@karlorz/codexhost-cli-win32-x64 0.16.1-0 → 0.16.1-3

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.
@@ -16277,6 +16277,40 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16277
16277
  })
16278
16278
  });
16279
16279
 
16280
+ // ../shared-contracts/dist/background-activity.js
16281
+ var THREAD_ACTIVITY_LIST_METHOD = "codexhost/thread/activity/list";
16282
+ var THREAD_ACTIVITY_READ_METHOD = "codexhost/thread/activity/read";
16283
+ var THREAD_ACTIVITY_STOP_METHOD = "codexhost/thread/activity/stop";
16284
+ var backgroundActivitySchema = external_exports.strictObject({
16285
+ id: external_exports.string().min(1),
16286
+ kind: external_exports.enum(["task", "monitor", "loop", "subagent"]),
16287
+ label: external_exports.string(),
16288
+ status: external_exports.enum(["running", "scheduled", "completed", "failed", "cancelled", "unknown"]),
16289
+ canStop: external_exports.boolean(),
16290
+ /** Existing detached command Item presented by Desktop's native process UI. */
16291
+ commandItemId: hostItemIdSchema.optional(),
16292
+ schedule: external_exports.string().optional(),
16293
+ nextRunAt: external_exports.string().datetime({ offset: true }).optional(),
16294
+ relatedActivityId: external_exports.string().optional(),
16295
+ threadId: hostThreadIdSchema.optional()
16296
+ });
16297
+ var backgroundActivityDetailSchema = external_exports.strictObject({
16298
+ activity: backgroundActivitySchema,
16299
+ output: external_exports.string(),
16300
+ truncated: external_exports.boolean()
16301
+ });
16302
+ var threadActivityParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
16303
+ var threadActivityItemParamsSchema = threadActivityParamsSchema.extend({
16304
+ activityId: external_exports.string().min(1)
16305
+ });
16306
+ var threadActivityListResultSchema = external_exports.strictObject({
16307
+ supported: external_exports.boolean(),
16308
+ activities: external_exports.array(backgroundActivitySchema)
16309
+ });
16310
+ var threadActivityStopResultSchema = external_exports.strictObject({
16311
+ outcome: external_exports.enum(["stopped", "alreadyStopped", "notFound"])
16312
+ });
16313
+
16280
16314
  // ../shared-contracts/dist/index.js
16281
16315
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
16282
16316
 
@@ -16515,9 +16549,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16515
16549
  const matchesMetadata = (profile) => (version2 === void 0 || profile.version === version2) && (platform === void 0 || profile.platform === platform);
16516
16550
  if (present.length > 0) {
16517
16551
  const profile = present.length === 1 ? present[0] : void 0;
16518
- return profile && matchesMetadata(profile) && [profile.initial, profile.shared].every(
16519
- (asset) => auditedAppInitialAssetPresent(names, asset)
16520
- ) ? profile : void 0;
16552
+ if (!profile || !matchesMetadata(profile)) return void 0;
16553
+ const initialPresent = auditedAppInitialAssetPresent(names, profile.initial);
16554
+ const sharedPresent = auditedAppInitialAssetPresent(names, profile.shared);
16555
+ return sharedPresent && (initialPresent || version2 !== void 0 && platform !== void 0) ? profile : void 0;
16521
16556
  }
16522
16557
  if (version2 === void 0) return void 0;
16523
16558
  const candidates = profiles.filter(matchesMetadata);
@@ -16525,17 +16560,26 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16525
16560
  }
16526
16561
 
16527
16562
  // src/renderer-native-chat-voice-assets.ts
16528
- var NATIVE_CHAT_VOICE_VERSION = "26.1023.51421";
16529
- var NATIVE_CHAT_INITIAL_ASSET = "app-initial-bc8256c3cccb.js";
16530
- var START_ASSET = "start-voice-a0564cefdc95.js";
16563
+ var NATIVE_CHAT_VOICE_VERSION = "26.1027.30824";
16564
+ var NATIVE_CHAT_INITIAL_ASSET = "app-initial-60f141238751.js";
16565
+ var START_ASSET = "start-voice-4c77215aa289.js";
16531
16566
  var NATIVE_CHAT_VOICE_ASSETS = [
16532
16567
  {
16533
16568
  platform: "darwin",
16534
16569
  version: NATIVE_CHAT_VOICE_VERSION,
16535
16570
  initial: NATIVE_CHAT_INITIAL_ASSET,
16571
+ shared: "app-shared-7815d5a1a42a.js",
16572
+ primary: "app-primary-95a0e6d83f1e.js",
16573
+ start: START_ASSET,
16574
+ prewarm: "voice-prewarm-e49220ad61bd.js"
16575
+ },
16576
+ {
16577
+ platform: "darwin",
16578
+ version: "26.1023.51421",
16579
+ initial: "app-initial-bc8256c3cccb.js",
16536
16580
  shared: "app-shared-e9f258fd3588.js",
16537
16581
  primary: "app-primary-b7f335b763ca.js",
16538
- start: START_ASSET,
16582
+ start: "start-voice-a0564cefdc95.js",
16539
16583
  prewarm: "voice-prewarm-53aefded152c.js",
16540
16584
  settings: "voice-settings-1a9f68eb7ae8.js"
16541
16585
  },
@@ -16583,15 +16627,28 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16583
16627
  )
16584
16628
  );
16585
16629
  if (!sharedModule || !initialModule || !startModule || !prewarm) throw new Error();
16586
- const latest = assets.version === NATIVE_CHAT_VOICE_VERSION;
16630
+ const newest = assets.version === NATIVE_CHAT_VOICE_VERSION;
16631
+ const latest = newest || assets.version === "26.1023.51421";
16587
16632
  const current = latest || assets.version === "26.1021.31345";
16588
- const initialize = latest ? primary?.gm : current ? primary?.um : initialModule.oT;
16633
+ const initialize = newest ? primary?.Yp : latest ? primary?.gm : current ? primary?.um : initialModule.oT;
16589
16634
  const start = current && !latest ? { t: startModule.r, n: startModule.i } : startModule;
16590
- if (typeof start.t !== "function" || typeof start.n !== "function" || typeof initialize !== "function" || typeof (latest ? initialModule["s$t"] : current ? initialModule.qXt : initialModule.SPn) !== "function" || typeof (latest ? sharedModule.OHt : current ? sharedModule.XVt : sharedModule.FBt) !== "function" || typeof (latest ? sharedModule.wPt : current ? sharedModule.KNt : sharedModule.PNt) !== "function" || typeof prewarm.VoiceInstantConnectCacheController !== "function")
16635
+ if (typeof start.t !== "function" || typeof start.n !== "function" || typeof initialize !== "function" || typeof (newest ? initialModule.Xen : latest ? initialModule["s$t"] : current ? initialModule.qXt : initialModule.SPn) !== "function" || typeof (newest ? sharedModule.pWt : latest ? sharedModule.OHt : current ? sharedModule.XVt : sharedModule.FBt) !== "function" || typeof (newest ? sharedModule.GFt : latest ? sharedModule.wPt : current ? sharedModule.KNt : sharedModule.PNt) !== "function" || typeof prewarm.VoiceInstantConnectCacheController !== "function")
16591
16636
  throw new Error();
16592
16637
  initialize();
16593
16638
  start.t();
16594
- const initial = latest ? {
16639
+ const initial = newest ? {
16640
+ MOr: initialModule.l5n,
16641
+ CDr: initialModule.b6n,
16642
+ B1n: initialModule.pOn,
16643
+ SPn: initialModule.Xen,
16644
+ oT: primary?.Yp,
16645
+ aT: primary?.Jp,
16646
+ Ycr: initialModule.nfr,
16647
+ Nir: initialModule.hEn,
16648
+ n0n: initialModule.jOn,
16649
+ Y1n: initialModule.wOn,
16650
+ HJt: initialModule.J6
16651
+ } : latest ? {
16595
16652
  MOr: initialModule.x1n,
16596
16653
  CDr: initialModule.MQn,
16597
16654
  B1n: initialModule.Opn,
@@ -16616,7 +16673,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16616
16673
  Y1n: initialModule.fdn,
16617
16674
  HJt: initialModule.R2
16618
16675
  } : initialModule;
16619
- const shared = latest ? { Qst: sharedModule.uct, FBt: sharedModule.OHt, PNt: sharedModule.wPt, Vot: sharedModule.ast } : current ? {
16676
+ const shared = newest ? { Qst: sharedModule.klt, FBt: sharedModule.pWt, PNt: sharedModule.GFt, Vot: sharedModule._ct } : latest ? {
16677
+ Qst: sharedModule.uct,
16678
+ FBt: sharedModule.OHt,
16679
+ PNt: sharedModule.wPt,
16680
+ Vot: sharedModule.ast
16681
+ } : current ? {
16620
16682
  Qst: sharedModule.Bst,
16621
16683
  FBt: sharedModule.XVt,
16622
16684
  PNt: sharedModule.KNt,
@@ -16914,14 +16976,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16914
16976
 
16915
16977
  // ../desktop-control/dist/renderer-host-discovery.js
16916
16978
  function requestManagerFromHookState(value, hostId2) {
16917
- const record15 = (candidate) => typeof candidate === "object" && candidate !== null;
16979
+ const record16 = (candidate) => typeof candidate === "object" && candidate !== null;
16918
16980
  const manager = (candidate) => {
16919
- if (!record15(candidate) || !record15(candidate.requestClient) || !record15(candidate.prewarmedThreadManager))
16981
+ if (!record16(candidate) || !record16(candidate.requestClient) || !record16(candidate.prewarmedThreadManager))
16920
16982
  return null;
16921
16983
  const bridge = candidate.requestClient;
16922
16984
  return typeof candidate.sendRequest === "function" && typeof bridge.sendRequest === "function" && typeof bridge.prewarmThreadStart === "function" && typeof bridge.enqueueRequest === "function" && typeof candidate.prewarmedThreadManager.discardAllPrewarmedThreads === "function" ? candidate : null;
16923
16985
  };
16924
- if (!record15(value))
16986
+ if (!record16(value))
16925
16987
  return null;
16926
16988
  const direct = manager(value) ?? manager(value.manager);
16927
16989
  if (direct)
@@ -16984,18 +17046,18 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16984
17046
 
16985
17047
  // ../desktop-control/dist/renderer-host-rpc-discovery.js
16986
17048
  function findRendererHostRpcFamily(store) {
16987
- const record15 = (value) => typeof value === "object" && value !== null;
17049
+ const record16 = (value) => typeof value === "object" && value !== null;
16988
17050
  const families = /* @__PURE__ */ new Set();
16989
17051
  for (const [definition, members] of store.familyBindings) {
16990
- if (!record15(definition) || definition.kind !== "signal-family")
17052
+ if (!record16(definition) || definition.kind !== "signal-family")
16991
17053
  continue;
16992
- if (!record15(members) || typeof members.get !== "function")
17054
+ if (!record16(members) || typeof members.get !== "function")
16993
17055
  continue;
16994
17056
  for (const [hostId2, member] of members) {
16995
- if (typeof hostId2 !== "string" || !record15(member))
17057
+ if (typeof hostId2 !== "string" || !record16(member))
16996
17058
  continue;
16997
17059
  const signal = member.value;
16998
- if (!record15(signal) || typeof signal.get !== "function")
17060
+ if (!record16(signal) || typeof signal.get !== "function")
16999
17061
  continue;
17000
17062
  let value;
17001
17063
  try {
@@ -17003,7 +17065,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17003
17065
  } catch {
17004
17066
  continue;
17005
17067
  }
17006
- if (record15(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record15(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
17068
+ if (record16(value) && Object.keys(value).length === 2 && typeof value.status === "string" && record16(value.client) && value.client.hostId === hostId2 && "rpc" in value.client) {
17007
17069
  families.add(members);
17008
17070
  break;
17009
17071
  }
@@ -17014,9 +17076,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17014
17076
  return { store, family: families.values().next().value };
17015
17077
  }
17016
17078
  function resolveRendererHostRpc(discovery, hostId2) {
17017
- const record15 = (value2) => typeof value2 === "object" && value2 !== null;
17079
+ const record16 = (value2) => typeof value2 === "object" && value2 !== null;
17018
17080
  const signal = discovery.family.get(hostId2)?.value;
17019
- if (!record15(signal) || typeof signal.get !== "function")
17081
+ if (!record16(signal) || typeof signal.get !== "function")
17020
17082
  return null;
17021
17083
  let value;
17022
17084
  try {
@@ -17024,10 +17086,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17024
17086
  } catch {
17025
17087
  return null;
17026
17088
  }
17027
- if (!record15(value) || value.status !== "ready" || !record15(value.client) || value.client.hostId !== hostId2)
17089
+ if (!record16(value) || value.status !== "ready" || !record16(value.client) || value.client.hostId !== hostId2)
17028
17090
  return null;
17029
17091
  const rpc = value.client.rpc;
17030
- return typeof rpc === "function" || record15(rpc) ? rpc : null;
17092
+ return typeof rpc === "function" || record16(rpc) ? rpc : null;
17031
17093
  }
17032
17094
 
17033
17095
  // ../desktop-control/dist/renderer-schedule-workspace-rpc.js
@@ -18139,10 +18201,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18139
18201
  }
18140
18202
 
18141
18203
  // src/renderer-client-owned-voice.ts
18142
- var CLIENT_OWNED_VOICE_VERSION = "26.1023.51421";
18143
- var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-bc8256c3cccb.js";
18144
- var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-e9f258fd3588.js";
18145
- var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-af6c3662f64f.js";
18204
+ var CLIENT_OWNED_VOICE_VERSION = "26.1027.30824";
18205
+ var CLIENT_OWNED_VOICE_INITIAL_ASSET = "app-initial-60f141238751.js";
18206
+ var CLIENT_OWNED_VOICE_SHARED_ASSET = "app-shared-7815d5a1a42a.js";
18207
+ var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-d9d400e751cd.js";
18146
18208
  var CLIENT_OWNED_VOICE_ASSETS = [
18147
18209
  {
18148
18210
  platform: "darwin",
@@ -18150,6 +18212,23 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18150
18212
  initial: CLIENT_OWNED_VOICE_INITIAL_ASSET,
18151
18213
  shared: CLIENT_OWNED_VOICE_SHARED_ASSET,
18152
18214
  overlay: CLIENT_OWNED_VOICE_OVERLAY_ASSET,
18215
+ init: "Edr",
18216
+ fetch: "wdr",
18217
+ fetchFrom: "initial",
18218
+ bridge: "LRt",
18219
+ services: "Vct",
18220
+ responseError: "Adr",
18221
+ responseErrorFrom: "initial",
18222
+ capabilityInit: "Ner",
18223
+ capabilityFamily: "Mer",
18224
+ inferenceGateFamily: "Lfr"
18225
+ },
18226
+ {
18227
+ platform: "darwin",
18228
+ version: "26.1023.51421",
18229
+ initial: "app-initial-bc8256c3cccb.js",
18230
+ shared: "app-shared-e9f258fd3588.js",
18231
+ overlay: "avatar-overlay-native-page-af6c3662f64f.js",
18153
18232
  init: "xir",
18154
18233
  fetch: "yir",
18155
18234
  fetchFrom: "initial",
@@ -18275,11 +18354,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18275
18354
  function visibleWorkComposer(owner) {
18276
18355
  const document2 = owner.document;
18277
18356
  if (!document2?.querySelectorAll) return false;
18278
- const visible = (element) => {
18357
+ const visible2 = (element) => {
18279
18358
  const box = element.getBoundingClientRect?.() ?? { width: 0 };
18280
18359
  return box.width > 0 && !element.closest?.("[hidden], [inert]");
18281
18360
  };
18282
- return [...document2.querySelectorAll("[data-codex-composer-root]")].some(visible) && ![...document2.querySelectorAll("[data-chatgpt-composer]")].some(visible);
18361
+ return [...document2.querySelectorAll("[data-codex-composer-root]")].some(visible2) && ![...document2.querySelectorAll("[data-chatgpt-composer]")].some(visible2);
18283
18362
  }
18284
18363
  function selectedWorkTab(owner) {
18285
18364
  const document2 = owner.document;
@@ -18471,7 +18550,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18471
18550
  if (!object2(bridgeClass) && typeof bridgeClass !== "function") throw new Error();
18472
18551
  const client = Reflect.get(fetchClass, "getInstance").call(fetchClass);
18473
18552
  const bridge = Reflect.get(bridgeClass, "getInstance").call(bridgeClass);
18474
- const responseError = typeof errorName === "string" && typeof sharedModule[errorName] === "function" ? sharedModule[errorName] : async (response) => {
18553
+ const errorModule = "responseErrorFrom" in assets && assets.responseErrorFrom === "initial" ? fetchModule : sharedModule;
18554
+ const responseError = typeof errorName === "string" && typeof errorModule[errorName] === "function" ? errorModule[errorName] : async (response) => {
18475
18555
  throw Object.assign(new Error(await response.text()), { status: response.status });
18476
18556
  };
18477
18557
  if (typeof client?.fetch !== "function" || typeof bridge?.dispatchMessage !== "function" || typeof bridge?.subscribe !== "function")
@@ -18500,6 +18580,546 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18500
18580
  return handle;
18501
18581
  }
18502
18582
 
18583
+ // src/renderer-request-sender.ts
18584
+ var RendererMethodUnavailableError = class extends Error {
18585
+ constructor(method, cause) {
18586
+ super(`${method} is unsupported on this Host connection`, { cause });
18587
+ this.method = method;
18588
+ this.name = "RendererMethodUnavailableError";
18589
+ }
18590
+ method;
18591
+ code = -32601;
18592
+ };
18593
+ function isUnsupportedMethod(error51, method) {
18594
+ if (typeof error51 !== "object" || error51 === null) return false;
18595
+ const code = "code" in error51 ? error51.code : void 0;
18596
+ const message2 = "message" in error51 ? error51.message : void 0;
18597
+ return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
18598
+ }
18599
+ function createRendererRequestSender(send) {
18600
+ const unsupported = /* @__PURE__ */ new Map();
18601
+ return async (method, params, options) => {
18602
+ const known = unsupported.get(method);
18603
+ if (known) throw known;
18604
+ try {
18605
+ return await (options === void 0 ? send(method, params) : send(method, params, options));
18606
+ } catch (error51) {
18607
+ if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
18608
+ const unavailable = new RendererMethodUnavailableError(method, error51);
18609
+ unsupported.set(method, unavailable);
18610
+ throw unavailable;
18611
+ }
18612
+ };
18613
+ }
18614
+
18615
+ // src/renderer-activity-navigation.ts
18616
+ var record6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18617
+ function openRendererActivityChild(owner, child) {
18618
+ if (!owner.composer.isConnected || child.kind !== "subagent" || !child.threadId)
18619
+ throw Error("Native child conversation is unavailable");
18620
+ const callbacks = /* @__PURE__ */ new Set();
18621
+ const seen = /* @__PURE__ */ new Set();
18622
+ const anchors = [owner.composer, ...owner.composer.querySelectorAll("[contenteditable]")];
18623
+ for (const anchor of anchors) {
18624
+ const keys = Object.getOwnPropertyNames(anchor).filter(
18625
+ (key2) => key2.startsWith("__reactFiber$")
18626
+ );
18627
+ const key = keys[0];
18628
+ if (keys.length !== 1 || !key) continue;
18629
+ const first = Object.getOwnPropertyDescriptor(anchor, key)?.value;
18630
+ for (const fiber of committedReactAncestors(first)) {
18631
+ if (seen.has(fiber)) break;
18632
+ seen.add(fiber);
18633
+ const props = fiber.memoizedProps;
18634
+ if (!record6(props) || typeof props.onOpenBackgroundAgent !== "function") continue;
18635
+ if (typeof props.hostId !== "string" || typeof props.conversationId !== "string") continue;
18636
+ if (props.hostId !== owner.hostId || props.conversationId !== owner.threadId)
18637
+ throw Error("Native child navigation belongs to another chat or Host");
18638
+ callbacks.add(props.onOpenBackgroundAgent);
18639
+ }
18640
+ }
18641
+ const callback = callbacks.values().next().value;
18642
+ if (callbacks.size !== 1 || !callback)
18643
+ throw Error("Native child navigation is unavailable or ambiguous");
18644
+ callback({ conversationId: child.threadId, displayName: child.label, canInteract: false });
18645
+ }
18646
+
18647
+ // src/renderer-activity-detail.ts
18648
+ function appendActivityOutput(parent, detail, expanded, onExpanded) {
18649
+ const document2 = parent.ownerDocument;
18650
+ if (detail.activity.kind !== "loop") {
18651
+ const output = document2.createElement("pre");
18652
+ output.className = "activity-process-output";
18653
+ output.textContent = detail.output || "No native output available yet.";
18654
+ parent.append(output);
18655
+ return;
18656
+ }
18657
+ const prompt = detail.output || "No native prompt available yet.";
18658
+ const firstBreak = /\r\n|[\r\n]/.exec(prompt);
18659
+ const title = firstBreak ? prompt.slice(0, firstBreak.index) : prompt;
18660
+ const instructions = firstBreak ? prompt.slice(firstBreak.index + firstBreak[0].length) : "";
18661
+ const heading = document2.createElement("h4");
18662
+ heading.className = "activity-prompt-title text-sm font-medium";
18663
+ heading.textContent = title;
18664
+ parent.append(heading);
18665
+ if (!instructions) return;
18666
+ const disclosure = document2.createElement("details");
18667
+ disclosure.open = expanded;
18668
+ const summary = document2.createElement("summary");
18669
+ summary.className = "text-sm text-secondary";
18670
+ summary.textContent = "Schedule instructions";
18671
+ const body = document2.createElement("div");
18672
+ body.className = "activity-prompt-instructions text-sm";
18673
+ body.textContent = instructions;
18674
+ disclosure.append(summary, body);
18675
+ disclosure.addEventListener("toggle", () => {
18676
+ if (disclosure.isConnected) onExpanded(disclosure.open);
18677
+ });
18678
+ parent.append(disclosure);
18679
+ }
18680
+
18681
+ // src/renderer-activity-section.ts
18682
+ var PANEL = "[data-summary-panel-variant]";
18683
+ var OWNED = "[data-codexhost-background-activity]";
18684
+ function visible(window2, node) {
18685
+ if (!node.isConnected || node.getClientRects().length === 0) return false;
18686
+ for (let ancestor = node; ancestor; ancestor = ancestor.parentElement) {
18687
+ const style = window2.getComputedStyle(ancestor);
18688
+ if (ancestor.hidden || style.display === "none" || style.visibility === "hidden") return false;
18689
+ }
18690
+ return true;
18691
+ }
18692
+ function activitySectionTarget(window2, composer, previous) {
18693
+ const viewport = composer.closest("[data-app-shell-main-content-layout]");
18694
+ const workspace = viewport?.parentElement;
18695
+ if (!composer.isConnected) return { target: null, reason: "detached-composer" };
18696
+ if (!workspace) return { target: null, reason: "missing-workspace" };
18697
+ const roots = Array.from(workspace.querySelectorAll(PANEL)).filter(
18698
+ (node) => node.classList.contains("group/summary-panel") && visible(window2, node)
18699
+ );
18700
+ if (roots.length !== 1)
18701
+ return { target: null, reason: roots.length ? "ambiguous-panel" : "missing-panel" };
18702
+ const root = roots[0];
18703
+ if (!root) return { target: null, reason: "missing-panel" };
18704
+ const nativeSections = Array.from(root.querySelectorAll("section")).filter(
18705
+ (node) => {
18706
+ const parentSection = node.parentElement?.closest("section");
18707
+ return !node.closest(OWNED) && node.closest(PANEL) === root && node.classList.contains("flex") && node.classList.contains("flex-col") && (!parentSection || parentSection === root || !root.contains(parentSection));
18708
+ }
18709
+ );
18710
+ const containers = new Set(nativeSections.map((node) => node.parentElement));
18711
+ const target = nativeSections[0]?.parentElement;
18712
+ if (containers.size === 1 && target) return { target, reason: null };
18713
+ if (containers.size === 0 && previous?.isConnected && previous.closest(PANEL) === root)
18714
+ return { target: previous, reason: null };
18715
+ return { target: null, reason: containers.size ? "ambiguous-sections" : "missing-sections" };
18716
+ }
18717
+ var ACTIVITY_SECTION_CLASS = "relative z-0 flex flex-col pb-2 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:py-2";
18718
+ var ACTIVITY_SECTION_CONTENT_CLASS = "flex flex-col gap-0.5 px-5 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:gap-0 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:px-4 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:px-5";
18719
+ var ACTIVITY_SECTION_HEADING_CLASS = "activity-heading sticky top-2 z-10 flex h-7 w-full min-w-0 items-center justify-start gap-2 pb-0.5 text-sm font-normal text-secondary bg-surface-elevated-secondary before:bg-surface-elevated-secondary before:pointer-events-none before:absolute before:inset-x-0 before:-top-2 before:h-2 before:content-[''] ps-5 pe-3.5 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:h-6 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:h-7 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:pb-0 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:text-dynamic-isle-row group-data-[summary-panel-variant=dynamic-isle]/summary-panel:ps-4 group-data-[summary-panel-variant=dynamic-isle]/summary-panel:group-data-[summary-panel-density=comfortable]/summary-panel:ps-5";
18720
+ var ACTIVITY_SECTION_TOGGLE_CLASS = "group/section-toggle -ms-[3.5px] inline-flex min-w-0 flex-1 cursor-interaction items-center gap-1 rounded-xl py-0.5 ps-[3.5px] pe-1 text-start focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-ring";
18721
+ var ACTIVITY_SECTION_LABEL_CLASS = "activity-title min-w-0 flex-1 text-sm group-data-[summary-panel-variant=dynamic-isle]/summary-panel:text-dynamic-isle-row";
18722
+
18723
+ // src/renderer-background-activity.ts
18724
+ function activityCountdown(nextRunAt, now = Date.now()) {
18725
+ if (!nextRunAt) return "";
18726
+ const seconds = Math.ceil((Date.parse(nextRunAt) - now) / 1e3);
18727
+ if (!Number.isFinite(seconds)) return "";
18728
+ if (seconds <= 0) return "Waiting for Harness";
18729
+ return "Next in " + Math.floor(seconds / 60) + ":" + String(seconds % 60).padStart(2, "0");
18730
+ }
18731
+ function activitySummaryLabel(activity) {
18732
+ const firstLine = activity.label.trim().split(/[\r\n]/, 1)[0]?.replace(/\s+/g, " ") ?? "";
18733
+ if (!firstLine) return activity.kind === "loop" ? "Loop schedule" : "Background process";
18734
+ const characters = Array.from(firstLine);
18735
+ return characters.length > 72 ? characters.slice(0, 71).join("") + "\u2026" : firstLine;
18736
+ }
18737
+ function supplementalBackgroundActivities(activities) {
18738
+ const rows = activities.filter(
18739
+ (item) => item.kind === "loop" || item.kind !== "subagent" && !item.commandItemId
18740
+ );
18741
+ return rows.some((item) => !["completed", "failed", "cancelled"].includes(item.status)) ? rows : [];
18742
+ }
18743
+ function same(a, b) {
18744
+ return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
18745
+ }
18746
+ var CSS2 = [
18747
+ "[data-codexhost-background-activity]{font:inherit;color:var(--color-text-primary,inherit);min-width:0}",
18748
+ "[data-codexhost-background-activity] button{font:inherit;color:inherit;cursor:pointer;background:transparent;border:0;text-align:left}",
18749
+ "[data-codexhost-background-activity] button:disabled{opacity:.6;cursor:wait}",
18750
+ "[data-codexhost-background-activity] button:focus-visible{outline:2px solid var(--color-ring,#779cff);outline-offset:2px}",
18751
+ "[data-codexhost-background-activity] [hidden]{display:none}",
18752
+ "[data-codexhost-background-activity] .activity-heading{margin:0}",
18753
+ "[data-codexhost-background-activity] .activity-disclosure{flex-shrink:0;transition:transform .15s}",
18754
+ "[data-codexhost-background-activity] button[aria-expanded=true]>.activity-disclosure{opacity:0}",
18755
+ "[data-codexhost-background-activity] button:hover>.activity-disclosure,[data-codexhost-background-activity] button:focus-visible>.activity-disclosure{opacity:1}",
18756
+ "[data-codexhost-background-activity] .activity-row{display:block;box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:7px 0}",
18757
+ "[data-codexhost-background-activity] .activity-title{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
18758
+ "[data-codexhost-background-activity] .activity-meta{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}",
18759
+ "[data-codexhost-background-activity] .activity-detail{padding:4px 0 10px;min-width:0}",
18760
+ "[data-codexhost-background-activity] .activity-prompt-title{margin:0 0 6px;overflow-wrap:anywhere}",
18761
+ "[data-codexhost-background-activity] summary{cursor:pointer;padding:4px 0}",
18762
+ "[data-codexhost-background-activity] .activity-prompt-instructions{white-space:pre-wrap;overflow-wrap:anywhere;max-height:40vh;overflow:auto;padding:6px 0}",
18763
+ "[data-codexhost-background-activity] pre{white-space:pre-wrap;overflow-wrap:anywhere;font:inherit;max-height:40vh;overflow:auto}",
18764
+ "[data-codexhost-background-activity] pre.activity-process-output{font:12px/1.5 ui-monospace,monospace}",
18765
+ "[data-codexhost-background-activity] .activity-action{padding:5px 0;text-decoration:underline;margin-right:12px}",
18766
+ "[data-codexhost-background-activity] .activity-error{font-size:12px;padding:0 20px;color:var(--color-text-danger,light-dark(#a32020,#ffaaa0))}"
18767
+ ].join("\n");
18768
+ function installRendererBackgroundActivity(window2, readContext) {
18769
+ let context = null;
18770
+ let revision = 0;
18771
+ let disposed = false;
18772
+ let inFlight = null;
18773
+ let root = null;
18774
+ let container = null;
18775
+ let body = null;
18776
+ let errorNode = null;
18777
+ let activities = [];
18778
+ let allActivities = [];
18779
+ let selected = null;
18780
+ let expanded = true;
18781
+ let instructionsExpanded = false;
18782
+ let detail = null;
18783
+ let renderKey = "";
18784
+ let renderedOutput;
18785
+ let navigation = null;
18786
+ const unsupported = /* @__PURE__ */ new WeakSet();
18787
+ const valid = (owner, token) => !disposed && token === revision && same(owner, context) && same(owner, readContext());
18788
+ const message2 = (error51) => error51 instanceof Error ? error51.message : "Native activity is unavailable";
18789
+ const setError = (text) => {
18790
+ if (errorNode && errorNode.textContent !== text) errorNode.textContent = text;
18791
+ };
18792
+ const unmount = () => {
18793
+ root?.remove();
18794
+ root = null;
18795
+ body = null;
18796
+ errorNode = null;
18797
+ renderKey = "";
18798
+ renderedOutput = void 0;
18799
+ };
18800
+ const clear = () => {
18801
+ navigation?.abort();
18802
+ navigation = null;
18803
+ unmount();
18804
+ container = null;
18805
+ selected = null;
18806
+ expanded = true;
18807
+ instructionsExpanded = false;
18808
+ detail = null;
18809
+ activities = [];
18810
+ allActivities = [];
18811
+ };
18812
+ const button2 = (text, action, className) => {
18813
+ const node = window2.document.createElement("button");
18814
+ node.type = "button";
18815
+ node.className = className;
18816
+ node.textContent = text;
18817
+ node.addEventListener("click", action);
18818
+ return node;
18819
+ };
18820
+ const clocks = () => {
18821
+ for (const clock of root?.querySelectorAll("[data-next-run]") ?? []) {
18822
+ const text = activityCountdown(clock.dataset.nextRun);
18823
+ if (clock.textContent !== text) clock.textContent = text;
18824
+ }
18825
+ };
18826
+ const metadata = (parent, activity) => {
18827
+ const meta3 = window2.document.createElement("span");
18828
+ meta3.className = "activity-meta text-xs text-secondary";
18829
+ meta3.textContent = [
18830
+ activity.kind === "loop" ? "Schedule" : "Process",
18831
+ activity.status,
18832
+ activity.schedule
18833
+ ].filter(Boolean).join(" \xB7 ");
18834
+ parent.append(meta3);
18835
+ if (activity.nextRunAt) {
18836
+ const clock = window2.document.createElement("span");
18837
+ clock.className = "activity-meta text-xs text-secondary";
18838
+ clock.dataset.nextRun = activity.nextRunAt;
18839
+ parent.append(clock);
18840
+ }
18841
+ };
18842
+ const openChild = async (owner, token, id) => {
18843
+ navigation?.abort();
18844
+ const request = new AbortController();
18845
+ navigation = request;
18846
+ let child = allActivities.find((item) => item.id === id);
18847
+ if (!child?.threadId) {
18848
+ let raw;
18849
+ try {
18850
+ raw = await owner.route.sendRequest(
18851
+ THREAD_ACTIVITY_READ_METHOD,
18852
+ { threadId: owner.threadId, activityId: id },
18853
+ { priority: "interactive", timeoutMs: 1e4 }
18854
+ );
18855
+ } catch (error51) {
18856
+ if (request.signal.aborted) return;
18857
+ throw error51;
18858
+ }
18859
+ if (!valid(owner, token) || request.signal.aborted) return;
18860
+ child = backgroundActivityDetailSchema.parse(raw).activity;
18861
+ }
18862
+ if (!valid(owner, token) || request.signal.aborted) return;
18863
+ if (child.kind !== "subagent" || !child.threadId)
18864
+ throw Error("Native child conversation is unavailable");
18865
+ openRendererActivityChild(owner, child);
18866
+ };
18867
+ const showDetail = async (id) => {
18868
+ const owner = context;
18869
+ if (!owner) return;
18870
+ const token = revision;
18871
+ selected = selected === id ? null : id;
18872
+ instructionsExpanded = false;
18873
+ detail = null;
18874
+ setError("");
18875
+ render();
18876
+ if (!selected) return;
18877
+ try {
18878
+ const raw = await owner.route.sendRequest(
18879
+ THREAD_ACTIVITY_READ_METHOD,
18880
+ { threadId: owner.threadId, activityId: id },
18881
+ { priority: "interactive", timeoutMs: 1e4 }
18882
+ );
18883
+ if (!valid(owner, token) || selected !== id) return;
18884
+ detail = backgroundActivityDetailSchema.parse(raw);
18885
+ render();
18886
+ } catch (error51) {
18887
+ if (valid(owner, token) && selected === id) setError(message2(error51));
18888
+ }
18889
+ };
18890
+ const render = () => {
18891
+ if (!body || !context) return;
18892
+ const key = JSON.stringify([
18893
+ activities,
18894
+ selected,
18895
+ detail && [detail.activity, detail.truncated]
18896
+ ]);
18897
+ if (key === renderKey && detail?.output === renderedOutput) return;
18898
+ renderKey = key;
18899
+ renderedOutput = detail?.output;
18900
+ body.replaceChildren();
18901
+ for (const activity of activities) {
18902
+ const row = window2.document.createElement("div");
18903
+ const trigger = button2("", () => void showDetail(activity.id), "activity-row");
18904
+ const title = window2.document.createElement("span");
18905
+ title.className = ACTIVITY_SECTION_LABEL_CLASS;
18906
+ title.textContent = activitySummaryLabel(activity);
18907
+ trigger.append(title);
18908
+ trigger.setAttribute("aria-expanded", String(selected === activity.id));
18909
+ metadata(trigger, activity);
18910
+ row.append(trigger);
18911
+ body.append(row);
18912
+ if (selected !== activity.id) continue;
18913
+ const content = window2.document.createElement("div");
18914
+ content.className = "activity-detail";
18915
+ row.append(content);
18916
+ if (!detail) {
18917
+ content.textContent = "Loading native details\u2026";
18918
+ continue;
18919
+ }
18920
+ appendActivityOutput(content, detail, instructionsExpanded, (value) => {
18921
+ instructionsExpanded = value;
18922
+ });
18923
+ if (detail.truncated) {
18924
+ const note = window2.document.createElement("span");
18925
+ note.className = "activity-meta text-xs text-secondary";
18926
+ note.textContent = "Native output is truncated.";
18927
+ content.append(note);
18928
+ }
18929
+ const owner = context;
18930
+ const token = revision;
18931
+ if (activity.relatedActivityId) {
18932
+ const id = activity.relatedActivityId;
18933
+ const open = button2(
18934
+ "Open latest run",
18935
+ () => {
18936
+ if (!valid(owner, token)) return;
18937
+ open.disabled = true;
18938
+ setError("");
18939
+ void openChild(owner, token, id).catch((error51) => {
18940
+ if (valid(owner, token)) setError(message2(error51));
18941
+ }).finally(() => {
18942
+ if (valid(owner, token)) open.disabled = false;
18943
+ });
18944
+ },
18945
+ "activity-action"
18946
+ );
18947
+ content.append(open);
18948
+ }
18949
+ if (detail.activity.canStop) {
18950
+ const stop = button2(
18951
+ activity.kind === "loop" ? "Delete schedule" : "Stop task",
18952
+ () => {
18953
+ if (!valid(owner, token)) return;
18954
+ stop.disabled = true;
18955
+ void (async () => {
18956
+ try {
18957
+ const raw = await owner.route.sendRequest(
18958
+ THREAD_ACTIVITY_STOP_METHOD,
18959
+ { threadId: owner.threadId, activityId: activity.id },
18960
+ { priority: "interactive", timeoutMs: 1e4 }
18961
+ );
18962
+ if (!valid(owner, token)) return;
18963
+ const result = threadActivityStopResultSchema.parse(raw);
18964
+ setError(result.outcome === "notFound" ? "Native activity was not found." : "");
18965
+ await refresh();
18966
+ } catch (error51) {
18967
+ if (valid(owner, token)) setError(message2(error51));
18968
+ } finally {
18969
+ if (valid(owner, token)) stop.disabled = false;
18970
+ }
18971
+ })();
18972
+ },
18973
+ "activity-action"
18974
+ );
18975
+ content.append(stop);
18976
+ }
18977
+ }
18978
+ clocks();
18979
+ };
18980
+ const mount = (owner, target) => {
18981
+ root = window2.document.createElement("section");
18982
+ root.dataset.codexhostBackgroundActivity = owner.threadId;
18983
+ root.className = ACTIVITY_SECTION_CLASS;
18984
+ const style = window2.document.createElement("style");
18985
+ style.textContent = CSS2;
18986
+ const heading = window2.document.createElement("header");
18987
+ heading.className = ACTIVITY_SECTION_HEADING_CLASS;
18988
+ const toggle = button2(
18989
+ "",
18990
+ () => {
18991
+ expanded = !expanded;
18992
+ syncExpanded();
18993
+ },
18994
+ ACTIVITY_SECTION_TOGGLE_CLASS
18995
+ );
18996
+ const label = window2.document.createElement("span");
18997
+ label.className = "truncate";
18998
+ label.textContent = "Background activity";
18999
+ const disclosure = window2.document.createElementNS("http://www.w3.org/2000/svg", "svg");
19000
+ disclosure.setAttribute("class", "activity-disclosure");
19001
+ disclosure.setAttribute("width", "12");
19002
+ disclosure.setAttribute("height", "12");
19003
+ disclosure.setAttribute("viewBox", "0 0 24 24");
19004
+ disclosure.setAttribute("aria-hidden", "true");
19005
+ const path = window2.document.createElementNS("http://www.w3.org/2000/svg", "path");
19006
+ path.setAttribute("d", "m9 5 7 7-7 7");
19007
+ path.setAttribute("fill", "none");
19008
+ path.setAttribute("stroke", "currentColor");
19009
+ path.setAttribute("stroke-width", "2");
19010
+ disclosure.append(path);
19011
+ toggle.append(label, disclosure);
19012
+ heading.append(toggle);
19013
+ errorNode = window2.document.createElement("div");
19014
+ errorNode.className = "activity-error";
19015
+ errorNode.setAttribute("role", "status");
19016
+ body = window2.document.createElement("div");
19017
+ body.className = ACTIVITY_SECTION_CONTENT_CLASS;
19018
+ const syncExpanded = () => {
19019
+ toggle.setAttribute("aria-expanded", String(expanded));
19020
+ disclosure.style.transform = expanded ? "rotate(90deg)" : "";
19021
+ if (body) body.hidden = !expanded;
19022
+ if (errorNode) errorNode.hidden = !expanded;
19023
+ };
19024
+ syncExpanded();
19025
+ root.append(style, heading, errorNode, body);
19026
+ root.addEventListener("click", (event) => event.stopPropagation());
19027
+ target.append(root);
19028
+ renderKey = "";
19029
+ };
19030
+ const syncTarget = (owner) => {
19031
+ const { target } = activitySectionTarget(window2, owner.composer, container);
19032
+ if (!target) {
19033
+ unmount();
19034
+ if (!container?.isConnected) container = null;
19035
+ return;
19036
+ }
19037
+ container = target;
19038
+ if (!activities.length) {
19039
+ unmount();
19040
+ return;
19041
+ }
19042
+ if (!root?.isConnected) mount(owner, target);
19043
+ else if (root.parentElement !== target) target.append(root);
19044
+ render();
19045
+ };
19046
+ const refresh = async () => {
19047
+ if (disposed) return;
19048
+ const next = readContext();
19049
+ if (!same(context, next)) {
19050
+ revision++;
19051
+ inFlight = null;
19052
+ clear();
19053
+ context = next;
19054
+ }
19055
+ const owner = context;
19056
+ if (!owner) return;
19057
+ if (inFlight || unsupported.has(owner.route)) return;
19058
+ const token = revision;
19059
+ const request = {};
19060
+ inFlight = request;
19061
+ try {
19062
+ const raw = await owner.route.sendRequest(
19063
+ THREAD_ACTIVITY_LIST_METHOD,
19064
+ { threadId: owner.threadId },
19065
+ { priority: "background", timeoutMs: 5e3 }
19066
+ );
19067
+ if (!valid(owner, token)) return;
19068
+ const result = threadActivityListResultSchema.parse(raw);
19069
+ if (!result.supported) {
19070
+ clear();
19071
+ return;
19072
+ }
19073
+ allActivities = result.activities;
19074
+ activities = supplementalBackgroundActivities(allActivities);
19075
+ if (selected && !activities.some((item) => item.id === selected)) {
19076
+ selected = null;
19077
+ instructionsExpanded = false;
19078
+ detail = null;
19079
+ }
19080
+ syncTarget(owner);
19081
+ if (selected) {
19082
+ const id = selected;
19083
+ const rawDetail = await owner.route.sendRequest(
19084
+ THREAD_ACTIVITY_READ_METHOD,
19085
+ { threadId: owner.threadId, activityId: id },
19086
+ { priority: "background", timeoutMs: 5e3 }
19087
+ );
19088
+ if (!valid(owner, token) || selected !== id) return;
19089
+ detail = backgroundActivityDetailSchema.parse(rawDetail);
19090
+ render();
19091
+ }
19092
+ } catch (error51) {
19093
+ if (!valid(owner, token)) return;
19094
+ if (isUnsupportedMethod(error51, THREAD_ACTIVITY_LIST_METHOD)) {
19095
+ unsupported.add(owner.route);
19096
+ clear();
19097
+ } else {
19098
+ syncTarget(owner);
19099
+ setError(message2(error51));
19100
+ }
19101
+ } finally {
19102
+ if (inFlight === request) inFlight = null;
19103
+ }
19104
+ };
19105
+ const timer = window2.setInterval(() => {
19106
+ clocks();
19107
+ void refresh();
19108
+ }, 1e3);
19109
+ void refresh();
19110
+ return {
19111
+ refreshContext() {
19112
+ if (!same(context, readContext()) || root && !root.isConnected) void refresh();
19113
+ },
19114
+ dispose() {
19115
+ disposed = true;
19116
+ revision++;
19117
+ window2.clearInterval(timer);
19118
+ clear();
19119
+ }
19120
+ };
19121
+ }
19122
+
18503
19123
  // src/voice-settings-sync.ts
18504
19124
  function desktopVoiceCallActive(owner) {
18505
19125
  const hook = Reflect.get(owner, "__codexhostNativeChatVoiceV1");
@@ -18601,9 +19221,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18601
19221
  }
18602
19222
 
18603
19223
  // src/codex-ssh-services.ts
18604
- var record6 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19224
+ var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18605
19225
  function isSshServices(value) {
18606
- if (!record6(value) || !Object.hasOwn(value, "sshConnections") || !Object.hasOwn(value, "remoteConnections"))
19226
+ if (!record7(value) || !Object.hasOwn(value, "sshConnections") || !Object.hasOwn(value, "remoteConnections"))
18607
19227
  return false;
18608
19228
  const ssh = value.sshConnections;
18609
19229
  const remote = value.remoteConnections;
@@ -18614,7 +19234,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18614
19234
  }
18615
19235
 
18616
19236
  // src/codex-ssh-adapter.ts
18617
- var record7 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
19237
+ var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
18618
19238
  function createCodexSshClient(ownerWindow) {
18619
19239
  let nativeServices;
18620
19240
  function services() {
@@ -18650,7 +19270,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18650
19270
  const abort = () => finish(new DOMException("Aborted", "AbortError"));
18651
19271
  const receive = (event) => {
18652
19272
  const message2 = event.data;
18653
- if (!record7(message2) || message2.type !== "fetch-response" || message2.requestId !== requestId2)
19273
+ if (!record8(message2) || message2.type !== "fetch-response" || message2.requestId !== requestId2)
18654
19274
  return;
18655
19275
  if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
18656
19276
  const detail = typeof message2.error === "string" ? `: ${message2.error}` : "";
@@ -18706,12 +19326,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18706
19326
  }
18707
19327
  async function list(signal) {
18708
19328
  const result = await request("refresh-remote-connections", {}, signal);
18709
- if (!record7(result) || !Array.isArray(result.remoteConnections))
19329
+ if (!record8(result) || !Array.isArray(result.remoteConnections))
18710
19330
  throw new Error("Invalid Codex SSH connection list");
18711
19331
  return result.remoteConnections.filter(
18712
- (item) => !(record7(item) && ["wsl", "remote-control"].includes(String(item.source)))
19332
+ (item) => !(record8(item) && ["wsl", "remote-control"].includes(String(item.source)))
18713
19333
  ).map((item) => {
18714
- if (!record7(item) || typeof item.hostId !== "string" || typeof item.displayName !== "string" || !["codex-managed", "discovered"].includes(String(item.source)) || typeof item.sshHost !== "string" || typeof item.autoConnect !== "boolean" || !(item.sshAlias == null || typeof item.sshAlias === "string") || !(item.identity == null || typeof item.identity === "string") || !(item.sshPort == null || Number.isInteger(item.sshPort) && Number(item.sshPort) > 0 && Number(item.sshPort) <= 65535)) {
19334
+ if (!record8(item) || typeof item.hostId !== "string" || typeof item.displayName !== "string" || !["codex-managed", "discovered"].includes(String(item.source)) || typeof item.sshHost !== "string" || typeof item.autoConnect !== "boolean" || !(item.sshAlias == null || typeof item.sshAlias === "string") || !(item.identity == null || typeof item.identity === "string") || !(item.sshPort == null || Number.isInteger(item.sshPort) && Number(item.sshPort) > 0 && Number(item.sshPort) <= 65535)) {
18715
19335
  throw new Error(
18716
19336
  "This Codex version uses an unsupported SSH configuration; open native settings"
18717
19337
  );
@@ -18783,11 +19403,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18783
19403
  },
18784
19404
  async state(hostId2, signal) {
18785
19405
  const result = await request("app-server-connection-state", { hostId: hostId2 }, signal);
18786
- if (!record7(result) || typeof result.state !== "string")
19406
+ if (!record8(result) || typeof result.state !== "string")
18787
19407
  throw new Error("Invalid Codex connection state");
18788
19408
  return {
18789
19409
  state: result.state,
18790
- error: typeof result.error === "string" ? result.error : record7(result.error) && typeof result.error.message === "string" ? result.error.message : null
19410
+ error: typeof result.error === "string" ? result.error : record8(result.error) && typeof result.error.message === "string" ? result.error.message : null
18791
19411
  };
18792
19412
  }
18793
19413
  };
@@ -19351,40 +19971,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19351
19971
  };
19352
19972
  }
19353
19973
 
19354
- // src/renderer-request-sender.ts
19355
- var RendererMethodUnavailableError = class extends Error {
19356
- constructor(method, cause) {
19357
- super(`${method} is unsupported on this Host connection`, { cause });
19358
- this.method = method;
19359
- this.name = "RendererMethodUnavailableError";
19360
- }
19361
- method;
19362
- code = -32601;
19363
- };
19364
- function isUnsupportedMethod(error51, method) {
19365
- if (typeof error51 !== "object" || error51 === null) return false;
19366
- const code = "code" in error51 ? error51.code : void 0;
19367
- const message2 = "message" in error51 ? error51.message : void 0;
19368
- return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
19369
- }
19370
- function createRendererRequestSender(send) {
19371
- const unsupported = /* @__PURE__ */ new Map();
19372
- return async (method, params, options) => {
19373
- const known = unsupported.get(method);
19374
- if (known) throw known;
19375
- try {
19376
- return await (options === void 0 ? send(method, params) : send(method, params, options));
19377
- } catch (error51) {
19378
- if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
19379
- const unavailable = new RendererMethodUnavailableError(method, error51);
19380
- unsupported.set(method, unavailable);
19381
- throw unavailable;
19382
- }
19383
- };
19384
- }
19385
-
19386
19974
  // src/renderer-questions.ts
19387
- function same(a, b) {
19975
+ function same2(a, b) {
19388
19976
  return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
19389
19977
  }
19390
19978
  function installRendererQuestions(window2, readContext) {
@@ -19412,7 +20000,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19412
20000
  const refresh = async () => {
19413
20001
  if (disposed) return;
19414
20002
  const next = readContext();
19415
- if (!same(context, next)) {
20003
+ if (!same2(context, next)) {
19416
20004
  clear();
19417
20005
  context = next;
19418
20006
  revision++;
@@ -19427,7 +20015,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19427
20015
  { threadId: current.threadId },
19428
20016
  { priority: "background", timeoutMs: 5e3 }
19429
20017
  );
19430
- if (disposed || revision !== startedRevision || !same(current, readContext())) return;
20018
+ if (disposed || revision !== startedRevision || !same2(current, readContext())) return;
19431
20019
  const question = threadQuestionsResultSchema.parse(raw).questions[0];
19432
20020
  if (!question || !question.questions.some(
19433
20021
  (field2) => field2.type === "choice" && (field2.multiple || field2.allowOther)
@@ -19452,7 +20040,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19452
20040
  current.composer.ownerDocument,
19453
20041
  question,
19454
20042
  async (answers, cancelled) => {
19455
- if (disposed || !same(current, readContext()) || cardKey !== key)
20043
+ if (disposed || !same2(current, readContext()) || cardKey !== key)
19456
20044
  throw new Error("Question owner changed");
19457
20045
  const raw2 = await current.route.sendRequest(
19458
20046
  THREAD_QUESTION_RESPOND_METHOD,
@@ -19467,7 +20055,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19467
20055
  );
19468
20056
  threadQuestionRespondResultSchema.parse(raw2);
19469
20057
  drafts.delete(key);
19470
- if (same(current, context)) {
20058
+ if (same2(current, context)) {
19471
20059
  revision++;
19472
20060
  if (cardKey === key) clear(false);
19473
20061
  }
@@ -19479,7 +20067,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19479
20067
  stopActivity = installQuestionActivity(
19480
20068
  window2,
19481
20069
  card.root,
19482
- () => same(current, readContext()) && card === mounted && mounted.autoResolution?.resetOnActivity === true,
20070
+ () => same2(current, readContext()) && card === mounted && mounted.autoResolution?.resetOnActivity === true,
19483
20071
  async () => {
19484
20072
  const raw2 = await current.route.sendRequest(
19485
20073
  THREAD_QUESTION_ACTIVITY_METHOD,
@@ -19490,14 +20078,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19490
20078
  },
19491
20079
  { priority: "background", timeoutMs: 4e3 }
19492
20080
  );
19493
- if (disposed || card !== mounted || !same(current, readContext())) return;
20081
+ if (disposed || card !== mounted || !same2(current, readContext())) return;
19494
20082
  const ack = threadQuestionActivityResultSchema.parse(raw2).autoResolution;
19495
20083
  if (ack) mounted.updateAutoResolution(ack);
19496
20084
  }
19497
20085
  );
19498
20086
  } catch (error51) {
19499
20087
  if (isUnsupportedMethod(error51, THREAD_QUESTIONS_LIST_METHOD)) unsupported.add(current.route);
19500
- if (revision === startedRevision && same(current, context)) clear();
20088
+ if (revision === startedRevision && same2(current, context)) clear();
19501
20089
  } finally {
19502
20090
  inFlight = false;
19503
20091
  }
@@ -19509,7 +20097,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19509
20097
  return {
19510
20098
  refresh,
19511
20099
  refreshContext() {
19512
- if (!same(context, readContext()) || card && !card.root.isConnected) void refresh();
20100
+ if (!same2(context, readContext()) || card && !card.root.isConnected) void refresh();
19513
20101
  },
19514
20102
  dispose() {
19515
20103
  disposed = true;
@@ -23162,12 +23750,12 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
23162
23750
  const externalAgent = agent;
23163
23751
  const showInstall = view.downloadVisible[externalAgent] === true;
23164
23752
  const showError = view.errorVisible[externalAgent] === true;
23165
- const visible = showInstall || showError;
23753
+ const visible2 = showInstall || showError;
23166
23754
  option.action.hidden = false;
23167
- option.action.disabled = !visible;
23755
+ option.action.disabled = !visible2;
23168
23756
  option.action.style.display = "inline-flex";
23169
- option.action.style.visibility = visible ? "visible" : "hidden";
23170
- option.action.style.pointerEvents = visible ? "auto" : "none";
23757
+ option.action.style.visibility = visible2 ? "visible" : "hidden";
23758
+ option.action.style.pointerEvents = visible2 ? "auto" : "none";
23171
23759
  if (showError) {
23172
23760
  option.action.dataset.mode = "error";
23173
23761
  option.action.textContent = "!";
@@ -23193,7 +23781,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
23193
23781
  option.action.setAttribute("aria-label", label);
23194
23782
  option.action.title = label;
23195
23783
  }
23196
- option.action.setAttribute("aria-hidden", String(!visible));
23784
+ option.action.setAttribute("aria-hidden", String(!visible2));
23197
23785
  }
23198
23786
  }
23199
23787
  return view;
@@ -23242,19 +23830,30 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
23242
23830
  trigger.style.overflow = "hidden";
23243
23831
  }
23244
23832
  function observeRendererCompactComposer(composer) {
23833
+ let compact;
23834
+ let frame = null;
23245
23835
  const update = () => {
23246
23836
  const width = composer.getBoundingClientRect().width;
23247
- if (width > 0) {
23248
- composer.toggleAttribute(COMPACT_COMPOSER_ATTRIBUTE, width <= COMPACT_COMPOSER_WIDTH);
23249
- }
23837
+ if (width <= 0) return;
23838
+ const next = width <= COMPACT_COMPOSER_WIDTH;
23839
+ if (next === compact) return;
23840
+ compact = next;
23841
+ composer.toggleAttribute(COMPACT_COMPOSER_ATTRIBUTE, next);
23250
23842
  };
23251
23843
  update();
23252
23844
  if (typeof ResizeObserver === "undefined")
23253
23845
  return () => composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
23254
- const observer = new ResizeObserver(update);
23846
+ const observer = new ResizeObserver(() => {
23847
+ if (frame !== null) return;
23848
+ frame = requestAnimationFrame(() => {
23849
+ frame = null;
23850
+ update();
23851
+ });
23852
+ });
23255
23853
  observer.observe(composer, { box: "border-box" });
23256
23854
  return () => {
23257
23855
  observer.disconnect();
23856
+ if (frame !== null) cancelAnimationFrame(frame);
23258
23857
  composer.removeAttribute(COMPACT_COMPOSER_ATTRIBUTE);
23259
23858
  };
23260
23859
  }
@@ -23800,9 +24399,9 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
23800
24399
  const totalCostUsd = usage?.totalCostUsd;
23801
24400
  const hasContext = usage?.contextUsedTokens !== void 0 && usage.contextWindowTokens !== void 0;
23802
24401
  const hasTokenUsage = usage?.totalTokens !== void 0 || usage?.inputTokens !== void 0 || usage?.cachedInputTokens !== void 0 || usage?.cacheWriteInputTokens !== void 0 || usage?.outputTokens !== void 0;
23803
- const visible = rendererUsageHasDisplayData(usage);
23804
- control.root.style.display = visible ? "inline-flex" : "none";
23805
- if (!visible) {
24402
+ const visible2 = rendererUsageHasDisplayData(usage);
24403
+ control.root.style.display = visible2 ? "inline-flex" : "none";
24404
+ if (!visible2) {
23806
24405
  closePopover(control);
23807
24406
  return false;
23808
24407
  }
@@ -24947,7 +25546,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
24947
25546
  const content = rendererModelSelectionNoticeContent(view, locale);
24948
25547
  control.selectionNotice.show(content.heading, content.message);
24949
25548
  }
24950
- function renderRendererModelPicker(control, view, visible, harnessId = "", locale = "en") {
25549
+ function renderRendererModelPicker(control, view, visible2, harnessId = "", locale = "en") {
24951
25550
  if (control.harnessId !== harnessId) {
24952
25551
  control.close();
24953
25552
  control.selectionNotice.hide();
@@ -24955,13 +25554,13 @@ Codex Fast mode prioritizes requests and may increase usage.`
24955
25554
  control.favorites = readModelFavorites(harnessId);
24956
25555
  delete control.root.dataset.catalogSignature;
24957
25556
  }
24958
- control.root.style.display = visible ? "inline-flex" : "none";
25557
+ control.root.style.display = visible2 ? "inline-flex" : "none";
24959
25558
  control.root.style.alignItems = "center";
24960
25559
  control.root.style.alignSelf = "center";
24961
25560
  control.root.style.height = "28px";
24962
25561
  control.root.style.verticalAlign = "middle";
24963
25562
  applyRendererTriggerChipSqueezeRoot(control.root, rendererModelTriggerMaxWidth());
24964
- if (!visible) {
25563
+ if (!visible2) {
24965
25564
  control.close();
24966
25565
  control.fast.close();
24967
25566
  control.selectionNotice.hide();
@@ -25318,17 +25917,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
25318
25917
  control.menu.append(button2);
25319
25918
  }
25320
25919
  }
25321
- function renderRendererPermissionModePicker(control, view, visible, locale = control.locale) {
25920
+ function renderRendererPermissionModePicker(control, view, visible2, locale = control.locale) {
25322
25921
  control.locale = locale;
25323
25922
  const messages = rendererHarnessMessages(locale);
25324
25923
  control.menu.setAttribute("aria-label", messages.permissionMode);
25325
- control.root.style.display = visible ? "inline-flex" : "none";
25924
+ control.root.style.display = visible2 ? "inline-flex" : "none";
25326
25925
  control.root.style.alignItems = "center";
25327
25926
  control.root.style.alignSelf = "center";
25328
25927
  control.root.style.height = "28px";
25329
25928
  control.root.style.verticalAlign = "middle";
25330
25929
  applyRendererTriggerChipSqueezeRoot(control.root, rendererPermissionModeTriggerMaxWidth());
25331
- if (!visible) {
25930
+ if (!visible2) {
25332
25931
  control.close();
25333
25932
  return;
25334
25933
  }
@@ -25822,9 +26421,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
25822
26421
  root.append(chip);
25823
26422
  }
25824
26423
  }
25825
- const visible = active.length > 0 && anchor !== null;
25826
- if (root.hidden === visible) root.hidden = !visible;
25827
- const display = visible ? "inline-flex" : "none";
26424
+ const visible2 = active.length > 0 && anchor !== null;
26425
+ if (root.hidden === visible2) root.hidden = !visible2;
26426
+ const display = visible2 ? "inline-flex" : "none";
25828
26427
  if (root.style.display !== display) root.style.display = display;
25829
26428
  const visibility = root.scrollWidth > root.clientWidth ? "hidden" : "visible";
25830
26429
  if (root.style.visibility !== visibility) root.style.visibility = visibility;
@@ -27716,6 +28315,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
27716
28315
  function isRecord9(value) {
27717
28316
  return value !== null && typeof value === "object" && !Array.isArray(value);
27718
28317
  }
28318
+ function conversationIdFrom(request) {
28319
+ if (typeof request === "string" && request) return request;
28320
+ if (!isRecord9(request)) return null;
28321
+ if (typeof request.conversationId === "string" && request.conversationId)
28322
+ return request.conversationId;
28323
+ if (typeof request.threadId === "string" && request.threadId) return request.threadId;
28324
+ return null;
28325
+ }
28326
+ function isHostExternalConversation(conversation, threadId) {
28327
+ return isRecord9(conversation) && conversation.id === threadId && conversation.modelProvider === "codexhost";
28328
+ }
27719
28329
  function isManager(value) {
27720
28330
  return isRecord9(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
27721
28331
  (key) => typeof value[key] === "function"
@@ -27751,6 +28361,27 @@ Codex Fast mode prioritizes requests and may increase usage.`
27751
28361
  if (!text) return params;
27752
28362
  return { ...params, input: [{ type: "text", text, text_elements: [] }] };
27753
28363
  }
28364
+ function installExternalQueueUi(manager) {
28365
+ const coordinator = manager.getTurnCoordinator();
28366
+ const options = isRecord9(coordinator) ? coordinator.options : null;
28367
+ if (!isRecord9(options) || typeof options.getMessageQueueMode !== "function") return null;
28368
+ const descriptor = Object.getOwnPropertyDescriptor(options, "getMessageQueueMode");
28369
+ if (!descriptor?.writable) return null;
28370
+ const original = options.getMessageQueueMode;
28371
+ const getMessageQueueMode = (...args) => {
28372
+ const threadId = conversationIdFrom(args[0]);
28373
+ if (threadId && typeof manager.getConversation === "function" && isHostExternalConversation(manager.getConversation(threadId), threadId)) {
28374
+ return Promise.resolve("queue");
28375
+ }
28376
+ return original.apply(options, args);
28377
+ };
28378
+ options.getMessageQueueMode = getMessageQueueMode;
28379
+ return () => {
28380
+ if (options.getMessageQueueMode === getMessageQueueMode) {
28381
+ Object.defineProperty(options, "getMessageQueueMode", descriptor);
28382
+ }
28383
+ };
28384
+ }
27754
28385
  function submissionHost(manager) {
27755
28386
  const coordinator = manager.getTurnCoordinator();
27756
28387
  const options = isRecord9(coordinator) ? coordinator.options : null;
@@ -27824,6 +28455,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
27824
28455
  function installRendererExternalSteering(target, sendTurnStart, prepareTurnInput) {
27825
28456
  if (!isManager(target)) return null;
27826
28457
  const manager = target;
28458
+ const restoreQueueUi = installExternalQueueUi(manager);
27827
28459
  const originalSteer = manager.steerTurn;
27828
28460
  const originalSend = manager.sendRequest;
27829
28461
  const routes = /* @__PURE__ */ new Map();
@@ -27834,7 +28466,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
27834
28466
  if ((method === "turn/start" || method === "turn/steer") && prepareTurnInput) {
27835
28467
  params = prepareTurnInput(params);
27836
28468
  }
27837
- if (method === "turn/start") params = restoreQueuedTurnStartText(manager, params);
28469
+ if (method === "turn/start" || method === "turn/steer") {
28470
+ params = restoreQueuedTurnStartText(manager, params);
28471
+ }
27838
28472
  const messageId = isRecord9(params) ? params.clientUserMessageId : null;
27839
28473
  const route = typeof messageId === "string" && isRecord9(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
27840
28474
  if (method !== "turn/start" || !isRecord9(params) || !route || route.threadId !== params.threadId) {
@@ -28041,6 +28675,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
28041
28675
  });
28042
28676
  return () => {
28043
28677
  disposed = true;
28678
+ restoreQueueUi?.();
28044
28679
  restoreMethod("steerTurn");
28045
28680
  if (getStreamRole) restoreMethod("getStreamRole");
28046
28681
  if (pending.size === 0) {
@@ -28209,10 +28844,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28209
28844
  }
28210
28845
 
28211
28846
  // src/renderer-thread-reference-persistence.ts
28212
- var record8 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
28847
+ var record9 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
28213
28848
  var SYNC_TIMEOUT_MS = 2e3;
28214
28849
  function restoreRpcThreadReferenceCapability(client, messages, isCurrent) {
28215
- if (!record8(messages) || !record8(messages.electronBridge)) return client;
28850
+ if (!record9(messages) || !record9(messages.electronBridge)) return client;
28216
28851
  const bridge = messages.electronBridge;
28217
28852
  const send = bridge.sendMessageFromView;
28218
28853
  if (typeof send !== "function") return client;
@@ -28227,7 +28862,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28227
28862
  const listener = (event) => {
28228
28863
  if (event.source != null && event.source !== messages) return;
28229
28864
  const message2 = event.data;
28230
- if (!record8(message2) || message2.type !== "persisted-atom-sync" || !record8(message2.state))
28865
+ if (!record9(message2) || message2.type !== "persisted-atom-sync" || !record9(message2.state))
28231
28866
  return;
28232
28867
  finish(!Object.hasOwn(message2.state, key));
28233
28868
  };
@@ -28268,12 +28903,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28268
28903
  }
28269
28904
 
28270
28905
  // src/renderer-thread-reference-capability.ts
28271
- var record9 = (value) => typeof value === "object" && value !== null;
28906
+ var record10 = (value) => typeof value === "object" && value !== null;
28272
28907
  function restoreThreadReferenceCapability(client, manager, isCurrent, messages = null) {
28273
- if (record9(manager) && manager.kind === "main-process-rpc") {
28908
+ if (record10(manager) && manager.kind === "main-process-rpc") {
28274
28909
  return restoreRpcThreadReferenceCapability(client, messages, isCurrent);
28275
28910
  }
28276
- if (!record9(manager) || !record9(manager.storage)) return client;
28911
+ if (!record10(manager) || !record10(manager.storage)) return client;
28277
28912
  const storage = manager.storage;
28278
28913
  const read = storage.readValue;
28279
28914
  const write = storage.writeValue;
@@ -28308,14 +28943,14 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28308
28943
  }
28309
28944
 
28310
28945
  // src/renderer-thread-reference-context.ts
28311
- var record10 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
28946
+ var record11 = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
28312
28947
  function createThreadReferenceContext(manager, hostId2, isCurrent) {
28313
28948
  const prepared = /* @__PURE__ */ new WeakMap();
28314
28949
  return (params) => {
28315
- if (hostId2 === "local" || !record10(manager) || typeof manager.getConversation !== "function" || !record10(params) || typeof params.threadId !== "string")
28950
+ if (hostId2 === "local" || !record11(manager) || typeof manager.getConversation !== "function" || !record11(params) || typeof params.threadId !== "string")
28316
28951
  return params;
28317
28952
  const conversation = manager.getConversation.call(manager, params.threadId);
28318
- if (!record10(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
28953
+ if (!record11(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
28319
28954
  return params;
28320
28955
  if (!isCurrent()) throw new Error("Thread reference connection is no longer available");
28321
28956
  const cached2 = prepared.get(params);
@@ -35547,7 +36182,7 @@ ${detail}` : ""}`
35547
36182
  }
35548
36183
  function defaultImportName(source, existing) {
35549
36184
  const base = source.provider === "openai-codex" ? "codex" : "grok";
35550
- const used = new Set(existing.map((record15) => record15.name));
36185
+ const used = new Set(existing.map((record16) => record16.name));
35551
36186
  const valid = (name) => credentialImportNameSchema.safeParse(name).success;
35552
36187
  if (!used.has(base)) return base;
35553
36188
  const local = source.label.includes("@") ? source.label.split("@")[0] ?? "" : "";
@@ -35570,7 +36205,7 @@ ${detail}` : ""}`
35570
36205
  const shown = (text) => accountDisplayText(text, hideEmails);
35571
36206
  const targetButtons = /* @__PURE__ */ new Map();
35572
36207
  const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
35573
- const sourceOf = (record15) => snapshot.sources.find((source) => source.id === record15.source.id);
36208
+ const sourceOf = (record16) => snapshot.sources.find((source) => source.id === record16.source.id);
35574
36209
  const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
35575
36210
  const compatibleSources = () => {
35576
36211
  const target = piTarget();
@@ -35608,7 +36243,7 @@ ${detail}` : ""}`
35608
36243
  sectionImport.addEventListener("click", () => {
35609
36244
  const sources = compatibleSources();
35610
36245
  const free = sources.find(
35611
- (source2) => !importedRecords().some((record15) => record15.source.id === source2.id)
36246
+ (source2) => !importedRecords().some((record16) => record16.source.id === source2.id)
35612
36247
  );
35613
36248
  const source = free ?? sources[0];
35614
36249
  if (source) openDialog("add", { source, choose: true }, SECTION_IMPORT_KEY);
@@ -35658,30 +36293,30 @@ ${detail}` : ""}`
35658
36293
  mark.append(createRendererAgentIcon(agent ?? "pi", 26, document2, pluginFor(agent ?? "pi")));
35659
36294
  return mark;
35660
36295
  };
35661
- const renderRow = (record15) => {
36296
+ const renderRow = (record16) => {
35662
36297
  const row = document2.createElement("div");
35663
36298
  row.className = "settings-pi-accounts__row";
35664
36299
  row.tabIndex = -1;
35665
- row.dataset.importName = record15.name;
35666
- row.setAttribute("aria-label", shown(record15.source.label));
35667
- const agent = record15.source.harnessId;
36300
+ row.dataset.importName = record16.name;
36301
+ row.setAttribute("aria-label", shown(record16.source.label));
36302
+ const agent = record16.source.harnessId;
35668
36303
  const mark = createMark(agent);
35669
36304
  const identity = document2.createElement("div");
35670
36305
  identity.className = "settings-pi-accounts__identity";
35671
36306
  const label = document2.createElement("strong");
35672
36307
  label.className = "settings-account-email";
35673
- label.textContent = shown(record15.source.label);
36308
+ label.textContent = shown(record16.source.label);
35674
36309
  label.title = label.textContent;
35675
36310
  label.translate = false;
35676
36311
  const meta3 = document2.createElement("div");
35677
36312
  meta3.className = "settings-account-metadata";
35678
- const source = sourceOf(record15);
36313
+ const source = sourceOf(record16);
35679
36314
  const parts = [
35680
36315
  metaPart(rendererAgentLabel(agent, pluginFor(agent)), "settings-pi-accounts__agent"),
35681
- metaPart(`${record15.name}/\u2026`, void 0, true),
36316
+ metaPart(`${record16.name}/\u2026`, void 0, true),
35682
36317
  metaPart(messages.copied)
35683
36318
  ];
35684
- const time3 = formatImportedAt(record15.importedAt);
36319
+ const time3 = formatImportedAt(record16.importedAt);
35685
36320
  if (time3) parts.push(metaPart(time3));
35686
36321
  parts.forEach((part, index) => {
35687
36322
  if (index > 0) {
@@ -35698,23 +36333,23 @@ ${detail}` : ""}`
35698
36333
  reimport.type = "button";
35699
36334
  reimport.className = "settings-account-action";
35700
36335
  reimport.textContent = messages.rowReimport;
35701
- reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record15.source.label)}`);
36336
+ reimport.setAttribute("aria-label", `${messages.reimport}: ${shown(record16.source.label)}`);
35702
36337
  reimport.disabled = busy || !source;
35703
36338
  reimport.title = messages.reimport;
35704
36339
  reimport.addEventListener("click", () => {
35705
- if (source) openDialog("reimport", { source, record: record15 }, `row:${record15.name}`);
36340
+ if (source) openDialog("reimport", { source, record: record16 }, `row:${record16.name}`);
35706
36341
  });
35707
36342
  const remove = document2.createElement("button");
35708
36343
  remove.type = "button";
35709
36344
  remove.className = "settings-account-action settings-pi-accounts__remove";
35710
36345
  remove.textContent = messages.rowRemove;
35711
- remove.setAttribute("aria-label", `${messages.remove}: ${shown(record15.source.label)}`);
36346
+ remove.setAttribute("aria-label", `${messages.remove}: ${shown(record16.source.label)}`);
35712
36347
  remove.disabled = busy;
35713
- remove.addEventListener("click", () => openDialog("remove", { record: record15 }, `row:${record15.name}`));
36348
+ remove.addEventListener("click", () => openDialog("remove", { record: record16 }, `row:${record16.name}`));
35714
36349
  if (source) actions.append(reimport);
35715
36350
  actions.append(remove);
35716
36351
  row.append(mark, identity, actions);
35717
- rows.set(record15.name, row);
36352
+ rows.set(record16.name, row);
35718
36353
  return row;
35719
36354
  };
35720
36355
  const loginTypeLabel = (type) => type === "oauth" ? messages.typeOauth : type === "api_key" ? messages.typeApiKey : messages.typeOther;
@@ -35867,7 +36502,7 @@ ${detail}` : ""}`
35867
36502
  const label = document2.createElement("strong");
35868
36503
  label.textContent = shown(choice.label);
35869
36504
  label.translate = false;
35870
- const existing = importedRecords().find((record15) => record15.source.id === choice.id);
36505
+ const existing = importedRecords().find((record16) => record16.source.id === choice.id);
35871
36506
  const agent = choice.harnessId;
35872
36507
  const detail = document2.createElement("span");
35873
36508
  detail.textContent = [
@@ -35908,7 +36543,7 @@ ${detail}` : ""}`
35908
36543
  const name = request.action === "list" ? void 0 : request.name;
35909
36544
  state = {
35910
36545
  source: state.source,
35911
- record: importedRecords().find((record15) => record15.name === name) ?? state.record
36546
+ record: importedRecords().find((record16) => record16.name === name) ?? state.record
35912
36547
  };
35913
36548
  show(next);
35914
36549
  } else {
@@ -35922,12 +36557,12 @@ ${detail}` : ""}`
35922
36557
  sourceRadios = [];
35923
36558
  body.replaceChildren();
35924
36559
  controls.replaceChildren();
35925
- const { source, record: record15 } = state;
36560
+ const { source, record: record16 } = state;
35926
36561
  const close = () => modal.close();
35927
36562
  if (mode2 === "add" || mode2 === "reimport") {
35928
36563
  title.textContent = mode2 === "add" ? messages.add : messages.reimport;
35929
36564
  modal.setAttribute("aria-label", title.textContent);
35930
- const active = source ?? record15?.source;
36565
+ const active = source ?? record16?.source;
35931
36566
  const choices = mode2 === "add" && state.choose ? compatibleSources() : [];
35932
36567
  if (choices.length > 1) body.append(sourcePicker(choices));
35933
36568
  else if (active) body.append(line(messages.source, shown(active.label)));
@@ -35936,8 +36571,8 @@ ${detail}` : ""}`
35936
36571
  input.maxLength = 48;
35937
36572
  input.autocomplete = "off";
35938
36573
  input.spellcheck = false;
35939
- input.value = record15?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
35940
- input.readOnly = Boolean(record15);
36574
+ input.value = record16?.name ?? (source ? defaultImportName(source, importedRecords()) : "codex");
36575
+ input.readOnly = Boolean(record16);
35941
36576
  input.addEventListener("input", () => {
35942
36577
  nameEdited = true;
35943
36578
  });
@@ -35971,7 +36606,7 @@ ${detail}` : ""}`
35971
36606
  {
35972
36607
  action: mode2 === "reimport" ? "reimport" : "import",
35973
36608
  sourceId: source2.id,
35974
- name: record15?.name ?? input.value,
36609
+ name: record16?.name ?? input.value,
35975
36610
  confirmed: true
35976
36611
  },
35977
36612
  "done"
@@ -35981,16 +36616,16 @@ ${detail}` : ""}`
35981
36616
  )
35982
36617
  );
35983
36618
  (mode2 === "add" ? input : controls.children[0]).focus();
35984
- } else if (mode2 === "remove" && record15) {
36619
+ } else if (mode2 === "remove" && record16) {
35985
36620
  title.textContent = messages.remove;
35986
36621
  modal.setAttribute("aria-label", title.textContent);
35987
- body.append(note(messages.removeWarning.replace("{name}", record15.name)));
36622
+ body.append(note(messages.removeWarning.replace("{name}", record16.name)));
35988
36623
  const cancel = command(messages.cancel, close);
35989
36624
  controls.append(
35990
36625
  cancel,
35991
36626
  command(
35992
36627
  messages.remove,
35993
- () => submit({ action: "remove", name: record15.name, confirmed: true }, null),
36628
+ () => submit({ action: "remove", name: record16.name, confirmed: true }, null),
35994
36629
  "danger"
35995
36630
  )
35996
36631
  );
@@ -35998,7 +36633,7 @@ ${detail}` : ""}`
35998
36633
  } else {
35999
36634
  title.textContent = messages.doneTitle;
36000
36635
  modal.setAttribute("aria-label", title.textContent);
36001
- const name = record15?.name;
36636
+ const name = record16?.name;
36002
36637
  if (name) body.append(line(messages.entry, `${name}/\u2026`, true));
36003
36638
  body.append(note(messages.done));
36004
36639
  const done = command(messages.close, close, "primary");
@@ -36045,21 +36680,21 @@ ${detail}` : ""}`
36045
36680
  (candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
36046
36681
  );
36047
36682
  if (!source || !target) return null;
36048
- const record15 = target.imports.find((candidate) => candidate.source.id === source.id);
36683
+ const record16 = target.imports.find((candidate) => candidate.source.id === source.id);
36049
36684
  const key = `${harnessId}:${accountLabel}:import`;
36050
36685
  const button2 = document2.createElement("button");
36051
36686
  button2.type = "button";
36052
36687
  button2.className = "settings-account-pi-import";
36053
36688
  button2.dataset.accountFocus = key;
36054
36689
  button2.disabled = busy;
36055
- const hint = record15 ? messages.importedHint.replace("{name}", record15.name) : messages.add;
36690
+ const hint = record16 ? messages.importedHint.replace("{name}", record16.name) : messages.add;
36056
36691
  button2.title = hint;
36057
36692
  button2.setAttribute("aria-label", hint);
36058
36693
  button2.append(createRendererAgentIcon("pi", 12, document2, pluginFor("pi")));
36059
- if (record15) {
36694
+ if (record16) {
36060
36695
  button2.dataset.state = "imported";
36061
36696
  const name = document2.createElement("code");
36062
- name.textContent = `${record15.name}/\u2026`;
36697
+ name.textContent = `${record16.name}/\u2026`;
36063
36698
  name.translate = false;
36064
36699
  button2.append(name, createRendererSettingsIcon("check", 12));
36065
36700
  } else {
@@ -36067,7 +36702,7 @@ ${detail}` : ""}`
36067
36702
  button2.append(messages.add);
36068
36703
  }
36069
36704
  button2.addEventListener("click", () => {
36070
- if (!record15) {
36705
+ if (!record16) {
36071
36706
  openDialog("add", { source }, key);
36072
36707
  return;
36073
36708
  }
@@ -36076,7 +36711,7 @@ ${detail}` : ""}`
36076
36711
  renderSection();
36077
36712
  sectionToggle.setAttribute("aria-expanded", "true");
36078
36713
  }
36079
- const row = rows.get(record15.name);
36714
+ const row = rows.get(record16.name);
36080
36715
  row?.scrollIntoView({ block: "nearest", behavior: "smooth" });
36081
36716
  row?.focus();
36082
36717
  });
@@ -42788,7 +43423,7 @@ th[aria-sort] .console-usage-sort__mark {
42788
43423
  place();
42789
43424
  const observer = ownerWindow ? new ownerWindow.MutationObserver((records) => {
42790
43425
  const titlebar = source?.closest("[data-app-shell-titlebar]");
42791
- if (!source?.isConnected || records.some((record15) => titlebar?.contains(record15.target))) {
43426
+ if (!source?.isConnected || records.some((record16) => titlebar?.contains(record16.target))) {
42792
43427
  place();
42793
43428
  }
42794
43429
  }) : null;
@@ -46853,6 +47488,7 @@ ${usage_default}`;
46853
47488
  }
46854
47489
  pendingReplacements.clear();
46855
47490
  questions.refreshContext();
47491
+ backgroundActivity.refreshContext();
46856
47492
  };
46857
47493
  const scheduleScan = (refreshTargets = false) => {
46858
47494
  refreshTargetsOnNextScan ||= refreshTargets;
@@ -47153,16 +47789,18 @@ ${usage_default}`;
47153
47789
  const connectedComposers = () => [...mountedByComposer.values()].filter(
47154
47790
  (mounted) => isMountedComposer(mounted.composer) && mounted.control.root.isConnected
47155
47791
  );
47156
- const questions = installRendererQuestions(window, () => {
47157
- const visible = connectedComposers().filter(
47792
+ const readActivityContext = () => {
47793
+ const visible2 = connectedComposers().filter(
47158
47794
  (mounted2) => mounted2.composer.getClientRects().length > 0 && window.getComputedStyle(mounted2.composer).visibility === "visible" && !mounted2.composer.closest('[hidden], [inert], [aria-hidden="true"]') && controller.get(mounted2.composer).agent !== "codex"
47159
47795
  );
47160
- const mounted = visible.length === 1 ? visible[0] : void 0;
47796
+ const mounted = visible2.length === 1 ? visible2[0] : void 0;
47161
47797
  const threadId = mounted ? threadIdFromComposerModelTarget(findComposerModelTarget(mounted.composer)) : null;
47162
47798
  const hostId2 = mounted?.hostId;
47163
47799
  const route = hostId2 ? window.__codexhostHostRoutingV1?.forHost(hostId2) : null;
47164
47800
  return mounted && threadId && hostId2 && route ? { hostId: hostId2, threadId, composer: mounted.composer, route: route.manager } : null;
47165
- });
47801
+ };
47802
+ const questions = installRendererQuestions(window, readActivityContext);
47803
+ const backgroundActivity = installRendererBackgroundActivity(window, readActivityContext);
47166
47804
  const api = {
47167
47805
  remoteConnections: (request) => handleRemoteConnectionsRequest(remoteConnections, request),
47168
47806
  currentThreadId() {
@@ -47256,6 +47894,7 @@ ${usage_default}`;
47256
47894
  if (disposed) return;
47257
47895
  disposed = true;
47258
47896
  questions.dispose();
47897
+ backgroundActivity.dispose();
47259
47898
  usageNotificationDispose();
47260
47899
  adapterDispose?.();
47261
47900
  adapterDispose = null;
@@ -47463,8 +48102,8 @@ ${usage_default}`;
47463
48102
  // src/renderer-voice-capability.ts
47464
48103
  var GLOBAL = "__codexhostVoiceCapabilityV1";
47465
48104
  var INFERENCE_GATE = "3683713372";
47466
- var record11 = (value) => value !== null && typeof value === "object";
47467
- var capable = (value) => record11(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
48105
+ var record12 = (value) => value !== null && typeof value === "object";
48106
+ var capable = (value) => record12(value) && typeof value.isLoading === "boolean" && typeof value.isError === "boolean" && typeof value.isCapable === "boolean";
47468
48107
  var equal = (a, b) => a.isLoading === b.isLoading && a.isError === b.isError && a.isCapable === b.isCapable;
47469
48108
  function replayVoiceCapability(store, atom, gate) {
47470
48109
  const evaluate = (override) => {
@@ -47502,7 +48141,7 @@ ${usage_default}`;
47502
48141
  }
47503
48142
  }
47504
48143
  function isFamily(value) {
47505
- return record11(value) && record11(value.scope) && typeof value.resolve === "function";
48144
+ return record12(value) && record12(value.scope) && typeof value.resolve === "function";
47506
48145
  }
47507
48146
  function initializeVoiceCapabilityFamilies(module, assets) {
47508
48147
  const initialize = module[assets.capabilityInit];
@@ -47518,7 +48157,7 @@ ${usage_default}`;
47518
48157
  const result = [];
47519
48158
  const seen = /* @__PURE__ */ new Set();
47520
48159
  let hook = fiber.memoizedState;
47521
- while (record11(hook) && result.length < 4096 && !seen.has(hook)) {
48160
+ while (record12(hook) && result.length < 4096 && !seen.has(hook)) {
47522
48161
  seen.add(hook);
47523
48162
  result.push(hook);
47524
48163
  hook = hook.next;
@@ -47534,7 +48173,7 @@ ${usage_default}`;
47534
48173
  let root = ancestors2[0];
47535
48174
  if (chat) {
47536
48175
  const owners = ancestors2.filter(
47537
- ({ memoizedProps: props }) => record11(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record11(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
48176
+ ({ memoizedProps: props }) => record12(props) && props.isWorkConversation === false && props.isTemporaryChat === false && props.shouldBlockExternalEgress === false && props.readOnly !== true && typeof props.conversationId === "string" && record12(props.composerSelectionContext) && props.composerSelectionContext.conversationId === props.conversationId
47538
48177
  );
47539
48178
  if (owners.length !== 1) return fibers;
47540
48179
  root = owners[0];
@@ -47546,7 +48185,7 @@ ${usage_default}`;
47546
48185
  const ancestors3 = committedReactAncestors(Object.getOwnPropertyDescriptor(element, key)?.value);
47547
48186
  const boundary = ancestors3.indexOf(root);
47548
48187
  if (boundary < 0) continue;
47549
- for (const fiber of ancestors3.slice(0, boundary + 1)) if (record11(fiber)) fibers.add(fiber);
48188
+ for (const fiber of ancestors3.slice(0, boundary + 1)) if (record12(fiber)) fibers.add(fiber);
47550
48189
  }
47551
48190
  return fibers;
47552
48191
  }
@@ -47567,7 +48206,7 @@ ${usage_default}`;
47567
48206
  const list = hooks(fiber);
47568
48207
  for (const memo of list) {
47569
48208
  const [signal, deps] = Array.isArray(memo.memoizedState) ? memo.memoizedState : [];
47570
- if (!record11(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
48209
+ if (!record12(signal) || !Array.isArray(deps) || deps.length !== 5 || deps[3] !== family || !(deps[1] instanceof Map) || deps[2] !== void 0)
47571
48210
  continue;
47572
48211
  const chain = deps[1];
47573
48212
  const node = chain.get(family.scope.id);
@@ -47576,7 +48215,7 @@ ${usage_default}`;
47576
48215
  const matches = [...members].filter(([, member]) => member.cacheKey === deps[0]);
47577
48216
  if (matches.length !== 1 || typeof matches[0]?.[0] !== "string") continue;
47578
48217
  const parameter = JSON.parse(matches[0][0]);
47579
- if (!record11(parameter) || Object.keys(parameter).some((key) => key !== "name" && key !== "hostId") || !names.some((name) => parameter.name === name) || realtimeOnly && parameter.name !== "voice.realtime" || parameter.hostId !== void 0 && parameter.hostId !== "local" || parameter.name === "voice.thread" && parameter.hostId !== "local")
48218
+ if (!record12(parameter) || Object.keys(parameter).some((key) => key !== "name" && key !== "hostId") || !names.some((name) => parameter.name === name) || realtimeOnly && parameter.name !== "voice.realtime" || parameter.hostId !== void 0 && parameter.hostId !== "local" || parameter.name === "voice.thread" && parameter.hostId !== "local")
47580
48219
  continue;
47581
48220
  const subscriptions = list.filter((hook2) => {
47582
48221
  const state = hook2.memoizedState;
@@ -47589,7 +48228,7 @@ ${usage_default}`;
47589
48228
  const effect = hook.next?.next?.memoizedState;
47590
48229
  const store = signal.store;
47591
48230
  const gate = gates.resolve(node, chain, INFERENCE_GATE)?.atom;
47592
- if (!gate || !instance || !record11(effect) || !Array.isArray(effect.deps) || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || typeof instance.getSnapshot !== "function" || !capable(store.get(signal.atom)) || !capable(subscriber.getSnapshot()) || !capable(instance.getSnapshot()) || !equal(
48231
+ if (!gate || !instance || !record12(effect) || !Array.isArray(effect.deps) || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || typeof instance.getSnapshot !== "function" || !capable(store.get(signal.atom)) || !capable(subscriber.getSnapshot()) || !capable(instance.getSnapshot()) || !equal(
47593
48232
  store.get(signal.atom),
47594
48233
  subscriber.getSnapshot()
47595
48234
  ) || !equal(subscriber.getSnapshot(), instance.getSnapshot()) || subscriber.createRender?.() != null)
@@ -47701,7 +48340,7 @@ ${usage_default}`;
47701
48340
  target[GLOBAL] = handle;
47702
48341
  const hookActive = (key) => {
47703
48342
  const hook = target[key];
47704
- return record11(hook) && hook.status === "active";
48343
+ return record12(hook) && hook.status === "active";
47705
48344
  };
47706
48345
  const currentRoute = () => {
47707
48346
  try {
@@ -47777,7 +48416,7 @@ ${usage_default}`;
47777
48416
  }
47778
48417
 
47779
48418
  // src/renderer-voice-settings-availability.ts
47780
- var record12 = (value) => value !== null && typeof value === "object";
48419
+ var record13 = (value) => value !== null && typeof value === "object";
47781
48420
  function voiceSettingsSurface(doc, page, appScope) {
47782
48421
  const pages = /* @__PURE__ */ new Set();
47783
48422
  const fibers = /* @__PURE__ */ new Set();
@@ -47800,8 +48439,8 @@ ${usage_default}`;
47800
48439
  const scopes = /* @__PURE__ */ new Map();
47801
48440
  for (const fiber of fibers)
47802
48441
  for (const hook of hooks(fiber)) {
47803
- const scope2 = record12(hook.memoizedState) ? hook.memoizedState.current : void 0;
47804
- if (record12(scope2) && scope2.scope === appScope && record12(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(appScope.id) === scope2.node && typeof scope2.get === "function")
48442
+ const scope2 = record13(hook.memoizedState) ? hook.memoizedState.current : void 0;
48443
+ if (record13(scope2) && scope2.scope === appScope && record13(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(appScope.id) === scope2.node && typeof scope2.get === "function")
47805
48444
  scopes.set(scope2.node, scope2);
47806
48445
  }
47807
48446
  const scope = [...scopes.values()][0];
@@ -47845,7 +48484,7 @@ ${usage_default}`;
47845
48484
  for (const fiber of currentFibers())
47846
48485
  for (const hook2 of hooks(fiber)) {
47847
48486
  const [subscriber2, deps] = Array.isArray(hook2.memoizedState) ? hook2.memoizedState : [];
47848
- if (!record12(subscriber2) || typeof subscriber2.getSnapshot !== "function" || !Array.isArray(deps) || deps.length !== 2 || deps[0] !== store || !record12(deps[1]) || typeof deps[1].read !== "function")
48487
+ if (!record13(subscriber2) || typeof subscriber2.getSnapshot !== "function" || !Array.isArray(deps) || deps.length !== 2 || deps[0] !== store || !record13(deps[1]) || typeof deps[1].read !== "function")
47849
48488
  continue;
47850
48489
  const atom2 = deps[1];
47851
48490
  if (availability(store, atom2, voice, gate) === true)
@@ -47858,7 +48497,7 @@ ${usage_default}`;
47858
48497
  const instance = hook.next?.queue;
47859
48498
  const effect = hook.next?.next?.memoizedState;
47860
48499
  const native = store.get(atom);
47861
- if (!instance || typeof instance.getSnapshot !== "function" || !record12(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
48500
+ if (!instance || typeof instance.getSnapshot !== "function" || !record13(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
47862
48501
  throw new Error("Unsupported Settings availability subscription");
47863
48502
  for (const [object3, key] of [
47864
48503
  [store, "sub"],
@@ -47917,7 +48556,7 @@ ${usage_default}`;
47917
48556
  }
47918
48557
 
47919
48558
  // src/renderer-dictation-settings.ts
47920
- var record13 = (value) => value !== null && typeof value === "object";
48559
+ var record14 = (value) => value !== null && typeof value === "object";
47921
48560
  var mode = (value) => value === null || value === "os-global" || value === "app";
47922
48561
  function replayDictationSettingsMode(store, atom, capabilities, gate) {
47923
48562
  try {
@@ -47960,7 +48599,7 @@ ${usage_default}`;
47960
48599
  function bindDictationSettingsMode(currentFibers, store, atom, capabilities, gate, allowed) {
47961
48600
  const readers = () => [...currentFibers()].flatMap(hooks).filter((hook) => {
47962
48601
  const [subscriber, deps] = Array.isArray(hook.memoizedState) ? hook.memoizedState : [];
47963
- return record13(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
48602
+ return record14(subscriber) && typeof subscriber.getSnapshot === "function" && Array.isArray(deps) && deps.length === 2 && deps[0] === store && deps[1] === atom;
47964
48603
  });
47965
48604
  const subscriptions = readers();
47966
48605
  if (!subscriptions.length || replayDictationSettingsMode(store, atom, capabilities, gate) === void 0)
@@ -47973,7 +48612,7 @@ ${usage_default}`;
47973
48612
  const instance = hook.next?.queue;
47974
48613
  const effect = hook.next?.next?.memoizedState;
47975
48614
  const native = store.get(atom);
47976
- if (!instance || typeof instance.getSnapshot !== "function" || !record13(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
48615
+ if (!instance || typeof instance.getSnapshot !== "function" || !record14(effect) || !Array.isArray(effect.deps) || effect.deps.length !== 1 || effect.deps[0] !== subscriber.subscribe || typeof effect.create !== "function" || subscriber.getSnapshot() !== native || instance.getSnapshot() !== native || subscriber.createRender?.() != null)
47977
48616
  throw new Error("Unsupported Settings dictation mode subscription");
47978
48617
  for (const [object3, key] of [
47979
48618
  [store, "sub"],
@@ -48045,8 +48684,8 @@ ${usage_default}`;
48045
48684
  var MESSAGE_ID = "settings.general.realtimeVoice.unavailable.description";
48046
48685
  var LABEL = "Voice settings unavailable with this provider";
48047
48686
  var DESCRIPTION = "Your account allows voice chat. These Desktop settings require the default inference provider. Start ChatGPT Chat voice from the Chat composer.";
48048
- var record14 = (value) => value !== null && typeof value === "object";
48049
- var settled = (value, isCapable) => record14(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
48687
+ var record15 = (value) => value !== null && typeof value === "object";
48688
+ var settled = (value, isCapable) => record15(value) && value.isLoading === false && value.isError === false && value.isCapable === isCapable;
48050
48689
  function realtimeAtoms(scope, modules) {
48051
48690
  const atom = modules.capability.resolve(scope.node, scope.chain, { name: "voice.realtime" }).resolve(scope.node, scope.chain);
48052
48691
  return {
@@ -48057,7 +48696,7 @@ ${usage_default}`;
48057
48696
  function providerBlocksVoiceSettings(scope, modules) {
48058
48697
  try {
48059
48698
  const access = scope.get(modules.access);
48060
- if (!record14(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
48699
+ if (!record15(access) || access.status !== "allowed" || !settled(scope.get(modules.capability, { name: "voice" }), true) || !settled(scope.get(modules.capability, { name: "voice.realtime" }), false))
48061
48700
  return false;
48062
48701
  const { atom, gate } = realtimeAtoms(scope, modules);
48063
48702
  return replayVoiceCapability(scope.node.store, atom, gate)?.isCapable === true;
@@ -48075,10 +48714,10 @@ ${usage_default}`;
48075
48714
  );
48076
48715
  if (!ancestors2.some((fiber) => fiber.type === modules.page)) continue;
48077
48716
  const owner = ancestors2.find(
48078
- ({ memoizedProps: props2 }) => record14(props2) && record14(props2.description) && record14(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
48717
+ ({ memoizedProps: props2 }) => record15(props2) && record15(props2.description) && record15(props2.description.props) && props2.description.props.id === MESSAGE_ID && props2.control === null
48079
48718
  );
48080
48719
  const props = owner?.memoizedProps;
48081
- if (!record14(props) || !record14(props.description) || !record14(props.description.props) || !record14(props.label) || !record14(props.label.props) || element.textContent !== props.description.props.defaultMessage)
48720
+ if (!record15(props) || !record15(props.description) || !record15(props.description.props) || !record15(props.label) || !record15(props.label.props) || element.textContent !== props.description.props.defaultMessage)
48082
48721
  continue;
48083
48722
  const labelText = props.label.props.defaultMessage;
48084
48723
  if (typeof labelText !== "string") continue;
@@ -48095,10 +48734,10 @@ ${usage_default}`;
48095
48734
  for (const fiber of ancestors2) {
48096
48735
  let hook = fiber.memoizedState;
48097
48736
  const seen = /* @__PURE__ */ new Set();
48098
- while (record14(hook) && seen.size < 4096 && !seen.has(hook)) {
48737
+ while (record15(hook) && seen.size < 4096 && !seen.has(hook)) {
48099
48738
  seen.add(hook);
48100
- const scope2 = record14(hook.memoizedState) ? hook.memoizedState.current : void 0;
48101
- if (record14(scope2) && scope2.scope === modules.appScope && record14(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(modules.appScope.id) === scope2.node && typeof scope2.get === "function")
48739
+ const scope2 = record15(hook.memoizedState) ? hook.memoizedState.current : void 0;
48740
+ if (record15(scope2) && scope2.scope === modules.appScope && record15(scope2.node) && scope2.chain instanceof Map && scope2.chain.get(modules.appScope.id) === scope2.node && typeof scope2.get === "function")
48102
48741
  scopes.set(scope2.node, scope2);
48103
48742
  hook = hook.next;
48104
48743
  }
@@ -48255,7 +48894,7 @@ ${usage_default}`;
48255
48894
  )
48256
48895
  );
48257
48896
  if (disposed) return;
48258
- const latest = assets.version === NATIVE_CHAT_VOICE_VERSION;
48897
+ const latest = assets.version === "26.1023.51421";
48259
48898
  const initialize = latest ? initial.N4n : initial.l0n;
48260
48899
  if (typeof initialize !== "function" || typeof settings.VoiceSettings !== "function")
48261
48900
  return;