@cotal-ai/manager 0.29.2 → 0.30.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/commands.d.ts +19 -0
- package/dist/commands.d.ts.map +1 -1
- package/dist/commands.js +154 -6
- package/dist/commands.js.map +1 -1
- package/dist/manager-service-contract.d.ts +6 -0
- package/dist/manager-service-contract.d.ts.map +1 -1
- package/dist/manager-service-contract.js +5 -0
- package/dist/manager-service-contract.js.map +1 -1
- package/dist/manager.d.ts +78 -1
- package/dist/manager.d.ts.map +1 -1
- package/dist/manager.js +214 -50
- package/dist/manager.js.map +1 -1
- package/dist/remote-authority.d.ts +22 -0
- package/dist/remote-authority.d.ts.map +1 -0
- package/dist/remote-authority.js +102 -0
- package/dist/remote-authority.js.map +1 -0
- package/dist/remote-register.d.ts +19 -0
- package/dist/remote-register.d.ts.map +1 -0
- package/dist/remote-register.js +73 -0
- package/dist/remote-register.js.map +1 -0
- package/dist/runtime/pty.d.ts.map +1 -1
- package/dist/runtime/pty.js +10 -1
- package/dist/runtime/pty.js.map +1 -1
- package/dist/session/bridge.d.ts +11 -6
- package/dist/session/bridge.d.ts.map +1 -1
- package/dist/session/bridge.js +192 -41
- package/dist/session/bridge.js.map +1 -1
- package/package.json +4 -4
package/dist/session/bridge.js
CHANGED
|
@@ -1,11 +1,25 @@
|
|
|
1
1
|
import { EpEnvelopeError, openSessionRail, encodeTerminalData, terminalFrameBytes, decodeTerminalFrame, } from "@cotal-ai/core";
|
|
2
|
+
const OUTPUT_BATCH_MS = 8;
|
|
3
|
+
const OUTPUT_BATCH_BYTES = 64 * 1024;
|
|
4
|
+
const REPAINT_BUFFER_BYTES = 256 * 1024;
|
|
5
|
+
const DROP_RETRY_MS = 25;
|
|
6
|
+
const END_ACK_GRACE_MS = 1_500;
|
|
2
7
|
export function serveSessionBridge(opts) {
|
|
3
8
|
const { session } = opts;
|
|
9
|
+
const outputBatchMs = Math.max(0, opts.outputBatchMs ?? OUTPUT_BATCH_MS);
|
|
10
|
+
const outputBatchBytes = Math.max(1, opts.outputBatchBytes ?? OUTPUT_BATCH_BYTES);
|
|
4
11
|
let live = false; // has `ready` been received (backlog replayed, streaming live)?
|
|
12
|
+
let repainting = false;
|
|
13
|
+
let repaintQueued = false;
|
|
5
14
|
let ended = false;
|
|
6
15
|
let droppedBytes = 0;
|
|
7
16
|
let droppedFrames = 0; // caller frames the codec rejected (observability; NOT a silent black hole)
|
|
8
|
-
|
|
17
|
+
let pendingOutput = [];
|
|
18
|
+
let pendingOutputBytes = 0;
|
|
19
|
+
let outputTimer;
|
|
20
|
+
let repaintBuffer = [];
|
|
21
|
+
let repaintBufferBytes = 0;
|
|
22
|
+
let dropRetryTimer;
|
|
9
23
|
let rail;
|
|
10
24
|
// Send an application payload down the serving rail. Returns true on success; false when the
|
|
11
25
|
// window is FULL (`resource-exhausted`, the caller-must-drop signal); any OTHER failure
|
|
@@ -22,47 +36,142 @@ export function serveSessionBridge(opts) {
|
|
|
22
36
|
return false;
|
|
23
37
|
}
|
|
24
38
|
};
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
const forwardOutput = (chunk) => {
|
|
31
|
-
if (ended)
|
|
39
|
+
// A drop notice must not depend on the child producing one more byte. Retry the CONTROL frame
|
|
40
|
+
// until caller credit reopens the bounded window; the caller responds with a repeat `ready`, whose
|
|
41
|
+
// piggybacked ack gives this side room for the canonical repaint snapshot.
|
|
42
|
+
const scheduleDropNotice = () => {
|
|
43
|
+
if (ended || droppedBytes === 0 || dropRetryTimer)
|
|
32
44
|
return;
|
|
45
|
+
dropRetryTimer = setTimeout(() => {
|
|
46
|
+
dropRetryTimer = undefined;
|
|
47
|
+
if (ended || droppedBytes === 0)
|
|
48
|
+
return;
|
|
49
|
+
const bytes = droppedBytes;
|
|
50
|
+
if (railSend({ k: "drop", bytes }))
|
|
51
|
+
droppedBytes -= bytes;
|
|
52
|
+
else
|
|
53
|
+
scheduleDropNotice();
|
|
54
|
+
}, DROP_RETRY_MS);
|
|
55
|
+
dropRetryTimer.unref?.();
|
|
56
|
+
};
|
|
57
|
+
// Forward one bounded output frame. A pending drop count is flushed FIRST, so the caller learns
|
|
58
|
+
// that its screen is stale before any resumed stream; a refused chunk is counted and discarded.
|
|
59
|
+
const forwardOutput = (chunk) => {
|
|
60
|
+
if (ended || chunk.length === 0)
|
|
61
|
+
return false;
|
|
33
62
|
if (droppedBytes > 0) {
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
const bytes = droppedBytes;
|
|
64
|
+
if (railSend({ k: "drop", bytes }))
|
|
65
|
+
droppedBytes -= bytes;
|
|
36
66
|
else {
|
|
37
67
|
droppedBytes += chunk.length;
|
|
38
|
-
|
|
68
|
+
scheduleDropNotice();
|
|
69
|
+
return false;
|
|
39
70
|
}
|
|
40
71
|
}
|
|
41
|
-
if (
|
|
42
|
-
|
|
72
|
+
if (railSend(encodeTerminalData(chunk)))
|
|
73
|
+
return true;
|
|
74
|
+
droppedBytes += chunk.length;
|
|
75
|
+
scheduleDropNotice();
|
|
76
|
+
return false;
|
|
77
|
+
};
|
|
78
|
+
const forwardBytes = (bytes) => {
|
|
79
|
+
for (let offset = 0; offset < bytes.length; offset += outputBatchBytes) {
|
|
80
|
+
const part = bytes.subarray(offset, Math.min(bytes.length, offset + outputBatchBytes));
|
|
81
|
+
if (forwardOutput(part))
|
|
82
|
+
continue;
|
|
83
|
+
const remaining = bytes.length - offset - part.length;
|
|
84
|
+
if (remaining > 0)
|
|
85
|
+
droppedBytes += remaining;
|
|
86
|
+
scheduleDropNotice();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
const flushOutput = () => {
|
|
91
|
+
if (outputTimer)
|
|
92
|
+
clearTimeout(outputTimer);
|
|
93
|
+
outputTimer = undefined;
|
|
94
|
+
if (pendingOutputBytes === 0)
|
|
95
|
+
return;
|
|
96
|
+
const bytes = Buffer.concat(pendingOutput, pendingOutputBytes);
|
|
97
|
+
pendingOutput = [];
|
|
98
|
+
pendingOutputBytes = 0;
|
|
99
|
+
forwardBytes(bytes);
|
|
100
|
+
};
|
|
101
|
+
const discardPendingOutput = () => {
|
|
102
|
+
if (outputTimer)
|
|
103
|
+
clearTimeout(outputTimer);
|
|
104
|
+
outputTimer = undefined;
|
|
105
|
+
pendingOutput = [];
|
|
106
|
+
pendingOutputBytes = 0;
|
|
107
|
+
};
|
|
108
|
+
const queueOutput = (chunk) => {
|
|
109
|
+
if (ended || chunk.length === 0)
|
|
110
|
+
return;
|
|
111
|
+
if (chunk.length >= outputBatchBytes) {
|
|
112
|
+
flushOutput();
|
|
113
|
+
forwardBytes(chunk);
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
if (pendingOutputBytes + chunk.length > outputBatchBytes)
|
|
117
|
+
flushOutput();
|
|
118
|
+
pendingOutput.push(chunk);
|
|
119
|
+
pendingOutputBytes += chunk.length;
|
|
120
|
+
if (pendingOutputBytes >= outputBatchBytes || outputBatchMs === 0) {
|
|
121
|
+
flushOutput();
|
|
122
|
+
return;
|
|
123
|
+
}
|
|
124
|
+
if (!outputTimer) {
|
|
125
|
+
outputTimer = setTimeout(flushOutput, outputBatchMs);
|
|
126
|
+
outputTimer.unref?.();
|
|
127
|
+
}
|
|
128
|
+
};
|
|
129
|
+
const bufferDuringRepaint = (chunk) => {
|
|
130
|
+
const room = REPAINT_BUFFER_BYTES - repaintBufferBytes;
|
|
131
|
+
if (room > 0) {
|
|
132
|
+
const kept = chunk.length <= room ? chunk : chunk.subarray(0, room);
|
|
133
|
+
repaintBuffer.push(kept);
|
|
134
|
+
repaintBufferBytes += kept.length;
|
|
135
|
+
}
|
|
136
|
+
if (chunk.length > room) {
|
|
137
|
+
droppedBytes += chunk.length - Math.max(0, room);
|
|
138
|
+
scheduleDropNotice();
|
|
139
|
+
}
|
|
43
140
|
};
|
|
44
141
|
const offData = session.onData((chunk) => {
|
|
45
142
|
if (ended)
|
|
46
143
|
return;
|
|
47
|
-
if (
|
|
48
|
-
|
|
49
|
-
else
|
|
50
|
-
|
|
144
|
+
if (repainting)
|
|
145
|
+
bufferDuringRepaint(chunk);
|
|
146
|
+
else if (live)
|
|
147
|
+
queueOutput(chunk);
|
|
148
|
+
// Before the first `ready`, the session's canonical backlog is the bounded source of truth. No
|
|
149
|
+
// raw pre-ready byte queue is needed: goLive snapshots it, then buffers only post-boundary bytes.
|
|
51
150
|
});
|
|
52
|
-
// The pty exit surfaces `process-exit
|
|
53
|
-
// the
|
|
54
|
-
// at-most-once, so an `end` frame sent before the caller subscribed to `.out` is lost. goLive sends
|
|
55
|
-
// the deferred exit AFTER the backlog, so the caller always learns the agent exited.
|
|
151
|
+
// The pty exit surfaces `process-exit`, deferred through an opening/repaint snapshot so the caller
|
|
152
|
+
// receives the final canonical screen before the distinct terminal reason.
|
|
56
153
|
let pendingExit = false;
|
|
57
|
-
const offExit = session.onExit(() => {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
154
|
+
const offExit = session.onExit(() => {
|
|
155
|
+
if (live && !repainting) {
|
|
156
|
+
flushOutput();
|
|
157
|
+
end("process-exit");
|
|
158
|
+
}
|
|
159
|
+
else
|
|
160
|
+
pendingExit = true;
|
|
161
|
+
});
|
|
162
|
+
// Initial `ready` and repeat repaint use the same ordered cut: discard only UNSENT coalesced bytes
|
|
163
|
+
// (the terminal mirror already contains them), snapshot the canonical screen, then flush bytes that
|
|
164
|
+
// arrived after the snapshot boundary. Concurrent repeat-ready requests collapse to one more pass.
|
|
65
165
|
const goLive = async () => {
|
|
166
|
+
if (repainting) {
|
|
167
|
+
repaintQueued = true;
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
repainting = true;
|
|
171
|
+
repaintQueued = false;
|
|
172
|
+
discardPendingOutput();
|
|
173
|
+
repaintBuffer = [];
|
|
174
|
+
repaintBufferBytes = 0;
|
|
66
175
|
let snapshot;
|
|
67
176
|
try {
|
|
68
177
|
snapshot = await session.backlog();
|
|
@@ -74,17 +183,26 @@ export function serveSessionBridge(opts) {
|
|
|
74
183
|
}
|
|
75
184
|
if (ended)
|
|
76
185
|
return;
|
|
186
|
+
// A canonical snapshot is one atomic repaint frame, as before. Splitting it across the live-output
|
|
187
|
+
// batch ceiling can fill a small window halfway through the image and create a repaint loop.
|
|
77
188
|
if (snapshot.length)
|
|
78
189
|
forwardOutput(snapshot);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
if (
|
|
190
|
+
const afterSnapshot = Buffer.concat(repaintBuffer, repaintBufferBytes);
|
|
191
|
+
repaintBuffer = [];
|
|
192
|
+
repaintBufferBytes = 0;
|
|
193
|
+
if (afterSnapshot.length)
|
|
194
|
+
forwardBytes(afterSnapshot);
|
|
195
|
+
live = true;
|
|
196
|
+
repainting = false;
|
|
197
|
+
if (droppedBytes > 0)
|
|
198
|
+
scheduleDropNotice();
|
|
199
|
+
// The pty exited before/during reconstruction: surface the reason only after the final image.
|
|
200
|
+
if (pendingExit) {
|
|
87
201
|
end("process-exit");
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
if (repaintQueued)
|
|
205
|
+
void goLive();
|
|
88
206
|
};
|
|
89
207
|
const onCallerFrame = (data) => {
|
|
90
208
|
// A caller frame must NEVER wedge the serving rail. A GARBLED or DEGENERATE frame — e.g. a console
|
|
@@ -128,16 +246,42 @@ export function serveSessionBridge(opts) {
|
|
|
128
246
|
if (ended)
|
|
129
247
|
return;
|
|
130
248
|
ended = true;
|
|
249
|
+
if (outputTimer)
|
|
250
|
+
clearTimeout(outputTimer);
|
|
251
|
+
if (dropRetryTimer)
|
|
252
|
+
clearTimeout(dropRetryTimer);
|
|
253
|
+
outputTimer = undefined;
|
|
254
|
+
dropRetryTimer = undefined;
|
|
255
|
+
pendingOutput = [];
|
|
256
|
+
pendingOutputBytes = 0;
|
|
257
|
+
repaintBuffer = [];
|
|
258
|
+
repaintBufferBytes = 0;
|
|
131
259
|
offData();
|
|
132
260
|
offExit();
|
|
261
|
+
let endSeq;
|
|
133
262
|
try {
|
|
134
|
-
rail.send({ k: "end", reason });
|
|
263
|
+
endSeq = rail.send({ k: "end", reason });
|
|
135
264
|
}
|
|
136
265
|
catch {
|
|
137
266
|
/* the ledger close/expiry is the authority; the notice is advisory (§13.6) */
|
|
138
267
|
}
|
|
139
|
-
|
|
140
|
-
|
|
268
|
+
// `close` is an unsequenced control frame. Sending it immediately can overtake data already
|
|
269
|
+
// queued in the caller's async handler and make that handler discard the preceding `end` frame.
|
|
270
|
+
// Hold the serving connection until the end frame is acknowledged (stdout accepted it) or a
|
|
271
|
+
// bounded grace expires; then close/release regardless, because the ledger remains authoritative.
|
|
272
|
+
void (async () => {
|
|
273
|
+
try {
|
|
274
|
+
await opts.nc.flush();
|
|
275
|
+
}
|
|
276
|
+
catch { /* connection already gone */ }
|
|
277
|
+
if (endSeq !== undefined) {
|
|
278
|
+
const deadline = Date.now() + Math.max(END_ACK_GRACE_MS, (opts.idleCreditMs ?? 1_000) + 500);
|
|
279
|
+
while (rail.stats().ackedThrough < endSeq && Date.now() < deadline)
|
|
280
|
+
await new Promise((resolve) => setTimeout(resolve, 10));
|
|
281
|
+
}
|
|
282
|
+
rail.close();
|
|
283
|
+
opts.onEnd?.(reason);
|
|
284
|
+
})();
|
|
141
285
|
}
|
|
142
286
|
rail = openSessionRail({
|
|
143
287
|
nc: opts.nc,
|
|
@@ -151,7 +295,14 @@ export function serveSessionBridge(opts) {
|
|
|
151
295
|
});
|
|
152
296
|
return {
|
|
153
297
|
end,
|
|
154
|
-
stats: () => ({
|
|
298
|
+
stats: () => ({
|
|
299
|
+
...rail.stats(),
|
|
300
|
+
droppedBytes,
|
|
301
|
+
droppedFrames,
|
|
302
|
+
queuedBytes: pendingOutputBytes + repaintBufferBytes,
|
|
303
|
+
live,
|
|
304
|
+
repainting,
|
|
305
|
+
}),
|
|
155
306
|
};
|
|
156
307
|
}
|
|
157
308
|
//# sourceMappingURL=bridge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/session/bridge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../../src/session/bridge.ts"],"names":[],"mappings":"AAsBA,OAAO,EACL,eAAe,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,mBAAmB,GAE9F,MAAM,gBAAgB,CAAC;AASxB,MAAM,eAAe,GAAG,CAAC,CAAC;AAC1B,MAAM,kBAAkB,GAAG,EAAE,GAAG,IAAI,CAAC;AACrC,MAAM,oBAAoB,GAAG,GAAG,GAAG,IAAI,CAAC;AACxC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,gBAAgB,GAAG,KAAK,CAAC;AA+B/B,MAAM,UAAU,kBAAkB,CAAC,IAA4B;IAC7D,MAAM,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IACzB,MAAM,aAAa,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,aAAa,IAAI,eAAe,CAAC,CAAC;IACzE,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,gBAAgB,IAAI,kBAAkB,CAAC,CAAC;IAClF,IAAI,IAAI,GAAG,KAAK,CAAC,CAAC,gEAAgE;IAClF,IAAI,UAAU,GAAG,KAAK,CAAC;IACvB,IAAI,aAAa,GAAG,KAAK,CAAC;IAC1B,IAAI,KAAK,GAAG,KAAK,CAAC;IAClB,IAAI,YAAY,GAAG,CAAC,CAAC;IACrB,IAAI,aAAa,GAAG,CAAC,CAAC,CAAC,4EAA4E;IACnG,IAAI,aAAa,GAAa,EAAE,CAAC;IACjC,IAAI,kBAAkB,GAAG,CAAC,C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CAAC,QAAQ,CAAC;QAC5B,eAAe,EAAE,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC;QACpC,GAAG,CAAC,IAAI,CAAC,YAAY,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAC/E,GAAG,CAAC,IAAI,CAAC,cAAc,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtF,CAAC,CAAC;IAEH,OAAO;QACL,GAAG;QACH,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC;YACZ,GAAG,IAAI,CAAC,KAAK,EAAE;YACf,YAAY;YACZ,aAAa;YACb,WAAW,EAAE,kBAAkB,GAAG,kBAAkB;YACpD,IAAI;YACJ,UAAU;SACX,CAAC;KACH,CAAC;AACJ,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.30.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
"ws": "^8.21.0",
|
|
28
28
|
"yaml": "^2.9.0",
|
|
29
29
|
"zod": "^4.4.3",
|
|
30
|
-
"@cotal-ai/core": "0.
|
|
31
|
-
"@cotal-ai/workspace": "0.
|
|
30
|
+
"@cotal-ai/core": "0.30.0",
|
|
31
|
+
"@cotal-ai/workspace": "0.30.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@nats-io/jetstream": "^3.4.0",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@types/ws": "^8.18.1",
|
|
39
39
|
"esbuild": "^0.28.1",
|
|
40
40
|
"@cotal-ai/smoke-kit": "0.0.0",
|
|
41
|
-
"@cotal-ai/connector-core": "0.
|
|
41
|
+
"@cotal-ai/connector-core": "0.30.0"
|
|
42
42
|
},
|
|
43
43
|
"files": [
|
|
44
44
|
"dist"
|