cotal-ai 0.14.1 → 0.14.2

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/cotal.js CHANGED
@@ -1,37 +1,29 @@
1
1
  #!/usr/bin/env node
2
2
  /**
3
- * Composition root for the `cotal` operator CLI, published as `cotal-ai`. Importing an
4
- * implementation self-registers its commands into the shared registry base mesh commands
5
- * plus `spawn`/`console` (@cotal-ai/cli) and the manager's control plane + daemon runners
6
- * (@cotal-ai/manager). The root just picks which surfaces to pull in; `runCli` resolves
7
- * whatever registered. A new surface (another connector, a control client …) is one more import line.
3
+ * Executable entry for the `cotal` CLI (published as `cotal-ai`): a Node-version preflight, then a
4
+ * hand-off to the real composition root (./run.js) via dynamic import.
5
+ *
6
+ * Why this file exists separately: the CLI's UI stack (ink, @clack/prompts, string-width) and the
7
+ * bundled `nats-server` optional dependency (@eplightning/nats-server-*) all require Node >= 22
8
+ * and npm SILENTLY SKIPS an optional dependency whose `engines` the running Node doesn't satisfy,
9
+ * so on an older Node the bundled broker is never installed at all. On top of that, string-width
10
+ * uses a Node-20+ regex flag that is a hard parse error on older Node. An ESM entry parses its whole
11
+ * static-import graph before its own body runs, so a version check inside ./run.ts would come too
12
+ * late — it would crash while parsing string-width. This shim therefore keeps ZERO static imports
13
+ * of that chain: the check runs first, and ./run.js is only pulled in (dynamically) once it passes.
8
14
  */
9
- // NOTE: registration order across these imports is NOT guaranteed (tsx's entry interop can
10
- // evaluate the smaller daemon graphs first) — display order is a non-goal here; `help` ranks
11
- // its groups explicitly (GROUP_ORDER in @cotal-ai/cli).
12
- import { runCli } from "@cotal-ai/cli"; // self-registers the base surface incl. spawn (foreground + --detach) / stop / ps / attach
13
- import "@cotal-ai/manager"; // self-registers `supervise` the agent-supervisor daemon
14
- import "@cotal-ai/delivery"; // self-registers `deliver` the server-side Plane-3 delivery daemon
15
- import "@cotal-ai/auth"; // self-registers login / logout — per-user IdP sessions (device-code sign-in)
16
- import { registry } from "@cotal-ai/core";
17
- // A CLI must exit quietly when its stdout is closed early piped to `head`, a pager that quits,
18
- // or a shell's process substitution (`source <(cotal completion bash)`). Node otherwise turns the
19
- // closed-pipe write into a fatal unhandled 'error' event with a stack trace. Mirror SIGPIPE: exit
20
- // 0. Registered before any command can write.
21
- process.stdout.on("error", (e) => {
22
- if (e.code === "EPIPE")
23
- process.exit(0);
24
- throw e;
25
- });
26
- // The four agent connectors (claude/opencode/hermes/pi) are NOT imported here: they are removable,
27
- // install-seeded `cotal ext` plugins loaded through the manifest, exactly like a third-party
28
- // connector (and like the `@cotal-ai/orca` runtime already is). `runCli` seeds them on first run and
29
- // materializes each lazily when a command resolves it; the default agent is `COTAL_DEFAULT_AGENT`
30
- // (else claude), resolved manager-side. The old `"cotal"` default-agent alias is gone with them.
31
- //
32
- // Bare `cotal` prints help; explicit `cotal setup` runs guided setup. The published binary is
33
- // the ONE composition root that loads operator-installed extensions (`cotal ext add …`) — commands,
34
- // runtimes, connectors, and local process components all self-register from those packages. Library
35
- // roots keep the explicit-import model.
36
- const argv = process.argv.slice(2);
37
- await runCli(registry, argv, { extensions: true });
15
+ const MIN_NODE_MAJOR = 22;
16
+ const nodeMajor = Number.parseInt(process.versions.node.split(".")[0] ?? "", 10);
17
+ if (!Number.isInteger(nodeMajor) || nodeMajor < MIN_NODE_MAJOR) {
18
+ process.stderr.write(`\ncotal-ai requires Node.js >= ${MIN_NODE_MAJOR}, but this is ${process.version}.\n` +
19
+ `The bundled nats-server broker (and the CLI's UI stack) need Node >= ${MIN_NODE_MAJOR}; on an\n` +
20
+ `older Node, npm silently skips the broker binary and the CLI cannot start.\n\n` +
21
+ `Install a newer Node (https://nodejs.org). With nvm:\n` +
22
+ ` nvm install ${MIN_NODE_MAJOR} && nvm use ${MIN_NODE_MAJOR}\n\n` +
23
+ `If you already ran cotal once under the old Node, also clear the npx cache so the bundled\n` +
24
+ `nats-server is fetched cleanly, then retry:\n` +
25
+ ` rm -rf ~/.npm/_npx # or: npx clear-npx-cache\n\n`);
26
+ process.exit(1);
27
+ }
28
+ await import("./run.js");
29
+ export {};
package/dist/run.js ADDED
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Composition root for the `cotal` operator CLI, published as `cotal-ai`. Importing an
3
+ * implementation self-registers its commands into the shared registry — base mesh commands
4
+ * plus `spawn`/`console` (@cotal-ai/cli) and the manager's control plane + daemon runners
5
+ * (@cotal-ai/manager). The root just picks which surfaces to pull in; `runCli` resolves
6
+ * whatever registered. A new surface (another connector, a control client …) is one more import line.
7
+ *
8
+ * Reached only via ./cotal.ts, which runs the Node-version preflight first: everything imported
9
+ * here requires Node >= 22 (the UI stack and the bundled nats-server optional dep), so this module
10
+ * must never be the executable entry — importing it on an old Node crashes at parse time.
11
+ */
12
+ // NOTE: registration order across these imports is NOT guaranteed (tsx's entry interop can
13
+ // evaluate the smaller daemon graphs first) — display order is a non-goal here; `help` ranks
14
+ // its groups explicitly (GROUP_ORDER in @cotal-ai/cli).
15
+ import { runCli } from "@cotal-ai/cli"; // self-registers the base surface incl. spawn (foreground + --detach) / stop / ps / attach
16
+ import "@cotal-ai/manager"; // self-registers `supervise` — the agent-supervisor daemon
17
+ import "@cotal-ai/delivery"; // self-registers `deliver` — the server-side Plane-3 delivery daemon
18
+ import "@cotal-ai/auth"; // self-registers login / logout — per-user IdP sessions (device-code sign-in)
19
+ import { registry } from "@cotal-ai/core";
20
+ // A CLI must exit quietly when its stdout is closed early — piped to `head`, a pager that quits,
21
+ // or a shell's process substitution (`source <(cotal completion bash)`). Node otherwise turns the
22
+ // closed-pipe write into a fatal unhandled 'error' event with a stack trace. Mirror SIGPIPE: exit
23
+ // 0. Registered before any command can write.
24
+ process.stdout.on("error", (e) => {
25
+ if (e.code === "EPIPE")
26
+ process.exit(0);
27
+ throw e;
28
+ });
29
+ // The four agent connectors (claude/opencode/hermes/pi) are NOT imported here: they are removable,
30
+ // install-seeded `cotal ext` plugins loaded through the manifest, exactly like a third-party
31
+ // connector (and like the `@cotal-ai/orca` runtime already is). `runCli` seeds them on first run and
32
+ // materializes each lazily when a command resolves it; the default agent is `COTAL_DEFAULT_AGENT`
33
+ // (else claude), resolved manager-side. The old `"cotal"` default-agent alias is gone with them.
34
+ //
35
+ // Bare `cotal` prints help; explicit `cotal setup` runs guided setup. The published binary is
36
+ // the ONE composition root that loads operator-installed extensions (`cotal ext add …`) — commands,
37
+ // runtimes, connectors, and local process components all self-register from those packages. Library
38
+ // roots keep the explicit-import model.
39
+ const argv = process.argv.slice(2);
40
+ await runCli(registry, argv, { extensions: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cotal-ai",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
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": [
@@ -23,25 +23,25 @@
23
23
  "cotal": "./dist/cotal.js"
24
24
  },
25
25
  "engines": {
26
- "node": ">=20"
26
+ "node": ">=22"
27
27
  },
28
28
  "dependencies": {
29
- "@cotal-ai/auth": "0.14.1",
30
- "@cotal-ai/cli": "0.14.1",
31
- "@cotal-ai/delivery": "0.14.1",
32
- "@cotal-ai/core": "0.14.1",
33
- "@cotal-ai/connector-core": "0.14.1",
34
- "@cotal-ai/manager": "0.14.1",
35
- "@cotal-ai/workspace": "0.14.1"
29
+ "@cotal-ai/auth": "0.14.2",
30
+ "@cotal-ai/connector-core": "0.14.2",
31
+ "@cotal-ai/cli": "0.14.2",
32
+ "@cotal-ai/core": "0.14.2",
33
+ "@cotal-ai/delivery": "0.14.2",
34
+ "@cotal-ai/manager": "0.14.2",
35
+ "@cotal-ai/workspace": "0.14.2"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@nats-io/jetstream": "^3.4.0",
39
39
  "@nats-io/transport-node": "^3.4.0",
40
- "@cotal-ai/connector-hermes": "0.14.1",
41
- "@cotal-ai/connector-opencode": "0.14.1",
42
- "@cotal-ai/pi": "0.14.1",
43
- "@cotal-ai/web": "0.14.1",
44
- "@cotal-ai/connector-claude-code": "0.14.1"
40
+ "@cotal-ai/connector-hermes": "0.14.2",
41
+ "@cotal-ai/connector-opencode": "0.14.2",
42
+ "@cotal-ai/pi": "0.14.2",
43
+ "@cotal-ai/connector-claude-code": "0.14.2",
44
+ "@cotal-ai/web": "0.14.2"
45
45
  },
46
46
  "files": [
47
47
  "dist",
@@ -24413,7 +24413,7 @@ function hasIdentity(env = process.env) {
24413
24413
 
24414
24414
  // ../connector-core/dist/docs-bundle.generated.js
24415
24415
  var DOCS_BUNDLE = {
24416
- "version": "0.14.1",
24416
+ "version": "0.14.2",
24417
24417
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
24418
24418
  "pages": [
24419
24419
  {
@@ -151,7 +151,7 @@ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAll
151
151
 
152
152
  // ../connector-core/dist/docs-bundle.generated.js
153
153
  var DOCS_BUNDLE = {
154
- "version": "0.14.1",
154
+ "version": "0.14.2",
155
155
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
156
156
  "pages": [
157
157
  {
@@ -59962,7 +59962,7 @@ var import_node_child_process2 = require("node:child_process");
59962
59962
 
59963
59963
  // ../connector-core/dist/docs-bundle.generated.js
59964
59964
  var DOCS_BUNDLE = {
59965
- "version": "0.14.1",
59965
+ "version": "0.14.2",
59966
59966
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
59967
59967
  "pages": [
59968
59968
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-claude-code",
3
3
  "description": "Cotal connector for Claude Code: an installed plugin that joins a session to the mesh.",
4
- "version": "0.14.1",
4
+ "version": "0.14.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -111,7 +111,7 @@ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAll
111
111
 
112
112
  // ../connector-core/dist/docs-bundle.generated.js
113
113
  var DOCS_BUNDLE = {
114
- "version": "0.14.1",
114
+ "version": "0.14.2",
115
115
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
116
116
  "pages": [
117
117
  {
@@ -43568,7 +43568,7 @@ config(en_default());
43568
43568
 
43569
43569
  // ../connector-core/dist/docs-bundle.generated.js
43570
43570
  var DOCS_BUNDLE = {
43571
- "version": "0.14.1",
43571
+ "version": "0.14.2",
43572
43572
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
43573
43573
  "pages": [
43574
43574
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-hermes",
3
3
  "description": "Cotal connector for the Hermes (Nous Research) agent.",
4
- "version": "0.14.1",
4
+ "version": "0.14.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -43548,7 +43548,7 @@ config(en_default());
43548
43548
 
43549
43549
  // ../connector-core/dist/docs-bundle.generated.js
43550
43550
  var DOCS_BUNDLE = {
43551
- "version": "0.14.1",
43551
+ "version": "0.14.2",
43552
43552
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
43553
43553
  "pages": [
43554
43554
  {
@@ -136,7 +136,7 @@ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAll
136
136
 
137
137
  // ../connector-core/dist/docs-bundle.generated.js
138
138
  var DOCS_BUNDLE = {
139
- "version": "0.14.1",
139
+ "version": "0.14.2",
140
140
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
141
141
  "pages": [
142
142
  {
@@ -43556,7 +43556,7 @@ config(en_default());
43556
43556
 
43557
43557
  // ../connector-core/dist/docs-bundle.generated.js
43558
43558
  var DOCS_BUNDLE = {
43559
- "version": "0.14.1",
43559
+ "version": "0.14.2",
43560
43560
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
43561
43561
  "pages": [
43562
43562
  {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/connector-opencode",
3
3
  "description": "Cotal connector for OpenCode: a native in-process plugin that joins a session to the mesh.",
4
- "version": "0.14.1",
4
+ "version": "0.14.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -15492,7 +15492,7 @@ import { isConcreteChannel as isConcreteChannel3, channelInAllow as channelInAll
15492
15492
 
15493
15493
  // ../connector-core/dist/docs-bundle.generated.js
15494
15494
  var DOCS_BUNDLE = {
15495
- "version": "0.14.1",
15495
+ "version": "0.14.2",
15496
15496
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
15497
15497
  "pages": [
15498
15498
  {
@@ -43563,7 +43563,7 @@ config(en_default());
43563
43563
 
43564
43564
  // ../connector-core/dist/docs-bundle.generated.js
43565
43565
  var DOCS_BUNDLE = {
43566
- "version": "0.14.1",
43566
+ "version": "0.14.2",
43567
43567
  "generatedFrom": "docs/*.md + SPEC.md + spec/cotal.schema.json",
43568
43568
  "pages": [
43569
43569
  {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cotal-ai/pi",
3
- "version": "0.14.1",
3
+ "version": "0.14.2",
4
4
  "license": "Apache-2.0",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@cotal-ai/web",
3
3
  "description": "Cotal browser observability dashboard: adds the `web` command to the cotal CLI.",
4
- "version": "0.14.1",
4
+ "version": "0.14.2",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",