@cotal-ai/manager 0.49.0 → 0.50.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/dist/manager.d.ts +33 -1
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +168 -24
- package/dist/manager.js.map +1 -1
- package/dist/runtime/index.d.ts +17 -4
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +21 -2
- package/dist/runtime/index.js.map +1 -1
- package/package.json +10 -10
package/dist/runtime/index.d.ts
CHANGED
|
@@ -2,15 +2,25 @@ import { type AgentHandle, type Runtime, type RuntimeKind, type RuntimeReference
|
|
|
2
2
|
export type { Runtime, RuntimeKind, AgentHandle, AttachSession } from "@cotal-ai/core";
|
|
3
3
|
/** Adopt a durable handle, or refuse by name when this runtime has no adopt method. */
|
|
4
4
|
export declare function requireRuntimeAdopt(runtime: Runtime, reference: RuntimeReference): AgentHandle;
|
|
5
|
-
/** What a {@link CustodialRuntime.reap} proved. `absent`:
|
|
6
|
-
*
|
|
7
|
-
*
|
|
5
|
+
/** What a {@link CustodialRuntime.reap} proved. `absent`: the custody record for that reference
|
|
6
|
+
* could not be read. That is a statement about ADDRESSABILITY, not about liveness, and the two are
|
|
7
|
+
* not the same fact: a custodian that dies after spawning its child and before writing the record
|
|
8
|
+
* leaves a LIVE seat and no record, and a stale or wrong reference looks for a record that exists
|
|
9
|
+
* at a different path. `reaped`: every process the record named was signalled and verified gone, or
|
|
10
|
+
* found already gone by identity. Only `reaped` proves anything about a process. */
|
|
8
11
|
export type RuntimeReapEvidence = {
|
|
9
12
|
outcome: "absent";
|
|
10
13
|
} | {
|
|
11
14
|
outcome: "reaped";
|
|
12
15
|
detail: string;
|
|
13
16
|
};
|
|
17
|
+
/** A reap that could not PROVE the seat gone, thrown by {@link requireRuntimeReap} on an `absent`
|
|
18
|
+
* outcome so no caller can render it as a disposal it did not make. Carries the reference so the
|
|
19
|
+
* operator has the one thing that lets them go look: what to search for. */
|
|
20
|
+
export declare class RuntimeReapUnproven extends Error {
|
|
21
|
+
readonly reference: RuntimeReference;
|
|
22
|
+
constructor(runtimeKind: string, reference: RuntimeReference);
|
|
23
|
+
}
|
|
14
24
|
/**
|
|
15
25
|
* A runtime that OWNS the processes it starts, durably enough to address them after the manager
|
|
16
26
|
* that started them is gone.
|
|
@@ -38,7 +48,10 @@ export declare function isCustodialRuntime(runtime: Runtime): runtime is Custodi
|
|
|
38
48
|
/** Reap an orphaned custody by reference, or refuse by name when this runtime does not custody its
|
|
39
49
|
* own processes. Absent means REFUSE, never "assume gone": the lifecycle stays held rather than
|
|
40
50
|
* retiring over a live seat. */
|
|
41
|
-
export declare function requireRuntimeReap(runtime: Runtime, reference: RuntimeReference): Promise<
|
|
51
|
+
export declare function requireRuntimeReap(runtime: Runtime, reference: RuntimeReference): Promise<{
|
|
52
|
+
outcome: "reaped";
|
|
53
|
+
detail: string;
|
|
54
|
+
}>;
|
|
42
55
|
/** How a manager picks its backend. `auto` is the deterministic default — always `pty`. External
|
|
43
56
|
* runtimes are never auto-selected; choose one explicitly, which resolves
|
|
44
57
|
* the integration from the registry and fails loud if it isn't imported. No fallbacks. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAY,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,KAAK,WAAW,EAAwB,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAIzI,YAAY,EAAE,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEvF,uFAAuF;AACvF,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,gBAAgB,GAAG,WAAW,CAI9F;AAED
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAEA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AAE,OAAO,EAAE,MAAM,GAAG,OAAO,CA0BzE;AAED,wFAAwF;AACxF,wBAAgB,iBAAiB,CAAC,QAAQ,GAAE,MAAsB,GAAG,MAAM,CAQ1E"}
|
package/dist/runtime/index.js
CHANGED
|
@@ -9,6 +9,18 @@ export function requireRuntimeAdopt(runtime, reference) {
|
|
|
9
9
|
throw new Error(`runtime "${runtime.kind}" does not support adopt`);
|
|
10
10
|
return runtime.adopt(reference);
|
|
11
11
|
}
|
|
12
|
+
/** A reap that could not PROVE the seat gone, thrown by {@link requireRuntimeReap} on an `absent`
|
|
13
|
+
* outcome so no caller can render it as a disposal it did not make. Carries the reference so the
|
|
14
|
+
* operator has the one thing that lets them go look: what to search for. */
|
|
15
|
+
export class RuntimeReapUnproven extends Error {
|
|
16
|
+
reference;
|
|
17
|
+
constructor(runtimeKind, reference) {
|
|
18
|
+
super(`runtime "${runtimeKind}" holds no custody record for ${reference.kind}:${reference.id}, so the seat it addresses is NOT proved gone; ` +
|
|
19
|
+
`a custodian that died before writing its record leaves a live seat behind this same outcome`);
|
|
20
|
+
this.name = "RuntimeReapUnproven";
|
|
21
|
+
this.reference = reference;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
12
24
|
/** Whether this backend custodies its own processes. Both methods are required together: a runtime
|
|
13
25
|
* that could mint references but never prove them gone would have the manager record references no
|
|
14
26
|
* successor can act on, which is worse than recording none. */
|
|
@@ -19,10 +31,17 @@ export function isCustodialRuntime(runtime) {
|
|
|
19
31
|
/** Reap an orphaned custody by reference, or refuse by name when this runtime does not custody its
|
|
20
32
|
* own processes. Absent means REFUSE, never "assume gone": the lifecycle stays held rather than
|
|
21
33
|
* retiring over a live seat. */
|
|
22
|
-
export function requireRuntimeReap(runtime, reference) {
|
|
34
|
+
export async function requireRuntimeReap(runtime, reference) {
|
|
23
35
|
if (!isCustodialRuntime(runtime))
|
|
24
36
|
throw new Error(`runtime "${runtime.kind}" does not support reap; the orphaned process for ${reference.kind}:${reference.id} cannot be proved gone`);
|
|
25
|
-
|
|
37
|
+
const evidence = await runtime.reap(reference);
|
|
38
|
+
// The refusal this function's contract promises, made structural: `absent` never leaves here, so
|
|
39
|
+
// the return type carries no branch a caller could render as success. Placing it at the callsites
|
|
40
|
+
// instead left each one free to describe an unread record as a reaped process, which is what both
|
|
41
|
+
// of them did.
|
|
42
|
+
if (evidence.outcome === "absent")
|
|
43
|
+
throw new RuntimeReapUnproven(runtime.kind, reference);
|
|
44
|
+
return evidence;
|
|
26
45
|
}
|
|
27
46
|
/** Build the runtime a manager will spawn through. `pty` ships with the manager and is what `auto`
|
|
28
47
|
* resolves to. Every other name resolves a self-registered {@link RuntimeProvider}; an explicit
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAiG,MAAM,gBAAgB,CAAC;AACzI,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAI5C,uFAAuF;AACvF,MAAM,UAAU,mBAAmB,CAAC,OAAgB,EAAE,SAA2B;IAC/E,IAAI,OAAO,OAAO,CAAC,KAAK,KAAK,UAAU;QACrC,MAAM,IAAI,KAAK,CAAC,YAAY,OAAO,CAAC,IAAI,0BAA0B,CAAC,CAAC;IACtE,OAAO,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAClC,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAA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AACxF,MAAM,UAAU,iBAAiB,CAAC,WAAmB,OAAO,CAAC,GAAG,EAAE;IAChE,IAAI,GAAG,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC5B,SAAS,CAAC;QACR,IAAI,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,qBAAqB,CAAC,CAAC;YAAE,OAAO,GAAG,CAAC;QAC7D,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QAC5B,IAAI,MAAM,KAAK,GAAG;YAAE,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;QAC7C,GAAG,GAAG,MAAM,CAAC;IACf,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cotal-ai/manager",
|
|
3
3
|
"description": "Cotal agent supervisor: spawns and manages mesh nodes via a pluggable runtime (pty/tmux/cmux/orca/herdr).",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.50.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
"ws": "^8.21.0",
|
|
31
31
|
"yaml": "^2.9.0",
|
|
32
32
|
"zod": "^4.4.3",
|
|
33
|
-
"@cotal-ai/core": "0.
|
|
34
|
-
"@cotal-ai/
|
|
35
|
-
"@cotal-ai/
|
|
33
|
+
"@cotal-ai/core": "0.50.0",
|
|
34
|
+
"@cotal-ai/seat": "0.50.0",
|
|
35
|
+
"@cotal-ai/workspace": "0.50.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@nats-io/nats-core": "^3.4.0",
|
|
39
39
|
"@types/ws": "^8.18.1",
|
|
40
40
|
"esbuild": "^0.28.1",
|
|
41
|
-
"@cotal-ai/
|
|
42
|
-
"@cotal-ai/
|
|
41
|
+
"@cotal-ai/auth": "0.50.0",
|
|
42
|
+
"@cotal-ai/connector-codex": "0.50.0",
|
|
43
|
+
"@cotal-ai/connector-claude-code": "0.50.0",
|
|
43
44
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
44
|
-
"@cotal-ai/connector-
|
|
45
|
-
"@cotal-ai/connector-
|
|
46
|
-
"@cotal-ai/delivery": "0.
|
|
47
|
-
"@cotal-ai/connector-core": "0.49.0"
|
|
45
|
+
"@cotal-ai/connector-core": "0.50.0",
|
|
46
|
+
"@cotal-ai/connector-opencode": "0.50.0",
|
|
47
|
+
"@cotal-ai/delivery": "0.50.0"
|
|
48
48
|
},
|
|
49
49
|
"files": [
|
|
50
50
|
"dist"
|