@cotal-ai/manager 0.171.2 → 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.
- package/dist/command-dispatch.d.ts +206 -0
- package/dist/command-dispatch.d.ts.map +1 -0
- package/dist/command-dispatch.js +471 -0
- package/dist/command-dispatch.js.map +1 -0
- package/dist/manager.d.ts +27 -176
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +152 -1270
- package/dist/manager.js.map +1 -1
- package/dist/persona-catalog.d.ts +86 -0
- package/dist/persona-catalog.d.ts.map +1 -0
- package/dist/persona-catalog.js +325 -0
- package/dist/persona-catalog.js.map +1 -0
- package/dist/runtime/index.d.ts +2 -0
- package/dist/runtime/index.d.ts.map +1 -1
- package/dist/runtime/index.js +22 -0
- package/dist/runtime/index.js.map +1 -1
- package/dist/service-adapter.d.ts.map +1 -1
- package/dist/service-adapter.js +6 -0
- package/dist/service-adapter.js.map +1 -1
- package/dist/spawn-goal.d.ts +77 -0
- package/dist/spawn-goal.d.ts.map +1 -0
- package/dist/spawn-goal.js +357 -0
- package/dist/spawn-goal.js.map +1 -0
- package/dist/terminal-input.d.ts +82 -0
- package/dist/terminal-input.d.ts.map +1 -0
- package/dist/terminal-input.js +266 -0
- package/dist/terminal-input.js.map +1 -0
- package/package.json +12 -12
|
@@ -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;AAEjF;+GAC+G;AAC/G,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,IAAI,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAC5B,mBAAmB,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAC;IAC1D,YAAY,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,CAAC;IAC5C,MAAM,EAAE,MAAM,OAAO,CAAC,QAAQ,CAAC,CAAC;IAChC,UAAU,EAAE,CAAC,GAAG,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,KAAK,UAAU,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC;CAC/F;AAED,yGAAyG;AACzG,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAAJ,IAAI,EAAE,iBAAiB;IAKpD,OAAO,KAAK,MAAM,GAAiC;IACnD,OAAO,KAAK,IAAI,GAA+B;IAC/C,OAAO,KAAK,mBAAmB,GAA8C;IAC7E,OAAO,KAAK,YAAY,GAAuC;IAC/D,OAAO,KAAK,MAAM,GAAiC;IACnD,OAAO,CAAC,UAAU;IAElB;;;;;;;;;;;;;;;;;;;;;;6FAsByF;IACnF,eAAe,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC;IAuG/G;;;;uGAImG;IAC7F,gBAAgB,CAAC,CAAC,EAAE,YAAY,EAAE,MAAM,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,GAAG,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,YAAY,CAAC;IA+CrH;;;;;;2GAMuG;IACjG,uBAAuB,CAAC,IAAI,EAAE,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,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B;;;;kGAIkG;AAClG,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AAEvC,MAAM,CAAC,MAAM,SAAS,GAAG,WAAW,CAAC;AAErC;;wFAEwF;AACxF,MAAM,CAAC,MAAM,0BAA0B,GAAG,sCAAsC,CAAC;AAajF,yGAAyG;AACzG,MAAM,OAAO,aAAa;IACK;IAA7B,YAA6B,IAAuB;QAAvB,SAAI,GAAJ,IAAI,CAAmB;IAAG,CAAC;IAExD,kGAAkG;IAClG,mGAAmG;IACnG,wBAAwB;IACxB,IAAY,MAAM,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;IACnD,IAAY,IAAI,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAC/C,IAAY,mBAAmB,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC;IAC7E,IAAY,YAAY,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC;IAC/D,IAAY,MAAM,KAAK,OAAO,IAAI,CAAC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
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.
|
|
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.
|
|
23
|
-
"@cotal-ai/seat": "0.171.
|
|
24
|
-
"@cotal-ai/workspace": "0.171.
|
|
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.
|
|
41
|
-
"@cotal-ai/connector-claude-code": "0.171.
|
|
42
|
-
"@cotal-ai/connector-codex": "0.171.
|
|
43
|
-
"@cotal-ai/connector-core": "0.171.
|
|
44
|
-
"@cotal-ai/connector-hermes": "0.171.
|
|
45
|
-
"@cotal-ai/connector-opencode": "0.171.
|
|
46
|
-
"@cotal-ai/delivery": "0.171.
|
|
47
|
-
"@cotal-ai/runtime": "0.171.
|
|
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",
|