@cotal-ai/cli 0.9.1 → 0.10.1
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 +12 -3
- package/dist/command.d.ts.map +1 -1
- package/dist/command.js +58 -11
- package/dist/command.js.map +1 -1
- package/dist/commands/agents.d.ts +64 -0
- package/dist/commands/agents.d.ts.map +1 -0
- package/dist/commands/agents.js +83 -0
- package/dist/commands/agents.js.map +1 -0
- package/dist/commands/channels.d.ts +2 -1
- package/dist/commands/channels.d.ts.map +1 -1
- package/dist/commands/channels.js +3 -16
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/completion.d.ts +6 -5
- package/dist/commands/completion.d.ts.map +1 -1
- package/dist/commands/completion.js +37 -14
- package/dist/commands/completion.js.map +1 -1
- package/dist/commands/console.d.ts +2 -1
- package/dist/commands/console.d.ts.map +1 -1
- package/dist/commands/console.js +2 -12
- package/dist/commands/console.js.map +1 -1
- package/dist/commands/down.d.ts +3 -2
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +42 -16
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/ext.d.ts +18 -0
- package/dist/commands/ext.d.ts.map +1 -0
- package/dist/commands/ext.js +220 -0
- package/dist/commands/ext.js.map +1 -0
- package/dist/commands/feedback.d.ts +2 -2
- package/dist/commands/feedback.d.ts.map +1 -1
- package/dist/commands/feedback.js +4 -283
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/history.d.ts +2 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +3 -13
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.d.ts +2 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +2 -18
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes.d.ts +2 -1
- package/dist/commands/meshes.d.ts.map +1 -1
- package/dist/commands/meshes.js +1 -1
- package/dist/commands/meshes.js.map +1 -1
- package/dist/commands/mint.d.ts +2 -1
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +3 -14
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/models.d.ts +29 -0
- package/dist/commands/models.d.ts.map +1 -0
- package/dist/commands/models.js +54 -0
- package/dist/commands/models.js.map +1 -0
- package/dist/commands/personas.d.ts +2 -2
- package/dist/commands/personas.d.ts.map +1 -1
- package/dist/commands/personas.js +23 -20
- package/dist/commands/personas.js.map +1 -1
- package/dist/commands/send.d.ts +2 -2
- package/dist/commands/send.d.ts.map +1 -1
- package/dist/commands/send.js +21 -24
- package/dist/commands/send.js.map +1 -1
- package/dist/commands/setup.d.ts +30 -8
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +151 -316
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/spawn.d.ts +122 -2
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +156 -49
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/status.d.ts +15 -0
- package/dist/commands/status.d.ts.map +1 -0
- package/dist/commands/status.js +172 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/topology.d.ts +2 -1
- package/dist/commands/topology.d.ts.map +1 -1
- package/dist/commands/topology.js +4 -8
- package/dist/commands/topology.js.map +1 -1
- package/dist/commands/up.d.ts +9 -4
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +96 -56
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/use.d.ts +2 -2
- package/dist/commands/use.d.ts.map +1 -1
- package/dist/commands/use.js +2 -2
- package/dist/commands/use.js.map +1 -1
- package/dist/ext-loader.d.ts +13 -0
- package/dist/ext-loader.d.ts.map +1 -0
- package/dist/ext-loader.js +121 -0
- package/dist/ext-loader.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +219 -67
- package/dist/index.js.map +1 -1
- package/dist/lib/attach-client.d.ts +20 -0
- package/dist/lib/attach-client.d.ts.map +1 -0
- package/dist/lib/attach-client.js +218 -0
- package/dist/lib/attach-client.js.map +1 -0
- package/dist/lib/completion.d.ts +8 -0
- package/dist/lib/completion.d.ts.map +1 -0
- package/dist/lib/completion.js +66 -0
- package/dist/lib/completion.js.map +1 -0
- package/dist/lib/connect.d.ts +1 -73
- package/dist/lib/connect.d.ts.map +1 -1
- package/dist/lib/connect.js +4 -90
- package/dist/lib/connect.js.map +1 -1
- package/dist/lib/control.d.ts +34 -0
- package/dist/lib/control.d.ts.map +1 -0
- package/dist/lib/control.js +65 -0
- package/dist/lib/control.js.map +1 -0
- package/dist/lib/delivery-proc.d.ts +2 -0
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.d.ts +5 -13
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +3 -42
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/apply.d.ts.map +1 -1
- package/dist/lib/manifest/apply.js +5 -0
- package/dist/lib/manifest/apply.js.map +1 -1
- package/dist/lib/manifest/live.d.ts.map +1 -1
- package/dist/lib/manifest/live.js +4 -1
- package/dist/lib/manifest/live.js.map +1 -1
- package/dist/lib/manifest/model.d.ts +2 -0
- package/dist/lib/manifest/model.d.ts.map +1 -1
- package/dist/lib/manifest/prepare.d.ts +2 -1
- package/dist/lib/manifest/prepare.d.ts.map +1 -1
- package/dist/lib/manifest/prepare.js +3 -1
- package/dist/lib/manifest/prepare.js.map +1 -1
- package/dist/lib/manifest/resolve.js +1 -0
- package/dist/lib/manifest/resolve.js.map +1 -1
- package/dist/lib/manifest/schema.d.ts +2 -0
- package/dist/lib/manifest/schema.d.ts.map +1 -1
- package/dist/lib/manifest/schema.js +3 -2
- package/dist/lib/manifest/schema.js.map +1 -1
- package/dist/lib/self-exec.d.ts +7 -2
- package/dist/lib/self-exec.d.ts.map +1 -1
- package/dist/lib/self-exec.js +14 -3
- package/dist/lib/self-exec.js.map +1 -1
- package/dist/lib/status.d.ts +8 -4
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +42 -9
- package/dist/lib/status.js.map +1 -1
- package/dist/ui.d.ts +1 -12
- package/dist/ui.d.ts.map +1 -1
- package/dist/ui.js +4 -12
- package/dist/ui.js.map +1 -1
- package/package.json +8 -6
- package/dist/commands/demo.d.ts +0 -2
- package/dist/commands/demo.d.ts.map +0 -1
- package/dist/commands/demo.js +0 -163
- package/dist/commands/demo.js.map +0 -1
- package/dist/commands/web.d.ts +0 -32
- package/dist/commands/web.d.ts.map +0 -1
- package/dist/commands/web.js +0 -307
- package/dist/commands/web.js.map +0 -1
- package/dist/web/app.js +0 -823
- package/dist/web/graph.html +0 -207
- package/dist/web/graph.js +0 -528
- package/dist/web/index.html +0 -350
package/dist/commands/down.js
CHANGED
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import {} from "@cotal-ai/core";
|
|
3
3
|
import { clearCurrent, getCurrent, removeMesh } from "@cotal-ai/workspace";
|
|
4
4
|
import { c } from "../ui.js";
|
|
5
5
|
import { cotalPath } from "../lib/paths.js";
|
|
6
6
|
import { resolveSpace } from "../lib/status.js";
|
|
7
7
|
import { downManifest } from "./down-manifest.js";
|
|
8
|
-
/** Stop the background processes started by `cotal up --detach
|
|
8
|
+
/** Stop the background processes started by `cotal up --detach`: the manager, the
|
|
9
9
|
* delivery daemon, the web dashboard, and the mesh. With `-f <cotal.yaml>` (or `--run <id>`) it does
|
|
10
10
|
* an ownership-scoped teardown of a `spawn -f` deploy instead — removing ONLY what that run created
|
|
11
11
|
* (its agents + the channels it added), from the ledger, never the whole shared mesh. */
|
|
12
|
-
export async function down(
|
|
13
|
-
const
|
|
14
|
-
args: argv,
|
|
15
|
-
allowPositionals: true,
|
|
16
|
-
options: {
|
|
17
|
-
file: { type: "string", short: "f" }, // ownership-scoped teardown of a spawn -f deploy
|
|
18
|
-
run: { type: "string" }, // tear down by run id (when the manifest was edited since spawn -f)
|
|
19
|
-
"dry-run": { type: "boolean" }, // print what would be removed, change nothing
|
|
20
|
-
},
|
|
21
|
-
});
|
|
12
|
+
export async function down(args) {
|
|
13
|
+
const values = args.values;
|
|
22
14
|
if (values.file || values.run) {
|
|
23
15
|
await downManifest(values.file ?? "<run>", { run: values.run, dryRun: Boolean(values["dry-run"]) });
|
|
24
16
|
return;
|
|
@@ -30,12 +22,14 @@ export async function down(argv = []) {
|
|
|
30
22
|
["nats.pid", "nats-server"],
|
|
31
23
|
];
|
|
32
24
|
let any = false;
|
|
25
|
+
// Sequential, in declared order (manager → delivery → web → nats): the manager's graceful shutdown
|
|
26
|
+
// releases its lease OVER nats, so nats must outlive it. Each stop awaits the real exit.
|
|
33
27
|
for (const [file, label] of targets) {
|
|
34
28
|
const pidPath = cotalPath(file);
|
|
35
29
|
if (!existsSync(pidPath))
|
|
36
30
|
continue;
|
|
37
31
|
any = true;
|
|
38
|
-
stop(pidPath, label);
|
|
32
|
+
await stop(pidPath, label);
|
|
39
33
|
}
|
|
40
34
|
// Non-pid control-plane artifacts: the delivery daemon's scoped creds + the manager's delivery-aware
|
|
41
35
|
// marker. Drop them with the processes so a stale creds file / marker never lingers.
|
|
@@ -54,15 +48,47 @@ export async function down(argv = []) {
|
|
|
54
48
|
process.exit(1);
|
|
55
49
|
}
|
|
56
50
|
}
|
|
57
|
-
|
|
51
|
+
const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|
52
|
+
const isAlive = (pid) => {
|
|
53
|
+
try {
|
|
54
|
+
process.kill(pid, 0);
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
/** Stop one recorded process and AWAIT its actual exit — SIGTERM starts a graceful shutdown (a
|
|
62
|
+
* manager reaps its agents and releases its JetStream lease over NATS, which isn't instant), so
|
|
63
|
+
* returning before the process is really gone would let callers (and `up`-style smokes) race a
|
|
64
|
+
* still-dying manager. Poll the pid, escalate to SIGKILL if it overstays, then confirm it's gone. */
|
|
65
|
+
async function stop(pidPath, label) {
|
|
58
66
|
const pid = Number(readFileSync(pidPath, "utf8").trim());
|
|
67
|
+
// Drop the pidfile up front so a concurrent `down` can't double-signal a reused pid.
|
|
68
|
+
rmSync(pidPath, { force: true });
|
|
69
|
+
if (!Number.isFinite(pid))
|
|
70
|
+
return;
|
|
59
71
|
try {
|
|
60
72
|
process.kill(pid, "SIGTERM");
|
|
61
|
-
console.log(c.green(`✓ stopped ${label} (pid ${pid})`));
|
|
62
73
|
}
|
|
63
74
|
catch {
|
|
64
75
|
console.log(c.dim(`${label} (pid ${pid}) was not running.`));
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
const graceDeadline = Date.now() + 15_000;
|
|
79
|
+
while (isAlive(pid) && Date.now() < graceDeadline)
|
|
80
|
+
await sleep(100);
|
|
81
|
+
if (isAlive(pid)) {
|
|
82
|
+
try {
|
|
83
|
+
process.kill(pid, "SIGKILL");
|
|
84
|
+
}
|
|
85
|
+
catch { /* raced to exit */ }
|
|
86
|
+
const hardDeadline = Date.now() + 3_000;
|
|
87
|
+
while (isAlive(pid) && Date.now() < hardDeadline)
|
|
88
|
+
await sleep(100);
|
|
65
89
|
}
|
|
66
|
-
|
|
90
|
+
console.log(isAlive(pid)
|
|
91
|
+
? c.red(`✗ ${label} (pid ${pid}) did not exit`)
|
|
92
|
+
: c.green(`✓ stopped ${label} (pid ${pid})`));
|
|
67
93
|
}
|
|
68
94
|
//# sourceMappingURL=down.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"down.js","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3D,OAAO,
|
|
1
|
+
{"version":3,"file":"down.js","sourceRoot":"","sources":["../../src/commands/down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CAAC,aAAa,KAAK,SAAS,GAAG,GAAG,CAAC,CAC/C,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ParsedArgs } from "@cotal-ai/core";
|
|
2
|
+
/**
|
|
3
|
+
* `cotal ext` — operator-installed CLI extensions. `add` installs an npm package into the
|
|
4
|
+
* cotal-owned prefix (never the user's project), imports it ONCE so it self-registers into the
|
|
5
|
+
* live `Registry`, verifies the registration actually landed, and caches the contributed command
|
|
6
|
+
* metadata into the manifest. From then on, help and <TAB> read the cache (no import), and
|
|
7
|
+
* dispatch imports the package lazily to run one of its commands with LIVE specs.
|
|
8
|
+
*
|
|
9
|
+
* Add-time guarantees (design-review conditions — each converts a silent failure into a loud one):
|
|
10
|
+
* - shared `@cotal-ai/*` packages must be PEER dependencies of the extension; each is linked to
|
|
11
|
+
* the running binary's copy (core is mandatory — otherwise the extension registers into ITS
|
|
12
|
+
* OWN module's registry singleton and the binary never sees the commands; others, e.g.
|
|
13
|
+
* `@cotal-ai/workspace`, would silently drift from the binary's).
|
|
14
|
+
* - after import, the expected commands must have appeared in OUR registry, else the add fails.
|
|
15
|
+
* - a contributed name colliding with an existing command fails the add (builtins win).
|
|
16
|
+
*/
|
|
17
|
+
export declare function ext(args: ParsedArgs): Promise<void>;
|
|
18
|
+
//# sourceMappingURL=ext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ext.d.ts","sourceRoot":"","sources":["../../src/commands/ext.ts"],"names":[],"mappings":"AAIA,OAAO,EAA0B,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAczE;;;;;;;;;;;;;;GAcG;AAEH,wBAAsB,GAAG,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAOzD"}
|
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, rmSync, symlinkSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath, pathToFileURL } from "node:url";
|
|
5
|
+
import { registry } from "@cotal-ai/core";
|
|
6
|
+
import { cacheCommand, extensionPackageDir, extensionsDir, extensionsManifestPath, installedExtensionVersion, loadExtensionsManifest, provenance, saveExtensionsManifest, } from "@cotal-ai/workspace";
|
|
7
|
+
import { c } from "../ui.js";
|
|
8
|
+
/**
|
|
9
|
+
* `cotal ext` — operator-installed CLI extensions. `add` installs an npm package into the
|
|
10
|
+
* cotal-owned prefix (never the user's project), imports it ONCE so it self-registers into the
|
|
11
|
+
* live `Registry`, verifies the registration actually landed, and caches the contributed command
|
|
12
|
+
* metadata into the manifest. From then on, help and <TAB> read the cache (no import), and
|
|
13
|
+
* dispatch imports the package lazily to run one of its commands with LIVE specs.
|
|
14
|
+
*
|
|
15
|
+
* Add-time guarantees (design-review conditions — each converts a silent failure into a loud one):
|
|
16
|
+
* - shared `@cotal-ai/*` packages must be PEER dependencies of the extension; each is linked to
|
|
17
|
+
* the running binary's copy (core is mandatory — otherwise the extension registers into ITS
|
|
18
|
+
* OWN module's registry singleton and the binary never sees the commands; others, e.g.
|
|
19
|
+
* `@cotal-ai/workspace`, would silently drift from the binary's).
|
|
20
|
+
* - after import, the expected commands must have appeared in OUR registry, else the add fails.
|
|
21
|
+
* - a contributed name colliding with an existing command fails the add (builtins win).
|
|
22
|
+
*/
|
|
23
|
+
export async function ext(args) {
|
|
24
|
+
const [sub, ...rest] = args.positionals;
|
|
25
|
+
if (sub === "add" && rest[0])
|
|
26
|
+
return add(rest[0]);
|
|
27
|
+
if (sub === "remove" && rest[0])
|
|
28
|
+
return remove(rest[0]);
|
|
29
|
+
if (sub === "list" && !rest.length)
|
|
30
|
+
return list();
|
|
31
|
+
console.error(c.red("usage: cotal ext <add <npm-package> | remove <name> | list>"));
|
|
32
|
+
process.exit(1);
|
|
33
|
+
}
|
|
34
|
+
/** Resolve the running binary's @cotal-ai/core package dir — the ONE core instance every
|
|
35
|
+
* extension must share. Resolved from this module's own import graph (so dev workspace links
|
|
36
|
+
* and installed node_modules both work) by walking up from the package's resolved ENTRY to the
|
|
37
|
+
* directory holding its package.json — the `exports` maps don't expose "./package.json",
|
|
38
|
+
* so the subpath can't be resolved directly. NOTE: resolution runs from @cotal-ai/cli's graph,
|
|
39
|
+
* so only shared packages the CLI itself carries (core, workspace) are linkable today; an
|
|
40
|
+
* extension peering any other @cotal-ai/* package fails its add loudly. */
|
|
41
|
+
function ourPackageDir(name) {
|
|
42
|
+
let dir = dirname(fileURLToPath(import.meta.resolve(name)));
|
|
43
|
+
for (;;) {
|
|
44
|
+
const pj = join(dir, "package.json");
|
|
45
|
+
if (existsSync(pj) && JSON.parse(readFileSync(pj, "utf8")).name === name)
|
|
46
|
+
return dir;
|
|
47
|
+
const parent = dirname(dir);
|
|
48
|
+
if (parent === dir)
|
|
49
|
+
throw new Error(`couldn't locate ${name}'s package root from its resolved entry`);
|
|
50
|
+
dir = parent;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
function npm(args, cwd) {
|
|
54
|
+
const bin = process.platform === "win32" ? "npm.cmd" : "npm";
|
|
55
|
+
const r = spawnSync(bin, args, { cwd, encoding: "utf8" });
|
|
56
|
+
return { status: r.status, output: `${r.stdout ?? ""}${r.stderr ?? ""}`.trim() };
|
|
57
|
+
}
|
|
58
|
+
/** Import an installed extension package (its declared entry) so it self-registers. */
|
|
59
|
+
async function importExtension(pkg) {
|
|
60
|
+
const dir = extensionPackageDir(pkg);
|
|
61
|
+
const meta = JSON.parse(readFileSync(join(dir, "package.json"), "utf8"));
|
|
62
|
+
// Entry resolution: the common cases (exports["."] as string or {import|default}, else main).
|
|
63
|
+
let entry = meta.main ?? "index.js";
|
|
64
|
+
const dot = meta.exports?.["."];
|
|
65
|
+
if (typeof dot === "string")
|
|
66
|
+
entry = dot;
|
|
67
|
+
else if (dot && typeof dot === "object") {
|
|
68
|
+
const d = dot;
|
|
69
|
+
entry = d.import ?? d.default ?? entry;
|
|
70
|
+
}
|
|
71
|
+
else if (typeof meta.exports === "string")
|
|
72
|
+
entry = meta.exports;
|
|
73
|
+
await import(pathToFileURL(join(dir, entry)).href);
|
|
74
|
+
}
|
|
75
|
+
async function add(spec) {
|
|
76
|
+
const dir = extensionsDir();
|
|
77
|
+
mkdirSync(dir, { recursive: true });
|
|
78
|
+
if (!existsSync(join(dir, "package.json"))) {
|
|
79
|
+
writeFileSync(join(dir, "package.json"), `${JSON.stringify({ name: "cotal-extensions", private: true }, null, 2)}\n`);
|
|
80
|
+
provenance.wrote("extensions prefix", join(dir, "package.json"));
|
|
81
|
+
}
|
|
82
|
+
// A file:/path spec is resolved to an absolute path so the prefix install works from any cwd.
|
|
83
|
+
const isPath = /^(\.|\/)/.test(spec);
|
|
84
|
+
const resolved = isPath ? resolve(spec) : spec;
|
|
85
|
+
// The installed NAME is known BEFORE npm runs — never recovered afterwards by diffing the prefix
|
|
86
|
+
// dependencies (a heuristic that binds to the wrong key if the prefix ever drifted, and that made
|
|
87
|
+
// re-adding an installed extension impossible).
|
|
88
|
+
const pkg = packageNameFromSpec(resolved, isPath);
|
|
89
|
+
console.error(c.dim(`installing ${resolved} into ${dir} …`));
|
|
90
|
+
// --legacy-peer-deps: never auto-install the peer'd core from the registry — the add ALWAYS
|
|
91
|
+
// links the running binary's copy below (one core instance is the whole point).
|
|
92
|
+
// --install-links: a file:/path spec is COPIED into the prefix, not symlinked — a symlink's
|
|
93
|
+
// realpath would escape the prefix and Node could no longer resolve the linked core from it.
|
|
94
|
+
const r = npm(["install", "--save", "--no-audit", "--no-fund", "--legacy-peer-deps", "--install-links", resolved], dir);
|
|
95
|
+
if (r.status !== 0) {
|
|
96
|
+
console.error(c.red(`✗ npm install failed:\n${r.output.split("\n").slice(-8).join("\n")}`));
|
|
97
|
+
process.exit(1);
|
|
98
|
+
}
|
|
99
|
+
// The spec's package must now be a prefix dependency — anything else is a failed install.
|
|
100
|
+
const deps = JSON.parse(readFileSync(join(dir, "package.json"), "utf8")).dependencies ?? {};
|
|
101
|
+
if (!deps[pkg]) {
|
|
102
|
+
console.error(c.red(`✗ npm install succeeded but "${pkg}" is not among the prefix dependencies — remove and retry`));
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
const pkgDir = extensionPackageDir(pkg);
|
|
106
|
+
const pkgMeta = JSON.parse(readFileSync(join(pkgDir, "package.json"), "utf8"));
|
|
107
|
+
// Shared @cotal-ai/* packages must be PEER dependencies — a regular dependency vendors a second
|
|
108
|
+
// copy: core's would swallow the extension's registrations into its own registry singleton, and
|
|
109
|
+
// any other shared package would silently drift from the binary's. Fail with the exact reason.
|
|
110
|
+
const vendored = Object.keys(pkgMeta.dependencies ?? {}).filter((d) => d.startsWith("@cotal-ai/"));
|
|
111
|
+
if (vendored.length) {
|
|
112
|
+
fail(pkg, `declares ${vendored.join(", ")} as a regular dependency — shared @cotal-ai/* packages must be peerDependencies, or the extension runs its own copy (core's would swallow its command registrations; any other's drifts from this CLI's)`);
|
|
113
|
+
}
|
|
114
|
+
if (!pkgMeta.peerDependencies?.["@cotal-ai/core"]) {
|
|
115
|
+
fail(pkg, `does not declare @cotal-ai/core as a peerDependency — a cotal CLI extension must (its extension objects register into core's registry)`);
|
|
116
|
+
}
|
|
117
|
+
// Link every shared @cotal-ai/* peer to the RUNNING binary's copy, so the extension's imports
|
|
118
|
+
// land on our singletons — core's registry above all. npm ignored the peers at install
|
|
119
|
+
// (--legacy-peer-deps), so this link is the ONLY resolution they get: core is mandatory, and any
|
|
120
|
+
// other @cotal-ai/* peer must be one the binary carries, else the add fails loud.
|
|
121
|
+
for (const peer of Object.keys(pkgMeta.peerDependencies ?? {}).filter((d) => d.startsWith("@cotal-ai/"))) {
|
|
122
|
+
let src;
|
|
123
|
+
try {
|
|
124
|
+
src = ourPackageDir(peer);
|
|
125
|
+
}
|
|
126
|
+
catch {
|
|
127
|
+
fail(pkg, `peer-depends on ${peer}, which this cotal binary does not carry — the peer can't be linked, so the extension could never resolve it`);
|
|
128
|
+
}
|
|
129
|
+
const dest = join(dir, "node_modules", ...peer.split("/"));
|
|
130
|
+
rmSync(dest, { recursive: true, force: true });
|
|
131
|
+
mkdirSync(dirname(dest), { recursive: true });
|
|
132
|
+
symlinkSync(src, dest, "junction");
|
|
133
|
+
provenance.wrote(`${peer} link (extension → this CLI's copy)`, dest);
|
|
134
|
+
}
|
|
135
|
+
// Import once; the registration must LAND IN OUR REGISTRY — zero new commands is a failed add.
|
|
136
|
+
const before = new Set(registry.all("command").map((cm) => cm.name));
|
|
137
|
+
try {
|
|
138
|
+
await importExtension(pkg);
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
fail(pkg, `failed to import: ${e.message}`);
|
|
142
|
+
}
|
|
143
|
+
const contributed = registry.all("command").filter((cm) => !before.has(cm.name));
|
|
144
|
+
if (!contributed.length) {
|
|
145
|
+
fail(pkg, `imported cleanly but registered no commands in THIS CLI's registry — if it bundles its own @cotal-ai/core, make core a peerDependency`);
|
|
146
|
+
}
|
|
147
|
+
// Builtin collisions can't happen here (registry.register throws on a duplicate, surfacing as
|
|
148
|
+
// failed-to-import above, naming the extension). OTHER installed extensions are invisible to the
|
|
149
|
+
// registry during this add (they aren't imported), so their CACHED names are checked explicitly —
|
|
150
|
+
// a duplicate fails the add under the same contract, naming both sides.
|
|
151
|
+
const manifest = loadExtensionsManifest();
|
|
152
|
+
for (const cm of contributed) {
|
|
153
|
+
const other = manifest.extensions.find((e) => e.pkg !== pkg && e.commands.some((oc) => oc.name === cm.name));
|
|
154
|
+
if (other) {
|
|
155
|
+
fail(pkg, `contributes "${cm.name}", already provided by installed extension ${other.pkg}@${other.version} — two extensions cannot claim one command; \`cotal ext remove ${other.pkg}\` first if you want this one`);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
const version = pkgMeta.version ?? "0.0.0";
|
|
159
|
+
const entry = { pkg, version, spec: resolved, commands: contributed.map(cacheCommand) };
|
|
160
|
+
saveExtensionsManifest({ extensions: [...manifest.extensions.filter((e) => e.pkg !== pkg), entry] });
|
|
161
|
+
provenance.wrote(`extensions manifest (+${pkg}@${version})`, extensionsManifestPath());
|
|
162
|
+
console.log(c.green(`✓ added ${pkg}@${version}`) + c.dim(` — commands: ${contributed.map((cm) => cm.name).join(", ")}`));
|
|
163
|
+
function fail(p, why) {
|
|
164
|
+
npm(["remove", "--no-audit", "--no-fund", p], dir); // roll the prefix back
|
|
165
|
+
console.error(c.red(`✗ ${p} ${why}`));
|
|
166
|
+
process.exit(1);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
/** The package NAME a spec installs, known BEFORE npm runs: a path spec reads its package.json;
|
|
170
|
+
* a registry spec carries the name (`name`, `name@range`, `@scope/name@range`). Exotic forms
|
|
171
|
+
* (git / tarball URLs) are refused rather than guessed at — there is no reliable way to know
|
|
172
|
+
* which prefix dependency such an install bound to. */
|
|
173
|
+
function packageNameFromSpec(resolved, isPath) {
|
|
174
|
+
if (isPath) {
|
|
175
|
+
let meta;
|
|
176
|
+
try {
|
|
177
|
+
meta = JSON.parse(readFileSync(join(resolved, "package.json"), "utf8"));
|
|
178
|
+
}
|
|
179
|
+
catch (e) {
|
|
180
|
+
console.error(c.red(`✗ can't read ${join(resolved, "package.json")}: ${e.message}`));
|
|
181
|
+
process.exit(1);
|
|
182
|
+
}
|
|
183
|
+
if (meta.name)
|
|
184
|
+
return meta.name;
|
|
185
|
+
console.error(c.red(`✗ ${join(resolved, "package.json")} declares no "name"`));
|
|
186
|
+
process.exit(1);
|
|
187
|
+
}
|
|
188
|
+
const m = /^(@[^/@]+\/[^/@]+|[^/@]+)(@.*)?$/.exec(resolved);
|
|
189
|
+
if (m)
|
|
190
|
+
return m[1];
|
|
191
|
+
console.error(c.red(`✗ unsupported extension spec "${resolved}" — use a local path or a registry name[@version]`));
|
|
192
|
+
process.exit(1);
|
|
193
|
+
}
|
|
194
|
+
async function remove(pkg) {
|
|
195
|
+
const manifest = loadExtensionsManifest();
|
|
196
|
+
const entry = manifest.extensions.find((e) => e.pkg === pkg);
|
|
197
|
+
if (!entry) {
|
|
198
|
+
console.error(c.red(`✗ no installed extension "${pkg}" — see \`cotal ext list\``));
|
|
199
|
+
process.exit(1);
|
|
200
|
+
}
|
|
201
|
+
const r = npm(["remove", "--no-audit", "--no-fund", pkg], extensionsDir());
|
|
202
|
+
if (r.status !== 0) {
|
|
203
|
+
console.error(c.red(`✗ npm remove failed:\n${r.output.split("\n").slice(-6).join("\n")}`));
|
|
204
|
+
process.exit(1);
|
|
205
|
+
}
|
|
206
|
+
saveExtensionsManifest({ extensions: manifest.extensions.filter((e) => e.pkg !== pkg) });
|
|
207
|
+
provenance.wrote(`extensions manifest (−${pkg})`, extensionsManifestPath());
|
|
208
|
+
console.log(c.green(`✓ removed ${pkg}`) + c.dim(` — commands gone: ${entry.commands.map((cm) => cm.name).join(", ")}`));
|
|
209
|
+
}
|
|
210
|
+
function list() {
|
|
211
|
+
const { extensions } = loadExtensionsManifest();
|
|
212
|
+
if (!extensions.length) {
|
|
213
|
+
console.log(c.dim("(no extensions installed — add one with `cotal ext add <npm-package>`)"));
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
for (const e of extensions) {
|
|
217
|
+
console.log(`${c.bold(e.pkg)}@${e.version} ${c.dim(e.commands.map((cm) => cm.name).join(", "))}`);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
//# sourceMappingURL=ext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ext.js","sourceRoot":"","sources":["../../src/commands/ext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClG,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO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AAI;IACX,MAAM,EAAE,UAAU,EAAE,GAAG,sBAAsB,EAAE,CAAC;IAChD,IAAI,CAAC,UAAU,CAAC,MAAM,EAAE,CAAC;QACvB,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,wEAAwE,CAAC,CAAC,CAAC;QAC7F,OAAO;IACT,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,UAAU,EAAE,CAAC;QAC3B,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC;IACrG,CAAC;AACH,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function feedback(
|
|
1
|
+
import { type ParsedArgs } from "@cotal-ai/core";
|
|
2
|
+
export declare function feedback(args: ParsedArgs): Promise<void>;
|
|
3
3
|
//# sourceMappingURL=feedback.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/commands/feedback.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"feedback.d.ts","sourceRoot":"","sources":["../../src/commands/feedback.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAcjD,wBAAsB,QAAQ,CAAC,IAAI,EAAE,UAAU,GAAG,OAAO,CAAC,IAAI,CAAC,CAyE9D"}
|