cotal-ai 0.164.0 → 0.164.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/daemon/manager.js +4 -2
- package/dist/daemon/update-entry.js +58 -3
- package/package.json +19 -19
- package/seeded-connectors/_shared/docs-bundle.bin +0 -0
- package/seeded-connectors/_shared/docs-index.bin +0 -0
- package/seeded-connectors/_shared/placements.json +2 -2
- package/seeded-connectors/claude/dist/index.js +7 -7
- package/seeded-connectors/claude/dist/mcp.cjs +14 -14
- package/seeded-connectors/claude/package.json +1 -1
- package/seeded-connectors/codex/dist/host.js +11 -11
- package/seeded-connectors/codex/dist/index.js +8 -8
- package/seeded-connectors/codex/dist/personal.js +14 -14
- package/seeded-connectors/codex/dist/setup.d.ts.map +1 -1
- package/seeded-connectors/codex/package.json +2 -2
- package/seeded-connectors/hermes/dist/index.js +7 -7
- package/seeded-connectors/hermes/dist/launch.js +11 -11
- package/seeded-connectors/hermes/package.json +1 -1
- package/seeded-connectors/hermes/plugin/cotal/_sidecar/standalone.cjs +11 -11
- package/seeded-connectors/hermes/plugin/cotal/adapter.py +2 -2
- package/seeded-connectors/hermes/plugin/cotal/framing.py +15 -1
- package/seeded-connectors/jcode/dist/host.js +11 -11
- package/seeded-connectors/jcode/dist/index.js +7 -7
- package/seeded-connectors/jcode/dist/mcp.js +8 -8
- package/seeded-connectors/jcode/package.json +1 -1
- package/seeded-connectors/opencode/dist/index.js +7 -7
- package/seeded-connectors/opencode/dist/plugin/index.js +11 -11
- package/seeded-connectors/opencode/package.json +1 -1
- package/seeded-connectors/pi/dist/driver.d.ts.map +1 -1
- package/seeded-connectors/pi/dist/index.js +10 -10
- package/seeded-connectors/pi/dist/standalone.js +12 -12
- package/seeded-connectors/pi/package.json +1 -1
- package/seeded-connectors/web/dist/web/assets/{AgentPage-f8SURf88.js → AgentPage-Qukx5uVG.js} +1 -1
- package/seeded-connectors/web/dist/web/assets/controller-S0XMj89g.js +110 -0
- package/seeded-connectors/web/dist/web/assets/{index-BlnRKE9-.js → index-DDaWQ0T5.js} +3 -3
- package/seeded-connectors/web/dist/web/index.html +2 -2
- package/seeded-connectors/web/package.json +1 -1
- package/seeded-connectors/web/dist/web/assets/controller-BZFLTUGf.js +0 -110
package/dist/daemon/manager.js
CHANGED
|
@@ -713,8 +713,10 @@ export function createHostedManagers(home = homeCotalDir(), version = installedG
|
|
|
713
713
|
if (!l.child)
|
|
714
714
|
continue;
|
|
715
715
|
const seats = await generationCall(l.child, randomUUID(), "inspect");
|
|
716
|
-
if (seats !== undefined && seats > 0)
|
|
717
|
-
|
|
716
|
+
if (seats !== undefined && seats > 0) {
|
|
717
|
+
const agents = await readHostedAgents(l.child);
|
|
718
|
+
throw new HostedManagerRefusal("SEATS_ACTIVE", `hosted Manager for ${l.view.space} holds ${seats} active seat(s): ${agents.map(agent => agent.name).join(", ")}`, command(`stop the seats through Manager ${l.view.instanceId} in space ${l.view.space}, then run \`cotal daemon setup --space ${l.view.space}\``));
|
|
719
|
+
}
|
|
718
720
|
}
|
|
719
721
|
const readinessDeadline = Date.now() + 15_000;
|
|
720
722
|
for (const l of live.values()) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
/** The binary composes machine-daemon custody with the stock package updater. */
|
|
2
2
|
import { existsSync } from "node:fs";
|
|
3
3
|
import { join } from "node:path";
|
|
4
|
+
import { createInterface } from "node:readline/promises";
|
|
4
5
|
import { registry } from "@cotal-ai/core";
|
|
5
6
|
import { update, updateRuntime, localUpdateManagers, readManagerContinuity, updateManagerPin } from "@cotal-ai/cli/update";
|
|
6
7
|
import { withIdpSessionDir, withRemoteExchangeRetry } from "@cotal-ai/auth";
|
|
7
|
-
import { brokerAddressKey, assertRecordIdentity, CommandFailure, homeCotalDir, readUpdateRecovery, claimUpdateClosureAccess, resolveControlTarget
|
|
8
|
+
import { brokerAddressKey, assertRecordIdentity, CommandFailure, homeCotalDir, readUpdateRecovery, claimUpdateClosureAccess, resolveControlTarget } from "@cotal-ai/workspace";
|
|
8
9
|
import { askManager } from "@cotal-ai/workspace/control";
|
|
9
10
|
import { daemonPaths, EndpointRefusal } from "./endpoint.js";
|
|
10
11
|
import { managerViaDaemon, queryDaemon } from "./client.js";
|
|
@@ -20,6 +21,7 @@ const composed = { ...command, async run(args) {
|
|
|
20
21
|
let preparedRestart = false;
|
|
21
22
|
let absentRecoveryHost = false;
|
|
22
23
|
let currentPackages = false;
|
|
24
|
+
let askedToStop = false;
|
|
23
25
|
await update(args, { ...updateRuntime, isCurrent() {
|
|
24
26
|
currentPackages = updateRuntime.isCurrent?.() === true;
|
|
25
27
|
return currentPackages;
|
|
@@ -116,6 +118,7 @@ const composed = { ...command, async run(args) {
|
|
|
116
118
|
hostedSpaces = active.map((manager) => manager.space);
|
|
117
119
|
if (!active.length)
|
|
118
120
|
return updateRuntime.reportRunningManager(flags);
|
|
121
|
+
const blockedAgents = [];
|
|
119
122
|
for (const manager of active) {
|
|
120
123
|
// A failed earlier observation is not proof that a retained child's endpoint cannot answer.
|
|
121
124
|
// Keep the fresh, instance-pinned custody check below as the authority for update admission.
|
|
@@ -129,8 +132,39 @@ const composed = { ...command, async run(args) {
|
|
|
129
132
|
throw new Error(reply.error ?? "hosted Manager status did not answer");
|
|
130
133
|
const status = reply.data;
|
|
131
134
|
if (!currentPackages && status.custody === "legacy" && status.agentCount !== 0) {
|
|
132
|
-
const
|
|
133
|
-
|
|
135
|
+
const instanceId = manager.instanceId;
|
|
136
|
+
const inventory = await withIdpSessionDir(homeCotalDir(), async () => {
|
|
137
|
+
const target = await resolveControlTarget({ space: manager.space }, "control-caller-privileged", instanceId, { onRefusal: "throw", readOnly: true });
|
|
138
|
+
const rows = await askManager({ versionSkew: (text) => text, roster: async () => [] }, manager.space, target.server, "ps", undefined, target.auth, "owner", 3000, { instanceId });
|
|
139
|
+
if (!rows.ok || !Array.isArray(rows.data))
|
|
140
|
+
throw new Error(rows.error ?? "hosted Manager agent inventory did not answer");
|
|
141
|
+
return rows.data;
|
|
142
|
+
});
|
|
143
|
+
if (inventory.some(agent => !agent || typeof agent.name !== "string" || !agent.name || typeof agent.id !== "string" || !agent.id || typeof agent.lifecycleUid !== "string" || !agent.lifecycleUid))
|
|
144
|
+
throw new Error("hosted Manager returned an unfenced agent inventory; no stop authorized");
|
|
145
|
+
if (inventory.length !== status.agentCount)
|
|
146
|
+
throw new Error("hosted Manager agent inventory changed during update preflight; retry the update");
|
|
147
|
+
const describe = inventory.map(agent => `${agent.name} (idle ${typeof agent.activeAt === "number" ? `${Math.max(0, Math.floor((Date.now() - agent.activeAt) / 60_000))} min` : "time unavailable"})`).join(", ");
|
|
148
|
+
blockedAgents.push({ space: manager.space, describe, async stop() {
|
|
149
|
+
await withIdpSessionDir(homeCotalDir(), async () => {
|
|
150
|
+
const target = await resolveControlTarget({ space: manager.space }, "control-caller-privileged", instanceId, { onRefusal: "throw", readOnly: true });
|
|
151
|
+
const client = { versionSkew: (text) => text, roster: async () => [] };
|
|
152
|
+
const fresh = await askManager(client, manager.space, target.server, "ps", undefined, target.auth, "owner", 3000, { instanceId });
|
|
153
|
+
if (!fresh.ok || !Array.isArray(fresh.data))
|
|
154
|
+
throw new Error(fresh.error ?? "agent inventory did not answer before stop");
|
|
155
|
+
const current = fresh.data;
|
|
156
|
+
if (current.length !== inventory.length || inventory.some(agent => !current.some(row => row.id === agent.id && row.lifecycleUid === agent.lifecycleUid && row.name === agent.name)))
|
|
157
|
+
throw new Error("agent inventory changed after consent; no further stops authorized; retry the update");
|
|
158
|
+
for (const agent of inventory) {
|
|
159
|
+
const stopped = await askManager(client, manager.space, target.server, "stop", { name: agent.name }, target.auth, "owner", 20_000, { instanceId, expectedTarget: { id: agent.id, lifecycleUid: agent.lifecycleUid } });
|
|
160
|
+
if (!stopped.ok)
|
|
161
|
+
throw new Error(stopped.error ?? `could not stop ${agent.name}`);
|
|
162
|
+
}
|
|
163
|
+
const empty = await askManager(client, manager.space, target.server, "managerStatus", undefined, target.auth, "owner", 3000, { instanceId });
|
|
164
|
+
if (!empty.ok || empty.data?.agentCount !== 0)
|
|
165
|
+
throw new Error("hosted Manager still has running agents; update deferred");
|
|
166
|
+
});
|
|
167
|
+
} });
|
|
134
168
|
}
|
|
135
169
|
if (currentPackages && status.custody === "legacy" && status.agentCount !== 0) {
|
|
136
170
|
const names = status.stopImpact?.agents.map(agent => agent.name);
|
|
@@ -167,6 +201,27 @@ const composed = { ...command, async run(args) {
|
|
|
167
201
|
return "legacy";
|
|
168
202
|
}
|
|
169
203
|
}
|
|
204
|
+
if (localVerdict === "legacy")
|
|
205
|
+
return localVerdict;
|
|
206
|
+
if (blockedAgents.length) {
|
|
207
|
+
const summary = blockedAgents.map(row => `${row.space}: ${row.describe}`).join("; ");
|
|
208
|
+
let consent = flags["stop-agents"] === true && process.env.COTAL_AUTO_UPDATE !== "1";
|
|
209
|
+
if (!consent && !askedToStop && process.env.COTAL_AUTO_UPDATE !== "1" && !process.env.COTAL_UPDATE_PARENT && process.stdin.isTTY && process.stdout.isTTY) {
|
|
210
|
+
askedToStop = true;
|
|
211
|
+
console.log(`These agents cannot survive this update: ${summary}`);
|
|
212
|
+
const input = createInterface({ input: process.stdin, output: process.stdout });
|
|
213
|
+
try {
|
|
214
|
+
consent = /^(y|yes)$/i.test((await input.question("Stop these agents and continue the update? [y/N] ")).trim());
|
|
215
|
+
}
|
|
216
|
+
finally {
|
|
217
|
+
input.close();
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
if (!consent)
|
|
221
|
+
throw new CommandFailure("refused", "LIFECYCLE_BLOCKED", `cannot preserve running agents on this computer during update (${summary}); restarting would end them`, { remedy: "save their work, then run `cotal update --self --stop-agents` to stop them and finish the update" });
|
|
222
|
+
for (const row of blockedAgents)
|
|
223
|
+
await row.stop();
|
|
224
|
+
}
|
|
170
225
|
return localVerdict;
|
|
171
226
|
}) });
|
|
172
227
|
if (currentPackages || args.values.check === true || args.values.auto || args.values.notify || process.exitCode || !daemonObserved)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cotal-ai",
|
|
3
|
-
"version": "0.164.
|
|
3
|
+
"version": "0.164.1",
|
|
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,28 +33,28 @@
|
|
|
33
33
|
"node": ">=22.10"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@cotal-ai/auth": "0.164.
|
|
37
|
-
"@cotal-ai/cli": "0.164.
|
|
38
|
-
"@cotal-ai/connector-core": "0.164.
|
|
39
|
-
"@cotal-ai/core": "0.164.
|
|
40
|
-
"@cotal-ai/delivery": "0.164.
|
|
41
|
-
"@cotal-ai/manager": "0.164.
|
|
42
|
-
"@cotal-ai/registry": "0.164.
|
|
43
|
-
"@cotal-ai/runtime": "0.164.
|
|
44
|
-
"@cotal-ai/seat": "0.164.
|
|
45
|
-
"@cotal-ai/workspace": "0.164.
|
|
36
|
+
"@cotal-ai/auth": "0.164.1",
|
|
37
|
+
"@cotal-ai/cli": "0.164.1",
|
|
38
|
+
"@cotal-ai/connector-core": "0.164.1",
|
|
39
|
+
"@cotal-ai/core": "0.164.1",
|
|
40
|
+
"@cotal-ai/delivery": "0.164.1",
|
|
41
|
+
"@cotal-ai/manager": "0.164.1",
|
|
42
|
+
"@cotal-ai/registry": "0.164.1",
|
|
43
|
+
"@cotal-ai/runtime": "0.164.1",
|
|
44
|
+
"@cotal-ai/seat": "0.164.1",
|
|
45
|
+
"@cotal-ai/workspace": "0.164.1",
|
|
46
46
|
"jose": "^6.2.3"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@cotal-ai/connector-claude-code": "0.164.
|
|
50
|
-
"@cotal-ai/connector-codex": "0.164.
|
|
51
|
-
"@cotal-ai/connector-hermes": "0.164.
|
|
52
|
-
"@cotal-ai/connector-jcode": "0.164.
|
|
53
|
-
"@cotal-ai/connector-opencode": "0.164.
|
|
54
|
-
"@cotal-ai/linear": "0.164.
|
|
55
|
-
"@cotal-ai/pi": "0.164.
|
|
49
|
+
"@cotal-ai/connector-claude-code": "0.164.1",
|
|
50
|
+
"@cotal-ai/connector-codex": "0.164.1",
|
|
51
|
+
"@cotal-ai/connector-hermes": "0.164.1",
|
|
52
|
+
"@cotal-ai/connector-jcode": "0.164.1",
|
|
53
|
+
"@cotal-ai/connector-opencode": "0.164.1",
|
|
54
|
+
"@cotal-ai/linear": "0.164.1",
|
|
55
|
+
"@cotal-ai/pi": "0.164.1",
|
|
56
56
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
57
|
-
"@cotal-ai/web": "0.164.
|
|
57
|
+
"@cotal-ai/web": "0.164.1",
|
|
58
58
|
"@nats-io/jetstream": "^3.4.0",
|
|
59
59
|
"@nats-io/transport-node": "^3.4.0",
|
|
60
60
|
"typescript": "^5.9.3"
|
|
Binary file
|
|
Binary file
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"v": 1,
|
|
3
3
|
"files": {
|
|
4
|
-
"docs-bundle.bin": "
|
|
5
|
-
"docs-index.bin": "
|
|
4
|
+
"docs-bundle.bin": "fdfd9c814ed3552540ac32807d7e0fcea6511cd89719e7f3c75128bc05b5246c",
|
|
5
|
+
"docs-index.bin": "8f065c7459cfff6275247d8e5bd80fae79404f616ef841932d55ccffb074c73e"
|
|
6
6
|
},
|
|
7
7
|
"placements": {
|
|
8
8
|
"claude": [
|