@cotal-ai/manager 0.171.1 → 0.171.3

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 (40) hide show
  1. package/dist/command-dispatch.d.ts +206 -0
  2. package/dist/command-dispatch.d.ts.map +1 -0
  3. package/dist/command-dispatch.js +471 -0
  4. package/dist/command-dispatch.js.map +1 -0
  5. package/dist/manager.d.ts +48 -283
  6. package/dist/manager.d.ts.map +1 -1
  7. package/dist/manager.js +230 -1775
  8. package/dist/manager.js.map +1 -1
  9. package/dist/persona-catalog.d.ts +86 -0
  10. package/dist/persona-catalog.d.ts.map +1 -0
  11. package/dist/persona-catalog.js +325 -0
  12. package/dist/persona-catalog.js.map +1 -0
  13. package/dist/run-hosting.d.ts +5 -2
  14. package/dist/run-hosting.d.ts.map +1 -1
  15. package/dist/run-hosting.js +55 -16
  16. package/dist/run-hosting.js.map +1 -1
  17. package/dist/runtime/index.d.ts +2 -0
  18. package/dist/runtime/index.d.ts.map +1 -1
  19. package/dist/runtime/index.js +22 -0
  20. package/dist/runtime/index.js.map +1 -1
  21. package/dist/seat-launch.d.ts +1 -1
  22. package/dist/seat-launch.d.ts.map +1 -1
  23. package/dist/seat-launch.js +4 -2
  24. package/dist/seat-launch.js.map +1 -1
  25. package/dist/seat-stop.d.ts +232 -0
  26. package/dist/seat-stop.d.ts.map +1 -0
  27. package/dist/seat-stop.js +552 -0
  28. package/dist/seat-stop.js.map +1 -0
  29. package/dist/service-adapter.d.ts.map +1 -1
  30. package/dist/service-adapter.js +14 -5
  31. package/dist/service-adapter.js.map +1 -1
  32. package/dist/spawn-goal.d.ts +77 -0
  33. package/dist/spawn-goal.d.ts.map +1 -0
  34. package/dist/spawn-goal.js +357 -0
  35. package/dist/spawn-goal.js.map +1 -0
  36. package/dist/terminal-input.d.ts +82 -0
  37. package/dist/terminal-input.d.ts.map +1 -0
  38. package/dist/terminal-input.js +266 -0
  39. package/dist/terminal-input.js.map +1 -0
  40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wF;QACxF,IAAI,MAAM,KAAK,SAAS;YAAE,MAAM,mBAAmB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpE,MAAM,IAAI,eAAe,CAAC,aAAa,EAAE,SAAS,MAAM,yIAAyI,CAAC,CAAC;IACrM,CAAC;IAED;+FAC2F;IAC3F,oBAAoB,CAAC,GAAY;QAC/B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;QACzB,UAAU,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,yBAAyB,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC;IAC/F,CAAC;CACF"}
@@ -0,0 +1,82 @@
1
+ import type { ControlReply } from "@cotal-ai/core";
2
+ import type { SessionEstablishment } from "./attach-endpoint.js";
3
+ import type { Manager } from "./manager.js";
4
+ import type { ManagedAgent } from "./seat-types.js";
5
+ /** Bracketed-paste delimiters (DECSET 2004). `input` wraps a seat's text in these so the return it
6
+ * writes afterwards is a KEYSTROKE rather than the newline trailing a pasted block: a TUI that
7
+ * classifies a fast burst as a paste consumes that trailing newline and the text sits unsubmitted
8
+ * in the composer until the next call's return (issue #1649). Framing, never content - these bytes
9
+ * are not counted into the receipt, so `bytes` still reports what the caller asked to deliver. */
10
+ export declare const PASTE_START = "\u001B[200~";
11
+ export declare const PASTE_END = "\u001B[201~";
12
+ /** `details[].kind` on an `attach` refusal raised because the seat's runtime opens no terminal
13
+ * stream. The message carries that runtime's own guidance, which is operator copy and changes; this
14
+ * marker is the contract a caller keys on so it can act without reading the wording. */
15
+ export declare const RUNTIME_NO_TERMINAL_DETAIL = "ai.cotal.manager.runtime-no-terminal";
16
+ /** What {@link TerminalInput} reads from the Manager. Every entry is read at use, so a field the Manager
17
+ * assigns after construction is always current, and a Manager method a test replaces is the one that runs. */
18
+ export interface TerminalInputDeps {
19
+ agents: () => Manager["agents"];
20
+ auth: () => Manager["auth"];
21
+ managerLifecycleUid: () => Manager["managerLifecycleUid"];
22
+ sessionPlane: () => Manager["sessionPlane"];
23
+ wsPort: () => Manager["wsPort"];
24
+ runtimeFor: (...args: Parameters<Manager["runtimeFor"]>) => ReturnType<Manager["runtimeFor"]>;
25
+ }
26
+ /** Typing into a seat's terminal and opening an attach or console session on it, after authorization. */
27
+ export declare class TerminalInput {
28
+ private readonly deps;
29
+ constructor(deps: TerminalInputDeps);
30
+ private get agents();
31
+ private get auth();
32
+ private get managerLifecycleUid();
33
+ private get sessionPlane();
34
+ private get wsPort();
35
+ private runtimeFor;
36
+ /** The post-authorization `input` effect (C3): type `text` into the seat's terminal as if a human
37
+ * had. The single call an external UI needs to deliver a harness command (`/compact`, `/clear`,
38
+ * `/model`) without holding a terminal open on the caller's side.
39
+ *
40
+ * Why the runtime HANDLE and not an attach session: a session is a stream (backlog, subscriber
41
+ * set, a lifetime the session plane accounts for and caps). Opening and discarding one per
42
+ * keystroke line would burn a session slot for a write, and would put a capacity refusal in the
43
+ * path of an operation that has no capacity cost. {@link AgentHandle.write} is the one-shot
44
+ * sibling of `interrupt()`, which already writes into the same pty.
45
+ *
46
+ * Three refusals, each for a different reason and each with its own code, so a caller can tell
47
+ * "never going to work" from "not right now":
48
+ * - the name was refilled while authorization awaited: act on the incarnation the caller was
49
+ * authorized for or on nothing at all (the same guard {@link attachAuthorized} carries, for
50
+ * the same reason: a name is a reusable slot and `authorizeNamed` can await a ledger read);
51
+ * - the agent is not running: there is no terminal to type into;
52
+ * - the runtime cannot write (tmux/cmux/orca/herdr attach to an externally-owned process, so
53
+ * they own no input stream for it): `unimplemented`, named by runtime kind. NOT a fallback
54
+ * to an attach session and NOT a silent success - a dropped keystroke would leave the caller
55
+ * believing a command was delivered that never was.
56
+ *
57
+ * `enter` defaults to true: a harness command typed but not submitted has not been delivered.
58
+ * Nothing is echoed back; the caller reads the resulting turns from the event plane. */
59
+ inputAuthorized(a: ManagedAgent, args: Record<string, unknown>): Promise<{
60
+ name: string;
61
+ bytes: number;
62
+ }>;
63
+ /** The post-authorization attach effect: mint the holder-bound §13.6 offer, redeem it
64
+ * through the ONE session plane (one-use CAS + presenter-equality), and stand up the PTY bridge —
65
+ * atomically. The reply is the SIGNED grant (no ws:// URL, non-bearer, never logged); the caller
66
+ * redeems it over the mesh with a per-session rails-only cred it mints itself. Only streamable
67
+ * backends (pty/host) attach; an external runtime's attach() throws with per-runtime guidance. */
68
+ attachAuthorized(a: ManagedAgent, caller: {
69
+ owner: string;
70
+ actor: string;
71
+ uid: string;
72
+ }): Promise<ControlReply>;
73
+ /** The console's mesh §13.6 session establisher (backing `POST /session/<name>` on the
74
+ * loopback face). Drives THE ONE plane — same establishAttach as the ep `attach` command — with
75
+ * the loopback OPERATOR as holder (same-host trust boundary), then hands the browser everything it
76
+ * needs to open the caller rail over the broker ws listener: the holder-bound grant, a per-session
77
+ * RAILS-ONLY caller cred (static mints from the seed, TTL-bound to the session; an open mesh has no
78
+ * credential system so the browser connects bare), and the ws URL. NO 127.0.0.1 terminal transport
79
+ * — the terminal rides the mesh session. Injected only when a wsPort exists (see the constructor). */
80
+ establishConsoleSession(name: string): Promise<SessionEstablishment>;
81
+ }
82
+ //# sourceMappingURL=terminal-input.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-input.d.ts","sourceRoot":"","sources":["../src/terminal-input.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAEjE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AASpD;;;;kGAIkG;AAClG,eAAO,MAAM,WAAW,gBAAc,CAAC;AAEvC,eAAO,MAAM,SAAS,gBAAc,CAAC;AAErC;;wFAEwF;AACxF,eAAO,MAAM,0BAA0B,yCAAyC,CAAC;AA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,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAkC3E"}
@@ -0,0 +1,266 @@
1
+ import { DEV_OWNER, EpEnvelopeError, mintCreds, newIdentity, rejectionText } from "@cotal-ai/core";
2
+ import Headless from "@xterm/headless";
3
+ import { MANAGER_ENDPOINT } from "./manager-service-contract.js";
4
+ /** How much of an `input` text is written to a seat's pty at a time. Comfortably under the 4096-byte
5
+ * kernel input buffer, so a slice is never re-split at a boundary the manager did not choose: the
6
+ * tail of an oversized write stays queued and swallows the submit key that follows it (issue #1649).
7
+ * Sized in CHARS against a byte buffer on purpose — a multi-byte character can only make a slice
8
+ * shorter in characters than in bytes, never longer, so the margin cannot be eaten from below. */
9
+ const INPUT_SLICE_CHARS = 2048;
10
+ /** Bracketed-paste delimiters (DECSET 2004). `input` wraps a seat's text in these so the return it
11
+ * writes afterwards is a KEYSTROKE rather than the newline trailing a pasted block: a TUI that
12
+ * classifies a fast burst as a paste consumes that trailing newline and the text sits unsubmitted
13
+ * in the composer until the next call's return (issue #1649). Framing, never content - these bytes
14
+ * are not counted into the receipt, so `bytes` still reports what the caller asked to deliver. */
15
+ export const PASTE_START = "\x1b[200~";
16
+ export const PASTE_END = "\x1b[201~";
17
+ /** `details[].kind` on an `attach` refusal raised because the seat's runtime opens no terminal
18
+ * stream. The message carries that runtime's own guidance, which is operator copy and changes; this
19
+ * marker is the contract a caller keys on so it can act without reading the wording. */
20
+ export const RUNTIME_NO_TERMINAL_DETAIL = "ai.cotal.manager.runtime-no-terminal";
21
+ /** Typing into a seat's terminal and opening an attach or console session on it, after authorization. */
22
+ export class TerminalInput {
23
+ deps;
24
+ constructor(deps) {
25
+ this.deps = deps;
26
+ }
27
+ // The Manager members these bodies read, under their Manager names. Each reads through its dep at
28
+ // use, so a field the Manager assigns later is current and a method a test replaces on the Manager
29
+ // is the one that runs.
30
+ get agents() { return this.deps.agents(); }
31
+ get auth() { return this.deps.auth(); }
32
+ get managerLifecycleUid() { return this.deps.managerLifecycleUid(); }
33
+ get sessionPlane() { return this.deps.sessionPlane(); }
34
+ get wsPort() { return this.deps.wsPort(); }
35
+ runtimeFor(...args) { return this.deps.runtimeFor(...args); }
36
+ /** The post-authorization `input` effect (C3): type `text` into the seat's terminal as if a human
37
+ * had. The single call an external UI needs to deliver a harness command (`/compact`, `/clear`,
38
+ * `/model`) without holding a terminal open on the caller's side.
39
+ *
40
+ * Why the runtime HANDLE and not an attach session: a session is a stream (backlog, subscriber
41
+ * set, a lifetime the session plane accounts for and caps). Opening and discarding one per
42
+ * keystroke line would burn a session slot for a write, and would put a capacity refusal in the
43
+ * path of an operation that has no capacity cost. {@link AgentHandle.write} is the one-shot
44
+ * sibling of `interrupt()`, which already writes into the same pty.
45
+ *
46
+ * Three refusals, each for a different reason and each with its own code, so a caller can tell
47
+ * "never going to work" from "not right now":
48
+ * - the name was refilled while authorization awaited: act on the incarnation the caller was
49
+ * authorized for or on nothing at all (the same guard {@link attachAuthorized} carries, for
50
+ * the same reason: a name is a reusable slot and `authorizeNamed` can await a ledger read);
51
+ * - the agent is not running: there is no terminal to type into;
52
+ * - the runtime cannot write (tmux/cmux/orca/herdr attach to an externally-owned process, so
53
+ * they own no input stream for it): `unimplemented`, named by runtime kind. NOT a fallback
54
+ * to an attach session and NOT a silent success - a dropped keystroke would leave the caller
55
+ * believing a command was delivered that never was.
56
+ *
57
+ * `enter` defaults to true: a harness command typed but not submitted has not been delivered.
58
+ * Nothing is echoed back; the caller reads the resulting turns from the event plane. */
59
+ async inputAuthorized(a, args) {
60
+ // These three refuse before the first write, so nothing was typed (SPEC 13.3). A write the
61
+ // runtime rejects below states no outcome: the runtime contract does not say a rejected write
62
+ // delivered nothing, and an earlier slice may already have reached the seat.
63
+ if (this.agents.get(a.name) !== a)
64
+ throw new EpEnvelopeError("failed-precondition", `agent "${a.name}" was replaced during authorization - retry`, undefined, "not-executed");
65
+ if (a.handle.status() !== "running")
66
+ throw new EpEnvelopeError("failed-precondition", `agent "${a.name}" is not running (${a.handle.status()}); nothing to type into`, undefined, "not-executed");
67
+ const write = a.handle.write?.bind(a.handle);
68
+ if (!write)
69
+ throw new EpEnvelopeError("unimplemented", `input is not supported by runtime ${a.handle.kind}`, undefined, "not-executed");
70
+ if (a.agent === "claude") {
71
+ // AskUserQuestion ignores bracketed text at its choice menu, but the following Enter
72
+ // confirms the highlighted option. Refuse rather than answer a different question choice.
73
+ const handle = a.handle;
74
+ let selection = false;
75
+ try {
76
+ const session = handle.attach();
77
+ const backlog = await session.backlog();
78
+ const term = new Headless.Terminal({ cols: session.cols, rows: session.rows, allowProposedApi: true });
79
+ try {
80
+ await new Promise((done) => term.write(backlog, done));
81
+ const screen = term.buffer.active;
82
+ const lines = Array.from({ length: term.rows }, (_, y) => screen.getLine(screen.baseY + y)?.translateToString(true).trim() ?? "");
83
+ selection = lines.some((line) => /^❯\s+\d+\./u.test(line))
84
+ && lines.some((line) => line.includes("Enter to select") && line.includes("↑/↓ to navigate") && line.includes("Esc to cancel"));
85
+ }
86
+ finally {
87
+ term.dispose();
88
+ }
89
+ }
90
+ catch {
91
+ throw new EpEnvelopeError("failed-precondition", `cannot inspect Claude input for seat "${a.name}"; use \`cotal attach --name ${a.name}\` to inspect and type directly`, undefined, "not-executed");
92
+ }
93
+ if (selection)
94
+ throw new EpEnvelopeError("failed-precondition", `Claude is showing a selection menu for seat "${a.name}"; input text cannot safely select an option. Use \`cotal attach --name ${a.name}\`, then arrow keys and Enter; nothing was typed`, undefined, "not-executed");
95
+ // Snapshot parsing awaits I/O. Keep this write bound to the authorized incarnation and handle.
96
+ if (this.agents.get(a.name) !== a || a.handle !== handle || handle.status() !== "running")
97
+ throw new EpEnvelopeError("failed-precondition", `agent "${a.name}" changed while inspecting its terminal; nothing was typed`, undefined, "not-executed");
98
+ }
99
+ // The contract validated `text` (non-empty, <= 64KiB) and `enter` (boolean) before this ran, so
100
+ // the only decision left is the carriage return. `!== false` and not `?? true`: an ABSENT enter
101
+ // and an explicit `true` must behave identically, and only `false` may suppress the return.
102
+ //
103
+ // THE TEXT IS DELIVERED AS A BRACKETED PASTE AND THE RETURN FOLLOWS IT AS ITS OWN WRITE, and
104
+ // that is the whole of issue #1649. A TUI harness reads keystrokes, so a return fused onto the
105
+ // tail of the text (`${text}\r`) is the text's last character rather than the submit key: the
106
+ // line waits in the composer and the NEXT call's return submits the PREVIOUS call's text, so
107
+ // every delivery runs one call behind while the op still reports the full byte count.
108
+ //
109
+ // Separating the return is necessary and NOT sufficient, which is the part that cost a second
110
+ // round of measurement. A TUI classifies a fast burst of input as a PASTE and eats the newline
111
+ // that trails it (Jcode spells this `paste_guard::consume_paste_trailing_enter`), so a text big
112
+ // enough to need more than one write is still one call behind even when the return is written
113
+ // alone. Measured on a real seat, delivering in 2048-char slices with a yield before the return:
114
+ // 120 and 700 bytes submitted on their own call, 2500 and 3100 bytes did not - each appeared
115
+ // only when the NEXT call's return arrived. That is the reported symptom exactly.
116
+ //
117
+ // Bracketed paste states the boundary instead of guessing at it. `ESC[200~ text ESC[201~`
118
+ // delimits the pasted block, so the return after it is unambiguously a keystroke and the guard
119
+ // has no trailing newline to consume. This is a CLASSIFIER, not a race, so a sleep would be the
120
+ // wrong instrument: measured on a real seat, a 250ms pause before the return still lost the
121
+ // submission while 1000ms carried it, and any margin chosen from those numbers is a guess a
122
+ // loaded host breaks. Bracketed delivery submitted 120, 2600 and 5912 bytes (the issue's own
123
+ // size) each on its own call. The terminal advertises support by enabling DECSET 2004, which
124
+ // Jcode's TUI does.
125
+ //
126
+ // The bytes the SEAT receives as text are unchanged, and the receipt still counts the text plus
127
+ // the return: the paste markers are framing this op adds, never content the caller asked to
128
+ // deliver, so counting them would make `bytes` disagree with what the caller sent.
129
+ const text = String(args.text);
130
+ const submit = args.enter !== false;
131
+ const intendedBytes = Buffer.byteLength(text, "utf8") + (submit ? 1 : 0);
132
+ const parts = [{ data: PASTE_START, counted: false }];
133
+ for (let i = 0; i < text.length; i += INPUT_SLICE_CHARS)
134
+ parts.push({ data: text.slice(i, i + INPUT_SLICE_CHARS), counted: true });
135
+ parts.push({ data: PASTE_END, counted: false });
136
+ // `enter:false` still presses nothing: the text is delivered into the composer and left there.
137
+ if (submit)
138
+ parts.push({ data: "\r", counted: true });
139
+ let bytes = 0;
140
+ for (const [i, part] of parts.entries()) {
141
+ // Yield BEFORE each write but the first, so the child drains the previous slice rather than
142
+ // the pty buffer merging them. `setImmediate` runs after I/O, which a microtask would not.
143
+ if (i > 0)
144
+ await new Promise((resolve) => setImmediate(resolve));
145
+ let accepted;
146
+ try {
147
+ accepted = await write(part.data);
148
+ }
149
+ catch (error) {
150
+ throw new EpEnvelopeError("unavailable", `input for seat "${a.name}" failed: ${rejectionText(error)}`);
151
+ }
152
+ if (!Number.isSafeInteger(accepted)) {
153
+ throw new EpEnvelopeError("unavailable", `input for seat "${a.name}" failed: runtime accepted ${String(accepted)} of ${intendedBytes} bytes`);
154
+ }
155
+ // A short write on ANY part is a failed delivery, including a marker: a paste block that was
156
+ // opened but not closed would leave the seat's composer in paste mode.
157
+ if (accepted !== Buffer.byteLength(part.data, "utf8"))
158
+ throw new EpEnvelopeError("unavailable", `input for seat "${a.name}" failed: runtime accepted ${accepted} of ${Buffer.byteLength(part.data, "utf8")} bytes of one write`);
159
+ if (part.counted)
160
+ bytes += accepted;
161
+ }
162
+ if (bytes !== intendedBytes)
163
+ throw new EpEnvelopeError("unavailable", `input for seat "${a.name}" failed: runtime accepted ${String(bytes)} of ${intendedBytes} bytes`);
164
+ return { name: a.name, bytes };
165
+ }
166
+ /** The post-authorization attach effect: mint the holder-bound §13.6 offer, redeem it
167
+ * through the ONE session plane (one-use CAS + presenter-equality), and stand up the PTY bridge —
168
+ * atomically. The reply is the SIGNED grant (no ws:// URL, non-bearer, never logged); the caller
169
+ * redeems it over the mesh with a per-session rails-only cred it mints itself. Only streamable
170
+ * backends (pty/host) attach; an external runtime's attach() throws with per-runtime guidance. */
171
+ async attachAuthorized(a, caller) {
172
+ // Every refusal before establishAttach below has opened no session, so it states that (SPEC 13.3).
173
+ if (!this.sessionPlane)
174
+ throw new EpEnvelopeError("failed-precondition", "the manager session plane is not available (the manager is not fully started)", undefined, "not-executed");
175
+ // A name is a reusable slot and the authorization above can await (user mode reads the ledger).
176
+ // The ep target is incarnation-pinned, so `a` cannot BE a successor — but the slot it names can
177
+ // have been stopped and refilled while we waited, and everything below must act on the
178
+ // incarnation this caller was actually authorized for, never on whoever holds the name now.
179
+ if (this.agents.get(a.name) !== a)
180
+ throw new EpEnvelopeError("failed-precondition", `agent "${a.name}" was replaced during authorization - retry`, undefined, "not-executed");
181
+ // Never establish a session over a dead agent — a doomed session (the caller would get an
182
+ // immediate process-exit at best, a confusing empty terminal at worst). Refuse honestly.
183
+ if (a.handle.status() !== "running")
184
+ throw new EpEnvelopeError("failed-precondition", `agent "${a.name}" is not running (${a.handle.status()}); nothing to attach`, undefined, "not-executed");
185
+ // CLAIM the session slot BEFORE attaching the target's PTY, matching the console door: this door
186
+ // used to attach first and check capacity inside establishAttach, so a `resource-exhausted`
187
+ // refusal landed AFTER the attach. The claim is carried INTO establishAttach, so one reservation
188
+ // spans the attach and the establishment, and it is released on every refusal below.
189
+ //
190
+ // RESIDUAL, NAMED: no shipped runtime acquires anything at attach time — pty's `attach()` returns
191
+ // a pure view (it registers a data subscriber only when `onData` is called) and tmux/cmux/orca
192
+ // throw — so an attach nobody bridges is a garbage-collectible object, not a held resource, and
193
+ // ordering alone suffices. A future runtime that DOES acquire something in `attach()` reopens
194
+ // this: it would need a release on the failure paths, and `AttachSession` has no close today.
195
+ const slot = this.sessionPlane.claimSlot();
196
+ let session;
197
+ try {
198
+ session = a.handle.attach();
199
+ }
200
+ catch (e) {
201
+ slot.release();
202
+ // The external runtimes refuse attach() before acquiring anything (see the residual above).
203
+ //
204
+ // A runtime that streams NO terminal is `unimplemented` and not a precondition: asking again
205
+ // cannot change it, and a caller that reads this as transient retries a refusal forever. The
206
+ // runtime's own throw is the guidance for watching the agent where it really runs, so it is
207
+ // carried through verbatim, and the namespaced detail lets a caller act on the one fact
208
+ // without reading the wording. This is the same answer `input` gives a runtime that cannot
209
+ // write, for the same reason.
210
+ if (!this.runtimeFor(a.handle.kind).streamsTerminal)
211
+ throw new EpEnvelopeError("unimplemented", `the ${a.handle.kind} runtime streams no terminal, so agent "${a.name}" has none to attach: ${rejectionText(e)}`, [{ kind: RUNTIME_NO_TERMINAL_DETAIL, runtime: a.handle.kind }], "not-executed");
212
+ throw new EpEnvelopeError("failed-precondition", rejectionText(e), undefined, "not-executed");
213
+ }
214
+ // establishAttach releases the claim it was handed on every exit; nothing to unwind here.
215
+ const { grant } = await this.sessionPlane.establishAttach(caller, { name: a.name, lifecycleUid: a.lifecycleUid }, session, slot);
216
+ const carried = a.launch.resumed?.host;
217
+ return { ok: true, data: { grant, ...(carried ? { resumedFrom: { host: carried, source: a.launch.resumed.source } } : {}) } };
218
+ }
219
+ /** The console's mesh §13.6 session establisher (backing `POST /session/<name>` on the
220
+ * loopback face). Drives THE ONE plane — same establishAttach as the ep `attach` command — with
221
+ * the loopback OPERATOR as holder (same-host trust boundary), then hands the browser everything it
222
+ * needs to open the caller rail over the broker ws listener: the holder-bound grant, a per-session
223
+ * RAILS-ONLY caller cred (static mints from the seed, TTL-bound to the session; an open mesh has no
224
+ * credential system so the browser connects bare), and the ws URL. NO 127.0.0.1 terminal transport
225
+ * — the terminal rides the mesh session. Injected only when a wsPort exists (see the constructor). */
226
+ async establishConsoleSession(name) {
227
+ if (!this.sessionPlane)
228
+ throw new Error("the manager session plane is not available (the manager is not fully started)");
229
+ if (this.wsPort === undefined)
230
+ throw new Error("the broker websocket port is not configured; the console cannot open a mesh session");
231
+ // CLAIM the session slot here, before the PTY attach and before this establisher goes on to
232
+ // mint a seed-signed `session-caller` credential: a capacity refusal must land before anything
233
+ // with a side effect or a cost. The claim is carried INTO establishAttach, so the reservation
234
+ // spans the whole establishment rather than being a check that a concurrent caller can race.
235
+ // (See attachAuthorized for why the attach itself needs no unwind on any shipped runtime.)
236
+ const slot = this.sessionPlane.claimSlot();
237
+ try {
238
+ const a = this.agents.get(name);
239
+ if (!a)
240
+ throw new Error(`no managed agent "${name}"`);
241
+ if (a.handle.status() !== "running")
242
+ throw new Error(`agent "${name}" is not running (${a.handle.status()}); nothing to attach`);
243
+ const session = a.handle.attach(); // throws for non-streamable runtimes — surfaced to the browser as a 500
244
+ // The loopback operator is the console's holder (same-host trust boundary).
245
+ const caller = { owner: DEV_OWNER, actor: "console", uid: this.managerLifecycleUid };
246
+ const { grant } = await this.sessionPlane.establishAttach(caller, { name: a.name, lifecycleUid: a.lifecycleUid }, session, slot);
247
+ // The caller credential is minted ONLY after a session is really live, so a refused or failed
248
+ // establishment never yields a seed-signed JWT. (A failure HERE would leave a live session the
249
+ // browser never reaches, holding its slot until the grant expires — unreachable in practice,
250
+ // because the SERVING mint above signs from this same `this.auth` first and would have failed
251
+ // before any session existed.)
252
+ const creds = this.auth
253
+ ? await mintCreds(this.auth, newIdentity(), "session-caller", {
254
+ sessionCaller: { endpoint: MANAGER_ENDPOINT, sessionId: grant.sessionId, epoch: grant.serving.epoch },
255
+ expiresAt: Math.floor(grant.exp / 1000), // grant.exp is ms (now+ttlMs); the JWT exp is seconds
256
+ })
257
+ : "";
258
+ return { grant, wsUrl: `ws://127.0.0.1:${this.wsPort}`, creds };
259
+ }
260
+ catch (e) {
261
+ slot.release(); // idempotent with establishAttach's own release
262
+ throw e;
263
+ }
264
+ }
265
+ }
266
+ //# sourceMappingURL=terminal-input.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"terminal-input.js","sourceRoot":"","sources":["../src/terminal-input.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEnG,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAIjE;;;;kGAIkG;AAClG,M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,+FAA+F;YAC/F,6FAA6F;YAC7F,8FAA8F;YAC9F,+BAA+B;YAC/B,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI;gBACrB,CAAC,CAAC,MAAM,SAAS,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,EAAE,gBAAgB,EAAE;oBAC1D,aAAa,EAAE,EAAE,QAAQ,EAAE,gBAAgB,EAAE,SAAS,EAAE,KAAK,CAAC,SAAS,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,CAAC,KAAK,EAAE;oBACrG,SAAS,EAAE,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,GAAG,IAAI,CAAC,EAAE,sDAAsD;iBAChG,CAAC;gBACJ,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,kBAAkB,IAAI,CAAC,MAAM,EAAE,EAAE,KAAK,EAAE,CAAC;QAClE,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,gDAAgD;YAChE,MAAM,CAAC,CAAC;QACV,CAAC;IACH,CAAC;CACF"}
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.171.1",
4
+ "version": "0.171.3",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
7
7
  "type": "git",
@@ -19,9 +19,9 @@
19
19
  },
20
20
  "dependencies": {
21
21
  "@clack/prompts": "^1.0.0",
22
- "@cotal-ai/core": "0.171.1",
23
- "@cotal-ai/seat": "0.171.1",
24
- "@cotal-ai/workspace": "0.171.1",
22
+ "@cotal-ai/core": "0.171.3",
23
+ "@cotal-ai/seat": "0.171.3",
24
+ "@cotal-ai/workspace": "0.171.3",
25
25
  "@lydell/node-pty": "1.2.0-beta.12",
26
26
  "@nats-io/jetstream": "3.4.0",
27
27
  "@nats-io/kv": "3.4.0",
@@ -37,14 +37,14 @@
37
37
  "zod": "^4.4.3"
38
38
  },
39
39
  "devDependencies": {
40
- "@cotal-ai/auth": "0.171.1",
41
- "@cotal-ai/connector-claude-code": "0.171.1",
42
- "@cotal-ai/connector-codex": "0.171.1",
43
- "@cotal-ai/connector-core": "0.171.1",
44
- "@cotal-ai/connector-hermes": "0.171.1",
45
- "@cotal-ai/connector-opencode": "0.171.1",
46
- "@cotal-ai/delivery": "0.171.1",
47
- "@cotal-ai/runtime": "0.171.1",
40
+ "@cotal-ai/auth": "0.171.3",
41
+ "@cotal-ai/connector-claude-code": "0.171.3",
42
+ "@cotal-ai/connector-codex": "0.171.3",
43
+ "@cotal-ai/connector-core": "0.171.3",
44
+ "@cotal-ai/connector-hermes": "0.171.3",
45
+ "@cotal-ai/connector-opencode": "0.171.3",
46
+ "@cotal-ai/delivery": "0.171.3",
47
+ "@cotal-ai/runtime": "0.171.3",
48
48
  "@cotal-ai/smoke-kit": "0.0.0",
49
49
  "@modelcontextprotocol/sdk": "1.29.0",
50
50
  "@types/ws": "^8.18.1",