@cotal-ai/workspace 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/colors.d.ts +16 -0
- package/dist/colors.d.ts.map +1 -0
- package/dist/colors.js +16 -0
- package/dist/colors.js.map +1 -0
- package/dist/connect.d.ts +75 -0
- package/dist/connect.d.ts.map +1 -0
- package/dist/connect.js +90 -0
- package/dist/connect.js.map +1 -0
- package/dist/default-agent.d.ts +11 -0
- package/dist/default-agent.d.ts.map +1 -0
- package/dist/default-agent.js +19 -0
- package/dist/default-agent.js.map +1 -0
- package/dist/extensions.d.ts +52 -0
- package/dist/extensions.d.ts.map +1 -0
- package/dist/extensions.js +57 -0
- package/dist/extensions.js.map +1 -0
- package/dist/flags.d.ts +126 -0
- package/dist/flags.d.ts.map +1 -0
- package/dist/flags.js +39 -0
- package/dist/flags.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/provenance.d.ts +14 -0
- package/dist/provenance.d.ts.map +1 -0
- package/dist/provenance.js +18 -0
- package/dist/provenance.js.map +1 -0
- package/dist/space.d.ts +5 -0
- package/dist/space.d.ts.map +1 -0
- package/dist/space.js +9 -0
- package/dist/space.js.map +1 -0
- package/package.json +2 -2
package/dist/colors.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ANSI color helpers for operator-facing terminal output — shared by every command surface
|
|
2
|
+
* (@cotal-ai/cli, cotal-web) so they render identically. Workstation-layer
|
|
3
|
+
* concern: the wire protocol in core never prints. */
|
|
4
|
+
export declare const c: {
|
|
5
|
+
dim: (s: string) => string;
|
|
6
|
+
bold: (s: string) => string;
|
|
7
|
+
green: (s: string) => string;
|
|
8
|
+
cyan: (s: string) => string;
|
|
9
|
+
yellow: (s: string) => string;
|
|
10
|
+
red: (s: string) => string;
|
|
11
|
+
magenta: (s: string) => string;
|
|
12
|
+
gray: (s: string) => string;
|
|
13
|
+
};
|
|
14
|
+
/** 256-color foreground wrapper (xterm color index 0-255). */
|
|
15
|
+
export declare const color256: (n: number) => (s: string) => string;
|
|
16
|
+
//# sourceMappingURL=colors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;uDAEuD;AACvD,eAAO,MAAM,CAAC;aACH,MAAM;cACL,MAAM;eACL,MAAM;cACP,MAAM;gBACJ,MAAM;aACT,MAAM;iBACF,MAAM;cACT,MAAM;CACjB,CAAC;AAEF,8DAA8D;AAC9D,eAAO,MAAM,QAAQ,GAAI,GAAG,MAAM,MAAM,GAAG,MAAM,WAAiC,CAAC"}
|
package/dist/colors.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** ANSI color helpers for operator-facing terminal output — shared by every command surface
|
|
2
|
+
* (@cotal-ai/cli, cotal-web) so they render identically. Workstation-layer
|
|
3
|
+
* concern: the wire protocol in core never prints. */
|
|
4
|
+
export const c = {
|
|
5
|
+
dim: (s) => `\x1b[2m${s}\x1b[0m`,
|
|
6
|
+
bold: (s) => `\x1b[1m${s}\x1b[0m`,
|
|
7
|
+
green: (s) => `\x1b[32m${s}\x1b[0m`,
|
|
8
|
+
cyan: (s) => `\x1b[36m${s}\x1b[0m`,
|
|
9
|
+
yellow: (s) => `\x1b[33m${s}\x1b[0m`,
|
|
10
|
+
red: (s) => `\x1b[31m${s}\x1b[0m`,
|
|
11
|
+
magenta: (s) => `\x1b[35m${s}\x1b[0m`,
|
|
12
|
+
gray: (s) => `\x1b[90m${s}\x1b[0m`,
|
|
13
|
+
};
|
|
14
|
+
/** 256-color foreground wrapper (xterm color index 0-255). */
|
|
15
|
+
export const color256 = (n) => (s) => `\x1b[38;5;${n}m${s}\x1b[0m`;
|
|
16
|
+
//# sourceMappingURL=colors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;uDAEuD;AACvD,MAAM,CAAC,MAAM,CAAC,GAAG;IACf,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS;IACxC,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS;IACzC,KAAK,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC3C,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC1C,MAAM,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC5C,GAAG,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IACzC,OAAO,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;IAC7C,IAAI,EAAE,CAAC,CAAS,EAAE,EAAE,CAAC,WAAW,CAAC,SAAS;CAC3C,CAAC;AAEF,8DAA8D;AAC9D,MAAM,CAAC,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,SAAS,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { type Profile, type SpaceAuth } from "@cotal-ai/core";
|
|
2
|
+
import { type MeshTarget } from "./mesh-target.js";
|
|
3
|
+
/**
|
|
4
|
+
* The one way every command that touches a running mesh figures out WHICH mesh + with what creds,
|
|
5
|
+
* and confirms it's actually up — shared by every command surface (@cotal-ai/cli, cotal-web)
|
|
6
|
+
* so `spawn`, `send`, `console`, `web`, … all behave identically from any
|
|
7
|
+
* directory. The pure resolution/probe/classify/render steps live beside this file; these wrappers
|
|
8
|
+
* own the OPERATOR I/O — they colour, print the command-copy line, and exit the process. That is
|
|
9
|
+
* deliberate: this is the workstation layer, not the wire library (core never prints or exits).
|
|
10
|
+
* Two escape hatches take a RAW off-registry connection (no registry lookup, no stale-prune):
|
|
11
|
+
* explicit `--creds`, and `--server` + an unregistered `--space` (an open remote mesh that has no
|
|
12
|
+
* creds to pass).
|
|
13
|
+
*/
|
|
14
|
+
export interface ConnectFlags {
|
|
15
|
+
server?: string;
|
|
16
|
+
space?: string;
|
|
17
|
+
/** Explicit creds file — triggers a raw off-registry connection (see {@link connectOrExit}). */
|
|
18
|
+
creds?: string;
|
|
19
|
+
}
|
|
20
|
+
/** Raw NATS auth for an off-registry connection — a join link / --token / --user+--pass / --creds.
|
|
21
|
+
* Structurally matches what `probeConnect` accepts. */
|
|
22
|
+
export interface RawAuth {
|
|
23
|
+
token?: string;
|
|
24
|
+
user?: string;
|
|
25
|
+
pass?: string;
|
|
26
|
+
creds?: string;
|
|
27
|
+
tls?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export interface Connection {
|
|
30
|
+
server: string;
|
|
31
|
+
space: string;
|
|
32
|
+
creds?: string;
|
|
33
|
+
/** The mesh's trust material when resolved from the registry on an auth mesh — undefined for an
|
|
34
|
+
* open mesh or a raw off-registry connection (`--creds` or `--server`+unregistered `--space`).
|
|
35
|
+
* (web keeps it for its per-delete manager mint.) */
|
|
36
|
+
auth?: SpaceAuth;
|
|
37
|
+
/** The resolved mesh's recorded checkout root, for a REGISTERED mesh — undefined for a raw
|
|
38
|
+
* off-registry connection (`--creds`, or `--server`+unregistered `--space`). `spawn -f`/`down -f`
|
|
39
|
+
* use it to enforce the same-checkout invariant: local launch artifacts + the ledger live under
|
|
40
|
+
* this checkout, so deploying onto a mesh recorded by another checkout would decouple them. */
|
|
41
|
+
root?: string;
|
|
42
|
+
/** How the target was resolved (registry / current / flag-space / …) — undefined for raw. */
|
|
43
|
+
source?: MeshTarget["source"];
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Resolve where a mesh-touching command connects + with what creds.
|
|
47
|
+
* • Explicit `--creds` → a RAW off-registry connection: straight to `--server` (default loopback)
|
|
48
|
+
* as `--space`, with those creds. No registry lookup, no stale-prune, plain reachability message
|
|
49
|
+
* (the user is deliberately off-registry — e.g. a remote mesh that isn't locally recorded).
|
|
50
|
+
* • Otherwise → resolve the running mesh from the registry (works from any dir), mint `role` creds
|
|
51
|
+
* on an auth mesh, and preflight with the registry's stale-prune.
|
|
52
|
+
*/
|
|
53
|
+
export declare function connectOrExit(flags: ConnectFlags, role: Profile): Promise<Connection>;
|
|
54
|
+
/** Reachability check for a RAW (off-registry) connection — one plain sentence, never a registry/
|
|
55
|
+
* stale-entry message and never a prune. Used by the `--creds` escape hatch and `join`'s explicit
|
|
56
|
+
* (link/token/creds) path, both of which connect to a broker the user named, not the registry. */
|
|
57
|
+
export declare function reachableOrExit(server: string, auth?: RawAuth): Promise<void>;
|
|
58
|
+
/** Resolve the mesh a command targets, exiting with one human sentence on an unresolved/ambiguous
|
|
59
|
+
* registry rather than a stack trace. Prunes dead registry entries first so a crashed mesh doesn't
|
|
60
|
+
* block a bare command or appear in the "pick one" list — but ONLY when resolving without an
|
|
61
|
+
* explicit `--space`. A named `--space` is resolved + preflighted directly, so pre-pruning can't
|
|
62
|
+
* erase a dead-recorded mesh the operator is recovering with a live `--server` override; preflight
|
|
63
|
+
* still prunes it (with the friendly message) when no override revives it. */
|
|
64
|
+
export declare function resolveTargetOrExit(flags: {
|
|
65
|
+
server?: string;
|
|
66
|
+
space?: string;
|
|
67
|
+
}): Promise<MeshTarget>;
|
|
68
|
+
/** Confirm the resolved mesh is up and accepts these creds — replaces the raw NATS "Authorization
|
|
69
|
+
* Violation" trace with one sentence, and prunes the entry if the broker is gone / mismatched.
|
|
70
|
+
* The probe + classify + render live beside this file; this wrapper owns the operator I/O — it
|
|
71
|
+
* acts on the prune decision, colours, and exits. Probes with `probeCreds` when given (the
|
|
72
|
+
* caller's `--creds`/minted creds); otherwise a throwaway identity is minted from the target's
|
|
73
|
+
* own trust material. */
|
|
74
|
+
export declare function preflightOrExit(target: MeshTarget, probeCreds?: string): Promise<void>;
|
|
75
|
+
//# sourceMappingURL=connect.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connect.d.ts","sourceRoot":"","sources":["../src/connect.ts"],"names":[],"mappings":"AACA,OAAO,EAML,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAA6C,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAI9F;;;;;;;;;;GAUG;AAEH,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gGAAgG;IAChG,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;wDACwD;AACxD,MAAM,WAAW,OAAO;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;0DAEsD;IACtD,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB;;;oGAGgG;IAChG,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,6FAA6F;IAC7F,MAAM,CAAC,EAAE,UAAU,CAAC,QAAQ,CAAC,CAAC;CAC/B;AAED;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,CAoB3F;AAED;;mGAEmG;AACnG,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,GAAE,OAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CAKvF;AAED;;;;;+EAK+E;AAC/E,wBAAsB,mBAAmB,CAAC,KAAK,EAAE;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmBtB;AAED;;;;;0BAK0B;AAC1B,wBAAsB,eAAe,CAAC,MAAM,EAAE,UAAU,EAAE,UAAU,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAM5F"}
|
package/dist/connect.js
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { readFileSync } from "node:fs";
|
|
2
|
+
import { DEFAULT_SERVER, DEFAULT_SPACE, mintCreds, newIdentity, probeConnect, } from "@cotal-ai/core";
|
|
3
|
+
import { c } from "./colors.js";
|
|
4
|
+
import { findMesh, getCurrent, removeMesh } from "./mesh-registry.js";
|
|
5
|
+
import { isWorkspaceTargetError, resolveMeshTarget } from "./mesh-target.js";
|
|
6
|
+
import { preflightTarget, pruneStaleMeshes } from "./preflight.js";
|
|
7
|
+
import { renderWorkspaceError } from "./render.js";
|
|
8
|
+
/**
|
|
9
|
+
* Resolve where a mesh-touching command connects + with what creds.
|
|
10
|
+
* • Explicit `--creds` → a RAW off-registry connection: straight to `--server` (default loopback)
|
|
11
|
+
* as `--space`, with those creds. No registry lookup, no stale-prune, plain reachability message
|
|
12
|
+
* (the user is deliberately off-registry — e.g. a remote mesh that isn't locally recorded).
|
|
13
|
+
* • Otherwise → resolve the running mesh from the registry (works from any dir), mint `role` creds
|
|
14
|
+
* on an auth mesh, and preflight with the registry's stale-prune.
|
|
15
|
+
*/
|
|
16
|
+
export async function connectOrExit(flags, role) {
|
|
17
|
+
if (flags.creds) {
|
|
18
|
+
const server = flags.server ?? DEFAULT_SERVER;
|
|
19
|
+
const space = flags.space ?? DEFAULT_SPACE;
|
|
20
|
+
const creds = readFileSync(flags.creds, "utf8");
|
|
21
|
+
await reachableOrExit(server, { creds });
|
|
22
|
+
return { server, space, creds };
|
|
23
|
+
}
|
|
24
|
+
// A raw OPEN remote mesh: explicit `--server` + a `--space` that isn't locally registered. Naming
|
|
25
|
+
// both is as deliberate as `--creds`, but an open broker has no creds to pass — connect bare,
|
|
26
|
+
// off-registry (no registry lookup, no prune). A registered `--space` still goes through the
|
|
27
|
+
// resolver below (which honors `--server` as an override); `--server` alone resolves there too.
|
|
28
|
+
if (flags.server && flags.space && !findMesh(flags.space)) {
|
|
29
|
+
await reachableOrExit(flags.server, {});
|
|
30
|
+
return { server: flags.server, space: flags.space };
|
|
31
|
+
}
|
|
32
|
+
const target = await resolveTargetOrExit({ server: flags.server, space: flags.space });
|
|
33
|
+
const creds = target.auth ? await mintCreds(target.auth, newIdentity(), role) : undefined;
|
|
34
|
+
await preflightOrExit(target, creds);
|
|
35
|
+
return { server: target.server, space: target.space, creds, auth: target.auth, root: target.root, source: target.source };
|
|
36
|
+
}
|
|
37
|
+
/** Reachability check for a RAW (off-registry) connection — one plain sentence, never a registry/
|
|
38
|
+
* stale-entry message and never a prune. Used by the `--creds` escape hatch and `join`'s explicit
|
|
39
|
+
* (link/token/creds) path, both of which connect to a broker the user named, not the registry. */
|
|
40
|
+
export async function reachableOrExit(server, auth = {}) {
|
|
41
|
+
const probe = await probeConnect(server, auth);
|
|
42
|
+
if (probe.ok)
|
|
43
|
+
return;
|
|
44
|
+
console.error(c.red(renderWorkspaceError({ kind: "reachable", reason: probe.reason, server })));
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
|
47
|
+
/** Resolve the mesh a command targets, exiting with one human sentence on an unresolved/ambiguous
|
|
48
|
+
* registry rather than a stack trace. Prunes dead registry entries first so a crashed mesh doesn't
|
|
49
|
+
* block a bare command or appear in the "pick one" list — but ONLY when resolving without an
|
|
50
|
+
* explicit `--space`. A named `--space` is resolved + preflighted directly, so pre-pruning can't
|
|
51
|
+
* erase a dead-recorded mesh the operator is recovering with a live `--server` override; preflight
|
|
52
|
+
* still prunes it (with the friendly message) when no override revives it. */
|
|
53
|
+
export async function resolveTargetOrExit(flags) {
|
|
54
|
+
if (!flags.space)
|
|
55
|
+
await pruneStaleMeshes();
|
|
56
|
+
let target;
|
|
57
|
+
try {
|
|
58
|
+
target = resolveMeshTarget(process.cwd(), flags);
|
|
59
|
+
}
|
|
60
|
+
catch (e) {
|
|
61
|
+
if (isWorkspaceTargetError(e)) {
|
|
62
|
+
console.error(c.red(renderWorkspaceError({ kind: "target", error: e })));
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
throw e;
|
|
66
|
+
}
|
|
67
|
+
// If a dangling `current` was silently bypassed — it named a mesh that's since gone and we fell
|
|
68
|
+
// back to the only live one — say so. The N>1 case errors loudly; this is the one spot that would
|
|
69
|
+
// otherwise quietly redirect a stale default.
|
|
70
|
+
const cur = getCurrent();
|
|
71
|
+
if (cur && !findMesh(cur) && target.source === "registry")
|
|
72
|
+
console.error(c.dim(`note: default mesh "${cur}" is down — using "${target.space}"`));
|
|
73
|
+
return target;
|
|
74
|
+
}
|
|
75
|
+
/** Confirm the resolved mesh is up and accepts these creds — replaces the raw NATS "Authorization
|
|
76
|
+
* Violation" trace with one sentence, and prunes the entry if the broker is gone / mismatched.
|
|
77
|
+
* The probe + classify + render live beside this file; this wrapper owns the operator I/O — it
|
|
78
|
+
* acts on the prune decision, colours, and exits. Probes with `probeCreds` when given (the
|
|
79
|
+
* caller's `--creds`/minted creds); otherwise a throwaway identity is minted from the target's
|
|
80
|
+
* own trust material. */
|
|
81
|
+
export async function preflightOrExit(target, probeCreds) {
|
|
82
|
+
const r = await preflightTarget(target, probeCreds);
|
|
83
|
+
if (r.ok)
|
|
84
|
+
return;
|
|
85
|
+
if (r.prune)
|
|
86
|
+
removeMesh(target.space);
|
|
87
|
+
console.error(c.red(renderWorkspaceError({ kind: "preflight", failure: r.kind, target, pruned: r.prune })));
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=connect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AAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5G,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const DEFAULT_AGENT_ENV = "COTAL_DEFAULT_AGENT";
|
|
2
|
+
export declare const DEFAULT_PERSONA_ENV = "COTAL_DEFAULT_PERSONA";
|
|
3
|
+
/** The operator-level default connector/agent harness, when set. */
|
|
4
|
+
export declare function defaultAgentOverride(env?: NodeJS.ProcessEnv): string | undefined;
|
|
5
|
+
/** Resolve the default connector/agent harness with the product fallback for this launch path. */
|
|
6
|
+
export declare function defaultAgentType(fallback: string, env?: NodeJS.ProcessEnv): string;
|
|
7
|
+
/** The operator-level default persona ref (catalog name or path), when set. */
|
|
8
|
+
export declare function defaultPersonaOverride(env?: NodeJS.ProcessEnv): string | undefined;
|
|
9
|
+
/** Resolve the default persona ref with the product fallback. */
|
|
10
|
+
export declare function defaultPersonaRef(fallback?: string, env?: NodeJS.ProcessEnv): string;
|
|
11
|
+
//# sourceMappingURL=default-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-agent.d.ts","sourceRoot":"","sources":["../src/default-agent.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,wBAAwB,CAAC;AACvD,eAAO,MAAM,mBAAmB,0BAA0B,CAAC;AAE3D,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAE7F;AAED,kGAAkG;AAClG,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAE/F;AAED,+EAA+E;AAC/E,wBAAgB,sBAAsB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,GAAG,SAAS,CAE/F;AAED,iEAAiE;AACjE,wBAAgB,iBAAiB,CAAC,QAAQ,SAAY,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAEpG"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export const DEFAULT_AGENT_ENV = "COTAL_DEFAULT_AGENT";
|
|
2
|
+
export const DEFAULT_PERSONA_ENV = "COTAL_DEFAULT_PERSONA";
|
|
3
|
+
/** The operator-level default connector/agent harness, when set. */
|
|
4
|
+
export function defaultAgentOverride(env = process.env) {
|
|
5
|
+
return env[DEFAULT_AGENT_ENV]?.trim() || undefined;
|
|
6
|
+
}
|
|
7
|
+
/** Resolve the default connector/agent harness with the product fallback for this launch path. */
|
|
8
|
+
export function defaultAgentType(fallback, env = process.env) {
|
|
9
|
+
return defaultAgentOverride(env) ?? fallback;
|
|
10
|
+
}
|
|
11
|
+
/** The operator-level default persona ref (catalog name or path), when set. */
|
|
12
|
+
export function defaultPersonaOverride(env = process.env) {
|
|
13
|
+
return env[DEFAULT_PERSONA_ENV]?.trim() || undefined;
|
|
14
|
+
}
|
|
15
|
+
/** Resolve the default persona ref with the product fallback. */
|
|
16
|
+
export function defaultPersonaRef(fallback = "default", env = process.env) {
|
|
17
|
+
return defaultPersonaOverride(env) ?? fallback;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=default-agent.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"default-agent.js","sourceRoot":"","sources":["../src/default-agent.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AACvD,MAAM,CAAC,MAAM,mBAAmB,GAAG,uBAAuB,CAAC;AAE3D,oEAAoE;AACpE,MAAM,UAAU,oBAAoB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACvE,OAAO,GAAG,CAAC,iBAAiB,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AACrD,CAAC;AAED,kGAAkG;AAClG,MAAM,UAAU,gBAAgB,CAAC,QAAgB,EAAE,MAAyB,OAAO,CAAC,GAAG;IACrF,OAAO,oBAAoB,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC;AAC/C,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,sBAAsB,CAAC,MAAyB,OAAO,CAAC,GAAG;IACzE,OAAO,GAAG,CAAC,mBAAmB,CAAC,EAAE,IAAI,EAAE,IAAI,SAAS,CAAC;AACvD,CAAC;AAED,iEAAiE;AACjE,MAAM,UAAU,iBAAiB,CAAC,QAAQ,GAAG,SAAS,EAAE,MAAyB,OAAO,CAAC,GAAG;IAC1F,OAAO,sBAAsB,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC;AACjD,CAAC"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { Command, FlagSpec } from "@cotal-ai/core";
|
|
2
|
+
/**
|
|
3
|
+
* Operator-installed CLI extensions (`cotal ext add <npm-package>`): the workstation state.
|
|
4
|
+
*
|
|
5
|
+
* Extensions install into a cotal-owned npm prefix (`$XDG_CONFIG_HOME/cotal/extensions/`, with
|
|
6
|
+
* its own package.json) — never the user's project. A MANIFEST records each installed package
|
|
7
|
+
* plus a CACHE of the command metadata it contributed. Two hard rules from the design review:
|
|
8
|
+
*
|
|
9
|
+
* - The manifest is a DISPLAY/TAB cache ONLY. Help and `__complete` read it (so a <TAB> never
|
|
10
|
+
* imports an extension), but at dispatch the freshly-imported command's LIVE specs are
|
|
11
|
+
* authoritative — cached specs never drive parsing (version skew would corrupt `run`'s input).
|
|
12
|
+
* - `name@version` is pinned at add time and verified at run-import; a mismatch is a loud error
|
|
13
|
+
* prescribing `cotal ext add` again — never a silent re-cache.
|
|
14
|
+
*/
|
|
15
|
+
/** One cached command: the JSON-serializable display surface of a {@link Command} (its `run` /
|
|
16
|
+
* `complete` functions stay in the package — the cache can render help and offer flag names,
|
|
17
|
+
* nothing more). */
|
|
18
|
+
export interface CachedCommand {
|
|
19
|
+
readonly name: string;
|
|
20
|
+
readonly summary: string;
|
|
21
|
+
readonly group?: string;
|
|
22
|
+
readonly usage?: string;
|
|
23
|
+
readonly hidden?: boolean;
|
|
24
|
+
readonly flags?: readonly FlagSpec[];
|
|
25
|
+
readonly positionals?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface InstalledExtension {
|
|
28
|
+
/** The npm package name (the import + `node_modules` key). */
|
|
29
|
+
readonly pkg: string;
|
|
30
|
+
/** Exact installed version, pinned at add time and verified at run-import. */
|
|
31
|
+
readonly version: string;
|
|
32
|
+
/** The spec the operator passed to `ext add` (registry range, file:, tarball…) — for re-adds. */
|
|
33
|
+
readonly spec: string;
|
|
34
|
+
readonly commands: readonly CachedCommand[];
|
|
35
|
+
}
|
|
36
|
+
export interface ExtensionsManifest {
|
|
37
|
+
readonly extensions: readonly InstalledExtension[];
|
|
38
|
+
}
|
|
39
|
+
/** The extensions prefix: `<config>/cotal/extensions` — its own npm installation root. */
|
|
40
|
+
export declare function extensionsDir(): string;
|
|
41
|
+
export declare function extensionsManifestPath(): string;
|
|
42
|
+
/** Load the manifest. Missing file → no extensions. A CORRUPT file is a loud error (never treat
|
|
43
|
+
* installed extensions as absent — commands would silently vanish from help). */
|
|
44
|
+
export declare function loadExtensionsManifest(): ExtensionsManifest;
|
|
45
|
+
export declare function saveExtensionsManifest(m: ExtensionsManifest): void;
|
|
46
|
+
/** Strip a live {@link Command} down to its serializable display surface for the cache. */
|
|
47
|
+
export declare function cacheCommand(cmd: Command): CachedCommand;
|
|
48
|
+
/** The installed package's on-disk root inside the prefix. */
|
|
49
|
+
export declare function extensionPackageDir(pkg: string): string;
|
|
50
|
+
/** The installed package's CURRENT version, read from disk (undefined when not installed). */
|
|
51
|
+
export declare function installedExtensionVersion(pkg: string): string | undefined;
|
|
52
|
+
//# sourceMappingURL=extensions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.d.ts","sourceRoot":"","sources":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GAAG,MAAM,CAEvD;AAED,8FAA8F;AAC9F,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAKzE"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { globalConfigDir } from "@cotal-ai/core";
|
|
4
|
+
/** The extensions prefix: `<config>/cotal/extensions` — its own npm installation root. */
|
|
5
|
+
export function extensionsDir() {
|
|
6
|
+
return join(globalConfigDir(), "extensions");
|
|
7
|
+
}
|
|
8
|
+
export function extensionsManifestPath() {
|
|
9
|
+
return join(extensionsDir(), "extensions.json");
|
|
10
|
+
}
|
|
11
|
+
/** Load the manifest. Missing file → no extensions. A CORRUPT file is a loud error (never treat
|
|
12
|
+
* installed extensions as absent — commands would silently vanish from help). */
|
|
13
|
+
export function loadExtensionsManifest() {
|
|
14
|
+
const p = extensionsManifestPath();
|
|
15
|
+
if (!existsSync(p))
|
|
16
|
+
return { extensions: [] };
|
|
17
|
+
let parsed;
|
|
18
|
+
try {
|
|
19
|
+
parsed = JSON.parse(readFileSync(p, "utf8"));
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
throw new Error(`corrupt extensions manifest ${p}: ${e.message} — fix or delete it, then \`cotal ext add\` again`);
|
|
23
|
+
}
|
|
24
|
+
const m = parsed;
|
|
25
|
+
if (!Array.isArray(m.extensions))
|
|
26
|
+
throw new Error(`corrupt extensions manifest ${p}: no "extensions" array`);
|
|
27
|
+
return m;
|
|
28
|
+
}
|
|
29
|
+
export function saveExtensionsManifest(m) {
|
|
30
|
+
mkdirSync(extensionsDir(), { recursive: true });
|
|
31
|
+
writeFileSync(extensionsManifestPath(), `${JSON.stringify(m, null, 2)}\n`);
|
|
32
|
+
}
|
|
33
|
+
/** Strip a live {@link Command} down to its serializable display surface for the cache. */
|
|
34
|
+
export function cacheCommand(cmd) {
|
|
35
|
+
return {
|
|
36
|
+
name: cmd.name,
|
|
37
|
+
summary: cmd.summary,
|
|
38
|
+
group: cmd.group,
|
|
39
|
+
usage: cmd.usage,
|
|
40
|
+
hidden: cmd.hidden,
|
|
41
|
+
flags: cmd.flags,
|
|
42
|
+
positionals: cmd.positionals,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/** The installed package's on-disk root inside the prefix. */
|
|
46
|
+
export function extensionPackageDir(pkg) {
|
|
47
|
+
return join(extensionsDir(), "node_modules", pkg);
|
|
48
|
+
}
|
|
49
|
+
/** The installed package's CURRENT version, read from disk (undefined when not installed). */
|
|
50
|
+
export function installedExtensionVersion(pkg) {
|
|
51
|
+
const p = join(extensionPackageDir(pkg), "package.json");
|
|
52
|
+
if (!existsSync(p))
|
|
53
|
+
return undefined;
|
|
54
|
+
const v = JSON.parse(readFileSync(p, "utf8")).version;
|
|
55
|
+
return typeof v === "string" ? v : undefined;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=extensions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extensions.js","sourceRoot":"","sources":["../src/extensions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA2CjD,0FAA0F;AAC1F,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,eAAe,EAAE,EAAE,YAAY,CAAC,CAAC;AAC/C,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,CAAC,aAAa,EAAE,EAAE,iBAAiB,CAAC,CAAC;AAClD,CAAC;AAED;kFACkF;AAClF,MAAM,UAAU,sBAAsB;IACpC,MAAM,CAAC,GAAG,sBAAsB,EAAE,CAAC;IACnC,IAAI,C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EAAE,EAAE,cAAc,EAAE,GAAG,CAAC,CAAC;AACpD,CAAC;AAED,8FAA8F;AAC9F,MAAM,UAAU,yBAAyB,CAAC,GAAW;IACnD,MAAM,CAAC,GAAG,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC;IACzD,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC;QAAE,OAAO,SAAS,CAAC;IACrC,MAAM,CAAC,GAAI,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,MAAM,CAAC,CAA0B,CAAC,OAAO,CAAC;IAChF,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AAC/C,CAAC"}
|
package/dist/flags.d.ts
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared flag vocabulary of the workstation layer. Commands spread these specs instead of
|
|
3
|
+
* declaring their own copies, so the vocabulary cannot drift between commands; a command that
|
|
4
|
+
* takes only a SUBSET (e.g. `spawn` foreground has no `--creds`) composes the individual specs.
|
|
5
|
+
* Declared `as const` so `FlagValues<typeof …>` derives each command's values type — the cast
|
|
6
|
+
* in `run` is compile-checked against exactly these specs.
|
|
7
|
+
*/
|
|
8
|
+
export declare const spaceFlag: {
|
|
9
|
+
readonly name: "space";
|
|
10
|
+
readonly type: "string";
|
|
11
|
+
readonly value: "<s>";
|
|
12
|
+
readonly description: "target space (default: the resolved mesh)";
|
|
13
|
+
};
|
|
14
|
+
export declare const serverFlag: {
|
|
15
|
+
readonly name: "server";
|
|
16
|
+
readonly type: "string";
|
|
17
|
+
readonly value: "<url>";
|
|
18
|
+
readonly description: "broker URL (overrides the mesh registry entry)";
|
|
19
|
+
};
|
|
20
|
+
export declare const credsFlag: {
|
|
21
|
+
readonly name: "creds";
|
|
22
|
+
readonly type: "string";
|
|
23
|
+
readonly value: "<path>";
|
|
24
|
+
readonly description: "creds file for an off-registry connection";
|
|
25
|
+
};
|
|
26
|
+
/** The mesh-target bundle: which space, which broker, and (off-registry) which credential.
|
|
27
|
+
* Resolution order is `resolveMeshTarget`'s: explicit flags > the folder's project > the
|
|
28
|
+
* registry/`current` mesh. */
|
|
29
|
+
export declare const targetFlags: readonly [{
|
|
30
|
+
readonly name: "space";
|
|
31
|
+
readonly type: "string";
|
|
32
|
+
readonly value: "<s>";
|
|
33
|
+
readonly description: "target space (default: the resolved mesh)";
|
|
34
|
+
}, {
|
|
35
|
+
readonly name: "server";
|
|
36
|
+
readonly type: "string";
|
|
37
|
+
readonly value: "<url>";
|
|
38
|
+
readonly description: "broker URL (overrides the mesh registry entry)";
|
|
39
|
+
}, {
|
|
40
|
+
readonly name: "creds";
|
|
41
|
+
readonly type: "string";
|
|
42
|
+
readonly value: "<path>";
|
|
43
|
+
readonly description: "creds file for an off-registry connection";
|
|
44
|
+
}];
|
|
45
|
+
/**
|
|
46
|
+
* The launch grammar: every knob for bringing an agent onto the mesh, shared verbatim by the
|
|
47
|
+
* foreground and detached (`--detach`, manager-run) paths of `cotal spawn` — one bundle, so the
|
|
48
|
+
* two launch modes can never again diverge in ability (the old `spawn` vs `start` drift).
|
|
49
|
+
* The MCP `cotal_spawn` tool mirrors this grammar; a parity smoke (not an import — tier rule)
|
|
50
|
+
* keeps it honest.
|
|
51
|
+
*/
|
|
52
|
+
export declare const launchFlags: readonly [{
|
|
53
|
+
readonly name: "name";
|
|
54
|
+
readonly type: "string";
|
|
55
|
+
readonly value: "<n>";
|
|
56
|
+
readonly description: "presence name override; does not choose the persona";
|
|
57
|
+
}, {
|
|
58
|
+
readonly name: "config";
|
|
59
|
+
readonly type: "string";
|
|
60
|
+
readonly value: "<persona-or-path>";
|
|
61
|
+
readonly description: "persona catalog name or file path; defaults from COTAL_DEFAULT_PERSONA";
|
|
62
|
+
}, {
|
|
63
|
+
readonly name: "agent";
|
|
64
|
+
readonly type: "string";
|
|
65
|
+
readonly value: "<a>";
|
|
66
|
+
readonly description: "connector type (claude, opencode, hermes …); defaults from COTAL_DEFAULT_AGENT";
|
|
67
|
+
}, {
|
|
68
|
+
readonly name: "role";
|
|
69
|
+
readonly type: "string";
|
|
70
|
+
readonly value: "<r>";
|
|
71
|
+
readonly description: "role override (wins over the agent file's role:)";
|
|
72
|
+
}, {
|
|
73
|
+
readonly name: "model";
|
|
74
|
+
readonly type: "string";
|
|
75
|
+
readonly value: "<m>";
|
|
76
|
+
readonly description: "model override (wins over the agent file's model:)";
|
|
77
|
+
}, {
|
|
78
|
+
readonly name: "variant";
|
|
79
|
+
readonly type: "string";
|
|
80
|
+
readonly value: "<v>";
|
|
81
|
+
readonly description: "model variant override (connector-defined; wins over the agent file's variant:)";
|
|
82
|
+
}, {
|
|
83
|
+
readonly name: "cwd";
|
|
84
|
+
readonly type: "string";
|
|
85
|
+
readonly value: "<dir>";
|
|
86
|
+
readonly description: "working directory to root the agent at";
|
|
87
|
+
}, {
|
|
88
|
+
readonly name: "prompt";
|
|
89
|
+
readonly type: "string";
|
|
90
|
+
readonly value: "<text>";
|
|
91
|
+
readonly description: "initial prompt auto-submitted at start";
|
|
92
|
+
}, {
|
|
93
|
+
readonly name: "resume";
|
|
94
|
+
readonly type: "string";
|
|
95
|
+
readonly value: "<id>";
|
|
96
|
+
readonly description: "fork an existing session id into the mesh (claude only; detached: pair with --cwd)";
|
|
97
|
+
}, {
|
|
98
|
+
readonly name: "transcript";
|
|
99
|
+
readonly type: "boolean";
|
|
100
|
+
readonly description: "mirror the session transcript to tr-<name>";
|
|
101
|
+
}, {
|
|
102
|
+
readonly name: "no-transcript";
|
|
103
|
+
readonly type: "boolean";
|
|
104
|
+
readonly description: "explicit default: no transcript mirror";
|
|
105
|
+
}, {
|
|
106
|
+
readonly name: "share-tools";
|
|
107
|
+
readonly type: "string";
|
|
108
|
+
readonly value: "<sel>";
|
|
109
|
+
readonly description: "share named operator MCP servers with the agent";
|
|
110
|
+
}, {
|
|
111
|
+
readonly name: "subscribe";
|
|
112
|
+
readonly type: "string";
|
|
113
|
+
readonly value: "<a,b>";
|
|
114
|
+
readonly description: "channel read set override";
|
|
115
|
+
}, {
|
|
116
|
+
readonly name: "allow-subscribe";
|
|
117
|
+
readonly type: "string";
|
|
118
|
+
readonly value: "<a,b>";
|
|
119
|
+
readonly description: "read ACL override";
|
|
120
|
+
}, {
|
|
121
|
+
readonly name: "allow-publish";
|
|
122
|
+
readonly type: "string";
|
|
123
|
+
readonly value: "<a,b>";
|
|
124
|
+
readonly description: "post ACL override";
|
|
125
|
+
}];
|
|
126
|
+
//# sourceMappingURL=flags.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.d.ts","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,SAAS;;;;;CAAwI,CAAC;AAC/J,eAAO,MAAM,UAAU;;;;;CAAgJ,CAAC;AACxK,eAAO,MAAM,SAAS;;;;;CAA2I,CAAC;AAElK;;+BAE+B;AAC/B,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAA4E,CAAC;AAErG;;;;;;GAMG;AACH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgBgB,CAAC"}
|
package/dist/flags.js
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shared flag vocabulary of the workstation layer. Commands spread these specs instead of
|
|
3
|
+
* declaring their own copies, so the vocabulary cannot drift between commands; a command that
|
|
4
|
+
* takes only a SUBSET (e.g. `spawn` foreground has no `--creds`) composes the individual specs.
|
|
5
|
+
* Declared `as const` so `FlagValues<typeof …>` derives each command's values type — the cast
|
|
6
|
+
* in `run` is compile-checked against exactly these specs.
|
|
7
|
+
*/
|
|
8
|
+
export const spaceFlag = { name: "space", type: "string", value: "<s>", description: "target space (default: the resolved mesh)" };
|
|
9
|
+
export const serverFlag = { name: "server", type: "string", value: "<url>", description: "broker URL (overrides the mesh registry entry)" };
|
|
10
|
+
export const credsFlag = { name: "creds", type: "string", value: "<path>", description: "creds file for an off-registry connection" };
|
|
11
|
+
/** The mesh-target bundle: which space, which broker, and (off-registry) which credential.
|
|
12
|
+
* Resolution order is `resolveMeshTarget`'s: explicit flags > the folder's project > the
|
|
13
|
+
* registry/`current` mesh. */
|
|
14
|
+
export const targetFlags = [spaceFlag, serverFlag, credsFlag];
|
|
15
|
+
/**
|
|
16
|
+
* The launch grammar: every knob for bringing an agent onto the mesh, shared verbatim by the
|
|
17
|
+
* foreground and detached (`--detach`, manager-run) paths of `cotal spawn` — one bundle, so the
|
|
18
|
+
* two launch modes can never again diverge in ability (the old `spawn` vs `start` drift).
|
|
19
|
+
* The MCP `cotal_spawn` tool mirrors this grammar; a parity smoke (not an import — tier rule)
|
|
20
|
+
* keeps it honest.
|
|
21
|
+
*/
|
|
22
|
+
export const launchFlags = [
|
|
23
|
+
{ name: "name", type: "string", value: "<n>", description: "presence name override; does not choose the persona" },
|
|
24
|
+
{ name: "config", type: "string", value: "<persona-or-path>", description: "persona catalog name or file path; defaults from COTAL_DEFAULT_PERSONA" },
|
|
25
|
+
{ name: "agent", type: "string", value: "<a>", description: "connector type (claude, opencode, hermes …); defaults from COTAL_DEFAULT_AGENT" },
|
|
26
|
+
{ name: "role", type: "string", value: "<r>", description: "role override (wins over the agent file's role:)" },
|
|
27
|
+
{ name: "model", type: "string", value: "<m>", description: "model override (wins over the agent file's model:)" },
|
|
28
|
+
{ name: "variant", type: "string", value: "<v>", description: "model variant override (connector-defined; wins over the agent file's variant:)" },
|
|
29
|
+
{ name: "cwd", type: "string", value: "<dir>", description: "working directory to root the agent at" },
|
|
30
|
+
{ name: "prompt", type: "string", value: "<text>", description: "initial prompt auto-submitted at start" },
|
|
31
|
+
{ name: "resume", type: "string", value: "<id>", description: "fork an existing session id into the mesh (claude only; detached: pair with --cwd)" },
|
|
32
|
+
{ name: "transcript", type: "boolean", description: "mirror the session transcript to tr-<name>" },
|
|
33
|
+
{ name: "no-transcript", type: "boolean", description: "explicit default: no transcript mirror" },
|
|
34
|
+
{ name: "share-tools", type: "string", value: "<sel>", description: "share named operator MCP servers with the agent" },
|
|
35
|
+
{ name: "subscribe", type: "string", value: "<a,b>", description: "channel read set override" },
|
|
36
|
+
{ name: "allow-subscribe", type: "string", value: "<a,b>", description: "read ACL override" },
|
|
37
|
+
{ name: "allow-publish", type: "string", value: "<a,b>", description: "post ACL override" },
|
|
38
|
+
];
|
|
39
|
+
//# sourceMappingURL=flags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flags.js","sourceRoot":"","sources":["../src/flags.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,2CAA2C,EAA8B,CAAC;AAC/J,MAAM,CAAC,MAAM,UAAU,GAAG,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,gDAAgD,EAA8B,CAAC;AACxK,MAAM,CAAC,MAAM,SAAS,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,EAAE,WAAW,EAAE,2CAA2C,EAA8B,CAAC;AAElK;;+BAE+B;AAC/B,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,SAAS,EAAE,UAAU,EAAE,SAAS,CAAwC,CAAC;AAErG;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,qDAAqD,EAAE;IAClH,EAAE,IAAI,EAAE,Q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AAK,EAAE,OAAO,EAAE,WAAW,EAAE,2BAA2B,EAAE;IAC/F,EAAE,IAAI,EAAE,iBAAiB,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE;IAC7F,EAAE,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE;CACrD,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export * from "./auth-paths.js";
|
|
2
2
|
export * from "./bin-path.js";
|
|
3
|
+
export * from "./colors.js";
|
|
4
|
+
export * from "./connect.js";
|
|
5
|
+
export * from "./default-agent.js";
|
|
6
|
+
export * from "./extensions.js";
|
|
7
|
+
export * from "./flags.js";
|
|
8
|
+
export * from "./provenance.js";
|
|
3
9
|
export * from "./mesh-registry.js";
|
|
4
10
|
export * from "./mesh-target.js";
|
|
5
11
|
export * from "./preflight.js";
|
|
6
12
|
export * from "./render.js";
|
|
13
|
+
export * from "./space.js";
|
|
7
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,14 @@
|
|
|
1
1
|
export * from "./auth-paths.js";
|
|
2
2
|
export * from "./bin-path.js";
|
|
3
|
+
export * from "./colors.js";
|
|
4
|
+
export * from "./connect.js";
|
|
5
|
+
export * from "./default-agent.js";
|
|
6
|
+
export * from "./extensions.js";
|
|
7
|
+
export * from "./flags.js";
|
|
8
|
+
export * from "./provenance.js";
|
|
3
9
|
export * from "./mesh-registry.js";
|
|
4
10
|
export * from "./mesh-target.js";
|
|
5
11
|
export * from "./preflight.js";
|
|
6
12
|
export * from "./render.js";
|
|
13
|
+
export * from "./space.js";
|
|
7
14
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,eAAe,CAAC;AAC9B,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One consistent voice for CLI provenance, on stderr: which on-disk source a command RESOLVED
|
|
3
|
+
* its configuration from, and what it WROTE where. Commands must never silently pick up state
|
|
4
|
+
* from a directory or silently drop files — every read of config (persona file, mesh entry,
|
|
5
|
+
* config.json layer) and every write (creds, seeded files) gets one dim arrow line. stderr so
|
|
6
|
+
* it never pollutes machine-readable stdout; plain text so this layer needs no color dep.
|
|
7
|
+
*/
|
|
8
|
+
export declare const provenance: {
|
|
9
|
+
/** `→ using <what>: <source>` — the source that WON resolution (say which layer/path). */
|
|
10
|
+
read(what: string, source: string): void;
|
|
11
|
+
/** `→ wrote <what>: <dest>` — announce every file the command created or replaced. */
|
|
12
|
+
wrote(what: string, dest: string): void;
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=provenance.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.d.ts","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,eAAO,MAAM,UAAU;IACrB,0FAA0F;eAC/E,MAAM,UAAU,MAAM,GAAG,IAAI;IAGxC,sFAAsF;gBAC1E,MAAM,QAAQ,MAAM,GAAG,IAAI;CAGxC,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One consistent voice for CLI provenance, on stderr: which on-disk source a command RESOLVED
|
|
3
|
+
* its configuration from, and what it WROTE where. Commands must never silently pick up state
|
|
4
|
+
* from a directory or silently drop files — every read of config (persona file, mesh entry,
|
|
5
|
+
* config.json layer) and every write (creds, seeded files) gets one dim arrow line. stderr so
|
|
6
|
+
* it never pollutes machine-readable stdout; plain text so this layer needs no color dep.
|
|
7
|
+
*/
|
|
8
|
+
export const provenance = {
|
|
9
|
+
/** `→ using <what>: <source>` — the source that WON resolution (say which layer/path). */
|
|
10
|
+
read(what, source) {
|
|
11
|
+
process.stderr.write(`→ using ${what}: ${source}\n`);
|
|
12
|
+
},
|
|
13
|
+
/** `→ wrote <what>: <dest>` — announce every file the command created or replaced. */
|
|
14
|
+
wrote(what, dest) {
|
|
15
|
+
process.stderr.write(`→ wrote ${what}: ${dest}\n`);
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=provenance.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provenance.js","sourceRoot":"","sources":["../src/provenance.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,0FAA0F;IAC1F,IAAI,CAAC,IAAY,EAAE,MAAc;QAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC;IACvD,CAAC;IACD,sFAAsF;IACtF,KAAK,CAAC,IAAY,EAAE,IAAY;QAC9B,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,KAAK,IAAI,IAAI,CAAC,CAAC;IACrD,CAAC;CACF,CAAC"}
|
package/dist/space.d.ts
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** The space this folder operates on: its `.cotal/auth` space if set up, else the default.
|
|
2
|
+
* A folder has exactly one space (its auth) — commands resolve it through here so they always
|
|
3
|
+
* match the folder's mesh instead of assuming the global default. */
|
|
4
|
+
export declare function resolveSpace(cwd: string): string;
|
|
5
|
+
//# sourceMappingURL=space.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.d.ts","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAGA;;sEAEsE;AACtE,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
package/dist/space.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { DEFAULT_SPACE } from "@cotal-ai/core";
|
|
2
|
+
import { authDir, findCotalRoot, loadSpaceAuth } from "./auth-paths.js";
|
|
3
|
+
/** The space this folder operates on: its `.cotal/auth` space if set up, else the default.
|
|
4
|
+
* A folder has exactly one space (its auth) — commands resolve it through here so they always
|
|
5
|
+
* match the folder's mesh instead of assuming the global default. */
|
|
6
|
+
export function resolveSpace(cwd) {
|
|
7
|
+
return loadSpaceAuth(authDir(findCotalRoot(cwd)))?.space ?? DEFAULT_SPACE;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=space.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"space.js","sourceRoot":"","sources":["../src/space.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAExE;;sEAEsE;AACtE,MAAM,UAAU,YAAY,CAAC,GAAW;IACtC,OAAO,aAAa,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,IAAI,aAAa,CAAC;AAC5E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/workspace",
|
|
3
3
|
"description": "Cotal machine-local workstation layer: the ~/.cotal mesh registry, target resolution, preflight, on-disk auth-path I/O, and the command-copy renderer — operator concerns over a local checkout, kept separate from the wire protocol in @cotal-ai/core.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.10.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@cotal-ai/core": "0.
|
|
21
|
+
"@cotal-ai/core": "0.10.1"
|
|
22
22
|
},
|
|
23
23
|
"files": [
|
|
24
24
|
"dist"
|