@cotal-ai/cli 0.2.0 → 0.3.0-next-20260614011207

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.
Files changed (87) hide show
  1. package/dist/commands/channels.d.ts.map +1 -1
  2. package/dist/commands/channels.js +4 -2
  3. package/dist/commands/channels.js.map +1 -1
  4. package/dist/commands/console.d.ts.map +1 -1
  5. package/dist/commands/console.js +11 -8
  6. package/dist/commands/console.js.map +1 -1
  7. package/dist/commands/demo.js +3 -2
  8. package/dist/commands/demo.js.map +1 -1
  9. package/dist/commands/down.d.ts +4 -0
  10. package/dist/commands/down.d.ts.map +1 -0
  11. package/dist/commands/down.js +36 -0
  12. package/dist/commands/down.js.map +1 -0
  13. package/dist/commands/history.d.ts.map +1 -1
  14. package/dist/commands/history.js +5 -3
  15. package/dist/commands/history.js.map +1 -1
  16. package/dist/commands/join.js +3 -2
  17. package/dist/commands/join.js.map +1 -1
  18. package/dist/commands/mint.d.ts.map +1 -1
  19. package/dist/commands/mint.js +3 -2
  20. package/dist/commands/mint.js.map +1 -1
  21. package/dist/commands/setup.d.ts +8 -6
  22. package/dist/commands/setup.d.ts.map +1 -1
  23. package/dist/commands/setup.js +496 -56
  24. package/dist/commands/setup.js.map +1 -1
  25. package/dist/commands/spawn.d.ts.map +1 -1
  26. package/dist/commands/spawn.js +9 -5
  27. package/dist/commands/spawn.js.map +1 -1
  28. package/dist/commands/up.d.ts +21 -0
  29. package/dist/commands/up.d.ts.map +1 -1
  30. package/dist/commands/up.js +106 -38
  31. package/dist/commands/up.js.map +1 -1
  32. package/dist/commands/web.d.ts +27 -0
  33. package/dist/commands/web.d.ts.map +1 -1
  34. package/dist/commands/web.js +64 -7
  35. package/dist/commands/web.js.map +1 -1
  36. package/dist/index.d.ts.map +1 -1
  37. package/dist/index.js +23 -8
  38. package/dist/index.js.map +1 -1
  39. package/dist/lib/assist.d.ts +16 -0
  40. package/dist/lib/assist.d.ts.map +1 -0
  41. package/dist/lib/assist.js +52 -0
  42. package/dist/lib/assist.js.map +1 -0
  43. package/dist/lib/cancel.d.ts +5 -0
  44. package/dist/lib/cancel.d.ts.map +1 -0
  45. package/dist/lib/cancel.js +12 -0
  46. package/dist/lib/cancel.js.map +1 -0
  47. package/dist/lib/live-window.d.ts +22 -0
  48. package/dist/lib/live-window.d.ts.map +1 -0
  49. package/dist/lib/live-window.js +71 -0
  50. package/dist/lib/live-window.js.map +1 -0
  51. package/dist/lib/manager-proc.d.ts +32 -0
  52. package/dist/lib/manager-proc.d.ts.map +1 -0
  53. package/dist/lib/manager-proc.js +84 -0
  54. package/dist/lib/manager-proc.js.map +1 -0
  55. package/dist/lib/nats-bin.d.ts +7 -0
  56. package/dist/lib/nats-bin.d.ts.map +1 -0
  57. package/dist/lib/nats-bin.js +21 -0
  58. package/dist/lib/nats-bin.js.map +1 -0
  59. package/dist/lib/onboard.d.ts +3 -0
  60. package/dist/lib/onboard.d.ts.map +1 -0
  61. package/dist/lib/onboard.js +15 -0
  62. package/dist/lib/onboard.js.map +1 -0
  63. package/dist/lib/paths.d.ts +7 -0
  64. package/dist/lib/paths.d.ts.map +1 -0
  65. package/dist/lib/paths.js +13 -0
  66. package/dist/lib/paths.js.map +1 -0
  67. package/dist/lib/self-exec.d.ts +10 -0
  68. package/dist/lib/self-exec.d.ts.map +1 -0
  69. package/dist/lib/self-exec.js +16 -0
  70. package/dist/lib/self-exec.js.map +1 -0
  71. package/dist/lib/setup-log.d.ts +8 -0
  72. package/dist/lib/setup-log.d.ts.map +1 -0
  73. package/dist/lib/setup-log.js +17 -0
  74. package/dist/lib/setup-log.js.map +1 -0
  75. package/dist/lib/status.d.ts +28 -0
  76. package/dist/lib/status.d.ts.map +1 -0
  77. package/dist/lib/status.js +58 -0
  78. package/dist/lib/status.js.map +1 -0
  79. package/dist/lib/steps.d.ts +31 -0
  80. package/dist/lib/steps.d.ts.map +1 -0
  81. package/dist/lib/steps.js +91 -0
  82. package/dist/lib/steps.js.map +1 -0
  83. package/dist/lib/theme.d.ts +18 -0
  84. package/dist/lib/theme.d.ts.map +1 -0
  85. package/dist/lib/theme.js +61 -0
  86. package/dist/lib/theme.js.map +1 -0
  87. package/package.json +12 -2
@@ -1,64 +1,504 @@
1
- import { execFileSync } from "node:child_process";
2
- import { existsSync } from "node:fs";
3
- import { dirname, join, resolve } from "node:path";
4
- import { c } from "../ui.js";
5
- /** Walk up to the cotal repo root (where the plugin marketplace manifest lives). */
6
- function repoRoot(start = process.cwd()) {
7
- let dir = resolve(start);
8
- for (;;) {
9
- if (existsSync(join(dir, ".claude-plugin", "marketplace.json")))
10
- return dir;
11
- const parent = dirname(dir);
12
- if (parent === dir)
13
- throw new Error("couldn't find the cotal repo root (.claude-plugin/marketplace.json)");
14
- dir = parent;
1
+ import { spawnSync } from "node:child_process";
2
+ import { cpSync, existsSync, mkdirSync, readFileSync, writeFileSync } from "node:fs";
3
+ import { homedir } from "node:os";
4
+ import { join } from "node:path";
5
+ import { parseArgs } from "node:util";
6
+ import * as p from "@clack/prompts";
7
+ import { DEFAULT_SERVER, isReachable, registry } from "@cotal-ai/core";
8
+ import { cmux } from "@cotal-ai/cmux";
9
+ import { brand, brandBold, dim, ok, note, splash } from "../lib/theme.js";
10
+ import { LivePane } from "../lib/live-window.js";
11
+ import { runSteps } from "../lib/steps.js";
12
+ import { abortIfCancel } from "../lib/cancel.js";
13
+ import { openSetupLog } from "../lib/setup-log.js";
14
+ import { resolveNatsServer } from "../lib/nats-bin.js";
15
+ import { isOnboarded, markOnboarded } from "../lib/onboard.js";
16
+ import { machineStatus, meshStatus, onPath, resolveSpace } from "../lib/status.js";
17
+ import { startMeshDetached, up } from "./up.js";
18
+ import { ensureWeb, webUp, WEB_URL } from "./web.js";
19
+ import { cmuxManagerRunning, ensureManager, managerUp, pgrepMatches, stopManager } from "../lib/manager-proc.js";
20
+ import { selfCotal } from "../lib/self-exec.js";
21
+ import { cotalPath, cotalRoot } from "../lib/paths.js";
22
+ import { spawn } from "./spawn.js";
23
+ const ONBOARD_VERSION = "1";
24
+ /** The teammates the cmux/background demo pre-spawns (manager-owned, so they're despawnable). One
25
+ * source of truth for both the `--spawn` list and the `cotal-<n>` tabs we clean up on restart. */
26
+ const DEMO_TEAM = ["david", "sven"];
27
+ const README_URL = "https://github.com/Cotal-AI/Cotal/blob/main/README.md";
28
+ const CC_DOCS_URL = "https://github.com/Cotal-AI/Cotal/blob/main/docs/claude-code-integration.md";
29
+ const NATS_RELEASES_URL = "https://github.com/nats-io/nats-server/releases";
30
+ /** `cotal setup`: guided setup. First run (no `~/.cotal/onboarded.json`) gets the full
31
+ * narrated flow; later runs get a compact ensure+status. `--full` forces the full flow.
32
+ * Each failed step offers an interactive Claude handoff (COTAL_SKIP_ASSIST=1 disables). */
33
+ export async function setup(argv) {
34
+ const { values } = parseArgs({
35
+ args: argv,
36
+ allowPositionals: true,
37
+ options: {
38
+ full: { type: "boolean" },
39
+ yes: { type: "boolean", short: "y" },
40
+ auth: { type: "boolean" }, // opt into an authed mesh (JWT/ACLs); default is an open local mesh
41
+ },
42
+ });
43
+ // `--yes` (agents/CI) always runs the full flow non-interactively. The local mesh is open by
44
+ // default (frictionless, loopback-only); `--auth` opts into JWT auth for shared/cross-machine use.
45
+ if (!isOnboarded() || values.full || values.yes)
46
+ await runFirstRun(Boolean(values.yes), !values.auth);
47
+ else
48
+ await runEnsure();
49
+ }
50
+ /** `cotal go` — open or resume your session. A friendlier-named alias of `cotal setup`: the first
51
+ * run installs (full guided flow), later runs fast-forward to the ensure path and reopen your
52
+ * cmux session. `cotal setup` stays the explicit install/update name. */
53
+ export async function go(argv) {
54
+ return setup(argv);
55
+ }
56
+ /** The full, narrated first-run experience. `yes` = non-interactive accept-all; `open` = run the
57
+ * mesh without auth (the frictionless local default; `--auth` flips it off). */
58
+ async function runFirstRun(yes, open) {
59
+ splash();
60
+ p.intro(brandBold("Welcome to Cotal"));
61
+ note("Cotal is the open web for agents: they join a shared space, see who's around, and coordinate as peers instead of in silos. Build whole agent societies, even across different machines, on one open web. Let's set yours up.", "Give your agents a place to work together");
62
+ const log = openSetupLog(process.cwd());
63
+ // Prerequisites + the local web (NATS). These never prompt.
64
+ const core = [
65
+ {
66
+ name: "node-version",
67
+ title: "Check Node.js",
68
+ explain: "Cotal needs Node 20 or newer.",
69
+ context: [README_URL],
70
+ async run() {
71
+ const major = Number(process.versions.node.split(".")[0]);
72
+ if (major < 20)
73
+ throw new Error(`Node ${process.versions.node} is too old; Cotal needs Node >= 20`);
74
+ return `Node ${process.versions.node}`;
75
+ },
76
+ },
77
+ {
78
+ name: "nats-binary",
79
+ title: "Locate the NATS server",
80
+ explain: "Cotal runs on NATS + JetStream, the wire your agents speak over.",
81
+ context: [NATS_RELEASES_URL, README_URL],
82
+ async run() {
83
+ const r = await resolveNatsServer();
84
+ return r.source === "path" ? "nats-server from PATH" : "bundled binary";
85
+ },
86
+ },
87
+ {
88
+ name: "start-mesh",
89
+ title: "Start the web for agents",
90
+ explain: "A local NATS + JetStream server you own; the web your agents join, in the background.",
91
+ live: true,
92
+ context: [cotalPath("nats.log"), cotalPath("auth/server.conf"), README_URL],
93
+ async run() {
94
+ if (await isReachable(DEFAULT_SERVER))
95
+ return `already running at ${DEFAULT_SERVER}`;
96
+ const pane = new LivePane();
97
+ pane.start("Booting nats-server");
98
+ try {
99
+ const { server } = await startMeshDetached({ onLine: (l) => pane.push(l), open });
100
+ return `running at ${server} (stop with: cotal down)`;
101
+ }
102
+ finally {
103
+ pane.clear();
104
+ }
105
+ },
106
+ },
107
+ ];
108
+ if (!(await runSteps(core, log, { yes })))
109
+ return abort();
110
+ // The web dashboard, in the background, so it's just there (best-effort; never blocks setup).
111
+ try {
112
+ const web = await ensureWeb({ space: resolveSpace(process.cwd()), server: DEFAULT_SERVER });
113
+ if (web.running) {
114
+ p.log.success(`Web dashboard at ${web.url} (stop with: cotal down)`);
115
+ log.line(`web: ${web.url}`);
116
+ }
117
+ }
118
+ catch {
119
+ /* non-fatal: the card still shows how to start it */
120
+ }
121
+ // Connectors: which agents should be able to join. Only Claude needs an install
122
+ // (its wake channel binds to an installed plugin); Codex/OpenCode auto-wire at spawn.
123
+ const found = { claude: onPath("claude"), codex: onPath("codex"), opencode: onPath("opencode") };
124
+ const selected = await pickConnectors(found, yes);
125
+ if (selected.has("claude")) {
126
+ if (!found.claude)
127
+ p.log.warn("claude isn't on PATH. Install it (https://claude.com/claude-code), then re-run setup.");
128
+ else if (!(await runSteps([claudePluginStep()], log, { yes })))
129
+ return abort();
130
+ }
131
+ for (const name of ["codex", "opencode"]) {
132
+ if (selected.has(name) && found[name]) {
133
+ p.log.success(`${name} ready (auto-wired when you spawn it)`);
134
+ log.line(`connector ${name}: ready (no install)`);
135
+ }
136
+ }
137
+ // Two experts plus your own driving session, by default. These are setup-managed: refreshed when
138
+ // DEMO_AGENTS changes (so persona edits actually land), but a file you've taken ownership of is
139
+ // backed up first, never silently lost — see writeDemoAgent.
140
+ mkdirSync(cotalPath("agents"), { recursive: true });
141
+ for (const [name, body] of Object.entries(DEMO_AGENTS)) {
142
+ writeDemoAgent(cotalPath("agents", `${name}.md`), body);
143
+ }
144
+ p.log.success("Added david (the engineer), sven (the guide), and your session (me); they join when you spawn them or open the demo");
145
+ log.line("demo-agents: wrote david + sven + me");
146
+ markOnboarded(ONBOARD_VERSION);
147
+ note([
148
+ "Your agent has direct access to Cotal: spawn one and just talk to it (it can message peers, spawn teammates, and send feedback). Now any agent can join and collaborate. You can also use the CLI.",
149
+ "",
150
+ `${ok("✓")} drive a session ${dim("cotal spawn me")}`,
151
+ `${ok("✓")} ask the engineer ${dim("cotal spawn david")}`,
152
+ `${ok("✓")} ask the guide ${dim("cotal spawn sven")}`,
153
+ `${ok("✓")} watch the mesh ${dim("cotal console")}`,
154
+ `${ok("✓")} open the dashboard ${dim(WEB_URL)}`,
155
+ `${ok("✓")} resume later ${dim("cotal go")}`,
156
+ `${ok("✓")} stop everything ${dim("cotal down")}`,
157
+ "",
158
+ dim('Cotal not working? Tell your agent to give us feedback and it sends it for you (built-in cotal_feedback), or run cotal feedback "<msg>".'),
159
+ ].join("\n"), "You're set");
160
+ if (!yes)
161
+ await offerDemo(found.claude);
162
+ else {
163
+ // Agents/CI: bring up the control plane so cotal_spawn / despawn / purge work right away.
164
+ try {
165
+ ensureManager({ space: resolveSpace(process.cwd()), server: DEFAULT_SERVER });
166
+ }
167
+ catch {
168
+ /* non-fatal */
169
+ }
170
+ }
171
+ p.outro(brand(yes ? "Cotal is ready." : "Happy meshing."));
172
+ function abort() {
173
+ p.outro(brand("Setup paused. Fix the step above and run `cotal setup` again."));
174
+ process.exitCode = 1;
15
175
  }
16
176
  }
17
- /** Capture a command's stdout (for idempotency checks). */
18
- function read(cmd, args) {
19
- return execFileSync(cmd, args, { encoding: "utf8", stdio: ["ignore", "pipe", "pipe"] });
177
+ /** Pick which agent connectors to set up. Detected ones are pre-checked (= the "all"
178
+ * default). Non-interactive / --yes selects all detected without prompting. */
179
+ async function pickConnectors(found, yes) {
180
+ const all = ["claude", "codex", "opencode"].filter((n) => found[n]);
181
+ if (yes || !process.stdin.isTTY)
182
+ return new Set(all);
183
+ const labels = { claude: "Claude Code", codex: "Codex", opencode: "OpenCode" };
184
+ // Common case: show what was detected and offer a visible Continue button (clack's multiselect
185
+ // has no native one). Only "Customize" (or nothing detected) drops into the toggle list.
186
+ if (all.length) {
187
+ note(all.map((n) => labels[n]).join(", "), "Agents found");
188
+ const go = abortIfCancel(await p.confirm({ message: "Set these up?", active: "Continue", inactive: "Customize", initialValue: true }));
189
+ if (go)
190
+ return new Set(all);
191
+ }
192
+ const picked = abortIfCancel(await p.multiselect({
193
+ message: "Pick the agents to set up (space toggles, enter continues)",
194
+ options: ["claude", "codex", "opencode"].map((n) => ({
195
+ value: n,
196
+ label: labels[n],
197
+ hint: !found[n] ? "not on PATH" : n === "claude" ? "installs a plugin" : "ready at spawn",
198
+ })),
199
+ initialValues: all,
200
+ required: false,
201
+ }));
202
+ return new Set(picked);
20
203
  }
21
- /**
22
- * One-time onboarding: make the repo's Claude sessions cotal-aware by installing the
23
- * cotal plugin (the `cotal_*` tools + presence hooks). Idempotent — safe to re-run.
24
- * `cotal cmux go` runs this for you; you can also run it standalone.
25
- */
26
- export async function setup() {
27
- const root = repoRoot();
28
- // 1) The installed plugin runs the bundled dist/*.cjs — make sure it's built.
29
- const bundle = join(root, "extensions", "connector-claude-code", "dist", "mcp.cjs");
30
- if (!existsSync(bundle)) {
31
- console.log(c.dim("Building the connector bundle…"));
32
- execFileSync("pnpm", ["--filter", "@cotal-ai/connector-claude-code", "bundle"], {
33
- cwd: root,
34
- stdio: "inherit",
35
- });
204
+ /** The Claude Code plugin install, as a step (spinner + failure handling + handoff). */
205
+ function claudePluginStep() {
206
+ return {
207
+ name: "claude-plugin",
208
+ title: "Install the Claude Code plugin",
209
+ explain: "Lets a Claude Code session join the web and wake on peer messages.",
210
+ context: [join(homedir(), ".cotal/claude-plugin"), CC_DOCS_URL],
211
+ async run() {
212
+ installClaudePlugin();
213
+ return "cotal@cotal-mesh (local scope)";
214
+ },
215
+ };
216
+ }
217
+ /** Finale: a live demo — a Claude the operator drives, with david and sven (manager-owned
218
+ * teammates) helping. In cmux they get their own tabs; otherwise they run in the background and
219
+ * the terminal is handed to the driving session. The demo spawns Claude sessions, so it needs
220
+ * Claude Code. If declined / no Claude, fall back to the `cotal · ready` card. Skipped under --yes. */
221
+ async function offerDemo(haveClaude) {
222
+ const haveAgents = ["me", "david", "sven"].every((n) => existsSync(cotalPath("agents", `${n}.md`)));
223
+ const isTTY = Boolean(process.stdin.isTTY);
224
+ if (haveClaude && haveAgents && isTTY) {
225
+ const cmux = inCmuxSurface();
226
+ const go = abortIfCancel(await p.confirm({
227
+ message: cmux
228
+ ? "Open the cmux demo? A Claude you drive, with david and sven helping in cmux tabs."
229
+ : "Open the demo? A Claude you drive, with david and sven helping in the background.",
230
+ initialValue: true,
231
+ }));
232
+ if (go) {
233
+ if (cmux) {
234
+ ensureCmuxSession(cotalRoot());
235
+ p.log.success("Session open: drive the 'cotal-main' pane; david and sven are on the mesh in the background.");
236
+ return;
237
+ }
238
+ // Non-cmux: a background pty manager pre-spawns david/sven (managed, despawnable), then we
239
+ // hand this terminal to the driving session.
240
+ ensureManager({ space: resolveSpace(process.cwd()), server: DEFAULT_SERVER, spawn: [...DEMO_TEAM] });
241
+ p.outro(brand("Launching your session... david and sven are warming up in the background."));
242
+ await spawn(["me", "--prompt", ME_GREETING]);
243
+ process.exit(0);
244
+ }
36
245
  }
37
- // 2) Register the cotal-mesh marketplace (+ install the plugin) via Claude Code's CLI.
38
- let marketplaces;
246
+ else if (isTTY && haveAgents && !haveClaude) {
247
+ p.log.info("The demo needs Claude Code. Install it (https://claude.com/claude-code), then run `cotal go`.");
248
+ }
249
+ // Declined, or no Claude: start the background (pty) control plane so cotal_spawn / despawn /
250
+ // purge still work, then leave them the quick-reference card.
39
251
  try {
40
- marketplaces = read("claude", ["plugin", "marketplace", "list"]);
41
- }
42
- catch (e) {
43
- console.error(c.red("Couldn't run `claude` is Claude Code installed and on your PATH?"));
44
- console.error(c.dim("Once it is, run these two commands manually:"));
45
- console.error(c.dim(` claude plugin marketplace add ${root}`));
46
- console.error(c.dim(" claude plugin install cotal@cotal-mesh --scope local"));
47
- throw e;
48
- }
49
- if (!/\bcotal-mesh\b/.test(marketplaces)) {
50
- console.log(c.dim("Registering the cotal-mesh marketplace…"));
51
- execFileSync("claude", ["plugin", "marketplace", "add", root], { stdio: "inherit" });
52
- }
53
- // 3) Install the plugin (repo-local scope) if it isn't already.
54
- if (/\bcotal@cotal-mesh\b/.test(read("claude", ["plugin", "list"]))) {
55
- console.log(c.green("✓ cotal plugin already set up"));
56
- return;
57
- }
58
- console.log(c.dim("Installing the cotal plugin…"));
59
- execFileSync("claude", ["plugin", "install", "cotal@cotal-mesh", "--scope", "local"], {
60
- stdio: "inherit",
252
+ ensureManager({ space: resolveSpace(process.cwd()), server: DEFAULT_SERVER });
253
+ }
254
+ catch {
255
+ /* non-fatal: the card still shows how to start it */
256
+ }
257
+ await readyCard(process.cwd());
258
+ }
259
+ /** Greeting the driving session auto-submits on start (no apostrophes — it rides through
260
+ * cmux's `bash -lc '…'` quoting). Teaches the capabilities by telling, not by calling tools,
261
+ * so it does not depend on david/sven having joined yet when this first turn runs. */
262
+ const ME_GREETING = "Greet the operator in a few short lines. Open with one line on what Cotal is: an open space where AI agents join and work together as peers. Say you are their Cotal session and that david (the engineer) and sven (the guide) are on the mesh to help. Then tell them what you can do for them: message david or sven, spawn new teammates and despawn them when done, and send feedback. End by asking what they want to build.";
263
+ /** True when we're running inside a real cmux pane (cmux sets `CMUX_SURFACE_ID` per surface).
264
+ * Opening/closing cmux workspaces is only authorized from a live pane, so this — not
265
+ * `cmux.available()` (which only pings the app) is the gate for opening the cmux session. */
266
+ function inCmuxSurface() {
267
+ return Boolean(process.env.CMUX_SURFACE_ID);
268
+ }
269
+ /** (Re)open the cmux working session, idempotently. A background cmux-runtime manager pre-spawns
270
+ * david/sven (so they're managed teammates you can `cotal_despawn`) into their own tabs; the
271
+ * focused `cotal-main` workspace is the console + the driving session "me" (your foreground
272
+ * driver). Re-running reuses whatever's already open — only missing tabs are created, so there's
273
+ * never a second manager. The `me` pane presses Enter on its own cmux surface a few times to
274
+ * auto-accept the one-time dev-channels prompt (the manager's cmux runtime does the same for
275
+ * david/sven). */
276
+ function ensureCmuxSession(cwd) {
277
+ const sq = (s) => `'${s.replace(/'/g, "'\\''")}'`;
278
+ const enterLoop = '( [ -n "$CMUX_SURFACE_ID" ] && [ -n "$CMUX_BUNDLED_CLI_PATH" ] && ' +
279
+ 'for _ in 1 2 3 4 5; do sleep 1; "$CMUX_BUNDLED_CLI_PATH" send-key --surface "$CMUX_SURFACE_ID" enter >/dev/null 2>&1; done ) &';
280
+ const term = (cmd) => ({
281
+ pane: { surfaces: [{ type: "terminal", command: `bash -lc ${sq(`cd "${cwd}" && ${cmd}`)}` }] },
282
+ });
283
+ // A claude pane that auto-confirms the dev-channels prompt so the session joins the mesh.
284
+ const confirmTerm = (cmd) => ({
285
+ pane: { surfaces: [{ type: "terminal", command: `bash -lc ${sq(`cd "${cwd}" && ${enterLoop} ${cmd}`)}` }] },
61
286
  });
62
- console.log(c.green("✓ cotal plugin installed Claude sessions in this repo now have the cotal tools"));
287
+ // The cmux-tab manager becomes the control plane; drop any detached pty manager so they don't
288
+ // both answer control requests.
289
+ stopManager();
290
+ // Invoke this CLI by its resolved path, not bare `cotal`, so the panes work whether the user
291
+ // installed via npx, `npm i -g`, or a dev clone (no dependency on `cotal` being on PATH). The
292
+ // space follows the folder's auth so every pane matches the running mesh.
293
+ const cotal = selfCotal();
294
+ const space = resolveSpace(cwd);
295
+ // Control plane: a cmux-runtime manager that pre-spawns david/sven into their own tabs and owns
296
+ // them (so cotal_despawn / cotal_spawn work). A cmux tab persists after its process dies, so
297
+ // "workspace exists" != "manager running" — gate on the live process. When none is up, drop the
298
+ // dead manager + teammate tabs first, then open a fresh one; otherwise re-runs keep skipping a
299
+ // never-restarted manager and david/sven never join.
300
+ if (!cmuxManagerRunning(space)) {
301
+ for (const ws of ["cotal-manager", ...DEMO_TEAM.map((n) => `cotal-${n}`)])
302
+ closeStaleWorkspaces(ws);
303
+ cmux.openWorkspace("cotal-manager", JSON.stringify(term(`${cotal} cmux --space ${space} --spawn ${DEMO_TEAM.join(",")}`)), { focus: false });
304
+ }
305
+ // Your focused driver: console + the "me" session. Gate on the live driving session (not the
306
+ // persistent tab) so a session you're driving is never disturbed; a dead/closed one gets its stale
307
+ // tab dropped and reopened. cmux runs pane commands through the login shell (which may be nushell)
308
+ // before bash, so keep the command free of embedded single quotes: pass the greeting base64-encoded
309
+ // and decode it in bash.
310
+ if (!pgrepMatches(`spawn me --space ${space}`)) {
311
+ closeStaleWorkspaces("cotal-main");
312
+ const greetB64 = Buffer.from(ME_GREETING, "utf8").toString("base64");
313
+ const meCmd = `${cotal} spawn me --space ${space} --prompt "$(echo ${greetB64} | base64 -d)"`;
314
+ const main = JSON.stringify({
315
+ direction: "vertical",
316
+ split: 0.34,
317
+ children: [term(`${cotal} console --space ${space}`), confirmTerm(meCmd)],
318
+ });
319
+ cmux.openWorkspace("cotal-main", main, { focus: true });
320
+ }
321
+ }
322
+ /** Close any lingering cmux tabs labelled `name` (dead tabs persist in the workspace list after
323
+ * their process exits) so a freshly opened one is the only instance. */
324
+ function closeStaleWorkspaces(name) {
325
+ for (const ref of cmux.workspaceRefs(name)) {
326
+ try {
327
+ cmux.closeWorkspace(ref);
328
+ }
329
+ catch {
330
+ /* already gone */
331
+ }
332
+ }
333
+ }
334
+ /** The compact repeat-run: quietly ensure the mesh + web are up here, then a one-glance card. */
335
+ async function runEnsure() {
336
+ let mesh = await meshStatus(process.cwd());
337
+ if (!mesh.reachable) {
338
+ const s = p.spinner();
339
+ s.start("Starting the web for agents");
340
+ try {
341
+ await up(["--detach"]);
342
+ s.stop("Web for agents started");
343
+ }
344
+ catch (e) {
345
+ s.stop(`Couldn't start it: ${e.message}`);
346
+ process.exitCode = 1;
347
+ return;
348
+ }
349
+ mesh = await meshStatus(process.cwd());
350
+ }
351
+ await ensureWeb({ space: mesh.space, server: mesh.server }).catch(() => { });
352
+ // Inside cmux, re-running setup reopens your session (idempotent: reuse the live manager +
353
+ // david/sven, open only missing tabs). Otherwise bring up the background pty control plane.
354
+ try {
355
+ if (inCmuxSurface())
356
+ ensureCmuxSession(cotalRoot());
357
+ else
358
+ ensureManager({ space: mesh.space, server: mesh.server });
359
+ }
360
+ catch {
361
+ /* non-fatal */
362
+ }
363
+ await readyCard(process.cwd());
364
+ }
365
+ /** The `cotal · ready` one-glance card: machine + mesh + web + manager status, plus the key
366
+ * commands. Shared by the repeat-run ensure and the first-run no-demo finale. */
367
+ async function readyCard(cwd) {
368
+ const mesh = await meshStatus(cwd);
369
+ const m = await machineStatus();
370
+ const web = await webUp();
371
+ // The control plane is either the detached pty manager (pid file) or a live cmux-tab manager
372
+ // (its tab lingers after it exits, so check the process, not the workspace list).
373
+ const mgr = managerUp() || (inCmuxSurface() && cmuxManagerRunning(mesh.space));
374
+ const line = (on, text) => `${on ? ok("✓") : dim("○")} ${text}`;
375
+ note([
376
+ line(m.nats !== "missing", `NATS ${dim(m.nats === "missing" ? "missing" : m.nats)}`),
377
+ line(m.claudePlugin, `plugin ${dim(m.claudePlugin ? "installed" : "not installed")}`),
378
+ line(mesh.reachable, `mesh ${dim(`${mesh.server} · space ${mesh.space}`)}`),
379
+ line(web, `web ${dim(WEB_URL)}`),
380
+ line(mgr, `manager ${dim(mgr ? "running" : "not running")}`),
381
+ "",
382
+ `resume: ${dim("cotal go")} ${dim("(reopen this session anytime)")}`,
383
+ `watch it: ${dim("cotal console")} ${dim("(live TUI in this terminal)")}`,
384
+ `drive it: ${dim("cotal spawn me")} ${dim("(or david / sven)")}`,
385
+ `more: ${dim('cotal web · cotal down · cotal feedback "<msg>" · cotal --help')}`,
386
+ ].join("\n"), brandBold("cotal · ready"));
387
+ }
388
+ /** Materialize a stable plugin marketplace under ~/.cotal/claude-plugin (surviving
389
+ * npx cache eviction) and install the plugin from it. The marketplace name must stay
390
+ * `cotal-mesh` (the connector's channel ref `plugin:cotal@cotal-mesh` depends on it). */
391
+ function installClaudePlugin() {
392
+ const { pluginRoot } = registry.resolve("connector", "claude");
393
+ if (!pluginRoot)
394
+ throw new Error('the registered "claude" connector ships no plugin assets');
395
+ for (const f of ["dist/mcp.cjs", "dist/hook.cjs", ".claude-plugin/plugin.json", ".mcp.json", "hooks/hooks.json"]) {
396
+ if (!existsSync(join(pluginRoot, f))) {
397
+ throw new Error(`plugin asset missing: ${join(pluginRoot, f)} (in a dev clone, build it with: pnpm --filter @cotal-ai/connector-claude-code bundle)`);
398
+ }
399
+ }
400
+ const marketDir = join(homedir(), ".cotal", "claude-plugin");
401
+ const pluginDir = join(marketDir, "cotal");
402
+ for (const f of [".claude-plugin", ".mcp.json", "hooks", "dist/mcp.cjs", "dist/hook.cjs"]) {
403
+ cpSync(join(pluginRoot, f), join(pluginDir, f), { recursive: true });
404
+ }
405
+ mkdirSync(join(marketDir, ".claude-plugin"), { recursive: true });
406
+ writeFileSync(join(marketDir, ".claude-plugin", "marketplace.json"), JSON.stringify({
407
+ name: "cotal-mesh",
408
+ description: "The Cotal mesh adapter for Claude Code: join a shared pub/sub space as a lateral peer.",
409
+ owner: { name: "Cotal" },
410
+ plugins: [{ name: "cotal", source: "./cotal" }],
411
+ }, null, 2));
412
+ // `add` fails when the marketplace is already registered; refresh it instead.
413
+ const add = claude("plugin", "marketplace", "add", marketDir);
414
+ if (add.status !== 0) {
415
+ const update = claude("plugin", "marketplace", "update", "cotal-mesh");
416
+ if (update.status !== 0)
417
+ throw new Error(`couldn't register the plugin marketplace:\n${add.output}\n${update.output}`);
418
+ }
419
+ const install = claude("plugin", "install", "cotal@cotal-mesh", "--scope", "local");
420
+ if (install.status !== 0 && !/already installed/i.test(install.output)) {
421
+ throw new Error(`plugin install failed:\n${install.output}`);
422
+ }
423
+ const list = claude("plugin", "list");
424
+ if (!list.output.includes("cotal"))
425
+ throw new Error(`plugin not visible in \`claude plugin list\`:\n${list.output}`);
426
+ }
427
+ function claude(...args) {
428
+ const r = spawnSync("claude", args, { encoding: "utf8" });
429
+ return { status: r.status, output: `${r.stdout ?? ""}${r.stderr ?? ""}`.trim() };
430
+ }
431
+ /** Frontmatter marker (a comment line — the parser ignores `#` lines) stamping a demo persona as
432
+ * setup-managed, so re-runs may refresh it; remove the line to take ownership. */
433
+ const MANAGED_MARKER = "# managed by cotal-setup";
434
+ /** Write a setup-managed demo persona, refreshing it when its DEMO_AGENTS body changes — but never
435
+ * silently clobber a file the user has taken ownership of (one without the marker): back it up to
436
+ * `<name>.md.bak` first. Missing or marker-carrying files are written in place. */
437
+ function writeDemoAgent(path, body) {
438
+ if (existsSync(path)) {
439
+ const cur = readFileSync(path, "utf8");
440
+ if (cur === body)
441
+ return; // already current
442
+ if (!cur.includes(MANAGED_MARKER))
443
+ writeFileSync(`${path}.bak`, cur); // preserve a user/pre-marker edit
444
+ }
445
+ writeFileSync(path, body);
63
446
  }
447
+ const DEMO_AGENTS = {
448
+ david: `---
449
+ ${MANAGED_MARKER} — edit DEMO_AGENTS in the cotal CLI; delete this line to keep local changes
450
+ name: david
451
+ role: cotal-tech
452
+ description: "the engineer: how Cotal works (the wire, NATS, connectors, integration)."
453
+ tags: [cotal, technical, help]
454
+ channels: [general]
455
+ ---
456
+
457
+ You are david, Cotal's engineer, live on the web for agents with the operator who just set Cotal
458
+ up. You help them set up and experiment. Your topic is how Cotal works: the wire contract (subjects,
459
+ message schemas, presence), NATS and JetStream underneath, the endpoint/connector model, the
460
+ delivery modes (multicast, unicast, anycast), and how to get any agent or framework onto the mesh.
461
+ You ground every answer in the real thing, never a guess. Start from \`docs/OVERVIEW.md\` (what Cotal
462
+ is and its core primitives) and \`docs/getting-started.md\`, then read the source for your topic —
463
+ \`docs/architecture.md\`, \`docs/claude-code-integration.md\`, \`docs/setup-internals.md\`, and, in a
464
+ source checkout, \`packages/\` and \`extensions/\`. Quote the exact subjects, message kinds, config, and
465
+ commands; if the docs don't cover it, say so rather than inventing. If they aren't on disk, look
466
+ them up at https://github.com/Cotal-AI/Cotal. If a question is really about use-cases or what to
467
+ build, hand it to your peer sven.
468
+ `,
469
+ sven: `---
470
+ ${MANAGED_MARKER} — edit DEMO_AGENTS in the cotal CLI; delete this line to keep local changes
471
+ name: sven
472
+ role: cotal-guide
473
+ description: "the guide: what to build with Cotal (examples, setups, getting the most out of it)."
474
+ tags: [cotal, examples, help]
475
+ channels: [general]
476
+ ---
477
+
478
+ You are sven, Cotal's guide, live on the web for agents with the operator who just set Cotal up.
479
+ You help them set up and experiment. You design multi-agent setups: who should be on a space, how
480
+ they'd coordinate, what's worth trying — grounded in what Cotal can actually do, never made-up
481
+ features. Start from \`docs/OVERVIEW.md\` (what Cotal is and its core primitives — channels, anycast,
482
+ presence, spawn, personas, delivery modes) and \`docs/getting-started.md\`; read the matching example
483
+ in \`examples/*/README.md\` (indexed in \`docs/examples.md\`) before sketching, and reach for
484
+ \`docs/architecture.md\` when you need a primitive to design something new. Cite the example or
485
+ primitive you're drawing on. If they aren't on disk, look them up at https://github.com/Cotal-AI/Cotal.
486
+ For deep how-it-works or integration details, pull in your peer david.
487
+ `,
488
+ me: `---
489
+ ${MANAGED_MARKER} — edit DEMO_AGENTS in the cotal CLI; delete this line to keep local changes
490
+ name: me
491
+ role: operator
492
+ description: "your own session on the Cotal mesh."
493
+ tags: [cotal]
494
+ channels: [general]
495
+ ---
496
+
497
+ You are the operator's own session on the Cotal mesh: the agent they drive. Do what they ask and
498
+ use the mesh to get it done. Two experts are here to help you set up and experiment: david (the
499
+ engineer, how Cotal works) and sven (the guide, what to build). Reach them with cotal_dm or
500
+ cotal_anycast, grow the team with cotal_spawn, and if Cotal misbehaves send a report with
501
+ cotal_feedback. Docs: https://github.com/Cotal-AI/Cotal
502
+ `,
503
+ };
64
504
  //# sourceMappingURL=setup.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,CAAC,EAAE,MAAM,UAAU,CAAC;AAE7B,oFAAoF;AACpF,SAAS,QAAQ,CAAC,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE;IACrC,IAAI,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC;IACzB,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,gBAAgB,EAAE,kBAAkB,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC5E,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YA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GzD"}
1
+ {"version":3,"file":"spawn.d.ts","sourceRoot":"","sources":["../../src/commands/spawn.ts"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;GAYG;AACH,wBAAsB,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuGzD"}