refactor(core,packaging): relocate embedded assets and binary runtime to src/packaging and enforce core whitelist

This commit is contained in:
gitea committed 2026-09-30 00:29:20 +08:00
1 parent 3864f0ffd0
commit 27c86e052a
10 files changed
+20 -5

No files matched your search

+15
View File
@@ -113,4 +113,19 @@ describe("Architecture Layering Boundaries", () => {
expect(violations).toEqual([]);
});
test("src/core/ must only contain whitelisted infrastructure modules", () => {
const allowedTopLevel = new Set([
"README.core.md",
"auth",
"cache",
"config",
"db",
"errors.ts",
"http",
]);
const entries = readdirSync(join(SRC_ROOT, "core"));
const unexpected = entries.filter((entry) => !allowedTopLevel.has(entry));
expect(unexpected).toEqual([]);
});
});
+1 -1
View File
@@ -1,4 +1,4 @@
import { getOpenApiSchema, listOpenApiPaths, type OpenApiType } from "../../core/embedded-openapi.js";
import { getOpenApiSchema, listOpenApiPaths, type OpenApiType } from "../../packaging/embedded-openapi.js";
import { booleanOption, stringOption } from "../parser.js";
import { printJson, printKeyValue, printTable } from "../printer.js";
import type { CliParsedArgs, CliResult, CliRuntime } from "../types.js";
+1 -1
View File
@@ -5,7 +5,7 @@ import {
getDefaultGlobalSkillDir,
getSkillContent,
installSkillFiles,
} from "../../core/embedded-skill.js";
} from "../../packaging/embedded-skill.js";
import { booleanOption, stringOption } from "../parser.js";
import { printJson, printKeyValue } from "../printer.js";
import { isDryRun, mutationPreview, requireMutationConfirmation } from "../mutation.js";
+2 -2
View File
@@ -1,8 +1,8 @@
import { chmodSync, existsSync, mkdirSync, renameSync, rmSync, symlinkSync, unlinkSync, writeFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { spawnSync } from "node:child_process";
import { isCompiledBinary, resolveAppRoot } from "../../core/runtime.js";
import { syncGlobalSkillIfPresent } from "../../core/embedded-skill.js";
import { isCompiledBinary, resolveAppRoot } from "../../packaging/runtime.js";
import { syncGlobalSkillIfPresent } from "../../packaging/embedded-skill.js";
import { loadGlobalConfig } from "../../core/config/loader.js";
import { VERSION } from "../../version.js";
import { booleanOption, numberOption, stringOption } from "../parser.js";