orkestrator 2.35.3-beta → 2.35.5-beta
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/client.js +1599 -22
- package/dist/main.js +204498 -196821
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +3092 -158
- package/resources/claude-bridge/dist/index.js +5297 -2509
- package/resources/codex-bridge/dist/index.js +2940 -139
- package/resources/cursor-bridge/dist/index.js +3227 -219
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +3052 -128
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -1,6 +1,2388 @@
|
|
|
1
1
|
// ../protocol/src/node/bridge-diagnostics.ts
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
|
-
|
|
3
|
+
|
|
4
|
+
// ../protocol/src/secret-redaction.ts
|
|
5
|
+
var TEXT_RULES = [
|
|
6
|
+
{
|
|
7
|
+
pattern: /([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
|
|
8
|
+
replacement: "$1[redacted]@"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
pattern: /([?&](?:access[_-]?token|refresh[_-]?token|id[_-]?token|api[_-]?key|apikey|auth|authorization|token|secret|password|passwd|signature|sig|key|state|code)=)[^&\s"'`]+/gi,
|
|
12
|
+
replacement: "$1[redacted]"
|
|
13
|
+
},
|
|
14
|
+
{ pattern: /\bBearer\s+[A-Za-z0-9._~+/=-]{8,}/gi, replacement: "Bearer [redacted]" },
|
|
15
|
+
{ pattern: /\bBasic\s+[A-Za-z0-9+/=]{8,}/gi, replacement: "Basic [redacted]" },
|
|
16
|
+
{
|
|
17
|
+
pattern: /\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}/g,
|
|
18
|
+
replacement: "[redacted]"
|
|
19
|
+
},
|
|
20
|
+
{ pattern: /\bgh[pousr]_[A-Za-z0-9]{16,}/g, replacement: "[redacted]" },
|
|
21
|
+
{ pattern: /\bgithub_pat_[A-Za-z0-9_]{20,}/g, replacement: "[redacted]" },
|
|
22
|
+
{ pattern: /\b(?:sk|rk|pk)-[A-Za-z0-9_-]{12,}/g, replacement: "[redacted]" },
|
|
23
|
+
{ pattern: /\bxox[baprse]-[A-Za-z0-9-]{8,}/g, replacement: "[redacted]" },
|
|
24
|
+
{ pattern: /\bAKIA[0-9A-Z]{12,}/g, replacement: "[redacted]" },
|
|
25
|
+
{ pattern: /\bAIza[0-9A-Za-z_-]{20,}/g, replacement: "[redacted]" },
|
|
26
|
+
{
|
|
27
|
+
pattern: /\b((?:[A-Za-z0-9]+[_-])*(?:api[_-]?key|apikey|access[_-]?token|refresh[_-]?token|auth[_-]?token|token|secret|client[_-]?secret|password|passwd|passphrase|authorization))("?\s*[:=]\s*)("?)(?!Bearer\b|Basic\b|\[redacted\])[^\s"',;)&]{6,}\3/gi,
|
|
28
|
+
replacement: "$1$2[redacted]"
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
function redactSecrets(value) {
|
|
32
|
+
let result = value;
|
|
33
|
+
for (const rule of TEXT_RULES) {
|
|
34
|
+
result = result.replace(new RegExp(rule.pattern.source, rule.pattern.flags), rule.replacement);
|
|
35
|
+
}
|
|
36
|
+
return result;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// ../protocol/src/log-error.ts
|
|
40
|
+
var MAX_MESSAGE_CHARS = 1024;
|
|
41
|
+
var MAX_STACK_FRAMES = 8;
|
|
42
|
+
var MAX_FRAME_CHARS = 240;
|
|
43
|
+
var MAX_RAW_FRAME_CHARS = 1024;
|
|
44
|
+
var MAX_CAUSE_DEPTH = 2;
|
|
45
|
+
var TRUNCATED_MARKER = "...[truncated]";
|
|
46
|
+
var NAME_PATTERN = /^[A-Za-z_$][\w$.-]{0,63}$/;
|
|
47
|
+
var CODE_PATTERN = /^[\w.:-]{1,64}$/;
|
|
48
|
+
var SYSCALL_PATTERN = /^[\w./ -]{1,128}$/;
|
|
49
|
+
var COMMAND_OUTPUT_FIELDS = ["stdout", "stderr", "cmd", "spawnargs"];
|
|
50
|
+
var safeErrors = new WeakSet;
|
|
51
|
+
function isSafeLogError(value) {
|
|
52
|
+
return typeof value === "object" && value !== null && safeErrors.has(value);
|
|
53
|
+
}
|
|
54
|
+
function brand(details) {
|
|
55
|
+
const safe = Object.freeze(details);
|
|
56
|
+
safeErrors.add(safe);
|
|
57
|
+
return safe;
|
|
58
|
+
}
|
|
59
|
+
function boundedText(value, maxChars) {
|
|
60
|
+
const cut = value.length > maxChars ? `${value.slice(0, maxChars - TRUNCATED_MARKER.length)}${TRUNCATED_MARKER}` : value;
|
|
61
|
+
return redactSecrets(cut).replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]+/g, " ").trim();
|
|
62
|
+
}
|
|
63
|
+
var FRAME_LOCATION = /(^|[\s(])((?:[a-z][a-z0-9+.-]*:\/\/[^/\s)]*)?(?:\/|[a-z]:[\\/]|\\\\).*?)(?=:\d+(?::\d+)?\)?(?:,|$)|\)(?:,|$)|,\s|$)/gi;
|
|
64
|
+
var LOCATION_SCHEME = /^([a-z][a-z0-9+.-]*):\/\/[^/\s)]*/i;
|
|
65
|
+
var APP_PATH = /(?:^|\/)((?:apps\/(?:backend|desktop|web|web-public)|packages\/(?:protocol|cli|toolchain)|bridges\/[\w-]+|[\w-]+-bridge)\/.*)$/;
|
|
66
|
+
var PACKAGED_PATH = /\/((?:app\.asar(?:\.unpacked)?|resources)\/.*)$/i;
|
|
67
|
+
function appRelativeLocation(location) {
|
|
68
|
+
const scheme = LOCATION_SCHEME.exec(location)?.[1]?.toLowerCase();
|
|
69
|
+
const isWebUrl = scheme !== undefined && scheme !== "file";
|
|
70
|
+
const withoutOrigin = location.replace(LOCATION_SCHEME, "");
|
|
71
|
+
const path = (isWebUrl ? withoutOrigin.split(/[?#]/, 1)[0] : withoutOrigin).replace(/\\/g, "/");
|
|
72
|
+
const modules = path.lastIndexOf("/node_modules/");
|
|
73
|
+
if (modules >= 0)
|
|
74
|
+
return path.slice(modules + 1);
|
|
75
|
+
const app = APP_PATH.exec(path)?.[1] ?? PACKAGED_PATH.exec(path)?.[1];
|
|
76
|
+
if (app)
|
|
77
|
+
return app;
|
|
78
|
+
if (isWebUrl)
|
|
79
|
+
return path.replace(/^\/+/, "");
|
|
80
|
+
return `.../${path.slice(path.lastIndexOf("/") + 1)}`;
|
|
81
|
+
}
|
|
82
|
+
function relativeFrame(frame) {
|
|
83
|
+
return frame.slice(0, MAX_RAW_FRAME_CHARS).replace(FRAME_LOCATION, (_match, lead, location) => `${lead}${appRelativeLocation(location)}`);
|
|
84
|
+
}
|
|
85
|
+
function read(target, key) {
|
|
86
|
+
try {
|
|
87
|
+
return target[key];
|
|
88
|
+
} catch {
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function matching(value, pattern) {
|
|
93
|
+
return typeof value === "string" && pattern.test(value) ? value : undefined;
|
|
94
|
+
}
|
|
95
|
+
function finite(value) {
|
|
96
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
97
|
+
}
|
|
98
|
+
function isCommandFailure(target, name, message) {
|
|
99
|
+
return name === "CommandFailedError" || Boolean(message?.startsWith("Command failed")) || COMMAND_OUTPUT_FIELDS.some((field) => read(target, field) !== undefined);
|
|
100
|
+
}
|
|
101
|
+
function stackFrames(target, message) {
|
|
102
|
+
const stack = read(target, "stack");
|
|
103
|
+
if (typeof stack !== "string")
|
|
104
|
+
return;
|
|
105
|
+
const index = message ? stack.indexOf(message) : -1;
|
|
106
|
+
const body = index >= 0 ? stack.slice(index + message.length) : stack;
|
|
107
|
+
const frames = body.split(`
|
|
108
|
+
`).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText(relativeFrame(line), MAX_FRAME_CHARS));
|
|
109
|
+
return frames.length > 0 ? frames : undefined;
|
|
110
|
+
}
|
|
111
|
+
function describe(error, includeStack, includeMessage, depth) {
|
|
112
|
+
if (typeof error !== "object" || error === null) {
|
|
113
|
+
if (!includeMessage)
|
|
114
|
+
return { name: "NonError" };
|
|
115
|
+
return {
|
|
116
|
+
name: "NonError",
|
|
117
|
+
message: typeof error === "string" ? boundedText(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const rawMessage = read(error, "message");
|
|
121
|
+
if (!(error instanceof Error) && typeof rawMessage !== "string") {
|
|
122
|
+
return { name: "NonError", message: "[object]" };
|
|
123
|
+
}
|
|
124
|
+
const name = matching(read(error, "name"), NAME_PATTERN) ?? "Error";
|
|
125
|
+
const message = typeof rawMessage === "string" ? rawMessage : undefined;
|
|
126
|
+
const commandFailure = isCommandFailure(error, name, message);
|
|
127
|
+
const stackHoldsMessage = message !== undefined && String(read(error, "stack") ?? "").includes(message);
|
|
128
|
+
const details = { name };
|
|
129
|
+
if (commandFailure)
|
|
130
|
+
details.outputOmitted = true;
|
|
131
|
+
else if (message && includeMessage)
|
|
132
|
+
details.message = boundedText(message, MAX_MESSAGE_CHARS);
|
|
133
|
+
const code = read(error, "code");
|
|
134
|
+
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
135
|
+
if (safeCode !== undefined)
|
|
136
|
+
details.code = safeCode;
|
|
137
|
+
const errno = finite(read(error, "errno"));
|
|
138
|
+
if (errno !== undefined)
|
|
139
|
+
details.errno = errno;
|
|
140
|
+
const syscall = matching(read(error, "syscall"), SYSCALL_PATTERN);
|
|
141
|
+
if (syscall)
|
|
142
|
+
details.syscall = syscall;
|
|
143
|
+
const exitCode = finite(read(error, "exitCode"));
|
|
144
|
+
if (exitCode !== undefined)
|
|
145
|
+
details.exitCode = exitCode;
|
|
146
|
+
const signal = matching(read(error, "signal"), CODE_PATTERN);
|
|
147
|
+
if (signal)
|
|
148
|
+
details.signal = signal;
|
|
149
|
+
if (includeStack && (!commandFailure || stackHoldsMessage || !message)) {
|
|
150
|
+
const frames = stackFrames(error, message);
|
|
151
|
+
if (frames)
|
|
152
|
+
details.stack = frames;
|
|
153
|
+
}
|
|
154
|
+
const members = read(error, "errors");
|
|
155
|
+
if (Array.isArray(members))
|
|
156
|
+
details.errorCount = members.length;
|
|
157
|
+
const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
|
|
158
|
+
if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
|
|
159
|
+
details.cause = describe(cause, false, includeMessage, depth + 1);
|
|
160
|
+
}
|
|
161
|
+
return details;
|
|
162
|
+
}
|
|
163
|
+
function formatLogError(error, options = {}) {
|
|
164
|
+
try {
|
|
165
|
+
return brand(describe(error, options.stack !== false, options.message !== false, 0));
|
|
166
|
+
} catch {
|
|
167
|
+
return brand({ name: "Error", message: "[unreadable]" });
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function logErrorKind(error) {
|
|
171
|
+
if (typeof error !== "object" || error === null)
|
|
172
|
+
return "NonError";
|
|
173
|
+
if (!(error instanceof Error) && typeof read(error, "message") !== "string")
|
|
174
|
+
return "NonError";
|
|
175
|
+
const code = read(error, "code");
|
|
176
|
+
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
177
|
+
if (safeCode !== undefined)
|
|
178
|
+
return String(safeCode);
|
|
179
|
+
return matching(read(error, "name"), NAME_PATTERN) ?? "Error";
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
// ../protocol/src/log-vocabulary/define.ts
|
|
183
|
+
var THROTTLE_LOG_EVENTS = {
|
|
184
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
185
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
186
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
187
|
+
};
|
|
188
|
+
function defineLogAreas(areas) {
|
|
189
|
+
return areas;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// ../protocol/src/log-vocabulary/agent-mail.ts
|
|
193
|
+
var AGENT_MAIL_LOG_AREAS = defineLogAreas({
|
|
194
|
+
"agent-mail": {
|
|
195
|
+
description: "Delivering agent mail into waiting agent sessions.",
|
|
196
|
+
events: {
|
|
197
|
+
"delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
|
|
198
|
+
"drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
|
|
199
|
+
"presence.sync-failed": "Mailboxes could not be synchronized.",
|
|
200
|
+
"inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
|
|
201
|
+
"inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
|
|
202
|
+
"stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
|
|
203
|
+
"coordinator.start-failed": "The main coordinator could not be started for a new message.",
|
|
204
|
+
"message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
|
|
205
|
+
"budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
|
|
206
|
+
"budget.reset-failed": "The mail budget could not be reset for a prompted tab."
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
});
|
|
210
|
+
|
|
211
|
+
// ../protocol/src/log-vocabulary/backend.ts
|
|
212
|
+
var BACKEND_LOG_AREAS = defineLogAreas({
|
|
213
|
+
"build.pipeline": {
|
|
214
|
+
description: "Build delivery, ticket reconciliation and persisted pipeline recovery.",
|
|
215
|
+
events: {
|
|
216
|
+
"delivery-policy.failed": "A ticket delivery edit could not be reconciled with the running build.",
|
|
217
|
+
"criteria.failed": "Verify could not record criterion results on the ticket.",
|
|
218
|
+
"transcript-maintenance.failed": "Pipeline transcript maintenance failed.",
|
|
219
|
+
"hydrate.failed": "The renderer could not load the authoritative pipeline snapshot."
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"backend.activity": {
|
|
223
|
+
description: "The backend's recurring activity and maintenance jobs.",
|
|
224
|
+
events: {
|
|
225
|
+
"job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
|
|
226
|
+
...THROTTLE_LOG_EVENTS
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
backend: {
|
|
230
|
+
description: "The backend process: startup, background notices and shutdown.",
|
|
231
|
+
events: {
|
|
232
|
+
starting: "The backend process is starting.",
|
|
233
|
+
"ssh-socket.resolved": "An SSH agent socket was found.",
|
|
234
|
+
"ssh-socket.missing": "No usable SSH agent socket was found.",
|
|
235
|
+
"standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
|
|
236
|
+
"instance.publish-failed": "The instance descriptor could not be published.",
|
|
237
|
+
"instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
|
|
238
|
+
"parent.exited": "The parent process exited, so local servers are shutting down.",
|
|
239
|
+
"startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
|
|
240
|
+
"startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
|
|
241
|
+
"startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
|
|
242
|
+
"startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
|
|
243
|
+
"startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
|
|
244
|
+
"notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
|
|
245
|
+
"artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
|
|
246
|
+
"shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
|
|
247
|
+
"shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
|
|
248
|
+
"shutdown.finished": "Shutdown finished, and the process exits with `code`.",
|
|
249
|
+
"port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
|
|
250
|
+
"port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// ../protocol/src/log-vocabulary/bridge.ts
|
|
256
|
+
var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
|
|
257
|
+
var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
258
|
+
"bridge.diagnostics": {
|
|
259
|
+
description: "Metadata snapshots of bridge turns and processes: lifecycle, stalls and a keepalive at info, every minute at debug, and each change at trace. docs/architecture/bridge-diagnostics.md reads them.",
|
|
260
|
+
tag: "bridge-diagnostics",
|
|
261
|
+
maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
|
|
262
|
+
events: {
|
|
263
|
+
heartbeat: "A periodic snapshot of an open turn or process: every minute at debug; at info only as stall evidence (a stall starting or clearing, a late timer, a change during a silent stall) or the ten-minute keepalive.",
|
|
264
|
+
change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
|
|
265
|
+
"send-started": "A turn or process diagnostic scope began.",
|
|
266
|
+
"send-resolved": "The provider accepted a dispatch.",
|
|
267
|
+
"cancel-requested": "Cancellation of a turn was requested.",
|
|
268
|
+
"cancel-settled": "The provider's cancel call returned or failed.",
|
|
269
|
+
closed: "A diagnostic scope ended, with its final counters.",
|
|
270
|
+
"snapshot-overflow": "A snapshot exceeded the bound, so only its size was written.",
|
|
271
|
+
"debug-events": "A batch of allowlisted debug labels with their counts.",
|
|
272
|
+
"setup-failed": "A Cursor setup step failed and swallowed its error.",
|
|
273
|
+
"sdk-snapshot": "Cursor's SDK transports and executions at a boundary.",
|
|
274
|
+
"sdk-snapshot-overflow": "A Cursor SDK snapshot exceeded the bound, so it was omitted."
|
|
275
|
+
}
|
|
276
|
+
},
|
|
277
|
+
"bridge.lifecycle": {
|
|
278
|
+
description: "What every long-lived bridge does the same way: its sweep and its shutdown.",
|
|
279
|
+
events: {
|
|
280
|
+
"idle-sweep.failed": "An idle sweep threw; the next tick retries.",
|
|
281
|
+
"shutdown.failed": "Releasing the bridge failed during shutdown; it still exits."
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"bridge.acp": {
|
|
285
|
+
description: "The ACP bridge behind Grok: its routes, sessions, saved state and change evidence.",
|
|
286
|
+
events: {
|
|
287
|
+
"command-change.record-failed": "A measured command change could not be recorded.",
|
|
288
|
+
"evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
|
|
289
|
+
"evidence.shell-record-failed": "A shell observation could not be recorded.",
|
|
290
|
+
"evidence.turn-record-failed": "Turn change evidence could not be recorded.",
|
|
291
|
+
"server.listening": "The HTTP server is listening.",
|
|
292
|
+
"state.composer-reset": "A saved composer state was malformed and was reset.",
|
|
293
|
+
"state.discarded": "Saved bridge state could not be used and was discarded.",
|
|
294
|
+
"state.persist-failed": "Saving bridge state failed; a later write retries.",
|
|
295
|
+
"state.session-config-reset": "A saved session configuration was malformed and was reset."
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
"bridge.claude": {
|
|
299
|
+
description: "The Claude bridge: its routes, sessions, parked interactions and the Agent SDK turn loop.",
|
|
300
|
+
events: {
|
|
301
|
+
"commands.read-failed": "The command catalogue read failed; the cached answer stands.",
|
|
302
|
+
"context-usage.read-failed": "The detailed context usage read failed; the route falls back.",
|
|
303
|
+
"dispatch.rollback-failed": "Rolling back a prompt dispatch claim failed.",
|
|
304
|
+
"event-subscriber.failed": "An event subscriber threw; other subscribers still ran.",
|
|
305
|
+
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
306
|
+
"mcp.config-ignored": "An MCP server configuration of an unsupported shape was ignored.",
|
|
307
|
+
"mcp.read-failed": "Listing MCP servers failed; the route answered 500.",
|
|
308
|
+
"models.fetch-failed": "Reading the supported models failed; the fallback catalogue is served.",
|
|
309
|
+
"models.requested": "The model catalogue route was called.",
|
|
310
|
+
"models.responded": "The model catalogue route answered.",
|
|
311
|
+
"parent.gone": "The backend that launched this bridge has gone; shutting down.",
|
|
312
|
+
"plan-approval.responding": "Answering a parked plan approval.",
|
|
313
|
+
"plan-approval.response-failed": "The plan approval route failed.",
|
|
314
|
+
"plan-approval.response-received": "The route received a plan approval answer.",
|
|
315
|
+
"plan-approval.result": "A parked plan approval was answered.",
|
|
316
|
+
"plan-approval.wait-failed": "A parked plan approval ended without an answer: cancelled, timed out or closed.",
|
|
317
|
+
"plan-exit.failure-overridden": "ExitPlanMode failed after the user approved; treated as success with a continuation re-prompt.",
|
|
318
|
+
"plan-mode.record-failed": "Plan mode from a status frame could not be recorded.",
|
|
319
|
+
"plan.reprompt-approved-failed": "Re-prompting after an approved plan failed.",
|
|
320
|
+
"plan.reprompt-feedback-failed": "Re-prompting with plan rejection feedback failed.",
|
|
321
|
+
"plugin.path-missing": "A configured plugin was skipped because its path does not exist.",
|
|
322
|
+
"plugin.unsafe-path": "An installed plugin was skipped because its install path is unsafe.",
|
|
323
|
+
"plugins.read-failed": "Listing plugins failed; the route answered 500.",
|
|
324
|
+
"prompt.accepted": "The route accepted a prompt and answered 202.",
|
|
325
|
+
"prompt.failed": "A prompt turn failed; the session reports the error.",
|
|
326
|
+
"prompt.processing-failed": "A prompt accepted by the route failed while processing.",
|
|
327
|
+
"prompt.received": "A prompt reached the bridge; only its length is logged.",
|
|
328
|
+
"prompt.send-failed": "A prompt request failed; the route answered with an error.",
|
|
329
|
+
"query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
|
|
330
|
+
"query.failed": "A Claude query ended with an error result.",
|
|
331
|
+
"question.answer-failed": "The answer-question route failed.",
|
|
332
|
+
"question.answering": "Answering a parked question.",
|
|
333
|
+
"question.answers-prepared": "The route prepared a question answer for the session.",
|
|
334
|
+
"question.answers-received": "A parked question received its answers.",
|
|
335
|
+
"question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
|
|
336
|
+
"question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
|
|
337
|
+
"runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
|
|
338
|
+
"server.listening": "The HTTP server is listening.",
|
|
339
|
+
"server.starting": "The HTTP server is about to bind.",
|
|
340
|
+
"session.compact-failed": "A requested compaction failed.",
|
|
341
|
+
"session.create-failed": "Creating a session failed; the route answered with an error.",
|
|
342
|
+
"session.created": "A session was created or recovered.",
|
|
343
|
+
"session.delete-failed": "Deleting a session failed.",
|
|
344
|
+
"session.fork-failed": "Forking a session failed.",
|
|
345
|
+
"session.rename-failed": "Renaming a session failed.",
|
|
346
|
+
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
347
|
+
"session.rewind-failed": "Rewinding session files failed.",
|
|
348
|
+
"session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
|
|
349
|
+
"sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
|
|
350
|
+
"sse.aborted": "The client closed an event stream.",
|
|
351
|
+
"sse.cleanup": "An event stream connection was released.",
|
|
352
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
353
|
+
"sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
|
|
354
|
+
"sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
|
|
355
|
+
"sse.opened": "An event stream connection opened.",
|
|
356
|
+
"sse.subscribe-requested": "A client asked to subscribe to the event stream.",
|
|
357
|
+
"sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
|
|
358
|
+
"task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
|
|
359
|
+
"task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
|
|
360
|
+
"task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
|
|
361
|
+
"task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
|
|
362
|
+
"task.stop-route-failed": "The stop-task route failed.",
|
|
363
|
+
"transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
|
|
364
|
+
"transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
|
|
365
|
+
}
|
|
366
|
+
},
|
|
367
|
+
"bridge.codex": {
|
|
368
|
+
description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
|
|
369
|
+
events: {
|
|
370
|
+
"account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
|
|
371
|
+
"account.login-reload-failed": "Reloading the stored account login failed.",
|
|
372
|
+
"account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
|
|
373
|
+
"account.usage-read-failed": "Reading account usage failed; the route answers 503.",
|
|
374
|
+
"app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
|
|
375
|
+
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
376
|
+
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
377
|
+
"app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
|
|
378
|
+
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
379
|
+
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
380
|
+
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
381
|
+
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
382
|
+
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
383
|
+
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
384
|
+
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
385
|
+
"command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
|
|
386
|
+
"dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
|
|
387
|
+
"dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
|
|
388
|
+
"engine.listener-failed": "An engine event listener threw; the others still ran.",
|
|
389
|
+
"engine.ready": "The app-server engine started.",
|
|
390
|
+
"engine.start-failed": "The app-server engine failed to start; reported through health.",
|
|
391
|
+
"engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
|
|
392
|
+
"generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
|
|
393
|
+
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
394
|
+
"idle-sweep.failed": "An idle sweep failed; the next one retries.",
|
|
395
|
+
"interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
|
|
396
|
+
"interaction.resolved-callback-failed": "An interaction resolved callback threw.",
|
|
397
|
+
"journal.persist-failed": "Saving the dispatch journal failed.",
|
|
398
|
+
"message.publish-failed": "Publishing a message update failed.",
|
|
399
|
+
"models.cache-persist-failed": "Saving the model cache failed.",
|
|
400
|
+
"models.debug-read-failed": "`codex debug models` failed; another source is used.",
|
|
401
|
+
"models.list-failed": "model/list failed; the cached models are served.",
|
|
402
|
+
"models.refresh-failed": "A background model refresh failed; the cache stands.",
|
|
403
|
+
"notification.enqueue-failed": "Queueing a notification threw.",
|
|
404
|
+
"ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
|
|
405
|
+
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
406
|
+
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
407
|
+
"parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
|
|
408
|
+
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
409
|
+
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
410
|
+
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
411
|
+
"recorder.threw": "The notification recorder threw.",
|
|
412
|
+
"recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
|
|
413
|
+
"registry.persist-failed": "Saving the session registry failed; a later write retries.",
|
|
414
|
+
"rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
|
|
415
|
+
"runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
|
|
416
|
+
"runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
|
|
417
|
+
"server-request.answer-failed": "Answering a server request failed.",
|
|
418
|
+
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
419
|
+
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
420
|
+
"session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
|
|
421
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
422
|
+
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
423
|
+
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
424
|
+
"sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
|
|
425
|
+
"sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
|
|
426
|
+
"sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
|
|
427
|
+
"subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
|
|
428
|
+
"thread.archive-failed": "Archiving or unarchiving a thread failed.",
|
|
429
|
+
"thread.fork-failed": "thread/fork failed; the route answers 503.",
|
|
430
|
+
"thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
|
|
431
|
+
"thread.reattach-failed": "A thread could not be re-attached.",
|
|
432
|
+
"thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
|
|
433
|
+
"thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
|
|
434
|
+
"thread.turns-read-failed": "A thread's turns could not be read.",
|
|
435
|
+
"thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
|
|
436
|
+
"threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
|
|
437
|
+
"transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
|
|
438
|
+
"turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
|
|
439
|
+
"turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
|
|
440
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
441
|
+
"turns.stopped": "Running turns were stopped because the backend went away."
|
|
442
|
+
}
|
|
443
|
+
},
|
|
444
|
+
"bridge.cursor": {
|
|
445
|
+
description: "The Cursor bridge: its routes, sessions and saved state.",
|
|
446
|
+
events: {
|
|
447
|
+
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
448
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
449
|
+
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
450
|
+
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
451
|
+
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
452
|
+
"state.publication-recovered": "Saving bridge state recovered.",
|
|
453
|
+
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
|
|
454
|
+
}
|
|
455
|
+
},
|
|
456
|
+
"bridge.pi": {
|
|
457
|
+
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
458
|
+
events: {
|
|
459
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
460
|
+
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
461
|
+
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
});
|
|
465
|
+
|
|
466
|
+
// ../protocol/src/log-vocabulary/desktop.ts
|
|
467
|
+
var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
468
|
+
desktop: {
|
|
469
|
+
description: "The Electron main process: startup, windows, quit and the Local backend's life.",
|
|
470
|
+
events: {
|
|
471
|
+
"backend.docker-context-seed-failed": "An agent-test profile fell back to the default Docker context.",
|
|
472
|
+
"backend.exited": "The Local backend exited unexpectedly; Local work is unavailable.",
|
|
473
|
+
"backend.exited-recovering": "The Local backend exited just after a remote update; relaunching unattended.",
|
|
474
|
+
"backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
|
|
475
|
+
"backend.start-failed": "The Local backend did not start; continuing with remote machines.",
|
|
476
|
+
"clipboard.write-failed": "Writing text to the system clipboard failed.",
|
|
477
|
+
"instance.already-running": "Another instance holds this data directory; this one will quit.",
|
|
478
|
+
"main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
|
|
479
|
+
"quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
|
|
480
|
+
"relaunch.schedule-failed": "The AppImage relaunch waiter failed; using Electron's relauncher.",
|
|
481
|
+
"relaunch.service-register-failed": "The AppImage relaunch service was refused; using a detached waiter.",
|
|
482
|
+
"renderer.gone-giving-up": "A renderer kept dying, so the window is no longer reloaded.",
|
|
483
|
+
"renderer.gone-reloading": "A renderer died and the window is being reloaded.",
|
|
484
|
+
"renderer.reload-failed": "Reloading a window after its renderer died failed.",
|
|
485
|
+
"restart-prompt.failed": "A native restart prompt could not be shown.",
|
|
486
|
+
"saved-machines.attach-failed": "Saved machines were not imported into the command node yet.",
|
|
487
|
+
"saved-machines.attached": "Saved machines were imported into the local command node.",
|
|
488
|
+
"startup.failed": "The application failed to start.",
|
|
489
|
+
"uncaught-exception": "The main process hit an uncaught exception.",
|
|
490
|
+
"uncaught-exception.dialog-failed": "The uncaught exception sheet could not be shown.",
|
|
491
|
+
"window.create-failed": "A menu-driven new window could not be created.",
|
|
492
|
+
"window.recreate-failed": "The main window could not be recreated on activation.",
|
|
493
|
+
"window.second-launch-failed": "A second launch could not open a window."
|
|
494
|
+
}
|
|
495
|
+
},
|
|
496
|
+
"desktop.startup": {
|
|
497
|
+
description: "Renderer startup markers and renderer process failures. These are the only events the renderer can place in the persistent log.",
|
|
498
|
+
tag: "DesktopStartup",
|
|
499
|
+
events: {
|
|
500
|
+
"backend-unavailable": "The renderer could not complete a Local backend read in time.",
|
|
501
|
+
"bridge-unavailable": "The preload API or connection-list IPC did not answer.",
|
|
502
|
+
checking: "The renderer began waiting for the desktop connection.",
|
|
503
|
+
"page-load-failed": "Chromium failed to load the main document.",
|
|
504
|
+
"preload-failed": "Electron rejected the preload script.",
|
|
505
|
+
ready: "The renderer reached the desktop connection and may mount the workspace.",
|
|
506
|
+
"renderer-error": "An uncaught error occurred while the renderer was starting.",
|
|
507
|
+
"renderer-gone": "A renderer process exited.",
|
|
508
|
+
"renderer-load-failed": "Importing or mounting the application failed.",
|
|
509
|
+
"unhandled-rejection": "An unhandled rejection occurred while the renderer was starting."
|
|
510
|
+
}
|
|
511
|
+
},
|
|
512
|
+
"desktop.dialog": {
|
|
513
|
+
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
514
|
+
events: {
|
|
515
|
+
"attention-failed": "A dialog could not ask for the user's attention.",
|
|
516
|
+
closed: "A native dialog closed.",
|
|
517
|
+
"open-failed": "A dialog could not open; it was answered as cancelled.",
|
|
518
|
+
opening: "A native dialog is opening.",
|
|
519
|
+
"preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
|
|
520
|
+
"renderer-beforeunload-cancelled": "A renderer's beforeunload handler cancelled an unload."
|
|
521
|
+
}
|
|
522
|
+
},
|
|
523
|
+
"backend.client": {
|
|
524
|
+
description: "The desktop's HTTP and event stream client for a backend.",
|
|
525
|
+
events: {
|
|
526
|
+
"event-stream.disconnected": "The event stream dropped; the client reconnects with backoff.",
|
|
527
|
+
"event-stream.malformed-frame": "An event stream frame could not be parsed and was dropped."
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
connections: {
|
|
531
|
+
description: "The desktop's saved machines and active connection.",
|
|
532
|
+
events: {
|
|
533
|
+
"catalogue.legacy-read-failed": "The previous connection list could not be read to migrate.",
|
|
534
|
+
"catalogue.restored-from-backup": "The device catalogue was unreadable; the backup was used.",
|
|
535
|
+
"restore.failed": "The previous remote connection could not be restored; using Local.",
|
|
536
|
+
"secure-storage.waiting": "Startup is waiting on an operating system keychain prompt."
|
|
537
|
+
}
|
|
538
|
+
},
|
|
539
|
+
workspaces: {
|
|
540
|
+
description: "Workspace realms the desktop holds on other machines.",
|
|
541
|
+
events: {
|
|
542
|
+
"route.moved-direct": "A relayed workspace moved to its direct route."
|
|
543
|
+
}
|
|
544
|
+
},
|
|
545
|
+
toolchain: {
|
|
546
|
+
description: "Preparing the pinned agent toolchain at desktop startup.",
|
|
547
|
+
events: {
|
|
548
|
+
"bootstrap-progress.show-failed": "The toolchain progress window could not be shown.",
|
|
549
|
+
"prepare.failed": "Preparing the pinned agent tools failed."
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
"artifact-host": {
|
|
553
|
+
description: "Live artifact hosts in the desktop app.",
|
|
554
|
+
events: {
|
|
555
|
+
"host.ended": "A host ended; fields count its blocked and rejected requests by reason."
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
});
|
|
559
|
+
|
|
560
|
+
// ../protocol/src/log-vocabulary/environment.ts
|
|
561
|
+
var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
562
|
+
environment: {
|
|
563
|
+
description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
|
|
564
|
+
events: {
|
|
565
|
+
"cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
|
|
566
|
+
"rename.failed": "Naming an environment from its pending prompt failed for the first time.",
|
|
567
|
+
"rename.still-failing": "That rename is still failing; written at the 2nd, 4th, 8th... failure.",
|
|
568
|
+
"rename.recovered": "A rename from a pending prompt succeeded after failing.",
|
|
569
|
+
"setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
|
|
570
|
+
"setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
|
|
571
|
+
"setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
|
|
572
|
+
"cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
|
|
573
|
+
"cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
|
|
574
|
+
"cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
|
|
575
|
+
"cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
|
|
576
|
+
"cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
|
|
577
|
+
"cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
|
|
578
|
+
"cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
|
|
579
|
+
"orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
|
|
580
|
+
"orphan-state.removed": "Orphaned environment state directories were removed.",
|
|
581
|
+
"orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
|
|
582
|
+
"orphan-canvas.removed": "Orphaned design canvases were removed.",
|
|
583
|
+
"orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
|
|
584
|
+
"orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
|
|
585
|
+
"stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
|
|
586
|
+
"stray-workspace.removed": "Stray workspace directories were removed.",
|
|
587
|
+
"stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
|
|
588
|
+
"temp-files.removed": "Abandoned temp files were removed.",
|
|
589
|
+
"status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
|
|
590
|
+
"status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
|
|
591
|
+
"setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
|
|
592
|
+
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
593
|
+
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
594
|
+
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
595
|
+
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
596
|
+
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
597
|
+
"handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
|
|
598
|
+
"delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
|
|
599
|
+
"delete.artifacts-left": "Graph run artifact directories were not removed.",
|
|
600
|
+
"delete.worktrees-kept": "Graph runs kept branch worktrees.",
|
|
601
|
+
"delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
|
|
602
|
+
"merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
|
|
603
|
+
"move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
|
|
604
|
+
"move.recovery-failed": "Recovering an interrupted environment move failed.",
|
|
605
|
+
"stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
|
|
606
|
+
...THROTTLE_LOG_EVENTS
|
|
607
|
+
}
|
|
608
|
+
}
|
|
609
|
+
});
|
|
610
|
+
|
|
611
|
+
// ../protocol/src/log-vocabulary/gateway.ts
|
|
612
|
+
var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
613
|
+
gateway: {
|
|
614
|
+
description: "The gateway other devices, browsers and the desktop connect through.",
|
|
615
|
+
events: {
|
|
616
|
+
"remote.start-failed": "The desktop could not start the remote gateway.",
|
|
617
|
+
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
|
|
618
|
+
disabled: "The gateway is disabled by its environment variable.",
|
|
619
|
+
"tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
|
|
620
|
+
"tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
|
|
621
|
+
"control.listening": "The backend control listener is up.",
|
|
622
|
+
"browser.listening": "The browser listener is up.",
|
|
623
|
+
"browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
|
|
624
|
+
"browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
|
|
625
|
+
"loopback.listening": "The loopback client listener is up.",
|
|
626
|
+
"loopback.unavailable": "The loopback client listener could not start.",
|
|
627
|
+
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
628
|
+
"auth-token.persist-failed": "The gateway token could not be saved.",
|
|
629
|
+
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
630
|
+
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
631
|
+
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
632
|
+
"websocket.upgrade-failed": "A WebSocket upgrade failed.",
|
|
633
|
+
"events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
|
|
634
|
+
"proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
|
|
635
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
636
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
637
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
638
|
+
}
|
|
639
|
+
},
|
|
640
|
+
"gateway.terminal": {
|
|
641
|
+
description: "The gateway's terminal WebSocket.",
|
|
642
|
+
events: {
|
|
643
|
+
"upgrade-rejected": "A terminal WebSocket upgrade was refused.",
|
|
644
|
+
"socket-error": "A terminal WebSocket reported an error.",
|
|
645
|
+
"subscription-failed": "A terminal subscription failed.",
|
|
646
|
+
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
|
|
647
|
+
}
|
|
648
|
+
},
|
|
649
|
+
"gateway.tailscale": {
|
|
650
|
+
description: "Tailscale Serve for desktop web access and a standalone backend.",
|
|
651
|
+
events: {
|
|
652
|
+
"web-access.disable-failed": "Desktop web access could not be turned off.",
|
|
653
|
+
"web-access.enable-failed": "Desktop web access could not be turned on.",
|
|
654
|
+
"web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
|
|
655
|
+
"web-access.reset-failed": "Desktop web access could not be reset.",
|
|
656
|
+
"startup.init-failed": "Desktop web access could not be initialized at startup.",
|
|
657
|
+
available: "Tailscale Serve is publishing the gateway."
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
});
|
|
661
|
+
|
|
662
|
+
// ../protocol/src/log-vocabulary/local-server.ts
|
|
663
|
+
var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
664
|
+
"local-server": {
|
|
665
|
+
description: "Agent bridge processes the backend runs on the host.",
|
|
666
|
+
events: {
|
|
667
|
+
"bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
|
|
668
|
+
"bridge-runtime.installing": "A bridge runtime is being installed.",
|
|
669
|
+
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
670
|
+
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
671
|
+
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
672
|
+
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
673
|
+
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
674
|
+
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
675
|
+
"reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
|
|
676
|
+
"reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
|
|
677
|
+
"reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
|
|
678
|
+
"reaper.server-reaping": "An orphaned server is being stopped.",
|
|
679
|
+
"reaper.server-kill-failed": "An orphaned server did not exit.",
|
|
680
|
+
...THROTTLE_LOG_EVENTS
|
|
681
|
+
}
|
|
682
|
+
}
|
|
683
|
+
});
|
|
684
|
+
|
|
685
|
+
// ../protocol/src/log-vocabulary/git.ts
|
|
686
|
+
var GIT_LOG_AREAS = defineLogAreas({
|
|
687
|
+
git: {
|
|
688
|
+
description: "Git operations the backend runs in environment worktrees and containers.",
|
|
689
|
+
events: {
|
|
690
|
+
"branch.rename-failed": "Renaming an environment's branch failed; the stored name is kept.",
|
|
691
|
+
"branch.push-config-failed": "A branch was renamed but its push settings could not be written; the rename is undone.",
|
|
692
|
+
"branch.rollback-failed": "Undoing a branch rename failed; the stored name follows whichever branch now exists."
|
|
693
|
+
}
|
|
694
|
+
}
|
|
695
|
+
});
|
|
696
|
+
|
|
697
|
+
// ../protocol/src/log-vocabulary/logging.ts
|
|
698
|
+
var LOGGING_LOG_AREAS = defineLogAreas({
|
|
699
|
+
logging: {
|
|
700
|
+
description: "The logger and the on-disk application log themselves.",
|
|
701
|
+
events: {
|
|
702
|
+
"capture.started": "Saving logs to disk began for this process.",
|
|
703
|
+
"capture.stopped": "Saving logs to disk stopped for this process.",
|
|
704
|
+
"config.invalid": "A logging environment variable held a value that was ignored.",
|
|
705
|
+
"entries.dropped": "The log queue was full, so entries were dropped and counted.",
|
|
706
|
+
"policy.changed": "The logging settings changed: saving, retention and levels, with no content.",
|
|
707
|
+
"policy.bridge-predates-route": "A running bridge has no logging settings route; it applies them at its next start.",
|
|
708
|
+
"policy.push-failed": "A running bridge did not take the logging settings after retries; its next start resends them.",
|
|
709
|
+
"prune.failed": "Removing expired log files failed; the next sweep retries.",
|
|
710
|
+
"write.failed": "Appending to the log file failed.",
|
|
711
|
+
"unknown-area": "Code outside the type checker asked for an area that is not listed."
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
});
|
|
715
|
+
|
|
716
|
+
// ../protocol/src/log-vocabulary/models.ts
|
|
717
|
+
var MODEL_LOG_AREAS = defineLogAreas({
|
|
718
|
+
models: {
|
|
719
|
+
description: "Agent model catalogues and their persistent caches.",
|
|
720
|
+
events: {
|
|
721
|
+
"cache.write-failed": "A successful catalogue refresh could not update the host cache.",
|
|
722
|
+
"seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
|
|
723
|
+
"bridge.not-ready": "The first-use catalogue bridge did not become ready.",
|
|
724
|
+
"bridge.start-failed": "The first-use catalogue bridge failed to start.",
|
|
725
|
+
"probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
|
|
726
|
+
"download.deferred": "A model catalogue could not be downloaded yet."
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
});
|
|
730
|
+
|
|
731
|
+
// ../protocol/src/log-vocabulary/native-agent.ts
|
|
732
|
+
var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
733
|
+
"native-agent": {
|
|
734
|
+
description: "Native agent sessions and what the backend reads from their bridges.",
|
|
735
|
+
events: {
|
|
736
|
+
"catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
|
|
737
|
+
"handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
|
|
738
|
+
"handoff.consume-failed": "A delivered handoff could not be marked consumed.",
|
|
739
|
+
"job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
|
|
740
|
+
"job.resend-queue-failed": "A resend could not be queued for a job.",
|
|
741
|
+
"interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
|
|
742
|
+
"interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
|
|
743
|
+
"human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
|
|
744
|
+
"question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
|
|
745
|
+
"activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
|
|
746
|
+
"activity.persist-failed": "An environment's activity could not be saved.",
|
|
747
|
+
"pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
|
|
748
|
+
"launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
|
|
749
|
+
"queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
|
|
750
|
+
"provider.retire-failed": "Retiring an obsolete provider failed.",
|
|
751
|
+
"workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
|
|
752
|
+
"catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
|
|
753
|
+
"dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
|
|
754
|
+
"coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
|
|
755
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
756
|
+
"interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
|
|
757
|
+
"resume.close-replaced-failed": "The session a resume replaced could not be closed.",
|
|
758
|
+
"sign-in.check-failed": "A turn could not be checked for a login refusal.",
|
|
759
|
+
"sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
|
|
760
|
+
"sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
|
|
761
|
+
"shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
|
|
762
|
+
"turn-recovery.failed": "Recovering an incomplete turn failed.",
|
|
763
|
+
"turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
|
|
764
|
+
"turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
|
|
765
|
+
"usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
|
|
766
|
+
"title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
|
|
767
|
+
...THROTTLE_LOG_EVENTS
|
|
768
|
+
}
|
|
769
|
+
},
|
|
770
|
+
"native-agent.goal": {
|
|
771
|
+
description: "The /goal loop: advancing goals and their verifiers.",
|
|
772
|
+
events: {
|
|
773
|
+
"advance.failed": "A goal could not advance; the next sweep retries.",
|
|
774
|
+
"attention.record-failed": "Attention for a goal could not be recorded.",
|
|
775
|
+
"turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
|
|
776
|
+
"verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
|
|
777
|
+
"verifier.stop-failed": "An earlier verifier could not be stopped.",
|
|
778
|
+
"recover.failed": "Goals could not be recovered at startup."
|
|
779
|
+
}
|
|
780
|
+
},
|
|
781
|
+
"native-agent.opencode": {
|
|
782
|
+
description: "The OpenCode provider: its request monitor, retries and agent tools.",
|
|
783
|
+
events: {
|
|
784
|
+
"retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
|
|
785
|
+
"retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
|
|
786
|
+
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
787
|
+
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
788
|
+
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
789
|
+
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
790
|
+
"request.failed": "Handling a request event failed, so the stream restarts. Error class only."
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
});
|
|
794
|
+
|
|
795
|
+
// ../protocol/src/log-vocabulary/preview.ts
|
|
796
|
+
var PREVIEW_LOG_AREAS = defineLogAreas({
|
|
797
|
+
preview: {
|
|
798
|
+
description: "Browser and service previews: transports, partitions and captures.",
|
|
799
|
+
events: {
|
|
800
|
+
"attachment.release-failed": "Releasing a preview attachment failed; its lease expires it.",
|
|
801
|
+
"capture-spool.load-failed": "The pending browser capture spool could not be loaded.",
|
|
802
|
+
"certificate.refresh-failed": "Re-reading the preview certificate failed; the next check retries.",
|
|
803
|
+
"certificate.renewal-refused": "A renewed certificate does not cover the preview hosts, so it was ignored.",
|
|
804
|
+
"connection-cleanup.record-failed": "A forgotten connection's cleanup could not be recorded.",
|
|
805
|
+
"link.open-external-failed": "A preview link could not be opened in the system browser.",
|
|
806
|
+
"node.record-failed": "A node that owns preview partitions could not be recorded.",
|
|
807
|
+
"partition.clear-failed": "A preview partition could not be cleared.",
|
|
808
|
+
"partitions.record-cleared-failed": "Cleared preview partitions could not be recorded.",
|
|
809
|
+
"partitions.record-nodes-failed": "The nodes that own preview partitions could not be saved.",
|
|
810
|
+
"partitions.remove-failed": "Cleared preview partition directories could not be removed.",
|
|
811
|
+
"partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
|
|
812
|
+
"port-hints.persist-failed": "Preview port hints could not be saved.",
|
|
813
|
+
"transport.close-failed": "A preview transport could not be closed.",
|
|
814
|
+
"ca-bundle.read-failed": "The upstream CA bundle could not be read.",
|
|
815
|
+
"publication.start-failed": "Private preview publication did not start.",
|
|
816
|
+
"publication.reconfigure-failed": "Preview publication could not be reconfigured.",
|
|
817
|
+
"publication.listening": "Private preview origins are listening.",
|
|
818
|
+
"certificate.reloaded": "The preview certificate was reloaded.",
|
|
819
|
+
"access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
|
|
820
|
+
"registry.invalid-definition": "An invalid stored preview service definition was ignored.",
|
|
821
|
+
"registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
|
|
822
|
+
"registry.resolver-failed": "A preview resolver failed. Error class only.",
|
|
823
|
+
"registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
|
|
824
|
+
"registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
|
|
825
|
+
...THROTTLE_LOG_EVENTS
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
});
|
|
829
|
+
|
|
830
|
+
// ../protocol/src/log-vocabulary/runtime.ts
|
|
831
|
+
var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
832
|
+
"event-loop": {
|
|
833
|
+
description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
|
|
834
|
+
events: {
|
|
835
|
+
stalled: "A timer fired late, so every request in that window waited."
|
|
836
|
+
}
|
|
837
|
+
}
|
|
838
|
+
});
|
|
839
|
+
|
|
840
|
+
// ../protocol/src/log-vocabulary/terminal.ts
|
|
841
|
+
var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
842
|
+
terminal: {
|
|
843
|
+
description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
|
|
844
|
+
events: {
|
|
845
|
+
"input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
|
|
846
|
+
"orphan.reaped": "A terminal no tab references was closed.",
|
|
847
|
+
"agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
|
|
848
|
+
"activity.record-failed": "Terminal environment activity could not be recorded.",
|
|
849
|
+
"pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
|
|
850
|
+
"pty.exit-notify-failed": "Notifying a terminal's exit failed.",
|
|
851
|
+
"pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
|
|
852
|
+
"setup.pty-reused": "A setup terminal reused its existing PTY.",
|
|
853
|
+
"setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
|
|
854
|
+
"setup.pty-spawned": "A setup terminal's PTY started.",
|
|
855
|
+
"setup.pty-exited": "A setup terminal's PTY exited.",
|
|
856
|
+
"setup.preparing": "Workspace preparation started in the setup terminal.",
|
|
857
|
+
"setup.session-creating": "A setup session is being created.",
|
|
858
|
+
"setup.intro-emitted": "The setup intro was written to the terminal.",
|
|
859
|
+
"setup.completed": "Setup finished.",
|
|
860
|
+
"setup.failed": "Setup failed.",
|
|
861
|
+
"setup.already-complete": "Setup was requested but had already finished.",
|
|
862
|
+
"setup.renderer-ensured": "The renderer asked for setup to be running.",
|
|
863
|
+
"setup.renderer-requested": "The renderer asked for the setup session.",
|
|
864
|
+
"setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
|
|
865
|
+
"setup.no-commands": "An environment has no setup commands to run.",
|
|
866
|
+
"setup.already-running": "Setup was requested while it was already running.",
|
|
867
|
+
"setup.held-for-approval": "Setup is held until its commands are approved.",
|
|
868
|
+
"setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
|
|
869
|
+
"setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
|
|
870
|
+
"input.resume-failed": "Asking the backend to resume refused terminal input failed.",
|
|
871
|
+
"input.write-failed": "Writing input to a terminal session threw.",
|
|
872
|
+
"listener.remove-failed": "Removing a terminal output listener threw.",
|
|
873
|
+
"listener.released": "A terminal hook unmounted and dropped its output listener.",
|
|
874
|
+
"session.unmounted": "A terminal hook unmounted; the shell keeps running.",
|
|
875
|
+
"connect.called": "A terminal hook began connecting to a session.",
|
|
876
|
+
"output.reconcile-failed": "Output could not be reconciled against the backend snapshot.",
|
|
877
|
+
"session.stopped-while-disconnected": "A session ended while its event stream was down.",
|
|
878
|
+
"session.disconnect-failed": "Closing or detaching a terminal session failed.",
|
|
879
|
+
"session.resize-failed": "Resizing a terminal session failed, other than for a gone session.",
|
|
880
|
+
"session.id-stored": "A new backend session id was saved for a terminal tab.",
|
|
881
|
+
"session-key.environment-missing": "A local session key was built with no environment id.",
|
|
882
|
+
"clipboard.image-failed": "An image pasted into a terminal could not be saved.",
|
|
883
|
+
"clipboard.copy-failed": "Copying a terminal selection to the clipboard failed.",
|
|
884
|
+
"clipboard.paste-failed": "A paste into a terminal failed; `target` says which path.",
|
|
885
|
+
"clipboard.process-failed": "Reading or storing clipboard data for a paste failed.",
|
|
886
|
+
"clipboard.image-save-failed": "An image from a paste event could not be written to disk.",
|
|
887
|
+
"environment.ready-detected": "A first tab's output showed that the workspace is ready.",
|
|
888
|
+
"shell.ready-detected": "A later tab's output showed that its shell is ready.",
|
|
889
|
+
"setup.scripts-completed": "A setup tab's scripts reported their end by an escape code.",
|
|
890
|
+
"setup.marked-complete": "The user marked a setup tab complete by hand.",
|
|
891
|
+
"setup.awaiting-detection": "A first tab connected and is watching output for readiness.",
|
|
892
|
+
"reconnect.setup-marker-found": "A reconnected tab's buffer already held the setup marker.",
|
|
893
|
+
"reconnect.setup-marker-absent": "A reconnected first tab's buffer lacked the setup marker.",
|
|
894
|
+
"reconnect.completed": "A terminal tab finished reconnecting to its session.",
|
|
895
|
+
"restore.setup-marker-found": "A restored tab's buffer already held the setup marker.",
|
|
896
|
+
"persistent-sessions.load-failed": "Listing an environment's saved sessions failed.",
|
|
897
|
+
"persistent-session.restoring": "A tab began restoring from its saved session.",
|
|
898
|
+
"persistent-session.found": "A tab found its saved session already recorded.",
|
|
899
|
+
"persistent-session.creating": "A tab began recording a saved session for the sidebar.",
|
|
900
|
+
"persistent-session.created": "A saved session for the sidebar was recorded.",
|
|
901
|
+
"persistent-session.create-failed": "Recording a saved session for the sidebar failed.",
|
|
902
|
+
"persistent-session.status-update-failed": "Marking a saved session connected failed.",
|
|
903
|
+
"persistent-session.activity-update-failed": "Updating a saved session's activity failed.",
|
|
904
|
+
"persistent-buffer.loaded": "A saved session's buffer loaded; only its length is logged.",
|
|
905
|
+
"persistent-buffer.load-failed": "A saved session's buffer could not be loaded.",
|
|
906
|
+
"persistent-buffer.save-failed": "Saving a session's buffer during cleanup failed.",
|
|
907
|
+
"buffer.restore-failed": "Writing a saved buffer back into a terminal threw.",
|
|
908
|
+
"buffer.serialize-failed": "Serializing a terminal's buffer during cleanup threw.",
|
|
909
|
+
"command.launching": "A tab began launching its command in a new session.",
|
|
910
|
+
"bootstrap.failed": "A launch request for a new session failed; it may retry.",
|
|
911
|
+
"setup-session.bind-failed": "Looking up or binding the backend setup session failed.",
|
|
912
|
+
"setup-tab.stale-removed": "A setup placeholder tab with no session was removed.",
|
|
913
|
+
"multi-reviews.restore-failed": "Multi-review tabs could not be restored for an environment.",
|
|
914
|
+
"pane-layout.restore-failed": "An environment's saved pane layout could not be read.",
|
|
915
|
+
"pane-layout.history-migrate-failed": "Stripping private browser history fields failed.",
|
|
916
|
+
"pane-layout.snapshot-remove-failed": "Removing an unusable pane layout snapshot failed.",
|
|
917
|
+
"pane-layout.selection-migrate-failed": "Saving a migrated legacy pane selection failed.",
|
|
918
|
+
"panes.reset": "An environment's panes were reset: its container changed or stopped.",
|
|
919
|
+
"tabs.limit-reached": "A new tab was refused because the tab limit was reached.",
|
|
920
|
+
"tab.created": "A new tab was added to a pane; `tabType` says which kind.",
|
|
921
|
+
"tab.activated": "Opening a file selected the tab that already held it.",
|
|
922
|
+
"tab.duplicate-refused": "A new tab was refused because its requested id is in use.",
|
|
923
|
+
"tab.multi-review-refused": "A multi-review tab was refused for lack of a workflow id.",
|
|
924
|
+
"tab.split-at-edge": "A dragged tab split a pane at one of its edges.",
|
|
925
|
+
"tab.reordered": "A dragged tab moved within its pane.",
|
|
926
|
+
"tab.moved": "A dragged tab moved to another pane.",
|
|
927
|
+
"drag.ended": "A tab drag ended, whether or not it landed on a target.",
|
|
928
|
+
"display.state": "The terminal container's overlays and tab count, on each dev render.",
|
|
929
|
+
"compose.draft-restore-failed": "A saved compose draft could not be read.",
|
|
930
|
+
"compose.draft-persist-failed": "A compose draft could not be saved or discarded.",
|
|
931
|
+
"compose.image-too-large": "A pasted image stayed over the attachment limit after resizing.",
|
|
932
|
+
"compose.image-add-failed": "Adding a pasted image to the compose bar failed.",
|
|
933
|
+
"compose.image-save-failed": "Saving one compose image for sending failed; the rest proceed.",
|
|
934
|
+
"compose.send-failed": "Sending from the compose bar failed.",
|
|
935
|
+
"init-logs.load-failed": "A container's initialization logs could not be loaded.",
|
|
936
|
+
"init-logs.refresh-stopped": "A container's initialization logs stopped refreshing.",
|
|
937
|
+
"portal.terminal-created": "The portal host created a terminal for a new tab.",
|
|
938
|
+
"portal.terminal-disposed": "The portal host disposed a terminal for a removed tab.",
|
|
939
|
+
"link.open-failed": "Opening a terminal link in the external browser failed.",
|
|
940
|
+
"canvas.context-unavailable": "A resize canvas had no 2D context; the original is kept.",
|
|
941
|
+
...THROTTLE_LOG_EVENTS
|
|
942
|
+
}
|
|
943
|
+
},
|
|
944
|
+
"terminal.setup": {
|
|
945
|
+
description: "The renderer attaching a backend-managed environment setup terminal.",
|
|
946
|
+
events: {
|
|
947
|
+
"session.bind-from-environment": "The environment hook bound a setup session to a tab.",
|
|
948
|
+
"setup.started-received": "An environment-setup-started event arrived.",
|
|
949
|
+
"setup.complete-received": "An environment-setup-complete event arrived.",
|
|
950
|
+
"attach.state-changed": "A setup tab's attach inputs changed; runs per effect pass.",
|
|
951
|
+
"terminal.preserve-failed": "Keeping a setup terminal's buffer before conversion failed.",
|
|
952
|
+
"tab.marker-retired": "A setup tab with no live PTY stopped being a setup tab.",
|
|
953
|
+
"tab.added": "The backend-managed setup tab was added to a new layout.",
|
|
954
|
+
"session.bind-skipped": "A setup session lookup was already running for this tab.",
|
|
955
|
+
"session.requested": "A tab asked the backend for its setup session.",
|
|
956
|
+
"session.unavailable": "The backend had no setup session to give a tab.",
|
|
957
|
+
"session.bind-started": "A backend setup session was found and is being bound to a tab.",
|
|
958
|
+
"session.awaited": "The layout is waiting for a setup session before adding the tab.",
|
|
959
|
+
"reconcile.started": "The reconcile effect found setup tabs that still need a session.",
|
|
960
|
+
"reconnect-listener.install-failed": "Listening for event stream reconnects failed.",
|
|
961
|
+
"layout.initial-decided": "An empty layout was evaluated for its setup tab; runs per effect."
|
|
962
|
+
}
|
|
963
|
+
}
|
|
964
|
+
});
|
|
965
|
+
|
|
966
|
+
// ../protocol/src/log-vocabulary/tmux.ts
|
|
967
|
+
var TMUX_LOG_AREAS = defineLogAreas({
|
|
968
|
+
tmux: {
|
|
969
|
+
description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
|
|
970
|
+
events: {
|
|
971
|
+
"poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
|
|
972
|
+
"poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
|
|
973
|
+
"poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
|
|
974
|
+
"poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
|
|
975
|
+
"poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
|
|
976
|
+
"cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
|
|
977
|
+
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
978
|
+
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
979
|
+
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
980
|
+
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
981
|
+
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
982
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
983
|
+
"orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
|
|
984
|
+
"orphan.reaped": "A tmux session no tab references was killed.",
|
|
985
|
+
"orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
|
|
986
|
+
"cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
|
|
987
|
+
"cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
|
|
988
|
+
"cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
|
|
989
|
+
"interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
|
|
990
|
+
"signal.arm-failed": "The Claude state signal could not be armed.",
|
|
991
|
+
"signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
|
|
992
|
+
"pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
|
|
993
|
+
"pr-probe.failed": "Probing for a pull request an agent created failed.",
|
|
994
|
+
"activity.persist-failed": "Tmux tab activity could not be saved.",
|
|
995
|
+
"fast-mode.persist-failed": "The launch fast mode could not be saved.",
|
|
996
|
+
"fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
|
|
997
|
+
"pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
|
|
998
|
+
"turn.failure-record-failed": "A failed turn could not be recorded.",
|
|
999
|
+
"slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
|
|
1000
|
+
"queue.failing": "A tmux prompt queue keeps failing to dispatch.",
|
|
1001
|
+
"queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
|
|
1002
|
+
...THROTTLE_LOG_EVENTS
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
});
|
|
1006
|
+
|
|
1007
|
+
// ../protocol/src/log-vocabulary/updater.ts
|
|
1008
|
+
var UPDATER_LOG_AREAS = defineLogAreas({
|
|
1009
|
+
updater: {
|
|
1010
|
+
description: "Desktop self-update: electron-updater and updates a remote client requested.",
|
|
1011
|
+
events: {
|
|
1012
|
+
"channel.following": "Update checks now follow a different release channel.",
|
|
1013
|
+
"check-report.failed": "A check's result could not be reported.",
|
|
1014
|
+
"check.failed": "An update check failed; the next periodic check retries.",
|
|
1015
|
+
"download.failed": "Downloading or staging an update failed.",
|
|
1016
|
+
downloaded: "An update finished downloading.",
|
|
1017
|
+
"library.message": "One line from electron-updater at its own level. Its debug output, which includes the differential download plan, is off by default.",
|
|
1018
|
+
"remote.check-failed": "A check a remote client requested failed.",
|
|
1019
|
+
"remote.installing": "Installing an update for a remote client.",
|
|
1020
|
+
"remote.read-failed": "Update requests could not be read from the Local backend.",
|
|
1021
|
+
"remote.relaunch-prepare-failed": "Preparing the relaunch after a remote update failed.",
|
|
1022
|
+
"remote.relaunched": "The app relaunched to finish a remote client's update.",
|
|
1023
|
+
"remote.report-failed": "An update report could not reach the Local backend.",
|
|
1024
|
+
"remote.restart-not-recorded": "The backend did not record a restart, so it was not installed.",
|
|
1025
|
+
"remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
|
|
1026
|
+
"restart-prompt.failed": "The restart prompt for a downloaded update failed.",
|
|
1027
|
+
unavailable: "Auto-update could not be set up in this session.",
|
|
1028
|
+
"update.failed": "electron-updater reported an update error.",
|
|
1029
|
+
"standalone.restarting": "A standalone backend is restarting into a new version."
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
});
|
|
1033
|
+
|
|
1034
|
+
// ../protocol/src/log-vocabulary/web-annotations.ts
|
|
1035
|
+
var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
|
|
1036
|
+
"web-annotations": {
|
|
1037
|
+
description: "Web annotation requests and their background reconciler.",
|
|
1038
|
+
events: {
|
|
1039
|
+
"reconcile.failed": "A background reconcile pass failed; the next one retries.",
|
|
1040
|
+
"legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
|
|
1041
|
+
"legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
|
|
1042
|
+
"legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
|
|
1043
|
+
"legacy.unavailable": "Legacy annotation storage could not be read.",
|
|
1044
|
+
"legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
|
|
1045
|
+
"legacy.archive-failed": "Imported legacy annotation files could not be archived.",
|
|
1046
|
+
"legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
|
|
1047
|
+
"migration.draft-failed": "Migrating one draft failed.",
|
|
1048
|
+
"draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
|
|
1049
|
+
"request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
|
|
1050
|
+
"evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
|
|
1051
|
+
"queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
|
|
1052
|
+
"request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
|
|
1053
|
+
"turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
|
|
1054
|
+
"gc.failed": "Annotation garbage collection failed; the next pass retries.",
|
|
1055
|
+
"record.unavailable": "An annotation record is unavailable; written once per record.",
|
|
1056
|
+
"storage.unavailable": "An environment's annotation store is unreadable.",
|
|
1057
|
+
"change-hint.listener-failed": "A change hint listener threw.",
|
|
1058
|
+
"orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
|
|
1059
|
+
"storage.load-failed": "An environment's annotation storage could not be loaded.",
|
|
1060
|
+
...THROTTLE_LOG_EVENTS
|
|
1061
|
+
}
|
|
1062
|
+
}
|
|
1063
|
+
});
|
|
1064
|
+
|
|
1065
|
+
// ../protocol/src/log-vocabulary/storage.ts
|
|
1066
|
+
var STORAGE_LOG_AREAS = defineLogAreas({
|
|
1067
|
+
storage: {
|
|
1068
|
+
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
1069
|
+
events: {
|
|
1070
|
+
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
1071
|
+
"snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
|
|
1072
|
+
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
1073
|
+
"snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
|
|
1074
|
+
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
1075
|
+
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
1076
|
+
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
1077
|
+
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
1078
|
+
"preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
|
|
1079
|
+
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
1080
|
+
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
1081
|
+
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
1082
|
+
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
1083
|
+
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
1084
|
+
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
1085
|
+
"legacy-json.archive-failed": "Imported JSON store files could not be archived."
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
});
|
|
1089
|
+
|
|
1090
|
+
// ../protocol/src/log-vocabulary/build-pipeline.ts
|
|
1091
|
+
var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
1092
|
+
"build-pipeline": {
|
|
1093
|
+
description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
|
|
1094
|
+
events: {
|
|
1095
|
+
"sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
|
|
1096
|
+
"sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
|
|
1097
|
+
"result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
|
|
1098
|
+
"consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
|
|
1099
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
|
|
1100
|
+
"interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
|
|
1101
|
+
"transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
|
|
1102
|
+
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
1103
|
+
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
1104
|
+
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
1105
|
+
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
1106
|
+
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
1107
|
+
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
1108
|
+
"usage.read-failed": "Reading a stage session's token usage failed.",
|
|
1109
|
+
"checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
|
|
1110
|
+
"checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
|
|
1111
|
+
"legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
|
|
1112
|
+
}
|
|
1113
|
+
}
|
|
1114
|
+
});
|
|
1115
|
+
|
|
1116
|
+
// ../protocol/src/log-vocabulary/agent-branch.ts
|
|
1117
|
+
var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
|
|
1118
|
+
"agent-branch": {
|
|
1119
|
+
description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
|
|
1120
|
+
events: {
|
|
1121
|
+
"observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
|
|
1122
|
+
"transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
|
|
1123
|
+
"usage.read-failed": "Reading a reviewer's token usage failed.",
|
|
1124
|
+
"result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
|
|
1125
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
|
|
1126
|
+
"result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
|
|
1127
|
+
}
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
|
|
1131
|
+
// ../protocol/src/log-vocabulary/change-tracking.ts
|
|
1132
|
+
var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
1133
|
+
"change-tracking": {
|
|
1134
|
+
description: "Change tracking: turn capture, evidence pulls and measurements.",
|
|
1135
|
+
events: {
|
|
1136
|
+
"journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
|
|
1137
|
+
"projection.failed": "Projecting a change event onto its environment failed.",
|
|
1138
|
+
"startup.reconcile-failed": "Reconciling change tracking at startup failed.",
|
|
1139
|
+
"turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
|
|
1140
|
+
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
1141
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
1142
|
+
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
1143
|
+
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
1144
|
+
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
1145
|
+
}
|
|
1146
|
+
},
|
|
1147
|
+
"diff-stats": {
|
|
1148
|
+
description: "Environment diff stats and the worktree signals that drive them.",
|
|
1149
|
+
events: {
|
|
1150
|
+
"baseline.update-failed": "An environment's diff baseline could not be updated.",
|
|
1151
|
+
"scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
|
|
1152
|
+
"scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
|
|
1153
|
+
"scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
|
|
1154
|
+
"scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
|
|
1155
|
+
"emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
|
|
1156
|
+
"emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
|
|
1157
|
+
"signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
});
|
|
1161
|
+
|
|
1162
|
+
// ../protocol/src/log-vocabulary/coordinator.ts
|
|
1163
|
+
var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
1164
|
+
coordinator: {
|
|
1165
|
+
description: "Coordinators: delegations, status wakes and their store.",
|
|
1166
|
+
events: {
|
|
1167
|
+
"delegation.open-failed": "A delegation could not be opened; `source` says for what.",
|
|
1168
|
+
"deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
|
|
1169
|
+
"mail.move-failed": "Mail could not move to the new main coordinator.",
|
|
1170
|
+
"work.move-failed": "Work could not move to the main coordinator.",
|
|
1171
|
+
"wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
|
|
1172
|
+
"wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
|
|
1173
|
+
"wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
|
|
1174
|
+
"wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
|
|
1175
|
+
"wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
|
|
1176
|
+
"wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
|
|
1177
|
+
"wake.waiting-report-failed": "A waiting worker could not be reported.",
|
|
1178
|
+
"wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
|
|
1179
|
+
"store.malformed": "The coordinator store was malformed and is treated as empty.",
|
|
1180
|
+
"store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
|
|
1181
|
+
"store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
|
|
1182
|
+
"store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
|
|
1183
|
+
"store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
|
|
1184
|
+
"remote-worker.settle-failed": "A remote worker could not be settled."
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
});
|
|
1188
|
+
|
|
1189
|
+
// ../protocol/src/log-vocabulary/review.ts
|
|
1190
|
+
var REVIEW_LOG_AREAS = defineLogAreas({
|
|
1191
|
+
review: {
|
|
1192
|
+
description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
|
|
1193
|
+
events: {
|
|
1194
|
+
"fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
|
|
1195
|
+
"graph-run.not-started": "A workflow's graph run did not start.",
|
|
1196
|
+
"reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
|
|
1197
|
+
"graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
|
|
1198
|
+
"graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
|
|
1199
|
+
"delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
|
|
1200
|
+
"fix-session.read-failed": "Reading an interactive fix session's state failed.",
|
|
1201
|
+
"fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
|
|
1202
|
+
"fix-usage.read-failed": "Reading a fix session's token usage failed.",
|
|
1203
|
+
"result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
|
|
1204
|
+
"failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
|
|
1205
|
+
}
|
|
1206
|
+
},
|
|
1207
|
+
"pull-request": {
|
|
1208
|
+
description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
|
|
1209
|
+
events: {
|
|
1210
|
+
"merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
|
|
1211
|
+
"refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
|
|
1212
|
+
"arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
|
|
1213
|
+
"gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
|
|
1214
|
+
"monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
|
|
1215
|
+
"cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
|
|
1216
|
+
"auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
|
|
1217
|
+
"auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
|
|
1218
|
+
"auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
|
|
1219
|
+
"monitor.detection-failed": "Checking an environment for its pull request failed.",
|
|
1220
|
+
"monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
|
|
1221
|
+
"monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
|
|
1222
|
+
"monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
|
|
1223
|
+
"monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
|
|
1224
|
+
"monitor.state-persist-failed": "A pull request's observed state could not be saved.",
|
|
1225
|
+
"monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
|
|
1226
|
+
"monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
|
|
1227
|
+
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
1228
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
});
|
|
1232
|
+
|
|
1233
|
+
// ../protocol/src/log-vocabulary/public-api.ts
|
|
1234
|
+
var PUBLIC_API_LOG_AREAS = defineLogAreas({
|
|
1235
|
+
"public-api": {
|
|
1236
|
+
description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
|
|
1237
|
+
events: {
|
|
1238
|
+
"outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
|
|
1239
|
+
"goal-checks.stop-failed": "Goal checks could not be stopped.",
|
|
1240
|
+
"exec.list-failed": "Exec workers could not be listed.",
|
|
1241
|
+
"exec.cancel-failed": "An exec could not be cancelled.",
|
|
1242
|
+
"goal-workers.list-failed": "Goal check workers could not be listed.",
|
|
1243
|
+
"operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
|
|
1244
|
+
"reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
|
|
1245
|
+
}
|
|
1246
|
+
}
|
|
1247
|
+
});
|
|
1248
|
+
|
|
1249
|
+
// ../protocol/src/log-vocabulary/agent-accounts.ts
|
|
1250
|
+
var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
1251
|
+
"agent-accounts": {
|
|
1252
|
+
description: "Agent accounts: automatic switching, staged logins and plan usage.",
|
|
1253
|
+
events: {
|
|
1254
|
+
"switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
|
|
1255
|
+
"auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
|
|
1256
|
+
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
1257
|
+
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
1258
|
+
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
1259
|
+
"login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
});
|
|
1263
|
+
|
|
1264
|
+
// ../protocol/src/log-vocabulary/docker.ts
|
|
1265
|
+
var DOCKER_LOG_AREAS = defineLogAreas({
|
|
1266
|
+
docker: {
|
|
1267
|
+
description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
|
|
1268
|
+
events: {
|
|
1269
|
+
"portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
|
|
1270
|
+
"project-seed.refused": "A project .env, .env.local or opencode.json was not copied into a new container: a link, not a regular file, outside the project, too large or unreadable.",
|
|
1271
|
+
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
1272
|
+
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
1273
|
+
"login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
|
|
1274
|
+
"login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
|
|
1275
|
+
"login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
|
|
1276
|
+
"login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
|
|
1277
|
+
"lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
|
|
1278
|
+
"lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
|
|
1279
|
+
"replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
|
|
1280
|
+
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
1281
|
+
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
1282
|
+
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
1283
|
+
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"docker.reachability": {
|
|
1287
|
+
description: "Whether agents in containers can reach the backend's agent tools server.",
|
|
1288
|
+
events: {
|
|
1289
|
+
"check.crashed": "A reachability check crashed.",
|
|
1290
|
+
"check.started": "A reachability check started.",
|
|
1291
|
+
"check.finished": "A reachability check finished.",
|
|
1292
|
+
"check.probe": "One probe of a finished check.",
|
|
1293
|
+
"check.summary": "Content-free status and reason for a check that did not find the host reachable.",
|
|
1294
|
+
"check.remediation": "One command the user can run to unblock containers.",
|
|
1295
|
+
"shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
|
|
1296
|
+
"shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
|
|
1297
|
+
"shutdown.removing-resources": "Shutdown is removing probe resources.",
|
|
1298
|
+
"shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
|
|
1299
|
+
"shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
|
|
1300
|
+
"probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
|
|
1301
|
+
"preflight.refused": "A stage was refused because its container cannot reach the host.",
|
|
1302
|
+
"probe.prepare-failed": "A container could not be prepared for a probe.",
|
|
1303
|
+
"probe.result": "The outcome of probing one container.",
|
|
1304
|
+
"probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
|
|
1305
|
+
"topology.detected": "The Docker topology was read.",
|
|
1306
|
+
"firewall.detected": "The host firewall was read.",
|
|
1307
|
+
"probe-network.remove-failed": "The probe network could not be removed.",
|
|
1308
|
+
"probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
|
|
1309
|
+
"event.emit-failed": "A reachability event could not be emitted.",
|
|
1310
|
+
"host-addresses.list-failed": "Host addresses could not be listed.",
|
|
1311
|
+
"probe-image.present": "The probe image is already present.",
|
|
1312
|
+
"probe-image.pulling": "The probe image is being pulled.",
|
|
1313
|
+
"probe-image.pulled": "The probe image was pulled.",
|
|
1314
|
+
"probe-image.pull-failed": "The probe image could not be pulled.",
|
|
1315
|
+
"probe-image.fallback": "The environment image is used as the probe image.",
|
|
1316
|
+
"probe-image.missing": "No probe image is available.",
|
|
1317
|
+
"network.list-failed": "Docker networks could not be listed.",
|
|
1318
|
+
"network.inspect-failed": "A Docker network could not be inspected.",
|
|
1319
|
+
"stale-containers.removing": "Stale probe containers are being removed.",
|
|
1320
|
+
"stale-networks.removing": "Stale probe networks are being removed."
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1323
|
+
});
|
|
1324
|
+
|
|
1325
|
+
// ../protocol/src/log-vocabulary/mcp.ts
|
|
1326
|
+
var MCP_LOG_AREAS = defineLogAreas({
|
|
1327
|
+
"control-mcp": {
|
|
1328
|
+
description: "The Control MCP server other agents and devices reach Orkestrator through.",
|
|
1329
|
+
events: {
|
|
1330
|
+
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
1331
|
+
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
1332
|
+
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
1333
|
+
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
1334
|
+
}
|
|
1335
|
+
},
|
|
1336
|
+
"mcp-management": {
|
|
1337
|
+
description: "Managed MCP configuration: its commands, overlays and apply loop.",
|
|
1338
|
+
events: {
|
|
1339
|
+
"command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
|
|
1340
|
+
"overlay.materialise-failed": "An MCP overlay could not be written.",
|
|
1341
|
+
"apply.tick-failed": "An MCP apply tick failed; the next one retries."
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
});
|
|
1345
|
+
|
|
1346
|
+
// ../protocol/src/log-vocabulary/design.ts
|
|
1347
|
+
var DESIGN_LOG_AREAS = defineLogAreas({
|
|
1348
|
+
design: {
|
|
1349
|
+
description: "The design canvas: its library, renderer and session links.",
|
|
1350
|
+
events: {
|
|
1351
|
+
"change-signal.failed": "A design change signal failed.",
|
|
1352
|
+
"library.index-write-failed": "The design library index could not be written.",
|
|
1353
|
+
"library.refresh-failed": "The design library could not be refreshed.",
|
|
1354
|
+
"renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
|
|
1355
|
+
"task.failed": "A design background task failed.",
|
|
1356
|
+
"canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
|
|
1357
|
+
"startup.step-failed": "One part of design startup failed; `step` says which.",
|
|
1358
|
+
"legacy.retire-failed": "A migrated legacy design could not be retired.",
|
|
1359
|
+
"profiles.swept": "Design startup removed stale browser profiles.",
|
|
1360
|
+
"session-link.record-failed": "A closing conversation could not be recorded on a design link."
|
|
1361
|
+
}
|
|
1362
|
+
}
|
|
1363
|
+
});
|
|
1364
|
+
|
|
1365
|
+
// ../protocol/src/log-vocabulary/graph.ts
|
|
1366
|
+
var GRAPH_LOG_AREAS = defineLogAreas({
|
|
1367
|
+
graph: {
|
|
1368
|
+
description: "Graph runs: launches, passes, rewinds, system actions and templates.",
|
|
1369
|
+
events: {
|
|
1370
|
+
"describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
|
|
1371
|
+
"system.stop-failed": "A system action's work could not be stopped.",
|
|
1372
|
+
"system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
|
|
1373
|
+
"attention.update-failed": "The sidebar could not be updated for a run.",
|
|
1374
|
+
"launch.ticket-link-failed": "A launched run's ticket could not be linked.",
|
|
1375
|
+
"launch.started": "A graph run was launched.",
|
|
1376
|
+
"launch.swept": "Runs that ended without an environment were removed.",
|
|
1377
|
+
"rewind.pending": "A run's code rewind has not finished.",
|
|
1378
|
+
"rewind.applied": "A run was restarted or rewound.",
|
|
1379
|
+
"rewind.waiting": "A run waits for its code rewind to finish.",
|
|
1380
|
+
"history.pruned": "Finished runs beyond an environment's history were removed.",
|
|
1381
|
+
"history.prune-failed": "Pruning an environment's run history failed.",
|
|
1382
|
+
"worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
|
|
1383
|
+
"run.unreadable": "A run is unreadable, so it is not scheduled.",
|
|
1384
|
+
"run.pass-failed": "A pass over a run failed.",
|
|
1385
|
+
"transcript.capture-failed": "A run's transcript capture failed.",
|
|
1386
|
+
"ticket.link-failed": "A run's ticket could not be linked to its environment.",
|
|
1387
|
+
"template.skipped": "A built-in template was skipped as invalid or a duplicate."
|
|
1388
|
+
}
|
|
1389
|
+
}
|
|
1390
|
+
});
|
|
1391
|
+
|
|
1392
|
+
// ../protocol/src/log-vocabulary/nodes.ts
|
|
1393
|
+
var NODES_LOG_AREAS = defineLogAreas({
|
|
1394
|
+
nodes: {
|
|
1395
|
+
description: "Command nodes: links, handovers, leaf mail and project copies.",
|
|
1396
|
+
events: {
|
|
1397
|
+
"actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
|
|
1398
|
+
"project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
|
|
1399
|
+
"mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
|
|
1400
|
+
"command.post-step-failed": "A step after a routed command failed.",
|
|
1401
|
+
"seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
|
|
1402
|
+
"contact.record-failed": "The latest controller contact could not be recorded.",
|
|
1403
|
+
"settings.send-failed": "Settings could not be sent to a node.",
|
|
1404
|
+
"verification.record-failed": "A node verification could not be recorded.",
|
|
1405
|
+
"profile.record-failed": "A node profile could not be recorded.",
|
|
1406
|
+
"detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
|
|
1407
|
+
"handover.recovery-pending": "Command handover recovery is still pending."
|
|
1408
|
+
}
|
|
1409
|
+
}
|
|
1410
|
+
});
|
|
1411
|
+
|
|
1412
|
+
// ../protocol/src/log-vocabulary/linear.ts
|
|
1413
|
+
var LINEAR_LOG_AREAS = defineLogAreas({
|
|
1414
|
+
linear: {
|
|
1415
|
+
description: "Linear issues read for build actions.",
|
|
1416
|
+
events: {
|
|
1417
|
+
"comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
});
|
|
1421
|
+
|
|
1422
|
+
// ../protocol/src/log-vocabulary/usage-history.ts
|
|
1423
|
+
var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
|
|
1424
|
+
"usage-history": {
|
|
1425
|
+
description: "Recorded agent token usage.",
|
|
1426
|
+
events: {
|
|
1427
|
+
"record.failed": "Agent usage could not be recorded; a later read counts it.",
|
|
1428
|
+
"prune.failed": "Pruning recorded usage failed; the next prune retries."
|
|
1429
|
+
}
|
|
1430
|
+
}
|
|
1431
|
+
});
|
|
1432
|
+
|
|
1433
|
+
// ../protocol/src/log-vocabulary/feature.ts
|
|
1434
|
+
var FEATURE_LOG_AREAS = defineLogAreas({
|
|
1435
|
+
feature: {
|
|
1436
|
+
description: "Pipeline environments started from a feature, and feature planning.",
|
|
1437
|
+
events: {
|
|
1438
|
+
"naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
|
|
1439
|
+
"planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
|
|
1440
|
+
"planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
});
|
|
1444
|
+
|
|
1445
|
+
// ../protocol/src/log-vocabulary/host.ts
|
|
1446
|
+
var HOST_LOG_AREAS = defineLogAreas({
|
|
1447
|
+
host: {
|
|
1448
|
+
description: "The host machine: its executables, load, suspends and maintenance.",
|
|
1449
|
+
events: {
|
|
1450
|
+
"path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
|
|
1451
|
+
"tool.available": "A host tool's availability was read.",
|
|
1452
|
+
"tool.missing": "A host tool was not found.",
|
|
1453
|
+
"maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
|
|
1454
|
+
"suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
|
|
1455
|
+
"load.sample-failed": "Sampling machine load failed; the next sample retries."
|
|
1456
|
+
}
|
|
1457
|
+
}
|
|
1458
|
+
});
|
|
1459
|
+
|
|
1460
|
+
// ../protocol/src/log-vocabulary/transcript-artifacts.ts
|
|
1461
|
+
var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
|
|
1462
|
+
"transcript-artifacts": {
|
|
1463
|
+
description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
|
|
1464
|
+
events: {
|
|
1465
|
+
"announce-failed": "An artifact change could not be announced.",
|
|
1466
|
+
"cleanup-failed": "An artifact cleanup failed.",
|
|
1467
|
+
"grant-revocation-failed": "A grant could not be revoked.",
|
|
1468
|
+
"ledger-listener-failed": "A ledger listener threw.",
|
|
1469
|
+
"ledger-read-failed": "The ledger could not be read.",
|
|
1470
|
+
"operation-executor-failed": "A preview operation's executor failed.",
|
|
1471
|
+
"operation-failed": "A preview operation failed.",
|
|
1472
|
+
"pdf-preview": "A PDF preview was served.",
|
|
1473
|
+
"pdf-preview-failed": "A PDF preview failed.",
|
|
1474
|
+
"pdf-print-failed": "Printing an artifact to PDF failed.",
|
|
1475
|
+
"pdf-printed": "An artifact was printed to PDF.",
|
|
1476
|
+
"runtime-unavailable": "The artifact runtime could not be created."
|
|
1477
|
+
}
|
|
1478
|
+
}
|
|
1479
|
+
});
|
|
1480
|
+
|
|
1481
|
+
// ../protocol/src/log-vocabulary/scheduler.ts
|
|
1482
|
+
var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
1483
|
+
scheduler: {
|
|
1484
|
+
description: "Scheduled jobs and the backend-owned timing that fires them.",
|
|
1485
|
+
events: {
|
|
1486
|
+
"tick.failed": "A scheduler tick failed; the next tick retries.",
|
|
1487
|
+
"job.claim-failed": "A due job could not be claimed.",
|
|
1488
|
+
"fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
|
|
1489
|
+
"fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
|
|
1494
|
+
// ../protocol/src/log-vocabulary/web-app.ts
|
|
1495
|
+
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
1496
|
+
"web.app": {
|
|
1497
|
+
description: "The application root: startup checks and restoring state.",
|
|
1498
|
+
events: {
|
|
1499
|
+
"config.load-failed": "The application config could not be loaded.",
|
|
1500
|
+
"docker.check-failed": "A Docker availability probe failed; the result stays unknown.",
|
|
1501
|
+
"docker.checked": "A Docker availability check finished.",
|
|
1502
|
+
"docker.orphans-cleared": "Reconciling with Docker cleared orphaned container references.",
|
|
1503
|
+
"docker.sync-failed": "Reconciling environments with Docker failed; non-fatal.",
|
|
1504
|
+
"prompt-queues.restore-failed": "An environment's prompt queues could not be restored.",
|
|
1505
|
+
"multi-reviews.restore-failed": "An environment's multi reviews could not be restored.",
|
|
1506
|
+
"build-pipelines.migrate-failed": "Migrating legacy build pipelines failed; the next launch retries.",
|
|
1507
|
+
"build-pipelines.restore-failed": "A project's build pipelines could not be restored.",
|
|
1508
|
+
"macos-permissions.check-failed": "Reading macOS file permission status failed.",
|
|
1509
|
+
"cli-check.failed": "One startup CLI check failed; its result stays unknown.",
|
|
1510
|
+
"cli-check.completed": "A startup CLI check finished; one line per tool.",
|
|
1511
|
+
"cli-check.retried": "A user-requested CLI recheck finished.",
|
|
1512
|
+
"cli-check.retry-failed": "A user-requested CLI recheck failed.",
|
|
1513
|
+
"exit.failed": "Exiting through the plugin failed; the window closes instead.",
|
|
1514
|
+
"zoom.native-failed": "Applying native zoom failed; the CSS fallback is used.",
|
|
1515
|
+
"github-cli.status-failed": "Reading the GitHub CLI setup status failed.",
|
|
1516
|
+
"attachments.restore-failed": "Saved prompt attachments could not be restored before startup.",
|
|
1517
|
+
"startup-launch.persist-failed": "Saving the startup agent launch failed; nothing started.",
|
|
1518
|
+
"environment.start-failed": "Starting an environment from the terminal overlay failed.",
|
|
1519
|
+
"project.delete-failed": "Deleting a project from its dialog failed."
|
|
1520
|
+
}
|
|
1521
|
+
},
|
|
1522
|
+
"web.session": {
|
|
1523
|
+
description: "The renderer's terminal and agent session store.",
|
|
1524
|
+
events: {
|
|
1525
|
+
"status.update-failed": "A session status change could not be saved.",
|
|
1526
|
+
"activity.update-failed": "A best-effort session activity update failed.",
|
|
1527
|
+
"environment-sessions.disconnect-failed": "Disconnecting an environment's sessions failed.",
|
|
1528
|
+
"container-sessions.sync-failed": "Syncing sessions with container state failed.",
|
|
1529
|
+
"reorder.failed": "Reordering sessions failed; the list reloads from the backend.",
|
|
1530
|
+
"refresh.manual-failed": "A manual refresh of an agent tab failed."
|
|
1531
|
+
}
|
|
1532
|
+
},
|
|
1533
|
+
"web.action-bar": {
|
|
1534
|
+
description: "The environment action bar.",
|
|
1535
|
+
events: {
|
|
1536
|
+
"editor.open-failed": "The external editor could not be opened.",
|
|
1537
|
+
"run-commands.read-failed": "Reading the project's run commands file failed.",
|
|
1538
|
+
"environment.delete-failed": "Deleting an environment from the action bar failed.",
|
|
1539
|
+
"merge.started": "A user-requested PR merge started.",
|
|
1540
|
+
"merge.completed": "A user-requested PR merge command returned.",
|
|
1541
|
+
"merge.failed": "A user-requested PR merge failed."
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
|
|
1546
|
+
// ../protocol/src/log-vocabulary/web-build-pipeline.ts
|
|
1547
|
+
var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
1548
|
+
"web.build-pipeline": {
|
|
1549
|
+
description: "Build pipelines as the renderer starts, hydrates and shows them.",
|
|
1550
|
+
events: {
|
|
1551
|
+
"build.start-failed": "A build could not be started.",
|
|
1552
|
+
"pipeline.hydrate-failed": "A pipeline read failed; source says who asked for it.",
|
|
1553
|
+
"pipeline.project-mismatch": "A pending tab activation was dropped: wrong project.",
|
|
1554
|
+
"environment.not-found": "A build's environment read returned nothing after creation.",
|
|
1555
|
+
"environment.project-mismatch": "A build's environment was not added: wrong project.",
|
|
1556
|
+
"environment.hydrate-failed": "A build's environment read failed; live sync can recover.",
|
|
1557
|
+
"transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
|
|
1558
|
+
"legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
|
|
1559
|
+
"opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
|
|
1560
|
+
"opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
|
|
1561
|
+
}
|
|
1562
|
+
}
|
|
1563
|
+
});
|
|
1564
|
+
|
|
1565
|
+
// ../protocol/src/log-vocabulary/web-chat.ts
|
|
1566
|
+
var WEB_CHAT_LOG_AREAS = defineLogAreas({
|
|
1567
|
+
"web.chat": {
|
|
1568
|
+
description: "Rendering the agent transcript: messages, rich blocks and question cards.",
|
|
1569
|
+
events: {
|
|
1570
|
+
"message.copy-failed": "A message could not be copied to the clipboard.",
|
|
1571
|
+
"message.long-press-failed": "A user message's long-press action failed.",
|
|
1572
|
+
"message.link-open-failed": "A link in a message could not be opened.",
|
|
1573
|
+
"message.render-failed": "One transcript row failed to render; fields are the bounded diagnostic.",
|
|
1574
|
+
"image-preview.load-failed": "An image in a message could not be loaded for preview.",
|
|
1575
|
+
"session-list.load-failed": "The resume dialog could not fetch the resumable sessions.",
|
|
1576
|
+
"question.submit-failed": "An answer to an agent's question could not be submitted.",
|
|
1577
|
+
"question.dismiss-failed": "An agent's question could not be dismissed.",
|
|
1578
|
+
"rich-block.render-failed": "A rich block's renderer failed and its source is shown instead.",
|
|
1579
|
+
"rich-block.copy-failed": "A rich block's copy action could not write to the clipboard.",
|
|
1580
|
+
"scroll-viewport.not-found": "The scroll viewport was still missing when polling for it ended."
|
|
1581
|
+
}
|
|
1582
|
+
},
|
|
1583
|
+
"web.native-agent": {
|
|
1584
|
+
description: "The native agent tab and its composer.",
|
|
1585
|
+
events: {
|
|
1586
|
+
"model-catalogue.load-failed": "The native model catalogue could not be loaded.",
|
|
1587
|
+
"provider-lock.persist-failed": "The locked agent choice could not be saved.",
|
|
1588
|
+
"compose-draft.persist-failed": "A compose draft could not be saved.",
|
|
1589
|
+
"compose-draft.restore-failed": "A saved compose draft could not be restored.",
|
|
1590
|
+
"compose-draft.discard-failed": "A saved compose draft could not be discarded.",
|
|
1591
|
+
"paste.failed": "Pasting an image into a composer failed unexpectedly.",
|
|
1592
|
+
"agent-state.listen-failed": "Subscribing to a tab's agent state events failed.",
|
|
1593
|
+
"model-favorites.persist-failed": "The favorite model list could not be saved."
|
|
1594
|
+
}
|
|
1595
|
+
}
|
|
1596
|
+
});
|
|
1597
|
+
|
|
1598
|
+
// ../protocol/src/log-vocabulary/web-claude-tmux.ts
|
|
1599
|
+
var WEB_CLAUDE_TMUX_LOG_AREAS = defineLogAreas({
|
|
1600
|
+
"web.claude-tmux": {
|
|
1601
|
+
description: "The renderer's Claude tmux chat tab and interactive terminal.",
|
|
1602
|
+
events: {
|
|
1603
|
+
"sessions.list-failed": "The resume dialog could not list tmux sessions.",
|
|
1604
|
+
"tab.hydrate-failed": "Reading a tab's tmux session from the backend failed.",
|
|
1605
|
+
"models.catalog-unavailable": "The model catalogue failed; the bundled fallback stays.",
|
|
1606
|
+
"queue.promote-failed": "After an interrupt, the next queued prompt did not become the draft.",
|
|
1607
|
+
"files.load-failed": "The file list for @mentions could not be loaded.",
|
|
1608
|
+
"clipboard.image-failed": "An image pasted into the interactive terminal could not be saved.",
|
|
1609
|
+
"terminal.resize-failed": "Resizing the interactive terminal's session failed.",
|
|
1610
|
+
"terminal.recover-failed": "The interactive terminal could not reattach to its session."
|
|
1611
|
+
}
|
|
1612
|
+
}
|
|
1613
|
+
});
|
|
1614
|
+
|
|
1615
|
+
// ../protocol/src/log-vocabulary/web-design.ts
|
|
1616
|
+
var WEB_DESIGN_LOG_AREAS = defineLogAreas({
|
|
1617
|
+
"web.design": {
|
|
1618
|
+
description: "Opening design canvas tabs.",
|
|
1619
|
+
events: {
|
|
1620
|
+
"tab.duplicate-refused": "A design tab was not opened because its id is already in use."
|
|
1621
|
+
}
|
|
1622
|
+
}
|
|
1623
|
+
});
|
|
1624
|
+
|
|
1625
|
+
// ../protocol/src/log-vocabulary/web-environment.ts
|
|
1626
|
+
var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
1627
|
+
"web.environment": {
|
|
1628
|
+
description: "Environment lifecycle and dialogs as the renderer drives them.",
|
|
1629
|
+
events: {
|
|
1630
|
+
"start.called": "The renderer was asked to start an environment.",
|
|
1631
|
+
"start.unknown-environment": "A start was requested for an id the store does not hold.",
|
|
1632
|
+
"start.snapshot-read": "An environment's state as its start began.",
|
|
1633
|
+
"start.status-set": "The environment was marked as creating before the backend call.",
|
|
1634
|
+
"start.background-requested": "A start is being handed to the backend to run in background.",
|
|
1635
|
+
"start.backend-requested": "A foreground start call to the backend is being made.",
|
|
1636
|
+
"start.backend-completed": "The backend finished a foreground start.",
|
|
1637
|
+
"start.environment-refreshed": "An environment was read back after a foreground start.",
|
|
1638
|
+
"start.worktree-missing": "A local environment started with no worktree path.",
|
|
1639
|
+
"start.failed": "Starting an environment from the renderer failed.",
|
|
1640
|
+
"stop.called": "The renderer was asked to stop an environment.",
|
|
1641
|
+
"stop.status-set": "The environment's status was set while stopping it.",
|
|
1642
|
+
"stop.backend-requested": "A stop call to the backend is being made.",
|
|
1643
|
+
"stop.backend-completed": "The backend finished a stop.",
|
|
1644
|
+
"stop.sessions-disconnecting": "A stopped environment's sessions are being disconnected.",
|
|
1645
|
+
"stop.sessions-disconnected": "A stopped environment's sessions were disconnected.",
|
|
1646
|
+
"stop.failed": "Stopping an environment from the renderer failed.",
|
|
1647
|
+
"restart.failed": "Restarting an environment from the renderer failed.",
|
|
1648
|
+
"status-sync.failed": "An environment's status could not be synced from the backend.",
|
|
1649
|
+
"list.refresh-failed": "A background refresh of a project's environments failed.",
|
|
1650
|
+
"setup-snapshot.reconcile-failed": "An environment's setup state could not be reconciled.",
|
|
1651
|
+
"rename.received": "An environment-renamed event arrived.",
|
|
1652
|
+
"rename.pr-state-cleared": "A rename changed the branch, so stale PR state was cleared.",
|
|
1653
|
+
"unread.clear-failed": "An environment's unread work could not be cleared on the backend.",
|
|
1654
|
+
"create.failed": "Creating an environment from the dialog failed.",
|
|
1655
|
+
"create.port-mappings-invalid": "Creation was refused: a port is not between 1 and 65535.",
|
|
1656
|
+
"create.attachment-read-failed": "A file dropped on the create dialog could not be read.",
|
|
1657
|
+
"auto-start.failed": "A background start after creating an environment was rejected.",
|
|
1658
|
+
"models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
|
|
1659
|
+
"models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
|
|
1660
|
+
"github-credential.check-failed": "The GitHub credential check before creating failed.",
|
|
1661
|
+
"feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
|
|
1662
|
+
"settings.extensions-load-failed": "The settings dialog could not load extensions.",
|
|
1663
|
+
"settings.container-reset-failed": "The settings dialog could not reset the container.",
|
|
1664
|
+
"settings.save-failed": "The settings dialog could not save.",
|
|
1665
|
+
"domains.test-failed": "Testing whether network whitelist domains resolve failed.",
|
|
1666
|
+
"network-whitelist.save-failed": "The network whitelist dialog could not save."
|
|
1667
|
+
}
|
|
1668
|
+
},
|
|
1669
|
+
"web.sidebar": {
|
|
1670
|
+
description: "The project and environment sidebar.",
|
|
1671
|
+
events: {
|
|
1672
|
+
"reorder.persist-failed": "A sidebar reorder could not be saved.",
|
|
1673
|
+
"fork.failed": "Forking an environment from the sidebar failed.",
|
|
1674
|
+
"auto-start.started": "Selecting an unstarted local environment is starting it.",
|
|
1675
|
+
"auto-start.failed": "Starting a local environment on selection failed.",
|
|
1676
|
+
"environment.stop-failed": "Stopping a selected environment failed.",
|
|
1677
|
+
"environment.restart-failed": "Restarting a selected environment failed.",
|
|
1678
|
+
"environment.delete-failed": "Deleting an environment from the sidebar failed.",
|
|
1679
|
+
"environments.load-failed": "A project's environments could not be loaded for the sidebar.",
|
|
1680
|
+
"project.add-failed": "Adding a project from the sidebar failed.",
|
|
1681
|
+
"project.create-failed": "Creating a project from scratch failed.",
|
|
1682
|
+
"project.delete-failed": "Deleting a project from the sidebar failed.",
|
|
1683
|
+
"folder.project-remove-failed": "A project could not be removed from its folder.",
|
|
1684
|
+
"folder.rename-failed": "A project folder could not be renamed.",
|
|
1685
|
+
"folder.ungroup-failed": "A project folder could not be removed.",
|
|
1686
|
+
"folder.sort-failed": "A project folder could not be sorted."
|
|
1687
|
+
}
|
|
1688
|
+
},
|
|
1689
|
+
"web.docker": {
|
|
1690
|
+
description: "The Docker settings view.",
|
|
1691
|
+
events: {
|
|
1692
|
+
"data.load-failed": "Container or image data could not be loaded.",
|
|
1693
|
+
"container.stop-failed": "Stopping a container from Docker settings failed.",
|
|
1694
|
+
"container.delete-failed": "Deleting a container from Docker settings failed.",
|
|
1695
|
+
"container.reattach-failed": "Reattaching a container to a project failed."
|
|
1696
|
+
}
|
|
1697
|
+
},
|
|
1698
|
+
"web.project": {
|
|
1699
|
+
description: "Adding a project from the renderer.",
|
|
1700
|
+
events: {
|
|
1701
|
+
"directory-picker.failed": "The directory picker could not be opened.",
|
|
1702
|
+
"git-remote.read-failed": "A chosen directory's git remote could not be read."
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
});
|
|
1706
|
+
|
|
1707
|
+
// ../protocol/src/log-vocabulary/web-files.ts
|
|
1708
|
+
var WEB_FILES_LOG_AREAS = defineLogAreas({
|
|
1709
|
+
"web.files": {
|
|
1710
|
+
description: "The files panel, file viewer and file search.",
|
|
1711
|
+
events: {
|
|
1712
|
+
"file.save-failed": "A file could not be saved.",
|
|
1713
|
+
"git-changes.load-failed": "The files panel could not load the git changes.",
|
|
1714
|
+
"file-tree.load-failed": "The file tree could not be loaded.",
|
|
1715
|
+
"changes.refresh-failed": "Refreshing the files panel's changes failed.",
|
|
1716
|
+
"folder.load-failed": "An expanded folder's contents could not be loaded.",
|
|
1717
|
+
"path.copy-failed": "A file's path could not be copied to the clipboard.",
|
|
1718
|
+
"draft.persist-failed": "A file viewer tab's draft could not be saved.",
|
|
1719
|
+
"draft.restore-failed": "A file viewer tab's saved draft could not be restored.",
|
|
1720
|
+
"draft.discard-failed": "A file's saved draft could not be discarded before a reload."
|
|
1721
|
+
}
|
|
1722
|
+
}
|
|
1723
|
+
});
|
|
1724
|
+
|
|
1725
|
+
// ../protocol/src/log-vocabulary/web-github.ts
|
|
1726
|
+
var WEB_GITHUB_LOG_AREAS = defineLogAreas({
|
|
1727
|
+
"web.github": {
|
|
1728
|
+
description: "Pull request and GitHub issue views.",
|
|
1729
|
+
events: {
|
|
1730
|
+
"pull-request.url-failed": "A pull request's URL could not be read.",
|
|
1731
|
+
"pull-request.mode-request-failed": "The pull request monitor refused a watch mode request.",
|
|
1732
|
+
"pull-request.copy-failed": "A pull request value could not be copied to the clipboard.",
|
|
1733
|
+
"comment-edit-draft.clear-failed": "An edited comment's saved draft could not be cleared.",
|
|
1734
|
+
"issue-draft.clear-failed": "An edited issue's saved drafts could not be cleared.",
|
|
1735
|
+
"comment-draft.clear-failed": "A posted comment's draft could not be cleared."
|
|
1736
|
+
}
|
|
1737
|
+
},
|
|
1738
|
+
"web.linear": {
|
|
1739
|
+
description: "The Linear tickets view.",
|
|
1740
|
+
events: {
|
|
1741
|
+
"comment-draft.clear-failed": "A posted comment's draft could not be cleared."
|
|
1742
|
+
}
|
|
1743
|
+
}
|
|
1744
|
+
});
|
|
1745
|
+
|
|
1746
|
+
// ../protocol/src/log-vocabulary/web-kanban.ts
|
|
1747
|
+
var WEB_KANBAN_LOG_AREAS = defineLogAreas({
|
|
1748
|
+
"web.kanban": {
|
|
1749
|
+
description: "The Kanban board, its task dialog and project notes.",
|
|
1750
|
+
events: {
|
|
1751
|
+
"tasks.load-failed": "A project's tasks could not be loaded.",
|
|
1752
|
+
"task.add-failed": "A new task could not be added.",
|
|
1753
|
+
"task.update-failed": "A task's fields could not be updated.",
|
|
1754
|
+
"task.content-update-failed": "A task's content edit could not be saved.",
|
|
1755
|
+
"task.build-status-clear-failed": "A task's build status could not be cleared.",
|
|
1756
|
+
"task.delete-failed": "A task could not be deleted.",
|
|
1757
|
+
"task.move-failed": "A task move failed and its status was rolled back.",
|
|
1758
|
+
"comment.add-failed": "A comment could not be added to a task.",
|
|
1759
|
+
"comment.delete-failed": "A comment could not be deleted from a task.",
|
|
1760
|
+
"image.add-failed": "An image could not be added to a task.",
|
|
1761
|
+
"image.delete-failed": "An image could not be deleted from a task.",
|
|
1762
|
+
"notes.load-failed": "Project notes could not be loaded; the editor stays disabled.",
|
|
1763
|
+
"notes.save-failed": "Project notes could not be saved.",
|
|
1764
|
+
"notes.draft-retained": "A notes save failed; the edit stays in its durable draft.",
|
|
1765
|
+
"draft.restore-failed": "A saved create-task draft could not be restored.",
|
|
1766
|
+
"draft.persist-failed": "A create-task draft could not be saved; phase says when.",
|
|
1767
|
+
"draft.discard-failed": "A create-task draft could not be removed; phase says when.",
|
|
1768
|
+
"build.start-failed": "The task dialog could not start a build for a task.",
|
|
1769
|
+
"build.create-and-start-failed": "The task dialog could not create a task and build it."
|
|
1770
|
+
}
|
|
1771
|
+
},
|
|
1772
|
+
"web.feature-plan": {
|
|
1773
|
+
description: "Feature planning in the renderer.",
|
|
1774
|
+
events: {
|
|
1775
|
+
"features.load-failed": "A project's features could not be loaded.",
|
|
1776
|
+
"feature.create-failed": "A new feature could not be created.",
|
|
1777
|
+
"feature.update-failed": "A feature could not be updated.",
|
|
1778
|
+
"build.claim-failed": "A feature's build could not be claimed for a task.",
|
|
1779
|
+
"build.start-failed": "Starting a build from a feature failed.",
|
|
1780
|
+
"message.append-failed": "A message could not be added to a feature's chat.",
|
|
1781
|
+
"story-message.append-failed": "A message could not be added to a story's chat.",
|
|
1782
|
+
"planning.start-failed": "Feature planning could not be started.",
|
|
1783
|
+
"planning.retry-failed": "Feature planning could not be retried.",
|
|
1784
|
+
"planning.cancel-failed": "Feature planning could not be cancelled.",
|
|
1785
|
+
"drafts.persist-failed": "A project's feature chat drafts could not be saved.",
|
|
1786
|
+
"drafts.restore-failed": "A project's feature chat drafts could not be restored."
|
|
1787
|
+
}
|
|
1788
|
+
}
|
|
1789
|
+
});
|
|
1790
|
+
|
|
1791
|
+
// ../protocol/src/log-vocabulary/web-pane-layout.ts
|
|
1792
|
+
var WEB_PANE_LAYOUT_LOG_AREAS = defineLogAreas({
|
|
1793
|
+
"web.pane-layout": {
|
|
1794
|
+
description: "Panes and tabs in the renderer: moves, splits, teardown and saved layouts.",
|
|
1795
|
+
events: {
|
|
1796
|
+
"persist.failed": "A pane layout could not be written to the backend.",
|
|
1797
|
+
"persist.install-skipped": "A saved layout was not installed: its dependencies did not load.",
|
|
1798
|
+
"persist.settled-handler-failed": "A write-settled handler threw; later handlers still ran.",
|
|
1799
|
+
"environment.activated": "The active environment changed.",
|
|
1800
|
+
"environment.initialized": "An environment's pane state was initialized.",
|
|
1801
|
+
"environment.initialize-skipped": "Initialize was called with no active environment.",
|
|
1802
|
+
"environment.terminals-cleared": "A reset cleared the environment's terminal instances.",
|
|
1803
|
+
"terminal-session.cleanup-started": "A closed tab's terminal session is being cleaned up.",
|
|
1804
|
+
"teardown.pending": "A tab teardown was rejected; the backend keeps it pending and retries.",
|
|
1805
|
+
"browser-preview.destroy-failed": "Destroying a closed browser tab's preview failed.",
|
|
1806
|
+
"handoffs.prune-failed": "Pruning unreferenced agent handoffs failed.",
|
|
1807
|
+
"tab.reactivated": "A tab added twice was activated in its existing pane instead.",
|
|
1808
|
+
"tab.move-started": "A tab move passed its checks and is being applied.",
|
|
1809
|
+
"tab.move-failed": "A tab move was refused; `reason` says which lookup failed.",
|
|
1810
|
+
"tab.initial-prompt-cleared": "A tab's initial prompt was cleared.",
|
|
1811
|
+
"tab.initial-agent-options-cleared": "A tab's initial agent options were cleared.",
|
|
1812
|
+
"pane.split-depth-reached": "A split was refused at the maximum split depth.",
|
|
1813
|
+
"pane.edge-split-started": "An edge split passed its checks and is being applied.",
|
|
1814
|
+
"pane.edge-split-failed": "An edge split was refused; `reason` says which lookup failed.",
|
|
1815
|
+
"pane.close-refused": "Closing the only pane in a layout was refused.",
|
|
1816
|
+
"draft.discard-failed": "A closing tab's draft could not be discarded; the tab stayed open.",
|
|
1817
|
+
"draft.file-conflict-resolve-failed": "Discarding a newer saved file draft failed.",
|
|
1818
|
+
"draft.compose-conflict-resolve-failed": "Discarding a newer saved compose draft failed."
|
|
1819
|
+
}
|
|
1820
|
+
}
|
|
1821
|
+
});
|
|
1822
|
+
|
|
1823
|
+
// ../protocol/src/log-vocabulary/web-settings.ts
|
|
1824
|
+
var WEB_SETTINGS_LOG_AREAS = defineLogAreas({
|
|
1825
|
+
"web.settings": {
|
|
1826
|
+
description: "The settings screens.",
|
|
1827
|
+
events: {
|
|
1828
|
+
"config.save-failed": "Global settings could not be saved.",
|
|
1829
|
+
"config.load-failed": "The settings page could not load the config.",
|
|
1830
|
+
"config.reload-failed": "Re-reading the workspace config after a save failed.",
|
|
1831
|
+
"domains.test-failed": "The domain resolution test could not run.",
|
|
1832
|
+
"github-credentials.propagate-failed": "Propagating GitHub credentials to environments failed.",
|
|
1833
|
+
"credential.save-failed": "A credential could not be saved.",
|
|
1834
|
+
"credential.clear-failed": "A credential could not be cleared.",
|
|
1835
|
+
"gateway-token.save-failed": "The gateway token could not be saved.",
|
|
1836
|
+
"gateway-token.copy-failed": "Copying the gateway token to the clipboard failed.",
|
|
1837
|
+
"web-client-url.copy-failed": "Copying the web client address to the clipboard failed.",
|
|
1838
|
+
"backend-version.read-failed": "The debug tab could not read the backend version.",
|
|
1839
|
+
"messaging.flush-failed": "Saving pending messaging settings on unmount failed.",
|
|
1840
|
+
"directory-picker.failed": "The repository directory picker could not open.",
|
|
1841
|
+
"file-picker.failed": "The repository file picker could not open.",
|
|
1842
|
+
"repository.save-failed": "Repository settings could not be saved.",
|
|
1843
|
+
"model-catalogues.read-failed": "Reading the model catalogues for settings failed."
|
|
1844
|
+
}
|
|
1845
|
+
}
|
|
1846
|
+
});
|
|
1847
|
+
|
|
1848
|
+
// ../protocol/src/log-vocabulary/web-shell.ts
|
|
1849
|
+
var WEB_SHELL_LOG_AREAS = defineLogAreas({
|
|
1850
|
+
"web.startup": {
|
|
1851
|
+
description: "Loading the renderer, after the desktop connection check.",
|
|
1852
|
+
events: {
|
|
1853
|
+
"renderer.load-failed": "Importing or mounting the application failed.",
|
|
1854
|
+
"model-catalogue.restore-failed": "The cached model catalogue could not be restored; bundled fallbacks stay in use."
|
|
1855
|
+
}
|
|
1856
|
+
},
|
|
1857
|
+
"web.window": {
|
|
1858
|
+
description: "Errors nothing in the renderer caught. Bug reports classify these two lines.",
|
|
1859
|
+
events: {
|
|
1860
|
+
"error.unhandled": "A window error event reached the bootstrap handler.",
|
|
1861
|
+
"rejection.unhandled": "A promise rejected with no handler."
|
|
1862
|
+
}
|
|
1863
|
+
},
|
|
1864
|
+
"web.react": {
|
|
1865
|
+
description: "React's root error callbacks and the lazy view boundary.",
|
|
1866
|
+
events: {
|
|
1867
|
+
"root.caught-error": "An error boundary caught a render error.",
|
|
1868
|
+
"root.uncaught-error": "A render error reached the root with no boundary.",
|
|
1869
|
+
"root.recoverable-error": "React recovered from a render error by retrying.",
|
|
1870
|
+
"lazy-view.failed": "A lazily loaded view failed; fields are the bounded diagnostic."
|
|
1871
|
+
}
|
|
1872
|
+
}
|
|
1873
|
+
});
|
|
1874
|
+
|
|
1875
|
+
// ../protocol/src/log-vocabulary/web-sync.ts
|
|
1876
|
+
var WEB_SYNC_LOG_AREAS = defineLogAreas({
|
|
1877
|
+
"web.resource-sync": {
|
|
1878
|
+
description: "Keeping renderer stores current with backend resources.",
|
|
1879
|
+
events: {
|
|
1880
|
+
"handler.threw": "A resource change handler threw; other handlers still ran.",
|
|
1881
|
+
"resync-handler.threw": "A resync handler threw; the resync counts as failed.",
|
|
1882
|
+
"view-safety-check.threw": "A view safety check handler threw; the others still ran.",
|
|
1883
|
+
"snapshots.batch-failed": "A scoped snapshot batch failed; individual reads take over.",
|
|
1884
|
+
"manifest.scoped-check-failed": "The scoped manifest read failed; a full resync runs.",
|
|
1885
|
+
"manifest.check-failed": "The manifest read failed; a full resync runs.",
|
|
1886
|
+
"subscribe.failed": "Subscribing to a resource transport event failed.",
|
|
1887
|
+
"change.malformed": "A resource-changed payload had the wrong shape and was dropped.",
|
|
1888
|
+
"config.refresh-failed": "Refreshing the config store after a change failed.",
|
|
1889
|
+
"pane-layout.refresh-failed": "Refreshing an environment's pane layout failed.",
|
|
1890
|
+
"setup-completion.observe-failed": "Subscribing to setup completion events failed.",
|
|
1891
|
+
"resync.project-failed": "The authoritative project read failed during a store resync.",
|
|
1892
|
+
"resync.environment-failed": "The authoritative environment read failed during a resync.",
|
|
1893
|
+
"resync.read-failed": "One of a store resync's per-environment reads failed.",
|
|
1894
|
+
"resync.pane-failed": "A pane layout read failed during a store resync.",
|
|
1895
|
+
"agent-mail.summary-refresh-failed": "Refreshing the agent mail summary failed.",
|
|
1896
|
+
"agent-mail.mailbox-refresh-failed": "Refreshing one agent mailbox failed.",
|
|
1897
|
+
"prompt-queues.refresh-failed": "Refreshing an environment's prompt queues failed.",
|
|
1898
|
+
"build-pipeline.refresh-failed": "Refreshing one build pipeline failed.",
|
|
1899
|
+
"multi-review.refresh-failed": "Refreshing one multi review workflow failed.",
|
|
1900
|
+
"authoritative.resync-failed": "Re-reading a snapshot after a stream reconnect failed.",
|
|
1901
|
+
"observation.listener-threw": "A native observation invalidation listener threw.",
|
|
1902
|
+
"observation.subscribe-failed": "Subscribing to native observation events failed.",
|
|
1903
|
+
"hydration.status-listener-failed": "A bounded hydration status listener threw.",
|
|
1904
|
+
"hydration.notification-failed": "A bounded hydration change notification threw."
|
|
1905
|
+
}
|
|
1906
|
+
},
|
|
1907
|
+
"web.read-coordinator": {
|
|
1908
|
+
description: "The renderer's coalesced, bounded backend reads.",
|
|
1909
|
+
events: {
|
|
1910
|
+
"listener.threw": "A read state listener threw.",
|
|
1911
|
+
"read.settle-failed": "Applying a finished read's result threw."
|
|
1912
|
+
}
|
|
1913
|
+
},
|
|
1914
|
+
"web.gateway": {
|
|
1915
|
+
description: "The renderer's connection to the gateway: requests and event streams.",
|
|
1916
|
+
events: {
|
|
1917
|
+
"events.disconnected": "The main event stream dropped; it reconnects and replays.",
|
|
1918
|
+
"terminal-stream.disconnected": "A terminal event stream dropped; it reconnects.",
|
|
1919
|
+
"connection-listener.failed": "A main stream connection state listener threw.",
|
|
1920
|
+
"event-listener.failed": "A listener for a gateway event threw.",
|
|
1921
|
+
"stream-listener.failed": "A listener for the stream-connected notice threw."
|
|
1922
|
+
}
|
|
1923
|
+
},
|
|
1924
|
+
"web.federation": {
|
|
1925
|
+
description: "Events from federated nodes as the renderer receives them.",
|
|
1926
|
+
events: {
|
|
1927
|
+
"resync-handler.failed": "A node resync handler failed.",
|
|
1928
|
+
"event-handler.failed": "A handler for an event relayed from a node failed.",
|
|
1929
|
+
"environment.start-failed": "Starting an environment opened in a workspace window failed."
|
|
1930
|
+
}
|
|
1931
|
+
}
|
|
1932
|
+
});
|
|
1933
|
+
|
|
1934
|
+
// ../protocol/src/log-vocabulary/index.ts
|
|
1935
|
+
var LOG_VOCABULARY = {
|
|
1936
|
+
...AGENT_MAIL_LOG_AREAS,
|
|
1937
|
+
...BACKEND_LOG_AREAS,
|
|
1938
|
+
...BRIDGE_LOG_AREAS,
|
|
1939
|
+
...DESKTOP_LOG_AREAS,
|
|
1940
|
+
...ENVIRONMENT_LOG_AREAS,
|
|
1941
|
+
...GATEWAY_LOG_AREAS,
|
|
1942
|
+
...LOCAL_SERVER_LOG_AREAS,
|
|
1943
|
+
...GIT_LOG_AREAS,
|
|
1944
|
+
...LOGGING_LOG_AREAS,
|
|
1945
|
+
...MODEL_LOG_AREAS,
|
|
1946
|
+
...NATIVE_AGENT_LOG_AREAS,
|
|
1947
|
+
...PREVIEW_LOG_AREAS,
|
|
1948
|
+
...RUNTIME_LOG_AREAS,
|
|
1949
|
+
...TERMINAL_LOG_AREAS,
|
|
1950
|
+
...TMUX_LOG_AREAS,
|
|
1951
|
+
...UPDATER_LOG_AREAS,
|
|
1952
|
+
...WEB_ANNOTATIONS_LOG_AREAS,
|
|
1953
|
+
...STORAGE_LOG_AREAS,
|
|
1954
|
+
...BUILD_PIPELINE_LOG_AREAS,
|
|
1955
|
+
...AGENT_BRANCH_LOG_AREAS,
|
|
1956
|
+
...CHANGE_TRACKING_LOG_AREAS,
|
|
1957
|
+
...COORDINATOR_LOG_AREAS,
|
|
1958
|
+
...REVIEW_LOG_AREAS,
|
|
1959
|
+
...PUBLIC_API_LOG_AREAS,
|
|
1960
|
+
...AGENT_ACCOUNTS_LOG_AREAS,
|
|
1961
|
+
...DOCKER_LOG_AREAS,
|
|
1962
|
+
...MCP_LOG_AREAS,
|
|
1963
|
+
...DESIGN_LOG_AREAS,
|
|
1964
|
+
...GRAPH_LOG_AREAS,
|
|
1965
|
+
...NODES_LOG_AREAS,
|
|
1966
|
+
...LINEAR_LOG_AREAS,
|
|
1967
|
+
...USAGE_HISTORY_LOG_AREAS,
|
|
1968
|
+
...FEATURE_LOG_AREAS,
|
|
1969
|
+
...HOST_LOG_AREAS,
|
|
1970
|
+
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
1971
|
+
...SCHEDULER_LOG_AREAS,
|
|
1972
|
+
...WEB_APP_LOG_AREAS,
|
|
1973
|
+
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
1974
|
+
...WEB_CHAT_LOG_AREAS,
|
|
1975
|
+
...WEB_CLAUDE_TMUX_LOG_AREAS,
|
|
1976
|
+
...WEB_DESIGN_LOG_AREAS,
|
|
1977
|
+
...WEB_ENVIRONMENT_LOG_AREAS,
|
|
1978
|
+
...WEB_FILES_LOG_AREAS,
|
|
1979
|
+
...WEB_GITHUB_LOG_AREAS,
|
|
1980
|
+
...WEB_KANBAN_LOG_AREAS,
|
|
1981
|
+
...WEB_PANE_LAYOUT_LOG_AREAS,
|
|
1982
|
+
...WEB_SETTINGS_LOG_AREAS,
|
|
1983
|
+
...WEB_SHELL_LOG_AREAS,
|
|
1984
|
+
...WEB_SYNC_LOG_AREAS
|
|
1985
|
+
};
|
|
1986
|
+
|
|
1987
|
+
// ../protocol/src/logger.ts
|
|
1988
|
+
var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
1989
|
+
var MAX_FIELD_CHARS = 2048;
|
|
1990
|
+
var TRUNCATION_MARKER_RESERVE = 32;
|
|
1991
|
+
var MAX_FIELDS = 32;
|
|
1992
|
+
var FIELD_NAME_PATTERN = /^[A-Za-z][\w.-]{0,63}$/;
|
|
1993
|
+
var BARE_TEXT_VALUE = /^[\w./:@+,~-]+$/;
|
|
1994
|
+
var THROTTLE_KIND_PATTERN = /^[\w.:-]{1,64}$/;
|
|
1995
|
+
var MAX_THROTTLE_SCOPE_CHARS = 128;
|
|
1996
|
+
var FORBIDDEN_FIELD_NAMES = new Set([
|
|
1997
|
+
"stdout",
|
|
1998
|
+
"stderr",
|
|
1999
|
+
"cmd",
|
|
2000
|
+
"spawnargs",
|
|
2001
|
+
"prompt",
|
|
2002
|
+
"token",
|
|
2003
|
+
"password",
|
|
2004
|
+
"secret",
|
|
2005
|
+
"authorization",
|
|
2006
|
+
"apikey",
|
|
2007
|
+
"cookie",
|
|
2008
|
+
"credentials"
|
|
2009
|
+
]);
|
|
2010
|
+
var LEVEL_RANK = {
|
|
2011
|
+
error: 0,
|
|
2012
|
+
warn: 1,
|
|
2013
|
+
info: 2,
|
|
2014
|
+
debug: 3,
|
|
2015
|
+
trace: 4
|
|
2016
|
+
};
|
|
2017
|
+
var OUTPUT_METHOD = {
|
|
2018
|
+
error: "error",
|
|
2019
|
+
warn: "warn",
|
|
2020
|
+
info: "info",
|
|
2021
|
+
debug: "debug",
|
|
2022
|
+
trace: "debug"
|
|
2023
|
+
};
|
|
2024
|
+
var consoleSink = ({ method, line }) => {
|
|
2025
|
+
console[method](line);
|
|
2026
|
+
};
|
|
2027
|
+
var DEFAULT_CONFIG = {
|
|
2028
|
+
level: "info",
|
|
2029
|
+
areaLevels: {},
|
|
2030
|
+
format: "text",
|
|
2031
|
+
sink: consoleSink
|
|
2032
|
+
};
|
|
2033
|
+
var config = DEFAULT_CONFIG;
|
|
2034
|
+
var generation = 0;
|
|
2035
|
+
function configureLogger(change) {
|
|
2036
|
+
config = { ...config, ...change };
|
|
2037
|
+
generation += 1;
|
|
2038
|
+
}
|
|
2039
|
+
function isLogLevel(value) {
|
|
2040
|
+
return typeof value === "string" && LOG_LEVELS.includes(value);
|
|
2041
|
+
}
|
|
2042
|
+
function areaSpec(area) {
|
|
2043
|
+
return Object.hasOwn(LOG_VOCABULARY, area) ? LOG_VOCABULARY[area] : undefined;
|
|
2044
|
+
}
|
|
2045
|
+
function thresholdRank(area) {
|
|
2046
|
+
for (let scope = area;; scope = scope.slice(0, scope.lastIndexOf("."))) {
|
|
2047
|
+
const level = Object.hasOwn(config.areaLevels, scope) ? config.areaLevels[scope] : undefined;
|
|
2048
|
+
if (level)
|
|
2049
|
+
return LEVEL_RANK[level];
|
|
2050
|
+
if (!scope.includes("."))
|
|
2051
|
+
return LEVEL_RANK[config.level];
|
|
2052
|
+
}
|
|
2053
|
+
}
|
|
2054
|
+
function boundedString(value, maxChars) {
|
|
2055
|
+
if (value.length <= maxChars)
|
|
2056
|
+
return value;
|
|
2057
|
+
const kept = maxChars - TRUNCATION_MARKER_RESERVE;
|
|
2058
|
+
return `${value.slice(0, kept)}...[truncated ${value.length - kept} chars]`;
|
|
2059
|
+
}
|
|
2060
|
+
function sanitizeValue(name, value, maxChars) {
|
|
2061
|
+
if (FORBIDDEN_FIELD_NAMES.has(name.toLowerCase().replace(/[-_.]/g, "")))
|
|
2062
|
+
return "[forbidden]";
|
|
2063
|
+
switch (typeof value) {
|
|
2064
|
+
case "string":
|
|
2065
|
+
return boundedString(value, maxChars);
|
|
2066
|
+
case "number":
|
|
2067
|
+
return Number.isFinite(value) ? value : String(value);
|
|
2068
|
+
case "boolean":
|
|
2069
|
+
return value;
|
|
2070
|
+
case "undefined":
|
|
2071
|
+
return;
|
|
2072
|
+
case "bigint":
|
|
2073
|
+
return value.toString();
|
|
2074
|
+
case "object":
|
|
2075
|
+
if (value === null)
|
|
2076
|
+
return null;
|
|
2077
|
+
if (isSafeLogError(value))
|
|
2078
|
+
return value;
|
|
2079
|
+
if (value instanceof Error)
|
|
2080
|
+
return formatLogError(value);
|
|
2081
|
+
return "[rejected:object]";
|
|
2082
|
+
default:
|
|
2083
|
+
return `[rejected:${typeof value}]`;
|
|
2084
|
+
}
|
|
2085
|
+
}
|
|
2086
|
+
function sanitizeFields(fields, maxChars) {
|
|
2087
|
+
const clean = {};
|
|
2088
|
+
let count = 0;
|
|
2089
|
+
let dropped = 0;
|
|
2090
|
+
for (const name of Object.keys(fields)) {
|
|
2091
|
+
const value = sanitizeValue(name, fields[name], maxChars);
|
|
2092
|
+
if (value === undefined)
|
|
2093
|
+
continue;
|
|
2094
|
+
if (count >= MAX_FIELDS || !FIELD_NAME_PATTERN.test(name)) {
|
|
2095
|
+
dropped += 1;
|
|
2096
|
+
continue;
|
|
2097
|
+
}
|
|
2098
|
+
clean[name] = value;
|
|
2099
|
+
count += 1;
|
|
2100
|
+
}
|
|
2101
|
+
if (dropped > 0)
|
|
2102
|
+
clean.droppedFields = dropped;
|
|
2103
|
+
return count > 0 || dropped > 0 ? clean : undefined;
|
|
2104
|
+
}
|
|
2105
|
+
function textValue(value) {
|
|
2106
|
+
if (typeof value !== "string")
|
|
2107
|
+
return String(value);
|
|
2108
|
+
return BARE_TEXT_VALUE.test(value) ? value : JSON.stringify(value);
|
|
2109
|
+
}
|
|
2110
|
+
function appendTextField(parts, name, value) {
|
|
2111
|
+
if (typeof value !== "object" || value === null) {
|
|
2112
|
+
parts.push(`${name}=${textValue(value)}`);
|
|
2113
|
+
return;
|
|
2114
|
+
}
|
|
2115
|
+
for (const key of Object.keys(value)) {
|
|
2116
|
+
const entry = value[key];
|
|
2117
|
+
if (entry === undefined)
|
|
2118
|
+
continue;
|
|
2119
|
+
if (key === "cause")
|
|
2120
|
+
appendTextField(parts, `${name}.cause`, entry);
|
|
2121
|
+
else if (key === "stack")
|
|
2122
|
+
parts.push(`${name}.stack=${textValue(entry.join(" | "))}`);
|
|
2123
|
+
else
|
|
2124
|
+
parts.push(`${name}.${key}=${textValue(entry)}`);
|
|
2125
|
+
}
|
|
2126
|
+
}
|
|
2127
|
+
function escapeLogLine(line) {
|
|
2128
|
+
return line.replace(/[\u007f-\u009f\u2028\u2029]/g, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
2129
|
+
}
|
|
2130
|
+
function renderText(record) {
|
|
2131
|
+
const tag = areaSpec(record.area)?.tag ?? record.area;
|
|
2132
|
+
const parts = [`[${tag}]`, record.event];
|
|
2133
|
+
if (record.fields) {
|
|
2134
|
+
for (const name of Object.keys(record.fields))
|
|
2135
|
+
appendTextField(parts, name, record.fields[name]);
|
|
2136
|
+
}
|
|
2137
|
+
return escapeLogLine(parts.join(" "));
|
|
2138
|
+
}
|
|
2139
|
+
function renderJson(record) {
|
|
2140
|
+
return escapeLogLine(JSON.stringify(record));
|
|
2141
|
+
}
|
|
2142
|
+
function deliver(record) {
|
|
2143
|
+
try {
|
|
2144
|
+
config.sink({
|
|
2145
|
+
method: OUTPUT_METHOD[record.level],
|
|
2146
|
+
line: config.format === "json" ? renderJson(record) : renderText(record),
|
|
2147
|
+
record
|
|
2148
|
+
});
|
|
2149
|
+
return true;
|
|
2150
|
+
} catch {
|
|
2151
|
+
return false;
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
function buildRecord(level, area, event, fields) {
|
|
2155
|
+
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
2156
|
+
return {
|
|
2157
|
+
orklog: 1,
|
|
2158
|
+
ts: new Date().toISOString(),
|
|
2159
|
+
level,
|
|
2160
|
+
area,
|
|
2161
|
+
event,
|
|
2162
|
+
...clean ? { fields: clean } : {}
|
|
2163
|
+
};
|
|
2164
|
+
}
|
|
2165
|
+
var LOG_THROTTLE_WINDOW_MS = 60000;
|
|
2166
|
+
var LOG_THROTTLE_MAX_KEYS = 512;
|
|
2167
|
+
var LOG_THROTTLE_IDLE_MS = 5 * LOG_THROTTLE_WINDOW_MS;
|
|
2168
|
+
var throttledSites = new Map;
|
|
2169
|
+
var throttledKeyCount = 0;
|
|
2170
|
+
var throttleRecency = 0;
|
|
2171
|
+
var throttleGeneration = generation;
|
|
2172
|
+
var nextThrottleFlushAt = 0;
|
|
2173
|
+
function writeThrottleLine(site, event, fields) {
|
|
2174
|
+
const spec = areaSpec(site.area);
|
|
2175
|
+
if (!spec)
|
|
2176
|
+
return;
|
|
2177
|
+
const listed = Object.hasOwn(spec.events, event);
|
|
2178
|
+
const line = { site: site.event, ...site.scope === undefined ? {} : { scope: site.scope } };
|
|
2179
|
+
deliver(buildRecord(site.level, site.area, listed ? event : "invalid-event", listed ? { ...line, ...fields } : undefined));
|
|
2180
|
+
}
|
|
2181
|
+
function syncThrottleLevels() {
|
|
2182
|
+
if (throttleGeneration === generation)
|
|
2183
|
+
return;
|
|
2184
|
+
throttleGeneration = generation;
|
|
2185
|
+
for (const [siteKey, site] of Array.from(throttledSites)) {
|
|
2186
|
+
if (LEVEL_RANK[site.level] <= thresholdRank(site.area))
|
|
2187
|
+
continue;
|
|
2188
|
+
throttledSites.delete(siteKey);
|
|
2189
|
+
throttledKeyCount -= site.keys.size;
|
|
2190
|
+
}
|
|
2191
|
+
}
|
|
2192
|
+
function rollThrottleWindow(site, kind, key, now) {
|
|
2193
|
+
const elapsed = now - key.windowStart;
|
|
2194
|
+
if (elapsed >= 0 && elapsed < LOG_THROTTLE_WINDOW_MS)
|
|
2195
|
+
return;
|
|
2196
|
+
if (key.pending > 0) {
|
|
2197
|
+
writeThrottleLine(site, "throttle.suppressed", {
|
|
2198
|
+
kind,
|
|
2199
|
+
suppressed: key.pending,
|
|
2200
|
+
windowSeconds: Math.max(0, Math.round(elapsed / 1000))
|
|
2201
|
+
});
|
|
2202
|
+
}
|
|
2203
|
+
key.pending = 0;
|
|
2204
|
+
key.windowStart = now;
|
|
2205
|
+
}
|
|
2206
|
+
function flushDueThrottleWindows(now) {
|
|
2207
|
+
if (now < nextThrottleFlushAt && nextThrottleFlushAt - now <= LOG_THROTTLE_WINDOW_MS)
|
|
2208
|
+
return;
|
|
2209
|
+
nextThrottleFlushAt = now + LOG_THROTTLE_WINDOW_MS;
|
|
2210
|
+
for (const site of throttledSites.values()) {
|
|
2211
|
+
for (const [kind, key] of site.keys)
|
|
2212
|
+
rollThrottleWindow(site, kind, key, now);
|
|
2213
|
+
}
|
|
2214
|
+
}
|
|
2215
|
+
function evictOldestThrottleKey() {
|
|
2216
|
+
let oldest;
|
|
2217
|
+
for (const [siteKey, site] of throttledSites) {
|
|
2218
|
+
for (const [kind, key] of site.keys) {
|
|
2219
|
+
if (!oldest || key.recency < oldest.key.recency)
|
|
2220
|
+
oldest = { siteKey, site, kind, key };
|
|
2221
|
+
}
|
|
2222
|
+
}
|
|
2223
|
+
if (!oldest)
|
|
2224
|
+
return;
|
|
2225
|
+
const { siteKey, site, kind, key } = oldest;
|
|
2226
|
+
writeThrottleLine(site, "throttle.evicted", { kind, suppressed: key.pending });
|
|
2227
|
+
site.keys.delete(kind);
|
|
2228
|
+
throttledKeyCount -= 1;
|
|
2229
|
+
if (site.keys.size === 0)
|
|
2230
|
+
throttledSites.delete(siteKey);
|
|
2231
|
+
}
|
|
2232
|
+
function throttleSiteKey(area, event, scope) {
|
|
2233
|
+
return `${area}\x00${event}\x00${scope ?? ""}`;
|
|
2234
|
+
}
|
|
2235
|
+
function noteThrottledFailure(area, level, event, scope, kind) {
|
|
2236
|
+
const now = Date.now();
|
|
2237
|
+
flushDueThrottleWindows(now);
|
|
2238
|
+
const siteKey = throttleSiteKey(area, event, scope);
|
|
2239
|
+
let site = throttledSites.get(siteKey);
|
|
2240
|
+
let known = site?.keys.get(kind);
|
|
2241
|
+
if (known && now - known.lastFailureAt >= LOG_THROTTLE_IDLE_MS) {
|
|
2242
|
+
site.keys.delete(kind);
|
|
2243
|
+
throttledKeyCount -= 1;
|
|
2244
|
+
if (site.keys.size === 0) {
|
|
2245
|
+
throttledSites.delete(siteKey);
|
|
2246
|
+
site = undefined;
|
|
2247
|
+
}
|
|
2248
|
+
known = undefined;
|
|
2249
|
+
}
|
|
2250
|
+
if (!known && throttledKeyCount >= LOG_THROTTLE_MAX_KEYS) {
|
|
2251
|
+
evictOldestThrottleKey();
|
|
2252
|
+
site = throttledSites.get(siteKey);
|
|
2253
|
+
}
|
|
2254
|
+
site ??= { area, event, scope, level, since: now, failures: 0, keys: new Map };
|
|
2255
|
+
site.level = level;
|
|
2256
|
+
site.failures += 1;
|
|
2257
|
+
throttledSites.delete(siteKey);
|
|
2258
|
+
throttledSites.set(siteKey, site);
|
|
2259
|
+
if (known) {
|
|
2260
|
+
rollThrottleWindow(site, kind, known, now);
|
|
2261
|
+
known.pending += 1;
|
|
2262
|
+
known.lastFailureAt = now;
|
|
2263
|
+
known.recency = ++throttleRecency;
|
|
2264
|
+
site.keys.delete(kind);
|
|
2265
|
+
site.keys.set(kind, known);
|
|
2266
|
+
return false;
|
|
2267
|
+
}
|
|
2268
|
+
site.keys.set(kind, {
|
|
2269
|
+
pending: 0,
|
|
2270
|
+
windowStart: now,
|
|
2271
|
+
lastFailureAt: now,
|
|
2272
|
+
recency: ++throttleRecency
|
|
2273
|
+
});
|
|
2274
|
+
throttledKeyCount += 1;
|
|
2275
|
+
return true;
|
|
2276
|
+
}
|
|
2277
|
+
function noteThrottledSuccess(area, event, scope) {
|
|
2278
|
+
const now = Date.now();
|
|
2279
|
+
flushDueThrottleWindows(now);
|
|
2280
|
+
const siteKey = throttleSiteKey(area, event, scope);
|
|
2281
|
+
const site = throttledSites.get(siteKey);
|
|
2282
|
+
if (!site)
|
|
2283
|
+
return;
|
|
2284
|
+
throttledSites.delete(siteKey);
|
|
2285
|
+
throttledKeyCount -= site.keys.size;
|
|
2286
|
+
let suppressed = 0;
|
|
2287
|
+
for (const key of site.keys.values())
|
|
2288
|
+
suppressed += key.pending;
|
|
2289
|
+
writeThrottleLine(site, "throttle.recovered", {
|
|
2290
|
+
failures: site.failures,
|
|
2291
|
+
kinds: site.keys.size,
|
|
2292
|
+
suppressed,
|
|
2293
|
+
faultSeconds: Math.max(0, Math.round((now - site.since) / 1000))
|
|
2294
|
+
});
|
|
2295
|
+
}
|
|
2296
|
+
function throttleKind(options) {
|
|
2297
|
+
if (options.kind === undefined)
|
|
2298
|
+
return logErrorKind(options.error);
|
|
2299
|
+
return THROTTLE_KIND_PATTERN.test(options.kind) ? options.kind : "invalid-kind";
|
|
2300
|
+
}
|
|
2301
|
+
function resolveFields(fields) {
|
|
2302
|
+
try {
|
|
2303
|
+
return typeof fields === "function" ? fields() : fields;
|
|
2304
|
+
} catch {
|
|
2305
|
+
return { fieldsFailed: true };
|
|
2306
|
+
}
|
|
2307
|
+
}
|
|
2308
|
+
function deliverEvent(level, area, event, fields) {
|
|
2309
|
+
const spec = areaSpec(area);
|
|
2310
|
+
if (!spec)
|
|
2311
|
+
return deliver(buildRecord(level, "logging", "unknown-area", undefined));
|
|
2312
|
+
if (!Object.hasOwn(spec.events, event))
|
|
2313
|
+
return deliver(buildRecord(level, area, "invalid-event", undefined));
|
|
2314
|
+
return deliver(buildRecord(level, area, event, fields));
|
|
2315
|
+
}
|
|
2316
|
+
function tryWriteLog(level, area, event, fields) {
|
|
2317
|
+
if (LEVEL_RANK[level] > thresholdRank(area))
|
|
2318
|
+
return false;
|
|
2319
|
+
return deliverEvent(level, area, event, resolveFields(fields));
|
|
2320
|
+
}
|
|
2321
|
+
function createLogger(area) {
|
|
2322
|
+
const spec = areaSpec(area);
|
|
2323
|
+
let seenGeneration = -1;
|
|
2324
|
+
let rank = 0;
|
|
2325
|
+
const enabled = (level) => {
|
|
2326
|
+
if (seenGeneration !== generation) {
|
|
2327
|
+
seenGeneration = generation;
|
|
2328
|
+
rank = thresholdRank(area);
|
|
2329
|
+
}
|
|
2330
|
+
return LEVEL_RANK[level] <= rank;
|
|
2331
|
+
};
|
|
2332
|
+
const writeResolved = (level, event, resolved) => {
|
|
2333
|
+
deliverEvent(level, area, event, resolved);
|
|
2334
|
+
};
|
|
2335
|
+
const write = (level, event, fields) => {
|
|
2336
|
+
if (!enabled(level))
|
|
2337
|
+
return;
|
|
2338
|
+
writeResolved(level, event, resolveFields(fields));
|
|
2339
|
+
};
|
|
2340
|
+
return {
|
|
2341
|
+
error: (event, fields) => write("error", event, fields),
|
|
2342
|
+
warn: (event, fields) => write("warn", event, fields),
|
|
2343
|
+
info: (event, fields) => write("info", event, fields),
|
|
2344
|
+
debug: (event, fields) => write("debug", event, fields),
|
|
2345
|
+
trace: (event, fields) => write("trace", event, fields),
|
|
2346
|
+
throttled: (level, event, options) => {
|
|
2347
|
+
syncThrottleLevels();
|
|
2348
|
+
if (!enabled(level))
|
|
2349
|
+
return;
|
|
2350
|
+
if (!spec || !Object.hasOwn(spec.events, event) || event.startsWith("throttle.") || !Object.hasOwn(spec.events, "throttle.recovered")) {
|
|
2351
|
+
deliver(buildRecord(level, spec ? area : "logging", spec ? "invalid-event" : "unknown-area", undefined));
|
|
2352
|
+
return;
|
|
2353
|
+
}
|
|
2354
|
+
const kind = throttleKind(options);
|
|
2355
|
+
const scope = options.scope?.slice(0, MAX_THROTTLE_SCOPE_CHARS);
|
|
2356
|
+
if (!noteThrottledFailure(area, level, event, scope, kind))
|
|
2357
|
+
return;
|
|
2358
|
+
writeResolved(level, event, {
|
|
2359
|
+
...scope === undefined ? {} : { scope },
|
|
2360
|
+
kind,
|
|
2361
|
+
...resolveFields(options.fields)
|
|
2362
|
+
});
|
|
2363
|
+
},
|
|
2364
|
+
recovered: (event, scope) => {
|
|
2365
|
+
syncThrottleLevels();
|
|
2366
|
+
if (throttledKeyCount === 0)
|
|
2367
|
+
return;
|
|
2368
|
+
noteThrottledSuccess(area, event, scope?.slice(0, MAX_THROTTLE_SCOPE_CHARS));
|
|
2369
|
+
},
|
|
2370
|
+
isEnabled: enabled
|
|
2371
|
+
};
|
|
2372
|
+
}
|
|
2373
|
+
|
|
2374
|
+
// ../protocol/src/event-loop-stall-monitor.ts
|
|
2375
|
+
var log = createLogger("event-loop");
|
|
2376
|
+
var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
|
|
2377
|
+
|
|
2378
|
+
// ../protocol/src/node/bridge-diagnostics.ts
|
|
2379
|
+
var log2 = createLogger("bridge.diagnostics");
|
|
2380
|
+
var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
|
|
2381
|
+
var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
|
|
2382
|
+
var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
|
|
2383
|
+
var STALL_TOOL_PENDING_MS = 10 * 60000;
|
|
2384
|
+
var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
|
|
2385
|
+
var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
|
|
4
2386
|
var MAX_PENDING_TOOLS = 128;
|
|
5
2387
|
var MAX_REPORTED_TOOLS = 8;
|
|
6
2388
|
var MAX_ID_LENGTH = 1024;
|
|
@@ -61,6 +2443,28 @@ var UPDATE_KINDS = new Set([
|
|
|
61
2443
|
"step-started",
|
|
62
2444
|
"step-completed"
|
|
63
2445
|
]);
|
|
2446
|
+
var COUNTER_CHANGE_THRESHOLDS = {
|
|
2447
|
+
stderrBytes: 4096,
|
|
2448
|
+
requestsSent: 1,
|
|
2449
|
+
responsesReceived: 1,
|
|
2450
|
+
timeouts: 1,
|
|
2451
|
+
notificationsReceived: Number.POSITIVE_INFINITY,
|
|
2452
|
+
protocolErrors: 1
|
|
2453
|
+
};
|
|
2454
|
+
var WAITING_PHASES = new Set([
|
|
2455
|
+
"sending",
|
|
2456
|
+
"following",
|
|
2457
|
+
"draining",
|
|
2458
|
+
"cancelling"
|
|
2459
|
+
]);
|
|
2460
|
+
function sameSet(a, b) {
|
|
2461
|
+
if (a.size !== b.size)
|
|
2462
|
+
return false;
|
|
2463
|
+
for (const value of a)
|
|
2464
|
+
if (!b.has(value))
|
|
2465
|
+
return false;
|
|
2466
|
+
return true;
|
|
2467
|
+
}
|
|
64
2468
|
function identity(value) {
|
|
65
2469
|
if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
|
|
66
2470
|
return;
|
|
@@ -69,7 +2473,16 @@ function identity(value) {
|
|
|
69
2473
|
function readBridgeDebugFlag(value) {
|
|
70
2474
|
return value?.trim() === "1";
|
|
71
2475
|
}
|
|
2476
|
+
var liveDiagnostics;
|
|
2477
|
+
var liveScopes = new Set;
|
|
2478
|
+
function setLiveBridgeDiagnostics(enabled) {
|
|
2479
|
+
liveDiagnostics = enabled;
|
|
2480
|
+
for (const scope of Array.from(liveScopes))
|
|
2481
|
+
scope.syncActive();
|
|
2482
|
+
}
|
|
72
2483
|
function bridgeDebugEnabled(bridge, env = process.env) {
|
|
2484
|
+
if (liveDiagnostics !== undefined && env === process.env)
|
|
2485
|
+
return liveDiagnostics;
|
|
73
2486
|
const value = env.ORKESTRATOR_BRIDGE_DEBUG ?? env[`${bridge.toUpperCase()}_BRIDGE_DEBUG`];
|
|
74
2487
|
return readBridgeDebugFlag(value);
|
|
75
2488
|
}
|
|
@@ -127,18 +2540,35 @@ function safeDiagnosticMetrics(value) {
|
|
|
127
2540
|
result.state = value.state;
|
|
128
2541
|
return result;
|
|
129
2542
|
}
|
|
130
|
-
|
|
131
|
-
|
|
2543
|
+
function bridgeDiagnosticsChangesEnabled() {
|
|
2544
|
+
return log2.isEnabled("trace");
|
|
2545
|
+
}
|
|
2546
|
+
function writeBridgeDiagnostic({ bridge, event, payload }) {
|
|
2547
|
+
return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
|
|
2548
|
+
}
|
|
2549
|
+
function bridgeDiagnosticsActive() {
|
|
2550
|
+
return log2.isEnabled("info");
|
|
2551
|
+
}
|
|
2552
|
+
function bridgeDiagnosticsStreamEnabled(bridge) {
|
|
2553
|
+
return bridgeDebugEnabled(bridge) || log2.isEnabled("debug");
|
|
2554
|
+
}
|
|
2555
|
+
function writeDiagnostic(bridge, event, payload, write) {
|
|
132
2556
|
try {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
2557
|
+
const json = JSON.stringify({ bridge, event, ...payload });
|
|
2558
|
+
const bytes = Buffer.byteLength(json);
|
|
2559
|
+
if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
|
|
2560
|
+
const accepted = write({ bridge, event, payload: json });
|
|
2561
|
+
return accepted !== false;
|
|
2562
|
+
}
|
|
2563
|
+
const accepted = write({
|
|
2564
|
+
bridge,
|
|
2565
|
+
event: "snapshot-overflow",
|
|
2566
|
+
payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
|
|
2567
|
+
});
|
|
2568
|
+
return accepted !== false;
|
|
2569
|
+
} catch {
|
|
2570
|
+
return false;
|
|
2571
|
+
}
|
|
142
2572
|
}
|
|
143
2573
|
|
|
144
2574
|
class BridgeRunDiagnostics {
|
|
@@ -148,6 +2578,7 @@ class BridgeRunDiagnostics {
|
|
|
148
2578
|
write;
|
|
149
2579
|
intervalMs;
|
|
150
2580
|
metrics;
|
|
2581
|
+
active;
|
|
151
2582
|
counters = {
|
|
152
2583
|
stderrBytes: 0,
|
|
153
2584
|
requestsSent: 0,
|
|
@@ -169,25 +2600,38 @@ class BridgeRunDiagnostics {
|
|
|
169
2600
|
completedTools = 0;
|
|
170
2601
|
pending = new Map;
|
|
171
2602
|
phase = "sending";
|
|
2603
|
+
processScope = false;
|
|
172
2604
|
terminal = "pending";
|
|
173
2605
|
stream = "pending";
|
|
174
2606
|
cancellation = "none";
|
|
175
2607
|
cancelReason;
|
|
176
2608
|
run;
|
|
177
2609
|
closed = false;
|
|
2610
|
+
wasActive;
|
|
2611
|
+
baseline;
|
|
2612
|
+
changeQueued = false;
|
|
178
2613
|
timer;
|
|
179
|
-
constructor(bridge, state, now = Date.now, write =
|
|
2614
|
+
constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
|
|
180
2615
|
this.bridge = bridge;
|
|
181
2616
|
this.state = state;
|
|
182
2617
|
this.now = now;
|
|
183
2618
|
this.write = write;
|
|
184
2619
|
this.intervalMs = intervalMs;
|
|
185
2620
|
this.metrics = metrics;
|
|
2621
|
+
this.active = active;
|
|
186
2622
|
this.startedAt = this.lastTick = now();
|
|
2623
|
+
this.wasActive = active();
|
|
187
2624
|
this.timer = setInterval(() => this.report("heartbeat"), intervalMs);
|
|
188
2625
|
this.timer.unref();
|
|
2626
|
+
liveScopes.add(this);
|
|
189
2627
|
this.report("send-started");
|
|
190
2628
|
}
|
|
2629
|
+
syncActive() {
|
|
2630
|
+
const active = this.active();
|
|
2631
|
+
if (active && !this.wasActive)
|
|
2632
|
+
this.report("heartbeat");
|
|
2633
|
+
this.wasActive = active;
|
|
2634
|
+
}
|
|
191
2635
|
sent(runId) {
|
|
192
2636
|
this.run = identity(runId);
|
|
193
2637
|
this.phase = "following";
|
|
@@ -211,7 +2655,8 @@ class BridgeRunDiagnostics {
|
|
|
211
2655
|
return;
|
|
212
2656
|
}
|
|
213
2657
|
if (stage === "completed") {
|
|
214
|
-
this.pending.delete(key)
|
|
2658
|
+
if (this.pending.delete(key))
|
|
2659
|
+
this.changed();
|
|
215
2660
|
this.completedTools++;
|
|
216
2661
|
return;
|
|
217
2662
|
}
|
|
@@ -226,13 +2671,23 @@ class BridgeRunDiagnostics {
|
|
|
226
2671
|
stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
|
|
227
2672
|
nested
|
|
228
2673
|
});
|
|
2674
|
+
if (!existing)
|
|
2675
|
+
this.changed();
|
|
229
2676
|
}
|
|
230
2677
|
checkpoint(phase) {
|
|
2678
|
+
if (phase === "attached")
|
|
2679
|
+
this.processScope = true;
|
|
2680
|
+
if (phase === this.phase)
|
|
2681
|
+
return;
|
|
231
2682
|
this.phase = phase;
|
|
2683
|
+
this.changed();
|
|
232
2684
|
}
|
|
233
2685
|
count(key, amount = 1) {
|
|
234
|
-
if (
|
|
235
|
-
|
|
2686
|
+
if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
|
|
2687
|
+
return;
|
|
2688
|
+
this.counters[key] += amount;
|
|
2689
|
+
if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
|
|
2690
|
+
this.changed();
|
|
236
2691
|
}
|
|
237
2692
|
translationFailed() {
|
|
238
2693
|
this.translationFailures++;
|
|
@@ -248,8 +2703,10 @@ class BridgeRunDiagnostics {
|
|
|
248
2703
|
}
|
|
249
2704
|
terminalSettled(outcome) {
|
|
250
2705
|
this.terminal = outcome;
|
|
251
|
-
if (outcome === "resolved")
|
|
2706
|
+
if (outcome === "resolved" && this.phase !== "draining") {
|
|
252
2707
|
this.phase = "draining";
|
|
2708
|
+
this.changed();
|
|
2709
|
+
}
|
|
253
2710
|
}
|
|
254
2711
|
requestCancellation(reason = "user") {
|
|
255
2712
|
this.cancellation = "pending";
|
|
@@ -271,10 +2728,38 @@ class BridgeRunDiagnostics {
|
|
|
271
2728
|
if (this.closed)
|
|
272
2729
|
return;
|
|
273
2730
|
const now = this.now();
|
|
274
|
-
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
275
2731
|
const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
|
|
276
2732
|
if (event === "heartbeat")
|
|
277
2733
|
this.lastTick = now;
|
|
2734
|
+
if (!bridgeDiagnosticsActive())
|
|
2735
|
+
return;
|
|
2736
|
+
const stall = this.stallState(now, tickDelayMs);
|
|
2737
|
+
if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
|
|
2738
|
+
return;
|
|
2739
|
+
this.writeSnapshot(event, now, tickDelayMs, stall);
|
|
2740
|
+
}
|
|
2741
|
+
changed() {
|
|
2742
|
+
if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
|
|
2743
|
+
return;
|
|
2744
|
+
this.changeQueued = true;
|
|
2745
|
+
queueMicrotask(() => {
|
|
2746
|
+
this.changeQueued = false;
|
|
2747
|
+
this.reportChange();
|
|
2748
|
+
});
|
|
2749
|
+
}
|
|
2750
|
+
reportChange() {
|
|
2751
|
+
if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
|
|
2752
|
+
return;
|
|
2753
|
+
const last = this.baseline;
|
|
2754
|
+
if (last && !this.changedSince(last))
|
|
2755
|
+
return;
|
|
2756
|
+
const now = this.now();
|
|
2757
|
+
try {
|
|
2758
|
+
this.writeSnapshot("change", now, 0, this.stallState(now, 0));
|
|
2759
|
+
} catch {}
|
|
2760
|
+
}
|
|
2761
|
+
writeSnapshot(event, now, tickDelayMs, stall) {
|
|
2762
|
+
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
278
2763
|
const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
|
|
279
2764
|
id,
|
|
280
2765
|
kind: tool.kind,
|
|
@@ -283,8 +2768,7 @@ class BridgeRunDiagnostics {
|
|
|
283
2768
|
ageMs: age(tool.since)
|
|
284
2769
|
}));
|
|
285
2770
|
try {
|
|
286
|
-
writeDiagnostic(this.bridge, {
|
|
287
|
-
event,
|
|
2771
|
+
const written = writeDiagnostic(this.bridge, event, {
|
|
288
2772
|
session: identity(this.state.id),
|
|
289
2773
|
run: this.run,
|
|
290
2774
|
phase: this.phase,
|
|
@@ -311,21 +2795,79 @@ class BridgeRunDiagnostics {
|
|
|
311
2795
|
completedTools: this.completedTools,
|
|
312
2796
|
tickDelayMs
|
|
313
2797
|
}, this.write);
|
|
2798
|
+
if (!written)
|
|
2799
|
+
return;
|
|
2800
|
+
this.baseline = {
|
|
2801
|
+
at: now,
|
|
2802
|
+
phase: this.phase,
|
|
2803
|
+
pending: new Set(this.pending.keys()),
|
|
2804
|
+
counters: { ...this.counters },
|
|
2805
|
+
stall
|
|
2806
|
+
};
|
|
314
2807
|
} catch {}
|
|
315
2808
|
}
|
|
2809
|
+
periodicDue(now, stall) {
|
|
2810
|
+
if (stall.signals.has("tick-delay"))
|
|
2811
|
+
return true;
|
|
2812
|
+
const last = this.baseline;
|
|
2813
|
+
if (!last)
|
|
2814
|
+
return true;
|
|
2815
|
+
if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
|
|
2816
|
+
return true;
|
|
2817
|
+
if (stall.signals.has("no-delta") && this.changedSince(last))
|
|
2818
|
+
return true;
|
|
2819
|
+
return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
|
|
2820
|
+
}
|
|
2821
|
+
changedSince(last) {
|
|
2822
|
+
if (this.phase !== last.phase)
|
|
2823
|
+
return true;
|
|
2824
|
+
if (this.pending.size !== last.pending.size)
|
|
2825
|
+
return true;
|
|
2826
|
+
for (const key of this.pending.keys())
|
|
2827
|
+
if (!last.pending.has(key))
|
|
2828
|
+
return true;
|
|
2829
|
+
for (const key of Object.keys(this.counters))
|
|
2830
|
+
if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
|
|
2831
|
+
return true;
|
|
2832
|
+
return false;
|
|
2833
|
+
}
|
|
2834
|
+
stallState(now, tickDelayMs) {
|
|
2835
|
+
const signals = new Set;
|
|
2836
|
+
const tools = new Set;
|
|
2837
|
+
let oldestPending;
|
|
2838
|
+
for (const [key, tool] of this.pending) {
|
|
2839
|
+
if (oldestPending === undefined || tool.since < oldestPending)
|
|
2840
|
+
oldestPending = tool.since;
|
|
2841
|
+
if (now - tool.since >= STALL_TOOL_PENDING_MS)
|
|
2842
|
+
tools.add(key);
|
|
2843
|
+
}
|
|
2844
|
+
const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
|
|
2845
|
+
if (waitingSince !== undefined) {
|
|
2846
|
+
const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
|
|
2847
|
+
if (now - quietSince >= STALL_NO_DELTA_MS)
|
|
2848
|
+
signals.add("no-delta");
|
|
2849
|
+
}
|
|
2850
|
+
if (tools.size > 0)
|
|
2851
|
+
signals.add("tool-pending");
|
|
2852
|
+
if (tickDelayMs >= STALL_TICK_DELAY_MS)
|
|
2853
|
+
signals.add("tick-delay");
|
|
2854
|
+
return { signals, tools };
|
|
2855
|
+
}
|
|
316
2856
|
close(phase = "finished") {
|
|
317
2857
|
if (this.closed)
|
|
318
2858
|
return;
|
|
319
2859
|
this.phase = phase;
|
|
320
2860
|
this.report("closed");
|
|
321
2861
|
this.closed = true;
|
|
2862
|
+
liveScopes.delete(this);
|
|
322
2863
|
clearInterval(this.timer);
|
|
323
2864
|
this.pending.clear();
|
|
324
2865
|
}
|
|
325
2866
|
}
|
|
326
2867
|
function createBridgeDiagnostics(bridge, state, metrics) {
|
|
327
|
-
return
|
|
2868
|
+
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
|
|
328
2869
|
}
|
|
2870
|
+
var bufferedFlushes = new Set;
|
|
329
2871
|
|
|
330
2872
|
// ../../bridges/acp-bridge/src/acp-context.ts
|
|
331
2873
|
import { spawn as spawn2 } from "node:child_process";
|
|
@@ -1058,7 +3600,7 @@ class $ZodEncodeError extends Error {
|
|
|
1058
3600
|
}
|
|
1059
3601
|
(_a = globalThis).__zod_globalConfig ?? (_a.__zod_globalConfig = {});
|
|
1060
3602
|
var globalConfig = globalThis.__zod_globalConfig;
|
|
1061
|
-
function
|
|
3603
|
+
function config2(newConfig) {
|
|
1062
3604
|
if (newConfig)
|
|
1063
3605
|
Object.assign(globalConfig, newConfig);
|
|
1064
3606
|
return globalConfig;
|
|
@@ -1190,7 +3732,7 @@ var _parse = (_Err) => {
|
|
|
1190
3732
|
throw new $ZodAsyncError;
|
|
1191
3733
|
}
|
|
1192
3734
|
if (result.issues.length) {
|
|
1193
|
-
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
3735
|
+
const e = new (_params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config2())));
|
|
1194
3736
|
captureStackTrace(e, _params?.callee ?? fn);
|
|
1195
3737
|
throw e;
|
|
1196
3738
|
}
|
|
@@ -1205,7 +3747,7 @@ var _parseAsync = (_Err) => {
|
|
|
1205
3747
|
if (result instanceof Promise)
|
|
1206
3748
|
result = await result;
|
|
1207
3749
|
if (result.issues.length) {
|
|
1208
|
-
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
3750
|
+
const e = new (params?.Err ?? _Err)(result.issues.map((iss) => finalizeIssue(iss, ctx, config2())));
|
|
1209
3751
|
captureStackTrace(e, params?.callee ?? fn);
|
|
1210
3752
|
throw e;
|
|
1211
3753
|
}
|
|
@@ -1227,7 +3769,7 @@ function failure(Err, issues, ctx) {
|
|
|
1227
3769
|
success: false,
|
|
1228
3770
|
get error() {
|
|
1229
3771
|
if (!error) {
|
|
1230
|
-
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx,
|
|
3772
|
+
error = new Err(issues.map((iss) => finalizeIssue(iss, ctx, config2())));
|
|
1231
3773
|
issues = undefined;
|
|
1232
3774
|
ctx = undefined;
|
|
1233
3775
|
}
|
|
@@ -1857,7 +4399,7 @@ var $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
1857
4399
|
own(this, "~standard", value);
|
|
1858
4400
|
}
|
|
1859
4401
|
});
|
|
1860
|
-
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
4402
|
+
var toStandardResult = (r, ctx) => r.issues.length ? { issues: r.issues.map((iss) => finalizeIssue(iss, ctx, config2())) } : { value: r.value };
|
|
1861
4403
|
async function validateAsync2(inst, value) {
|
|
1862
4404
|
const ctx = { async: true };
|
|
1863
4405
|
return toStandardResult(await inst._zod.run({ value, issues: [] }, ctx), ctx);
|
|
@@ -2685,7 +5227,7 @@ function handleUnionResults(results, final, inst, ctx) {
|
|
|
2685
5227
|
code: "invalid_union",
|
|
2686
5228
|
input: final.value,
|
|
2687
5229
|
inst,
|
|
2688
|
-
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
5230
|
+
errors: results.map((result) => result.issues.map((iss) => finalizeIssue(iss, ctx, config2())))
|
|
2689
5231
|
});
|
|
2690
5232
|
return final;
|
|
2691
5233
|
}
|
|
@@ -2881,7 +5423,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2881
5423
|
payload.issues.push({
|
|
2882
5424
|
code: "invalid_key",
|
|
2883
5425
|
origin: "record",
|
|
2884
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
5426
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config2())),
|
|
2885
5427
|
input: key,
|
|
2886
5428
|
path: [key],
|
|
2887
5429
|
inst
|
|
@@ -2961,7 +5503,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
|
|
|
2961
5503
|
payload.issues.push({
|
|
2962
5504
|
code: "invalid_key",
|
|
2963
5505
|
origin: "record",
|
|
2964
|
-
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
5506
|
+
issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config2())),
|
|
2965
5507
|
input: key,
|
|
2966
5508
|
path: [key],
|
|
2967
5509
|
inst
|
|
@@ -3199,7 +5741,7 @@ function handleCatchResult(payload, result, def, ctx) {
|
|
|
3199
5741
|
...result,
|
|
3200
5742
|
value: payload.value,
|
|
3201
5743
|
error: {
|
|
3202
|
-
issues: result.issues.map((iss) => finalizeIssue(iss, ctx,
|
|
5744
|
+
issues: result.issues.map((iss) => finalizeIssue(iss, ctx, config2()))
|
|
3203
5745
|
},
|
|
3204
5746
|
input: payload.value
|
|
3205
5747
|
});
|
|
@@ -5300,11 +7842,11 @@ var safeDecodeAsync = /* @__PURE__ */ _safeDecodeAsync(ZodRealError);
|
|
|
5300
7842
|
// ../../node_modules/.bun/zod@4.6.7/node_modules/zod/v4/classic/schemas.js
|
|
5301
7843
|
function _ensureDefaultLocale() {
|
|
5302
7844
|
if (!globalConfig.localeError)
|
|
5303
|
-
|
|
7845
|
+
config2(en_default());
|
|
5304
7846
|
}
|
|
5305
7847
|
function _ensureDefaultMemoizer() {
|
|
5306
7848
|
if (!globalConfig.memoizer)
|
|
5307
|
-
|
|
7849
|
+
config2({ memoizer: memoizer() });
|
|
5308
7850
|
}
|
|
5309
7851
|
var ZodType = /* @__PURE__ */ $constructor("ZodType", (inst, def) => {
|
|
5310
7852
|
_ensureDefaultLocale();
|
|
@@ -8156,6 +10698,7 @@ var AGENT_INTERACTION_LIMITS = Object.freeze({
|
|
|
8156
10698
|
maxSerializedPayloadBytes: 256 * 1024,
|
|
8157
10699
|
maxIdLength: 512,
|
|
8158
10700
|
maxProviderValueLength: 4096,
|
|
10701
|
+
maxSourceNameLength: 256,
|
|
8159
10702
|
maxJournalEntries: 512,
|
|
8160
10703
|
maxWorkflowSummaries: 64
|
|
8161
10704
|
});
|
|
@@ -8223,6 +10766,19 @@ var LIMITED_HOLD_REASONS = new Set([
|
|
|
8223
10766
|
"provider-limit",
|
|
8224
10767
|
"upstream-may-expire"
|
|
8225
10768
|
]);
|
|
10769
|
+
var AGENT_INTERACTION_SOURCE_KINDS = ["mcp-server"];
|
|
10770
|
+
var SOURCE_SCOPE_LABELS = Object.freeze({
|
|
10771
|
+
user: "user settings",
|
|
10772
|
+
project: "project settings",
|
|
10773
|
+
local: "local settings",
|
|
10774
|
+
dynamic: "session settings",
|
|
10775
|
+
plugin: "a plugin",
|
|
10776
|
+
managed: "managed settings",
|
|
10777
|
+
enterprise: "enterprise settings",
|
|
10778
|
+
claudeai: "a claude.ai connector",
|
|
10779
|
+
agent: "an agent definition",
|
|
10780
|
+
sdk: "the agent host"
|
|
10781
|
+
});
|
|
8226
10782
|
var UNATTENDED_POLICY_INSTRUCTION = "This is a non-interactive build session: no user can answer a provider input request. " + "If input is unavailable or declined, choose the safest likely assumption yourself, " + "state that assumption, and continue. Never treat the absence of a person as authorization.";
|
|
8227
10783
|
var INTERACTIVE_AGENT_INTERACTION_POLICY = Object.freeze({
|
|
8228
10784
|
version: AGENT_INTERACTION_POLICY_VERSION,
|
|
@@ -8298,8 +10854,11 @@ var REQUEST_KEYS = new Set([
|
|
|
8298
10854
|
"createdAt",
|
|
8299
10855
|
"updatedAt",
|
|
8300
10856
|
"expiresAt",
|
|
8301
|
-
"hold"
|
|
10857
|
+
"hold",
|
|
10858
|
+
"source"
|
|
8302
10859
|
]);
|
|
10860
|
+
var SOURCE_KEYS = new Set(["kind", "name", "scope"]);
|
|
10861
|
+
var SOURCE_KINDS = new Set(AGENT_INTERACTION_SOURCE_KINDS);
|
|
8303
10862
|
var HOLD_KEYS = new Set(["available", "heldAt", "reason"]);
|
|
8304
10863
|
var HOLD_REASONS = new Set(AGENT_INTERACTION_HOLD_REASONS);
|
|
8305
10864
|
var PRESENTATION_KEYS = new Set([
|
|
@@ -10966,19 +13525,108 @@ var WEB_ANNOTATION_BLOCKED_REASON_LABELS = Object.freeze({
|
|
|
10966
13525
|
// ../../bridges/acp-bridge/src/acp-tools.ts
|
|
10967
13526
|
import { createHash as createHash4 } from "node:crypto";
|
|
10968
13527
|
|
|
10969
|
-
// ../protocol/src/node/transcript-
|
|
13528
|
+
// ../protocol/src/node/bridge-transcript-text.ts
|
|
10970
13529
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
13530
|
+
function sliceUtf8(value, maximumBytes) {
|
|
13531
|
+
if (maximumBytes <= 0)
|
|
13532
|
+
return "";
|
|
13533
|
+
const buffer = Buffer2.from(value);
|
|
13534
|
+
if (buffer.length <= maximumBytes)
|
|
13535
|
+
return value;
|
|
13536
|
+
let end = maximumBytes;
|
|
13537
|
+
while (end > 0 && (buffer[end] & 192) === 128)
|
|
13538
|
+
end -= 1;
|
|
13539
|
+
return buffer.subarray(0, end).toString("utf8");
|
|
13540
|
+
}
|
|
13541
|
+
function boundUtf8Text(value, maximumBytes, notice) {
|
|
13542
|
+
if (Buffer2.byteLength(value) <= maximumBytes)
|
|
13543
|
+
return value;
|
|
13544
|
+
const available = Math.max(0, maximumBytes - Buffer2.byteLength(notice));
|
|
13545
|
+
return sliceUtf8(value, available) + notice;
|
|
13546
|
+
}
|
|
13547
|
+
|
|
13548
|
+
class BoundedTextAppender {
|
|
13549
|
+
notice;
|
|
13550
|
+
policy;
|
|
13551
|
+
saturated;
|
|
13552
|
+
#noticeBytes;
|
|
13553
|
+
#lengths = new WeakMap;
|
|
13554
|
+
constructor(options) {
|
|
13555
|
+
this.notice = options.notice;
|
|
13556
|
+
this.policy = options.policy;
|
|
13557
|
+
this.saturated = options.saturated ?? new WeakSet;
|
|
13558
|
+
this.#noticeBytes = Buffer2.byteLength(options.notice);
|
|
13559
|
+
}
|
|
13560
|
+
append(current, addition, maximumBytes, owner, saturate = true) {
|
|
13561
|
+
if (owner && saturate && this.saturated.has(owner))
|
|
13562
|
+
return { value: current, truncated: true };
|
|
13563
|
+
if (!addition)
|
|
13564
|
+
return { value: current, truncated: false };
|
|
13565
|
+
const currentBytes = this.byteLength(current, owner);
|
|
13566
|
+
const additionBytes = Buffer2.byteLength(addition);
|
|
13567
|
+
if (currentBytes + additionBytes <= maximumBytes) {
|
|
13568
|
+
const value = current + addition;
|
|
13569
|
+
if (owner) {
|
|
13570
|
+
this.#lengths.set(owner, {
|
|
13571
|
+
value,
|
|
13572
|
+
bytes: concatenatedBytes(current, currentBytes, addition, additionBytes)
|
|
13573
|
+
});
|
|
13574
|
+
}
|
|
13575
|
+
return { value, truncated: false };
|
|
13576
|
+
}
|
|
13577
|
+
if (owner) {
|
|
13578
|
+
this.#lengths.delete(owner);
|
|
13579
|
+
if (saturate)
|
|
13580
|
+
this.saturated.add(owner);
|
|
13581
|
+
}
|
|
13582
|
+
if (this.policy === "append-notice") {
|
|
13583
|
+
const available = maximumBytes - currentBytes - this.#noticeBytes;
|
|
13584
|
+
if (available <= 0) {
|
|
13585
|
+
const value = current.endsWith(this.notice) ? current : current + this.notice;
|
|
13586
|
+
return { value, truncated: true };
|
|
13587
|
+
}
|
|
13588
|
+
return { value: current + sliceUtf8(addition, available) + this.notice, truncated: true };
|
|
13589
|
+
}
|
|
13590
|
+
const contentLimit = Math.max(0, maximumBytes - this.#noticeBytes);
|
|
13591
|
+
const prefix = currentBytes <= contentLimit ? current : sliceUtf8(current, contentLimit);
|
|
13592
|
+
const prefixBytes = prefix === current ? currentBytes : Buffer2.byteLength(prefix);
|
|
13593
|
+
const usable = Math.max(0, contentLimit - prefixBytes);
|
|
13594
|
+
return {
|
|
13595
|
+
value: prefix + sliceUtf8(addition, usable) + sliceUtf8(this.notice, maximumBytes),
|
|
13596
|
+
truncated: true
|
|
13597
|
+
};
|
|
13598
|
+
}
|
|
13599
|
+
byteLength(value, owner) {
|
|
13600
|
+
const known = owner ? this.#lengths.get(owner) : undefined;
|
|
13601
|
+
if (known && known.value === value)
|
|
13602
|
+
return known.bytes;
|
|
13603
|
+
return Buffer2.byteLength(value);
|
|
13604
|
+
}
|
|
13605
|
+
}
|
|
13606
|
+
function concatenatedBytes(left, leftBytes, right, rightBytes) {
|
|
13607
|
+
const high = left.charCodeAt(left.length - 1);
|
|
13608
|
+
const low = right.charCodeAt(0);
|
|
13609
|
+
const splitPair = high >= 55296 && high <= 56319 && low >= 56320 && low <= 57343;
|
|
13610
|
+
return leftBytes + rightBytes - (splitPair ? 2 : 0);
|
|
13611
|
+
}
|
|
13612
|
+
|
|
13613
|
+
// ../protocol/src/node/transcript-budget.ts
|
|
13614
|
+
import { Buffer as Buffer3 } from "node:buffer";
|
|
10971
13615
|
function encodedJsonBytes(value) {
|
|
10972
13616
|
const json = JSON.stringify(value);
|
|
10973
|
-
return json === undefined ? 0 :
|
|
13617
|
+
return json === undefined ? 0 : Buffer3.byteLength(json);
|
|
10974
13618
|
}
|
|
10975
13619
|
function jsonArrayBytes(count, total) {
|
|
10976
13620
|
return 2 + total + Math.max(0, count - 1);
|
|
10977
13621
|
}
|
|
10978
13622
|
function planOldestFirstTrim(messages, maximumBytes, options = {}) {
|
|
10979
13623
|
const measure = options.measure ?? encodedJsonBytes;
|
|
10980
|
-
const
|
|
10981
|
-
|
|
13624
|
+
const known = options.messageSizes;
|
|
13625
|
+
if (known && known.length !== messages.length) {
|
|
13626
|
+
throw new Error("planOldestFirstTrim: messageSizes must describe every message");
|
|
13627
|
+
}
|
|
13628
|
+
const sizes = known ? known.slice() : messages.map((message) => measure(message));
|
|
13629
|
+
let measuredValues = known ? 0 : sizes.length;
|
|
10982
13630
|
let total = sizes.reduce((sum, size) => sum + size, 0);
|
|
10983
13631
|
let count = messages.length;
|
|
10984
13632
|
let bytes = jsonArrayBytes(count, total);
|
|
@@ -11024,6 +13672,131 @@ function planOldestFirstTrim(messages, maximumBytes, options = {}) {
|
|
|
11024
13672
|
measuredValues
|
|
11025
13673
|
};
|
|
11026
13674
|
}
|
|
13675
|
+
function jsonStringContentBytes(value) {
|
|
13676
|
+
return value ? Buffer3.byteLength(JSON.stringify(value)) - 2 : 0;
|
|
13677
|
+
}
|
|
13678
|
+
var VERIFY_REMEMBERED_SIZES = false;
|
|
13679
|
+
|
|
13680
|
+
class StaleTranscriptSizeError extends Error {
|
|
13681
|
+
constructor(kind, remembered, measured) {
|
|
13682
|
+
super(`Remembered transcript ${kind} size is stale (${remembered} bytes remembered, ` + `${measured} measured): a write path changed it without noting the change`);
|
|
13683
|
+
this.name = "StaleTranscriptSizeError";
|
|
13684
|
+
}
|
|
13685
|
+
}
|
|
13686
|
+
|
|
13687
|
+
class TranscriptRowSizes {
|
|
13688
|
+
#rows = new Map;
|
|
13689
|
+
#verify;
|
|
13690
|
+
constructor(options = {}) {
|
|
13691
|
+
this.#verify = options.verify ?? VERIFY_REMEMBERED_SIZES;
|
|
13692
|
+
}
|
|
13693
|
+
invalidate(id) {
|
|
13694
|
+
this.#rows.delete(id);
|
|
13695
|
+
}
|
|
13696
|
+
invalidateRow(row) {
|
|
13697
|
+
const id = rowId(row);
|
|
13698
|
+
if (id !== undefined)
|
|
13699
|
+
this.#rows.delete(id);
|
|
13700
|
+
}
|
|
13701
|
+
clear() {
|
|
13702
|
+
this.#rows.clear();
|
|
13703
|
+
}
|
|
13704
|
+
get size() {
|
|
13705
|
+
return this.#rows.size;
|
|
13706
|
+
}
|
|
13707
|
+
measureRows(messages, measure = encodedJsonBytes) {
|
|
13708
|
+
const previous = this.#rows;
|
|
13709
|
+
const next = new Map;
|
|
13710
|
+
const newest = messages.length - 1;
|
|
13711
|
+
const sizes = messages.map((row, index) => {
|
|
13712
|
+
const id = rowId(row);
|
|
13713
|
+
const known = id === undefined ? undefined : previous.get(id);
|
|
13714
|
+
const follower = messages[index + 1];
|
|
13715
|
+
let bytes;
|
|
13716
|
+
if (index < newest && known?.row === row && known.follower === follower) {
|
|
13717
|
+
bytes = known.bytes;
|
|
13718
|
+
if (this.#verify) {
|
|
13719
|
+
const measured = measure(row);
|
|
13720
|
+
if (measured !== bytes)
|
|
13721
|
+
throw new StaleTranscriptSizeError("row", bytes, measured);
|
|
13722
|
+
}
|
|
13723
|
+
} else {
|
|
13724
|
+
bytes = measure(row);
|
|
13725
|
+
}
|
|
13726
|
+
if (follower && id !== undefined)
|
|
13727
|
+
next.set(id, { row, follower, bytes });
|
|
13728
|
+
return bytes;
|
|
13729
|
+
});
|
|
13730
|
+
this.#rows = next;
|
|
13731
|
+
return sizes;
|
|
13732
|
+
}
|
|
13733
|
+
}
|
|
13734
|
+
function rowId(row) {
|
|
13735
|
+
const id = row.id;
|
|
13736
|
+
return typeof id === "string" ? id : undefined;
|
|
13737
|
+
}
|
|
13738
|
+
|
|
13739
|
+
class EncodedObjectSizes {
|
|
13740
|
+
#fields = new WeakMap;
|
|
13741
|
+
#verify;
|
|
13742
|
+
constructor(options = {}) {
|
|
13743
|
+
this.#verify = options.verify ?? VERIFY_REMEMBERED_SIZES;
|
|
13744
|
+
}
|
|
13745
|
+
measure(object) {
|
|
13746
|
+
let fields = this.#fields.get(object);
|
|
13747
|
+
if (!fields) {
|
|
13748
|
+
fields = new Map;
|
|
13749
|
+
this.#fields.set(object, fields);
|
|
13750
|
+
}
|
|
13751
|
+
let bytes = 2;
|
|
13752
|
+
let members = 0;
|
|
13753
|
+
for (const key of Object.keys(object)) {
|
|
13754
|
+
const value = object[key];
|
|
13755
|
+
if (value === undefined || typeof value === "function" || typeof value === "symbol") {
|
|
13756
|
+
fields.delete(key);
|
|
13757
|
+
continue;
|
|
13758
|
+
}
|
|
13759
|
+
let valueBytes;
|
|
13760
|
+
if (typeof value === "string") {
|
|
13761
|
+
valueBytes = encodedStringBytes(value, fields.get(key));
|
|
13762
|
+
fields.set(key, { value, bytes: valueBytes });
|
|
13763
|
+
} else {
|
|
13764
|
+
fields.delete(key);
|
|
13765
|
+
valueBytes = encodedJsonBytes(value);
|
|
13766
|
+
}
|
|
13767
|
+
bytes += encodedJsonBytes(key) + 1 + valueBytes;
|
|
13768
|
+
members += 1;
|
|
13769
|
+
}
|
|
13770
|
+
if (fields.size > members) {
|
|
13771
|
+
for (const key of Array.from(fields.keys())) {
|
|
13772
|
+
if (!Object.hasOwn(object, key))
|
|
13773
|
+
fields.delete(key);
|
|
13774
|
+
}
|
|
13775
|
+
}
|
|
13776
|
+
bytes += Math.max(0, members - 1);
|
|
13777
|
+
if (this.#verify) {
|
|
13778
|
+
const measured = encodedJsonBytes(object);
|
|
13779
|
+
if (measured !== bytes)
|
|
13780
|
+
throw new StaleTranscriptSizeError("part", bytes, measured);
|
|
13781
|
+
}
|
|
13782
|
+
return bytes;
|
|
13783
|
+
}
|
|
13784
|
+
}
|
|
13785
|
+
function encodedStringBytes(value, previous) {
|
|
13786
|
+
if (previous) {
|
|
13787
|
+
if (previous.value === value)
|
|
13788
|
+
return previous.bytes;
|
|
13789
|
+
const before = previous.value;
|
|
13790
|
+
if (value.length > before.length && value.startsWith(before)) {
|
|
13791
|
+
const suffix = value.slice(before.length);
|
|
13792
|
+
const high = before.charCodeAt(before.length - 1);
|
|
13793
|
+
const low = suffix.charCodeAt(0);
|
|
13794
|
+
const splitPair = high >= 55296 && high <= 56319 && low >= 56320 && low <= 57343;
|
|
13795
|
+
return previous.bytes + jsonStringContentBytes(suffix) - (splitPair ? 8 : 0);
|
|
13796
|
+
}
|
|
13797
|
+
}
|
|
13798
|
+
return Buffer3.byteLength(JSON.stringify(value));
|
|
13799
|
+
}
|
|
11027
13800
|
|
|
11028
13801
|
// ../../bridges/acp-bridge/src/acp-persist-writer.ts
|
|
11029
13802
|
import { promises as fs2 } from "node:fs";
|
|
@@ -11031,7 +13804,7 @@ import { dirname as dirname2 } from "node:path";
|
|
|
11031
13804
|
import { randomBytes as randomBytes3 } from "node:crypto";
|
|
11032
13805
|
|
|
11033
13806
|
// ../protocol/src/node/transcript-window.ts
|
|
11034
|
-
import { Buffer as
|
|
13807
|
+
import { Buffer as Buffer4 } from "node:buffer";
|
|
11035
13808
|
var DEFAULT_ENVELOPE_RESERVE_BYTES = 256;
|
|
11036
13809
|
var DEFAULT_CONTENT_FALLBACK_BYTES = 1024 * 1024;
|
|
11037
13810
|
var MAX_TRANSCRIPT_INDEX_DIGITS = 16;
|
|
@@ -11055,7 +13828,7 @@ function transcriptTailStart(retained, tailMessages) {
|
|
|
11055
13828
|
function retainUtf8Tail(value, maximumBytes) {
|
|
11056
13829
|
if (maximumBytes <= 0)
|
|
11057
13830
|
return "";
|
|
11058
|
-
const encoded =
|
|
13831
|
+
const encoded = Buffer4.from(value);
|
|
11059
13832
|
if (encoded.length <= maximumBytes)
|
|
11060
13833
|
return value;
|
|
11061
13834
|
let start = encoded.length - maximumBytes;
|
|
@@ -11068,7 +13841,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
11068
13841
|
const contentFallbackBytes = options.contentFallbackBytes === undefined ? DEFAULT_CONTENT_FALLBACK_BYTES : options.contentFallbackBytes;
|
|
11069
13842
|
const tail = options.tailMessages;
|
|
11070
13843
|
const selected = tail !== undefined && messages.length > tail ? messages.slice(-tail) : [...messages];
|
|
11071
|
-
const measure = options.measure ?? ((message) =>
|
|
13844
|
+
const measure = options.measure ?? ((message) => Buffer4.byteLength(JSON.stringify(message)));
|
|
11072
13845
|
const sizes = selected.map((message) => measure(message));
|
|
11073
13846
|
let bytes = envelope + 2 + sizes.reduce((total, size) => total + size, 0) + Math.max(0, sizes.length - 1);
|
|
11074
13847
|
let start = 0;
|
|
@@ -11080,7 +13853,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
11080
13853
|
let truncatedContent = false;
|
|
11081
13854
|
const oldestRetained = selected[start];
|
|
11082
13855
|
if (bytes > maximumBytes && oldestRetained) {
|
|
11083
|
-
const partSizes = oldestRetained.parts.map((part) =>
|
|
13856
|
+
const partSizes = oldestRetained.parts.map((part) => Buffer4.byteLength(JSON.stringify(part)));
|
|
11084
13857
|
const partCount = partSizes.length;
|
|
11085
13858
|
while (omittedParts < partCount && bytes > maximumBytes) {
|
|
11086
13859
|
const shed = partSizes[omittedParts];
|
|
@@ -11101,7 +13874,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
11101
13874
|
};
|
|
11102
13875
|
omittedParts = oldestRetained.parts.length;
|
|
11103
13876
|
truncatedContent = true;
|
|
11104
|
-
bytes = envelope + 2 +
|
|
13877
|
+
bytes = envelope + 2 + Buffer4.byteLength(JSON.stringify(selected[start]));
|
|
11105
13878
|
}
|
|
11106
13879
|
}
|
|
11107
13880
|
const bounded = selected.slice(start);
|
|
@@ -11118,6 +13891,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
11118
13891
|
}
|
|
11119
13892
|
|
|
11120
13893
|
// ../../bridges/acp-bridge/src/acp-persist-writer.ts
|
|
13894
|
+
var log3 = createLogger("bridge.acp");
|
|
11121
13895
|
function boundPersistedSnapshot(snapshot) {
|
|
11122
13896
|
const bounded = {
|
|
11123
13897
|
...snapshot,
|
|
@@ -11314,7 +14088,7 @@ function schedulePersist() {
|
|
|
11314
14088
|
await writePersistedState();
|
|
11315
14089
|
});
|
|
11316
14090
|
setPersistenceTail(operation.catch((error) => {
|
|
11317
|
-
|
|
14091
|
+
log3.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
|
|
11318
14092
|
}));
|
|
11319
14093
|
}
|
|
11320
14094
|
function persistState() {
|
|
@@ -11478,12 +14252,25 @@ function notePartMutation(state, part) {
|
|
|
11478
14252
|
}
|
|
11479
14253
|
}
|
|
11480
14254
|
function noteRevisedRow(state, index) {
|
|
14255
|
+
rowSizes.get(state)?.invalidate(state.messages[index].id);
|
|
11481
14256
|
const absoluteIndex = state.droppedMessages + index;
|
|
11482
14257
|
if (state.mutatedMessageFloor === undefined || absoluteIndex < state.mutatedMessageFloor) {
|
|
11483
14258
|
state.mutatedMessageFloor = absoluteIndex;
|
|
11484
14259
|
}
|
|
11485
14260
|
(state.revisedRows ??= new RecentlyRevisedRows).note(state.messages[index].id);
|
|
11486
14261
|
}
|
|
14262
|
+
var rowSizes = new WeakMap;
|
|
14263
|
+
function transcriptRowSizes(state) {
|
|
14264
|
+
let sizes = rowSizes.get(state);
|
|
14265
|
+
if (!sizes) {
|
|
14266
|
+
sizes = new TranscriptRowSizes;
|
|
14267
|
+
rowSizes.set(state, sizes);
|
|
14268
|
+
}
|
|
14269
|
+
return sizes;
|
|
14270
|
+
}
|
|
14271
|
+
function forgetRowSize(state, message) {
|
|
14272
|
+
rowSizes.get(state)?.invalidate(message.id);
|
|
14273
|
+
}
|
|
11487
14274
|
function rememberEvictedRows(state, evicted) {
|
|
11488
14275
|
for (const message of evicted) {
|
|
11489
14276
|
state.revisedRows?.forget(message.id);
|
|
@@ -11585,13 +14372,13 @@ function rememberTrimmedToolCalls(message, dropped) {
|
|
|
11585
14372
|
}
|
|
11586
14373
|
trimmedToolCalls.set(message, ids);
|
|
11587
14374
|
}
|
|
11588
|
-
function
|
|
14375
|
+
function boundedString2(value, maximumBytes) {
|
|
11589
14376
|
if (typeof value !== "string")
|
|
11590
14377
|
return;
|
|
11591
14378
|
return truncateUtf8(value, maximumBytes);
|
|
11592
14379
|
}
|
|
11593
14380
|
function boundedNullableString(value, maximumBytes) {
|
|
11594
|
-
return value === null ? undefined :
|
|
14381
|
+
return value === null ? undefined : boundedString2(value, maximumBytes);
|
|
11595
14382
|
}
|
|
11596
14383
|
var MAX_SESSION_TITLE_BYTES = 512;
|
|
11597
14384
|
function sessionTitle(value) {
|
|
@@ -11644,7 +14431,7 @@ function toolCallContentText(value) {
|
|
|
11644
14431
|
return text ? [text] : [];
|
|
11645
14432
|
}
|
|
11646
14433
|
if (item.type === "terminal") {
|
|
11647
|
-
const terminalId =
|
|
14434
|
+
const terminalId = boundedString2(item.terminalId, MAX_TOOL_ID_BYTES);
|
|
11648
14435
|
const output = terminalId ? terminalDisplayOutput(terminalId) : undefined;
|
|
11649
14436
|
return [output || (terminalId ? `[Terminal ${terminalId}]` : "[Terminal]")];
|
|
11650
14437
|
}
|
|
@@ -11667,7 +14454,7 @@ function toolCallContentDiffs(value) {
|
|
|
11667
14454
|
});
|
|
11668
14455
|
}
|
|
11669
14456
|
function normalizeAcpContentDiff(value) {
|
|
11670
|
-
const filePath =
|
|
14457
|
+
const filePath = boundedString2(value.path, MAX_TOOL_PATH_BYTES);
|
|
11671
14458
|
const rawBefore = typeof value.oldText === "string" ? value.oldText : undefined;
|
|
11672
14459
|
const rawAfter = typeof value.newText === "string" ? value.newText : undefined;
|
|
11673
14460
|
const keepInline = Buffer.byteLength(rawBefore ?? "") <= MAX_TOOL_INLINE_FILE_BYTES && Buffer.byteLength(rawAfter ?? "") <= MAX_TOOL_INLINE_FILE_BYTES;
|
|
@@ -11716,10 +14503,10 @@ function toolCallLocationPath(value) {
|
|
|
11716
14503
|
if (!Array.isArray(value))
|
|
11717
14504
|
return;
|
|
11718
14505
|
const first = value.find((location) => isObject3(location));
|
|
11719
|
-
return
|
|
14506
|
+
return boundedString2(first?.path, MAX_TOOL_PATH_BYTES);
|
|
11720
14507
|
}
|
|
11721
14508
|
function toolArgumentPath(toolArgs) {
|
|
11722
|
-
return
|
|
14509
|
+
return boundedString2(toolArgs?.path, MAX_TOOL_PATH_BYTES) ?? boundedString2(toolArgs?.filePath, MAX_TOOL_PATH_BYTES) ?? boundedString2(toolArgs?.file_path, MAX_TOOL_PATH_BYTES);
|
|
11723
14510
|
}
|
|
11724
14511
|
function createDisplayDiff(filePath, before, after) {
|
|
11725
14512
|
const lines = diffFileLines(fileLines(before ?? ""), fileLines(after));
|
|
@@ -11885,10 +14672,7 @@ function safeDiffPath(value) {
|
|
|
11885
14672
|
return value.replace(/[\r\n]/g, " ");
|
|
11886
14673
|
}
|
|
11887
14674
|
function truncateDisplayText(value, maximumBytes, notice) {
|
|
11888
|
-
|
|
11889
|
-
return value;
|
|
11890
|
-
const noticeBytes = Buffer.byteLength(notice);
|
|
11891
|
-
return truncateUtf8(value, Math.max(0, maximumBytes - noticeBytes)) + notice;
|
|
14675
|
+
return boundUtf8Text(value, maximumBytes, notice);
|
|
11892
14676
|
}
|
|
11893
14677
|
var MAX_CONTENT_IMAGE_BYTES = 4 * 1024 * 1024;
|
|
11894
14678
|
var MAX_CONTENT_BLOCKS = 16;
|
|
@@ -11959,41 +14743,19 @@ function contentBlockParts(value, messageId, startIndex) {
|
|
|
11959
14743
|
}
|
|
11960
14744
|
return parts;
|
|
11961
14745
|
}
|
|
14746
|
+
var appender = new BoundedTextAppender({
|
|
14747
|
+
notice: `
|
|
14748
|
+
[output truncated by Orkestrator]`,
|
|
14749
|
+
policy: "reserve-notice",
|
|
14750
|
+
saturated: saturatedText
|
|
14751
|
+
});
|
|
11962
14752
|
function appendSaturating(target, current, addition, maximumBytes) {
|
|
11963
|
-
|
|
11964
|
-
return { value: current, truncated: true };
|
|
11965
|
-
const next = appendBounded(current, addition, maximumBytes);
|
|
11966
|
-
if (next.truncated && target)
|
|
11967
|
-
saturatedText.add(target);
|
|
11968
|
-
return next;
|
|
14753
|
+
return appender.append(current, addition, maximumBytes, target);
|
|
11969
14754
|
}
|
|
11970
|
-
function appendBounded(current, addition, maximumBytes) {
|
|
11971
|
-
|
|
11972
|
-
const remaining = Math.max(0, maximumBytes - currentBytes);
|
|
11973
|
-
if (Buffer.byteLength(addition) <= remaining)
|
|
11974
|
-
return { value: current + addition, truncated: false };
|
|
11975
|
-
const marker = `
|
|
11976
|
-
[output truncated by Orkestrator]`;
|
|
11977
|
-
const markerBytes = Buffer.byteLength(marker);
|
|
11978
|
-
const contentLimit = Math.max(0, maximumBytes - markerBytes);
|
|
11979
|
-
const prefix = truncateUtf8(current, contentLimit);
|
|
11980
|
-
const usable = Math.max(0, contentLimit - Buffer.byteLength(prefix));
|
|
11981
|
-
return {
|
|
11982
|
-
value: prefix + truncateUtf8(addition, usable) + truncateUtf8(marker, maximumBytes),
|
|
11983
|
-
truncated: true
|
|
11984
|
-
};
|
|
11985
|
-
}
|
|
11986
|
-
function truncateUtf8(value, maximumBytes) {
|
|
11987
|
-
if (maximumBytes <= 0)
|
|
11988
|
-
return "";
|
|
11989
|
-
const encoded = Buffer.from(value);
|
|
11990
|
-
if (encoded.length <= maximumBytes)
|
|
11991
|
-
return value;
|
|
11992
|
-
let end = maximumBytes;
|
|
11993
|
-
while (end > 0 && (encoded[end] & 192) === 128)
|
|
11994
|
-
end -= 1;
|
|
11995
|
-
return encoded.subarray(0, end).toString("utf8");
|
|
14755
|
+
function appendBounded(current, addition, maximumBytes, lengthOwner) {
|
|
14756
|
+
return appender.append(current, addition, maximumBytes, lengthOwner, false);
|
|
11996
14757
|
}
|
|
14758
|
+
var truncateUtf8 = sliceUtf8;
|
|
11997
14759
|
function boundTranscript(state) {
|
|
11998
14760
|
state.uncheckedTranscriptBytes = 0;
|
|
11999
14761
|
let truncatedCurrentMessage = false;
|
|
@@ -12003,7 +14765,9 @@ function boundTranscript(state) {
|
|
|
12003
14765
|
state.droppedMessages += removed;
|
|
12004
14766
|
state.transcriptTruncated = true;
|
|
12005
14767
|
}
|
|
14768
|
+
const rowSizes = transcriptRowSizes(state);
|
|
12006
14769
|
const plan = planOldestFirstTrim(state.messages, MAX_TRANSCRIPT_BYTES, {
|
|
14770
|
+
messageSizes: rowSizes.measureRows(state.messages),
|
|
12007
14771
|
leadingReplacement: (message) => ({
|
|
12008
14772
|
bytes: encodedJsonBytes(trimNoticePart(message)),
|
|
12009
14773
|
present: isTrimNotice(message, message.parts[0])
|
|
@@ -12018,6 +14782,7 @@ function boundTranscript(state) {
|
|
|
12018
14782
|
if (plan.droppedParts > 0 && onlyMessage) {
|
|
12019
14783
|
const realParts = onlyMessage.parts.length - (isTrimNotice(onlyMessage, onlyMessage.parts[0]) ? 1 : 0);
|
|
12020
14784
|
state.droppedParts += trimPartsTo(onlyMessage, 1 + realParts - plan.droppedParts);
|
|
14785
|
+
rowSizes.invalidate(onlyMessage.id);
|
|
12021
14786
|
state.transcriptTruncated = true;
|
|
12022
14787
|
truncatedCurrentMessage = true;
|
|
12023
14788
|
}
|
|
@@ -12089,13 +14854,15 @@ function shedNestedParts(state, owner, parentTaskUseId, keep) {
|
|
|
12089
14854
|
removed.unshift(...owner.parts.splice(index, 1));
|
|
12090
14855
|
}
|
|
12091
14856
|
rememberTrimmedToolCalls(owner, removed);
|
|
14857
|
+
forgetRowSize(state, owner);
|
|
12092
14858
|
state.droppedParts += removed.length;
|
|
12093
14859
|
state.transcriptTruncated = true;
|
|
12094
14860
|
}
|
|
14861
|
+
var toolPartSizes = new EncodedObjectSizes;
|
|
12095
14862
|
function commitToolPartMutation(state, part, source) {
|
|
12096
14863
|
state.revision += 1;
|
|
12097
14864
|
notePartMutation(state, part);
|
|
12098
|
-
const serializedBytes =
|
|
14865
|
+
const serializedBytes = toolPartSizes.measure(part);
|
|
12099
14866
|
state.uncheckedTranscriptBytes += Math.max(0, serializedBytes - (source.chargedBytes ?? 0));
|
|
12100
14867
|
source.chargedBytes = serializedBytes;
|
|
12101
14868
|
const transcriptTruncated = state.messages.length > MAX_MESSAGES || state.uncheckedTranscriptBytes >= TRANSCRIPT_CHECK_INTERVAL_BYTES ? boundTranscript(state) : false;
|
|
@@ -12203,8 +14970,8 @@ function applyToolCallUpdate(state, update, isInitial) {
|
|
|
12203
14970
|
return part;
|
|
12204
14971
|
}
|
|
12205
14972
|
function namesAnotherCall(update, part) {
|
|
12206
|
-
const title =
|
|
12207
|
-
return title !== undefined && title.length > 0 && title !==
|
|
14973
|
+
const title = boundedString2(update.title, MAX_TOOL_TITLE_BYTES)?.trim();
|
|
14974
|
+
return title !== undefined && title.length > 0 && title !== boundedString2(acpToolSourceStates.get(part)?.title ?? part.toolTitle, MAX_TOOL_TITLE_BYTES)?.trim();
|
|
12208
14975
|
}
|
|
12209
14976
|
function continuesAcrossTurns(state, part, isInitial) {
|
|
12210
14977
|
if (state.activeSubagentToolIds.has(part.toolUseId))
|
|
@@ -12215,7 +14982,7 @@ function continuesAcrossTurns(state, part, isInitial) {
|
|
|
12215
14982
|
return !isInitial && !isSettledToolPart(part);
|
|
12216
14983
|
}
|
|
12217
14984
|
function collectReplayToolMetadata(collector, update, isInitial) {
|
|
12218
|
-
const id =
|
|
14985
|
+
const id = boundedString2(update.toolCallId, MAX_TOOL_ID_BYTES)?.trim();
|
|
12219
14986
|
if (!id)
|
|
12220
14987
|
return;
|
|
12221
14988
|
let call = collector.byId.get(id);
|
|
@@ -12244,7 +15011,7 @@ function collectReplayToolMetadata(collector, update, isInitial) {
|
|
|
12244
15011
|
candidate.toolName = boundedNullableString(update.kind, MAX_TOOL_NAME_BYTES);
|
|
12245
15012
|
}
|
|
12246
15013
|
if ("rawInput" in update && isObject3(update.rawInput)) {
|
|
12247
|
-
candidate.toolName ??=
|
|
15014
|
+
candidate.toolName ??= boundedString2(update.rawInput._toolName, MAX_TOOL_NAME_BYTES);
|
|
12248
15015
|
candidate.toolArgs = boundedToolArguments(update.rawInput);
|
|
12249
15016
|
}
|
|
12250
15017
|
if ("content" in update) {
|
|
@@ -12521,7 +15288,7 @@ function acpParentTaskUseId(update) {
|
|
|
12521
15288
|
}
|
|
12522
15289
|
}
|
|
12523
15290
|
for (const candidate of candidates) {
|
|
12524
|
-
const value =
|
|
15291
|
+
const value = boundedString2(candidate, MAX_TOOL_ID_BYTES)?.trim();
|
|
12525
15292
|
if (value)
|
|
12526
15293
|
return value;
|
|
12527
15294
|
}
|
|
@@ -12540,8 +15307,8 @@ function applyAcpToolSourcePatch(source, update) {
|
|
|
12540
15307
|
if ("_meta" in update && isObject3(update._meta)) {
|
|
12541
15308
|
const toolMeta = isObject3(update._meta["x.ai/tool"]) ? update._meta["x.ai/tool"] : undefined;
|
|
12542
15309
|
if (toolMeta) {
|
|
12543
|
-
source.metadataName =
|
|
12544
|
-
source.metadataKind =
|
|
15310
|
+
source.metadataName = boundedString2(toolMeta.name, MAX_TOOL_NAME_BYTES)?.trim();
|
|
15311
|
+
source.metadataKind = boundedString2(toolMeta.kind, MAX_TOOL_NAME_BYTES)?.trim();
|
|
12545
15312
|
if (isAcpTodosToolName(source.metadataName)) {
|
|
12546
15313
|
source.explicitName = source.metadataName;
|
|
12547
15314
|
}
|
|
@@ -12549,7 +15316,7 @@ function applyAcpToolSourcePatch(source, update) {
|
|
|
12549
15316
|
}
|
|
12550
15317
|
if ("rawInput" in update) {
|
|
12551
15318
|
if (isObject3(update.rawInput)) {
|
|
12552
|
-
source.inputName =
|
|
15319
|
+
source.inputName = boundedString2(update.rawInput._toolName, MAX_TOOL_NAME_BYTES);
|
|
12553
15320
|
source.toolArgs = preserveTaskLaunchArgs(source.toolArgs, boundedToolArguments(update.rawInput));
|
|
12554
15321
|
} else {
|
|
12555
15322
|
source.inputName = undefined;
|
|
@@ -12579,7 +15346,7 @@ function grokWrappedToolCall(source) {
|
|
|
12579
15346
|
const wrapper = [source.metadataName, source.explicitName, source.inputName].some((name) => name?.trim() === GROK_USE_TOOL);
|
|
12580
15347
|
if (!wrapper || !source.toolArgs)
|
|
12581
15348
|
return;
|
|
12582
|
-
const name =
|
|
15349
|
+
const name = boundedString2(source.toolArgs.tool_name, MAX_TOOL_NAME_BYTES)?.trim();
|
|
12583
15350
|
if (!name)
|
|
12584
15351
|
return;
|
|
12585
15352
|
let input = source.toolArgs.tool_input;
|
|
@@ -12850,10 +15617,10 @@ function boundedDurationMs(value) {
|
|
|
12850
15617
|
}
|
|
12851
15618
|
function cursorSubagentTypeLabel(value) {
|
|
12852
15619
|
if (typeof value === "string") {
|
|
12853
|
-
return
|
|
15620
|
+
return boundedString2(value, MAX_TOOL_NAME_BYTES)?.trim();
|
|
12854
15621
|
}
|
|
12855
15622
|
if (isObject3(value) && typeof value.custom === "string") {
|
|
12856
|
-
return
|
|
15623
|
+
return boundedString2(value.custom, MAX_TOOL_NAME_BYTES)?.trim();
|
|
12857
15624
|
}
|
|
12858
15625
|
return;
|
|
12859
15626
|
}
|
|
@@ -12951,11 +15718,11 @@ function parseCursorTodos(value) {
|
|
|
12951
15718
|
break;
|
|
12952
15719
|
if (!isObject3(candidate))
|
|
12953
15720
|
continue;
|
|
12954
|
-
const content =
|
|
15721
|
+
const content = boundedString2(candidate.content, MAX_TOOL_TITLE_BYTES)?.trim();
|
|
12955
15722
|
const status = typeof candidate.status === "string" ? candidate.status : "";
|
|
12956
15723
|
if (!content || !CURSOR_TODO_STATUS_SET.has(status))
|
|
12957
15724
|
continue;
|
|
12958
|
-
const id =
|
|
15725
|
+
const id = boundedString2(candidate.id, MAX_TOOL_ID_BYTES)?.trim();
|
|
12959
15726
|
parsed.push({
|
|
12960
15727
|
...id ? { id } : {},
|
|
12961
15728
|
content,
|
|
@@ -13065,7 +15832,7 @@ function applyCursorUpdateTodos(state, params) {
|
|
|
13065
15832
|
if (params.sessionId !== undefined && params.sessionId !== state.acpSessionId)
|
|
13066
15833
|
return;
|
|
13067
15834
|
const payload = isObject3(params.update) ? params.update : params;
|
|
13068
|
-
const toolCallId =
|
|
15835
|
+
const toolCallId = boundedString2(payload.toolCallId, MAX_TOOL_ID_BYTES)?.trim();
|
|
13069
15836
|
if (!toolCallId || !Array.isArray(payload.todos))
|
|
13070
15837
|
return;
|
|
13071
15838
|
const incoming = parseCursorTodos(payload.todos);
|
|
@@ -13178,14 +15945,14 @@ function applyCursorTask(state, params) {
|
|
|
13178
15945
|
if (params.sessionId !== undefined && params.sessionId !== state.acpSessionId)
|
|
13179
15946
|
return;
|
|
13180
15947
|
const payload = isObject3(params.update) ? params.update : params;
|
|
13181
|
-
const toolCallId =
|
|
15948
|
+
const toolCallId = boundedString2(payload.toolCallId, MAX_TOOL_ID_BYTES)?.trim();
|
|
13182
15949
|
if (!toolCallId)
|
|
13183
15950
|
return;
|
|
13184
|
-
const description =
|
|
13185
|
-
const prompt =
|
|
15951
|
+
const description = boundedString2(payload.description, MAX_TOOL_TITLE_BYTES)?.trim();
|
|
15952
|
+
const prompt = boundedString2(payload.prompt, MAX_CURSOR_TASK_PROMPT_BYTES)?.trim();
|
|
13186
15953
|
const subagentType = cursorSubagentTypeLabel(payload.subagentType ?? payload.subagent_type);
|
|
13187
|
-
const model =
|
|
13188
|
-
const agentId =
|
|
15954
|
+
const model = boundedString2(payload.model, MAX_TOOL_NAME_BYTES)?.trim();
|
|
15955
|
+
const agentId = boundedString2(payload.agentId ?? payload.agent_id, MAX_TOOL_ID_BYTES)?.trim();
|
|
13189
15956
|
const durationMs = boundedDurationMs(payload.durationMs);
|
|
13190
15957
|
const namedState = cursorTaskNamedState(payload);
|
|
13191
15958
|
if (!description && !prompt && !subagentType && !model && !agentId && durationMs === undefined && namedState === undefined) {
|
|
@@ -13308,12 +16075,12 @@ function toolCallLifecycle(value) {
|
|
|
13308
16075
|
}
|
|
13309
16076
|
}
|
|
13310
16077
|
function applySubagentSpawned(state, update) {
|
|
13311
|
-
const subagentId =
|
|
16078
|
+
const subagentId = boundedString2(update.subagent_id, MAX_TOOL_ID_BYTES)?.trim();
|
|
13312
16079
|
if (!subagentId || state.subagentToolIds.has(subagentId))
|
|
13313
16080
|
return;
|
|
13314
16081
|
const claimedToolIds = new Set(state.subagentToolIds.values());
|
|
13315
|
-
const description =
|
|
13316
|
-
const subagentType =
|
|
16082
|
+
const description = boundedString2(update.description, MAX_TOOL_TITLE_BYTES)?.trim();
|
|
16083
|
+
const subagentType = boundedString2(update.subagent_type, MAX_TOOL_NAME_BYTES)?.trim();
|
|
13317
16084
|
const candidates = [...state.activeSubagentDescriptors.entries()].filter(([toolUseId]) => !claimedToolIds.has(toolUseId));
|
|
13318
16085
|
const matched = candidates.find(([, descriptor]) => (!description || descriptor.description === description) && (!subagentType || descriptor.subagentType === subagentType));
|
|
13319
16086
|
const selected = matched ?? (!description && !subagentType && candidates.length === 1 ? candidates[0] : undefined);
|
|
@@ -13321,7 +16088,7 @@ function applySubagentSpawned(state, update) {
|
|
|
13321
16088
|
state.subagentToolIds.set(subagentId, selected[0]);
|
|
13322
16089
|
}
|
|
13323
16090
|
function applySubagentFinished(state, update) {
|
|
13324
|
-
const subagentId =
|
|
16091
|
+
const subagentId = boundedString2(update.subagent_id, MAX_TOOL_ID_BYTES)?.trim();
|
|
13325
16092
|
if (!subagentId)
|
|
13326
16093
|
return;
|
|
13327
16094
|
const toolUseId = state.subagentToolIds.get(subagentId);
|
|
@@ -14102,8 +16869,8 @@ function parsePersistedComposer(provider, value) {
|
|
|
14102
16869
|
for (const candidate of value.models) {
|
|
14103
16870
|
if (!isObject4(candidate) || candidate.platform !== provider)
|
|
14104
16871
|
return null;
|
|
14105
|
-
const id =
|
|
14106
|
-
const label =
|
|
16872
|
+
const id = boundedString3(candidate.id, 1024);
|
|
16873
|
+
const label = boundedString3(candidate.label, 4096);
|
|
14107
16874
|
if (!id || !label || modelIds.has(id))
|
|
14108
16875
|
return null;
|
|
14109
16876
|
modelIds.add(id);
|
|
@@ -14116,8 +16883,8 @@ function parsePersistedComposer(provider, value) {
|
|
|
14116
16883
|
for (const option of candidate.reasoning) {
|
|
14117
16884
|
if (!isObject4(option))
|
|
14118
16885
|
return null;
|
|
14119
|
-
const optionId =
|
|
14120
|
-
const optionLabel =
|
|
16886
|
+
const optionId = boundedString3(option.id, 256);
|
|
16887
|
+
const optionLabel = boundedString3(option.label, 1024);
|
|
14121
16888
|
if (!optionId || !optionLabel || reasoningIds.has(optionId))
|
|
14122
16889
|
return null;
|
|
14123
16890
|
reasoningIds.add(optionId);
|
|
@@ -14165,7 +16932,7 @@ function parsePersistedComposer(provider, value) {
|
|
|
14165
16932
|
for (const candidate of value.modes) {
|
|
14166
16933
|
if (!isObject4(candidate) || candidate.id !== "build" && candidate.id !== "plan")
|
|
14167
16934
|
return null;
|
|
14168
|
-
const label =
|
|
16935
|
+
const label = boundedString3(candidate.label, 1024);
|
|
14169
16936
|
if (!label || modeIds.has(candidate.id))
|
|
14170
16937
|
return null;
|
|
14171
16938
|
modeIds.add(candidate.id);
|
|
@@ -14184,7 +16951,7 @@ function parsePersistedComposer(provider, value) {
|
|
|
14184
16951
|
return null;
|
|
14185
16952
|
parameterValues = {};
|
|
14186
16953
|
for (const [key, candidate] of Object.entries(value.parameterValues)) {
|
|
14187
|
-
const id =
|
|
16954
|
+
const id = boundedString3(key, 256);
|
|
14188
16955
|
if (!id || typeof candidate !== "string" && typeof candidate !== "boolean")
|
|
14189
16956
|
return null;
|
|
14190
16957
|
if (typeof candidate === "string" && Buffer.byteLength(candidate) > 1024)
|
|
@@ -14216,8 +16983,8 @@ function parsePersistedModelParameters(value) {
|
|
|
14216
16983
|
for (const candidate of value) {
|
|
14217
16984
|
if (!isObject4(candidate))
|
|
14218
16985
|
return null;
|
|
14219
|
-
const id =
|
|
14220
|
-
const label =
|
|
16986
|
+
const id = boundedString3(candidate.id, 256);
|
|
16987
|
+
const label = boundedString3(candidate.label, 1024);
|
|
14221
16988
|
if (!id || !label || ids.has(id))
|
|
14222
16989
|
return null;
|
|
14223
16990
|
ids.add(id);
|
|
@@ -14242,8 +17009,8 @@ function parsePersistedModelParameters(value) {
|
|
|
14242
17009
|
for (const option of candidate.options) {
|
|
14243
17010
|
if (!isObject4(option))
|
|
14244
17011
|
return null;
|
|
14245
|
-
const optionId =
|
|
14246
|
-
const optionLabel =
|
|
17012
|
+
const optionId = boundedString3(option.id, 256);
|
|
17013
|
+
const optionLabel = boundedString3(option.label, 1024);
|
|
14247
17014
|
const optionDescription = optionalBoundedString(option.description, 4096);
|
|
14248
17015
|
if (!optionId || !optionLabel || optionDescription === null || optionIds.has(optionId))
|
|
14249
17016
|
return null;
|
|
@@ -14360,7 +17127,7 @@ function isObject4(value) {
|
|
|
14360
17127
|
function firstString(...values) {
|
|
14361
17128
|
return values.find((value) => typeof value === "string" && value.length > 0);
|
|
14362
17129
|
}
|
|
14363
|
-
function
|
|
17130
|
+
function boundedString3(value, maximumBytes) {
|
|
14364
17131
|
return typeof value === "string" && value.length > 0 && Buffer.byteLength(value) <= maximumBytes ? value : undefined;
|
|
14365
17132
|
}
|
|
14366
17133
|
function positiveInteger(value) {
|
|
@@ -15281,6 +18048,7 @@ function compactCommandSelection(state) {
|
|
|
15281
18048
|
}
|
|
15282
18049
|
|
|
15283
18050
|
// ../../bridges/acp-bridge/src/acp-persistence.ts
|
|
18051
|
+
var log4 = createLogger("bridge.acp");
|
|
15284
18052
|
async function listNormalizedModels(signal) {
|
|
15285
18053
|
const live = mergeComposerCatalog(provider, [
|
|
15286
18054
|
...catalogCache ? [catalogCache] : [],
|
|
@@ -15328,14 +18096,14 @@ function restoreSessionConfig(candidate) {
|
|
|
15328
18096
|
const restored = parsePersistedAcpSessionConfig(provider, candidate.sessionConfig);
|
|
15329
18097
|
if (restored)
|
|
15330
18098
|
return restored;
|
|
15331
|
-
|
|
18099
|
+
log4.warn("state.session-config-reset");
|
|
15332
18100
|
return emptySessionConfig();
|
|
15333
18101
|
}
|
|
15334
18102
|
if (candidate.composer !== undefined) {
|
|
15335
18103
|
const composer = parsePersistedComposerState(provider, candidate.composer);
|
|
15336
18104
|
if (composer)
|
|
15337
18105
|
return { ...emptySessionConfig(), composer };
|
|
15338
|
-
|
|
18106
|
+
log4.warn("state.composer-reset");
|
|
15339
18107
|
}
|
|
15340
18108
|
return emptySessionConfig();
|
|
15341
18109
|
}
|
|
@@ -15418,7 +18186,7 @@ async function restorePersistedState() {
|
|
|
15418
18186
|
sessions.clear();
|
|
15419
18187
|
bumpCursorDiscoveryRevision();
|
|
15420
18188
|
clientSessionKeys.clear();
|
|
15421
|
-
|
|
18189
|
+
log4.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
|
|
15422
18190
|
const file = stateFile;
|
|
15423
18191
|
if (!file)
|
|
15424
18192
|
return;
|
|
@@ -15594,7 +18362,7 @@ function normalizeBridgePart(value, index, messageId) {
|
|
|
15594
18362
|
const content = typeof value.content === "string" ? value.content : typeof value.text === "string" ? value.text : undefined;
|
|
15595
18363
|
if (content === undefined)
|
|
15596
18364
|
return null;
|
|
15597
|
-
const parentTaskUseId =
|
|
18365
|
+
const parentTaskUseId = boundedString2(value.parentTaskUseId, MAX_TOOL_ID_BYTES)?.trim();
|
|
15598
18366
|
return {
|
|
15599
18367
|
type: value.type === "reasoning" ? "thinking" : value.type,
|
|
15600
18368
|
content: truncateUtf8(content, MAX_MESSAGE_TEXT_BYTES),
|
|
@@ -15605,7 +18373,7 @@ function normalizeBridgePart(value, index, messageId) {
|
|
|
15605
18373
|
};
|
|
15606
18374
|
}
|
|
15607
18375
|
if (value.type === "retry") {
|
|
15608
|
-
const content =
|
|
18376
|
+
const content = boundedString2(value.content, MAX_TOOL_TITLE_BYTES);
|
|
15609
18377
|
if (content === undefined)
|
|
15610
18378
|
return null;
|
|
15611
18379
|
const interrupted = value.toolState !== "success" && value.toolState !== "failure";
|
|
@@ -15619,10 +18387,10 @@ function normalizeBridgePart(value, index, messageId) {
|
|
|
15619
18387
|
};
|
|
15620
18388
|
}
|
|
15621
18389
|
if (value.type === "file") {
|
|
15622
|
-
const content =
|
|
18390
|
+
const content = boundedString2(value.content, MAX_TOOL_PATH_BYTES);
|
|
15623
18391
|
if (!content)
|
|
15624
18392
|
return null;
|
|
15625
|
-
const fileUrl =
|
|
18393
|
+
const fileUrl = boundedString2(value.fileUrl, MAX_TOOL_PATH_BYTES);
|
|
15626
18394
|
return {
|
|
15627
18395
|
type: "file",
|
|
15628
18396
|
content,
|
|
@@ -15639,16 +18407,16 @@ function normalizeBridgePart(value, index, messageId) {
|
|
|
15639
18407
|
return null;
|
|
15640
18408
|
const toolState = value.toolState === "success" || value.toolState === "failure" || value.toolState === "pending" ? value.toolState : undefined;
|
|
15641
18409
|
const agentState = value.agentState === "active" || value.agentState === "finished" || value.agentState === "failed" ? value.agentState : undefined;
|
|
15642
|
-
const toolOutput =
|
|
15643
|
-
const toolError =
|
|
18410
|
+
const toolOutput = boundedString2(value.toolOutput, MAX_TOOL_OUTPUT_BYTES);
|
|
18411
|
+
const toolError = boundedString2(value.toolError, MAX_TOOL_OUTPUT_BYTES);
|
|
15644
18412
|
const toolDiff = normalizeBridgeToolDiff(value.toolDiff);
|
|
15645
18413
|
const commandChanges = parseMeasuredWorkspaceChange(value.commandChanges);
|
|
15646
|
-
const toolName =
|
|
15647
|
-
const toolTitle =
|
|
15648
|
-
const parentTaskUseId =
|
|
18414
|
+
const toolName = boundedString2(value.toolName, MAX_TOOL_NAME_BYTES);
|
|
18415
|
+
const toolTitle = boundedString2(value.toolTitle, MAX_TOOL_TITLE_BYTES);
|
|
18416
|
+
const parentTaskUseId = boundedString2(value.parentTaskUseId, MAX_TOOL_ID_BYTES)?.trim();
|
|
15649
18417
|
return {
|
|
15650
18418
|
type: "tool-invocation",
|
|
15651
|
-
content:
|
|
18419
|
+
content: boundedString2(value.content, MAX_TOOL_TITLE_BYTES) ?? "Tool call",
|
|
15652
18420
|
sourcePartId,
|
|
15653
18421
|
sourceMessageId,
|
|
15654
18422
|
toolUseId,
|
|
@@ -15669,7 +18437,7 @@ function normalizeBridgePart(value, index, messageId) {
|
|
|
15669
18437
|
function normalizeBridgeToolDiff(value) {
|
|
15670
18438
|
if (!isObject3(value))
|
|
15671
18439
|
return;
|
|
15672
|
-
const filePath =
|
|
18440
|
+
const filePath = boundedString2(value.filePath, MAX_TOOL_PATH_BYTES);
|
|
15673
18441
|
const rawBefore = typeof value.before === "string" ? value.before : undefined;
|
|
15674
18442
|
const rawAfter = typeof value.after === "string" ? value.after : undefined;
|
|
15675
18443
|
const keepInline = Buffer.byteLength(rawBefore ?? "") <= MAX_TOOL_INLINE_FILE_BYTES && Buffer.byteLength(rawAfter ?? "") <= MAX_TOOL_INLINE_FILE_BYTES;
|
|
@@ -15677,7 +18445,7 @@ function normalizeBridgeToolDiff(value) {
|
|
|
15677
18445
|
const after = keepInline ? rawAfter : undefined;
|
|
15678
18446
|
const additions = Number.isSafeInteger(value.additions) && Number(value.additions) >= 0 ? Number(value.additions) : undefined;
|
|
15679
18447
|
const deletions = Number.isSafeInteger(value.deletions) && Number(value.deletions) >= 0 ? Number(value.deletions) : undefined;
|
|
15680
|
-
const diff =
|
|
18448
|
+
const diff = boundedString2(value.diff, MAX_TOOL_DIFF_BYTES);
|
|
15681
18449
|
if (!filePath && additions === undefined && deletions === undefined && before === undefined && after === undefined && diff === undefined)
|
|
15682
18450
|
return;
|
|
15683
18451
|
return {
|
|
@@ -17609,6 +20377,7 @@ function canonicalEvidence(evidence) {
|
|
|
17609
20377
|
}
|
|
17610
20378
|
|
|
17611
20379
|
// ../../bridges/acp-bridge/src/change-evidence.ts
|
|
20380
|
+
var log5 = createLogger("bridge.acp");
|
|
17612
20381
|
var MAX_DIFF_BLOCKS_PER_CALL = 100;
|
|
17613
20382
|
var MAX_HELD_DIFF_BYTES = 32 * 1024 * 1024;
|
|
17614
20383
|
var MAX_SEEN_CALL_IDS = 8192;
|
|
@@ -17907,7 +20676,9 @@ function recordAcpToolEvidence(state, part, update) {
|
|
|
17907
20676
|
if (isTerminal(phase))
|
|
17908
20677
|
settleRecord(state, part, record);
|
|
17909
20678
|
} catch (error) {
|
|
17910
|
-
|
|
20679
|
+
log5.warn("evidence.record-failed", {
|
|
20680
|
+
errorClass: error instanceof Error ? error.name : "unknown"
|
|
20681
|
+
});
|
|
17911
20682
|
}
|
|
17912
20683
|
}
|
|
17913
20684
|
function recordAcpToolApproval(state, toolCallId, outcome) {
|
|
@@ -17949,7 +20720,9 @@ function recordAcpShellObservation(state, toolUseId, observation) {
|
|
|
17949
20720
|
...observation.unavailableReason ? { unavailableReason: observation.unavailableReason } : {}
|
|
17950
20721
|
});
|
|
17951
20722
|
} catch (error) {
|
|
17952
|
-
|
|
20723
|
+
log5.warn("evidence.shell-record-failed", {
|
|
20724
|
+
errorClass: error instanceof Error ? error.name : "unknown"
|
|
20725
|
+
});
|
|
17953
20726
|
}
|
|
17954
20727
|
}
|
|
17955
20728
|
function beginAcpTurnEvidence(state, requestId) {
|
|
@@ -17979,11 +20752,14 @@ function endAcpTurnEvidence(state, outcome) {
|
|
|
17979
20752
|
const writers = state.activeSubagentToolIds.size > 0 || turn.backgroundLaunched ? "may-write" : "quiescent";
|
|
17980
20753
|
changeEvidenceRecorder().turn({ conversationId: state.id, turnId: turn.turnId }, outcome, writers);
|
|
17981
20754
|
} catch (error) {
|
|
17982
|
-
|
|
20755
|
+
log5.warn("evidence.turn-record-failed", {
|
|
20756
|
+
errorClass: error instanceof Error ? error.name : "unknown"
|
|
20757
|
+
});
|
|
17983
20758
|
}
|
|
17984
20759
|
}
|
|
17985
20760
|
|
|
17986
20761
|
// ../../bridges/acp-bridge/src/acp-command-changes.ts
|
|
20762
|
+
var log6 = createLogger("bridge.acp");
|
|
17987
20763
|
var MAX_WINDOWS_PER_SESSION = 256;
|
|
17988
20764
|
var MAX_CACHED_JOURNALS = MAX_RESUMABLE_SESSIONS;
|
|
17989
20765
|
var probe;
|
|
@@ -18097,7 +20873,9 @@ function closeWindow(active, state, toolUseId, role) {
|
|
|
18097
20873
|
recordAcpShellObservation(state, toolUseId, observation);
|
|
18098
20874
|
recordCommandChange(state, toolUseId, legacyCommandChange(observation));
|
|
18099
20875
|
}).catch((error) => {
|
|
18100
|
-
|
|
20876
|
+
log6.warn("command-change.record-failed", {
|
|
20877
|
+
errorClass: error instanceof Error ? error.name : "unknown"
|
|
20878
|
+
});
|
|
18101
20879
|
});
|
|
18102
20880
|
}
|
|
18103
20881
|
function legacyCommandChange(observation) {
|
|
@@ -18209,20 +20987,20 @@ async function listResumableSessionsReserved() {
|
|
|
18209
20987
|
for (const candidate of result.sessions) {
|
|
18210
20988
|
if (!isObject3(candidate))
|
|
18211
20989
|
continue;
|
|
18212
|
-
const acpSessionId =
|
|
20990
|
+
const acpSessionId = boundedString2(candidate.sessionId, 512)?.trim();
|
|
18213
20991
|
if (!acpSessionId || seenSessionIds.has(acpSessionId))
|
|
18214
20992
|
continue;
|
|
18215
|
-
const cwd =
|
|
20993
|
+
const cwd = boundedString2(candidate.cwd, MAX_TOOL_PATH_BYTES)?.trim();
|
|
18216
20994
|
if (!cwd || resolve7(cwd) !== workingDirectory)
|
|
18217
20995
|
continue;
|
|
18218
20996
|
seenSessionIds.add(acpSessionId);
|
|
18219
20997
|
const meta = isObject3(candidate._meta) ? candidate._meta : undefined;
|
|
18220
20998
|
const messageCount = Number.isSafeInteger(meta?.messageCount) && Number(meta?.messageCount) >= 0 ? Number(meta.messageCount) : undefined;
|
|
18221
|
-
const createdAt =
|
|
18222
|
-
const updatedAt =
|
|
20999
|
+
const createdAt = boundedString2(candidate.createdAt, 64);
|
|
21000
|
+
const updatedAt = boundedString2(candidate.updatedAt, 64);
|
|
18223
21001
|
listed.push({
|
|
18224
21002
|
id: knownSessions.get(acpSessionId) ?? externalSessionToken(acpSessionId),
|
|
18225
|
-
...
|
|
21003
|
+
...boundedString2(candidate.title, MAX_TOOL_TITLE_BYTES) ? { title: boundedString2(candidate.title, MAX_TOOL_TITLE_BYTES) } : {},
|
|
18226
21004
|
...createdAt ? { createdAt } : {},
|
|
18227
21005
|
...updatedAt ? { updatedAt } : {},
|
|
18228
21006
|
...messageCount === undefined ? {} : { messageCount }
|
|
@@ -18230,7 +21008,7 @@ async function listResumableSessionsReserved() {
|
|
|
18230
21008
|
if (listed.length >= MAX_RESUMABLE_SESSIONS)
|
|
18231
21009
|
break;
|
|
18232
21010
|
}
|
|
18233
|
-
const nextCursor =
|
|
21011
|
+
const nextCursor = boundedString2(result.nextCursor, 4096)?.trim();
|
|
18234
21012
|
if (!nextCursor || seenCursors.has(nextCursor))
|
|
18235
21013
|
break;
|
|
18236
21014
|
seenCursors.add(nextCursor);
|
|
@@ -19201,7 +21979,7 @@ function permissionDetail(params, recorded = {}) {
|
|
|
19201
21979
|
} : { kind: "permission" };
|
|
19202
21980
|
}
|
|
19203
21981
|
if (kind && FILE_CHANGE_TOOL_KINDS.has(kind)) {
|
|
19204
|
-
const located = Array.isArray(call.locations) ? call.locations.flatMap((location) => isObject3(location) ? [
|
|
21982
|
+
const located = Array.isArray(call.locations) ? call.locations.flatMap((location) => isObject3(location) ? [boundedString2(location.path, MAX_TOOL_PATH_BYTES)] : []) : [recorded.locationPath];
|
|
19205
21983
|
const paths = [...new Set([...located, toolArgumentPath(input)])].filter((path) => typeof path === "string" && path.trim().length > 0);
|
|
19206
21984
|
return paths.length > 0 ? {
|
|
19207
21985
|
kind: "file-change",
|
|
@@ -19425,7 +22203,7 @@ function applySessionUpdate(state, params) {
|
|
|
19425
22203
|
}
|
|
19426
22204
|
const partType = kind === "agent_thought_chunk" ? "thinking" : "text";
|
|
19427
22205
|
const isChunk = kind === "user_message_chunk" || kind === "agent_message_chunk" || kind === "agent_thought_chunk";
|
|
19428
|
-
const providerMessageId =
|
|
22206
|
+
const providerMessageId = boundedString2(update.messageId, MAX_TOOL_ID_BYTES)?.trim();
|
|
19429
22207
|
let message = providerMessageId ? findHistoryMessage(state, providerMessageId) : undefined;
|
|
19430
22208
|
const last = state.messages.at(-1);
|
|
19431
22209
|
const startsPart = last?.parts.at(-1)?.type !== partType;
|
|
@@ -19487,7 +22265,7 @@ function applySessionUpdate(state, params) {
|
|
|
19487
22265
|
const nextContent = partType === "text" ? appendSaturating(message, message.content, text, MAX_MESSAGE_TEXT_BYTES) : { value: message.content, truncated: false };
|
|
19488
22266
|
message.content = nextContent.value;
|
|
19489
22267
|
if (role === "assistant" && partType === "text" && state.currentTurnOutput !== null) {
|
|
19490
|
-
const captured = appendBounded(state.currentTurnOutput, text, MAX_MESSAGE_TEXT_BYTES);
|
|
22268
|
+
const captured = appendBounded(state.currentTurnOutput, text, MAX_MESSAGE_TEXT_BYTES, state);
|
|
19491
22269
|
state.currentTurnOutput = captured.value;
|
|
19492
22270
|
if (captured.truncated)
|
|
19493
22271
|
state.outputTruncated = true;
|
|
@@ -20084,6 +22862,155 @@ function turnTerminalError(state, stopReason, promptSequence) {
|
|
|
20084
22862
|
async function dispatchAcpPrompt(state, child, initialPrompt, promptSequence, schema) {
|
|
20085
22863
|
return requestPromptWithRetriableProviderRetries(state, child, initialPrompt, promptSequence, schema);
|
|
20086
22864
|
}
|
|
22865
|
+
// ../protocol/src/log-policy.ts
|
|
22866
|
+
var BRIDGE_DIAGNOSTICS_LOG_AREA = "bridge.diagnostics";
|
|
22867
|
+
var MAX_LOG_DETAIL_AREAS = 256;
|
|
22868
|
+
var MAX_LOG_AREA_NAME_CHARS = 64;
|
|
22869
|
+
var LOG_AREA_NAME = /^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/;
|
|
22870
|
+
function parseLogDetail(value) {
|
|
22871
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
22872
|
+
return null;
|
|
22873
|
+
const { level, areaLevels } = value;
|
|
22874
|
+
if (!isLogLevel(level))
|
|
22875
|
+
return null;
|
|
22876
|
+
if (areaLevels === undefined)
|
|
22877
|
+
return { level, areaLevels: {} };
|
|
22878
|
+
if (typeof areaLevels !== "object" || areaLevels === null || Array.isArray(areaLevels)) {
|
|
22879
|
+
return null;
|
|
22880
|
+
}
|
|
22881
|
+
const names = Object.keys(areaLevels).sort();
|
|
22882
|
+
if (names.length > MAX_LOG_DETAIL_AREAS)
|
|
22883
|
+
return null;
|
|
22884
|
+
const clean = {};
|
|
22885
|
+
for (const name of names) {
|
|
22886
|
+
const areaLevel = areaLevels[name];
|
|
22887
|
+
if (name.length > MAX_LOG_AREA_NAME_CHARS || !LOG_AREA_NAME.test(name))
|
|
22888
|
+
return null;
|
|
22889
|
+
if (!isLogLevel(areaLevel))
|
|
22890
|
+
return null;
|
|
22891
|
+
clean[name] = areaLevel;
|
|
22892
|
+
}
|
|
22893
|
+
return { level, areaLevels: clean };
|
|
22894
|
+
}
|
|
22895
|
+
var LEVEL_DETAIL = {
|
|
22896
|
+
error: 0,
|
|
22897
|
+
warn: 1,
|
|
22898
|
+
info: 2,
|
|
22899
|
+
debug: 3,
|
|
22900
|
+
trace: 4
|
|
22901
|
+
};
|
|
22902
|
+
function effectiveLogLevel(detail, area) {
|
|
22903
|
+
for (let scope = area;; scope = scope.slice(0, scope.lastIndexOf("."))) {
|
|
22904
|
+
const level = Object.hasOwn(detail.areaLevels, scope) ? detail.areaLevels[scope] : undefined;
|
|
22905
|
+
if (level)
|
|
22906
|
+
return level;
|
|
22907
|
+
if (!scope.includes("."))
|
|
22908
|
+
return detail.level;
|
|
22909
|
+
}
|
|
22910
|
+
}
|
|
22911
|
+
function logDetailEnablesBridgeDiagnostics(detail) {
|
|
22912
|
+
return LEVEL_DETAIL[effectiveLogLevel(detail, BRIDGE_DIAGNOSTICS_LOG_AREA)] >= LEVEL_DETAIL.debug;
|
|
22913
|
+
}
|
|
22914
|
+
var BRIDGE_LOG_POLICY_ROUTE = "/debug/log-policy";
|
|
22915
|
+
function parseBridgeLogPolicy(value) {
|
|
22916
|
+
const detail = parseLogDetail(value);
|
|
22917
|
+
if (!detail)
|
|
22918
|
+
return null;
|
|
22919
|
+
const { seq } = value;
|
|
22920
|
+
return Number.isSafeInteger(seq) && seq >= 0 ? { ...detail, seq } : null;
|
|
22921
|
+
}
|
|
22922
|
+
|
|
22923
|
+
// ../protocol/src/node/logger-environment.ts
|
|
22924
|
+
var LOG_LEVEL_ENV = "ORKESTRATOR_LOG_LEVEL";
|
|
22925
|
+
var LOG_FORMAT_ENV = "ORKESTRATOR_LOG_FORMAT";
|
|
22926
|
+
var BRIDGE_LOG_RELAY_ENV = "ORKESTRATOR_BRIDGE_LOG_RELAY";
|
|
22927
|
+
var bridgeLogLevelOverrides = new WeakMap;
|
|
22928
|
+
function logLevelEnvironmentValue(env) {
|
|
22929
|
+
return env[LOG_LEVEL_ENV] ?? bridgeLogLevelOverrides.get(env);
|
|
22930
|
+
}
|
|
22931
|
+
function parseLogLevels(value) {
|
|
22932
|
+
const parsed = { areaLevels: {}, invalid: [] };
|
|
22933
|
+
for (const entry of (value ?? "").split(",")) {
|
|
22934
|
+
const trimmed = entry.trim();
|
|
22935
|
+
if (!trimmed)
|
|
22936
|
+
continue;
|
|
22937
|
+
const separator = trimmed.indexOf("=");
|
|
22938
|
+
if (separator < 0) {
|
|
22939
|
+
if (isLogLevel(trimmed))
|
|
22940
|
+
parsed.level = trimmed;
|
|
22941
|
+
else
|
|
22942
|
+
parsed.invalid.push(trimmed);
|
|
22943
|
+
continue;
|
|
22944
|
+
}
|
|
22945
|
+
const area = trimmed.slice(0, separator);
|
|
22946
|
+
const level = trimmed.slice(separator + 1);
|
|
22947
|
+
if (isLogLevel(level) && isKnownScope(area))
|
|
22948
|
+
parsed.areaLevels[area] = level;
|
|
22949
|
+
else
|
|
22950
|
+
parsed.invalid.push(trimmed);
|
|
22951
|
+
}
|
|
22952
|
+
return parsed;
|
|
22953
|
+
}
|
|
22954
|
+
function isKnownScope(scope) {
|
|
22955
|
+
return Object.keys(LOG_VOCABULARY).some((area) => area === scope || area.startsWith(`${scope}.`));
|
|
22956
|
+
}
|
|
22957
|
+
function configureLoggerFromEnvironment(env, options = {}) {
|
|
22958
|
+
const levels = parseLogLevels(env[LOG_LEVEL_ENV]);
|
|
22959
|
+
const requestedFormat = env[LOG_FORMAT_ENV];
|
|
22960
|
+
const format = options.relayToSupervisor || requestedFormat === "json" ? "json" : "text";
|
|
22961
|
+
configureLogger({
|
|
22962
|
+
...levels.level ? { level: levels.level } : {},
|
|
22963
|
+
areaLevels: levels.areaLevels,
|
|
22964
|
+
format
|
|
22965
|
+
});
|
|
22966
|
+
const log = createLogger("logging");
|
|
22967
|
+
if (levels.invalid.length > 0) {
|
|
22968
|
+
log.warn("config.invalid", { variable: LOG_LEVEL_ENV, entries: levels.invalid.length });
|
|
22969
|
+
}
|
|
22970
|
+
if (requestedFormat && requestedFormat !== "json" && requestedFormat !== "text") {
|
|
22971
|
+
log.warn("config.invalid", { variable: LOG_FORMAT_ENV, entries: 1 });
|
|
22972
|
+
}
|
|
22973
|
+
}
|
|
22974
|
+
function configureBridgeLogger(env = process.env) {
|
|
22975
|
+
const relayToSupervisor = env[BRIDGE_LOG_RELAY_ENV] === "1";
|
|
22976
|
+
bridgeLogLevelOverrides.set(env, env[LOG_LEVEL_ENV]);
|
|
22977
|
+
delete env[BRIDGE_LOG_RELAY_ENV];
|
|
22978
|
+
configureLoggerFromEnvironment(env, { relayToSupervisor });
|
|
22979
|
+
delete env[LOG_FORMAT_ENV];
|
|
22980
|
+
delete env[LOG_LEVEL_ENV];
|
|
22981
|
+
}
|
|
22982
|
+
|
|
22983
|
+
// ../protocol/src/node/log-policy.ts
|
|
22984
|
+
function effectiveLogDetail(detail, env = process.env) {
|
|
22985
|
+
const overrides = parseLogLevels(logLevelEnvironmentValue(env));
|
|
22986
|
+
return {
|
|
22987
|
+
level: overrides.level ?? detail.level,
|
|
22988
|
+
areaLevels: { ...detail.areaLevels, ...overrides.areaLevels }
|
|
22989
|
+
};
|
|
22990
|
+
}
|
|
22991
|
+
function applyLogDetail(detail, env = process.env) {
|
|
22992
|
+
const effective = effectiveLogDetail(detail, env);
|
|
22993
|
+
configureLogger(effective);
|
|
22994
|
+
return effective;
|
|
22995
|
+
}
|
|
22996
|
+
|
|
22997
|
+
// ../protocol/src/node/bridge-log-policy.ts
|
|
22998
|
+
var MAX_BRIDGE_LOG_POLICY_BYTES = 64 * 1024;
|
|
22999
|
+
var appliedSeq = -1;
|
|
23000
|
+
function applyBridgeLogPolicy(value, env = process.env) {
|
|
23001
|
+
const policy = parseBridgeLogPolicy(value);
|
|
23002
|
+
if (!policy)
|
|
23003
|
+
return { status: 400, body: { error: "Invalid log policy" } };
|
|
23004
|
+
if (policy.seq < appliedSeq) {
|
|
23005
|
+
return { status: 200, body: { applied: false, stale: true, seq: appliedSeq } };
|
|
23006
|
+
}
|
|
23007
|
+
appliedSeq = policy.seq;
|
|
23008
|
+
const effective = applyLogDetail(policy, env);
|
|
23009
|
+
const diagnostics = logDetailEnablesBridgeDiagnostics(effective);
|
|
23010
|
+
setLiveBridgeDiagnostics(diagnostics);
|
|
23011
|
+
return { status: 200, body: { applied: true, seq: policy.seq, diagnostics } };
|
|
23012
|
+
}
|
|
23013
|
+
|
|
20087
23014
|
// ../../bridges/acp-bridge/src/acp-fork.ts
|
|
20088
23015
|
var COMPACT_PROMPT = "/compact";
|
|
20089
23016
|
function normalizedPrompt(text) {
|
|
@@ -20191,6 +23118,7 @@ async function forkAcpSession(state, upToMessageId, signal) {
|
|
|
20191
23118
|
|
|
20192
23119
|
// ../protocol/src/human-prompts.ts
|
|
20193
23120
|
var HUMAN_PROMPT_SCAN_BYTES = 16 * 1024;
|
|
23121
|
+
var HUMAN_PROMPT_OBSERVATION_ROWS = 64;
|
|
20194
23122
|
function humanPromptObservation(messages, tasks) {
|
|
20195
23123
|
const object = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
20196
23124
|
const parts = [];
|
|
@@ -20224,7 +23152,7 @@ function humanPromptObservation(messages, tasks) {
|
|
|
20224
23152
|
}
|
|
20225
23153
|
};
|
|
20226
23154
|
if (Array.isArray(messages)) {
|
|
20227
|
-
for (let i = messages.length - 1;i >= Math.max(0, messages.length -
|
|
23155
|
+
for (let i = messages.length - 1;i >= Math.max(0, messages.length - HUMAN_PROMPT_OBSERVATION_ROWS); i--) {
|
|
20228
23156
|
const message = messages[i];
|
|
20229
23157
|
if (object(message))
|
|
20230
23158
|
walk(message.parts);
|
|
@@ -20680,7 +23608,7 @@ var DEFAULT_MCP_MANAGEMENT_ROLLOUT = Object.freeze({
|
|
|
20680
23608
|
});
|
|
20681
23609
|
|
|
20682
23610
|
// ../protocol/src/node/bridge-transcript-summary.ts
|
|
20683
|
-
import { Buffer as
|
|
23611
|
+
import { Buffer as Buffer5 } from "node:buffer";
|
|
20684
23612
|
import { createHash as createHash8 } from "node:crypto";
|
|
20685
23613
|
|
|
20686
23614
|
// ../protocol/src/node/progressive-transcript.ts
|
|
@@ -20765,7 +23693,7 @@ var MAX_SUMMARY_DEPTH = 8;
|
|
|
20765
23693
|
var NESTED_PART_FIELDS = ["parts", "childTools", "subagentActions"];
|
|
20766
23694
|
var LOCATOR_PREFIX = "bd1.";
|
|
20767
23695
|
function encodeLocator(body) {
|
|
20768
|
-
const locator = LOCATOR_PREFIX +
|
|
23696
|
+
const locator = LOCATOR_PREFIX + Buffer5.from(JSON.stringify(body)).toString("base64url");
|
|
20769
23697
|
return locator.length <= BRIDGE_DETAIL_LOCATOR_MAX_LENGTH ? locator : undefined;
|
|
20770
23698
|
}
|
|
20771
23699
|
function decodeLocator(locator) {
|
|
@@ -20773,7 +23701,7 @@ function decodeLocator(locator) {
|
|
|
20773
23701
|
return;
|
|
20774
23702
|
}
|
|
20775
23703
|
try {
|
|
20776
|
-
const body = JSON.parse(
|
|
23704
|
+
const body = JSON.parse(Buffer5.from(locator.slice(LOCATOR_PREFIX.length), "base64url").toString("utf8"));
|
|
20777
23705
|
if (!isRecord4(body))
|
|
20778
23706
|
return;
|
|
20779
23707
|
const { m, p, d } = body;
|
|
@@ -20846,7 +23774,7 @@ function measureDetail(part, payload) {
|
|
|
20846
23774
|
function digestPayload(payload) {
|
|
20847
23775
|
const serialized = JSON.stringify(payload);
|
|
20848
23776
|
return {
|
|
20849
|
-
bytes:
|
|
23777
|
+
bytes: Buffer5.byteLength(serialized),
|
|
20850
23778
|
digest: createHash8("sha256").update(serialized).digest("base64url").slice(0, 32)
|
|
20851
23779
|
};
|
|
20852
23780
|
}
|
|
@@ -21021,7 +23949,7 @@ function revisedBeforeWindow(messages, startIndex, ids) {
|
|
|
21021
23949
|
continue;
|
|
21022
23950
|
found.delete(id);
|
|
21023
23951
|
const summary = summarizeBridgeMessage(message);
|
|
21024
|
-
const size =
|
|
23952
|
+
const size = Buffer5.byteLength(JSON.stringify(summary));
|
|
21025
23953
|
if (revised.length >= BRIDGE_REVISED_MESSAGES_MAX || bytes + size > BRIDGE_REVISED_MESSAGES_MAX_BYTES) {
|
|
21026
23954
|
omitted.push(summary);
|
|
21027
23955
|
continue;
|
|
@@ -21083,7 +24011,7 @@ function bridgeTranscriptSummaryUpdate(messages, options) {
|
|
|
21083
24011
|
}
|
|
21084
24012
|
var PAGE_CURSOR_PREFIX = "bp1.";
|
|
21085
24013
|
function encodePageCursor(body) {
|
|
21086
|
-
const cursor = PAGE_CURSOR_PREFIX +
|
|
24014
|
+
const cursor = PAGE_CURSOR_PREFIX + Buffer5.from(JSON.stringify(body)).toString("base64url");
|
|
21087
24015
|
return cursor.length <= BRIDGE_PAGE_CURSOR_MAX_LENGTH ? cursor : undefined;
|
|
21088
24016
|
}
|
|
21089
24017
|
function decodePageCursor(cursor) {
|
|
@@ -21091,7 +24019,7 @@ function decodePageCursor(cursor) {
|
|
|
21091
24019
|
return;
|
|
21092
24020
|
}
|
|
21093
24021
|
try {
|
|
21094
|
-
const body = JSON.parse(
|
|
24022
|
+
const body = JSON.parse(Buffer5.from(cursor.slice(PAGE_CURSOR_PREFIX.length), "base64url").toString("utf8"));
|
|
21095
24023
|
if (!isRecord4(body))
|
|
21096
24024
|
return;
|
|
21097
24025
|
const { g, e, b } = body;
|
|
@@ -21658,6 +24586,10 @@ async function route(request, response, clientSignal) {
|
|
|
21658
24586
|
});
|
|
21659
24587
|
return json(response, answer.status, answer.body);
|
|
21660
24588
|
}
|
|
24589
|
+
if (url.pathname === BRIDGE_LOG_POLICY_ROUTE && request.method === "POST") {
|
|
24590
|
+
const answer = applyBridgeLogPolicy(await readJson(request));
|
|
24591
|
+
return json(response, answer.status, answer.body);
|
|
24592
|
+
}
|
|
21661
24593
|
const match = /^\/session\/([^/]+)(?:\/(close|messages|transcript(?:\/(?:detail|page))?|status|activity|human-prompts|prompt|compact|fork|attach|dispatch|cancel|abort|structured-output|interactions(?:\/[^/]+(?:\/hold)?)?|config|commands(?:\/refresh)?|mcp|approvals(?:\/[^/]+(?:\/hold)?)?|runtime-health))?$/.exec(url.pathname);
|
|
21662
24594
|
if (!match)
|
|
21663
24595
|
return json(response, 404, { error: "Not found" });
|
|
@@ -22520,6 +25452,8 @@ function watchClientDisconnect(request, response, onDisconnect) {
|
|
|
22520
25452
|
}
|
|
22521
25453
|
|
|
22522
25454
|
// ../../bridges/acp-bridge/src/acp-server.ts
|
|
25455
|
+
var log7 = createLogger("bridge.acp");
|
|
25456
|
+
configureBridgeLogger();
|
|
22523
25457
|
await restorePersistedState();
|
|
22524
25458
|
var server = createServer((request, response) => {
|
|
22525
25459
|
response[RESPONSE_ACCEPTS_GZIP] = acceptsGzip(request.headers["accept-encoding"]);
|
|
@@ -22536,7 +25470,7 @@ var server = createServer((request, response) => {
|
|
|
22536
25470
|
json(response, status, { error: error instanceof Error ? error.message : String(error) });
|
|
22537
25471
|
}).finally(stopWatchingClient);
|
|
22538
25472
|
});
|
|
22539
|
-
server.listen(port, hostname, () =>
|
|
25473
|
+
server.listen(port, hostname, () => log7.info("server.listening", { provider, hostname, port }));
|
|
22540
25474
|
var shutdownPromise = null;
|
|
22541
25475
|
function shutdown() {
|
|
22542
25476
|
if (shutdownPromise)
|
|
@@ -22706,7 +25640,7 @@ export {
|
|
|
22706
25640
|
boundedDurationMs,
|
|
22707
25641
|
boundedFallbackDiff,
|
|
22708
25642
|
boundedNullableString,
|
|
22709
|
-
boundedString,
|
|
25643
|
+
boundedString2 as boundedString,
|
|
22710
25644
|
boundedToolArguments,
|
|
22711
25645
|
bumpCursorDiscoveryRevision,
|
|
22712
25646
|
cancelCursorToolMetadataReconcile,
|