@cotal-ai/cli 0.6.0 → 0.8.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/dist/commands/channels.d.ts +4 -2
- package/dist/commands/channels.d.ts.map +1 -1
- package/dist/commands/channels.js +17 -18
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/console.d.ts.map +1 -1
- package/dist/commands/console.js +13 -29
- package/dist/commands/console.js.map +1 -1
- package/dist/commands/down-manifest.d.ts +6 -0
- package/dist/commands/down-manifest.d.ts.map +1 -0
- package/dist/commands/down-manifest.js +282 -0
- package/dist/commands/down-manifest.js.map +1 -0
- package/dist/commands/down.d.ts +5 -3
- package/dist/commands/down.d.ts.map +1 -1
- package/dist/commands/down.js +30 -3
- package/dist/commands/down.js.map +1 -1
- package/dist/commands/history.d.ts.map +1 -1
- package/dist/commands/history.js +6 -13
- package/dist/commands/history.js.map +1 -1
- package/dist/commands/join.d.ts.map +1 -1
- package/dist/commands/join.js +20 -7
- package/dist/commands/join.js.map +1 -1
- package/dist/commands/meshes.d.ts +5 -0
- package/dist/commands/meshes.d.ts.map +1 -0
- package/dist/commands/meshes.js +25 -0
- package/dist/commands/meshes.js.map +1 -0
- package/dist/commands/mint.d.ts.map +1 -1
- package/dist/commands/mint.js +2 -1
- package/dist/commands/mint.js.map +1 -1
- package/dist/commands/setup.d.ts.map +1 -1
- package/dist/commands/setup.js +66 -16
- package/dist/commands/setup.js.map +1 -1
- package/dist/commands/spawn-manifest.d.ts +10 -0
- package/dist/commands/spawn-manifest.d.ts.map +1 -0
- package/dist/commands/spawn-manifest.js +197 -0
- package/dist/commands/spawn-manifest.js.map +1 -0
- package/dist/commands/spawn.d.ts +4 -2
- package/dist/commands/spawn.d.ts.map +1 -1
- package/dist/commands/spawn.js +84 -25
- package/dist/commands/spawn.js.map +1 -1
- package/dist/commands/topology.d.ts +10 -0
- package/dist/commands/topology.d.ts.map +1 -0
- package/dist/commands/topology.js +46 -0
- package/dist/commands/topology.js.map +1 -0
- package/dist/commands/up.d.ts +4 -0
- package/dist/commands/up.d.ts.map +1 -1
- package/dist/commands/up.js +223 -6
- package/dist/commands/up.js.map +1 -1
- package/dist/commands/use.d.ts +7 -0
- package/dist/commands/use.d.ts.map +1 -0
- package/dist/commands/use.js +27 -0
- package/dist/commands/use.js.map +1 -0
- package/dist/commands/web.d.ts.map +1 -1
- package/dist/commands/web.js +60 -28
- package/dist/commands/web.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +27 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/connect.d.ts +74 -0
- package/dist/lib/connect.d.ts.map +1 -0
- package/dist/lib/connect.js +91 -0
- package/dist/lib/connect.js.map +1 -0
- package/dist/lib/delivery-proc.d.ts.map +1 -1
- package/dist/lib/delivery-proc.js +2 -1
- package/dist/lib/delivery-proc.js.map +1 -1
- package/dist/lib/manager-proc.d.ts +4 -0
- package/dist/lib/manager-proc.d.ts.map +1 -1
- package/dist/lib/manager-proc.js +17 -0
- package/dist/lib/manager-proc.js.map +1 -1
- package/dist/lib/manifest/apply.d.ts +29 -0
- package/dist/lib/manifest/apply.d.ts.map +1 -0
- package/dist/lib/manifest/apply.js +138 -0
- package/dist/lib/manifest/apply.js.map +1 -0
- package/dist/lib/manifest/errors.d.ts +21 -0
- package/dist/lib/manifest/errors.d.ts.map +1 -0
- package/dist/lib/manifest/errors.js +19 -0
- package/dist/lib/manifest/errors.js.map +1 -0
- package/dist/lib/manifest/index.d.ts +13 -0
- package/dist/lib/manifest/index.d.ts.map +1 -0
- package/dist/lib/manifest/index.js +21 -0
- package/dist/lib/manifest/index.js.map +1 -0
- package/dist/lib/manifest/ledger.d.ts +81 -0
- package/dist/lib/manifest/ledger.d.ts.map +1 -0
- package/dist/lib/manifest/ledger.js +213 -0
- package/dist/lib/manifest/ledger.js.map +1 -0
- package/dist/lib/manifest/live.d.ts +25 -0
- package/dist/lib/manifest/live.d.ts.map +1 -0
- package/dist/lib/manifest/live.js +61 -0
- package/dist/lib/manifest/live.js.map +1 -0
- package/dist/lib/manifest/model.d.ts +71 -0
- package/dist/lib/manifest/model.d.ts.map +1 -0
- package/dist/lib/manifest/model.js +2 -0
- package/dist/lib/manifest/model.js.map +1 -0
- package/dist/lib/manifest/preflight.d.ts +12 -0
- package/dist/lib/manifest/preflight.d.ts.map +1 -0
- package/dist/lib/manifest/preflight.js +43 -0
- package/dist/lib/manifest/preflight.js.map +1 -0
- package/dist/lib/manifest/prepare.d.ts +57 -0
- package/dist/lib/manifest/prepare.d.ts.map +1 -0
- package/dist/lib/manifest/prepare.js +95 -0
- package/dist/lib/manifest/prepare.js.map +1 -0
- package/dist/lib/manifest/render.d.ts +41 -0
- package/dist/lib/manifest/render.d.ts.map +1 -0
- package/dist/lib/manifest/render.js +177 -0
- package/dist/lib/manifest/render.js.map +1 -0
- package/dist/lib/manifest/resolve.d.ts +5 -0
- package/dist/lib/manifest/resolve.d.ts.map +1 -0
- package/dist/lib/manifest/resolve.js +185 -0
- package/dist/lib/manifest/resolve.js.map +1 -0
- package/dist/lib/manifest/schema.d.ts +103 -0
- package/dist/lib/manifest/schema.d.ts.map +1 -0
- package/dist/lib/manifest/schema.js +77 -0
- package/dist/lib/manifest/schema.js.map +1 -0
- package/dist/lib/manifest/spawn-plan.d.ts +87 -0
- package/dist/lib/manifest/spawn-plan.d.ts.map +1 -0
- package/dist/lib/manifest/spawn-plan.js +75 -0
- package/dist/lib/manifest/spawn-plan.js.map +1 -0
- package/dist/lib/meshes.d.ts +2 -0
- package/dist/lib/meshes.d.ts.map +1 -0
- package/dist/lib/meshes.js +6 -0
- package/dist/lib/meshes.js.map +1 -0
- package/dist/lib/onboard.js +6 -6
- package/dist/lib/onboard.js.map +1 -1
- package/dist/lib/paths.js +1 -1
- package/dist/lib/paths.js.map +1 -1
- package/dist/lib/status.d.ts.map +1 -1
- package/dist/lib/status.js +2 -1
- package/dist/lib/status.js.map +1 -1
- package/dist/lib/transient.d.ts +7 -6
- package/dist/lib/transient.d.ts.map +1 -1
- package/dist/lib/transient.js +6 -25
- package/dist/lib/transient.js.map +1 -1
- package/dist/web/graph.html +207 -0
- package/dist/web/graph.js +508 -0
- package/dist/web/index.html +6 -0
- package/package.json +6 -2
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `cotal channels` — inspect and mutate the per-space channel registry (replay policy,
|
|
3
|
-
* description, instructions) while the mesh is up. Writes are privileged:
|
|
4
|
-
* command mints ephemeral manager creds from `.cotal/auth`;
|
|
3
|
+
* description, instructions) while the mesh is up. Writes are privileged: on an auth mesh the
|
|
4
|
+
* command mints ephemeral manager creds from the resolved mesh's `.cotal/auth`; on an open mesh it
|
|
5
|
+
* connects plainly. Works from any directory (resolves the running mesh); `--creds` is a raw
|
|
6
|
+
* off-registry connection.
|
|
5
7
|
*
|
|
6
8
|
* cotal channels list
|
|
7
9
|
* cotal channels set <name> [--replay|--no-replay] [--desc <s>] [--instructions <s>]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/commands/channels.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"channels.d.ts","sourceRoot":"","sources":["../../src/commands/channels.ts"],"names":[],"mappings":"AAYA;;;;;;;;;;GAUG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA4D5D"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { resolveSpace } from "../lib/status.js";
|
|
2
|
+
import { seedChannelRegistry, readChannelRegistry, effectiveReplay, } from "@cotal-ai/core";
|
|
3
|
+
import { connectOrExit } from "../lib/connect.js";
|
|
5
4
|
import { c } from "../ui.js";
|
|
6
5
|
/**
|
|
7
6
|
* `cotal channels` — inspect and mutate the per-space channel registry (replay policy,
|
|
8
|
-
* description, instructions) while the mesh is up. Writes are privileged:
|
|
9
|
-
* command mints ephemeral manager creds from `.cotal/auth`;
|
|
7
|
+
* description, instructions) while the mesh is up. Writes are privileged: on an auth mesh the
|
|
8
|
+
* command mints ephemeral manager creds from the resolved mesh's `.cotal/auth`; on an open mesh it
|
|
9
|
+
* connects plainly. Works from any directory (resolves the running mesh); `--creds` is a raw
|
|
10
|
+
* off-registry connection.
|
|
10
11
|
*
|
|
11
12
|
* cotal channels list
|
|
12
13
|
* cotal channels set <name> [--replay|--no-replay] [--desc <s>] [--instructions <s>]
|
|
@@ -19,6 +20,7 @@ export async function channels(argv) {
|
|
|
19
20
|
options: {
|
|
20
21
|
server: { type: "string" },
|
|
21
22
|
space: { type: "string" },
|
|
23
|
+
creds: { type: "string" },
|
|
22
24
|
replay: { type: "boolean" },
|
|
23
25
|
"no-replay": { type: "boolean" },
|
|
24
26
|
window: { type: "string" }, // backfill window, e.g. 24h / 30m / 7d
|
|
@@ -26,12 +28,17 @@ export async function channels(argv) {
|
|
|
26
28
|
instructions: { type: "string" },
|
|
27
29
|
},
|
|
28
30
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
+
// Validate the subcommand BEFORE connecting, so a typo (or a bare `cotal channels`) prints usage,
|
|
32
|
+
// not "no mesh running" — the same validate-first order as `history`.
|
|
33
|
+
const sub = positionals[0];
|
|
34
|
+
if (sub !== "list" && sub !== "set" && sub !== "default")
|
|
35
|
+
return usage();
|
|
36
|
+
if (sub === "set" && !positionals[1])
|
|
37
|
+
return usage(); // need a channel name before touching the mesh
|
|
31
38
|
// Tri-state replay: --replay → true, --no-replay → false, neither → leave unchanged.
|
|
32
39
|
const replay = values["no-replay"] ? false : values.replay ? true : undefined;
|
|
33
|
-
const creds = await
|
|
34
|
-
switch (
|
|
40
|
+
const { server, space, creds } = await connectOrExit(values, "manager"); // creds undefined ⇒ open mode
|
|
41
|
+
switch (sub) {
|
|
35
42
|
case "list": {
|
|
36
43
|
printRegistry(await readChannelRegistry({ servers: server, space, creds }));
|
|
37
44
|
return;
|
|
@@ -75,14 +82,6 @@ export async function channels(argv) {
|
|
|
75
82
|
return usage();
|
|
76
83
|
}
|
|
77
84
|
}
|
|
78
|
-
/** Privileged creds for a registry write: mint ephemeral manager creds from the space auth
|
|
79
|
-
* (auth mode), or undefined to connect open. Throws nothing — open mode is the no-auth dev mesh. */
|
|
80
|
-
async function managerCreds() {
|
|
81
|
-
const auth = loadSpaceAuth(authDir(cotalRoot()));
|
|
82
|
-
if (!auth)
|
|
83
|
-
return undefined;
|
|
84
|
-
return mintCreds(auth, newIdentity(), "manager");
|
|
85
|
-
}
|
|
86
85
|
function printRegistry(reg) {
|
|
87
86
|
const def = reg.defaults?.replay;
|
|
88
87
|
const dw = reg.defaults?.replayWindow;
|
|
@@ -104,7 +103,7 @@ function printRegistry(reg) {
|
|
|
104
103
|
}
|
|
105
104
|
}
|
|
106
105
|
function usage() {
|
|
107
|
-
console.error(c.red("usage: cotal channels <list | set <name> [--replay|--no-replay] [--window <dur>] [--desc <s>] [--instructions <s>] | default [--replay|--no-replay] [--window <dur>]> [--space <s>] [--server <url>]"));
|
|
106
|
+
console.error(c.red("usage: cotal channels <list | set <name> [--replay|--no-replay] [--window <dur>] [--desc <s>] [--instructions <s>] | default [--replay|--no-replay] [--window <dur>]> [--space <s>] [--server <url>] [--creds <path>]"));
|
|
108
107
|
process.exit(1);
|
|
109
108
|
}
|
|
110
109
|
//# sourceMappingURL=channels.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/commands/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"channels.js","sourceRoot":"","sources":["../../src/commands/channels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EACL,mBAAmB,EACnB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AAC,YAAY,GAAG,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC3E,CAAC;AACH,CAAC;AAED,SAAS,KAAK;IACZ,OAAO,CAAC,KAAK,CACX,CAAC,CAAC,GAAG,CACH,uNAAuN,CACxN,CACF,CAAC;IACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"AAWA;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CA0E5D"}
|
package/dist/commands/console.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { parseArgs } from "node:util";
|
|
2
|
-
import {
|
|
2
|
+
import { writeSync } from "node:fs";
|
|
3
3
|
import { userInfo } from "node:os";
|
|
4
4
|
import { createElement } from "react";
|
|
5
5
|
import { render } from "ink";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { resolveSpace } from "../lib/status.js";
|
|
6
|
+
import { chatWildcard } from "@cotal-ai/core";
|
|
7
|
+
import { connectOrExit } from "../lib/connect.js";
|
|
9
8
|
import { c } from "../ui.js";
|
|
10
9
|
import { runLog } from "../render.js";
|
|
11
10
|
import { Root, makeObserver } from "../console/root.js";
|
|
@@ -26,29 +25,14 @@ export async function console_(argv) {
|
|
|
26
25
|
creds: { type: "string" },
|
|
27
26
|
},
|
|
28
27
|
});
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
|
|
37
|
-
if (!creds) {
|
|
38
|
-
const auth = loadSpaceAuth(authDir(cotalRoot()));
|
|
39
|
-
if (auth) {
|
|
40
|
-
if (space && space !== auth.space) {
|
|
41
|
-
console.error(c.red(`Auth here is for space "${auth.space}", not "${space}". Use --space ${auth.space} (or pass --creds).`));
|
|
42
|
-
process.exit(1);
|
|
43
|
-
}
|
|
44
|
-
space = auth.space;
|
|
45
|
-
creds = await mintCreds(auth, newIdentity(), "admin");
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
if (!(await isReachable(server, { creds }))) {
|
|
49
|
-
console.error(c.red(`Can't reach NATS at ${server}. Run: pnpm cotal up`));
|
|
50
|
-
process.exit(1);
|
|
51
|
-
}
|
|
28
|
+
// Resolve WHICH running mesh (server + trust material) from any directory — same as `spawn`/`web`.
|
|
29
|
+
// Auth mode self-mints an admin god-view cred (the console shows DMs/anycast, which the narrower
|
|
30
|
+
// `observer` profile denies → NATS Authorization Violation); an authed server hosts exactly one
|
|
31
|
+
// space, so we enter it directly. Open mode connects bare; with no --space, the TTY shows the
|
|
32
|
+
// space overview. An explicit --creds wins.
|
|
33
|
+
const { server, space: resolvedSpace, creds, auth } = await connectOrExit(values, "admin");
|
|
34
|
+
// Auth pins its one space; open mode keeps --space (undefined → the overview picker).
|
|
35
|
+
const space = auth ? resolvedSpace : values.space;
|
|
52
36
|
// Operator identity for sent messages (still off the roster). Open mode or an explicit --creds can
|
|
53
37
|
// write; the self-minted observer cred (auth default) is read-only, so the palette/`D` are inert.
|
|
54
38
|
const operator = (() => {
|
|
@@ -61,9 +45,9 @@ export async function console_(argv) {
|
|
|
61
45
|
})();
|
|
62
46
|
const canWrite = !creds || !!values.creds;
|
|
63
47
|
// No TTY (piped/headless) or --plain → the passive line stream; Ink needs a real terminal, and a
|
|
64
|
-
// stream can't host the picker, so it falls back to the
|
|
48
|
+
// stream can't host the picker, so it falls back to the RESOLVED mesh's space (not the cwd's).
|
|
65
49
|
if (values.plain || process.stdout.isTTY !== true) {
|
|
66
|
-
const s = space ??
|
|
50
|
+
const s = space ?? resolvedSpace;
|
|
67
51
|
await runLog(makeObserver(s, server, creds, operator), s, creds ? chatWildcard(s) : undefined);
|
|
68
52
|
return;
|
|
69
53
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"console.js","sourceRoot":"","sources":["../../src/commands/console.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AACnC,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AACtC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC;AAC7B,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAExD;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,QAAQ,CAAC,IAAc;IAC3C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC3B,IAAI,EAAE,IAAI;QACV,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACP,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YAC1B,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;YAC1B,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;SAC1B;KACF,CAAC,CAAC;IACH,mGAAmG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AAE,MAAM,EAAE,KAAK,EAAE,iBAAiB,GAAG,OAAO,CAAC,IAAI,CAAC,CAmNxF"}
|
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `cotal down -f cotal.yaml` — ownership-scoped teardown of a `spawn -f` deploy: stop + remove ONLY
|
|
3
|
+
* the agents/channels that run created, never foreign actors on the shared mesh. The ledger is
|
|
4
|
+
* treated as untrusted input and the WHOLE of it is validated + every path resolved up front, before
|
|
5
|
+
* any destructive action (fail closed). Local-only: works from the same checkout/host that created
|
|
6
|
+
* the run (the ledger is local state).
|
|
7
|
+
*
|
|
8
|
+
* Safety invariants (security/critic/UX early-PR2 review):
|
|
9
|
+
* - find the ledger by manifest hash; an edited file / >1 match FAILS with `--run`, never guesses;
|
|
10
|
+
* - stop an owned agent only when the live agent matches the recorded name AND nkey id — a name
|
|
11
|
+
* match with a different id is left alone (foreign reuse), never stopped by name;
|
|
12
|
+
* - cred paths are DERIVED from the auth root (never read from the ledger) and deleted no-follow;
|
|
13
|
+
* - a ledger-owned channel card is removed only when no members remain and membership is knowable —
|
|
14
|
+
* skipped (best-effort, racy) on ANY uncertainty, including an owned agent that failed to stop;
|
|
15
|
+
* - `--allow-stale` is apply-only and has no effect here.
|
|
16
|
+
*/
|
|
17
|
+
import { lstatSync, readFileSync, rmSync } from "node:fs";
|
|
18
|
+
import { join, resolve } from "node:path";
|
|
19
|
+
import { CONTROL_ADMIN, deleteChannels, isReachable, mintCreds, newIdentity, realDirNoSymlink, subjectMatches, unlinkFileNoFollow, } from "@cotal-ai/core";
|
|
20
|
+
import { authDir, loadSpaceAuth } from "@cotal-ai/workspace";
|
|
21
|
+
import { c } from "../ui.js";
|
|
22
|
+
import { cotalRoot } from "../lib/paths.js";
|
|
23
|
+
import { connectProbe } from "../lib/manifest/live.js";
|
|
24
|
+
import { findLedgerByHash, findLedgerByRun, hashManifestSource, ownedCredPath, writeLedger } from "../lib/manifest/ledger.js";
|
|
25
|
+
export async function downManifest(file, flags) {
|
|
26
|
+
const abs = resolve(file);
|
|
27
|
+
const root = cotalRoot();
|
|
28
|
+
// 1) Resolve the ledger — fail, never guess (edited file / ambiguous → require --run).
|
|
29
|
+
let ledgerPath;
|
|
30
|
+
let ledger;
|
|
31
|
+
try {
|
|
32
|
+
const found = flags.run ? findLedgerByRun(root, flags.run) : findLedgerByHash(root, hashManifestSource(readFileSync(abs, "utf8")));
|
|
33
|
+
ledgerPath = found.path;
|
|
34
|
+
ledger = found.ledger; // loadLedger already validated the WHOLE ledger as untrusted input
|
|
35
|
+
}
|
|
36
|
+
catch (e) {
|
|
37
|
+
console.error(c.red(`✗ ${e.message}`));
|
|
38
|
+
process.exit(1);
|
|
39
|
+
}
|
|
40
|
+
// 2) Show exactly what is being torn down BEFORE deleting anything.
|
|
41
|
+
console.log(c.bold(`Tear down run ${ledger.runId}`));
|
|
42
|
+
console.log(c.dim(` ledger: ${ledgerPath}`));
|
|
43
|
+
console.log(c.dim(` manifest: ${ledger.manifestPath} · hash ${ledger.manifestHash}`));
|
|
44
|
+
console.log(c.dim(` mesh: ${ledger.space} @ ${ledger.server}`));
|
|
45
|
+
console.log(c.dim(` owns: ${ledger.created.agents.length} agent(s), ${ledger.created.channels.length} channel(s)`));
|
|
46
|
+
// 3) Resolve every owned path from validated IDs up front — a bad name fails the WHOLE teardown
|
|
47
|
+
// before any side effect (no partial "validated the one I'm deleting" flow).
|
|
48
|
+
let credPaths;
|
|
49
|
+
let runDir;
|
|
50
|
+
let specPath;
|
|
51
|
+
try {
|
|
52
|
+
credPaths = ledger.created.agents.map((a) => ({ requested: a.requested, name: a.name, id: a.id, path: ownedCredPath(root, a.name) }));
|
|
53
|
+
const runParent = realDirNoSymlink(root, ".cotal", "run"); // refuse a symlinked .cotal/run before deriving under it
|
|
54
|
+
runDir = realDirNoSymlink(root, ".cotal", "run", ledger.runId);
|
|
55
|
+
specPath = join(runParent ?? join(root, ".cotal", "run"), `${ledger.runId}.json`);
|
|
56
|
+
}
|
|
57
|
+
catch (e) {
|
|
58
|
+
console.error(c.red(`✗ refusing teardown — unsafe owned resource: ${e.message}`));
|
|
59
|
+
process.exit(1);
|
|
60
|
+
}
|
|
61
|
+
if (flags.dryRun) {
|
|
62
|
+
console.log(c.bold("\nWould remove (dry run):"));
|
|
63
|
+
for (const a of credPaths)
|
|
64
|
+
console.log(` ${c.red("-")} agent ${a.name} ${c.dim(`(id ${a.id.slice(0, 8)}, creds ${a.path}) — stopped only if name+id match live`)}`);
|
|
65
|
+
for (const ch of ledger.created.channels)
|
|
66
|
+
console.log(` ${c.red("-")} channel ${c.cyan("#" + ch)} ${c.dim("(auth mesh: only if no members remain · open mesh: metadata cleanup, no membership audit)")}`);
|
|
67
|
+
console.log(` ${c.red("-")} run dir ${runDir ?? "(none)"} + ledger ${ledgerPath} ${c.dim("(only if every owned resource is removed/proven gone; else the ledger is kept)")}`);
|
|
68
|
+
console.log(c.dim("\nDry run — nothing was changed. The live membership check + actual disposition happen at apply."));
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// 4) Best-effort live teardown: stop owned agents (name AND id match) + remove childless owned
|
|
72
|
+
// channels. If the broker is down, nothing remote is torn down and the ledger is RETAINED.
|
|
73
|
+
const stoppedIds = new Set();
|
|
74
|
+
const removed = [];
|
|
75
|
+
const openNoFeed = []; // owned channels removed on an open mesh with no membership proof
|
|
76
|
+
const skipped = [];
|
|
77
|
+
const creds = await mintIfAuth(root, ledger.space);
|
|
78
|
+
const reachable = await isReachable(ledger.server, creds ? { creds } : undefined);
|
|
79
|
+
let liveById = new Map();
|
|
80
|
+
// controlOk: we completed the live ps/stop/channel pass. A control-plane error (no manager
|
|
81
|
+
// responder, a thrown ps/stop/membership/delete) is teardown UNCERTAINTY, not a crash — we catch
|
|
82
|
+
// it, mark everything unresolved below, and fall through to ledger retention (engineer/security/ux).
|
|
83
|
+
let controlOk = false;
|
|
84
|
+
if (reachable) {
|
|
85
|
+
try {
|
|
86
|
+
const ep = await connectProbe({ space: ledger.space, server: ledger.server, creds });
|
|
87
|
+
try {
|
|
88
|
+
const ps = await ep.requestControl(CONTROL_ADMIN, { op: "ps" });
|
|
89
|
+
// A FAILED ps reply is teardown uncertainty too — not a trustworthy empty roster. Throw so it
|
|
90
|
+
// joins the no-responder/thrown path → controlOk stays false → partial retention (review-ux).
|
|
91
|
+
if (!ps.ok)
|
|
92
|
+
throw new Error(ps.error ?? "ps failed");
|
|
93
|
+
const live = ps.data ?? [];
|
|
94
|
+
liveById = new Map(live.map((r) => [r.id, r]));
|
|
95
|
+
for (const a of ledger.created.agents) {
|
|
96
|
+
const l = liveById.get(a.id);
|
|
97
|
+
if (!l) {
|
|
98
|
+
const sameName = live.find((r) => r.name === a.name);
|
|
99
|
+
if (sameName)
|
|
100
|
+
console.log(c.yellow(` ~ ${a.name}: a different agent (id ${sameName.id.slice(0, 8)}) holds this name — NOT ours, left running`));
|
|
101
|
+
else
|
|
102
|
+
console.log(c.dim(` • ${a.name}: not running`));
|
|
103
|
+
continue;
|
|
104
|
+
}
|
|
105
|
+
const stop = await ep.requestControl(CONTROL_ADMIN, { op: "stop", args: { name: l.name } });
|
|
106
|
+
if (stop.ok) {
|
|
107
|
+
stoppedIds.add(a.id);
|
|
108
|
+
console.log(c.green(` ✓ stopped ${l.name}`));
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
console.log(c.yellow(` ! ${l.name}: stop failed — ${stop.error ?? "unknown"}`));
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
// Channel removal: skip on ANY uncertainty (best-effort, racy — said so in output). The
|
|
115
|
+
// fail-closed "skip when membership is unobservable" rule protects ACL isolation, which exists
|
|
116
|
+
// only on an AUTH mesh; an open mesh has no isolation and no membership feed by design, so an
|
|
117
|
+
// owned card is removable there (otherwise `down -f` could never clean an open dev mesh).
|
|
118
|
+
const openMesh = !creds;
|
|
119
|
+
const stopFailed = ledger.created.agents.some((a) => liveById.has(a.id) && !stoppedIds.has(a.id));
|
|
120
|
+
const snapshot = await ep.readMembership().catch(() => null);
|
|
121
|
+
const ownedIds = new Set(ledger.created.agents.map((a) => a.id));
|
|
122
|
+
const toRemove = [];
|
|
123
|
+
for (const ch of ledger.created.channels) {
|
|
124
|
+
if (stopFailed) {
|
|
125
|
+
skipped.push({ channel: ch, why: "an owned agent failed to stop" });
|
|
126
|
+
continue;
|
|
127
|
+
}
|
|
128
|
+
if (snapshot) {
|
|
129
|
+
const others = snapshot.members.filter((m) => !ownedIds.has(m.id) && (m.durable.includes(ch) || m.live.some((p) => subjectMatches(p, ch))));
|
|
130
|
+
if (others.length) {
|
|
131
|
+
skipped.push({ channel: ch, why: `members present (${others.length})` });
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (!openMesh) {
|
|
136
|
+
skipped.push({ channel: ch, why: "membership unknown (no feed) on an auth mesh" });
|
|
137
|
+
continue;
|
|
138
|
+
}
|
|
139
|
+
else {
|
|
140
|
+
openNoFeed.push(ch); // open mesh, no feed: removable (no isolation), but no membership proof
|
|
141
|
+
}
|
|
142
|
+
toRemove.push(ch);
|
|
143
|
+
}
|
|
144
|
+
if (toRemove.length) {
|
|
145
|
+
await deleteChannels({ servers: ledger.server, space: ledger.space, creds, channels: toRemove });
|
|
146
|
+
removed.push(...toRemove);
|
|
147
|
+
}
|
|
148
|
+
controlOk = true; // got all the way through — the live pass is trustworthy
|
|
149
|
+
}
|
|
150
|
+
finally {
|
|
151
|
+
await ep.stop();
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
catch (e) {
|
|
155
|
+
console.log(c.yellow(` ! ${ledger.server}: control plane unavailable (${e.message}) — nothing torn down remotely; the ledger is RETAINED for a later \`down -f --run ${ledger.runId}\``));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
else {
|
|
159
|
+
console.log(c.yellow(` ! ${ledger.server} unreachable — can't stop processes or remove channels; the ledger is RETAINED for a later \`down -f --run ${ledger.runId}\``));
|
|
160
|
+
}
|
|
161
|
+
// 5) Remote resolution: which owned REMOTE resources are NOT proven handled. An agent is unresolved
|
|
162
|
+
// if the broker was unreachable, or it's still live under our recorded id and its stop failed (an
|
|
163
|
+
// id we don't see live is gone; a same-name/different-id agent is foreign, not ours). A channel
|
|
164
|
+
// is unresolved if it wasn't removed.
|
|
165
|
+
// An agent is resolved only when we explicitly stopped it, OR the control pass was trustworthy and
|
|
166
|
+
// its id isn't live (gone). If the broker was unreachable or the control plane failed, only the
|
|
167
|
+
// agents we actually stopped are resolved — everything else is assumed maybe-running (safe).
|
|
168
|
+
const controlReliable = reachable && controlOk;
|
|
169
|
+
const removedSet = new Set(removed);
|
|
170
|
+
const unresolvedAgents = ledger.created.agents.filter((a) => !stoppedIds.has(a.id) && (!controlReliable || liveById.has(a.id)));
|
|
171
|
+
const unresolvedChannels = ledger.created.channels.filter((ch) => !removedSet.has(ch));
|
|
172
|
+
const unresolvedIds = new Set(unresolvedAgents.map((a) => a.id));
|
|
173
|
+
// 6) Local cred cleanup of RESOLVED agents. A cred is deleted only after its own nkey id matches the
|
|
174
|
+
// recorded id. The dispositions, narrowed by review-fact so retention can't strand the ledger:
|
|
175
|
+
// - no file (undefined) → proven absent, resolved;
|
|
176
|
+
// - sub !== id → a foreign/overwritten cred (OUR cred is already gone) — left in place, reported,
|
|
177
|
+
// NOT retained (retaining would re-trigger every retry → a permanently un-downable ledger);
|
|
178
|
+
// - unverifiable (null: symlink/corrupt) → left in place, reported, NOT retained (same trap; a
|
|
179
|
+
// symlink isn't a cred we wrote) — surfaced loudly so a genuine stale cred isn't silent;
|
|
180
|
+
// - id matches but UNLINK THROWS → OUR cred, a recoverable FS error → retained so a retry finishes.
|
|
181
|
+
const unresolvedCredIds = new Set();
|
|
182
|
+
for (const cp of credPaths) {
|
|
183
|
+
if (unresolvedIds.has(cp.id))
|
|
184
|
+
continue; // remote-unresolved agent keeps its cred (still in use / retry)
|
|
185
|
+
const sub = credSubject(cp.path);
|
|
186
|
+
if (sub === undefined)
|
|
187
|
+
continue; // no cred file — proven absent
|
|
188
|
+
if (sub === null) {
|
|
189
|
+
console.error(c.yellow(` ! ${cp.name} creds: unreadable/unverifiable — left in place (resolve by hand if it's a stale cred)`));
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
if (sub !== cp.id) {
|
|
193
|
+
console.error(c.yellow(` ~ ${cp.name} creds belong to a different agent (id ${sub.slice(0, 8)} ≠ ${cp.id.slice(0, 8)}) — ours is gone, left in place`));
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
try {
|
|
197
|
+
if (unlinkFileNoFollow(cp.path))
|
|
198
|
+
console.log(c.dim(` • removed creds for ${cp.name}`));
|
|
199
|
+
}
|
|
200
|
+
catch (e) {
|
|
201
|
+
console.error(c.yellow(` ! ${cp.name} creds: ${e.message} — retained for retry`));
|
|
202
|
+
unresolvedCredIds.add(cp.id); // OUR id-verified cred, unlink failed (recoverable) → keep the record
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
// 7) Disposition. The ledger is deleted only when EVERY owned resource — remote agents, channels,
|
|
206
|
+
// AND our own credential files — is removed or proven gone; otherwise it's rewritten DOWN to the
|
|
207
|
+
// unresolved set (atomic temp-then-rename) so a later `down -f --run` finishes. Never erase the
|
|
208
|
+
// only ownership record while anything owned may remain (critic/security/engineer/ux PR2 gate).
|
|
209
|
+
const retainIds = new Set([...unresolvedIds, ...unresolvedCredIds]);
|
|
210
|
+
const complete = retainIds.size === 0 && unresolvedChannels.length === 0;
|
|
211
|
+
for (const s of skipped)
|
|
212
|
+
console.log(c.yellow(` ~ left ${c.cyan("#" + s.channel)}: ${s.why}`) + c.dim(" (best-effort membership check — racy)"));
|
|
213
|
+
if (openNoFeed.length)
|
|
214
|
+
console.log(c.dim(` note: removed ${openNoFeed.length} channel(s) on an OPEN mesh with no membership feed — no ACL isolation to protect, no membership proof: ${openNoFeed.map((n) => "#" + n).join(", ")}`));
|
|
215
|
+
if (complete) {
|
|
216
|
+
// Everything owned is removed/proven gone — safe to delete the run dir + launch spec + ledger.
|
|
217
|
+
try {
|
|
218
|
+
unlinkFileNoFollow(specPath);
|
|
219
|
+
}
|
|
220
|
+
catch (e) {
|
|
221
|
+
console.error(c.yellow(` ! launch spec: ${e.message}`));
|
|
222
|
+
}
|
|
223
|
+
if (runDir)
|
|
224
|
+
rmSync(runDir, { recursive: true, force: true });
|
|
225
|
+
try {
|
|
226
|
+
unlinkFileNoFollow(ledgerPath);
|
|
227
|
+
}
|
|
228
|
+
catch (e) {
|
|
229
|
+
console.error(c.yellow(` ! ledger: ${e.message}`));
|
|
230
|
+
}
|
|
231
|
+
console.log(c.green(`✓ torn down run ${ledger.runId}`) + (removed.length ? c.dim(` — removed ${removed.length} channel(s): ${removed.map((n) => "#" + n).join(", ")}`) : ""));
|
|
232
|
+
}
|
|
233
|
+
else {
|
|
234
|
+
// Partial: rewrite the ledger DOWN to the unresolved resources so a later `down -f --run` finishes.
|
|
235
|
+
const remainAgents = ledger.created.agents.filter((a) => retainIds.has(a.id));
|
|
236
|
+
const remaining = { ...ledger, created: { channels: unresolvedChannels, agents: remainAgents } };
|
|
237
|
+
writeLedger(root, remaining, { update: true });
|
|
238
|
+
console.log(c.yellow(`! partial teardown of run ${ledger.runId}`) +
|
|
239
|
+
c.dim(` — ${remainAgents.length} agent(s) + ${unresolvedChannels.length} channel(s) still owned; ledger kept`));
|
|
240
|
+
if (unresolvedCredIds.size)
|
|
241
|
+
console.log(c.dim(` local credential cleanup incomplete for ${unresolvedCredIds.size} agent(s) — ledger kept for retry`));
|
|
242
|
+
console.log(c.dim(` finish later (broker up / members gone): cotal down -f ${ledger.manifestPath} --run ${ledger.runId}`));
|
|
243
|
+
process.exitCode = 1; // not a full success
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
/** Extract the nkey subject (the agent id) from a NATS creds file's user JWT — to verify a cred file
|
|
247
|
+
* belongs to the recorded agent before `down -f` deletes it. Returns `undefined` if the file is
|
|
248
|
+
* absent, or `null` if it can't be verified (symlink / not a regular file / no JWT / unparseable) so
|
|
249
|
+
* the caller fails closed and leaves it. */
|
|
250
|
+
function credSubject(path) {
|
|
251
|
+
let raw;
|
|
252
|
+
try {
|
|
253
|
+
const st = lstatSync(path);
|
|
254
|
+
if (st.isSymbolicLink() || !st.isFile())
|
|
255
|
+
return null;
|
|
256
|
+
raw = readFileSync(path, "utf8");
|
|
257
|
+
}
|
|
258
|
+
catch (e) {
|
|
259
|
+
if (e.code === "ENOENT")
|
|
260
|
+
return undefined;
|
|
261
|
+
return null;
|
|
262
|
+
}
|
|
263
|
+
const jwt = raw.split("\n").find((l) => l && !l.startsWith("-") && l.split(".").length === 3);
|
|
264
|
+
if (!jwt)
|
|
265
|
+
return null;
|
|
266
|
+
try {
|
|
267
|
+
const claims = JSON.parse(Buffer.from(jwt.split(".")[1], "base64url").toString("utf8"));
|
|
268
|
+
return typeof claims.sub === "string" ? claims.sub : null;
|
|
269
|
+
}
|
|
270
|
+
catch {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
/** Mint a manager (admin-control) cred for the ledger's space from the local trust material, or
|
|
275
|
+
* undefined for an open mesh / mismatched checkout (then we connect bare and do local cleanup). */
|
|
276
|
+
async function mintIfAuth(root, space) {
|
|
277
|
+
const auth = loadSpaceAuth(authDir(root));
|
|
278
|
+
if (!auth || auth.space !== space)
|
|
279
|
+
return undefined;
|
|
280
|
+
return mintCreds(auth, newIdentity(), "manager");
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=down-manifest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"down-manifest.js","sourceRoot":"","sources":["../../src/commands/down-manifest.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AACH,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,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C,IAAI,CAAC,CAAC,CAAC;IAC1C,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,KAAK,KAAK,KAAK;QAAE,OAAO,SAAS,CAAC;IACpD,OAAO,SAAS,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,SAAS,CAAC,CAAC;AACnD,CAAC"}
|
package/dist/commands/down.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
/** Stop the background processes started by `cotal up --detach` / `cotal setup`:
|
|
2
|
-
*
|
|
3
|
-
|
|
1
|
+
/** Stop the background processes started by `cotal up --detach` / `cotal setup`: the manager, the
|
|
2
|
+
* delivery daemon, the web dashboard, and the mesh. With `-f <cotal.yaml>` (or `--run <id>`) it does
|
|
3
|
+
* an ownership-scoped teardown of a `spawn -f` deploy instead — removing ONLY what that run created
|
|
4
|
+
* (its agents + the channels it added), from the ledger, never the whole shared mesh. */
|
|
5
|
+
export declare function down(argv?: string[]): Promise<void>;
|
|
4
6
|
//# sourceMappingURL=down.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"down.d.ts","sourceRoot":"","sources":["../../src/commands/down.ts"],"names":[],"mappings":"AAQA;;;0FAG0F;AAC1F,wBAAsB,IAAI,CAAC,IAAI,GAAE,MAAM,EAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAyC7D"}
|
package/dist/commands/down.js
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
1
|
import { existsSync, readFileSync, rmSync } from "node:fs";
|
|
2
|
+
import { parseArgs } from "node:util";
|
|
3
|
+
import { clearCurrent, getCurrent, removeMesh } from "@cotal-ai/workspace";
|
|
2
4
|
import { c } from "../ui.js";
|
|
3
5
|
import { cotalPath } from "../lib/paths.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
import { resolveSpace } from "../lib/status.js";
|
|
7
|
+
import { downManifest } from "./down-manifest.js";
|
|
8
|
+
/** Stop the background processes started by `cotal up --detach` / `cotal setup`: the manager, the
|
|
9
|
+
* delivery daemon, the web dashboard, and the mesh. With `-f <cotal.yaml>` (or `--run <id>`) it does
|
|
10
|
+
* an ownership-scoped teardown of a `spawn -f` deploy instead — removing ONLY what that run created
|
|
11
|
+
* (its agents + the channels it added), from the ledger, never the whole shared mesh. */
|
|
12
|
+
export async function down(argv = []) {
|
|
13
|
+
const { values } = parseArgs({
|
|
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
|
+
});
|
|
22
|
+
if (values.file || values.run) {
|
|
23
|
+
await downManifest(values.file ?? "<run>", { run: values.run, dryRun: Boolean(values["dry-run"]) });
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
7
26
|
const targets = [
|
|
8
27
|
["manager.pid", "manager"],
|
|
9
28
|
["delivery.pid", "delivery daemon"],
|
|
@@ -22,6 +41,14 @@ export async function down() {
|
|
|
22
41
|
// marker. Drop them with the processes so a stale creds file / marker never lingers.
|
|
23
42
|
for (const f of ["delivery.creds", "manager.delivery-aware"])
|
|
24
43
|
rmSync(cotalPath(f), { force: true });
|
|
44
|
+
// Transient `cotal up -f` launch artifacts (launch specs + materialized runtime personas). `up -f`
|
|
45
|
+
// owns the whole mesh, so tearing it down clears all run dirs — they're never authoritative source.
|
|
46
|
+
rmSync(cotalPath("run"), { recursive: true, force: true });
|
|
47
|
+
// Drop this folder's mesh from the registry (and the `current` pointer if it was the default).
|
|
48
|
+
const space = resolveSpace(process.cwd());
|
|
49
|
+
removeMesh(space);
|
|
50
|
+
if (getCurrent() === space)
|
|
51
|
+
clearCurrent();
|
|
25
52
|
if (!any) {
|
|
26
53
|
console.error(c.red("Nothing running here (no .cotal/*.pid). Was it started with `cotal up` / `cotal setup`?"));
|
|
27
54
|
process.exit(1);
|
|
@@ -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,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;
|
|
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,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAC3E,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD;;;0FAG0F;AAC1F,MAAM,CAAC,KAAK,UAAU,IAAI,CAAC,OAAiB,EAAE;IAC5C,MAAM,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;QAC3B,IAAI,EAAE,IAAI;QACV,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACP,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,iDAAiD;YACvF,GAAG,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,oEAAoE;YAC7F,SAAS,EAAE,EAAE,IAAI,EAAE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U,CAAC,KAAK,CAAC,CAAC;IAClB,IAAI,UAAU,EAAE,KAAK,KAAK;QAAE,YAAY,EAAE,CAAC;IAC3C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,yFAAyF,CAAC,CAAC,CAAC;QAChH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,SAAS,IAAI,CAAC,OAAe,EAAE,KAAa;IAC1C,MAAM,GAAG,GAAG,MAAM,CAAC,YAAY,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC;IACzD,IAAI,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC,CAAC;QAC7B,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,aAAa,KAAK,SAAS,GAAG,GAAG,CAAC,CAAC,CAAC;IAC1D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK,SAAS,GAAG,oBAAoB,CAAC,CAAC,CAAC;IAC/D,CAAC;IACD,MAAM,CAAC,OAAO,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/commands/history.ts"],"names":[],"mappings":"AAKA;mFACmF;AACnF,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAiC3D"}
|