orkestrator 2.35.3-beta → 2.35.5-beta
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.js +1599 -22
- package/dist/main.js +204498 -196821
- package/package.json +3 -3
- package/resources/acp-bridge/dist/index.js +3092 -158
- package/resources/claude-bridge/dist/index.js +5297 -2509
- package/resources/codex-bridge/dist/index.js +2940 -139
- package/resources/cursor-bridge/dist/index.js +3227 -219
- package/resources/cursor-bridge/runtime/install.json +1 -1
- package/resources/pi-bridge/dist/index.js +3052 -128
- package/resources/pi-bridge/runtime/install.json +1 -1
|
@@ -1094,8 +1094,12 @@ function jsonArrayBytes(count, total) {
|
|
|
1094
1094
|
}
|
|
1095
1095
|
function planOldestFirstTrim(messages, maximumBytes, options = {}) {
|
|
1096
1096
|
const measure = options.measure ?? encodedJsonBytes;
|
|
1097
|
-
const
|
|
1098
|
-
|
|
1097
|
+
const known = options.messageSizes;
|
|
1098
|
+
if (known && known.length !== messages.length) {
|
|
1099
|
+
throw new Error("planOldestFirstTrim: messageSizes must describe every message");
|
|
1100
|
+
}
|
|
1101
|
+
const sizes = known ? known.slice() : messages.map((message) => measure(message));
|
|
1102
|
+
let measuredValues = known ? 0 : sizes.length;
|
|
1099
1103
|
let total = sizes.reduce((sum, size) => sum + size, 0);
|
|
1100
1104
|
let count = messages.length;
|
|
1101
1105
|
let bytes = jsonArrayBytes(count, total);
|
|
@@ -1144,7 +1148,7 @@ function planOldestFirstTrim(messages, maximumBytes, options = {}) {
|
|
|
1144
1148
|
function jsonStringContentBytes(value) {
|
|
1145
1149
|
return value ? Buffer2.byteLength(JSON.stringify(value)) - 2 : 0;
|
|
1146
1150
|
}
|
|
1147
|
-
function boundTranscriptInPlace(state, limits) {
|
|
1151
|
+
function boundTranscriptInPlace(state, limits, rowSizes) {
|
|
1148
1152
|
let changed = false;
|
|
1149
1153
|
if (state.messages.length > limits.maxMessages) {
|
|
1150
1154
|
const removed = state.messages.length - limits.maxMessages;
|
|
@@ -1159,12 +1163,15 @@ function boundTranscriptInPlace(state, limits) {
|
|
|
1159
1163
|
continue;
|
|
1160
1164
|
const removed = message.parts.length - limits.maxPartsPerMessage;
|
|
1161
1165
|
message.parts.splice(0, removed);
|
|
1166
|
+
rowSizes?.invalidateRow(message);
|
|
1162
1167
|
state.droppedParts += removed;
|
|
1163
1168
|
state.transcriptTruncated = true;
|
|
1164
1169
|
changed = true;
|
|
1165
1170
|
}
|
|
1166
1171
|
state.uncheckedTranscriptBytes = 0;
|
|
1167
|
-
const plan = planOldestFirstTrim(state.messages, limits.maxTranscriptBytes
|
|
1172
|
+
const plan = planOldestFirstTrim(state.messages, limits.maxTranscriptBytes, {
|
|
1173
|
+
messageSizes: rowSizes?.measureRows(state.messages)
|
|
1174
|
+
});
|
|
1168
1175
|
if (plan.droppedMessages > 0) {
|
|
1169
1176
|
const dropped = state.messages.splice(0, plan.droppedMessages);
|
|
1170
1177
|
state.droppedMessages += dropped.length;
|
|
@@ -1174,112 +1181,338 @@ function boundTranscriptInPlace(state, limits) {
|
|
|
1174
1181
|
}
|
|
1175
1182
|
if (plan.droppedParts > 0) {
|
|
1176
1183
|
state.messages[0].parts.splice(0, plan.droppedParts);
|
|
1184
|
+
rowSizes?.invalidateRow(state.messages[0]);
|
|
1177
1185
|
state.droppedParts += plan.droppedParts;
|
|
1178
1186
|
state.transcriptTruncated = true;
|
|
1179
1187
|
changed = true;
|
|
1180
1188
|
}
|
|
1181
1189
|
return changed;
|
|
1182
1190
|
}
|
|
1191
|
+
var VERIFY_REMEMBERED_SIZES = false;
|
|
1183
1192
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1193
|
+
class StaleTranscriptSizeError extends Error {
|
|
1194
|
+
constructor(kind, remembered, measured) {
|
|
1195
|
+
super(`Remembered transcript ${kind} size is stale (${remembered} bytes remembered, ` + `${measured} measured): a write path changed it without noting the change`);
|
|
1196
|
+
this.name = "StaleTranscriptSizeError";
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1186
1199
|
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1200
|
+
class TranscriptRowSizes {
|
|
1201
|
+
#rows = new Map;
|
|
1202
|
+
#verify;
|
|
1203
|
+
constructor(options = {}) {
|
|
1204
|
+
this.#verify = options.verify ?? VERIFY_REMEMBERED_SIZES;
|
|
1205
|
+
}
|
|
1206
|
+
invalidate(id) {
|
|
1207
|
+
this.#rows.delete(id);
|
|
1208
|
+
}
|
|
1209
|
+
invalidateRow(row) {
|
|
1210
|
+
const id = rowId(row);
|
|
1211
|
+
if (id !== undefined)
|
|
1212
|
+
this.#rows.delete(id);
|
|
1213
|
+
}
|
|
1214
|
+
clear() {
|
|
1215
|
+
this.#rows.clear();
|
|
1216
|
+
}
|
|
1217
|
+
get size() {
|
|
1218
|
+
return this.#rows.size;
|
|
1219
|
+
}
|
|
1220
|
+
measureRows(messages, measure = encodedJsonBytes) {
|
|
1221
|
+
const previous = this.#rows;
|
|
1222
|
+
const next = new Map;
|
|
1223
|
+
const newest = messages.length - 1;
|
|
1224
|
+
const sizes = messages.map((row, index) => {
|
|
1225
|
+
const id = rowId(row);
|
|
1226
|
+
const known = id === undefined ? undefined : previous.get(id);
|
|
1227
|
+
const follower = messages[index + 1];
|
|
1228
|
+
let bytes;
|
|
1229
|
+
if (index < newest && known?.row === row && known.follower === follower) {
|
|
1230
|
+
bytes = known.bytes;
|
|
1231
|
+
if (this.#verify) {
|
|
1232
|
+
const measured = measure(row);
|
|
1233
|
+
if (measured !== bytes)
|
|
1234
|
+
throw new StaleTranscriptSizeError("row", bytes, measured);
|
|
1235
|
+
}
|
|
1236
|
+
} else {
|
|
1237
|
+
bytes = measure(row);
|
|
1238
|
+
}
|
|
1239
|
+
if (follower && id !== undefined)
|
|
1240
|
+
next.set(id, { row, follower, bytes });
|
|
1241
|
+
return bytes;
|
|
1242
|
+
});
|
|
1243
|
+
this.#rows = next;
|
|
1244
|
+
return sizes;
|
|
1207
1245
|
}
|
|
1208
|
-
return current + sliceToBytes(addition, available) + TRUNCATION_NOTICE;
|
|
1209
1246
|
}
|
|
1210
|
-
function
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1247
|
+
function rowId(row) {
|
|
1248
|
+
const id = row.id;
|
|
1249
|
+
return typeof id === "string" ? id : undefined;
|
|
1250
|
+
}
|
|
1251
|
+
|
|
1252
|
+
class EncodedObjectSizes {
|
|
1253
|
+
#fields = new WeakMap;
|
|
1254
|
+
#verify;
|
|
1255
|
+
constructor(options = {}) {
|
|
1256
|
+
this.#verify = options.verify ?? VERIFY_REMEMBERED_SIZES;
|
|
1257
|
+
}
|
|
1258
|
+
measure(object) {
|
|
1259
|
+
let fields = this.#fields.get(object);
|
|
1260
|
+
if (!fields) {
|
|
1261
|
+
fields = new Map;
|
|
1262
|
+
this.#fields.set(object, fields);
|
|
1263
|
+
}
|
|
1264
|
+
let bytes = 2;
|
|
1265
|
+
let members = 0;
|
|
1266
|
+
for (const key of Object.keys(object)) {
|
|
1267
|
+
const value = object[key];
|
|
1268
|
+
if (value === undefined || typeof value === "function" || typeof value === "symbol") {
|
|
1269
|
+
fields.delete(key);
|
|
1270
|
+
continue;
|
|
1271
|
+
}
|
|
1272
|
+
let valueBytes;
|
|
1273
|
+
if (typeof value === "string") {
|
|
1274
|
+
valueBytes = encodedStringBytes(value, fields.get(key));
|
|
1275
|
+
fields.set(key, { value, bytes: valueBytes });
|
|
1276
|
+
} else {
|
|
1277
|
+
fields.delete(key);
|
|
1278
|
+
valueBytes = encodedJsonBytes(value);
|
|
1279
|
+
}
|
|
1280
|
+
bytes += encodedJsonBytes(key) + 1 + valueBytes;
|
|
1281
|
+
members += 1;
|
|
1282
|
+
}
|
|
1283
|
+
if (fields.size > members) {
|
|
1284
|
+
for (const key of Array.from(fields.keys())) {
|
|
1285
|
+
if (!Object.hasOwn(object, key))
|
|
1286
|
+
fields.delete(key);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
bytes += Math.max(0, members - 1);
|
|
1290
|
+
if (this.#verify) {
|
|
1291
|
+
const measured = encodedJsonBytes(object);
|
|
1292
|
+
if (measured !== bytes)
|
|
1293
|
+
throw new StaleTranscriptSizeError("part", bytes, measured);
|
|
1294
|
+
}
|
|
1295
|
+
return bytes;
|
|
1296
|
+
}
|
|
1297
|
+
}
|
|
1298
|
+
function encodedStringBytes(value, previous) {
|
|
1299
|
+
if (previous) {
|
|
1300
|
+
if (previous.value === value)
|
|
1301
|
+
return previous.bytes;
|
|
1302
|
+
const before = previous.value;
|
|
1303
|
+
if (value.length > before.length && value.startsWith(before)) {
|
|
1304
|
+
const suffix = value.slice(before.length);
|
|
1305
|
+
const high = before.charCodeAt(before.length - 1);
|
|
1306
|
+
const low = suffix.charCodeAt(0);
|
|
1307
|
+
const splitPair = high >= 55296 && high <= 56319 && low >= 56320 && low <= 57343;
|
|
1308
|
+
return previous.bytes + jsonStringContentBytes(suffix) - (splitPair ? 8 : 0);
|
|
1309
|
+
}
|
|
1310
|
+
}
|
|
1311
|
+
return Buffer2.byteLength(JSON.stringify(value));
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
// ../protocol/src/node/bridge-transcript-bounds.ts
|
|
1315
|
+
function createBridgeTranscriptBounds(options) {
|
|
1316
|
+
const limits = {
|
|
1317
|
+
maxMessages: options.maxMessages,
|
|
1318
|
+
maxPartsPerMessage: options.maxPartsPerMessage,
|
|
1319
|
+
maxTranscriptBytes: options.maxTranscriptBytes
|
|
1320
|
+
};
|
|
1321
|
+
const revisedRows = new WeakMap;
|
|
1322
|
+
const rowSizes = new WeakMap;
|
|
1323
|
+
const sizesFor = (state) => {
|
|
1324
|
+
let sizes = rowSizes.get(state);
|
|
1325
|
+
if (!sizes) {
|
|
1326
|
+
sizes = new TranscriptRowSizes;
|
|
1327
|
+
rowSizes.set(state, sizes);
|
|
1328
|
+
}
|
|
1329
|
+
return sizes;
|
|
1330
|
+
};
|
|
1331
|
+
const noteRowRevised = (state, id) => {
|
|
1332
|
+
rowSizes.get(state)?.invalidate(id);
|
|
1333
|
+
if (state.messages.at(-1)?.id === id)
|
|
1334
|
+
return;
|
|
1335
|
+
let rows = revisedRows.get(state);
|
|
1336
|
+
if (!rows) {
|
|
1337
|
+
rows = new RecentlyRevisedRows;
|
|
1338
|
+
revisedRows.set(state, rows);
|
|
1339
|
+
}
|
|
1340
|
+
rows.note(id);
|
|
1341
|
+
};
|
|
1342
|
+
const boundTranscript = (state) => {
|
|
1343
|
+
const rowsBefore = state.messages.slice();
|
|
1344
|
+
const partsBefore = rowsBefore.map((row) => row.parts.length);
|
|
1345
|
+
const trimmed = boundTranscriptInPlace(state, limits, sizesFor(state));
|
|
1346
|
+
if (!trimmed)
|
|
1347
|
+
return false;
|
|
1348
|
+
const offset = rowsBefore.length - state.messages.length;
|
|
1349
|
+
state.messages.forEach((row, index) => {
|
|
1350
|
+
if (row.parts.length < partsBefore[index + offset])
|
|
1351
|
+
noteRowRevised(state, row.id);
|
|
1352
|
+
});
|
|
1353
|
+
return true;
|
|
1354
|
+
};
|
|
1355
|
+
return {
|
|
1356
|
+
streamIntervalBytes: options.streamIntervalBytes,
|
|
1357
|
+
boundTranscript,
|
|
1358
|
+
boundTranscriptForRead(state) {
|
|
1359
|
+
if (state.uncheckedTranscriptBytes === 0)
|
|
1360
|
+
return;
|
|
1361
|
+
if (boundTranscript(state))
|
|
1362
|
+
state.revision += 1;
|
|
1363
|
+
},
|
|
1364
|
+
streamingBoundDue(state) {
|
|
1365
|
+
return state.messages.length > limits.maxMessages || (state.messages.at(-1)?.parts.length ?? 0) > limits.maxPartsPerMessage || state.uncheckedTranscriptBytes >= options.streamIntervalBytes;
|
|
1366
|
+
},
|
|
1367
|
+
chargeTranscript(state, bytes) {
|
|
1368
|
+
if (bytes > 0)
|
|
1369
|
+
state.uncheckedTranscriptBytes += bytes;
|
|
1370
|
+
},
|
|
1371
|
+
noteRowRevised,
|
|
1372
|
+
rowChanged(state, row) {
|
|
1373
|
+
noteRowRevised(state, row.id);
|
|
1374
|
+
state.revision += 1;
|
|
1375
|
+
},
|
|
1376
|
+
forgetRowSize(state, row) {
|
|
1377
|
+
rowSizes.get(state)?.invalidate(row.id);
|
|
1378
|
+
},
|
|
1379
|
+
revisedRowsOverflowVersion(state) {
|
|
1380
|
+
return revisedRows.get(state)?.overflowVersion ?? 0;
|
|
1381
|
+
},
|
|
1382
|
+
revisedRowIds(state) {
|
|
1383
|
+
const ids = revisedRows.get(state)?.ids();
|
|
1384
|
+
return ids && ids.length > 0 ? ids : undefined;
|
|
1385
|
+
},
|
|
1386
|
+
forgetRevisedRows(state) {
|
|
1387
|
+
revisedRows.get(state)?.clear();
|
|
1388
|
+
rowSizes.get(state)?.clear();
|
|
1389
|
+
}
|
|
1390
|
+
};
|
|
1215
1391
|
}
|
|
1216
|
-
|
|
1217
|
-
|
|
1392
|
+
|
|
1393
|
+
// ../protocol/src/node/bridge-transcript-text.ts
|
|
1394
|
+
import { Buffer as Buffer3 } from "node:buffer";
|
|
1395
|
+
function sliceUtf8(value, maximumBytes) {
|
|
1396
|
+
if (maximumBytes <= 0)
|
|
1218
1397
|
return "";
|
|
1219
|
-
const buffer =
|
|
1220
|
-
if (buffer.length <=
|
|
1398
|
+
const buffer = Buffer3.from(value);
|
|
1399
|
+
if (buffer.length <= maximumBytes)
|
|
1221
1400
|
return value;
|
|
1222
|
-
let end =
|
|
1401
|
+
let end = maximumBytes;
|
|
1223
1402
|
while (end > 0 && (buffer[end] & 192) === 128)
|
|
1224
1403
|
end -= 1;
|
|
1225
1404
|
return buffer.subarray(0, end).toString("utf8");
|
|
1226
1405
|
}
|
|
1227
|
-
function
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
const
|
|
1231
|
-
|
|
1232
|
-
return false;
|
|
1233
|
-
const offset = rowsBefore.length - state.messages.length;
|
|
1234
|
-
state.messages.forEach((row, index) => {
|
|
1235
|
-
if (row.parts.length < partsBefore[index + offset])
|
|
1236
|
-
noteRowRevised(state, row.id);
|
|
1237
|
-
});
|
|
1238
|
-
return true;
|
|
1239
|
-
}
|
|
1240
|
-
function boundTranscriptForRead(state) {
|
|
1241
|
-
if (state.uncheckedTranscriptBytes === 0)
|
|
1242
|
-
return;
|
|
1243
|
-
if (boundTranscript(state))
|
|
1244
|
-
state.revision += 1;
|
|
1406
|
+
function boundUtf8Text(value, maximumBytes, notice) {
|
|
1407
|
+
if (Buffer3.byteLength(value) <= maximumBytes)
|
|
1408
|
+
return value;
|
|
1409
|
+
const available = Math.max(0, maximumBytes - Buffer3.byteLength(notice));
|
|
1410
|
+
return sliceUtf8(value, available) + notice;
|
|
1245
1411
|
}
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1412
|
+
|
|
1413
|
+
class BoundedTextAppender {
|
|
1414
|
+
notice;
|
|
1415
|
+
policy;
|
|
1416
|
+
saturated;
|
|
1417
|
+
#noticeBytes;
|
|
1418
|
+
#lengths = new WeakMap;
|
|
1419
|
+
constructor(options) {
|
|
1420
|
+
this.notice = options.notice;
|
|
1421
|
+
this.policy = options.policy;
|
|
1422
|
+
this.saturated = options.saturated ?? new WeakSet;
|
|
1423
|
+
this.#noticeBytes = Buffer3.byteLength(options.notice);
|
|
1424
|
+
}
|
|
1425
|
+
append(current, addition, maximumBytes, owner, saturate = true) {
|
|
1426
|
+
if (owner && saturate && this.saturated.has(owner))
|
|
1427
|
+
return { value: current, truncated: true };
|
|
1428
|
+
if (!addition)
|
|
1429
|
+
return { value: current, truncated: false };
|
|
1430
|
+
const currentBytes = this.byteLength(current, owner);
|
|
1431
|
+
const additionBytes = Buffer3.byteLength(addition);
|
|
1432
|
+
if (currentBytes + additionBytes <= maximumBytes) {
|
|
1433
|
+
const value = current + addition;
|
|
1434
|
+
if (owner) {
|
|
1435
|
+
this.#lengths.set(owner, {
|
|
1436
|
+
value,
|
|
1437
|
+
bytes: concatenatedBytes(current, currentBytes, addition, additionBytes)
|
|
1438
|
+
});
|
|
1439
|
+
}
|
|
1440
|
+
return { value, truncated: false };
|
|
1441
|
+
}
|
|
1442
|
+
if (owner) {
|
|
1443
|
+
this.#lengths.delete(owner);
|
|
1444
|
+
if (saturate)
|
|
1445
|
+
this.saturated.add(owner);
|
|
1446
|
+
}
|
|
1447
|
+
if (this.policy === "append-notice") {
|
|
1448
|
+
const available = maximumBytes - currentBytes - this.#noticeBytes;
|
|
1449
|
+
if (available <= 0) {
|
|
1450
|
+
const value = current.endsWith(this.notice) ? current : current + this.notice;
|
|
1451
|
+
return { value, truncated: true };
|
|
1452
|
+
}
|
|
1453
|
+
return { value: current + sliceUtf8(addition, available) + this.notice, truncated: true };
|
|
1454
|
+
}
|
|
1455
|
+
const contentLimit = Math.max(0, maximumBytes - this.#noticeBytes);
|
|
1456
|
+
const prefix = currentBytes <= contentLimit ? current : sliceUtf8(current, contentLimit);
|
|
1457
|
+
const prefixBytes = prefix === current ? currentBytes : Buffer3.byteLength(prefix);
|
|
1458
|
+
const usable = Math.max(0, contentLimit - prefixBytes);
|
|
1459
|
+
return {
|
|
1460
|
+
value: prefix + sliceUtf8(addition, usable) + sliceUtf8(this.notice, maximumBytes),
|
|
1461
|
+
truncated: true
|
|
1462
|
+
};
|
|
1250
1463
|
}
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
state.uncheckedTranscriptBytes += bytes;
|
|
1257
|
-
}
|
|
1258
|
-
var revisedRows = new WeakMap;
|
|
1259
|
-
function noteRowRevised(state, id) {
|
|
1260
|
-
if (state.messages.at(-1)?.id === id)
|
|
1261
|
-
return;
|
|
1262
|
-
let rows = revisedRows.get(state);
|
|
1263
|
-
if (!rows) {
|
|
1264
|
-
rows = new RecentlyRevisedRows;
|
|
1265
|
-
revisedRows.set(state, rows);
|
|
1464
|
+
byteLength(value, owner) {
|
|
1465
|
+
const known = owner ? this.#lengths.get(owner) : undefined;
|
|
1466
|
+
if (known && known.value === value)
|
|
1467
|
+
return known.bytes;
|
|
1468
|
+
return Buffer3.byteLength(value);
|
|
1266
1469
|
}
|
|
1267
|
-
rows.note(id);
|
|
1268
1470
|
}
|
|
1269
|
-
function
|
|
1270
|
-
|
|
1271
|
-
|
|
1471
|
+
function concatenatedBytes(left, leftBytes, right, rightBytes) {
|
|
1472
|
+
const high = left.charCodeAt(left.length - 1);
|
|
1473
|
+
const low = right.charCodeAt(0);
|
|
1474
|
+
const splitPair = high >= 55296 && high <= 56319 && low >= 56320 && low <= 57343;
|
|
1475
|
+
return leftBytes + rightBytes - (splitPair ? 2 : 0);
|
|
1272
1476
|
}
|
|
1273
|
-
|
|
1274
|
-
|
|
1477
|
+
|
|
1478
|
+
// ../../bridges/pi-bridge/src/transcript.ts
|
|
1479
|
+
var TRUNCATION_NOTICE = `
|
|
1480
|
+
|
|
1481
|
+
[output truncated]`;
|
|
1482
|
+
var STREAM_BOUND_INTERVAL_BYTES = Math.min(MAX_TRANSCRIPT_BYTES, 1024 * 1024);
|
|
1483
|
+
var bounds = createBridgeTranscriptBounds({
|
|
1484
|
+
maxMessages: MAX_MESSAGES,
|
|
1485
|
+
maxPartsPerMessage: MAX_PARTS_PER_MESSAGE,
|
|
1486
|
+
maxTranscriptBytes: MAX_TRANSCRIPT_BYTES,
|
|
1487
|
+
streamIntervalBytes: STREAM_BOUND_INTERVAL_BYTES
|
|
1488
|
+
});
|
|
1489
|
+
var appender = new BoundedTextAppender({
|
|
1490
|
+
notice: TRUNCATION_NOTICE,
|
|
1491
|
+
policy: "append-notice",
|
|
1492
|
+
saturated: saturatedText
|
|
1493
|
+
});
|
|
1494
|
+
function appendBounded(carrier, current, addition, limit = MAX_MESSAGE_TEXT_BYTES) {
|
|
1495
|
+
return appender.append(current, addition, limit, carrier).value;
|
|
1275
1496
|
}
|
|
1276
|
-
function
|
|
1277
|
-
|
|
1278
|
-
return ids && ids.length > 0 ? ids : undefined;
|
|
1497
|
+
function boundText(value, limit) {
|
|
1498
|
+
return boundUtf8Text(value, limit, TRUNCATION_NOTICE);
|
|
1279
1499
|
}
|
|
1280
|
-
|
|
1281
|
-
|
|
1500
|
+
var sliceToBytes = sliceUtf8;
|
|
1501
|
+
var boundTranscript = bounds.boundTranscript;
|
|
1502
|
+
var boundTranscriptForRead = bounds.boundTranscriptForRead;
|
|
1503
|
+
function boundTranscriptDuringStreaming(state) {
|
|
1504
|
+
if (!bounds.streamingBoundDue(state))
|
|
1505
|
+
return;
|
|
1506
|
+
if (boundTranscript(state))
|
|
1507
|
+
state.revision += 1;
|
|
1282
1508
|
}
|
|
1509
|
+
var chargeTranscript = bounds.chargeTranscript;
|
|
1510
|
+
var noteRowRevised = bounds.noteRowRevised;
|
|
1511
|
+
var rowChanged = bounds.rowChanged;
|
|
1512
|
+
var forgetRowSize = bounds.forgetRowSize;
|
|
1513
|
+
var revisedRowsOverflowVersion = bounds.revisedRowsOverflowVersion;
|
|
1514
|
+
var revisedRowIds = bounds.revisedRowIds;
|
|
1515
|
+
var forgetRevisedRows = bounds.forgetRevisedRows;
|
|
1283
1516
|
|
|
1284
1517
|
// ../../bridges/pi-bridge/src/tool-rendering.ts
|
|
1285
1518
|
function renderToolCall(source) {
|
|
@@ -1726,6 +1959,7 @@ var AGENT_INTERACTION_LIMITS = Object.freeze({
|
|
|
1726
1959
|
maxSerializedPayloadBytes: 256 * 1024,
|
|
1727
1960
|
maxIdLength: 512,
|
|
1728
1961
|
maxProviderValueLength: 4096,
|
|
1962
|
+
maxSourceNameLength: 256,
|
|
1729
1963
|
maxJournalEntries: 512,
|
|
1730
1964
|
maxWorkflowSummaries: 64
|
|
1731
1965
|
});
|
|
@@ -1793,6 +2027,19 @@ var LIMITED_HOLD_REASONS = new Set([
|
|
|
1793
2027
|
"provider-limit",
|
|
1794
2028
|
"upstream-may-expire"
|
|
1795
2029
|
]);
|
|
2030
|
+
var AGENT_INTERACTION_SOURCE_KINDS = ["mcp-server"];
|
|
2031
|
+
var SOURCE_SCOPE_LABELS = Object.freeze({
|
|
2032
|
+
user: "user settings",
|
|
2033
|
+
project: "project settings",
|
|
2034
|
+
local: "local settings",
|
|
2035
|
+
dynamic: "session settings",
|
|
2036
|
+
plugin: "a plugin",
|
|
2037
|
+
managed: "managed settings",
|
|
2038
|
+
enterprise: "enterprise settings",
|
|
2039
|
+
claudeai: "a claude.ai connector",
|
|
2040
|
+
agent: "an agent definition",
|
|
2041
|
+
sdk: "the agent host"
|
|
2042
|
+
});
|
|
1796
2043
|
var UNATTENDED_POLICY_INSTRUCTION = "This is a non-interactive build session: no user can answer a provider input request. " + "If input is unavailable or declined, choose the safest likely assumption yourself, " + "state that assumption, and continue. Never treat the absence of a person as authorization.";
|
|
1797
2044
|
var INTERACTIVE_AGENT_INTERACTION_POLICY = Object.freeze({
|
|
1798
2045
|
version: AGENT_INTERACTION_POLICY_VERSION,
|
|
@@ -1868,8 +2115,11 @@ var REQUEST_KEYS = new Set([
|
|
|
1868
2115
|
"createdAt",
|
|
1869
2116
|
"updatedAt",
|
|
1870
2117
|
"expiresAt",
|
|
1871
|
-
"hold"
|
|
2118
|
+
"hold",
|
|
2119
|
+
"source"
|
|
1872
2120
|
]);
|
|
2121
|
+
var SOURCE_KEYS = new Set(["kind", "name", "scope"]);
|
|
2122
|
+
var SOURCE_KINDS = new Set(AGENT_INTERACTION_SOURCE_KINDS);
|
|
1873
2123
|
var HOLD_KEYS = new Set(["available", "heldAt", "reason"]);
|
|
1874
2124
|
var HOLD_REASONS = new Set(AGENT_INTERACTION_HOLD_REASONS);
|
|
1875
2125
|
var PRESENTATION_KEYS = new Set([
|
|
@@ -3564,9 +3814,10 @@ function upsertToolPart(state, message, toolCallId) {
|
|
|
3564
3814
|
chargeNewEntry(state, part);
|
|
3565
3815
|
return part;
|
|
3566
3816
|
}
|
|
3817
|
+
var toolPartSizes = new EncodedObjectSizes;
|
|
3567
3818
|
function chargeToolPart(state, part) {
|
|
3568
3819
|
const source = toolSourceStates.get(part) ?? {};
|
|
3569
|
-
const size =
|
|
3820
|
+
const size = toolPartSizes.measure(part);
|
|
3570
3821
|
chargeTranscript(state, Math.max(0, size - (source.chargedBytes ?? 0)));
|
|
3571
3822
|
source.chargedBytes = size;
|
|
3572
3823
|
toolSourceStates.set(part, source);
|
|
@@ -3830,6 +4081,7 @@ var COORDINATOR_CONTROL_TOOL_NAMES = Object.freeze([
|
|
|
3830
4081
|
"update_schedule",
|
|
3831
4082
|
"update_ticket"
|
|
3832
4083
|
]);
|
|
4084
|
+
var COORDINATOR_PROJECT_HOME_MESSAGE_WINDOW_MS = 3 * 60 * 60000;
|
|
3833
4085
|
|
|
3834
4086
|
// ../protocol/src/agent-mail.ts
|
|
3835
4087
|
var AGENT_MAIL_MAX_BODY_BYTES = 32 * 1024;
|
|
@@ -28486,7 +28738,2343 @@ function newSessionState(clientSessionKey, policy) {
|
|
|
28486
28738
|
};
|
|
28487
28739
|
}
|
|
28488
28740
|
|
|
28741
|
+
// ../protocol/src/log-error.ts
|
|
28742
|
+
var MAX_MESSAGE_CHARS = 1024;
|
|
28743
|
+
var MAX_STACK_FRAMES = 8;
|
|
28744
|
+
var MAX_FRAME_CHARS = 240;
|
|
28745
|
+
var MAX_RAW_FRAME_CHARS = 1024;
|
|
28746
|
+
var MAX_CAUSE_DEPTH = 2;
|
|
28747
|
+
var TRUNCATED_MARKER = "...[truncated]";
|
|
28748
|
+
var NAME_PATTERN = /^[A-Za-z_$][\w$.-]{0,63}$/;
|
|
28749
|
+
var CODE_PATTERN = /^[\w.:-]{1,64}$/;
|
|
28750
|
+
var SYSCALL_PATTERN = /^[\w./ -]{1,128}$/;
|
|
28751
|
+
var COMMAND_OUTPUT_FIELDS = ["stdout", "stderr", "cmd", "spawnargs"];
|
|
28752
|
+
var safeErrors = new WeakSet;
|
|
28753
|
+
function isSafeLogError(value) {
|
|
28754
|
+
return typeof value === "object" && value !== null && safeErrors.has(value);
|
|
28755
|
+
}
|
|
28756
|
+
function brand(details) {
|
|
28757
|
+
const safe = Object.freeze(details);
|
|
28758
|
+
safeErrors.add(safe);
|
|
28759
|
+
return safe;
|
|
28760
|
+
}
|
|
28761
|
+
function boundedText3(value, maxChars) {
|
|
28762
|
+
const cut = value.length > maxChars ? `${value.slice(0, maxChars - TRUNCATED_MARKER.length)}${TRUNCATED_MARKER}` : value;
|
|
28763
|
+
return redactSecrets(cut).replace(/[\u0000-\u001f\u007f-\u009f\u2028\u2029]+/g, " ").trim();
|
|
28764
|
+
}
|
|
28765
|
+
var FRAME_LOCATION = /(^|[\s(])((?:[a-z][a-z0-9+.-]*:\/\/[^/\s)]*)?(?:\/|[a-z]:[\\/]|\\\\).*?)(?=:\d+(?::\d+)?\)?(?:,|$)|\)(?:,|$)|,\s|$)/gi;
|
|
28766
|
+
var LOCATION_SCHEME = /^([a-z][a-z0-9+.-]*):\/\/[^/\s)]*/i;
|
|
28767
|
+
var APP_PATH = /(?:^|\/)((?:apps\/(?:backend|desktop|web|web-public)|packages\/(?:protocol|cli|toolchain)|bridges\/[\w-]+|[\w-]+-bridge)\/.*)$/;
|
|
28768
|
+
var PACKAGED_PATH = /\/((?:app\.asar(?:\.unpacked)?|resources)\/.*)$/i;
|
|
28769
|
+
function appRelativeLocation(location) {
|
|
28770
|
+
const scheme = LOCATION_SCHEME.exec(location)?.[1]?.toLowerCase();
|
|
28771
|
+
const isWebUrl = scheme !== undefined && scheme !== "file";
|
|
28772
|
+
const withoutOrigin = location.replace(LOCATION_SCHEME, "");
|
|
28773
|
+
const path = (isWebUrl ? withoutOrigin.split(/[?#]/, 1)[0] : withoutOrigin).replace(/\\/g, "/");
|
|
28774
|
+
const modules = path.lastIndexOf("/node_modules/");
|
|
28775
|
+
if (modules >= 0)
|
|
28776
|
+
return path.slice(modules + 1);
|
|
28777
|
+
const app = APP_PATH.exec(path)?.[1] ?? PACKAGED_PATH.exec(path)?.[1];
|
|
28778
|
+
if (app)
|
|
28779
|
+
return app;
|
|
28780
|
+
if (isWebUrl)
|
|
28781
|
+
return path.replace(/^\/+/, "");
|
|
28782
|
+
return `.../${path.slice(path.lastIndexOf("/") + 1)}`;
|
|
28783
|
+
}
|
|
28784
|
+
function relativeFrame(frame) {
|
|
28785
|
+
return frame.slice(0, MAX_RAW_FRAME_CHARS).replace(FRAME_LOCATION, (_match, lead, location) => `${lead}${appRelativeLocation(location)}`);
|
|
28786
|
+
}
|
|
28787
|
+
function read(target, key) {
|
|
28788
|
+
try {
|
|
28789
|
+
return target[key];
|
|
28790
|
+
} catch {
|
|
28791
|
+
return;
|
|
28792
|
+
}
|
|
28793
|
+
}
|
|
28794
|
+
function matching(value, pattern) {
|
|
28795
|
+
return typeof value === "string" && pattern.test(value) ? value : undefined;
|
|
28796
|
+
}
|
|
28797
|
+
function finite(value) {
|
|
28798
|
+
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
|
|
28799
|
+
}
|
|
28800
|
+
function isCommandFailure(target, name, message) {
|
|
28801
|
+
return name === "CommandFailedError" || Boolean(message?.startsWith("Command failed")) || COMMAND_OUTPUT_FIELDS.some((field) => read(target, field) !== undefined);
|
|
28802
|
+
}
|
|
28803
|
+
function stackFrames(target, message) {
|
|
28804
|
+
const stack = read(target, "stack");
|
|
28805
|
+
if (typeof stack !== "string")
|
|
28806
|
+
return;
|
|
28807
|
+
const index = message ? stack.indexOf(message) : -1;
|
|
28808
|
+
const body = index >= 0 ? stack.slice(index + message.length) : stack;
|
|
28809
|
+
const frames = body.split(`
|
|
28810
|
+
`).filter((line) => /^\s*at\s/.test(line)).slice(0, MAX_STACK_FRAMES).map((line) => boundedText3(relativeFrame(line), MAX_FRAME_CHARS));
|
|
28811
|
+
return frames.length > 0 ? frames : undefined;
|
|
28812
|
+
}
|
|
28813
|
+
function describe2(error, includeStack, includeMessage, depth) {
|
|
28814
|
+
if (typeof error !== "object" || error === null) {
|
|
28815
|
+
if (!includeMessage)
|
|
28816
|
+
return { name: "NonError" };
|
|
28817
|
+
return {
|
|
28818
|
+
name: "NonError",
|
|
28819
|
+
message: typeof error === "string" ? boundedText3(error, MAX_MESSAGE_CHARS) : `[${typeof error}]`
|
|
28820
|
+
};
|
|
28821
|
+
}
|
|
28822
|
+
const rawMessage = read(error, "message");
|
|
28823
|
+
if (!(error instanceof Error) && typeof rawMessage !== "string") {
|
|
28824
|
+
return { name: "NonError", message: "[object]" };
|
|
28825
|
+
}
|
|
28826
|
+
const name = matching(read(error, "name"), NAME_PATTERN) ?? "Error";
|
|
28827
|
+
const message = typeof rawMessage === "string" ? rawMessage : undefined;
|
|
28828
|
+
const commandFailure = isCommandFailure(error, name, message);
|
|
28829
|
+
const stackHoldsMessage = message !== undefined && String(read(error, "stack") ?? "").includes(message);
|
|
28830
|
+
const details = { name };
|
|
28831
|
+
if (commandFailure)
|
|
28832
|
+
details.outputOmitted = true;
|
|
28833
|
+
else if (message && includeMessage)
|
|
28834
|
+
details.message = boundedText3(message, MAX_MESSAGE_CHARS);
|
|
28835
|
+
const code = read(error, "code");
|
|
28836
|
+
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
28837
|
+
if (safeCode !== undefined)
|
|
28838
|
+
details.code = safeCode;
|
|
28839
|
+
const errno = finite(read(error, "errno"));
|
|
28840
|
+
if (errno !== undefined)
|
|
28841
|
+
details.errno = errno;
|
|
28842
|
+
const syscall = matching(read(error, "syscall"), SYSCALL_PATTERN);
|
|
28843
|
+
if (syscall)
|
|
28844
|
+
details.syscall = syscall;
|
|
28845
|
+
const exitCode = finite(read(error, "exitCode"));
|
|
28846
|
+
if (exitCode !== undefined)
|
|
28847
|
+
details.exitCode = exitCode;
|
|
28848
|
+
const signal = matching(read(error, "signal"), CODE_PATTERN);
|
|
28849
|
+
if (signal)
|
|
28850
|
+
details.signal = signal;
|
|
28851
|
+
if (includeStack && (!commandFailure || stackHoldsMessage || !message)) {
|
|
28852
|
+
const frames = stackFrames(error, message);
|
|
28853
|
+
if (frames)
|
|
28854
|
+
details.stack = frames;
|
|
28855
|
+
}
|
|
28856
|
+
const members = read(error, "errors");
|
|
28857
|
+
if (Array.isArray(members))
|
|
28858
|
+
details.errorCount = members.length;
|
|
28859
|
+
const cause = read(error, "cause") ?? (Array.isArray(members) ? members[0] : undefined);
|
|
28860
|
+
if (cause !== undefined && cause !== null && depth < MAX_CAUSE_DEPTH) {
|
|
28861
|
+
details.cause = describe2(cause, false, includeMessage, depth + 1);
|
|
28862
|
+
}
|
|
28863
|
+
return details;
|
|
28864
|
+
}
|
|
28865
|
+
function formatLogError(error, options = {}) {
|
|
28866
|
+
try {
|
|
28867
|
+
return brand(describe2(error, options.stack !== false, options.message !== false, 0));
|
|
28868
|
+
} catch {
|
|
28869
|
+
return brand({ name: "Error", message: "[unreadable]" });
|
|
28870
|
+
}
|
|
28871
|
+
}
|
|
28872
|
+
function logErrorKind(error) {
|
|
28873
|
+
if (typeof error !== "object" || error === null)
|
|
28874
|
+
return "NonError";
|
|
28875
|
+
if (!(error instanceof Error) && typeof read(error, "message") !== "string")
|
|
28876
|
+
return "NonError";
|
|
28877
|
+
const code = read(error, "code");
|
|
28878
|
+
const safeCode = finite(code) ?? matching(code, CODE_PATTERN);
|
|
28879
|
+
if (safeCode !== undefined)
|
|
28880
|
+
return String(safeCode);
|
|
28881
|
+
return matching(read(error, "name"), NAME_PATTERN) ?? "Error";
|
|
28882
|
+
}
|
|
28883
|
+
|
|
28884
|
+
// ../protocol/src/log-vocabulary/define.ts
|
|
28885
|
+
var THROTTLE_LOG_EVENTS = {
|
|
28886
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
28887
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
28888
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
28889
|
+
};
|
|
28890
|
+
function defineLogAreas(areas) {
|
|
28891
|
+
return areas;
|
|
28892
|
+
}
|
|
28893
|
+
|
|
28894
|
+
// ../protocol/src/log-vocabulary/agent-mail.ts
|
|
28895
|
+
var AGENT_MAIL_LOG_AREAS = defineLogAreas({
|
|
28896
|
+
"agent-mail": {
|
|
28897
|
+
description: "Delivering agent mail into waiting agent sessions.",
|
|
28898
|
+
events: {
|
|
28899
|
+
"delivery.waiting": "The drain passed over a pending message, for a reason it had not yet logged.",
|
|
28900
|
+
"drain.new-mail-failed": "Draining newly received mail failed; the next sweep delivers it.",
|
|
28901
|
+
"presence.sync-failed": "Mailboxes could not be synchronized.",
|
|
28902
|
+
"inject.verified": "An injected message's delivery was checked. Ids and decisions only.",
|
|
28903
|
+
"inject.dispatched": "Messages were dispatched into a session. Ids and decisions only.",
|
|
28904
|
+
"stopped-worker.action-failed": "Nothing could act on mail for a stopped worker.",
|
|
28905
|
+
"coordinator.start-failed": "The main coordinator could not be started for a new message.",
|
|
28906
|
+
"message.placed": "A message was placed in a mailbox. Ids and decisions only, never subjects or bodies.",
|
|
28907
|
+
"budget.hold-notify-failed": "The coordinator could not be told about held worker mail.",
|
|
28908
|
+
"budget.reset-failed": "The mail budget could not be reset for a prompted tab."
|
|
28909
|
+
}
|
|
28910
|
+
}
|
|
28911
|
+
});
|
|
28912
|
+
|
|
28913
|
+
// ../protocol/src/log-vocabulary/backend.ts
|
|
28914
|
+
var BACKEND_LOG_AREAS = defineLogAreas({
|
|
28915
|
+
"build.pipeline": {
|
|
28916
|
+
description: "Build delivery, ticket reconciliation and persisted pipeline recovery.",
|
|
28917
|
+
events: {
|
|
28918
|
+
"delivery-policy.failed": "A ticket delivery edit could not be reconciled with the running build.",
|
|
28919
|
+
"criteria.failed": "Verify could not record criterion results on the ticket.",
|
|
28920
|
+
"transcript-maintenance.failed": "Pipeline transcript maintenance failed.",
|
|
28921
|
+
"hydrate.failed": "The renderer could not load the authoritative pipeline snapshot."
|
|
28922
|
+
}
|
|
28923
|
+
},
|
|
28924
|
+
"backend.activity": {
|
|
28925
|
+
description: "The backend's recurring activity and maintenance jobs.",
|
|
28926
|
+
events: {
|
|
28927
|
+
"job.failed": "One pass of the job named in `scope` failed; its next pass retries.",
|
|
28928
|
+
...THROTTLE_LOG_EVENTS
|
|
28929
|
+
}
|
|
28930
|
+
},
|
|
28931
|
+
backend: {
|
|
28932
|
+
description: "The backend process: startup, background notices and shutdown.",
|
|
28933
|
+
events: {
|
|
28934
|
+
starting: "The backend process is starting.",
|
|
28935
|
+
"ssh-socket.resolved": "An SSH agent socket was found.",
|
|
28936
|
+
"ssh-socket.missing": "No usable SSH agent socket was found.",
|
|
28937
|
+
"standalone-updater.mismatch": "--standalone-updater does not match --data-dir, so self-update is off.",
|
|
28938
|
+
"instance.publish-failed": "The instance descriptor could not be published.",
|
|
28939
|
+
"instance.republish-failed": "The instance descriptor could not be republished; a later pass retries.",
|
|
28940
|
+
"parent.exited": "The parent process exited, so local servers are shutting down.",
|
|
28941
|
+
"startup.step-failed": "One part of startup failed and the backend carried on; `step` says which.",
|
|
28942
|
+
"startup.setup-fence-failed": "An environment's interrupted setup could not be fenced.",
|
|
28943
|
+
"startup.setup-adopt-failed": "An environment's pending setup could not be adopted.",
|
|
28944
|
+
"startup.deletion-pending": "An interrupted environment deletion stays pending. Its owning step logged the detail.",
|
|
28945
|
+
"startup.looped-review-pending": "Cleanup of the retired Looped Review stays pending.",
|
|
28946
|
+
"notice.failed": "A background notice after a turn or prompt failed; `step` says which.",
|
|
28947
|
+
"artifacts.live-unavailable": "Live interactive artifacts are unavailable.",
|
|
28948
|
+
"shutdown.step-failed": "One part of shutdown failed and the rest went on; `step` says which.",
|
|
28949
|
+
"shutdown.signal-received": "A signal started shutdown, which tells a clean quit from the backend being killed.",
|
|
28950
|
+
"shutdown.finished": "Shutdown finished, and the process exits with `code`.",
|
|
28951
|
+
"port-policy.second-backend": "Another backend serves the default data directory, so this one avoids its ports.",
|
|
28952
|
+
"port-policy.serve-on-free-port": "--tailscale-serve is on a free gateway port; pass --port with --strict-gateway-port to keep one."
|
|
28953
|
+
}
|
|
28954
|
+
}
|
|
28955
|
+
});
|
|
28956
|
+
|
|
28957
|
+
// ../protocol/src/log-vocabulary/bridge.ts
|
|
28958
|
+
var MAX_BRIDGE_DIAGNOSTIC_BYTES = 8192;
|
|
28959
|
+
var BRIDGE_LOG_AREAS = defineLogAreas({
|
|
28960
|
+
"bridge.diagnostics": {
|
|
28961
|
+
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.",
|
|
28962
|
+
tag: "bridge-diagnostics",
|
|
28963
|
+
maxStringChars: MAX_BRIDGE_DIAGNOSTIC_BYTES,
|
|
28964
|
+
events: {
|
|
28965
|
+
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.",
|
|
28966
|
+
change: "At trace only: a snapshot written as soon as the phase, the pending tools or a counter past its threshold changes.",
|
|
28967
|
+
"send-started": "A turn or process diagnostic scope began.",
|
|
28968
|
+
"send-resolved": "The provider accepted a dispatch.",
|
|
28969
|
+
"cancel-requested": "Cancellation of a turn was requested.",
|
|
28970
|
+
"cancel-settled": "The provider's cancel call returned or failed.",
|
|
28971
|
+
closed: "A diagnostic scope ended, with its final counters.",
|
|
28972
|
+
"snapshot-overflow": "A snapshot exceeded the bound, so only its size was written.",
|
|
28973
|
+
"debug-events": "A batch of allowlisted debug labels with their counts.",
|
|
28974
|
+
"setup-failed": "A Cursor setup step failed and swallowed its error.",
|
|
28975
|
+
"sdk-snapshot": "Cursor's SDK transports and executions at a boundary.",
|
|
28976
|
+
"sdk-snapshot-overflow": "A Cursor SDK snapshot exceeded the bound, so it was omitted."
|
|
28977
|
+
}
|
|
28978
|
+
},
|
|
28979
|
+
"bridge.lifecycle": {
|
|
28980
|
+
description: "What every long-lived bridge does the same way: its sweep and its shutdown.",
|
|
28981
|
+
events: {
|
|
28982
|
+
"idle-sweep.failed": "An idle sweep threw; the next tick retries.",
|
|
28983
|
+
"shutdown.failed": "Releasing the bridge failed during shutdown; it still exits."
|
|
28984
|
+
}
|
|
28985
|
+
},
|
|
28986
|
+
"bridge.acp": {
|
|
28987
|
+
description: "The ACP bridge behind Grok: its routes, sessions, saved state and change evidence.",
|
|
28988
|
+
events: {
|
|
28989
|
+
"command-change.record-failed": "A measured command change could not be recorded.",
|
|
28990
|
+
"evidence.record-failed": "Change evidence could not be recorded; the read loop carries on.",
|
|
28991
|
+
"evidence.shell-record-failed": "A shell observation could not be recorded.",
|
|
28992
|
+
"evidence.turn-record-failed": "Turn change evidence could not be recorded.",
|
|
28993
|
+
"server.listening": "The HTTP server is listening.",
|
|
28994
|
+
"state.composer-reset": "A saved composer state was malformed and was reset.",
|
|
28995
|
+
"state.discarded": "Saved bridge state could not be used and was discarded.",
|
|
28996
|
+
"state.persist-failed": "Saving bridge state failed; a later write retries.",
|
|
28997
|
+
"state.session-config-reset": "A saved session configuration was malformed and was reset."
|
|
28998
|
+
}
|
|
28999
|
+
},
|
|
29000
|
+
"bridge.claude": {
|
|
29001
|
+
description: "The Claude bridge: its routes, sessions, parked interactions and the Agent SDK turn loop.",
|
|
29002
|
+
events: {
|
|
29003
|
+
"commands.read-failed": "The command catalogue read failed; the cached answer stands.",
|
|
29004
|
+
"context-usage.read-failed": "The detailed context usage read failed; the route falls back.",
|
|
29005
|
+
"dispatch.rollback-failed": "Rolling back a prompt dispatch claim failed.",
|
|
29006
|
+
"event-subscriber.failed": "An event subscriber threw; other subscribers still ran.",
|
|
29007
|
+
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
29008
|
+
"mcp.config-ignored": "An MCP server configuration of an unsupported shape was ignored.",
|
|
29009
|
+
"mcp.read-failed": "Listing MCP servers failed; the route answered 500.",
|
|
29010
|
+
"models.fetch-failed": "Reading the supported models failed; the fallback catalogue is served.",
|
|
29011
|
+
"models.requested": "The model catalogue route was called.",
|
|
29012
|
+
"models.responded": "The model catalogue route answered.",
|
|
29013
|
+
"parent.gone": "The backend that launched this bridge has gone; shutting down.",
|
|
29014
|
+
"plan-approval.responding": "Answering a parked plan approval.",
|
|
29015
|
+
"plan-approval.response-failed": "The plan approval route failed.",
|
|
29016
|
+
"plan-approval.response-received": "The route received a plan approval answer.",
|
|
29017
|
+
"plan-approval.result": "A parked plan approval was answered.",
|
|
29018
|
+
"plan-approval.wait-failed": "A parked plan approval ended without an answer: cancelled, timed out or closed.",
|
|
29019
|
+
"plan-exit.failure-overridden": "ExitPlanMode failed after the user approved; treated as success with a continuation re-prompt.",
|
|
29020
|
+
"plan-mode.record-failed": "Plan mode from a status frame could not be recorded.",
|
|
29021
|
+
"plan.reprompt-approved-failed": "Re-prompting after an approved plan failed.",
|
|
29022
|
+
"plan.reprompt-feedback-failed": "Re-prompting with plan rejection feedback failed.",
|
|
29023
|
+
"plugin.path-missing": "A configured plugin was skipped because its path does not exist.",
|
|
29024
|
+
"plugin.unsafe-path": "An installed plugin was skipped because its install path is unsafe.",
|
|
29025
|
+
"plugins.read-failed": "Listing plugins failed; the route answered 500.",
|
|
29026
|
+
"prompt.accepted": "The route accepted a prompt and answered 202.",
|
|
29027
|
+
"prompt.failed": "A prompt turn failed; the session reports the error.",
|
|
29028
|
+
"prompt.processing-failed": "A prompt accepted by the route failed while processing.",
|
|
29029
|
+
"prompt.received": "A prompt reached the bridge; only its length is logged.",
|
|
29030
|
+
"prompt.send-failed": "A prompt request failed; the route answered with an error.",
|
|
29031
|
+
"query.close-failed": "Stopping the Claude query failed while closing a tab; the close stays pending.",
|
|
29032
|
+
"query.failed": "A Claude query ended with an error result.",
|
|
29033
|
+
"question.answer-failed": "The answer-question route failed.",
|
|
29034
|
+
"question.answering": "Answering a parked question.",
|
|
29035
|
+
"question.answers-prepared": "The route prepared a question answer for the session.",
|
|
29036
|
+
"question.answers-received": "A parked question received its answers.",
|
|
29037
|
+
"question.stale": "An answer arrived for a question no longer pending; the route answered stale.",
|
|
29038
|
+
"question.wait-failed": "A parked question ended without an answer: cancelled, timed out or closed.",
|
|
29039
|
+
"runtime.ended-under-resumed-turn": "The Claude runtime ended while a resumed root turn was still open.",
|
|
29040
|
+
"server.listening": "The HTTP server is listening.",
|
|
29041
|
+
"server.starting": "The HTTP server is about to bind.",
|
|
29042
|
+
"session.compact-failed": "A requested compaction failed.",
|
|
29043
|
+
"session.create-failed": "Creating a session failed; the route answered with an error.",
|
|
29044
|
+
"session.created": "A session was created or recovered.",
|
|
29045
|
+
"session.delete-failed": "Deleting a session failed.",
|
|
29046
|
+
"session.fork-failed": "Forking a session failed.",
|
|
29047
|
+
"session.rename-failed": "Renaming a session failed.",
|
|
29048
|
+
"session.resolve-failed": "A session could not be found or loaded for a request; action names the request.",
|
|
29049
|
+
"session.rewind-failed": "Rewinding session files failed.",
|
|
29050
|
+
"session.task-state-hydrate-failed": "Hydrating session task state failed; the route answered with an error.",
|
|
29051
|
+
"sessions.reconcile-failed": "Reconciling persisted sessions failed; the sessions already known are listed.",
|
|
29052
|
+
"sse.aborted": "The client closed an event stream.",
|
|
29053
|
+
"sse.cleanup": "An event stream connection was released.",
|
|
29054
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
29055
|
+
"sse.handshake-failed": "An event stream failed during its handshake; the client reconnects.",
|
|
29056
|
+
"sse.keepalive-failed": "An event stream keepalive failed, usually a client that has gone; the connection closes.",
|
|
29057
|
+
"sse.opened": "An event stream connection opened.",
|
|
29058
|
+
"sse.subscribe-requested": "A client asked to subscribe to the event stream.",
|
|
29059
|
+
"sse.write-failed": "Writing to an event stream failed; the connection closes and the client reconnects.",
|
|
29060
|
+
"task.candidate-bound-reached": "An unresolved Bash call was not tracked as a background task: the candidate bound is full.",
|
|
29061
|
+
"task.details-persist-failed": "Shell task details could not be saved; the task carries on.",
|
|
29062
|
+
"task.settling-bound-reached": "A settling task was not tracked: the settling bound is full.",
|
|
29063
|
+
"task.stop-failed": "Stopping a background task failed on a control channel that had closed.",
|
|
29064
|
+
"task.stop-route-failed": "The stop-task route failed.",
|
|
29065
|
+
"transcript.background-hydrate-failed": "Hydrating a transcript in the background failed; the next read retries.",
|
|
29066
|
+
"transcript.hydrate-failed": "Hydrating a transcript before a prompt failed; the prompt runs and a later read retries."
|
|
29067
|
+
}
|
|
29068
|
+
},
|
|
29069
|
+
"bridge.codex": {
|
|
29070
|
+
description: "The Codex bridge: its routes, sessions and the app-server child it supervises.",
|
|
29071
|
+
events: {
|
|
29072
|
+
"account.connector-recovery-failed": "Recovering account connectors failed; the account answer stands.",
|
|
29073
|
+
"account.login-reload-failed": "Reloading the stored account login failed.",
|
|
29074
|
+
"account.sign-in-check-failed": "An account sign-in check failed; admission is left unchanged.",
|
|
29075
|
+
"account.usage-read-failed": "Reading account usage failed; the route answers 503.",
|
|
29076
|
+
"app-server.drain-expired": "The drain deadline expired, so app-server restarted with turns still in flight.",
|
|
29077
|
+
"app-server.exited": "app-server exited unexpectedly; the code and signal say how.",
|
|
29078
|
+
"app-server.invariant-violation": "app-server asked for something its configuration forbids.",
|
|
29079
|
+
"app-server.protocol-violation": "app-server wrote a line that is not valid protocol; it was ignored.",
|
|
29080
|
+
"app-server.recording": "Notification recording is on; recordings hold content.",
|
|
29081
|
+
"app-server.stale-reaped": "A stale app-server left by an earlier bridge was stopped.",
|
|
29082
|
+
"app-server.stderr": "Metadata of an app-server stderr line, never its content.",
|
|
29083
|
+
"app-server.stderr-suppressed": "app-server stderr lines beyond the budget were counted, not described.",
|
|
29084
|
+
"approval.cancel-failed": "Cancelling a turn after an approval answer failed.",
|
|
29085
|
+
"approval.present-failed": "Presenting an approval threw; it is auto-declined.",
|
|
29086
|
+
"approval.resolved-callback-failed": "An approval resolved callback threw.",
|
|
29087
|
+
"command-changes.record-failed": "Recording line changes for a command failed; the turn carries on.",
|
|
29088
|
+
"dispatch.reconcile-failed": "A dispatch could not be reconciled against its thread; it stays recovering.",
|
|
29089
|
+
"dispatch.restore-failed": "A journaled dispatch could not be restored after a restart; recovery retries.",
|
|
29090
|
+
"engine.listener-failed": "An engine event listener threw; the others still ran.",
|
|
29091
|
+
"engine.ready": "The app-server engine started.",
|
|
29092
|
+
"engine.start-failed": "The app-server engine failed to start; reported through health.",
|
|
29093
|
+
"engine.stop-failed": "Stopping the Codex engine failed during shutdown; the bridge exits anyway.",
|
|
29094
|
+
"generation.recovery-failed": "Recovering sessions after an app-server generation change failed.",
|
|
29095
|
+
"http.request-failed": "An HTTP route threw; it answered 500.",
|
|
29096
|
+
"idle-sweep.failed": "An idle sweep failed; the next one retries.",
|
|
29097
|
+
"interaction.present-failed": "Presenting an interaction threw; it is cancelled.",
|
|
29098
|
+
"interaction.resolved-callback-failed": "An interaction resolved callback threw.",
|
|
29099
|
+
"journal.persist-failed": "Saving the dispatch journal failed.",
|
|
29100
|
+
"message.publish-failed": "Publishing a message update failed.",
|
|
29101
|
+
"models.cache-persist-failed": "Saving the model cache failed.",
|
|
29102
|
+
"models.debug-read-failed": "`codex debug models` failed; another source is used.",
|
|
29103
|
+
"models.list-failed": "model/list failed; the cached models are served.",
|
|
29104
|
+
"models.refresh-failed": "A background model refresh failed; the cache stands.",
|
|
29105
|
+
"notification.enqueue-failed": "Queueing a notification threw.",
|
|
29106
|
+
"ordered-events.flush-failed": "Flushing before ordered-event reconciliation failed.",
|
|
29107
|
+
"ordered-events.publish-failed": "Publishing an ordered event failed; clients are told to rehydrate.",
|
|
29108
|
+
"ordered-events.reconcile-failed": "Reconciling ordered events failed.",
|
|
29109
|
+
"parent.gone": "The backend that launched this bridge has gone; stopping turns and shutting down.",
|
|
29110
|
+
"queue.task-failed": "A task on a per-thread queue failed.",
|
|
29111
|
+
"raw-log.write-failed": "Appending to the raw Codex log failed.",
|
|
29112
|
+
"recorder.notice": "The notification recorder needs attention: it is on, or was asked for without its confirmation.",
|
|
29113
|
+
"recorder.threw": "The notification recorder threw.",
|
|
29114
|
+
"recorder.write-failed": "Writing a notification recording failed; its lines were dropped.",
|
|
29115
|
+
"registry.persist-failed": "Saving the session registry failed; a later write retries.",
|
|
29116
|
+
"rollout.hydrate-failed": "A rollout could not be read to hydrate a thread.",
|
|
29117
|
+
"runtime-env.refresh-failed": "Refreshing the runtime environment failed; the last values stay.",
|
|
29118
|
+
"runtime-env.refreshed": "Runtime environment variables changed; names only, never values.",
|
|
29119
|
+
"server-request.answer-failed": "Answering a server request failed.",
|
|
29120
|
+
"server-request.flush-timeout": "An answer to a server request did not flush in time.",
|
|
29121
|
+
"server-request.handoff-failed": "Handing a server request to the router threw.",
|
|
29122
|
+
"session.config-apply-failed": "Applying session configuration failed; the route answers unavailable.",
|
|
29123
|
+
"sse.closed": "An event stream was closed by the bridge; the client reconnects and replays.",
|
|
29124
|
+
"sse.keepalive-failed": "An event stream keepalive failed.",
|
|
29125
|
+
"sse.observer-failed": "An event stream observer failed; it reconnects.",
|
|
29126
|
+
"sse.payload-serialize-failed": "An event payload could not be serialized; a placeholder was sent.",
|
|
29127
|
+
"sse.payload-snapshot-failed": "An event payload could not be snapshotted; a placeholder was sent.",
|
|
29128
|
+
"sse.subscriber-failed": "An event stream subscriber failed; it reconnects and replays.",
|
|
29129
|
+
"subagent.activity-load-failed": "Sub-agent activity could not be loaded; the transcript renders without it.",
|
|
29130
|
+
"thread.archive-failed": "Archiving or unarchiving a thread failed.",
|
|
29131
|
+
"thread.fork-failed": "thread/fork failed; the route answers 503.",
|
|
29132
|
+
"thread.fork-hydrate-failed": "A forked thread could not be hydrated and was closed.",
|
|
29133
|
+
"thread.reattach-failed": "A thread could not be re-attached.",
|
|
29134
|
+
"thread.rename-failed": "thread/name/set failed; the bridge title index stays authoritative.",
|
|
29135
|
+
"thread.turns-read-after-revert-failed": "A thread's turns could not be read after a revert.",
|
|
29136
|
+
"thread.turns-read-failed": "A thread's turns could not be read.",
|
|
29137
|
+
"thread.unsubscribe-failed": "thread/unsubscribe failed; the binding is kept so a retry can unsubscribe.",
|
|
29138
|
+
"threads.list-failed": "thread/list failed; sessions come from the rollout parser.",
|
|
29139
|
+
"transcript.serving-last-known": "A thread read failed, so the last known transcript is served.",
|
|
29140
|
+
"turn.capacity-retry-failed": "Retrying a turn after a capacity failure failed.",
|
|
29141
|
+
"turn.capacity-retry-journal-failed": "A capacity retry could not be journaled.",
|
|
29142
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
29143
|
+
"turns.stopped": "Running turns were stopped because the backend went away."
|
|
29144
|
+
}
|
|
29145
|
+
},
|
|
29146
|
+
"bridge.cursor": {
|
|
29147
|
+
description: "The Cursor bridge: its routes, sessions and saved state.",
|
|
29148
|
+
events: {
|
|
29149
|
+
"agent.archive-failed": "Archiving or unarchiving an agent failed.",
|
|
29150
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
29151
|
+
"startup.closes-failed": "Finishing closes a previous process left behind failed at startup.",
|
|
29152
|
+
"startup.closes-incomplete": "Some closes a previous process left behind did not finish at startup; a retried close finishes them.",
|
|
29153
|
+
"state.publication-failing": "Saving bridge state is failing; new prompts and steers are refused until it recovers.",
|
|
29154
|
+
"state.publication-recovered": "Saving bridge state recovered.",
|
|
29155
|
+
"state.transcripts-shortened": "The state file reached its limit, so some sessions were saved with a shortened transcript copy."
|
|
29156
|
+
}
|
|
29157
|
+
},
|
|
29158
|
+
"bridge.pi": {
|
|
29159
|
+
description: "The Pi bridge: its routes, sessions and saved state.",
|
|
29160
|
+
events: {
|
|
29161
|
+
"http.route-failed": "An HTTP route failed unexpectedly; its error is not logged because it can hold content.",
|
|
29162
|
+
"state.over-budget": "The state file stayed over budget after shedding transcripts, so the write was skipped.",
|
|
29163
|
+
"state.transcripts-shed": "The state file was over budget, so some sessions were saved without their transcript."
|
|
29164
|
+
}
|
|
29165
|
+
}
|
|
29166
|
+
});
|
|
29167
|
+
|
|
29168
|
+
// ../protocol/src/log-vocabulary/desktop.ts
|
|
29169
|
+
var DESKTOP_LOG_AREAS = defineLogAreas({
|
|
29170
|
+
desktop: {
|
|
29171
|
+
description: "The Electron main process: startup, windows, quit and the Local backend's life.",
|
|
29172
|
+
events: {
|
|
29173
|
+
"backend.docker-context-seed-failed": "An agent-test profile fell back to the default Docker context.",
|
|
29174
|
+
"backend.exited": "The Local backend exited unexpectedly; Local work is unavailable.",
|
|
29175
|
+
"backend.exited-recovering": "The Local backend exited just after a remote update; relaunching unattended.",
|
|
29176
|
+
"backend.keychain-link-remove-failed": "An agent-test profile kept a legacy link to the host keychain.",
|
|
29177
|
+
"backend.start-failed": "The Local backend did not start; continuing with remote machines.",
|
|
29178
|
+
"clipboard.write-failed": "Writing text to the system clipboard failed.",
|
|
29179
|
+
"instance.already-running": "Another instance holds this data directory; this one will quit.",
|
|
29180
|
+
"main-thread.stalled": "A timer fired late, so windows, IPC and the stdout reader waited.",
|
|
29181
|
+
"quit.stopping-backend": "The app is quitting and has asked the Local backend to stop.",
|
|
29182
|
+
"relaunch.schedule-failed": "The AppImage relaunch waiter failed; using Electron's relauncher.",
|
|
29183
|
+
"relaunch.service-register-failed": "The AppImage relaunch service was refused; using a detached waiter.",
|
|
29184
|
+
"renderer.gone-giving-up": "A renderer kept dying, so the window is no longer reloaded.",
|
|
29185
|
+
"renderer.gone-reloading": "A renderer died and the window is being reloaded.",
|
|
29186
|
+
"renderer.reload-failed": "Reloading a window after its renderer died failed.",
|
|
29187
|
+
"restart-prompt.failed": "A native restart prompt could not be shown.",
|
|
29188
|
+
"saved-machines.attach-failed": "Saved machines were not imported into the command node yet.",
|
|
29189
|
+
"saved-machines.attached": "Saved machines were imported into the local command node.",
|
|
29190
|
+
"startup.failed": "The application failed to start.",
|
|
29191
|
+
"uncaught-exception": "The main process hit an uncaught exception.",
|
|
29192
|
+
"uncaught-exception.dialog-failed": "The uncaught exception sheet could not be shown.",
|
|
29193
|
+
"window.create-failed": "A menu-driven new window could not be created.",
|
|
29194
|
+
"window.recreate-failed": "The main window could not be recreated on activation.",
|
|
29195
|
+
"window.second-launch-failed": "A second launch could not open a window."
|
|
29196
|
+
}
|
|
29197
|
+
},
|
|
29198
|
+
"desktop.startup": {
|
|
29199
|
+
description: "Renderer startup markers and renderer process failures. These are the only events the renderer can place in the persistent log.",
|
|
29200
|
+
tag: "DesktopStartup",
|
|
29201
|
+
events: {
|
|
29202
|
+
"backend-unavailable": "The renderer could not complete a Local backend read in time.",
|
|
29203
|
+
"bridge-unavailable": "The preload API or connection-list IPC did not answer.",
|
|
29204
|
+
checking: "The renderer began waiting for the desktop connection.",
|
|
29205
|
+
"page-load-failed": "Chromium failed to load the main document.",
|
|
29206
|
+
"preload-failed": "Electron rejected the preload script.",
|
|
29207
|
+
ready: "The renderer reached the desktop connection and may mount the workspace.",
|
|
29208
|
+
"renderer-error": "An uncaught error occurred while the renderer was starting.",
|
|
29209
|
+
"renderer-gone": "A renderer process exited.",
|
|
29210
|
+
"renderer-load-failed": "Importing or mounting the application failed.",
|
|
29211
|
+
"unhandled-rejection": "An unhandled rejection occurred while the renderer was starting."
|
|
29212
|
+
}
|
|
29213
|
+
},
|
|
29214
|
+
"desktop.dialog": {
|
|
29215
|
+
description: "Native dialogs, whose modal loops hold the main thread while they are open.",
|
|
29216
|
+
events: {
|
|
29217
|
+
"attention-failed": "A dialog could not ask for the user's attention.",
|
|
29218
|
+
closed: "A native dialog closed.",
|
|
29219
|
+
"open-failed": "A dialog could not open; it was answered as cancelled.",
|
|
29220
|
+
opening: "A native dialog is opening.",
|
|
29221
|
+
"preview-beforeunload-ignored": "A browser preview's beforeunload handler was ignored.",
|
|
29222
|
+
"renderer-beforeunload-cancelled": "A renderer's beforeunload handler cancelled an unload."
|
|
29223
|
+
}
|
|
29224
|
+
},
|
|
29225
|
+
"backend.client": {
|
|
29226
|
+
description: "The desktop's HTTP and event stream client for a backend.",
|
|
29227
|
+
events: {
|
|
29228
|
+
"event-stream.disconnected": "The event stream dropped; the client reconnects with backoff.",
|
|
29229
|
+
"event-stream.malformed-frame": "An event stream frame could not be parsed and was dropped."
|
|
29230
|
+
}
|
|
29231
|
+
},
|
|
29232
|
+
connections: {
|
|
29233
|
+
description: "The desktop's saved machines and active connection.",
|
|
29234
|
+
events: {
|
|
29235
|
+
"catalogue.legacy-read-failed": "The previous connection list could not be read to migrate.",
|
|
29236
|
+
"catalogue.restored-from-backup": "The device catalogue was unreadable; the backup was used.",
|
|
29237
|
+
"restore.failed": "The previous remote connection could not be restored; using Local.",
|
|
29238
|
+
"secure-storage.waiting": "Startup is waiting on an operating system keychain prompt."
|
|
29239
|
+
}
|
|
29240
|
+
},
|
|
29241
|
+
workspaces: {
|
|
29242
|
+
description: "Workspace realms the desktop holds on other machines.",
|
|
29243
|
+
events: {
|
|
29244
|
+
"route.moved-direct": "A relayed workspace moved to its direct route."
|
|
29245
|
+
}
|
|
29246
|
+
},
|
|
29247
|
+
toolchain: {
|
|
29248
|
+
description: "Preparing the pinned agent toolchain at desktop startup.",
|
|
29249
|
+
events: {
|
|
29250
|
+
"bootstrap-progress.show-failed": "The toolchain progress window could not be shown.",
|
|
29251
|
+
"prepare.failed": "Preparing the pinned agent tools failed."
|
|
29252
|
+
}
|
|
29253
|
+
},
|
|
29254
|
+
"artifact-host": {
|
|
29255
|
+
description: "Live artifact hosts in the desktop app.",
|
|
29256
|
+
events: {
|
|
29257
|
+
"host.ended": "A host ended; fields count its blocked and rejected requests by reason."
|
|
29258
|
+
}
|
|
29259
|
+
}
|
|
29260
|
+
});
|
|
29261
|
+
|
|
29262
|
+
// ../protocol/src/log-vocabulary/environment.ts
|
|
29263
|
+
var ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
29264
|
+
environment: {
|
|
29265
|
+
description: "Environment naming, setup, status, moves, deletion and cleanup afterwards.",
|
|
29266
|
+
events: {
|
|
29267
|
+
"cleanup.branch-kept": "A deleted environment's local branch was kept, as it may hold unmerged work.",
|
|
29268
|
+
"rename.failed": "Naming an environment from its pending prompt failed for the first time.",
|
|
29269
|
+
"rename.still-failing": "That rename is still failing; written at the 2nd, 4th, 8th... failure.",
|
|
29270
|
+
"rename.recovered": "A rename from a pending prompt succeeded after failing.",
|
|
29271
|
+
"setup.attention-not-recorded": "Held setup could not be recorded as needing the user's attention.",
|
|
29272
|
+
"setup.coordinator-not-notified": "The worker's coordinator could not be told that its setup is held for approval.",
|
|
29273
|
+
"setup.unknown-environment": "The renderer was asked to act on the setup of an environment it does not hold.",
|
|
29274
|
+
"cleanup.rearmed": "A deleted environment's stopped cleanup is retried once under a new backend version.",
|
|
29275
|
+
"cleanup.exhausted": "A deleted environment's cleanup keeps failing after its attempts; written once per environment.",
|
|
29276
|
+
"cleanup.retry-not-admitted": "A cleanup retry was not admitted; the entry stays for the next start.",
|
|
29277
|
+
"cleanup.step-failed": "One step of a deleted environment's cleanup failed; a later reconcile retries it.",
|
|
29278
|
+
"cleanup.record-failed": "A finished cleanup step could not be recorded, so it may run again.",
|
|
29279
|
+
"cleanup.sweep-failed": "A cleanup sweep failed; written once per sweep.",
|
|
29280
|
+
"cleanup.reconcile-failed": "A cleanup reconcile pass failed; the next one retries.",
|
|
29281
|
+
"orphan-state.remove-failed": "An orphaned environment state directory could not be removed.",
|
|
29282
|
+
"orphan-state.removed": "Orphaned environment state directories were removed.",
|
|
29283
|
+
"orphan-state.sweep-failed": "Sweeping orphaned environment state failed.",
|
|
29284
|
+
"orphan-canvas.removed": "Orphaned design canvases were removed.",
|
|
29285
|
+
"orphan-canvas.sweep-failed": "Sweeping orphaned design canvases failed.",
|
|
29286
|
+
"orphan-branches.swept": "Orphaned environment branches were deleted, or kept as they may hold unmerged work.",
|
|
29287
|
+
"stray-workspace.remove-failed": "A stray workspace directory could not be removed.",
|
|
29288
|
+
"stray-workspace.removed": "Stray workspace directories were removed.",
|
|
29289
|
+
"stray-workspace.kept": "Unowned workspace directories that hold files were kept; remove them by hand if unneeded.",
|
|
29290
|
+
"temp-files.removed": "Abandoned temp files were removed.",
|
|
29291
|
+
"status.ownership-probe-failed": "A strict container ownership probe failed, so the stored status is kept.",
|
|
29292
|
+
"status.docker-error": "A transient Docker error stopped a status read, so the stored status is kept.",
|
|
29293
|
+
"setup.clear-launch-failed": "A pending agent launch could not be cleared after setup failed.",
|
|
29294
|
+
"setup.record-failure-failed": "A setup failure before its first attempt could not be recorded.",
|
|
29295
|
+
"lifecycle.failed": "Starting, rebuilding or recreating an environment failed; `operation` says which.",
|
|
29296
|
+
"tab-teardown.pending": "A tab's teardown failed and stays pending; the reconcile sweep retries.",
|
|
29297
|
+
"tab-reconcile.skipped": "Orphaned tab reconciliation was skipped because pane layouts are unreadable.",
|
|
29298
|
+
"orphan-session.reaped": "A native session no tab references was torn down.",
|
|
29299
|
+
"handoff-sweep.failed": "Sweeping transferred transcripts no tab references failed.",
|
|
29300
|
+
"delete.terminals-survived": "Terminal process trees outlived termination, so the deletion stops.",
|
|
29301
|
+
"delete.artifacts-left": "Graph run artifact directories were not removed.",
|
|
29302
|
+
"delete.worktrees-kept": "Graph runs kept branch worktrees.",
|
|
29303
|
+
"delete.step-failed": "One best-effort part of deleting an environment failed; `step` says which, and the rest goes on.",
|
|
29304
|
+
"merge-cleanup.resume-failed": "A merge cleanup interrupted by a restart could not be resumed.",
|
|
29305
|
+
"move.sessions-not-moved": "A provider's sessions could not follow a moved environment.",
|
|
29306
|
+
"move.recovery-failed": "Recovering an interrupted environment move failed.",
|
|
29307
|
+
"stop.settle-activity-failed": "Agent activity could not be settled after a runtime stopped.",
|
|
29308
|
+
...THROTTLE_LOG_EVENTS
|
|
29309
|
+
}
|
|
29310
|
+
}
|
|
29311
|
+
});
|
|
29312
|
+
|
|
29313
|
+
// ../protocol/src/log-vocabulary/gateway.ts
|
|
29314
|
+
var GATEWAY_LOG_AREAS = defineLogAreas({
|
|
29315
|
+
gateway: {
|
|
29316
|
+
description: "The gateway other devices, browsers and the desktop connect through.",
|
|
29317
|
+
events: {
|
|
29318
|
+
"remote.start-failed": "The desktop could not start the remote gateway.",
|
|
29319
|
+
"remote.stop-failed": "The desktop could not stop the remote gateway cleanly.",
|
|
29320
|
+
disabled: "The gateway is disabled by its environment variable.",
|
|
29321
|
+
"tailscale.no-address": "No Tailscale address was found, so the gateway did not start.",
|
|
29322
|
+
"tailscale.no-address-fallback": "No Tailscale address was found, so the gateway binds its fallback address.",
|
|
29323
|
+
"control.listening": "The backend control listener is up.",
|
|
29324
|
+
"browser.listening": "The browser listener is up.",
|
|
29325
|
+
"browser.unavailable": "The browser listener could not start; control remains if started, or loopback is attempted.",
|
|
29326
|
+
"browser.unavailable-degraded": "No browser listener was started (`reason=no-tailscale-address`); control remains if started, or loopback is attempted.",
|
|
29327
|
+
"loopback.listening": "The loopback client listener is up.",
|
|
29328
|
+
"loopback.unavailable": "The loopback client listener could not start.",
|
|
29329
|
+
"auth-token.stored": "The gateway token's file was written. The path only, never the token.",
|
|
29330
|
+
"auth-token.persist-failed": "The gateway token could not be saved.",
|
|
29331
|
+
"port.fallback": "The preferred port was taken, so a nearby one is used.",
|
|
29332
|
+
"port.fallback-distant": "The preferred port and those nearby were taken, so another is used.",
|
|
29333
|
+
"request.failed": "A gateway request failed. Throttled: repeats are counted, not written.",
|
|
29334
|
+
"websocket.upgrade-failed": "A WebSocket upgrade failed.",
|
|
29335
|
+
"events.client-dropped": "An event-stream client buffered too much and was dropped; it reconnects and refetches.",
|
|
29336
|
+
"proxy.client-disconnected": "A proxy client went away, so its upstream request was aborted.",
|
|
29337
|
+
"throttle.suppressed": "Repeats of the throttled `site` were counted over a window, not written.",
|
|
29338
|
+
"throttle.recovered": "The throttled `site` succeeded again, so its fault has cleared.",
|
|
29339
|
+
"throttle.evicted": "The tracked-key limit dropped the `site`, so no recovered line follows unless it fails again."
|
|
29340
|
+
}
|
|
29341
|
+
},
|
|
29342
|
+
"gateway.terminal": {
|
|
29343
|
+
description: "The gateway's terminal WebSocket.",
|
|
29344
|
+
events: {
|
|
29345
|
+
"upgrade-rejected": "A terminal WebSocket upgrade was refused.",
|
|
29346
|
+
"socket-error": "A terminal WebSocket reported an error.",
|
|
29347
|
+
"subscription-failed": "A terminal subscription failed.",
|
|
29348
|
+
"operation-failed": "A terminal operation failed. Fixed text: the operation can hold terminal input."
|
|
29349
|
+
}
|
|
29350
|
+
},
|
|
29351
|
+
"gateway.tailscale": {
|
|
29352
|
+
description: "Tailscale Serve for desktop web access and a standalone backend.",
|
|
29353
|
+
events: {
|
|
29354
|
+
"web-access.disable-failed": "Desktop web access could not be turned off.",
|
|
29355
|
+
"web-access.enable-failed": "Desktop web access could not be turned on.",
|
|
29356
|
+
"web-access.cleanup-failed": "Cleaning up after a failed enable also failed.",
|
|
29357
|
+
"web-access.reset-failed": "Desktop web access could not be reset.",
|
|
29358
|
+
"startup.init-failed": "Desktop web access could not be initialized at startup.",
|
|
29359
|
+
available: "Tailscale Serve is publishing the gateway."
|
|
29360
|
+
}
|
|
29361
|
+
}
|
|
29362
|
+
});
|
|
29363
|
+
|
|
29364
|
+
// ../protocol/src/log-vocabulary/local-server.ts
|
|
29365
|
+
var LOCAL_SERVER_LOG_AREAS = defineLogAreas({
|
|
29366
|
+
"local-server": {
|
|
29367
|
+
description: "Agent bridge processes the backend runs on the host.",
|
|
29368
|
+
events: {
|
|
29369
|
+
"bridge.not-answering": "A bridge with work in progress fails health checks, so it is not restarted yet.",
|
|
29370
|
+
"bridge-runtime.installing": "A bridge runtime is being installed.",
|
|
29371
|
+
"bridge-runtime.installed": "A bridge runtime finished installing.",
|
|
29372
|
+
"opencode.database-lost-retrying": "OpenCode lost its shared database at startup, so it is retried.",
|
|
29373
|
+
"server.stopping": "A local server is being stopped, for the fixed `reason` given.",
|
|
29374
|
+
"reaper.tmux-list-failed": "Orphaned claude-tmux sessions could not be listed.",
|
|
29375
|
+
"reaper.tmux-kill-failed": "An orphaned tmux session could not be killed.",
|
|
29376
|
+
"reaper.tmux-reaped": "Orphaned claude-tmux sessions of a deleted environment were killed.",
|
|
29377
|
+
"reaper.runtime-root-remove-failed": "A claude-tmux runtime root could not be removed; it stays for a retry.",
|
|
29378
|
+
"reaper.server-unidentified": "An orphan candidate could not be identified, so its record is kept.",
|
|
29379
|
+
"reaper.server-refused": "An orphan candidate leads no process group, so it was not reaped.",
|
|
29380
|
+
"reaper.server-reaping": "An orphaned server is being stopped.",
|
|
29381
|
+
"reaper.server-kill-failed": "An orphaned server did not exit.",
|
|
29382
|
+
...THROTTLE_LOG_EVENTS
|
|
29383
|
+
}
|
|
29384
|
+
}
|
|
29385
|
+
});
|
|
29386
|
+
|
|
29387
|
+
// ../protocol/src/log-vocabulary/git.ts
|
|
29388
|
+
var GIT_LOG_AREAS = defineLogAreas({
|
|
29389
|
+
git: {
|
|
29390
|
+
description: "Git operations the backend runs in environment worktrees and containers.",
|
|
29391
|
+
events: {
|
|
29392
|
+
"branch.rename-failed": "Renaming an environment's branch failed; the stored name is kept.",
|
|
29393
|
+
"branch.push-config-failed": "A branch was renamed but its push settings could not be written; the rename is undone.",
|
|
29394
|
+
"branch.rollback-failed": "Undoing a branch rename failed; the stored name follows whichever branch now exists."
|
|
29395
|
+
}
|
|
29396
|
+
}
|
|
29397
|
+
});
|
|
29398
|
+
|
|
29399
|
+
// ../protocol/src/log-vocabulary/logging.ts
|
|
29400
|
+
var LOGGING_LOG_AREAS = defineLogAreas({
|
|
29401
|
+
logging: {
|
|
29402
|
+
description: "The logger and the on-disk application log themselves.",
|
|
29403
|
+
events: {
|
|
29404
|
+
"capture.started": "Saving logs to disk began for this process.",
|
|
29405
|
+
"capture.stopped": "Saving logs to disk stopped for this process.",
|
|
29406
|
+
"config.invalid": "A logging environment variable held a value that was ignored.",
|
|
29407
|
+
"entries.dropped": "The log queue was full, so entries were dropped and counted.",
|
|
29408
|
+
"policy.changed": "The logging settings changed: saving, retention and levels, with no content.",
|
|
29409
|
+
"policy.bridge-predates-route": "A running bridge has no logging settings route; it applies them at its next start.",
|
|
29410
|
+
"policy.push-failed": "A running bridge did not take the logging settings after retries; its next start resends them.",
|
|
29411
|
+
"prune.failed": "Removing expired log files failed; the next sweep retries.",
|
|
29412
|
+
"write.failed": "Appending to the log file failed.",
|
|
29413
|
+
"unknown-area": "Code outside the type checker asked for an area that is not listed."
|
|
29414
|
+
}
|
|
29415
|
+
}
|
|
29416
|
+
});
|
|
29417
|
+
|
|
29418
|
+
// ../protocol/src/log-vocabulary/models.ts
|
|
29419
|
+
var MODEL_LOG_AREAS = defineLogAreas({
|
|
29420
|
+
models: {
|
|
29421
|
+
description: "Agent model catalogues and their persistent caches.",
|
|
29422
|
+
events: {
|
|
29423
|
+
"cache.write-failed": "A successful catalogue refresh could not update the host cache.",
|
|
29424
|
+
"seed.pi-failed": "The host Pi model catalogue could not be seeded; the next launch retries.",
|
|
29425
|
+
"bridge.not-ready": "The first-use catalogue bridge did not become ready.",
|
|
29426
|
+
"bridge.start-failed": "The first-use catalogue bridge failed to start.",
|
|
29427
|
+
"probe.exit-unclean": "A catalogue probe or sign-in server did not exit cleanly.",
|
|
29428
|
+
"download.deferred": "A model catalogue could not be downloaded yet."
|
|
29429
|
+
}
|
|
29430
|
+
}
|
|
29431
|
+
});
|
|
29432
|
+
|
|
29433
|
+
// ../protocol/src/log-vocabulary/native-agent.ts
|
|
29434
|
+
var NATIVE_AGENT_LOG_AREAS = defineLogAreas({
|
|
29435
|
+
"native-agent": {
|
|
29436
|
+
description: "Native agent sessions and what the backend reads from their bridges.",
|
|
29437
|
+
events: {
|
|
29438
|
+
"catalogue.outdated-bridge": "A bridge predates the command catalogue, so its commands stay unavailable.",
|
|
29439
|
+
"handoff.summary-read-failed": "Change summaries could not be read for a handoff, so the carrier says they are unmeasured.",
|
|
29440
|
+
"handoff.consume-failed": "A delivered handoff could not be marked consumed.",
|
|
29441
|
+
"job.pr-refresh-rollback-failed": "Rolling back a pull request refresh for a job failed.",
|
|
29442
|
+
"job.resend-queue-failed": "A resend could not be queued for a job.",
|
|
29443
|
+
"interaction.requests-dropped": "Interaction requests that could not be mapped were dropped.",
|
|
29444
|
+
"interaction.observe-failed": "Observing a session's interactions failed. Error class only.",
|
|
29445
|
+
"human-prompt.listener-failed": "A human prompt listener threw; the others still run.",
|
|
29446
|
+
"question.attention-record-failed": "Attention for an async question could not be recorded; the transcript stays readable.",
|
|
29447
|
+
"activity.reconcile-failed": "Reconciling an environment's activity failed. Error class only.",
|
|
29448
|
+
"activity.persist-failed": "An environment's activity could not be saved.",
|
|
29449
|
+
"pr-refresh.schedule-failed": "A pull request refresh after completion could not be scheduled.",
|
|
29450
|
+
"launch.startup-failed": "A startup launch failed; it retries unless `permanent`.",
|
|
29451
|
+
"queue.failing": "A native prompt queue keeps failing. The key and reason only, never the prompt.",
|
|
29452
|
+
"provider.retire-failed": "Retiring an obsolete provider failed.",
|
|
29453
|
+
"workflow-result.store-unavailable": "The workflow result store is unavailable, so the provider's result is used.",
|
|
29454
|
+
"catalogue.refresh-failed": "A provider's command catalogue could not be refreshed.",
|
|
29455
|
+
"dispatch.attach-failed": "Attaching an agent before dispatch failed; the prompt request answers authoritatively.",
|
|
29456
|
+
"coordinator-context.ack-failed": "Coordinator repository context could not be acknowledged.",
|
|
29457
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
29458
|
+
"interrupt.persist-failed": "A turn interrupt could not be saved, so automatic publication stays fenced.",
|
|
29459
|
+
"resume.close-replaced-failed": "The session a resume replaced could not be closed.",
|
|
29460
|
+
"sign-in.check-failed": "A turn could not be checked for a login refusal.",
|
|
29461
|
+
"sign-in.resend-failed": "Sending refused prompts after sign-in failed.",
|
|
29462
|
+
"sign-in.prompt-resend-failed": "One refused prompt could not be sent again after sign-in. Error class only.",
|
|
29463
|
+
"shutdown.checkpoints-skipped": "Shutdown skipped display-tail checkpoints; provider history stays authoritative. Count only.",
|
|
29464
|
+
"turn-recovery.failed": "Recovering an incomplete turn failed.",
|
|
29465
|
+
"turn-recovery.exhausted": "A turn failed again after automatic recovery and is left for the user.",
|
|
29466
|
+
"turn-recovery.retrying": "An incomplete or provider-failed turn is being retried automatically.",
|
|
29467
|
+
"usage-limit.resend-failed": "Resending after a usage limit failed. An unknown send stays in the journal.",
|
|
29468
|
+
"title.strategy-failed": "A session title strategy failed, so the next is tried. Content-free: the error can quote the prompt.",
|
|
29469
|
+
...THROTTLE_LOG_EVENTS
|
|
29470
|
+
}
|
|
29471
|
+
},
|
|
29472
|
+
"native-agent.goal": {
|
|
29473
|
+
description: "The /goal loop: advancing goals and their verifiers.",
|
|
29474
|
+
events: {
|
|
29475
|
+
"advance.failed": "A goal could not advance; the next sweep retries.",
|
|
29476
|
+
"attention.record-failed": "Attention for a goal could not be recorded.",
|
|
29477
|
+
"turn-end.settle-failed": "Turn-end work for a goal could not be settled.",
|
|
29478
|
+
"verifier.finish-failed": "A verifier failed to finish; the goal stays verifying, so the next sweep runs it again.",
|
|
29479
|
+
"verifier.stop-failed": "An earlier verifier could not be stopped.",
|
|
29480
|
+
"recover.failed": "Goals could not be recovered at startup."
|
|
29481
|
+
}
|
|
29482
|
+
},
|
|
29483
|
+
"native-agent.opencode": {
|
|
29484
|
+
description: "The OpenCode provider: its request monitor, retries and agent tools.",
|
|
29485
|
+
events: {
|
|
29486
|
+
"retry.abort-failed": "Aborting an automatic retry failed. Error class only.",
|
|
29487
|
+
"retry.abort-not-scheduled": "An automatic retry abort could not be scheduled. Error class only.",
|
|
29488
|
+
"agent-tools.unavailable": "OpenCode agent tools remain unavailable for a session.",
|
|
29489
|
+
"coordinator-servers.unavailable": "OpenCode coordinator research servers are unavailable.",
|
|
29490
|
+
"monitor.reconnecting": "The request monitor lost its stream and is reconnecting. Error class only.",
|
|
29491
|
+
"worker-limit.reached": "The bounded request workers are full, so the stream restarts and a snapshot reconciles.",
|
|
29492
|
+
"request.failed": "Handling a request event failed, so the stream restarts. Error class only."
|
|
29493
|
+
}
|
|
29494
|
+
}
|
|
29495
|
+
});
|
|
29496
|
+
|
|
29497
|
+
// ../protocol/src/log-vocabulary/preview.ts
|
|
29498
|
+
var PREVIEW_LOG_AREAS = defineLogAreas({
|
|
29499
|
+
preview: {
|
|
29500
|
+
description: "Browser and service previews: transports, partitions and captures.",
|
|
29501
|
+
events: {
|
|
29502
|
+
"attachment.release-failed": "Releasing a preview attachment failed; its lease expires it.",
|
|
29503
|
+
"capture-spool.load-failed": "The pending browser capture spool could not be loaded.",
|
|
29504
|
+
"certificate.refresh-failed": "Re-reading the preview certificate failed; the next check retries.",
|
|
29505
|
+
"certificate.renewal-refused": "A renewed certificate does not cover the preview hosts, so it was ignored.",
|
|
29506
|
+
"connection-cleanup.record-failed": "A forgotten connection's cleanup could not be recorded.",
|
|
29507
|
+
"link.open-external-failed": "A preview link could not be opened in the system browser.",
|
|
29508
|
+
"node.record-failed": "A node that owns preview partitions could not be recorded.",
|
|
29509
|
+
"partition.clear-failed": "A preview partition could not be cleared.",
|
|
29510
|
+
"partitions.record-cleared-failed": "Cleared preview partitions could not be recorded.",
|
|
29511
|
+
"partitions.record-nodes-failed": "The nodes that own preview partitions could not be saved.",
|
|
29512
|
+
"partitions.remove-failed": "Cleared preview partition directories could not be removed.",
|
|
29513
|
+
"partitions.retry-forgotten-failed": "Retrying a forgotten preview cleanup failed.",
|
|
29514
|
+
"port-hints.persist-failed": "Preview port hints could not be saved.",
|
|
29515
|
+
"transport.close-failed": "A preview transport could not be closed.",
|
|
29516
|
+
"ca-bundle.read-failed": "The upstream CA bundle could not be read.",
|
|
29517
|
+
"publication.start-failed": "Private preview publication did not start.",
|
|
29518
|
+
"publication.reconfigure-failed": "Preview publication could not be reconfigured.",
|
|
29519
|
+
"publication.listening": "Private preview origins are listening.",
|
|
29520
|
+
"certificate.reloaded": "The preview certificate was reloaded.",
|
|
29521
|
+
"access.revoked-close-failed": "A revoked preview resource could not be closed. Error class only.",
|
|
29522
|
+
"registry.invalid-definition": "An invalid stored preview service definition was ignored.",
|
|
29523
|
+
"registry.environment-reconcile-failed": "An environment's preview services could not be reconciled.",
|
|
29524
|
+
"registry.resolver-failed": "A preview resolver failed. Error class only.",
|
|
29525
|
+
"registry.revocation-listener-failed": "A preview revocation listener threw. Error class only.",
|
|
29526
|
+
"registry.change-emit-failed": "A preview change event could not be emitted. Error class only.",
|
|
29527
|
+
...THROTTLE_LOG_EVENTS
|
|
29528
|
+
}
|
|
29529
|
+
}
|
|
29530
|
+
});
|
|
29531
|
+
|
|
29532
|
+
// ../protocol/src/log-vocabulary/runtime.ts
|
|
29533
|
+
var RUNTIME_LOG_AREAS = defineLogAreas({
|
|
29534
|
+
"event-loop": {
|
|
29535
|
+
description: "This process's event loop. A stall of 10 seconds or more is written at error, so no level hides it.",
|
|
29536
|
+
events: {
|
|
29537
|
+
stalled: "A timer fired late, so every request in that window waited."
|
|
29538
|
+
}
|
|
29539
|
+
}
|
|
29540
|
+
});
|
|
29541
|
+
|
|
29542
|
+
// ../protocol/src/log-vocabulary/terminal.ts
|
|
29543
|
+
var TERMINAL_LOG_AREAS = defineLogAreas({
|
|
29544
|
+
terminal: {
|
|
29545
|
+
description: "Terminals. The renderer's lines stay in the browser console; the backend's reach the saved log.",
|
|
29546
|
+
events: {
|
|
29547
|
+
"input.undelivered": "A keystroke did not reach a shell: `no-session` or `not-delivered`.",
|
|
29548
|
+
"orphan.reaped": "A terminal no tab references was closed.",
|
|
29549
|
+
"agent-completion.notify-failed": "A terminal agent's completion could not be reported.",
|
|
29550
|
+
"activity.record-failed": "Terminal environment activity could not be recorded.",
|
|
29551
|
+
"pty.exit-listener-failed": "A terminal exit listener threw; the others still run.",
|
|
29552
|
+
"pty.exit-notify-failed": "Notifying a terminal's exit failed.",
|
|
29553
|
+
"pty.late-exit-listener-failed": "A listener added after a terminal exited threw.",
|
|
29554
|
+
"setup.pty-reused": "A setup terminal reused its existing PTY.",
|
|
29555
|
+
"setup.pty-spawning": "A setup terminal is spawning its PTY. The argument count only, never the arguments.",
|
|
29556
|
+
"setup.pty-spawned": "A setup terminal's PTY started.",
|
|
29557
|
+
"setup.pty-exited": "A setup terminal's PTY exited.",
|
|
29558
|
+
"setup.preparing": "Workspace preparation started in the setup terminal.",
|
|
29559
|
+
"setup.session-creating": "A setup session is being created.",
|
|
29560
|
+
"setup.intro-emitted": "The setup intro was written to the terminal.",
|
|
29561
|
+
"setup.completed": "Setup finished.",
|
|
29562
|
+
"setup.failed": "Setup failed.",
|
|
29563
|
+
"setup.already-complete": "Setup was requested but had already finished.",
|
|
29564
|
+
"setup.renderer-ensured": "The renderer asked for setup to be running.",
|
|
29565
|
+
"setup.renderer-requested": "The renderer asked for the setup session.",
|
|
29566
|
+
"setup.renderer-requested-none": "The renderer asked for a setup session that does not exist.",
|
|
29567
|
+
"setup.no-commands": "An environment has no setup commands to run.",
|
|
29568
|
+
"setup.already-running": "Setup was requested while it was already running.",
|
|
29569
|
+
"setup.held-for-approval": "Setup is held until its commands are approved.",
|
|
29570
|
+
"setup.renderer-checked-session": "The renderer asked whether a setup terminal session exists.",
|
|
29571
|
+
"setup.renderer-requested-buffer": "The renderer asked for a setup terminal's output buffer. A size only, never its contents.",
|
|
29572
|
+
"input.resume-failed": "Asking the backend to resume refused terminal input failed.",
|
|
29573
|
+
"input.write-failed": "Writing input to a terminal session threw.",
|
|
29574
|
+
"listener.remove-failed": "Removing a terminal output listener threw.",
|
|
29575
|
+
"listener.released": "A terminal hook unmounted and dropped its output listener.",
|
|
29576
|
+
"session.unmounted": "A terminal hook unmounted; the shell keeps running.",
|
|
29577
|
+
"connect.called": "A terminal hook began connecting to a session.",
|
|
29578
|
+
"output.reconcile-failed": "Output could not be reconciled against the backend snapshot.",
|
|
29579
|
+
"session.stopped-while-disconnected": "A session ended while its event stream was down.",
|
|
29580
|
+
"session.disconnect-failed": "Closing or detaching a terminal session failed.",
|
|
29581
|
+
"session.resize-failed": "Resizing a terminal session failed, other than for a gone session.",
|
|
29582
|
+
"session.id-stored": "A new backend session id was saved for a terminal tab.",
|
|
29583
|
+
"session-key.environment-missing": "A local session key was built with no environment id.",
|
|
29584
|
+
"clipboard.image-failed": "An image pasted into a terminal could not be saved.",
|
|
29585
|
+
"clipboard.copy-failed": "Copying a terminal selection to the clipboard failed.",
|
|
29586
|
+
"clipboard.paste-failed": "A paste into a terminal failed; `target` says which path.",
|
|
29587
|
+
"clipboard.process-failed": "Reading or storing clipboard data for a paste failed.",
|
|
29588
|
+
"clipboard.image-save-failed": "An image from a paste event could not be written to disk.",
|
|
29589
|
+
"environment.ready-detected": "A first tab's output showed that the workspace is ready.",
|
|
29590
|
+
"shell.ready-detected": "A later tab's output showed that its shell is ready.",
|
|
29591
|
+
"setup.scripts-completed": "A setup tab's scripts reported their end by an escape code.",
|
|
29592
|
+
"setup.marked-complete": "The user marked a setup tab complete by hand.",
|
|
29593
|
+
"setup.awaiting-detection": "A first tab connected and is watching output for readiness.",
|
|
29594
|
+
"reconnect.setup-marker-found": "A reconnected tab's buffer already held the setup marker.",
|
|
29595
|
+
"reconnect.setup-marker-absent": "A reconnected first tab's buffer lacked the setup marker.",
|
|
29596
|
+
"reconnect.completed": "A terminal tab finished reconnecting to its session.",
|
|
29597
|
+
"restore.setup-marker-found": "A restored tab's buffer already held the setup marker.",
|
|
29598
|
+
"persistent-sessions.load-failed": "Listing an environment's saved sessions failed.",
|
|
29599
|
+
"persistent-session.restoring": "A tab began restoring from its saved session.",
|
|
29600
|
+
"persistent-session.found": "A tab found its saved session already recorded.",
|
|
29601
|
+
"persistent-session.creating": "A tab began recording a saved session for the sidebar.",
|
|
29602
|
+
"persistent-session.created": "A saved session for the sidebar was recorded.",
|
|
29603
|
+
"persistent-session.create-failed": "Recording a saved session for the sidebar failed.",
|
|
29604
|
+
"persistent-session.status-update-failed": "Marking a saved session connected failed.",
|
|
29605
|
+
"persistent-session.activity-update-failed": "Updating a saved session's activity failed.",
|
|
29606
|
+
"persistent-buffer.loaded": "A saved session's buffer loaded; only its length is logged.",
|
|
29607
|
+
"persistent-buffer.load-failed": "A saved session's buffer could not be loaded.",
|
|
29608
|
+
"persistent-buffer.save-failed": "Saving a session's buffer during cleanup failed.",
|
|
29609
|
+
"buffer.restore-failed": "Writing a saved buffer back into a terminal threw.",
|
|
29610
|
+
"buffer.serialize-failed": "Serializing a terminal's buffer during cleanup threw.",
|
|
29611
|
+
"command.launching": "A tab began launching its command in a new session.",
|
|
29612
|
+
"bootstrap.failed": "A launch request for a new session failed; it may retry.",
|
|
29613
|
+
"setup-session.bind-failed": "Looking up or binding the backend setup session failed.",
|
|
29614
|
+
"setup-tab.stale-removed": "A setup placeholder tab with no session was removed.",
|
|
29615
|
+
"multi-reviews.restore-failed": "Multi-review tabs could not be restored for an environment.",
|
|
29616
|
+
"pane-layout.restore-failed": "An environment's saved pane layout could not be read.",
|
|
29617
|
+
"pane-layout.history-migrate-failed": "Stripping private browser history fields failed.",
|
|
29618
|
+
"pane-layout.snapshot-remove-failed": "Removing an unusable pane layout snapshot failed.",
|
|
29619
|
+
"pane-layout.selection-migrate-failed": "Saving a migrated legacy pane selection failed.",
|
|
29620
|
+
"panes.reset": "An environment's panes were reset: its container changed or stopped.",
|
|
29621
|
+
"tabs.limit-reached": "A new tab was refused because the tab limit was reached.",
|
|
29622
|
+
"tab.created": "A new tab was added to a pane; `tabType` says which kind.",
|
|
29623
|
+
"tab.activated": "Opening a file selected the tab that already held it.",
|
|
29624
|
+
"tab.duplicate-refused": "A new tab was refused because its requested id is in use.",
|
|
29625
|
+
"tab.multi-review-refused": "A multi-review tab was refused for lack of a workflow id.",
|
|
29626
|
+
"tab.split-at-edge": "A dragged tab split a pane at one of its edges.",
|
|
29627
|
+
"tab.reordered": "A dragged tab moved within its pane.",
|
|
29628
|
+
"tab.moved": "A dragged tab moved to another pane.",
|
|
29629
|
+
"drag.ended": "A tab drag ended, whether or not it landed on a target.",
|
|
29630
|
+
"display.state": "The terminal container's overlays and tab count, on each dev render.",
|
|
29631
|
+
"compose.draft-restore-failed": "A saved compose draft could not be read.",
|
|
29632
|
+
"compose.draft-persist-failed": "A compose draft could not be saved or discarded.",
|
|
29633
|
+
"compose.image-too-large": "A pasted image stayed over the attachment limit after resizing.",
|
|
29634
|
+
"compose.image-add-failed": "Adding a pasted image to the compose bar failed.",
|
|
29635
|
+
"compose.image-save-failed": "Saving one compose image for sending failed; the rest proceed.",
|
|
29636
|
+
"compose.send-failed": "Sending from the compose bar failed.",
|
|
29637
|
+
"init-logs.load-failed": "A container's initialization logs could not be loaded.",
|
|
29638
|
+
"init-logs.refresh-stopped": "A container's initialization logs stopped refreshing.",
|
|
29639
|
+
"portal.terminal-created": "The portal host created a terminal for a new tab.",
|
|
29640
|
+
"portal.terminal-disposed": "The portal host disposed a terminal for a removed tab.",
|
|
29641
|
+
"link.open-failed": "Opening a terminal link in the external browser failed.",
|
|
29642
|
+
"canvas.context-unavailable": "A resize canvas had no 2D context; the original is kept.",
|
|
29643
|
+
...THROTTLE_LOG_EVENTS
|
|
29644
|
+
}
|
|
29645
|
+
},
|
|
29646
|
+
"terminal.setup": {
|
|
29647
|
+
description: "The renderer attaching a backend-managed environment setup terminal.",
|
|
29648
|
+
events: {
|
|
29649
|
+
"session.bind-from-environment": "The environment hook bound a setup session to a tab.",
|
|
29650
|
+
"setup.started-received": "An environment-setup-started event arrived.",
|
|
29651
|
+
"setup.complete-received": "An environment-setup-complete event arrived.",
|
|
29652
|
+
"attach.state-changed": "A setup tab's attach inputs changed; runs per effect pass.",
|
|
29653
|
+
"terminal.preserve-failed": "Keeping a setup terminal's buffer before conversion failed.",
|
|
29654
|
+
"tab.marker-retired": "A setup tab with no live PTY stopped being a setup tab.",
|
|
29655
|
+
"tab.added": "The backend-managed setup tab was added to a new layout.",
|
|
29656
|
+
"session.bind-skipped": "A setup session lookup was already running for this tab.",
|
|
29657
|
+
"session.requested": "A tab asked the backend for its setup session.",
|
|
29658
|
+
"session.unavailable": "The backend had no setup session to give a tab.",
|
|
29659
|
+
"session.bind-started": "A backend setup session was found and is being bound to a tab.",
|
|
29660
|
+
"session.awaited": "The layout is waiting for a setup session before adding the tab.",
|
|
29661
|
+
"reconcile.started": "The reconcile effect found setup tabs that still need a session.",
|
|
29662
|
+
"reconnect-listener.install-failed": "Listening for event stream reconnects failed.",
|
|
29663
|
+
"layout.initial-decided": "An empty layout was evaluated for its setup tab; runs per effect."
|
|
29664
|
+
}
|
|
29665
|
+
}
|
|
29666
|
+
});
|
|
29667
|
+
|
|
29668
|
+
// ../protocol/src/log-vocabulary/tmux.ts
|
|
29669
|
+
var TMUX_LOG_AREAS = defineLogAreas({
|
|
29670
|
+
tmux: {
|
|
29671
|
+
description: "Claude tmux tabs: launch, the poll loop, cleanup and the tmux prompt queue.",
|
|
29672
|
+
events: {
|
|
29673
|
+
"poll.discovery-failed": "Finding the session's transcript failed; a later tick retries.",
|
|
29674
|
+
"poll.snapshot-failed": "Reading the hook and transcript state failed; the next tick retries.",
|
|
29675
|
+
"poll.drain-pending-failed": "Delivering pending hook events failed; the next tick retries.",
|
|
29676
|
+
"poll.drain-timeouts-failed": "Delivering hook timeouts failed; the next tick retries.",
|
|
29677
|
+
"poll.tail-failed": "Reading new transcript lines failed; the next tick retries.",
|
|
29678
|
+
"cleanup.session-stop-failed": "A tmux session could not be stopped while cleaning up an environment.",
|
|
29679
|
+
"cleanup.skipped": "Environment tmux cleanup was skipped because tmux could not be reached and nothing required it.",
|
|
29680
|
+
"cleanup.environments-load-failed": "Environments could not be loaded during tmux cleanup, so it stays incomplete.",
|
|
29681
|
+
"cleanup.kill-failed": "An environment's tmux sessions could not be killed.",
|
|
29682
|
+
"hooks.uninstall-failed": "Workspace hooks could not be uninstalled.",
|
|
29683
|
+
"hooks.git-exclude-failed": "The git exclude for Claude's local settings could not be set.",
|
|
29684
|
+
"naming.prepare-failed": "First-prompt naming could not be prepared; the prompt still goes ahead.",
|
|
29685
|
+
"orphans.skipped": "Orphan reconciliation was skipped because pane layouts are unreadable.",
|
|
29686
|
+
"orphan.reaped": "A tmux session no tab references was killed.",
|
|
29687
|
+
"orphan.kill-skipped": "An orphan tmux kill was skipped because the tmux server could not be reached.",
|
|
29688
|
+
"cli.thinking-display-probe-failed": "Probing the CLI for --thinking-display failed, so it launches without it.",
|
|
29689
|
+
"cli.fast-mode-unsupported": "The claude CLI lacks --settings, so it launches without fast mode.",
|
|
29690
|
+
"cli.effort-unsupported": "The claude CLI lacks --effort, so it launches without it.",
|
|
29691
|
+
"interactive.snapshot-failed": "An interactive snapshot failed; expected while a pane is closing.",
|
|
29692
|
+
"signal.arm-failed": "The Claude state signal could not be armed.",
|
|
29693
|
+
"signal.degraded": "The Claude state signal missed a change or rang too often, so polling stays at one second until it is re-armed.",
|
|
29694
|
+
"pr-refresh.schedule-failed": "A pull request refresh after a turn could not be scheduled.",
|
|
29695
|
+
"pr-probe.failed": "Probing for a pull request an agent created failed.",
|
|
29696
|
+
"activity.persist-failed": "Tmux tab activity could not be saved.",
|
|
29697
|
+
"fast-mode.persist-failed": "The launch fast mode could not be saved.",
|
|
29698
|
+
"fast-mode.repair-failed": "Fast mode metadata could not be repaired on a reattached session.",
|
|
29699
|
+
"pane.observe-failed": "A pane observation failed. Error class only: pane contents are sensitive.",
|
|
29700
|
+
"turn.failure-record-failed": "A failed turn could not be recorded.",
|
|
29701
|
+
"slash-command.settle-timeout": "Timed out waiting for a Claude slash command to settle.",
|
|
29702
|
+
"queue.failing": "A tmux prompt queue keeps failing to dispatch.",
|
|
29703
|
+
"queue.rename-failed": "An environment could not be named from its first prompt; the prompt still goes ahead.",
|
|
29704
|
+
...THROTTLE_LOG_EVENTS
|
|
29705
|
+
}
|
|
29706
|
+
}
|
|
29707
|
+
});
|
|
29708
|
+
|
|
29709
|
+
// ../protocol/src/log-vocabulary/updater.ts
|
|
29710
|
+
var UPDATER_LOG_AREAS = defineLogAreas({
|
|
29711
|
+
updater: {
|
|
29712
|
+
description: "Desktop self-update: electron-updater and updates a remote client requested.",
|
|
29713
|
+
events: {
|
|
29714
|
+
"channel.following": "Update checks now follow a different release channel.",
|
|
29715
|
+
"check-report.failed": "A check's result could not be reported.",
|
|
29716
|
+
"check.failed": "An update check failed; the next periodic check retries.",
|
|
29717
|
+
"download.failed": "Downloading or staging an update failed.",
|
|
29718
|
+
downloaded: "An update finished downloading.",
|
|
29719
|
+
"library.message": "One line from electron-updater at its own level. Its debug output, which includes the differential download plan, is off by default.",
|
|
29720
|
+
"remote.check-failed": "A check a remote client requested failed.",
|
|
29721
|
+
"remote.installing": "Installing an update for a remote client.",
|
|
29722
|
+
"remote.read-failed": "Update requests could not be read from the Local backend.",
|
|
29723
|
+
"remote.relaunch-prepare-failed": "Preparing the relaunch after a remote update failed.",
|
|
29724
|
+
"remote.relaunched": "The app relaunched to finish a remote client's update.",
|
|
29725
|
+
"remote.report-failed": "An update report could not reach the Local backend.",
|
|
29726
|
+
"remote.restart-not-recorded": "The backend did not record a restart, so it was not installed.",
|
|
29727
|
+
"remote.unavailable": "Updates requested by remote clients are unavailable in this session.",
|
|
29728
|
+
"restart-prompt.failed": "The restart prompt for a downloaded update failed.",
|
|
29729
|
+
unavailable: "Auto-update could not be set up in this session.",
|
|
29730
|
+
"update.failed": "electron-updater reported an update error.",
|
|
29731
|
+
"standalone.restarting": "A standalone backend is restarting into a new version."
|
|
29732
|
+
}
|
|
29733
|
+
}
|
|
29734
|
+
});
|
|
29735
|
+
|
|
29736
|
+
// ../protocol/src/log-vocabulary/web-annotations.ts
|
|
29737
|
+
var WEB_ANNOTATIONS_LOG_AREAS = defineLogAreas({
|
|
29738
|
+
"web-annotations": {
|
|
29739
|
+
description: "Web annotation requests and their background reconciler.",
|
|
29740
|
+
events: {
|
|
29741
|
+
"reconcile.failed": "A background reconcile pass failed; the next one retries.",
|
|
29742
|
+
"legacy.degraded": "Legacy annotation storage is damaged, so the previous committed copy is served read-only.",
|
|
29743
|
+
"legacy.draft-index-problem": "The legacy draft index could not be used; `status` says why.",
|
|
29744
|
+
"legacy.unreadable-records": "The legacy import found unreadable records; they stay unread.",
|
|
29745
|
+
"legacy.unavailable": "Legacy annotation storage could not be read.",
|
|
29746
|
+
"legacy.unreadable": "An environment's legacy annotation storage is unreadable.",
|
|
29747
|
+
"legacy.archive-failed": "Imported legacy annotation files could not be archived.",
|
|
29748
|
+
"legacy.files-archived": "Legacy files beside an imported environment were archived, not imported.",
|
|
29749
|
+
"migration.draft-failed": "Migrating one draft failed.",
|
|
29750
|
+
"draft-reconcile.deferred": "Draft reconciliation was deferred; a later pass retries.",
|
|
29751
|
+
"request.handoff-deferred": "A request's handoff was deferred; a later pass retries.",
|
|
29752
|
+
"evidence.materialize-failed": "Materializing a request's evidence failed; it backs off and retries.",
|
|
29753
|
+
"queue.publish-deferred": "Publishing a request to the queue was deferred; it retries under the same id.",
|
|
29754
|
+
"request.reconcile-failed": "Reconciling a request failed; the next pass retries.",
|
|
29755
|
+
"turn-end.reconcile-failed": "Reconciling a request at the end of a turn failed; the next pass retries.",
|
|
29756
|
+
"gc.failed": "Annotation garbage collection failed; the next pass retries.",
|
|
29757
|
+
"record.unavailable": "An annotation record is unavailable; written once per record.",
|
|
29758
|
+
"storage.unavailable": "An environment's annotation store is unreadable.",
|
|
29759
|
+
"change-hint.listener-failed": "A change hint listener threw.",
|
|
29760
|
+
"orphan.remove-failed": "An orphaned environment's annotation storage could not be removed.",
|
|
29761
|
+
"storage.load-failed": "An environment's annotation storage could not be loaded.",
|
|
29762
|
+
...THROTTLE_LOG_EVENTS
|
|
29763
|
+
}
|
|
29764
|
+
}
|
|
29765
|
+
});
|
|
29766
|
+
|
|
29767
|
+
// ../protocol/src/log-vocabulary/storage.ts
|
|
29768
|
+
var STORAGE_LOG_AREAS = defineLogAreas({
|
|
29769
|
+
storage: {
|
|
29770
|
+
description: "The SQLite-backed stores, their snapshots and imports from older formats.",
|
|
29771
|
+
events: {
|
|
29772
|
+
"usage.environment-label-failed": "Usage labels could not be retained for a removed environment; deletion continues.",
|
|
29773
|
+
"snapshot.integrity-failed": "An hourly database snapshot failed its integrity check and was discarded.",
|
|
29774
|
+
"snapshot.skipped-low-disk": "The hourly database snapshot was skipped because the disk lacks room; `retryAt` says when it tries again.",
|
|
29775
|
+
"snapshot.failed": "The hourly database snapshot failed; `retryAt` says when it tries again, if known.",
|
|
29776
|
+
"listener.attention-failed": "An environment attention listener threw; the committed mutation stands.",
|
|
29777
|
+
"listener.change-failed": "A resource change listener threw; the committed mutation stands.",
|
|
29778
|
+
"kanban.image-cleanup-failed": "An orphaned Kanban image could not be removed after its retries; it is safe to remove later.",
|
|
29779
|
+
"nodes.entries-dropped": "Unreadable node registry entries were ignored.",
|
|
29780
|
+
"preview-identity.reminted": "The data directory moved or was copied, so previews get a new backend identity.",
|
|
29781
|
+
"machine-profile.invalid": "The stored machine profile was invalid and the default was restored.",
|
|
29782
|
+
"permission-rules.cleanup-failed": "A deleted project's permission rules could not be removed.",
|
|
29783
|
+
"retired.turn-cleanup-pending": "Cleanup of a retired Looped Review turn did not finish and stays pending.",
|
|
29784
|
+
"handoffs.prune-failed": "Pruning agent handoffs that nothing references failed; a later prune retries.",
|
|
29785
|
+
"desktop-connections.malformed": "Stored desktop connection settings were malformed, so the local connection is used.",
|
|
29786
|
+
"legacy-json.moved": "JSON store files written after the SQLite migration were archived, not imported.",
|
|
29787
|
+
"legacy-json.archive-failed": "Imported JSON store files could not be archived."
|
|
29788
|
+
}
|
|
29789
|
+
}
|
|
29790
|
+
});
|
|
29791
|
+
|
|
29792
|
+
// ../protocol/src/log-vocabulary/build-pipeline.ts
|
|
29793
|
+
var BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
29794
|
+
"build-pipeline": {
|
|
29795
|
+
description: "Build pipelines: their supervision, stages, transcripts and sidebar state.",
|
|
29796
|
+
events: {
|
|
29797
|
+
"sidebar.reconcile-failed": "Sidebar activity for pipelines could not be reconciled.",
|
|
29798
|
+
"sidebar.update-failed": "The sidebar could not be updated for one pipeline.",
|
|
29799
|
+
"result.consume-deferred": "Consuming a stage's workflow result failed; it stays staged and is retried.",
|
|
29800
|
+
"consolidation.consume-deferred": "Consuming a review consolidation result failed; it stays pending and is retried.",
|
|
29801
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request does the same work and answers authoritatively.",
|
|
29802
|
+
"interaction.resolved": "A human interaction on a pipeline stage resolved. Metadata only.",
|
|
29803
|
+
"transcripts.migrated": "A transcript migration pass moved stage transcripts; counts only.",
|
|
29804
|
+
"transcripts.maintenance-failed": "Migrating or sweeping stage transcripts failed; the next start retries.",
|
|
29805
|
+
"restore.skipped": "A pipeline could not be restored at startup and was skipped.",
|
|
29806
|
+
"criteria.record-failed": "Acceptance criteria results could not be recorded on the ticket.",
|
|
29807
|
+
"workspace.waiting": "A pipeline is waiting for its workspace; written once per reason.",
|
|
29808
|
+
"rewind.pending": "A pipeline's code rewind has not finished; written once per reason.",
|
|
29809
|
+
"kanban.status-failed": "A restarted pipeline's Kanban status could not be set; it retries shortly.",
|
|
29810
|
+
"usage.read-failed": "Reading a stage session's token usage failed.",
|
|
29811
|
+
"checkpoint.deferred": "A stage transcript checkpoint could not be written yet; the provider's history stands.",
|
|
29812
|
+
"checkpoint.not-committed": "A stage transcript checkpoint was reverted in the commit that should have kept it.",
|
|
29813
|
+
"legacy-transcript.deferred": "Moving a legacy inline transcript failed; the inline body stays readable."
|
|
29814
|
+
}
|
|
29815
|
+
}
|
|
29816
|
+
});
|
|
29817
|
+
|
|
29818
|
+
// ../protocol/src/log-vocabulary/agent-branch.ts
|
|
29819
|
+
var AGENT_BRANCH_LOG_AREAS = defineLogAreas({
|
|
29820
|
+
"agent-branch": {
|
|
29821
|
+
description: "Agent branches shared by review fan-outs, graph agents and goal verifiers; `owner` names which.",
|
|
29822
|
+
events: {
|
|
29823
|
+
"observation.checkpoint-failed": "Checkpointing reviewer observations failed; the next pass retries.",
|
|
29824
|
+
"transcript.mirror-failed": "Mirroring a reviewer transcript failed.",
|
|
29825
|
+
"usage.read-failed": "Reading a reviewer's token usage failed.",
|
|
29826
|
+
"result.nudge-failed": "An agent with an uncommitted result could not be nudged.",
|
|
29827
|
+
"dispatch.prepare-failed": "Attaching the agent before dispatch failed; the prompt request answers authoritatively.",
|
|
29828
|
+
"result.consume-deferred": "Consuming a branch's workflow result failed; it stays staged and is retried."
|
|
29829
|
+
}
|
|
29830
|
+
}
|
|
29831
|
+
});
|
|
29832
|
+
|
|
29833
|
+
// ../protocol/src/log-vocabulary/change-tracking.ts
|
|
29834
|
+
var CHANGE_TRACKING_LOG_AREAS = defineLogAreas({
|
|
29835
|
+
"change-tracking": {
|
|
29836
|
+
description: "Change tracking: turn capture, evidence pulls and measurements.",
|
|
29837
|
+
events: {
|
|
29838
|
+
"journal-import.failed": "Importing surviving OpenCode command journals as legacy summaries failed.",
|
|
29839
|
+
"projection.failed": "Projecting a change event onto its environment failed.",
|
|
29840
|
+
"startup.reconcile-failed": "Reconciling change tracking at startup failed.",
|
|
29841
|
+
"turn-start.capture-failed": "Capturing a turn's start failed, so the turn is untracked.",
|
|
29842
|
+
"dispatch.record-failed": "Recording a turn's dispatch outcome failed.",
|
|
29843
|
+
"turn.finalize-failed": "Finalizing a turn failed.",
|
|
29844
|
+
"turn.settle-failed": "Settling a late interrupted turn failed.",
|
|
29845
|
+
"evidence.pull-failed": "Pulling change evidence from a bridge failed; a later pull retries.",
|
|
29846
|
+
"measurement.failed": "Recomputing a tool's measurement failed."
|
|
29847
|
+
}
|
|
29848
|
+
},
|
|
29849
|
+
"diff-stats": {
|
|
29850
|
+
description: "Environment diff stats and the worktree signals that drive them.",
|
|
29851
|
+
events: {
|
|
29852
|
+
"baseline.update-failed": "An environment's diff baseline could not be updated.",
|
|
29853
|
+
"scan.watcher-failed": "An environment's diff watcher failed; its scans fall back to polling.",
|
|
29854
|
+
"scan.failed": "A diff scan failed; the last results stay, marked stale, and the scan is retried.",
|
|
29855
|
+
"scan.freshness-read-failed": "Reading whether an environment's remote is fresh failed.",
|
|
29856
|
+
"scan.listener-failed": "A change-tracking scan listener threw; the scan itself stands.",
|
|
29857
|
+
"emit.diff-stats-failed": "A diff stats change could not be emitted to its sink.",
|
|
29858
|
+
"emit.worktree-snapshot-failed": "A worktree snapshot could not be emitted to its sink.",
|
|
29859
|
+
"signal.demoted": "A worktree signal stopped being trusted, so scans fall back to timers until it is re-armed."
|
|
29860
|
+
}
|
|
29861
|
+
}
|
|
29862
|
+
});
|
|
29863
|
+
|
|
29864
|
+
// ../protocol/src/log-vocabulary/coordinator.ts
|
|
29865
|
+
var COORDINATOR_LOG_AREAS = defineLogAreas({
|
|
29866
|
+
coordinator: {
|
|
29867
|
+
description: "Coordinators: delegations, status wakes and their store.",
|
|
29868
|
+
events: {
|
|
29869
|
+
"delegation.open-failed": "A delegation could not be opened; `source` says for what.",
|
|
29870
|
+
"deliver-now.drain-failed": "The mail delivery pass after deliverNow failed; the next sweep delivers.",
|
|
29871
|
+
"mail.move-failed": "Mail could not move to the new main coordinator.",
|
|
29872
|
+
"work.move-failed": "Work could not move to the main coordinator.",
|
|
29873
|
+
"wake.observe-remote-workflow-failed": "A remote workflow could not be observed for status wakes.",
|
|
29874
|
+
"wake.observe-pull-request-failed": "A pull request could not be observed for status wakes.",
|
|
29875
|
+
"wake.observe-workflow-failed": "A workflow could not be observed for status wakes.",
|
|
29876
|
+
"wake.deliver-failed": "A workflow status wake could not be delivered; the next pass retries.",
|
|
29877
|
+
"wake.waiting-check-failed": "A waiting worker could not be checked; the next pass retries.",
|
|
29878
|
+
"wake.resolve-report-failed": "A finished Resolve tab could not be reported.",
|
|
29879
|
+
"wake.waiting-report-failed": "A waiting worker could not be reported.",
|
|
29880
|
+
"wake.worker-outcomes-failed": "Coordinator-owned workers' merges and deletions could not be checked; the next sweep retries.",
|
|
29881
|
+
"store.malformed": "The coordinator store was malformed and is treated as empty.",
|
|
29882
|
+
"store.unsupported-version": "The coordinator store has an unsupported version and is treated as empty.",
|
|
29883
|
+
"store.invalid-workspace": "An invalid coordinator workspace record was ignored.",
|
|
29884
|
+
"store.workflows-cleared": "The workflow store was full, so a batch of its oldest finished records was removed.",
|
|
29885
|
+
"store.workflows-in-use": "The workflow store was full and every record was still in use, so new work was refused.",
|
|
29886
|
+
"remote-worker.settle-failed": "A remote worker could not be settled."
|
|
29887
|
+
}
|
|
29888
|
+
}
|
|
29889
|
+
});
|
|
29890
|
+
|
|
29891
|
+
// ../protocol/src/log-vocabulary/review.ts
|
|
29892
|
+
var REVIEW_LOG_AREAS = defineLogAreas({
|
|
29893
|
+
review: {
|
|
29894
|
+
description: "Multi Review workflows: scheduling, graph runs and interactive fix sessions.",
|
|
29895
|
+
events: {
|
|
29896
|
+
"fix-tab.publish-failed": "A fix request was delivered but its tab could not be opened; the user is told.",
|
|
29897
|
+
"graph-run.not-started": "A workflow's graph run did not start.",
|
|
29898
|
+
"reconcile.scan-failed": "A reconciliation scan failed; the next scan retries.",
|
|
29899
|
+
"graph-engine.unavailable": "The graph engine is selected but unavailable, so the bespoke engine runs.",
|
|
29900
|
+
"graph-run.cancel-failed": "Cancelling a graph run failed; the next pass projects how it ended.",
|
|
29901
|
+
"delete.cleanup-failed": "A cleanup step after deleting a workflow failed; stale tabs reconcile away on hydration.",
|
|
29902
|
+
"fix-session.read-failed": "Reading an interactive fix session's state failed.",
|
|
29903
|
+
"fix-outcome.read-failed": "Reading an interactive fix's outcome failed; it stays pending.",
|
|
29904
|
+
"fix-usage.read-failed": "Reading a fix session's token usage failed.",
|
|
29905
|
+
"result.consume-deferred": "Consuming a workflow result failed; it stays staged and is retried.",
|
|
29906
|
+
"failure-triage.failed": "Classifying a review package's failing tests failed; the package is sealed without the triage and says so."
|
|
29907
|
+
}
|
|
29908
|
+
},
|
|
29909
|
+
"pull-request": {
|
|
29910
|
+
description: "Pull request monitoring, auto-merge and the `gh` reads behind them.",
|
|
29911
|
+
events: {
|
|
29912
|
+
"merged-state.persist-failed": "A merged pull request's state could not be saved; GitHub stays authoritative and cleanup goes on.",
|
|
29913
|
+
"refresh.failed": "A pull request could not be refreshed; the armed flag stands.",
|
|
29914
|
+
"arm.track-failed": "An armed environment could not be tracked; the monitor's next sync retries.",
|
|
29915
|
+
"gh.pr-list-unparseable": "`gh pr list` returned nothing that parses. Sizes only, never the output.",
|
|
29916
|
+
"monitor.start-failed": "Monitoring could not start for a newly opened pull request.",
|
|
29917
|
+
"cleanup-scheduler.missing": "A merged pull request was seen, but this runtime has no merge cleanup scheduler.",
|
|
29918
|
+
"auto-merge.evaluation-failed": "Evaluating an environment for auto-merge failed.",
|
|
29919
|
+
"auto-merge.merge-failed": "Auto-merge could not merge a pull request; the attempt is held and retried.",
|
|
29920
|
+
"auto-merge.resolve-failed": "Auto-merge could not launch Resolve for a pull request; the attempt is held and retried.",
|
|
29921
|
+
"monitor.detection-failed": "Checking an environment for its pull request failed.",
|
|
29922
|
+
"monitor.detection-admission-failed": "A pull request check could not be admitted to the work pool.",
|
|
29923
|
+
"monitor.terminal-repair-failed": "Repairing a merged or closed pull request's side effects failed.",
|
|
29924
|
+
"monitor.terminal-resume-failed": "Resuming a merged or closed pull request's side effects failed.",
|
|
29925
|
+
"monitor.stale-reading-ignored": "A non-merged reading (`state`) for a pull request already merged was ignored as stale.",
|
|
29926
|
+
"monitor.state-persist-failed": "A pull request's observed state could not be saved.",
|
|
29927
|
+
"monitor.state-clear-failed": "A pull request's saved state could not be cleared.",
|
|
29928
|
+
"monitor.task-reconcile-failed": "Updating the Kanban task of a merged or closed (`state`) pull request failed.",
|
|
29929
|
+
"monitor.task-store-failed": "A pull request could not be recorded on its Kanban task.",
|
|
29930
|
+
"monitor.emit-failed": "A pull request monitor event could not be emitted to its sink."
|
|
29931
|
+
}
|
|
29932
|
+
}
|
|
29933
|
+
});
|
|
29934
|
+
|
|
29935
|
+
// ../protocol/src/log-vocabulary/public-api.ts
|
|
29936
|
+
var PUBLIC_API_LOG_AREAS = defineLogAreas({
|
|
29937
|
+
"public-api": {
|
|
29938
|
+
description: "The public CLI's operations: their outcomes, reconciliation and exec workers.",
|
|
29939
|
+
events: {
|
|
29940
|
+
"outcome.record-failed": "A background operation's outcome could not be recorded; reconciliation settles it.",
|
|
29941
|
+
"goal-checks.stop-failed": "Goal checks could not be stopped.",
|
|
29942
|
+
"exec.list-failed": "Exec workers could not be listed.",
|
|
29943
|
+
"exec.cancel-failed": "An exec could not be cancelled.",
|
|
29944
|
+
"goal-workers.list-failed": "Goal check workers could not be listed.",
|
|
29945
|
+
"operation.reconcile-failed": "Reconciling one operation failed; the next pass retries.",
|
|
29946
|
+
"reconcile.pass-failed": "A reconciliation pass failed; the next one retries."
|
|
29947
|
+
}
|
|
29948
|
+
}
|
|
29949
|
+
});
|
|
29950
|
+
|
|
29951
|
+
// ../protocol/src/log-vocabulary/agent-accounts.ts
|
|
29952
|
+
var AGENT_ACCOUNTS_LOG_AREAS = defineLogAreas({
|
|
29953
|
+
"agent-accounts": {
|
|
29954
|
+
description: "Agent accounts: automatic switching, staged logins and plan usage.",
|
|
29955
|
+
events: {
|
|
29956
|
+
"switch-notice.failed": "A notice about an automatic account switch failed; the switch stands. `audience` says whose.",
|
|
29957
|
+
"auto-switch.check-failed": "An automatic account check failed; the next nudge retries.",
|
|
29958
|
+
"container-sync.failed": "Handing a login or account to a container failed; `step` says which part.",
|
|
29959
|
+
"last-usage.save-failed": "The last plan usage reading could not be saved; the next save retries.",
|
|
29960
|
+
"login-cleanup.failed": "A temporary login could not be cleaned up.",
|
|
29961
|
+
"login-refresh.deferred": "Containers were not told to refresh their login now; they reconcile from its durable generation."
|
|
29962
|
+
}
|
|
29963
|
+
}
|
|
29964
|
+
});
|
|
29965
|
+
|
|
29966
|
+
// ../protocol/src/log-vocabulary/docker.ts
|
|
29967
|
+
var DOCKER_LOG_AREAS = defineLogAreas({
|
|
29968
|
+
docker: {
|
|
29969
|
+
description: "Docker containers: lifecycle, starts, staged inputs and the login files they hold.",
|
|
29970
|
+
events: {
|
|
29971
|
+
"portable-inputs.relay-missing": "Docker is rootless and the image predates the staged-input relay, so the container cannot read them until rebuilt.",
|
|
29972
|
+
"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.",
|
|
29973
|
+
"opencode.warm-incomplete": "OpenCode did not finish loading /workspace in a container.",
|
|
29974
|
+
"login-keeper.pass-failed": "A Claude login keeper pass failed; the next interval retries.",
|
|
29975
|
+
"login-keeper.refresh-failed": "Refreshing the host Claude login failed. Fixed text: CLI output can hold credentials.",
|
|
29976
|
+
"login-keeper.refresh-not-extended": "Refreshing the host Claude login did not extend its expiry.",
|
|
29977
|
+
"login-keeper.refresh-check-failed": "Checking the host Claude login after a refresh failed.",
|
|
29978
|
+
"login-watcher.pass-failed": "A container login file watcher pass failed; the next one retries.",
|
|
29979
|
+
"lifecycle.record-failure-failed": "A failed container operation could not be recorded.",
|
|
29980
|
+
"lifecycle.reconcile-failed": "Reconciling one environment's container operation failed; the next pass retries.",
|
|
29981
|
+
"replacement.clear-terminals-failed": "Terminal sessions could not be cleared after a container replacement.",
|
|
29982
|
+
"recovery.clear-terminals-failed": "Terminal sessions could not be cleared after a recovery restore.",
|
|
29983
|
+
"github-ranges.seed-not-copied": "The GitHub ranges seed could not be copied into a container, so its firewall fetches them.",
|
|
29984
|
+
"availability.probe-failed": "Docker is not available; written when the diagnostic changes. Fixed-shape metadata only: messages can hold daemon endpoints.",
|
|
29985
|
+
"start.port-collision-retrying": "An automatic host port collided on start, so it is retried once with fresh ports."
|
|
29986
|
+
}
|
|
29987
|
+
},
|
|
29988
|
+
"docker.reachability": {
|
|
29989
|
+
description: "Whether agents in containers can reach the backend's agent tools server.",
|
|
29990
|
+
events: {
|
|
29991
|
+
"check.crashed": "A reachability check crashed.",
|
|
29992
|
+
"check.started": "A reachability check started.",
|
|
29993
|
+
"check.finished": "A reachability check finished.",
|
|
29994
|
+
"check.probe": "One probe of a finished check.",
|
|
29995
|
+
"check.summary": "Content-free status and reason for a check that did not find the host reachable.",
|
|
29996
|
+
"check.remediation": "One command the user can run to unblock containers.",
|
|
29997
|
+
"shutdown.awaiting-network": "Shutdown is waiting for probe network preparation.",
|
|
29998
|
+
"shutdown.cleanup-deferred": "Probe network cleanup waits until its preparation settles.",
|
|
29999
|
+
"shutdown.removing-resources": "Shutdown is removing probe resources.",
|
|
30000
|
+
"shutdown.container-remove-failed": "A probe container could not be removed at shutdown.",
|
|
30001
|
+
"shutdown.network-remove-failed": "The probe network could not be removed at shutdown.",
|
|
30002
|
+
"probe.skipped": "A container probe was skipped because the agent tools server is not listening.",
|
|
30003
|
+
"preflight.refused": "A stage was refused because its container cannot reach the host.",
|
|
30004
|
+
"probe.prepare-failed": "A container could not be prepared for a probe.",
|
|
30005
|
+
"probe.result": "The outcome of probing one container.",
|
|
30006
|
+
"probe.contradicts-host": "A container probe disagrees with the host status, so the host is rechecked.",
|
|
30007
|
+
"topology.detected": "The Docker topology was read.",
|
|
30008
|
+
"firewall.detected": "The host firewall was read.",
|
|
30009
|
+
"probe-network.remove-failed": "The probe network could not be removed.",
|
|
30010
|
+
"probe-network.create-failed": "The probe network could not be created, so only the default bridge is checked.",
|
|
30011
|
+
"event.emit-failed": "A reachability event could not be emitted.",
|
|
30012
|
+
"host-addresses.list-failed": "Host addresses could not be listed.",
|
|
30013
|
+
"probe-image.present": "The probe image is already present.",
|
|
30014
|
+
"probe-image.pulling": "The probe image is being pulled.",
|
|
30015
|
+
"probe-image.pulled": "The probe image was pulled.",
|
|
30016
|
+
"probe-image.pull-failed": "The probe image could not be pulled.",
|
|
30017
|
+
"probe-image.fallback": "The environment image is used as the probe image.",
|
|
30018
|
+
"probe-image.missing": "No probe image is available.",
|
|
30019
|
+
"network.list-failed": "Docker networks could not be listed.",
|
|
30020
|
+
"network.inspect-failed": "A Docker network could not be inspected.",
|
|
30021
|
+
"stale-containers.removing": "Stale probe containers are being removed.",
|
|
30022
|
+
"stale-networks.removing": "Stale probe networks are being removed."
|
|
30023
|
+
}
|
|
30024
|
+
}
|
|
30025
|
+
});
|
|
30026
|
+
|
|
30027
|
+
// ../protocol/src/log-vocabulary/mcp.ts
|
|
30028
|
+
var MCP_LOG_AREAS = defineLogAreas({
|
|
30029
|
+
"control-mcp": {
|
|
30030
|
+
description: "The Control MCP server other agents and devices reach Orkestrator through.",
|
|
30031
|
+
events: {
|
|
30032
|
+
"listener.port-free": "The Control MCP's fixed port is free again, so it is listening.",
|
|
30033
|
+
"state-listener.failed": "A Control MCP state listener threw; the others still run.",
|
|
30034
|
+
"delegation.remote-open-failed": "A delegation could not be opened on another node.",
|
|
30035
|
+
"delegation.open-failed": "A coordinator delegation could not be opened."
|
|
30036
|
+
}
|
|
30037
|
+
},
|
|
30038
|
+
"mcp-management": {
|
|
30039
|
+
description: "Managed MCP configuration: its commands, overlays and apply loop.",
|
|
30040
|
+
events: {
|
|
30041
|
+
"command.failed": "An MCP management command failed; `ref` is the correlation id shown to the user.",
|
|
30042
|
+
"overlay.materialise-failed": "An MCP overlay could not be written.",
|
|
30043
|
+
"apply.tick-failed": "An MCP apply tick failed; the next one retries."
|
|
30044
|
+
}
|
|
30045
|
+
}
|
|
30046
|
+
});
|
|
30047
|
+
|
|
30048
|
+
// ../protocol/src/log-vocabulary/design.ts
|
|
30049
|
+
var DESIGN_LOG_AREAS = defineLogAreas({
|
|
30050
|
+
design: {
|
|
30051
|
+
description: "The design canvas: its library, renderer and session links.",
|
|
30052
|
+
events: {
|
|
30053
|
+
"change-signal.failed": "A design change signal failed.",
|
|
30054
|
+
"library.index-write-failed": "The design library index could not be written.",
|
|
30055
|
+
"library.refresh-failed": "The design library could not be refreshed.",
|
|
30056
|
+
"renderer.problem": "The renderer hit a limit or lost a browser; `problem` is a fixed name.",
|
|
30057
|
+
"task.failed": "A design background task failed.",
|
|
30058
|
+
"canvas.needs-recovery": "A design canvas is unreadable and marked for recovery.",
|
|
30059
|
+
"startup.step-failed": "One part of design startup failed; `step` says which.",
|
|
30060
|
+
"legacy.retire-failed": "A migrated legacy design could not be retired.",
|
|
30061
|
+
"profiles.swept": "Design startup removed stale browser profiles.",
|
|
30062
|
+
"session-link.record-failed": "A closing conversation could not be recorded on a design link."
|
|
30063
|
+
}
|
|
30064
|
+
}
|
|
30065
|
+
});
|
|
30066
|
+
|
|
30067
|
+
// ../protocol/src/log-vocabulary/graph.ts
|
|
30068
|
+
var GRAPH_LOG_AREAS = defineLogAreas({
|
|
30069
|
+
graph: {
|
|
30070
|
+
description: "Graph runs: launches, passes, rewinds, system actions and templates.",
|
|
30071
|
+
events: {
|
|
30072
|
+
"describe.pass-failed": "A graph describe pass failed. Content-free: never the description or draft.",
|
|
30073
|
+
"system.stop-failed": "A system action's work could not be stopped.",
|
|
30074
|
+
"system.action-failed": "A system action failed; `cause` is its fixed failure cause.",
|
|
30075
|
+
"attention.update-failed": "The sidebar could not be updated for a run.",
|
|
30076
|
+
"launch.ticket-link-failed": "A launched run's ticket could not be linked.",
|
|
30077
|
+
"launch.started": "A graph run was launched.",
|
|
30078
|
+
"launch.swept": "Runs that ended without an environment were removed.",
|
|
30079
|
+
"rewind.pending": "A run's code rewind has not finished.",
|
|
30080
|
+
"rewind.applied": "A run was restarted or rewound.",
|
|
30081
|
+
"rewind.waiting": "A run waits for its code rewind to finish.",
|
|
30082
|
+
"history.pruned": "Finished runs beyond an environment's history were removed.",
|
|
30083
|
+
"history.prune-failed": "Pruning an environment's run history failed.",
|
|
30084
|
+
"worktree.cleanup-failed": "A run's branch worktree cleanup failed.",
|
|
30085
|
+
"run.unreadable": "A run is unreadable, so it is not scheduled.",
|
|
30086
|
+
"run.pass-failed": "A pass over a run failed.",
|
|
30087
|
+
"transcript.capture-failed": "A run's transcript capture failed.",
|
|
30088
|
+
"ticket.link-failed": "A run's ticket could not be linked to its environment.",
|
|
30089
|
+
"template.skipped": "A built-in template was skipped as invalid or a duplicate."
|
|
30090
|
+
}
|
|
30091
|
+
}
|
|
30092
|
+
});
|
|
30093
|
+
|
|
30094
|
+
// ../protocol/src/log-vocabulary/nodes.ts
|
|
30095
|
+
var NODES_LOG_AREAS = defineLogAreas({
|
|
30096
|
+
nodes: {
|
|
30097
|
+
description: "Command nodes: links, handovers, leaf mail and project copies.",
|
|
30098
|
+
events: {
|
|
30099
|
+
"actions.resume-failed": "Approved actions could not be resumed; a later pass retries.",
|
|
30100
|
+
"project-copy.notify-failed": "The coordinator could not be told a project copy finished.",
|
|
30101
|
+
"mail.delivery-deferred": "Leaf mail could not reach a coordinator yet.",
|
|
30102
|
+
"command.post-step-failed": "A step after a routed command failed.",
|
|
30103
|
+
"seed-files.incomplete": "Seed files for a leaf environment were not all copied.",
|
|
30104
|
+
"contact.record-failed": "The latest controller contact could not be recorded.",
|
|
30105
|
+
"settings.send-failed": "Settings could not be sent to a node.",
|
|
30106
|
+
"verification.record-failed": "A node verification could not be recorded.",
|
|
30107
|
+
"profile.record-failed": "A node profile could not be recorded.",
|
|
30108
|
+
"detach.unconfirmed": "A forgotten node has not confirmed the detach yet.",
|
|
30109
|
+
"handover.recovery-pending": "Command handover recovery is still pending."
|
|
30110
|
+
}
|
|
30111
|
+
}
|
|
30112
|
+
});
|
|
30113
|
+
|
|
30114
|
+
// ../protocol/src/log-vocabulary/linear.ts
|
|
30115
|
+
var LINEAR_LOG_AREAS = defineLogAreas({
|
|
30116
|
+
linear: {
|
|
30117
|
+
description: "Linear issues read for build actions.",
|
|
30118
|
+
events: {
|
|
30119
|
+
"comments.load-failed": "An issue's comments could not be loaded; the issue still renders without them."
|
|
30120
|
+
}
|
|
30121
|
+
}
|
|
30122
|
+
});
|
|
30123
|
+
|
|
30124
|
+
// ../protocol/src/log-vocabulary/usage-history.ts
|
|
30125
|
+
var USAGE_HISTORY_LOG_AREAS = defineLogAreas({
|
|
30126
|
+
"usage-history": {
|
|
30127
|
+
description: "Recorded agent token usage.",
|
|
30128
|
+
events: {
|
|
30129
|
+
"record.failed": "Agent usage could not be recorded; a later read counts it.",
|
|
30130
|
+
"prune.failed": "Pruning recorded usage failed; the next prune retries."
|
|
30131
|
+
}
|
|
30132
|
+
}
|
|
30133
|
+
});
|
|
30134
|
+
|
|
30135
|
+
// ../protocol/src/log-vocabulary/feature.ts
|
|
30136
|
+
var FEATURE_LOG_AREAS = defineLogAreas({
|
|
30137
|
+
feature: {
|
|
30138
|
+
description: "Pipeline environments started from a feature, and feature planning.",
|
|
30139
|
+
events: {
|
|
30140
|
+
"naming.fallback": "Automatic naming failed, so a local fallback name is used. Error kind only: the description stays out.",
|
|
30141
|
+
"planning.legacy-adopt-failed": "Legacy planning conversations could not be adopted.",
|
|
30142
|
+
"planning.tick-retrying": "A planning tick failed on a transient error; the next tick retries."
|
|
30143
|
+
}
|
|
30144
|
+
}
|
|
30145
|
+
});
|
|
30146
|
+
|
|
30147
|
+
// ../protocol/src/log-vocabulary/host.ts
|
|
30148
|
+
var HOST_LOG_AREAS = defineLogAreas({
|
|
30149
|
+
host: {
|
|
30150
|
+
description: "The host machine: its executables, load, suspends and maintenance.",
|
|
30151
|
+
events: {
|
|
30152
|
+
"path.discovered": "Executable discovery finished. Counts and booleans only: PATH entries can hold private directory names.",
|
|
30153
|
+
"tool.available": "A host tool's availability was read.",
|
|
30154
|
+
"tool.missing": "A host tool was not found.",
|
|
30155
|
+
"maintenance.listener-failed": "A host maintenance listener threw; the others still run.",
|
|
30156
|
+
"suspend.reconcile-failed": "Reconciling due work after a host suspension failed.",
|
|
30157
|
+
"load.sample-failed": "Sampling machine load failed; the next sample retries."
|
|
30158
|
+
}
|
|
30159
|
+
}
|
|
30160
|
+
});
|
|
30161
|
+
|
|
30162
|
+
// ../protocol/src/log-vocabulary/transcript-artifacts.ts
|
|
30163
|
+
var TRANSCRIPT_ARTIFACTS_LOG_AREAS = defineLogAreas({
|
|
30164
|
+
"transcript-artifacts": {
|
|
30165
|
+
description: "Transcript artifacts: previews, printing, grants and their ledger. Ids, kinds, sizes and reason codes only.",
|
|
30166
|
+
events: {
|
|
30167
|
+
"announce-failed": "An artifact change could not be announced.",
|
|
30168
|
+
"cleanup-failed": "An artifact cleanup failed.",
|
|
30169
|
+
"grant-revocation-failed": "A grant could not be revoked.",
|
|
30170
|
+
"ledger-listener-failed": "A ledger listener threw.",
|
|
30171
|
+
"ledger-read-failed": "The ledger could not be read.",
|
|
30172
|
+
"operation-executor-failed": "A preview operation's executor failed.",
|
|
30173
|
+
"operation-failed": "A preview operation failed.",
|
|
30174
|
+
"pdf-preview": "A PDF preview was served.",
|
|
30175
|
+
"pdf-preview-failed": "A PDF preview failed.",
|
|
30176
|
+
"pdf-print-failed": "Printing an artifact to PDF failed.",
|
|
30177
|
+
"pdf-printed": "An artifact was printed to PDF.",
|
|
30178
|
+
"runtime-unavailable": "The artifact runtime could not be created."
|
|
30179
|
+
}
|
|
30180
|
+
}
|
|
30181
|
+
});
|
|
30182
|
+
|
|
30183
|
+
// ../protocol/src/log-vocabulary/scheduler.ts
|
|
30184
|
+
var SCHEDULER_LOG_AREAS = defineLogAreas({
|
|
30185
|
+
scheduler: {
|
|
30186
|
+
description: "Scheduled jobs and the backend-owned timing that fires them.",
|
|
30187
|
+
events: {
|
|
30188
|
+
"tick.failed": "A scheduler tick failed; the next tick retries.",
|
|
30189
|
+
"job.claim-failed": "A due job could not be claimed.",
|
|
30190
|
+
"fire.heartbeat-failed": "A running fire's heartbeat could not be recorded.",
|
|
30191
|
+
"fire.outcome-record-failed": "A finished fire's outcome could not be recorded."
|
|
30192
|
+
}
|
|
30193
|
+
}
|
|
30194
|
+
});
|
|
30195
|
+
|
|
30196
|
+
// ../protocol/src/log-vocabulary/web-app.ts
|
|
30197
|
+
var WEB_APP_LOG_AREAS = defineLogAreas({
|
|
30198
|
+
"web.app": {
|
|
30199
|
+
description: "The application root: startup checks and restoring state.",
|
|
30200
|
+
events: {
|
|
30201
|
+
"config.load-failed": "The application config could not be loaded.",
|
|
30202
|
+
"docker.check-failed": "A Docker availability probe failed; the result stays unknown.",
|
|
30203
|
+
"docker.checked": "A Docker availability check finished.",
|
|
30204
|
+
"docker.orphans-cleared": "Reconciling with Docker cleared orphaned container references.",
|
|
30205
|
+
"docker.sync-failed": "Reconciling environments with Docker failed; non-fatal.",
|
|
30206
|
+
"prompt-queues.restore-failed": "An environment's prompt queues could not be restored.",
|
|
30207
|
+
"multi-reviews.restore-failed": "An environment's multi reviews could not be restored.",
|
|
30208
|
+
"build-pipelines.migrate-failed": "Migrating legacy build pipelines failed; the next launch retries.",
|
|
30209
|
+
"build-pipelines.restore-failed": "A project's build pipelines could not be restored.",
|
|
30210
|
+
"macos-permissions.check-failed": "Reading macOS file permission status failed.",
|
|
30211
|
+
"cli-check.failed": "One startup CLI check failed; its result stays unknown.",
|
|
30212
|
+
"cli-check.completed": "A startup CLI check finished; one line per tool.",
|
|
30213
|
+
"cli-check.retried": "A user-requested CLI recheck finished.",
|
|
30214
|
+
"cli-check.retry-failed": "A user-requested CLI recheck failed.",
|
|
30215
|
+
"exit.failed": "Exiting through the plugin failed; the window closes instead.",
|
|
30216
|
+
"zoom.native-failed": "Applying native zoom failed; the CSS fallback is used.",
|
|
30217
|
+
"github-cli.status-failed": "Reading the GitHub CLI setup status failed.",
|
|
30218
|
+
"attachments.restore-failed": "Saved prompt attachments could not be restored before startup.",
|
|
30219
|
+
"startup-launch.persist-failed": "Saving the startup agent launch failed; nothing started.",
|
|
30220
|
+
"environment.start-failed": "Starting an environment from the terminal overlay failed.",
|
|
30221
|
+
"project.delete-failed": "Deleting a project from its dialog failed."
|
|
30222
|
+
}
|
|
30223
|
+
},
|
|
30224
|
+
"web.session": {
|
|
30225
|
+
description: "The renderer's terminal and agent session store.",
|
|
30226
|
+
events: {
|
|
30227
|
+
"status.update-failed": "A session status change could not be saved.",
|
|
30228
|
+
"activity.update-failed": "A best-effort session activity update failed.",
|
|
30229
|
+
"environment-sessions.disconnect-failed": "Disconnecting an environment's sessions failed.",
|
|
30230
|
+
"container-sessions.sync-failed": "Syncing sessions with container state failed.",
|
|
30231
|
+
"reorder.failed": "Reordering sessions failed; the list reloads from the backend.",
|
|
30232
|
+
"refresh.manual-failed": "A manual refresh of an agent tab failed."
|
|
30233
|
+
}
|
|
30234
|
+
},
|
|
30235
|
+
"web.action-bar": {
|
|
30236
|
+
description: "The environment action bar.",
|
|
30237
|
+
events: {
|
|
30238
|
+
"editor.open-failed": "The external editor could not be opened.",
|
|
30239
|
+
"run-commands.read-failed": "Reading the project's run commands file failed.",
|
|
30240
|
+
"environment.delete-failed": "Deleting an environment from the action bar failed.",
|
|
30241
|
+
"merge.started": "A user-requested PR merge started.",
|
|
30242
|
+
"merge.completed": "A user-requested PR merge command returned.",
|
|
30243
|
+
"merge.failed": "A user-requested PR merge failed."
|
|
30244
|
+
}
|
|
30245
|
+
}
|
|
30246
|
+
});
|
|
30247
|
+
|
|
30248
|
+
// ../protocol/src/log-vocabulary/web-build-pipeline.ts
|
|
30249
|
+
var WEB_BUILD_PIPELINE_LOG_AREAS = defineLogAreas({
|
|
30250
|
+
"web.build-pipeline": {
|
|
30251
|
+
description: "Build pipelines as the renderer starts, hydrates and shows them.",
|
|
30252
|
+
events: {
|
|
30253
|
+
"build.start-failed": "A build could not be started.",
|
|
30254
|
+
"pipeline.hydrate-failed": "A pipeline read failed; source says who asked for it.",
|
|
30255
|
+
"pipeline.project-mismatch": "A pending tab activation was dropped: wrong project.",
|
|
30256
|
+
"environment.not-found": "A build's environment read returned nothing after creation.",
|
|
30257
|
+
"environment.project-mismatch": "A build's environment was not added: wrong project.",
|
|
30258
|
+
"environment.hydrate-failed": "A build's environment read failed; live sync can recover.",
|
|
30259
|
+
"transcript.load-failed": "A stage transcript read failed and will retry with backoff.",
|
|
30260
|
+
"legacy.state-too-large": "Legacy pipeline state was over the limit and skipped.",
|
|
30261
|
+
"opencode-catalog.load-failed": "The cached OpenCode model list could not be loaded.",
|
|
30262
|
+
"opencode-preferences.load-failed": "OpenCode model preferences could not be loaded."
|
|
30263
|
+
}
|
|
30264
|
+
}
|
|
30265
|
+
});
|
|
30266
|
+
|
|
30267
|
+
// ../protocol/src/log-vocabulary/web-chat.ts
|
|
30268
|
+
var WEB_CHAT_LOG_AREAS = defineLogAreas({
|
|
30269
|
+
"web.chat": {
|
|
30270
|
+
description: "Rendering the agent transcript: messages, rich blocks and question cards.",
|
|
30271
|
+
events: {
|
|
30272
|
+
"message.copy-failed": "A message could not be copied to the clipboard.",
|
|
30273
|
+
"message.long-press-failed": "A user message's long-press action failed.",
|
|
30274
|
+
"message.link-open-failed": "A link in a message could not be opened.",
|
|
30275
|
+
"message.render-failed": "One transcript row failed to render; fields are the bounded diagnostic.",
|
|
30276
|
+
"image-preview.load-failed": "An image in a message could not be loaded for preview.",
|
|
30277
|
+
"session-list.load-failed": "The resume dialog could not fetch the resumable sessions.",
|
|
30278
|
+
"question.submit-failed": "An answer to an agent's question could not be submitted.",
|
|
30279
|
+
"question.dismiss-failed": "An agent's question could not be dismissed.",
|
|
30280
|
+
"rich-block.render-failed": "A rich block's renderer failed and its source is shown instead.",
|
|
30281
|
+
"rich-block.copy-failed": "A rich block's copy action could not write to the clipboard.",
|
|
30282
|
+
"scroll-viewport.not-found": "The scroll viewport was still missing when polling for it ended."
|
|
30283
|
+
}
|
|
30284
|
+
},
|
|
30285
|
+
"web.native-agent": {
|
|
30286
|
+
description: "The native agent tab and its composer.",
|
|
30287
|
+
events: {
|
|
30288
|
+
"model-catalogue.load-failed": "The native model catalogue could not be loaded.",
|
|
30289
|
+
"provider-lock.persist-failed": "The locked agent choice could not be saved.",
|
|
30290
|
+
"compose-draft.persist-failed": "A compose draft could not be saved.",
|
|
30291
|
+
"compose-draft.restore-failed": "A saved compose draft could not be restored.",
|
|
30292
|
+
"compose-draft.discard-failed": "A saved compose draft could not be discarded.",
|
|
30293
|
+
"paste.failed": "Pasting an image into a composer failed unexpectedly.",
|
|
30294
|
+
"agent-state.listen-failed": "Subscribing to a tab's agent state events failed.",
|
|
30295
|
+
"model-favorites.persist-failed": "The favorite model list could not be saved."
|
|
30296
|
+
}
|
|
30297
|
+
}
|
|
30298
|
+
});
|
|
30299
|
+
|
|
30300
|
+
// ../protocol/src/log-vocabulary/web-claude-tmux.ts
|
|
30301
|
+
var WEB_CLAUDE_TMUX_LOG_AREAS = defineLogAreas({
|
|
30302
|
+
"web.claude-tmux": {
|
|
30303
|
+
description: "The renderer's Claude tmux chat tab and interactive terminal.",
|
|
30304
|
+
events: {
|
|
30305
|
+
"sessions.list-failed": "The resume dialog could not list tmux sessions.",
|
|
30306
|
+
"tab.hydrate-failed": "Reading a tab's tmux session from the backend failed.",
|
|
30307
|
+
"models.catalog-unavailable": "The model catalogue failed; the bundled fallback stays.",
|
|
30308
|
+
"queue.promote-failed": "After an interrupt, the next queued prompt did not become the draft.",
|
|
30309
|
+
"files.load-failed": "The file list for @mentions could not be loaded.",
|
|
30310
|
+
"clipboard.image-failed": "An image pasted into the interactive terminal could not be saved.",
|
|
30311
|
+
"terminal.resize-failed": "Resizing the interactive terminal's session failed.",
|
|
30312
|
+
"terminal.recover-failed": "The interactive terminal could not reattach to its session."
|
|
30313
|
+
}
|
|
30314
|
+
}
|
|
30315
|
+
});
|
|
30316
|
+
|
|
30317
|
+
// ../protocol/src/log-vocabulary/web-design.ts
|
|
30318
|
+
var WEB_DESIGN_LOG_AREAS = defineLogAreas({
|
|
30319
|
+
"web.design": {
|
|
30320
|
+
description: "Opening design canvas tabs.",
|
|
30321
|
+
events: {
|
|
30322
|
+
"tab.duplicate-refused": "A design tab was not opened because its id is already in use."
|
|
30323
|
+
}
|
|
30324
|
+
}
|
|
30325
|
+
});
|
|
30326
|
+
|
|
30327
|
+
// ../protocol/src/log-vocabulary/web-environment.ts
|
|
30328
|
+
var WEB_ENVIRONMENT_LOG_AREAS = defineLogAreas({
|
|
30329
|
+
"web.environment": {
|
|
30330
|
+
description: "Environment lifecycle and dialogs as the renderer drives them.",
|
|
30331
|
+
events: {
|
|
30332
|
+
"start.called": "The renderer was asked to start an environment.",
|
|
30333
|
+
"start.unknown-environment": "A start was requested for an id the store does not hold.",
|
|
30334
|
+
"start.snapshot-read": "An environment's state as its start began.",
|
|
30335
|
+
"start.status-set": "The environment was marked as creating before the backend call.",
|
|
30336
|
+
"start.background-requested": "A start is being handed to the backend to run in background.",
|
|
30337
|
+
"start.backend-requested": "A foreground start call to the backend is being made.",
|
|
30338
|
+
"start.backend-completed": "The backend finished a foreground start.",
|
|
30339
|
+
"start.environment-refreshed": "An environment was read back after a foreground start.",
|
|
30340
|
+
"start.worktree-missing": "A local environment started with no worktree path.",
|
|
30341
|
+
"start.failed": "Starting an environment from the renderer failed.",
|
|
30342
|
+
"stop.called": "The renderer was asked to stop an environment.",
|
|
30343
|
+
"stop.status-set": "The environment's status was set while stopping it.",
|
|
30344
|
+
"stop.backend-requested": "A stop call to the backend is being made.",
|
|
30345
|
+
"stop.backend-completed": "The backend finished a stop.",
|
|
30346
|
+
"stop.sessions-disconnecting": "A stopped environment's sessions are being disconnected.",
|
|
30347
|
+
"stop.sessions-disconnected": "A stopped environment's sessions were disconnected.",
|
|
30348
|
+
"stop.failed": "Stopping an environment from the renderer failed.",
|
|
30349
|
+
"restart.failed": "Restarting an environment from the renderer failed.",
|
|
30350
|
+
"status-sync.failed": "An environment's status could not be synced from the backend.",
|
|
30351
|
+
"list.refresh-failed": "A background refresh of a project's environments failed.",
|
|
30352
|
+
"setup-snapshot.reconcile-failed": "An environment's setup state could not be reconciled.",
|
|
30353
|
+
"rename.received": "An environment-renamed event arrived.",
|
|
30354
|
+
"rename.pr-state-cleared": "A rename changed the branch, so stale PR state was cleared.",
|
|
30355
|
+
"unread.clear-failed": "An environment's unread work could not be cleared on the backend.",
|
|
30356
|
+
"create.failed": "Creating an environment from the dialog failed.",
|
|
30357
|
+
"create.port-mappings-invalid": "Creation was refused: a port is not between 1 and 65535.",
|
|
30358
|
+
"create.attachment-read-failed": "A file dropped on the create dialog could not be read.",
|
|
30359
|
+
"auto-start.failed": "A background start after creating an environment was rejected.",
|
|
30360
|
+
"models.pi-seed-failed": "The create dialog could not seed the Pi model catalogue.",
|
|
30361
|
+
"models.opencode-cache-load-failed": "The create dialog could not read cached OpenCode models.",
|
|
30362
|
+
"github-credential.check-failed": "The GitHub credential check before creating failed.",
|
|
30363
|
+
"feature-build.start-failed": "Starting a pipeline environment from the dialog failed.",
|
|
30364
|
+
"settings.extensions-load-failed": "The settings dialog could not load extensions.",
|
|
30365
|
+
"settings.container-reset-failed": "The settings dialog could not reset the container.",
|
|
30366
|
+
"settings.save-failed": "The settings dialog could not save.",
|
|
30367
|
+
"domains.test-failed": "Testing whether network whitelist domains resolve failed.",
|
|
30368
|
+
"network-whitelist.save-failed": "The network whitelist dialog could not save."
|
|
30369
|
+
}
|
|
30370
|
+
},
|
|
30371
|
+
"web.sidebar": {
|
|
30372
|
+
description: "The project and environment sidebar.",
|
|
30373
|
+
events: {
|
|
30374
|
+
"reorder.persist-failed": "A sidebar reorder could not be saved.",
|
|
30375
|
+
"fork.failed": "Forking an environment from the sidebar failed.",
|
|
30376
|
+
"auto-start.started": "Selecting an unstarted local environment is starting it.",
|
|
30377
|
+
"auto-start.failed": "Starting a local environment on selection failed.",
|
|
30378
|
+
"environment.stop-failed": "Stopping a selected environment failed.",
|
|
30379
|
+
"environment.restart-failed": "Restarting a selected environment failed.",
|
|
30380
|
+
"environment.delete-failed": "Deleting an environment from the sidebar failed.",
|
|
30381
|
+
"environments.load-failed": "A project's environments could not be loaded for the sidebar.",
|
|
30382
|
+
"project.add-failed": "Adding a project from the sidebar failed.",
|
|
30383
|
+
"project.create-failed": "Creating a project from scratch failed.",
|
|
30384
|
+
"project.delete-failed": "Deleting a project from the sidebar failed.",
|
|
30385
|
+
"folder.project-remove-failed": "A project could not be removed from its folder.",
|
|
30386
|
+
"folder.rename-failed": "A project folder could not be renamed.",
|
|
30387
|
+
"folder.ungroup-failed": "A project folder could not be removed.",
|
|
30388
|
+
"folder.sort-failed": "A project folder could not be sorted."
|
|
30389
|
+
}
|
|
30390
|
+
},
|
|
30391
|
+
"web.docker": {
|
|
30392
|
+
description: "The Docker settings view.",
|
|
30393
|
+
events: {
|
|
30394
|
+
"data.load-failed": "Container or image data could not be loaded.",
|
|
30395
|
+
"container.stop-failed": "Stopping a container from Docker settings failed.",
|
|
30396
|
+
"container.delete-failed": "Deleting a container from Docker settings failed.",
|
|
30397
|
+
"container.reattach-failed": "Reattaching a container to a project failed."
|
|
30398
|
+
}
|
|
30399
|
+
},
|
|
30400
|
+
"web.project": {
|
|
30401
|
+
description: "Adding a project from the renderer.",
|
|
30402
|
+
events: {
|
|
30403
|
+
"directory-picker.failed": "The directory picker could not be opened.",
|
|
30404
|
+
"git-remote.read-failed": "A chosen directory's git remote could not be read."
|
|
30405
|
+
}
|
|
30406
|
+
}
|
|
30407
|
+
});
|
|
30408
|
+
|
|
30409
|
+
// ../protocol/src/log-vocabulary/web-files.ts
|
|
30410
|
+
var WEB_FILES_LOG_AREAS = defineLogAreas({
|
|
30411
|
+
"web.files": {
|
|
30412
|
+
description: "The files panel, file viewer and file search.",
|
|
30413
|
+
events: {
|
|
30414
|
+
"file.save-failed": "A file could not be saved.",
|
|
30415
|
+
"git-changes.load-failed": "The files panel could not load the git changes.",
|
|
30416
|
+
"file-tree.load-failed": "The file tree could not be loaded.",
|
|
30417
|
+
"changes.refresh-failed": "Refreshing the files panel's changes failed.",
|
|
30418
|
+
"folder.load-failed": "An expanded folder's contents could not be loaded.",
|
|
30419
|
+
"path.copy-failed": "A file's path could not be copied to the clipboard.",
|
|
30420
|
+
"draft.persist-failed": "A file viewer tab's draft could not be saved.",
|
|
30421
|
+
"draft.restore-failed": "A file viewer tab's saved draft could not be restored.",
|
|
30422
|
+
"draft.discard-failed": "A file's saved draft could not be discarded before a reload."
|
|
30423
|
+
}
|
|
30424
|
+
}
|
|
30425
|
+
});
|
|
30426
|
+
|
|
30427
|
+
// ../protocol/src/log-vocabulary/web-github.ts
|
|
30428
|
+
var WEB_GITHUB_LOG_AREAS = defineLogAreas({
|
|
30429
|
+
"web.github": {
|
|
30430
|
+
description: "Pull request and GitHub issue views.",
|
|
30431
|
+
events: {
|
|
30432
|
+
"pull-request.url-failed": "A pull request's URL could not be read.",
|
|
30433
|
+
"pull-request.mode-request-failed": "The pull request monitor refused a watch mode request.",
|
|
30434
|
+
"pull-request.copy-failed": "A pull request value could not be copied to the clipboard.",
|
|
30435
|
+
"comment-edit-draft.clear-failed": "An edited comment's saved draft could not be cleared.",
|
|
30436
|
+
"issue-draft.clear-failed": "An edited issue's saved drafts could not be cleared.",
|
|
30437
|
+
"comment-draft.clear-failed": "A posted comment's draft could not be cleared."
|
|
30438
|
+
}
|
|
30439
|
+
},
|
|
30440
|
+
"web.linear": {
|
|
30441
|
+
description: "The Linear tickets view.",
|
|
30442
|
+
events: {
|
|
30443
|
+
"comment-draft.clear-failed": "A posted comment's draft could not be cleared."
|
|
30444
|
+
}
|
|
30445
|
+
}
|
|
30446
|
+
});
|
|
30447
|
+
|
|
30448
|
+
// ../protocol/src/log-vocabulary/web-kanban.ts
|
|
30449
|
+
var WEB_KANBAN_LOG_AREAS = defineLogAreas({
|
|
30450
|
+
"web.kanban": {
|
|
30451
|
+
description: "The Kanban board, its task dialog and project notes.",
|
|
30452
|
+
events: {
|
|
30453
|
+
"tasks.load-failed": "A project's tasks could not be loaded.",
|
|
30454
|
+
"task.add-failed": "A new task could not be added.",
|
|
30455
|
+
"task.update-failed": "A task's fields could not be updated.",
|
|
30456
|
+
"task.content-update-failed": "A task's content edit could not be saved.",
|
|
30457
|
+
"task.build-status-clear-failed": "A task's build status could not be cleared.",
|
|
30458
|
+
"task.delete-failed": "A task could not be deleted.",
|
|
30459
|
+
"task.move-failed": "A task move failed and its status was rolled back.",
|
|
30460
|
+
"comment.add-failed": "A comment could not be added to a task.",
|
|
30461
|
+
"comment.delete-failed": "A comment could not be deleted from a task.",
|
|
30462
|
+
"image.add-failed": "An image could not be added to a task.",
|
|
30463
|
+
"image.delete-failed": "An image could not be deleted from a task.",
|
|
30464
|
+
"notes.load-failed": "Project notes could not be loaded; the editor stays disabled.",
|
|
30465
|
+
"notes.save-failed": "Project notes could not be saved.",
|
|
30466
|
+
"notes.draft-retained": "A notes save failed; the edit stays in its durable draft.",
|
|
30467
|
+
"draft.restore-failed": "A saved create-task draft could not be restored.",
|
|
30468
|
+
"draft.persist-failed": "A create-task draft could not be saved; phase says when.",
|
|
30469
|
+
"draft.discard-failed": "A create-task draft could not be removed; phase says when.",
|
|
30470
|
+
"build.start-failed": "The task dialog could not start a build for a task.",
|
|
30471
|
+
"build.create-and-start-failed": "The task dialog could not create a task and build it."
|
|
30472
|
+
}
|
|
30473
|
+
},
|
|
30474
|
+
"web.feature-plan": {
|
|
30475
|
+
description: "Feature planning in the renderer.",
|
|
30476
|
+
events: {
|
|
30477
|
+
"features.load-failed": "A project's features could not be loaded.",
|
|
30478
|
+
"feature.create-failed": "A new feature could not be created.",
|
|
30479
|
+
"feature.update-failed": "A feature could not be updated.",
|
|
30480
|
+
"build.claim-failed": "A feature's build could not be claimed for a task.",
|
|
30481
|
+
"build.start-failed": "Starting a build from a feature failed.",
|
|
30482
|
+
"message.append-failed": "A message could not be added to a feature's chat.",
|
|
30483
|
+
"story-message.append-failed": "A message could not be added to a story's chat.",
|
|
30484
|
+
"planning.start-failed": "Feature planning could not be started.",
|
|
30485
|
+
"planning.retry-failed": "Feature planning could not be retried.",
|
|
30486
|
+
"planning.cancel-failed": "Feature planning could not be cancelled.",
|
|
30487
|
+
"drafts.persist-failed": "A project's feature chat drafts could not be saved.",
|
|
30488
|
+
"drafts.restore-failed": "A project's feature chat drafts could not be restored."
|
|
30489
|
+
}
|
|
30490
|
+
}
|
|
30491
|
+
});
|
|
30492
|
+
|
|
30493
|
+
// ../protocol/src/log-vocabulary/web-pane-layout.ts
|
|
30494
|
+
var WEB_PANE_LAYOUT_LOG_AREAS = defineLogAreas({
|
|
30495
|
+
"web.pane-layout": {
|
|
30496
|
+
description: "Panes and tabs in the renderer: moves, splits, teardown and saved layouts.",
|
|
30497
|
+
events: {
|
|
30498
|
+
"persist.failed": "A pane layout could not be written to the backend.",
|
|
30499
|
+
"persist.install-skipped": "A saved layout was not installed: its dependencies did not load.",
|
|
30500
|
+
"persist.settled-handler-failed": "A write-settled handler threw; later handlers still ran.",
|
|
30501
|
+
"environment.activated": "The active environment changed.",
|
|
30502
|
+
"environment.initialized": "An environment's pane state was initialized.",
|
|
30503
|
+
"environment.initialize-skipped": "Initialize was called with no active environment.",
|
|
30504
|
+
"environment.terminals-cleared": "A reset cleared the environment's terminal instances.",
|
|
30505
|
+
"terminal-session.cleanup-started": "A closed tab's terminal session is being cleaned up.",
|
|
30506
|
+
"teardown.pending": "A tab teardown was rejected; the backend keeps it pending and retries.",
|
|
30507
|
+
"browser-preview.destroy-failed": "Destroying a closed browser tab's preview failed.",
|
|
30508
|
+
"handoffs.prune-failed": "Pruning unreferenced agent handoffs failed.",
|
|
30509
|
+
"tab.reactivated": "A tab added twice was activated in its existing pane instead.",
|
|
30510
|
+
"tab.move-started": "A tab move passed its checks and is being applied.",
|
|
30511
|
+
"tab.move-failed": "A tab move was refused; `reason` says which lookup failed.",
|
|
30512
|
+
"tab.initial-prompt-cleared": "A tab's initial prompt was cleared.",
|
|
30513
|
+
"tab.initial-agent-options-cleared": "A tab's initial agent options were cleared.",
|
|
30514
|
+
"pane.split-depth-reached": "A split was refused at the maximum split depth.",
|
|
30515
|
+
"pane.edge-split-started": "An edge split passed its checks and is being applied.",
|
|
30516
|
+
"pane.edge-split-failed": "An edge split was refused; `reason` says which lookup failed.",
|
|
30517
|
+
"pane.close-refused": "Closing the only pane in a layout was refused.",
|
|
30518
|
+
"draft.discard-failed": "A closing tab's draft could not be discarded; the tab stayed open.",
|
|
30519
|
+
"draft.file-conflict-resolve-failed": "Discarding a newer saved file draft failed.",
|
|
30520
|
+
"draft.compose-conflict-resolve-failed": "Discarding a newer saved compose draft failed."
|
|
30521
|
+
}
|
|
30522
|
+
}
|
|
30523
|
+
});
|
|
30524
|
+
|
|
30525
|
+
// ../protocol/src/log-vocabulary/web-settings.ts
|
|
30526
|
+
var WEB_SETTINGS_LOG_AREAS = defineLogAreas({
|
|
30527
|
+
"web.settings": {
|
|
30528
|
+
description: "The settings screens.",
|
|
30529
|
+
events: {
|
|
30530
|
+
"config.save-failed": "Global settings could not be saved.",
|
|
30531
|
+
"config.load-failed": "The settings page could not load the config.",
|
|
30532
|
+
"config.reload-failed": "Re-reading the workspace config after a save failed.",
|
|
30533
|
+
"domains.test-failed": "The domain resolution test could not run.",
|
|
30534
|
+
"github-credentials.propagate-failed": "Propagating GitHub credentials to environments failed.",
|
|
30535
|
+
"credential.save-failed": "A credential could not be saved.",
|
|
30536
|
+
"credential.clear-failed": "A credential could not be cleared.",
|
|
30537
|
+
"gateway-token.save-failed": "The gateway token could not be saved.",
|
|
30538
|
+
"gateway-token.copy-failed": "Copying the gateway token to the clipboard failed.",
|
|
30539
|
+
"web-client-url.copy-failed": "Copying the web client address to the clipboard failed.",
|
|
30540
|
+
"backend-version.read-failed": "The debug tab could not read the backend version.",
|
|
30541
|
+
"messaging.flush-failed": "Saving pending messaging settings on unmount failed.",
|
|
30542
|
+
"directory-picker.failed": "The repository directory picker could not open.",
|
|
30543
|
+
"file-picker.failed": "The repository file picker could not open.",
|
|
30544
|
+
"repository.save-failed": "Repository settings could not be saved.",
|
|
30545
|
+
"model-catalogues.read-failed": "Reading the model catalogues for settings failed."
|
|
30546
|
+
}
|
|
30547
|
+
}
|
|
30548
|
+
});
|
|
30549
|
+
|
|
30550
|
+
// ../protocol/src/log-vocabulary/web-shell.ts
|
|
30551
|
+
var WEB_SHELL_LOG_AREAS = defineLogAreas({
|
|
30552
|
+
"web.startup": {
|
|
30553
|
+
description: "Loading the renderer, after the desktop connection check.",
|
|
30554
|
+
events: {
|
|
30555
|
+
"renderer.load-failed": "Importing or mounting the application failed.",
|
|
30556
|
+
"model-catalogue.restore-failed": "The cached model catalogue could not be restored; bundled fallbacks stay in use."
|
|
30557
|
+
}
|
|
30558
|
+
},
|
|
30559
|
+
"web.window": {
|
|
30560
|
+
description: "Errors nothing in the renderer caught. Bug reports classify these two lines.",
|
|
30561
|
+
events: {
|
|
30562
|
+
"error.unhandled": "A window error event reached the bootstrap handler.",
|
|
30563
|
+
"rejection.unhandled": "A promise rejected with no handler."
|
|
30564
|
+
}
|
|
30565
|
+
},
|
|
30566
|
+
"web.react": {
|
|
30567
|
+
description: "React's root error callbacks and the lazy view boundary.",
|
|
30568
|
+
events: {
|
|
30569
|
+
"root.caught-error": "An error boundary caught a render error.",
|
|
30570
|
+
"root.uncaught-error": "A render error reached the root with no boundary.",
|
|
30571
|
+
"root.recoverable-error": "React recovered from a render error by retrying.",
|
|
30572
|
+
"lazy-view.failed": "A lazily loaded view failed; fields are the bounded diagnostic."
|
|
30573
|
+
}
|
|
30574
|
+
}
|
|
30575
|
+
});
|
|
30576
|
+
|
|
30577
|
+
// ../protocol/src/log-vocabulary/web-sync.ts
|
|
30578
|
+
var WEB_SYNC_LOG_AREAS = defineLogAreas({
|
|
30579
|
+
"web.resource-sync": {
|
|
30580
|
+
description: "Keeping renderer stores current with backend resources.",
|
|
30581
|
+
events: {
|
|
30582
|
+
"handler.threw": "A resource change handler threw; other handlers still ran.",
|
|
30583
|
+
"resync-handler.threw": "A resync handler threw; the resync counts as failed.",
|
|
30584
|
+
"view-safety-check.threw": "A view safety check handler threw; the others still ran.",
|
|
30585
|
+
"snapshots.batch-failed": "A scoped snapshot batch failed; individual reads take over.",
|
|
30586
|
+
"manifest.scoped-check-failed": "The scoped manifest read failed; a full resync runs.",
|
|
30587
|
+
"manifest.check-failed": "The manifest read failed; a full resync runs.",
|
|
30588
|
+
"subscribe.failed": "Subscribing to a resource transport event failed.",
|
|
30589
|
+
"change.malformed": "A resource-changed payload had the wrong shape and was dropped.",
|
|
30590
|
+
"config.refresh-failed": "Refreshing the config store after a change failed.",
|
|
30591
|
+
"pane-layout.refresh-failed": "Refreshing an environment's pane layout failed.",
|
|
30592
|
+
"setup-completion.observe-failed": "Subscribing to setup completion events failed.",
|
|
30593
|
+
"resync.project-failed": "The authoritative project read failed during a store resync.",
|
|
30594
|
+
"resync.environment-failed": "The authoritative environment read failed during a resync.",
|
|
30595
|
+
"resync.read-failed": "One of a store resync's per-environment reads failed.",
|
|
30596
|
+
"resync.pane-failed": "A pane layout read failed during a store resync.",
|
|
30597
|
+
"agent-mail.summary-refresh-failed": "Refreshing the agent mail summary failed.",
|
|
30598
|
+
"agent-mail.mailbox-refresh-failed": "Refreshing one agent mailbox failed.",
|
|
30599
|
+
"prompt-queues.refresh-failed": "Refreshing an environment's prompt queues failed.",
|
|
30600
|
+
"build-pipeline.refresh-failed": "Refreshing one build pipeline failed.",
|
|
30601
|
+
"multi-review.refresh-failed": "Refreshing one multi review workflow failed.",
|
|
30602
|
+
"authoritative.resync-failed": "Re-reading a snapshot after a stream reconnect failed.",
|
|
30603
|
+
"observation.listener-threw": "A native observation invalidation listener threw.",
|
|
30604
|
+
"observation.subscribe-failed": "Subscribing to native observation events failed.",
|
|
30605
|
+
"hydration.status-listener-failed": "A bounded hydration status listener threw.",
|
|
30606
|
+
"hydration.notification-failed": "A bounded hydration change notification threw."
|
|
30607
|
+
}
|
|
30608
|
+
},
|
|
30609
|
+
"web.read-coordinator": {
|
|
30610
|
+
description: "The renderer's coalesced, bounded backend reads.",
|
|
30611
|
+
events: {
|
|
30612
|
+
"listener.threw": "A read state listener threw.",
|
|
30613
|
+
"read.settle-failed": "Applying a finished read's result threw."
|
|
30614
|
+
}
|
|
30615
|
+
},
|
|
30616
|
+
"web.gateway": {
|
|
30617
|
+
description: "The renderer's connection to the gateway: requests and event streams.",
|
|
30618
|
+
events: {
|
|
30619
|
+
"events.disconnected": "The main event stream dropped; it reconnects and replays.",
|
|
30620
|
+
"terminal-stream.disconnected": "A terminal event stream dropped; it reconnects.",
|
|
30621
|
+
"connection-listener.failed": "A main stream connection state listener threw.",
|
|
30622
|
+
"event-listener.failed": "A listener for a gateway event threw.",
|
|
30623
|
+
"stream-listener.failed": "A listener for the stream-connected notice threw."
|
|
30624
|
+
}
|
|
30625
|
+
},
|
|
30626
|
+
"web.federation": {
|
|
30627
|
+
description: "Events from federated nodes as the renderer receives them.",
|
|
30628
|
+
events: {
|
|
30629
|
+
"resync-handler.failed": "A node resync handler failed.",
|
|
30630
|
+
"event-handler.failed": "A handler for an event relayed from a node failed.",
|
|
30631
|
+
"environment.start-failed": "Starting an environment opened in a workspace window failed."
|
|
30632
|
+
}
|
|
30633
|
+
}
|
|
30634
|
+
});
|
|
30635
|
+
|
|
30636
|
+
// ../protocol/src/log-vocabulary/index.ts
|
|
30637
|
+
var LOG_VOCABULARY = {
|
|
30638
|
+
...AGENT_MAIL_LOG_AREAS,
|
|
30639
|
+
...BACKEND_LOG_AREAS,
|
|
30640
|
+
...BRIDGE_LOG_AREAS,
|
|
30641
|
+
...DESKTOP_LOG_AREAS,
|
|
30642
|
+
...ENVIRONMENT_LOG_AREAS,
|
|
30643
|
+
...GATEWAY_LOG_AREAS,
|
|
30644
|
+
...LOCAL_SERVER_LOG_AREAS,
|
|
30645
|
+
...GIT_LOG_AREAS,
|
|
30646
|
+
...LOGGING_LOG_AREAS,
|
|
30647
|
+
...MODEL_LOG_AREAS,
|
|
30648
|
+
...NATIVE_AGENT_LOG_AREAS,
|
|
30649
|
+
...PREVIEW_LOG_AREAS,
|
|
30650
|
+
...RUNTIME_LOG_AREAS,
|
|
30651
|
+
...TERMINAL_LOG_AREAS,
|
|
30652
|
+
...TMUX_LOG_AREAS,
|
|
30653
|
+
...UPDATER_LOG_AREAS,
|
|
30654
|
+
...WEB_ANNOTATIONS_LOG_AREAS,
|
|
30655
|
+
...STORAGE_LOG_AREAS,
|
|
30656
|
+
...BUILD_PIPELINE_LOG_AREAS,
|
|
30657
|
+
...AGENT_BRANCH_LOG_AREAS,
|
|
30658
|
+
...CHANGE_TRACKING_LOG_AREAS,
|
|
30659
|
+
...COORDINATOR_LOG_AREAS,
|
|
30660
|
+
...REVIEW_LOG_AREAS,
|
|
30661
|
+
...PUBLIC_API_LOG_AREAS,
|
|
30662
|
+
...AGENT_ACCOUNTS_LOG_AREAS,
|
|
30663
|
+
...DOCKER_LOG_AREAS,
|
|
30664
|
+
...MCP_LOG_AREAS,
|
|
30665
|
+
...DESIGN_LOG_AREAS,
|
|
30666
|
+
...GRAPH_LOG_AREAS,
|
|
30667
|
+
...NODES_LOG_AREAS,
|
|
30668
|
+
...LINEAR_LOG_AREAS,
|
|
30669
|
+
...USAGE_HISTORY_LOG_AREAS,
|
|
30670
|
+
...FEATURE_LOG_AREAS,
|
|
30671
|
+
...HOST_LOG_AREAS,
|
|
30672
|
+
...TRANSCRIPT_ARTIFACTS_LOG_AREAS,
|
|
30673
|
+
...SCHEDULER_LOG_AREAS,
|
|
30674
|
+
...WEB_APP_LOG_AREAS,
|
|
30675
|
+
...WEB_BUILD_PIPELINE_LOG_AREAS,
|
|
30676
|
+
...WEB_CHAT_LOG_AREAS,
|
|
30677
|
+
...WEB_CLAUDE_TMUX_LOG_AREAS,
|
|
30678
|
+
...WEB_DESIGN_LOG_AREAS,
|
|
30679
|
+
...WEB_ENVIRONMENT_LOG_AREAS,
|
|
30680
|
+
...WEB_FILES_LOG_AREAS,
|
|
30681
|
+
...WEB_GITHUB_LOG_AREAS,
|
|
30682
|
+
...WEB_KANBAN_LOG_AREAS,
|
|
30683
|
+
...WEB_PANE_LAYOUT_LOG_AREAS,
|
|
30684
|
+
...WEB_SETTINGS_LOG_AREAS,
|
|
30685
|
+
...WEB_SHELL_LOG_AREAS,
|
|
30686
|
+
...WEB_SYNC_LOG_AREAS
|
|
30687
|
+
};
|
|
30688
|
+
|
|
30689
|
+
// ../protocol/src/logger.ts
|
|
30690
|
+
var LOG_LEVELS = ["error", "warn", "info", "debug", "trace"];
|
|
30691
|
+
var MAX_FIELD_CHARS = 2048;
|
|
30692
|
+
var TRUNCATION_MARKER_RESERVE = 32;
|
|
30693
|
+
var MAX_FIELDS = 32;
|
|
30694
|
+
var FIELD_NAME_PATTERN = /^[A-Za-z][\w.-]{0,63}$/;
|
|
30695
|
+
var BARE_TEXT_VALUE = /^[\w./:@+,~-]+$/;
|
|
30696
|
+
var THROTTLE_KIND_PATTERN = /^[\w.:-]{1,64}$/;
|
|
30697
|
+
var MAX_THROTTLE_SCOPE_CHARS = 128;
|
|
30698
|
+
var FORBIDDEN_FIELD_NAMES = new Set([
|
|
30699
|
+
"stdout",
|
|
30700
|
+
"stderr",
|
|
30701
|
+
"cmd",
|
|
30702
|
+
"spawnargs",
|
|
30703
|
+
"prompt",
|
|
30704
|
+
"token",
|
|
30705
|
+
"password",
|
|
30706
|
+
"secret",
|
|
30707
|
+
"authorization",
|
|
30708
|
+
"apikey",
|
|
30709
|
+
"cookie",
|
|
30710
|
+
"credentials"
|
|
30711
|
+
]);
|
|
30712
|
+
var LEVEL_RANK = {
|
|
30713
|
+
error: 0,
|
|
30714
|
+
warn: 1,
|
|
30715
|
+
info: 2,
|
|
30716
|
+
debug: 3,
|
|
30717
|
+
trace: 4
|
|
30718
|
+
};
|
|
30719
|
+
var OUTPUT_METHOD = {
|
|
30720
|
+
error: "error",
|
|
30721
|
+
warn: "warn",
|
|
30722
|
+
info: "info",
|
|
30723
|
+
debug: "debug",
|
|
30724
|
+
trace: "debug"
|
|
30725
|
+
};
|
|
30726
|
+
var consoleSink = ({ method, line }) => {
|
|
30727
|
+
console[method](line);
|
|
30728
|
+
};
|
|
30729
|
+
var DEFAULT_CONFIG = {
|
|
30730
|
+
level: "info",
|
|
30731
|
+
areaLevels: {},
|
|
30732
|
+
format: "text",
|
|
30733
|
+
sink: consoleSink
|
|
30734
|
+
};
|
|
30735
|
+
var config2 = DEFAULT_CONFIG;
|
|
30736
|
+
var generation = 0;
|
|
30737
|
+
function configureLogger(change) {
|
|
30738
|
+
config2 = { ...config2, ...change };
|
|
30739
|
+
generation += 1;
|
|
30740
|
+
}
|
|
30741
|
+
function isLogLevel(value) {
|
|
30742
|
+
return typeof value === "string" && LOG_LEVELS.includes(value);
|
|
30743
|
+
}
|
|
30744
|
+
function areaSpec(area) {
|
|
30745
|
+
return Object.hasOwn(LOG_VOCABULARY, area) ? LOG_VOCABULARY[area] : undefined;
|
|
30746
|
+
}
|
|
30747
|
+
function thresholdRank(area) {
|
|
30748
|
+
for (let scope = area;; scope = scope.slice(0, scope.lastIndexOf("."))) {
|
|
30749
|
+
const level = Object.hasOwn(config2.areaLevels, scope) ? config2.areaLevels[scope] : undefined;
|
|
30750
|
+
if (level)
|
|
30751
|
+
return LEVEL_RANK[level];
|
|
30752
|
+
if (!scope.includes("."))
|
|
30753
|
+
return LEVEL_RANK[config2.level];
|
|
30754
|
+
}
|
|
30755
|
+
}
|
|
30756
|
+
function boundedString(value, maxChars) {
|
|
30757
|
+
if (value.length <= maxChars)
|
|
30758
|
+
return value;
|
|
30759
|
+
const kept = maxChars - TRUNCATION_MARKER_RESERVE;
|
|
30760
|
+
return `${value.slice(0, kept)}...[truncated ${value.length - kept} chars]`;
|
|
30761
|
+
}
|
|
30762
|
+
function sanitizeValue(name, value, maxChars) {
|
|
30763
|
+
if (FORBIDDEN_FIELD_NAMES.has(name.toLowerCase().replace(/[-_.]/g, "")))
|
|
30764
|
+
return "[forbidden]";
|
|
30765
|
+
switch (typeof value) {
|
|
30766
|
+
case "string":
|
|
30767
|
+
return boundedString(value, maxChars);
|
|
30768
|
+
case "number":
|
|
30769
|
+
return Number.isFinite(value) ? value : String(value);
|
|
30770
|
+
case "boolean":
|
|
30771
|
+
return value;
|
|
30772
|
+
case "undefined":
|
|
30773
|
+
return;
|
|
30774
|
+
case "bigint":
|
|
30775
|
+
return value.toString();
|
|
30776
|
+
case "object":
|
|
30777
|
+
if (value === null)
|
|
30778
|
+
return null;
|
|
30779
|
+
if (isSafeLogError(value))
|
|
30780
|
+
return value;
|
|
30781
|
+
if (value instanceof Error)
|
|
30782
|
+
return formatLogError(value);
|
|
30783
|
+
return "[rejected:object]";
|
|
30784
|
+
default:
|
|
30785
|
+
return `[rejected:${typeof value}]`;
|
|
30786
|
+
}
|
|
30787
|
+
}
|
|
30788
|
+
function sanitizeFields(fields, maxChars) {
|
|
30789
|
+
const clean = {};
|
|
30790
|
+
let count = 0;
|
|
30791
|
+
let dropped = 0;
|
|
30792
|
+
for (const name of Object.keys(fields)) {
|
|
30793
|
+
const value = sanitizeValue(name, fields[name], maxChars);
|
|
30794
|
+
if (value === undefined)
|
|
30795
|
+
continue;
|
|
30796
|
+
if (count >= MAX_FIELDS || !FIELD_NAME_PATTERN.test(name)) {
|
|
30797
|
+
dropped += 1;
|
|
30798
|
+
continue;
|
|
30799
|
+
}
|
|
30800
|
+
clean[name] = value;
|
|
30801
|
+
count += 1;
|
|
30802
|
+
}
|
|
30803
|
+
if (dropped > 0)
|
|
30804
|
+
clean.droppedFields = dropped;
|
|
30805
|
+
return count > 0 || dropped > 0 ? clean : undefined;
|
|
30806
|
+
}
|
|
30807
|
+
function textValue(value) {
|
|
30808
|
+
if (typeof value !== "string")
|
|
30809
|
+
return String(value);
|
|
30810
|
+
return BARE_TEXT_VALUE.test(value) ? value : JSON.stringify(value);
|
|
30811
|
+
}
|
|
30812
|
+
function appendTextField(parts, name, value) {
|
|
30813
|
+
if (typeof value !== "object" || value === null) {
|
|
30814
|
+
parts.push(`${name}=${textValue(value)}`);
|
|
30815
|
+
return;
|
|
30816
|
+
}
|
|
30817
|
+
for (const key of Object.keys(value)) {
|
|
30818
|
+
const entry = value[key];
|
|
30819
|
+
if (entry === undefined)
|
|
30820
|
+
continue;
|
|
30821
|
+
if (key === "cause")
|
|
30822
|
+
appendTextField(parts, `${name}.cause`, entry);
|
|
30823
|
+
else if (key === "stack")
|
|
30824
|
+
parts.push(`${name}.stack=${textValue(entry.join(" | "))}`);
|
|
30825
|
+
else
|
|
30826
|
+
parts.push(`${name}.${key}=${textValue(entry)}`);
|
|
30827
|
+
}
|
|
30828
|
+
}
|
|
30829
|
+
function escapeLogLine(line) {
|
|
30830
|
+
return line.replace(/[\u007f-\u009f\u2028\u2029]/g, (character) => `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`);
|
|
30831
|
+
}
|
|
30832
|
+
function renderText(record) {
|
|
30833
|
+
const tag = areaSpec(record.area)?.tag ?? record.area;
|
|
30834
|
+
const parts = [`[${tag}]`, record.event];
|
|
30835
|
+
if (record.fields) {
|
|
30836
|
+
for (const name of Object.keys(record.fields))
|
|
30837
|
+
appendTextField(parts, name, record.fields[name]);
|
|
30838
|
+
}
|
|
30839
|
+
return escapeLogLine(parts.join(" "));
|
|
30840
|
+
}
|
|
30841
|
+
function renderJson(record) {
|
|
30842
|
+
return escapeLogLine(JSON.stringify(record));
|
|
30843
|
+
}
|
|
30844
|
+
function deliver(record) {
|
|
30845
|
+
try {
|
|
30846
|
+
config2.sink({
|
|
30847
|
+
method: OUTPUT_METHOD[record.level],
|
|
30848
|
+
line: config2.format === "json" ? renderJson(record) : renderText(record),
|
|
30849
|
+
record
|
|
30850
|
+
});
|
|
30851
|
+
return true;
|
|
30852
|
+
} catch {
|
|
30853
|
+
return false;
|
|
30854
|
+
}
|
|
30855
|
+
}
|
|
30856
|
+
function buildRecord(level, area, event, fields) {
|
|
30857
|
+
const clean = fields ? sanitizeFields(fields, areaSpec(area)?.maxStringChars ?? MAX_FIELD_CHARS) : undefined;
|
|
30858
|
+
return {
|
|
30859
|
+
orklog: 1,
|
|
30860
|
+
ts: new Date().toISOString(),
|
|
30861
|
+
level,
|
|
30862
|
+
area,
|
|
30863
|
+
event,
|
|
30864
|
+
...clean ? { fields: clean } : {}
|
|
30865
|
+
};
|
|
30866
|
+
}
|
|
30867
|
+
var LOG_THROTTLE_WINDOW_MS = 60000;
|
|
30868
|
+
var LOG_THROTTLE_MAX_KEYS = 512;
|
|
30869
|
+
var LOG_THROTTLE_IDLE_MS = 5 * LOG_THROTTLE_WINDOW_MS;
|
|
30870
|
+
var throttledSites = new Map;
|
|
30871
|
+
var throttledKeyCount = 0;
|
|
30872
|
+
var throttleRecency = 0;
|
|
30873
|
+
var throttleGeneration = generation;
|
|
30874
|
+
var nextThrottleFlushAt = 0;
|
|
30875
|
+
function writeThrottleLine(site, event, fields) {
|
|
30876
|
+
const spec = areaSpec(site.area);
|
|
30877
|
+
if (!spec)
|
|
30878
|
+
return;
|
|
30879
|
+
const listed = Object.hasOwn(spec.events, event);
|
|
30880
|
+
const line = { site: site.event, ...site.scope === undefined ? {} : { scope: site.scope } };
|
|
30881
|
+
deliver(buildRecord(site.level, site.area, listed ? event : "invalid-event", listed ? { ...line, ...fields } : undefined));
|
|
30882
|
+
}
|
|
30883
|
+
function syncThrottleLevels() {
|
|
30884
|
+
if (throttleGeneration === generation)
|
|
30885
|
+
return;
|
|
30886
|
+
throttleGeneration = generation;
|
|
30887
|
+
for (const [siteKey, site] of Array.from(throttledSites)) {
|
|
30888
|
+
if (LEVEL_RANK[site.level] <= thresholdRank(site.area))
|
|
30889
|
+
continue;
|
|
30890
|
+
throttledSites.delete(siteKey);
|
|
30891
|
+
throttledKeyCount -= site.keys.size;
|
|
30892
|
+
}
|
|
30893
|
+
}
|
|
30894
|
+
function rollThrottleWindow(site, kind, key, now) {
|
|
30895
|
+
const elapsed = now - key.windowStart;
|
|
30896
|
+
if (elapsed >= 0 && elapsed < LOG_THROTTLE_WINDOW_MS)
|
|
30897
|
+
return;
|
|
30898
|
+
if (key.pending > 0) {
|
|
30899
|
+
writeThrottleLine(site, "throttle.suppressed", {
|
|
30900
|
+
kind,
|
|
30901
|
+
suppressed: key.pending,
|
|
30902
|
+
windowSeconds: Math.max(0, Math.round(elapsed / 1000))
|
|
30903
|
+
});
|
|
30904
|
+
}
|
|
30905
|
+
key.pending = 0;
|
|
30906
|
+
key.windowStart = now;
|
|
30907
|
+
}
|
|
30908
|
+
function flushDueThrottleWindows(now) {
|
|
30909
|
+
if (now < nextThrottleFlushAt && nextThrottleFlushAt - now <= LOG_THROTTLE_WINDOW_MS)
|
|
30910
|
+
return;
|
|
30911
|
+
nextThrottleFlushAt = now + LOG_THROTTLE_WINDOW_MS;
|
|
30912
|
+
for (const site of throttledSites.values()) {
|
|
30913
|
+
for (const [kind, key] of site.keys)
|
|
30914
|
+
rollThrottleWindow(site, kind, key, now);
|
|
30915
|
+
}
|
|
30916
|
+
}
|
|
30917
|
+
function evictOldestThrottleKey() {
|
|
30918
|
+
let oldest;
|
|
30919
|
+
for (const [siteKey, site] of throttledSites) {
|
|
30920
|
+
for (const [kind, key] of site.keys) {
|
|
30921
|
+
if (!oldest || key.recency < oldest.key.recency)
|
|
30922
|
+
oldest = { siteKey, site, kind, key };
|
|
30923
|
+
}
|
|
30924
|
+
}
|
|
30925
|
+
if (!oldest)
|
|
30926
|
+
return;
|
|
30927
|
+
const { siteKey, site, kind, key } = oldest;
|
|
30928
|
+
writeThrottleLine(site, "throttle.evicted", { kind, suppressed: key.pending });
|
|
30929
|
+
site.keys.delete(kind);
|
|
30930
|
+
throttledKeyCount -= 1;
|
|
30931
|
+
if (site.keys.size === 0)
|
|
30932
|
+
throttledSites.delete(siteKey);
|
|
30933
|
+
}
|
|
30934
|
+
function throttleSiteKey(area, event, scope) {
|
|
30935
|
+
return `${area}\x00${event}\x00${scope ?? ""}`;
|
|
30936
|
+
}
|
|
30937
|
+
function noteThrottledFailure(area, level, event, scope, kind) {
|
|
30938
|
+
const now = Date.now();
|
|
30939
|
+
flushDueThrottleWindows(now);
|
|
30940
|
+
const siteKey = throttleSiteKey(area, event, scope);
|
|
30941
|
+
let site = throttledSites.get(siteKey);
|
|
30942
|
+
let known = site?.keys.get(kind);
|
|
30943
|
+
if (known && now - known.lastFailureAt >= LOG_THROTTLE_IDLE_MS) {
|
|
30944
|
+
site.keys.delete(kind);
|
|
30945
|
+
throttledKeyCount -= 1;
|
|
30946
|
+
if (site.keys.size === 0) {
|
|
30947
|
+
throttledSites.delete(siteKey);
|
|
30948
|
+
site = undefined;
|
|
30949
|
+
}
|
|
30950
|
+
known = undefined;
|
|
30951
|
+
}
|
|
30952
|
+
if (!known && throttledKeyCount >= LOG_THROTTLE_MAX_KEYS) {
|
|
30953
|
+
evictOldestThrottleKey();
|
|
30954
|
+
site = throttledSites.get(siteKey);
|
|
30955
|
+
}
|
|
30956
|
+
site ??= { area, event, scope, level, since: now, failures: 0, keys: new Map };
|
|
30957
|
+
site.level = level;
|
|
30958
|
+
site.failures += 1;
|
|
30959
|
+
throttledSites.delete(siteKey);
|
|
30960
|
+
throttledSites.set(siteKey, site);
|
|
30961
|
+
if (known) {
|
|
30962
|
+
rollThrottleWindow(site, kind, known, now);
|
|
30963
|
+
known.pending += 1;
|
|
30964
|
+
known.lastFailureAt = now;
|
|
30965
|
+
known.recency = ++throttleRecency;
|
|
30966
|
+
site.keys.delete(kind);
|
|
30967
|
+
site.keys.set(kind, known);
|
|
30968
|
+
return false;
|
|
30969
|
+
}
|
|
30970
|
+
site.keys.set(kind, {
|
|
30971
|
+
pending: 0,
|
|
30972
|
+
windowStart: now,
|
|
30973
|
+
lastFailureAt: now,
|
|
30974
|
+
recency: ++throttleRecency
|
|
30975
|
+
});
|
|
30976
|
+
throttledKeyCount += 1;
|
|
30977
|
+
return true;
|
|
30978
|
+
}
|
|
30979
|
+
function noteThrottledSuccess(area, event, scope) {
|
|
30980
|
+
const now = Date.now();
|
|
30981
|
+
flushDueThrottleWindows(now);
|
|
30982
|
+
const siteKey = throttleSiteKey(area, event, scope);
|
|
30983
|
+
const site = throttledSites.get(siteKey);
|
|
30984
|
+
if (!site)
|
|
30985
|
+
return;
|
|
30986
|
+
throttledSites.delete(siteKey);
|
|
30987
|
+
throttledKeyCount -= site.keys.size;
|
|
30988
|
+
let suppressed = 0;
|
|
30989
|
+
for (const key of site.keys.values())
|
|
30990
|
+
suppressed += key.pending;
|
|
30991
|
+
writeThrottleLine(site, "throttle.recovered", {
|
|
30992
|
+
failures: site.failures,
|
|
30993
|
+
kinds: site.keys.size,
|
|
30994
|
+
suppressed,
|
|
30995
|
+
faultSeconds: Math.max(0, Math.round((now - site.since) / 1000))
|
|
30996
|
+
});
|
|
30997
|
+
}
|
|
30998
|
+
function throttleKind(options) {
|
|
30999
|
+
if (options.kind === undefined)
|
|
31000
|
+
return logErrorKind(options.error);
|
|
31001
|
+
return THROTTLE_KIND_PATTERN.test(options.kind) ? options.kind : "invalid-kind";
|
|
31002
|
+
}
|
|
31003
|
+
function resolveFields(fields) {
|
|
31004
|
+
try {
|
|
31005
|
+
return typeof fields === "function" ? fields() : fields;
|
|
31006
|
+
} catch {
|
|
31007
|
+
return { fieldsFailed: true };
|
|
31008
|
+
}
|
|
31009
|
+
}
|
|
31010
|
+
function deliverEvent(level, area, event, fields) {
|
|
31011
|
+
const spec = areaSpec(area);
|
|
31012
|
+
if (!spec)
|
|
31013
|
+
return deliver(buildRecord(level, "logging", "unknown-area", undefined));
|
|
31014
|
+
if (!Object.hasOwn(spec.events, event))
|
|
31015
|
+
return deliver(buildRecord(level, area, "invalid-event", undefined));
|
|
31016
|
+
return deliver(buildRecord(level, area, event, fields));
|
|
31017
|
+
}
|
|
31018
|
+
function tryWriteLog(level, area, event, fields) {
|
|
31019
|
+
if (LEVEL_RANK[level] > thresholdRank(area))
|
|
31020
|
+
return false;
|
|
31021
|
+
return deliverEvent(level, area, event, resolveFields(fields));
|
|
31022
|
+
}
|
|
31023
|
+
function createLogger(area) {
|
|
31024
|
+
const spec = areaSpec(area);
|
|
31025
|
+
let seenGeneration = -1;
|
|
31026
|
+
let rank = 0;
|
|
31027
|
+
const enabled = (level) => {
|
|
31028
|
+
if (seenGeneration !== generation) {
|
|
31029
|
+
seenGeneration = generation;
|
|
31030
|
+
rank = thresholdRank(area);
|
|
31031
|
+
}
|
|
31032
|
+
return LEVEL_RANK[level] <= rank;
|
|
31033
|
+
};
|
|
31034
|
+
const writeResolved = (level, event, resolved) => {
|
|
31035
|
+
deliverEvent(level, area, event, resolved);
|
|
31036
|
+
};
|
|
31037
|
+
const write = (level, event, fields) => {
|
|
31038
|
+
if (!enabled(level))
|
|
31039
|
+
return;
|
|
31040
|
+
writeResolved(level, event, resolveFields(fields));
|
|
31041
|
+
};
|
|
31042
|
+
return {
|
|
31043
|
+
error: (event, fields) => write("error", event, fields),
|
|
31044
|
+
warn: (event, fields) => write("warn", event, fields),
|
|
31045
|
+
info: (event, fields) => write("info", event, fields),
|
|
31046
|
+
debug: (event, fields) => write("debug", event, fields),
|
|
31047
|
+
trace: (event, fields) => write("trace", event, fields),
|
|
31048
|
+
throttled: (level, event, options) => {
|
|
31049
|
+
syncThrottleLevels();
|
|
31050
|
+
if (!enabled(level))
|
|
31051
|
+
return;
|
|
31052
|
+
if (!spec || !Object.hasOwn(spec.events, event) || event.startsWith("throttle.") || !Object.hasOwn(spec.events, "throttle.recovered")) {
|
|
31053
|
+
deliver(buildRecord(level, spec ? area : "logging", spec ? "invalid-event" : "unknown-area", undefined));
|
|
31054
|
+
return;
|
|
31055
|
+
}
|
|
31056
|
+
const kind = throttleKind(options);
|
|
31057
|
+
const scope = options.scope?.slice(0, MAX_THROTTLE_SCOPE_CHARS);
|
|
31058
|
+
if (!noteThrottledFailure(area, level, event, scope, kind))
|
|
31059
|
+
return;
|
|
31060
|
+
writeResolved(level, event, {
|
|
31061
|
+
...scope === undefined ? {} : { scope },
|
|
31062
|
+
kind,
|
|
31063
|
+
...resolveFields(options.fields)
|
|
31064
|
+
});
|
|
31065
|
+
},
|
|
31066
|
+
recovered: (event, scope) => {
|
|
31067
|
+
syncThrottleLevels();
|
|
31068
|
+
if (throttledKeyCount === 0)
|
|
31069
|
+
return;
|
|
31070
|
+
noteThrottledSuccess(area, event, scope?.slice(0, MAX_THROTTLE_SCOPE_CHARS));
|
|
31071
|
+
},
|
|
31072
|
+
isEnabled: enabled
|
|
31073
|
+
};
|
|
31074
|
+
}
|
|
31075
|
+
|
|
28489
31076
|
// ../../bridges/pi-bridge/src/persistence.ts
|
|
31077
|
+
var log = createLogger("bridge.pi");
|
|
28490
31078
|
var tail = Promise.resolve();
|
|
28491
31079
|
var scheduled = false;
|
|
28492
31080
|
var shuttingDown = false;
|
|
@@ -28545,11 +31133,11 @@ function shedToFit(payload, order) {
|
|
|
28545
31133
|
session.transcriptTruncated = true;
|
|
28546
31134
|
shed += 1;
|
|
28547
31135
|
if (Buffer.byteLength(JSON.stringify(payload)) <= MAX_STATE_FILE_BYTES) {
|
|
28548
|
-
|
|
31136
|
+
log.warn("state.transcripts-shed", { sessions: shed });
|
|
28549
31137
|
return true;
|
|
28550
31138
|
}
|
|
28551
31139
|
}
|
|
28552
|
-
|
|
31140
|
+
log.warn("state.over-budget", { sessions: shed });
|
|
28553
31141
|
return false;
|
|
28554
31142
|
}
|
|
28555
31143
|
async function persistNow(write = { barrier: false }) {
|
|
@@ -31973,6 +34561,7 @@ function applyHistoricToolResult(state, message) {
|
|
|
31973
34561
|
if (durationMs !== undefined)
|
|
31974
34562
|
part.toolDurationMs = durationMs;
|
|
31975
34563
|
replayNestedToolCalls(state.messages[index], toolCallId, message.nestedCalls);
|
|
34564
|
+
forgetRowSize(state, state.messages[index]);
|
|
31976
34565
|
return;
|
|
31977
34566
|
}
|
|
31978
34567
|
}
|
|
@@ -32012,7 +34601,19 @@ function pushMessage(state, role, content, parts, createdAt, messageId = randomB
|
|
|
32012
34601
|
}
|
|
32013
34602
|
// ../protocol/src/node/bridge-diagnostics.ts
|
|
32014
34603
|
import { createHash as createHash4 } from "node:crypto";
|
|
32015
|
-
|
|
34604
|
+
|
|
34605
|
+
// ../protocol/src/event-loop-stall-monitor.ts
|
|
34606
|
+
var log2 = createLogger("event-loop");
|
|
34607
|
+
var EVENT_LOOP_STALL_ALWAYS_LOG_MS = 1e4;
|
|
34608
|
+
|
|
34609
|
+
// ../protocol/src/node/bridge-diagnostics.ts
|
|
34610
|
+
var log3 = createLogger("bridge.diagnostics");
|
|
34611
|
+
var BRIDGE_DIAGNOSTICS_INTERVAL_MS = 60000;
|
|
34612
|
+
var INTERVAL_MS = BRIDGE_DIAGNOSTICS_INTERVAL_MS;
|
|
34613
|
+
var STALL_NO_DELTA_MS = 2 * INTERVAL_MS;
|
|
34614
|
+
var STALL_TOOL_PENDING_MS = 10 * 60000;
|
|
34615
|
+
var STALL_TICK_DELAY_MS = EVENT_LOOP_STALL_ALWAYS_LOG_MS;
|
|
34616
|
+
var BRIDGE_DIAGNOSTICS_KEEPALIVE_MS = 10 * 60000;
|
|
32016
34617
|
var MAX_PENDING_TOOLS = 128;
|
|
32017
34618
|
var MAX_REPORTED_TOOLS = 8;
|
|
32018
34619
|
var MAX_ID_LENGTH = 1024;
|
|
@@ -32073,6 +34674,28 @@ var UPDATE_KINDS = new Set([
|
|
|
32073
34674
|
"step-started",
|
|
32074
34675
|
"step-completed"
|
|
32075
34676
|
]);
|
|
34677
|
+
var COUNTER_CHANGE_THRESHOLDS = {
|
|
34678
|
+
stderrBytes: 4096,
|
|
34679
|
+
requestsSent: 1,
|
|
34680
|
+
responsesReceived: 1,
|
|
34681
|
+
timeouts: 1,
|
|
34682
|
+
notificationsReceived: Number.POSITIVE_INFINITY,
|
|
34683
|
+
protocolErrors: 1
|
|
34684
|
+
};
|
|
34685
|
+
var WAITING_PHASES = new Set([
|
|
34686
|
+
"sending",
|
|
34687
|
+
"following",
|
|
34688
|
+
"draining",
|
|
34689
|
+
"cancelling"
|
|
34690
|
+
]);
|
|
34691
|
+
function sameSet(a, b) {
|
|
34692
|
+
if (a.size !== b.size)
|
|
34693
|
+
return false;
|
|
34694
|
+
for (const value of a)
|
|
34695
|
+
if (!b.has(value))
|
|
34696
|
+
return false;
|
|
34697
|
+
return true;
|
|
34698
|
+
}
|
|
32076
34699
|
function identity(value) {
|
|
32077
34700
|
if (typeof value !== "string" || !value || value.length > MAX_ID_LENGTH)
|
|
32078
34701
|
return;
|
|
@@ -32081,7 +34704,16 @@ function identity(value) {
|
|
|
32081
34704
|
function readBridgeDebugFlag(value) {
|
|
32082
34705
|
return value?.trim() === "1";
|
|
32083
34706
|
}
|
|
34707
|
+
var liveDiagnostics;
|
|
34708
|
+
var liveScopes = new Set;
|
|
34709
|
+
function setLiveBridgeDiagnostics(enabled) {
|
|
34710
|
+
liveDiagnostics = enabled;
|
|
34711
|
+
for (const scope of Array.from(liveScopes))
|
|
34712
|
+
scope.syncActive();
|
|
34713
|
+
}
|
|
32084
34714
|
function bridgeDebugEnabled(bridge, env = process.env) {
|
|
34715
|
+
if (liveDiagnostics !== undefined && env === process.env)
|
|
34716
|
+
return liveDiagnostics;
|
|
32085
34717
|
const value = env.ORKESTRATOR_BRIDGE_DEBUG ?? env[`${bridge.toUpperCase()}_BRIDGE_DEBUG`];
|
|
32086
34718
|
return readBridgeDebugFlag(value);
|
|
32087
34719
|
}
|
|
@@ -32139,18 +34771,35 @@ function safeDiagnosticMetrics(value) {
|
|
|
32139
34771
|
result.state = value.state;
|
|
32140
34772
|
return result;
|
|
32141
34773
|
}
|
|
32142
|
-
|
|
32143
|
-
|
|
34774
|
+
function bridgeDiagnosticsChangesEnabled() {
|
|
34775
|
+
return log3.isEnabled("trace");
|
|
34776
|
+
}
|
|
34777
|
+
function writeBridgeDiagnostic({ bridge, event, payload }) {
|
|
34778
|
+
return tryWriteLog("info", "bridge.diagnostics", event, { bridge, payload });
|
|
34779
|
+
}
|
|
34780
|
+
function bridgeDiagnosticsActive() {
|
|
34781
|
+
return log3.isEnabled("info");
|
|
34782
|
+
}
|
|
34783
|
+
function bridgeDiagnosticsStreamEnabled(bridge) {
|
|
34784
|
+
return bridgeDebugEnabled(bridge) || log3.isEnabled("debug");
|
|
34785
|
+
}
|
|
34786
|
+
function writeDiagnostic(bridge, event, payload, write) {
|
|
32144
34787
|
try {
|
|
32145
|
-
|
|
32146
|
-
|
|
32147
|
-
|
|
32148
|
-
|
|
32149
|
-
|
|
32150
|
-
|
|
32151
|
-
|
|
32152
|
-
|
|
32153
|
-
|
|
34788
|
+
const json = JSON.stringify({ bridge, event, ...payload });
|
|
34789
|
+
const bytes = Buffer.byteLength(json);
|
|
34790
|
+
if (bytes <= MAX_BRIDGE_DIAGNOSTIC_BYTES) {
|
|
34791
|
+
const accepted = write({ bridge, event, payload: json });
|
|
34792
|
+
return accepted !== false;
|
|
34793
|
+
}
|
|
34794
|
+
const accepted = write({
|
|
34795
|
+
bridge,
|
|
34796
|
+
event: "snapshot-overflow",
|
|
34797
|
+
payload: JSON.stringify({ bridge, event: "snapshot-overflow", omittedBytes: bytes })
|
|
34798
|
+
});
|
|
34799
|
+
return accepted !== false;
|
|
34800
|
+
} catch {
|
|
34801
|
+
return false;
|
|
34802
|
+
}
|
|
32154
34803
|
}
|
|
32155
34804
|
|
|
32156
34805
|
class BridgeRunDiagnostics {
|
|
@@ -32160,6 +34809,7 @@ class BridgeRunDiagnostics {
|
|
|
32160
34809
|
write;
|
|
32161
34810
|
intervalMs;
|
|
32162
34811
|
metrics;
|
|
34812
|
+
active;
|
|
32163
34813
|
counters = {
|
|
32164
34814
|
stderrBytes: 0,
|
|
32165
34815
|
requestsSent: 0,
|
|
@@ -32181,25 +34831,38 @@ class BridgeRunDiagnostics {
|
|
|
32181
34831
|
completedTools = 0;
|
|
32182
34832
|
pending = new Map;
|
|
32183
34833
|
phase = "sending";
|
|
34834
|
+
processScope = false;
|
|
32184
34835
|
terminal = "pending";
|
|
32185
34836
|
stream = "pending";
|
|
32186
34837
|
cancellation = "none";
|
|
32187
34838
|
cancelReason;
|
|
32188
34839
|
run;
|
|
32189
34840
|
closed = false;
|
|
34841
|
+
wasActive;
|
|
34842
|
+
baseline;
|
|
34843
|
+
changeQueued = false;
|
|
32190
34844
|
timer;
|
|
32191
|
-
constructor(bridge, state, now = Date.now, write =
|
|
34845
|
+
constructor(bridge, state, now = Date.now, write = writeBridgeDiagnostic, intervalMs = INTERVAL_MS, metrics = () => ({}), active = () => true) {
|
|
32192
34846
|
this.bridge = bridge;
|
|
32193
34847
|
this.state = state;
|
|
32194
34848
|
this.now = now;
|
|
32195
34849
|
this.write = write;
|
|
32196
34850
|
this.intervalMs = intervalMs;
|
|
32197
34851
|
this.metrics = metrics;
|
|
34852
|
+
this.active = active;
|
|
32198
34853
|
this.startedAt = this.lastTick = now();
|
|
34854
|
+
this.wasActive = active();
|
|
32199
34855
|
this.timer = setInterval(() => this.report("heartbeat"), intervalMs);
|
|
32200
34856
|
this.timer.unref();
|
|
34857
|
+
liveScopes.add(this);
|
|
32201
34858
|
this.report("send-started");
|
|
32202
34859
|
}
|
|
34860
|
+
syncActive() {
|
|
34861
|
+
const active = this.active();
|
|
34862
|
+
if (active && !this.wasActive)
|
|
34863
|
+
this.report("heartbeat");
|
|
34864
|
+
this.wasActive = active;
|
|
34865
|
+
}
|
|
32203
34866
|
sent(runId) {
|
|
32204
34867
|
this.run = identity(runId);
|
|
32205
34868
|
this.phase = "following";
|
|
@@ -32223,7 +34886,8 @@ class BridgeRunDiagnostics {
|
|
|
32223
34886
|
return;
|
|
32224
34887
|
}
|
|
32225
34888
|
if (stage === "completed") {
|
|
32226
|
-
this.pending.delete(key)
|
|
34889
|
+
if (this.pending.delete(key))
|
|
34890
|
+
this.changed();
|
|
32227
34891
|
this.completedTools++;
|
|
32228
34892
|
return;
|
|
32229
34893
|
}
|
|
@@ -32238,13 +34902,23 @@ class BridgeRunDiagnostics {
|
|
|
32238
34902
|
stage: stage === "started" || existing?.stage === "started" ? "started" : "partial",
|
|
32239
34903
|
nested
|
|
32240
34904
|
});
|
|
34905
|
+
if (!existing)
|
|
34906
|
+
this.changed();
|
|
32241
34907
|
}
|
|
32242
34908
|
checkpoint(phase) {
|
|
34909
|
+
if (phase === "attached")
|
|
34910
|
+
this.processScope = true;
|
|
34911
|
+
if (phase === this.phase)
|
|
34912
|
+
return;
|
|
32243
34913
|
this.phase = phase;
|
|
34914
|
+
this.changed();
|
|
32244
34915
|
}
|
|
32245
34916
|
count(key, amount = 1) {
|
|
32246
|
-
if (
|
|
32247
|
-
|
|
34917
|
+
if (this.closed || !Number.isSafeInteger(amount) || amount < 0)
|
|
34918
|
+
return;
|
|
34919
|
+
this.counters[key] += amount;
|
|
34920
|
+
if (amount > 0 && Number.isFinite(COUNTER_CHANGE_THRESHOLDS[key]))
|
|
34921
|
+
this.changed();
|
|
32248
34922
|
}
|
|
32249
34923
|
translationFailed() {
|
|
32250
34924
|
this.translationFailures++;
|
|
@@ -32260,8 +34934,10 @@ class BridgeRunDiagnostics {
|
|
|
32260
34934
|
}
|
|
32261
34935
|
terminalSettled(outcome) {
|
|
32262
34936
|
this.terminal = outcome;
|
|
32263
|
-
if (outcome === "resolved")
|
|
34937
|
+
if (outcome === "resolved" && this.phase !== "draining") {
|
|
32264
34938
|
this.phase = "draining";
|
|
34939
|
+
this.changed();
|
|
34940
|
+
}
|
|
32265
34941
|
}
|
|
32266
34942
|
requestCancellation(reason = "user") {
|
|
32267
34943
|
this.cancellation = "pending";
|
|
@@ -32283,10 +34959,38 @@ class BridgeRunDiagnostics {
|
|
|
32283
34959
|
if (this.closed)
|
|
32284
34960
|
return;
|
|
32285
34961
|
const now = this.now();
|
|
32286
|
-
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
32287
34962
|
const tickDelayMs = event === "heartbeat" ? Math.max(0, now - this.lastTick - this.intervalMs) : 0;
|
|
32288
34963
|
if (event === "heartbeat")
|
|
32289
34964
|
this.lastTick = now;
|
|
34965
|
+
if (!bridgeDiagnosticsActive())
|
|
34966
|
+
return;
|
|
34967
|
+
const stall = this.stallState(now, tickDelayMs);
|
|
34968
|
+
if (event === "heartbeat" && !this.active() && !this.periodicDue(now, stall))
|
|
34969
|
+
return;
|
|
34970
|
+
this.writeSnapshot(event, now, tickDelayMs, stall);
|
|
34971
|
+
}
|
|
34972
|
+
changed() {
|
|
34973
|
+
if (this.closed || this.changeQueued || !bridgeDiagnosticsChangesEnabled())
|
|
34974
|
+
return;
|
|
34975
|
+
this.changeQueued = true;
|
|
34976
|
+
queueMicrotask(() => {
|
|
34977
|
+
this.changeQueued = false;
|
|
34978
|
+
this.reportChange();
|
|
34979
|
+
});
|
|
34980
|
+
}
|
|
34981
|
+
reportChange() {
|
|
34982
|
+
if (this.closed || !bridgeDiagnosticsChangesEnabled() || !bridgeDiagnosticsActive())
|
|
34983
|
+
return;
|
|
34984
|
+
const last = this.baseline;
|
|
34985
|
+
if (last && !this.changedSince(last))
|
|
34986
|
+
return;
|
|
34987
|
+
const now = this.now();
|
|
34988
|
+
try {
|
|
34989
|
+
this.writeSnapshot("change", now, 0, this.stallState(now, 0));
|
|
34990
|
+
} catch {}
|
|
34991
|
+
}
|
|
34992
|
+
writeSnapshot(event, now, tickDelayMs, stall) {
|
|
34993
|
+
const age = (time) => time === undefined ? null : Math.max(0, now - time);
|
|
32290
34994
|
const pendingTools = Array.from(this.pending.entries()).slice(0, MAX_REPORTED_TOOLS).map(([id, tool]) => ({
|
|
32291
34995
|
id,
|
|
32292
34996
|
kind: tool.kind,
|
|
@@ -32295,8 +34999,7 @@ class BridgeRunDiagnostics {
|
|
|
32295
34999
|
ageMs: age(tool.since)
|
|
32296
35000
|
}));
|
|
32297
35001
|
try {
|
|
32298
|
-
writeDiagnostic(this.bridge, {
|
|
32299
|
-
event,
|
|
35002
|
+
const written = writeDiagnostic(this.bridge, event, {
|
|
32300
35003
|
session: identity(this.state.id),
|
|
32301
35004
|
run: this.run,
|
|
32302
35005
|
phase: this.phase,
|
|
@@ -32323,21 +35026,79 @@ class BridgeRunDiagnostics {
|
|
|
32323
35026
|
completedTools: this.completedTools,
|
|
32324
35027
|
tickDelayMs
|
|
32325
35028
|
}, this.write);
|
|
35029
|
+
if (!written)
|
|
35030
|
+
return;
|
|
35031
|
+
this.baseline = {
|
|
35032
|
+
at: now,
|
|
35033
|
+
phase: this.phase,
|
|
35034
|
+
pending: new Set(this.pending.keys()),
|
|
35035
|
+
counters: { ...this.counters },
|
|
35036
|
+
stall
|
|
35037
|
+
};
|
|
32326
35038
|
} catch {}
|
|
32327
35039
|
}
|
|
35040
|
+
periodicDue(now, stall) {
|
|
35041
|
+
if (stall.signals.has("tick-delay"))
|
|
35042
|
+
return true;
|
|
35043
|
+
const last = this.baseline;
|
|
35044
|
+
if (!last)
|
|
35045
|
+
return true;
|
|
35046
|
+
if (!sameSet(stall.signals, last.stall.signals) || !sameSet(stall.tools, last.stall.tools))
|
|
35047
|
+
return true;
|
|
35048
|
+
if (stall.signals.has("no-delta") && this.changedSince(last))
|
|
35049
|
+
return true;
|
|
35050
|
+
return now - last.at >= BRIDGE_DIAGNOSTICS_KEEPALIVE_MS;
|
|
35051
|
+
}
|
|
35052
|
+
changedSince(last) {
|
|
35053
|
+
if (this.phase !== last.phase)
|
|
35054
|
+
return true;
|
|
35055
|
+
if (this.pending.size !== last.pending.size)
|
|
35056
|
+
return true;
|
|
35057
|
+
for (const key of this.pending.keys())
|
|
35058
|
+
if (!last.pending.has(key))
|
|
35059
|
+
return true;
|
|
35060
|
+
for (const key of Object.keys(this.counters))
|
|
35061
|
+
if (this.counters[key] - last.counters[key] >= COUNTER_CHANGE_THRESHOLDS[key])
|
|
35062
|
+
return true;
|
|
35063
|
+
return false;
|
|
35064
|
+
}
|
|
35065
|
+
stallState(now, tickDelayMs) {
|
|
35066
|
+
const signals = new Set;
|
|
35067
|
+
const tools = new Set;
|
|
35068
|
+
let oldestPending;
|
|
35069
|
+
for (const [key, tool] of this.pending) {
|
|
35070
|
+
if (oldestPending === undefined || tool.since < oldestPending)
|
|
35071
|
+
oldestPending = tool.since;
|
|
35072
|
+
if (now - tool.since >= STALL_TOOL_PENDING_MS)
|
|
35073
|
+
tools.add(key);
|
|
35074
|
+
}
|
|
35075
|
+
const waitingSince = this.processScope ? oldestPending : WAITING_PHASES.has(this.phase) ? this.startedAt : undefined;
|
|
35076
|
+
if (waitingSince !== undefined) {
|
|
35077
|
+
const quietSince = Math.max(this.lastDelta ?? waitingSince, waitingSince);
|
|
35078
|
+
if (now - quietSince >= STALL_NO_DELTA_MS)
|
|
35079
|
+
signals.add("no-delta");
|
|
35080
|
+
}
|
|
35081
|
+
if (tools.size > 0)
|
|
35082
|
+
signals.add("tool-pending");
|
|
35083
|
+
if (tickDelayMs >= STALL_TICK_DELAY_MS)
|
|
35084
|
+
signals.add("tick-delay");
|
|
35085
|
+
return { signals, tools };
|
|
35086
|
+
}
|
|
32328
35087
|
close(phase = "finished") {
|
|
32329
35088
|
if (this.closed)
|
|
32330
35089
|
return;
|
|
32331
35090
|
this.phase = phase;
|
|
32332
35091
|
this.report("closed");
|
|
32333
35092
|
this.closed = true;
|
|
35093
|
+
liveScopes.delete(this);
|
|
32334
35094
|
clearInterval(this.timer);
|
|
32335
35095
|
this.pending.clear();
|
|
32336
35096
|
}
|
|
32337
35097
|
}
|
|
32338
35098
|
function createBridgeDiagnostics(bridge, state, metrics) {
|
|
32339
|
-
return
|
|
35099
|
+
return new BridgeRunDiagnostics(bridge, state, undefined, undefined, undefined, metrics, () => bridgeDiagnosticsStreamEnabled(bridge));
|
|
32340
35100
|
}
|
|
35101
|
+
var bufferedFlushes = new Set;
|
|
32341
35102
|
|
|
32342
35103
|
// ../protocol/src/structured-output-text.ts
|
|
32343
35104
|
var STRUCTURED_OUTPUT_RECOVERY_CHARS = 1024 * 1024;
|
|
@@ -33324,7 +36085,7 @@ ${lines.join(`
|
|
|
33324
36085
|
`)}`;
|
|
33325
36086
|
}
|
|
33326
36087
|
// ../protocol/src/node/transcript-window.ts
|
|
33327
|
-
import { Buffer as
|
|
36088
|
+
import { Buffer as Buffer4 } from "node:buffer";
|
|
33328
36089
|
var DEFAULT_ENVELOPE_RESERVE_BYTES = 256;
|
|
33329
36090
|
var DEFAULT_CONTENT_FALLBACK_BYTES = 1024 * 1024;
|
|
33330
36091
|
var MAX_TRANSCRIPT_INDEX_DIGITS = 16;
|
|
@@ -33348,7 +36109,7 @@ function transcriptTailStart(retained, tailMessages) {
|
|
|
33348
36109
|
function retainUtf8Tail(value, maximumBytes) {
|
|
33349
36110
|
if (maximumBytes <= 0)
|
|
33350
36111
|
return "";
|
|
33351
|
-
const encoded =
|
|
36112
|
+
const encoded = Buffer4.from(value);
|
|
33352
36113
|
if (encoded.length <= maximumBytes)
|
|
33353
36114
|
return value;
|
|
33354
36115
|
let start = encoded.length - maximumBytes;
|
|
@@ -33361,7 +36122,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
33361
36122
|
const contentFallbackBytes = options.contentFallbackBytes === undefined ? DEFAULT_CONTENT_FALLBACK_BYTES : options.contentFallbackBytes;
|
|
33362
36123
|
const tail = options.tailMessages;
|
|
33363
36124
|
const selected = tail !== undefined && messages.length > tail ? messages.slice(-tail) : [...messages];
|
|
33364
|
-
const measure = options.measure ?? ((message) =>
|
|
36125
|
+
const measure = options.measure ?? ((message) => Buffer4.byteLength(JSON.stringify(message)));
|
|
33365
36126
|
const sizes = selected.map((message) => measure(message));
|
|
33366
36127
|
let bytes = envelope + 2 + sizes.reduce((total, size) => total + size, 0) + Math.max(0, sizes.length - 1);
|
|
33367
36128
|
let start = 0;
|
|
@@ -33373,7 +36134,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
33373
36134
|
let truncatedContent = false;
|
|
33374
36135
|
const oldestRetained = selected[start];
|
|
33375
36136
|
if (bytes > maximumBytes && oldestRetained) {
|
|
33376
|
-
const partSizes = oldestRetained.parts.map((part) =>
|
|
36137
|
+
const partSizes = oldestRetained.parts.map((part) => Buffer4.byteLength(JSON.stringify(part)));
|
|
33377
36138
|
const partCount = partSizes.length;
|
|
33378
36139
|
while (omittedParts < partCount && bytes > maximumBytes) {
|
|
33379
36140
|
const shed = partSizes[omittedParts];
|
|
@@ -33394,7 +36155,7 @@ function boundTranscriptResponse(messages, maximumBytes, options = {}) {
|
|
|
33394
36155
|
};
|
|
33395
36156
|
omittedParts = oldestRetained.parts.length;
|
|
33396
36157
|
truncatedContent = true;
|
|
33397
|
-
bytes = envelope + 2 +
|
|
36158
|
+
bytes = envelope + 2 + Buffer4.byteLength(JSON.stringify(selected[start]));
|
|
33398
36159
|
}
|
|
33399
36160
|
}
|
|
33400
36161
|
const bounded = selected.slice(start);
|
|
@@ -33566,8 +36327,158 @@ function publicQueue(state) {
|
|
|
33566
36327
|
].map((item, index) => ({ id: `queued:${index}`, ...item }))
|
|
33567
36328
|
};
|
|
33568
36329
|
}
|
|
36330
|
+
// ../protocol/src/log-policy.ts
|
|
36331
|
+
var BRIDGE_DIAGNOSTICS_LOG_AREA = "bridge.diagnostics";
|
|
36332
|
+
var MAX_LOG_DETAIL_AREAS = 256;
|
|
36333
|
+
var MAX_LOG_AREA_NAME_CHARS = 64;
|
|
36334
|
+
var LOG_AREA_NAME = /^[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*$/;
|
|
36335
|
+
function parseLogDetail(value) {
|
|
36336
|
+
if (typeof value !== "object" || value === null || Array.isArray(value))
|
|
36337
|
+
return null;
|
|
36338
|
+
const { level, areaLevels } = value;
|
|
36339
|
+
if (!isLogLevel(level))
|
|
36340
|
+
return null;
|
|
36341
|
+
if (areaLevels === undefined)
|
|
36342
|
+
return { level, areaLevels: {} };
|
|
36343
|
+
if (typeof areaLevels !== "object" || areaLevels === null || Array.isArray(areaLevels)) {
|
|
36344
|
+
return null;
|
|
36345
|
+
}
|
|
36346
|
+
const names = Object.keys(areaLevels).sort();
|
|
36347
|
+
if (names.length > MAX_LOG_DETAIL_AREAS)
|
|
36348
|
+
return null;
|
|
36349
|
+
const clean = {};
|
|
36350
|
+
for (const name of names) {
|
|
36351
|
+
const areaLevel = areaLevels[name];
|
|
36352
|
+
if (name.length > MAX_LOG_AREA_NAME_CHARS || !LOG_AREA_NAME.test(name))
|
|
36353
|
+
return null;
|
|
36354
|
+
if (!isLogLevel(areaLevel))
|
|
36355
|
+
return null;
|
|
36356
|
+
clean[name] = areaLevel;
|
|
36357
|
+
}
|
|
36358
|
+
return { level, areaLevels: clean };
|
|
36359
|
+
}
|
|
36360
|
+
var LEVEL_DETAIL = {
|
|
36361
|
+
error: 0,
|
|
36362
|
+
warn: 1,
|
|
36363
|
+
info: 2,
|
|
36364
|
+
debug: 3,
|
|
36365
|
+
trace: 4
|
|
36366
|
+
};
|
|
36367
|
+
function effectiveLogLevel(detail, area) {
|
|
36368
|
+
for (let scope = area;; scope = scope.slice(0, scope.lastIndexOf("."))) {
|
|
36369
|
+
const level = Object.hasOwn(detail.areaLevels, scope) ? detail.areaLevels[scope] : undefined;
|
|
36370
|
+
if (level)
|
|
36371
|
+
return level;
|
|
36372
|
+
if (!scope.includes("."))
|
|
36373
|
+
return detail.level;
|
|
36374
|
+
}
|
|
36375
|
+
}
|
|
36376
|
+
function logDetailEnablesBridgeDiagnostics(detail) {
|
|
36377
|
+
return LEVEL_DETAIL[effectiveLogLevel(detail, BRIDGE_DIAGNOSTICS_LOG_AREA)] >= LEVEL_DETAIL.debug;
|
|
36378
|
+
}
|
|
36379
|
+
var BRIDGE_LOG_POLICY_ROUTE = "/debug/log-policy";
|
|
36380
|
+
function parseBridgeLogPolicy(value) {
|
|
36381
|
+
const detail = parseLogDetail(value);
|
|
36382
|
+
if (!detail)
|
|
36383
|
+
return null;
|
|
36384
|
+
const { seq } = value;
|
|
36385
|
+
return Number.isSafeInteger(seq) && seq >= 0 ? { ...detail, seq } : null;
|
|
36386
|
+
}
|
|
36387
|
+
|
|
36388
|
+
// ../protocol/src/node/logger-environment.ts
|
|
36389
|
+
var LOG_LEVEL_ENV = "ORKESTRATOR_LOG_LEVEL";
|
|
36390
|
+
var LOG_FORMAT_ENV = "ORKESTRATOR_LOG_FORMAT";
|
|
36391
|
+
var BRIDGE_LOG_RELAY_ENV = "ORKESTRATOR_BRIDGE_LOG_RELAY";
|
|
36392
|
+
var bridgeLogLevelOverrides = new WeakMap;
|
|
36393
|
+
function logLevelEnvironmentValue(env) {
|
|
36394
|
+
return env[LOG_LEVEL_ENV] ?? bridgeLogLevelOverrides.get(env);
|
|
36395
|
+
}
|
|
36396
|
+
function parseLogLevels(value) {
|
|
36397
|
+
const parsed = { areaLevels: {}, invalid: [] };
|
|
36398
|
+
for (const entry of (value ?? "").split(",")) {
|
|
36399
|
+
const trimmed = entry.trim();
|
|
36400
|
+
if (!trimmed)
|
|
36401
|
+
continue;
|
|
36402
|
+
const separator = trimmed.indexOf("=");
|
|
36403
|
+
if (separator < 0) {
|
|
36404
|
+
if (isLogLevel(trimmed))
|
|
36405
|
+
parsed.level = trimmed;
|
|
36406
|
+
else
|
|
36407
|
+
parsed.invalid.push(trimmed);
|
|
36408
|
+
continue;
|
|
36409
|
+
}
|
|
36410
|
+
const area = trimmed.slice(0, separator);
|
|
36411
|
+
const level = trimmed.slice(separator + 1);
|
|
36412
|
+
if (isLogLevel(level) && isKnownScope(area))
|
|
36413
|
+
parsed.areaLevels[area] = level;
|
|
36414
|
+
else
|
|
36415
|
+
parsed.invalid.push(trimmed);
|
|
36416
|
+
}
|
|
36417
|
+
return parsed;
|
|
36418
|
+
}
|
|
36419
|
+
function isKnownScope(scope) {
|
|
36420
|
+
return Object.keys(LOG_VOCABULARY).some((area) => area === scope || area.startsWith(`${scope}.`));
|
|
36421
|
+
}
|
|
36422
|
+
function configureLoggerFromEnvironment(env, options = {}) {
|
|
36423
|
+
const levels = parseLogLevels(env[LOG_LEVEL_ENV]);
|
|
36424
|
+
const requestedFormat = env[LOG_FORMAT_ENV];
|
|
36425
|
+
const format = options.relayToSupervisor || requestedFormat === "json" ? "json" : "text";
|
|
36426
|
+
configureLogger({
|
|
36427
|
+
...levels.level ? { level: levels.level } : {},
|
|
36428
|
+
areaLevels: levels.areaLevels,
|
|
36429
|
+
format
|
|
36430
|
+
});
|
|
36431
|
+
const log = createLogger("logging");
|
|
36432
|
+
if (levels.invalid.length > 0) {
|
|
36433
|
+
log.warn("config.invalid", { variable: LOG_LEVEL_ENV, entries: levels.invalid.length });
|
|
36434
|
+
}
|
|
36435
|
+
if (requestedFormat && requestedFormat !== "json" && requestedFormat !== "text") {
|
|
36436
|
+
log.warn("config.invalid", { variable: LOG_FORMAT_ENV, entries: 1 });
|
|
36437
|
+
}
|
|
36438
|
+
}
|
|
36439
|
+
function configureBridgeLogger(env = process.env) {
|
|
36440
|
+
const relayToSupervisor = env[BRIDGE_LOG_RELAY_ENV] === "1";
|
|
36441
|
+
bridgeLogLevelOverrides.set(env, env[LOG_LEVEL_ENV]);
|
|
36442
|
+
delete env[BRIDGE_LOG_RELAY_ENV];
|
|
36443
|
+
configureLoggerFromEnvironment(env, { relayToSupervisor });
|
|
36444
|
+
delete env[LOG_FORMAT_ENV];
|
|
36445
|
+
delete env[LOG_LEVEL_ENV];
|
|
36446
|
+
}
|
|
36447
|
+
|
|
36448
|
+
// ../protocol/src/node/log-policy.ts
|
|
36449
|
+
function effectiveLogDetail(detail, env = process.env) {
|
|
36450
|
+
const overrides = parseLogLevels(logLevelEnvironmentValue(env));
|
|
36451
|
+
return {
|
|
36452
|
+
level: overrides.level ?? detail.level,
|
|
36453
|
+
areaLevels: { ...detail.areaLevels, ...overrides.areaLevels }
|
|
36454
|
+
};
|
|
36455
|
+
}
|
|
36456
|
+
function applyLogDetail(detail, env = process.env) {
|
|
36457
|
+
const effective = effectiveLogDetail(detail, env);
|
|
36458
|
+
configureLogger(effective);
|
|
36459
|
+
return effective;
|
|
36460
|
+
}
|
|
36461
|
+
|
|
36462
|
+
// ../protocol/src/node/bridge-log-policy.ts
|
|
36463
|
+
var MAX_BRIDGE_LOG_POLICY_BYTES = 64 * 1024;
|
|
36464
|
+
var appliedSeq = -1;
|
|
36465
|
+
function applyBridgeLogPolicy(value, env = process.env) {
|
|
36466
|
+
const policy = parseBridgeLogPolicy(value);
|
|
36467
|
+
if (!policy)
|
|
36468
|
+
return { status: 400, body: { error: "Invalid log policy" } };
|
|
36469
|
+
if (policy.seq < appliedSeq) {
|
|
36470
|
+
return { status: 200, body: { applied: false, stale: true, seq: appliedSeq } };
|
|
36471
|
+
}
|
|
36472
|
+
appliedSeq = policy.seq;
|
|
36473
|
+
const effective = applyLogDetail(policy, env);
|
|
36474
|
+
const diagnostics = logDetailEnablesBridgeDiagnostics(effective);
|
|
36475
|
+
setLiveBridgeDiagnostics(diagnostics);
|
|
36476
|
+
return { status: 200, body: { applied: true, seq: policy.seq, diagnostics } };
|
|
36477
|
+
}
|
|
36478
|
+
|
|
33569
36479
|
// ../protocol/src/human-prompts.ts
|
|
33570
36480
|
var HUMAN_PROMPT_SCAN_BYTES = 16 * 1024;
|
|
36481
|
+
var HUMAN_PROMPT_OBSERVATION_ROWS = 64;
|
|
33571
36482
|
function humanPromptObservation(messages, tasks) {
|
|
33572
36483
|
const object = (value) => !!value && typeof value === "object" && !Array.isArray(value);
|
|
33573
36484
|
const parts = [];
|
|
@@ -33601,7 +36512,7 @@ function humanPromptObservation(messages, tasks) {
|
|
|
33601
36512
|
}
|
|
33602
36513
|
};
|
|
33603
36514
|
if (Array.isArray(messages)) {
|
|
33604
|
-
for (let i = messages.length - 1;i >= Math.max(0, messages.length -
|
|
36515
|
+
for (let i = messages.length - 1;i >= Math.max(0, messages.length - HUMAN_PROMPT_OBSERVATION_ROWS); i--) {
|
|
33605
36516
|
const message = messages[i];
|
|
33606
36517
|
if (object(message))
|
|
33607
36518
|
walk(message.parts);
|
|
@@ -33675,7 +36586,7 @@ var DEFAULT_MCP_MANAGEMENT_ROLLOUT = Object.freeze({
|
|
|
33675
36586
|
});
|
|
33676
36587
|
|
|
33677
36588
|
// ../protocol/src/node/bridge-transcript-summary.ts
|
|
33678
|
-
import { Buffer as
|
|
36589
|
+
import { Buffer as Buffer5 } from "node:buffer";
|
|
33679
36590
|
import { createHash as createHash5 } from "node:crypto";
|
|
33680
36591
|
|
|
33681
36592
|
// ../protocol/src/node/progressive-transcript.ts
|
|
@@ -33760,7 +36671,7 @@ var MAX_SUMMARY_DEPTH = 8;
|
|
|
33760
36671
|
var NESTED_PART_FIELDS = ["parts", "childTools", "subagentActions"];
|
|
33761
36672
|
var LOCATOR_PREFIX = "bd1.";
|
|
33762
36673
|
function encodeLocator(body) {
|
|
33763
|
-
const locator = LOCATOR_PREFIX +
|
|
36674
|
+
const locator = LOCATOR_PREFIX + Buffer5.from(JSON.stringify(body)).toString("base64url");
|
|
33764
36675
|
return locator.length <= BRIDGE_DETAIL_LOCATOR_MAX_LENGTH ? locator : undefined;
|
|
33765
36676
|
}
|
|
33766
36677
|
function decodeLocator(locator) {
|
|
@@ -33768,7 +36679,7 @@ function decodeLocator(locator) {
|
|
|
33768
36679
|
return;
|
|
33769
36680
|
}
|
|
33770
36681
|
try {
|
|
33771
|
-
const body = JSON.parse(
|
|
36682
|
+
const body = JSON.parse(Buffer5.from(locator.slice(LOCATOR_PREFIX.length), "base64url").toString("utf8"));
|
|
33772
36683
|
if (!isRecord2(body))
|
|
33773
36684
|
return;
|
|
33774
36685
|
const { m, p, d } = body;
|
|
@@ -33841,7 +36752,7 @@ function measureDetail(part, payload) {
|
|
|
33841
36752
|
function digestPayload(payload) {
|
|
33842
36753
|
const serialized = JSON.stringify(payload);
|
|
33843
36754
|
return {
|
|
33844
|
-
bytes:
|
|
36755
|
+
bytes: Buffer5.byteLength(serialized),
|
|
33845
36756
|
digest: createHash5("sha256").update(serialized).digest("base64url").slice(0, 32)
|
|
33846
36757
|
};
|
|
33847
36758
|
}
|
|
@@ -34016,7 +36927,7 @@ function revisedBeforeWindow(messages, startIndex, ids) {
|
|
|
34016
36927
|
continue;
|
|
34017
36928
|
found.delete(id);
|
|
34018
36929
|
const summary = summarizeBridgeMessage(message);
|
|
34019
|
-
const size =
|
|
36930
|
+
const size = Buffer5.byteLength(JSON.stringify(summary));
|
|
34020
36931
|
if (revised.length >= BRIDGE_REVISED_MESSAGES_MAX || bytes + size > BRIDGE_REVISED_MESSAGES_MAX_BYTES) {
|
|
34021
36932
|
omitted.push(summary);
|
|
34022
36933
|
continue;
|
|
@@ -34078,7 +36989,7 @@ function bridgeTranscriptSummaryUpdate(messages, options) {
|
|
|
34078
36989
|
}
|
|
34079
36990
|
var PAGE_CURSOR_PREFIX = "bp1.";
|
|
34080
36991
|
function encodePageCursor(body) {
|
|
34081
|
-
const cursor = PAGE_CURSOR_PREFIX +
|
|
36992
|
+
const cursor = PAGE_CURSOR_PREFIX + Buffer5.from(JSON.stringify(body)).toString("base64url");
|
|
34082
36993
|
return cursor.length <= BRIDGE_PAGE_CURSOR_MAX_LENGTH ? cursor : undefined;
|
|
34083
36994
|
}
|
|
34084
36995
|
function decodePageCursor(cursor) {
|
|
@@ -34086,7 +36997,7 @@ function decodePageCursor(cursor) {
|
|
|
34086
36997
|
return;
|
|
34087
36998
|
}
|
|
34088
36999
|
try {
|
|
34089
|
-
const body = JSON.parse(
|
|
37000
|
+
const body = JSON.parse(Buffer5.from(cursor.slice(PAGE_CURSOR_PREFIX.length), "base64url").toString("utf8"));
|
|
34090
37001
|
if (!isRecord2(body))
|
|
34091
37002
|
return;
|
|
34092
37003
|
const { g, e, b } = body;
|
|
@@ -34563,6 +37474,8 @@ async function answerSessionActivityBatch(body, read, options = {}) {
|
|
|
34563
37474
|
}
|
|
34564
37475
|
|
|
34565
37476
|
// ../../bridges/pi-bridge/src/http.ts
|
|
37477
|
+
var log4 = createLogger("bridge.pi");
|
|
37478
|
+
|
|
34566
37479
|
class HttpError extends Error {
|
|
34567
37480
|
status;
|
|
34568
37481
|
constructor(status, message) {
|
|
@@ -34622,6 +37535,10 @@ async function route(request, response, clientSignal) {
|
|
|
34622
37535
|
});
|
|
34623
37536
|
return json(response, answer.status, answer.body);
|
|
34624
37537
|
}
|
|
37538
|
+
if (url.pathname === BRIDGE_LOG_POLICY_ROUTE && request.method === "POST") {
|
|
37539
|
+
const answer = applyBridgeLogPolicy(await readJson(request));
|
|
37540
|
+
return json(response, answer.status, answer.body);
|
|
37541
|
+
}
|
|
34625
37542
|
const handled = await routeGlobal(request, response, url);
|
|
34626
37543
|
if (handled)
|
|
34627
37544
|
return;
|
|
@@ -34641,7 +37558,7 @@ async function route(request, response, clientSignal) {
|
|
|
34641
37558
|
if (error instanceof PromptAttachmentError) {
|
|
34642
37559
|
return json(response, 400, { error: error.message });
|
|
34643
37560
|
}
|
|
34644
|
-
|
|
37561
|
+
log4.error("http.route-failed");
|
|
34645
37562
|
return json(response, 500, { error: "Internal bridge error" });
|
|
34646
37563
|
}
|
|
34647
37564
|
}
|
|
@@ -35641,6 +38558,7 @@ function startParentWatchdog(options) {
|
|
|
35641
38558
|
}
|
|
35642
38559
|
|
|
35643
38560
|
// ../protocol/src/bridge-lifecycle.ts
|
|
38561
|
+
var log5 = createLogger("bridge.lifecycle");
|
|
35644
38562
|
var TERMINATION_SIGNALS = ["SIGTERM", "SIGINT"];
|
|
35645
38563
|
function errorKind(error) {
|
|
35646
38564
|
if (error instanceof Error)
|
|
@@ -35656,11 +38574,9 @@ class BridgeLifecycle {
|
|
|
35656
38574
|
#exit = null;
|
|
35657
38575
|
#options;
|
|
35658
38576
|
#timers;
|
|
35659
|
-
#report;
|
|
35660
38577
|
constructor(options) {
|
|
35661
38578
|
this.#options = options;
|
|
35662
38579
|
this.#timers = options.timers ?? runtimeIntervalTimers;
|
|
35663
|
-
this.#report = options.report ?? ((message) => console.error(message));
|
|
35664
38580
|
}
|
|
35665
38581
|
get phase() {
|
|
35666
38582
|
return this.#phase;
|
|
@@ -35696,7 +38612,10 @@ class BridgeLifecycle {
|
|
|
35696
38612
|
}
|
|
35697
38613
|
requestExit() {
|
|
35698
38614
|
this.#exit ??= this.shutdown().then(() => this.#options.exit(0), (error) => {
|
|
35699
|
-
|
|
38615
|
+
log5.error("shutdown.failed", {
|
|
38616
|
+
bridge: this.#options.label,
|
|
38617
|
+
errorClass: errorKind(error)
|
|
38618
|
+
});
|
|
35700
38619
|
this.#options.exit(1);
|
|
35701
38620
|
});
|
|
35702
38621
|
return this.#exit;
|
|
@@ -35710,7 +38629,10 @@ class BridgeLifecycle {
|
|
|
35710
38629
|
try {
|
|
35711
38630
|
idleSweep.run();
|
|
35712
38631
|
} catch (error) {
|
|
35713
|
-
|
|
38632
|
+
log5.warn("idle-sweep.failed", {
|
|
38633
|
+
bridge: this.#options.label,
|
|
38634
|
+
errorClass: errorKind(error)
|
|
38635
|
+
});
|
|
35714
38636
|
}
|
|
35715
38637
|
}, idleSweep.intervalMs);
|
|
35716
38638
|
this.#disarmers.push(() => this.#timers.clearInterval(handle));
|
|
@@ -35974,6 +38896,7 @@ function installFatalRejectionGuard(options) {
|
|
|
35974
38896
|
}
|
|
35975
38897
|
|
|
35976
38898
|
// ../../bridges/pi-bridge/src/index.ts
|
|
38899
|
+
configureBridgeLogger();
|
|
35977
38900
|
installFatalRejectionGuard({ label: "[pi-bridge]" });
|
|
35978
38901
|
if (process.env.PI_BRIDGE_LIBRARY_ONLY !== "1") {
|
|
35979
38902
|
await start();
|
|
@@ -36072,6 +38995,7 @@ export {
|
|
|
36072
38995
|
expireComposerHydrationRetryForTests,
|
|
36073
38996
|
fallbackDefaultModelId,
|
|
36074
38997
|
forgetRevisedRows,
|
|
38998
|
+
forgetRowSize,
|
|
36075
38999
|
forkSession,
|
|
36076
39000
|
holdApproval,
|
|
36077
39001
|
hostname,
|