@codexhost/cli-darwin-x64 0.24.0 → 0.25.1

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 (52) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +3166 -3040
  4. package/app/console-web.js +1156 -585
  5. package/app/desktop-controller.mjs +645 -264
  6. package/app/host-runtime.mjs +10906 -10282
  7. package/app/plugins/antigravity/plugin.mjs +515 -369
  8. package/app/plugins/claude-code/plugin.mjs +583 -438
  9. package/app/plugins/codebuddy/plugin.mjs +551 -429
  10. package/app/plugins/codex-usage/plugin.mjs +344 -224
  11. package/app/plugins/copilot/plugin.mjs +408 -286
  12. package/app/plugins/cursor-cli/plugin.mjs +499 -360
  13. package/app/plugins/deepseek-harness/plugin.mjs +759 -520
  14. package/app/plugins/devin/plugin.mjs +385 -265
  15. package/app/plugins/grok/plugin.mjs +638 -516
  16. package/app/plugins/hermes/plugin.mjs +456 -334
  17. package/app/plugins/kimi-code/plugin.mjs +454 -332
  18. package/app/plugins/kiro-cli/plugin.mjs +445 -325
  19. package/app/plugins/omp/plugin.mjs +707 -339
  20. package/app/plugins/opencode/plugin.mjs +873 -741
  21. package/app/plugins/pi/plugin.mjs +481 -359
  22. package/app/plugins/qoder/plugin.mjs +682 -560
  23. package/app/plugins/qoder-cn/plugin.mjs +682 -560
  24. package/app/plugins/qwen-code/plugin.mjs +475 -355
  25. package/app/plugins/workbuddy/plugin.mjs +549 -429
  26. package/app/plugins/zcode/plugin.mjs +352 -232
  27. package/app/renderer-extension.js +1706 -945
  28. package/app/web/assets/{index-IvFk9KT-.js → index-DUOvhHbV.js} +82 -82
  29. package/app/web/codexhost-settings.js +416 -51
  30. package/app/web/index.html +1 -1
  31. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +64 -64
  32. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  33. package/app/web/plugins/deepseek-ai__dsh-api-workspace-controller/client.js +1 -1
  34. package/app/web/plugins/deepseek-ai__dsh-client-shortcuts/client.js +1 -1
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-brand-official/client.js +1 -1
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -74
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +72 -72
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +97 -97
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +1 -1
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +2 -2
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
  44. package/app/web-modules/server.mjs +2132 -1312
  45. package/bin/codexhost +0 -0
  46. package/libexec/CodexHost.app/Contents/Info.plist +30 -0
  47. package/libexec/CodexHost.app/Contents/MacOS/CodexHost +0 -0
  48. package/libexec/CodexHost.app/Contents/PkgInfo +1 -0
  49. package/libexec/CodexHost.app/Contents/Resources/AppIcon.icns +0 -0
  50. package/libexec/codexhost-shim +0 -0
  51. package/libexec/codexhost-updater +0 -0
  52. package/package.json +1 -1
@@ -11714,8 +11714,182 @@ var CdpClient = class _CdpClient {
11714
11714
  }
11715
11715
  };
11716
11716
 
11717
+ // packages/desktop-control/src/renderer-remote-delivery.ts
11718
+ async function rendererRemoteDelivery(operation, read, write) {
11719
+ const { threadId } = operation;
11720
+ const record5 = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : void 0;
11721
+ const codeOf = (error51) => record5(error51)?.jsonRpcCode ?? record5(error51)?.code;
11722
+ const messageOf = (error51) => String(record5(error51)?.message ?? "");
11723
+ const queueUnavailable = (error51, method) => codeOf(error51) === -32601 || (codeOf(error51) === -32600 || codeOf(error51) === -32602) && (messageOf(error51).startsWith(`Invalid request: unknown variant \`${method}\``) || messageOf(error51) === `${method} requires experimentalApi capability` || messageOf(error51) === "user message queue is unavailable");
11724
+ const reject = (code, message) => ({ accepted: false, code, message });
11725
+ const readQueue = async (limit) => {
11726
+ const page = record5(await read("thread/queue/list", { threadId, cursor: null, limit }));
11727
+ if (!Array.isArray(page?.data) || page.data.length > limit || page.nextCursor !== null && (typeof page.nextCursor !== "string" || page.nextCursor.length === 0))
11728
+ throw new Error("Invalid remote queue response");
11729
+ return { data: page.data, nextCursor: page.nextCursor };
11730
+ };
11731
+ if (operation.kind === "queue") {
11732
+ let page;
11733
+ try {
11734
+ page = await readQueue(100);
11735
+ } catch (error51) {
11736
+ if (queueUnavailable(error51, "thread/queue/list")) return { available: false };
11737
+ throw error51;
11738
+ }
11739
+ if (page.nextCursor !== null) throw new Error("Remote queue exceeds the snapshot limit");
11740
+ const items = page.data.map((value) => {
11741
+ const item = record5(value);
11742
+ if (typeof item?.id !== "string" || typeof item.clientUserMessageId !== "string" || !Array.isArray(item.input))
11743
+ throw new Error("Invalid remote queue item");
11744
+ let preview = "";
11745
+ for (const value2 of item.input) {
11746
+ const part = record5(value2);
11747
+ const text2 = part?.type === "text" && typeof part.text === "string" ? part.text : typeof part?.type === "string" ? `[${part.type}]` : "";
11748
+ preview += (preview ? " " : "") + text2.slice(0, 801 - preview.length);
11749
+ if (preview.length >= 801) {
11750
+ preview = preview.slice(0, 800) + "…";
11751
+ break;
11752
+ }
11753
+ }
11754
+ return { id: item.id, clientUserMessageId: item.clientUserMessageId, preview };
11755
+ });
11756
+ if (new Set(items.map((item) => item.id)).size !== items.length)
11757
+ throw new Error("Remote queue repeats a submission");
11758
+ return { available: true, items };
11759
+ }
11760
+ const readHeader = async () => {
11761
+ const result2 = record5(await read("thread/read", { threadId, includeTurns: false }));
11762
+ const thread2 = record5(result2?.thread);
11763
+ const status = record5(thread2?.status)?.type;
11764
+ if (thread2?.id !== threadId || typeof status !== "string")
11765
+ throw new Error("Invalid remote Thread status");
11766
+ const strictSteerField = "codexhostSupportsStrictSteer";
11767
+ return {
11768
+ status,
11769
+ readOnly: thread2.canAcceptDirectInput === false,
11770
+ // The Host reserves both markers on its external Thread projections.
11771
+ external: thread2.modelProvider === "codexhost" && thread2.cliVersion === "codexhost",
11772
+ strictSteer: thread2[strictSteerField] === true
11773
+ };
11774
+ };
11775
+ const readOnly = () => reject("remote/send-rejected", "This remote Thread does not accept direct input.");
11776
+ let header = await readHeader();
11777
+ if (header.readOnly) return readOnly();
11778
+ const { action } = operation;
11779
+ if (action.kind === "remove") {
11780
+ try {
11781
+ const result2 = record5(
11782
+ await write("thread/queue/delete", { threadId, queuedSubmissionId: action.itemId })
11783
+ );
11784
+ if (result2?.deleted === true) return { accepted: true };
11785
+ if (result2?.deleted === false)
11786
+ return reject("session/queue-item-not-found", "Queued message is no longer pending.");
11787
+ throw new Error("Remote queue removal was not confirmed");
11788
+ } catch (error51) {
11789
+ if (codeOf(error51) === -32072 && messageOf(error51) === "Queued message is already starting")
11790
+ return reject("session/queue-item-starting", messageOf(error51));
11791
+ throw error51;
11792
+ }
11793
+ }
11794
+ if (action.kind === "start") {
11795
+ const busy = () => reject("remote/turn-changed", "The remote Thread is already running.");
11796
+ if (header.status === "active") return busy();
11797
+ try {
11798
+ if (action.onlyIfHead && record5((await readQueue(1)).data[0])?.id !== action.itemId)
11799
+ return { accepted: true };
11800
+ const result2 = record5(
11801
+ await write("thread/queue/start", { threadId, queuedSubmissionId: action.itemId })
11802
+ );
11803
+ if (typeof record5(result2?.turn)?.id === "string") return { accepted: true };
11804
+ throw new Error("Remote queued Turn start was not confirmed");
11805
+ } catch (error51) {
11806
+ const code = codeOf(error51);
11807
+ const message = messageOf(error51);
11808
+ if (code === -32600 && message === "thread already has an active or pending turn" || code === -32072 && message === "External Thread already has an active Turn")
11809
+ return busy();
11810
+ if (code === -32600 && message === `queued submission not found: ${action.itemId}` || code === -32072 && message === "Queued message not found")
11811
+ return reject("session/queue-item-not-found", "Queued message is no longer pending.");
11812
+ throw error51;
11813
+ }
11814
+ }
11815
+ const params = {
11816
+ threadId,
11817
+ input: [{ type: "text", text: action.text, text_elements: [] }],
11818
+ clientUserMessageId: action.requestId
11819
+ };
11820
+ if (action.kind === "steer") {
11821
+ const turnChanged = () => reject("remote/turn-changed", "The selected Turn has ended or changed.");
11822
+ if (header.status !== "active") return turnChanged();
11823
+ if (header.external && !header.strictSteer)
11824
+ return reject(
11825
+ "remote/steer-unavailable",
11826
+ "This remote Host does not support steering with a confirmed Turn target."
11827
+ );
11828
+ const strictTarget = {
11829
+ codexhostSteerStrictTarget: true
11830
+ };
11831
+ try {
11832
+ const result2 = record5(
11833
+ await write("turn/steer", {
11834
+ ...params,
11835
+ expectedTurnId: action.turnId,
11836
+ ...header.external ? strictTarget : {}
11837
+ })
11838
+ );
11839
+ if (result2?.turnId === action.turnId) return { accepted: true };
11840
+ if (header.external && result2?.delivery === "newTurn" && typeof result2.turnId === "string" && result2.turnId)
11841
+ return { accepted: true };
11842
+ throw new Error("Remote steering was not confirmed");
11843
+ } catch (error51) {
11844
+ const code = codeOf(error51);
11845
+ const message = messageOf(error51);
11846
+ if (code === -32600 && (message === "no active turn to steer" || /^expected active turn id .+ but found /u.test(message)) || code === -32074 && (message === "External steering must reference the active Turn" || message === "External steering target is no longer active"))
11847
+ return turnChanged();
11848
+ if (code === -32601 || code === -32602 || code === -32600 && message.startsWith("cannot steer "))
11849
+ return reject("remote/send-rejected", message);
11850
+ throw error51;
11851
+ }
11852
+ }
11853
+ if (header.status === "notLoaded") {
11854
+ await read("thread/resume", { threadId, excludeTurns: true });
11855
+ header = await readHeader();
11856
+ }
11857
+ if (header.readOnly) return readOnly();
11858
+ if (header.status !== "idle" && header.status !== "active")
11859
+ return reject("remote/send-rejected", "The remote Thread could not be opened for input.");
11860
+ const unavailable = () => reject("remote/queue-unavailable", "This remote Host does not support message queues.");
11861
+ let startNativeWhenEmpty = false;
11862
+ if (!header.external && header.status === "idle") {
11863
+ try {
11864
+ startNativeWhenEmpty = (await readQueue(1)).data.length === 0;
11865
+ } catch (error51) {
11866
+ if (queueUnavailable(error51, "thread/queue/list")) return unavailable();
11867
+ throw error51;
11868
+ }
11869
+ }
11870
+ const startExternalIfEmpty = {
11871
+ codexhostQueueStartIfEmpty: true
11872
+ };
11873
+ const addParams = header.external && header.status === "idle" ? { ...params, ...startExternalIfEmpty } : params;
11874
+ let result;
11875
+ try {
11876
+ result = record5(await write("thread/queue/add", addParams));
11877
+ } catch (error51) {
11878
+ if (queueUnavailable(error51, "thread/queue/add")) return unavailable();
11879
+ const code = codeOf(error51);
11880
+ const message = messageOf(error51);
11881
+ if (code === -32602 || code === -32600 && message === "queue cannot contain more than 100 submissions" || code === -32072 && (message === "External Thread queue is full" || message === "Message ID was already used with different input"))
11882
+ return reject("remote/send-rejected", message);
11883
+ throw error51;
11884
+ }
11885
+ const queued = record5(result?.queuedSubmission);
11886
+ if (typeof queued?.id !== "string" || !queued.id || queued.clientUserMessageId !== action.requestId)
11887
+ throw new Error("Remote queue admission was not confirmed");
11888
+ return { accepted: true, ...startNativeWhenEmpty ? { startQueuedItemId: queued.id } : {} };
11889
+ }
11890
+
11717
11891
  // packages/desktop-control/src/renderer-remote-sessions.ts
11718
- async function rendererRemoteSession(target2, operation) {
11892
+ async function rendererRemoteSession(target2, operation, delivery = rendererRemoteDelivery) {
11719
11893
  const routing = target2.__codexhostHostRoutingV1;
11720
11894
  if (!routing)
11721
11895
  throw Object.assign(new Error("Desktop remote session routing is unavailable"), {
@@ -11725,10 +11899,25 @@ async function rendererRemoteSession(target2, operation) {
11725
11899
  (id3) => /^remote-(?:ssh(?:-|:)|control:)/u.test(id3)
11726
11900
  );
11727
11901
  const state = target2.__codexhostRemoteSessionsV1 ??= { managers: /* @__PURE__ */ new WeakMap() };
11902
+ const connectionGeneration = (route2) => {
11903
+ let generation2 = state.managers.get(route2);
11904
+ if (!generation2) {
11905
+ generation2 = { epoch: crypto.randomUUID(), answered: /* @__PURE__ */ new Set() };
11906
+ state.managers.set(route2, generation2);
11907
+ }
11908
+ return generation2;
11909
+ };
11728
11910
  if (operation.kind === "hosts") {
11729
11911
  const api = target2.__codexhostRendererBindingProbeV1;
11730
11912
  if (!api?.remoteConnections)
11731
- return ids.map((hostId2) => ({ hostId: hostId2, online: !!routing.forHost(hostId2) }));
11913
+ return ids.map((hostId2) => {
11914
+ const route2 = routing.forHost(hostId2);
11915
+ return {
11916
+ hostId: hostId2,
11917
+ online: !!route2,
11918
+ ...route2 ? { epoch: connectionGeneration(route2).epoch } : {}
11919
+ };
11920
+ });
11732
11921
  const configured = await api.remoteConnections({ action: "catalog" });
11733
11922
  const connections = Array.isArray(configured) ? configured : [];
11734
11923
  const previous = state.reconnectAttempts;
@@ -11785,11 +11974,13 @@ async function rendererRemoteSession(target2, operation) {
11785
11974
  await attempt.loading;
11786
11975
  status = await api.remoteConnections({ action: "state", hostId: hostId2 }).catch(() => ({ state: "error" }));
11787
11976
  }
11977
+ const route2 = routing.forHost(hostId2);
11788
11978
  return {
11789
11979
  hostId: hostId2,
11790
11980
  displayName: connection?.displayName ?? (hostId2.startsWith("remote-control:") ? "Remote Control" : hostId2.replace(/^remote-ssh-(?:discovered|codex-managed):/u, "")),
11791
11981
  state: status.state,
11792
- online: status.state === "connected" && !!routing.forHost(hostId2)
11982
+ online: status.state === "connected" && !!route2,
11983
+ ...status.state === "connected" && route2 ? { epoch: connectionGeneration(route2).epoch } : {}
11793
11984
  };
11794
11985
  })
11795
11986
  );
@@ -11815,22 +12006,72 @@ async function rendererRemoteSession(target2, operation) {
11815
12006
  throw connectionError("Remote connection changed during read", true);
11816
12007
  return result;
11817
12008
  };
11818
- let generation = state.managers.get(route);
11819
- if (!generation) {
11820
- generation = { epoch: crypto.randomUUID(), answered: /* @__PURE__ */ new Set() };
11821
- state.managers.set(route, generation);
11822
- }
12009
+ const generation = connectionGeneration(route);
11823
12010
  if ("epoch" in operation && operation.epoch !== generation.epoch)
11824
12011
  throw connectionError("Remote connection changed; refresh before operating", true);
11825
- if (operation.kind === "list")
12012
+ if (operation.kind === "projectHarnesses") {
12013
+ const result = await read(
12014
+ () => manager.sendRequest("codexhost/harness/plugins/list", {})
12015
+ );
12016
+ return result.plugins.filter((plugin) => plugin.kind !== "usage").map(({ id: id3, name }) => ({ id: id3, name }));
12017
+ }
12018
+ if (operation.kind === "inspectHarness")
11826
12019
  return read(
12020
+ () => manager.sendRequest("codexhost/harness/inspect", {
12021
+ harnessId: operation.harnessId,
12022
+ cwd: operation.cwd
12023
+ })
12024
+ );
12025
+ if (operation.kind === "startSelected") {
12026
+ const result = await read(
12027
+ () => manager.sendRequest("thread/start", {
12028
+ cwd: operation.cwd,
12029
+ historyMode: "paginated",
12030
+ model: operation.model,
12031
+ ...operation.serviceTier ? { serviceTier: operation.serviceTier } : {},
12032
+ ...operation.reasoningEffort ? { config: { model_reasoning_effort: operation.reasoningEffort } } : {}
12033
+ })
12034
+ );
12035
+ const owner = await read(
12036
+ () => manager.sendRequest("codexhost/thread/inspect", {
12037
+ threadId: result.thread.id
12038
+ })
12039
+ );
12040
+ if ((owner.owner === "codex" ? "codex" : owner.owner === "external" ? owner.harnessId : void 0) !== operation.harnessId)
12041
+ throw new Error("Remote Host did not confirm the selected Harness; no message was sent");
12042
+ return result;
12043
+ }
12044
+ if (operation.kind === "create") {
12045
+ const result = await manager.sendRequest("thread/start", {
12046
+ cwd: operation.cwd,
12047
+ historyMode: "paginated"
12048
+ });
12049
+ if (routing.forHost(operation.hostId) !== route)
12050
+ throw connectionError("Remote connection changed during Thread creation", true);
12051
+ return result;
12052
+ }
12053
+ if (operation.kind === "list") {
12054
+ const loaded = operation.includeLoaded ? await read(() => manager.sendRequest("thread/loaded/list", {})) : void 0;
12055
+ const page = await read(
11827
12056
  () => manager.sendRequest("thread/list", {
11828
12057
  cursor: operation.cursor,
11829
12058
  archived: operation.archived,
11830
12059
  limit: 100
11831
12060
  })
11832
12061
  );
12062
+ return loaded ? { ...page, loaded: loaded.data, epoch: generation.epoch } : page;
12063
+ }
11833
12064
  const threadId = operation.threadId;
12065
+ if (operation.kind === "delivery" || operation.kind === "queue")
12066
+ return delivery(
12067
+ operation,
12068
+ (method, params) => read(() => manager.sendRequest(method, params)),
12069
+ async (method, params) => {
12070
+ if (routing.forHost(operation.hostId) !== route)
12071
+ throw connectionError("Remote connection changed before dispatch", true);
12072
+ return manager.sendRequest(method, params);
12073
+ }
12074
+ );
11834
12075
  if (operation.kind === "usage")
11835
12076
  return read(() => manager.sendRequest("codexhost/thread/usage/inspect", { threadId }));
11836
12077
  if (operation.kind === "status") {
@@ -11857,7 +12098,14 @@ async function rendererRemoteSession(target2, operation) {
11857
12098
  const latest = page.data[0];
11858
12099
  if (latest?.status === "inProgress" && typeof latest.id === "string") turnId = latest.id;
11859
12100
  }
11860
- return { threadId, status: result.thread.status.type, turnId, epoch: generation.epoch };
12101
+ return {
12102
+ threadId,
12103
+ status: result.thread.status.type,
12104
+ turnId,
12105
+ epoch: generation.epoch,
12106
+ supportsDelivery: true,
12107
+ ...result.thread.canAcceptDirectInput === false ? { readOnly: true } : {}
12108
+ };
11861
12109
  }
11862
12110
  const pendingRequests = async () => {
11863
12111
  const conversation = await read(() => manager.getConversation?.(threadId));
@@ -11873,20 +12121,34 @@ async function rendererRemoteSession(target2, operation) {
11873
12121
  () => manager.sendRequest("thread/read", { threadId, includeTurns: false })
11874
12122
  );
11875
12123
  const header = result;
11876
- let nextCursor = null;
11877
- const requestedPage = operation.page;
11878
- if (header.thread?.historyMode === "paginated" && requestedPage) {
11879
- let limit = requestedPage.limit ?? 20;
11880
- for (; ; ) {
11881
- const response = await read(
12124
+ const readTurns = async (cursor, limit, sortDirection) => {
12125
+ try {
12126
+ return await read(
11882
12127
  () => manager.sendRequest("thread/turns/list", {
11883
12128
  threadId,
11884
- cursor: requestedPage.cursor,
12129
+ cursor,
11885
12130
  limit,
11886
- sortDirection: requestedPage.sortDirection ?? "asc",
12131
+ sortDirection,
11887
12132
  itemsView: "full"
11888
12133
  })
11889
12134
  );
12135
+ } catch (error51) {
12136
+ const rpc = error51;
12137
+ if (cursor === null && (rpc?.jsonRpcCode ?? rpc?.code) === -32600 && rpc?.message === `thread ${threadId} is not materialized yet; thread/turns/list is unavailable before first user message`)
12138
+ return { data: [], nextCursor: null };
12139
+ throw error51;
12140
+ }
12141
+ };
12142
+ let nextCursor = null;
12143
+ const requestedPage = operation.page;
12144
+ if (header.thread?.historyMode === "paginated" && requestedPage) {
12145
+ let limit = requestedPage.limit ?? 20;
12146
+ for (; ; ) {
12147
+ const response = await readTurns(
12148
+ requestedPage.cursor,
12149
+ limit,
12150
+ requestedPage.sortDirection ?? "asc"
12151
+ );
11890
12152
  if (!Array.isArray(response.data) || response.nextCursor !== null && (typeof response.nextCursor !== "string" || response.nextCursor.length === 0))
11891
12153
  throw new Error("Invalid remote history page");
11892
12154
  if (new TextEncoder().encode(JSON.stringify(response.data)).byteLength > 14 * 1024 * 1024) {
@@ -11910,15 +12172,7 @@ async function rendererRemoteSession(target2, operation) {
11910
12172
  for (let page = 0; page < 100; page++) {
11911
12173
  if (routing.forHost(operation.hostId) !== route)
11912
12174
  throw connectionError("Remote connection changed during read", true);
11913
- const response = await read(
11914
- () => manager.sendRequest("thread/turns/list", {
11915
- threadId,
11916
- cursor,
11917
- limit: 50,
11918
- sortDirection: "asc",
11919
- itemsView: "full"
11920
- })
11921
- );
12175
+ const response = await readTurns(cursor, 50, "asc");
11922
12176
  if (!Array.isArray(response.data) || response.nextCursor !== null && typeof response.nextCursor !== "string")
11923
12177
  throw new Error("Invalid remote history page");
11924
12178
  bytes += new TextEncoder().encode(JSON.stringify(response.data)).byteLength;
@@ -12087,7 +12341,14 @@ async function rendererRemoteSession(target2, operation) {
12087
12341
  }
12088
12342
  }
12089
12343
  case "prompt":
12090
- await manager.sendRequest("thread/resume", { threadId, excludeTurns: true });
12344
+ try {
12345
+ await manager.sendRequest("thread/resume", { threadId, excludeTurns: true });
12346
+ } catch (error51) {
12347
+ if (error51?.message !== `no rollout found for thread id ${threadId}`)
12348
+ throw error51;
12349
+ const loaded = await read(() => manager.sendRequest("thread/loaded/list", {}));
12350
+ if (!loaded.data.includes(threadId)) throw error51;
12351
+ }
12091
12352
  if (routing.forHost(operation.hostId) !== route)
12092
12353
  throw new Error("Remote connection changed during resume");
12093
12354
  return manager.sendRequest("turn/start", {
@@ -12811,8 +13072,8 @@ function cached(getter) {
12811
13072
  }
12812
13073
  };
12813
13074
  }
12814
- function nullish(input) {
12815
- return input === null || input === void 0;
13075
+ function nullish(input2) {
13076
+ return input2 === null || input2 === void 0;
12816
13077
  }
12817
13078
  function cleanRegex(source) {
12818
13079
  const start = source.startsWith("^") ? 1 : 0;
@@ -12899,8 +13160,8 @@ function randomString(length = 10) {
12899
13160
  function esc(str) {
12900
13161
  return JSON.stringify(str);
12901
13162
  }
12902
- function slugify(input) {
12903
- return input.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
13163
+ function slugify(input2) {
13164
+ return input2.toLowerCase().trim().replace(/[^\w\s-]/g, "").replace(/[\s_-]+/g, "-").replace(/^-+|-+$/g, "");
12904
13165
  }
12905
13166
  var captureStackTrace = "captureStackTrace" in Error ? Error.captureStackTrace : (..._args) => {
12906
13167
  };
@@ -13305,19 +13566,19 @@ function finalizeIssue(iss, ctx, config2) {
13305
13566
  }
13306
13567
  return rest;
13307
13568
  }
13308
- function getSizableOrigin(input) {
13309
- if (input instanceof Set)
13569
+ function getSizableOrigin(input2) {
13570
+ if (input2 instanceof Set)
13310
13571
  return "set";
13311
- if (input instanceof Map)
13572
+ if (input2 instanceof Map)
13312
13573
  return "map";
13313
- if (input instanceof File)
13574
+ if (input2 instanceof File)
13314
13575
  return "file";
13315
13576
  return "unknown";
13316
13577
  }
13317
- function getLengthableOrigin(input) {
13318
- if (Array.isArray(input))
13578
+ function getLengthableOrigin(input2) {
13579
+ if (Array.isArray(input2))
13319
13580
  return "array";
13320
- if (typeof input === "string")
13581
+ if (typeof input2 === "string")
13321
13582
  return "string";
13322
13583
  return "unknown";
13323
13584
  }
@@ -13343,12 +13604,12 @@ function parsedType(data) {
13343
13604
  return t2;
13344
13605
  }
13345
13606
  function issue(...args) {
13346
- const [iss, input, inst] = args;
13607
+ const [iss, input2, inst] = args;
13347
13608
  if (typeof iss === "string") {
13348
13609
  return {
13349
13610
  message: iss,
13350
13611
  code: "custom",
13351
- input,
13612
+ input: input2,
13352
13613
  inst
13353
13614
  };
13354
13615
  }
@@ -13892,23 +14153,23 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
13892
14153
  bag.pattern = integer;
13893
14154
  });
13894
14155
  inst._zod.check = (payload) => {
13895
- const input = payload.value;
14156
+ const input2 = payload.value;
13896
14157
  if (isInt) {
13897
- if (!Number.isInteger(input)) {
14158
+ if (!Number.isInteger(input2)) {
13898
14159
  payload.issues.push({
13899
14160
  expected: origin,
13900
14161
  format: def.format,
13901
14162
  code: "invalid_type",
13902
14163
  continue: false,
13903
- input,
14164
+ input: input2,
13904
14165
  inst
13905
14166
  });
13906
14167
  return;
13907
14168
  }
13908
- if (!Number.isSafeInteger(input)) {
13909
- if (input > 0) {
14169
+ if (!Number.isSafeInteger(input2)) {
14170
+ if (input2 > 0) {
13910
14171
  payload.issues.push({
13911
- input,
14172
+ input: input2,
13912
14173
  code: "too_big",
13913
14174
  maximum: Number.MAX_SAFE_INTEGER,
13914
14175
  note: "Integers must be within the safe integer range.",
@@ -13919,7 +14180,7 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
13919
14180
  });
13920
14181
  } else {
13921
14182
  payload.issues.push({
13922
- input,
14183
+ input: input2,
13923
14184
  code: "too_small",
13924
14185
  minimum: Number.MIN_SAFE_INTEGER,
13925
14186
  note: "Integers must be within the safe integer range.",
@@ -13932,10 +14193,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
13932
14193
  return;
13933
14194
  }
13934
14195
  }
13935
- if (input < minimum) {
14196
+ if (input2 < minimum) {
13936
14197
  payload.issues.push({
13937
14198
  origin: "number",
13938
- input,
14199
+ input: input2,
13939
14200
  code: "too_small",
13940
14201
  minimum,
13941
14202
  inclusive: true,
@@ -13943,10 +14204,10 @@ var $ZodCheckNumberFormat = /* @__PURE__ */ $constructor("$ZodCheckNumberFormat"
13943
14204
  continue: !def.abort
13944
14205
  });
13945
14206
  }
13946
- if (input > maximum) {
14207
+ if (input2 > maximum) {
13947
14208
  payload.issues.push({
13948
14209
  origin: "number",
13949
- input,
14210
+ input: input2,
13950
14211
  code: "too_big",
13951
14212
  maximum,
13952
14213
  inclusive: true,
@@ -13966,11 +14227,11 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
13966
14227
  bag.maximum = maximum;
13967
14228
  });
13968
14229
  inst._zod.check = (payload) => {
13969
- const input = payload.value;
13970
- if (input < minimum) {
14230
+ const input2 = payload.value;
14231
+ if (input2 < minimum) {
13971
14232
  payload.issues.push({
13972
14233
  origin: "bigint",
13973
- input,
14234
+ input: input2,
13974
14235
  code: "too_small",
13975
14236
  minimum,
13976
14237
  inclusive: true,
@@ -13978,10 +14239,10 @@ var $ZodCheckBigIntFormat = /* @__PURE__ */ $constructor("$ZodCheckBigIntFormat"
13978
14239
  continue: !def.abort
13979
14240
  });
13980
14241
  }
13981
- if (input > maximum) {
14242
+ if (input2 > maximum) {
13982
14243
  payload.issues.push({
13983
14244
  origin: "bigint",
13984
- input,
14245
+ input: input2,
13985
14246
  code: "too_big",
13986
14247
  maximum,
13987
14248
  inclusive: true,
@@ -14004,16 +14265,16 @@ var $ZodCheckMaxSize = /* @__PURE__ */ $constructor("$ZodCheckMaxSize", (inst, d
14004
14265
  inst2._zod.bag.maximum = def.maximum;
14005
14266
  });
14006
14267
  inst._zod.check = (payload) => {
14007
- const input = payload.value;
14008
- const size = input.size;
14268
+ const input2 = payload.value;
14269
+ const size = input2.size;
14009
14270
  if (size <= def.maximum)
14010
14271
  return;
14011
14272
  payload.issues.push({
14012
- origin: getSizableOrigin(input),
14273
+ origin: getSizableOrigin(input2),
14013
14274
  code: "too_big",
14014
14275
  maximum: def.maximum,
14015
14276
  inclusive: true,
14016
- input,
14277
+ input: input2,
14017
14278
  inst,
14018
14279
  continue: !def.abort
14019
14280
  });
@@ -14032,16 +14293,16 @@ var $ZodCheckMinSize = /* @__PURE__ */ $constructor("$ZodCheckMinSize", (inst, d
14032
14293
  inst2._zod.bag.minimum = def.minimum;
14033
14294
  });
14034
14295
  inst._zod.check = (payload) => {
14035
- const input = payload.value;
14036
- const size = input.size;
14296
+ const input2 = payload.value;
14297
+ const size = input2.size;
14037
14298
  if (size >= def.minimum)
14038
14299
  return;
14039
14300
  payload.issues.push({
14040
- origin: getSizableOrigin(input),
14301
+ origin: getSizableOrigin(input2),
14041
14302
  code: "too_small",
14042
14303
  minimum: def.minimum,
14043
14304
  inclusive: true,
14044
- input,
14305
+ input: input2,
14045
14306
  inst,
14046
14307
  continue: !def.abort
14047
14308
  });
@@ -14061,13 +14322,13 @@ var $ZodCheckSizeEquals = /* @__PURE__ */ $constructor("$ZodCheckSizeEquals", (i
14061
14322
  bag.size = def.size;
14062
14323
  });
14063
14324
  inst._zod.check = (payload) => {
14064
- const input = payload.value;
14065
- const size = input.size;
14325
+ const input2 = payload.value;
14326
+ const size = input2.size;
14066
14327
  if (size === def.size)
14067
14328
  return;
14068
14329
  const tooBig = size > def.size;
14069
14330
  payload.issues.push({
14070
- origin: getSizableOrigin(input),
14331
+ origin: getSizableOrigin(input2),
14071
14332
  ...tooBig ? { code: "too_big", maximum: def.size } : { code: "too_small", minimum: def.size },
14072
14333
  inclusive: true,
14073
14334
  exact: true,
@@ -14090,17 +14351,17 @@ var $ZodCheckMaxLength = /* @__PURE__ */ $constructor("$ZodCheckMaxLength", (ins
14090
14351
  inst2._zod.bag.maximum = def.maximum;
14091
14352
  });
14092
14353
  inst._zod.check = (payload) => {
14093
- const input = payload.value;
14094
- const length = input.length;
14354
+ const input2 = payload.value;
14355
+ const length = input2.length;
14095
14356
  if (length <= def.maximum)
14096
14357
  return;
14097
- const origin = getLengthableOrigin(input);
14358
+ const origin = getLengthableOrigin(input2);
14098
14359
  payload.issues.push({
14099
14360
  origin,
14100
14361
  code: "too_big",
14101
14362
  maximum: def.maximum,
14102
14363
  inclusive: true,
14103
- input,
14364
+ input: input2,
14104
14365
  inst,
14105
14366
  continue: !def.abort
14106
14367
  });
@@ -14119,17 +14380,17 @@ var $ZodCheckMinLength = /* @__PURE__ */ $constructor("$ZodCheckMinLength", (ins
14119
14380
  inst2._zod.bag.minimum = def.minimum;
14120
14381
  });
14121
14382
  inst._zod.check = (payload) => {
14122
- const input = payload.value;
14123
- const length = input.length;
14383
+ const input2 = payload.value;
14384
+ const length = input2.length;
14124
14385
  if (length >= def.minimum)
14125
14386
  return;
14126
- const origin = getLengthableOrigin(input);
14387
+ const origin = getLengthableOrigin(input2);
14127
14388
  payload.issues.push({
14128
14389
  origin,
14129
14390
  code: "too_small",
14130
14391
  minimum: def.minimum,
14131
14392
  inclusive: true,
14132
- input,
14393
+ input: input2,
14133
14394
  inst,
14134
14395
  continue: !def.abort
14135
14396
  });
@@ -14149,11 +14410,11 @@ var $ZodCheckLengthEquals = /* @__PURE__ */ $constructor("$ZodCheckLengthEquals"
14149
14410
  bag.length = def.length;
14150
14411
  });
14151
14412
  inst._zod.check = (payload) => {
14152
- const input = payload.value;
14153
- const length = input.length;
14413
+ const input2 = payload.value;
14414
+ const length = input2.length;
14154
14415
  if (length === def.length)
14155
14416
  return;
14156
- const origin = getLengthableOrigin(input);
14417
+ const origin = getLengthableOrigin(input2);
14157
14418
  const tooBig = length > def.length;
14158
14419
  payload.issues.push({
14159
14420
  origin,
@@ -14824,15 +15085,15 @@ var $ZodNumber = /* @__PURE__ */ $constructor("$ZodNumber", (inst, def) => {
14824
15085
  payload.value = Number(payload.value);
14825
15086
  } catch (_2) {
14826
15087
  }
14827
- const input = payload.value;
14828
- if (typeof input === "number" && !Number.isNaN(input) && Number.isFinite(input)) {
15088
+ const input2 = payload.value;
15089
+ if (typeof input2 === "number" && !Number.isNaN(input2) && Number.isFinite(input2)) {
14829
15090
  return payload;
14830
15091
  }
14831
- const received = typeof input === "number" ? Number.isNaN(input) ? "NaN" : !Number.isFinite(input) ? "Infinity" : void 0 : void 0;
15092
+ const received = typeof input2 === "number" ? Number.isNaN(input2) ? "NaN" : !Number.isFinite(input2) ? "Infinity" : void 0 : void 0;
14832
15093
  payload.issues.push({
14833
15094
  expected: "number",
14834
15095
  code: "invalid_type",
14835
- input,
15096
+ input: input2,
14836
15097
  inst,
14837
15098
  ...received ? { received } : {}
14838
15099
  });
@@ -14852,13 +15113,13 @@ var $ZodBoolean = /* @__PURE__ */ $constructor("$ZodBoolean", (inst, def) => {
14852
15113
  payload.value = Boolean(payload.value);
14853
15114
  } catch (_2) {
14854
15115
  }
14855
- const input = payload.value;
14856
- if (typeof input === "boolean")
15116
+ const input2 = payload.value;
15117
+ if (typeof input2 === "boolean")
14857
15118
  return payload;
14858
15119
  payload.issues.push({
14859
15120
  expected: "boolean",
14860
15121
  code: "invalid_type",
14861
- input,
15122
+ input: input2,
14862
15123
  inst
14863
15124
  });
14864
15125
  return payload;
@@ -14891,13 +15152,13 @@ var $ZodBigIntFormat = /* @__PURE__ */ $constructor("$ZodBigIntFormat", (inst, d
14891
15152
  var $ZodSymbol = /* @__PURE__ */ $constructor("$ZodSymbol", (inst, def) => {
14892
15153
  $ZodType.init(inst, def);
14893
15154
  inst._zod.parse = (payload, _ctx) => {
14894
- const input = payload.value;
14895
- if (typeof input === "symbol")
15155
+ const input2 = payload.value;
15156
+ if (typeof input2 === "symbol")
14896
15157
  return payload;
14897
15158
  payload.issues.push({
14898
15159
  expected: "symbol",
14899
15160
  code: "invalid_type",
14900
- input,
15161
+ input: input2,
14901
15162
  inst
14902
15163
  });
14903
15164
  return payload;
@@ -14908,13 +15169,13 @@ var $ZodUndefined = /* @__PURE__ */ $constructor("$ZodUndefined", (inst, def) =>
14908
15169
  inst._zod.pattern = _undefined;
14909
15170
  inst._zod.values = /* @__PURE__ */ new Set([void 0]);
14910
15171
  inst._zod.parse = (payload, _ctx) => {
14911
- const input = payload.value;
14912
- if (typeof input === "undefined")
15172
+ const input2 = payload.value;
15173
+ if (typeof input2 === "undefined")
14913
15174
  return payload;
14914
15175
  payload.issues.push({
14915
15176
  expected: "undefined",
14916
15177
  code: "invalid_type",
14917
- input,
15178
+ input: input2,
14918
15179
  inst
14919
15180
  });
14920
15181
  return payload;
@@ -14925,13 +15186,13 @@ var $ZodNull = /* @__PURE__ */ $constructor("$ZodNull", (inst, def) => {
14925
15186
  inst._zod.pattern = _null;
14926
15187
  inst._zod.values = /* @__PURE__ */ new Set([null]);
14927
15188
  inst._zod.parse = (payload, _ctx) => {
14928
- const input = payload.value;
14929
- if (input === null)
15189
+ const input2 = payload.value;
15190
+ if (input2 === null)
14930
15191
  return payload;
14931
15192
  payload.issues.push({
14932
15193
  expected: "null",
14933
15194
  code: "invalid_type",
14934
- input,
15195
+ input: input2,
14935
15196
  inst
14936
15197
  });
14937
15198
  return payload;
@@ -14960,13 +15221,13 @@ var $ZodNever = /* @__PURE__ */ $constructor("$ZodNever", (inst, def) => {
14960
15221
  var $ZodVoid = /* @__PURE__ */ $constructor("$ZodVoid", (inst, def) => {
14961
15222
  $ZodType.init(inst, def);
14962
15223
  inst._zod.parse = (payload, _ctx) => {
14963
- const input = payload.value;
14964
- if (typeof input === "undefined")
15224
+ const input2 = payload.value;
15225
+ if (typeof input2 === "undefined")
14965
15226
  return payload;
14966
15227
  payload.issues.push({
14967
15228
  expected: "void",
14968
15229
  code: "invalid_type",
14969
- input,
15230
+ input: input2,
14970
15231
  inst
14971
15232
  });
14972
15233
  return payload;
@@ -14981,15 +15242,15 @@ var $ZodDate = /* @__PURE__ */ $constructor("$ZodDate", (inst, def) => {
14981
15242
  } catch (_err) {
14982
15243
  }
14983
15244
  }
14984
- const input = payload.value;
14985
- const isDate = input instanceof Date;
14986
- const isValidDate = isDate && !Number.isNaN(input.getTime());
15245
+ const input2 = payload.value;
15246
+ const isDate = input2 instanceof Date;
15247
+ const isValidDate = isDate && !Number.isNaN(input2.getTime());
14987
15248
  if (isValidDate)
14988
15249
  return payload;
14989
15250
  payload.issues.push({
14990
15251
  expected: "date",
14991
15252
  code: "invalid_type",
14992
- input,
15253
+ input: input2,
14993
15254
  ...isDate ? { received: "Invalid Date" } : {},
14994
15255
  inst
14995
15256
  });
@@ -15005,20 +15266,20 @@ function handleArrayResult(result, final, index) {
15005
15266
  var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
15006
15267
  $ZodType.init(inst, def);
15007
15268
  inst._zod.parse = (payload, ctx) => {
15008
- const input = payload.value;
15009
- if (!Array.isArray(input)) {
15269
+ const input2 = payload.value;
15270
+ if (!Array.isArray(input2)) {
15010
15271
  payload.issues.push({
15011
15272
  expected: "array",
15012
15273
  code: "invalid_type",
15013
- input,
15274
+ input: input2,
15014
15275
  inst
15015
15276
  });
15016
15277
  return payload;
15017
15278
  }
15018
- payload.value = Array(input.length);
15279
+ payload.value = Array(input2.length);
15019
15280
  const proms = [];
15020
- for (let i2 = 0; i2 < input.length; i2++) {
15021
- const item = input[i2];
15281
+ for (let i2 = 0; i2 < input2.length; i2++) {
15282
+ const item = input2[i2];
15022
15283
  const result = def.element._zod.run({
15023
15284
  value: item,
15024
15285
  issues: []
@@ -15035,8 +15296,8 @@ var $ZodArray = /* @__PURE__ */ $constructor("$ZodArray", (inst, def) => {
15035
15296
  return payload;
15036
15297
  };
15037
15298
  });
15038
- function handlePropertyResult(result, final, key, input, isOptionalIn, isOptionalOut) {
15039
- const isPresent = key in input;
15299
+ function handlePropertyResult(result, final, key, input2, isOptionalIn, isOptionalOut) {
15300
+ const isPresent = key in input2;
15040
15301
  if (result.issues.length) {
15041
15302
  if (isOptionalIn && isOptionalOut && !isPresent) {
15042
15303
  return;
@@ -15078,14 +15339,14 @@ function normalizeDef(def) {
15078
15339
  optionalKeys: new Set(okeys)
15079
15340
  };
15080
15341
  }
15081
- function handleCatchall(proms, input, payload, ctx, def, inst) {
15342
+ function handleCatchall(proms, input2, payload, ctx, def, inst) {
15082
15343
  const unrecognized = [];
15083
15344
  const keySet = def.keySet;
15084
15345
  const _catchall = def.catchall._zod;
15085
15346
  const t2 = _catchall.def.type;
15086
15347
  const isOptionalIn = _catchall.optin === "optional";
15087
15348
  const isOptionalOut = _catchall.optout === "optional";
15088
- for (const key in input) {
15349
+ for (const key in input2) {
15089
15350
  if (key === "__proto__")
15090
15351
  continue;
15091
15352
  if (keySet.has(key))
@@ -15094,18 +15355,18 @@ function handleCatchall(proms, input, payload, ctx, def, inst) {
15094
15355
  unrecognized.push(key);
15095
15356
  continue;
15096
15357
  }
15097
- const r2 = _catchall.run({ value: input[key], issues: [] }, ctx);
15358
+ const r2 = _catchall.run({ value: input2[key], issues: [] }, ctx);
15098
15359
  if (r2 instanceof Promise) {
15099
- proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input, isOptionalIn, isOptionalOut)));
15360
+ proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input2, isOptionalIn, isOptionalOut)));
15100
15361
  } else {
15101
- handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut);
15362
+ handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut);
15102
15363
  }
15103
15364
  }
15104
15365
  if (unrecognized.length) {
15105
15366
  payload.issues.push({
15106
15367
  code: "unrecognized_keys",
15107
15368
  keys: unrecognized,
15108
- input,
15369
+ input: input2,
15109
15370
  inst
15110
15371
  });
15111
15372
  }
@@ -15149,12 +15410,12 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
15149
15410
  let value;
15150
15411
  inst._zod.parse = (payload, ctx) => {
15151
15412
  value ?? (value = _normalized.value);
15152
- const input = payload.value;
15153
- if (!isObject2(input)) {
15413
+ const input2 = payload.value;
15414
+ if (!isObject2(input2)) {
15154
15415
  payload.issues.push({
15155
15416
  expected: "object",
15156
15417
  code: "invalid_type",
15157
- input,
15418
+ input: input2,
15158
15419
  inst
15159
15420
  });
15160
15421
  return payload;
@@ -15166,17 +15427,17 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
15166
15427
  const el2 = shape[key];
15167
15428
  const isOptionalIn = el2._zod.optin === "optional";
15168
15429
  const isOptionalOut = el2._zod.optout === "optional";
15169
- const r2 = el2._zod.run({ value: input[key], issues: [] }, ctx);
15430
+ const r2 = el2._zod.run({ value: input2[key], issues: [] }, ctx);
15170
15431
  if (r2 instanceof Promise) {
15171
- proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input, isOptionalIn, isOptionalOut)));
15432
+ proms.push(r2.then((r3) => handlePropertyResult(r3, payload, key, input2, isOptionalIn, isOptionalOut)));
15172
15433
  } else {
15173
- handlePropertyResult(r2, payload, key, input, isOptionalIn, isOptionalOut);
15434
+ handlePropertyResult(r2, payload, key, input2, isOptionalIn, isOptionalOut);
15174
15435
  }
15175
15436
  }
15176
15437
  if (!catchall) {
15177
15438
  return proms.length ? Promise.all(proms).then(() => payload) : payload;
15178
15439
  }
15179
- return handleCatchall(proms, input, payload, ctx, _normalized.value, inst);
15440
+ return handleCatchall(proms, input2, payload, ctx, _normalized.value, inst);
15180
15441
  };
15181
15442
  });
15182
15443
  var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) => {
@@ -15285,12 +15546,12 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
15285
15546
  let value;
15286
15547
  inst._zod.parse = (payload, ctx) => {
15287
15548
  value ?? (value = _normalized.value);
15288
- const input = payload.value;
15289
- if (!isObject2(input)) {
15549
+ const input2 = payload.value;
15550
+ if (!isObject2(input2)) {
15290
15551
  payload.issues.push({
15291
15552
  expected: "object",
15292
15553
  code: "invalid_type",
15293
- input,
15554
+ input: input2,
15294
15555
  inst
15295
15556
  });
15296
15557
  return payload;
@@ -15301,7 +15562,7 @@ var $ZodObjectJIT = /* @__PURE__ */ $constructor("$ZodObjectJIT", (inst, def) =>
15301
15562
  payload = fastpass(payload, ctx);
15302
15563
  if (!catchall)
15303
15564
  return payload;
15304
- return handleCatchall([], input, payload, ctx, value, inst);
15565
+ return handleCatchall([], input2, payload, ctx, value, inst);
15305
15566
  }
15306
15567
  return superParse(payload, ctx);
15307
15568
  };
@@ -15461,17 +15722,17 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
15461
15722
  return map2;
15462
15723
  });
15463
15724
  inst._zod.parse = (payload, ctx) => {
15464
- const input = payload.value;
15465
- if (!isObject(input)) {
15725
+ const input2 = payload.value;
15726
+ if (!isObject(input2)) {
15466
15727
  payload.issues.push({
15467
15728
  code: "invalid_type",
15468
15729
  expected: "object",
15469
- input,
15730
+ input: input2,
15470
15731
  inst
15471
15732
  });
15472
15733
  return payload;
15473
15734
  }
15474
- const opt = disc.value.get(input?.[def.discriminator]);
15735
+ const opt = disc.value.get(input2?.[def.discriminator]);
15475
15736
  if (opt) {
15476
15737
  return opt._zod.run(payload, ctx);
15477
15738
  }
@@ -15484,7 +15745,7 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
15484
15745
  note: "No matching discriminator",
15485
15746
  discriminator: def.discriminator,
15486
15747
  options: Array.from(disc.value.keys()),
15487
- input,
15748
+ input: input2,
15488
15749
  path: [def.discriminator],
15489
15750
  inst
15490
15751
  });
@@ -15494,9 +15755,9 @@ var $ZodDiscriminatedUnion = /* @__PURE__ */ $constructor("$ZodDiscriminatedUnio
15494
15755
  var $ZodIntersection = /* @__PURE__ */ $constructor("$ZodIntersection", (inst, def) => {
15495
15756
  $ZodType.init(inst, def);
15496
15757
  inst._zod.parse = (payload, ctx) => {
15497
- const input = payload.value;
15498
- const left = def.left._zod.run({ value: input, issues: [] }, ctx);
15499
- const right = def.right._zod.run({ value: input, issues: [] }, ctx);
15758
+ const input2 = payload.value;
15759
+ const left = def.left._zod.run({ value: input2, issues: [] }, ctx);
15760
+ const right = def.right._zod.run({ value: input2, issues: [] }, ctx);
15500
15761
  const async = left instanceof Promise || right instanceof Promise;
15501
15762
  if (async) {
15502
15763
  return Promise.all([left, right]).then(([left2, right2]) => {
@@ -15593,10 +15854,10 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
15593
15854
  $ZodType.init(inst, def);
15594
15855
  const items = def.items;
15595
15856
  inst._zod.parse = (payload, ctx) => {
15596
- const input = payload.value;
15597
- if (!Array.isArray(input)) {
15857
+ const input2 = payload.value;
15858
+ if (!Array.isArray(input2)) {
15598
15859
  payload.issues.push({
15599
- input,
15860
+ input: input2,
15600
15861
  inst,
15601
15862
  expected: "tuple",
15602
15863
  code: "invalid_type"
@@ -15608,23 +15869,23 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
15608
15869
  const optinStart = getTupleOptStart(items, "optin");
15609
15870
  const optoutStart = getTupleOptStart(items, "optout");
15610
15871
  if (!def.rest) {
15611
- if (input.length < optinStart) {
15872
+ if (input2.length < optinStart) {
15612
15873
  payload.issues.push({
15613
15874
  code: "too_small",
15614
15875
  minimum: optinStart,
15615
15876
  inclusive: true,
15616
- input,
15877
+ input: input2,
15617
15878
  inst,
15618
15879
  origin: "array"
15619
15880
  });
15620
15881
  return payload;
15621
15882
  }
15622
- if (input.length > items.length) {
15883
+ if (input2.length > items.length) {
15623
15884
  payload.issues.push({
15624
15885
  code: "too_big",
15625
15886
  maximum: items.length,
15626
15887
  inclusive: true,
15627
- input,
15888
+ input: input2,
15628
15889
  inst,
15629
15890
  origin: "array"
15630
15891
  });
@@ -15632,7 +15893,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
15632
15893
  }
15633
15894
  const itemResults = new Array(items.length);
15634
15895
  for (let i2 = 0; i2 < items.length; i2++) {
15635
- const r2 = items[i2]._zod.run({ value: input[i2], issues: [] }, ctx);
15896
+ const r2 = items[i2]._zod.run({ value: input2[i2], issues: [] }, ctx);
15636
15897
  if (r2 instanceof Promise) {
15637
15898
  proms.push(r2.then((rr2) => {
15638
15899
  itemResults[i2] = rr2;
@@ -15643,7 +15904,7 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
15643
15904
  }
15644
15905
  if (def.rest) {
15645
15906
  let i2 = items.length - 1;
15646
- const rest = input.slice(items.length);
15907
+ const rest = input2.slice(items.length);
15647
15908
  for (const el2 of rest) {
15648
15909
  i2++;
15649
15910
  const result = def.rest._zod.run({ value: el2, issues: [] }, ctx);
@@ -15655,9 +15916,9 @@ var $ZodTuple = /* @__PURE__ */ $constructor("$ZodTuple", (inst, def) => {
15655
15916
  }
15656
15917
  }
15657
15918
  if (proms.length) {
15658
- return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input, optoutStart));
15919
+ return Promise.all(proms).then(() => handleTupleResults(itemResults, payload, items, input2, optoutStart));
15659
15920
  }
15660
- return handleTupleResults(itemResults, payload, items, input, optoutStart);
15921
+ return handleTupleResults(itemResults, payload, items, input2, optoutStart);
15661
15922
  };
15662
15923
  });
15663
15924
  function getTupleOptStart(items, key) {
@@ -15673,10 +15934,10 @@ function handleTupleResult(result, final, index) {
15673
15934
  }
15674
15935
  final.value[index] = result.value;
15675
15936
  }
15676
- function handleTupleResults(itemResults, final, items, input, optoutStart) {
15937
+ function handleTupleResults(itemResults, final, items, input2, optoutStart) {
15677
15938
  for (let i2 = 0; i2 < items.length; i2++) {
15678
15939
  const r2 = itemResults[i2];
15679
- const isPresent = i2 < input.length;
15940
+ const isPresent = i2 < input2.length;
15680
15941
  if (r2.issues.length) {
15681
15942
  if (!isPresent && i2 >= optoutStart) {
15682
15943
  final.value.length = i2;
@@ -15686,7 +15947,7 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
15686
15947
  }
15687
15948
  final.value[i2] = r2.value;
15688
15949
  }
15689
- for (let i2 = final.value.length - 1; i2 >= input.length; i2--) {
15950
+ for (let i2 = final.value.length - 1; i2 >= input2.length; i2--) {
15690
15951
  if (items[i2]._zod.optout === "optional" && final.value[i2] === void 0) {
15691
15952
  final.value.length = i2;
15692
15953
  } else {
@@ -15698,12 +15959,12 @@ function handleTupleResults(itemResults, final, items, input, optoutStart) {
15698
15959
  var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15699
15960
  $ZodType.init(inst, def);
15700
15961
  inst._zod.parse = (payload, ctx) => {
15701
- const input = payload.value;
15702
- if (!isPlainObject(input)) {
15962
+ const input2 = payload.value;
15963
+ if (!isPlainObject(input2)) {
15703
15964
  payload.issues.push({
15704
15965
  expected: "record",
15705
15966
  code: "invalid_type",
15706
- input,
15967
+ input: input2,
15707
15968
  inst
15708
15969
  });
15709
15970
  return payload;
@@ -15732,7 +15993,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15732
15993
  continue;
15733
15994
  }
15734
15995
  const outKey = keyResult.value;
15735
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
15996
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
15736
15997
  if (result instanceof Promise) {
15737
15998
  proms.push(result.then((result2) => {
15738
15999
  if (result2.issues.length) {
@@ -15749,7 +16010,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15749
16010
  }
15750
16011
  }
15751
16012
  let unrecognized;
15752
- for (const key in input) {
16013
+ for (const key in input2) {
15753
16014
  if (!recordKeys.has(key)) {
15754
16015
  unrecognized = unrecognized ?? [];
15755
16016
  unrecognized.push(key);
@@ -15758,17 +16019,17 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15758
16019
  if (unrecognized && unrecognized.length > 0) {
15759
16020
  payload.issues.push({
15760
16021
  code: "unrecognized_keys",
15761
- input,
16022
+ input: input2,
15762
16023
  inst,
15763
16024
  keys: unrecognized
15764
16025
  });
15765
16026
  }
15766
16027
  } else {
15767
16028
  payload.value = {};
15768
- for (const key of Reflect.ownKeys(input)) {
16029
+ for (const key of Reflect.ownKeys(input2)) {
15769
16030
  if (key === "__proto__")
15770
16031
  continue;
15771
- if (!Object.prototype.propertyIsEnumerable.call(input, key))
16032
+ if (!Object.prototype.propertyIsEnumerable.call(input2, key))
15772
16033
  continue;
15773
16034
  let keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
15774
16035
  if (keyResult instanceof Promise) {
@@ -15786,7 +16047,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15786
16047
  }
15787
16048
  if (keyResult.issues.length) {
15788
16049
  if (def.mode === "loose") {
15789
- payload.value[key] = input[key];
16050
+ payload.value[key] = input2[key];
15790
16051
  } else {
15791
16052
  payload.issues.push({
15792
16053
  code: "invalid_key",
@@ -15799,7 +16060,7 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15799
16060
  }
15800
16061
  continue;
15801
16062
  }
15802
- const result = def.valueType._zod.run({ value: input[key], issues: [] }, ctx);
16063
+ const result = def.valueType._zod.run({ value: input2[key], issues: [] }, ctx);
15803
16064
  if (result instanceof Promise) {
15804
16065
  proms.push(result.then((result2) => {
15805
16066
  if (result2.issues.length) {
@@ -15824,27 +16085,27 @@ var $ZodRecord = /* @__PURE__ */ $constructor("$ZodRecord", (inst, def) => {
15824
16085
  var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
15825
16086
  $ZodType.init(inst, def);
15826
16087
  inst._zod.parse = (payload, ctx) => {
15827
- const input = payload.value;
15828
- if (!(input instanceof Map)) {
16088
+ const input2 = payload.value;
16089
+ if (!(input2 instanceof Map)) {
15829
16090
  payload.issues.push({
15830
16091
  expected: "map",
15831
16092
  code: "invalid_type",
15832
- input,
16093
+ input: input2,
15833
16094
  inst
15834
16095
  });
15835
16096
  return payload;
15836
16097
  }
15837
16098
  const proms = [];
15838
16099
  payload.value = /* @__PURE__ */ new Map();
15839
- for (const [key, value] of input) {
16100
+ for (const [key, value] of input2) {
15840
16101
  const keyResult = def.keyType._zod.run({ value: key, issues: [] }, ctx);
15841
16102
  const valueResult = def.valueType._zod.run({ value, issues: [] }, ctx);
15842
16103
  if (keyResult instanceof Promise || valueResult instanceof Promise) {
15843
16104
  proms.push(Promise.all([keyResult, valueResult]).then(([keyResult2, valueResult2]) => {
15844
- handleMapResult(keyResult2, valueResult2, payload, key, input, inst, ctx);
16105
+ handleMapResult(keyResult2, valueResult2, payload, key, input2, inst, ctx);
15845
16106
  }));
15846
16107
  } else {
15847
- handleMapResult(keyResult, valueResult, payload, key, input, inst, ctx);
16108
+ handleMapResult(keyResult, valueResult, payload, key, input2, inst, ctx);
15848
16109
  }
15849
16110
  }
15850
16111
  if (proms.length)
@@ -15852,7 +16113,7 @@ var $ZodMap = /* @__PURE__ */ $constructor("$ZodMap", (inst, def) => {
15852
16113
  return payload;
15853
16114
  };
15854
16115
  });
15855
- function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
16116
+ function handleMapResult(keyResult, valueResult, final, key, input2, inst, ctx) {
15856
16117
  if (keyResult.issues.length) {
15857
16118
  if (propertyKeyTypes.has(typeof key)) {
15858
16119
  final.issues.push(...prefixIssues(key, keyResult.issues));
@@ -15860,7 +16121,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
15860
16121
  final.issues.push({
15861
16122
  code: "invalid_key",
15862
16123
  origin: "map",
15863
- input,
16124
+ input: input2,
15864
16125
  inst,
15865
16126
  issues: keyResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
15866
16127
  });
@@ -15873,7 +16134,7 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
15873
16134
  final.issues.push({
15874
16135
  origin: "map",
15875
16136
  code: "invalid_element",
15876
- input,
16137
+ input: input2,
15877
16138
  inst,
15878
16139
  key,
15879
16140
  issues: valueResult.issues.map((iss) => finalizeIssue(iss, ctx, config()))
@@ -15885,10 +16146,10 @@ function handleMapResult(keyResult, valueResult, final, key, input, inst, ctx) {
15885
16146
  var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
15886
16147
  $ZodType.init(inst, def);
15887
16148
  inst._zod.parse = (payload, ctx) => {
15888
- const input = payload.value;
15889
- if (!(input instanceof Set)) {
16149
+ const input2 = payload.value;
16150
+ if (!(input2 instanceof Set)) {
15890
16151
  payload.issues.push({
15891
- input,
16152
+ input: input2,
15892
16153
  inst,
15893
16154
  expected: "set",
15894
16155
  code: "invalid_type"
@@ -15897,7 +16158,7 @@ var $ZodSet = /* @__PURE__ */ $constructor("$ZodSet", (inst, def) => {
15897
16158
  }
15898
16159
  const proms = [];
15899
16160
  payload.value = /* @__PURE__ */ new Set();
15900
- for (const item of input) {
16161
+ for (const item of input2) {
15901
16162
  const result = def.valueType._zod.run({ value: item, issues: [] }, ctx);
15902
16163
  if (result instanceof Promise) {
15903
16164
  proms.push(result.then((result2) => handleSetResult(result2, payload)));
@@ -15922,14 +16183,14 @@ var $ZodEnum = /* @__PURE__ */ $constructor("$ZodEnum", (inst, def) => {
15922
16183
  inst._zod.values = valuesSet;
15923
16184
  inst._zod.pattern = new RegExp(`^(${values.filter((k2) => propertyKeyTypes.has(typeof k2)).map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2.toString()).join("|")})$`);
15924
16185
  inst._zod.parse = (payload, _ctx) => {
15925
- const input = payload.value;
15926
- if (valuesSet.has(input)) {
16186
+ const input2 = payload.value;
16187
+ if (valuesSet.has(input2)) {
15927
16188
  return payload;
15928
16189
  }
15929
16190
  payload.issues.push({
15930
16191
  code: "invalid_value",
15931
16192
  values,
15932
- input,
16193
+ input: input2,
15933
16194
  inst
15934
16195
  });
15935
16196
  return payload;
@@ -15944,14 +16205,14 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
15944
16205
  inst._zod.values = values;
15945
16206
  inst._zod.pattern = new RegExp(`^(${def.values.map((o2) => typeof o2 === "string" ? escapeRegex(o2) : o2 ? escapeRegex(o2.toString()) : String(o2)).join("|")})$`);
15946
16207
  inst._zod.parse = (payload, _ctx) => {
15947
- const input = payload.value;
15948
- if (values.has(input)) {
16208
+ const input2 = payload.value;
16209
+ if (values.has(input2)) {
15949
16210
  return payload;
15950
16211
  }
15951
16212
  payload.issues.push({
15952
16213
  code: "invalid_value",
15953
16214
  values: def.values,
15954
- input,
16215
+ input: input2,
15955
16216
  inst
15956
16217
  });
15957
16218
  return payload;
@@ -15960,13 +16221,13 @@ var $ZodLiteral = /* @__PURE__ */ $constructor("$ZodLiteral", (inst, def) => {
15960
16221
  var $ZodFile = /* @__PURE__ */ $constructor("$ZodFile", (inst, def) => {
15961
16222
  $ZodType.init(inst, def);
15962
16223
  inst._zod.parse = (payload, _ctx) => {
15963
- const input = payload.value;
15964
- if (input instanceof File)
16224
+ const input2 = payload.value;
16225
+ if (input2 instanceof File)
15965
16226
  return payload;
15966
16227
  payload.issues.push({
15967
16228
  expected: "file",
15968
16229
  code: "invalid_type",
15969
- input,
16230
+ input: input2,
15970
16231
  inst
15971
16232
  });
15972
16233
  return payload;
@@ -15996,8 +16257,8 @@ var $ZodTransform = /* @__PURE__ */ $constructor("$ZodTransform", (inst, def) =>
15996
16257
  return payload;
15997
16258
  };
15998
16259
  });
15999
- function handleOptionalResult(result, input) {
16000
- if (input === void 0 && (result.issues.length || result.fallback)) {
16260
+ function handleOptionalResult(result, input2) {
16261
+ if (input2 === void 0 && (result.issues.length || result.fallback)) {
16001
16262
  return { issues: [], value: void 0 };
16002
16263
  }
16003
16264
  return result;
@@ -16015,11 +16276,11 @@ var $ZodOptional = /* @__PURE__ */ $constructor("$ZodOptional", (inst, def) => {
16015
16276
  });
16016
16277
  inst._zod.parse = (payload, ctx) => {
16017
16278
  if (def.innerType._zod.optin === "optional") {
16018
- const input = payload.value;
16279
+ const input2 = payload.value;
16019
16280
  const result = def.innerType._zod.run(payload, ctx);
16020
16281
  if (result instanceof Promise)
16021
- return result.then((r2) => handleOptionalResult(r2, input));
16022
- return handleOptionalResult(result, input);
16282
+ return result.then((r2) => handleOptionalResult(r2, input2));
16283
+ return handleOptionalResult(result, input2);
16023
16284
  }
16024
16285
  if (payload.value === void 0) {
16025
16286
  return payload;
@@ -16444,20 +16705,20 @@ var $ZodCustom = /* @__PURE__ */ $constructor("$ZodCustom", (inst, def) => {
16444
16705
  return payload;
16445
16706
  };
16446
16707
  inst._zod.check = (payload) => {
16447
- const input = payload.value;
16448
- const r2 = def.fn(input);
16708
+ const input2 = payload.value;
16709
+ const r2 = def.fn(input2);
16449
16710
  if (r2 instanceof Promise) {
16450
- return r2.then((r3) => handleRefineResult(r3, payload, input, inst));
16711
+ return r2.then((r3) => handleRefineResult(r3, payload, input2, inst));
16451
16712
  }
16452
- handleRefineResult(r2, payload, input, inst);
16713
+ handleRefineResult(r2, payload, input2, inst);
16453
16714
  return;
16454
16715
  };
16455
16716
  });
16456
- function handleRefineResult(result, payload, input, inst) {
16717
+ function handleRefineResult(result, payload, input2, inst) {
16457
16718
  if (!result) {
16458
16719
  const _iss = {
16459
16720
  code: "custom",
16460
- input,
16721
+ input: input2,
16461
16722
  inst,
16462
16723
  // incorporates params.error into issue reporting
16463
16724
  path: [...inst._zod.def.path ?? []],
@@ -19744,8 +20005,8 @@ function ko_default() {
19744
20005
  }
19745
20006
 
19746
20007
  // node_modules/zod/v4/locales/lt.js
19747
- var capitalizeFirstCharacter = (text) => {
19748
- return text.charAt(0).toUpperCase() + text.slice(1);
20008
+ var capitalizeFirstCharacter = (text2) => {
20009
+ return text2.charAt(0).toUpperCase() + text2.slice(1);
19749
20010
  };
19750
20011
  function getUnitTypeFromNumber(number4) {
19751
20012
  const abs = Math.abs(number4);
@@ -23145,23 +23406,23 @@ function _overwrite(tx) {
23145
23406
  }
23146
23407
  // @__NO_SIDE_EFFECTS__
23147
23408
  function _normalize(form) {
23148
- return /* @__PURE__ */ _overwrite((input) => input.normalize(form));
23409
+ return /* @__PURE__ */ _overwrite((input2) => input2.normalize(form));
23149
23410
  }
23150
23411
  // @__NO_SIDE_EFFECTS__
23151
23412
  function _trim() {
23152
- return /* @__PURE__ */ _overwrite((input) => input.trim());
23413
+ return /* @__PURE__ */ _overwrite((input2) => input2.trim());
23153
23414
  }
23154
23415
  // @__NO_SIDE_EFFECTS__
23155
23416
  function _toLowerCase() {
23156
- return /* @__PURE__ */ _overwrite((input) => input.toLowerCase());
23417
+ return /* @__PURE__ */ _overwrite((input2) => input2.toLowerCase());
23157
23418
  }
23158
23419
  // @__NO_SIDE_EFFECTS__
23159
23420
  function _toUpperCase() {
23160
- return /* @__PURE__ */ _overwrite((input) => input.toUpperCase());
23421
+ return /* @__PURE__ */ _overwrite((input2) => input2.toUpperCase());
23161
23422
  }
23162
23423
  // @__NO_SIDE_EFFECTS__
23163
23424
  function _slugify() {
23164
- return /* @__PURE__ */ _overwrite((input) => slugify(input));
23425
+ return /* @__PURE__ */ _overwrite((input2) => slugify(input2));
23165
23426
  }
23166
23427
  // @__NO_SIDE_EFFECTS__
23167
23428
  function _array(Class2, element, params) {
@@ -23466,8 +23727,8 @@ function _stringbool(Classes, _params) {
23466
23727
  type: "pipe",
23467
23728
  in: stringSchema,
23468
23729
  out: booleanSchema,
23469
- transform: ((input, payload) => {
23470
- let data = input;
23730
+ transform: ((input2, payload) => {
23731
+ let data = input2;
23471
23732
  if (params.case !== "sensitive")
23472
23733
  data = data.toLowerCase();
23473
23734
  if (truthySet.has(data)) {
@@ -23486,8 +23747,8 @@ function _stringbool(Classes, _params) {
23486
23747
  return {};
23487
23748
  }
23488
23749
  }),
23489
- reverseTransform: ((input, _payload) => {
23490
- if (input === true) {
23750
+ reverseTransform: ((input2, _payload) => {
23751
+ if (input2 === true) {
23491
23752
  return truthyArray[0] || "true";
23492
23753
  } else {
23493
23754
  return falsyArray[0] || "false";
@@ -24383,9 +24644,9 @@ var allProcessors = {
24383
24644
  optional: optionalProcessor,
24384
24645
  lazy: lazyProcessor
24385
24646
  };
24386
- function toJSONSchema(input, params) {
24387
- if ("_idmap" in input) {
24388
- const registry2 = input;
24647
+ function toJSONSchema(input2, params) {
24648
+ if ("_idmap" in input2) {
24649
+ const registry2 = input2;
24389
24650
  const ctx2 = initializeContext({ ...params, processors: allProcessors });
24390
24651
  const defs = {};
24391
24652
  for (const entry of registry2._idmap.entries()) {
@@ -24413,9 +24674,9 @@ function toJSONSchema(input, params) {
24413
24674
  return { schemas };
24414
24675
  }
24415
24676
  const ctx = initializeContext({ ...params, processors: allProcessors });
24416
- process2(input, ctx);
24417
- extractDefs(ctx, input);
24418
- return finalize(ctx, input);
24677
+ process2(input2, ctx);
24678
+ extractDefs(ctx, input2);
24679
+ return finalize(ctx, input2);
24419
24680
  }
24420
24681
 
24421
24682
  // node_modules/zod/v4/core/json-schema-generator.js
@@ -26692,7 +26953,7 @@ var codexhostErrorSchema = external_exports.strictObject({
26692
26953
 
26693
26954
  // packages/shared-contracts/dist/harness-presentation.js
26694
26955
  var localeSchema = external_exports.string().max(64).regex(/^[a-z]{2,3}(?:-[A-Za-z0-9]{2,8})*$/u);
26695
- var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text) => text.trim().length > 0);
26956
+ var displayText = (maximum) => external_exports.string().min(1).max(maximum).refine((text2) => text2.trim().length > 0);
26696
26957
  var harnessLocalizationsSchema = external_exports.record(localeSchema, external_exports.object({
26697
26958
  label: displayText(256).optional(),
26698
26959
  description: displayText(1024).optional()
@@ -26781,7 +27042,7 @@ var usageMeasurementsSchema = external_exports.object({
26781
27042
  outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
26782
27043
  timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
26783
27044
  }).strict();
26784
- var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
27045
+ var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
26785
27046
  var composerIndicatorsSchema = external_exports.array(external_exports.object({
26786
27047
  kind: external_exports.literal("countdown"),
26787
27048
  id: external_exports.string().min(1).max(64),
@@ -27164,6 +27425,8 @@ var externalThreadInspectionSchema = external_exports.object({
27164
27425
  effectiveThinkingOptionId: harnessThinkingOptionIdSchema.optional(),
27165
27426
  availableThinkingOptions: harnessThinkingOptionsSchema.optional(),
27166
27427
  effectivePermissionModeId: harnessPermissionModeIdSchema.optional(),
27428
+ /** Live Session catalog when it, not the Adapter inspection, contains `effectiveModel`. */
27429
+ catalog: harnessModelCatalogSchema.optional(),
27167
27430
  history: harnessHistoryCapabilitiesSchema,
27168
27431
  usage: threadUsageSnapshotSchema.optional(),
27169
27432
  locked: external_exports.literal(true)
@@ -27222,9 +27485,9 @@ var threadSteeringInspectParamsSchema = external_exports.object({
27222
27485
  }).strict();
27223
27486
  var threadSteeringContextSchema = external_exports.object({
27224
27487
  kind: external_exports.literal("application"),
27225
- value: external_exports.string().transform((text, context) => {
27488
+ value: external_exports.string().transform((text2, context) => {
27226
27489
  try {
27227
- return JSON.parse(text);
27490
+ return JSON.parse(text2);
27228
27491
  } catch {
27229
27492
  context.addIssue({ code: "custom", message: "Invalid steering context JSON" });
27230
27493
  return external_exports.NEVER;
@@ -27359,8 +27622,8 @@ var desktopExtensionHttpUrlSchema = external_exports.string().trim().max(2048).r
27359
27622
  const { username, password } = new URL(value);
27360
27623
  return !username && !password && !/[\\\s]/u.test(value);
27361
27624
  }, "URL must not contain credentials, backslashes, or whitespace");
27362
- function localizedText(text) {
27363
- return external_exports.strictObject({ en: text, "zh-CN": text });
27625
+ function localizedText(text2) {
27626
+ return external_exports.strictObject({ en: text2, "zh-CN": text2 });
27364
27627
  }
27365
27628
  var desktopExtensionLocalizedTextSchema = localizedText(external_exports.string().trim().min(1));
27366
27629
  var categoriesSchema = external_exports.array(desktopExtensionCategorySchema).max(desktopExtensionCategorySchema.options.length).refine((categories) => new Set(categories).size === categories.length, "Duplicate categories");
@@ -27490,8 +27753,8 @@ var desktopExtensionTrustTierSchema = external_exports.enum(["official", "commun
27490
27753
  function isGitHubDesktopExtensionZipballUrl(url2) {
27491
27754
  return url2.origin === "https://api.github.com" && /^\/repos\/[\w-]+\/[\w.-]+\/zipball(?:\/[^/]+)?\/?$/u.test(url2.pathname);
27492
27755
  }
27493
- var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input) => {
27494
- const url2 = new URL(input);
27756
+ var desktopExtensionZipUrlSchema = desktopExtensionHttpUrlSchema.refine((input2) => {
27757
+ const url2 = new URL(input2);
27495
27758
  return /\.zip$/iu.test(url2.pathname) || isGitHubDesktopExtensionZipballUrl(url2) || url2.origin === "https://github.com" && /^\/[\w-]+\/[\w.-]+\/zipball(?:\/.+)?\/?$/u.test(url2.pathname) || url2.origin === "https://codeload.github.com" && /^\/[\w-]+\/[\w.-]+\/(?:zip|zipball|legacy\.zip)\/.+$/u.test(url2.pathname);
27496
27759
  }, "Expected a .zip download URL or a GitHub zipball URL");
27497
27760
  var desktopExtensionCatalogEntrySchema = external_exports.strictObject({
@@ -27911,6 +28174,8 @@ var CLIENT_CHANNEL_METHODS = [
27911
28174
  "codexhost/workspace/read",
27912
28175
  "codexhost/thread/tree/read",
27913
28176
  "codexhost/thread/pins/list",
28177
+ "codexhost/thread/sections/list",
28178
+ "codexhost/thread/sections/move",
27914
28179
  "codexhost/thread/pins/set",
27915
28180
  "codexhost/harness/plugins/list",
27916
28181
  "codexhost/harness/inspect",
@@ -27949,8 +28214,21 @@ var CLIENT_CHANNEL_METHODS = [
27949
28214
  "codexhost/update/check",
27950
28215
  "codexhost/update/start",
27951
28216
  "codexhost/update/status",
28217
+ "codexhost/announcement/get",
28218
+ "codexhost/announcement/acknowledge",
27952
28219
  "codexhost/sessions/loaded/list"
27953
28220
  ];
28221
+ var clientThreadSectionsSchema = external_exports.object({
28222
+ sections: external_exports.array(external_exports.object({
28223
+ id: external_exports.string().min(1),
28224
+ name: external_exports.string().min(1),
28225
+ threads: external_exports.array(jsonObjectSchema)
28226
+ }).strict())
28227
+ }).strict();
28228
+ var clientThreadSectionMoveSchema = external_exports.object({
28229
+ threadId: external_exports.string().min(1).max(1024),
28230
+ sectionId: external_exports.string().min(1).max(1024).nullable()
28231
+ }).strict();
27954
28232
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
27955
28233
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
27956
28234
  var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
@@ -28493,8 +28771,8 @@ var harnessPreferencePatchSchema = external_exports.strictObject({
28493
28771
  operations: external_exports.array(harnessPreferenceOperationSchema).min(1).max(256),
28494
28772
  initializeOnly: external_exports.boolean().optional(),
28495
28773
  expectedRevision: external_exports.number().int().nonnegative().optional()
28496
- }).superRefine((input, ctx) => {
28497
- for (const operation of input.operations) {
28774
+ }).superRefine((input2, ctx) => {
28775
+ for (const operation of input2.operations) {
28498
28776
  if (operation.kind === "newThread" && (!operation.lastHarness && !operation.configuration || Boolean(operation.harnessId) !== Boolean(operation.configuration)))
28499
28777
  ctx.addIssue({
28500
28778
  code: "custom",
@@ -28896,13 +29174,18 @@ var harnessLaunchSettingsSchema = external_exports.object({
28896
29174
  // packages/shared-contracts/dist/harness-installation.js
28897
29175
  var harnessInstallationParamsSchema = external_exports.object({
28898
29176
  harnessId: harnessIdSchema,
28899
- action: external_exports.enum(["check", "update", "install"])
28900
- }).strict();
29177
+ action: external_exports.enum(["check", "update", "install"]),
29178
+ confirmedVersion: external_exports.string().min(1).max(128).optional()
29179
+ }).strict().refine(({ action, confirmedVersion }) => action === "update" || confirmedVersion === void 0);
28901
29180
  var harnessInstallationStateSchema = external_exports.object({
28902
29181
  currentVersion: external_exports.string().min(1).max(128),
28903
29182
  latestVersion: external_exports.string().min(1).max(128),
28904
29183
  updateAvailable: external_exports.boolean(),
28905
29184
  canUpdate: external_exports.boolean(),
29185
+ /** Present when the Adapter has a verified list and the available target is outside it. */
29186
+ latestVerifiedVersion: external_exports.string().min(1).max(128).optional(),
29187
+ /** Update preflight stopped before running the installer; latestVersion needs confirmation. */
29188
+ confirmationRequired: external_exports.literal(true).optional(),
28906
29189
  /** Defaults to CLI; some Harnesses ship only inside a desktop application. */
28907
29190
  versionKind: external_exports.enum(["cli", "application"]).optional(),
28908
29191
  /** Official download opened by the user; does not imply an automatic installation. */
@@ -29227,6 +29510,38 @@ var updateStatusResultSchema = external_exports.strictObject({
29227
29510
  status: updateStatusSchema.nullable()
29228
29511
  });
29229
29512
 
29513
+ // packages/shared-contracts/dist/release-announcement.js
29514
+ var RELEASE_ANNOUNCEMENT_MAX_THEMES = 12;
29515
+ var releaseAnnouncementThemeSchema = external_exports.strictObject({
29516
+ icon: external_exports.string().min(1).max(16).optional(),
29517
+ title: external_exports.string().min(1).max(120),
29518
+ body: external_exports.string().min(1).max(1200),
29519
+ contributors: external_exports.array(external_exports.string().min(1).max(39)).max(30)
29520
+ });
29521
+ var releaseAnnouncementContentSchema = external_exports.strictObject({
29522
+ summary: external_exports.string().min(1).max(600).optional(),
29523
+ themes: external_exports.array(releaseAnnouncementThemeSchema).min(1).max(RELEASE_ANNOUNCEMENT_MAX_THEMES)
29524
+ });
29525
+ var releaseAnnouncementSchema = external_exports.strictObject({
29526
+ version: updateSemanticVersionSchema,
29527
+ publishedAt: external_exports.iso.datetime(),
29528
+ url: external_exports.string().max(300).regex(/^https:\/\/github\.com\/BytePioneer-AI\/codex-host\/releases\/tag\/v[0-9A-Za-z.+-]+$/u),
29529
+ zh: releaseAnnouncementContentSchema.nullable(),
29530
+ en: releaseAnnouncementContentSchema.nullable()
29531
+ }).refine((value) => value.zh !== null || value.en !== null, {
29532
+ message: "an announcement needs at least one language"
29533
+ });
29534
+ var releaseAnnouncementGetParamsSchema = external_exports.strictObject({
29535
+ manual: external_exports.boolean().optional()
29536
+ });
29537
+ var releaseAnnouncementGetResultSchema = external_exports.strictObject({
29538
+ announcement: releaseAnnouncementSchema.nullable(),
29539
+ unread: external_exports.boolean()
29540
+ });
29541
+ var releaseAnnouncementAcknowledgeParamsSchema = external_exports.strictObject({
29542
+ version: updateSemanticVersionSchema
29543
+ });
29544
+
29230
29545
  // packages/shared-contracts/dist/thread-watch-notice.js
29231
29546
  var THREAD_WATCH_NOTICE_OUTCOMES = [
29232
29547
  "completed",
@@ -29274,17 +29589,67 @@ var remoteSshSetupResultSchema = external_exports.object({ state: external_expor
29274
29589
 
29275
29590
  // packages/shared-contracts/dist/remote-sessions.js
29276
29591
  var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
29277
- var identity = external_exports.string().min(1).max(1024);
29592
+ var REMOTE_IDENTITY_MAX_LENGTH = 1024;
29593
+ var identity = external_exports.string().min(1).max(REMOTE_IDENTITY_MAX_LENGTH);
29278
29594
  var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
29279
29595
  var thread = { ...target, threadId: identity };
29596
+ var text = external_exports.string().min(1).max(8e3);
29597
+ var input = { text, requestId: identity };
29598
+ var remoteDeliveryReplySchema = external_exports.discriminatedUnion("accepted", [
29599
+ external_exports.object({ accepted: external_exports.literal(true), startQueuedItemId: identity.optional() }),
29600
+ external_exports.object({
29601
+ accepted: external_exports.literal(false),
29602
+ code: external_exports.enum([
29603
+ "remote/queue-unavailable",
29604
+ "remote/steer-unavailable",
29605
+ "remote/turn-changed",
29606
+ "remote/send-rejected",
29607
+ "session/queue-item-not-found",
29608
+ "session/queue-item-starting"
29609
+ ]),
29610
+ message: external_exports.string()
29611
+ })
29612
+ ]);
29613
+ var remoteQueueSnapshotSchema = external_exports.discriminatedUnion("available", [
29614
+ external_exports.object({ available: external_exports.literal(false) }),
29615
+ external_exports.object({
29616
+ available: external_exports.literal(true),
29617
+ items: external_exports.array(external_exports.object({ id: identity, clientUserMessageId: identity, preview: external_exports.string().max(801) })).max(100)
29618
+ })
29619
+ ]);
29280
29620
  var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
29281
29621
  external_exports.strictObject({ kind: external_exports.literal("hosts") }),
29622
+ external_exports.strictObject({
29623
+ kind: external_exports.literal("create"),
29624
+ ...target,
29625
+ cwd: external_exports.string().min(1).max(8192),
29626
+ epoch: identity
29627
+ }),
29628
+ external_exports.strictObject({ kind: external_exports.literal("projectHarnesses"), ...target, epoch: identity }),
29629
+ external_exports.strictObject({
29630
+ kind: external_exports.literal("inspectHarness"),
29631
+ ...target,
29632
+ epoch: identity,
29633
+ cwd: external_exports.string().min(1).max(8192),
29634
+ harnessId: identity
29635
+ }),
29636
+ external_exports.strictObject({
29637
+ kind: external_exports.literal("startSelected"),
29638
+ ...target,
29639
+ epoch: identity,
29640
+ cwd: external_exports.string().min(1).max(8192),
29641
+ harnessId: identity,
29642
+ model: external_exports.string().min(1).max(4096),
29643
+ serviceTier: external_exports.enum(["priority", "ultrafast"]).optional(),
29644
+ reasoningEffort: identity.optional()
29645
+ }),
29282
29646
  external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
29283
29647
  external_exports.strictObject({
29284
29648
  kind: external_exports.literal("list"),
29285
29649
  ...target,
29286
29650
  cursor: external_exports.string().nullable(),
29287
- archived: external_exports.boolean()
29651
+ archived: external_exports.boolean(),
29652
+ includeLoaded: external_exports.literal(true).optional()
29288
29653
  }),
29289
29654
  external_exports.strictObject({
29290
29655
  kind: external_exports.literal("read"),
@@ -29314,9 +29679,25 @@ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
29314
29679
  kind: external_exports.literal("prompt"),
29315
29680
  ...thread,
29316
29681
  epoch: identity,
29317
- text: external_exports.string().min(1).max(8e3),
29682
+ text,
29318
29683
  requestId: identity.optional()
29319
29684
  }),
29685
+ external_exports.strictObject({ kind: external_exports.literal("queue"), ...thread, epoch: identity }),
29686
+ external_exports.strictObject({
29687
+ kind: external_exports.literal("delivery"),
29688
+ ...thread,
29689
+ epoch: identity,
29690
+ action: external_exports.discriminatedUnion("kind", [
29691
+ external_exports.strictObject({ kind: external_exports.literal("enqueue"), ...input }),
29692
+ external_exports.strictObject({ kind: external_exports.literal("steer"), ...input, turnId: identity }),
29693
+ external_exports.strictObject({ kind: external_exports.literal("remove"), itemId: identity }),
29694
+ external_exports.strictObject({
29695
+ kind: external_exports.literal("start"),
29696
+ itemId: identity,
29697
+ onlyIfHead: external_exports.literal(true).optional()
29698
+ })
29699
+ ])
29700
+ }),
29320
29701
  external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
29321
29702
  external_exports.strictObject({
29322
29703
  kind: external_exports.literal("rename"),
@@ -29434,10 +29815,10 @@ var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT
29434
29815
 
29435
29816
  // packages/desktop-control/src/remote-connections-control.ts
29436
29817
  var MAX_REPLY_BYTES = 1024 * 1024;
29437
- function remoteConnectionsExpression(input) {
29438
- const request = remoteConnectionsRequestSchema.parse(input);
29818
+ function remoteConnectionsExpression(input2) {
29819
+ const request = remoteConnectionsRequestSchema.parse(input2);
29439
29820
  if (request.action === "session")
29440
- 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)}};} })()`;
29821
+ return `(async () => { try { return {result:await (${rendererRemoteSession.toString()})(window,${JSON.stringify(request.operation)},${rendererRemoteDelivery.toString()})}; } catch(error) {return {error:{code:typeof error?.code === "number" ? error.code : -32603,message:String(error?.message ?? error)}};} })()`;
29441
29822
  return `(async () => {
29442
29823
  try {
29443
29824
  const api = window.__codexhostRendererBindingProbeV1;
@@ -29562,9 +29943,9 @@ async function startControllerAttachmentServer(options) {
29562
29943
  }
29563
29944
  const remotePrefix = `REMOTE ${options.nonce} `;
29564
29945
  if (options.remoteConnections && line.startsWith(remotePrefix)) {
29565
- let input;
29946
+ let input2;
29566
29947
  try {
29567
- input = remoteConnectionsRequestSchema.parse(JSON.parse(line.slice(remotePrefix.length)));
29948
+ input2 = remoteConnectionsRequestSchema.parse(JSON.parse(line.slice(remotePrefix.length)));
29568
29949
  } catch {
29569
29950
  respond(socket, "rejected");
29570
29951
  return;
@@ -29574,19 +29955,19 @@ async function startControllerAttachmentServer(options) {
29574
29955
  return;
29575
29956
  }
29576
29957
  socket.setTimeout(
29577
- input.action === "read-thread" || input.action === "session" ? REMOTE_THREAD_CONTROL_TIMEOUT_MS : 3e4,
29958
+ input2.action === "read-thread" || input2.action === "session" ? REMOTE_THREAD_CONTROL_TIMEOUT_MS : 3e4,
29578
29959
  () => socket.destroy()
29579
29960
  );
29580
29961
  const operation = options.remoteConnections;
29581
- void Promise.resolve().then(() => operation(input)).then(
29962
+ void Promise.resolve().then(() => operation(input2)).then(
29582
29963
  (reply) => {
29583
29964
  const serialized = JSON.stringify(reply) + "\n";
29584
- if ((input.action === "read-thread" || input.action === "session") && Buffer.byteLength(serialized) > REMOTE_THREAD_REPLY_MAX_BYTES) {
29965
+ if ((input2.action === "read-thread" || input2.action === "session") && Buffer.byteLength(serialized) > REMOTE_THREAD_REPLY_MAX_BYTES) {
29585
29966
  socket.end(
29586
29967
  JSON.stringify({
29587
29968
  error: {
29588
29969
  code: -32094,
29589
- 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."
29970
+ message: input2.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."
29590
29971
  }
29591
29972
  }) + "\n"
29592
29973
  );
@@ -29904,27 +30285,27 @@ function isolateRendererPrewarmConsumption(manager, discardExternal) {
29904
30285
  return route === marker ? route : void 0;
29905
30286
  };
29906
30287
  const external = (model2) => typeof model2 === "string" && model2.startsWith("codexhost/");
29907
- const routedStart = function(input, options, ...args) {
30288
+ const routedStart = function(input2, options, ...args) {
29908
30289
  const draftId = record5(options) ? options.clientThreadId : null;
29909
- const mode = record5(input) && record5(input.collaborationMode) ? input.collaborationMode : null;
30290
+ const mode = record5(input2) && record5(input2.collaborationMode) ? input2.collaborationMode : null;
29910
30291
  const origin = mode ? Reflect.get(mode, draftIdentity) : void 0;
29911
30292
  if (mode && record5(mode.settings) && external(mode.settings.model))
29912
- return originalStart.call(this, input, options, ...args);
30293
+ return originalStart.call(this, input2, options, ...args);
29913
30294
  const model2 = (typeof draftId === "string" ? draftRoutes.get(draftId)?.model : void 0) ?? activeRoute(origin)?.model;
29914
- if (!model2) return originalStart.call(this, input, options, ...args);
29915
- if (!record5(input) || !record5(input.collaborationMode) || !record5(input.collaborationMode.settings))
30295
+ if (!model2) return originalStart.call(this, input2, options, ...args);
30296
+ if (!record5(input2) || !record5(input2.collaborationMode) || !record5(input2.collaborationMode.settings))
29916
30297
  throw new Error("External draft creation is missing its native Model settings");
29917
30298
  const routed = {
29918
- ...input,
30299
+ ...input2,
29919
30300
  collaborationMode: {
29920
- ...input.collaborationMode,
29921
- settings: { ...input.collaborationMode.settings, model: model2 }
30301
+ ...input2.collaborationMode,
30302
+ settings: { ...input2.collaborationMode.settings, model: model2 }
29922
30303
  }
29923
30304
  };
29924
30305
  return originalStart.call(this, routed, options, ...args);
29925
30306
  };
29926
- const wrapped = function(input, ...args) {
29927
- const mode = record5(input) && record5(input.collaborationMode) ? input.collaborationMode : null;
30307
+ const wrapped = function(input2, ...args) {
30308
+ const mode = record5(input2) && record5(input2.collaborationMode) ? input2.collaborationMode : null;
29928
30309
  const expected = mode && record5(mode.settings) ? mode.settings.model : null;
29929
30310
  const scopedPool = Object.create(pool);
29930
30311
  scopedPool.hasPrewarmedThread = (...parameters) => hasPrewarm.apply(pool, parameters);
@@ -29944,7 +30325,7 @@ function isolateRendererPrewarmConsumption(manager, discardExternal) {
29944
30325
  };
29945
30326
  const invocation = Object.create(creation);
29946
30327
  invocation.params = { ...params, prewarmedThreadManager: scopedPool };
29947
- return original.call(invocation, input, ...args);
30328
+ return original.call(invocation, input2, ...args);
29948
30329
  };
29949
30330
  creation.createConversation = wrapped;
29950
30331
  manager.startConversation = routedStart;
@@ -30983,9 +31364,9 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
30983
31364
  return message;
30984
31365
  const [, importId, path6, args] = expression;
30985
31366
  if (!Array.isArray(path6) || path6.length !== 1 || !Array.isArray(args)) return message;
30986
- const [input, options] = args;
30987
- if (!isRecord3(input) || !isRecord3(input.collaborationMode)) return message;
30988
- const settings = input.collaborationMode.settings;
31367
+ const [input2, options] = args;
31368
+ if (!isRecord3(input2) || !isRecord3(input2.collaborationMode)) return message;
31369
+ const settings = input2.collaborationMode.settings;
30989
31370
  if (!isRecord3(settings)) return message;
30990
31371
  const nativeModel = typeof settings.model === "string" ? settings.model : null;
30991
31372
  let model2 = null;
@@ -30993,7 +31374,7 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
30993
31374
  const draftId = isRecord3(options) ? options.clientThreadId : null;
30994
31375
  model2 = typeof draftId === "string" ? externalDrafts.get(draftId)?.model ?? null : null;
30995
31376
  } else if (path6[0] === "prewarmConversation") {
30996
- if (input.ephemeral !== true) publishDraftWorkspace("local", input.cwd);
31377
+ if (input2.ephemeral !== true) publishDraftWorkspace("local", input2.cwd);
30997
31378
  const selected = selectedModels.get("local") ?? null;
30998
31379
  const carrier = nativeModel?.startsWith("codexhost/") ? nativeModel : selected;
30999
31380
  model2 = carrier ? prewarmCarrier(carrier) : null;
@@ -31001,7 +31382,7 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
31001
31382
  if (!model2) return message;
31002
31383
  if (path6[0] === "startConversation" && nativeModel?.startsWith("codexhost/"))
31003
31384
  model2 = nativeModel;
31004
- const config2 = input.config == null ? { model: model2 } : isRecord3(input.config) ? { model: model2, ...input.config } : input.config;
31385
+ const config2 = input2.config == null ? { model: model2 } : isRecord3(input2.config) ? { model: model2, ...input2.config } : input2.config;
31005
31386
  return [
31006
31387
  "push",
31007
31388
  [
@@ -31010,9 +31391,9 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
31010
31391
  path6,
31011
31392
  [
31012
31393
  {
31013
- ...input,
31394
+ ...input2,
31014
31395
  ...path6[0] === "startConversation" ? { config: config2 } : {},
31015
- collaborationMode: { ...input.collaborationMode, settings: { ...settings, model: model2 } }
31396
+ collaborationMode: { ...input2.collaborationMode, settings: { ...settings, model: model2 } }
31016
31397
  },
31017
31398
  ...args.slice(1)
31018
31399
  ]
@@ -31052,6 +31433,12 @@ function installRendererHostRpcRouting(root, target2, dependencies) {
31052
31433
  return rpc.getConversation?.(threadId);
31053
31434
  }
31054
31435
  } : {},
31436
+ ...typeof rpc.discardConversationFromCache === "function" ? {
31437
+ discardConversationFromCache: async (threadId) => {
31438
+ if (!isCurrent()) throw new Error("Remote manager retired");
31439
+ return rpc.discardConversationFromCache?.(threadId);
31440
+ }
31441
+ } : {},
31055
31442
  ...typeof rpc.replyWithCommandExecutionApprovalDecision === "function" ? {
31056
31443
  replyWithCommandExecutionApprovalDecision: async (threadId, requestId, decision) => {
31057
31444
  if (!isCurrent()) throw new Error("Remote manager retired");
@@ -32136,8 +32523,8 @@ function retainNativeRpcInteractions(upstream, manager, hostId2) {
32136
32523
  if (disposed || !record5(value) || typeof value.conversationId !== "string") return;
32137
32524
  void read(value.conversationId).catch(() => void 0);
32138
32525
  };
32139
- const subscribe = (input) => {
32140
- const pending = upstream.subscribe(input);
32526
+ const subscribe = (input2) => {
32527
+ const pending = upstream.subscribe(input2);
32141
32528
  retained.add(pending);
32142
32529
  return Promise.resolve(pending).then((lease) => {
32143
32530
  if (disposed) lease[Symbol.dispose]();
@@ -33255,7 +33642,7 @@ var RendererDesktopExtensions = class {
33255
33642
  #target;
33256
33643
  #closed = false;
33257
33644
  #queue = Promise.resolve();
33258
- #pendingScan;
33645
+ #queuedScan;
33259
33646
  #pendingPoll = false;
33260
33647
  #lastEnsure = 0;
33261
33648
  attach(id3, renderer) {
@@ -33294,23 +33681,17 @@ var RendererDesktopExtensions = class {
33294
33681
  if (this.#closed) return;
33295
33682
  clearTimeout(this.#debounce);
33296
33683
  this.#debounce = setTimeout(() => {
33297
- void (this.#pendingScan ?? Promise.resolve()).then(() => {
33298
- if (!this.#closed) void this.refresh();
33299
- });
33684
+ void this.refresh();
33300
33685
  }, DEBOUNCE_MS);
33301
33686
  this.#debounce.unref();
33302
33687
  }
33303
33688
  refresh() {
33304
- if (this.#pendingScan) return this.#pendingScan;
33305
- const promise2 = this.#enqueue(async () => {
33689
+ if (this.#closed) return Promise.resolve();
33690
+ return this.#queuedScan ??= this.#enqueue(async () => {
33691
+ this.#queuedScan = void 0;
33306
33692
  const target2 = this.#target;
33307
33693
  if (target2) await this.#reconcile(target2);
33308
33694
  });
33309
- this.#pendingScan = promise2;
33310
- void promise2.finally(() => {
33311
- if (this.#pendingScan === promise2) this.#pendingScan = void 0;
33312
- });
33313
- return promise2;
33314
33695
  }
33315
33696
  close() {
33316
33697
  this.#closed = true;