create-codemodekit 0.4.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -2
- package/dist/agent-plugin.d.ts +3 -5
- package/dist/agent-plugin.d.ts.map +1 -1
- package/dist/agent-plugin.js +29 -25
- package/dist/agent-plugin.js.map +1 -1
- package/dist/catalog-files.d.ts +28 -0
- package/dist/catalog-files.d.ts.map +1 -0
- package/dist/catalog-files.js +193 -0
- package/dist/catalog-files.js.map +1 -0
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +139 -49
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/scaffold.d.ts +5 -1
- package/dist/scaffold.d.ts.map +1 -1
- package/dist/scaffold.js +115 -44
- package/dist/scaffold.js.map +1 -1
- package/dist/source-template.d.ts +12 -2
- package/dist/source-template.d.ts.map +1 -1
- package/dist/source-template.js +80 -13
- package/dist/source-template.js.map +1 -1
- package/dist/verify-template.d.ts +2 -0
- package/dist/verify-template.d.ts.map +1 -0
- package/dist/verify-template.js +113 -0
- package/dist/verify-template.js.map +1 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -34,6 +34,7 @@ npm create codemodekit@latest my-code-mode -- \
|
|
|
34
34
|
--mcp-command 'uvx my-mcp-server'
|
|
35
35
|
|
|
36
36
|
cd my-code-mode
|
|
37
|
+
npm run verify
|
|
37
38
|
npm start
|
|
38
39
|
```
|
|
39
40
|
|
|
@@ -41,7 +42,18 @@ The command is parsed directly into an executable and argument array. Shell oper
|
|
|
41
42
|
|
|
42
43
|
Generated servers use `--policy allow-all` by default so the project runs immediately. Use `--policy deny-all` when you want the generated server to start closed while you define a narrower tool policy.
|
|
43
44
|
|
|
44
|
-
Use `--mcp-url https://example.com/mcp` instead of `--mcp-command` for a Streamable HTTP source.
|
|
45
|
+
Use `--mcp-url https://example.com/mcp` instead of `--mcp-command` for a Streamable HTTP source. Add `--mcp-bearer-env MCP_TOKEN` or repeat `--mcp-header-env Header-Name=ENV_NAME` to assemble authentication headers from the host environment without writing credential values to source, manifests, or plugin artifacts.
|
|
46
|
+
|
|
47
|
+
Repeat a complete source group to combine MCPs in one generated catalog:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
npm create codemodekit@latest work-code-mode -- \
|
|
51
|
+
--mcp-name github --mcp-command 'docker run -i --rm ghcr.io/github/github-mcp-server' \
|
|
52
|
+
--mcp-name tickets --mcp-url https://tickets.example.com/mcp \
|
|
53
|
+
--mcp-bearer-env TICKETS_TOKEN
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Every scaffold includes `npm run verify`. It validates source discovery, the two-tool downstream surface, invalid calls, and sandbox isolation without calling provider tools. For a semantic live check, set `CODEMODEKIT_VERIFY_CODE_FILE` to a bounded TypeScript composition that returns `{ verified: true }`. The generated `.env.example` is documentation; export its variables with your preferred environment manager.
|
|
45
57
|
|
|
46
58
|
## Generate an Agent Plugin
|
|
47
59
|
|
|
@@ -54,7 +66,7 @@ npm create codemodekit@latest my-code-mode -- \
|
|
|
54
66
|
--agent-plugin
|
|
55
67
|
```
|
|
56
68
|
|
|
57
|
-
This adds root `plugin.json` and `mcp.json` files plus `skills/use-upstream-codemode/`. The generated companion skill is a mechanically correct runtime baseline
|
|
69
|
+
This adds root `plugin.json` and `mcp.json` files plus `skills/use-upstream-codemode/`. The generated companion skill is a mechanically correct runtime baseline. Catalog sync writes a complete `references/tools.d.ts`, one file per source, and bounded tool-prefix shards for large sources; `catalog-metadata.json` indexes the set. Use the installed `author-codemode-skill` to add domain triggers, real workflows, safety decisions, and type-correct compositions. After installation, the generator builds a self-contained `dist/plugin` artifact containing the server bundle, QuickJS WASM, manifests, and runtime skill.
|
|
58
70
|
|
|
59
71
|
The generator attempts catalog sync after dependency installation. If the upstream MCP still needs credentials or connectivity, the project remains valid with pending references. Configure the source and run:
|
|
60
72
|
|
package/dist/agent-plugin.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { type AgentPluginTypeScriptCatalog } from "./catalog-files.js";
|
|
2
|
+
export type { AgentPluginTypeScriptCatalog, AgentPluginTypeScriptCatalogShard, AgentPluginTypeScriptCatalogSource, } from "./catalog-files.js";
|
|
1
3
|
export interface AgentPluginCatalogSource {
|
|
2
4
|
start(signal?: AbortSignal): Promise<AgentPluginStartupReport>;
|
|
3
5
|
getTypeScriptCatalog(signal?: AbortSignal): Promise<AgentPluginTypeScriptCatalog>;
|
|
@@ -14,10 +16,6 @@ export interface AgentPluginSourceReport {
|
|
|
14
16
|
readonly message?: string;
|
|
15
17
|
readonly rejectedToolCount?: number;
|
|
16
18
|
}
|
|
17
|
-
export interface AgentPluginTypeScriptCatalog {
|
|
18
|
-
readonly catalogRevision: string;
|
|
19
|
-
readonly declarations: string;
|
|
20
|
-
}
|
|
21
19
|
export interface ScaffoldAgentPluginOptions {
|
|
22
20
|
readonly root: string;
|
|
23
21
|
readonly pluginName: string;
|
|
@@ -46,6 +44,7 @@ export interface SyncAgentPluginSkillResult {
|
|
|
46
44
|
readonly skillDirectory: string;
|
|
47
45
|
readonly catalogRevision: string;
|
|
48
46
|
readonly declarations: string;
|
|
47
|
+
readonly declarationFiles: readonly string[];
|
|
49
48
|
readonly metadata: string;
|
|
50
49
|
readonly sources: readonly AgentPluginSourceReport[];
|
|
51
50
|
}
|
|
@@ -67,5 +66,4 @@ interface RenderCompanionSkillOptions {
|
|
|
67
66
|
readonly serverName: string;
|
|
68
67
|
}
|
|
69
68
|
export declare function renderCompanionSkill(options: RenderCompanionSkillOptions): string;
|
|
70
|
-
export {};
|
|
71
69
|
//# sourceMappingURL=agent-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-plugin.d.ts","sourceRoot":"","sources":["../src/agent-plugin.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3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MAAM,CAAC;IAC3B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,MAAM,CAyBR"}
|
package/dist/agent-plugin.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { mkdir,
|
|
1
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
|
+
import { catalogDeclarationFiles, commitCatalogSnapshot, } from "./catalog-files.js";
|
|
3
4
|
const PLUGIN_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/plugin.schema.json";
|
|
4
5
|
const MCP_SCHEMA = "https://agent-plugins.org/schemas/1.0.0/mcp.schema.json";
|
|
5
6
|
const PORTABLE_NAME = /^[a-z0-9]+(?:-[a-z0-9]+)*$/u;
|
|
@@ -52,9 +53,13 @@ export async function scaffoldAgentPlugin(options) {
|
|
|
52
53
|
writeFile(path.join(referencesDirectory, "examples.md"), renderExamplesReference(), "utf8"),
|
|
53
54
|
writeFile(path.join(referencesDirectory, "tools.d.ts"), renderPendingDeclarations(), "utf8"),
|
|
54
55
|
writeJson(path.join(referencesDirectory, "catalog-metadata.json"), {
|
|
55
|
-
schemaVersion:
|
|
56
|
+
schemaVersion: 2,
|
|
56
57
|
status: "pending",
|
|
57
58
|
serverName,
|
|
59
|
+
declarations: [
|
|
60
|
+
{ path: "tools.d.ts", scope: "catalog", toolCount: 0 },
|
|
61
|
+
],
|
|
62
|
+
generatedFiles: ["tools.d.ts"],
|
|
58
63
|
message: "Run npm run plugin:sync after the upstream tool source is available.",
|
|
59
64
|
}),
|
|
60
65
|
]);
|
|
@@ -88,11 +93,12 @@ export async function syncAgentPluginSkill(options) {
|
|
|
88
93
|
const skillDirectory = path.join(root, "skills", skillName);
|
|
89
94
|
const referencesDirectory = path.join(skillDirectory, "references");
|
|
90
95
|
await mkdir(referencesDirectory, { recursive: true });
|
|
96
|
+
const declarationFiles = catalogDeclarationFiles(snapshot.catalog);
|
|
91
97
|
const declarationsPath = path.join(referencesDirectory, "tools.d.ts");
|
|
92
98
|
const metadataPath = path.join(referencesDirectory, "catalog-metadata.json");
|
|
93
|
-
const
|
|
99
|
+
const totalToolCount = snapshot.startup.sources.reduce((total, source) => total + source.toolCount, 0);
|
|
94
100
|
const metadata = {
|
|
95
|
-
schemaVersion:
|
|
101
|
+
schemaVersion: 2,
|
|
96
102
|
status: "ready",
|
|
97
103
|
serverName,
|
|
98
104
|
catalogRevision: snapshot.catalog.catalogRevision,
|
|
@@ -104,15 +110,24 @@ export async function syncAgentPluginSkill(options) {
|
|
|
104
110
|
? {}
|
|
105
111
|
: { rejectedToolCount: source.rejectedToolCount }),
|
|
106
112
|
})),
|
|
113
|
+
declarations: declarationFiles.map((file) => ({
|
|
114
|
+
path: file.path,
|
|
115
|
+
scope: file.scope,
|
|
116
|
+
toolCount: file.scope === "catalog" ? totalToolCount : file.toolCount,
|
|
117
|
+
...(file.source === undefined ? {} : { source: file.source }),
|
|
118
|
+
...(file.prefixes === undefined ? {} : { prefixes: file.prefixes }),
|
|
119
|
+
})),
|
|
120
|
+
generatedFiles: declarationFiles.map((file) => file.path),
|
|
107
121
|
};
|
|
108
|
-
await
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
]);
|
|
122
|
+
await commitCatalogSnapshot(referencesDirectory, new Map([
|
|
123
|
+
...declarationFiles.map((file) => [file.path, file.contents]),
|
|
124
|
+
["catalog-metadata.json", `${JSON.stringify(metadata, null, 2)}\n`],
|
|
125
|
+
]));
|
|
112
126
|
return {
|
|
113
127
|
skillDirectory,
|
|
114
128
|
catalogRevision: snapshot.catalog.catalogRevision,
|
|
115
129
|
declarations: declarationsPath,
|
|
130
|
+
declarationFiles: declarationFiles.map((file) => path.join(referencesDirectory, file.path)),
|
|
116
131
|
metadata: metadataPath,
|
|
117
132
|
sources: snapshot.startup.sources,
|
|
118
133
|
};
|
|
@@ -144,10 +159,10 @@ This generated baseline covers Code Mode mechanics and the live tool catalog. Ma
|
|
|
144
159
|
|
|
145
160
|
Use \`run_typescript\` as the primary interface to the tools wrapped by this server.
|
|
146
161
|
|
|
147
|
-
1.
|
|
162
|
+
1. Read [references/catalog-metadata.json](references/catalog-metadata.json) as the declaration-file index. Open the narrowest listed prefix or source shard that covers the request; use [references/tools.d.ts](references/tools.d.ts) only for cross-source work or when no narrower shard applies.
|
|
148
163
|
2. Put related calls, result extraction, filtering, and reshaping into one \`run_typescript\` execution.
|
|
149
|
-
3. Return only the bounded value needed to answer the user.
|
|
150
|
-
4. Use \`search_tools\` when the generated catalog is pending or stale, does not contain the needed capability, or the client cannot search
|
|
164
|
+
3. Return only the bounded value needed to answer the user. Project requested fields, omit empty metadata, cap collections, and summarize large result sets instead of returning raw upstream payloads.
|
|
165
|
+
4. Use \`search_tools\` when the generated catalog is pending or stale, does not contain the needed capability, or the available client cannot search declaration files efficiently.
|
|
151
166
|
5. Treat tool errors as data you can catch and handle; do not bypass tool policy or sandbox limits.
|
|
152
167
|
|
|
153
168
|
Read [references/runtime.md](references/runtime.md) for execution rules, [references/result-contract.md](references/result-contract.md) for MCP result extraction, and [references/examples.md](references/examples.md) for composition patterns.
|
|
@@ -163,9 +178,9 @@ The server exposes a small Code Mode surface:
|
|
|
163
178
|
|
|
164
179
|
The sandbox exposes \`tools\` and a limited set of safe JavaScript globals. It does not expose Node.js modules, filesystem APIs, process APIs, network APIs, dynamic imports, or arbitrary package imports.
|
|
165
180
|
|
|
166
|
-
Prefer one execution that calls, combines, and reduces upstream results. Use \`Promise.all\` only for independent operations.
|
|
181
|
+
Prefer one execution that calls, combines, and reduces upstream results. Use \`Promise.all\` only for independent operations. Project requested fields, remove null or empty metadata, cap collections to the smallest useful number of rows, and return counts or summaries for larger sets. Do not return raw upstream payloads.
|
|
167
182
|
|
|
168
|
-
The generated declaration snapshot is authoritative for its recorded catalog revision. If a call is missing or fails with \`TOOL_NOT_FOUND\`, use \`search_tools\` to inspect the live catalog and then refresh the snapshot with \`npm run plugin:sync\` when maintaining the plugin.
|
|
183
|
+
The generated declaration snapshot is authoritative for its recorded catalog revision. \`catalog-metadata.json\` indexes the complete catalog, per-source files, and bounded tool-prefix shards. Start with the narrowest applicable shard so unrelated declarations stay out of context. If a call is missing or fails with \`TOOL_NOT_FOUND\`, use \`search_tools\` to inspect the live catalog and then refresh the snapshot with \`npm run plugin:sync\` when maintaining the plugin.
|
|
169
184
|
`;
|
|
170
185
|
}
|
|
171
186
|
function renderResultContractReference() {
|
|
@@ -193,7 +208,7 @@ Tool failures throw a catchable \`ToolCallError\` with \`code\`, \`phase\`, and
|
|
|
193
208
|
function renderExamplesReference() {
|
|
194
209
|
return `# Composition examples
|
|
195
210
|
|
|
196
|
-
Replace the source, tool, and input names with declarations from \`
|
|
211
|
+
Replace the source, tool, and input names with declarations from the narrowest file indexed by \`catalog-metadata.json\`.
|
|
197
212
|
|
|
198
213
|
## Extract structured data
|
|
199
214
|
|
|
@@ -241,12 +256,6 @@ function renderPendingDeclarations() {
|
|
|
241
256
|
// Run: npm run plugin:sync
|
|
242
257
|
`;
|
|
243
258
|
}
|
|
244
|
-
function renderCatalogDeclarations(revision, declarations) {
|
|
245
|
-
return `// Generated by CodeModeKit from catalog revision ${revision}.
|
|
246
|
-
// Refresh with: npm run plugin:sync
|
|
247
|
-
|
|
248
|
-
${declarations.trim()}\n`;
|
|
249
|
-
}
|
|
250
259
|
async function stableCatalogSnapshot(codeMode, signal) {
|
|
251
260
|
for (let attempt = 0; attempt < 3; attempt += 1) {
|
|
252
261
|
const startup = await codeMode.start(signal);
|
|
@@ -260,11 +269,6 @@ async function stableCatalogSnapshot(codeMode, signal) {
|
|
|
260
269
|
async function writeJson(file, value) {
|
|
261
270
|
await writeFile(file, `${JSON.stringify(value, null, 2)}\n`, "utf8");
|
|
262
271
|
}
|
|
263
|
-
async function atomicWrite(file, contents) {
|
|
264
|
-
const temporary = `${file}.${String(process.pid)}.tmp`;
|
|
265
|
-
await writeFile(temporary, contents, "utf8");
|
|
266
|
-
await rename(temporary, file);
|
|
267
|
-
}
|
|
268
272
|
function validatePortableName(value, label) {
|
|
269
273
|
const name = required(value, label);
|
|
270
274
|
if (name.length > 64 || !PORTABLE_NAME.test(name)) {
|
package/dist/agent-plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent-plugin.js","sourceRoot":"","sources":["../src/agent-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"agent-plugin.js","sourceRoot":"","sources":["../src/agent-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,uBAAuB,EACvB,qBAAqB,GAEtB,MAAM,oBAAoB,CAAC;AAQ5B,MAAM,aAAa,GACjB,4DAA4D,CAAC;AAC/D,MAAM,UAAU,GACd,yDAAyD,CAAC;AAC5D,MAAM,aAAa,GAAG,6BAA6B,CAAC;AAyDpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAmC;IAEnC,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,MAAM,UAAU,GAAG,oBAAoB,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC3E,MAAM,SAAS,GAAG,oBAAoB,CAAC,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;IACxE,MAAM,UAAU,GAAG,QAAQ,CAAC,OAAO,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC;IAC/D,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,OAAO,IAAI,OAAO,EAAE,gBAAgB,CAAC,CAAC;IACvE,MAAM,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,gBAAgB,CAAC;IAC1D,0BAA0B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;AACvE,CAAC;AAED,SAAS,oBAAoB,CAAC,KAAa,EAAE,KAAa;IACxD,MAAM,IAAI,GAAG,QAAQ,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACpC,IAAI,IAAI,CAAC,MAAM,GAAG,EAAE,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,SAAS,CACjB,GAAG,KAAK,wEAAwE,CACjF,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,0BAA0B,CAAC,KAAa,EAAE,KAAa;IAC9D,IACE,KAAK,KAAK,EAAE;QACZ,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC;QACtB,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,KAAK,IAAI,CAAC,EACzD,CAAC;QACD,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,mCAAmC,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,SAAS,QAAQ,CAAC,KAAa,EAAE,KAAa;IAC5C,IAAI,KAAK,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACxB,MAAM,IAAI,SAAS,CAAC,GAAG,KAAK,oBAAoB,CAAC,CAAC;IACpD,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export interface AgentPluginTypeScriptCatalog {
|
|
2
|
+
readonly catalogRevision: string;
|
|
3
|
+
readonly declarations: string;
|
|
4
|
+
readonly sources?: readonly AgentPluginTypeScriptCatalogSource[];
|
|
5
|
+
}
|
|
6
|
+
export interface AgentPluginTypeScriptCatalogSource {
|
|
7
|
+
readonly source: string;
|
|
8
|
+
readonly toolCount: number;
|
|
9
|
+
readonly declarations: string;
|
|
10
|
+
readonly shards: readonly AgentPluginTypeScriptCatalogShard[];
|
|
11
|
+
}
|
|
12
|
+
export interface AgentPluginTypeScriptCatalogShard {
|
|
13
|
+
readonly key: string;
|
|
14
|
+
readonly prefixes: readonly string[];
|
|
15
|
+
readonly toolCount: number;
|
|
16
|
+
readonly declarations: string;
|
|
17
|
+
}
|
|
18
|
+
export interface CatalogDeclarationFile {
|
|
19
|
+
readonly path: string;
|
|
20
|
+
readonly scope: "catalog" | "source" | "prefix";
|
|
21
|
+
readonly source?: string;
|
|
22
|
+
readonly prefixes?: readonly string[];
|
|
23
|
+
readonly toolCount: number;
|
|
24
|
+
readonly contents: string;
|
|
25
|
+
}
|
|
26
|
+
export declare function catalogDeclarationFiles(catalog: AgentPluginTypeScriptCatalog): readonly CatalogDeclarationFile[];
|
|
27
|
+
export declare function commitCatalogSnapshot(referencesDirectory: string, files: ReadonlyMap<string, string>): Promise<void>;
|
|
28
|
+
//# sourceMappingURL=catalog-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"catalog-files.d.ts","sourceRoot":"","sources":["../src/catalog-files.ts"],"names":[],"mappings":"AAYA,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,kCAAkC,EAAE,CAAC;CAClE;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,MAAM,EAAE,SAAS,iCAAiC,EAAE,CAAC;CAC/D;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,CAAC;IACrC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;CAC/B;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAC;IAChD,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,4BAA4B,GACpC,SAAS,sBAAsB,EAAE,CA0DnC;AAED,wBAAsB,qBAAqB,CACzC,mBAAmB,EAAE,MAAM,EAC3B,KAAK,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACjC,OAAO,CAAC,IAAI,CAAC,CAoEf"}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { access, mkdir, readdir, readFile, rename, rm, writeFile, } from "node:fs/promises";
|
|
3
|
+
import path from "node:path";
|
|
4
|
+
export function catalogDeclarationFiles(catalog) {
|
|
5
|
+
const files = [
|
|
6
|
+
{
|
|
7
|
+
path: "tools.d.ts",
|
|
8
|
+
scope: "catalog",
|
|
9
|
+
toolCount: catalog.sources?.reduce((total, source) => total + source.toolCount, 0) ?? 0,
|
|
10
|
+
contents: renderCatalogDeclarations(catalog.catalogRevision, catalog.declarations),
|
|
11
|
+
},
|
|
12
|
+
];
|
|
13
|
+
const usedPaths = new Map([["tools.d.ts", "catalog"]]);
|
|
14
|
+
const sourceSegments = collisionSafeSegments((catalog.sources ?? []).map((source) => source.source));
|
|
15
|
+
for (const source of catalog.sources ?? []) {
|
|
16
|
+
const sourceSegment = sourceSegments.get(source.source) ?? safeFilenameSegment(source.source);
|
|
17
|
+
files.push({
|
|
18
|
+
path: allocateDeclarationPath([sourceSegment], `source:${source.source}`, usedPaths),
|
|
19
|
+
scope: "source",
|
|
20
|
+
source: source.source,
|
|
21
|
+
toolCount: source.toolCount,
|
|
22
|
+
contents: renderCatalogDeclarations(catalog.catalogRevision, source.declarations),
|
|
23
|
+
});
|
|
24
|
+
for (const shard of source.shards) {
|
|
25
|
+
const identity = `prefix:${source.source}:${shard.key}:` + shard.prefixes.join("\u0000");
|
|
26
|
+
files.push({
|
|
27
|
+
path: allocateDeclarationPath([sourceSegment, safeFilenameSegment(shard.key)], identity, usedPaths),
|
|
28
|
+
scope: "prefix",
|
|
29
|
+
source: source.source,
|
|
30
|
+
prefixes: shard.prefixes,
|
|
31
|
+
toolCount: shard.toolCount,
|
|
32
|
+
contents: renderCatalogDeclarations(catalog.catalogRevision, shard.declarations),
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return files;
|
|
37
|
+
}
|
|
38
|
+
export async function commitCatalogSnapshot(referencesDirectory, files) {
|
|
39
|
+
const transaction = path.join(referencesDirectory, `.codemodekit-sync-${String(process.pid)}-${randomUUID()}`);
|
|
40
|
+
const incoming = path.join(transaction, "incoming");
|
|
41
|
+
const backup = path.join(transaction, "backup");
|
|
42
|
+
const incomingNames = [...files.keys()];
|
|
43
|
+
for (const name of incomingNames) {
|
|
44
|
+
validateGeneratedFilename(name);
|
|
45
|
+
}
|
|
46
|
+
await Promise.all([
|
|
47
|
+
mkdir(incoming, { recursive: true }),
|
|
48
|
+
mkdir(backup, { recursive: true }),
|
|
49
|
+
]);
|
|
50
|
+
try {
|
|
51
|
+
await Promise.all([...files].map(([name, contents]) => writeFile(path.join(incoming, name), contents, "utf8")));
|
|
52
|
+
const existingNames = await ownedCatalogFiles(referencesDirectory);
|
|
53
|
+
const backedUp = [];
|
|
54
|
+
const committed = [];
|
|
55
|
+
try {
|
|
56
|
+
for (const name of existingNames) {
|
|
57
|
+
if (await fileExists(path.join(referencesDirectory, name))) {
|
|
58
|
+
await rename(path.join(referencesDirectory, name), path.join(backup, name));
|
|
59
|
+
backedUp.push(name);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
const commitOrder = incomingNames
|
|
63
|
+
.filter((name) => name !== "catalog-metadata.json")
|
|
64
|
+
.concat(incomingNames.includes("catalog-metadata.json")
|
|
65
|
+
? ["catalog-metadata.json"]
|
|
66
|
+
: []);
|
|
67
|
+
for (const name of commitOrder) {
|
|
68
|
+
await rename(path.join(incoming, name), path.join(referencesDirectory, name));
|
|
69
|
+
committed.push(name);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (error) {
|
|
73
|
+
await Promise.allSettled(committed.map((name) => rm(path.join(referencesDirectory, name), { force: true })));
|
|
74
|
+
for (const name of backedUp) {
|
|
75
|
+
await rename(path.join(backup, name), path.join(referencesDirectory, name));
|
|
76
|
+
}
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
finally {
|
|
81
|
+
await rm(transaction, { recursive: true, force: true });
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
function collisionSafeSegments(values) {
|
|
85
|
+
const byBase = new Map();
|
|
86
|
+
for (const value of values) {
|
|
87
|
+
const base = safeFilenameSegment(value);
|
|
88
|
+
byBase.set(base, [...(byBase.get(base) ?? []), value]);
|
|
89
|
+
}
|
|
90
|
+
const result = new Map();
|
|
91
|
+
for (const [base, collisions] of byBase) {
|
|
92
|
+
for (const value of collisions) {
|
|
93
|
+
result.set(value, collisions.length === 1 ? base : `${base}-${shortHash(value)}`);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return result;
|
|
97
|
+
}
|
|
98
|
+
function allocateDeclarationPath(segments, identity, used) {
|
|
99
|
+
const base = `tools.${segments.join(".")}.d.ts`;
|
|
100
|
+
const existing = used.get(base);
|
|
101
|
+
if (existing === undefined || existing === identity) {
|
|
102
|
+
used.set(base, identity);
|
|
103
|
+
return base;
|
|
104
|
+
}
|
|
105
|
+
const stem = `tools.${segments.join(".")}-${shortHash(identity)}`;
|
|
106
|
+
let attempt = 1;
|
|
107
|
+
while (true) {
|
|
108
|
+
const candidate = `${stem}${attempt === 1 ? "" : `-${String(attempt)}`}.d.ts`;
|
|
109
|
+
const collision = used.get(candidate);
|
|
110
|
+
if (collision === undefined || collision === identity) {
|
|
111
|
+
used.set(candidate, identity);
|
|
112
|
+
return candidate;
|
|
113
|
+
}
|
|
114
|
+
attempt += 1;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
function safeFilenameSegment(value) {
|
|
118
|
+
const normalized = value
|
|
119
|
+
.normalize("NFKD")
|
|
120
|
+
.replace(/[\u0300-\u036f]/gu, "")
|
|
121
|
+
.toLowerCase()
|
|
122
|
+
.replace(/[^a-z0-9]+/gu, "-")
|
|
123
|
+
.replace(/-+/gu, "-")
|
|
124
|
+
.replace(/^-|-$/gu, "");
|
|
125
|
+
if (normalized === "") {
|
|
126
|
+
return `item-${shortHash(value)}`;
|
|
127
|
+
}
|
|
128
|
+
if (normalized.length <= 48) {
|
|
129
|
+
return normalized;
|
|
130
|
+
}
|
|
131
|
+
return `${normalized.slice(0, 39).replace(/-$/u, "")}-${shortHash(value)}`;
|
|
132
|
+
}
|
|
133
|
+
function shortHash(value) {
|
|
134
|
+
return createHash("sha256").update(value).digest("hex").slice(0, 8);
|
|
135
|
+
}
|
|
136
|
+
function renderCatalogDeclarations(revision, declarations) {
|
|
137
|
+
return `// Generated by CodeModeKit from catalog revision ${revision}.
|
|
138
|
+
// Refresh with: npm run plugin:sync
|
|
139
|
+
|
|
140
|
+
${declarations.trim()}\n`;
|
|
141
|
+
}
|
|
142
|
+
async function ownedCatalogFiles(referencesDirectory) {
|
|
143
|
+
const owned = new Set(["tools.d.ts", "catalog-metadata.json"]);
|
|
144
|
+
const metadataPath = path.join(referencesDirectory, "catalog-metadata.json");
|
|
145
|
+
try {
|
|
146
|
+
const metadata = JSON.parse(await readFile(metadataPath, "utf8"));
|
|
147
|
+
if (Array.isArray(metadata.generatedFiles)) {
|
|
148
|
+
for (const name of metadata.generatedFiles) {
|
|
149
|
+
if (typeof name === "string" && isGeneratedFilename(name)) {
|
|
150
|
+
owned.add(name);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
catch {
|
|
156
|
+
// Legacy metadata is recovered by inspecting generated declaration headers.
|
|
157
|
+
}
|
|
158
|
+
try {
|
|
159
|
+
const entries = await readdir(referencesDirectory, { withFileTypes: true });
|
|
160
|
+
await Promise.all(entries.map(async (entry) => {
|
|
161
|
+
if (!entry.isFile() || !isGeneratedFilename(entry.name))
|
|
162
|
+
return;
|
|
163
|
+
const contents = await readFile(path.join(referencesDirectory, entry.name), "utf8");
|
|
164
|
+
if (contents.startsWith("// Generated by CodeModeKit") ||
|
|
165
|
+
contents.startsWith("// CodeModeKit catalog snapshot pending")) {
|
|
166
|
+
owned.add(entry.name);
|
|
167
|
+
}
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// The caller creates this directory; absence means there is no prior snapshot.
|
|
172
|
+
}
|
|
173
|
+
return [...owned].sort();
|
|
174
|
+
}
|
|
175
|
+
function validateGeneratedFilename(name) {
|
|
176
|
+
if (!isGeneratedFilename(name) && name !== "catalog-metadata.json") {
|
|
177
|
+
throw new TypeError(`Invalid generated catalog filename: ${name}`);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
function isGeneratedFilename(name) {
|
|
181
|
+
return (path.basename(name) === name &&
|
|
182
|
+
/^tools(?:\.[a-z0-9-]+)*\.d\.ts$/u.test(name));
|
|
183
|
+
}
|
|
184
|
+
async function fileExists(file) {
|
|
185
|
+
try {
|
|
186
|
+
await access(file);
|
|
187
|
+
return true;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
return false;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMapp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F,IACE,QAAQ,CAAC,UAAU,CAAC,6BAA6B,CAAC;gBAClD,QAAQ,CAAC,UAAU,CAAC,yCAAyC,CAAC,EAC9D,CAAC;gBACD,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC;QACH,CAAC,CAAC,CACH,CAAC;IACJ,CAAC;IAAC,MAAM,CAAC;QACP,+EAA+E;IACjF,CAAC;IACD,OAAO,CAAC,GAAG,KAAK,CAAC,CAAC,IAAI,EAAE,CAAC;AAC3B,CAAC;AAED,SAAS,yBAAyB,CAAC,IAAY;IAC7C,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAC,IAAI,IAAI,KAAK,uBAAuB,EAAE,CAAC;QACnE,MAAM,IAAI,SAAS,CAAC,uCAAuC,IAAI,EAAE,CAAC,CAAC;IACrE,CAAC;AACH,CAAC;AAED,SAAS,mBAAmB,CAAC,IAAY;IACvC,OAAO,CACL,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAK,IAAI;QAC5B,kCAAkC,CAAC,IAAI,CAAC,IAAI,CAAC,CAC9C,CAAC;AACJ,CAAC;AAED,KAAK,UAAU,UAAU,CAAC,IAAY;IACpC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,IAAI,CAAC,CAAC;QACnB,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/dist/cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAoDA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC/D,MAAM,CAAC,CAAC,SAAS,MAAM,EACrB,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,SAAS;QAAE,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAA;KAAE,EAAE,EACjE,YAAY,EAAE,CAAC,GACd,OAAO,CAAC,CAAC,CAAC,CAAC;IACd,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAClE,KAAK,CAAC,IAAI,IAAI,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,CAAC,EAAE,WAAW,CAAC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,GAAE,aAAkB,GAC1B,OAAO,CAAC,IAAI,CAAC,CAgFf"}
|