@liberseek/boft-cli-win32-arm64 0.8.8 → 0.8.9

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.
Files changed (68) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +59 -6
  4. package/app/console-web.js +1376 -1053
  5. package/app/desktop-controller.mjs +239 -57
  6. package/app/host-runtime.mjs +35964 -28304
  7. package/app/plugins/antigravity/assets/icon.svg +1 -1
  8. package/app/plugins/antigravity/plugin.mjs +9491 -4266
  9. package/app/plugins/claude-code/plugin.mjs +580 -116
  10. package/app/plugins/codebuddy/plugin.mjs +85 -8
  11. package/app/plugins/codex-usage/plugin.mjs +70 -6
  12. package/app/plugins/copilot/plugin.mjs +62 -6
  13. package/app/plugins/cursor-cli/plugin.mjs +62 -6
  14. package/app/plugins/deepseek-harness/plugin.mjs +87 -11
  15. package/app/plugins/devin/plugin.mjs +61 -6
  16. package/app/plugins/grok/plugin.mjs +320 -223
  17. package/app/plugins/hermes/plugin.mjs +61 -6
  18. package/app/plugins/kimi-code/plugin.mjs +87 -16
  19. package/app/plugins/kiro-cli/plugin.mjs +62 -6
  20. package/app/plugins/muse/plugin.mjs +61 -6
  21. package/app/plugins/omp/plugin.mjs +195 -31
  22. package/app/plugins/opencode/plugin.mjs +88 -15
  23. package/app/plugins/pi/plugin.mjs +207 -32
  24. package/app/plugins/qoder/plugin.mjs +99 -7
  25. package/app/plugins/qoder-cn/plugin.mjs +99 -7
  26. package/app/plugins/qwen-code/plugin.mjs +62 -6
  27. package/app/plugins/workbuddy/plugin.mjs +89 -11
  28. package/app/plugins/zcode/plugin.mjs +70 -6
  29. package/app/renderer-extension.js +1767 -1187
  30. package/app/web/assets/index-C2OA-eHT.js +201 -0
  31. package/app/web/assets/index-DJW4bmyx.css +1 -0
  32. package/app/web/assets/langs/{graphql-B8vkg11W.js → graphql-ChAeyPkT.js} +1 -1
  33. package/app/web/assets/langs/{http-DmoDEjMt.js → http-BvreBIbD.js} +1 -1
  34. package/app/web/assets/langs/{php-DJ5ovfAM.js → php-D8omCIuJ.js} +1 -1
  35. package/app/web/assets/langs/{rst-U5-R5x3p.js → rst-Do7RLLCS.js} +1 -1
  36. package/app/web/assets/langs/{ruby-VKVsnS0H.js → ruby-rH_O_vse.js} +1 -1
  37. package/app/web/assets/langs/{svelte-C20lOv9V.js → svelte-xZy73wAj.js} +1 -1
  38. package/app/web/assets/langs/{vue-z6Y-lzP-.js → vue-C4DW8agZ.js} +1 -1
  39. package/app/web/assets/{vendor-dSL872WO.js → vendor-C9g2bw8s.js} +3 -3
  40. package/app/web/codexhost-settings.js +1383 -1056
  41. package/app/web/index.html +4 -3
  42. package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +2 -2
  43. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  44. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +11 -11
  45. package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -69
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +3 -3
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +28 -28
  51. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  52. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
  53. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
  54. package/app/web/plugins/deepseek-ai__dsh-client-ui-session/client.js +1 -1
  55. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  56. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
  57. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +9 -9
  58. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  59. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  60. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
  61. package/app/web-modules/server.mjs +2458 -1615
  62. package/bin/boft.exe +0 -0
  63. package/libexec/boft-node-repl.exe +0 -0
  64. package/libexec/boft-shim.exe +0 -0
  65. package/libexec/boft-updater.exe +0 -0
  66. package/package.json +1 -1
  67. package/app/web/assets/index-CP6wY-1D.css +0 -1
  68. package/app/web/assets/index-Da35Phrd.js +0 -199
@@ -212,14 +212,14 @@ var CdpClient = class _CdpClient {
212
212
  if (listeners.size === 0) this.#listeners.delete(method);
213
213
  };
214
214
  }
215
- #send(method, params, sessionId) {
215
+ #send(method, params, sessionId, timeoutMs = this.#commandTimeoutMs) {
216
216
  if (this.#closed) return Promise.reject(new CdpConnectionClosedError("CDP client is closed"));
217
217
  const id = this.#nextId++;
218
218
  return new Promise((resolve, reject) => {
219
219
  const timeout = setTimeout(() => {
220
220
  this.#pending.delete(id);
221
221
  reject(new Error(`CDP command '${method}' timed out`));
222
- }, this.#commandTimeoutMs);
222
+ }, timeoutMs);
223
223
  this.#pending.set(id, { resolve, reject, timeout });
224
224
  try {
225
225
  this.#socket.send(
@@ -232,12 +232,13 @@ var CdpClient = class _CdpClient {
232
232
  }
233
233
  });
234
234
  }
235
- async evaluate(expression) {
236
- const response = await this.command("Runtime.evaluate", {
237
- expression,
238
- awaitPromise: true,
239
- returnByValue: true
240
- });
235
+ async evaluate(expression, timeoutMs) {
236
+ const response = await this.#send(
237
+ "Runtime.evaluate",
238
+ { expression, awaitPromise: true, returnByValue: true },
239
+ void 0,
240
+ timeoutMs
241
+ );
241
242
  if (!isRecord(response)) throw new Error("Runtime.evaluate returned an invalid result");
242
243
  try {
243
244
  if (isRecord(response.exceptionDetails)) {
@@ -316,7 +317,10 @@ var CdpClient = class _CdpClient {
316
317
  // packages/desktop-control/src/renderer-remote-sessions.ts
317
318
  async function rendererRemoteSession(target2, operation) {
318
319
  const routing = target2.__codexhostHostRoutingV1;
319
- if (!routing) throw new Error("Desktop remote session routing is unavailable");
320
+ if (!routing)
321
+ throw Object.assign(new Error("Desktop remote session routing is unavailable"), {
322
+ code: -32090
323
+ });
320
324
  const ids = [...new Set(routing.knownHostIds?.() ?? [])].filter(
321
325
  (id) => /^remote-(?:ssh(?:-|:)|control:)/u.test(id)
322
326
  );
@@ -390,49 +394,131 @@ async function rendererRemoteSession(target2, operation) {
390
394
  })
391
395
  );
392
396
  }
397
+ const connectionError = (message, changed = false) => Object.assign(new Error(message), {
398
+ code: changed && routing.forHost(operation.hostId) ? -32095 : -32090
399
+ });
393
400
  if (!ids.includes(operation.hostId))
394
- throw new Error("Remote Host is offline or no longer known to Desktop");
401
+ throw connectionError("Remote Host is offline or no longer known to Desktop");
395
402
  const route = routing.forHost(operation.hostId);
396
403
  const manager = route?.manager;
397
- if (!route || !manager) throw new Error("Remote Host is offline");
404
+ if (!route || !manager) throw connectionError("Remote Host is offline");
405
+ const read = async (request) => {
406
+ let result;
407
+ try {
408
+ result = await request();
409
+ } catch (error51) {
410
+ if (routing.forHost(operation.hostId) !== route)
411
+ throw connectionError("Remote connection changed during read", true);
412
+ throw error51;
413
+ }
414
+ if (routing.forHost(operation.hostId) !== route)
415
+ throw connectionError("Remote connection changed during read", true);
416
+ return result;
417
+ };
398
418
  let generation = state.managers.get(route);
399
419
  if (!generation) {
400
420
  generation = { epoch: crypto.randomUUID(), answered: /* @__PURE__ */ new Set() };
401
421
  state.managers.set(route, generation);
402
422
  }
403
423
  if ("epoch" in operation && operation.epoch !== generation.epoch)
404
- throw new Error("Remote connection changed; refresh before operating");
424
+ throw connectionError("Remote connection changed; refresh before operating", true);
405
425
  if (operation.kind === "list")
406
- return manager.sendRequest("thread/list", {
407
- cursor: operation.cursor,
408
- archived: operation.archived,
409
- limit: 100
410
- });
426
+ return read(
427
+ () => manager.sendRequest("thread/list", {
428
+ cursor: operation.cursor,
429
+ archived: operation.archived,
430
+ limit: 100
431
+ })
432
+ );
411
433
  const threadId = operation.threadId;
434
+ if (operation.kind === "usage")
435
+ return read(() => manager.sendRequest("codexhost/thread/usage/inspect", { threadId }));
436
+ if (operation.kind === "status") {
437
+ const result = await read(
438
+ () => manager.sendRequest("thread/read", {
439
+ threadId,
440
+ includeTurns: false
441
+ })
442
+ );
443
+ if (result.thread?.id !== threadId || typeof result.thread.status?.type !== "string")
444
+ throw new Error("Invalid remote Thread status");
445
+ let turnId = null;
446
+ if (result.thread.status.type === "active") {
447
+ const page = await read(
448
+ () => manager.sendRequest("thread/turns/list", {
449
+ threadId,
450
+ cursor: null,
451
+ limit: 1,
452
+ sortDirection: "desc",
453
+ itemsView: "notLoaded"
454
+ })
455
+ );
456
+ if (!Array.isArray(page.data)) throw new Error("Invalid remote Turn status");
457
+ const latest = page.data[0];
458
+ if (latest?.status === "inProgress" && typeof latest.id === "string") turnId = latest.id;
459
+ }
460
+ return { threadId, status: result.thread.status.type, turnId, epoch: generation.epoch };
461
+ }
412
462
  const pendingRequests = async () => {
413
- const conversation = await manager.getConversation?.(threadId);
414
- if (routing.forHost(operation.hostId) !== route)
415
- throw new Error("Remote connection changed during interaction read");
463
+ const conversation = await read(() => manager.getConversation?.(threadId));
416
464
  return Array.isArray(conversation?.requests) ? conversation.requests : [];
417
465
  };
418
466
  if (operation.kind === "read") {
419
- let result = await manager.sendRequest("thread/read", { threadId, includeTurns: false });
420
- if (routing.forHost(operation.hostId) !== route)
421
- throw new Error("Remote connection changed during read");
467
+ if (operation.page?.epoch !== void 0 && operation.page.epoch !== generation.epoch)
468
+ throw connectionError(
469
+ "Remote connection changed during history pagination; refresh and retry",
470
+ true
471
+ );
472
+ let result = await read(
473
+ () => manager.sendRequest("thread/read", { threadId, includeTurns: false })
474
+ );
422
475
  const header = result;
423
- if (header.thread?.historyMode === "paginated") {
476
+ let nextCursor = null;
477
+ const requestedPage = operation.page;
478
+ if (header.thread?.historyMode === "paginated" && requestedPage) {
479
+ let limit = requestedPage.limit ?? 20;
480
+ for (; ; ) {
481
+ const response = await read(
482
+ () => manager.sendRequest("thread/turns/list", {
483
+ threadId,
484
+ cursor: requestedPage.cursor,
485
+ limit,
486
+ sortDirection: requestedPage.sortDirection ?? "asc",
487
+ itemsView: "full"
488
+ })
489
+ );
490
+ if (!Array.isArray(response.data) || response.nextCursor !== null && (typeof response.nextCursor !== "string" || response.nextCursor.length === 0))
491
+ throw new Error("Invalid remote history page");
492
+ if (new TextEncoder().encode(JSON.stringify(response.data)).byteLength > 14 * 1024 * 1024) {
493
+ if (response.data.length <= 1 || limit === 1)
494
+ throw Object.assign(
495
+ new Error(
496
+ "A remote Turn exceeds the history page limit; open this chat in Codex Desktop."
497
+ ),
498
+ { code: -32094 }
499
+ );
500
+ limit = Math.max(1, Math.floor(Math.min(limit, response.data.length) / 2));
501
+ continue;
502
+ }
503
+ result = { ...result, thread: { ...header.thread, turns: response.data } };
504
+ nextCursor = response.nextCursor;
505
+ break;
506
+ }
507
+ } else if (header.thread?.historyMode === "paginated") {
424
508
  const turns = [], cursors = /* @__PURE__ */ new Set();
425
509
  let cursor = null, bytes = 0, complete = false;
426
510
  for (let page = 0; page < 100; page++) {
427
511
  if (routing.forHost(operation.hostId) !== route)
428
- throw new Error("Remote connection changed during read");
429
- const response = await manager.sendRequest("thread/turns/list", {
430
- threadId,
431
- cursor,
432
- limit: 50,
433
- sortDirection: "asc",
434
- itemsView: "full"
435
- });
512
+ throw connectionError("Remote connection changed during read", true);
513
+ const response = await read(
514
+ () => manager.sendRequest("thread/turns/list", {
515
+ threadId,
516
+ cursor,
517
+ limit: 50,
518
+ sortDirection: "asc",
519
+ itemsView: "full"
520
+ })
521
+ );
436
522
  if (!Array.isArray(response.data) || response.nextCursor !== null && typeof response.nextCursor !== "string")
437
523
  throw new Error("Invalid remote history page");
438
524
  bytes += new TextEncoder().encode(JSON.stringify(response.data)).byteLength;
@@ -448,28 +534,52 @@ async function rendererRemoteSession(target2, operation) {
448
534
  }
449
535
  if (!complete) throw new Error("Remote history exceeds the page limit");
450
536
  result = { ...result, thread: { ...header.thread, turns } };
451
- } else result = await manager.sendRequest("thread/read", { threadId, includeTurns: true });
537
+ } else
538
+ result = await read(
539
+ () => manager.sendRequest("thread/read", { threadId, includeTurns: true })
540
+ );
452
541
  if (routing.forHost(operation.hostId) !== route)
453
- throw new Error("Remote connection changed during read");
542
+ throw connectionError("Remote connection changed during read", true);
454
543
  let metadata = {};
455
- if (header.thread?.modelProvider === "codexhost") {
544
+ if (header.thread) {
456
545
  const cwd = header.thread.cwd;
457
546
  try {
458
547
  const configuration = await manager.sendRequest("codexhost/thread/inspect", {
459
548
  threadId
460
549
  });
461
550
  if (routing.forHost(operation.hostId) !== route)
462
- throw new Error("Remote connection changed during read");
463
- metadata = { configuration };
464
- if (configuration.owner === "external" && configuration.harnessId) {
465
- const harnessId = configuration.harnessId, key = JSON.stringify([harnessId, cwd]);
551
+ throw connectionError("Remote connection changed during read", true);
552
+ metadata = {
553
+ configuration,
554
+ ...configuration.owner === "codex" ? {
555
+ nativeSettings: {
556
+ model: header.thread.model,
557
+ reasoningEffort: header.thread.reasoningEffort,
558
+ serviceTier: header.thread.serviceTier
559
+ }
560
+ } : {}
561
+ };
562
+ if (configuration.owner === "codex" && manager.getConversation) {
563
+ const conversation = await Promise.resolve().then(() => manager.getConversation?.(threadId)).catch(() => void 0);
564
+ if (routing.forHost(operation.hostId) !== route)
565
+ throw connectionError("Remote connection changed during read", true);
566
+ const settings = conversation?.latestThreadSettings;
567
+ if (settings?.model === header.thread.model && typeof settings?.model === "string")
568
+ metadata.nativeSettings = {
569
+ model: settings.model,
570
+ reasoningEffort: header.thread.reasoningEffort === void 0 ? settings.effort : header.thread.reasoningEffort,
571
+ serviceTier: header.thread.serviceTier === void 0 ? settings.serviceTier : header.thread.serviceTier
572
+ };
573
+ }
574
+ if (configuration.owner === "codex" || configuration.owner === "external" && configuration.harnessId) {
575
+ const harnessId = configuration.owner === "codex" ? "codex" : configuration.harnessId ?? "codex", key = JSON.stringify([harnessId, cwd]);
466
576
  const cache = generation.metadata ??= /* @__PURE__ */ new Map();
467
577
  let discovery = cache.get(key);
468
578
  if (!discovery || Date.now() >= discovery.retryAt) {
469
579
  const loading = Promise.all([
470
580
  Promise.resolve().then(() => {
471
581
  if (routing.forHost(operation.hostId) !== route)
472
- throw new Error("Remote connection changed during read");
582
+ throw connectionError("Remote connection changed during read", true);
473
583
  return manager.sendRequest("codexhost/harness/inspect", {
474
584
  harnessId,
475
585
  ...cwd ? { cwd } : {}
@@ -477,7 +587,7 @@ async function rendererRemoteSession(target2, operation) {
477
587
  }),
478
588
  Promise.resolve().then(() => {
479
589
  if (routing.forHost(operation.hostId) !== route)
480
- throw new Error("Remote connection changed during read");
590
+ throw connectionError("Remote connection changed during read", true);
481
591
  return manager.sendRequest("codexhost/harness/plugins/list", {});
482
592
  }).catch(() => null)
483
593
  ]).then(([inspection, catalog]) => {
@@ -512,12 +622,13 @@ async function rendererRemoteSession(target2, operation) {
512
622
  }
513
623
  }
514
624
  if (routing.forHost(operation.hostId) !== route)
515
- throw new Error("Remote connection changed during read");
625
+ throw connectionError("Remote connection changed during read", true);
516
626
  const requests = await pendingRequests();
517
627
  return {
518
628
  result,
519
629
  ...metadata,
520
630
  epoch: generation.epoch,
631
+ ...operation.page ? { nextCursor } : {},
521
632
  interactionsAvailable: !!manager.getConversation && !!manager.replyWithCommandExecutionApprovalDecision && !!manager.replyWithFileChangeApprovalDecision,
522
633
  requests: requests.filter(
523
634
  (request) => (request.params.threadId ?? request.params.conversationId) === threadId && !generation.answered.has(JSON.stringify([threadId, request.id]))
@@ -547,7 +658,7 @@ async function rendererRemoteSession(target2, operation) {
547
658
  });
548
659
  if (routing.forHost(operation.hostId) !== route)
549
660
  throw new Error("Remote connection changed during configuration");
550
- if (configuration.owner !== "external")
661
+ if (configuration.owner !== "external" && configuration.owner !== "codex")
551
662
  throw new Error("Remote Thread configuration is unavailable");
552
663
  let method, params;
553
664
  if (operation.modelId !== void 0) {
@@ -570,7 +681,7 @@ async function rendererRemoteSession(target2, operation) {
570
681
  }
571
682
  }
572
683
  case "prompt":
573
- await manager.sendRequest("thread/resume", { threadId });
684
+ await manager.sendRequest("thread/resume", { threadId, excludeTurns: true });
574
685
  if (routing.forHost(operation.hostId) !== route)
575
686
  throw new Error("Remote connection changed during resume");
576
687
  return manager.sendRequest("turn/start", {
@@ -15240,13 +15351,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
15240
15351
  var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
15241
15352
  var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
15242
15353
  var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
15354
+ var usageOutputTimingSchema = external_exports.object({
15355
+ version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
15356
+ requestId: external_exports.string().min(1),
15357
+ turnId: external_exports.string().min(1).max(1024),
15358
+ outputTokens: nonNegativeSafeIntegerSchema,
15359
+ startedAtMs: nonNegativeSafeIntegerSchema,
15360
+ completedAtMs: nonNegativeSafeIntegerSchema
15361
+ }).strict().refine((value) => value.completedAtMs > value.startedAtMs);
15243
15362
  var usageMeasurementSchema = external_exports.object({
15363
+ version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
15244
15364
  value: finiteNonNegativeNumberSchema,
15245
15365
  turnId: external_exports.string().min(1).max(1024),
15246
15366
  at: nonNegativeSafeIntegerSchema
15247
15367
  }).strict();
15248
15368
  var usageMeasurementsSchema = external_exports.object({
15249
- outputTokensPerSecond: usageMeasurementSchema.optional(),
15369
+ // Older intervals can omit hidden thinking time; do not restore them into averages.
15370
+ outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
15371
+ // Retain independent TTFT facts when dropping incompatible speed measurements.
15372
+ outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
15250
15373
  timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
15251
15374
  }).strict();
15252
15375
  var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
@@ -15266,6 +15389,7 @@ var threadUsageSnapshotSchema = external_exports.object({
15266
15389
  cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
15267
15390
  outputTokens: nonNegativeSafeIntegerSchema.optional(),
15268
15391
  outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15392
+ sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15269
15393
  apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
15270
15394
  reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
15271
15395
  totalTokens: nonNegativeSafeIntegerSchema.optional(),
@@ -15697,11 +15821,19 @@ var threadSteeringInspectResultSchema = external_exports.object({
15697
15821
  delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
15698
15822
  }).strict();
15699
15823
 
15824
+ // packages/shared-contracts/dist/thread-archive-confirm.js
15825
+ var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
15826
+ var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
15827
+
15700
15828
  // packages/shared-contracts/dist/client-channel.js
15701
15829
  var CLIENT_CHANNEL_VERSION = 1;
15702
15830
  var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
15703
15831
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
15704
15832
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
15833
+ var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
15834
+ var clientThreadTreeSchema = external_exports.object({
15835
+ parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
15836
+ }).strict();
15705
15837
  var clientProjectlessWorkspaceSchema = external_exports.object({
15706
15838
  prompt: external_exports.string().max(16384).optional()
15707
15839
  }).strict();
@@ -15723,6 +15855,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
15723
15855
  cursor: clientChannelCursorSchema,
15724
15856
  cwd: external_exports.string().optional()
15725
15857
  }),
15858
+ external_exports.object({
15859
+ type: external_exports.literal("harness-inspection-changed"),
15860
+ cursor: clientChannelCursorSchema,
15861
+ harnessId: external_exports.string().min(1)
15862
+ }),
15726
15863
  external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
15727
15864
  external_exports.object({
15728
15865
  type: external_exports.literal("preferences-changed"),
@@ -15794,6 +15931,8 @@ var clientItemTruncationSchema = external_exports.object({
15794
15931
  var clientTurnSchema = external_exports.object({
15795
15932
  id: external_exports.string().min(1),
15796
15933
  status: external_exports.string().min(1),
15934
+ /** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
15935
+ codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
15797
15936
  items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
15798
15937
  /** Original file operations, independent of the cumulative Desktop fileChange card.
15799
15938
  * Insert before the named non-file Item; null appends at the end of the Turn.
@@ -15832,7 +15971,12 @@ var clientThreadSnapshotSchema = external_exports.object({
15832
15971
  /** Current interruptible Host Turn, including command Turns omitted from client history. */
15833
15972
  activeTurnId: external_exports.string().min(1).nullable().optional(),
15834
15973
  /** Most recent explicit command in this Host process; not native conversation history. */
15835
- command: external_exports.object({ name: external_exports.string().min(1), turn: clientTurnSchema }).optional(),
15974
+ command: external_exports.object({
15975
+ name: external_exports.string().min(1),
15976
+ turn: clientTurnSchema,
15977
+ /** First ordinary Turn started after this command; its retained result is not a new event. */
15978
+ subsequentTurnId: external_exports.string().min(1).optional()
15979
+ }).optional(),
15836
15980
  thread: external_exports.object({
15837
15981
  id: external_exports.string().min(1),
15838
15982
  cwd: external_exports.string(),
@@ -16040,7 +16184,6 @@ var webAccessStateSchema = external_exports.object({
16040
16184
  quotaUntil: external_exports.string().optional()
16041
16185
  }).strict().optional()
16042
16186
  }).strict();
16043
- var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
16044
16187
 
16045
16188
  // packages/shared-contracts/dist/delegation-read.js
16046
16189
  var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
@@ -16048,8 +16191,8 @@ var REMOTE_THREAD_CONTROL_TIMEOUT_MS = 4e4;
16048
16191
  var delegationReadParamsSchema = external_exports.strictObject({
16049
16192
  threadId: external_exports.string().min(1).max(1024),
16050
16193
  view: external_exports.enum(["result", "messages"]),
16051
- cursor: external_exports.string().min(1).max(8192).optional(),
16052
- limit: external_exports.number().int().min(1).max(100).optional()
16194
+ from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
16195
+ to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
16053
16196
  });
16054
16197
 
16055
16198
  // packages/shared-contracts/dist/credential-imports.js
@@ -17029,6 +17172,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
17029
17172
  "completed",
17030
17173
  "failed",
17031
17174
  "interrupted",
17175
+ "needsInput",
17032
17176
  "timedOut",
17033
17177
  "unreadable",
17034
17178
  "notFound"
@@ -17075,13 +17219,26 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
17075
17219
  var thread = { ...target, threadId: identity };
17076
17220
  var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
17077
17221
  external_exports.strictObject({ kind: external_exports.literal("hosts") }),
17222
+ external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
17078
17223
  external_exports.strictObject({
17079
17224
  kind: external_exports.literal("list"),
17080
17225
  ...target,
17081
17226
  cursor: external_exports.string().nullable(),
17082
17227
  archived: external_exports.boolean()
17083
17228
  }),
17084
- external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
17229
+ external_exports.strictObject({
17230
+ kind: external_exports.literal("read"),
17231
+ ...thread,
17232
+ page: external_exports.strictObject({
17233
+ cursor: external_exports.string().min(1).max(8192).nullable(),
17234
+ epoch: identity.optional(),
17235
+ sortDirection: external_exports.enum(["asc", "desc"]).optional(),
17236
+ limit: external_exports.number().int().min(1).max(20).optional()
17237
+ }).refine((page) => page.cursor === null || page.epoch !== void 0, {
17238
+ message: "A history continuation requires its connection epoch"
17239
+ }).optional()
17240
+ }),
17241
+ external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
17085
17242
  external_exports.strictObject({
17086
17243
  kind: external_exports.literal("configure"),
17087
17244
  ...thread,
@@ -17162,6 +17319,13 @@ var remoteConnectionsReplySchema = external_exports.union([
17162
17319
  external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
17163
17320
  ]);
17164
17321
 
17322
+ // packages/shared-contracts/dist/thread-title.js
17323
+ var threadTitleInputSchema = external_exports.strictObject({
17324
+ prompt: external_exports.string().trim().min(1).max(2e3),
17325
+ cwd: external_exports.string().max(4096).nullable()
17326
+ });
17327
+ var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
17328
+
17165
17329
  // packages/shared-contracts/dist/web-ui-extensions.js
17166
17330
  var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
17167
17331
  var localizedTextSchema2 = external_exports.union([
@@ -17210,7 +17374,7 @@ var MAX_REPLY_BYTES = 1024 * 1024;
17210
17374
  function remoteConnectionsExpression(input) {
17211
17375
  const request = remoteConnectionsRequestSchema.parse(input);
17212
17376
  if (request.action === "session")
17213
- return `(async () => { try { return {result:await (${rendererRemoteSession.toString()})(window,${JSON.stringify(request.operation)})}; } catch(error) {return {error:{code:-32090,message:String(error?.message ?? error)}};} })()`;
17377
+ return `(async () => { try { return {result:await (${rendererRemoteSession.toString()})(window,${JSON.stringify(request.operation)})}; } catch(error) {return {error:{code:typeof error?.code === "number" ? error.code : -32603,message:String(error?.message ?? error)}};} })()`;
17214
17378
  return `(async () => {
17215
17379
  try {
17216
17380
  const api = window.__codexhostRendererBindingProbeV1;
@@ -17354,7 +17518,7 @@ async function startControllerAttachmentServer(options) {
17354
17518
  JSON.stringify({
17355
17519
  error: {
17356
17520
  code: -32094,
17357
- message: input.action === "session" ? "Remote Thread snapshot exceeds the 16 MiB response limit; open this Thread in Codex Desktop. Paged remote snapshots are not supported." : "Thread snapshot exceeds the 16 MiB response limit; reduce the message page size. Oversized individual results are not supported."
17521
+ message: input.action === "session" ? "Remote history reply exceeds the 16 MiB limit; update codexhost on this computer to use paged history, or open this chat in Codex Desktop." : "Thread snapshot exceeds the 16 MiB response limit; reduce the message page size. Oversized individual results are not supported."
17358
17522
  }
17359
17523
  }) + "\n"
17360
17524
  );
@@ -19197,7 +19361,7 @@ async function installRendererLoadedModules(renderer) {
19197
19361
  };
19198
19362
  try {
19199
19363
  await renderer.command("Runtime.enable");
19200
- await renderer.command("Debugger.enable");
19364
+ await renderer.command("Debugger.enable", { maxScriptsCacheSize: 0 });
19201
19365
  ready = true;
19202
19366
  await flush();
19203
19367
  return dispose;
@@ -20337,9 +20501,9 @@ var InstalledRendererCdpControlSession = class {
20337
20501
  await this.renderer.command("Page.bringToFront");
20338
20502
  return 1;
20339
20503
  }
20340
- executeRenderer(expression) {
20504
+ executeRenderer(expression, timeoutMs) {
20341
20505
  if (this.#closed) return Promise.reject(new Error("Renderer CDP Control Session is closed"));
20342
- return this.renderer.evaluate(expression);
20506
+ return this.renderer.evaluate(expression, timeoutMs);
20343
20507
  }
20344
20508
  close() {
20345
20509
  if (this.#closed) return;
@@ -20404,6 +20568,20 @@ var TRANSIENT_INSTALL_RETRY_MS = 250;
20404
20568
  var RECOVERY_RETRY_INITIAL_MS = 3e4;
20405
20569
  var RECOVERY_RETRY_MAX_MS = 3e5;
20406
20570
  var REMOTE_CONNECTION_RECOVERY_INTERVAL_MS = 5e3;
20571
+ var SHUTDOWN_OPERATION_WAIT_MS = 3e3;
20572
+ async function settleWithin(promise2, milliseconds) {
20573
+ let timer;
20574
+ try {
20575
+ await Promise.race([
20576
+ promise2,
20577
+ new Promise((resolve) => {
20578
+ timer = setTimeout(resolve, milliseconds);
20579
+ })
20580
+ ]);
20581
+ } finally {
20582
+ clearTimeout(timer);
20583
+ }
20584
+ }
20407
20585
  var startupTraceStartedAt = Date.now();
20408
20586
  function startupTrace(stage, detail) {
20409
20587
  if (process.env.CODEXHOST_STARTUP_TRACE !== "1") return;
@@ -20621,7 +20799,10 @@ ${rendererSource}`,
20621
20799
  remoteConnections: async (request) => {
20622
20800
  const current = await useSession(() => recoverSession());
20623
20801
  return remoteConnectionsReplySchema.parse(
20624
- await current.executeRenderer(remoteConnectionsExpression(request))
20802
+ await current.executeRenderer(
20803
+ remoteConnectionsExpression(request),
20804
+ request.action === "read-thread" || request.action === "session" ? REMOTE_THREAD_CONTROL_TIMEOUT_MS : 3e4
20805
+ )
20625
20806
  );
20626
20807
  },
20627
20808
  openLocalPage: (url2) => openRendererLocalPage(
@@ -20666,8 +20847,9 @@ ${rendererSource}`,
20666
20847
  }
20667
20848
  } finally {
20668
20849
  await attachmentServer?.close();
20669
- await operation;
20850
+ await settleWithin(operation, SHUTDOWN_OPERATION_WAIT_MS);
20670
20851
  resetSession();
20852
+ void operation.then(resetSession);
20671
20853
  }
20672
20854
  }
20673
20855