@namzu/sdk 52.2.0 → 52.3.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/CHANGELOG.md +6 -0
- package/dist/bridge/a2a/mapper.d.ts.map +1 -1
- package/dist/bridge/a2a/mapper.js +3 -0
- package/dist/bridge/a2a/mapper.js.map +1 -1
- package/dist/bridge/sse/mapper.d.ts.map +1 -1
- package/dist/bridge/sse/mapper.js +18 -0
- package/dist/bridge/sse/mapper.js.map +1 -1
- package/dist/contracts/session/api.d.ts +1 -1
- package/dist/contracts/session/api.d.ts.map +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/pals/channels/routing.d.ts +1 -1
- package/dist/pals/channels/schema.d.ts +7 -7
- package/dist/pals/communication/ingress-schema.d.ts +32 -32
- package/dist/public-runtime.d.ts +1 -1
- package/dist/public-runtime.d.ts.map +1 -1
- package/dist/public-runtime.js +1 -1
- package/dist/public-runtime.js.map +1 -1
- package/dist/public-tools.d.ts +2 -1
- package/dist/public-tools.d.ts.map +1 -1
- package/dist/public-tools.js +6 -1
- package/dist/public-tools.js.map +1 -1
- package/dist/runtime/jobs/awaited-jobs.d.ts +59 -2
- package/dist/runtime/jobs/awaited-jobs.d.ts.map +1 -1
- package/dist/runtime/jobs/awaited-jobs.js +108 -5
- package/dist/runtime/jobs/awaited-jobs.js.map +1 -1
- package/dist/runtime/jobs/monitor-stream.d.ts +96 -0
- package/dist/runtime/jobs/monitor-stream.d.ts.map +1 -0
- package/dist/runtime/jobs/monitor-stream.js +221 -0
- package/dist/runtime/jobs/monitor-stream.js.map +1 -0
- package/dist/runtime/jobs/registry.d.ts +96 -0
- package/dist/runtime/jobs/registry.d.ts.map +1 -1
- package/dist/runtime/jobs/registry.js +203 -20
- package/dist/runtime/jobs/registry.js.map +1 -1
- package/dist/runtime/query/executor.d.ts +9 -0
- package/dist/runtime/query/executor.d.ts.map +1 -1
- package/dist/runtime/query/executor.js +6 -0
- package/dist/runtime/query/executor.js.map +1 -1
- package/dist/runtime/query/index.d.ts +16 -0
- package/dist/runtime/query/index.d.ts.map +1 -1
- package/dist/runtime/query/index.js +93 -3
- package/dist/runtime/query/index.js.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.d.ts +14 -0
- package/dist/runtime/query/iteration/outstanding-work.d.ts.map +1 -1
- package/dist/runtime/query/iteration/outstanding-work.js +64 -3
- package/dist/runtime/query/iteration/outstanding-work.js.map +1 -1
- package/dist/runtime/query/iteration/phases/context.d.ts +9 -0
- package/dist/runtime/query/iteration/phases/context.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/context.js.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.d.ts.map +1 -1
- package/dist/runtime/query/iteration/phases/tool-review.js +11 -2
- package/dist/runtime/query/iteration/phases/tool-review.js.map +1 -1
- package/dist/runtime/query/release-turn.d.ts.map +1 -1
- package/dist/runtime/query/release-turn.js +35 -0
- package/dist/runtime/query/release-turn.js.map +1 -1
- package/dist/runtime/query/steering.d.ts +35 -0
- package/dist/runtime/query/steering.d.ts.map +1 -1
- package/dist/runtime/query/steering.js +121 -0
- package/dist/runtime/query/steering.js.map +1 -1
- package/dist/runtime/query/tooling.d.ts +4 -0
- package/dist/runtime/query/tooling.d.ts.map +1 -1
- package/dist/runtime/query/tooling.js +4 -0
- package/dist/runtime/query/tooling.js.map +1 -1
- package/dist/runtime/system-events.d.ts +9 -0
- package/dist/runtime/system-events.d.ts.map +1 -1
- package/dist/runtime/system-events.js +12 -0
- package/dist/runtime/system-events.js.map +1 -1
- package/dist/tools/builtins/bash.d.ts +3 -0
- package/dist/tools/builtins/bash.d.ts.map +1 -1
- package/dist/tools/builtins/bash.js +3 -2
- package/dist/tools/builtins/bash.js.map +1 -1
- package/dist/tools/builtins/index.d.ts +1 -0
- package/dist/tools/builtins/index.d.ts.map +1 -1
- package/dist/tools/builtins/index.js +1 -0
- package/dist/tools/builtins/index.js.map +1 -1
- package/dist/tools/builtins/job.d.ts.map +1 -1
- package/dist/tools/builtins/job.js +6 -2
- package/dist/tools/builtins/job.js.map +1 -1
- package/dist/tools/builtins/monitor.d.ts +24 -0
- package/dist/tools/builtins/monitor.d.ts.map +1 -0
- package/dist/tools/builtins/monitor.js +167 -0
- package/dist/tools/builtins/monitor.js.map +1 -0
- package/dist/tools/builtins/wait-for-job.d.ts +1 -1
- package/dist/turn/reporter.d.ts.map +1 -1
- package/dist/turn/reporter.js +8 -0
- package/dist/turn/reporter.js.map +1 -1
- package/dist/types/session/events.d.ts +30 -4
- package/dist/types/session/events.d.ts.map +1 -1
- package/dist/types/session/events.js +6 -1
- package/dist/types/session/events.js.map +1 -1
- package/dist/types/session/records.d.ts +2 -2
- package/dist/types/session/records.d.ts.map +1 -1
- package/dist/types/session/records.js +3 -2
- package/dist/types/session/records.js.map +1 -1
- package/dist/types/tool/index.d.ts +25 -0
- package/dist/types/tool/index.d.ts.map +1 -1
- package/dist/types/tool/index.js.map +1 -1
- package/package.json +1 -1
- package/src/bridge/a2a/mapper.ts +3 -0
- package/src/bridge/sse/mapper.ts +18 -0
- package/src/contracts/session/api.ts +1 -0
- package/src/index.ts +23 -0
- package/src/public-runtime.ts +3 -0
- package/src/public-tools.ts +11 -0
- package/src/runtime/jobs/awaited-jobs.ts +127 -5
- package/src/runtime/jobs/monitor-stream.ts +269 -0
- package/src/runtime/jobs/registry.ts +286 -21
- package/src/runtime/query/executor.ts +15 -0
- package/src/runtime/query/index.ts +116 -3
- package/src/runtime/query/iteration/outstanding-work.ts +64 -3
- package/src/runtime/query/iteration/phases/context.ts +9 -0
- package/src/runtime/query/iteration/phases/tool-review.ts +21 -9
- package/src/runtime/query/release-turn.ts +33 -0
- package/src/runtime/query/steering.ts +144 -0
- package/src/runtime/query/tooling.ts +8 -0
- package/src/runtime/system-events.ts +17 -0
- package/src/tools/builtins/bash.ts +3 -2
- package/src/tools/builtins/index.ts +6 -0
- package/src/tools/builtins/job.ts +11 -2
- package/src/tools/builtins/monitor.ts +206 -0
- package/src/turn/reporter.ts +8 -0
- package/src/types/session/events.ts +31 -4
- package/src/types/session/records.ts +3 -2
- package/src/types/tool/index.ts +24 -1
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turns a command's stdout into a few model-sized events.
|
|
3
|
+
*
|
|
4
|
+
* A watcher (`tail -f`, a poll loop, `gh run watch`) can print a line every
|
|
5
|
+
* millisecond, and every line the model is told about costs a context resend.
|
|
6
|
+
* So a monitor does not forward lines, it forwards BATCHES: lines are split,
|
|
7
|
+
* trimmed and truncated here, held for a short fixed window, and delivered
|
|
8
|
+
* together, and the batches themselves are rationed by a token bucket. A
|
|
9
|
+
* source that outruns the ration is first told so, then stopped, because a
|
|
10
|
+
* model that is flooded stops reading and one that is silenced does not know
|
|
11
|
+
* to look.
|
|
12
|
+
*
|
|
13
|
+
* Pure: no process, no registry, no model. The clock and the timer are
|
|
14
|
+
* injectable (and default to the globals read at call time, so fake timers
|
|
15
|
+
* work without any injection), which is what lets the tests advance a window
|
|
16
|
+
* by calling a function rather than by waiting for one.
|
|
17
|
+
*
|
|
18
|
+
* The constants and the wording come from the reference implementation of this
|
|
19
|
+
* tool; deviations are named where they are made.
|
|
20
|
+
*/
|
|
21
|
+
/** A longer line keeps its first this-many characters. */
|
|
22
|
+
export const MONITOR_LINE_MAX_CHARS = 500;
|
|
23
|
+
/** A joined batch longer than this keeps its first this-many characters. */
|
|
24
|
+
export const MONITOR_BATCH_MAX_CHARS = 3000;
|
|
25
|
+
/**
|
|
26
|
+
* The first buffered line arms ONE timer for this long; everything that
|
|
27
|
+
* arrives before it fires rides in the same batch. A fixed window, not a
|
|
28
|
+
* debounce: a source that never pauses still gets a batch every window
|
|
29
|
+
* instead of never.
|
|
30
|
+
*/
|
|
31
|
+
export const MONITOR_BATCH_WINDOW_MS = 200;
|
|
32
|
+
/** A partial line (no newline yet) keeps its tail past this many bytes. */
|
|
33
|
+
export const MONITOR_PARTIAL_LINE_MAX_BYTES = 1024 * 1024;
|
|
34
|
+
/** One token per BATCH, not per line. */
|
|
35
|
+
export const MONITOR_BUCKET_CAPACITY = 10;
|
|
36
|
+
export const MONITOR_BUCKET_REFILL_MS = 2000;
|
|
37
|
+
/** Suppression older than this, with another batch dropped, stops the monitor. */
|
|
38
|
+
export const MONITOR_SUPPRESSION_LIMIT_MS = 30_000;
|
|
39
|
+
/** The effective ceiling on a monitor's life; a host may lower it, never raise it past the schema. */
|
|
40
|
+
export const MONITOR_TIMEOUT_CAP_MS = 1_800_000;
|
|
41
|
+
export const MONITOR_TIMEOUT_DEFAULT_MS = 300_000;
|
|
42
|
+
export const MONITOR_TIMEOUT_MIN_MS = 1000;
|
|
43
|
+
/** The schema ceiling; anything between the cap and this is clamped, not refused. */
|
|
44
|
+
export const MONITOR_TIMEOUT_MAX_MS = 3_600_000;
|
|
45
|
+
/** One notification handed to the model is cut to this many characters, in the middle. */
|
|
46
|
+
export const MONITOR_NOTIFICATION_MAX_CHARS = 100_000;
|
|
47
|
+
/**
|
|
48
|
+
* One event's content is shrunk to this many characters BEFORE it is framed,
|
|
49
|
+
* so the notification cap never has to cut inside an envelope. A batch is at
|
|
50
|
+
* most 3000, so this only matters to a notice or a caller that outgrew that.
|
|
51
|
+
*/
|
|
52
|
+
export const MONITOR_EVENT_CONTENT_MAX_CHARS = 20_000;
|
|
53
|
+
const LINE_TRUNCATED = '...(truncated)';
|
|
54
|
+
const BATCH_TRUNCATED = '\n...(truncated)';
|
|
55
|
+
/** `30m`, `5m`, `90s`: whole minutes as minutes, anything else in seconds. */
|
|
56
|
+
export function formatMonitorDuration(ms) {
|
|
57
|
+
const seconds = Math.max(1, Math.round(ms / 1000));
|
|
58
|
+
return seconds % 60 === 0 ? `${seconds / 60}m` : `${seconds}s`;
|
|
59
|
+
}
|
|
60
|
+
export function suppressionNotice(count) {
|
|
61
|
+
return `[${count} events suppressed — output rate too high. Consider stopping this monitor and starting it with a more selective command.]`;
|
|
62
|
+
}
|
|
63
|
+
export function tooMuchOutputNotice(count, overMs) {
|
|
64
|
+
return `[Monitor stopped — too much output (${count} events suppressed over ${formatMonitorDuration(overMs)}). Restart it with a more selective command.]`;
|
|
65
|
+
}
|
|
66
|
+
export function expiryNotice(ms, delivered) {
|
|
67
|
+
return delivered > 0
|
|
68
|
+
? `[Monitor expired after ${formatMonitorDuration(ms)} with ${delivered} events delivered. Start it again if you still need the watch.]`
|
|
69
|
+
: `[Monitor expired after ${formatMonitorDuration(ms)} with no events delivered. Start it again if you still need the watch — and widen the filter if silence was unexpected.]`;
|
|
70
|
+
}
|
|
71
|
+
/** The tail of `text` that fits `maxBytes`, starting on a whole code point. */
|
|
72
|
+
function keepTail(text, maxBytes) {
|
|
73
|
+
const bytes = Buffer.from(text);
|
|
74
|
+
if (bytes.length <= maxBytes)
|
|
75
|
+
return text;
|
|
76
|
+
let start = bytes.length - maxBytes;
|
|
77
|
+
while (start < bytes.length && ((bytes[start] ?? 0) & 0xc0) === 0x80)
|
|
78
|
+
start++;
|
|
79
|
+
return bytes.subarray(start).toString('utf8');
|
|
80
|
+
}
|
|
81
|
+
export function createMonitorStream(options) {
|
|
82
|
+
const now = options.now ?? (() => Date.now());
|
|
83
|
+
const setTimer = options.setTimer ??
|
|
84
|
+
((callback, ms) => {
|
|
85
|
+
const handle = setTimeout(callback, ms);
|
|
86
|
+
// A pending batch must not keep a process alive; the job's own exit
|
|
87
|
+
// drains it.
|
|
88
|
+
handle.unref?.();
|
|
89
|
+
return handle;
|
|
90
|
+
});
|
|
91
|
+
const clearTimer = options.clearTimer ?? ((handle) => clearTimeout(handle));
|
|
92
|
+
let closed = false;
|
|
93
|
+
let partial = '';
|
|
94
|
+
let lines = [];
|
|
95
|
+
let timer;
|
|
96
|
+
let timerArmed = false;
|
|
97
|
+
let tokens = MONITOR_BUCKET_CAPACITY;
|
|
98
|
+
let refilledAt = now();
|
|
99
|
+
let eventsDelivered = 0;
|
|
100
|
+
let suppressedTotal = 0;
|
|
101
|
+
let stdoutChars = 0;
|
|
102
|
+
// The suppression tracker. `count` is what the auto-stop reports; `unannounced`
|
|
103
|
+
// is what the next notice reports. They differ after a notice, because the
|
|
104
|
+
// tracker outlives it on purpose: a source that is told and keeps going must
|
|
105
|
+
// still reach the 30 s rule.
|
|
106
|
+
let suppressionStartedAt;
|
|
107
|
+
let lastDropAt = 0;
|
|
108
|
+
let count = 0;
|
|
109
|
+
let unannounced = 0;
|
|
110
|
+
let noticeEmitted = false;
|
|
111
|
+
const refill = (at) => {
|
|
112
|
+
const elapsed = at - refilledAt;
|
|
113
|
+
if (elapsed <= 0)
|
|
114
|
+
return;
|
|
115
|
+
tokens = Math.min(MONITOR_BUCKET_CAPACITY, tokens + elapsed / MONITOR_BUCKET_REFILL_MS);
|
|
116
|
+
refilledAt = at;
|
|
117
|
+
};
|
|
118
|
+
const deliver = (batch) => {
|
|
119
|
+
const at = now();
|
|
120
|
+
// Reset only after a notice went out AND the source has been quiet for
|
|
121
|
+
// three refills. Resetting on quiet alone would let a source that is
|
|
122
|
+
// dropped every other window never reach the stop rule.
|
|
123
|
+
if (noticeEmitted && at - lastDropAt > 3 * MONITOR_BUCKET_REFILL_MS) {
|
|
124
|
+
suppressionStartedAt = undefined;
|
|
125
|
+
count = 0;
|
|
126
|
+
unannounced = 0;
|
|
127
|
+
noticeEmitted = false;
|
|
128
|
+
}
|
|
129
|
+
refill(at);
|
|
130
|
+
if (tokens >= 1) {
|
|
131
|
+
tokens -= 1;
|
|
132
|
+
if (unannounced > 0) {
|
|
133
|
+
options.onNotice(suppressionNotice(unannounced));
|
|
134
|
+
unannounced = 0;
|
|
135
|
+
noticeEmitted = true;
|
|
136
|
+
}
|
|
137
|
+
eventsDelivered++;
|
|
138
|
+
options.onBatch(batch);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
// Whether the rule fires is decided by when suppression BEGAN, before
|
|
142
|
+
// this drop is counted, and the count reported includes it.
|
|
143
|
+
const began = suppressionStartedAt;
|
|
144
|
+
suppressionStartedAt ??= at;
|
|
145
|
+
lastDropAt = at;
|
|
146
|
+
suppressedTotal++;
|
|
147
|
+
count++;
|
|
148
|
+
unannounced++;
|
|
149
|
+
if (began !== undefined && at - began > MONITOR_SUPPRESSION_LIMIT_MS) {
|
|
150
|
+
stop();
|
|
151
|
+
options.onOverflow({ suppressed: count, overMs: at - began });
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
const emitPending = () => {
|
|
155
|
+
if (timerArmed) {
|
|
156
|
+
clearTimer(timer);
|
|
157
|
+
timerArmed = false;
|
|
158
|
+
}
|
|
159
|
+
if (lines.length === 0)
|
|
160
|
+
return;
|
|
161
|
+
let batch = lines.join('\n');
|
|
162
|
+
lines = [];
|
|
163
|
+
if (batch.length > MONITOR_BATCH_MAX_CHARS) {
|
|
164
|
+
batch = batch.slice(0, MONITOR_BATCH_MAX_CHARS) + BATCH_TRUNCATED;
|
|
165
|
+
}
|
|
166
|
+
deliver(batch);
|
|
167
|
+
};
|
|
168
|
+
const addLine = (raw) => {
|
|
169
|
+
const line = raw.trim();
|
|
170
|
+
if (line.length === 0)
|
|
171
|
+
return;
|
|
172
|
+
lines.push(line.length > MONITOR_LINE_MAX_CHARS
|
|
173
|
+
? line.slice(0, MONITOR_LINE_MAX_CHARS) + LINE_TRUNCATED
|
|
174
|
+
: line);
|
|
175
|
+
if (!timerArmed) {
|
|
176
|
+
timerArmed = true;
|
|
177
|
+
timer = setTimer(() => {
|
|
178
|
+
timerArmed = false;
|
|
179
|
+
if (!closed)
|
|
180
|
+
emitPending();
|
|
181
|
+
}, MONITOR_BATCH_WINDOW_MS);
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const stop = () => {
|
|
185
|
+
closed = true;
|
|
186
|
+
if (timerArmed) {
|
|
187
|
+
clearTimer(timer);
|
|
188
|
+
timerArmed = false;
|
|
189
|
+
}
|
|
190
|
+
lines = [];
|
|
191
|
+
partial = '';
|
|
192
|
+
};
|
|
193
|
+
return {
|
|
194
|
+
push(text) {
|
|
195
|
+
if (closed || text.length === 0)
|
|
196
|
+
return;
|
|
197
|
+
stdoutChars += text.length;
|
|
198
|
+
const buffered = partial + text;
|
|
199
|
+
const parts = buffered.split('\n');
|
|
200
|
+
partial = keepTail(parts.pop() ?? '', MONITOR_PARTIAL_LINE_MAX_BYTES);
|
|
201
|
+
for (const part of parts)
|
|
202
|
+
addLine(part);
|
|
203
|
+
},
|
|
204
|
+
flush() {
|
|
205
|
+
if (closed)
|
|
206
|
+
return;
|
|
207
|
+
emitPending();
|
|
208
|
+
},
|
|
209
|
+
drain() {
|
|
210
|
+
if (closed)
|
|
211
|
+
return;
|
|
212
|
+
const rest = partial;
|
|
213
|
+
partial = '';
|
|
214
|
+
addLine(rest);
|
|
215
|
+
emitPending();
|
|
216
|
+
},
|
|
217
|
+
close: stop,
|
|
218
|
+
stats: () => ({ eventsDelivered, suppressed: suppressedTotal, stdoutChars }),
|
|
219
|
+
};
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=monitor-stream.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-stream.js","sourceRoot":"","sources":["../../../src/runtime/jobs/monitor-stream.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,0DAA0D;AAC1D,MAAM,CAAC,MAAM,sBAAsB,GAAG,GAAG,CAAA;AACzC,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,IAAI,CAAA;AAC3C;;;;;GAKG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAA;AAC1C,2EAA2E;AAC3E,MAAM,CAAC,MAAM,8BAA8B,GAAG,IAAI,GAAG,IAAI,CAAA;AACzD,yCAAyC;AACzC,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAA;AACzC,MAAM,CAAC,MAAM,wBAAwB,GAAG,IAAI,CAA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AC,IAAI,CAAC,CAAA;QACxC,CAAC;QACD,KAAK;YACJ,IAAI,MAAM;gBAAE,OAAM;YAClB,WAAW,EAAE,CAAA;QACd,CAAC;QACD,KAAK;YACJ,IAAI,MAAM;gBAAE,OAAM;YAClB,MAAM,IAAI,GAAG,OAAO,CAAA;YACpB,OAAO,GAAG,EAAE,CAAA;YACZ,OAAO,CAAC,IAAI,CAAC,CAAA;YACb,WAAW,EAAE,CAAA;QACd,CAAC;QACD,KAAK,EAAE,IAAI;QACX,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,EAAE,eAAe,EAAE,UAAU,EAAE,eAAe,EAAE,WAAW,EAAE,CAAC;KAC5E,CAAA;AACF,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { spawn } from 'node:child_process';
|
|
2
2
|
import type { BackgroundJobOutputWaitOptions, BackgroundJobOutputWaitResult } from '../../types/job/index.js';
|
|
3
|
+
import { type MonitorStreamStats } from './monitor-stream.js';
|
|
3
4
|
/**
|
|
4
5
|
* Work that outlives a tool call, owned by whoever started it.
|
|
5
6
|
*
|
|
@@ -43,6 +44,37 @@ export interface BackgroundJob {
|
|
|
43
44
|
readonly recoveryRequired?: boolean;
|
|
44
45
|
/** Safe registry diagnostic for an unconfirmed stop; excludes transport secrets. */
|
|
45
46
|
readonly stopError?: string;
|
|
47
|
+
/**
|
|
48
|
+
* `monitor` for a job started by the `monitor` tool: its stdout is
|
|
49
|
+
* delivered line by line as events, and it expires. Absent for every
|
|
50
|
+
* other job.
|
|
51
|
+
*/
|
|
52
|
+
readonly kind?: 'monitor';
|
|
53
|
+
/** What the monitor watches, in the model's words; shown with every event. */
|
|
54
|
+
readonly description?: string;
|
|
55
|
+
/** When the monitor will be stopped if the command has not ended first (epoch ms). */
|
|
56
|
+
readonly expiresAt?: number;
|
|
57
|
+
/**
|
|
58
|
+
* Why a monitor was stopped, when the registry stopped it: `expired` at
|
|
59
|
+
* its deadline, `too_much_output` when the source outran the event
|
|
60
|
+
* ration, `stopped` for a `kill()` asked for from outside. Absent while it
|
|
61
|
+
* runs and when the command ended on its own.
|
|
62
|
+
*/
|
|
63
|
+
readonly stopReason?: 'expired' | 'too_much_output' | 'stopped';
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* One thing a monitor has to say: a batch of its stdout lines, or a notice
|
|
67
|
+
* from the monitor itself (events suppressed, stopped, expired).
|
|
68
|
+
*/
|
|
69
|
+
export interface MonitorEvent {
|
|
70
|
+
/** `${jobId}:${seq}`, unique per registry and stable, so a host can acknowledge it. */
|
|
71
|
+
readonly id: string;
|
|
72
|
+
readonly jobId: string;
|
|
73
|
+
readonly owner: string;
|
|
74
|
+
readonly description: string;
|
|
75
|
+
readonly kind: 'output' | 'notice';
|
|
76
|
+
readonly text: string;
|
|
77
|
+
readonly at: number;
|
|
46
78
|
}
|
|
47
79
|
export interface BackgroundJobOutput {
|
|
48
80
|
readonly chunk: string;
|
|
@@ -97,6 +129,16 @@ export interface StartJobParams {
|
|
|
97
129
|
* decoded the way a foreground command's are, not as a Linux guest's.
|
|
98
130
|
*/
|
|
99
131
|
readonly hostOutput?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Run the command as a monitor: stdout is split into lines and delivered
|
|
134
|
+
* to `onMonitorEvent` listeners in batches, and the job is stopped at
|
|
135
|
+
* `timeoutMs`. Both streams stay in the retained buffer, so `read` still
|
|
136
|
+
* shows everything, stderr included.
|
|
137
|
+
*/
|
|
138
|
+
readonly monitor?: {
|
|
139
|
+
readonly description: string;
|
|
140
|
+
readonly timeoutMs: number;
|
|
141
|
+
};
|
|
100
142
|
}
|
|
101
143
|
export interface BackgroundJobRegistryConfig {
|
|
102
144
|
/**
|
|
@@ -150,6 +192,7 @@ export declare class BackgroundJobRegistry {
|
|
|
150
192
|
private readonly config;
|
|
151
193
|
private readonly jobs;
|
|
152
194
|
private readonly exitListeners;
|
|
195
|
+
private readonly monitorListeners;
|
|
153
196
|
private outputWaiters;
|
|
154
197
|
private readonly outputWaitersByOwner;
|
|
155
198
|
/**
|
|
@@ -160,6 +203,20 @@ export declare class BackgroundJobRegistry {
|
|
|
160
203
|
*/
|
|
161
204
|
onExit(listener: (job: BackgroundJob) => void): () => void;
|
|
162
205
|
private announceExit;
|
|
206
|
+
/**
|
|
207
|
+
* Be told what a monitor has to say, whoever owns it: a batch of its
|
|
208
|
+
* stdout lines, or a notice from the monitor itself. Returns the
|
|
209
|
+
* unsubscribe.
|
|
210
|
+
*
|
|
211
|
+
* Every listener hears every monitor's events, whatever their `owner`: a
|
|
212
|
+
* consumer serving one turn or session MUST filter on `event.owner`, as the
|
|
213
|
+
* turn does. A listener that throws is its owner's problem, as in
|
|
214
|
+
* {@link onExit}.
|
|
215
|
+
*/
|
|
216
|
+
onMonitorEvent(listener: (event: MonitorEvent) => void): () => void;
|
|
217
|
+
private announceMonitorEvent;
|
|
218
|
+
/** What a monitor's stream has done so far, for the summary of how it ended. */
|
|
219
|
+
monitorStats(id: string): MonitorStreamStats;
|
|
163
220
|
/** A failed remote stop never releases ownership or announces a terminal job. */
|
|
164
221
|
private confirmTermination;
|
|
165
222
|
constructor(config?: BackgroundJobRegistryConfig);
|
|
@@ -168,6 +225,8 @@ export declare class BackgroundJobRegistry {
|
|
|
168
225
|
/** Live jobs for one owner, oldest first. */
|
|
169
226
|
list(owner: string): readonly BackgroundJob[];
|
|
170
227
|
start(params: StartJobParams): BackgroundJob;
|
|
228
|
+
/** The deadline: the last batch, then the notice, then the same kill every stop uses. */
|
|
229
|
+
private expireMonitor;
|
|
171
230
|
/**
|
|
172
231
|
* Resolves once the job's process exists, or once it could not be
|
|
173
232
|
* created (`error` then says why). Lets a caller report a start that
|
|
@@ -253,6 +312,19 @@ export declare function bindOwner(registry: BackgroundJobRegistry, owner: string
|
|
|
253
312
|
* than present and silently doing nothing.
|
|
254
313
|
*/
|
|
255
314
|
readonly onAwaited?: (id: string) => void;
|
|
315
|
+
/**
|
|
316
|
+
* The longest a monitor started through this binding may live. A host
|
|
317
|
+
* may lower it (a single-shot run has no tomorrow to watch for); the
|
|
318
|
+
* default is {@link MONITOR_TIMEOUT_CAP_MS}.
|
|
319
|
+
*/
|
|
320
|
+
readonly monitorTimeoutCapMs?: number;
|
|
321
|
+
/**
|
|
322
|
+
* Be told that this binding started a monitor. The turn passes its own
|
|
323
|
+
* recorder here when the monitor belongs to the turn itself, which is
|
|
324
|
+
* what makes the turn stay open for it; a session-owned monitor is not
|
|
325
|
+
* reported, because the host wakes on its events.
|
|
326
|
+
*/
|
|
327
|
+
readonly onMonitorStarted?: (id: string) => void;
|
|
256
328
|
}): {
|
|
257
329
|
kill: (id: string) => Promise<BackgroundJob>;
|
|
258
330
|
list: () => readonly BackgroundJob[];
|
|
@@ -261,6 +333,15 @@ export declare function bindOwner(registry: BackgroundJobRegistry, owner: string
|
|
|
261
333
|
command: string;
|
|
262
334
|
workingDirectory?: string;
|
|
263
335
|
}) => BackgroundJob;
|
|
336
|
+
startMonitor: (params: {
|
|
337
|
+
command: string;
|
|
338
|
+
description: string;
|
|
339
|
+
timeoutMs: number;
|
|
340
|
+
workingDirectory?: string;
|
|
341
|
+
}) => {
|
|
342
|
+
job: BackgroundJob;
|
|
343
|
+
timeoutMs: number;
|
|
344
|
+
};
|
|
264
345
|
adopt: (params: {
|
|
265
346
|
command: string;
|
|
266
347
|
child: ReturnType<typeof spawn>;
|
|
@@ -279,4 +360,19 @@ export declare function bindOwner(registry: BackgroundJobRegistry, owner: string
|
|
|
279
360
|
}) => Promise<BackgroundJob>;
|
|
280
361
|
waitForOutput: (id: string, opts: BackgroundJobOutputWaitOptions) => Promise<BackgroundJobOutputWaitResult>;
|
|
281
362
|
};
|
|
363
|
+
/**
|
|
364
|
+
* How a monitor ended, in the words the model, the transcript and a
|
|
365
|
+
* single-shot run all use, so the three cannot disagree about it.
|
|
366
|
+
*
|
|
367
|
+
* `completed` is the command ending by itself: with output it is the stream
|
|
368
|
+
* ending, and without any it is a watch that never saw anything, which a
|
|
369
|
+
* reader must not mistake for a quiet success. A non-zero exit is `failed`.
|
|
370
|
+
* `killed` covers every stop the registry or the model asked for; the expiry
|
|
371
|
+
* and the too-much-output stop already told the model why in a notice of their
|
|
372
|
+
* own, so the summary does not repeat it.
|
|
373
|
+
*/
|
|
374
|
+
export declare function describeMonitorEnd(job: Pick<BackgroundJob, 'description' | 'status' | 'exitCode' | 'signal' | 'error'>, stats: Pick<MonitorStreamStats, 'stdoutChars'>): {
|
|
375
|
+
status: 'completed' | 'failed' | 'killed';
|
|
376
|
+
summary: string;
|
|
377
|
+
};
|
|
282
378
|
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/runtime/jobs/registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AAO/C,OAAO,KAAK,EACX,8BAA8B,EAC9B,6BAA6B,EAC7B,MAAM,0BAA0B,CAAA;AAIjC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,MAAM,mBAAmB,GAAG,SAAS,GAAG,QAAQ,GAAG,QAAQ,CAAA;AAEjE,MAAM,WAAW,aAAa;IAC7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAA;IACnB,+FAA+F;IAC/F,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAA;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAA;IACpC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;IACxB;;;;;OAKG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAA;IACvB,iFAAiF;I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