@codexhost/cli-darwin-x64 0.9.2 → 0.10.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.
@@ -22,7 +22,8 @@
22
22
  "cursor-cli",
23
23
  "hermes",
24
24
  "qoder",
25
- "qoder-cn"
25
+ "qoder-cn",
26
+ "kimi-code"
26
27
  ];
27
28
  var DEFAULT_RENDERER_AGENTS = KNOWN_RENDERER_AGENTS;
28
29
  function defaultIdFactory(sequence) {
@@ -157,6 +158,8 @@
157
158
  else if (agent === "qoder") delete state.qoderModel;
158
159
  if (agent === "qoder-cn" && model) state.qoderCnModel = model;
159
160
  else if (agent === "qoder-cn") delete state.qoderCnModel;
161
+ if (agent === "kimi-code" && model) state.kimiCodeModel = model;
162
+ else if (agent === "kimi-code") delete state.kimiCodeModel;
160
163
  if (agent === "pi" && thinkingOptionId) state.piThinkingOptionId = thinkingOptionId;
161
164
  else if (agent === "pi") delete state.piThinkingOptionId;
162
165
  if (agent === "claude-code" && thinkingOptionId) {
@@ -187,6 +190,9 @@
187
190
  if (agent === "qoder-cn" && thinkingOptionId) {
188
191
  state.qoderCnThinkingOptionId = thinkingOptionId;
189
192
  } else if (agent === "qoder-cn") delete state.qoderCnThinkingOptionId;
193
+ if (agent === "kimi-code" && thinkingOptionId) {
194
+ state.kimiCodeThinkingOptionId = thinkingOptionId;
195
+ } else if (agent === "kimi-code") delete state.kimiCodeThinkingOptionId;
190
196
  if (agent !== "codex") {
191
197
  const permissionModeByAgent = {};
192
198
  for (const candidate of [
@@ -203,7 +209,8 @@
203
209
  "cursor-cli",
204
210
  "hermes",
205
211
  "qoder",
206
- "qoder-cn"
212
+ "qoder-cn",
213
+ "kimi-code"
207
214
  ]) {
208
215
  const current = state.permissionModeByAgent?.[candidate];
209
216
  if (candidate !== agent && current) permissionModeByAgent[candidate] = current;
@@ -233,6 +240,7 @@
233
240
  if (agent === "hermes") return state.hermesModel;
234
241
  if (agent === "qoder") return state.qoderModel;
235
242
  if (agent === "qoder-cn") return state.qoderCnModel;
243
+ if (agent === "kimi-code") return state.kimiCodeModel;
236
244
  return void 0;
237
245
  }
238
246
  thinkingOptionForAgent(composer, agent) {
@@ -248,6 +256,7 @@
248
256
  if (agent === "workbuddy") return state.workBuddyThinkingOptionId;
249
257
  if (agent === "qoder") return state.qoderThinkingOptionId;
250
258
  if (agent === "qoder-cn") return state.qoderCnThinkingOptionId;
259
+ if (agent === "kimi-code") return state.kimiCodeThinkingOptionId;
251
260
  return void 0;
252
261
  }
253
262
  permissionModeForAgent(composer, agent) {
@@ -277,6 +286,7 @@
277
286
  else if (agent === "hermes") state.hermesModel = model;
278
287
  else if (agent === "qoder") state.qoderModel = model;
279
288
  else if (agent === "qoder-cn") state.qoderCnModel = model;
289
+ else if (agent === "kimi-code") state.kimiCodeModel = model;
280
290
  else state.antigravityModel = model;
281
291
  return state;
282
292
  }
@@ -334,6 +344,10 @@
334
344
  state.qoderCnThinkingOptionId = thinkingOptionId;
335
345
  } else if (agent === "qoder-cn") {
336
346
  delete state.qoderCnThinkingOptionId;
347
+ } else if (agent === "kimi-code" && thinkingOptionId) {
348
+ state.kimiCodeThinkingOptionId = thinkingOptionId;
349
+ } else if (agent === "kimi-code") {
350
+ delete state.kimiCodeThinkingOptionId;
337
351
  }
338
352
  return state;
339
353
  }
@@ -15732,10 +15746,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15732
15746
  invocation: commandInvocationSchema,
15733
15747
  label: commandLabelSchema,
15734
15748
  description: commandDescriptionSchema.optional(),
15735
- argumentMode: external_exports.enum(["none", "text"])
15749
+ argumentMode: external_exports.enum(["none", "text"]),
15750
+ /**
15751
+ * Native distinction reported by the Harness. Omitted when the Harness does
15752
+ * not tell skills and commands apart; consumers treat that as "command".
15753
+ */
15754
+ kind: external_exports.enum(["command", "skill"]).optional()
15736
15755
  }).strict();
15737
15756
  var harnessCommandCatalogSchema = external_exports.object({
15738
- commands: external_exports.array(harnessCommandDescriptorSchema)
15757
+ commands: external_exports.array(harnessCommandDescriptorSchema),
15758
+ /**
15759
+ * `live` when the catalog includes what a native Session reports for its
15760
+ * workspace (custom commands, skills); `static` for Adapter built-ins only.
15761
+ * Omitted by Adapters; set by the Host on inspection results.
15762
+ */
15763
+ source: external_exports.enum(["live", "static"]).optional()
15739
15764
  }).strict().superRefine((catalog, context) => {
15740
15765
  const ids = /* @__PURE__ */ new Set();
15741
15766
  for (const [index, command] of catalog.commands.entries()) {
@@ -15749,7 +15774,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15749
15774
  ids.add(command.id);
15750
15775
  }
15751
15776
  });
15752
- var harnessCommandsInspectParamsSchema = external_exports.object({ harnessId: harnessIdSchema }).strict();
15777
+ var harnessCommandsInspectParamsSchema = external_exports.object({
15778
+ harnessId: harnessIdSchema,
15779
+ /** Workspace of a draft without a Thread, for its live catalog when known. */
15780
+ cwd: external_exports.string().min(1).optional()
15781
+ }).strict();
15753
15782
  var threadCommandsInspectParamsSchema = external_exports.object({
15754
15783
  threadId: hostThreadIdSchema
15755
15784
  }).strict();
@@ -15888,6 +15917,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15888
15917
  status: updateStatusSchema.nullable()
15889
15918
  });
15890
15919
 
15920
+ // ../shared-contracts/dist/delegation-mention.js
15921
+ var DELEGATION_MENTION_PATH_PREFIX = "subagent://codexhost.";
15922
+ var HARNESS_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
15923
+ function delegationMentionPath(harnessId) {
15924
+ if (!HARNESS_ID_PATTERN.test(harnessId)) {
15925
+ throw new Error(`Invalid delegation mention Harness id: ${harnessId}`);
15926
+ }
15927
+ return `${DELEGATION_MENTION_PATH_PREFIX}${harnessId}`;
15928
+ }
15929
+ function sanitizeLabel(label) {
15930
+ const cleaned = label.replace(/[[\]()\n\r]+/gu, " ").replace(/\s+/gu, " ").trim();
15931
+ return cleaned.length > 0 ? cleaned : "agent";
15932
+ }
15933
+ function formatDelegationMentionLink(mention) {
15934
+ return `[@${sanitizeLabel(mention.label)}](${delegationMentionPath(mention.harnessId)})`;
15935
+ }
15936
+ var HARNESS_COMMAND_MENTION_PATH_PREFIX = "subagent://codexhost-command.";
15937
+ function harnessCommandMentionPath(invocation) {
15938
+ const name = invocation.trim().replace(/^\//u, "");
15939
+ if (!name || /\s/u.test(name))
15940
+ throw new Error(`Invalid Harness command: ${invocation}`);
15941
+ return `${HARNESS_COMMAND_MENTION_PATH_PREFIX}${encodeURIComponent(name).replace(/[()]/gu, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`)}`;
15942
+ }
15943
+
15891
15944
  // ../shared-contracts/dist/index.js
15892
15945
  var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
15893
15946
 
@@ -15997,6 +16050,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
15997
16050
  return sharedStore;
15998
16051
  }
15999
16052
 
16053
+ // src/assets/kimi-agent.svg
16054
+ var kimi_agent_default = 'data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 40 40" fill="none">%0A <rect width="40" height="40" rx="10" fill="%23000000"/>%0A <path d="M31.6957 7.11414C32.8305 7.11414 33.7505 8.0341 33.7505 9.16893V9.16893C33.7505 10.3038 32.8305 11.2237 31.6957 11.2237L29.8826 11.2237C29.7491 11.2237 29.6409 11.1155 29.6409 10.982L29.6409 9.16893C29.6409 8.0341 30.5609 7.11414 31.6957 7.11414Z" fill="%231783FF"/>%0A <path d="M20.1757 19.0798L27.9302 11.3864C28.0761 11.2413 27.9939 10.9498 27.8056 10.9498H23.633C23.5877 10.9498 23.5438 10.9683 23.5084 11.0038L15.1533 19.2911C15.023 19.4192 14.8304 19.305 14.8304 19.0998V11.1951C14.8304 11.0593 14.7411 10.9498 14.6321 10.9498H11.7569C11.6478 10.9498 11.5586 11.0593 11.5586 11.1951V28.2387C11.5586 28.3745 11.6478 28.484 11.7569 28.484H14.6321C14.7411 28.484 14.8304 28.3745 14.8304 28.2387V24.7661C14.8304 24.6921 14.8573 24.6211 14.904 24.5748L17.4945 22.0047C17.5568 21.943 17.6432 21.9337 17.7126 21.98L24.6414 27.0786C25.7759 27.8423 27.0436 28.3112 28.331 28.4501C28.4458 28.4624 28.5449 28.3483 28.5449 28.2048V24.9343C28.5449 24.8093 28.4698 24.7075 28.3693 24.6921C27.6115 24.5733 26.8722 24.2802 26.2037 23.8297L20.2054 19.487C20.0808 19.4037 20.0652 19.1893 20.1757 19.0798Z" fill="%23FFFFFF"/>%0A</svg>%0A';
16055
+
16000
16056
  // src/assets/codex-agent.png
16001
16057
  var codex_agent_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABoCAYAAAAdHLWhAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAJnFJREFUeAHtfQuYFdWV7tpVdc7pprvpppvuhm4ejQ9AQQFFUEEUfAUVH4k448TRuT4y0UnumGiSm0y8YuZO8jlXRx0fMXGi5rtqfIyj8YWiKCoEQcGAgAEabZAG+km/+/Q5VXvfvXftvWtV9ek3oM7X6/uqq07Vrl1V699rrX+vvasaYFiGZViGZViGZViGZViG5VAKUUs3YYyRPs77byNftYfRoDCxLFu2zHrr/ZEV444Zd9KMU046c0Qia+LY8lETxx41ojDZBJ07d1Y3Upr4/NNNm/+8v7ltbePW97atWnV3faQuCl9j+aoAJO7D4osnfpz3rbumXvY3139/2nEjLystJmNLcgEcruYEL+F2AaRdBhYhEIurE7IAmjoB2rvA27ItvW3NB5UPH9j8zBNPPnlHS7Tur5t8FQCywW/l7Lqb18775lWz758xxZmVx23IdoEdqALYvYeR2gYG7a0WpDhAHi9NuMpj/MxEgkFBPsDYMYSOmwRQOBqsZAKgsh68lSv3/8d/PXH/P61f+asGf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/8zyuYW1tHLFdMCOoP6YA+yqDjmjk6FtCSkjSbtTBmt3W1c8vJFZZzxMGR9wZfnuDw3lc5oZz0dT88cPbYo0vfqlxPYe8uSLd1WDFRgWX3DYKpLML0hGj6L3bnZUNqwmQanzbfoutWrz/3hf+Y+zYcYbeG5csEaKAilXTa0n8rPO/cH7yZrIGTdm6itLbGYu0dYIuevhWZS9CbmHEg8CN+Tja4xWOZddwpnMDE2MZ333hq4brlV7XAlwiOkK8TQELU+9FAl9667cLpk4/7bfN+KNu/E6C+htHWNkKSKU42aNC97yknKGbEikns+XlA84uYJTqgiVGsZuum1dc8//CCN3Qx+BLcWvRev24SUtyV39+0pHzCsXfk5GTPauHssKGGQWsjYZ1JIGIypP6Yhuwo22ICv/xHVCyvAEh+KUBBGTCbuB99uP79O179/aJX1TUO+bDBYOXrCJCWEDucNe/OsqOOn3Hh6DFzLiguGXUSTUGhzSCLCmWLORM+rB4vnWRxVt/U3PnnlprNr1ZVvvPi+8t/VqfqxBN6vxLydQZISzd2KOTkk5eMyCu7ckSnW5/lxDpzWJq4+bkVLU1717atXXtPEpXXZKW/pGVYhij9bXT/HRrnsAzLsAzLsAzLsAzLsHwl5f8DGzhXq3EeY8wAAAAASUVORK5CYII=";
16002
16058
 
@@ -16046,7 +16102,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16046
16102
  "cursor-cli": "Cursor CLI (Experimental)",
16047
16103
  hermes: "Hermes",
16048
16104
  qoder: "Qoder",
16049
- "qoder-cn": "Qoder CN"
16105
+ "qoder-cn": "Qoder CN",
16106
+ "kimi-code": "Kimi Code"
16050
16107
  };
16051
16108
  var PI_PATHS = [
16052
16109
  {
@@ -16122,9 +16179,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16122
16179
  image.style.flex = "none";
16123
16180
  return image;
16124
16181
  }
16125
- if (agent === "antigravity" || agent === "kiro-cli" || agent === "codebuddy" || agent === "workbuddy" || agent === "cursor-cli") {
16182
+ if (agent === "antigravity" || agent === "kiro-cli" || agent === "codebuddy" || agent === "workbuddy" || agent === "cursor-cli" || agent === "kimi-code") {
16126
16183
  const image = ownerDocument.createElement("img");
16127
- image.src = agent === "codebuddy" ? codebuddy_agent_default : agent === "workbuddy" ? workbuddy_agent_default : agent === "cursor-cli" ? cursor_agent_default : agent === "kiro-cli" ? kiro_agent_default : antigravity_agent_default;
16184
+ image.src = agent === "kimi-code" ? kimi_agent_default : agent === "codebuddy" ? codebuddy_agent_default : agent === "workbuddy" ? workbuddy_agent_default : agent === "cursor-cli" ? cursor_agent_default : agent === "kiro-cli" ? kiro_agent_default : antigravity_agent_default;
16128
16185
  image.alt = "";
16129
16186
  image.draggable = false;
16130
16187
  image.style.width = `${size}px`;
@@ -16805,6 +16862,15 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
16805
16862
  "irm https://static.qoder.com.cn/qoder-cli-cn/install.ps1 | iex"
16806
16863
  ),
16807
16864
  after: start("qoderclicn")
16865
+ },
16866
+ "kimi-code": {
16867
+ url: "https://moonshotai.github.io/kimi-code/en/guides/getting-started.html",
16868
+ commands: shells(
16869
+ "curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash",
16870
+ "irm https://code.kimi.com/kimi-code/install.ps1 | iex"
16871
+ ),
16872
+ before: ["On Windows, install Git for Windows first.", "Windows \u8BF7\u5148\u5B89\u88C5 Git for Windows\u3002"],
16873
+ after: start("kimi")
16808
16874
  }
16809
16875
  };
16810
16876
  function harnessInstallationGuide(agent, locale) {
@@ -17132,6 +17198,12 @@ ${error51.stderrTail}`] : []
17132
17198
  inspector.replaceChildren(createInspectorHeader(document2, item, messages));
17133
17199
  const body = document2.createElement("div");
17134
17200
  body.className = "settings-connection-inspector__body";
17201
+ if (item.agentSnapshot?.agent === "deepseek-harness") {
17202
+ const compatibility = document2.createElement("p");
17203
+ compatibility.className = "settings-connection-compatibility";
17204
+ compatibility.textContent = messages.connectionDeepSeekTestedVersions;
17205
+ body.append(compatibility);
17206
+ }
17135
17207
  if (item.agentSnapshot?.availability === "notInstalled") {
17136
17208
  const callout = document2.createElement("div");
17137
17209
  callout.className = "settings-connection-install-callout";
@@ -17904,6 +17976,7 @@ ${error51.stderrTail}`] : []
17904
17976
  launchPathSaveError: "Could not save. Enter an existing absolute installation folder on this Host and check configuration permissions.",
17905
17977
  connectionOpenInstallation: "Show installation instructions",
17906
17978
  connectionOpenHarnessWeb: "Open DeepSeek Harness Web",
17979
+ connectionDeepSeekTestedVersions: "Tested with DSH 0.1.2-rc.1, 0.1.5-rc.1 and 0.1.5-rc.2. Other versions may connect, but have not been verified.",
17907
17980
  connectionInstall: "Install",
17908
17981
  connectionInstallDescription: "This Harness was not detected.",
17909
17982
  connectionErrorTitle: "Connection check failed",
@@ -17944,7 +18017,8 @@ ${error51.stderrTail}`] : []
17944
18017
  updateWaitingForExit: "Waiting for the application to close...",
17945
18018
  updateInstalling: "Installing update...",
17946
18019
  updateInstallingNpm: "Installing update through npm...",
17947
- updateRequestTimeout: "The update service did not respond. Try again.",
18020
+ updateRequestTimeout: "The update service did not respond. Download the latest version from GitHub Releases below.",
18021
+ updateServiceUnavailable: "Automatic updates are unavailable right now. Download the latest version from GitHub Releases below.",
17948
18022
  updateRestarting: "Restarting to finish the update...",
17949
18023
  updateSucceeded: "Update installed successfully.",
17950
18024
  updateFailed: "Update failed.",
@@ -18141,6 +18215,7 @@ ${error51.stderrTail}`] : []
18141
18215
  launchPathSaveError: "\u4FDD\u5B58\u5931\u8D25\u3002\u8BF7\u586B\u5199\u6B64 Host \u4E0A\u5B9E\u9645\u5B58\u5728\u7684\u5B89\u88C5\u76EE\u5F55\u7EDD\u5BF9\u8DEF\u5F84\uFF0C\u5E76\u786E\u8BA4\u914D\u7F6E\u76EE\u5F55\u53EF\u5199\u3002",
18142
18216
  connectionOpenInstallation: "\u67E5\u770B\u5B89\u88C5\u6307\u5F15",
18143
18217
  connectionOpenHarnessWeb: "\u6253\u5F00 DeepSeek Harness Web",
18218
+ connectionDeepSeekTestedVersions: "\u5DF2\u5728 DSH 0.1.2-rc.1\u30010.1.5-rc.1 \u548C 0.1.5-rc.2 \u4E0A\u6D4B\u8BD5\u3002\u5176\u4ED6\u7248\u672C\u53EF\u4EE5\u5C1D\u8BD5\u8FDE\u63A5\uFF0C\u4F46\u5C1A\u672A\u9A8C\u8BC1\u3002",
18144
18219
  connectionInstall: "\u5B89\u88C5",
18145
18220
  connectionInstallDescription: "\u5C1A\u672A\u68C0\u6D4B\u5230\u8BE5 Harness\u3002",
18146
18221
  connectionErrorTitle: "\u8FDE\u63A5\u68C0\u67E5\u5931\u8D25",
@@ -18181,7 +18256,8 @@ ${error51.stderrTail}`] : []
18181
18256
  updateWaitingForExit: "\u6B63\u5728\u7B49\u5F85\u5E94\u7528\u9000\u51FA...",
18182
18257
  updateInstalling: "\u6B63\u5728\u5B89\u88C5\u66F4\u65B0...",
18183
18258
  updateInstallingNpm: "\u6B63\u5728\u901A\u8FC7 npm \u5B89\u88C5...",
18184
- updateRequestTimeout: "\u66F4\u65B0\u670D\u52A1\u672A\u54CD\u5E94\uFF0C\u8BF7\u91CD\u8BD5\u3002",
18259
+ updateRequestTimeout: "\u66F4\u65B0\u670D\u52A1\u672A\u54CD\u5E94\uFF0C\u8BF7\u901A\u8FC7\u4E0B\u65B9 GitHub Releases \u624B\u52A8\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u3002",
18260
+ updateServiceUnavailable: "\u6682\u65F6\u65E0\u6CD5\u81EA\u52A8\u66F4\u65B0\uFF0C\u8BF7\u901A\u8FC7\u4E0B\u65B9 GitHub Releases \u624B\u52A8\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u3002",
18185
18261
  updateRestarting: "\u6B63\u5728\u91CD\u542F\u4EE5\u5B8C\u6210\u66F4\u65B0...",
18186
18262
  updateSucceeded: "\u66F4\u65B0\u5B89\u88C5\u6210\u529F\u3002",
18187
18263
  updateFailed: "\u66F4\u65B0\u5931\u8D25\u3002",
@@ -18264,7 +18340,8 @@ ${error51.stderrTail}`] : []
18264
18340
  "cursor-cli": "https://cursor.com/docs/cli/installation",
18265
18341
  hermes: "https://hermes-agent.nousresearch.com/docs",
18266
18342
  qoder: "https://docs.qoder.com/",
18267
- "qoder-cn": "https://docs.qoder.cn/"
18343
+ "qoder-cn": "https://docs.qoder.cn/",
18344
+ "kimi-code": "https://moonshotai.github.io/kimi-code/en/guides/getting-started.html"
18268
18345
  };
18269
18346
  var CONTROL_ATTRIBUTE = "data-codexhost-agent-control";
18270
18347
  var AGENT_MENU_WIDTH = 224;
@@ -19687,26 +19764,30 @@ ${error51.stderrTail}`] : []
19687
19764
  harnessCommands: "Harness commands",
19688
19765
  commandsUnavailable: "No Harness commands available yet",
19689
19766
  commandRequiresConversation: "Start a conversation before running this command",
19767
+ commandMenuHint: "Type # for commands, skills and agents",
19690
19768
  textArgument: "Text",
19691
19769
  permissionMode: "Permission mode",
19692
19770
  permissions: "Permissions",
19693
19771
  loadingPermissions: "Loading permissions...",
19694
19772
  selecting: "Selecting...",
19695
19773
  permissionsUnavailable: "Permissions unavailable",
19696
- permissionModeFixedAtCreate: "Grok fixes its Permission Mode when the Session is created. Start a new Thread to change it."
19774
+ permissionModeFixedAtCreate: "Grok fixes its Permission Mode when the Session is created. Start a new Thread to change it.",
19775
+ codexUsageGateUnavailable: "Could not separate this Harness from the Codex usage limit in this Desktop version. Codex usage limits still apply to sending."
19697
19776
  });
19698
19777
  var CHINESE_HARNESS_MESSAGES = Object.freeze({
19699
19778
  commands: "\u547D\u4EE4",
19700
19779
  harnessCommands: "Harness \u547D\u4EE4",
19701
19780
  commandsUnavailable: "\u6682\u65E0\u53EF\u7528\u7684 Harness \u547D\u4EE4",
19702
19781
  commandRequiresConversation: "\u8BF7\u5148\u5F00\u59CB\u5BF9\u8BDD\uFF0C\u518D\u6267\u884C\u6B64\u547D\u4EE4",
19782
+ commandMenuHint: "\u8F93\u5165 # \u6253\u5F00\u547D\u4EE4\u3001\u6280\u80FD\u548C Agent",
19703
19783
  textArgument: "\u6587\u672C",
19704
19784
  permissionMode: "\u6743\u9650\u6A21\u5F0F",
19705
19785
  permissions: "\u6743\u9650",
19706
19786
  loadingPermissions: "\u6B63\u5728\u52A0\u8F7D\u6743\u9650...",
19707
19787
  selecting: "\u6B63\u5728\u9009\u62E9...",
19708
19788
  permissionsUnavailable: "\u6743\u9650\u4E0D\u53EF\u7528",
19709
- permissionModeFixedAtCreate: "Grok \u7684\u6743\u9650\u6A21\u5F0F\u5728\u4F1A\u8BDD\u521B\u5EFA\u65F6\u786E\u5B9A\uFF0C\u5982\u9700\u66F4\u6539\u8BF7\u65B0\u5EFA\u4F1A\u8BDD"
19789
+ permissionModeFixedAtCreate: "Grok \u7684\u6743\u9650\u6A21\u5F0F\u5728\u4F1A\u8BDD\u521B\u5EFA\u65F6\u786E\u5B9A\uFF0C\u5982\u9700\u66F4\u6539\u8BF7\u65B0\u5EFA\u4F1A\u8BDD",
19790
+ codexUsageGateUnavailable: "\u5F53\u524D Desktop \u7248\u672C\u65E0\u6CD5\u5C06\u6B64 Harness \u4E0E Codex \u989D\u5EA6\u9650\u5236\u5206\u79BB\uFF0C\u53D1\u9001\u4ECD\u53D7 Codex \u989D\u5EA6\u9650\u5236"
19710
19791
  });
19711
19792
  var ENGLISH_PERMISSION_MODE_LABELS = /* @__PURE__ */ new Map([
19712
19793
  ["read-only", "Read only"],
@@ -19825,6 +19906,10 @@ ${error51.stderrTail}`] : []
19825
19906
  description: mode.description === void 0 ? void 0 : CHINESE_PERMISSION_MODE_DESCRIPTIONS.get(mode.description) ?? mode.description
19826
19907
  };
19827
19908
  }
19909
+ function rendererLiveCommandsPendingNotice(locale, harnessLabel) {
19910
+ const harness = harnessLabel.replace(/\s*[((][^))]*[))]\s*$/u, "").trim() || harnessLabel;
19911
+ return locale === "zh-CN" ? `\u53D1\u9001\u4E00\u6761\u6D88\u606F\u540E\uFF0C\u4F1A\u52A0\u8F7D ${harness} \u5728\u5F53\u524D\u9879\u76EE\u7684\u5168\u90E8\u547D\u4EE4\u548C\u6280\u80FD` : `Send a message to load all ${harness} commands and skills for this project`;
19912
+ }
19828
19913
 
19829
19914
  // src/renderer-permission-mode-picker.ts
19830
19915
  var MENU_CLASSES2 = "fixed z-50 overflow-hidden rounded-lg bg-token-dropdown-background/95 text-token-foreground shadow-lg ring-[0.5px] ring-token-border backdrop-blur-xl";
@@ -20907,71 +20992,15 @@ ${error51.stderrTail}`] : []
20907
20992
  return true;
20908
20993
  }
20909
20994
 
20910
- // src/renderer-harness-command-claim.ts
20911
- function inputEvent(editor, text) {
20912
- const view = editor.ownerDocument.defaultView;
20913
- return view?.InputEvent ? new view.InputEvent("input", {
20914
- bubbles: true,
20915
- composed: true,
20916
- data: text,
20917
- inputType: "insertText"
20918
- }) : new (view?.Event ?? Event)("input", { bubbles: true, composed: true });
20919
- }
20920
- function prependTextarea(editor, prefix) {
20921
- const view = editor.ownerDocument.defaultView;
20922
- if (!view || !(editor instanceof view.HTMLTextAreaElement)) return false;
20923
- const setter = Object.getOwnPropertyDescriptor(view.HTMLTextAreaElement.prototype, "value")?.set;
20924
- if (!setter) return false;
20925
- const start2 = editor.selectionStart;
20926
- const end = editor.selectionEnd;
20927
- setter.call(editor, prefix + editor.value);
20928
- editor.dispatchEvent(inputEvent(editor, prefix));
20929
- editor.focus({ preventScroll: true });
20930
- if (start2 !== null && end !== null) {
20931
- editor.setSelectionRange(start2 + prefix.length, end + prefix.length);
20932
- }
20933
- return true;
20934
- }
20935
- function prependContentEditable(editor, prefix) {
20936
- if (editor.getAttribute("contenteditable") !== "true") return false;
20937
- const document2 = editor.ownerDocument;
20938
- const selection = document2.getSelection();
20939
- if (!selection || typeof document2.execCommand !== "function") return false;
20940
- const range = document2.createRange();
20941
- range.selectNodeContents(editor);
20942
- range.collapse(true);
20943
- editor.focus({ preventScroll: true });
20944
- selection.removeAllRanges();
20945
- selection.addRange(range);
20946
- return document2.execCommand("insertText", false, prefix);
20947
- }
20948
- function prependEditor(editor, prefix) {
20949
- return prependTextarea(editor, prefix) || prependContentEditable(editor, prefix);
20950
- }
20951
- function rendererHarnessCommandExecutesDirectly(command) {
20952
- return command.invocation === "/compact" || command.argumentMode === "none";
20953
- }
20954
- function routeRendererHarnessCommandSelection(editor, command, execute) {
20955
- if (rendererHarnessCommandExecutesDirectly(command)) {
20956
- execute();
20957
- return true;
20958
- }
20959
- return editor !== null && prependEditor(editor, `${command.invocation} `);
20960
- }
20961
-
20962
20995
  // src/renderer-harness-command-control.ts
20963
20996
  var CONTROL_ATTRIBUTE2 = "data-codexhost-harness-command-control";
20964
- var MENU_ATTRIBUTE = "data-codexhost-harness-command-menu";
20965
- var MENU_WIDTH = 320;
20966
- var VIEWPORT_MARGIN = 8;
20967
- var MENU_GAP2 = 8;
20968
20997
  var SVG_NS2 = "http://www.w3.org/2000/svg";
20969
20998
  var COMMAND_ICON_PATHS = [
20970
20999
  "M409.6 377.6h204.8a32 32 0 0 1 32 32v204.8a32 32 0 0 1-32 32H409.6a32 32 0 0 1-32-32V409.6a32 32 0 0 1 32-32z m172.8 64h-140.8v140.8h140.8z",
20971
21000
  "M332.8 800a108.8 108.8 0 0 1 0-217.6h76.8a32 32 0 0 1 32 32v76.8a108.928 108.928 0 0 1-108.8 108.8z m0-153.6a44.8 44.8 0 1 0 44.8 44.8v-44.8zM409.6 441.6H332.8a108.8 108.8 0 1 1 108.8-108.8v76.8a32 32 0 0 1-32 32z m-76.8-153.6a44.8 44.8 0 0 0 0 89.6h44.8V332.8A44.842667 44.842667 0 0 0 332.8 288zM691.2 441.6h-76.8a32 32 0 0 1-32-32V332.8a108.8 108.8 0 1 1 108.8 108.8z m-44.8-64h44.8a44.8 44.8 0 1 0-44.8-44.8zM691.2 800a108.928 108.928 0 0 1-108.8-108.8v-76.8a32 32 0 0 1 32-32h76.8a108.8 108.8 0 0 1 0 217.6z m-44.8-153.6v44.8a44.8 44.8 0 1 0 44.8-44.8z",
20972
21001
  "M640 970.666667H384c-118.186667 0-198.272-25.002667-251.946667-78.72S53.333333 758.186667 53.333333 640V384c0-118.186667 25.002667-198.272 78.72-251.946667S265.813333 53.333333 384 53.333333h256c118.186667 0 198.272 25.002667 251.946667 78.72S970.666667 265.813333 970.666667 384v256c0 118.186667-25.002667 198.272-78.72 251.946667S758.186667 970.666667 640 970.666667z m-256-853.333334c-100.096 0-165.802667 19.2-206.72 59.946667S117.333333 283.904 117.333333 384v256c0 100.096 19.072 165.802667 59.946667 206.72S283.904 906.666667 384 906.666667h256c100.096 0 165.802667-19.072 206.72-59.946667S906.666667 740.096 906.666667 640V384c0-100.096-19.072-165.802667-59.946667-206.72S740.096 117.333333 640 117.333333z"
20973
21002
  ];
20974
- function commandIcon(ownerDocument) {
21003
+ function createHarnessCommandIcon(ownerDocument) {
20975
21004
  const svg = ownerDocument.createElementNS(SVG_NS2, "svg");
20976
21005
  svg.setAttribute("viewBox", "0 0 1024 1024");
20977
21006
  svg.setAttribute("width", "15");
@@ -20985,85 +21014,25 @@ ${error51.stderrTail}`] : []
20985
21014
  }
20986
21015
  return svg;
20987
21016
  }
20988
- function menuItem(ownerDocument, command, locale, messages, onSelect, disabledReason) {
20989
- const presentation = rendererHarnessCommandPresentation(command, locale);
20990
- const item = ownerDocument.createElement("button");
20991
- item.type = "button";
20992
- if (disabledReason) {
20993
- item.disabled = true;
20994
- item.title = disabledReason;
20995
- item.style.opacity = "0.5";
20996
- }
20997
- item.setAttribute("role", "menuitem");
20998
- item.setAttribute("data-command-id", command.id);
20999
- item.setAttribute("aria-label", `${command.invocation} ${presentation.label}`);
21000
- item.style.display = "flex";
21001
- item.style.alignItems = "center";
21002
- item.style.width = "100%";
21003
- item.style.minHeight = "38px";
21004
- item.style.gap = "8px";
21005
- item.style.padding = "6px 8px";
21006
- item.style.border = "0";
21007
- item.style.borderRadius = "6px";
21008
- item.style.background = "transparent";
21009
- item.style.color = "inherit";
21010
- item.style.textAlign = "left";
21011
- item.style.cursor = "pointer";
21012
- const updateHighlight = (active) => {
21013
- item.style.background = active ? "rgba(127, 127, 127, 0.12)" : "transparent";
21014
- };
21015
- item.addEventListener("pointerenter", () => updateHighlight(true));
21016
- item.addEventListener("pointerleave", () => updateHighlight(false));
21017
- item.addEventListener("focus", () => updateHighlight(true));
21018
- item.addEventListener("blur", () => updateHighlight(false));
21019
- item.addEventListener("click", onSelect);
21020
- const copy = ownerDocument.createElement("span");
21021
- copy.style.display = "flex";
21022
- copy.style.flexDirection = "column";
21023
- copy.style.minWidth = "0";
21024
- copy.style.flex = "1 1 auto";
21025
- const title = ownerDocument.createElement("span");
21026
- title.textContent = command.invocation;
21027
- title.style.font = "600 13px/18px system-ui, sans-serif";
21028
- title.style.whiteSpace = "nowrap";
21029
- const description = ownerDocument.createElement("span");
21030
- description.textContent = disabledReason ?? presentation.description;
21031
- description.style.overflow = "hidden";
21032
- description.style.color = "rgba(127, 127, 127, 0.9)";
21033
- description.style.font = "400 11px/16px system-ui, sans-serif";
21034
- description.style.textOverflow = "ellipsis";
21035
- description.style.whiteSpace = "nowrap";
21036
- const hint = ownerDocument.createElement("span");
21037
- hint.textContent = rendererHarnessCommandExecutesDirectly(command) ? "\u21B5" : messages.textArgument;
21038
- hint.style.flex = "0 0 auto";
21039
- hint.style.color = "rgba(127, 127, 127, 0.75)";
21040
- hint.style.font = "400 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace";
21041
- copy.append(title, description);
21042
- item.append(copy, hint);
21043
- return item;
21044
- }
21045
- function clamp(value, minimum, maximum) {
21046
- return Math.max(minimum, Math.min(value, maximum));
21047
- }
21048
- function setButtonClass(button) {
21049
- button.style.display = "inline-flex";
21050
- button.style.alignItems = "center";
21051
- button.style.justifyContent = "center";
21052
- button.style.gap = "0";
21053
- button.style.width = "28px";
21054
- button.style.height = "28px";
21055
- button.style.padding = "0";
21056
- button.style.border = "0";
21057
- button.style.borderRadius = "8px";
21058
- button.style.background = "transparent";
21059
- button.style.color = "inherit";
21060
- button.style.cursor = "pointer";
21061
- button.style.whiteSpace = "nowrap";
21062
- }
21063
- function mountRendererHarnessCommandControl(parent, insertBefore, onCommandSelected, initialLocale = "en") {
21017
+ function styleButton(button) {
21018
+ Object.assign(button.style, {
21019
+ display: "inline-flex",
21020
+ alignItems: "center",
21021
+ justifyContent: "center",
21022
+ width: "28px",
21023
+ height: "28px",
21024
+ padding: "0",
21025
+ border: "0",
21026
+ borderRadius: "8px",
21027
+ background: "transparent",
21028
+ color: "inherit",
21029
+ cursor: "pointer"
21030
+ });
21031
+ }
21032
+ function mountRendererHarnessCommandControl(parent, insertBefore, onOpenMenu, initialLocale = "en") {
21064
21033
  const ownerDocument = parent.ownerDocument;
21034
+ let messages = rendererHarnessMessages(initialLocale);
21065
21035
  let locale = initialLocale;
21066
- let messages = rendererHarnessMessages(locale);
21067
21036
  const root = ownerDocument.createElement("div");
21068
21037
  root.setAttribute(CONTROL_ATTRIBUTE2, "true");
21069
21038
  root.style.display = "inline-flex";
@@ -21071,190 +21040,39 @@ ${error51.stderrTail}`] : []
21071
21040
  root.style.minWidth = "0";
21072
21041
  const trigger = ownerDocument.createElement("button");
21073
21042
  trigger.type = "button";
21074
- trigger.setAttribute("aria-haspopup", "menu");
21075
- trigger.setAttribute("aria-expanded", "false");
21076
- trigger.setAttribute("aria-label", messages.harnessCommands);
21077
- trigger.title = messages.harnessCommands;
21078
- setButtonClass(trigger);
21079
- trigger.append(commandIcon(ownerDocument));
21043
+ styleButton(trigger);
21044
+ trigger.append(createHarnessCommandIcon(ownerDocument));
21080
21045
  root.append(trigger);
21081
- const menu = ownerDocument.createElement("div");
21082
- menu.setAttribute(MENU_ATTRIBUTE, "true");
21083
- menu.setAttribute("role", "menu");
21084
- menu.setAttribute("aria-label", messages.harnessCommands);
21085
- menu.hidden = true;
21086
- menu.style.position = "fixed";
21087
- menu.style.inset = "auto";
21088
- menu.style.zIndex = "2147483647";
21089
- menu.style.width = `${MENU_WIDTH}px`;
21090
- menu.style.maxWidth = `calc(100vw - ${VIEWPORT_MARGIN * 2}px)`;
21091
- menu.style.maxHeight = "min(360px, calc(100vh - 16px))";
21092
- menu.style.overflowY = "auto";
21093
- menu.style.padding = "4px";
21094
- menu.style.border = "1px solid rgba(127, 127, 127, 0.24)";
21095
- menu.style.borderRadius = "10px";
21096
- menu.style.background = "Canvas";
21097
- menu.style.color = "CanvasText";
21098
- menu.style.boxShadow = "0 12px 32px rgba(0, 0, 0, 0.22)";
21099
- ownerDocument.body.append(menu);
21100
- if (insertBefore?.parentElement === parent) parent.insertBefore(root, insertBefore);
21101
- else parent.append(root);
21102
21046
  let commands = [];
21103
- let items = [];
21104
- let activeIndex = 0;
21105
- let executingCommandId = null;
21106
21047
  let hasSession = true;
21107
- let triggerHovered = false;
21108
- let disposed = false;
21109
- const positionMenu2 = () => {
21110
- const rect = trigger.getBoundingClientRect();
21111
- const menuHeight = menu.getBoundingClientRect().height;
21112
- const opensAbove = rect.top >= menuHeight + MENU_GAP2 + VIEWPORT_MARGIN;
21113
- const left = clamp(
21114
- rect.left,
21115
- VIEWPORT_MARGIN,
21116
- window.innerWidth - MENU_WIDTH - VIEWPORT_MARGIN
21117
- );
21118
- menu.style.left = `${left}px`;
21119
- menu.style.top = opensAbove ? `${Math.max(VIEWPORT_MARGIN, rect.top - menuHeight - MENU_GAP2)}px` : `${Math.min(window.innerHeight - menuHeight - VIEWPORT_MARGIN, rect.bottom + MENU_GAP2)}px`;
21120
- };
21121
- const focusActive = (direction = 1) => {
21122
- if (items.length === 0 || items.every((item2) => item2.disabled)) return;
21123
- while (items[activeIndex]?.disabled) {
21124
- activeIndex = (activeIndex + direction + items.length) % items.length;
21125
- }
21126
- const item = items[activeIndex];
21127
- if (!item) return;
21128
- item.focus();
21129
- item.scrollIntoView({ block: "nearest" });
21130
- };
21131
- const syncTriggerBackground = () => {
21132
- trigger.style.background = !trigger.disabled && (triggerHovered || !menu.hidden) ? "rgba(127, 127, 127, 0.16)" : "transparent";
21133
- };
21134
- const syncTriggerState = () => {
21135
- trigger.disabled = commands.length === 0 || executingCommandId !== null;
21136
- trigger.style.opacity = trigger.disabled ? "0.65" : "1";
21137
- trigger.title = commands.length === 0 ? messages.commandsUnavailable : messages.harnessCommands;
21138
- syncTriggerBackground();
21139
- };
21140
- const close = () => {
21141
- menu.hidden = true;
21142
- trigger.setAttribute("aria-expanded", "false");
21143
- syncTriggerBackground();
21144
- };
21145
- const open = (shouldFocus = true) => {
21146
- if (commands.length === 0 || executingCommandId !== null) return;
21147
- menu.hidden = false;
21148
- positionMenu2();
21149
- trigger.setAttribute("aria-expanded", "true");
21150
- syncTriggerBackground();
21151
- if (shouldFocus) queueMicrotask(focusActive);
21152
- };
21153
- let closeTimer = null;
21154
- const cancelClose = () => {
21155
- if (closeTimer === null) return;
21156
- window.clearTimeout(closeTimer);
21157
- closeTimer = null;
21158
- };
21159
- const scheduleClose = () => {
21160
- cancelClose();
21161
- closeTimer = window.setTimeout(() => {
21162
- closeTimer = null;
21163
- if (!trigger.matches(":hover") && !menu.matches(":hover")) close();
21164
- }, 140);
21165
- };
21166
- const select = (command) => {
21167
- close();
21168
- onCommandSelected(command);
21169
- };
21170
- const renderItems = () => {
21171
- menu.replaceChildren();
21172
- const header = ownerDocument.createElement("div");
21173
- header.textContent = messages.commands;
21174
- header.style.padding = "5px 8px 4px";
21175
- header.style.color = "rgba(127, 127, 127, 0.75)";
21176
- header.style.font = "600 11px/16px system-ui, sans-serif";
21177
- menu.append(header);
21178
- items = commands.map(
21179
- (command) => menuItem(
21180
- ownerDocument,
21181
- command,
21182
- locale,
21183
- messages,
21184
- () => select(command),
21185
- !hasSession && rendererHarnessCommandExecutesDirectly(command) ? messages.commandRequiresConversation : void 0
21186
- )
21187
- );
21188
- menu.append(...items);
21189
- activeIndex = Math.min(activeIndex, Math.max(0, items.length - 1));
21190
- if (executingCommandId !== null) {
21191
- for (const item of items) {
21192
- const isExecuting = item.dataset.commandId === executingCommandId;
21193
- item.disabled = true;
21194
- item.style.opacity = isExecuting ? "1" : "0.5";
21195
- if (isExecuting) item.setAttribute("aria-busy", "true");
21196
- }
21197
- }
21198
- };
21199
- const onTriggerKeyDown = (event) => {
21200
- if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
21201
- event.preventDefault();
21202
- open();
21203
- }
21204
- };
21205
- const onMenuKeyDown = (event) => {
21206
- if (event.key === "Escape") {
21207
- event.preventDefault();
21208
- close();
21209
- trigger.focus();
21210
- return;
21211
- }
21212
- if (event.key === "ArrowDown" || event.key === "ArrowUp") {
21213
- event.preventDefault();
21214
- const delta = event.key === "ArrowDown" ? 1 : -1;
21215
- activeIndex = (activeIndex + delta + items.length) % items.length;
21216
- focusActive(delta);
21217
- return;
21218
- }
21219
- if (event.key === "Enter") {
21220
- event.preventDefault();
21221
- items[activeIndex]?.click();
21222
- }
21223
- };
21224
- const onDocumentPointerDown = (event) => {
21225
- if (!menu.hidden && !root.contains(event.target) && !menu.contains(event.target)) {
21226
- close();
21227
- }
21228
- };
21229
- const onViewportChange = () => {
21230
- if (!menu.hidden) positionMenu2();
21231
- };
21232
- trigger.addEventListener("click", () => {
21233
- cancelClose();
21234
- open(true);
21235
- });
21236
- trigger.addEventListener("pointerenter", () => {
21237
- triggerHovered = true;
21238
- syncTriggerBackground();
21239
- cancelClose();
21240
- if (menu.hidden) open(false);
21241
- });
21242
- trigger.addEventListener("pointerleave", () => {
21243
- triggerHovered = false;
21244
- syncTriggerBackground();
21245
- scheduleClose();
21246
- });
21247
- trigger.addEventListener("keydown", onTriggerKeyDown);
21248
- menu.addEventListener("pointerenter", cancelClose);
21249
- menu.addEventListener("pointerleave", scheduleClose);
21250
- menu.addEventListener("keydown", onMenuKeyDown);
21251
- ownerDocument.addEventListener("pointerdown", onDocumentPointerDown, true);
21252
- ownerDocument.defaultView?.addEventListener("resize", onViewportChange);
21253
- ownerDocument.defaultView?.addEventListener("scroll", onViewportChange, true);
21254
- const control = {
21048
+ let source;
21049
+ let executingCommandId = null;
21050
+ let hovered = false;
21051
+ const syncTrigger = () => {
21052
+ trigger.setAttribute("aria-label", messages.commandMenuHint);
21053
+ trigger.title = messages.commandMenuHint;
21054
+ trigger.style.background = hovered ? "rgba(127, 127, 127, 0.16)" : "transparent";
21055
+ };
21056
+ const onMouseDown = (event) => event.preventDefault();
21057
+ const onClick = () => onOpenMenu();
21058
+ const onEnter = () => {
21059
+ hovered = true;
21060
+ syncTrigger();
21061
+ };
21062
+ const onLeave = () => {
21063
+ hovered = false;
21064
+ syncTrigger();
21065
+ };
21066
+ trigger.addEventListener("mousedown", onMouseDown);
21067
+ trigger.addEventListener("click", onClick);
21068
+ trigger.addEventListener("pointerenter", onEnter);
21069
+ trigger.addEventListener("pointerleave", onLeave);
21070
+ if (insertBefore?.parentElement === parent) parent.insertBefore(root, insertBefore);
21071
+ else parent.append(root);
21072
+ syncTrigger();
21073
+ return {
21255
21074
  root,
21256
21075
  trigger,
21257
- menu,
21258
21076
  placeBefore(reference) {
21259
21077
  if (!reference?.parentElement) return false;
21260
21078
  if (root.parentElement === reference.parentElement && root.nextElementSibling === reference) {
@@ -21263,46 +21081,31 @@ ${error51.stderrTail}`] : []
21263
21081
  reference.parentElement.insertBefore(root, reference);
21264
21082
  return true;
21265
21083
  },
21266
- setCommands(nextCommands, nextHasSession = true) {
21084
+ setCommands(nextCommands, nextHasSession = true, nextSource) {
21267
21085
  commands = [...nextCommands];
21268
21086
  hasSession = nextHasSession;
21269
- if (commands.length === 0) close();
21270
- renderItems();
21271
- syncTriggerState();
21087
+ source = nextSource;
21088
+ },
21089
+ snapshot() {
21090
+ return { commands, hasSession, executingCommandId, source };
21272
21091
  },
21273
21092
  setExecuting(commandId) {
21274
21093
  executingCommandId = commandId;
21275
- renderItems();
21276
- syncTriggerState();
21277
21094
  },
21278
21095
  setLocale(nextLocale) {
21279
21096
  if (locale === nextLocale) return;
21280
21097
  locale = nextLocale;
21281
21098
  messages = rendererHarnessMessages(locale);
21282
- trigger.setAttribute("aria-label", messages.harnessCommands);
21283
- menu.setAttribute("aria-label", messages.harnessCommands);
21284
- renderItems();
21285
- syncTriggerState();
21099
+ syncTrigger();
21286
21100
  },
21287
- close,
21288
21101
  dispose() {
21289
- if (disposed) return;
21290
- disposed = true;
21291
- cancelClose();
21292
- close();
21293
- ownerDocument.removeEventListener("pointerdown", onDocumentPointerDown, true);
21294
- ownerDocument.defaultView?.removeEventListener("resize", onViewportChange);
21295
- ownerDocument.defaultView?.removeEventListener("scroll", onViewportChange, true);
21296
- trigger.removeEventListener("keydown", onTriggerKeyDown);
21297
- menu.removeEventListener("pointerenter", cancelClose);
21298
- menu.removeEventListener("pointerleave", scheduleClose);
21299
- menu.removeEventListener("keydown", onMenuKeyDown);
21300
- menu.remove();
21102
+ trigger.removeEventListener("mousedown", onMouseDown);
21103
+ trigger.removeEventListener("click", onClick);
21104
+ trigger.removeEventListener("pointerenter", onEnter);
21105
+ trigger.removeEventListener("pointerleave", onLeave);
21301
21106
  root.remove();
21302
21107
  }
21303
21108
  };
21304
- syncTriggerState();
21305
- return control;
21306
21109
  }
21307
21110
 
21308
21111
  // src/renderer-composer-dom.ts
@@ -21515,14 +21318,41 @@ ${error51.stderrTail}`] : []
21515
21318
  const root = control.permissionModePicker?.root;
21516
21319
  return root?.parentElement ? root : null;
21517
21320
  }
21321
+ function lastNativeButtonWithin(composer) {
21322
+ const buttons = [...composer.querySelectorAll("button")];
21323
+ for (let index = buttons.length - 1; index >= 0; index -= 1) {
21324
+ const button = buttons[index];
21325
+ if (button && !isInsideOwnedRendererControl(button, composer)) return button;
21326
+ }
21327
+ return null;
21328
+ }
21329
+ function isInsideOwnedRendererControl(element, composer) {
21330
+ for (let node2 = element; node2 && node2 !== composer; node2 = node2.parentElement) {
21331
+ if (typeof node2.hasAttribute === "function" && isOwnedRendererControl(node2)) return true;
21332
+ }
21333
+ return false;
21334
+ }
21335
+ function refreshSendButton(control) {
21336
+ const current = control.sendButton;
21337
+ if (current?.isConnected && control.composer.contains(current)) return current;
21338
+ const replacement = sendButtonWithin(control.composer) ?? (current && !isComposerSubmitButton(current) ? lastNativeButtonWithin(control.composer) : null);
21339
+ if (!replacement) return null;
21340
+ if (control.sendDisabledBeforeSwitch !== null) {
21341
+ control.sendDisabledBeforeSwitch = replacement.disabled;
21342
+ replacement.disabled = true;
21343
+ }
21344
+ control.sendButton = replacement;
21345
+ return replacement;
21346
+ }
21518
21347
  function refreshTrailingClusterPlacement(control) {
21519
- const sendButton = control.sendButton;
21348
+ const sendButton = refreshSendButton(control);
21520
21349
  const modelRoot = control.modelPicker?.root;
21521
21350
  const agentRoot = control.root ?? control.picker?.root;
21522
21351
  if (!sendButton || !modelRoot || !agentRoot) return;
21523
21352
  const anchor = trailingActionAnchor(sendButton);
21524
21353
  const parent = anchor.parentElement;
21525
21354
  if (!parent || typeof parent.insertBefore !== "function") return;
21355
+ if (!parent.isConnected || !control.composer.contains(parent)) return;
21526
21356
  if (modelRoot.parentElement === parent && agentRoot.parentElement === parent && modelRoot.nextElementSibling === agentRoot && agentRoot.nextElementSibling === anchor) {
21527
21357
  return;
21528
21358
  }
@@ -21592,7 +21422,7 @@ ${error51.stderrTail}`] : []
21592
21422
  setNativeControlHidden(control.nativeContextUsageControl, false);
21593
21423
  setNativeControlHidden(control.nativePermissionModeControl, hidePermissionMode);
21594
21424
  }
21595
- function mountComposerAgentControl(composer, composerId, sendButton, enabledAgents, onSelect, onDownload, onOpenProviderPicker, onSelectModel, onSelectThinking, onSelectPermissionMode, onSelectCommand) {
21425
+ function mountComposerAgentControl(composer, composerId, sendButton, enabledAgents, onSelect, onDownload, onOpenProviderPicker, onSelectModel, onSelectThinking, onSelectPermissionMode, onOpenCommandMenu) {
21596
21426
  if (composer instanceof HTMLElement) composer.style.minWidth = "0";
21597
21427
  const nativeModelControl = captureNativeControl(nativeModelControlForComposer(composer));
21598
21428
  const nativeContextUsageControl = captureNativeControl(
@@ -21618,7 +21448,7 @@ ${error51.stderrTail}`] : []
21618
21448
  const harnessCommands = mountRendererHarnessCommandControl(
21619
21449
  toolbar ?? composer,
21620
21450
  trailingActionAnchor(sendButton),
21621
- onSelectCommand
21451
+ onOpenCommandMenu
21622
21452
  );
21623
21453
  const permissionParent = nativePermissionModeControl?.element.parentElement;
21624
21454
  if (permissionParent && nativePermissionModeControl && nativePermissionModeControlVerified) {
@@ -21649,6 +21479,11 @@ ${error51.stderrTail}`] : []
21649
21479
  refreshCreditsPlacement(control);
21650
21480
  return control;
21651
21481
  }
21482
+ function nativeSendDisabled(button, fallback) {
21483
+ const key = Object.getOwnPropertyNames(button).find((name) => name.startsWith("__reactProps$"));
21484
+ const props = key ? Object.getOwnPropertyDescriptor(button, key)?.value : void 0;
21485
+ return typeof props === "object" && props !== null && "disabled" in props && typeof props.disabled === "boolean" ? props.disabled : fallback;
21486
+ }
21652
21487
  function renderComposerAgentControl(control, state, adapterState, switching, availability = {}, modelView = { status: "idle" }, permissionModeView = { status: "idle" }, usage = null, accountCredits = null, locale = "en", currentCodexAccount = null, ownershipError = false) {
21653
21488
  if (control.usage === null) {
21654
21489
  control.usage = mountRendererUsageControl(control.composerId, locale);
@@ -21667,7 +21502,10 @@ ${error51.stderrTail}`] : []
21667
21502
  control.sendDisabledBeforeSwitch = control.sendButton.disabled;
21668
21503
  control.sendButton.disabled = true;
21669
21504
  } else if (!submissionBlocked && control.sendDisabledBeforeSwitch !== null) {
21670
- control.sendButton.disabled = control.sendDisabledBeforeSwitch;
21505
+ control.sendButton.disabled = nativeSendDisabled(
21506
+ control.sendButton,
21507
+ control.sendDisabledBeforeSwitch
21508
+ );
21671
21509
  control.sendDisabledBeforeSwitch = null;
21672
21510
  }
21673
21511
  const pickerView = renderRendererAgentPicker(
@@ -21704,12 +21542,15 @@ ${error51.stderrTail}`] : []
21704
21542
  control.harnessCommands.setLocale(locale);
21705
21543
  control.harnessCommands.root.hidden = state.agent === "codex";
21706
21544
  control.harnessCommands.root.style.display = state.agent === "codex" ? "none" : "inline-flex";
21707
- if (state.agent === "codex") control.harnessCommands.close();
21708
21545
  renderRendererCreditsControl(control.credits, accountCredits, locale);
21546
+ return state.agent !== "codex" && adapterState === "ready" && !submissionBlocked;
21709
21547
  }
21710
21548
  function disposeComposerAgentControl(control) {
21711
21549
  if (control.sendDisabledBeforeSwitch !== null) {
21712
- control.sendButton.disabled = control.sendDisabledBeforeSwitch;
21550
+ control.sendButton.disabled = nativeSendDisabled(
21551
+ control.sendButton,
21552
+ control.sendDisabledBeforeSwitch
21553
+ );
21713
21554
  }
21714
21555
  restoreNativeControl(control.nativeModelControl);
21715
21556
  restoreNativeControl(control.nativeContextUsageControl);
@@ -21835,6 +21676,270 @@ ${error51.stderrTail}`] : []
21835
21676
  }
21836
21677
  };
21837
21678
 
21679
+ // ../desktop-control/dist/renderer-react-ownership.js
21680
+ function committedReactAncestors(value) {
21681
+ const MAX_VISITED_FIBERS = 2e4;
21682
+ const fiber = (value2) => typeof value2 === "object" && value2 !== null ? value2 : null;
21683
+ const first = fiber(value);
21684
+ if (!first)
21685
+ return [];
21686
+ const previous = [];
21687
+ const seen = /* @__PURE__ */ new Set();
21688
+ for (let node2 = first; node2; node2 = fiber(node2.return)) {
21689
+ if (seen.has(node2) || seen.size >= MAX_VISITED_FIBERS)
21690
+ return [];
21691
+ seen.add(node2);
21692
+ previous.push(node2);
21693
+ }
21694
+ const rootState = fiber(previous.at(-1)?.stateNode);
21695
+ if (!rootState || !("current" in rootState))
21696
+ return previous;
21697
+ const current = fiber(rootState.current);
21698
+ if (!current)
21699
+ return [];
21700
+ const stack = [{ node: current, parent: null }];
21701
+ const alternate = fiber(first.alternate);
21702
+ seen.clear();
21703
+ while (stack.length > 0 && seen.size < MAX_VISITED_FIBERS) {
21704
+ const entry = stack.pop();
21705
+ if (!entry)
21706
+ break;
21707
+ if (seen.has(entry.node))
21708
+ return [];
21709
+ seen.add(entry.node);
21710
+ if (entry.node === first || entry.node === alternate) {
21711
+ const ancestors = [];
21712
+ for (let cursor = entry; cursor; cursor = cursor.parent)
21713
+ ancestors.push(cursor.node);
21714
+ return ancestors;
21715
+ }
21716
+ const sibling = entry.parent && fiber(entry.node.sibling);
21717
+ if (sibling)
21718
+ stack.push({ node: sibling, parent: entry.parent });
21719
+ const child = fiber(entry.node.child);
21720
+ if (child)
21721
+ stack.push({ node: child, parent: entry });
21722
+ }
21723
+ return [];
21724
+ }
21725
+
21726
+ // src/renderer-codex-usage-gate.ts
21727
+ var EDITOR_SELECTOR2 = '[contenteditable="true"][role="textbox"]';
21728
+ var MAX_HOOKS = 4096;
21729
+ var MAX_DOM_DEPTH = 12;
21730
+ var RETRY_DELAY_MS = 1e3;
21731
+ function isRecord2(value) {
21732
+ return typeof value === "object" && value !== null && !Array.isArray(value);
21733
+ }
21734
+ function hooksOf(fiber) {
21735
+ const result = [];
21736
+ let hook = isRecord2(fiber) ? fiber.memoizedState : null;
21737
+ while (isRecord2(hook) && result.length < MAX_HOOKS) {
21738
+ result.push(hook);
21739
+ hook = hook.next;
21740
+ }
21741
+ return hook == null ? result : [];
21742
+ }
21743
+ function submitOwners(composer) {
21744
+ let element = composer.querySelector(EDITOR_SELECTOR2) ?? composer;
21745
+ for (let depth = 0; element && depth < MAX_DOM_DEPTH; depth += 1) {
21746
+ const key = Object.getOwnPropertyNames(element).find(
21747
+ (name) => name.startsWith("__reactFiber$")
21748
+ );
21749
+ if (key) {
21750
+ const owners = committedReactAncestors(
21751
+ Object.getOwnPropertyDescriptor(element, key)?.value
21752
+ ).filter(
21753
+ ({ memoizedProps: props }) => isRecord2(props) && "onLocalSubmitStart" in props && typeof props.submitDisabled === "boolean"
21754
+ );
21755
+ return owners;
21756
+ }
21757
+ element = element.parentElement;
21758
+ }
21759
+ return [];
21760
+ }
21761
+ function findSubmitOwner(composer) {
21762
+ const owners = submitOwners(composer);
21763
+ return owners.length === 1 ? owners[0] ?? null : null;
21764
+ }
21765
+ function subscriptionAt(hook) {
21766
+ const memo = hook.memoizedState;
21767
+ if (!Array.isArray(memo) || !Array.isArray(memo[1])) return null;
21768
+ const [subscriber, [store, atom]] = memo;
21769
+ const instance = hook.next?.queue;
21770
+ const effect = hook.next?.next?.memoizedState;
21771
+ if (!isRecord2(subscriber) || typeof subscriber.getSnapshot !== "function" || typeof subscriber.subscribe !== "function" || typeof subscriber.createRender === "function" && subscriber.createRender() != null || !isRecord2(store) || typeof store.get !== "function" || typeof store.sub !== "function" || !isRecord2(atom) || typeof atom.read !== "function" || "write" in atom || !isRecord2(instance) || typeof instance.value !== "boolean" || instance.getSnapshot !== subscriber.getSnapshot || !isRecord2(effect) || typeof effect.create !== "function" || !Array.isArray(effect.deps) || effect.deps[0] !== subscriber.subscribe) {
21772
+ return null;
21773
+ }
21774
+ return {
21775
+ subscriber,
21776
+ store,
21777
+ atom,
21778
+ instance,
21779
+ subscribeEffect: effect.create
21780
+ };
21781
+ }
21782
+ function gateKind({ store, atom }) {
21783
+ const read = /* @__PURE__ */ new Set();
21784
+ const trace = (value, prefix) => new Proxy(
21785
+ { ...value },
21786
+ {
21787
+ get(target, property, receiver) {
21788
+ if (typeof property === "string") read.add(`${prefix}.${property}`);
21789
+ return Reflect.get(target, property, receiver);
21790
+ }
21791
+ }
21792
+ );
21793
+ try {
21794
+ const native = store.get(atom);
21795
+ const replayed = atom.read((dependency) => {
21796
+ const value = store.get(dependency);
21797
+ if (!isRecord2(value)) return value;
21798
+ if (typeof value.hardBlocked === "boolean") return trace(value, "reserve");
21799
+ if ("authMethod" in value) return trace(value, "auth");
21800
+ if (isRecord2(value.data) && isRecord2(value.data.rate_limit)) {
21801
+ return {
21802
+ ...value,
21803
+ data: { ...value.data, rate_limit: trace(value.data.rate_limit, "limit") }
21804
+ };
21805
+ }
21806
+ return value;
21807
+ });
21808
+ if (typeof native !== "boolean" || replayed !== native) return null;
21809
+ } catch {
21810
+ return null;
21811
+ }
21812
+ if (read.has("reserve.hardBlocked") && !read.has("reserve.active")) return "reserve";
21813
+ if (read.has("auth.authMethod") && read.has("limit.allowed")) return "account";
21814
+ return null;
21815
+ }
21816
+ function gateSubscriptions(owner) {
21817
+ const found = { account: [], reserve: [] };
21818
+ for (const hook of hooksOf(owner)) {
21819
+ const subscription = subscriptionAt(hook);
21820
+ const kind = subscription && gateKind(subscription);
21821
+ if (subscription && kind) found[kind].push(subscription);
21822
+ }
21823
+ return found;
21824
+ }
21825
+ function discoverGates(owner) {
21826
+ const found = /* @__PURE__ */ new Map();
21827
+ for (const [kind, subscriptions] of Object.entries(gateSubscriptions(owner))) {
21828
+ if (subscriptions.length > 1) return null;
21829
+ if (subscriptions[0]) found.set(kind, subscriptions[0]);
21830
+ }
21831
+ return found;
21832
+ }
21833
+ function project({ subscriber, store, atom, instance, subscribeEffect }) {
21834
+ for (const [target, key] of [
21835
+ [store, "sub"],
21836
+ [subscriber, "getSnapshot"],
21837
+ [instance, "getSnapshot"]
21838
+ ]) {
21839
+ if (Object.getOwnPropertyDescriptor(target, key)?.writable !== true) {
21840
+ throw new Error("Codex usage gate is not writable");
21841
+ }
21842
+ }
21843
+ let notify;
21844
+ const originalSub = store.sub;
21845
+ try {
21846
+ store.sub = (candidate, listener) => {
21847
+ if (candidate !== atom || notify) throw new Error("Unexpected Codex usage subscription");
21848
+ notify = listener;
21849
+ return () => void 0;
21850
+ };
21851
+ subscribeEffect();
21852
+ } finally {
21853
+ store.sub = originalSub;
21854
+ }
21855
+ if (!notify) throw new Error("Codex usage gate listener is unavailable");
21856
+ const onChange = notify;
21857
+ const original = subscriber.getSnapshot;
21858
+ const allowed = () => false;
21859
+ subscriber.getSnapshot = allowed;
21860
+ instance.getSnapshot = allowed;
21861
+ if (instance.value !== false) onChange();
21862
+ return {
21863
+ subscriber,
21864
+ instance,
21865
+ restore() {
21866
+ if (subscriber.getSnapshot === allowed) subscriber.getSnapshot = original;
21867
+ if (instance.getSnapshot === allowed) instance.getSnapshot = original;
21868
+ onChange();
21869
+ }
21870
+ };
21871
+ }
21872
+ function isBound(owner, projections) {
21873
+ const alternate = isRecord2(owner.alternate) ? owner.alternate : null;
21874
+ const bound = [...projections];
21875
+ return [owner, alternate].some((fiber) => {
21876
+ const hooks = hooksOf(fiber);
21877
+ return bound.every(
21878
+ ({ subscriber, instance }) => hooks.some(
21879
+ (hook) => Array.isArray(hook.memoizedState) && hook.memoizedState[0] === subscriber && hook.next?.queue === instance
21880
+ )
21881
+ );
21882
+ });
21883
+ }
21884
+ function createRendererCodexUsageGate(composer) {
21885
+ let owner = null;
21886
+ const projections = /* @__PURE__ */ new Map();
21887
+ let retryAt = 0;
21888
+ let allowed = false;
21889
+ const release = () => {
21890
+ const previous = [...projections.values()];
21891
+ owner = null;
21892
+ projections.clear();
21893
+ for (const projection of previous) {
21894
+ try {
21895
+ projection.restore();
21896
+ } catch {
21897
+ }
21898
+ }
21899
+ };
21900
+ const bind = () => {
21901
+ const current = owner ?? findSubmitOwner(composer);
21902
+ const gates = current && discoverGates(current);
21903
+ if (!current || !gates?.has("reserve")) throw new Error("Codex usage gate is unavailable");
21904
+ owner = current;
21905
+ for (const [kind, gate] of gates) {
21906
+ if (!projections.has(kind)) projections.set(kind, project(gate));
21907
+ }
21908
+ return "bypassed";
21909
+ };
21910
+ const apply = () => {
21911
+ if (!allowed || !composer.isConnected) {
21912
+ release();
21913
+ retryAt = 0;
21914
+ return "native";
21915
+ }
21916
+ if (owner && !isBound(owner, projections.values())) {
21917
+ release();
21918
+ retryAt = 0;
21919
+ }
21920
+ if (owner && projections.size === 2) return "bypassed";
21921
+ if (Date.now() < retryAt) return owner ? "bypassed" : "unsupported";
21922
+ retryAt = Date.now() + RETRY_DELAY_MS;
21923
+ try {
21924
+ return bind();
21925
+ } catch {
21926
+ release();
21927
+ return "unsupported";
21928
+ }
21929
+ };
21930
+ return {
21931
+ update(next) {
21932
+ allowed = next;
21933
+ return apply();
21934
+ },
21935
+ refresh: apply,
21936
+ dispose() {
21937
+ allowed = false;
21938
+ release();
21939
+ }
21940
+ };
21941
+ }
21942
+
21838
21943
  // src/renderer-request-sender.ts
21839
21944
  var RendererMethodUnavailableError = class extends Error {
21840
21945
  constructor(method, cause) {
@@ -21941,15 +22046,15 @@ ${error51.stderrTail}`] : []
21941
22046
  var CODEX_ACCOUNT_LIST_METHOD = "codexhost/account/list";
21942
22047
  var CODEX_ACCOUNT_REFRESH_METHOD = "codexhost/account/refresh";
21943
22048
  var CODEX_ACCOUNT_CHANGED_METHOD = "codexhost/account/changed";
21944
- function isRecord2(value) {
22049
+ function isRecord3(value) {
21945
22050
  return typeof value === "object" && value !== null && !Array.isArray(value);
21946
22051
  }
21947
22052
  function notifiedThreadId(notification) {
21948
- if (!isRecord2(notification) || !THREAD_USAGE_REFRESH_METHODS.includes(notification.method)) {
22053
+ if (!isRecord3(notification) || !THREAD_USAGE_REFRESH_METHODS.includes(notification.method)) {
21949
22054
  return null;
21950
22055
  }
21951
22056
  const params = notification.params;
21952
- if (!isRecord2(params)) return null;
22057
+ if (!isRecord3(params)) return null;
21953
22058
  const parsed = hostThreadIdSchema.safeParse(params.threadId);
21954
22059
  return parsed.success ? parsed.data : null;
21955
22060
  }
@@ -22106,8 +22211,8 @@ ${error51.stderrTail}`] : []
22106
22211
  threadId: params.threadId,
22107
22212
  includeTurns: false
22108
22213
  });
22109
- const thread = isRecord2(native) ? native.thread : null;
22110
- if (!isRecord2(thread) || thread.id !== params.threadId || typeof thread.modelProvider !== "string" || !thread.modelProvider || thread.modelProvider === "codexhost" || typeof thread.cliVersion !== "string" || !thread.cliVersion || thread.cliVersion === "codexhost") {
22214
+ const thread = isRecord3(native) ? native.thread : null;
22215
+ if (!isRecord3(thread) || thread.id !== params.threadId || typeof thread.modelProvider !== "string" || !thread.modelProvider || thread.modelProvider === "codexhost" || typeof thread.cliVersion !== "string" || !thread.cliVersion || thread.cliVersion === "codexhost") {
22111
22216
  throw new Error("Native Thread response cannot establish Codex ownership");
22112
22217
  }
22113
22218
  return { owner: "codex", locked: true };
@@ -22227,7 +22332,7 @@ ${error51.stderrTail}`] : []
22227
22332
  throw new Error("Renderer Account notification callback is unavailable");
22228
22333
  }
22229
22334
  return notifications.addNotificationCallback(CODEX_ACCOUNT_CHANGED_METHOD, (notification) => {
22230
- if (!isRecord2(notification) || notification.method !== CODEX_ACCOUNT_CHANGED_METHOD) return;
22335
+ if (!isRecord3(notification) || notification.method !== CODEX_ACCOUNT_CHANGED_METHOD) return;
22231
22336
  const state = codexAccountChangedSchema.safeParse(notification.params);
22232
22337
  if (state.success) listener(state.data);
22233
22338
  });
@@ -22236,16 +22341,16 @@ ${error51.stderrTail}`] : []
22236
22341
  }
22237
22342
 
22238
22343
  // src/renderer-external-queue.ts
22239
- function isRecord3(value) {
22344
+ function isRecord4(value) {
22240
22345
  return value !== null && typeof value === "object" && !Array.isArray(value);
22241
22346
  }
22242
22347
  function installRendererExternalQueue(target) {
22243
- if (!isRecord3(target) || typeof target.getTurnCoordinator !== "function" || typeof target.getConversation !== "function") {
22348
+ if (!isRecord4(target) || typeof target.getTurnCoordinator !== "function" || typeof target.getConversation !== "function") {
22244
22349
  return null;
22245
22350
  }
22246
22351
  const coordinator = target.getTurnCoordinator();
22247
- const queue = isRecord3(coordinator) ? coordinator.serverQueue : null;
22248
- if (!isRecord3(queue) || typeof queue.isEnabled !== "function") return null;
22352
+ const queue = isRecord4(coordinator) ? coordinator.serverQueue : null;
22353
+ if (!isRecord4(queue) || typeof queue.isEnabled !== "function") return null;
22249
22354
  const descriptor = Object.getOwnPropertyDescriptor(queue, "isEnabled");
22250
22355
  if (!descriptor?.writable) return null;
22251
22356
  const original = queue.isEnabled;
@@ -22254,7 +22359,7 @@ ${error51.stderrTail}`] : []
22254
22359
  const threadId = args[0];
22255
22360
  if (typeof threadId === "string") {
22256
22361
  const conversation = getConversation.call(target, threadId);
22257
- if (isRecord3(conversation) && conversation.id === threadId && // Reserved transport marker from externalThreadValue, retained by
22362
+ if (isRecord4(conversation) && conversation.id === threadId && // Reserved transport marker from externalThreadValue, retained by
22258
22363
  // Desktop in both newly created and hydrated conversation metadata.
22259
22364
  conversation.modelProvider === "codexhost") {
22260
22365
  return false;
@@ -22269,19 +22374,19 @@ ${error51.stderrTail}`] : []
22269
22374
  }
22270
22375
 
22271
22376
  // src/renderer-external-steering.ts
22272
- function isRecord4(value) {
22377
+ function isRecord5(value) {
22273
22378
  return value !== null && typeof value === "object" && !Array.isArray(value);
22274
22379
  }
22275
22380
  function isManager(value) {
22276
- return isRecord4(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
22381
+ return isRecord5(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
22277
22382
  (key) => typeof value[key] === "function"
22278
22383
  );
22279
22384
  }
22280
22385
  function submissionHost(manager) {
22281
22386
  const coordinator = manager.getTurnCoordinator();
22282
- const options = isRecord4(coordinator) ? coordinator.options : null;
22283
- const host = isRecord4(options) ? options.submissionHost : null;
22284
- if (!isRecord4(host) || typeof host.getActiveTurnId !== "function" || typeof host.hasPendingTurnStart !== "function") {
22387
+ const options = isRecord5(coordinator) ? coordinator.options : null;
22388
+ const host = isRecord5(options) ? options.submissionHost : null;
22389
+ if (!isRecord5(host) || typeof host.getActiveTurnId !== "function" || typeof host.hasPendingTurnStart !== "function") {
22285
22390
  throw new Error("Desktop turn submission binding is unavailable");
22286
22391
  }
22287
22392
  return {
@@ -22323,20 +22428,20 @@ ${error51.stderrTail}`] : []
22323
22428
  var INTERRUPTED_QUEUE_REASON = "Interrupted before the steer was accepted.";
22324
22429
  async function preserveQueuedFollowUps(manager, threadId) {
22325
22430
  const coordinator = manager.getTurnCoordinator();
22326
- if (!isRecord4(coordinator) || typeof coordinator.loadMessages !== "function" || typeof coordinator.readMessages !== "function" || typeof coordinator.mutate !== "function") {
22431
+ if (!isRecord5(coordinator) || typeof coordinator.loadMessages !== "function" || typeof coordinator.readMessages !== "function" || typeof coordinator.mutate !== "function") {
22327
22432
  throw new Error("Desktop follow-up queue binding is unavailable");
22328
22433
  }
22329
22434
  await coordinator.loadMessages.call(coordinator, threadId);
22330
22435
  const messages = coordinator.readMessages.call(coordinator, threadId);
22331
22436
  if (!Array.isArray(messages)) throw new Error("Desktop follow-up queue is unavailable");
22332
22437
  const alreadyPaused = new Set(
22333
- messages.filter((message) => isRecord4(message) && message.pausedReason != null).map((message) => message.id)
22438
+ messages.filter((message) => isRecord5(message) && message.pausedReason != null).map((message) => message.id)
22334
22439
  );
22335
22440
  return () => {
22336
22441
  coordinator.mutate.call(coordinator, threadId, (current) => {
22337
22442
  if (!Array.isArray(current)) return current;
22338
22443
  return current.map((message) => {
22339
- if (!isRecord4(message) || alreadyPaused.has(message.id) || message.pausedReason !== INTERRUPTED_QUEUE_REASON)
22444
+ if (!isRecord5(message) || alreadyPaused.has(message.id) || message.pausedReason !== INTERRUPTED_QUEUE_REASON)
22340
22445
  return message;
22341
22446
  const resumed = { ...message };
22342
22447
  delete resumed.pausedReason;
@@ -22354,9 +22459,9 @@ ${error51.stderrTail}`] : []
22354
22459
  const pending = /* @__PURE__ */ new Map();
22355
22460
  let disposed = false;
22356
22461
  const send = function(method, params, options) {
22357
- const messageId = isRecord4(params) ? params.clientUserMessageId : null;
22358
- const route = typeof messageId === "string" && isRecord4(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
22359
- if (method !== "turn/start" || !isRecord4(params) || !route || route.threadId !== params.threadId) {
22462
+ const messageId = isRecord5(params) ? params.clientUserMessageId : null;
22463
+ const route = typeof messageId === "string" && isRecord5(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
22464
+ if (method !== "turn/start" || !isRecord5(params) || !route || route.threadId !== params.threadId) {
22360
22465
  return originalSend.call(manager, method, params, options);
22361
22466
  }
22362
22467
  if (disposed) return Promise.reject(new Error("External steering binding was disposed"));
@@ -22375,7 +22480,7 @@ ${error51.stderrTail}`] : []
22375
22480
  options
22376
22481
  )
22377
22482
  ).then((response) => {
22378
- if (!isRecord4(response) || typeof response.turnId !== "string" || !response.turnId) {
22483
+ if (!isRecord5(response) || typeof response.turnId !== "string" || !response.turnId) {
22379
22484
  throw new Error("External steering returned no replacement Turn identity");
22380
22485
  }
22381
22486
  return {
@@ -22406,7 +22511,7 @@ ${error51.stderrTail}`] : []
22406
22511
  ] = args;
22407
22512
  if (typeof threadId !== "string") return originalSteer.apply(manager, args);
22408
22513
  const role = manager.getStreamRole?.(threadId);
22409
- if (isRecord4(role) && role.role === "follower") return originalSteer.apply(manager, args);
22514
+ if (isRecord5(role) && role.role === "follower") return originalSteer.apply(manager, args);
22410
22515
  let host = null;
22411
22516
  let expectedTurnId;
22412
22517
  try {
@@ -22425,15 +22530,15 @@ ${error51.stderrTail}`] : []
22425
22530
  if (owner === "codex") return originalSteer.apply(manager, args);
22426
22531
  if (!host) throw new Error("Desktop turn submission binding is unavailable");
22427
22532
  const currentRole = manager.getStreamRole?.(threadId);
22428
- if (isRecord4(currentRole) && currentRole.role === "follower")
22533
+ if (isRecord5(currentRole) && currentRole.role === "follower")
22429
22534
  return originalSteer.apply(manager, args);
22430
22535
  if (!Array.isArray(input) || input.length === 0 || input.some(
22431
- (item) => !isRecord4(item) || item.type !== "text" || typeof item.text !== "string"
22432
- ) || !input.some((item) => isRecord4(item) && typeof item.text === "string" && item.text.trim())) {
22536
+ (item) => !isRecord5(item) || item.type !== "text" || typeof item.text !== "string"
22537
+ ) || !input.some((item) => isRecord5(item) && typeof item.text === "string" && item.text.trim())) {
22433
22538
  throw new Error("External steering requires non-empty text input");
22434
22539
  }
22435
22540
  if (toolOutput != null) throw new Error("External steering cannot replace a tool response");
22436
- if (!isRecord4(restoreMessage) || !isRecord4(restoreMessage.context)) {
22541
+ if (!isRecord5(restoreMessage) || !isRecord5(restoreMessage.context)) {
22437
22542
  throw new Error("Desktop steering message context is unavailable");
22438
22543
  }
22439
22544
  const messageId = typeof clientUserMessageId === "string" && clientUserMessageId ? clientUserMessageId : typeof restoreMessage.id === "string" && restoreMessage.id ? restoreMessage.id : crypto.randomUUID();
@@ -22481,7 +22586,7 @@ ${error51.stderrTail}`] : []
22481
22586
  },
22482
22587
  onMessageAdded
22483
22588
  );
22484
- if (!isRecord4(response) || !isRecord4(response.turn) || typeof response.turn.id !== "string") {
22589
+ if (!isRecord5(response) || !isRecord5(response.turn) || typeof response.turn.id !== "string") {
22485
22590
  throw new Error("Desktop returned no replacement Turn identity");
22486
22591
  }
22487
22592
  try {
@@ -22671,7 +22776,7 @@ ${error51.stderrTail}`] : []
22671
22776
  var SIDEBAR_THREAD_HOST_ID_ATTRIBUTE = "data-app-action-sidebar-thread-host-id";
22672
22777
  var SIDEBAR_AGENT_ICON_ATTRIBUTE = "data-codexhost-sidebar-agent-icon";
22673
22778
  var OWNERSHIP_RETRY_DELAYS_MS = [100, 300, 800, 1500, 3e3];
22674
- function isRecord5(value) {
22779
+ function isRecord6(value) {
22675
22780
  return typeof value === "object" && value !== null && !Array.isArray(value);
22676
22781
  }
22677
22782
  function sidebarThreadAttributes(element) {
@@ -22698,19 +22803,19 @@ ${error51.stderrTail}`] : []
22698
22803
  const fiberName = fiberNames[0];
22699
22804
  if (fiberNames.length !== 1 || !fiberName) return null;
22700
22805
  const firstFiber2 = Object.getOwnPropertyDescriptor(element, fiberName)?.value;
22701
- if (!isRecord5(firstFiber2)) return null;
22806
+ if (!isRecord6(firstFiber2)) return null;
22702
22807
  const candidates = /* @__PURE__ */ new Set();
22703
22808
  let fiber = firstFiber2;
22704
22809
  for (let depth = 0; fiber && depth < 12; depth += 1) {
22705
22810
  const props = fiber.memoizedProps;
22706
- if (isRecord5(props) && isRecord5(props.dataAttributes)) {
22811
+ if (isRecord6(props) && isRecord6(props.dataAttributes)) {
22707
22812
  const dataAttributes = props.dataAttributes;
22708
22813
  const threadId = hostThreadIdSchema.safeParse(props.conversationId);
22709
22814
  if (threadId.success && dataAttributes[SIDEBAR_THREAD_ROW_ATTRIBUTE] === rowMarker && dataAttributes[SIDEBAR_THREAD_ID_ATTRIBUTE] === taskKey && dataAttributes[SIDEBAR_THREAD_HOST_ID_ATTRIBUTE] === hostId) {
22710
22815
  candidates.add(threadId.data);
22711
22816
  }
22712
22817
  }
22713
- fiber = isRecord5(fiber.return) ? fiber.return : null;
22818
+ fiber = isRecord6(fiber.return) ? fiber.return : null;
22714
22819
  }
22715
22820
  return candidates.size === 1 ? candidates.values().next().value ?? null : null;
22716
22821
  }
@@ -22730,8 +22835,19 @@ ${error51.stderrTail}`] : []
22730
22835
  if (ownership.harnessId === "hermes") return "hermes";
22731
22836
  if (ownership.harnessId === "qoder") return "qoder";
22732
22837
  if (ownership.harnessId === "qoder-cn") return "qoder-cn";
22838
+ if (ownership.harnessId === "kimi-code") return "kimi-code";
22733
22839
  return null;
22734
22840
  }
22841
+ function sidebarAgentIconAnchor(titleTrigger, title) {
22842
+ const view = title.ownerDocument.defaultView;
22843
+ let anchor = title;
22844
+ while (anchor.parentElement && anchor.parentElement !== titleTrigger) {
22845
+ const style = view?.getComputedStyle(anchor.parentElement);
22846
+ if (style?.display.includes("flex") && !style.flexDirection.startsWith("column")) break;
22847
+ anchor = anchor.parentElement;
22848
+ }
22849
+ return anchor;
22850
+ }
22735
22851
  var BrowserSidebarAgentIconRow = class {
22736
22852
  constructor(element) {
22737
22853
  this.element = element;
@@ -22756,10 +22872,11 @@ ${error51.stderrTail}`] : []
22756
22872
  this.clear();
22757
22873
  return;
22758
22874
  }
22875
+ const anchor = sidebarAgentIconAnchor(titleTrigger, title);
22759
22876
  const icons = [
22760
22877
  ...this.element.querySelectorAll(`[${SIDEBAR_AGENT_ICON_ATTRIBUTE}]`)
22761
22878
  ];
22762
- if (icons.length === 1 && icons[0]?.parentElement === titleTrigger && icons[0].getAttribute(SIDEBAR_AGENT_ICON_ATTRIBUTE) === agent) {
22879
+ if (icons.length === 1 && icons[0]?.nextElementSibling === anchor && icons[0].getAttribute(SIDEBAR_AGENT_ICON_ATTRIBUTE) === agent) {
22763
22880
  return;
22764
22881
  }
22765
22882
  this.clear();
@@ -22777,7 +22894,7 @@ ${error51.stderrTail}`] : []
22777
22894
  marker.style.flex = "none";
22778
22895
  marker.style.pointerEvents = "none";
22779
22896
  marker.append(createRendererAgentIcon(agent, 14, this.element.ownerDocument));
22780
- titleTrigger.insertBefore(marker, title);
22897
+ anchor.before(marker);
22781
22898
  }
22782
22899
  clear() {
22783
22900
  for (const icon2 of this.element.querySelectorAll(`[${SIDEBAR_AGENT_ICON_ATTRIBUTE}]`)) {
@@ -23056,7 +23173,7 @@ ${error51.stderrTail}`] : []
23056
23173
  if (row) finish(row);
23057
23174
  });
23058
23175
  }
23059
- function isRecord6(value) {
23176
+ function isRecord7(value) {
23060
23177
  return typeof value === "object" && value !== null && !Array.isArray(value);
23061
23178
  }
23062
23179
  function firstFiber(element) {
@@ -23066,7 +23183,7 @@ ${error51.stderrTail}`] : []
23066
23183
  const name = names[0];
23067
23184
  if (names.length !== 1 || !name) return null;
23068
23185
  const value = Object.getOwnPropertyDescriptor(element, name)?.value;
23069
- return isRecord6(value) ? value : null;
23186
+ return isRecord7(value) ? value : null;
23070
23187
  }
23071
23188
  function rendererForkTargetFromButton(button) {
23072
23189
  const annotation = button.closest(`[${RESPONSE_CONVERSATION_ATTRIBUTE}]`);
@@ -23083,10 +23200,10 @@ ${error51.stderrTail}`] : []
23083
23200
  let hasForkCallback = false;
23084
23201
  let fiber = firstFiber(button);
23085
23202
  const buttonProps = fiber?.memoizedProps;
23086
- if (!isRecord6(buttonProps) || !Object.hasOwn(buttonProps, "aria-busy")) return null;
23203
+ if (!isRecord7(buttonProps) || !Object.hasOwn(buttonProps, "aria-busy")) return null;
23087
23204
  for (let depth = 0; fiber && depth < 24; depth += 1) {
23088
23205
  const props = fiber.memoizedProps;
23089
- if (isRecord6(props)) {
23206
+ if (isRecord7(props)) {
23090
23207
  if (typeof props.conversationId === "string") conversationIds.add(props.conversationId);
23091
23208
  if (typeof props.turnId === "string") turnIds.add(props.turnId);
23092
23209
  if (typeof props.hostId === "string") hostIds.add(props.hostId);
@@ -23095,7 +23212,7 @@ ${error51.stderrTail}`] : []
23095
23212
  }
23096
23213
  if (typeof props.onFork === "function") hasForkCallback = true;
23097
23214
  }
23098
- fiber = isRecord6(fiber.return) ? fiber.return : null;
23215
+ fiber = isRecord7(fiber.return) ? fiber.return : null;
23099
23216
  }
23100
23217
  if (!hasForkCallback || conversationIds.size !== 1 || !conversationIds.has(threadId.data) || turnIds.size !== 1 || !turnIds.has(turnId.data) || hostIds.size !== 1 || !hostIds.has("local") || projectlessStates.size !== 1) {
23101
23218
  return null;
@@ -23213,12 +23330,12 @@ ${error51.stderrTail}`] : []
23213
23330
  if (agent === "kiro-cli") return encodeHarnessPluginRoute({ harnessId: KIRO_CLI_HARNESS_ID });
23214
23331
  if (agent === "codebuddy" || agent === "workbuddy" || agent === "cursor-cli")
23215
23332
  return encodeHarnessPluginRoute({ harnessId: harnessIdSchema.parse(agent) });
23216
- if (agent === "qoder" || agent === "qoder-cn") {
23333
+ if (agent === "qoder" || agent === "qoder-cn" || agent === "kimi-code") {
23217
23334
  return encodeHarnessPluginRoute({ harnessId: harnessIdSchema.parse(agent) });
23218
23335
  }
23219
23336
  return null;
23220
23337
  }
23221
- function isRecord7(value) {
23338
+ function isRecord8(value) {
23222
23339
  return typeof value === "object" && value !== null && !Array.isArray(value);
23223
23340
  }
23224
23341
  function piTransportModelId(model, thinkingOptionId) {
@@ -23477,7 +23594,7 @@ ${error51.stderrTail}`] : []
23477
23594
  let fiber = findComposerFiber(composer);
23478
23595
  for (let depth = 0; fiber && depth < 120; depth += 1) {
23479
23596
  const props = fiber.memoizedProps;
23480
- if (isRecord7(props) && "conversationId" in props && props.conversationId != null) {
23597
+ if (isRecord8(props) && "conversationId" in props && props.conversationId != null) {
23481
23598
  const candidate = hostThreadIdSchema.safeParse(props.conversationId);
23482
23599
  if (!candidate.success || threadId !== void 0 && threadId !== candidate.data) {
23483
23600
  return null;
@@ -23490,12 +23607,12 @@ ${error51.stderrTail}`] : []
23490
23607
  return threadId;
23491
23608
  }
23492
23609
  function isLegacySevenSlotDraftWrapper(value) {
23493
- if (!Array.isArray(value) || value.length !== 7 || value[3] !== value[5] || value[3] !== value[6] || !isRecord7(value[3]) || typeof value[3].get !== "function" || typeof value[2] !== "string" && value[2] !== null) {
23610
+ if (!Array.isArray(value) || value.length !== 7 || value[3] !== value[5] || value[3] !== value[6] || !isRecord8(value[3]) || typeof value[3].get !== "function" || typeof value[2] !== "string" && value[2] !== null) {
23494
23611
  return false;
23495
23612
  }
23496
23613
  try {
23497
23614
  const draft = value[3].get();
23498
- return isRecord7(draft) && "modelSettings" in draft && "isManuallyChanged" in draft;
23615
+ return isRecord8(draft) && "modelSettings" in draft && "isManuallyChanged" in draft;
23499
23616
  } catch {
23500
23617
  return false;
23501
23618
  }
@@ -23529,8 +23646,8 @@ ${error51.stderrTail}`] : []
23529
23646
  let fiber = findComposerFiber(composer);
23530
23647
  for (let depth = 0; fiber && depth < 120; depth += 1) {
23531
23648
  const updateQueue = fiber.updateQueue;
23532
- const memoCache = isRecord7(updateQueue) ? updateQueue.memoCache : null;
23533
- const data = isRecord7(memoCache) && Array.isArray(memoCache.data) ? memoCache.data : [];
23649
+ const memoCache = isRecord8(updateQueue) ? updateQueue.memoCache : null;
23650
+ const data = isRecord8(memoCache) && Array.isArray(memoCache.data) ? memoCache.data : [];
23534
23651
  for (const value of data) {
23535
23652
  const draftId = draftIdFromMemoValue(value);
23536
23653
  if (draftId) draftIds.add(draftId);
@@ -23557,7 +23674,7 @@ ${error51.stderrTail}`] : []
23557
23674
  return ["default", draftIds.values().next().value];
23558
23675
  }
23559
23676
  function isDraftPrewarmPolicyReady(value) {
23560
- return isRecord7(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
23677
+ return isRecord8(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
23561
23678
  }
23562
23679
  async function waitForRendererDraftPrewarmPolicy(target, composer) {
23563
23680
  const deadline = Date.now() + DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS;
@@ -23577,7 +23694,7 @@ ${error51.stderrTail}`] : []
23577
23694
  ...model ? { model } : {},
23578
23695
  ...thinkingOptionId && agent !== "cursor-cli" ? { thinkingOptionId } : {},
23579
23696
  ...permissionModeId ? { permissionModeId } : {}
23580
- }) : agent === "hermes" ? hermesTransportModelId(model, permissionModeId) : agent === "qoder" || agent === "qoder-cn" ? encodeHarnessPluginRoute({
23697
+ }) : agent === "hermes" ? hermesTransportModelId(model, permissionModeId) : agent === "qoder" || agent === "qoder-cn" || agent === "kimi-code" ? encodeHarnessPluginRoute({
23581
23698
  harnessId: harnessIdSchema.parse(agent),
23582
23699
  ...model ? { model } : {},
23583
23700
  ...thinkingOptionId ? { thinkingOptionId } : {},
@@ -23792,11 +23909,11 @@ ${error51.stderrTail}`] : []
23792
23909
  return null;
23793
23910
  }
23794
23911
  }
23795
- function isRecord8(value) {
23912
+ function isRecord9(value) {
23796
23913
  return typeof value === "object" && value !== null && !Array.isArray(value);
23797
23914
  }
23798
23915
  function parseExternalConfiguration(value) {
23799
- if (!isRecord8(value)) return void 0;
23916
+ if (!isRecord9(value)) return void 0;
23800
23917
  const model = harnessModelRefSchema.safeParse(value.model);
23801
23918
  if (!model.success) return void 0;
23802
23919
  const thinkingOptionId = harnessThinkingOptionIdSchema.safeParse(value.thinkingOptionId);
@@ -23813,9 +23930,9 @@ ${error51.stderrTail}`] : []
23813
23930
  const raw = storage.getItem(RENDERER_NEW_THREAD_PREFERENCE_KEY);
23814
23931
  if (!raw) return void 0;
23815
23932
  const parsed = JSON.parse(raw);
23816
- if (!isRecord8(parsed) || parsed.version !== 1) return void 0;
23933
+ if (!isRecord9(parsed) || parsed.version !== 1) return void 0;
23817
23934
  if (!KNOWN_RENDERER_AGENTS.some((agent) => agent === parsed.lastAgent)) return void 0;
23818
- const externalByAgent = isRecord8(parsed.externalByAgent) ? parsed.externalByAgent : {};
23935
+ const externalByAgent = isRecord9(parsed.externalByAgent) ? parsed.externalByAgent : {};
23819
23936
  const parsedExternal = Object.fromEntries(
23820
23937
  KNOWN_RENDERER_AGENTS.filter(
23821
23938
  (agent) => agent !== "codex"
@@ -23857,41 +23974,93 @@ ${error51.stderrTail}`] : []
23857
23974
  ...permissionModeId ? { permissionModeId } : {}
23858
23975
  };
23859
23976
  }
23860
- function writeNewThreadAgentPreference(agent, storage = rendererStorage3()) {
23861
- const current = readPreference(storage);
23862
- writePreference(
23863
- {
23864
- version: 1,
23865
- lastAgent: agent,
23866
- externalByAgent: current?.externalByAgent ?? {}
23867
- },
23868
- storage
23869
- );
23977
+ function writeNewThreadAgentPreference(agent, storage = rendererStorage3()) {
23978
+ const current = readPreference(storage);
23979
+ writePreference(
23980
+ {
23981
+ version: 1,
23982
+ lastAgent: agent,
23983
+ externalByAgent: current?.externalByAgent ?? {}
23984
+ },
23985
+ storage
23986
+ );
23987
+ }
23988
+ function writeNewThreadExternalConfigurationPreference(agent, model, thinkingOptionId, permissionModeId, storage = rendererStorage3()) {
23989
+ const current = readPreference(storage);
23990
+ writePreference(
23991
+ {
23992
+ version: 1,
23993
+ lastAgent: current?.lastAgent ?? "codex",
23994
+ externalByAgent: {
23995
+ ...current?.externalByAgent,
23996
+ [agent]: {
23997
+ model: harnessModelRefSchema.parse(model),
23998
+ ...thinkingOptionId ? { thinkingOptionId: harnessThinkingOptionIdSchema.parse(thinkingOptionId) } : {},
23999
+ ...permissionModeId ? { permissionModeId: harnessPermissionModeIdSchema.parse(permissionModeId) } : {}
24000
+ }
24001
+ }
24002
+ },
24003
+ storage
24004
+ );
24005
+ }
24006
+
24007
+ // src/renderer-harness-command-claim.ts
24008
+ function inputEvent(editor, text) {
24009
+ const view = editor.ownerDocument.defaultView;
24010
+ return view?.InputEvent ? new view.InputEvent("input", {
24011
+ bubbles: true,
24012
+ composed: true,
24013
+ data: text,
24014
+ inputType: "insertText"
24015
+ }) : new (view?.Event ?? Event)("input", { bubbles: true, composed: true });
24016
+ }
24017
+ function prependTextarea(editor, prefix) {
24018
+ const view = editor.ownerDocument.defaultView;
24019
+ if (!view || !(editor instanceof view.HTMLTextAreaElement)) return false;
24020
+ const setter = Object.getOwnPropertyDescriptor(view.HTMLTextAreaElement.prototype, "value")?.set;
24021
+ if (!setter) return false;
24022
+ const start2 = editor.selectionStart;
24023
+ const end = editor.selectionEnd;
24024
+ setter.call(editor, prefix + editor.value);
24025
+ editor.dispatchEvent(inputEvent(editor, prefix));
24026
+ editor.focus({ preventScroll: true });
24027
+ if (start2 !== null && end !== null) {
24028
+ editor.setSelectionRange(start2 + prefix.length, end + prefix.length);
24029
+ }
24030
+ return true;
24031
+ }
24032
+ function prependContentEditable(editor, prefix) {
24033
+ if (editor.getAttribute("contenteditable") !== "true") return false;
24034
+ const document2 = editor.ownerDocument;
24035
+ const selection = document2.getSelection();
24036
+ if (!selection || typeof document2.execCommand !== "function") return false;
24037
+ const range = document2.createRange();
24038
+ range.selectNodeContents(editor);
24039
+ range.collapse(true);
24040
+ editor.focus({ preventScroll: true });
24041
+ selection.removeAllRanges();
24042
+ selection.addRange(range);
24043
+ return document2.execCommand("insertText", false, prefix);
24044
+ }
24045
+ function prependEditor(editor, prefix) {
24046
+ return prependTextarea(editor, prefix) || prependContentEditable(editor, prefix);
23870
24047
  }
23871
- function writeNewThreadExternalConfigurationPreference(agent, model, thinkingOptionId, permissionModeId, storage = rendererStorage3()) {
23872
- const current = readPreference(storage);
23873
- writePreference(
23874
- {
23875
- version: 1,
23876
- lastAgent: current?.lastAgent ?? "codex",
23877
- externalByAgent: {
23878
- ...current?.externalByAgent,
23879
- [agent]: {
23880
- model: harnessModelRefSchema.parse(model),
23881
- ...thinkingOptionId ? { thinkingOptionId: harnessThinkingOptionIdSchema.parse(thinkingOptionId) } : {},
23882
- ...permissionModeId ? { permissionModeId: harnessPermissionModeIdSchema.parse(permissionModeId) } : {}
23883
- }
23884
- }
23885
- },
23886
- storage
23887
- );
24048
+ function rendererHarnessCommandExecutesDirectly(command) {
24049
+ return command.invocation === "/compact" || command.argumentMode === "none";
24050
+ }
24051
+ function routeRendererHarnessCommandSelection(editor, command, execute) {
24052
+ if (rendererHarnessCommandExecutesDirectly(command)) {
24053
+ execute();
24054
+ return true;
24055
+ }
24056
+ return editor !== null && prependEditor(editor, `${command.invocation} `);
23888
24057
  }
23889
24058
 
23890
24059
  // src/codex-locale-adapter.ts
23891
24060
  var GET_LOCALE_OVERRIDE_URL = "vscode://codex/get-setting";
23892
24061
  var GET_LOCALE_INFO_URL = "vscode://codex/locale-info";
23893
24062
  var DEFAULT_LOCALE_REQUEST_TIMEOUT_MS = 750;
23894
- function isRecord9(value) {
24063
+ function isRecord10(value) {
23895
24064
  return typeof value === "object" && value !== null && !Array.isArray(value);
23896
24065
  }
23897
24066
  function canonicalLocale(value) {
@@ -23913,7 +24082,7 @@ ${error51.stderrTail}`] : []
23913
24082
  return new DOMException("The operation was aborted", "AbortError");
23914
24083
  }
23915
24084
  function parseLocaleOverride(value) {
23916
- if (!isRecord9(value) || !("value" in value)) {
24085
+ if (!isRecord10(value) || !("value" in value)) {
23917
24086
  throw new Error("Codex locale override response is malformed");
23918
24087
  }
23919
24088
  if (value.value === null) return { value: null };
@@ -23928,7 +24097,7 @@ ${error51.stderrTail}`] : []
23928
24097
  return locale;
23929
24098
  }
23930
24099
  function parseLocaleInfo(value) {
23931
- if (!isRecord9(value)) throw new Error("Codex locale info response is malformed");
24100
+ if (!isRecord10(value)) throw new Error("Codex locale info response is malformed");
23932
24101
  return {
23933
24102
  ideLocale: optionalLocale(value.ideLocale, "IDE locale"),
23934
24103
  systemLocale: optionalLocale(value.systemLocale, "system locale")
@@ -23957,7 +24126,7 @@ ${error51.stderrTail}`] : []
23957
24126
  const onAbort = () => settle(() => reject(abortError2()));
23958
24127
  const onMessage = (event) => {
23959
24128
  const message2 = event.data;
23960
- if (!isRecord9(message2) || message2.type !== "fetch-response") return;
24129
+ if (!isRecord10(message2) || message2.type !== "fetch-response") return;
23961
24130
  if (message2.requestId !== requestId) return;
23962
24131
  if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
23963
24132
  settle(() => reject(new Error("Codex locale request failed")));
@@ -25047,6 +25216,7 @@ ${error51.stderrTail}`] : []
25047
25216
  var ORDERED_ITEM_PATTERN = /^\d+[.)][ \t]+(.+?)\s*$/u;
25048
25217
  var FENCE_PATTERN = /^```([\w+-]*)\s*$/u;
25049
25218
  var THEMATIC_BREAK_PATTERN = /^(?:---|___|\*\*\*)[ \t]*$/u;
25219
+ var CJK_PATTERN = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/u;
25050
25220
  var INLINE_PATTERN = /(`+)((?:(?!\1).)+)\1|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/gu;
25051
25221
  function createReleaseNotesElement(document2, markdown) {
25052
25222
  const root = document2.createElement("div");
@@ -25168,9 +25338,20 @@ ${error51.stderrTail}`] : []
25168
25338
  index += 1;
25169
25339
  }
25170
25340
  const paragraph = document2.createElement("p");
25341
+ const primaryIsCjk = CJK_PATTERN.test(paragraphLines[0] ?? "");
25342
+ let previousWasTranslation = false;
25171
25343
  paragraphLines.forEach((line, lineIndex) => {
25344
+ if (lineIndex > 0 && !primaryIsCjk && CJK_PATTERN.test(line)) {
25345
+ const translation = document2.createElement("span");
25346
+ translation.className = "release-note-translation";
25347
+ appendInline(document2, translation, line);
25348
+ paragraph.append(translation);
25349
+ previousWasTranslation = true;
25350
+ return;
25351
+ }
25352
+ if (lineIndex > 0 && !previousWasTranslation) paragraph.append(document2.createElement("br"));
25353
+ previousWasTranslation = false;
25172
25354
  appendInline(document2, paragraph, line);
25173
- if (lineIndex < paragraphLines.length - 1) paragraph.append(document2.createElement("br"));
25174
25355
  });
25175
25356
  root.append(paragraph);
25176
25357
  return index;
@@ -26865,6 +27046,7 @@ ${error51.stderrTail}`] : []
26865
27046
  notes.className = "settings-update-notes-section";
26866
27047
  context.content.append(heading, metadata, panel, controls, notes);
26867
27048
  const setManualFallback = (fallback) => {
27049
+ controls.className = !fallback && !windows ? "settings-update-controls is-quiet" : "settings-update-controls";
26868
27050
  manualNpmDescription.textContent = windows ? messages.updateWindowsNpmDescription : fallback ? messages.updateManualFallbackDescription : messages.updateManualNpmDescription;
26869
27051
  manualNpmDescription.className = fallback ? "settings-update-manual-description is-fallback" : "settings-update-manual-description";
26870
27052
  };
@@ -26879,6 +27061,7 @@ ${error51.stderrTail}`] : []
26879
27061
  };
26880
27062
  const renderUnavailable = (detail) => {
26881
27063
  panel.dataset.updateState = "unavailable";
27064
+ delete panel.dataset.inline;
26882
27065
  panel.replaceChildren();
26883
27066
  const copy = document2.createElement("p");
26884
27067
  copy.className = "settings-update-summary";
@@ -26887,9 +27070,10 @@ ${error51.stderrTail}`] : []
26887
27070
  notes.replaceChildren();
26888
27071
  };
26889
27072
  const renderRequestFailure = (error51) => {
27073
+ console.error("codexhost update request failed", error51);
26890
27074
  renderPendingStatus(
26891
27075
  null,
26892
- error51 instanceof RendererUpdateRequestTimeoutError ? messages.updateRequestTimeout : error51 instanceof Error ? error51.message : messages.updateFailed,
27076
+ error51 instanceof RendererUpdateRequestTimeoutError ? messages.updateRequestTimeout : messages.updateServiceUnavailable,
26893
27077
  "failed"
26894
27078
  );
26895
27079
  };
@@ -26907,11 +27091,17 @@ ${error51.stderrTail}`] : []
26907
27091
  {
26908
27092
  success(result) {
26909
27093
  const message = statusMessage(result.status, messages);
26910
- if (isPendingStatus(result.status)) scheduleStatusPoll(client);
26911
27094
  if (message) renderPendingStatus(result.status, message);
27095
+ if (result.status === null || isPendingStatus(result.status)) {
27096
+ scheduleStatusPoll(client);
27097
+ }
26912
27098
  },
26913
27099
  failure(error51) {
26914
- renderRequestFailure(error51);
27100
+ if (error51 instanceof RendererUpdateRequestTimeoutError) {
27101
+ scheduleStatusPoll(client);
27102
+ } else {
27103
+ renderRequestFailure(error51);
27104
+ }
26915
27105
  }
26916
27106
  }
26917
27107
  );
@@ -26919,6 +27109,7 @@ ${error51.stderrTail}`] : []
26919
27109
  };
26920
27110
  const renderPendingStatus = (status, message, viewPhase = status?.phase ?? "pending") => {
26921
27111
  panel.dataset.updateState = viewPhase;
27112
+ delete panel.dataset.inline;
26922
27113
  panel.replaceChildren();
26923
27114
  panel.append(createPanelHead(document2, viewPhase, message));
26924
27115
  setManualFallback(viewPhase === "failed");
@@ -26937,14 +27128,6 @@ ${error51.stderrTail}`] : []
26937
27128
  detail.textContent = `${percent}% \xB7 ${formatUpdateBytes(status.downloadedBytes)} / ${formatUpdateBytes(status.totalBytes)}`;
26938
27129
  panel.append(progress, detail);
26939
27130
  }
26940
- if (viewPhase === "failed") {
26941
- const retry = document2.createElement("button");
26942
- retry.type = "button";
26943
- retry.className = "settings-command-button";
26944
- retry.append(createRendererSettingsIcon("refresh", 16), messages.updateRetry);
26945
- retry.addEventListener("click", () => void load());
26946
- panel.append(createPanelActions(document2, retry));
26947
- }
26948
27131
  };
26949
27132
  const start2 = (client) => {
26950
27133
  if (pending) return;
@@ -26963,7 +27146,11 @@ ${error51.stderrTail}`] : []
26963
27146
  },
26964
27147
  failure(error51) {
26965
27148
  pending = false;
26966
- renderRequestFailure(error51);
27149
+ if (error51 instanceof RendererUpdateRequestTimeoutError) {
27150
+ scheduleStatusPoll(client, true);
27151
+ } else {
27152
+ renderRequestFailure(error51);
27153
+ }
26967
27154
  }
26968
27155
  }
26969
27156
  );
@@ -26995,15 +27182,16 @@ ${error51.stderrTail}`] : []
26995
27182
  panel.dataset.updateState = view;
26996
27183
  panel.replaceChildren();
26997
27184
  setManualFallback(Boolean(result.error) || actionableStatus !== null);
26998
- if (result.error || !result.updateAvailable || windows || actionableStatus) {
26999
- panel.append(
27000
- createPanelHead(
27001
- document2,
27002
- view,
27003
- actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ? messages.updateWindowsManualRequired : messages.updateUpToDate
27004
- )
27005
- );
27006
- }
27185
+ const inlineUpdate = !result.error && !windows && !actionableStatus && result.updateAvailable;
27186
+ if (inlineUpdate) panel.dataset.inline = "";
27187
+ else delete panel.dataset.inline;
27188
+ panel.append(
27189
+ createPanelHead(
27190
+ document2,
27191
+ view,
27192
+ actionableStatus ? statusMessage(actionableStatus, messages) ?? messages.updateFailed : result.error ? messages.updateFailed : result.updateAvailable ? windows ? messages.updateWindowsManualRequired : messages.updateAvailable : messages.updateUpToDate
27193
+ )
27194
+ );
27007
27195
  if (actionableStatus?.error) {
27008
27196
  const error51 = document2.createElement("p");
27009
27197
  error51.className = "settings-update-error";
@@ -28331,11 +28519,13 @@ ${error51.stderrTail}`] : []
28331
28519
  .settings-connection-install-callout p,
28332
28520
  .settings-connection-error-summary p,
28333
28521
  .settings-connection-state-summary p,
28334
- .settings-connection-issue-note {
28522
+ .settings-connection-issue-note,
28523
+ .settings-connection-compatibility {
28335
28524
  margin: 0;
28336
28525
  color: var(--settings-muted);
28337
28526
  font-size: 11px;
28338
28527
  line-height: 16px;
28528
+ overflow-wrap: anywhere;
28339
28529
  }
28340
28530
 
28341
28531
  .settings-connection-install-button {
@@ -28555,12 +28745,10 @@ ${error51.stderrTail}`] : []
28555
28745
  }
28556
28746
 
28557
28747
  .settings-update-metadata {
28558
- display: grid;
28559
- grid-template-columns: repeat(3, minmax(0, 1fr));
28560
- gap: 24px;
28561
- margin-bottom: 24px;
28562
- padding: 0 4px 20px;
28563
- border-bottom: 1px solid var(--settings-divider);
28748
+ display: flex;
28749
+ flex-wrap: wrap;
28750
+ gap: 12px 48px;
28751
+ margin-bottom: 20px;
28564
28752
  }
28565
28753
 
28566
28754
  .settings-update-metadata__item {
@@ -28585,7 +28773,7 @@ ${error51.stderrTail}`] : []
28585
28773
  }
28586
28774
 
28587
28775
  /* The only emphasis on this screen: a latest version newer than the installed one. */
28588
- .settings-update-metadata__value--newer {
28776
+ .settings-update-metadata__item strong.settings-update-metadata__value--newer {
28589
28777
  color: var(--settings-focus);
28590
28778
  }
28591
28779
 
@@ -28599,6 +28787,13 @@ ${error51.stderrTail}`] : []
28599
28787
  border-radius: 8px;
28600
28788
  }
28601
28789
 
28790
+ /* Update available: status on the left, the one action on the right. */
28791
+ .settings-update-panel[data-inline] {
28792
+ grid-template-columns: minmax(0, 1fr) auto;
28793
+ align-items: center;
28794
+ padding: 14px 16px;
28795
+ }
28796
+
28602
28797
  .settings-update-panel__head {
28603
28798
  display: flex;
28604
28799
  align-items: center;
@@ -28610,19 +28805,33 @@ ${error51.stderrTail}`] : []
28610
28805
  color: var(--settings-muted);
28611
28806
  }
28612
28807
 
28613
- .settings-update-panel[data-update-state="available"] .codexhost-settings-icon,
28614
- .settings-update-panel[data-update-state="downloading"] .codexhost-settings-icon,
28615
- .settings-update-panel[data-update-state="installing"] .codexhost-settings-icon,
28616
- .settings-update-panel[data-update-state="restarting"] .codexhost-settings-icon {
28808
+ .settings-update-panel[data-update-state="available"]
28809
+ .settings-update-panel__head
28810
+ .codexhost-settings-icon,
28811
+ .settings-update-panel[data-update-state="downloading"]
28812
+ .settings-update-panel__head
28813
+ .codexhost-settings-icon,
28814
+ .settings-update-panel[data-update-state="installing"]
28815
+ .settings-update-panel__head
28816
+ .codexhost-settings-icon,
28817
+ .settings-update-panel[data-update-state="restarting"]
28818
+ .settings-update-panel__head
28819
+ .codexhost-settings-icon {
28617
28820
  color: var(--settings-focus);
28618
28821
  }
28619
28822
 
28620
- .settings-update-panel[data-update-state="current"] .codexhost-settings-icon {
28823
+ .settings-update-panel[data-update-state="current"]
28824
+ .settings-update-panel__head
28825
+ .codexhost-settings-icon {
28621
28826
  color: var(--settings-success);
28622
28827
  }
28623
28828
 
28624
- .settings-update-panel[data-update-state="failed"] .codexhost-settings-icon,
28625
- .settings-update-panel[data-update-state="error"] .codexhost-settings-icon {
28829
+ .settings-update-panel[data-update-state="failed"]
28830
+ .settings-update-panel__head
28831
+ .codexhost-settings-icon,
28832
+ .settings-update-panel[data-update-state="error"]
28833
+ .settings-update-panel__head
28834
+ .codexhost-settings-icon {
28626
28835
  color: var(--settings-danger);
28627
28836
  }
28628
28837
 
@@ -28679,7 +28888,7 @@ ${error51.stderrTail}`] : []
28679
28888
  display: grid;
28680
28889
  min-width: 0;
28681
28890
  gap: 12px;
28682
- color: var(--settings-muted);
28891
+ color: var(--settings-text);
28683
28892
  font-size: 14px;
28684
28893
  line-height: 22px;
28685
28894
  overflow-wrap: anywhere;
@@ -28705,13 +28914,13 @@ ${error51.stderrTail}`] : []
28705
28914
  }
28706
28915
 
28707
28916
  .settings-update-notes h1 {
28708
- font-size: 18px;
28709
- line-height: 26px;
28917
+ font-size: 16px;
28918
+ line-height: 24px;
28710
28919
  }
28711
28920
 
28712
28921
  .settings-update-notes h2 {
28713
- font-size: 17px;
28714
- line-height: 24px;
28922
+ font-size: 15px;
28923
+ line-height: 22px;
28715
28924
  }
28716
28925
 
28717
28926
  .settings-update-notes h3,
@@ -28745,7 +28954,7 @@ ${error51.stderrTail}`] : []
28745
28954
  }
28746
28955
 
28747
28956
  .settings-update-notes li + li {
28748
- margin-top: 14px;
28957
+ margin-top: 6px;
28749
28958
  }
28750
28959
 
28751
28960
  .settings-update-notes .release-note-translation {
@@ -28819,6 +29028,27 @@ ${error51.stderrTail}`] : []
28819
29028
  margin-top: 24px;
28820
29029
  }
28821
29030
 
29031
+ .settings-update-controls.is-quiet {
29032
+ margin-top: 10px;
29033
+ }
29034
+
29035
+ .settings-update-controls.is-quiet .settings-update-manual-title {
29036
+ display: none;
29037
+ }
29038
+
29039
+ .settings-update-controls.is-quiet .settings-update-link {
29040
+ min-height: 0;
29041
+ padding: 0;
29042
+ color: var(--settings-muted);
29043
+ background: transparent;
29044
+ border: 0;
29045
+ }
29046
+
29047
+ .settings-update-controls.is-quiet .settings-update-link:hover {
29048
+ color: var(--settings-text);
29049
+ background: transparent;
29050
+ }
29051
+
28822
29052
  .settings-update-manual-title {
28823
29053
  color: var(--settings-text);
28824
29054
  font-size: 15px;
@@ -29880,7 +30110,7 @@ ${error51.stderrTail}`] : []
29880
30110
  `;
29881
30111
 
29882
30112
  // src/settings/tailwind.css
29883
- var tailwind_default = '@layer properties, theme, base, components, utilities;\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.top-full{top:100%}.left-0{left:0}.z-20{z-index:20}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-\\[45px\\]{margin-left:45px}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-\\[60px\\]{min-height:60px}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-80{width:calc(var(--spacing) * 80)}.w-full{width:100%}.w-px{width:1px}.max-w-64{max-width:calc(var(--spacing) * 64)}.min-w-0{min-width:0}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.overflow-x-auto{overflow-x:auto}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-settings-border{border-color:var(--settings-border)}.border-settings-divider{border-color:var(--settings-divider)}.bg-settings-panel{background-color:var(--settings-panel)}.bg-settings-subtle{background-color:var(--settings-subtle)}.bg-settings-surface{background-color:var(--settings-surface)}.bg-settings-surface-hover{background-color:var(--settings-surface-hover)}.bg-transparent{background-color:#0000}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.\\!px-0{padding-inline:0!important}.px-1{padding-inline:var(--spacing)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.\\!text-right{text-align:right!important}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-settings-muted{color:var(--settings-muted)}.text-settings-subtle{color:var(--settings-subtle)}.text-settings-text{color:var(--settings-text)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_30px_rgb\\(0_0_0\\/0\\.22\\)\\]{--tw-shadow:0 10px 30px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-settings-border{--tw-ring-color:var(--settings-border)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\\[state\\=failed\\]\\/status\\:bg-settings-danger:is(:where(.group\\/status)[data-state=failed] *){background-color:var(--settings-danger)}.group-data-\\[state\\=unavailable\\]\\/status\\:bg-settings-warning:is(:where(.group\\/status)[data-state=unavailable] *){background-color:var(--settings-warning)}.marker\\:text-settings-subtle ::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle ::-webkit-details-marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::-webkit-details-marker{color:var(--settings-subtle)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-0\\.5:before{content:var(--tw-content);top:calc(var(--spacing) * .5)}.before\\:left-0\\.5:before{content:var(--tw-content);left:calc(var(--spacing) * .5)}.before\\:size-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.before\\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\\:bg-white:before{content:var(--tw-content);background-color:#fff}.before\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.3\\)\\]:before{content:var(--tw-content);--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.before\\:transition-transform:before{content:var(--tw-content);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.first\\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first-of-type\\:mt-0:first-of-type{margin-top:0}.checked\\:bg-settings-focus:checked{background-color:var(--settings-focus)}.checked\\:ring-transparent:checked{--tw-ring-color:transparent}.checked\\:before\\:translate-x-4:checked:before{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.focus-within\\:border-settings-focus:focus-within{border-color:var(--settings-focus)}@media (hover:hover){.hover\\:text-settings-text:hover{color:var(--settings-text)}}.focus-visible\\:text-settings-text:focus-visible{color:var(--settings-text)}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-settings-focus:focus-visible{outline-color:var(--settings-focus)}.data-\\[invalid\\=true\\]\\:border-settings-danger[data-invalid=true]{border-color:var(--settings-danger)}.data-\\[invalid\\=true\\]\\:text-settings-danger[data-invalid=true],.data-\\[state\\=failed\\]\\:text-settings-danger[data-state=failed]{color:var(--settings-danger)}.data-\\[state\\=unavailable\\]\\:text-settings-warning[data-state=unavailable]{color:var(--settings-warning)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@layer properties{\n *, ::before, ::after, ::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-alpha:100%;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-width:0;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-drop-shadow-alpha:100%;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}\n';
30113
+ var tailwind_default = '@layer properties, theme, base, components, utilities;\n/*! tailwindcss v4.3.3 | MIT License | https://tailwindcss.com */\n@layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-tracking:initial;--tw-ordinal:initial;--tw-slashed-zero:initial;--tw-numeric-figure:initial;--tw-numeric-spacing:initial;--tw-numeric-fraction:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-backdrop-blur:initial;--tw-backdrop-brightness:initial;--tw-backdrop-contrast:initial;--tw-backdrop-grayscale:initial;--tw-backdrop-hue-rotate:initial;--tw-backdrop-invert:initial;--tw-backdrop-opacity:initial;--tw-backdrop-saturate:initial;--tw-backdrop-sepia:initial;--tw-duration:initial;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}}@layer theme{:root,:host{--spacing:.25rem;--text-xs:.75rem;--text-xs--line-height:calc(1 / .75);--text-sm:.875rem;--text-sm--line-height:calc(1.25 / .875);--text-base:1rem;--text-base--line-height:calc(1.5 / 1);--text-xl:1.25rem;--text-xl--line-height:calc(1.75 / 1.25);--font-weight-normal:400;--font-weight-medium:500;--font-weight-semibold:600;--tracking-tight:-.025em;--leading-relaxed:1.625;--radius-md:.375rem;--radius-lg:.5rem;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}}@layer utilities{.pointer-events-none{pointer-events:none}.collapse{visibility:collapse}.invisible{visibility:hidden}.visible{visibility:visible}.sr-only{clip-path:inset(50%);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.absolute{position:absolute}.relative{position:relative}.top-full{top:100%}.left-0{left:0}.z-20{z-index:20}.container{width:100%}@media (min-width:40rem){.container{max-width:40rem}}@media (min-width:48rem){.container{max-width:48rem}}@media (min-width:64rem){.container{max-width:64rem}}@media (min-width:80rem){.container{max-width:80rem}}@media (min-width:96rem){.container{max-width:96rem}}.m-0{margin:0}.mx-2{margin-inline:calc(var(--spacing) * 2)}.mt-1{margin-top:var(--spacing)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-3{margin-top:calc(var(--spacing) * 3)}.mt-4{margin-top:calc(var(--spacing) * 4)}.mt-5{margin-top:calc(var(--spacing) * 5)}.mt-7{margin-top:calc(var(--spacing) * 7)}.mt-8{margin-top:calc(var(--spacing) * 8)}.mt-16{margin-top:calc(var(--spacing) * 16)}.mb-2{margin-bottom:calc(var(--spacing) * 2)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.ml-1{margin-left:var(--spacing)}.ml-\\[45px\\]{margin-left:45px}.ml-auto{margin-left:auto}.block{display:block}.flex{display:flex}.grid{display:grid}.hidden{display:none}.inline{display:inline}.inline-flex{display:inline-flex}.list-item{display:list-item}.table{display:table}.size-1\\.5{width:calc(var(--spacing) * 1.5);height:calc(var(--spacing) * 1.5)}.size-4{width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.h-5{height:calc(var(--spacing) * 5)}.h-8{height:calc(var(--spacing) * 8)}.min-h-6{min-height:calc(var(--spacing) * 6)}.min-h-\\[60px\\]{min-height:60px}.w-9{width:calc(var(--spacing) * 9)}.w-14{width:calc(var(--spacing) * 14)}.w-80{width:calc(var(--spacing) * 80)}.w-full{width:100%}.w-px{width:1px}.max-w-64{max-width:calc(var(--spacing) * 64)}.min-w-0{min-width:0}.flex-shrink{flex-shrink:1}.shrink-0{flex-shrink:0}.border-collapse{border-collapse:collapse}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.cursor-help{cursor:help}.cursor-pointer{cursor:pointer}.resize{resize:both}.list-disc{list-style-type:disc}.appearance-none{appearance:none}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:var(--spacing)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-5{gap:calc(var(--spacing) * 5)}.gap-6{gap:calc(var(--spacing) * 6)}.overflow-x-auto{overflow-x:auto}.rounded-\\[10px\\]{border-radius:10px}.rounded-full{border-radius:3.40282e38px}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-settings-border{border-color:var(--settings-border)}.border-settings-divider{border-color:var(--settings-divider)}.bg-settings-panel{background-color:var(--settings-panel)}.bg-settings-subtle{background-color:var(--settings-subtle)}.bg-settings-surface{background-color:var(--settings-surface)}.bg-settings-surface-hover{background-color:var(--settings-surface-hover)}.bg-transparent{background-color:#0000}.p-0{padding:0}.p-4{padding:calc(var(--spacing) * 4)}.\\!px-0{padding-inline:0!important}.px-1{padding-inline:var(--spacing)}.px-2\\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pl-4{padding-left:calc(var(--spacing) * 4)}.\\!text-right{text-align:right!important}.text-left{text-align:left}.text-right{text-align:right}.align-top{vertical-align:top}.text-base{font-size:var(--text-base);line-height:var(--tw-leading,var(--text-base--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading,var(--text-sm--line-height))}.text-xl{font-size:var(--text-xl);line-height:var(--tw-leading,var(--text-xl--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading,var(--text-xs--line-height))}.text-\\[11px\\]{font-size:11px}.text-\\[13px\\]{font-size:13px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-7{--tw-leading:calc(var(--spacing) * 7);line-height:calc(var(--spacing) * 7)}.leading-\\[18px\\]{--tw-leading:18px;line-height:18px}.leading-relaxed{--tw-leading:var(--leading-relaxed);line-height:var(--leading-relaxed)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-normal{--tw-font-weight:var(--font-weight-normal);font-weight:var(--font-weight-normal)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-tight{--tw-tracking:var(--tracking-tight);letter-spacing:var(--tracking-tight)}.text-wrap{text-wrap:wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.whitespace-pre-wrap{white-space:pre-wrap}.text-settings-muted{color:var(--settings-muted)}.text-settings-subtle{color:var(--settings-subtle)}.text-settings-text{color:var(--settings-text)}.lowercase{text-transform:lowercase}.tabular-nums{--tw-numeric-spacing:tabular-nums;font-variant-numeric:var(--tw-ordinal,) var(--tw-slashed-zero,) var(--tw-numeric-figure,) var(--tw-numeric-spacing,) var(--tw-numeric-fraction,)}.opacity-0{opacity:0}.shadow{--tw-shadow:0 1px 3px 0 var(--tw-shadow-color,#0000001a), 0 1px 2px -1px var(--tw-shadow-color,#0000001a);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.shadow-\\[0_10px_30px_rgb\\(0_0_0\\/0\\.22\\)\\]{--tw-shadow:0 10px 30px var(--tw-shadow-color,#00000038);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-1{--tw-ring-shadow:var(--tw-ring-inset,) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color,currentcolor);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.ring-settings-border{--tw-ring-color:var(--settings-border)}.outline{outline-style:var(--tw-outline-style);outline-width:1px}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.backdrop-filter{-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.ring-inset{--tw-ring-inset:inset}.group-focus-within\\:visible:is(:where(.group):focus-within *){visibility:visible}.group-focus-within\\:opacity-100:is(:where(.group):focus-within *){opacity:1}@media (hover:hover){.group-hover\\:visible:is(:where(.group):hover *){visibility:visible}.group-hover\\:opacity-100:is(:where(.group):hover *){opacity:1}}.group-data-\\[state\\=failed\\]\\/status\\:bg-settings-danger:is(:where(.group\\/status)[data-state=failed] *){background-color:var(--settings-danger)}.group-data-\\[state\\=unavailable\\]\\/status\\:bg-settings-warning:is(:where(.group\\/status)[data-state=unavailable] *){background-color:var(--settings-warning)}.marker\\:text-settings-subtle ::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle ::-webkit-details-marker{color:var(--settings-subtle)}.marker\\:text-settings-subtle::-webkit-details-marker{color:var(--settings-subtle)}.before\\:absolute:before{content:var(--tw-content);position:absolute}.before\\:top-0\\.5:before{content:var(--tw-content);top:calc(var(--spacing) * .5)}.before\\:left-0\\.5:before{content:var(--tw-content);left:calc(var(--spacing) * .5)}.before\\:size-4:before{content:var(--tw-content);width:calc(var(--spacing) * 4);height:calc(var(--spacing) * 4)}.before\\:rounded-full:before{content:var(--tw-content);border-radius:3.40282e38px}.before\\:bg-white:before{content:var(--tw-content);background-color:#fff}.before\\:shadow-\\[0_1px_2px_rgb\\(0_0_0\\/0\\.3\\)\\]:before{content:var(--tw-content);--tw-shadow:0 1px 2px var(--tw-shadow-color,#0000004d);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.before\\:transition-transform:before{content:var(--tw-content);transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.first\\:border-t-0:first-child{border-top-style:var(--tw-border-style);border-top-width:0}.first-of-type\\:mt-0:first-of-type{margin-top:0}.checked\\:bg-settings-focus:checked{background-color:var(--settings-focus)}.checked\\:ring-transparent:checked{--tw-ring-color:transparent}.checked\\:before\\:translate-x-4:checked:before{content:var(--tw-content);--tw-translate-x:calc(var(--spacing) * 4);translate:var(--tw-translate-x) var(--tw-translate-y)}.focus-within\\:border-settings-focus:focus-within{border-color:var(--settings-focus)}@media (hover:hover){.hover\\:text-settings-text:hover{color:var(--settings-text)}}.focus-visible\\:text-settings-text:focus-visible{color:var(--settings-text)}.focus-visible\\:outline-2:focus-visible{outline-style:var(--tw-outline-style);outline-width:2px}.focus-visible\\:outline-offset-2:focus-visible{outline-offset:2px}.focus-visible\\:outline-settings-focus:focus-visible{outline-color:var(--settings-focus)}.data-\\[invalid\\=true\\]\\:border-settings-danger[data-invalid=true]{border-color:var(--settings-danger)}.data-\\[invalid\\=true\\]\\:text-settings-danger[data-invalid=true],.data-\\[state\\=failed\\]\\:text-settings-danger[data-state=failed]{color:var(--settings-danger)}.data-\\[state\\=unavailable\\]\\:text-settings-warning[data-state=unavailable]{color:var(--settings-warning)}}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-tracking{syntax:"*";inherits:false}@property --tw-ordinal{syntax:"*";inherits:false}@property --tw-slashed-zero{syntax:"*";inherits:false}@property --tw-numeric-figure{syntax:"*";inherits:false}@property --tw-numeric-spacing{syntax:"*";inherits:false}@property --tw-numeric-fraction{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-outline-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-backdrop-blur{syntax:"*";inherits:false}@property --tw-backdrop-brightness{syntax:"*";inherits:false}@property --tw-backdrop-contrast{syntax:"*";inherits:false}@property --tw-backdrop-grayscale{syntax:"*";inherits:false}@property --tw-backdrop-hue-rotate{syntax:"*";inherits:false}@property --tw-backdrop-invert{syntax:"*";inherits:false}@property --tw-backdrop-opacity{syntax:"*";inherits:false}@property --tw-backdrop-saturate{syntax:"*";inherits:false}@property --tw-backdrop-sepia{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@property --tw-translate-x{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-y{syntax:"*";inherits:false;initial-value:0}@property --tw-translate-z{syntax:"*";inherits:false;initial-value:0}@layer properties{\n *, ::before, ::after, ::backdrop{--tw-border-style:solid;--tw-shadow:0 0 #0000;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-alpha:100%;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-offset-width:0;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-outline-style:solid;--tw-drop-shadow-alpha:100%;--tw-content:"";--tw-translate-x:0;--tw-translate-y:0;--tw-translate-z:0}}\n';
29884
30114
 
29885
30115
  // src/settings/shell.ts
29886
30116
  var SETTINGS_SHELL_ATTRIBUTE = "data-codexhost-settings-shell";
@@ -29924,7 +30154,7 @@ ${accounts_default}`;
29924
30154
  brandCopy.className = "settings-brand__copy";
29925
30155
  const brandName = ownerDocument.createElement("span");
29926
30156
  brandName.className = "settings-brand__name";
29927
- brandName.textContent = "Codex Host";
30157
+ brandName.textContent = "CodexHost";
29928
30158
  const brandTitle = ownerDocument.createElement("span");
29929
30159
  brandTitle.className = "settings-brand__title";
29930
30160
  brandTitle.id = "codexhost-settings-dialog-title";
@@ -30140,6 +30370,7 @@ ${accounts_default}`;
30140
30370
  var SETTINGS_APPLICATION_HEADER_SELECTOR = 'header[data-pip-obstacle="app-shell-header"]';
30141
30371
  var SETTINGS_HEADER_SLOT_SELECTOR = ':scope > [data-test-id="header-shell-slot"]';
30142
30372
  var SETTINGS_HEADER_NATIVE_ACTION_GROUP_SELECTOR = ':scope > [data-app-shell-header-obstacle="true"]';
30373
+ var UPDATE_ACCENT = "#3b82f6";
30143
30374
  function measuredBounds(element) {
30144
30375
  const bounds = element.getBoundingClientRect();
30145
30376
  return {
@@ -30223,26 +30454,18 @@ ${accounts_default}`;
30223
30454
  updateButton.style.display = "none";
30224
30455
  updateButton.style.alignItems = "center";
30225
30456
  updateButton.style.justifyContent = "center";
30457
+ updateButton.style.width = "28px";
30226
30458
  updateButton.style.height = "28px";
30227
- updateButton.style.padding = "0 10px";
30228
- updateButton.style.gap = "6px";
30229
- updateButton.style.border = "1px solid #1d4ed8";
30230
- updateButton.style.borderRadius = "7px";
30231
- updateButton.style.background = "#2563eb";
30232
- updateButton.style.color = "#ffffff";
30459
+ updateButton.style.padding = "0";
30460
+ updateButton.style.border = "0";
30461
+ updateButton.style.borderRadius = "8px";
30462
+ updateButton.style.background = "transparent";
30463
+ updateButton.style.color = UPDATE_ACCENT;
30233
30464
  updateButton.style.cursor = available ? "pointer" : "not-allowed";
30234
30465
  updateButton.style.opacity = available ? "1" : "0.5";
30235
- updateButton.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.18)";
30236
30466
  updateButton.style.outlineOffset = "2px";
30237
30467
  updateButton.style.setProperty("-webkit-app-region", "no-drag");
30238
- updateButton.append(createRendererSettingsIcon("updates", 15));
30239
- const updateLabel = ownerDocument.createElement("span");
30240
- updateLabel.textContent = messages.pageLabels.updates;
30241
- updateLabel.style.fontSize = "12px";
30242
- updateLabel.style.fontWeight = "600";
30243
- updateLabel.style.lineHeight = "1";
30244
- updateLabel.style.whiteSpace = "nowrap";
30245
- updateButton.append(updateLabel);
30468
+ updateButton.append(createRendererSettingsIcon("updates", 16));
30246
30469
  const onPointerEnter = () => {
30247
30470
  if (!button.disabled) button.style.background = "rgba(127, 127, 127, 0.16)";
30248
30471
  };
@@ -30254,14 +30477,10 @@ ${accounts_default}`;
30254
30477
  if (!button.disabled) onOpen(button);
30255
30478
  };
30256
30479
  const onUpdatePointerEnter = () => {
30257
- if (!updateButton.disabled) {
30258
- updateButton.style.background = "#1d4ed8";
30259
- updateButton.style.boxShadow = "0 2px 4px rgba(15, 23, 42, 0.22)";
30260
- }
30480
+ if (!updateButton.disabled) updateButton.style.background = "rgba(59, 130, 246, 0.14)";
30261
30481
  };
30262
30482
  const onUpdatePointerLeave = () => {
30263
- updateButton.style.background = "#2563eb";
30264
- updateButton.style.boxShadow = "0 1px 2px rgba(15, 23, 42, 0.18)";
30483
+ updateButton.style.background = "transparent";
30265
30484
  };
30266
30485
  const onUpdateClick = (event) => {
30267
30486
  event.stopPropagation();
@@ -30519,6 +30738,562 @@ ${accounts_default}`;
30519
30738
  };
30520
30739
  }
30521
30740
 
30741
+ // src/renderer-native-composer-controller.ts
30742
+ var MAX_ELEMENT_DEPTH = 4;
30743
+ var MAX_FIBER_DEPTH = 40;
30744
+ function isController(value, editor) {
30745
+ if (typeof value !== "object" || value === null) return false;
30746
+ const candidate = value;
30747
+ return candidate.view?.dom === editor && typeof candidate.view.posAtDOM === "function" && typeof candidate.insertMentionNodeInRange === "function";
30748
+ }
30749
+ function fiberOf(element) {
30750
+ const key = Object.keys(element).find((name) => name.startsWith("__reactFiber$"));
30751
+ return key ? element[key] : null;
30752
+ }
30753
+ function findNativeComposerController(editor) {
30754
+ let element = editor;
30755
+ for (let depth = 0; element && depth < MAX_ELEMENT_DEPTH; depth += 1) {
30756
+ let fiber = fiberOf(element);
30757
+ for (let level = 0; fiber && level < MAX_FIBER_DEPTH; level += 1) {
30758
+ const props = fiber.memoizedProps;
30759
+ if (props && isController(props.composerController, editor)) return props.composerController;
30760
+ fiber = fiber.return;
30761
+ }
30762
+ element = element.parentElement;
30763
+ }
30764
+ return null;
30765
+ }
30766
+ function resolveRange(controller, range) {
30767
+ const from = controller.view.posAtDOM(range.node, range.start);
30768
+ const to = controller.view.posAtDOM(range.node, range.end);
30769
+ return controller.view.state.doc.textBetween(from, to) === range.expected ? { from, to } : null;
30770
+ }
30771
+ function insertNativeTextAtSelection(editor, build) {
30772
+ const controller = findNativeComposerController(editor);
30773
+ if (!controller || typeof controller.view.dispatch !== "function") return false;
30774
+ try {
30775
+ const { from } = controller.view.state.selection;
30776
+ const previous = from > 0 ? controller.view.state.doc.textBetween(from - 1, from) : "";
30777
+ controller.view.dispatch(controller.view.state.tr.insertText(build(previous)));
30778
+ return true;
30779
+ } catch {
30780
+ return false;
30781
+ }
30782
+ }
30783
+ function deleteNativeRange(editor, range) {
30784
+ const controller = findNativeComposerController(editor);
30785
+ if (!controller || typeof controller.view.dispatch !== "function") return false;
30786
+ try {
30787
+ const resolved = resolveRange(controller, range);
30788
+ if (!resolved) return false;
30789
+ controller.view.dispatch(controller.view.state.tr.delete(resolved.from, resolved.to));
30790
+ return true;
30791
+ } catch {
30792
+ return false;
30793
+ }
30794
+ }
30795
+ function insertNativeAgentMention(editor, range, mention) {
30796
+ const controller = findNativeComposerController(editor);
30797
+ const nodeType = controller?.view.state.schema.nodes.agentMention;
30798
+ if (!controller || !nodeType) return false;
30799
+ try {
30800
+ const resolved = resolveRange(controller, range);
30801
+ if (!resolved) return false;
30802
+ const { from, to } = resolved;
30803
+ controller.insertMentionNodeInRange(
30804
+ nodeType,
30805
+ {
30806
+ conversationId: null,
30807
+ displayName: mention.displayName,
30808
+ name: mention.name,
30809
+ path: mention.path
30810
+ },
30811
+ from,
30812
+ to,
30813
+ true
30814
+ );
30815
+ return true;
30816
+ } catch {
30817
+ return false;
30818
+ }
30819
+ }
30820
+
30821
+ // src/renderer-delegation-mention.ts
30822
+ var MENU_ATTRIBUTE = "data-codexhost-delegation-mention-menu";
30823
+ var STYLE_ATTRIBUTE3 = "data-codexhost-delegation-mention-style";
30824
+ var MENU_MAX_HEIGHT = 320;
30825
+ var SOURCE_TAG = "codexhost";
30826
+ var MENU_CLASS = "border-default bg-surface-elevated-secondary flex flex-col overflow-hidden rounded-[var(--radius-suggestion-menu,var(--radius-2xl))] border text-sm backdrop-blur-sm";
30827
+ var LIST_CLASS = "vertical-scroll-fade-mask flex w-full flex-1 flex-col overflow-y-auto";
30828
+ var HEADER_CLASS = "text-codex-description sticky top-0 z-10 px-row-x py-1 text-sm bg-surface-elevated-secondary";
30829
+ var ROW_CLASS = "text-default outline-hidden cursor-interaction flex w-full min-h-[var(--app-menu-item-height,0px)] shrink-0 items-center overflow-hidden rounded-[var(--suggestion-menu-item-radius,var(--radius-xl))] p-[var(--suggestion-menu-item-padding,var(--app-menu-item-padding,var(--padding-row-y)_var(--padding-row-x)))] text-start text-sm";
30830
+ var ROW_CONTENT_CLASS = "flex w-full min-w-0 items-center gap-[var(--spacing-menu-item-content,calc(var(--spacing)*1.5))]";
30831
+ var ROW_HIGHLIGHT_CLASSES = ["bg-primary-ghost-hover", "opacity-100"];
30832
+ var ROW_IDLE_CLASS = "menu-row-opacity";
30833
+ var VIEWPORT_MARGIN = 8;
30834
+ var MENU_GAP2 = 4;
30835
+ var MAX_QUERY_LENGTH = 32;
30836
+ var TRIGGER_PATTERN = /(?:^|\s)#([^\s#]*)$/u;
30837
+ function findDelegationTrigger(textBeforeCaret) {
30838
+ const match = TRIGGER_PATTERN.exec(textBeforeCaret);
30839
+ if (!match) return null;
30840
+ const query = match[1] ?? "";
30841
+ if (query.length > MAX_QUERY_LENGTH || /^\d/u.test(query)) return null;
30842
+ return { query, start: textBeforeCaret.length - query.length - 1 };
30843
+ }
30844
+ function filterDelegationTargets(targets, query) {
30845
+ const needle = query.trim().toLowerCase();
30846
+ if (!needle) return [...targets];
30847
+ const scored = targets.flatMap((target, index) => {
30848
+ const label = target.label.toLowerCase();
30849
+ const id = target.agent.toLowerCase();
30850
+ const score = label.startsWith(needle) || id.startsWith(needle) ? 2 : label.includes(needle) || id.includes(needle) ? 1 : 0;
30851
+ return score > 0 ? [{ target, score, index }] : [];
30852
+ });
30853
+ return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target }) => target);
30854
+ }
30855
+ function filterDelegationCommands(commands, query) {
30856
+ const needle = query.trim().toLowerCase().replace(/^\//u, "");
30857
+ if (!needle) return [...commands];
30858
+ const scored = commands.flatMap((command, index) => {
30859
+ const invocation = command.invocation.toLowerCase().replace(/^\//u, "");
30860
+ const label = command.label.toLowerCase();
30861
+ const display = harnessCommandDisplayName(command.label).toLowerCase();
30862
+ const score = invocation.startsWith(needle) || display.startsWith(needle) ? 2 : invocation.includes(needle) || label.includes(needle) || display.includes(needle) ? 1 : 0;
30863
+ return score > 0 ? [{ command, score, index }] : [];
30864
+ });
30865
+ return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ command }) => command);
30866
+ }
30867
+ function harnessCommandDisplayName(label) {
30868
+ const slug = label.trim().replace(/^\//u, "").replace(/^skill:/u, "");
30869
+ if (!slug || /\s/u.test(slug) || /[A-Z]/u.test(slug) || /[^\x00-\x7F]/u.test(slug)) {
30870
+ return slug || label;
30871
+ }
30872
+ const name = slug.split(":").filter(Boolean).at(-1) ?? slug;
30873
+ return name.split(/[-_.]+/u).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
30874
+ }
30875
+ var SVG_NS3 = "http://www.w3.org/2000/svg";
30876
+ function createSkillIcon(ownerDocument) {
30877
+ const svg = ownerDocument.createElementNS(SVG_NS3, "svg");
30878
+ svg.setAttribute("viewBox", "0 0 24 24");
30879
+ svg.setAttribute("fill", "none");
30880
+ svg.setAttribute("stroke", "currentColor");
30881
+ svg.setAttribute("stroke-width", "1.7");
30882
+ svg.setAttribute("stroke-linejoin", "round");
30883
+ svg.setAttribute("aria-hidden", "true");
30884
+ const path = ownerDocument.createElementNS(SVG_NS3, "path");
30885
+ path.setAttribute("d", "M12 3 20 7.5v9L12 21l-8-4.5v-9ZM4 7.5 12 12l8-4.5M12 12v9");
30886
+ svg.append(path);
30887
+ return svg;
30888
+ }
30889
+ function agentsTitle(locale) {
30890
+ return locale === "zh-CN" ? "\u59D4\u6D3E\u7ED9 Agent" : "Delegate to agent";
30891
+ }
30892
+ function commandsTitle(locale) {
30893
+ return locale === "zh-CN" ? "\u547D\u4EE4" : "Commands";
30894
+ }
30895
+ function skillsTitle(locale) {
30896
+ return locale === "zh-CN" ? "\u6280\u80FD" : "Skills";
30897
+ }
30898
+ function iconUrl(agent, ownerDocument) {
30899
+ const icon2 = createRendererAgentIcon(agent, 16, ownerDocument);
30900
+ if (icon2.tagName.toLowerCase() === "img") return icon2.src || null;
30901
+ const view = ownerDocument.defaultView;
30902
+ if (!view?.XMLSerializer) return null;
30903
+ const markup = new view.XMLSerializer().serializeToString(icon2).replaceAll("currentColor", "#808080");
30904
+ return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(markup)}`;
30905
+ }
30906
+ function cssString(value) {
30907
+ return `"${value.replace(/["\\\n]/gu, (character) => `\\${character === "\n" ? "a " : character}`)}"`;
30908
+ }
30909
+ function syncChipStyle(ownerDocument, targets, cache) {
30910
+ let style = ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE3}]`);
30911
+ if (!style) {
30912
+ style = ownerDocument.createElement("style");
30913
+ style.setAttribute(STYLE_ATTRIBUTE3, "true");
30914
+ (ownerDocument.head ?? ownerDocument.documentElement).append(style);
30915
+ }
30916
+ const chip = [DELEGATION_MENTION_PATH_PREFIX, HARNESS_COMMAND_MENTION_PATH_PREFIX].map((prefix) => `[agent-mention-path^=${cssString(prefix)}][agent-mention-display-name]`).join(",");
30917
+ const withPseudo = (pseudo) => chip.split(",").map((selector) => `${selector}${pseudo}`).join(",");
30918
+ const rules = [
30919
+ withPseudo(" > span:last-child") + "{display:none;}",
30920
+ withPseudo("::after") + "{content:attr(agent-mention-display-name);}",
30921
+ ...targets.flatMap(({ agent }) => {
30922
+ if (!cache.has(agent)) cache.set(agent, iconUrl(agent, ownerDocument));
30923
+ const url2 = cache.get(agent);
30924
+ if (!url2) return [];
30925
+ const selector = `[agent-mention-path=${cssString(delegationMentionPath(agent))}]::before`;
30926
+ return [
30927
+ `${selector}{content:"";display:inline-block;width:16px;height:16px;margin-inline-end:3px;vertical-align:-3px;background:url(${cssString(url2)}) center/contain no-repeat;}`
30928
+ ];
30929
+ })
30930
+ ];
30931
+ const text = rules.join("\n");
30932
+ if (style.textContent !== text) style.textContent = text;
30933
+ }
30934
+ function installRendererDelegationMention(ownerDocument, options) {
30935
+ const view = ownerDocument.defaultView;
30936
+ if (!view) {
30937
+ return { refresh: () => void 0, openFor: () => void 0, dispose: () => void 0 };
30938
+ }
30939
+ const iconCache = /* @__PURE__ */ new Map();
30940
+ const menu = ownerDocument.createElement("div");
30941
+ menu.setAttribute(MENU_ATTRIBUTE, "true");
30942
+ menu.className = MENU_CLASS;
30943
+ Object.assign(menu.style, {
30944
+ display: "none",
30945
+ position: "fixed",
30946
+ zIndex: "2147483647",
30947
+ maxHeight: `min(${MENU_MAX_HEIGHT}px, calc(100vh - ${VIEWPORT_MARGIN * 2}px))`,
30948
+ padding: "var(--spacing)"
30949
+ });
30950
+ const list = ownerDocument.createElement("div");
30951
+ list.className = LIST_CLASS;
30952
+ list.setAttribute("role", "listbox");
30953
+ menu.append(list);
30954
+ ownerDocument.body.append(menu);
30955
+ const isMenuOpen = () => menu.style.display !== "none";
30956
+ const setMenuOpen = (open) => {
30957
+ menu.style.display = open ? "flex" : "none";
30958
+ };
30959
+ let active = null;
30960
+ let entries = [];
30961
+ let activeIndex = 0;
30962
+ let composing = false;
30963
+ let inserting = false;
30964
+ let openedFor = null;
30965
+ let rowsRendered = 0;
30966
+ const close = () => {
30967
+ active = null;
30968
+ entries = [];
30969
+ setMenuOpen(false);
30970
+ list.replaceChildren();
30971
+ };
30972
+ const highlight = () => {
30973
+ [...list.querySelectorAll("[role=option]")].forEach((item, index) => {
30974
+ const selected = index === activeIndex;
30975
+ item.setAttribute("aria-selected", String(selected));
30976
+ for (const name of ROW_HIGHLIGHT_CLASSES) item.classList.toggle(name, selected);
30977
+ item.classList.toggle(ROW_IDLE_CLASS, !selected);
30978
+ if (selected) item.scrollIntoView({ block: "nearest" });
30979
+ });
30980
+ };
30981
+ const position = (trigger) => {
30982
+ const anchor = options.anchorForEditor(trigger.editor) ?? trigger.editor;
30983
+ const rect = anchor.getBoundingClientRect();
30984
+ const width = Math.min(rect.width, view.innerWidth - VIEWPORT_MARGIN * 2);
30985
+ const left = Math.max(
30986
+ VIEWPORT_MARGIN,
30987
+ Math.min(rect.left, view.innerWidth - width - VIEWPORT_MARGIN)
30988
+ );
30989
+ menu.style.width = `${width}px`;
30990
+ menu.style.left = `${left}px`;
30991
+ const height = menu.getBoundingClientRect().height;
30992
+ const above = rect.top >= height + MENU_GAP2 + VIEWPORT_MARGIN;
30993
+ menu.style.top = above ? `${rect.top - height - MENU_GAP2}px` : `${Math.min(view.innerHeight - height - VIEWPORT_MARGIN, rect.bottom + MENU_GAP2)}px`;
30994
+ };
30995
+ const sectionHeader = (title) => {
30996
+ const header = ownerDocument.createElement("div");
30997
+ header.className = `${HEADER_CLASS} flex items-center justify-between gap-2`;
30998
+ const label = ownerDocument.createElement("span");
30999
+ label.className = "min-w-0 truncate";
31000
+ label.textContent = title;
31001
+ const source = ownerDocument.createElement("span");
31002
+ source.className = "shrink-0 text-sm text-codex-description";
31003
+ source.setAttribute("data-codexhost-source", "");
31004
+ source.textContent = SOURCE_TAG;
31005
+ header.append(label, source);
31006
+ return header;
31007
+ };
31008
+ const rowContent = (leading, labelText, detailText) => {
31009
+ const content = ownerDocument.createElement("div");
31010
+ content.className = ROW_CONTENT_CLASS;
31011
+ if (leading) {
31012
+ leading.classList.add("icon-xs", "shrink-0");
31013
+ content.append(leading);
31014
+ }
31015
+ const label = ownerDocument.createElement("span");
31016
+ label.className = "min-w-0 shrink truncate";
31017
+ label.textContent = labelText;
31018
+ content.append(label);
31019
+ if (detailText) {
31020
+ const detail = ownerDocument.createElement("span");
31021
+ detail.className = "flex-1 truncate text-codex-description";
31022
+ detail.textContent = detailText;
31023
+ content.append(detail);
31024
+ }
31025
+ return content;
31026
+ };
31027
+ const optionRow = (entry, content) => {
31028
+ const index = entries.length;
31029
+ entries.push(entry);
31030
+ const item = ownerDocument.createElement("div");
31031
+ item.setAttribute("role", "option");
31032
+ item.className = ROW_CLASS;
31033
+ item.append(content);
31034
+ item.addEventListener("pointermove", () => {
31035
+ if (activeIndex === index) return;
31036
+ activeIndex = index;
31037
+ highlight();
31038
+ });
31039
+ item.addEventListener("mousedown", (event) => event.preventDefault());
31040
+ item.addEventListener("click", () => void choose(entry));
31041
+ return item;
31042
+ };
31043
+ const render = (trigger, commands, targets) => {
31044
+ const locale = options.readLocale();
31045
+ const rows = [];
31046
+ entries = [];
31047
+ if (targets.length > 0) {
31048
+ rows.push(sectionHeader(agentsTitle(locale)));
31049
+ for (const target of targets) {
31050
+ rows.push(
31051
+ optionRow(
31052
+ { kind: "agent", target },
31053
+ rowContent(createRendererAgentIcon(target.agent, 16, ownerDocument), target.label, "")
31054
+ )
31055
+ );
31056
+ }
31057
+ }
31058
+ if (commands) {
31059
+ const groups = [
31060
+ [commandsTitle(locale), commands.matches.filter(({ kind }) => kind !== "skill")],
31061
+ [skillsTitle(locale), commands.matches.filter(({ kind }) => kind === "skill")]
31062
+ ];
31063
+ for (const [title, group] of groups) {
31064
+ if (group.length === 0) continue;
31065
+ rows.push(sectionHeader(title));
31066
+ for (const command of group) {
31067
+ const reason = commands.source.disabledReason(command);
31068
+ const presentation = rendererHarnessCommandPresentation(command, locale);
31069
+ const content = rowContent(
31070
+ command.kind === "skill" ? createSkillIcon(ownerDocument) : createHarnessCommandIcon(ownerDocument),
31071
+ harnessCommandDisplayName(presentation.label),
31072
+ reason ?? presentation.description
31073
+ );
31074
+ content.setAttribute("data-command-id", command.id);
31075
+ if (reason === null) {
31076
+ rows.push(optionRow({ kind: "command", command, source: commands.source }, content));
31077
+ } else {
31078
+ const disabled = ownerDocument.createElement("div");
31079
+ disabled.setAttribute("aria-disabled", "true");
31080
+ disabled.className = `${ROW_CLASS} opacity-50`;
31081
+ disabled.append(content);
31082
+ rows.push(disabled);
31083
+ }
31084
+ }
31085
+ }
31086
+ }
31087
+ const notice = commands?.source.pendingNotice;
31088
+ if (notice && (rows.length > 0 || trigger.query === "")) {
31089
+ if (!rows.some((row) => row.querySelector("[data-command-id]"))) {
31090
+ rows.push(sectionHeader(commandsTitle(locale)));
31091
+ }
31092
+ const hint = ownerDocument.createElement("div");
31093
+ hint.setAttribute("data-codexhost-command-notice", "");
31094
+ hint.className = "px-row-x py-1.5 text-sm text-codex-description";
31095
+ hint.textContent = notice;
31096
+ rows.push(hint);
31097
+ }
31098
+ rowsRendered = rows.length;
31099
+ list.replaceChildren(...rows);
31100
+ activeIndex = Math.min(activeIndex, Math.max(0, entries.length - 1));
31101
+ setMenuOpen(true);
31102
+ highlight();
31103
+ position(trigger);
31104
+ };
31105
+ const readTrigger = () => {
31106
+ const selection = ownerDocument.getSelection();
31107
+ if (!selection?.isCollapsed || selection.rangeCount === 0) return null;
31108
+ const node2 = selection.anchorNode;
31109
+ if (!node2 || node2.nodeType !== node2.TEXT_NODE) return null;
31110
+ const editor = node2.parentElement?.closest('[contenteditable="true"]');
31111
+ if (!editor || !options.isComposerEditor(editor)) return null;
31112
+ const text = node2;
31113
+ const found = findDelegationTrigger(text.data.slice(0, selection.anchorOffset));
31114
+ if (!found) return null;
31115
+ return {
31116
+ editor,
31117
+ node: text,
31118
+ start: found.start,
31119
+ end: selection.anchorOffset,
31120
+ query: found.query
31121
+ };
31122
+ };
31123
+ const refresh = () => {
31124
+ if (inserting || composing) return;
31125
+ const trigger = readTrigger();
31126
+ if (!trigger) {
31127
+ openedFor = null;
31128
+ close();
31129
+ return;
31130
+ }
31131
+ if (openedFor?.node !== trigger.node || openedFor.start !== trigger.start) {
31132
+ openedFor = { node: trigger.node, start: trigger.start };
31133
+ options.onOpen?.(trigger.editor);
31134
+ }
31135
+ const allTargets = options.readTargets();
31136
+ syncChipStyle(ownerDocument, allTargets, iconCache);
31137
+ const targets = filterDelegationTargets(allTargets, trigger.query);
31138
+ const source = options.readCommands(trigger.editor);
31139
+ const commandMatches = source ? filterDelegationCommands(source.commands, trigger.query) : [];
31140
+ const showsNotice = Boolean(source?.pendingNotice) && trigger.query === "";
31141
+ if (targets.length === 0 && commandMatches.length === 0 && !showsNotice) {
31142
+ close();
31143
+ return;
31144
+ }
31145
+ const sameQuery = active?.query === trigger.query && active.node === trigger.node;
31146
+ active = trigger;
31147
+ if (!sameQuery) activeIndex = 0;
31148
+ render(trigger, source ? { source, matches: commandMatches } : null, targets);
31149
+ if (rowsRendered === 0) close();
31150
+ };
31151
+ const waitForSelectionSync = () => new Promise((resolve) => view.setTimeout(resolve, 0));
31152
+ const selectTriggerText = async (trigger) => {
31153
+ const selection = ownerDocument.getSelection();
31154
+ if (!selection) return false;
31155
+ const range = ownerDocument.createRange();
31156
+ range.setStart(trigger.node, trigger.start);
31157
+ range.setEnd(trigger.node, trigger.end);
31158
+ trigger.editor.focus({ preventScroll: true });
31159
+ selection.removeAllRanges();
31160
+ selection.addRange(range);
31161
+ await waitForSelectionSync();
31162
+ return true;
31163
+ };
31164
+ const insertAgent = async (trigger, range, target) => {
31165
+ const path = delegationMentionPath(target.agent);
31166
+ if (insertNativeAgentMention(trigger.editor, range, {
31167
+ name: target.label,
31168
+ displayName: target.label,
31169
+ path
31170
+ })) {
31171
+ return;
31172
+ }
31173
+ if (!await selectTriggerText(trigger)) return;
31174
+ const carrier = `${formatDelegationMentionLink({ harnessId: target.agent, label: target.label })} `;
31175
+ const pasted = dispatchPlainTextPaste(trigger.editor, carrier);
31176
+ if (!pasted) ownerDocument.execCommand("insertText", false, carrier);
31177
+ };
31178
+ const runCommand = async (trigger, range, entry) => {
31179
+ const { command, source } = entry;
31180
+ if (!rendererHarnessCommandExecutesDirectly(command)) {
31181
+ let path = null;
31182
+ try {
31183
+ path = harnessCommandMentionPath(command.invocation);
31184
+ } catch {
31185
+ path = null;
31186
+ }
31187
+ if (path && insertNativeAgentMention(trigger.editor, range, {
31188
+ name: command.invocation,
31189
+ displayName: command.invocation,
31190
+ path
31191
+ })) {
31192
+ return;
31193
+ }
31194
+ }
31195
+ if (!deleteNativeRange(trigger.editor, range)) {
31196
+ if (!await selectTriggerText(trigger)) return;
31197
+ ownerDocument.execCommand("delete");
31198
+ }
31199
+ source.select(command);
31200
+ };
31201
+ const choose = async (entry) => {
31202
+ const trigger = active;
31203
+ close();
31204
+ if (!trigger || !trigger.node.isConnected) return;
31205
+ const expected = `#${trigger.query}`;
31206
+ if (trigger.node.data.slice(trigger.start, trigger.end) !== expected) return;
31207
+ const range = { node: trigger.node, start: trigger.start, end: trigger.end, expected };
31208
+ inserting = true;
31209
+ try {
31210
+ if (entry.kind === "agent") await insertAgent(trigger, range, entry.target);
31211
+ else await runCommand(trigger, range, entry);
31212
+ } finally {
31213
+ inserting = false;
31214
+ }
31215
+ };
31216
+ const onKeyDown = (event) => {
31217
+ if (!isMenuOpen() || !active || event.isComposing) return;
31218
+ if (entries.length === 0 && event.key !== "Escape") return;
31219
+ let handled = true;
31220
+ if (event.key === "ArrowDown") activeIndex = (activeIndex + 1) % entries.length;
31221
+ else if (event.key === "ArrowUp") {
31222
+ activeIndex = (activeIndex - 1 + entries.length) % entries.length;
31223
+ } else if (event.key === "Enter" || event.key === "Tab") {
31224
+ const entry = entries[activeIndex];
31225
+ if (entry) void choose(entry);
31226
+ } else if (event.key === "Escape") close();
31227
+ else handled = false;
31228
+ if (!handled) return;
31229
+ event.preventDefault();
31230
+ event.stopImmediatePropagation();
31231
+ if (isMenuOpen()) highlight();
31232
+ };
31233
+ const onCompositionStart = () => {
31234
+ composing = true;
31235
+ };
31236
+ const onCompositionEnd = () => {
31237
+ composing = false;
31238
+ refresh();
31239
+ };
31240
+ const onPointerDown = (event) => {
31241
+ if (isMenuOpen() && !menu.contains(event.target)) close();
31242
+ };
31243
+ const onViewportChange = () => {
31244
+ if (active && isMenuOpen()) position(active);
31245
+ };
31246
+ view.addEventListener("keydown", onKeyDown, true);
31247
+ ownerDocument.addEventListener("input", refresh, true);
31248
+ ownerDocument.addEventListener("selectionchange", refresh);
31249
+ ownerDocument.addEventListener("compositionstart", onCompositionStart, true);
31250
+ ownerDocument.addEventListener("compositionend", onCompositionEnd, true);
31251
+ ownerDocument.addEventListener("pointerdown", onPointerDown, true);
31252
+ view.addEventListener("resize", onViewportChange);
31253
+ view.addEventListener("scroll", onViewportChange, true);
31254
+ const dispose = () => {
31255
+ view.removeEventListener("keydown", onKeyDown, true);
31256
+ ownerDocument.removeEventListener("input", refresh, true);
31257
+ ownerDocument.removeEventListener("selectionchange", refresh);
31258
+ ownerDocument.removeEventListener("compositionstart", onCompositionStart, true);
31259
+ ownerDocument.removeEventListener("compositionend", onCompositionEnd, true);
31260
+ ownerDocument.removeEventListener("pointerdown", onPointerDown, true);
31261
+ view.removeEventListener("resize", onViewportChange);
31262
+ view.removeEventListener("scroll", onViewportChange, true);
31263
+ menu.remove();
31264
+ ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE3}]`)?.remove();
31265
+ };
31266
+ const openFor = (editor) => {
31267
+ editor.focus({ preventScroll: true });
31268
+ const trigger = (previous2) => previous2 && !/\s/u.test(previous2) ? " #" : "#";
31269
+ if (insertNativeTextAtSelection(editor, trigger)) return;
31270
+ const selection = ownerDocument.getSelection();
31271
+ const node2 = selection?.anchorNode;
31272
+ const previous = node2?.nodeType === node2?.TEXT_NODE && selection && selection.anchorOffset > 0 ? node2.data.charAt(selection.anchorOffset - 1) : "";
31273
+ ownerDocument.execCommand("insertText", false, trigger(previous));
31274
+ };
31275
+ return {
31276
+ openFor,
31277
+ refresh: () => {
31278
+ if (openedFor) refresh();
31279
+ },
31280
+ dispose
31281
+ };
31282
+ }
31283
+ function dispatchPlainTextPaste(editor, text) {
31284
+ const view = editor.ownerDocument.defaultView;
31285
+ if (!view?.DataTransfer || !view.ClipboardEvent) return false;
31286
+ const data = new view.DataTransfer();
31287
+ data.setData("text/plain", text);
31288
+ const event = new view.ClipboardEvent("paste", {
31289
+ bubbles: true,
31290
+ cancelable: true,
31291
+ clipboardData: data
31292
+ });
31293
+ editor.dispatchEvent(event);
31294
+ return event.defaultPrevented;
31295
+ }
31296
+
30522
31297
  // src/renderer-binding-probe.ts
30523
31298
  var externalHarnessIds = {
30524
31299
  pi: harnessIdSchema.parse("pi"),
@@ -30534,7 +31309,8 @@ ${accounts_default}`;
30534
31309
  "cursor-cli": harnessIdSchema.parse("cursor-cli"),
30535
31310
  hermes: harnessIdSchema.parse("hermes"),
30536
31311
  qoder: harnessIdSchema.parse("qoder"),
30537
- "qoder-cn": harnessIdSchema.parse("qoder-cn")
31312
+ "qoder-cn": harnessIdSchema.parse("qoder-cn"),
31313
+ "kimi-code": harnessIdSchema.parse("kimi-code")
30538
31314
  };
30539
31315
  var externalAgents = [
30540
31316
  "pi",
@@ -30550,7 +31326,8 @@ ${accounts_default}`;
30550
31326
  "cursor-cli",
30551
31327
  "hermes",
30552
31328
  "qoder",
30553
- "qoder-cn"
31329
+ "qoder-cn",
31330
+ "kimi-code"
30554
31331
  ];
30555
31332
  function isRetryableHarnessAvailability(availability, error51) {
30556
31333
  return availability !== void 0 && availability !== "ready" && availability !== "notInstalled" && error51?.retryable === true;
@@ -30758,6 +31535,21 @@ ${accounts_default}`;
30758
31535
  ...permissionModeId ? { permissionModeId } : {}
30759
31536
  };
30760
31537
  }
31538
+ if (inspection.harnessId === "kimi-code") {
31539
+ const route = decodeHarnessPluginRoute(inspection.transportModelId);
31540
+ if (!route || route.harnessId !== inspection.harnessId) {
31541
+ throw new Error("Kimi Code Thread reported an incompatible transport Model");
31542
+ }
31543
+ const model = inspection.effectiveModel ?? route.model;
31544
+ const thinkingOptionId = inspection.availableThinkingOptions !== void 0 ? selectableThinkingOptionId(inspection) : inspection.effectiveThinkingOptionId ?? route.thinkingOptionId;
31545
+ const permissionModeId = inspection.effectivePermissionModeId ?? route.permissionModeId;
31546
+ return {
31547
+ agent: inspection.harnessId,
31548
+ ...model ? { model } : {},
31549
+ ...thinkingOptionId ? { thinkingOptionId } : {},
31550
+ ...permissionModeId ? { permissionModeId } : {}
31551
+ };
31552
+ }
30761
31553
  throw new Error("Thread owner is not a Renderer Agent");
30762
31554
  }
30763
31555
  function isOwnershipSubmissionBlocked(status) {
@@ -30907,7 +31699,8 @@ ${accounts_default}`;
30907
31699
  "cursor-cli": void 0,
30908
31700
  hermes: void 0,
30909
31701
  qoder: void 0,
30910
- "qoder-cn": void 0
31702
+ "qoder-cn": void 0,
31703
+ "kimi-code": void 0
30911
31704
  },
30912
31705
  webUi: Object.fromEntries(
30913
31706
  externalAgents.map((agent) => [agent, false])
@@ -30984,12 +31777,16 @@ ${accounts_default}`;
30984
31777
  })
30985
31778
  );
30986
31779
  };
31780
+ const showCodexUsageGateStatus = (mounted, status) => {
31781
+ const title = status === "unsupported" ? rendererHarnessMessages(settingsLifecycle.locale).codexUsageGateUnavailable : "";
31782
+ if (mounted.control.root.title !== title) mounted.control.root.title = title;
31783
+ };
30987
31784
  const renderMounted = (mounted) => {
30988
31785
  const accounts = composerCodexAccounts(mounted.composer);
30989
31786
  const currentCodexAccount = accounts?.accounts.find(
30990
31787
  ({ accountId }) => accountId === accounts.readyAccountId
30991
31788
  );
30992
- renderComposerAgentControl(
31789
+ const externalSubmissionReady = renderComposerAgentControl(
30993
31790
  mounted.control,
30994
31791
  controller.get(mounted.composer),
30995
31792
  adapterStatus.state,
@@ -31003,6 +31800,7 @@ ${accounts_default}`;
31003
31800
  currentCodexAccount ?? null,
31004
31801
  mounted.ownershipStatus === "error"
31005
31802
  );
31803
+ showCodexUsageGateStatus(mounted, mounted.codexUsageGate.update(externalSubmissionReady));
31006
31804
  if (mounted.control.usage) {
31007
31805
  mounted.control.usage.onOpen = () => {
31008
31806
  void refreshThreadUsage(
@@ -31012,22 +31810,38 @@ ${accounts_default}`;
31012
31810
  };
31013
31811
  }
31014
31812
  };
31015
- const refreshCommands = async (mounted) => {
31813
+ let delegationMention = null;
31814
+ const draftWorkspaces = /* @__PURE__ */ new Map();
31815
+ {
31816
+ const published = Reflect.get(window, "__codexhostDraftWorkspacesV1");
31817
+ if (typeof published === "object" && published !== null) {
31818
+ for (const [hostId, cwd] of Object.entries(published)) {
31819
+ if (typeof cwd === "string" && cwd.length > 0) draftWorkspaces.set(hostId, cwd);
31820
+ }
31821
+ }
31822
+ }
31823
+ const refreshCommands = async (mounted, { keepCurrent = false } = {}) => {
31016
31824
  const generation = ++mounted.commandRequestGeneration;
31017
31825
  const agent = controller.get(mounted.composer).agent;
31018
- const hostId = threadIdFromComposerModelTarget(mounted.modelTarget) ? mounted.hostId : activeModelHostId();
31826
+ const threadId = threadIdFromComposerModelTarget(mounted.modelTarget);
31827
+ const hostId = threadId ? mounted.hostId : activeModelHostId();
31019
31828
  const requestControl = modelControl;
31020
31829
  const client = modelClientForHostFrom(requestControl, hostId);
31021
- mounted.control.harnessCommands.setCommands([]);
31830
+ if (!keepCurrent || agent === "codex") mounted.control.harnessCommands.setCommands([]);
31022
31831
  if (agent === "codex" || !client) return;
31023
31832
  try {
31024
- const catalog = await client.inspectHarnessCommands({ harnessId: externalHarnessIds[agent] });
31833
+ const catalog = threadId ? await client.inspectThreadCommands({ threadId }) : await client.inspectHarnessCommands({
31834
+ harnessId: externalHarnessIds[agent],
31835
+ ...hostId && draftWorkspaces.has(hostId) ? { cwd: draftWorkspaces.get(hostId) } : {}
31836
+ });
31025
31837
  if (disposed || mountedByComposer.get(mounted.composer) !== mounted || mounted.commandRequestGeneration !== generation || requestControl !== modelControl || (threadIdFromComposerModelTarget(mounted.modelTarget) ? mounted.hostId : activeModelHostId()) !== hostId || controller.get(mounted.composer).agent !== agent)
31026
31838
  return;
31027
31839
  mounted.control.harnessCommands.setCommands(
31028
31840
  catalog.commands,
31029
- threadIdFromComposerModelTarget(mounted.modelTarget) !== null
31841
+ threadIdFromComposerModelTarget(mounted.modelTarget) !== null,
31842
+ catalog.source
31030
31843
  );
31844
+ delegationMention?.refresh();
31031
31845
  } catch {
31032
31846
  }
31033
31847
  };
@@ -32240,15 +33054,16 @@ ${accounts_default}`;
32240
33054
  if (!composer.isConnected || !mounted2) return;
32241
33055
  void selectPermissionMode(mounted2, permissionModeId);
32242
33056
  },
32243
- (command) => {
32244
- const mounted2 = mountedByComposer.get(composer);
32245
- if (mounted2) selectCommand(mounted2, command);
33057
+ () => {
33058
+ const editor2 = composer.querySelector(EDITOR_SELECTOR);
33059
+ if (editor2) delegationMention?.openFor(editor2);
32246
33060
  }
32247
33061
  );
32248
33062
  const mounted = {
32249
33063
  composer,
32250
33064
  composerId: state.composerId,
32251
33065
  control,
33066
+ codexUsageGate: createRendererCodexUsageGate(composer),
32252
33067
  modelTarget,
32253
33068
  modelView: inherited?.modelView ?? { status: "idle" },
32254
33069
  permissionModeView: inherited?.permissionModeView ?? { status: "idle" },
@@ -32308,6 +33123,7 @@ ${accounts_default}`;
32308
33123
  window.clearTimeout(timer);
32309
33124
  usageRefreshTimers.delete(composer);
32310
33125
  }
33126
+ mounted.codexUsageGate.dispose();
32311
33127
  disposeComposerAgentControl(mounted.control);
32312
33128
  mountedByComposer.delete(composer);
32313
33129
  continue;
@@ -32316,6 +33132,7 @@ ${accounts_default}`;
32316
33132
  const hideCodexControls = controller.isSwitching(composer) || state.agent !== "codex";
32317
33133
  reconcileComposerNativeControls(mounted.control, hideCodexControls, hideCodexControls);
32318
33134
  if (refreshTargets) refreshMountedConversationTarget(mounted);
33135
+ showCodexUsageGateStatus(mounted, mounted.codexUsageGate.refresh());
32319
33136
  }
32320
33137
  for (const editor of document.querySelectorAll(EDITOR_SELECTOR)) {
32321
33138
  const composer = composerForEditor(editor);
@@ -32465,7 +33282,7 @@ ${accounts_default}`;
32465
33282
  const candidate = composerForElement(button);
32466
33283
  const composer = candidate && isMountedComposer(candidate) ? candidate : null;
32467
33284
  const mounted = composer ? mountedByComposer.get(composer) : void 0;
32468
- if (!composer || mounted?.control.sendButton !== button) return;
33285
+ if (!composer || !mounted || refreshSendButton(mounted.control) !== button) return;
32469
33286
  if (!prepareComposer(composer)) {
32470
33287
  blockEvent(event);
32471
33288
  return;
@@ -32538,9 +33355,63 @@ ${accounts_default}`;
32538
33355
  void refreshHarnessAvailability(true);
32539
33356
  }
32540
33357
  };
33358
+ const onDraftWorkspace = (event) => {
33359
+ const detail = event.detail;
33360
+ if (typeof detail !== "object" || detail === null) return;
33361
+ const { hostId, cwd } = detail;
33362
+ if (typeof hostId !== "string" || typeof cwd !== "string" || cwd.length === 0) return;
33363
+ draftWorkspaces.set(hostId, cwd);
33364
+ for (const mounted of mountedByComposer.values()) {
33365
+ if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId() === hostId && controller.get(mounted.composer).agent !== "codex") {
33366
+ void refreshCommands(mounted, { keepCurrent: true });
33367
+ }
33368
+ }
33369
+ };
32541
33370
  window.addEventListener("codexhost:draft-prewarm-policy-changed", onHostRouteChange);
33371
+ window.addEventListener("codexhost:draft-workspace", onDraftWorkspace);
32542
33372
  window.addEventListener("codexhost:renderer-adapter-status", onAdapterStatus);
32543
33373
  window.addEventListener("focus", onWindowFocus);
33374
+ delegationMention = installRendererDelegationMention(document, {
33375
+ onOpen: (editor) => {
33376
+ const composer = composerForElement(editor);
33377
+ const mounted = composer ? mountedByComposer.get(composer) : void 0;
33378
+ if (mounted && controller.get(mounted.composer).agent !== "codex") {
33379
+ void refreshCommands(mounted, { keepCurrent: true });
33380
+ }
33381
+ },
33382
+ readTargets: () => {
33383
+ const availability = activeHarnessAvailabilityState().availability;
33384
+ return enabledAgents.filter((agent) => agent === "codex" || availability[agent] === "ready").map((agent) => ({ agent, label: RENDERER_AGENT_LABELS[agent] }));
33385
+ },
33386
+ isComposerEditor: (editor) => {
33387
+ const composer = composerForElement(editor);
33388
+ return composer !== null && mountedByComposer.has(composer);
33389
+ },
33390
+ readLocale: () => settingsLifecycle.locale,
33391
+ // Desktop's own suggestion menu hugs the input card and covers the
33392
+ // top tray (workspace / branch bar), so anchor to the card when present.
33393
+ anchorForEditor: (editor) => editor.closest("[data-composer-body]") ?? composerForElement(editor),
33394
+ readCommands: (editor) => {
33395
+ const composer = composerForElement(editor);
33396
+ const mounted = composer ? mountedByComposer.get(composer) : void 0;
33397
+ if (!mounted || controller.get(mounted.composer).agent === "codex") return null;
33398
+ const { commands, hasSession, executingCommandId, source } = mounted.control.harnessCommands.snapshot();
33399
+ if (executingCommandId !== null) return null;
33400
+ const messages = rendererHarnessMessages(settingsLifecycle.locale);
33401
+ const agent = controller.get(mounted.composer).agent;
33402
+ const pendingNotice = source === "static" ? rendererLiveCommandsPendingNotice(
33403
+ settingsLifecycle.locale,
33404
+ RENDERER_AGENT_LABELS[agent]
33405
+ ) : null;
33406
+ if (commands.length === 0 && pendingNotice === null) return null;
33407
+ return {
33408
+ commands,
33409
+ pendingNotice,
33410
+ disabledReason: (command) => !hasSession && rendererHarnessCommandExecutesDirectly(command) ? messages.commandRequiresConversation : null,
33411
+ select: (command) => selectCommand(mounted, command)
33412
+ };
33413
+ }
33414
+ });
32544
33415
  const connectedComposers = () => [...mountedByComposer.values()].filter(
32545
33416
  (mounted) => mounted.composer.isConnected && mounted.control.root.isConnected
32546
33417
  );
@@ -32644,6 +33515,7 @@ ${accounts_default}`;
32644
33515
  modelControl = null;
32645
33516
  mutationObserver.disconnect();
32646
33517
  disposeReasoningSoftWrap();
33518
+ delegationMention?.dispose();
32647
33519
  sidebarAgentIcons.dispose();
32648
33520
  settingsLifecycle.dispose();
32649
33521
  document.removeEventListener("beforeinput", onBeforeInput, true);
@@ -32651,6 +33523,7 @@ ${accounts_default}`;
32651
33523
  document.removeEventListener("keydown", onKeyDown, true);
32652
33524
  document.removeEventListener("click", onClick, true);
32653
33525
  window.removeEventListener("codexhost:draft-prewarm-policy-changed", onHostRouteChange);
33526
+ window.removeEventListener("codexhost:draft-workspace", onDraftWorkspace);
32654
33527
  window.removeEventListener("codexhost:renderer-adapter-status", onAdapterStatus);
32655
33528
  window.removeEventListener("focus", onWindowFocus);
32656
33529
  for (const state of harnessAvailabilityByHost.values()) {
@@ -32664,6 +33537,7 @@ ${accounts_default}`;
32664
33537
  for (const mounted of mountedByComposer.values()) {
32665
33538
  mounted.usageRequestGeneration += 1;
32666
33539
  usageRefreshAttempts.delete(mounted.composer);
33540
+ mounted.codexUsageGate.dispose();
32667
33541
  disposeComposerAgentControl(mounted.control);
32668
33542
  }
32669
33543
  mountedByComposer.clear();