cotal-ai 0.99.1 → 0.100.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cotal-ai",
3
- "version": "0.99.1",
3
+ "version": "0.100.0",
4
4
  "description": "Cotal — lateral agent coordination over NATS. Run `npx cotal-ai` for the CLI.",
5
5
  "license": "Apache-2.0",
6
6
  "keywords": [
@@ -33,26 +33,26 @@
33
33
  "node": ">=22"
34
34
  },
35
35
  "dependencies": {
36
- "@cotal-ai/auth": "0.99.1",
37
- "@cotal-ai/cli": "0.99.1",
38
- "@cotal-ai/connector-core": "0.99.1",
39
- "@cotal-ai/core": "0.99.1",
40
- "@cotal-ai/delivery": "0.99.1",
41
- "@cotal-ai/manager": "0.99.1",
42
- "@cotal-ai/runtime": "0.99.1",
43
- "@cotal-ai/seat": "0.99.1",
44
- "@cotal-ai/workspace": "0.99.1"
36
+ "@cotal-ai/auth": "0.100.0",
37
+ "@cotal-ai/cli": "0.100.0",
38
+ "@cotal-ai/connector-core": "0.100.0",
39
+ "@cotal-ai/core": "0.100.0",
40
+ "@cotal-ai/delivery": "0.100.0",
41
+ "@cotal-ai/manager": "0.100.0",
42
+ "@cotal-ai/runtime": "0.100.0",
43
+ "@cotal-ai/seat": "0.100.0",
44
+ "@cotal-ai/workspace": "0.100.0"
45
45
  },
46
46
  "devDependencies": {
47
- "@cotal-ai/connector-claude-code": "0.99.1",
48
- "@cotal-ai/connector-codex": "0.99.1",
49
- "@cotal-ai/connector-hermes": "0.99.1",
50
- "@cotal-ai/connector-jcode": "0.99.1",
51
- "@cotal-ai/connector-opencode": "0.99.1",
52
- "@cotal-ai/linear": "0.99.1",
53
- "@cotal-ai/pi": "0.99.1",
47
+ "@cotal-ai/connector-claude-code": "0.100.0",
48
+ "@cotal-ai/connector-codex": "0.100.0",
49
+ "@cotal-ai/connector-hermes": "0.100.0",
50
+ "@cotal-ai/connector-jcode": "0.100.0",
51
+ "@cotal-ai/connector-opencode": "0.100.0",
52
+ "@cotal-ai/linear": "0.100.0",
53
+ "@cotal-ai/pi": "0.100.0",
54
54
  "@cotal-ai/smoke-kit": "0.0.0",
55
- "@cotal-ai/web": "0.99.1",
55
+ "@cotal-ai/web": "0.100.0",
56
56
  "@nats-io/jetstream": "^3.4.0",
57
57
  "@nats-io/transport-node": "^3.4.0",
58
58
  "typescript": "^5.9.3"
@@ -10,6 +10,13 @@ export interface DesktopEntry {
10
10
  }
11
11
  /** The `cotal` entry in the config at `path`, if it has one. */
12
12
  export declare function readDesktopEntry(path: string): unknown;
13
- /** Write `entry` as the `cotal` server in the config at `path`. Returns what changed. */
14
- export declare function writeDesktopEntry(path: string, entry: DesktopEntry): "added" | "updated" | "current";
13
+ /** Whether Claude Desktop is running, on macOS. Desktop reads its config once, when it starts, and
14
+ * writes the copy it holds back on ordinary use, so an entry added while it runs is lost. `ps -A -o
15
+ * comm=` prints each executable's path there; Desktop's main one ends in `/Claude.app/Contents/MacOS/
16
+ * Claude`, unlike its updater, its bundled Code (`claude.app/Contents/MacOS/claude`) and the `claude`
17
+ * CLI. Elsewhere this is `false`: that loss was not seen on Windows. */
18
+ export declare function desktopRunning(platform?: NodeJS.Platform): boolean;
19
+ /** Write `entry` as the `cotal` server in the config at `path`. Returns what changed, or that nothing
20
+ * was written because Claude Desktop is running. */
21
+ export declare function writeDesktopEntry(path: string, entry: DesktopEntry, running?: () => boolean): "added" | "updated" | "current" | "not added" | "not updated";
15
22
  //# sourceMappingURL=desktop-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"desktop-config.d.ts","sourceRoot":"","sources":["../src/desktop-config.ts"],"names":[],"mappings":"AAUA,6CAA6C;AAC7C,eAAO,MAAM,cAAc,UAAU,CAAC;AAEtC;iCACiC;AACjC,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAM,CAAC,QAA2B,EAAE,GAAG,GAAE,MAAM,CAAC,UAAw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AG,aAAa,CAU3K"}
@@ -6885,7 +6885,7 @@ var require_dist = __commonJS({
6885
6885
  });
6886
6886
 
6887
6887
  // src/setup.ts
6888
- import { spawn, spawnSync } from "node:child_process";
6888
+ import { spawn, spawnSync as spawnSync2 } from "node:child_process";
6889
6889
  import { createHash as createHash2, randomUUID } from "node:crypto";
6890
6890
  import { cpSync, existsSync as existsSync3, mkdirSync, readdirSync, readFileSync as readFileSync3, renameSync as renameSync2, rmSync, statSync as statSync2, writeFileSync as writeFileSync2 } from "node:fs";
6891
6891
  import { homedir as homedir3 } from "node:os";
@@ -23567,6 +23567,7 @@ var GATEWAY_INSTRUCTIONS = `${GATEWAY_CONNECTING} ${GATEWAY_LISTENING}`;
23567
23567
  var CLI_RECORD = "cli.json";
23568
23568
 
23569
23569
  // src/desktop-config.ts
23570
+ import { spawnSync } from "node:child_process";
23570
23571
  import { existsSync, readFileSync, renameSync, statSync, writeFileSync } from "node:fs";
23571
23572
  import { homedir } from "node:os";
23572
23573
  import { join as join2 } from "node:path";
@@ -23593,10 +23594,17 @@ function readConfig(path) {
23593
23594
  function readDesktopEntry(path) {
23594
23595
  return readConfig(path).mcpServers?.[DESKTOP_SERVER];
23595
23596
  }
23596
- function writeDesktopEntry(path, entry) {
23597
+ function desktopRunning(platform = process.platform) {
23598
+ if (platform !== "darwin") return false;
23599
+ const ps = spawnSync("ps", ["-A", "-o", "comm="], { encoding: "utf8", maxBuffer: 64 * 1024 * 1024, timeout: 1e4, killSignal: "SIGKILL" });
23600
+ if (ps.status !== 0) throw new Error(`Cotal could not list processes to tell whether Claude Desktop is running: ${ps.error?.message ?? ps.stderr.trim()}`);
23601
+ return ps.stdout.split("\n").some((line) => line.endsWith("/Claude.app/Contents/MacOS/Claude"));
23602
+ }
23603
+ function writeDesktopEntry(path, entry, running = desktopRunning) {
23597
23604
  const config2 = readConfig(path);
23598
23605
  const before = config2.mcpServers?.[DESKTOP_SERVER];
23599
23606
  if (JSON.stringify(before) === JSON.stringify(entry)) return "current";
23607
+ if (running()) return before === void 0 ? "not added" : "not updated";
23600
23608
  config2.mcpServers = { ...config2.mcpServers, [DESKTOP_SERVER]: entry };
23601
23609
  const tmp = `${path}.cotal-${process.pid}`;
23602
23610
  writeFileSync(tmp, `${JSON.stringify(config2, null, 2)}
@@ -23687,12 +23695,14 @@ function desktop(cotal, add, signedIn) {
23687
23695
  if (signedIn) return `Claude Desktop ${hostedConnector(signedIn)}`;
23688
23696
  if (!add && readDesktopEntry(path) === void 0) return void 0;
23689
23697
  const state = writeDesktopEntry(path, desktopEntry(cotal));
23698
+ if (state === "not added" || state === "not updated")
23699
+ return `Claude Desktop ${state}: Claude Desktop is running and writes back the config it read when it started, which would drop the entry. Quit Claude Desktop, then run \`cotal setup\` again from a terminal outside it`;
23690
23700
  return `Claude Desktop ${state}${state === "current" ? "" : "; quit and reopen Claude Desktop to load it"}`;
23691
23701
  }
23692
23702
  var DOCS_URL = "https://github.com/Cotal-AI/Cotal/blob/main/docs/connect-claude.md";
23693
23703
  var MARKETPLACE = "cotal-mesh";
23694
23704
  function claudeCommand() {
23695
- const terminal = spawnSync("claude", ["--version"], { stdio: "ignore", timeout: 5e3, killSignal: "SIGKILL" });
23705
+ const terminal = spawnSync2("claude", ["--version"], { stdio: "ignore", timeout: 5e3, killSignal: "SIGKILL" });
23696
23706
  if (terminal.status === 0) return "claude";
23697
23707
  if (terminal.error?.code !== "ENOENT")
23698
23708
  throw new Error("The installed Claude Code command could not run. Repair it before running cotal setup.");
@@ -23709,7 +23719,7 @@ function claudeCommand() {
23709
23719
  const candidates = process.platform === "darwin" ? [join4(root, entry.name, "claude.app", "Contents", "MacOS", "claude"), join4(root, entry.name, executable)] : [join4(root, entry.name, executable)];
23710
23720
  for (const candidate of candidates) {
23711
23721
  if (!existsSync3(candidate)) continue;
23712
- if (spawnSync(candidate, ["--version"], { stdio: "ignore", timeout: 5e3, killSignal: "SIGKILL" }).status !== 0)
23722
+ if (spawnSync2(candidate, ["--version"], { stdio: "ignore", timeout: 5e3, killSignal: "SIGKILL" }).status !== 0)
23713
23723
  throw new Error("Claude Desktop's bundled Code executable could not run. Update or reinstall Claude Desktop.");
23714
23724
  return candidate;
23715
23725
  }
@@ -23789,7 +23799,7 @@ function command(...args) {
23789
23799
  return commandIn(process.cwd(), ...args);
23790
23800
  }
23791
23801
  function commandIn(cwd, ...args) {
23792
- const result = spawnSync(claudeCommand(), args, { cwd, encoding: "utf8", maxBuffer: CLAUDE_OUTPUT_LIMIT, timeout: 12e4, killSignal: "SIGKILL" });
23802
+ const result = spawnSync2(claudeCommand(), args, { cwd, encoding: "utf8", maxBuffer: CLAUDE_OUTPUT_LIMIT, timeout: 12e4, killSignal: "SIGKILL" });
23793
23803
  if (result.error) return { status: null, output: result.error.message };
23794
23804
  return { status: result.status, output: `${result.stdout ?? ""}${result.stderr ?? ""}`.trim() };
23795
23805
  }