orkestrator 2.35.4-beta → 2.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1733 -554
- package/dist/main.js +199894 -190292
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +1471 -537
- package/resources/claude-bridge/dist/index.js +1231 -160
- package/resources/codex-bridge/dist/index.js +1521 -243
- package/resources/cursor-bridge/dist/index.js +932 -51
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +964 -53
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -1,230 +1,10 @@
|
|
|
1
1
|
// ../protocol/src/node/bridge-diagnostics.ts
|
|
2
2
|
import { createHash } from "node:crypto";
|
|
3
3
|
|
|
4
|
-
// ../protocol/src/log-vocabulary/define.ts
|
|
5
|
-
var THROTTLE_LOG_EVENTS = {
|
|
6
|
-
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
7
|
-
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
8
|
-
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
9
|
-
};
|
|
10
|
-
function defineLogAreas(areas) {
|
|
11
|
-
return areas;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// ../protocol/src/log-vocabulary/bridge.ts
|
|
15
|
-
var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
|
|
16
|
-
var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
17
|
-
"bridge.diagnostics": {
|
|
18
|
-
description: "Metadata snapshots of bridge turns and processes, written while Save Logs for Debugging is on. docs/architecture/bridge-diagnostics.md reads them.",
|
|
19
|
-
tag: "bridge-diagnostics",
|
|
20
|
-
maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
|
|
21
|
-
events: {
|
|
22
|
-
heartbeat: "The once-a-minute snapshot of a turn or process that is still open.",
|
|
23
|
-
"send-started": "A turn or process diagnostic scope began.",
|
|
24
|
-
"send-resolved": "The provider accepted a dispatch.",
|
|
25
|
-
"cancel-requested": "Cancellation of a turn was requested.",
|
|
26
|
-
"cancel-settled": "The provider's cancel call returned or failed.",
|
|
27
|
-
closed: "A diagnostic scope ended, with its final counters.",
|
|
28
|
-
"snapshot-overflow": "A snapshot exceeded the bound, so only its size was written.",
|
|
29
|
-
"debug-events": "A batch of allowlisted debug labels with their counts.",
|
|
30
|
-
"setup-failed": "A Cursor setup step failed and swallowed its error.",
|
|
31
|
-
"sdk-snapshot": "Cursor's SDK transports and executions at a boundary.",
|
|
32
|
-
"sdk-snapshot-overflow": "A Cursor SDK snapshot exceeded the bound, so it was omitted."
|
|
33
|
-
}
|
|
34
|
-
},
|
|
35
|
-
"bridge.lifecycle": {
|
|
36
|
-
description: "What every long-lived bridge does the same way: its sweep and its shutdown.",
|
|
37
|
-
events: {
|
|
38
|
-
"idle-sweep.failed": "An idle sweep threw; the next tick retries.",
|
|
39
|
-
"shutdown.failed": "Releasing the bridge failed during shutdown; it still exits."
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
"bridge.acp": {
|
|
43
|
-
description: "The ACP bridge behind Grok: its routes, sessions, saved state and change evidence.",
|
|
44
|
-
events: {
|
|
45
|
-
"command-change.record-failed": "A measured command change could not be recorded.",
|
|
46
|
-
"evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
|
|
47
|
-
"evidence.shell-record-failed": "A shell observation could not be recorded.",
|
|
48
|
-
"evidence.turn-record-failed": "Turn change evidence could not be recorded.",
|
|
49
|
-
"server.listening": "The HTTP server is listening.",
|
|
50
|
-
"state.composer-reset": "A saved composer state was malformed and was reset.",
|
|
51
|
-
"state.discarded": "Saved bridge state could not be used and was discarded.",
|
|
52
|
-
"state.persist-failed": "Saving bridge state failed; a later write retries.",
|
|
53
|
-
"state.session-config-reset": "A saved session configuration was malformed and was reset."
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"bridge.claude": {
|
|
57
|
-
description: "The Claude bridge: its routes, sessions, parked interactions and the Agent SDK turn loop.",
|
|
58
|
-
events: {
|
|
59
|
-
"commands.read-failed": "The command catalogue read failed; the cached answer stands.",
|
|
60
|
-
"context-usage.read-failed": "The detailed context usage read failed; the route falls back.",
|
|
61
|
-
"dispatch.rollback-failed": "Rolling back a prompt dispatch claim failed.",
|
|
62
|
-
"event-subscriber.failed": "An event subscriber threw; other subscribers still ran.",
|
|
63
|
-
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
64
|
-
"mcp.config-ignored": "An MCP server configuration of an unsupported shape was ignored.",
|
|
65
|
-
"mcp.read-failed": "Listing MCP servers failed; the route answered 500.",
|
|
66
|
-
"models.fetch-failed": "Reading the supported models failed; the fallback catalogue is served.",
|
|
67
|
-
"models.requested": "The model catalogue route was called.",
|
|
68
|
-
"models.responded": "The model catalogue route answered.",
|
|
69
|
-
"parent.gone": "The backend that launched this bridge has gone; shutting down.",
|
|
70
|
-
"plan-approval.responding": "Answering a parked plan approval.",
|
|
71
|
-
"plan-approval.response-failed": "The plan approval route failed.",
|
|
72
|
-
"plan-approval.response-received": "The route received a plan approval answer.",
|
|
73
|
-
"plan-approval.result": "A parked plan approval was answered.",
|
|
74
|
-
"plan-approval.wait-failed": "A parked plan approval ended without an answer: cancelled, timed out or closed.",
|
|
75
|
-
"plan-exit.failure-overridden": "ExitPlanMode failed after the user approved; treated as success with a continuation re-prompt.",
|
|
76
|
-
"plan-mode.record-failed": "Plan mode from a status frame could not be recorded.",
|
|
77
|
-
"plan.reprompt-approved-failed": "Re-prompting after an approved plan failed.",
|
|
78
|
-
"plan.reprompt-feedback-failed": "Re-prompting with plan rejection feedback failed.",
|
|
79
|
-
"plugin.path-missing": "A configured plugin was skipped because its path does not exist.",
|
|
80
|
-
"plugin.unsafe-path": "An installed plugin was skipped because its install path is unsafe.",
|
|
81
|
-
"plugins.read-failed": "Listing plugins failed; the route answered 500.",
|
|
82
|
-
"prompt.accepted": "The route accepted a prompt and answered 202.",
|
|
83
|
-
"prompt.failed": "A prompt turn failed; the session reports the error.",
|
|
84
|
-
"prompt.processing-failed": "A prompt accepted by the route failed while processing.",
|
|
85
|
-
"prompt.received": "A prompt reached the bridge; only its length is logged.",
|
|
86
|
-
"prompt.send-failed": "A prompt request failed; the route answered with an error.",
|
|
87
|
-
"query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
|
|
88
|
-
"query.failed": "A Claude query ended with an error result.",
|
|
89
|
-
"question.answer-failed": "The answer-question route failed.",
|
|
90
|
-
"question.answering": "Answering a parked question.",
|
|
91
|
-
"question.answers-prepared": "The route prepared a question answer for the session.",
|
|
92
|
-
"question.answers-received": "A parked question received its answers.",
|
|
93
|
-
"question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
|
|
94
|
-
"question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
|
|
95
|
-
"runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
|
|
96
|
-
"server.listening": "The HTTP server is listening.",
|
|
97
|
-
"server.starting": "The HTTP server is about to bind.",
|
|
98
|
-
"session.compact-failed": "A requested compaction failed.",
|
|
99
|
-
"session.create-failed": "Creating a session failed; the route answered with an error.",
|
|
100
|
-
"session.created": "A session was created or recovered.",
|
|
101
|
-
"session.delete-failed": "Deleting a session failed.",
|
|
102
|
-
"session.fork-failed": "Forking a session failed.",
|
|
103
|
-
"session.rename-failed": "Renaming a session failed.",
|
|
104
|
-
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
105
|
-
"session.rewind-failed": "Rewinding session files failed.",
|
|
106
|
-
"session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
|
|
107
|
-
"sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
|
|
108
|
-
"sse.aborted": "The client closed an event stream.",
|
|
109
|
-
"sse.cleanup": "An event stream connection was released.",
|
|
110
|
-
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
111
|
-
"sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
|
|
112
|
-
"sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
|
|
113
|
-
"sse.opened": "An event stream connection opened.",
|
|
114
|
-
"sse.subscribe-requested": "A client asked to subscribe to the event stream.",
|
|
115
|
-
"sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
|
|
116
|
-
"task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
|
|
117
|
-
"task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
|
|
118
|
-
"task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
|
|
119
|
-
"task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
|
|
120
|
-
"task.stop-route-failed": "The stop-task route failed.",
|
|
121
|
-
"transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
|
|
122
|
-
"transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
|
|
123
|
-
}
|
|
124
|
-
},
|
|
125
|
-
"bridge.codex": {
|
|
126
|
-
description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
|
|
127
|
-
events: {
|
|
128
|
-
"account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
|
|
129
|
-
"account.login-reload-failed": "Reloading the stored account login failed.",
|
|
130
|
-
"account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
|
|
131
|
-
"account.usage-read-failed": "Reading account usage failed; the route answers 503.",
|
|
132
|
-
"app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
|
|
133
|
-
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
134
|
-
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
135
|
-
"app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
|
|
136
|
-
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
137
|
-
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
138
|
-
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
139
|
-
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
140
|
-
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
141
|
-
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
142
|
-
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
143
|
-
"command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
|
|
144
|
-
"dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
|
|
145
|
-
"dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
|
|
146
|
-
"engine.listener-failed": "An engine event listener threw; the others still ran.",
|
|
147
|
-
"engine.ready": "The app-server engine started.",
|
|
148
|
-
"engine.start-failed": "The app-server engine failed to start; reported through health.",
|
|
149
|
-
"engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
|
|
150
|
-
"generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
|
|
151
|
-
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
152
|
-
"idle-sweep.failed": "An idle sweep failed; the next one retries.",
|
|
153
|
-
"interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
|
|
154
|
-
"interaction.resolved-callback-failed": "An interaction resolved callback threw.",
|
|
155
|
-
"journal.persist-failed": "Saving the dispatch journal failed.",
|
|
156
|
-
"message.publish-failed": "Publishing a message update failed.",
|
|
157
|
-
"models.cache-persist-failed": "Saving the model cache failed.",
|
|
158
|
-
"models.debug-read-failed": "`codex debug models` failed; another source is used.",
|
|
159
|
-
"models.list-failed": "model/list failed; the cached models are served.",
|
|
160
|
-
"models.refresh-failed": "A background model refresh failed; the cache stands.",
|
|
161
|
-
"notification.enqueue-failed": "Queueing a notification threw.",
|
|
162
|
-
"ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
|
|
163
|
-
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
164
|
-
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
165
|
-
"parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
|
|
166
|
-
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
167
|
-
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
168
|
-
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
169
|
-
"recorder.threw": "The notification recorder threw.",
|
|
170
|
-
"recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
|
|
171
|
-
"registry.persist-failed": "Saving the session registry failed; a later write retries.",
|
|
172
|
-
"rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
|
|
173
|
-
"runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
|
|
174
|
-
"runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
|
|
175
|
-
"server-request.answer-failed": "Answering a server request failed.",
|
|
176
|
-
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
177
|
-
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
178
|
-
"session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
|
|
179
|
-
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
180
|
-
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
181
|
-
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
182
|
-
"sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
|
|
183
|
-
"sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
|
|
184
|
-
"sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
|
|
185
|
-
"subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
|
|
186
|
-
"thread.archive-failed": "Archiving or unarchiving a thread failed.",
|
|
187
|
-
"thread.fork-failed": "thread/fork failed; the route answers 503.",
|
|
188
|
-
"thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
|
|
189
|
-
"thread.reattach-failed": "A thread could not be re-attached.",
|
|
190
|
-
"thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
|
|
191
|
-
"thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
|
|
192
|
-
"thread.turns-read-failed": "A thread's turns could not be read.",
|
|
193
|
-
"thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
|
|
194
|
-
"threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
|
|
195
|
-
"transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
|
|
196
|
-
"turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
|
|
197
|
-
"turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
|
|
198
|
-
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
199
|
-
"turns.stopped": "Running turns were stopped because the backend went away."
|
|
200
|
-
}
|
|
201
|
-
},
|
|
202
|
-
"bridge.cursor": {
|
|
203
|
-
description: "The Cursor bridge: its routes, sessions and saved state.",
|
|
204
|
-
events: {
|
|
205
|
-
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
206
|
-
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
207
|
-
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
208
|
-
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
209
|
-
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
210
|
-
"state.publication-recovered": "Saving bridge state recovered.",
|
|
211
|
-
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
|
|
212
|
-
}
|
|
213
|
-
},
|
|
214
|
-
"bridge.pi": {
|
|
215
|
-
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
216
|
-
events: {
|
|
217
|
-
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
218
|
-
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
219
|
-
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
});
|
|
223
|
-
|
|
224
4
|
// ../protocol/src/secret-redaction.ts
|
|
225
5
|
var TEXT_RULES = [
|
|
226
6
|
{
|
|
227
|
-
pattern: /([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
|
|
7
|
+
pattern: /(?<![a-z0-9+.-])([a-z][a-z0-9+.-]*:\/\/)[^/\s:@]+(?::[^/\s@]*)?@/gi,
|
|
228
8
|
replacement: "$1[redacted]@"
|
|
229
9
|
},
|
|
230
10
|
{
|
|
@@ -244,7 +24,7 @@ var TEXT_RULES = [
|
|
|
244
24
|
{ pattern: /\bAKIA[0-9A-Z]{12,}/g, replacement: "[redacted]" },
|
|
245
25
|
{ pattern: /\bAIza[0-9A-Za-z_-]{20,}/g, replacement: "[redacted]" },
|
|
246
26
|
{
|
|
247
|
-
pattern:
|
|
27
|
+
pattern: /(?<![A-Za-z0-9_-])(-*\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,
|
|
248
28
|
replacement: "$1$2[redacted]"
|
|
249
29
|
}
|
|
250
30
|
];
|
|
@@ -328,8 +108,10 @@ function stackFrames(target, message) {
|
|
|
328
108
|
`).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText(relativeFrame(line), MAX_FRAME_CHARS));
|
|
329
109
|
return frames.length > 0 ? frames : undefined;
|
|
330
110
|
}
|
|
331
|
-
function describe(error, includeStack, depth) {
|
|
111
|
+
function describe(error, includeStack, includeMessage, depth) {
|
|
332
112
|
if (typeof error !== "object" || error === null) {
|
|
113
|
+
if (!includeMessage)
|
|
114
|
+
return { name: "NonError" };
|
|
333
115
|
return {
|
|
334
116
|
name: "NonError",
|
|
335
117
|
message: typeof error === "string" ? boundedText(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
|
|
@@ -346,7 +128,7 @@ function describe(error, includeStack, depth) {
|
|
|
346
128
|
const details = { name };
|
|
347
129
|
if (commandFailure)
|
|
348
130
|
details.outputOmitted = true;
|
|
349
|
-
else if (message)
|
|
131
|
+
else if (message && includeMessage)
|
|
350
132
|
details.message = boundedText(message, MAX_MESSAGE_CHARS);
|
|
351
133
|
const code = read(error, "code");
|
|
352
134
|
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
@@ -374,13 +156,13 @@ function describe(error, includeStack, depth) {
|
|
|
374
156
|
details.errorCount = members.length;
|
|
375
157
|
const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
|
|
376
158
|
if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
|
|
377
|
-
details.cause = describe(cause, false, depth + 1);
|
|
159
|
+
details.cause = describe(cause, false, includeMessage, depth + 1);
|
|
378
160
|
}
|
|
379
161
|
return details;
|
|
380
162
|
}
|
|
381
163
|
function formatLogError(error, options = {}) {
|
|
382
164
|
try {
|
|
383
|
-
return brand(describe(error, options.stack !== false, 0));
|
|
165
|
+
return brand(describe(error, options.stack !== false, options.message !== false, 0));
|
|
384
166
|
} catch {
|
|
385
167
|
return brand({ name: "Error", message: "[unreadable]" });
|
|
386
168
|
}
|
|
@@ -397,32 +179,287 @@ function logErrorKind(error) {
|
|
|
397
179
|
return matching(read(error, "name"), NAME_PATTERN) ?? "Error";
|
|
398
180
|
}
|
|
399
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
|
+
|
|
400
192
|
// ../protocol/src/log-vocabulary/agent-mail.ts
|
|
401
193
|
var AGENT_MAIL_LOG_AREAS = defineLogAreas({
|
|
402
194
|
"agent-mail": {
|
|
403
195
|
description: "Delivering agent mail into waiting agent sessions.",
|
|
404
196
|
events: {
|
|
405
|
-
"delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged."
|
|
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.policy-widening-refused": "A config request tried to widen a live session's execution policy and was refused; widened names the axes.",
|
|
346
|
+
"session.rename-failed": "Renaming a session failed.",
|
|
347
|
+
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
348
|
+
"session.rewind-failed": "Rewinding session files failed.",
|
|
349
|
+
"session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
|
|
350
|
+
"sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
|
|
351
|
+
"sse.aborted": "The client closed an event stream.",
|
|
352
|
+
"sse.cleanup": "An event stream connection was released.",
|
|
353
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
354
|
+
"sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
|
|
355
|
+
"sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
|
|
356
|
+
"sse.opened": "An event stream connection opened.",
|
|
357
|
+
"sse.subscribe-requested": "A client asked to subscribe to the event stream.",
|
|
358
|
+
"sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
|
|
359
|
+
"task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
|
|
360
|
+
"task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
|
|
361
|
+
"task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
|
|
362
|
+
"task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
|
|
363
|
+
"task.stop-route-failed": "The stop-task route failed.",
|
|
364
|
+
"transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
|
|
365
|
+
"transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
|
|
366
|
+
}
|
|
367
|
+
},
|
|
368
|
+
"bridge.codex": {
|
|
369
|
+
description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
|
|
370
|
+
events: {
|
|
371
|
+
"account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
|
|
372
|
+
"account.login-reload-failed": "Reloading the stored account login failed.",
|
|
373
|
+
"account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
|
|
374
|
+
"account.usage-read-failed": "Reading account usage failed; the route answers 503.",
|
|
375
|
+
"app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
|
|
376
|
+
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
377
|
+
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
378
|
+
"app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
|
|
379
|
+
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
380
|
+
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
381
|
+
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
382
|
+
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
383
|
+
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
384
|
+
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
385
|
+
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
386
|
+
"command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
|
|
387
|
+
"dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
|
|
388
|
+
"dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
|
|
389
|
+
"engine.listener-failed": "An engine event listener threw; the others still ran.",
|
|
390
|
+
"engine.ready": "The app-server engine started.",
|
|
391
|
+
"engine.start-failed": "The app-server engine failed to start; reported through health.",
|
|
392
|
+
"engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
|
|
393
|
+
"generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
|
|
394
|
+
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
395
|
+
"idle-sweep.failed": "An idle sweep failed; the next one retries.",
|
|
396
|
+
"interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
|
|
397
|
+
"interaction.resolved-callback-failed": "An interaction resolved callback threw.",
|
|
398
|
+
"journal.persist-failed": "Saving the dispatch journal failed.",
|
|
399
|
+
"message.publish-failed": "Publishing a message update failed.",
|
|
400
|
+
"models.cache-persist-failed": "Saving the model cache failed.",
|
|
401
|
+
"models.debug-read-failed": "`codex debug models` failed; another source is used.",
|
|
402
|
+
"models.list-failed": "model/list failed; the cached models are served.",
|
|
403
|
+
"models.refresh-failed": "A background model refresh failed; the cache stands.",
|
|
404
|
+
"notification.enqueue-failed": "Queueing a notification threw.",
|
|
405
|
+
"ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
|
|
406
|
+
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
407
|
+
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
408
|
+
"parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
|
|
409
|
+
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
410
|
+
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
411
|
+
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
412
|
+
"recorder.threw": "The notification recorder threw.",
|
|
413
|
+
"recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
|
|
414
|
+
"registry.persist-failed": "Saving the session registry failed; a later write retries.",
|
|
415
|
+
"rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
|
|
416
|
+
"runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
|
|
417
|
+
"runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
|
|
418
|
+
"server-request.answer-failed": "Answering a server request failed.",
|
|
419
|
+
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
420
|
+
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
421
|
+
"session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
|
|
422
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
423
|
+
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
424
|
+
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
425
|
+
"sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
|
|
426
|
+
"sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
|
|
427
|
+
"sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
|
|
428
|
+
"subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
|
|
429
|
+
"thread.archive-failed": "Archiving or unarchiving a thread failed.",
|
|
430
|
+
"thread.fork-failed": "thread/fork failed; the route answers 503.",
|
|
431
|
+
"thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
|
|
432
|
+
"thread.reattach-failed": "A thread could not be re-attached.",
|
|
433
|
+
"thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
|
|
434
|
+
"thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
|
|
435
|
+
"thread.turns-read-failed": "A thread's turns could not be read.",
|
|
436
|
+
"thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
|
|
437
|
+
"threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
|
|
438
|
+
"transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
|
|
439
|
+
"turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
|
|
440
|
+
"turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
|
|
441
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
442
|
+
"turns.stopped": "Running turns were stopped because the backend went away."
|
|
406
443
|
}
|
|
407
|
-
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
// ../protocol/src/log-vocabulary/backend.ts
|
|
411
|
-
var BACKEND_LOG_AREAS = defineLogAreas({
|
|
412
|
-
"build.pipeline": {
|
|
413
|
-
description: "Build delivery, ticket reconciliation and persisted pipeline recovery.",
|
|
444
|
+
},
|
|
445
|
+
"bridge.cursor": {
|
|
446
|
+
description: "The Cursor bridge: its routes, sessions and saved state.",
|
|
414
447
|
events: {
|
|
415
|
-
"
|
|
416
|
-
"
|
|
417
|
-
"
|
|
418
|
-
"
|
|
448
|
+
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
449
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
450
|
+
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
451
|
+
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
452
|
+
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
453
|
+
"state.publication-recovered": "Saving bridge state recovered.",
|
|
454
|
+
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
|
|
419
455
|
}
|
|
420
456
|
},
|
|
421
|
-
"
|
|
422
|
-
description: "The
|
|
457
|
+
"bridge.pi": {
|
|
458
|
+
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
423
459
|
events: {
|
|
424
|
-
"
|
|
425
|
-
|
|
460
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
461
|
+
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
462
|
+
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
|
|
426
463
|
}
|
|
427
464
|
}
|
|
428
465
|
});
|
|
@@ -438,6 +475,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
438
475
|
"backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
|
|
439
476
|
"backend.start-failed": "The Local backend did not start; continuing with remote machines.",
|
|
440
477
|
"clipboard.write-failed": "Writing text to the system clipboard failed.",
|
|
478
|
+
"dev-mode.ignored-packaged": "A packaged app was launched with ELECTRON_DEV=1 and ignored it; it loads its bundled renderer.",
|
|
441
479
|
"instance.already-running": "Another instance holds this data directory; this one will quit.",
|
|
442
480
|
"main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
|
|
443
481
|
"quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
|
|
@@ -510,7 +548,8 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
510
548
|
description: "Preparing the pinned agent toolchain at desktop startup.",
|
|
511
549
|
events: {
|
|
512
550
|
"bootstrap-progress.show-failed": "The toolchain progress window could not be shown.",
|
|
513
|
-
"prepare.failed": "Preparing the pinned agent tools failed."
|
|
551
|
+
"prepare.failed": "Preparing the pinned agent tools failed.",
|
|
552
|
+
"prepare.ready": "The pinned agent tools were verified and activated; durationMs is how long startup waited."
|
|
514
553
|
}
|
|
515
554
|
},
|
|
516
555
|
"artifact-host": {
|
|
@@ -524,7 +563,7 @@ var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
|
524
563
|
// ../protocol/src/log-vocabulary/environment.ts
|
|
525
564
|
var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
526
565
|
environment: {
|
|
527
|
-
description: "Environment naming,
|
|
566
|
+
description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
|
|
528
567
|
events: {
|
|
529
568
|
"cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
|
|
530
569
|
"rename.failed": "Naming an environment from its pending prompt failed for the first time.",
|
|
@@ -533,6 +572,40 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
533
572
|
"setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
|
|
534
573
|
"setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
|
|
535
574
|
"setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
|
|
575
|
+
"cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
|
|
576
|
+
"cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
|
|
577
|
+
"cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
|
|
578
|
+
"cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
|
|
579
|
+
"cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
|
|
580
|
+
"cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
|
|
581
|
+
"cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
|
|
582
|
+
"orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
|
|
583
|
+
"orphan-state.removed": "Orphaned environment state directories were removed.",
|
|
584
|
+
"orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
|
|
585
|
+
"orphan-canvas.removed": "Orphaned design canvases were removed.",
|
|
586
|
+
"orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
|
|
587
|
+
"orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
|
|
588
|
+
"stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
|
|
589
|
+
"stray-workspace.removed": "Stray workspace directories were removed.",
|
|
590
|
+
"stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
|
|
591
|
+
"temp-files.removed": "Abandoned temp files were removed.",
|
|
592
|
+
"status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
|
|
593
|
+
"status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
|
|
594
|
+
"setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
|
|
595
|
+
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
596
|
+
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
597
|
+
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
598
|
+
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
599
|
+
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
600
|
+
"handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
|
|
601
|
+
"delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
|
|
602
|
+
"delete.artifacts-left": "Graph run artifact directories were not removed.",
|
|
603
|
+
"delete.worktrees-kept": "Graph runs kept branch worktrees.",
|
|
604
|
+
"delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
|
|
605
|
+
"merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
|
|
606
|
+
"move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
|
|
607
|
+
"move.recovery-failed": "Recovering an interrupted environment move failed.",
|
|
608
|
+
"stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
|
|
536
609
|
...THROTTLE_LOG_EVENTS
|
|
537
610
|
}
|
|
538
611
|
}
|
|
@@ -541,10 +614,50 @@ var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
541
614
|
// ../protocol/src/log-vocabulary/gateway.ts
|
|
542
615
|
var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
543
616
|
gateway: {
|
|
544
|
-
description: "The
|
|
617
|
+
description: "The gateway other devices, browsers and the desktop connect through.",
|
|
545
618
|
events: {
|
|
546
619
|
"remote.start-failed": "The desktop could not start the remote gateway.",
|
|
547
|
-
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly."
|
|
620
|
+
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
|
|
621
|
+
disabled: "The gateway is disabled by its environment variable.",
|
|
622
|
+
"tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
|
|
623
|
+
"tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
|
|
624
|
+
"control.listening": "The backend control listener is up.",
|
|
625
|
+
"browser.listening": "The browser listener is up.",
|
|
626
|
+
"browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
|
|
627
|
+
"browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
|
|
628
|
+
"loopback.listening": "The loopback client listener is up.",
|
|
629
|
+
"loopback.unavailable": "The loopback client listener could not start.",
|
|
630
|
+
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
631
|
+
"auth-token.persist-failed": "The gateway token could not be saved.",
|
|
632
|
+
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
633
|
+
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
634
|
+
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
635
|
+
"websocket.upgrade-failed": "A WebSocket upgrade failed.",
|
|
636
|
+
"events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
|
|
637
|
+
"proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
|
|
638
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
639
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
640
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
641
|
+
}
|
|
642
|
+
},
|
|
643
|
+
"gateway.terminal": {
|
|
644
|
+
description: "The gateway's terminal WebSocket.",
|
|
645
|
+
events: {
|
|
646
|
+
"upgrade-rejected": "A terminal WebSocket upgrade was refused.",
|
|
647
|
+
"socket-error": "A terminal WebSocket reported an error.",
|
|
648
|
+
"subscription-failed": "A terminal subscription failed.",
|
|
649
|
+
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
|
|
650
|
+
}
|
|
651
|
+
},
|
|
652
|
+
"gateway.tailscale": {
|
|
653
|
+
description: "Tailscale Serve for desktop web access and a standalone backend.",
|
|
654
|
+
events: {
|
|
655
|
+
"web-access.disable-failed": "Desktop web access could not be turned off.",
|
|
656
|
+
"web-access.enable-failed": "Desktop web access could not be turned on.",
|
|
657
|
+
"web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
|
|
658
|
+
"web-access.reset-failed": "Desktop web access could not be reset.",
|
|
659
|
+
"startup.init-failed": "Desktop web access could not be initialized at startup.",
|
|
660
|
+
available: "Tailscale Serve is publishing the gateway."
|
|
548
661
|
}
|
|
549
662
|
}
|
|
550
663
|
});
|
|
@@ -555,6 +668,18 @@ var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
|
555
668
|
description: "Agent bridge processes the backend runs on the host.",
|
|
556
669
|
events: {
|
|
557
670
|
"bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
|
|
671
|
+
"bridge-runtime.installing": "A bridge runtime is being installed.",
|
|
672
|
+
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
673
|
+
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
674
|
+
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
675
|
+
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
676
|
+
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
677
|
+
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
678
|
+
"reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
|
|
679
|
+
"reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
|
|
680
|
+
"reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
|
|
681
|
+
"reaper.server-reaping": "An orphaned server is being stopped.",
|
|
682
|
+
"reaper.server-kill-failed": "An orphaned server did not exit.",
|
|
558
683
|
...THROTTLE_LOG_EVENTS
|
|
559
684
|
}
|
|
560
685
|
}
|
|
@@ -596,7 +721,12 @@ var MODEL_LOG_AREAS = defineLogAreas({
|
|
|
596
721
|
models: {
|
|
597
722
|
description: "Agent model catalogues and their persistent caches.",
|
|
598
723
|
events: {
|
|
599
|
-
"cache.write-failed": "A successful catalogue refresh could not update the host cache."
|
|
724
|
+
"cache.write-failed": "A successful catalogue refresh could not update the host cache.",
|
|
725
|
+
"seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
|
|
726
|
+
"bridge.not-ready": "The first-use catalogue bridge did not become ready.",
|
|
727
|
+
"bridge.start-failed": "The first-use catalogue bridge failed to start.",
|
|
728
|
+
"probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
|
|
729
|
+
"download.deferred": "A model catalogue could not be downloaded yet."
|
|
600
730
|
}
|
|
601
731
|
}
|
|
602
732
|
});
|
|
@@ -607,8 +737,62 @@ var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
|
607
737
|
description: "Native agent sessions and what the backend reads from their bridges.",
|
|
608
738
|
events: {
|
|
609
739
|
"catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
|
|
740
|
+
"compact.instructions-ignored": "A bridge compacted without confirming the instructions sent with /compact: it predates them.",
|
|
741
|
+
"handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
|
|
742
|
+
"handoff.consume-failed": "A delivered handoff could not be marked consumed.",
|
|
743
|
+
"job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
|
|
744
|
+
"job.resend-queue-failed": "A resend could not be queued for a job.",
|
|
745
|
+
"interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
|
|
746
|
+
"interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
|
|
747
|
+
"human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
|
|
748
|
+
"question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
|
|
749
|
+
"activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
|
|
750
|
+
"activity.persist-failed": "An environment's activity could not be saved.",
|
|
751
|
+
"pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
|
|
752
|
+
"launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
|
|
753
|
+
"queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
|
|
754
|
+
"provider.retire-failed": "Retiring an obsolete provider failed.",
|
|
755
|
+
"workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
|
|
756
|
+
"catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
|
|
757
|
+
"dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
|
|
758
|
+
"coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
|
|
759
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
760
|
+
"interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
|
|
761
|
+
"resume.close-replaced-failed": "The session a resume replaced could not be closed.",
|
|
762
|
+
"sign-in.check-failed": "A turn could not be checked for a login refusal.",
|
|
763
|
+
"sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
|
|
764
|
+
"sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
|
|
765
|
+
"shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
|
|
766
|
+
"turn-recovery.failed": "Recovering an incomplete turn failed.",
|
|
767
|
+
"turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
|
|
768
|
+
"turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
|
|
769
|
+
"usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
|
|
770
|
+
"title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
|
|
610
771
|
...THROTTLE_LOG_EVENTS
|
|
611
772
|
}
|
|
773
|
+
},
|
|
774
|
+
"native-agent.goal": {
|
|
775
|
+
description: "The /goal loop: advancing goals and their verifiers.",
|
|
776
|
+
events: {
|
|
777
|
+
"advance.failed": "A goal could not advance; the next sweep retries.",
|
|
778
|
+
"attention.record-failed": "Attention for a goal could not be recorded.",
|
|
779
|
+
"turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
|
|
780
|
+
"verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
|
|
781
|
+
"verifier.stop-failed": "An earlier verifier could not be stopped.",
|
|
782
|
+
"recover.failed": "Goals could not be recovered at startup."
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
"native-agent.opencode": {
|
|
786
|
+
description: "The OpenCode provider: its request monitor, retries and agent tools.",
|
|
787
|
+
events: {
|
|
788
|
+
"retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
|
|
789
|
+
"retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
|
|
790
|
+
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
791
|
+
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
792
|
+
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
793
|
+
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
794
|
+
"request.failed": "Handling a request event failed, so the stream restarts. Error class only."
|
|
795
|
+
}
|
|
612
796
|
}
|
|
613
797
|
});
|
|
614
798
|
|
|
@@ -631,6 +815,17 @@ var PREVIEW_LOG_AREAS = defineLogAreas({
|
|
|
631
815
|
"partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
|
|
632
816
|
"port-hints.persist-failed": "Preview port hints could not be saved.",
|
|
633
817
|
"transport.close-failed": "A preview transport could not be closed.",
|
|
818
|
+
"ca-bundle.read-failed": "The upstream CA bundle could not be read.",
|
|
819
|
+
"publication.start-failed": "Private preview publication did not start.",
|
|
820
|
+
"publication.reconfigure-failed": "Preview publication could not be reconfigured.",
|
|
821
|
+
"publication.listening": "Private preview origins are listening.",
|
|
822
|
+
"certificate.reloaded": "The preview certificate was reloaded.",
|
|
823
|
+
"access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
|
|
824
|
+
"registry.invalid-definition": "An invalid stored preview service definition was ignored.",
|
|
825
|
+
"registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
|
|
826
|
+
"registry.resolver-failed": "A preview resolver failed. Error class only.",
|
|
827
|
+
"registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
|
|
828
|
+
"registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
|
|
634
829
|
...THROTTLE_LOG_EVENTS
|
|
635
830
|
}
|
|
636
831
|
}
|
|
@@ -649,9 +844,33 @@ var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
|
649
844
|
// ../protocol/src/log-vocabulary/terminal.ts
|
|
650
845
|
var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
651
846
|
terminal: {
|
|
652
|
-
description: "The renderer's
|
|
847
|
+
description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
|
|
653
848
|
events: {
|
|
654
849
|
"input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
|
|
850
|
+
"orphan.reaped": "A terminal no tab references was closed.",
|
|
851
|
+
"agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
|
|
852
|
+
"activity.record-failed": "Terminal environment activity could not be recorded.",
|
|
853
|
+
"pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
|
|
854
|
+
"pty.exit-notify-failed": "Notifying a terminal's exit failed.",
|
|
855
|
+
"pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
|
|
856
|
+
"setup.pty-reused": "A setup terminal reused its existing PTY.",
|
|
857
|
+
"setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
|
|
858
|
+
"setup.pty-spawned": "A setup terminal's PTY started.",
|
|
859
|
+
"setup.pty-exited": "A setup terminal's PTY exited.",
|
|
860
|
+
"setup.preparing": "Workspace preparation started in the setup terminal.",
|
|
861
|
+
"setup.session-creating": "A setup session is being created.",
|
|
862
|
+
"setup.intro-emitted": "The setup intro was written to the terminal.",
|
|
863
|
+
"setup.completed": "Setup finished.",
|
|
864
|
+
"setup.failed": "Setup failed.",
|
|
865
|
+
"setup.already-complete": "Setup was requested but had already finished.",
|
|
866
|
+
"setup.renderer-ensured": "The renderer asked for setup to be running.",
|
|
867
|
+
"setup.renderer-requested": "The renderer asked for the setup session.",
|
|
868
|
+
"setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
|
|
869
|
+
"setup.no-commands": "An environment has no setup commands to run.",
|
|
870
|
+
"setup.already-running": "Setup was requested while it was already running.",
|
|
871
|
+
"setup.held-for-approval": "Setup is held until its commands are approved.",
|
|
872
|
+
"setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
|
|
873
|
+
"setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
|
|
655
874
|
"input.resume-failed": "Asking the backend to resume refused terminal input failed.",
|
|
656
875
|
"input.write-failed": "Writing input to a terminal session threw.",
|
|
657
876
|
"listener.remove-failed": "Removing a terminal output listener threw.",
|
|
@@ -751,13 +970,41 @@ var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
|
751
970
|
// ../protocol/src/log-vocabulary/tmux.ts
|
|
752
971
|
var TMUX_LOG_AREAS = defineLogAreas({
|
|
753
972
|
tmux: {
|
|
754
|
-
description: "
|
|
973
|
+
description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
|
|
755
974
|
events: {
|
|
756
975
|
"poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
|
|
757
976
|
"poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
|
|
758
977
|
"poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
|
|
759
978
|
"poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
|
|
760
979
|
"poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
|
|
980
|
+
"cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
|
|
981
|
+
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
982
|
+
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
983
|
+
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
984
|
+
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
985
|
+
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
986
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
987
|
+
"orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
|
|
988
|
+
"orphan.reaped": "A tmux session no tab references was killed.",
|
|
989
|
+
"orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
|
|
990
|
+
"cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
|
|
991
|
+
"cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
|
|
992
|
+
"cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
|
|
993
|
+
"interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
|
|
994
|
+
"signal.arm-failed": "The Claude state signal could not be armed.",
|
|
995
|
+
"signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
|
|
996
|
+
"hook-signal.arm-failed": "The tmux hook doorbell could not be armed.",
|
|
997
|
+
"hook-signal.degraded": "The tmux hook doorbell missed a hook, so idle tabs poll every second until it is re-armed.",
|
|
998
|
+
"pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
|
|
999
|
+
"pr-probe.failed": "Probing for a pull request an agent created failed.",
|
|
1000
|
+
"activity.persist-failed": "Tmux tab activity could not be saved.",
|
|
1001
|
+
"fast-mode.persist-failed": "The launch fast mode could not be saved.",
|
|
1002
|
+
"fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
|
|
1003
|
+
"pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
|
|
1004
|
+
"turn.failure-record-failed": "A failed turn could not be recorded.",
|
|
1005
|
+
"slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
|
|
1006
|
+
"queue.failing": "A tmux prompt queue keeps failing to dispatch.",
|
|
1007
|
+
"queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
|
|
761
1008
|
...THROTTLE_LOG_EVENTS
|
|
762
1009
|
}
|
|
763
1010
|
}
|
|
@@ -784,7 +1031,8 @@ var UPDATER_LOG_AREAS = defineLogAreas({
|
|
|
784
1031
|
"remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
|
|
785
1032
|
"restart-prompt.failed": "The restart prompt for a downloaded update failed.",
|
|
786
1033
|
unavailable: "Auto-update could not be set up in this session.",
|
|
787
|
-
"update.failed": "electron-updater reported an update error."
|
|
1034
|
+
"update.failed": "electron-updater reported an update error.",
|
|
1035
|
+
"standalone.restarting": "A standalone backend is restarting into a new version."
|
|
788
1036
|
}
|
|
789
1037
|
}
|
|
790
1038
|
});
|
|
@@ -795,11 +1043,473 @@ var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
|
|
|
795
1043
|
description: "Web annotation requests and their background reconciler.",
|
|
796
1044
|
events: {
|
|
797
1045
|
"reconcile.failed": "A background reconcile pass failed; the next one retries.",
|
|
1046
|
+
"legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
|
|
1047
|
+
"legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
|
|
1048
|
+
"legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
|
|
1049
|
+
"legacy.unavailable": "Legacy annotation storage could not be read.",
|
|
1050
|
+
"legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
|
|
1051
|
+
"legacy.archive-failed": "Imported legacy annotation files could not be archived.",
|
|
1052
|
+
"legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
|
|
1053
|
+
"migration.draft-failed": "Migrating one draft failed.",
|
|
1054
|
+
"draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
|
|
1055
|
+
"request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
|
|
1056
|
+
"evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
|
|
1057
|
+
"queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
|
|
1058
|
+
"request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
|
|
1059
|
+
"turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
|
|
1060
|
+
"gc.failed": "Annotation garbage collection failed; the next pass retries.",
|
|
1061
|
+
"record.unavailable": "An annotation record is unavailable; written once per record.",
|
|
1062
|
+
"storage.unavailable": "An environment's annotation store is unreadable.",
|
|
1063
|
+
"change-hint.listener-failed": "A change hint listener threw.",
|
|
1064
|
+
"orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
|
|
1065
|
+
"storage.load-failed": "An environment's annotation storage could not be loaded.",
|
|
798
1066
|
...THROTTLE_LOG_EVENTS
|
|
799
1067
|
}
|
|
800
1068
|
}
|
|
801
1069
|
});
|
|
802
1070
|
|
|
1071
|
+
// ../protocol/src/log-vocabulary/storage.ts
|
|
1072
|
+
var STORAGE_LOG_AREAS = defineLogAreas({
|
|
1073
|
+
storage: {
|
|
1074
|
+
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
1075
|
+
events: {
|
|
1076
|
+
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
1077
|
+
"snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
|
|
1078
|
+
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
1079
|
+
"snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
|
|
1080
|
+
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
1081
|
+
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
1082
|
+
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
1083
|
+
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
1084
|
+
"preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
|
|
1085
|
+
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
1086
|
+
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
1087
|
+
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
1088
|
+
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
1089
|
+
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
1090
|
+
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
1091
|
+
"legacy-json.archive-failed": "Imported JSON store files could not be archived."
|
|
1092
|
+
}
|
|
1093
|
+
}
|
|
1094
|
+
});
|
|
1095
|
+
|
|
1096
|
+
// ../protocol/src/log-vocabulary/build-pipeline.ts
|
|
1097
|
+
var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
1098
|
+
"build-pipeline": {
|
|
1099
|
+
description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
|
|
1100
|
+
events: {
|
|
1101
|
+
"sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
|
|
1102
|
+
"sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
|
|
1103
|
+
"result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
|
|
1104
|
+
"consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
|
|
1105
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
|
|
1106
|
+
"interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
|
|
1107
|
+
"transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
|
|
1108
|
+
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
1109
|
+
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
1110
|
+
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
1111
|
+
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
1112
|
+
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
1113
|
+
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
1114
|
+
"usage.read-failed": "Reading a stage session's token usage failed.",
|
|
1115
|
+
"checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
|
|
1116
|
+
"checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
|
|
1117
|
+
"legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
});
|
|
1121
|
+
|
|
1122
|
+
// ../protocol/src/log-vocabulary/agent-branch.ts
|
|
1123
|
+
var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
|
|
1124
|
+
"agent-branch": {
|
|
1125
|
+
description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
|
|
1126
|
+
events: {
|
|
1127
|
+
"observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
|
|
1128
|
+
"transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
|
|
1129
|
+
"usage.read-failed": "Reading a reviewer's token usage failed.",
|
|
1130
|
+
"result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
|
|
1131
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
|
|
1132
|
+
"result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
});
|
|
1136
|
+
|
|
1137
|
+
// ../protocol/src/log-vocabulary/change-tracking.ts
|
|
1138
|
+
var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
1139
|
+
"change-tracking": {
|
|
1140
|
+
description: "Change tracking: turn capture, evidence pulls and measurements.",
|
|
1141
|
+
events: {
|
|
1142
|
+
"journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
|
|
1143
|
+
"projection.failed": "Projecting a change event onto its environment failed.",
|
|
1144
|
+
"startup.reconcile-failed": "Reconciling change tracking at startup failed.",
|
|
1145
|
+
"turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
|
|
1146
|
+
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
1147
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
1148
|
+
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
1149
|
+
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
1150
|
+
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
1151
|
+
}
|
|
1152
|
+
},
|
|
1153
|
+
"diff-stats": {
|
|
1154
|
+
description: "Environment diff stats and the worktree signals that drive them.",
|
|
1155
|
+
events: {
|
|
1156
|
+
"baseline.update-failed": "An environment's diff baseline could not be updated.",
|
|
1157
|
+
"scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
|
|
1158
|
+
"scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
|
|
1159
|
+
"scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
|
|
1160
|
+
"scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
|
|
1161
|
+
"emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
|
|
1162
|
+
"emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
|
|
1163
|
+
"signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
|
|
1164
|
+
}
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
|
|
1168
|
+
// ../protocol/src/log-vocabulary/coordinator.ts
|
|
1169
|
+
var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
1170
|
+
coordinator: {
|
|
1171
|
+
description: "Coordinators: delegations, status wakes and their store.",
|
|
1172
|
+
events: {
|
|
1173
|
+
"delegation.open-failed": "A delegation could not be opened; `source` says for what.",
|
|
1174
|
+
"deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
|
|
1175
|
+
"mail.move-failed": "Mail could not move to the new main coordinator.",
|
|
1176
|
+
"work.move-failed": "Work could not move to the main coordinator.",
|
|
1177
|
+
"wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
|
|
1178
|
+
"wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
|
|
1179
|
+
"wake.observe-feature-plan-failed": "A feature plan could not be observed for status wakes.",
|
|
1180
|
+
"wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
|
|
1181
|
+
"wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
|
|
1182
|
+
"wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
|
|
1183
|
+
"wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
|
|
1184
|
+
"wake.waiting-report-failed": "A waiting worker could not be reported.",
|
|
1185
|
+
"wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
|
|
1186
|
+
"store.malformed": "The coordinator store was malformed and is treated as empty.",
|
|
1187
|
+
"store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
|
|
1188
|
+
"store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
|
|
1189
|
+
"store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
|
|
1190
|
+
"store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
|
|
1191
|
+
"remote-worker.settle-failed": "A remote worker could not be settled.",
|
|
1192
|
+
"checkout.merge-followed": "After an environment's PR merged, the project checkout was fast-forwarded, or `outcome` says why not.",
|
|
1193
|
+
"checkout.merge-follow-failed": "Fast-forwarding the project checkout failed, after an environment's PR merged or before mail woke the main coordinator.",
|
|
1194
|
+
"checkout.mail-follow": "Before mail woke the main coordinator, the project checkout was fast-forwarded, or `outcome` says why not (`timed-out`, `failed`).",
|
|
1195
|
+
"checkout.mail-follow-failed": "Before mail woke the main coordinator, checking whether to fast-forward the project checkout failed; the mail was delivered anyway."
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
|
|
1200
|
+
// ../protocol/src/log-vocabulary/review.ts
|
|
1201
|
+
var REVIEW_LOG_AREAS = defineLogAreas({
|
|
1202
|
+
review: {
|
|
1203
|
+
description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
|
|
1204
|
+
events: {
|
|
1205
|
+
"fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
|
|
1206
|
+
"graph-run.not-started": "A workflow's graph run did not start.",
|
|
1207
|
+
"reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
|
|
1208
|
+
"graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
|
|
1209
|
+
"graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
|
|
1210
|
+
"delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
|
|
1211
|
+
"fix-session.read-failed": "Reading an interactive fix session's state failed.",
|
|
1212
|
+
"fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
|
|
1213
|
+
"fix-usage.read-failed": "Reading a fix session's token usage failed.",
|
|
1214
|
+
"result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
|
|
1215
|
+
"failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
|
|
1216
|
+
}
|
|
1217
|
+
},
|
|
1218
|
+
"pull-request": {
|
|
1219
|
+
description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
|
|
1220
|
+
events: {
|
|
1221
|
+
"merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
|
|
1222
|
+
"refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
|
|
1223
|
+
"arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
|
|
1224
|
+
"gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
|
|
1225
|
+
"monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
|
|
1226
|
+
"cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
|
|
1227
|
+
"checkout.follow-merge-lookup-failed": "A merged pull request's project could not be read, so its checkout was not fast-forwarded.",
|
|
1228
|
+
"auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
|
|
1229
|
+
"auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
|
|
1230
|
+
"auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
|
|
1231
|
+
"monitor.detection-failed": "Checking an environment for its pull request failed.",
|
|
1232
|
+
"monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
|
|
1233
|
+
"monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
|
|
1234
|
+
"monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
|
|
1235
|
+
"monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
|
|
1236
|
+
"monitor.state-persist-failed": "A pull request's observed state could not be saved.",
|
|
1237
|
+
"monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
|
|
1238
|
+
"monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
|
|
1239
|
+
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
1240
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
1241
|
+
}
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
|
|
1245
|
+
// ../protocol/src/log-vocabulary/public-api.ts
|
|
1246
|
+
var PUBLIC_API_LOG_AREAS = defineLogAreas({
|
|
1247
|
+
"public-api": {
|
|
1248
|
+
description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
|
|
1249
|
+
events: {
|
|
1250
|
+
"outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
|
|
1251
|
+
"goal-checks.stop-failed": "Goal checks could not be stopped.",
|
|
1252
|
+
"exec.list-failed": "Exec workers could not be listed.",
|
|
1253
|
+
"exec.cancel-failed": "An exec could not be cancelled.",
|
|
1254
|
+
"goal-workers.list-failed": "Goal check workers could not be listed.",
|
|
1255
|
+
"operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
|
|
1256
|
+
"reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
|
|
1257
|
+
}
|
|
1258
|
+
}
|
|
1259
|
+
});
|
|
1260
|
+
|
|
1261
|
+
// ../protocol/src/log-vocabulary/agent-accounts.ts
|
|
1262
|
+
var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
1263
|
+
"agent-accounts": {
|
|
1264
|
+
description: "Agent accounts: automatic switching, staged logins and plan usage.",
|
|
1265
|
+
events: {
|
|
1266
|
+
"switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
|
|
1267
|
+
"auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
|
|
1268
|
+
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
1269
|
+
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
1270
|
+
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
1271
|
+
"login-renewal.failed": "Renewing an idle account's sign-in to read its usage failed; it is retried after a backoff.",
|
|
1272
|
+
"login-renewal.not-extended": "Claude Code ran to renew an idle account's sign-in, but its token is still lapsed.",
|
|
1273
|
+
"login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
});
|
|
1277
|
+
|
|
1278
|
+
// ../protocol/src/log-vocabulary/docker.ts
|
|
1279
|
+
var DOCKER_LOG_AREAS = defineLogAreas({
|
|
1280
|
+
docker: {
|
|
1281
|
+
description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
|
|
1282
|
+
events: {
|
|
1283
|
+
"portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
|
|
1284
|
+
"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.",
|
|
1285
|
+
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
1286
|
+
"lifecycle-event.reconcile-failed": "Reconciling an environment after a container start or stop event failed; the next status read retries.",
|
|
1287
|
+
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
1288
|
+
"login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
|
|
1289
|
+
"login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
|
|
1290
|
+
"login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
|
|
1291
|
+
"login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
|
|
1292
|
+
"lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
|
|
1293
|
+
"lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
|
|
1294
|
+
"replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
|
|
1295
|
+
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
1296
|
+
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
1297
|
+
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
1298
|
+
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
|
|
1299
|
+
}
|
|
1300
|
+
},
|
|
1301
|
+
"docker.reachability": {
|
|
1302
|
+
description: "Whether agents in containers can reach the backend's agent tools server.",
|
|
1303
|
+
events: {
|
|
1304
|
+
"check.crashed": "A reachability check crashed.",
|
|
1305
|
+
"check.started": "A reachability check started.",
|
|
1306
|
+
"check.finished": "A reachability check finished.",
|
|
1307
|
+
"check.probe": "One probe of a finished check.",
|
|
1308
|
+
"check.summary": "Content-free status and reason for a check that did not find the host reachable.",
|
|
1309
|
+
"check.remediation": "One command the user can run to unblock containers.",
|
|
1310
|
+
"shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
|
|
1311
|
+
"shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
|
|
1312
|
+
"shutdown.removing-resources": "Shutdown is removing probe resources.",
|
|
1313
|
+
"shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
|
|
1314
|
+
"shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
|
|
1315
|
+
"probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
|
|
1316
|
+
"preflight.refused": "A stage was refused because its container cannot reach the host.",
|
|
1317
|
+
"probe.prepare-failed": "A container could not be prepared for a probe.",
|
|
1318
|
+
"probe.result": "The outcome of probing one container.",
|
|
1319
|
+
"probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
|
|
1320
|
+
"topology.detected": "The Docker topology was read.",
|
|
1321
|
+
"firewall.detected": "The host firewall was read.",
|
|
1322
|
+
"probe-network.remove-failed": "The probe network could not be removed.",
|
|
1323
|
+
"probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
|
|
1324
|
+
"event.emit-failed": "A reachability event could not be emitted.",
|
|
1325
|
+
"host-addresses.list-failed": "Host addresses could not be listed.",
|
|
1326
|
+
"probe-image.present": "The probe image is already present.",
|
|
1327
|
+
"probe-image.pulling": "The probe image is being pulled.",
|
|
1328
|
+
"probe-image.pulled": "The probe image was pulled.",
|
|
1329
|
+
"probe-image.pull-failed": "The probe image could not be pulled.",
|
|
1330
|
+
"probe-image.fallback": "The environment image is used as the probe image.",
|
|
1331
|
+
"probe-image.missing": "No probe image is available.",
|
|
1332
|
+
"network.list-failed": "Docker networks could not be listed.",
|
|
1333
|
+
"network.inspect-failed": "A Docker network could not be inspected.",
|
|
1334
|
+
"stale-containers.removing": "Stale probe containers are being removed.",
|
|
1335
|
+
"stale-networks.removing": "Stale probe networks are being removed."
|
|
1336
|
+
}
|
|
1337
|
+
}
|
|
1338
|
+
});
|
|
1339
|
+
|
|
1340
|
+
// ../protocol/src/log-vocabulary/mcp.ts
|
|
1341
|
+
var MCP_LOG_AREAS = defineLogAreas({
|
|
1342
|
+
"control-mcp": {
|
|
1343
|
+
description: "The Control MCP server other agents and devices reach Orkestrator through.",
|
|
1344
|
+
events: {
|
|
1345
|
+
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
1346
|
+
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
1347
|
+
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
1348
|
+
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
1349
|
+
}
|
|
1350
|
+
},
|
|
1351
|
+
"mcp-management": {
|
|
1352
|
+
description: "Managed MCP configuration: its commands, overlays and apply loop.",
|
|
1353
|
+
events: {
|
|
1354
|
+
"command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
|
|
1355
|
+
"overlay.materialise-failed": "An MCP overlay could not be written.",
|
|
1356
|
+
"apply.tick-failed": "An MCP apply tick failed; the next one retries."
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
});
|
|
1360
|
+
|
|
1361
|
+
// ../protocol/src/log-vocabulary/design.ts
|
|
1362
|
+
var DESIGN_LOG_AREAS = defineLogAreas({
|
|
1363
|
+
design: {
|
|
1364
|
+
description: "The design canvas: its library, renderer and session links.",
|
|
1365
|
+
events: {
|
|
1366
|
+
"change-signal.failed": "A design change signal failed.",
|
|
1367
|
+
"library.index-write-failed": "The design library index could not be written.",
|
|
1368
|
+
"library.refresh-failed": "The design library could not be refreshed.",
|
|
1369
|
+
"renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
|
|
1370
|
+
"task.failed": "A design background task failed.",
|
|
1371
|
+
"canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
|
|
1372
|
+
"startup.step-failed": "One part of design startup failed; `step` says which.",
|
|
1373
|
+
"legacy.retire-failed": "A migrated legacy design could not be retired.",
|
|
1374
|
+
"profiles.swept": "Design startup removed stale browser profiles.",
|
|
1375
|
+
"session-link.record-failed": "A closing conversation could not be recorded on a design link."
|
|
1376
|
+
}
|
|
1377
|
+
}
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
// ../protocol/src/log-vocabulary/graph.ts
|
|
1381
|
+
var GRAPH_LOG_AREAS = defineLogAreas({
|
|
1382
|
+
graph: {
|
|
1383
|
+
description: "Graph runs: launches, passes, rewinds, system actions and templates.",
|
|
1384
|
+
events: {
|
|
1385
|
+
"describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
|
|
1386
|
+
"system.stop-failed": "A system action's work could not be stopped.",
|
|
1387
|
+
"system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
|
|
1388
|
+
"attention.update-failed": "The sidebar could not be updated for a run.",
|
|
1389
|
+
"launch.ticket-link-failed": "A launched run's ticket could not be linked.",
|
|
1390
|
+
"launch.started": "A graph run was launched.",
|
|
1391
|
+
"launch.swept": "Runs that ended without an environment were removed.",
|
|
1392
|
+
"rewind.pending": "A run's code rewind has not finished.",
|
|
1393
|
+
"rewind.applied": "A run was restarted or rewound.",
|
|
1394
|
+
"rewind.waiting": "A run waits for its code rewind to finish.",
|
|
1395
|
+
"history.pruned": "Finished runs beyond an environment's history were removed.",
|
|
1396
|
+
"history.prune-failed": "Pruning an environment's run history failed.",
|
|
1397
|
+
"worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
|
|
1398
|
+
"run.unreadable": "A run is unreadable, so it is not scheduled.",
|
|
1399
|
+
"run.pass-failed": "A pass over a run failed.",
|
|
1400
|
+
"transcript.capture-failed": "A run's transcript capture failed.",
|
|
1401
|
+
"ticket.link-failed": "A run's ticket could not be linked to its environment.",
|
|
1402
|
+
"template.skipped": "A built-in template was skipped as invalid or a duplicate."
|
|
1403
|
+
}
|
|
1404
|
+
}
|
|
1405
|
+
});
|
|
1406
|
+
|
|
1407
|
+
// ../protocol/src/log-vocabulary/nodes.ts
|
|
1408
|
+
var NODES_LOG_AREAS = defineLogAreas({
|
|
1409
|
+
nodes: {
|
|
1410
|
+
description: "Command nodes: links, handovers, leaf mail, ticket sync and project copies.",
|
|
1411
|
+
events: {
|
|
1412
|
+
"actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
|
|
1413
|
+
"project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
|
|
1414
|
+
"mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
|
|
1415
|
+
"command.post-step-failed": "A step after a routed command failed.",
|
|
1416
|
+
"seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
|
|
1417
|
+
"contact.record-failed": "The latest controller contact could not be recorded.",
|
|
1418
|
+
"settings.send-failed": "Settings could not be sent to a node.",
|
|
1419
|
+
"verification.record-failed": "A node verification could not be recorded.",
|
|
1420
|
+
"profile.record-failed": "A node profile could not be recorded.",
|
|
1421
|
+
"detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
|
|
1422
|
+
"handover.recovery-pending": "Command handover recovery is still pending.",
|
|
1423
|
+
"ticket-sync.work-record-failed": "A remote build started but its ticket work location could not be saved.",
|
|
1424
|
+
"ticket-sync.failed": "A Kanban sync with a node failed; it is retried.",
|
|
1425
|
+
"ticket-sync.unknown-project": "A node sent ticket changes for a project that no longer exists here.",
|
|
1426
|
+
"ticket-sync.forget-failed": "A detached command node's ticket copies could not be released."
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
});
|
|
1430
|
+
|
|
1431
|
+
// ../protocol/src/log-vocabulary/linear.ts
|
|
1432
|
+
var LINEAR_LOG_AREAS = defineLogAreas({
|
|
1433
|
+
linear: {
|
|
1434
|
+
description: "Linear issues read for build actions.",
|
|
1435
|
+
events: {
|
|
1436
|
+
"comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
|
|
1437
|
+
}
|
|
1438
|
+
}
|
|
1439
|
+
});
|
|
1440
|
+
|
|
1441
|
+
// ../protocol/src/log-vocabulary/usage-history.ts
|
|
1442
|
+
var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
|
|
1443
|
+
"usage-history": {
|
|
1444
|
+
description: "Recorded agent token usage.",
|
|
1445
|
+
events: {
|
|
1446
|
+
"record.failed": "Agent usage could not be recorded; a later read counts it.",
|
|
1447
|
+
"prune.failed": "Pruning recorded usage failed; the next prune retries."
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
});
|
|
1451
|
+
|
|
1452
|
+
// ../protocol/src/log-vocabulary/feature.ts
|
|
1453
|
+
var FEATURE_LOG_AREAS = defineLogAreas({
|
|
1454
|
+
feature: {
|
|
1455
|
+
description: "Pipeline environments started from a feature, and feature planning.",
|
|
1456
|
+
events: {
|
|
1457
|
+
"naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
|
|
1458
|
+
"planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
|
|
1459
|
+
"planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
});
|
|
1463
|
+
|
|
1464
|
+
// ../protocol/src/log-vocabulary/host.ts
|
|
1465
|
+
var HOST_LOG_AREAS = defineLogAreas({
|
|
1466
|
+
host: {
|
|
1467
|
+
description: "The host machine: its executables, load, suspends and maintenance.",
|
|
1468
|
+
events: {
|
|
1469
|
+
"path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
|
|
1470
|
+
"tool.available": "A host tool's availability was read.",
|
|
1471
|
+
"tool.missing": "A host tool was not found.",
|
|
1472
|
+
"maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
|
|
1473
|
+
"suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
|
|
1474
|
+
"load.sample-failed": "Sampling machine load failed; the next sample retries."
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
});
|
|
1478
|
+
|
|
1479
|
+
// ../protocol/src/log-vocabulary/transcript-artifacts.ts
|
|
1480
|
+
var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
|
|
1481
|
+
"transcript-artifacts": {
|
|
1482
|
+
description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
|
|
1483
|
+
events: {
|
|
1484
|
+
"announce-failed": "An artifact change could not be announced.",
|
|
1485
|
+
"cleanup-failed": "An artifact cleanup failed.",
|
|
1486
|
+
"grant-revocation-failed": "A grant could not be revoked.",
|
|
1487
|
+
"ledger-listener-failed": "A ledger listener threw.",
|
|
1488
|
+
"ledger-read-failed": "The ledger could not be read.",
|
|
1489
|
+
"operation-executor-failed": "A preview operation's executor failed.",
|
|
1490
|
+
"operation-failed": "A preview operation failed.",
|
|
1491
|
+
"pdf-preview": "A PDF preview was served.",
|
|
1492
|
+
"pdf-preview-failed": "A PDF preview failed.",
|
|
1493
|
+
"pdf-print-failed": "Printing an artifact to PDF failed.",
|
|
1494
|
+
"pdf-printed": "An artifact was printed to PDF.",
|
|
1495
|
+
"runtime-unavailable": "The artifact runtime could not be created."
|
|
1496
|
+
}
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
|
|
1500
|
+
// ../protocol/src/log-vocabulary/scheduler.ts
|
|
1501
|
+
var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
1502
|
+
scheduler: {
|
|
1503
|
+
description: "Scheduled jobs and the backend-owned timing that fires them.",
|
|
1504
|
+
events: {
|
|
1505
|
+
"tick.failed": "A scheduler tick failed; the next tick retries.",
|
|
1506
|
+
"job.claim-failed": "A due job could not be claimed.",
|
|
1507
|
+
"fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
|
|
1508
|
+
"fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
|
|
1509
|
+
}
|
|
1510
|
+
}
|
|
1511
|
+
});
|
|
1512
|
+
|
|
803
1513
|
// ../protocol/src/log-vocabulary/web-app.ts
|
|
804
1514
|
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
805
1515
|
"web.app": {
|
|
@@ -967,7 +1677,7 @@ var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
|
967
1677
|
"models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
|
|
968
1678
|
"models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
|
|
969
1679
|
"github-credential.check-failed": "The GitHub credential check before creating failed.",
|
|
970
|
-
"feature-build.start-failed": "Starting a
|
|
1680
|
+
"feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
|
|
971
1681
|
"settings.extensions-load-failed": "The settings dialog could not load extensions.",
|
|
972
1682
|
"settings.container-reset-failed": "The settings dialog could not reset the container.",
|
|
973
1683
|
"settings.save-failed": "The settings dialog could not save.",
|
|
@@ -1259,6 +1969,25 @@ var LOG_VOCABULARY = {
|
|
|
1259
1969
|
...TMUX_LOG_AREAS,
|
|
1260
1970
|
...UPDATER_LOG_AREAS,
|
|
1261
1971
|
...WEB_ANNOTATIONS_LOG_AREAS,
|
|
1972
|
+
...STORAGE_LOG_AREAS,
|
|
1973
|
+
...BUILD_PIPELINE_LOG_AREAS,
|
|
1974
|
+
...AGENT_BRANCH_LOG_AREAS,
|
|
1975
|
+
...CHANGE_TRACKING_LOG_AREAS,
|
|
1976
|
+
...COORDINATOR_LOG_AREAS,
|
|
1977
|
+
...REVIEW_LOG_AREAS,
|
|
1978
|
+
...PUBLIC_API_LOG_AREAS,
|
|
1979
|
+
...AGENT_ACCOUNTS_LOG_AREAS,
|
|
1980
|
+
...DOCKER_LOG_AREAS,
|
|
1981
|
+
...MCP_LOG_AREAS,
|
|
1982
|
+
...DESIGN_LOG_AREAS,
|
|
1983
|
+
...GRAPH_LOG_AREAS,
|
|
1984
|
+
...NODES_LOG_AREAS,
|
|
1985
|
+
...LINEAR_LOG_AREAS,
|
|
1986
|
+
...USAGE_HISTORY_LOG_AREAS,
|
|
1987
|
+
...FEATURE_LOG_AREAS,
|
|
1988
|
+
...HOST_LOG_AREAS,
|
|
1989
|
+
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
1990
|
+
...SCHEDULER_LOG_AREAS,
|
|
1262
1991
|
...WEB_APP_LOG_AREAS,
|
|
1263
1992
|
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
1264
1993
|
...WEB_CHAT_LOG_AREAS,
|
|
@@ -1436,7 +2165,10 @@ function deliver(record) {
|
|
|
1436
2165
|
line: config.format === "json" ? renderJson(record) : renderText(record),
|
|
1437
2166
|
record
|
|
1438
2167
|
});
|
|
1439
|
-
|
|
2168
|
+
return true;
|
|
2169
|
+
} catch {
|
|
2170
|
+
return false;
|
|
2171
|
+
}
|
|
1440
2172
|
}
|
|
1441
2173
|
function buildRecord(level, area, event, fields) {
|
|
1442
2174
|
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
@@ -1592,6 +2324,19 @@ function resolveFields(fields) {
|
|
|
1592
2324
|
return { fieldsFailed: true };
|
|
1593
2325
|
}
|
|
1594
2326
|
}
|
|
2327
|
+
function deliverEvent(level, area, event, fields) {
|
|
2328
|
+
const spec = areaSpec(area);
|
|
2329
|
+
if (!spec)
|
|
2330
|
+
return deliver(buildRecord(level, "logging", "unknown-area", undefined));
|
|
2331
|
+
if (!Object.hasOwn(spec.events, event))
|
|
2332
|
+
return deliver(buildRecord(level, area, "invalid-event", undefined));
|
|
2333
|
+
return deliver(buildRecord(level, area, event, fields));
|
|
2334
|
+
}
|
|
2335
|
+
function tryWriteLog(level, area, event, fields) {
|
|
2336
|
+
if (LEVEL_RANK[level] > thresholdRank(area))
|
|
2337
|
+
return false;
|
|
2338
|
+
return deliverEvent(level, area, event, resolveFields(fields));
|
|
2339
|
+
}
|
|
1595
2340
|
function createLogger(area) {
|
|
1596
2341
|
const spec = areaSpec(area);
|
|
1597
2342
|
let seenGeneration = -1;
|
|
@@ -1604,13 +2349,7 @@ function createLogger(area) {
|
|
|
1604
2349
|
return LEVEL_RANK[level] <= rank;
|
|
1605
2350
|
};
|
|
1606
2351
|
const writeResolved = (level, event, resolved) => {
|
|
1607
|
-
|
|
1608
|
-
deliver(buildRecord(level, "logging", "unknown-area", undefined));
|
|
1609
|
-
} else if (Object.hasOwn(spec.events, event)) {
|
|
1610
|
-
deliver(buildRecord(level, area, event, resolved));
|
|
1611
|
-
} else {
|
|
1612
|
-
deliver(buildRecord(level, area, "invalid-event", undefined));
|
|
1613
|
-
}
|
|
2352
|
+
deliverEvent(level, area, event, resolved);
|
|
1614
2353
|
};
|
|
1615
2354
|
const write = (level, event, fields) => {
|
|
1616
2355
|
if (!enabled(level))
|
|
@@ -1651,9 +2390,18 @@ function createLogger(area) {
|
|
|
1651
2390
|
};
|
|
1652
2391
|
}
|
|
1653
2392
|
|
|
2393
|
+
// ../protocol/src/event-loop-stall-monitor.ts
|
|
2394
|
+
var log = createLogger("event-loop");
|
|
2395
|
+
var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
|
|
2396
|
+
|
|
1654
2397
|
// ../protocol/src/node/bridge-diagnostics.ts
|
|
1655
|
-
var
|
|
1656
|
-
var
|
|
2398
|
+
var log2 = createLogger("bridge.diagnostics");
|
|
2399
|
+
var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
|
|
2400
|
+
var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
|
|
2401
|
+
var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
|
|
2402
|
+
var STALL_TOOL_PENDING_MS = 10 * 60000;
|
|
2403
|
+
var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
|
|
2404
|
+
var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
|
|
1657
2405
|
var MAX_PENDING_TOOLS = 128;
|
|
1658
2406
|
var MAX_REPORTED_TOOLS = 8;
|
|
1659
2407
|
var MAX_ID_LENGTH = 1024;
|
|
@@ -1714,6 +2462,28 @@ var UPDATE_KINDS = new Set([
|
|
|
1714
2462
|
"step-started",
|
|
1715
2463
|
"step-completed"
|
|
1716
2464
|
]);
|
|
2465
|
+
var COUNTER_CHANGE_THRESHOLDS = {
|
|
2466
|
+
stderrBytes: 4096,
|
|
2467
|
+
requestsSent: 1,
|
|
2468
|
+
responsesReceived: 1,
|
|
2469
|
+
timeouts: 1,
|
|
2470
|
+
notificationsReceived: Number.POSITIVE_INFINITY,
|
|
2471
|
+
protocolErrors: 1
|
|
2472
|
+
};
|
|
2473
|
+
var WAITING_PHASES = new Set([
|
|
2474
|
+
"sending",
|
|
2475
|
+
"following",
|
|
2476
|
+
"draining",
|
|
2477
|
+
"cancelling"
|
|
2478
|
+
]);
|
|
2479
|
+
function sameSet(a, b) {
|
|
2480
|
+
if (a.size !== b.size)
|
|
2481
|
+
return false;
|
|
2482
|
+
for (const value of a)
|
|
2483
|
+
if (!b.has(value))
|
|
2484
|
+
return false;
|
|
2485
|
+
return true;
|
|
2486
|
+
}
|
|
1717
2487
|
function identity(value) {
|
|
1718
2488
|
if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
|
|
1719
2489
|
return;
|
|
@@ -1789,26 +2559,35 @@ function safeDiagnosticMetrics(value) {
|
|
|
1789
2559
|
result.state = value.state;
|
|
1790
2560
|
return result;
|
|
1791
2561
|
}
|
|
2562
|
+
function bridgeDiagnosticsChangesEnabled() {
|
|
2563
|
+
return log2.isEnabled("trace");
|
|
2564
|
+
}
|
|
1792
2565
|
function writeBridgeDiagnostic({ bridge, event, payload }) {
|
|
1793
|
-
|
|
2566
|
+
return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
|
|
1794
2567
|
}
|
|
1795
2568
|
function bridgeDiagnosticsActive() {
|
|
1796
|
-
return
|
|
2569
|
+
return log2.isEnabled("info");
|
|
2570
|
+
}
|
|
2571
|
+
function bridgeDiagnosticsStreamEnabled(bridge) {
|
|
2572
|
+
return bridgeDebugEnabled(bridge) || log2.isEnabled("debug");
|
|
1797
2573
|
}
|
|
1798
2574
|
function writeDiagnostic(bridge, event, payload, write) {
|
|
1799
2575
|
try {
|
|
1800
2576
|
const json = JSON.stringify({ bridge, event, ...payload });
|
|
1801
2577
|
const bytes = Buffer.byteLength(json);
|
|
1802
2578
|
if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
|
|
1803
|
-
write({ bridge, event, payload: json });
|
|
1804
|
-
return;
|
|
2579
|
+
const accepted = write({ bridge, event, payload: json });
|
|
2580
|
+
return accepted !== false;
|
|
1805
2581
|
}
|
|
1806
|
-
write({
|
|
2582
|
+
const accepted = write({
|
|
1807
2583
|
bridge,
|
|
1808
2584
|
event: "snapshot-overflow",
|
|
1809
2585
|
payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
|
|
1810
2586
|
});
|
|
1811
|
-
|
|
2587
|
+
return accepted !== false;
|
|
2588
|
+
} catch {
|
|
2589
|
+
return false;
|
|
2590
|
+
}
|
|
1812
2591
|
}
|
|
1813
2592
|
|
|
1814
2593
|
class BridgeRunDiagnostics {
|
|
@@ -1840,6 +2619,7 @@ class BridgeRunDiagnostics {
|
|
|
1840
2619
|
completedTools = 0;
|
|
1841
2620
|
pending = new Map;
|
|
1842
2621
|
phase = "sending";
|
|
2622
|
+
processScope = false;
|
|
1843
2623
|
terminal = "pending";
|
|
1844
2624
|
stream = "pending";
|
|
1845
2625
|
cancellation = "none";
|
|
@@ -1847,6 +2627,8 @@ class BridgeRunDiagnostics {
|
|
|
1847
2627
|
run;
|
|
1848
2628
|
closed = false;
|
|
1849
2629
|
wasActive;
|
|
2630
|
+
baseline;
|
|
2631
|
+
changeQueued = false;
|
|
1850
2632
|
timer;
|
|
1851
2633
|
constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
|
|
1852
2634
|
this.bridge = bridge;
|
|
@@ -1892,7 +2674,8 @@ class BridgeRunDiagnostics {
|
|
|
1892
2674
|
return;
|
|
1893
2675
|
}
|
|
1894
2676
|
if (stage === "completed") {
|
|
1895
|
-
this.pending.delete(key)
|
|
2677
|
+
if (this.pending.delete(key))
|
|
2678
|
+
this.changed();
|
|
1896
2679
|
this.completedTools++;
|
|
1897
2680
|
return;
|
|
1898
2681
|
}
|
|
@@ -1907,13 +2690,23 @@ class BridgeRunDiagnostics {
|
|
|
1907
2690
|
stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
|
|
1908
2691
|
nested
|
|
1909
2692
|
});
|
|
2693
|
+
if (!existing)
|
|
2694
|
+
this.changed();
|
|
1910
2695
|
}
|
|
1911
2696
|
checkpoint(phase) {
|
|
2697
|
+
if (phase === "attached")
|
|
2698
|
+
this.processScope = true;
|
|
2699
|
+
if (phase === this.phase)
|
|
2700
|
+
return;
|
|
1912
2701
|
this.phase = phase;
|
|
2702
|
+
this.changed();
|
|
1913
2703
|
}
|
|
1914
2704
|
count(key, amount = 1) {
|
|
1915
|
-
if (
|
|
1916
|
-
|
|
2705
|
+
if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
|
|
2706
|
+
return;
|
|
2707
|
+
this.counters[key] += amount;
|
|
2708
|
+
if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
|
|
2709
|
+
this.changed();
|
|
1917
2710
|
}
|
|
1918
2711
|
translationFailed() {
|
|
1919
2712
|
this.translationFailures++;
|
|
@@ -1929,8 +2722,10 @@ class BridgeRunDiagnostics {
|
|
|
1929
2722
|
}
|
|
1930
2723
|
terminalSettled(outcome) {
|
|
1931
2724
|
this.terminal = outcome;
|
|
1932
|
-
if (outcome === "resolved")
|
|
2725
|
+
if (outcome === "resolved" && this.phase !== "draining") {
|
|
1933
2726
|
this.phase = "draining";
|
|
2727
|
+
this.changed();
|
|
2728
|
+
}
|
|
1934
2729
|
}
|
|
1935
2730
|
requestCancellation(reason = "user") {
|
|
1936
2731
|
this.cancellation = "pending";
|
|
@@ -1952,12 +2747,38 @@ class BridgeRunDiagnostics {
|
|
|
1952
2747
|
if (this.closed)
|
|
1953
2748
|
return;
|
|
1954
2749
|
const now = this.now();
|
|
1955
|
-
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
1956
2750
|
const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
|
|
1957
2751
|
if (event === "heartbeat")
|
|
1958
2752
|
this.lastTick = now;
|
|
1959
|
-
if (!
|
|
2753
|
+
if (!bridgeDiagnosticsActive())
|
|
2754
|
+
return;
|
|
2755
|
+
const stall = this.stallState(now, tickDelayMs);
|
|
2756
|
+
if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
|
|
2757
|
+
return;
|
|
2758
|
+
this.writeSnapshot(event, now, tickDelayMs, stall);
|
|
2759
|
+
}
|
|
2760
|
+
changed() {
|
|
2761
|
+
if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
|
|
2762
|
+
return;
|
|
2763
|
+
this.changeQueued = true;
|
|
2764
|
+
queueMicrotask(() => {
|
|
2765
|
+
this.changeQueued = false;
|
|
2766
|
+
this.reportChange();
|
|
2767
|
+
});
|
|
2768
|
+
}
|
|
2769
|
+
reportChange() {
|
|
2770
|
+
if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
|
|
1960
2771
|
return;
|
|
2772
|
+
const last = this.baseline;
|
|
2773
|
+
if (last && !this.changedSince(last))
|
|
2774
|
+
return;
|
|
2775
|
+
const now = this.now();
|
|
2776
|
+
try {
|
|
2777
|
+
this.writeSnapshot("change", now, 0, this.stallState(now, 0));
|
|
2778
|
+
} catch {}
|
|
2779
|
+
}
|
|
2780
|
+
writeSnapshot(event, now, tickDelayMs, stall) {
|
|
2781
|
+
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
1961
2782
|
const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
|
|
1962
2783
|
id,
|
|
1963
2784
|
kind: tool.kind,
|
|
@@ -1966,7 +2787,7 @@ class BridgeRunDiagnostics {
|
|
|
1966
2787
|
ageMs: age(tool.since)
|
|
1967
2788
|
}));
|
|
1968
2789
|
try {
|
|
1969
|
-
writeDiagnostic(this.bridge, event, {
|
|
2790
|
+
const written = writeDiagnostic(this.bridge, event, {
|
|
1970
2791
|
session: identity(this.state.id),
|
|
1971
2792
|
run: this.run,
|
|
1972
2793
|
phase: this.phase,
|
|
@@ -1993,8 +2814,64 @@ class BridgeRunDiagnostics {
|
|
|
1993
2814
|
completedTools: this.completedTools,
|
|
1994
2815
|
tickDelayMs
|
|
1995
2816
|
}, this.write);
|
|
2817
|
+
if (!written)
|
|
2818
|
+
return;
|
|
2819
|
+
this.baseline = {
|
|
2820
|
+
at: now,
|
|
2821
|
+
phase: this.phase,
|
|
2822
|
+
pending: new Set(this.pending.keys()),
|
|
2823
|
+
counters: { ...this.counters },
|
|
2824
|
+
stall
|
|
2825
|
+
};
|
|
1996
2826
|
} catch {}
|
|
1997
2827
|
}
|
|
2828
|
+
periodicDue(now, stall) {
|
|
2829
|
+
if (stall.signals.has("tick-delay"))
|
|
2830
|
+
return true;
|
|
2831
|
+
const last = this.baseline;
|
|
2832
|
+
if (!last)
|
|
2833
|
+
return true;
|
|
2834
|
+
if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
|
|
2835
|
+
return true;
|
|
2836
|
+
if (stall.signals.has("no-delta") && this.changedSince(last))
|
|
2837
|
+
return true;
|
|
2838
|
+
return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
|
|
2839
|
+
}
|
|
2840
|
+
changedSince(last) {
|
|
2841
|
+
if (this.phase !== last.phase)
|
|
2842
|
+
return true;
|
|
2843
|
+
if (this.pending.size !== last.pending.size)
|
|
2844
|
+
return true;
|
|
2845
|
+
for (const key of this.pending.keys())
|
|
2846
|
+
if (!last.pending.has(key))
|
|
2847
|
+
return true;
|
|
2848
|
+
for (const key of Object.keys(this.counters))
|
|
2849
|
+
if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
|
|
2850
|
+
return true;
|
|
2851
|
+
return false;
|
|
2852
|
+
}
|
|
2853
|
+
stallState(now, tickDelayMs) {
|
|
2854
|
+
const signals = new Set;
|
|
2855
|
+
const tools = new Set;
|
|
2856
|
+
let oldestPending;
|
|
2857
|
+
for (const [key, tool] of this.pending) {
|
|
2858
|
+
if (oldestPending === undefined || tool.since < oldestPending)
|
|
2859
|
+
oldestPending = tool.since;
|
|
2860
|
+
if (now - tool.since >= STALL_TOOL_PENDING_MS)
|
|
2861
|
+
tools.add(key);
|
|
2862
|
+
}
|
|
2863
|
+
const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
|
|
2864
|
+
if (waitingSince !== undefined) {
|
|
2865
|
+
const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
|
|
2866
|
+
if (now - quietSince >= STALL_NO_DELTA_MS)
|
|
2867
|
+
signals.add("no-delta");
|
|
2868
|
+
}
|
|
2869
|
+
if (tools.size > 0)
|
|
2870
|
+
signals.add("tool-pending");
|
|
2871
|
+
if (tickDelayMs >= STALL_TICK_DELAY_MS)
|
|
2872
|
+
signals.add("tick-delay");
|
|
2873
|
+
return { signals, tools };
|
|
2874
|
+
}
|
|
1998
2875
|
close(phase = "finished") {
|
|
1999
2876
|
if (this.closed)
|
|
2000
2877
|
return;
|
|
@@ -2007,8 +2884,9 @@ class BridgeRunDiagnostics {
|
|
|
2007
2884
|
}
|
|
2008
2885
|
}
|
|
2009
2886
|
function createBridgeDiagnostics(bridge, state, metrics) {
|
|
2010
|
-
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () =>
|
|
2887
|
+
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
|
|
2011
2888
|
}
|
|
2889
|
+
var bufferedFlushes = new Set;
|
|
2012
2890
|
|
|
2013
2891
|
// ../../bridges/acp-bridge/src/acp-context.ts
|
|
2014
2892
|
import { spawn as spawn2 } from "node:child_process";
|
|
@@ -10763,22 +11641,288 @@ async function assertAcpSignedIn(provider, authMethodEnv, env = process.env) {
|
|
|
10763
11641
|
throw new CredentialError(GROK_SIGN_IN_REQUIRED_MESSAGE);
|
|
10764
11642
|
}
|
|
10765
11643
|
}
|
|
10766
|
-
async function acpReadiness(provider, authMethodEnv, env = process.env) {
|
|
10767
|
-
if (!await acpSignInMissing(provider, authMethodEnv, env))
|
|
11644
|
+
async function acpReadiness(provider, authMethodEnv, env = process.env) {
|
|
11645
|
+
if (!await acpSignInMissing(provider, authMethodEnv, env))
|
|
11646
|
+
return;
|
|
11647
|
+
return {
|
|
11648
|
+
state: "authentication-required",
|
|
11649
|
+
message: GROK_SIGN_IN_REQUIRED_MESSAGE,
|
|
11650
|
+
signIn: acpSignInRoute(provider)
|
|
11651
|
+
};
|
|
11652
|
+
}
|
|
11653
|
+
|
|
11654
|
+
// ../../bridges/acp-bridge/src/acp-client-methods.ts
|
|
11655
|
+
import { spawn } from "node:child_process";
|
|
11656
|
+
import { constants } from "node:fs";
|
|
11657
|
+
import { lstat, open as open2, realpath } from "node:fs/promises";
|
|
11658
|
+
import { dirname, isAbsolute, join as join2, relative, resolve, sep } from "node:path";
|
|
11659
|
+
import { randomBytes } from "node:crypto";
|
|
11660
|
+
|
|
11661
|
+
// ../protocol/src/coordinator-web-research.ts
|
|
11662
|
+
var DEFAULT_COORDINATOR_RESEARCH_MCP_SERVERS = Object.freeze([{ name: "context7", url: "https://mcp.context7.com/mcp" }]);
|
|
11663
|
+
var COORDINATOR_DENIED = Object.freeze([
|
|
11664
|
+
"file.write",
|
|
11665
|
+
"file.patch",
|
|
11666
|
+
"shell.mutate",
|
|
11667
|
+
"network"
|
|
11668
|
+
]);
|
|
11669
|
+
function coordinatorCapabilityPolicy(mode) {
|
|
11670
|
+
return {
|
|
11671
|
+
deny: [...COORDINATOR_DENIED],
|
|
11672
|
+
...mode === "off" ? {} : { allow: ["web.search"] }
|
|
11673
|
+
};
|
|
11674
|
+
}
|
|
11675
|
+
|
|
11676
|
+
// ../../bridges/acp-bridge/src/acp-policy.ts
|
|
11677
|
+
var BRIDGE_EXECUTION_POLICY_ENV = "ORKESTRATOR_BRIDGE_EXECUTION_POLICY";
|
|
11678
|
+
function processExecutionPolicyIsCoordinator(env = process.env) {
|
|
11679
|
+
return env[BRIDGE_EXECUTION_POLICY_ENV] === "coordinator-read-only";
|
|
11680
|
+
}
|
|
11681
|
+
function coordinatorProcessPolicy() {
|
|
11682
|
+
return {
|
|
11683
|
+
id: "coordinator-read-only",
|
|
11684
|
+
sandbox: "provider",
|
|
11685
|
+
approvals: "deny",
|
|
11686
|
+
projectResources: false,
|
|
11687
|
+
capabilityPolicy: coordinatorCapabilityPolicy("off"),
|
|
11688
|
+
networkAccess: "restricted",
|
|
11689
|
+
note: "Grok's write, search_replace, shell, subagent, web search and web fetch tools are removed. Remaining permission requests are denied; other tools that do not ask, including xAI's hosted X search tools, remain advisory."
|
|
11690
|
+
};
|
|
11691
|
+
}
|
|
11692
|
+
function effectiveExecutionPolicy(requested, env = process.env) {
|
|
11693
|
+
if (!processExecutionPolicyIsCoordinator(env))
|
|
11694
|
+
return requested;
|
|
11695
|
+
return coordinatorProcessPolicy();
|
|
11696
|
+
}
|
|
11697
|
+
function effectiveTurnExecutionPolicy(input) {
|
|
11698
|
+
return input.readOnly ? coordinatorProcessPolicy() : effectiveExecutionPolicy(input.policy);
|
|
11699
|
+
}
|
|
11700
|
+
function acpReportedPolicy(policy, agent) {
|
|
11701
|
+
const applied = withoutProviderSandbox(policy, { agent, toolsetBlocksNetwork: false });
|
|
11702
|
+
if (applied.projectResources)
|
|
11703
|
+
return applied;
|
|
11704
|
+
return appendNativeAgentPolicyNote({ ...applied, projectResources: true }, `${agent} loads a project's own configuration by its own folder trust, whatever this session's policy says.`);
|
|
11705
|
+
}
|
|
11706
|
+
function acpSessionReportedPolicy(state, agent) {
|
|
11707
|
+
if (state.readOnly) {
|
|
11708
|
+
return readOnlyTurnReportedPolicy(acpReportedPolicy(coordinatorProcessPolicy(), agent));
|
|
11709
|
+
}
|
|
11710
|
+
return state.policy ? acpReportedPolicy(state.policy, agent) : undefined;
|
|
11711
|
+
}
|
|
11712
|
+
var ACP_FILE_MUTATION_DENIALS = Object.freeze([
|
|
11713
|
+
"file.write",
|
|
11714
|
+
"file.patch",
|
|
11715
|
+
"write",
|
|
11716
|
+
"edit",
|
|
11717
|
+
"apply_patch"
|
|
11718
|
+
]);
|
|
11719
|
+
var ACP_SHELL_DENIALS = Object.freeze(["shell", "shell.mutate"]);
|
|
11720
|
+
var FULL_ACP_CLIENT_METHOD_GRANT = Object.freeze({
|
|
11721
|
+
writeTextFile: true,
|
|
11722
|
+
terminal: true
|
|
11723
|
+
});
|
|
11724
|
+
function acpClientMethodGrant(policy) {
|
|
11725
|
+
if (!policy)
|
|
11726
|
+
return FULL_ACP_CLIENT_METHOD_GRANT;
|
|
11727
|
+
if (policy.approvals === "deny")
|
|
11728
|
+
return { writeTextFile: false, terminal: false };
|
|
11729
|
+
const denied = new Set([
|
|
11730
|
+
...nativeAgentDeniedCapabilities(policy),
|
|
11731
|
+
...policy.toolPolicy?.deny ?? []
|
|
11732
|
+
]);
|
|
11733
|
+
return {
|
|
11734
|
+
writeTextFile: !ACP_FILE_MUTATION_DENIALS.some((name) => denied.has(name)),
|
|
11735
|
+
terminal: !ACP_SHELL_DENIALS.some((name) => denied.has(name))
|
|
11736
|
+
};
|
|
11737
|
+
}
|
|
11738
|
+
|
|
11739
|
+
// ../../bridges/acp-bridge/src/acp-provider-config.ts
|
|
11740
|
+
import { mkdtempSync } from "node:fs";
|
|
11741
|
+
import { tmpdir } from "node:os";
|
|
11742
|
+
import path from "node:path";
|
|
11743
|
+
var GROK_PROVIDER = {
|
|
11744
|
+
id: "grok",
|
|
11745
|
+
name: "Grok",
|
|
11746
|
+
executable: "grok",
|
|
11747
|
+
argv: ["--always-approve", "agent", "{{model}}", "{{effort}}", "stdio"],
|
|
11748
|
+
env: {},
|
|
11749
|
+
requiresAuthenticate: true,
|
|
11750
|
+
authMethodEnv: "GROK_AUTH_METHOD_ID",
|
|
11751
|
+
modeMap: {
|
|
11752
|
+
agent: "build",
|
|
11753
|
+
code: "build",
|
|
11754
|
+
build: "build",
|
|
11755
|
+
agentic: "build",
|
|
11756
|
+
plan: "plan",
|
|
11757
|
+
architect: "plan",
|
|
11758
|
+
ask: "plan"
|
|
11759
|
+
},
|
|
11760
|
+
extensionPrefixes: ["x.ai/", "_x.ai/"],
|
|
11761
|
+
acknowledgedExtensionMethods: [],
|
|
11762
|
+
modelUpdateMethods: ["x.ai/models/update", "_x.ai/models/update"],
|
|
11763
|
+
sessionUpdateMethods: ["x.ai/session/update", "_x.ai/session/update"]
|
|
11764
|
+
};
|
|
11765
|
+
var UNDECLARED_PROMPT_CAPABILITIES = {};
|
|
11766
|
+
function undeclaredPromptCapabilities(providerId) {
|
|
11767
|
+
return Object.hasOwn(UNDECLARED_PROMPT_CAPABILITIES, providerId) ? UNDECLARED_PROMPT_CAPABILITIES[providerId] : {};
|
|
11768
|
+
}
|
|
11769
|
+
var SESSION_FORK_METHODS = {
|
|
11770
|
+
grok: { fork: "_x.ai/session/fork", promptPoints: "_x.ai/rewind/points" }
|
|
11771
|
+
};
|
|
11772
|
+
function sessionForkMethods(providerId) {
|
|
11773
|
+
return Object.hasOwn(SESSION_FORK_METHODS, providerId) ? SESSION_FORK_METHODS[providerId] : undefined;
|
|
11774
|
+
}
|
|
11775
|
+
function loadAcpProviderConfig(environment = process.env) {
|
|
11776
|
+
const serialized = environment.ACP_PROVIDER_CONFIG?.trim();
|
|
11777
|
+
if (serialized)
|
|
11778
|
+
return parseProviderConfig(serialized);
|
|
11779
|
+
const id = environment.ACP_PROVIDER?.trim();
|
|
11780
|
+
if (id && id !== "grok") {
|
|
11781
|
+
throw new Error("ACP_PROVIDER_CONFIG is required for ACP providers other than grok (ACP_PROVIDER=grok is built in)");
|
|
11782
|
+
}
|
|
11783
|
+
return {
|
|
11784
|
+
...GROK_PROVIDER,
|
|
11785
|
+
executable: environment.ACP_AGENT_PATH?.trim() || GROK_PROVIDER.executable
|
|
11786
|
+
};
|
|
11787
|
+
}
|
|
11788
|
+
var NETWORK_DENIED_ARGUMENTS = {
|
|
11789
|
+
grok: {
|
|
11790
|
+
leading: ["--disable-web-search"],
|
|
11791
|
+
subcommand: "agent",
|
|
11792
|
+
afterSubcommand: ["--no-leader"]
|
|
11793
|
+
}
|
|
11794
|
+
};
|
|
11795
|
+
var PROJECT_TRUST = {
|
|
11796
|
+
grok: {
|
|
11797
|
+
env: { GROK_FOLDER_TRUST: "0" },
|
|
11798
|
+
subcommand: "agent",
|
|
11799
|
+
afterSubcommand: ["--no-leader"]
|
|
11800
|
+
}
|
|
11801
|
+
};
|
|
11802
|
+
var SESSION_RULES_META_FIELD = {
|
|
11803
|
+
grok: "rules"
|
|
11804
|
+
};
|
|
11805
|
+
function sessionInstructionsMeta(config, instructions) {
|
|
11806
|
+
if (!instructions || !Object.hasOwn(SESSION_RULES_META_FIELD, config.id))
|
|
11807
|
+
return {};
|
|
11808
|
+
return { _meta: { [SESSION_RULES_META_FIELD[config.id]]: instructions } };
|
|
11809
|
+
}
|
|
11810
|
+
var POLICY_ENV = {
|
|
11811
|
+
grok: { GROK_WORKTREE_INHERITS_MAIN_APPROVALS: "false" }
|
|
11812
|
+
};
|
|
11813
|
+
function projectTrust(config, trustProject) {
|
|
11814
|
+
return trustProject && Object.hasOwn(PROJECT_TRUST, config.id) ? PROJECT_TRUST[config.id] : undefined;
|
|
11815
|
+
}
|
|
11816
|
+
var withheldGhConfigDir;
|
|
11817
|
+
function emptyGhConfigDir() {
|
|
11818
|
+
withheldGhConfigDir ??= mkdtempSync(path.join(tmpdir(), "orkestrator-gh-withheld-"));
|
|
11819
|
+
return withheldGhConfigDir;
|
|
11820
|
+
}
|
|
11821
|
+
var BRIDGE_CONTROL_ENV_VARS = Object.freeze([
|
|
11822
|
+
"ACP_BRIDGE_TOKEN",
|
|
11823
|
+
"ORKESTRATOR_AGENT_MCP_TOKEN",
|
|
11824
|
+
"ORKESTRATOR_AGENT_MCP_URL"
|
|
11825
|
+
]);
|
|
11826
|
+
function withoutBridgeControlEnvironment(env) {
|
|
11827
|
+
const scrubbed = { ...env };
|
|
11828
|
+
for (const name of Object.keys(scrubbed)) {
|
|
11829
|
+
if (BRIDGE_CONTROL_ENV_VARS.includes(name) || name.endsWith("_BRIDGE_TOKEN")) {
|
|
11830
|
+
delete scrubbed[name];
|
|
11831
|
+
}
|
|
11832
|
+
}
|
|
11833
|
+
return scrubbed;
|
|
11834
|
+
}
|
|
11835
|
+
function providerEnv(config, options, base = process.env) {
|
|
11836
|
+
const env = {
|
|
11837
|
+
...withoutBridgeControlEnvironment(base),
|
|
11838
|
+
...config.env,
|
|
11839
|
+
...Object.hasOwn(POLICY_ENV, config.id) ? POLICY_ENV[config.id] : {},
|
|
11840
|
+
...projectTrust(config, options.trustProject)?.env
|
|
11841
|
+
};
|
|
11842
|
+
return options.withholdGitHub ? withheldGitHubCredentialEnvironment(env, options.withholdGitHub) : env;
|
|
11843
|
+
}
|
|
11844
|
+
function providerArgv(config, options) {
|
|
11845
|
+
if (options.readOnlyProfilePath && !config.argv.includes("agent")) {
|
|
11846
|
+
throw new Error("Grok read-only profile requires a local agent launcher");
|
|
11847
|
+
}
|
|
11848
|
+
const network = options.denyNetwork && Object.hasOwn(NETWORK_DENIED_ARGUMENTS, config.id) ? NETWORK_DENIED_ARGUMENTS[config.id] : undefined;
|
|
11849
|
+
const trust = projectTrust(config, options.trustProject);
|
|
11850
|
+
const argv = config.argv.flatMap((argument) => {
|
|
11851
|
+
if (argument === "--always-approve" && options.approvals && options.approvals !== "auto-approve") {
|
|
11852
|
+
return [];
|
|
11853
|
+
}
|
|
11854
|
+
if (argument === "{{model}}")
|
|
11855
|
+
return options.model ? ["--model", options.model] : [];
|
|
11856
|
+
if (argument === "{{effort}}") {
|
|
11857
|
+
return options.effort ? ["--reasoning-effort", options.effort] : [];
|
|
11858
|
+
}
|
|
11859
|
+
const after = [
|
|
11860
|
+
...network && argument === network.subcommand ? network.afterSubcommand : [],
|
|
11861
|
+
...trust && argument === trust.subcommand ? trust.afterSubcommand : [],
|
|
11862
|
+
...argument === "agent" && options.readOnlyProfilePath ? ["--no-leader"] : []
|
|
11863
|
+
];
|
|
11864
|
+
return [
|
|
11865
|
+
argument,
|
|
11866
|
+
...new Set(after),
|
|
11867
|
+
...argument === "agent" && options.readOnlyProfilePath ? ["--agent-profile", options.readOnlyProfilePath] : []
|
|
11868
|
+
];
|
|
11869
|
+
});
|
|
11870
|
+
return network ? [...network.leading, ...argv] : argv;
|
|
11871
|
+
}
|
|
11872
|
+
function parseProviderConfig(serialized) {
|
|
11873
|
+
let value;
|
|
11874
|
+
try {
|
|
11875
|
+
value = JSON.parse(serialized);
|
|
11876
|
+
} catch {
|
|
11877
|
+
throw new Error("ACP_PROVIDER_CONFIG must be valid JSON");
|
|
11878
|
+
}
|
|
11879
|
+
if (!isRecord2(value))
|
|
11880
|
+
throw new Error("ACP_PROVIDER_CONFIG must be a JSON object");
|
|
11881
|
+
const id = requiredString(value.id, "id");
|
|
11882
|
+
const executable = requiredString(value.executable, "executable");
|
|
11883
|
+
const argv = stringArray(value.argv, "argv", 128);
|
|
11884
|
+
const modeMap = isRecord2(value.modeMap) ? Object.fromEntries(Object.entries(value.modeMap).flatMap(([agentMode, normalized]) => normalized === "build" || normalized === "plan" ? [[agentMode, normalized]] : [])) : {};
|
|
11885
|
+
const env = isRecord2(value.env) ? Object.fromEntries(Object.entries(value.env).flatMap(([key, entry]) => typeof entry === "string" ? [[key, entry]] : [])) : {};
|
|
11886
|
+
return {
|
|
11887
|
+
id,
|
|
11888
|
+
name: optionalString(value.name) ?? id,
|
|
11889
|
+
executable,
|
|
11890
|
+
argv,
|
|
11891
|
+
env,
|
|
11892
|
+
requiresAuthenticate: value.requiresAuthenticate === true,
|
|
11893
|
+
...optionalString(value.authMethodEnv) ? { authMethodEnv: optionalString(value.authMethodEnv) } : {},
|
|
11894
|
+
modeMap,
|
|
11895
|
+
extensionPrefixes: stringArray(value.extensionPrefixes, "extensionPrefixes", 64, true),
|
|
11896
|
+
acknowledgedExtensionMethods: stringArray(value.acknowledgedExtensionMethods, "acknowledgedExtensionMethods", 64, true),
|
|
11897
|
+
modelUpdateMethods: stringArray(value.modelUpdateMethods, "modelUpdateMethods", 64, true),
|
|
11898
|
+
sessionUpdateMethods: stringArray(value.sessionUpdateMethods, "sessionUpdateMethods", 64, true)
|
|
11899
|
+
};
|
|
11900
|
+
}
|
|
11901
|
+
function stringArray(value, field, maximum, optional = false) {
|
|
11902
|
+
if (value === undefined && optional)
|
|
11903
|
+
return [];
|
|
11904
|
+
if (!Array.isArray(value) || value.length > maximum || value.some((entry) => !optionalString(entry))) {
|
|
11905
|
+
throw new Error(`ACP_PROVIDER_CONFIG.${field} must be an array of non-empty strings`);
|
|
11906
|
+
}
|
|
11907
|
+
return value;
|
|
11908
|
+
}
|
|
11909
|
+
function requiredString(value, field) {
|
|
11910
|
+
const parsed = optionalString(value);
|
|
11911
|
+
if (!parsed)
|
|
11912
|
+
throw new Error(`ACP_PROVIDER_CONFIG.${field} must be a non-empty string`);
|
|
11913
|
+
return parsed;
|
|
11914
|
+
}
|
|
11915
|
+
function optionalString(value) {
|
|
11916
|
+
if (typeof value !== "string")
|
|
10768
11917
|
return;
|
|
10769
|
-
|
|
10770
|
-
|
|
10771
|
-
|
|
10772
|
-
|
|
10773
|
-
|
|
11918
|
+
const trimmed = value.trim();
|
|
11919
|
+
return trimmed && Buffer.byteLength(trimmed) <= 4096 ? trimmed : undefined;
|
|
11920
|
+
}
|
|
11921
|
+
function isRecord2(value) {
|
|
11922
|
+
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
10774
11923
|
}
|
|
10775
11924
|
|
|
10776
11925
|
// ../../bridges/acp-bridge/src/acp-client-methods.ts
|
|
10777
|
-
import { spawn } from "node:child_process";
|
|
10778
|
-
import { constants } from "node:fs";
|
|
10779
|
-
import { lstat, open as open2, realpath } from "node:fs/promises";
|
|
10780
|
-
import { dirname, isAbsolute, join as join2, relative, resolve, sep } from "node:path";
|
|
10781
|
-
import { randomBytes } from "node:crypto";
|
|
10782
11926
|
var MAX_FILE_BYTES = 2 * 1024 * 1024;
|
|
10783
11927
|
var MAX_READ_LINES = 1e5;
|
|
10784
11928
|
var DEFAULT_TERMINAL_OUTPUT_BYTES = 1024 * 1024;
|
|
@@ -10844,12 +11988,17 @@ class BoundedTerminalOutput {
|
|
|
10844
11988
|
class AcpClientMethods {
|
|
10845
11989
|
workspaceRoot;
|
|
10846
11990
|
spawnTerminalImpl;
|
|
11991
|
+
grant;
|
|
10847
11992
|
#terminals = new Map;
|
|
10848
|
-
constructor(workspaceRoot, spawnTerminalImpl = spawnTerminal) {
|
|
11993
|
+
constructor(workspaceRoot, spawnTerminalImpl = spawnTerminal, grant = FULL_ACP_CLIENT_METHOD_GRANT) {
|
|
10849
11994
|
this.workspaceRoot = workspaceRoot;
|
|
10850
11995
|
this.spawnTerminalImpl = spawnTerminalImpl;
|
|
11996
|
+
this.grant = grant;
|
|
10851
11997
|
}
|
|
10852
11998
|
async handle(method, params) {
|
|
11999
|
+
if (method === "fs/write_text_file" && !this.grant.writeTextFile || method.startsWith("terminal/") && !this.grant.terminal) {
|
|
12000
|
+
throw new ClientMethodRefusedError(method);
|
|
12001
|
+
}
|
|
10853
12002
|
switch (method) {
|
|
10854
12003
|
case "fs/read_text_file":
|
|
10855
12004
|
return this.readTextFile(assertReadRequest(params));
|
|
@@ -10923,10 +12072,10 @@ class AcpClientMethods {
|
|
|
10923
12072
|
const terminalId = randomBytes(16).toString("hex");
|
|
10924
12073
|
const child = this.spawnTerminalImpl(request.command, request.args ?? [], {
|
|
10925
12074
|
cwd,
|
|
10926
|
-
env: {
|
|
12075
|
+
env: withoutBridgeControlEnvironment({
|
|
10927
12076
|
...process.env,
|
|
10928
12077
|
...Object.fromEntries((request.env ?? []).map((entry) => [entry.name, entry.value]))
|
|
10929
|
-
}
|
|
12078
|
+
})
|
|
10930
12079
|
});
|
|
10931
12080
|
let resolveExit;
|
|
10932
12081
|
const exited = new Promise((resolve) => {
|
|
@@ -10994,6 +12143,12 @@ class AcpClientMethods {
|
|
|
10994
12143
|
|
|
10995
12144
|
class UnsupportedClientMethodError extends Error {
|
|
10996
12145
|
}
|
|
12146
|
+
|
|
12147
|
+
class ClientMethodRefusedError extends Error {
|
|
12148
|
+
constructor(method) {
|
|
12149
|
+
super(`ACP ${method} is refused by this session's execution policy`);
|
|
12150
|
+
}
|
|
12151
|
+
}
|
|
10997
12152
|
async function secureExistingFile(requestedPath, workspaceRoot) {
|
|
10998
12153
|
const path = await securePath(requestedPath, workspaceRoot, false);
|
|
10999
12154
|
const stats = await lstat(path);
|
|
@@ -11202,178 +12357,6 @@ function isString(value) {
|
|
|
11202
12357
|
return typeof value === "string" && value.length > 0 && Buffer.byteLength(value) <= 16 * 1024;
|
|
11203
12358
|
}
|
|
11204
12359
|
|
|
11205
|
-
// ../../bridges/acp-bridge/src/acp-provider-config.ts
|
|
11206
|
-
import { mkdtempSync } from "node:fs";
|
|
11207
|
-
import { tmpdir } from "node:os";
|
|
11208
|
-
import path from "node:path";
|
|
11209
|
-
var GROK_PROVIDER = {
|
|
11210
|
-
id: "grok",
|
|
11211
|
-
name: "Grok",
|
|
11212
|
-
executable: "grok",
|
|
11213
|
-
argv: ["--always-approve", "agent", "{{model}}", "{{effort}}", "stdio"],
|
|
11214
|
-
env: {},
|
|
11215
|
-
requiresAuthenticate: true,
|
|
11216
|
-
authMethodEnv: "GROK_AUTH_METHOD_ID",
|
|
11217
|
-
modeMap: {
|
|
11218
|
-
agent: "build",
|
|
11219
|
-
code: "build",
|
|
11220
|
-
build: "build",
|
|
11221
|
-
agentic: "build",
|
|
11222
|
-
plan: "plan",
|
|
11223
|
-
architect: "plan",
|
|
11224
|
-
ask: "plan"
|
|
11225
|
-
},
|
|
11226
|
-
extensionPrefixes: ["x.ai/", "_x.ai/"],
|
|
11227
|
-
acknowledgedExtensionMethods: [],
|
|
11228
|
-
modelUpdateMethods: ["x.ai/models/update", "_x.ai/models/update"],
|
|
11229
|
-
sessionUpdateMethods: ["x.ai/session/update", "_x.ai/session/update"]
|
|
11230
|
-
};
|
|
11231
|
-
var UNDECLARED_PROMPT_CAPABILITIES = {};
|
|
11232
|
-
function undeclaredPromptCapabilities(providerId) {
|
|
11233
|
-
return Object.hasOwn(UNDECLARED_PROMPT_CAPABILITIES, providerId) ? UNDECLARED_PROMPT_CAPABILITIES[providerId] : {};
|
|
11234
|
-
}
|
|
11235
|
-
var SESSION_FORK_METHODS = {
|
|
11236
|
-
grok: { fork: "_x.ai/session/fork", promptPoints: "_x.ai/rewind/points" }
|
|
11237
|
-
};
|
|
11238
|
-
function sessionForkMethods(providerId) {
|
|
11239
|
-
return Object.hasOwn(SESSION_FORK_METHODS, providerId) ? SESSION_FORK_METHODS[providerId] : undefined;
|
|
11240
|
-
}
|
|
11241
|
-
function loadAcpProviderConfig(environment = process.env) {
|
|
11242
|
-
const serialized = environment.ACP_PROVIDER_CONFIG?.trim();
|
|
11243
|
-
if (serialized)
|
|
11244
|
-
return parseProviderConfig(serialized);
|
|
11245
|
-
const id = environment.ACP_PROVIDER?.trim();
|
|
11246
|
-
if (id && id !== "grok") {
|
|
11247
|
-
throw new Error("ACP_PROVIDER_CONFIG is required for ACP providers other than grok (ACP_PROVIDER=grok is built in)");
|
|
11248
|
-
}
|
|
11249
|
-
return {
|
|
11250
|
-
...GROK_PROVIDER,
|
|
11251
|
-
executable: environment.ACP_AGENT_PATH?.trim() || GROK_PROVIDER.executable
|
|
11252
|
-
};
|
|
11253
|
-
}
|
|
11254
|
-
var NETWORK_DENIED_ARGUMENTS = {
|
|
11255
|
-
grok: {
|
|
11256
|
-
leading: ["--disable-web-search"],
|
|
11257
|
-
subcommand: "agent",
|
|
11258
|
-
afterSubcommand: ["--no-leader"]
|
|
11259
|
-
}
|
|
11260
|
-
};
|
|
11261
|
-
var PROJECT_TRUST = {
|
|
11262
|
-
grok: {
|
|
11263
|
-
env: { GROK_FOLDER_TRUST: "0" },
|
|
11264
|
-
subcommand: "agent",
|
|
11265
|
-
afterSubcommand: ["--no-leader"]
|
|
11266
|
-
}
|
|
11267
|
-
};
|
|
11268
|
-
var SESSION_RULES_META_FIELD = {
|
|
11269
|
-
grok: "rules"
|
|
11270
|
-
};
|
|
11271
|
-
function sessionInstructionsMeta(config, instructions) {
|
|
11272
|
-
if (!instructions || !Object.hasOwn(SESSION_RULES_META_FIELD, config.id))
|
|
11273
|
-
return {};
|
|
11274
|
-
return { _meta: { [SESSION_RULES_META_FIELD[config.id]]: instructions } };
|
|
11275
|
-
}
|
|
11276
|
-
var POLICY_ENV = {
|
|
11277
|
-
grok: { GROK_WORKTREE_INHERITS_MAIN_APPROVALS: "false" }
|
|
11278
|
-
};
|
|
11279
|
-
function projectTrust(config, trustProject) {
|
|
11280
|
-
return trustProject && Object.hasOwn(PROJECT_TRUST, config.id) ? PROJECT_TRUST[config.id] : undefined;
|
|
11281
|
-
}
|
|
11282
|
-
var withheldGhConfigDir;
|
|
11283
|
-
function emptyGhConfigDir() {
|
|
11284
|
-
withheldGhConfigDir ??= mkdtempSync(path.join(tmpdir(), "orkestrator-gh-withheld-"));
|
|
11285
|
-
return withheldGhConfigDir;
|
|
11286
|
-
}
|
|
11287
|
-
function providerEnv(config, options, base = process.env) {
|
|
11288
|
-
const env = {
|
|
11289
|
-
...base,
|
|
11290
|
-
...config.env,
|
|
11291
|
-
...Object.hasOwn(POLICY_ENV, config.id) ? POLICY_ENV[config.id] : {},
|
|
11292
|
-
...projectTrust(config, options.trustProject)?.env
|
|
11293
|
-
};
|
|
11294
|
-
return options.withholdGitHub ? withheldGitHubCredentialEnvironment(env, options.withholdGitHub) : env;
|
|
11295
|
-
}
|
|
11296
|
-
function providerArgv(config, options) {
|
|
11297
|
-
if (options.readOnlyProfilePath && !config.argv.includes("agent")) {
|
|
11298
|
-
throw new Error("Grok read-only profile requires a local agent launcher");
|
|
11299
|
-
}
|
|
11300
|
-
const network = options.denyNetwork && Object.hasOwn(NETWORK_DENIED_ARGUMENTS, config.id) ? NETWORK_DENIED_ARGUMENTS[config.id] : undefined;
|
|
11301
|
-
const trust = projectTrust(config, options.trustProject);
|
|
11302
|
-
const argv = config.argv.flatMap((argument) => {
|
|
11303
|
-
if (argument === "--always-approve" && options.approvals && options.approvals !== "auto-approve") {
|
|
11304
|
-
return [];
|
|
11305
|
-
}
|
|
11306
|
-
if (argument === "{{model}}")
|
|
11307
|
-
return options.model ? ["--model", options.model] : [];
|
|
11308
|
-
if (argument === "{{effort}}") {
|
|
11309
|
-
return options.effort ? ["--reasoning-effort", options.effort] : [];
|
|
11310
|
-
}
|
|
11311
|
-
const after = [
|
|
11312
|
-
...network && argument === network.subcommand ? network.afterSubcommand : [],
|
|
11313
|
-
...trust && argument === trust.subcommand ? trust.afterSubcommand : [],
|
|
11314
|
-
...argument === "agent" && options.readOnlyProfilePath ? ["--no-leader"] : []
|
|
11315
|
-
];
|
|
11316
|
-
return [
|
|
11317
|
-
argument,
|
|
11318
|
-
...new Set(after),
|
|
11319
|
-
...argument === "agent" && options.readOnlyProfilePath ? ["--agent-profile", options.readOnlyProfilePath] : []
|
|
11320
|
-
];
|
|
11321
|
-
});
|
|
11322
|
-
return network ? [...network.leading, ...argv] : argv;
|
|
11323
|
-
}
|
|
11324
|
-
function parseProviderConfig(serialized) {
|
|
11325
|
-
let value;
|
|
11326
|
-
try {
|
|
11327
|
-
value = JSON.parse(serialized);
|
|
11328
|
-
} catch {
|
|
11329
|
-
throw new Error("ACP_PROVIDER_CONFIG must be valid JSON");
|
|
11330
|
-
}
|
|
11331
|
-
if (!isRecord2(value))
|
|
11332
|
-
throw new Error("ACP_PROVIDER_CONFIG must be a JSON object");
|
|
11333
|
-
const id = requiredString(value.id, "id");
|
|
11334
|
-
const executable = requiredString(value.executable, "executable");
|
|
11335
|
-
const argv = stringArray(value.argv, "argv", 128);
|
|
11336
|
-
const modeMap = isRecord2(value.modeMap) ? Object.fromEntries(Object.entries(value.modeMap).flatMap(([agentMode, normalized]) => normalized === "build" || normalized === "plan" ? [[agentMode, normalized]] : [])) : {};
|
|
11337
|
-
const env = isRecord2(value.env) ? Object.fromEntries(Object.entries(value.env).flatMap(([key, entry]) => typeof entry === "string" ? [[key, entry]] : [])) : {};
|
|
11338
|
-
return {
|
|
11339
|
-
id,
|
|
11340
|
-
name: optionalString(value.name) ?? id,
|
|
11341
|
-
executable,
|
|
11342
|
-
argv,
|
|
11343
|
-
env,
|
|
11344
|
-
requiresAuthenticate: value.requiresAuthenticate === true,
|
|
11345
|
-
...optionalString(value.authMethodEnv) ? { authMethodEnv: optionalString(value.authMethodEnv) } : {},
|
|
11346
|
-
modeMap,
|
|
11347
|
-
extensionPrefixes: stringArray(value.extensionPrefixes, "extensionPrefixes", 64, true),
|
|
11348
|
-
acknowledgedExtensionMethods: stringArray(value.acknowledgedExtensionMethods, "acknowledgedExtensionMethods", 64, true),
|
|
11349
|
-
modelUpdateMethods: stringArray(value.modelUpdateMethods, "modelUpdateMethods", 64, true),
|
|
11350
|
-
sessionUpdateMethods: stringArray(value.sessionUpdateMethods, "sessionUpdateMethods", 64, true)
|
|
11351
|
-
};
|
|
11352
|
-
}
|
|
11353
|
-
function stringArray(value, field, maximum, optional = false) {
|
|
11354
|
-
if (value === undefined && optional)
|
|
11355
|
-
return [];
|
|
11356
|
-
if (!Array.isArray(value) || value.length > maximum || value.some((entry) => !optionalString(entry))) {
|
|
11357
|
-
throw new Error(`ACP_PROVIDER_CONFIG.${field} must be an array of non-empty strings`);
|
|
11358
|
-
}
|
|
11359
|
-
return value;
|
|
11360
|
-
}
|
|
11361
|
-
function requiredString(value, field) {
|
|
11362
|
-
const parsed = optionalString(value);
|
|
11363
|
-
if (!parsed)
|
|
11364
|
-
throw new Error(`ACP_PROVIDER_CONFIG.${field} must be a non-empty string`);
|
|
11365
|
-
return parsed;
|
|
11366
|
-
}
|
|
11367
|
-
function optionalString(value) {
|
|
11368
|
-
if (typeof value !== "string")
|
|
11369
|
-
return;
|
|
11370
|
-
const trimmed = value.trim();
|
|
11371
|
-
return trimmed && Buffer.byteLength(trimmed) <= 4096 ? trimmed : undefined;
|
|
11372
|
-
}
|
|
11373
|
-
function isRecord2(value) {
|
|
11374
|
-
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
11375
|
-
}
|
|
11376
|
-
|
|
11377
12360
|
// ../../bridges/acp-bridge/src/acp-readonly-profile.ts
|
|
11378
12361
|
import { mkdtempSync as mkdtempSync2, writeFileSync, rmSync } from "node:fs";
|
|
11379
12362
|
import { tmpdir as tmpdir2 } from "node:os";
|
|
@@ -11483,58 +12466,6 @@ function grokQuestionTimeoutFromEnv(env) {
|
|
|
11483
12466
|
return layer.secs !== undefined ? layer.secs * 1000 : GROK_QUESTION_DEFAULT_TIMEOUT_MS;
|
|
11484
12467
|
}
|
|
11485
12468
|
|
|
11486
|
-
// ../protocol/src/coordinator-web-research.ts
|
|
11487
|
-
var DEFAULT_COORDINATOR_RESEARCH_MCP_SERVERS = Object.freeze([{ name: "context7", url: "https://mcp.context7.com/mcp" }]);
|
|
11488
|
-
var COORDINATOR_DENIED = Object.freeze([
|
|
11489
|
-
"file.write",
|
|
11490
|
-
"file.patch",
|
|
11491
|
-
"shell.mutate",
|
|
11492
|
-
"network"
|
|
11493
|
-
]);
|
|
11494
|
-
function coordinatorCapabilityPolicy(mode) {
|
|
11495
|
-
return {
|
|
11496
|
-
deny: [...COORDINATOR_DENIED],
|
|
11497
|
-
...mode === "off" ? {} : { allow: ["web.search"] }
|
|
11498
|
-
};
|
|
11499
|
-
}
|
|
11500
|
-
|
|
11501
|
-
// ../../bridges/acp-bridge/src/acp-policy.ts
|
|
11502
|
-
var BRIDGE_EXECUTION_POLICY_ENV = "ORKESTRATOR_BRIDGE_EXECUTION_POLICY";
|
|
11503
|
-
function processExecutionPolicyIsCoordinator(env = process.env) {
|
|
11504
|
-
return env[BRIDGE_EXECUTION_POLICY_ENV] === "coordinator-read-only";
|
|
11505
|
-
}
|
|
11506
|
-
function coordinatorProcessPolicy() {
|
|
11507
|
-
return {
|
|
11508
|
-
id: "coordinator-read-only",
|
|
11509
|
-
sandbox: "provider",
|
|
11510
|
-
approvals: "deny",
|
|
11511
|
-
projectResources: false,
|
|
11512
|
-
capabilityPolicy: coordinatorCapabilityPolicy("off"),
|
|
11513
|
-
networkAccess: "restricted",
|
|
11514
|
-
note: "Grok's write, search_replace, shell, subagent, web search and web fetch tools are removed. Remaining permission requests are denied; other tools that do not ask, including xAI's hosted X search tools, remain advisory."
|
|
11515
|
-
};
|
|
11516
|
-
}
|
|
11517
|
-
function effectiveExecutionPolicy(requested, env = process.env) {
|
|
11518
|
-
if (!processExecutionPolicyIsCoordinator(env))
|
|
11519
|
-
return requested;
|
|
11520
|
-
return coordinatorProcessPolicy();
|
|
11521
|
-
}
|
|
11522
|
-
function effectiveTurnExecutionPolicy(input) {
|
|
11523
|
-
return input.readOnly ? coordinatorProcessPolicy() : effectiveExecutionPolicy(input.policy);
|
|
11524
|
-
}
|
|
11525
|
-
function acpReportedPolicy(policy, agent) {
|
|
11526
|
-
const applied = withoutProviderSandbox(policy, { agent, toolsetBlocksNetwork: false });
|
|
11527
|
-
if (applied.projectResources)
|
|
11528
|
-
return applied;
|
|
11529
|
-
return appendNativeAgentPolicyNote({ ...applied, projectResources: true }, `${agent} loads a project's own configuration by its own folder trust, whatever this session's policy says.`);
|
|
11530
|
-
}
|
|
11531
|
-
function acpSessionReportedPolicy(state, agent) {
|
|
11532
|
-
if (state.readOnly) {
|
|
11533
|
-
return readOnlyTurnReportedPolicy(acpReportedPolicy(coordinatorProcessPolicy(), agent));
|
|
11534
|
-
}
|
|
11535
|
-
return state.policy ? acpReportedPolicy(state.policy, agent) : undefined;
|
|
11536
|
-
}
|
|
11537
|
-
|
|
11538
12469
|
// ../../bridges/acp-bridge/src/acp-mcp-inventory.ts
|
|
11539
12470
|
import { createHash as createHash2 } from "node:crypto";
|
|
11540
12471
|
import { readFile, stat } from "node:fs/promises";
|
|
@@ -11701,6 +12632,7 @@ var port = parsePort(process.env.PORT);
|
|
|
11701
12632
|
var hostname = process.env.HOSTNAME?.trim() || "127.0.0.1";
|
|
11702
12633
|
var workingDirectory = resolve3(process.env.CWD?.trim() || process.cwd());
|
|
11703
12634
|
var authToken = process.env.ACP_BRIDGE_TOKEN?.trim() || randomBytes2(32).toString("base64url");
|
|
12635
|
+
delete process.env.ACP_BRIDGE_TOKEN;
|
|
11704
12636
|
var executable = providerConfig.executable;
|
|
11705
12637
|
var stateDirectory = process.env.ACP_STATE_DIR?.trim();
|
|
11706
12638
|
var stateFile = stateDirectory ? resolve3(stateDirectory, "state.json") : null;
|
|
@@ -11859,7 +12791,8 @@ class AcpProcess {
|
|
|
11859
12791
|
child;
|
|
11860
12792
|
mcpConfigAtSpawn;
|
|
11861
12793
|
questionTimeout;
|
|
11862
|
-
clientMethods
|
|
12794
|
+
clientMethods;
|
|
12795
|
+
clientMethodGrant;
|
|
11863
12796
|
#diagnostics;
|
|
11864
12797
|
#nextId = 1;
|
|
11865
12798
|
#pending = new Map;
|
|
@@ -11885,6 +12818,8 @@ class AcpProcess {
|
|
|
11885
12818
|
throw new Error(`${provider} ACP provider config has no executable`);
|
|
11886
12819
|
}
|
|
11887
12820
|
const policy = spawnOptions.policy ?? effectiveExecutionPolicy(undefined);
|
|
12821
|
+
this.clientMethodGrant = acpClientMethodGrant(policy);
|
|
12822
|
+
this.clientMethods = new AcpClientMethods(workingDirectory, undefined, this.clientMethodGrant);
|
|
11888
12823
|
const trustProject = policy?.projectResources === true;
|
|
11889
12824
|
if (providerConfig.id === "grok" && policy?.approvals === "deny") {
|
|
11890
12825
|
this.#readOnlyProfile = createReadOnlyProfile();
|
|
@@ -11941,8 +12876,8 @@ class AcpProcess {
|
|
|
11941
12876
|
const initializeRequest = {
|
|
11942
12877
|
protocolVersion: PROTOCOL_VERSION,
|
|
11943
12878
|
clientCapabilities: {
|
|
11944
|
-
fs: { readTextFile: true, writeTextFile:
|
|
11945
|
-
terminal:
|
|
12879
|
+
fs: { readTextFile: true, writeTextFile: this.clientMethodGrant.writeTextFile },
|
|
12880
|
+
terminal: this.clientMethodGrant.terminal,
|
|
11946
12881
|
session: { configOptions: { boolean: {} }, notices: {} },
|
|
11947
12882
|
_meta: { parameterizedModelPicker: true }
|
|
11948
12883
|
},
|
|
@@ -12127,7 +13062,7 @@ class AcpProcess {
|
|
|
12127
13062
|
jsonrpc: "2.0",
|
|
12128
13063
|
id: message.id,
|
|
12129
13064
|
error: {
|
|
12130
|
-
code: error instanceof UnsupportedClientMethodError ? -32601 : -32602,
|
|
13065
|
+
code: error instanceof UnsupportedClientMethodError || error instanceof ClientMethodRefusedError ? -32601 : -32602,
|
|
12131
13066
|
message: error instanceof Error ? error.message : "ACP client request failed"
|
|
12132
13067
|
}
|
|
12133
13068
|
}));
|
|
@@ -13032,7 +13967,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
13032
13967
|
}
|
|
13033
13968
|
|
|
13034
13969
|
// ../../bridges/acp-bridge/src/acp-persist-writer.ts
|
|
13035
|
-
var
|
|
13970
|
+
var log3 = createLogger("bridge.acp");
|
|
13036
13971
|
function boundPersistedSnapshot(snapshot) {
|
|
13037
13972
|
const bounded = {
|
|
13038
13973
|
...snapshot,
|
|
@@ -13229,7 +14164,7 @@ function schedulePersist() {
|
|
|
13229
14164
|
await writePersistedState();
|
|
13230
14165
|
});
|
|
13231
14166
|
setPersistenceTail(operation.catch((error) => {
|
|
13232
|
-
|
|
14167
|
+
log3.warn("state.persist-failed", { error: formatLogError(error, { stack: false }) });
|
|
13233
14168
|
}));
|
|
13234
14169
|
}
|
|
13235
14170
|
function persistState() {
|
|
@@ -17189,7 +18124,7 @@ function compactCommandSelection(state) {
|
|
|
17189
18124
|
}
|
|
17190
18125
|
|
|
17191
18126
|
// ../../bridges/acp-bridge/src/acp-persistence.ts
|
|
17192
|
-
var
|
|
18127
|
+
var log4 = createLogger("bridge.acp");
|
|
17193
18128
|
async function listNormalizedModels(signal) {
|
|
17194
18129
|
const live = mergeComposerCatalog(provider, [
|
|
17195
18130
|
...catalogCache ? [catalogCache] : [],
|
|
@@ -17237,14 +18172,14 @@ function restoreSessionConfig(candidate) {
|
|
|
17237
18172
|
const restored = parsePersistedAcpSessionConfig(provider, candidate.sessionConfig);
|
|
17238
18173
|
if (restored)
|
|
17239
18174
|
return restored;
|
|
17240
|
-
|
|
18175
|
+
log4.warn("state.session-config-reset");
|
|
17241
18176
|
return emptySessionConfig();
|
|
17242
18177
|
}
|
|
17243
18178
|
if (candidate.composer !== undefined) {
|
|
17244
18179
|
const composer = parsePersistedComposerState(provider, candidate.composer);
|
|
17245
18180
|
if (composer)
|
|
17246
18181
|
return { ...emptySessionConfig(), composer };
|
|
17247
|
-
|
|
18182
|
+
log4.warn("state.composer-reset");
|
|
17248
18183
|
}
|
|
17249
18184
|
return emptySessionConfig();
|
|
17250
18185
|
}
|
|
@@ -17327,7 +18262,7 @@ async function restorePersistedState() {
|
|
|
17327
18262
|
sessions.clear();
|
|
17328
18263
|
bumpCursorDiscoveryRevision();
|
|
17329
18264
|
clientSessionKeys.clear();
|
|
17330
|
-
|
|
18265
|
+
log4.warn("state.discarded", { error: formatLogError(error, { stack: false }) });
|
|
17331
18266
|
const file = stateFile;
|
|
17332
18267
|
if (!file)
|
|
17333
18268
|
return;
|
|
@@ -19518,7 +20453,7 @@ function canonicalEvidence(evidence) {
|
|
|
19518
20453
|
}
|
|
19519
20454
|
|
|
19520
20455
|
// ../../bridges/acp-bridge/src/change-evidence.ts
|
|
19521
|
-
var
|
|
20456
|
+
var log5 = createLogger("bridge.acp");
|
|
19522
20457
|
var MAX_DIFF_BLOCKS_PER_CALL = 100;
|
|
19523
20458
|
var MAX_HELD_DIFF_BYTES = 32 * 1024 * 1024;
|
|
19524
20459
|
var MAX_SEEN_CALL_IDS = 8192;
|
|
@@ -19817,7 +20752,7 @@ function recordAcpToolEvidence(state, part, update) {
|
|
|
19817
20752
|
if (isTerminal(phase))
|
|
19818
20753
|
settleRecord(state, part, record);
|
|
19819
20754
|
} catch (error) {
|
|
19820
|
-
|
|
20755
|
+
log5.warn("evidence.record-failed", {
|
|
19821
20756
|
errorClass: error instanceof Error ? error.name : "unknown"
|
|
19822
20757
|
});
|
|
19823
20758
|
}
|
|
@@ -19861,7 +20796,7 @@ function recordAcpShellObservation(state, toolUseId, observation) {
|
|
|
19861
20796
|
...observation.unavailableReason ? { unavailableReason: observation.unavailableReason } : {}
|
|
19862
20797
|
});
|
|
19863
20798
|
} catch (error) {
|
|
19864
|
-
|
|
20799
|
+
log5.warn("evidence.shell-record-failed", {
|
|
19865
20800
|
errorClass: error instanceof Error ? error.name : "unknown"
|
|
19866
20801
|
});
|
|
19867
20802
|
}
|
|
@@ -19893,14 +20828,14 @@ function endAcpTurnEvidence(state, outcome) {
|
|
|
19893
20828
|
const writers = state.activeSubagentToolIds.size > 0 || turn.backgroundLaunched ? "may-write" : "quiescent";
|
|
19894
20829
|
changeEvidenceRecorder().turn({ conversationId: state.id, turnId: turn.turnId }, outcome, writers);
|
|
19895
20830
|
} catch (error) {
|
|
19896
|
-
|
|
20831
|
+
log5.warn("evidence.turn-record-failed", {
|
|
19897
20832
|
errorClass: error instanceof Error ? error.name : "unknown"
|
|
19898
20833
|
});
|
|
19899
20834
|
}
|
|
19900
20835
|
}
|
|
19901
20836
|
|
|
19902
20837
|
// ../../bridges/acp-bridge/src/acp-command-changes.ts
|
|
19903
|
-
var
|
|
20838
|
+
var log6 = createLogger("bridge.acp");
|
|
19904
20839
|
var MAX_WINDOWS_PER_SESSION = 256;
|
|
19905
20840
|
var MAX_CACHED_JOURNALS = MAX_RESUMABLE_SESSIONS;
|
|
19906
20841
|
var probe;
|
|
@@ -20014,7 +20949,7 @@ function closeWindow(active, state, toolUseId, role) {
|
|
|
20014
20949
|
recordAcpShellObservation(state, toolUseId, observation);
|
|
20015
20950
|
recordCommandChange(state, toolUseId, legacyCommandChange(observation));
|
|
20016
20951
|
}).catch((error) => {
|
|
20017
|
-
|
|
20952
|
+
log6.warn("command-change.record-failed", {
|
|
20018
20953
|
errorClass: error instanceof Error ? error.name : "unknown"
|
|
20019
20954
|
});
|
|
20020
20955
|
});
|
|
@@ -20636,15 +21571,14 @@ function permissionToolNames(params, recorded) {
|
|
|
20636
21571
|
function explicitlyDeniedPermissionTool(params, policy, recorded) {
|
|
20637
21572
|
return permissionToolNames(params, recorded).some((name) => policy?.toolPolicy?.deny?.includes(name));
|
|
20638
21573
|
}
|
|
20639
|
-
var FILE_MUTATION_DENIALS = ["file.write", "file.patch", "write", "edit", "apply_patch"];
|
|
20640
21574
|
var AUTO_APPROVE_DENIALS_BY_KIND = {
|
|
20641
21575
|
read: [],
|
|
20642
21576
|
search: [],
|
|
20643
21577
|
think: [],
|
|
20644
|
-
edit:
|
|
20645
|
-
delete:
|
|
20646
|
-
move:
|
|
20647
|
-
execute:
|
|
21578
|
+
edit: ACP_FILE_MUTATION_DENIALS,
|
|
21579
|
+
delete: ACP_FILE_MUTATION_DENIALS,
|
|
21580
|
+
move: ACP_FILE_MUTATION_DENIALS,
|
|
21581
|
+
execute: ACP_SHELL_DENIALS,
|
|
20648
21582
|
fetch: ["network"]
|
|
20649
21583
|
};
|
|
20650
21584
|
var PERMISSION_KIND_BY_TOOL = {
|
|
@@ -24593,7 +25527,7 @@ function watchClientDisconnect(request, response, onDisconnect) {
|
|
|
24593
25527
|
}
|
|
24594
25528
|
|
|
24595
25529
|
// ../../bridges/acp-bridge/src/acp-server.ts
|
|
24596
|
-
var
|
|
25530
|
+
var log7 = createLogger("bridge.acp");
|
|
24597
25531
|
configureBridgeLogger();
|
|
24598
25532
|
await restorePersistedState();
|
|
24599
25533
|
var server = createServer((request, response) => {
|
|
@@ -24611,7 +25545,7 @@ var server = createServer((request, response) => {
|
|
|
24611
25545
|
json(response, status, { error: error instanceof Error ? error.message : String(error) });
|
|
24612
25546
|
}).finally(stopWatchingClient);
|
|
24613
25547
|
});
|
|
24614
|
-
server.listen(port, hostname, () =>
|
|
25548
|
+
server.listen(port, hostname, () => log7.info("server.listening", { provider, hostname, port }));
|
|
24615
25549
|
var shutdownPromise = null;
|
|
24616
25550
|
function shutdown() {
|
|
24617
25551
|
if (shutdownPromise)
|