@cotal-ai/cli 0.11.2 → 0.11.4
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/dist/command.d.ts.map +1 -1
- package/dist/command.js +58 -0
- package/dist/command.js.map +1 -1
- package/dist/commands/ext.d.ts +6 -0
- package/dist/commands/ext.d.ts.map +1 -1
- package/dist/commands/ext.js +50 -47
- package/dist/commands/ext.js.map +1 -1
- package/dist/commands/models.d.ts.map +1 -1
- package/dist/commands/models.js +3 -2
- package/dist/commands/models.js.map +1 -1
- package/dist/commands/runtimes.d.ts +9 -0
- package/dist/commands/runtimes.d.ts.map +1 -0
- package/dist/commands/runtimes.js +52 -0
- package/dist/commands/runtimes.js.map +1 -0
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +24 -7
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/spawn-manifest.js +1 -1
- package/dist/commands/spawn-manifest.js.map +1 -1
- package/dist/commands/spawn.d.ts +7 -1
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +11 -0
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/up.d.ts +10 -1
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +66 -10
- package/dist/commands/up.js.map +1 -1
- package/dist/ext-loader.d.ts +12 -1
- package/dist/ext-loader.d.ts.map +1 -1
- package/dist/ext-loader.js +36 -62
- package/dist/ext-loader.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +20 -18
- package/dist/index.js.map +1 -1
- package/dist/lib/auth-proc.d.ts.map +1 -1
- package/dist/lib/auth-proc.js +3 -0
- package/dist/lib/auth-proc.js.map +1 -1
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +3 -1
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/ext-mutation.d.ts +17 -0
- package/dist/lib/ext-mutation.d.ts.map +1 -0
- package/dist/lib/ext-mutation.js +23 -0
- package/dist/lib/ext-mutation.js.map +1 -0
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +3 -1
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/apply.d.ts +4 -3
- package/dist/lib/manifest/apply.d.ts.map +1 -1
- package/dist/lib/manifest/apply.js +9 -7
- package/dist/lib/manifest/apply.js.map +1 -1
- package/dist/lib/up-report.d.ts +9 -0
- package/dist/lib/up-report.d.ts.map +1 -0
- package/dist/lib/up-report.js +12 -0
- package/dist/lib/up-report.js.map +1 -0
- package/dist/seed/authority.d.ts +54 -0
- package/dist/seed/authority.d.ts.map +1 -0
- package/dist/seed/authority.js +94 -0
- package/dist/seed/authority.js.map +1 -0
- package/dist/seed/lock.d.ts +109 -0
- package/dist/seed/lock.d.ts.map +1 -0
- package/dist/seed/lock.js +168 -0
- package/dist/seed/lock.js.map +1 -0
- package/dist/seed/paths.d.ts +66 -0
- package/dist/seed/paths.d.ts.map +1 -0
- package/dist/seed/paths.js +149 -0
- package/dist/seed/paths.js.map +1 -0
- package/dist/seed/reconcile.d.ts +16 -0
- package/dist/seed/reconcile.d.ts.map +1 -0
- package/dist/seed/reconcile.js +431 -0
- package/dist/seed/reconcile.js.map +1 -0
- package/dist/seed/store.d.ts +18 -0
- package/dist/seed/store.d.ts.map +1 -0
- package/dist/seed/store.js +58 -0
- package/dist/seed/store.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stage a built-in connector's shipped payload into `store/<generation>/<name>` and return that
|
|
3
|
+
* stable path (the spec `ext add` installs from). Idempotent: an intact prior copy is reused unless
|
|
4
|
+
* `force` re-materializes it (a `--force`/`--reset` repair). The copy is staged into a sibling temp
|
|
5
|
+
* dir and renamed into place, so a crash mid-copy never leaves a half-written payload at the final
|
|
6
|
+
* path for a later run to `ext add` from.
|
|
7
|
+
*/
|
|
8
|
+
export declare function stageSeedPayload(generation: string, name: string, opts?: {
|
|
9
|
+
force?: boolean;
|
|
10
|
+
}): string;
|
|
11
|
+
/**
|
|
12
|
+
* GC seed-store generations other than `keepGeneration`, but ONLY those no live manifest entry still
|
|
13
|
+
* installs from (its normalized `file:` spec points under the generation dir). This is the commit
|
|
14
|
+
* predicate: a prior generation is removed only after every seeded entry has been re-added from the
|
|
15
|
+
* new one, so a running manager never loses the bytes its connectors resolve.
|
|
16
|
+
*/
|
|
17
|
+
export declare function gcSeedStore(keepGeneration: string, referencedSpecs: readonly string[]): void;
|
|
18
|
+
//# sourceMappingURL=store.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.d.ts","sourceRoot":"","sources":["../../src/seed/store.ts"],"names":[],"mappings":"AAqBA;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,MAAM,CAWzG;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,cAAc,EAAE,MAAM,EAAE,eAAe,EAAE,SAAS,MAAM,EAAE,GAAG,IAAI,CAS5F"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { cpSync, existsSync, mkdirSync, readdirSync, renameSync, rmSync } from "node:fs";
|
|
2
|
+
import { dirname, join, relative, sep } from "node:path";
|
|
3
|
+
import { seedStoreDir, seedStorePath, shippedSourceDir } from "./paths.js";
|
|
4
|
+
/**
|
|
5
|
+
* The durable seed store: a stable, per-generation copy of each shipped connector payload that
|
|
6
|
+
* `ext add --install-links` can normalize a `file:` dep against (a volatile `npx` source would later
|
|
7
|
+
* fail to reify). One directory per generation keeps an in-flight refresh from clobbering the bytes a
|
|
8
|
+
* running manager's connectors still resolve; the old generation is GC'd only once nothing references
|
|
9
|
+
* it.
|
|
10
|
+
*/
|
|
11
|
+
/** Everything except a nested `node_modules` (npm resolves deps fresh; peers are junction-linked by
|
|
12
|
+
* the `ext add` path) and VCS metadata. The exclusion is RELATIVE to the payload root — a published
|
|
13
|
+
* connector lives UNDER `.../node_modules/cotal-ai/seeded-connectors/<name>`, so matching
|
|
14
|
+
* `node_modules` anywhere in the absolute path would reject the root itself and copy nothing. */
|
|
15
|
+
function payloadFilter(root, from) {
|
|
16
|
+
const segments = relative(root, from).split(sep);
|
|
17
|
+
return !segments.includes("node_modules") && !segments.includes(".git");
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Stage a built-in connector's shipped payload into `store/<generation>/<name>` and return that
|
|
21
|
+
* stable path (the spec `ext add` installs from). Idempotent: an intact prior copy is reused unless
|
|
22
|
+
* `force` re-materializes it (a `--force`/`--reset` repair). The copy is staged into a sibling temp
|
|
23
|
+
* dir and renamed into place, so a crash mid-copy never leaves a half-written payload at the final
|
|
24
|
+
* path for a later run to `ext add` from.
|
|
25
|
+
*/
|
|
26
|
+
export function stageSeedPayload(generation, name, opts = {}) {
|
|
27
|
+
const dest = seedStorePath(generation, name);
|
|
28
|
+
if (!opts.force && existsSync(join(dest, "package.json")))
|
|
29
|
+
return dest;
|
|
30
|
+
const src = shippedSourceDir(name);
|
|
31
|
+
const staging = `${dest}.staging`;
|
|
32
|
+
rmSync(staging, { recursive: true, force: true });
|
|
33
|
+
rmSync(dest, { recursive: true, force: true });
|
|
34
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
35
|
+
cpSync(src, staging, { recursive: true, filter: (from) => payloadFilter(src, from) });
|
|
36
|
+
renameSync(staging, dest); // atomic within the store: the final path only ever holds a complete payload
|
|
37
|
+
return dest;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* GC seed-store generations other than `keepGeneration`, but ONLY those no live manifest entry still
|
|
41
|
+
* installs from (its normalized `file:` spec points under the generation dir). This is the commit
|
|
42
|
+
* predicate: a prior generation is removed only after every seeded entry has been re-added from the
|
|
43
|
+
* new one, so a running manager never loses the bytes its connectors resolve.
|
|
44
|
+
*/
|
|
45
|
+
export function gcSeedStore(keepGeneration, referencedSpecs) {
|
|
46
|
+
const root = seedStoreDir();
|
|
47
|
+
if (!existsSync(root))
|
|
48
|
+
return;
|
|
49
|
+
for (const gen of readdirSync(root)) {
|
|
50
|
+
if (gen === keepGeneration)
|
|
51
|
+
continue;
|
|
52
|
+
const genDir = join(root, gen);
|
|
53
|
+
const referenced = referencedSpecs.some((spec) => spec === genDir || spec.startsWith(genDir + sep));
|
|
54
|
+
if (!referenced)
|
|
55
|
+
rmSync(genDir, { recursive: true, force: true });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=store.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"store.js","sourceRoot":"","sources":["../../src/seed/store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzF,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE3E;;;;;;GAMG;AAEH;;;kGAGkG;AAClG,SAAS,aAAa,CAAC,IAAY,EAAE,IAAY;IAC/C,MAAM,QAAQ,GAAG,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjD,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;AAC1E,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,gBAAgB,CAAC,UAAkB,EAAE,IAAY,EAAE,OAA4B,EAAE;IAC/F,MAAM,IAAI,GAAG,aAAa,CAAC,UAAU,EAAE,IAAI,C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AI,CAAC,UAAU,CAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC;QACpG,IAAI,CAAC,UAAU;YAAE,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/cli",
|
|
3
3
|
"description": "Cotal mesh CLI: up, join, watch, console, spawn, mint, channels, history, ext.",
|
|
4
|
-
"version": "0.11.
|
|
4
|
+
"version": "0.11.4",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -24,8 +24,8 @@
|
|
|
24
24
|
"yaml": "^2.9.0",
|
|
25
25
|
"zod": "^4.4.3",
|
|
26
26
|
"ws": "^8.21.0",
|
|
27
|
-
"@cotal-ai/
|
|
28
|
-
"@cotal-ai/
|
|
27
|
+
"@cotal-ai/core": "0.11.4",
|
|
28
|
+
"@cotal-ai/workspace": "0.11.4"
|
|
29
29
|
},
|
|
30
30
|
"optionalDependencies": {
|
|
31
31
|
"@eplightning/nats-server-darwin-arm64": "^2.14.0",
|