@codexhost/cli-darwin-x64 0.18.0-beta.4 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +98 -55
  4. package/app/console-web.js +276 -188
  5. package/app/desktop-controller.mjs +283 -113
  6. package/app/host-runtime.mjs +2129 -1529
  7. package/app/plugins/antigravity/plugin.mjs +787 -303
  8. package/app/plugins/claude-code/plugin.mjs +85 -45
  9. package/app/plugins/codebuddy/plugin.mjs +99 -59
  10. package/app/plugins/codex-usage/plugin.mjs +85 -45
  11. package/app/plugins/copilot/plugin.mjs +90 -50
  12. package/app/plugins/cursor-cli/plugin.mjs +113 -73
  13. package/app/plugins/deepseek-harness/plugin.mjs +116 -76
  14. package/app/plugins/devin/plugin.mjs +90 -50
  15. package/app/plugins/grok/plugin.mjs +96 -56
  16. package/app/plugins/hermes/plugin.mjs +77 -37
  17. package/app/plugins/kimi-code/plugin.mjs +94 -54
  18. package/app/plugins/kiro-cli/plugin.mjs +90 -50
  19. package/app/plugins/omp/plugin.mjs +81 -41
  20. package/app/plugins/opencode/plugin.mjs +78 -38
  21. package/app/plugins/pi/plugin.mjs +94 -54
  22. package/app/plugins/qoder/plugin.mjs +106 -66
  23. package/app/plugins/qoder-cn/plugin.mjs +106 -66
  24. package/app/plugins/qwen-code/plugin.mjs +101 -61
  25. package/app/plugins/workbuddy/plugin.mjs +99 -59
  26. package/app/plugins/zcode/plugin.mjs +82 -42
  27. package/app/renderer-extension.js +435 -361
  28. package/app/web/assets/{index-D1dOzBMI.js → index-C0aXz2jD.js} +63 -63
  29. package/app/web/codex-agent.png +0 -0
  30. package/app/web/codexhost-settings.js +229 -175
  31. package/app/web/index.html +1 -1
  32. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  33. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +61 -61
  34. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +8 -8
  35. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +2 -2
  36. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +12 -12
  37. package/app/web/plugins/deepseek-ai__dsh-client-ui-permission-presets/client.js +1 -1
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings/client.js +1 -1
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +3 -3
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-theme/client.js +1 -1
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +8 -8
  43. package/app/web/sw.js +41 -6
  44. package/app/web-modules/server.mjs +2079 -1201
  45. package/bin/codexhost +0 -0
  46. package/libexec/codexhost-shim +0 -0
  47. package/libexec/codexhost-updater +0 -0
  48. package/package.json +1 -1
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  (() => {
3
3
  var __defProp = Object.defineProperty;
4
- var __export = (target, all) => {
4
+ var __export = (target2, all) => {
5
5
  for (var name in all)
6
- __defProp(target, name, { get: all[name], enumerable: true });
6
+ __defProp(target2, name, { get: all[name], enumerable: true });
7
7
  };
8
8
 
9
9
  // src/agent-selection-state.ts
@@ -11,14 +11,14 @@
11
11
  function defaultIdFactory(sequence) {
12
12
  return `codexhost-composer-${Date.now().toString(36)}-${sequence.toString(36)}`;
13
13
  }
14
- function isDefaultTarget(target) {
15
- return target?.[0] === "default";
14
+ function isDefaultTarget(target2) {
15
+ return target2?.[0] === "default";
16
16
  }
17
- function isConversationTarget(target) {
18
- return target?.[0] === "conversation";
17
+ function isConversationTarget(target2) {
18
+ return target2?.[0] === "conversation";
19
19
  }
20
- function isIdentifiedTarget(target) {
21
- return target?.[0] === "conversation" || target?.[0] === "default" && typeof target[1] === "string" && target[1].startsWith("client-new-thread:");
20
+ function isIdentifiedTarget(target2) {
21
+ return target2?.[0] === "conversation" || target2?.[0] === "default" && typeof target2[1] === "string" && target2[1].startsWith("client-new-thread:");
22
22
  }
23
23
  function sameTarget(left, right) {
24
24
  return left.length === right.length && left.every((value, index) => value === right[index]);
@@ -56,15 +56,15 @@
56
56
  if (state && !preservePendingSubmission) this.#pendingSubmissions.delete(state);
57
57
  this.#states.delete(composer);
58
58
  }
59
- mount(composer, target, preferredNewThreadAgent) {
60
- const bound = this.#targetState(target);
59
+ mount(composer, target2, preferredNewThreadAgent) {
60
+ const bound = this.#targetState(target2);
61
61
  if (bound) {
62
62
  this.#states.set(composer, bound);
63
63
  return bound;
64
64
  }
65
65
  const preferredAgent = preferredNewThreadAgent ?? this.#lastSubmittedAgent;
66
- const state = this.#state(composer, isDefaultTarget(target) ? preferredAgent : "codex");
67
- if (isIdentifiedTarget(target)) this.#targetStates.push({ target, state });
66
+ const state = this.#state(composer, isDefaultTarget(target2) ? preferredAgent : "codex");
67
+ if (isIdentifiedTarget(target2)) this.#targetStates.push({ target: target2, state });
68
68
  return state;
69
69
  }
70
70
  isSwitching(composer) {
@@ -90,20 +90,20 @@
90
90
  isCurrentOwnershipRequest(composer, generation) {
91
91
  return (this.#ownershipRequestGenerations.get(this.#state(composer)) ?? 0) === generation;
92
92
  }
93
- rebindConversation(composer, target) {
94
- if (!isConversationTarget(target)) return null;
93
+ rebindConversation(composer, target2) {
94
+ if (!isConversationTarget(target2)) return null;
95
95
  const previous = this.#state(composer);
96
96
  this.#pendingSubmissions.delete(previous);
97
97
  this.#modelRequestGenerations.set(previous, ++this.#modelRequestSequence);
98
98
  this.#ownershipRequestGenerations.set(previous, ++this.#ownershipRequestSequence);
99
- let state = this.#targetState(target);
99
+ let state = this.#targetState(target2);
100
100
  if (!state) {
101
101
  state = {
102
102
  agent: "codex",
103
103
  phase: "draft",
104
104
  composerId: this.#idFactory(++this.#composerSequence)
105
105
  };
106
- this.#targetStates.push({ target, state });
106
+ this.#targetStates.push({ target: target2, state });
107
107
  }
108
108
  this.#states.set(composer, state);
109
109
  this.#modelRequestGenerations.set(state, ++this.#modelRequestSequence);
@@ -184,17 +184,17 @@
184
184
  if (state.phase === "draft") this.#lastSubmittedAgent = state.agent;
185
185
  return state;
186
186
  }
187
- transfer(source, replacement, target = null) {
187
+ transfer(source, replacement, target2 = null) {
188
188
  const state = this.#states.get(source);
189
189
  if (!state) return false;
190
- const bound = this.#targetState(target);
190
+ const bound = this.#targetState(target2);
191
191
  if (bound && bound !== state) return false;
192
192
  if (source !== replacement) {
193
193
  if (this.#states.has(replacement)) return false;
194
194
  this.#states.set(replacement, state);
195
195
  }
196
- if (isIdentifiedTarget(target) && !bound) this.#targetStates.push({ target, state });
197
- if (isConversationTarget(target) && this.#pendingSubmissions.delete(state))
196
+ if (isIdentifiedTarget(target2) && !bound) this.#targetStates.push({ target: target2, state });
197
+ if (isConversationTarget(target2) && this.#pendingSubmissions.delete(state))
198
198
  state.phase = "locked";
199
199
  return true;
200
200
  }
@@ -220,9 +220,9 @@
220
220
  this.#switching.delete(state);
221
221
  }
222
222
  }
223
- #targetState(target) {
224
- if (!isIdentifiedTarget(target)) return null;
225
- return this.#targetStates.find((candidate) => sameTarget(candidate.target, target))?.state ?? null;
223
+ #targetState(target2) {
224
+ if (!isIdentifiedTarget(target2)) return null;
225
+ return this.#targetStates.find((candidate) => sameTarget(candidate.target, target2))?.state ?? null;
226
226
  }
227
227
  #state(composer, initialAgent) {
228
228
  const existing = this.#states.get(composer);
@@ -984,8 +984,8 @@
984
984
  function objectClone(obj) {
985
985
  return Object.create(Object.getPrototypeOf(obj), Object.getOwnPropertyDescriptors(obj));
986
986
  }
987
- function assignProp(target, prop, value) {
988
- Object.defineProperty(target, prop, {
987
+ function assignProp(target2, prop, value) {
988
+ Object.defineProperty(target2, prop, {
989
989
  value,
990
990
  writable: true,
991
991
  enumerable: true,
@@ -1168,35 +1168,35 @@
1168
1168
  return params;
1169
1169
  }
1170
1170
  function createTransparentProxy(getter) {
1171
- let target;
1171
+ let target2;
1172
1172
  return new Proxy({}, {
1173
1173
  get(_, prop, receiver) {
1174
- target ?? (target = getter());
1175
- return Reflect.get(target, prop, receiver);
1174
+ target2 ?? (target2 = getter());
1175
+ return Reflect.get(target2, prop, receiver);
1176
1176
  },
1177
1177
  set(_, prop, value, receiver) {
1178
- target ?? (target = getter());
1179
- return Reflect.set(target, prop, value, receiver);
1178
+ target2 ?? (target2 = getter());
1179
+ return Reflect.set(target2, prop, value, receiver);
1180
1180
  },
1181
1181
  has(_, prop) {
1182
- target ?? (target = getter());
1183
- return Reflect.has(target, prop);
1182
+ target2 ?? (target2 = getter());
1183
+ return Reflect.has(target2, prop);
1184
1184
  },
1185
1185
  deleteProperty(_, prop) {
1186
- target ?? (target = getter());
1187
- return Reflect.deleteProperty(target, prop);
1186
+ target2 ?? (target2 = getter());
1187
+ return Reflect.deleteProperty(target2, prop);
1188
1188
  },
1189
1189
  ownKeys(_) {
1190
- target ?? (target = getter());
1191
- return Reflect.ownKeys(target);
1190
+ target2 ?? (target2 = getter());
1191
+ return Reflect.ownKeys(target2);
1192
1192
  },
1193
1193
  getOwnPropertyDescriptor(_, prop) {
1194
- target ?? (target = getter());
1195
- return Reflect.getOwnPropertyDescriptor(target, prop);
1194
+ target2 ?? (target2 = getter());
1195
+ return Reflect.getOwnPropertyDescriptor(target2, prop);
1196
1196
  },
1197
1197
  defineProperty(_, prop, descriptor) {
1198
- target ?? (target = getter());
1199
- return Reflect.defineProperty(target, prop, descriptor);
1198
+ target2 ?? (target2 = getter());
1199
+ return Reflect.defineProperty(target2, prop, descriptor);
1200
1200
  }
1201
1201
  });
1202
1202
  }
@@ -11648,15 +11648,15 @@
11648
11648
 
11649
11649
  // ../../node_modules/zod/v4/core/to-json-schema.js
11650
11650
  function initializeContext(params) {
11651
- let target = params?.target ?? "draft-2020-12";
11652
- if (target === "draft-4")
11653
- target = "draft-04";
11654
- if (target === "draft-7")
11655
- target = "draft-07";
11651
+ let target2 = params?.target ?? "draft-2020-12";
11652
+ if (target2 === "draft-4")
11653
+ target2 = "draft-04";
11654
+ if (target2 === "draft-7")
11655
+ target2 = "draft-07";
11656
11656
  return {
11657
11657
  processors: params.processors ?? {},
11658
11658
  metadataRegistry: params?.metadata ?? globalRegistry,
11659
- target,
11659
+ target: target2,
11660
11660
  unrepresentable: params?.unrepresentable ?? "throw",
11661
11661
  override: params?.override ?? (() => {
11662
11662
  }),
@@ -11998,8 +11998,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
11998
11998
  return finalize(ctx, schema);
11999
11999
  };
12000
12000
  var createStandardJSONSchemaMethod = (schema, io, processors = {}) => (params) => {
12001
- const { libraryOptions, target } = params ?? {};
12002
- const ctx = initializeContext({ ...libraryOptions ?? {}, target, io, processors });
12001
+ const { libraryOptions, target: target2 } = params ?? {};
12002
+ const ctx = initializeContext({ ...libraryOptions ?? {}, target: target2, io, processors });
12003
12003
  process(schema, ctx);
12004
12004
  extractDefs(ctx, schema);
12005
12005
  return finalize(ctx, schema);
@@ -13058,8 +13058,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
13058
13058
  catch(params) {
13059
13059
  return _catch2(this, params);
13060
13060
  },
13061
- pipe(target) {
13062
- return pipe(this, target);
13061
+ pipe(target2) {
13062
+ return pipe(this, target2);
13063
13063
  },
13064
13064
  readonly() {
13065
13065
  return readonly(this);
@@ -15319,15 +15319,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15319
15319
  threads: external_exports.array(threadOwnershipSchema).min(1).max(THREAD_OWNERSHIP_LIST_MAX_LENGTH)
15320
15320
  }).strict().superRefine(({ threads }, context2) => {
15321
15321
  const seen = /* @__PURE__ */ new Set();
15322
- for (const [index, thread] of threads.entries()) {
15323
- if (seen.has(thread.threadId)) {
15322
+ for (const [index, thread2] of threads.entries()) {
15323
+ if (seen.has(thread2.threadId)) {
15324
15324
  context2.addIssue({
15325
15325
  code: "custom",
15326
15326
  message: "Thread ownership-list results must be unique",
15327
15327
  path: ["threads", index, "threadId"]
15328
15328
  });
15329
15329
  }
15330
- seen.add(thread.threadId);
15330
+ seen.add(thread2.threadId);
15331
15331
  }
15332
15332
  });
15333
15333
  var threadSteeringInspectParamsSchema = external_exports.object({
@@ -16787,6 +16787,44 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16787
16787
  }).strict();
16788
16788
  var remoteSshSetupResultSchema = external_exports.object({ state: external_exports.enum(["installed", "not-installed"]) }).strict();
16789
16789
 
16790
+ // ../shared-contracts/dist/remote-sessions.js
16791
+ var REMOTE_CONTROLLER_REQUEST_MAX_BYTES = 16 * 1024;
16792
+ var identity = external_exports.string().min(1).max(1024);
16793
+ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
16794
+ var thread = { ...target, threadId: identity };
16795
+ var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
16796
+ external_exports.strictObject({ kind: external_exports.literal("hosts") }),
16797
+ external_exports.strictObject({
16798
+ kind: external_exports.literal("list"),
16799
+ ...target,
16800
+ cursor: external_exports.string().nullable(),
16801
+ archived: external_exports.boolean()
16802
+ }),
16803
+ external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
16804
+ external_exports.strictObject({
16805
+ kind: external_exports.literal("prompt"),
16806
+ ...thread,
16807
+ epoch: identity,
16808
+ text: external_exports.string().min(1).max(8e3),
16809
+ requestId: identity.optional()
16810
+ }),
16811
+ external_exports.strictObject({ kind: external_exports.literal("interrupt"), ...thread, epoch: identity, turnId: identity }),
16812
+ external_exports.strictObject({
16813
+ kind: external_exports.literal("rename"),
16814
+ ...thread,
16815
+ epoch: identity,
16816
+ name: external_exports.string().min(1).max(512)
16817
+ }),
16818
+ external_exports.strictObject({ kind: external_exports.literal("archive"), ...thread, epoch: identity, archived: external_exports.boolean() }),
16819
+ external_exports.strictObject({
16820
+ kind: external_exports.literal("respond"),
16821
+ ...thread,
16822
+ epoch: identity,
16823
+ requestId: external_exports.union([identity, external_exports.number().int()]),
16824
+ result: external_exports.record(external_exports.string(), external_exports.unknown())
16825
+ })
16826
+ ]);
16827
+
16790
16828
  // ../shared-contracts/dist/remote-connections.js
16791
16829
  var hostId = external_exports.string().min(1).max(1024);
16792
16830
  var codexSshConnectionSchema = external_exports.object({
@@ -16807,7 +16845,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16807
16845
  identity: external_exports.string().max(4096).nullable()
16808
16846
  });
16809
16847
  var remoteConnectionsRequestSchema = external_exports.discriminatedUnion("action", [
16848
+ external_exports.strictObject({ action: external_exports.literal("session"), operation: remoteSessionOperationSchema }),
16810
16849
  external_exports.strictObject({ action: external_exports.literal("list") }),
16850
+ external_exports.strictObject({ action: external_exports.literal("catalog") }),
16811
16851
  external_exports.strictObject({
16812
16852
  action: external_exports.literal("read-thread"),
16813
16853
  hostId: hostId.refine((id) => id !== "local"),
@@ -17383,6 +17423,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
17383
17423
  }
17384
17424
  return {
17385
17425
  list,
17426
+ async catalog() {
17427
+ const result = await request("refresh-remote-connections", {});
17428
+ if (!record4(result) || !Array.isArray(result.remoteConnections))
17429
+ throw new Error("Native remote catalog unavailable");
17430
+ return result.remoteConnections.flatMap(
17431
+ (item) => record4(item) && typeof item.hostId === "string" && /^remote-(?:ssh(?:-|:)|control:)/u.test(item.hostId) && typeof item.displayName === "string" ? [
17432
+ {
17433
+ hostId: item.hostId,
17434
+ displayName: item.displayName,
17435
+ autoConnect: item.autoConnect === true
17436
+ }
17437
+ ] : []
17438
+ );
17439
+ },
17386
17440
  save: (draft, previous, signal) => mutate(previous, draft, signal),
17387
17441
  remove: (previous, signal) => mutate(previous, null, signal),
17388
17442
  async connect(hostId2, enabled, signal) {
@@ -18023,9 +18077,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18023
18077
  const MAX_VISITED_FIBERS = 2e5;
18024
18078
  const fiber = (value2) => typeof value2 === "object" && value2 !== null ? value2 : null;
18025
18079
  const exhausted = () => {
18026
- const target = globalThis;
18027
- if (typeof target.dispatchEvent === "function" && typeof CustomEvent === "function")
18028
- target.dispatchEvent(new CustomEvent("codexhost:react-fiber-walk-limit", {
18080
+ const target2 = globalThis;
18081
+ if (typeof target2.dispatchEvent === "function" && typeof CustomEvent === "function")
18082
+ target2.dispatchEvent(new CustomEvent("codexhost:react-fiber-walk-limit", {
18029
18083
  detail: { limit: MAX_VISITED_FIBERS }
18030
18084
  }));
18031
18085
  return [];
@@ -18161,12 +18215,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18161
18215
  const modes = /* @__PURE__ */ new Set();
18162
18216
  const creationModes = /* @__PURE__ */ new Set();
18163
18217
  for (const row of rows) {
18164
- if (row.length !== 24 || row[7] !== null || row[10] !== true || !updates.has(row[13]))
18218
+ const offset = row.length === 25 ? 1 : 0;
18219
+ if (row.length !== 24 && row.length !== 25 || row[7 + offset] !== null || row[10 + offset] !== true || !updates.has(row[13 + offset]))
18165
18220
  continue;
18166
- const context2 = row[12];
18167
- const result = row[23];
18168
- if (context2 && context2 === row[21] && typeof context2.usesAccountPreferences === "boolean" && result?.usesAccountPreferences === context2.usesAccountPreferences && typeof row[14] === "function" && row[14] === row[20] && result.setModelAndReasoningEffort === row[14]) {
18169
- update ??= row[13];
18221
+ const context2 = row[12 + offset];
18222
+ const result = row[23 + offset];
18223
+ if (context2 && context2 === row[21 + offset] && typeof context2.usesAccountPreferences === "boolean" && result?.usesAccountPreferences === context2.usesAccountPreferences && typeof row[14 + offset] === "function" && row[14 + offset] === row[20 + offset] && result.setModelAndReasoningEffort === row[14 + offset]) {
18224
+ update ??= row[13 + offset];
18170
18225
  modes.add(context2.usesAccountPreferences);
18171
18226
  const settings = result.modelSettings;
18172
18227
  const group = groups.get(row);
@@ -18544,10 +18599,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18544
18599
  assertCurrent();
18545
18600
  if (!record6(result) || result.status !== "created" || !createdId || !record6(result.firstTurn) || result.firstTurn.status !== "not-requested")
18546
18601
  throw new Error("Chat creation was not confirmed. Check the chat list before creating another task.");
18547
- const { thread, empty } = await readEmpty(createdId);
18602
+ const { thread: thread2, empty } = await readEmpty(createdId);
18548
18603
  const inspection = threadInspectionSchema.parse(await request("codexhost/thread/inspect", { threadId: createdId }));
18549
18604
  assertCurrent();
18550
- if (!empty || thread.cwd !== input.workspace.cwd || inspection.owner !== "external" || inspection.transportModelId !== input.model)
18605
+ if (!empty || thread2.cwd !== input.workspace.cwd || inspection.owner !== "external" || inspection.transportModelId !== input.model)
18551
18606
  throw new Error("The created chat's workspace, Model or empty state could not be confirmed");
18552
18607
  return {
18553
18608
  threadId: createdId,
@@ -18732,11 +18787,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18732
18787
  async function handleRemoteConnectionsRequest(control, input) {
18733
18788
  const request = remoteConnectionsRequestSchema.parse(input);
18734
18789
  switch (request.action) {
18790
+ case "session":
18791
+ throw new Error("Remote sessions require the Desktop Controller route");
18735
18792
  case "read-thread":
18736
18793
  if (!control.readThread) throw new Error("Remote Thread reading is unavailable");
18737
18794
  return control.readThread(request.hostId, request.input);
18738
18795
  case "list":
18739
18796
  return control.ssh.list();
18797
+ case "catalog":
18798
+ return control.ssh.catalog?.() ?? control.ssh.list();
18740
18799
  case "save":
18741
18800
  await control.ssh.save(request.draft, request.previous);
18742
18801
  return null;
@@ -18929,6 +18988,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18929
18988
  return fallback;
18930
18989
  }
18931
18990
 
18991
+ // ../../node_modules/lucide/dist/esm/icons/smartphone.mjs
18992
+ var Smartphone = [
18993
+ ["rect", { width: "14", height: "20", x: "5", y: "2", rx: "2", ry: "2" }],
18994
+ ["path", { d: "M12 18h.01" }]
18995
+ ];
18996
+
18932
18997
  // ../../node_modules/lucide/dist/esm/icons/boxes.mjs
18933
18998
  var Boxes = [
18934
18999
  [
@@ -19271,6 +19336,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19271
19336
  "model-pool",
19272
19337
  "routes",
19273
19338
  "gateway",
19339
+ "mobile",
19274
19340
  "updates",
19275
19341
  "schedules",
19276
19342
  "about",
@@ -19323,6 +19389,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19323
19389
  "model-pool": Boxes,
19324
19390
  routes: Route,
19325
19391
  gateway: Network,
19392
+ mobile: Smartphone,
19326
19393
  updates: CircleArrowUp,
19327
19394
  schedules: CalendarClock,
19328
19395
  about: Info,
@@ -20010,20 +20077,20 @@ ${error51.stderrTail}`] : []
20010
20077
  row.dataset.connectionSelected = String(selected);
20011
20078
  row.tabIndex = selected ? 0 : -1;
20012
20079
  row.setAttribute("role", "row");
20013
- const identity2 = document2.createElement("div");
20014
- identity2.className = "settings-connection-row__identity";
20015
- identity2.setAttribute("role", "cell");
20080
+ const identity3 = document2.createElement("div");
20081
+ identity3.className = "settings-connection-row__identity";
20082
+ identity3.setAttribute("role", "cell");
20016
20083
  if (group) {
20017
20084
  const handle = document2.createElement("span");
20018
20085
  handle.className = "settings-connection-row__handle";
20019
20086
  handle.setAttribute("aria-hidden", "true");
20020
20087
  handle.title = group.dragHandleTitle;
20021
20088
  handle.append(createRendererSettingsIcon("grip-vertical", 15));
20022
- identity2.append(handle);
20089
+ identity3.append(handle);
20023
20090
  }
20024
20091
  const label = document2.createElement("strong");
20025
20092
  label.textContent = item.name;
20026
- identity2.append(createConnectionIdentityIcon(document2, item, 19), label);
20093
+ identity3.append(createConnectionIdentityIcon(document2, item, 19), label);
20027
20094
  const status = document2.createElement("span");
20028
20095
  status.className = "settings-connection-row__status";
20029
20096
  status.dataset.connectionTone = connectionStatusTone(item.availability, item.error !== null);
@@ -20101,8 +20168,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20101
20168
  action.append(toggle);
20102
20169
  }
20103
20170
  row.addEventListener("click", (event) => {
20104
- const target = event.target;
20105
- if (target?.closest?.("a")) return;
20171
+ const target2 = event.target;
20172
+ if (target2?.closest?.("a")) return;
20106
20173
  select();
20107
20174
  });
20108
20175
  row.addEventListener("keydown", (event) => {
@@ -20120,17 +20187,17 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20120
20187
  row.addEventListener("drop", group.onDrop);
20121
20188
  row.addEventListener("dragend", group.onDragEnd);
20122
20189
  }
20123
- row.append(identity2, status, action);
20190
+ row.append(identity3, status, action);
20124
20191
  return row;
20125
20192
  }
20126
20193
  function createInspectorHeader(document2, item, messages) {
20127
20194
  const header = document2.createElement("header");
20128
20195
  header.className = "settings-connection-inspector__header";
20129
- const identity2 = document2.createElement("div");
20130
- identity2.className = "settings-connection-inspector__identity";
20196
+ const identity3 = document2.createElement("div");
20197
+ identity3.className = "settings-connection-inspector__identity";
20131
20198
  const title = document2.createElement("strong");
20132
20199
  title.textContent = item.name;
20133
- identity2.append(createConnectionIdentityIcon(document2, item, 20), title);
20200
+ identity3.append(createConnectionIdentityIcon(document2, item, 20), title);
20134
20201
  const websiteUrl = item.agentSnapshot?.plugin?.links?.website ?? item.agentSnapshot?.plugin?.links?.documentation;
20135
20202
  if (websiteUrl) {
20136
20203
  const website = document2.createElement("a");
@@ -20142,13 +20209,13 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
20142
20209
  website.setAttribute("aria-label", `${messages.connectionOfficialWebsite}: ${item.name}`);
20143
20210
  website.append(createRendererSettingsIcon("external-link", 13));
20144
20211
  website.addEventListener("click", (event) => event.stopPropagation());
20145
- identity2.append(website);
20212
+ identity3.append(website);
20146
20213
  }
20147
20214
  const status = document2.createElement("span");
20148
20215
  status.className = "settings-connection-row__status";
20149
20216
  status.dataset.connectionTone = connectionStatusTone(item.availability, item.error !== null);
20150
20217
  status.textContent = item.error?.code === "authenticationRequired" ? messages.connectionLoginRequired : item.error?.code === "configurationRequired" ? messages.connectionConfigurationRequired : item.agentSnapshot && item.availability === "ready" && !item.error ? messages.connectionStatusConnected : connectionStatusLabel(item.availability, messages, item.error !== null);
20151
- header.append(identity2, status);
20218
+ header.append(identity3, status);
20152
20219
  return header;
20153
20220
  }
20154
20221
  function renderConnectionInspector(document2, inspector, item, hostId2, messages, diagnostics, existingLaunchControls, refresh) {
@@ -21151,7 +21218,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
21151
21218
  aboutConsoleFailed: "The console could not be opened",
21152
21219
  pageLabels: Object.freeze({
21153
21220
  connections: "Connections",
21154
- "remote-connections": "Remote connections",
21221
+ "mobile-web": "Phone & browser",
21222
+ "remote-connections": "Other computers (SSH)",
21155
21223
  appearance: "General",
21156
21224
  accounts: "Accounts",
21157
21225
  "session-import": "Session Import",
@@ -21432,7 +21500,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
21432
21500
  aboutConsoleFailed: "\u63A7\u5236\u53F0\u6253\u5F00\u5931\u8D25",
21433
21501
  pageLabels: Object.freeze({
21434
21502
  connections: "\u8FDE\u63A5",
21435
- "remote-connections": "\u8FDC\u7A0B\u8FDE\u63A5",
21503
+ "mobile-web": "\u624B\u673A\u4E0E\u6D4F\u89C8\u5668",
21504
+ "remote-connections": "\u5176\u4ED6\u7535\u8111\uFF08SSH\uFF09",
21436
21505
  appearance: "\u901A\u7528",
21437
21506
  accounts: "\u8D26\u53F7",
21438
21507
  "session-import": "\u4F1A\u8BDD\u5BFC\u5165",
@@ -21629,8 +21698,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
21629
21698
  ...menu.querySelectorAll('[role="menuitemradio"], [role="menuitem"]')
21630
21699
  ].filter((button2) => !button2.disabled && !button2.closest("[hidden]"));
21631
21700
  const selected = available.find((button2) => button2.getAttribute("aria-checked") === "true");
21632
- const target = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
21633
- target?.focus();
21701
+ const target2 = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
21702
+ target2?.focus();
21634
21703
  };
21635
21704
  const open = (focus = "selected") => {
21636
21705
  if (trigger.disabled || popoverOpen(menu)) return;
@@ -21910,8 +21979,8 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
21910
21979
  }
21911
21980
  if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) return;
21912
21981
  event.preventDefault();
21913
- const target = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
21914
- target?.focus();
21982
+ const target2 = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
21983
+ target2?.focus();
21915
21984
  };
21916
21985
  const onToggle = () => {
21917
21986
  trigger.setAttribute("aria-expanded", String(popoverOpen(menu)));
@@ -23613,16 +23682,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
23613
23682
  trigger.setAttribute("data-state", openState || popoverOpen2(menu) ? "open" : "closed");
23614
23683
  };
23615
23684
  const onRootClick = (event) => {
23616
- const target = event.target instanceof Element ? event.target.closest("button") : null;
23617
- if (target?.dataset.openModelMenu) {
23685
+ const target2 = event.target instanceof Element ? event.target.closest("button") : null;
23686
+ if (target2?.dataset.openModelMenu) {
23618
23687
  openModelMenu();
23619
23688
  control.searchInput.focus();
23620
23689
  return;
23621
23690
  }
23622
- if (target?.dataset.thinkingOptionId) {
23691
+ if (target2?.dataset.thinkingOptionId) {
23623
23692
  close();
23624
23693
  trigger.focus();
23625
- onSelectThinking(target.dataset.thinkingOptionId);
23694
+ onSelectThinking(target2.dataset.thinkingOptionId);
23626
23695
  }
23627
23696
  };
23628
23697
  const onModelMenuClick = (event) => {
@@ -23652,17 +23721,17 @@ Codex Fast mode prioritizes requests and may increase usage.`
23652
23721
  modelMenu.scrollTop = 0;
23653
23722
  return;
23654
23723
  }
23655
- const target = event.target instanceof Element ? event.target.closest("button[data-model-id]") : null;
23656
- if (!target?.dataset.modelId) return;
23724
+ const target2 = event.target instanceof Element ? event.target.closest("button[data-model-id]") : null;
23725
+ if (!target2?.dataset.modelId) return;
23657
23726
  close();
23658
23727
  trigger.focus();
23659
- onSelectModel(target.dataset.modelId);
23728
+ onSelectModel(target2.dataset.modelId);
23660
23729
  };
23661
23730
  const onModelHover = () => openModelMenu();
23662
23731
  const onDocumentPointerDown = (event) => {
23663
23732
  if (!popoverOpen2(menu) && !popoverOpen2(modelMenu)) return;
23664
- const target = event.target instanceof Node ? event.target : null;
23665
- if (target && (root.contains(target) || menu.contains(target) || modelMenu.contains(target))) {
23733
+ const target2 = event.target instanceof Node ? event.target : null;
23734
+ if (target2 && (root.contains(target2) || menu.contains(target2) || modelMenu.contains(target2))) {
23666
23735
  return;
23667
23736
  }
23668
23737
  close();
@@ -24084,8 +24153,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
24084
24153
  const focusOption = (position) => {
24085
24154
  const available = [...options.values()].map(({ button: button2 }) => button2).filter((button2) => !button2.disabled);
24086
24155
  const selected = available.find((button2) => button2.getAttribute("aria-checked") === "true");
24087
- const target = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
24088
- target?.focus();
24156
+ const target2 = position === "last" ? available.at(-1) : position === "selected" ? selected : available[0];
24157
+ target2?.focus();
24089
24158
  };
24090
24159
  const open = (focus = "selected") => {
24091
24160
  if (trigger.disabled || popoverOpen3(menu)) return;
@@ -24128,8 +24197,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
24128
24197
  }
24129
24198
  if (!["ArrowDown", "ArrowUp", "Home", "End"].includes(event.key)) return;
24130
24199
  event.preventDefault();
24131
- const target = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
24132
- target?.focus();
24200
+ const target2 = event.key === "Home" ? buttons[0] : event.key === "End" ? buttons.at(-1) : event.key === "ArrowDown" ? buttons[(index + 1 + buttons.length) % buttons.length] : buttons[(index - 1 + buttons.length) % buttons.length];
24201
+ target2?.focus();
24133
24202
  };
24134
24203
  const onToggle = () => {
24135
24204
  const openState = popoverOpen3(menu);
@@ -24894,9 +24963,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
24894
24963
  // src/renderer-composer-dom.ts
24895
24964
  var CODEX_COMPOSER_SELECTOR = "[data-codex-composer-root]";
24896
24965
  var EDITOR_SELECTOR = 'textarea, [contenteditable="true"], [role="textbox"]';
24897
- function eventElement(target) {
24898
- if (target instanceof Element) return target;
24899
- return target instanceof Node ? target.parentElement : null;
24966
+ function eventElement(target2) {
24967
+ if (target2 instanceof Element) return target2;
24968
+ return target2 instanceof Node ? target2.parentElement : null;
24900
24969
  }
24901
24970
  function controlDescription(element) {
24902
24971
  const typed = element;
@@ -25646,9 +25715,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
25646
25715
  const trace = (value, prefix) => new Proxy(
25647
25716
  { ...value },
25648
25717
  {
25649
- get(target, property, receiver) {
25718
+ get(target2, property, receiver) {
25650
25719
  if (typeof property === "string") read.add(`${prefix}.${property}`);
25651
- return Reflect.get(target, property, receiver);
25720
+ return Reflect.get(target2, property, receiver);
25652
25721
  }
25653
25722
  }
25654
25723
  );
@@ -25743,12 +25812,12 @@ Codex Fast mode prioritizes requests and may increase usage.`
25743
25812
  return found;
25744
25813
  }
25745
25814
  function project2(kind, { fiber, subscriber, store, atom, instance, subscribeEffect }) {
25746
- for (const [target, key] of [
25815
+ for (const [target2, key] of [
25747
25816
  [store, "sub"],
25748
25817
  [subscriber, "getSnapshot"],
25749
25818
  [instance, "getSnapshot"]
25750
25819
  ]) {
25751
- if (Object.getOwnPropertyDescriptor(target, key)?.writable !== true) {
25820
+ if (Object.getOwnPropertyDescriptor(target2, key)?.writable !== true) {
25752
25821
  throw new Error("Codex usage gate is not writable");
25753
25822
  }
25754
25823
  }
@@ -26022,8 +26091,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
26022
26091
  }
26023
26092
  async function verifyNativeCodexThread(sendRequest, threadId) {
26024
26093
  const native = await sendRequest("thread/read", { threadId, includeTurns: false });
26025
- const thread = isRecord4(native) ? native.thread : null;
26026
- if (!isRecord4(thread) || thread.id !== threadId || typeof thread.modelProvider !== "string" || !thread.modelProvider || thread.modelProvider === "codexhost" || typeof thread.cliVersion !== "string" || !thread.cliVersion || thread.cliVersion === "codexhost") {
26094
+ const thread2 = isRecord4(native) ? native.thread : null;
26095
+ if (!isRecord4(thread2) || thread2.id !== threadId || typeof thread2.modelProvider !== "string" || !thread2.modelProvider || thread2.modelProvider === "codexhost" || typeof thread2.cliVersion !== "string" || !thread2.cliVersion || thread2.cliVersion === "codexhost") {
26027
26096
  throw new Error("Native Thread response cannot establish Codex ownership");
26028
26097
  }
26029
26098
  }
@@ -26332,7 +26401,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
26332
26401
  const params = threadOwnershipListParamsSchema.parse(input);
26333
26402
  const value = await manager.sendRequest(THREAD_OWNERSHIP_LIST_METHOD, params);
26334
26403
  const result = threadOwnershipListResultSchema.parse(value);
26335
- if (result.threads.length !== params.threadIds.length || result.threads.some((thread, index) => thread.threadId !== params.threadIds[index])) {
26404
+ if (result.threads.length !== params.threadIds.length || result.threads.some((thread2, index) => thread2.threadId !== params.threadIds[index])) {
26336
26405
  throw new Error("Thread ownership-list result does not match the requested IDs");
26337
26406
  }
26338
26407
  return result;
@@ -26485,9 +26554,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
26485
26554
  function isRecord6(value) {
26486
26555
  return value !== null && typeof value === "object" && !Array.isArray(value);
26487
26556
  }
26488
- function installRendererExternalQueue(target) {
26489
- if (!isRecord6(target) || typeof target.getTurnCoordinator !== "function") return null;
26490
- const coordinator = target.getTurnCoordinator();
26557
+ function installRendererExternalQueue(target2) {
26558
+ if (!isRecord6(target2) || typeof target2.getTurnCoordinator !== "function") return null;
26559
+ const coordinator = target2.getTurnCoordinator();
26491
26560
  const queue = isRecord6(coordinator) ? coordinator.serverQueue : null;
26492
26561
  if (!isRecord6(queue) || typeof queue.isEnabled !== "function") return null;
26493
26562
  return () => void 0;
@@ -26512,7 +26581,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
26512
26581
  return "official";
26513
26582
  }
26514
26583
  const result = threadOwnershipListResultSchema.parse(response);
26515
- const owner = result.threads.find((thread) => thread.threadId === threadId)?.owner;
26584
+ const owner = result.threads.find((thread2) => thread2.threadId === threadId)?.owner;
26516
26585
  if (!owner) throw new Error("Thread ownership could not be resolved for steering");
26517
26586
  return owner === "codex" ? "official" : "newTurn";
26518
26587
  }
@@ -26594,9 +26663,9 @@ Codex Fast mode prioritizes requests and may increase usage.`
26594
26663
  });
26595
26664
  };
26596
26665
  }
26597
- function installRendererExternalSteering(target, sendTurnStart, prepareTurnInput) {
26598
- if (!isManager(target)) return null;
26599
- const manager = target;
26666
+ function installRendererExternalSteering(target2, sendTurnStart, prepareTurnInput) {
26667
+ if (!isManager(target2)) return null;
26668
+ const manager = target2;
26600
26669
  const originalSteer = manager.steerTurn;
26601
26670
  const originalSend = manager.sendRequest;
26602
26671
  const routes = /* @__PURE__ */ new Map();
@@ -26835,16 +26904,16 @@ Codex Fast mode prioritizes requests and may increase usage.`
26835
26904
  for (let index = 0; index < decoded.length; index += 1) bytes[index] = decoded.charCodeAt(index);
26836
26905
  return { contents: new Blob([bytes], { type: mimeType }), extension };
26837
26906
  }
26838
- function createRemoteAttachmentSender(target, hostId2, isCurrent) {
26907
+ function createRemoteAttachmentSender(target2, hostId2, isCurrent) {
26839
26908
  const prepared = /* @__PURE__ */ new WeakMap();
26840
26909
  return (params, send) => {
26841
- if (hostId2 === "local" || !isRecord8(target) || !isRecord8(params) || typeof params.threadId !== "string" || !Array.isArray(params.input) || typeof target.getConversation !== "function")
26910
+ if (hostId2 === "local" || !isRecord8(target2) || !isRecord8(params) || typeof params.threadId !== "string" || !Array.isArray(params.input) || typeof target2.getConversation !== "function")
26842
26911
  return send(params);
26843
26912
  const images = params.input.filter(
26844
26913
  (item) => isRecord8(item) && (item.type === "image" || item.type === "localImage")
26845
26914
  );
26846
26915
  if (images.length === 0) return send(params);
26847
- const conversation = target.getConversation.call(target, params.threadId);
26916
+ const conversation = target2.getConversation.call(target2, params.threadId);
26848
26917
  if (!isRecord8(conversation) || conversation.id !== params.threadId || conversation.modelProvider !== "codexhost")
26849
26918
  return send(params);
26850
26919
  const assertCurrent = () => {
@@ -26874,7 +26943,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
26874
26943
  if (totalBytes > MAX_TOTAL_BYTES) throw new Error("Remote image attachments exceed 32 MiB");
26875
26944
  return file2;
26876
26945
  });
26877
- if (files.some((file2) => "contents" in file2) && typeof target.createFileAttachment !== "function") {
26946
+ if (files.some((file2) => "contents" in file2) && typeof target2.createFileAttachment !== "function") {
26878
26947
  throw new Error("Desktop remote attachment storage is unavailable");
26879
26948
  }
26880
26949
  const created = [];
@@ -26886,7 +26955,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
26886
26955
  paths.push(file2.path);
26887
26956
  continue;
26888
26957
  }
26889
- const saved = await target.createFileAttachment.call(target, {
26958
+ const saved = await target2.createFileAttachment.call(target2, {
26890
26959
  contents: file2.contents,
26891
26960
  label: `image-${index + 1}.${file2.extension}`
26892
26961
  });
@@ -26919,11 +26988,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
26919
26988
  ]
26920
26989
  };
26921
26990
  } catch (error51) {
26922
- if (isCurrent() && typeof target.removePastedTextAttachment === "function") {
26991
+ if (isCurrent() && typeof target2.removePastedTextAttachment === "function") {
26923
26992
  await Promise.allSettled(
26924
26993
  created.map(
26925
26994
  (path) => Promise.resolve().then(
26926
- () => target.removePastedTextAttachment.call(target, path)
26995
+ () => target2.removePastedTextAttachment.call(target2, path)
26927
26996
  )
26928
26997
  )
26929
26998
  );
@@ -27062,13 +27131,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27062
27131
  function isRecord9(value) {
27063
27132
  return value !== null && typeof value === "object" && !Array.isArray(value);
27064
27133
  }
27065
- function installRendererManualCompaction(target, hostId2, messages) {
27066
- if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !isRecord9(target) || typeof target.registerPendingManualContextCompaction !== "function" || typeof target.getConversation !== "function") {
27134
+ function installRendererManualCompaction(target2, hostId2, messages) {
27135
+ if (!messages || typeof messages.addEventListener !== "function" || typeof messages.removeEventListener !== "function" || !isRecord9(target2) || typeof target2.registerPendingManualContextCompaction !== "function" || typeof target2.getConversation !== "function") {
27067
27136
  return null;
27068
27137
  }
27069
- const register = target.registerPendingManualContextCompaction;
27070
- const getConversation = target.getConversation;
27071
- const getStreamRole = typeof target.getStreamRole === "function" ? target.getStreamRole : null;
27138
+ const register = target2.registerPendingManualContextCompaction;
27139
+ const getConversation = target2.getConversation;
27140
+ const getStreamRole = typeof target2.getStreamRole === "function" ? target2.getStreamRole : null;
27072
27141
  const listener = (event) => {
27073
27142
  if (event.source != null && event.source !== messages) return;
27074
27143
  const message2 = event.data;
@@ -27078,13 +27147,13 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27078
27147
  const params = threadManualCompactionStartedSchema.safeParse(message2.params);
27079
27148
  if (!params.success) return;
27080
27149
  const { threadId } = params.data;
27081
- const conversation = getConversation.call(target, threadId);
27150
+ const conversation = getConversation.call(target2, threadId);
27082
27151
  if (!isRecord9(conversation) || conversation.id !== threadId || conversation.modelProvider !== "codexhost") {
27083
27152
  return;
27084
27153
  }
27085
- const role = getStreamRole?.call(target, threadId);
27154
+ const role = getStreamRole?.call(target2, threadId);
27086
27155
  if (isRecord9(role) && role.role === "follower") return;
27087
- register.call(target, threadId);
27156
+ register.call(target2, threadId);
27088
27157
  };
27089
27158
  messages.addEventListener("message", listener);
27090
27159
  return () => {
@@ -27111,7 +27180,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27111
27180
  const cached2 = entries.get(route.hostId);
27112
27181
  if (cached2?.route === route) return cached2.client;
27113
27182
  retire(route.hostId);
27114
- const target = route.manager;
27183
+ const target2 = route.manager;
27115
27184
  const cleanups = /* @__PURE__ */ new Set();
27116
27185
  const nativeClient = createRendererModelClient([
27117
27186
  {
@@ -27119,11 +27188,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27119
27188
  if (disposed || readRouting()?.forHost(route.hostId) !== route) {
27120
27189
  throw new Error(`Renderer request manager is unavailable for Host ${route.hostId}`);
27121
27190
  }
27122
- return options === void 0 ? target.sendRequest(method, params) : target.sendRequest(method, params, options);
27191
+ return options === void 0 ? target2.sendRequest(method, params) : target2.sendRequest(method, params, options);
27123
27192
  },
27124
- ...target.addNotificationCallback ? {
27193
+ ...target2.addNotificationCallback ? {
27125
27194
  addNotificationCallback(methods, listener) {
27126
- const unsubscribe = target.addNotificationCallback?.(methods, listener);
27195
+ const unsubscribe = target2.addNotificationCallback?.(methods, listener);
27127
27196
  if (!messages || !(typeof methods === "string" ? [methods] : methods).some(
27128
27197
  (method) => [
27129
27198
  THREAD_USAGE_UPDATED_METHOD,
@@ -27162,28 +27231,28 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27162
27231
  if (!nativeClient) return null;
27163
27232
  const client = restoreThreadReferenceCapability(
27164
27233
  nativeClient,
27165
- target,
27234
+ target2,
27166
27235
  () => !disposed && readRouting()?.forHost(route.hostId) === route,
27167
27236
  messages
27168
27237
  );
27169
27238
  entries.set(route.hostId, { route, client, cleanups });
27170
27239
  try {
27171
27240
  for (const install2 of [
27172
- () => installRendererExternalQueue(target),
27241
+ () => installRendererExternalQueue(target2),
27173
27242
  () => installRendererExternalSteering(
27174
- target,
27243
+ target2,
27175
27244
  createRemoteAttachmentSender(
27176
- target,
27245
+ target2,
27177
27246
  route.hostId,
27178
27247
  () => !disposed && readRouting()?.forHost(route.hostId) === route
27179
27248
  ),
27180
27249
  createThreadReferenceContext(
27181
- target,
27250
+ target2,
27182
27251
  route.hostId,
27183
27252
  () => !disposed && readRouting()?.forHost(route.hostId) === route
27184
27253
  )
27185
27254
  ),
27186
- () => installRendererManualCompaction(target, route.hostId, messages)
27255
+ () => installRendererManualCompaction(target2, route.hostId, messages)
27187
27256
  ]) {
27188
27257
  const cleanup = install2();
27189
27258
  if (cleanup) cleanups.add(cleanup);
@@ -27416,11 +27485,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27416
27485
  changed.add(this.#row(element));
27417
27486
  };
27418
27487
  for (const mutation of mutations) {
27419
- const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
27420
- const row = target?.closest(SIDEBAR_AGENT_ICON_ROW_SELECTOR);
27488
+ const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
27489
+ const row = target2?.closest(SIDEBAR_AGENT_ICON_ROW_SELECTOR);
27421
27490
  if (row) changed.add(this.#row(row));
27422
- else if (target && this.#rowsByElement.has(target))
27423
- changed.add(this.#row(target));
27491
+ else if (target2 && this.#rowsByElement.has(target2))
27492
+ changed.add(this.#row(target2));
27424
27493
  for (const node of mutation.addedNodes) collect(node);
27425
27494
  for (const node of mutation.removedNodes) collect(node);
27426
27495
  }
@@ -27805,18 +27874,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27805
27874
  const button2 = origin?.closest("button");
27806
27875
  if (!button2) return;
27807
27876
  if (this.#replayed.delete(button2)) return;
27808
- const target = rendererForkTargetFromButton(button2);
27809
- if (!target || !onFork(target)) return;
27877
+ const target2 = rendererForkTargetFromButton(button2);
27878
+ if (!target2 || !onFork(target2)) return;
27810
27879
  event.preventDefault();
27811
27880
  event.stopImmediatePropagation();
27812
27881
  };
27813
27882
  document.addEventListener("click", listener, true);
27814
27883
  return () => document.removeEventListener("click", listener, true);
27815
27884
  }
27816
- replay(target) {
27817
- if (!(target.control instanceof HTMLButtonElement) || !target.control.isConnected) return;
27818
- this.#replayed.add(target.control);
27819
- target.control.click();
27885
+ replay(target2) {
27886
+ if (!(target2.control instanceof HTMLButtonElement) || !target2.control.isConnected) return;
27887
+ this.#replayed.add(target2.control);
27888
+ target2.control.click();
27820
27889
  }
27821
27890
  openThread(threadId) {
27822
27891
  return openRendererThread(threadId);
@@ -27826,22 +27895,22 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
27826
27895
  const dom = options.dom ?? new BrowserRendererForkDom();
27827
27896
  const pending2 = /* @__PURE__ */ new Set();
27828
27897
  let disposed = false;
27829
- const stop = dom.listen((target) => {
27898
+ const stop = dom.listen((target2) => {
27830
27899
  if (disposed) return false;
27831
27900
  const client = options.getClient();
27832
27901
  if (!client) return false;
27833
- const key = `${target.threadId}\0${target.turnId}`;
27902
+ const key = `${target2.threadId}\0${target2.turnId}`;
27834
27903
  if (pending2.has(key)) return true;
27835
27904
  pending2.add(key);
27836
- void client.inspectThread({ threadId: target.threadId }).then(async (inspection) => {
27905
+ void client.inspectThread({ threadId: target2.threadId }).then(async (inspection) => {
27837
27906
  if (disposed) return;
27838
- if (inspection.owner === "codex" || !inspection.history.fork || !target.isProjectlessConversation) {
27839
- dom.replay(target);
27907
+ if (inspection.owner === "codex" || !inspection.history.fork || !target2.isProjectlessConversation) {
27908
+ dom.replay(target2);
27840
27909
  return;
27841
27910
  }
27842
27911
  const result = await client.forkThread({
27843
- threadId: target.threadId,
27844
- lastTurnId: target.turnId
27912
+ threadId: target2.threadId,
27913
+ lastTurnId: target2.turnId
27845
27914
  });
27846
27915
  if (!disposed) await dom.openThread(result.threadId);
27847
27916
  }).catch((error51) => options.reportError?.(error51)).finally(() => pending2.delete(key));
@@ -28024,11 +28093,11 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28024
28093
  ...thinking?.success ? { thinkingOptionId: thinking.data } : {}
28025
28094
  };
28026
28095
  }
28027
- function threadIdFromComposerModelTarget(target) {
28028
- if (target?.[0] !== "conversation" || typeof target[1] !== "string" || target[1].trim().length === 0) {
28096
+ function threadIdFromComposerModelTarget(target2) {
28097
+ if (target2?.[0] !== "conversation" || typeof target2[1] !== "string" || target2[1].trim().length === 0) {
28029
28098
  return null;
28030
28099
  }
28031
- return hostThreadIdSchema.parse(target[1]);
28100
+ return hostThreadIdSchema.parse(target2[1]);
28032
28101
  }
28033
28102
  function findComposerFiber(composer) {
28034
28103
  const selector = '[data-codex-composer], [contenteditable="true"][role="textbox"]';
@@ -28132,15 +28201,15 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28132
28201
  function isDraftPrewarmPolicyReady(value) {
28133
28202
  return isRecord12(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
28134
28203
  }
28135
- async function waitForRendererDraftPrewarmPolicy(target, composer) {
28204
+ async function waitForRendererDraftPrewarmPolicy(target2, composer) {
28136
28205
  const deadline = Date.now() + DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS;
28137
28206
  while (true) {
28138
- const policy = target.__codexhostHostRoutingV1?.forComposer(composer)?.policy;
28207
+ const policy = target2.__codexhostHostRoutingV1?.forComposer(composer)?.policy;
28139
28208
  if (isDraftPrewarmPolicyReady(policy)) return policy;
28140
28209
  const remaining = deadline - Date.now();
28141
28210
  if (remaining <= 0) throw new Error("Renderer draft prewarm policy is unavailable");
28142
28211
  await new Promise((resolve) => {
28143
- target.setTimeout(resolve, Math.min(DRAFT_PREWARM_POLICY_POLL_INTERVAL_MS, remaining));
28212
+ target2.setTimeout(resolve, Math.min(DRAFT_PREWARM_POLICY_POLL_INTERVAL_MS, remaining));
28144
28213
  });
28145
28214
  }
28146
28215
  }
@@ -28330,12 +28399,12 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28330
28399
  const route = window.__codexhostHostRoutingV1?.forComposer(composer);
28331
28400
  if (!route) return false;
28332
28401
  try {
28333
- const target = composer ? findComposerModelTarget(composer) : null;
28334
- if (target?.[0] === "conversation") return true;
28335
- if (target?.[0] !== "default" || typeof target[1] !== "string" || !composer)
28402
+ const target2 = composer ? findComposerModelTarget(composer) : null;
28403
+ if (target2?.[0] === "conversation") return true;
28404
+ if (target2?.[0] !== "default" || typeof target2[1] !== "string" || !composer)
28336
28405
  return agent === "codex";
28337
- const binding = findScopedDraftModelBinding(composer, target[1]);
28338
- const draftKey = target[1];
28406
+ const binding = findScopedDraftModelBinding(composer, target2[1]);
28407
+ const draftKey = target2[1];
28339
28408
  if (!binding || !route.policy.scopedCreation)
28340
28409
  return agent === "codex" && !draftModels.has(draftKey);
28341
28410
  const previous = draftModels.model(draftKey);
@@ -28820,20 +28889,20 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
28820
28889
  unmeteredRequests: 0
28821
28890
  };
28822
28891
  }
28823
- function addTotals(target, source) {
28824
- target.requests += source.requests;
28825
- target.inputTokens += source.inputTokens;
28826
- target.cachedInputTokens += source.cachedInputTokens;
28827
- target.cacheWriteInputTokens += source.cacheWriteInputTokens;
28828
- target.cacheKnownInputTokens += source.cacheKnownInputTokens;
28829
- target.cacheHitCachedInputTokens += source.cacheHitCachedInputTokens;
28830
- target.cacheHitInputTokens += source.cacheHitInputTokens;
28831
- target.outputTokens += source.outputTokens;
28832
- target.reasoningOutputTokens += source.reasoningOutputTokens;
28833
- target.costUsd += source.costUsd;
28834
- target.unpricedRequests += source.unpricedRequests;
28835
- target.unmeteredRequests += source.unmeteredRequests;
28836
- return target;
28892
+ function addTotals(target2, source) {
28893
+ target2.requests += source.requests;
28894
+ target2.inputTokens += source.inputTokens;
28895
+ target2.cachedInputTokens += source.cachedInputTokens;
28896
+ target2.cacheWriteInputTokens += source.cacheWriteInputTokens;
28897
+ target2.cacheKnownInputTokens += source.cacheKnownInputTokens;
28898
+ target2.cacheHitCachedInputTokens += source.cacheHitCachedInputTokens;
28899
+ target2.cacheHitInputTokens += source.cacheHitInputTokens;
28900
+ target2.outputTokens += source.outputTokens;
28901
+ target2.reasoningOutputTokens += source.reasoningOutputTokens;
28902
+ target2.costUsd += source.costUsd;
28903
+ target2.unpricedRequests += source.unpricedRequests;
28904
+ target2.unmeteredRequests += source.unmeteredRequests;
28905
+ return target2;
28837
28906
  }
28838
28907
  function inputWithoutCache(totals2) {
28839
28908
  return totals2.inputTokens - totals2.cachedInputTokens - totals2.cacheWriteInputTokens;
@@ -31791,7 +31860,7 @@ ${detail}` : ""}`
31791
31860
  card.setAttribute("aria-label", connection.displayName);
31792
31861
  card.setAttribute("aria-busy", String(locked));
31793
31862
  const head = remoteElement(document2, "div", "settings-remote-card__head");
31794
- const identity2 = remoteElement(document2, "div", "settings-remote-card__identity");
31863
+ const identity3 = remoteElement(document2, "div", "settings-remote-card__identity");
31795
31864
  const titleLine = remoteElement(document2, "div", "settings-remote-card__title");
31796
31865
  const [tone, stateLabel] = connectionState(row, t);
31797
31866
  const state = remoteElement(document2, "span", "settings-remote-card__state", stateLabel);
@@ -31804,7 +31873,7 @@ ${detail}` : ""}`
31804
31873
  addressLine.append(
31805
31874
  remoteElement(document2, "span", "settings-status-badge", t("SSH \u914D\u7F6E", "SSH config"))
31806
31875
  );
31807
- identity2.append(titleLine, addressLine);
31876
+ identity3.append(titleLine, addressLine);
31808
31877
  const headActions = remoteElement(document2, "div", "settings-remote-card__actions");
31809
31878
  if (row.installation !== "not-installed" && !row.probing) {
31810
31879
  if (row.state === "error" && connection.autoConnect)
@@ -31827,7 +31896,7 @@ ${detail}` : ""}`
31827
31896
  remove.append(createRendererSettingsIcon("trash", 15));
31828
31897
  remove.addEventListener("click", () => onAction("remove"));
31829
31898
  headActions.append(remove);
31830
- head.append(identity2, headActions);
31899
+ head.append(identity3, headActions);
31831
31900
  card.append(head);
31832
31901
  if (row.stateError) {
31833
31902
  const detail = remoteElement(
@@ -31879,15 +31948,15 @@ ${detail}` : ""}`
31879
31948
  }
31880
31949
  if (!remote) serviceActions.append(command("recheck", t("\u91CD\u65B0\u68C0\u6D4B", "Check again")));
31881
31950
  }
31882
- const target = remote ? remoteMaintenanceTarget(local, remote) : null;
31951
+ const target2 = remote ? remoteMaintenanceTarget(local, remote) : null;
31883
31952
  if (row.installation === "not-installed") {
31884
31953
  const install2 = command("install", t("\u5B89\u88C5\u5E76\u8FDE\u63A5", "Install and connect"), true);
31885
31954
  install2.disabled ||= !remoteInstallVersion(local);
31886
31955
  serviceActions.append(install2);
31887
- } else if (remote && target && !remoteBusy(remote)) {
31956
+ } else if (remote && target2 && !remoteBusy(remote)) {
31888
31957
  const update = command(
31889
31958
  "update",
31890
- target === remote.installedVersion ? t("\u91CD\u542F\u5E76\u8FDE\u63A5", "Restart and connect") : t("\u66F4\u65B0\u5230\u672C\u673A\u7248\u672C", "Match local version"),
31959
+ target2 === remote.installedVersion ? t("\u91CD\u542F\u5E76\u8FDE\u63A5", "Restart and connect") : t("\u66F4\u65B0\u5230\u672C\u673A\u7248\u672C", "Match local version"),
31891
31960
  true
31892
31961
  );
31893
31962
  serviceActions.append(update);
@@ -32121,13 +32190,13 @@ ${detail}` : ""}`
32121
32190
  port.min = "1";
32122
32191
  port.max = "65535";
32123
32192
  port.step = "1";
32124
- const identity2 = field2(
32193
+ const identity3 = field2(
32125
32194
  t("\u79C1\u94A5\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09", "Identity file (optional)"),
32126
32195
  previous?.identity ?? "",
32127
32196
  "~/.ssh/id_ed25519"
32128
32197
  );
32129
32198
  if (previous?.source === "discovered") {
32130
- hostname3.disabled = port.disabled = identity2.disabled = true;
32199
+ hostname3.disabled = port.disabled = identity3.disabled = true;
32131
32200
  dialog.body.append(
32132
32201
  remoteElement(
32133
32202
  document2,
@@ -32147,7 +32216,7 @@ ${detail}` : ""}`
32147
32216
  displayName: name.value,
32148
32217
  hostname: hostname3.value,
32149
32218
  sshPort: port.value ? Number(port.value) : null,
32150
- identity: identity2.value.trim() || null
32219
+ identity: identity3.value.trim() || null
32151
32220
  })
32152
32221
  );
32153
32222
  });
@@ -32242,7 +32311,7 @@ ${detail}` : ""}`
32242
32311
  var INSPECT_RETRY_MS = 6e4;
32243
32312
  var RESTART_GRACE_MS = 9e4;
32244
32313
  var CONNECT_REQUEST_WAIT_MS = 3e3;
32245
- function createRemoteConnectionsPage(messages, getControl, getOpenWeb = () => void 0) {
32314
+ function createRemoteConnectionsPage(messages, getControl) {
32246
32315
  const zh = messages.locale === "zh-CN";
32247
32316
  const t = (cn, en) => zh ? cn : en;
32248
32317
  return Object.freeze({
@@ -32261,72 +32330,17 @@ ${detail}` : ""}`
32261
32330
  return panel;
32262
32331
  };
32263
32332
  const root = el("div", "settings-remote");
32264
- const openWeb = getOpenWeb();
32265
- if (openWeb) {
32266
- root.append(el("h1", "settings-section-label", messages.pageLabels["remote-connections"]));
32267
- const web = el("section", "settings-remote");
32268
- const webHeader = el("div", "settings-remote__header");
32269
- const webCopy = el("div");
32270
- webCopy.append(
32271
- el(
32272
- "h2",
32273
- "settings-section-label",
32274
- t("\u624B\u673A\u548C\u5176\u4ED6\u8BBE\u5907\uFF08Web\uFF09", "Phones and other devices (Web)")
32275
- ),
32276
- el(
32277
- "p",
32278
- "settings-page-description",
32279
- t(
32280
- "\u5728\u624B\u673A\u6216\u5176\u4ED6\u8BBE\u5907\u7684\u6D4F\u89C8\u5668\u4E0A\u4F7F\u7528\u8FD9\u53F0\u7535\u8111\u7684 CodexHost\uFF0C\u8FD9\u53F0\u7535\u8111\u9700\u8981\u4FDD\u6301\u5F00\u673A\u548C\u8054\u7F51\u3002",
32281
- "Use this computer's CodexHost from a browser on your phone or another device. This computer must stay on and connected to the network."
32282
- )
32283
- )
32284
- );
32285
- webHeader.append(webCopy);
32286
- const actions = el("div", "settings-remote__toolbar");
32287
- const button2 = el(
32288
- "button",
32289
- "settings-command-button settings-command-button--secondary",
32290
- t("\u6253\u5F00\u8FDE\u63A5\u8BBE\u5907\u9875", "Open Connect devices")
32291
- );
32292
- button2.type = "button";
32293
- const status = el("div", "settings-remote__banner");
32294
- status.setAttribute("role", "alert");
32295
- status.hidden = true;
32296
- button2.addEventListener("click", () => {
32297
- button2.disabled = true;
32298
- button2.textContent = t("\u6B63\u5728\u6253\u5F00\u2026", "Opening\u2026");
32299
- status.hidden = true;
32300
- void openWeb().catch((error51) => {
32301
- status.textContent = `${t("Web \u6253\u5F00\u5931\u8D25", "Web could not be opened")}: ${remoteErrorMessage(error51)}`;
32302
- status.hidden = false;
32303
- }).finally(() => {
32304
- button2.disabled = false;
32305
- button2.textContent = t("\u6253\u5F00\u8FDE\u63A5\u8BBE\u5907\u9875", "Open Connect devices");
32306
- });
32307
- });
32308
- actions.append(button2);
32309
- web.append(webHeader, actions, status);
32310
- root.append(web);
32311
- }
32312
32333
  const header = el("div", "settings-remote__header");
32313
32334
  const headerCopy = el("div");
32314
32335
  const localVersion = el("p", "settings-remote__meta");
32315
32336
  headerCopy.append(
32316
- el(
32317
- openWeb ? "h2" : "h1",
32318
- "settings-section-label",
32319
- openWeb ? t("\u5176\u4ED6\u7535\u8111\uFF08SSH\uFF09", "Other computers (SSH)") : messages.pageLabels["remote-connections"]
32320
- ),
32337
+ el("h1", "settings-section-label", messages.pageLabels["remote-connections"]),
32321
32338
  el(
32322
32339
  "p",
32323
32340
  "settings-page-description",
32324
- openWeb ? t(
32341
+ t(
32325
32342
  "\u8FD9\u53F0\u7535\u8111\u901A\u8FC7 SSH \u8FDE\u63A5\u53E6\u4E00\u53F0 Mac \u6216 Linux \u7535\u8111\u3002\u8FDE\u63A5\u914D\u7F6E\u4E0E Codex \u5171\u7528\u3002",
32326
32343
  "This computer connects to another Mac or Linux computer over SSH. Connection settings are shared with Codex."
32327
- ) : t(
32328
- "\u901A\u8FC7 SSH \u8FDE\u63A5\u4F60\u7684 Mac \u6216 Linux \u7535\u8111\u3002\u8FDE\u63A5\u914D\u7F6E\u4E0E Codex \u5171\u7528\u3002",
32329
- "Connect to a Mac or Linux computer over SSH. Connection settings are shared with Codex."
32330
32344
  )
32331
32345
  ),
32332
32346
  localVersion
@@ -32468,8 +32482,8 @@ ${detail}` : ""}`
32468
32482
  });
32469
32483
  }
32470
32484
  function focusAction(card, action) {
32471
- const target = card.querySelector(`[data-action="${action}"]:not(:disabled)`) ?? card.querySelector("button:not(:disabled)");
32472
- target?.focus();
32485
+ const target2 = card.querySelector(`[data-action="${action}"]:not(:disabled)`) ?? card.querySelector("button:not(:disabled)");
32486
+ target2?.focus();
32473
32487
  }
32474
32488
  async function probe(row) {
32475
32489
  const { hostId: hostId2 } = row.connection;
@@ -32750,15 +32764,15 @@ ${detail}` : ""}`
32750
32764
  });
32751
32765
  break;
32752
32766
  case "update": {
32753
- const target = row.remote ? remoteMaintenanceTarget(local, row.remote) : null;
32754
- if (!target) break;
32755
- const restart = target === row.remote?.installedVersion;
32767
+ const target2 = row.remote ? remoteMaintenanceTarget(local, row.remote) : null;
32768
+ if (!target2) break;
32769
+ const restart = target2 === row.remote?.installedVersion;
32756
32770
  void act(
32757
32771
  row,
32758
32772
  action,
32759
32773
  restart ? t("\u6B63\u5728\u91CD\u542F\u8FDC\u7A0B\u670D\u52A1\u2026", "Restarting remote service\u2026") : t("\u6B63\u5728\u63D0\u4EA4\u66F4\u65B0\u2026", "Starting update\u2026"),
32760
32774
  async () => {
32761
- await control.update(hostId2, target);
32775
+ await control.update(hostId2, target2);
32762
32776
  await setConnected(true);
32763
32777
  }
32764
32778
  );
@@ -32797,6 +32811,64 @@ ${detail}` : ""}`
32797
32811
  });
32798
32812
  }
32799
32813
 
32814
+ // src/settings/mobile-web-page.ts
32815
+ function createMobileWebPage(messages, getOpenWeb) {
32816
+ const zh = messages.locale === "zh-CN";
32817
+ const t = (cn, en) => zh ? cn : en;
32818
+ return Object.freeze({
32819
+ id: "mobile-web",
32820
+ label: messages.pageLabels["mobile-web"],
32821
+ icon: "mobile",
32822
+ mount({ content }) {
32823
+ const document2 = content.ownerDocument;
32824
+ const el = (tag, className = "", text = "") => remoteElement(document2, tag, className, text);
32825
+ const root = el("div", "settings-remote");
32826
+ const header = el("div", "settings-remote__header");
32827
+ const copy = el("div");
32828
+ copy.append(
32829
+ el("h1", "settings-section-label", messages.pageLabels["mobile-web"]),
32830
+ el(
32831
+ "p",
32832
+ "settings-page-description",
32833
+ t(
32834
+ "\u5728\u624B\u673A\u6216\u5176\u4ED6\u8BBE\u5907\u7684\u6D4F\u89C8\u5668\u4E0A\u4F7F\u7528\u8FD9\u53F0\u7535\u8111\u7684 CodexHost\uFF0C\u8FD9\u53F0\u7535\u8111\u9700\u8981\u4FDD\u6301\u5F00\u673A\u548C\u8054\u7F51\u3002",
32835
+ "Use this computer's CodexHost from a browser on your phone or another device. This computer must stay on and connected to the network."
32836
+ )
32837
+ )
32838
+ );
32839
+ header.append(copy);
32840
+ const label = t("\u5728\u6D4F\u89C8\u5668\u4E2D\u6253\u5F00\u8FDE\u63A5\u8BBE\u7F6E", "Open connection settings in browser");
32841
+ const button2 = el("button", "settings-command-button", "");
32842
+ button2.type = "button";
32843
+ button2.textContent = label;
32844
+ const status = el("div", "settings-remote__banner");
32845
+ status.setAttribute("role", "alert");
32846
+ status.hidden = true;
32847
+ const openWeb = getOpenWeb();
32848
+ if (!openWeb) {
32849
+ button2.disabled = true;
32850
+ status.textContent = t("\u6B64\u7A97\u53E3\u65E0\u6CD5\u6253\u5F00 Web\u3002", "Web cannot be opened from this window.");
32851
+ status.hidden = false;
32852
+ }
32853
+ button2.addEventListener("click", () => {
32854
+ if (!openWeb) return;
32855
+ button2.disabled = true;
32856
+ status.hidden = true;
32857
+ void openWeb().catch((error51) => {
32858
+ status.textContent = `${t("Web \u6253\u5F00\u5931\u8D25", "Web could not be opened")}: ${remoteErrorMessage(error51)}`;
32859
+ status.hidden = false;
32860
+ }).finally(() => {
32861
+ button2.disabled = false;
32862
+ });
32863
+ });
32864
+ const actions = el("div", "settings-remote__toolbar");
32865
+ actions.append(button2);
32866
+ root.append(header, actions, status);
32867
+ content.append(root);
32868
+ }
32869
+ });
32870
+ }
32871
+
32800
32872
  // src/settings/core.ts
32801
32873
  var SETTINGS_PAGE_ID_PATTERN = /^[a-z][a-z0-9]*(?:-[a-z0-9]+)*$/u;
32802
32874
  var MAX_SETTINGS_PAGE_ID_LENGTH = 48;
@@ -33428,15 +33500,15 @@ ${detail}` : ""}`
33428
33500
  cwd.className = "settings-session-import-row__cwd";
33429
33501
  cwd.textContent = candidate.cwd;
33430
33502
  cwd.title = candidate.cwd;
33431
- const identity2 = document2.createElement("span");
33432
- identity2.textContent = `${messages.sessionImportSessionId}: ${shortSessionId(candidate.nativeSessionId)}`;
33433
- identity2.title = candidate.nativeSessionId;
33434
- identity2.setAttribute("aria-hidden", "true");
33503
+ const identity3 = document2.createElement("span");
33504
+ identity3.textContent = `${messages.sessionImportSessionId}: ${shortSessionId(candidate.nativeSessionId)}`;
33505
+ identity3.title = candidate.nativeSessionId;
33506
+ identity3.setAttribute("aria-hidden", "true");
33435
33507
  copy.append(
33436
33508
  title,
33437
33509
  metadata,
33438
33510
  cwd,
33439
- identity2,
33511
+ identity3,
33440
33512
  createAccessibleText(
33441
33513
  document2,
33442
33514
  `${messages.sessionImportSessionId}: ${candidate.nativeSessionId}`
@@ -34102,12 +34174,12 @@ ${detail}` : ""}`
34102
34174
  let hideEmails = false;
34103
34175
  const shown = (text) => accountDisplayText(text, hideEmails);
34104
34176
  const targetButtons = /* @__PURE__ */ new Map();
34105
- const importedRecords = () => snapshot.targets.find((target) => target.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
34177
+ const importedRecords = () => snapshot.targets.find((target2) => target2.harnessId === TARGET_HARNESS_ID)?.imports ?? [];
34106
34178
  const sourceOf = (record14) => snapshot.sources.find((source) => source.id === record14.source.id);
34107
34179
  const piTarget = () => snapshot.targets.find((candidate) => candidate.harnessId === TARGET_HARNESS_ID);
34108
34180
  const compatibleSources = () => {
34109
- const target = piTarget();
34110
- return target ? snapshot.sources.filter((source) => target.providers.includes(source.provider)) : [];
34181
+ const target2 = piTarget();
34182
+ return target2 ? snapshot.sources.filter((source) => target2.providers.includes(source.provider)) : [];
34111
34183
  };
34112
34184
  const section = document2.createElement("section");
34113
34185
  section.className = "settings-pi-accounts";
@@ -34199,8 +34271,8 @@ ${detail}` : ""}`
34199
34271
  row.setAttribute("aria-label", shown(record14.source.label));
34200
34272
  const agent = record14.source.harnessId;
34201
34273
  const mark = createMark(agent);
34202
- const identity2 = document2.createElement("div");
34203
- identity2.className = "settings-pi-accounts__identity";
34274
+ const identity3 = document2.createElement("div");
34275
+ identity3.className = "settings-pi-accounts__identity";
34204
34276
  const label = document2.createElement("strong");
34205
34277
  label.className = "settings-account-email";
34206
34278
  label.textContent = shown(record14.source.label);
@@ -34224,7 +34296,7 @@ ${detail}` : ""}`
34224
34296
  }
34225
34297
  meta3.append(part);
34226
34298
  });
34227
- identity2.append(label, meta3);
34299
+ identity3.append(label, meta3);
34228
34300
  const actions = document2.createElement("div");
34229
34301
  actions.className = "settings-pi-accounts__actions";
34230
34302
  const reimport = document2.createElement("button");
@@ -34246,7 +34318,7 @@ ${detail}` : ""}`
34246
34318
  remove.addEventListener("click", () => openDialog("remove", { record: record14 }, `row:${record14.name}`));
34247
34319
  if (source) actions.append(reimport);
34248
34320
  actions.append(remove);
34249
- row.append(mark, identity2, actions);
34321
+ row.append(mark, identity3, actions);
34250
34322
  rows.set(record14.name, row);
34251
34323
  return row;
34252
34324
  };
@@ -34260,8 +34332,8 @@ ${detail}` : ""}`
34260
34332
  [shown(login.label ?? login.provider), agent && rendererAgentLabel(agent, pluginFor(agent))].filter(Boolean).join(" \xB7 ")
34261
34333
  );
34262
34334
  const mark = createMark(agent);
34263
- const identity2 = document2.createElement("div");
34264
- identity2.className = "settings-pi-accounts__identity";
34335
+ const identity3 = document2.createElement("div");
34336
+ identity3.className = "settings-pi-accounts__identity";
34265
34337
  const title = document2.createElement("strong");
34266
34338
  title.className = "settings-account-email";
34267
34339
  title.textContent = shown(login.label ?? login.provider);
@@ -34280,15 +34352,15 @@ ${detail}` : ""}`
34280
34352
  }
34281
34353
  meta3.append(part);
34282
34354
  });
34283
- identity2.append(title, meta3);
34284
- row.append(mark, identity2);
34355
+ identity3.append(title, meta3);
34356
+ row.append(mark, identity3);
34285
34357
  return row;
34286
34358
  };
34287
34359
  const renderSection = () => {
34288
- const target = piTarget();
34289
- section.hidden = !target;
34360
+ const target2 = piTarget();
34361
+ section.hidden = !target2;
34290
34362
  const records = importedRecords();
34291
- const others = target?.others ?? [];
34363
+ const others = target2?.others ?? [];
34292
34364
  sectionCount.textContent = String(records.length + others.length);
34293
34365
  card.hidden = !sectionExpanded;
34294
34366
  sectionImport.hidden = compatibleSources().length === 0;
@@ -34545,8 +34617,8 @@ ${detail}` : ""}`
34545
34617
  modal.addEventListener("close", () => {
34546
34618
  modal.remove();
34547
34619
  dialog = void 0;
34548
- const target = returnKey ? returnKey === SECTION_IMPORT_KEY ? sectionImport : targetButtons.get(returnKey) ?? rows.get(returnKey.replace(/^row:/, "")) : void 0;
34549
- (target?.isConnected ? target : section).focus();
34620
+ const target2 = returnKey ? returnKey === SECTION_IMPORT_KEY ? sectionImport : targetButtons.get(returnKey) ?? rows.get(returnKey.replace(/^row:/, "")) : void 0;
34621
+ (target2?.isConnected ? target2 : section).focus();
34550
34622
  });
34551
34623
  show(initialMode);
34552
34624
  root.append(modal);
@@ -34574,11 +34646,11 @@ ${detail}` : ""}`
34574
34646
  const source = snapshot.sources.find(
34575
34647
  (candidate) => candidate.harnessId === harnessId && candidate.label === accountLabel
34576
34648
  );
34577
- const target = snapshot.targets.find(
34649
+ const target2 = snapshot.targets.find(
34578
34650
  (candidate) => candidate.harnessId === TARGET_HARNESS_ID && source && candidate.providers.includes(source.provider)
34579
34651
  );
34580
- if (!source || !target) return null;
34581
- const record14 = target.imports.find((candidate) => candidate.source.id === source.id);
34652
+ if (!source || !target2) return null;
34653
+ const record14 = target2.imports.find((candidate) => candidate.source.id === source.id);
34582
34654
  const key = `${harnessId}:${accountLabel}:import`;
34583
34655
  const button2 = document2.createElement("button");
34584
34656
  button2.type = "button";
@@ -34980,11 +35052,11 @@ ${detail}` : ""}`
34980
35052
  const key = active.getAttribute("data-account-focus");
34981
35053
  const accountId = active.closest(".settings-account-row")?.dataset.accountId;
34982
35054
  return () => {
34983
- const target = key ? list.querySelector(`[data-account-focus="${CSS.escape(key)}"]`) : null;
34984
- if (target && !target.matches(":disabled")) {
34985
- const dialog = target.closest("dialog");
35055
+ const target2 = key ? list.querySelector(`[data-account-focus="${CSS.escape(key)}"]`) : null;
35056
+ if (target2 && !target2.matches(":disabled")) {
35057
+ const dialog = target2.closest("dialog");
34986
35058
  if (dialog && !dialog.open) dialog.showModal();
34987
- target.focus({ preventScroll: true });
35059
+ target2.focus({ preventScroll: true });
34988
35060
  return;
34989
35061
  }
34990
35062
  const row = accountId ? list.querySelector(
@@ -35027,8 +35099,8 @@ ${detail}` : ""}`
35027
35099
  function createAccountPerson(document2, messages, input) {
35028
35100
  const person = document2.createElement("div");
35029
35101
  person.className = "settings-account-row__person";
35030
- const identity2 = document2.createElement("div");
35031
- identity2.className = "settings-account-row__identity";
35102
+ const identity3 = document2.createElement("div");
35103
+ identity3.className = "settings-account-row__identity";
35032
35104
  const title = document2.createElement("strong");
35033
35105
  title.className = "settings-account-email";
35034
35106
  title.textContent = input.name;
@@ -35060,9 +35132,9 @@ ${detail}` : ""}`
35060
35132
  badge.title = messages.accountDefaultHint;
35061
35133
  metadata.append(badge);
35062
35134
  }
35063
- identity2.append(title);
35064
- if (metadata.childElementCount) identity2.append(metadata);
35065
- person.append(input.mark, identity2);
35135
+ identity3.append(title);
35136
+ if (metadata.childElementCount) identity3.append(metadata);
35137
+ person.append(input.mark, identity3);
35066
35138
  return person;
35067
35139
  }
35068
35140
  function appendAccountExtras(cell, items) {
@@ -35761,14 +35833,14 @@ ${detail}` : ""}`
35761
35833
  function isWindowsRenderer(window2) {
35762
35834
  const navigator2 = window2?.navigator;
35763
35835
  if (!navigator2) return false;
35764
- const identity2 = `${rendererUserAgentData(navigator2)?.platform ?? ""} ${navigator2.platform ?? ""} ${navigator2.userAgent}`;
35765
- return /windows|win32|win64/iu.test(identity2);
35836
+ const identity3 = `${rendererUserAgentData(navigator2)?.platform ?? ""} ${navigator2.platform ?? ""} ${navigator2.userAgent}`;
35837
+ return /windows|win32|win64/iu.test(identity3);
35766
35838
  }
35767
35839
  function windowsInstallerDownloadUrl(window2, version2) {
35768
35840
  const navigator2 = window2?.navigator;
35769
35841
  const hints = navigator2 ? rendererUserAgentData(navigator2) : void 0;
35770
- const identity2 = `${hints?.architecture ?? ""} ${hints?.platform ?? ""} ${navigator2?.platform ?? ""} ${navigator2?.userAgent ?? ""}`;
35771
- const architecture = /arm64|aarch64|\barm\b/iu.test(identity2) ? "arm64" : "x64";
35842
+ const identity3 = `${hints?.architecture ?? ""} ${hints?.platform ?? ""} ${navigator2?.platform ?? ""} ${navigator2?.userAgent ?? ""}`;
35843
+ const architecture = /arm64|aarch64|\barm\b/iu.test(identity3) ? "arm64" : "x64";
35772
35844
  return `https://github.com/BytePioneer-AI/codex-host/releases/download/v${version2}/codexhost-${version2}-windows-${architecture}.exe`;
35773
35845
  }
35774
35846
  function panelIconName(view) {
@@ -36252,10 +36324,11 @@ ${detail}` : ""}`
36252
36324
  function createDefaultRendererSettingsPages(messages = DEFAULT_RENDERER_SETTINGS_MESSAGES, getUpdateClient = () => null, getDiagnostics = () => null, getAccountClient = () => null, getSessionImportClient = () => null, openImportedThread = () => Promise.reject(new Error("Imported Thread navigation is unavailable")), getLoadedSessionsClient = () => null, getRemoteConnections = () => null, requestUsageStatistics = () => Promise.reject(new Error("Local Host connection is unavailable")), usageStatisticsHosts, harnessSchedules) {
36253
36325
  return Object.freeze([
36254
36326
  createConnectionsSettingsPage(messages, getDiagnostics, void 0, getRemoteConnections),
36255
- createRemoteConnectionsPage(messages, getRemoteConnections, () => {
36327
+ createMobileWebPage(messages, () => {
36256
36328
  const client = getUpdateClient();
36257
36329
  return client?.openWeb?.bind(client);
36258
36330
  }),
36331
+ createRemoteConnectionsPage(messages, getRemoteConnections),
36259
36332
  createAccountsSettingsPage(messages, getAccountClient),
36260
36333
  ...harnessSchedules ? [createHarnessSchedulesPage(messages, harnessSchedules)] : [],
36261
36334
  createSessionImportSettingsPage(
@@ -41437,11 +41510,11 @@ ${renderer_brand_mark_default}`;
41437
41510
  ownerDocument.defaultView?.setTimeout(restoreFocus, 0);
41438
41511
  };
41439
41512
  const onNavigationClick = (event) => {
41440
- const target = event.target instanceof Element ? event.target.closest("button[data-page-id]") : null;
41441
- const pageId = target?.dataset.pageId;
41513
+ const target2 = event.target instanceof Element ? event.target.closest("button[data-page-id]") : null;
41514
+ const pageId = target2?.dataset.pageId;
41442
41515
  if (!pageId || pageId === navigationState.activePageId) return;
41443
41516
  activatePage(pageId);
41444
- target.focus();
41517
+ target2.focus();
41445
41518
  };
41446
41519
  const hide = (restoreFocus) => {
41447
41520
  if (disposed || surface.hidden) return;
@@ -41732,7 +41805,7 @@ ${renderer_brand_mark_default}`;
41732
41805
  }
41733
41806
  return hook == null ? result : [];
41734
41807
  }
41735
- function identity(owner) {
41808
+ function identity2(owner) {
41736
41809
  const props = owner.memoizedProps;
41737
41810
  if (!record11(props) || !record11(props.dataAttributes)) return null;
41738
41811
  const { conversationId: threadId, hostId: hostId2, dataAttributes: attributes } = props;
@@ -41761,7 +41834,7 @@ ${renderer_brand_mark_default}`;
41761
41834
  }
41762
41835
  function repairSidebarThreadState(owner) {
41763
41836
  if (!record11(owner)) return null;
41764
- const key = identity(owner);
41837
+ const key = identity2(owner);
41765
41838
  if (!key) return null;
41766
41839
  const candidates = [];
41767
41840
  try {
@@ -41781,12 +41854,12 @@ ${renderer_brand_mark_default}`;
41781
41854
  const candidate = candidates[0];
41782
41855
  if (candidates.length !== 1 || !candidate) return null;
41783
41856
  const { atom, store, subscriber, instance, effect } = candidate;
41784
- for (const [target, name] of [
41857
+ for (const [target2, name] of [
41785
41858
  [store, "sub"],
41786
41859
  [subscriber, "getSnapshot"],
41787
41860
  [instance, "getSnapshot"]
41788
41861
  ]) {
41789
- if (Object.getOwnPropertyDescriptor(target, name)?.writable !== true) return null;
41862
+ if (Object.getOwnPropertyDescriptor(target2, name)?.writable !== true) return null;
41790
41863
  }
41791
41864
  const originalSub = store.sub;
41792
41865
  let notify2;
@@ -41853,7 +41926,7 @@ ${renderer_brand_mark_default}`;
41853
41926
  if (!fiber) break;
41854
41927
  if (seen.has(fiber)) return /* @__PURE__ */ new Set();
41855
41928
  seen.add(fiber);
41856
- if (identity(fiber)) owners.add(fiber);
41929
+ if (identity2(fiber)) owners.add(fiber);
41857
41930
  if (fiber !== first && record11(fiber.sibling)) stack.push(fiber.sibling);
41858
41931
  if (record11(fiber.child)) stack.push(fiber.child);
41859
41932
  }
@@ -42047,13 +42120,13 @@ ${renderer_brand_mark_default}`;
42047
42120
  function filterDelegationTargets(targets, query) {
42048
42121
  const needle = query.trim().toLowerCase();
42049
42122
  if (!needle) return [...targets];
42050
- const scored = targets.flatMap((target, index) => {
42051
- const label = target.label.toLowerCase();
42052
- const id = target.agent.toLowerCase();
42123
+ const scored = targets.flatMap((target2, index) => {
42124
+ const label = target2.label.toLowerCase();
42125
+ const id = target2.agent.toLowerCase();
42053
42126
  const score = label.startsWith(needle) || id.startsWith(needle) ? 2 : label.includes(needle) || id.includes(needle) ? 1 : 0;
42054
- return score > 0 ? [{ target, score, index }] : [];
42127
+ return score > 0 ? [{ target: target2, score, index }] : [];
42055
42128
  });
42056
- return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target }) => target);
42129
+ return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target: target2 }) => target2);
42057
42130
  }
42058
42131
  function filterDelegationCommands(commands, query) {
42059
42132
  const needle = query.trim().toLowerCase().replace(/^\//u, "");
@@ -42250,13 +42323,13 @@ ${renderer_brand_mark_default}`;
42250
42323
  entries = [];
42251
42324
  if (targets.length > 0) {
42252
42325
  rows.push(sectionHeader(agentsTitle(locale)));
42253
- for (const target of targets) {
42326
+ for (const target2 of targets) {
42254
42327
  rows.push(
42255
42328
  optionRow(
42256
- { kind: "agent", target },
42329
+ { kind: "agent", target: target2 },
42257
42330
  rowContent(
42258
- createRendererAgentIcon(target.agent, 16, ownerDocument, target.plugin),
42259
- target.label,
42331
+ createRendererAgentIcon(target2.agent, 16, ownerDocument, target2.plugin),
42332
+ target2.label,
42260
42333
  ""
42261
42334
  )
42262
42335
  )
@@ -42369,17 +42442,17 @@ ${renderer_brand_mark_default}`;
42369
42442
  await waitForSelectionSync();
42370
42443
  return true;
42371
42444
  };
42372
- const insertAgent = async (trigger, range, target) => {
42373
- const path = delegationMentionPath(target.agent);
42445
+ const insertAgent = async (trigger, range, target2) => {
42446
+ const path = delegationMentionPath(target2.agent);
42374
42447
  if (insertNativeAgentMention(trigger.editor, range, {
42375
- name: target.label,
42376
- displayName: target.label,
42448
+ name: target2.label,
42449
+ displayName: target2.label,
42377
42450
  path
42378
42451
  })) {
42379
42452
  return;
42380
42453
  }
42381
42454
  if (!await selectTriggerText(trigger)) return;
42382
- const carrier = `${formatDelegationMentionLink({ harnessId: target.agent, label: target.label })} `;
42455
+ const carrier = `${formatDelegationMentionLink({ harnessId: target2.agent, label: target2.label })} `;
42383
42456
  const pasted = dispatchPlainTextPaste(trigger.editor, carrier);
42384
42457
  if (!pasted) ownerDocument.execCommand("insertText", false, carrier);
42385
42458
  };
@@ -43570,42 +43643,42 @@ ${renderer_brand_mark_default}`;
43570
43643
  if (!isLateConversationTarget(mountedTarget, currentTarget)) return "none";
43571
43644
  return mountedTarget?.[0] === "default" && (sourcePhase === "locked" || submissionPending) ? "transfer" : "inspect";
43572
43645
  }
43573
- function scopedComposerTarget(target, hostId2) {
43574
- if (target?.[0] !== "conversation" || !hostId2) return target;
43575
- return ["conversation", target[1], hostId2];
43646
+ function scopedComposerTarget(target2, hostId2) {
43647
+ if (target2?.[0] !== "conversation" || !hostId2) return target2;
43648
+ return ["conversation", target2[1], hostId2];
43576
43649
  }
43577
- function isComposerModelWriteAllowed(target) {
43578
- return target?.[0] === "default";
43650
+ function isComposerModelWriteAllowed(target2) {
43651
+ return target2?.[0] === "default";
43579
43652
  }
43580
- function applyComposerModelWrite(target, write) {
43581
- if (target?.[0] === "conversation") return true;
43582
- if (!isComposerModelWriteAllowed(target)) return false;
43653
+ function applyComposerModelWrite(target2, write) {
43654
+ if (target2?.[0] === "conversation") return true;
43655
+ if (!isComposerModelWriteAllowed(target2)) return false;
43583
43656
  return write();
43584
43657
  }
43585
43658
  function mutationMayAffectComposer(mutation) {
43586
- const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
43587
- if (!target) return true;
43659
+ const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
43660
+ if (!target2) return true;
43588
43661
  if (mutation.type === "attributes" && (mutation.attributeName === "data-codex-composer-root" || NATIVE_COMPOSER_REQUEST_ATTRIBUTES.some((attribute) => attribute === mutation.attributeName)))
43589
43662
  return true;
43590
- if (mutation.type !== "attributes" && editorForElement(target)) {
43663
+ if (mutation.type !== "attributes" && editorForElement(target2)) {
43591
43664
  return mutation.type === "childList" && [...mutation.addedNodes, ...mutation.removedNodes].some(
43592
43665
  (node) => node instanceof Element && hasNativeComposerRequest(node)
43593
43666
  );
43594
43667
  }
43595
- if (target.closest(CODEX_COMPOSER_SELECTOR)) return true;
43668
+ if (target2.closest(CODEX_COMPOSER_SELECTOR)) return true;
43596
43669
  if (mutation.type === "characterData") return false;
43597
- if (!target.closest(
43670
+ if (!target2.closest(
43598
43671
  `${TRANSCRIPT_ITEM_SELECTOR}, [data-turn-key], [data-content-search-turn-key], [data-app-action-sidebar-scroll], [data-app-action-sidebar-section], ${SIDEBAR_THREAD_ROW_SELECTOR}`
43599
43672
  ))
43600
43673
  return true;
43601
- if (mutation.type === "attributes") return target.querySelector(CODEX_COMPOSER_SELECTOR) !== null;
43674
+ if (mutation.type === "attributes") return target2.querySelector(CODEX_COMPOSER_SELECTOR) !== null;
43602
43675
  return mutation.type === "childList" && [...mutation.addedNodes, ...mutation.removedNodes].some(
43603
43676
  (node) => node instanceof Element && (node.matches(CODEX_COMPOSER_SELECTOR) || node.querySelector(CODEX_COMPOSER_SELECTOR))
43604
43677
  );
43605
43678
  }
43606
43679
  function mutationMayChangeComposerTarget(mutation) {
43607
- const target = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
43608
- return !target || editorForElement(target) === null;
43680
+ const target2 = mutation.target instanceof Element ? mutation.target : mutation.target.parentElement;
43681
+ return !target2 || editorForElement(target2) === null;
43609
43682
  }
43610
43683
  function catalogWithConfigurationState(catalog, model2, state) {
43611
43684
  if (!state.availableThinkingOptions) return catalog;
@@ -43653,7 +43726,7 @@ ${renderer_brand_mark_default}`;
43653
43726
  const hostId2 = modelControl.currentHostId ? modelControl.currentHostId(composer) : "local";
43654
43727
  return hostId2 === "durable" ? null : hostId2;
43655
43728
  };
43656
- const controllerTarget = (target, hostId2) => scopedComposerTarget(target, hostId2);
43729
+ const controllerTarget = (target2, hostId2) => scopedComposerTarget(target2, hostId2);
43657
43730
  const usageSubscriptions = /* @__PURE__ */ new Map();
43658
43731
  const usageNotificationDispose = () => {
43659
43732
  for (const subscription2 of usageSubscriptions.values()) subscription2.dispose();
@@ -43661,9 +43734,9 @@ ${renderer_brand_mark_default}`;
43661
43734
  };
43662
43735
  const localAgentForSidebarThread = (input) => {
43663
43736
  for (const mounted of mountedByComposer.values()) {
43664
- const target = mounted.modelTarget;
43665
- const matchesDraft = target?.[0] === "default" && input.draftId !== null && target[1] === input.draftId;
43666
- const matchesConversation = target?.[0] === "conversation" && input.threadId !== null && target[1] === input.threadId && mounted.ownershipStatus === "ready";
43737
+ const target2 = mounted.modelTarget;
43738
+ const matchesDraft = target2?.[0] === "default" && input.draftId !== null && target2[1] === input.draftId;
43739
+ const matchesConversation = target2?.[0] === "conversation" && input.threadId !== null && target2[1] === input.threadId && mounted.ownershipStatus === "ready";
43667
43740
  if (!matchesDraft && !matchesConversation) continue;
43668
43741
  const mountedHostId = activeModelHostId(mounted.composer);
43669
43742
  if (input.hostId !== mountedHostId) return null;
@@ -45119,8 +45192,8 @@ ${renderer_brand_mark_default}`;
45119
45192
  else void refreshDraftUsage(mounted);
45120
45193
  continue;
45121
45194
  }
45122
- const target = controllerTarget(mounted.modelTarget, hostId2);
45123
- if (controller.rebindConversation(mounted.composer, target) === null) {
45195
+ const target2 = controllerTarget(mounted.modelTarget, hostId2);
45196
+ if (controller.rebindConversation(mounted.composer, target2) === null) {
45124
45197
  mounted.ownershipStatus = "error";
45125
45198
  renderMounted(mounted);
45126
45199
  continue;
@@ -45160,22 +45233,22 @@ ${renderer_brand_mark_default}`;
45160
45233
  }
45161
45234
  }
45162
45235
  let connectionsChanged = false;
45163
- for (const target of new Set([...mountedByComposer.values()].map((m) => m.hostId))) {
45164
- if (!target) continue;
45165
- const client = modelClientForHost(target);
45166
- const previous = usageSubscriptions.get(target);
45236
+ for (const target2 of new Set([...mountedByComposer.values()].map((m) => m.hostId))) {
45237
+ if (!target2) continue;
45238
+ const client = modelClientForHost(target2);
45239
+ const previous = usageSubscriptions.get(target2);
45167
45240
  if (previous?.client === client) continue;
45168
45241
  connectionsChanged ||= previous !== void 0;
45169
45242
  previous?.dispose();
45170
- usageSubscriptions.delete(target);
45243
+ usageSubscriptions.delete(target2);
45171
45244
  if (!client?.subscribeThreadUsage) continue;
45172
45245
  try {
45173
45246
  const dispose = client.subscribeThreadUsage((update) => {
45174
- if (usageSubscriptions.get(target)?.client !== client) return;
45175
- if (modelClientForHost(target) !== client) return;
45176
- applyThreadUsageUpdate(target, update);
45247
+ if (usageSubscriptions.get(target2)?.client !== client) return;
45248
+ if (modelClientForHost(target2) !== client) return;
45249
+ applyThreadUsageUpdate(target2, update);
45177
45250
  });
45178
- usageSubscriptions.set(target, { client, dispose });
45251
+ usageSubscriptions.set(target2, { client, dispose });
45179
45252
  connectionsChanged = true;
45180
45253
  } catch {
45181
45254
  }
@@ -45230,14 +45303,14 @@ ${renderer_brand_mark_default}`;
45230
45303
  if (hostId2 === "durable") return Promise.resolve();
45231
45304
  return refreshConnectionHosts(
45232
45305
  [hostId2],
45233
- (target) => refreshHarnessAvailabilityForHost(target, true, false, true),
45234
- (target) => hostHarnessAvailabilityState(target).request?.promise
45306
+ (target2) => refreshHarnessAvailabilityForHost(target2, true, false, true),
45307
+ (target2) => hostHarnessAvailabilityState(target2).request?.promise
45235
45308
  );
45236
45309
  }
45237
45310
  reconcileHarnessAvailabilityHost();
45238
45311
  return refreshConnectionHosts(
45239
- [...harnessAvailabilityByHost.keys()].filter((target) => target !== "durable"),
45240
- (target) => refreshHarnessAvailabilityForHost(target, true, false, true)
45312
+ [...harnessAvailabilityByHost.keys()].filter((target2) => target2 !== "durable"),
45313
+ (target2) => refreshHarnessAvailabilityForHost(target2, true, false, true)
45241
45314
  );
45242
45315
  },
45243
45316
  async installation(hostId2, agent, action) {
@@ -45408,21 +45481,21 @@ ${renderer_brand_mark_default}`;
45408
45481
  if (disposed) return;
45409
45482
  settingsLifecycle.refresh();
45410
45483
  const transferredComposers = /* @__PURE__ */ new Set();
45411
- for (const [target, replacement] of pendingReplacements) {
45484
+ for (const [target2, replacement] of pendingReplacements) {
45412
45485
  const sourceState = controller.get(replacement.source.composer);
45413
- const replacementTarget = findComposerModelTarget(target);
45414
- const replacementHostId = activeModelHostId(target);
45415
- if (hasNativeComposerRequest(target) || orbitComposerKind(target) !== "codex" || !shouldTransferComposerState(
45486
+ const replacementTarget = findComposerModelTarget(target2);
45487
+ const replacementHostId = activeModelHostId(target2);
45488
+ if (hasNativeComposerRequest(target2) || orbitComposerKind(target2) !== "codex" || !shouldTransferComposerState(
45416
45489
  replacement.sourceModelTarget,
45417
45490
  replacementTarget,
45418
45491
  sourceState.phase,
45419
45492
  controller.isSubmissionPending(replacement.source.composer)
45420
45493
  ) || !controller.transfer(
45421
45494
  replacement.source.composer,
45422
- target,
45495
+ target2,
45423
45496
  controllerTarget(replacementTarget, replacementHostId)
45424
45497
  )) {
45425
- pendingReplacements.delete(target);
45498
+ pendingReplacements.delete(target2);
45426
45499
  } else {
45427
45500
  transferredComposers.add(replacement.source.composer);
45428
45501
  }
@@ -45516,10 +45589,10 @@ ${renderer_brand_mark_default}`;
45516
45589
  for (const replacement of replacements.values()) {
45517
45590
  if (replacement.removed.size !== 1 || replacement.added.size !== 1) continue;
45518
45591
  const source = replacement.removed.values().next().value;
45519
- const target = replacement.added.values().next().value;
45592
+ const target2 = replacement.added.values().next().value;
45520
45593
  const mounted = mountedByComposer.get(source);
45521
- if (source !== target && mounted) {
45522
- pendingReplacements.set(target, {
45594
+ if (source !== target2 && mounted) {
45595
+ pendingReplacements.set(target2, {
45523
45596
  source: mounted,
45524
45597
  sourceModelTarget: mounted.modelTarget
45525
45598
  });
@@ -45557,8 +45630,8 @@ ${renderer_brand_mark_default}`;
45557
45630
  renderMounted(mounted);
45558
45631
  return true;
45559
45632
  };
45560
- const composerForTarget = (target) => {
45561
- const element = eventElement(target);
45633
+ const composerForTarget = (target2) => {
45634
+ const element = eventElement(target2);
45562
45635
  const editor = element ? editorForElement(element) : null;
45563
45636
  const composer = editor ? composerForEditor(editor) : null;
45564
45637
  return composer && isMountedComposer(composer) ? composer : null;
@@ -46002,7 +46075,7 @@ ${renderer_brand_mark_default}`;
46002
46075
 
46003
46076
  // src/renderer-rpc-steering.ts
46004
46077
  var record13 = (value) => value !== null && typeof value === "object" && !Array.isArray(value);
46005
- var invoke = (target, name, ...args) => Reflect.apply(Reflect.get(target, name), target, args);
46078
+ var invoke = (target2, name, ...args) => Reflect.apply(Reflect.get(target2, name), target2, args);
46006
46079
  var running = (state) => record13(state) && (state.inProgress === true || !!state.activeTurnId);
46007
46080
  var context = (previous, marker) => ({
46008
46081
  ...record13(previous) ? previous : {},
@@ -46037,7 +46110,7 @@ ${renderer_brand_mark_default}`;
46037
46110
  current();
46038
46111
  return delivery;
46039
46112
  };
46040
- const target = async (threadId, messageId, delivery) => {
46113
+ const target2 = async (threadId, messageId, delivery) => {
46041
46114
  const state = await invoke(rpc, "getThreadExecutionState", threadId);
46042
46115
  current();
46043
46116
  if (!record13(state) || typeof state.activeTurnId !== "string" || !state.activeTurnId || typeof messageId !== "string" || !messageId)
@@ -46119,7 +46192,7 @@ ${renderer_brand_mark_default}`;
46119
46192
  const restore = prepared.steer.restoreMessage;
46120
46193
  messageId = record13(restore) && typeof restore.id === "string" ? restore.id : void 0;
46121
46194
  const clientId = prepared.steer.clientUserMessageId ?? messageId;
46122
- marker = await target(threadId, clientId, delivery);
46195
+ marker = await target2(threadId, clientId, delivery);
46123
46196
  if (delivery === "activeTurn") return apply(prepared);
46124
46197
  if (!messageId) throw new Error("Native queued message identity is unavailable");
46125
46198
  finish = await prepareRpcSteeringQueue(
@@ -46228,6 +46301,7 @@ lucide/dist/esm/icons/check.mjs:
46228
46301
  lucide/dist/esm/icons/message-circle-question-mark.mjs:
46229
46302
  lucide/dist/esm/icons/pencil.mjs:
46230
46303
  lucide/dist/esm/icons/x.mjs:
46304
+ lucide/dist/esm/icons/smartphone.mjs:
46231
46305
  lucide/dist/esm/icons/boxes.mjs:
46232
46306
  lucide/dist/esm/icons/calendar-clock.mjs:
46233
46307
  lucide/dist/esm/icons/circle-check.mjs: