@karlorz/codexhost-cli-win32-x64 0.18.0-1 → 0.19.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +1 -1
  2. package/app/codexhost-distribution.json +1 -1
  3. package/app/console-server.mjs +59 -2
  4. package/app/console-web.js +98 -8
  5. package/app/cpa-live-voice-hook.js +59 -2
  6. package/app/desktop-controller.mjs +290 -12
  7. package/app/host-runtime.mjs +12896 -2966
  8. package/app/plugins/antigravity/plugin.mjs +654 -216
  9. package/app/plugins/claude-code/plugin.mjs +138 -11
  10. package/app/plugins/codebuddy/plugin.mjs +152 -20
  11. package/app/plugins/codex-usage/plugin.mjs +59 -2
  12. package/app/plugins/copilot/plugin.mjs +59 -2
  13. package/app/plugins/cursor-cli/plugin.mjs +134 -12
  14. package/app/plugins/deepseek-harness/manifest.json +2 -2
  15. package/app/plugins/deepseek-harness/plugin.mjs +86 -7
  16. package/app/plugins/devin/plugin.mjs +59 -2
  17. package/app/plugins/grok/plugin.mjs +1093 -970
  18. package/app/plugins/hermes/plugin.mjs +138 -14
  19. package/app/plugins/kimi-code/plugin.mjs +59 -2
  20. package/app/plugins/kiro-cli/plugin.mjs +287 -18
  21. package/app/plugins/omp/plugin.mjs +789 -628
  22. package/app/plugins/opencode/plugin.mjs +59 -2
  23. package/app/plugins/pi/plugin.mjs +786 -660
  24. package/app/plugins/qoder/plugin.mjs +61 -6
  25. package/app/plugins/qoder-cn/plugin.mjs +61 -6
  26. package/app/plugins/qwen-code/plugin.mjs +168 -94
  27. package/app/plugins/workbuddy/plugin.mjs +152 -20
  28. package/app/plugins/zcode/plugin.mjs +132 -5
  29. package/app/renderer-extension.js +434 -39
  30. package/app/web/assets/{index-py6Ho-Dy.js → index-BCyiiDDL.js} +62 -62
  31. package/app/web/assets/index-BNQIOOHE.css +1 -0
  32. package/app/web/codexhost-settings.js +84 -4
  33. package/app/web/index.html +2 -2
  34. package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
  35. package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
  36. package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
  37. package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
  38. package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
  39. package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +129 -8
  40. package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +8 -6
  41. package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
  42. package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
  43. package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
  44. package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
  45. package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
  46. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
  47. package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
  48. package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +16 -16
  49. package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
  50. package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
  51. package/app/web-modules/server.mjs +2345 -1518
  52. package/bin/codexhost.exe +0 -0
  53. package/libexec/codexhost-node-repl.exe +0 -0
  54. package/libexec/codexhost-shim.exe +0 -0
  55. package/libexec/codexhost-updater.exe +0 -0
  56. package/package.json +1 -1
  57. package/app/web/assets/index-C3lniEH1.css +0 -1
@@ -18179,6 +18179,10 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18179
18179
  var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
18180
18180
  var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
18181
18181
  var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
18182
+ var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
18183
+ var clientThreadTreeSchema = external_exports.object({
18184
+ parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
18185
+ }).strict();
18182
18186
  var clientProjectlessWorkspaceSchema = external_exports.object({
18183
18187
  prompt: external_exports.string().max(16384).optional()
18184
18188
  }).strict();
@@ -18195,6 +18199,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18195
18199
  sequence: external_exports.number().int().nonnegative()
18196
18200
  });
18197
18201
  var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
18202
+ external_exports.object({
18203
+ type: external_exports.literal("skills-changed"),
18204
+ cursor: clientChannelCursorSchema,
18205
+ cwd: external_exports.string().optional()
18206
+ }),
18198
18207
  external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
18199
18208
  external_exports.object({
18200
18209
  type: external_exports.literal("preferences-changed"),
@@ -18392,6 +18401,71 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18392
18401
  external_exports.object({ ok: external_exports.literal(false), error: external_exports.object({ code: voiceErrorCodeSchema }).strict() }).strict()
18393
18402
  ]);
18394
18403
 
18404
+ // ../shared-contracts/dist/skills.js
18405
+ var SKILLS_LIST_METHOD = "codexhost/skills/list";
18406
+ var SKILLS_CHANGED_METHOD = "codexhost/skills/changed";
18407
+ var skillsListParamsSchema = external_exports.object({
18408
+ threadId: hostThreadIdSchema.optional(),
18409
+ cwd: external_exports.string().min(1).optional()
18410
+ }).strict().refine((params) => !(params.threadId && params.cwd), {
18411
+ message: "Specify threadId or cwd, not both"
18412
+ });
18413
+ var librarySkillSchema = external_exports.object({
18414
+ name: external_exports.string().min(1).regex(/^[^\s[\]]+$/u),
18415
+ description: external_exports.string().optional(),
18416
+ path: external_exports.string().min(1),
18417
+ scope: external_exports.enum(["project", "global"]),
18418
+ source: external_exports.string().min(1)
18419
+ }).strict();
18420
+ var skillsListResultSchema = external_exports.object({
18421
+ revision: external_exports.number().int().nonnegative(),
18422
+ complete: external_exports.boolean(),
18423
+ skills: external_exports.array(librarySkillSchema),
18424
+ warnings: external_exports.array(external_exports.string()).optional()
18425
+ }).strict();
18426
+ var skillsChangedParamsSchema = external_exports.object({ cwd: external_exports.string().min(1).optional() }).strict();
18427
+
18428
+ // ../shared-contracts/dist/skill-reference.js
18429
+ var DESKTOP_SKILL_MENTION_PATH_PREFIX = "subagent://codexhost-skill.";
18430
+ var DESKTOP_MENTION = /\[@[^\]\r\n]+\]\(<?subagent:\/\/codexhost-skill\.([^\s)>]+)>?\)/gu;
18431
+ var LINK = /\[\$([^\]\r\n]+)\]\((?:<([^<>\r\n]+)>|([^\s()]+))(?:[ \t]+(?:"[^"\r\n]*"|'[^'\r\n]*'))?\)/gu;
18432
+ function skillReferences(text) {
18433
+ return [...text.matchAll(LINK)].flatMap((match) => {
18434
+ const path = match[2] ?? match[3] ?? "";
18435
+ if (!/^(?:\/|[A-Za-z]:[\\/]|\\\\)/u.test(path) || !/[\\/]SKILL\.md$/u.test(path))
18436
+ return [];
18437
+ return [
18438
+ {
18439
+ start: match.index,
18440
+ end: match.index + match[0].length,
18441
+ name: match[1] ?? "",
18442
+ path,
18443
+ text: match[0]
18444
+ }
18445
+ ];
18446
+ });
18447
+ }
18448
+ function formatSkillReference(skill) {
18449
+ const target2 = /[\s()]/u.test(skill.path) ? `<${skill.path}>` : skill.path;
18450
+ return `[$${skill.name}](${target2} "Read this skill")`;
18451
+ }
18452
+ function desktopSkillMentionPath(skill) {
18453
+ return DESKTOP_SKILL_MENTION_PATH_PREFIX + encodeURIComponent(JSON.stringify({ name: skill.name, path: skill.path })).replace(/[!'()*]/gu, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`);
18454
+ }
18455
+ function restoreDesktopSkillMentions(text) {
18456
+ return text.replace(DESKTOP_MENTION, (match, encoded) => {
18457
+ try {
18458
+ const skill = JSON.parse(decodeURIComponent(encoded));
18459
+ if (!skill || typeof skill !== "object" || !("name" in skill) || typeof skill.name !== "string" || !("path" in skill) || typeof skill.path !== "string")
18460
+ return match;
18461
+ const canonical = formatSkillReference({ name: skill.name, path: skill.path });
18462
+ return skillReferences(canonical)[0]?.text === canonical ? canonical : match;
18463
+ } catch {
18464
+ return match;
18465
+ }
18466
+ });
18467
+ }
18468
+
18395
18469
  // ../shared-contracts/dist/web-access-tokens.js
18396
18470
  var webNetworkAccessUrlSchema = external_exports.object({
18397
18471
  /**
@@ -18500,8 +18574,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
18500
18574
  var delegationReadParamsSchema = external_exports.strictObject({
18501
18575
  threadId: external_exports.string().min(1).max(1024),
18502
18576
  view: external_exports.enum(["result", "messages"]),
18503
- cursor: external_exports.string().min(1).max(8192).optional(),
18504
- limit: external_exports.number().int().min(1).max(100).optional()
18577
+ from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
18578
+ to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
18505
18579
  });
18506
18580
 
18507
18581
  // ../shared-contracts/dist/credential-imports.js
@@ -19619,6 +19693,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19619
19693
  return [...context2.matchAll(IMAGE_ATTACHMENT_PATTERN)].map((match) => match[1] ?? "").filter((path) => path.length > 0 && !CONTROL_CHARACTER_PATTERN.test(path));
19620
19694
  }
19621
19695
 
19696
+ // ../shared-contracts/dist/thread-watch-notice.js
19697
+ var THREAD_WATCH_NOTICE_OUTCOMES = [
19698
+ "completed",
19699
+ "failed",
19700
+ "interrupted",
19701
+ "timedOut",
19702
+ "unreadable",
19703
+ "notFound"
19704
+ ];
19705
+ var ENTRY_PATTERN = new RegExp(String.raw`^- \[([^\]\n]+)\]\(thread://([^\s()<>"?#/]+)\): ` + `(${THREAD_WATCH_NOTICE_OUTCOMES.join("|")})(?:. (.+))?$`, "u");
19706
+
19622
19707
  // ../shared-contracts/dist/remote-runtime.js
19623
19708
  var RUNTIME_STATUS_METHOD = "codexhost/runtime/status";
19624
19709
  var REMOTE_UPDATE_METHOD = "codexhost/remote/update";
@@ -19669,6 +19754,14 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19669
19754
  archived: external_exports.boolean()
19670
19755
  }),
19671
19756
  external_exports.strictObject({ kind: external_exports.literal("read"), ...thread }),
19757
+ external_exports.strictObject({
19758
+ kind: external_exports.literal("configure"),
19759
+ ...thread,
19760
+ epoch: identity,
19761
+ modelId: identity.optional(),
19762
+ thinkingOptionId: identity.optional(),
19763
+ permissionModeId: identity.optional()
19764
+ }).refine((value) => [value.modelId, value.thinkingOptionId, value.permissionModeId].filter((v) => v !== void 0).length === 1, "Select exactly one remote setting"),
19672
19765
  external_exports.strictObject({
19673
19766
  kind: external_exports.literal("prompt"),
19674
19767
  ...thread,
@@ -19741,6 +19834,13 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
19741
19834
  external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
19742
19835
  ]);
19743
19836
 
19837
+ // ../shared-contracts/dist/thread-title.js
19838
+ var threadTitleInputSchema = external_exports.strictObject({
19839
+ prompt: external_exports.string().trim().min(1).max(2e3),
19840
+ cwd: external_exports.string().max(4096).nullable()
19841
+ });
19842
+ var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
19843
+
19744
19844
  // ../shared-contracts/dist/web-ui-extensions.js
19745
19845
  var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
19746
19846
  var localizedTextSchema2 = external_exports.union([
@@ -20450,6 +20550,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
20450
20550
  return handle;
20451
20551
  }
20452
20552
 
20553
+ // src/renderer-schema-config.ts
20554
+ external_exports.config({ jitless: true });
20555
+
20453
20556
  // src/agent-selection-state.ts
20454
20557
  var DEFAULT_RENDERER_AGENTS = ["codex"];
20455
20558
  function defaultIdFactory(sequence) {
@@ -27330,7 +27433,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
27330
27433
  grokComputerUseApplyFailed: "Could not apply the saved setting to Grok config.",
27331
27434
  connectionOfficialWebsite: "Visit official website",
27332
27435
  connectionOpenHarnessWeb: "Open DeepSeek Harness Web",
27333
- connectionDeepSeekTestedVersions: "Supported DSH versions: 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1, 0.2.1-rc.2, 0.2.1-rc.3, 0.2.1-rc.4, 0.2.1-rc.5 and 0.2.2-rc.1. Versions newer than 0.2.2-rc.1 can be tried, but compatibility may be limited; versions older than 0.1.7-rc.1 must be upgraded first.",
27436
+ connectionDeepSeekTestedVersions: "Supported DSH versions: 0.1.7-rc.1, 0.1.7-rc.2, 0.2.0-rc.1, 0.2.0-rc.2, 0.2.1-rc.1, 0.2.1-rc.2, 0.2.1-rc.3, 0.2.1-rc.4, 0.2.1-rc.5, 0.2.2-rc.1 and 0.2.2-rc.2. Versions newer than 0.2.2-rc.2 can be tried, but compatibility may be limited; versions older than 0.1.7-rc.1 must be upgraded first.",
27334
27437
  connectionInstall: "Install",
27335
27438
  connectionInstallDescription: "This Harness was not detected.",
27336
27439
  connectionInstallRunning: "Installing on the selected Host. You can leave this page; login or setup may still be required afterward.",
@@ -27726,7 +27829,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
27726
27829
  grokComputerUseApplyFailed: "\u65E0\u6CD5\u5C06\u5DF2\u4FDD\u5B58\u7684\u8BBE\u7F6E\u5199\u5165 Grok \u914D\u7F6E\u3002",
27727
27830
  connectionOfficialWebsite: "\u8BBF\u95EE\u5B98\u7F51",
27728
27831
  connectionOpenHarnessWeb: "\u6253\u5F00 DeepSeek Harness Web",
27729
- connectionDeepSeekTestedVersions: "\u652F\u6301 DSH \u7248\u672C\uFF1A0.1.7-rc.1\u30010.1.7-rc.2\u30010.2.0-rc.1\u30010.2.0-rc.2\u30010.2.1-rc.1\u30010.2.1-rc.2\u30010.2.1-rc.3\u30010.2.1-rc.4\u30010.2.1-rc.5 \u548C 0.2.2-rc.1\u3002\u9AD8\u4E8E 0.2.2-rc.1 \u7684\u7248\u672C\u53EF\u4EE5\u5C1D\u8BD5\u8FDE\u63A5\uFF0C\u4F46\u9002\u914D\u5EA6\u53EF\u80FD\u6709\u9650\uFF1B\u4F4E\u4E8E 0.1.7-rc.1 \u7684\u7248\u672C\u9700\u8981\u5148\u5347\u7EA7\u3002",
27832
+ connectionDeepSeekTestedVersions: "\u652F\u6301 DSH \u7248\u672C\uFF1A0.1.7-rc.1\u30010.1.7-rc.2\u30010.2.0-rc.1\u30010.2.0-rc.2\u30010.2.1-rc.1\u30010.2.1-rc.2\u30010.2.1-rc.3\u30010.2.1-rc.4\u30010.2.1-rc.5\u30010.2.2-rc.1 \u548C 0.2.2-rc.2\u3002\u9AD8\u4E8E 0.2.2-rc.2 \u7684\u7248\u672C\u53EF\u4EE5\u5C1D\u8BD5\u8FDE\u63A5\uFF0C\u4F46\u9002\u914D\u5EA6\u53EF\u80FD\u6709\u9650\uFF1B\u4F4E\u4E8E 0.1.7-rc.1 \u7684\u7248\u672C\u9700\u8981\u5148\u5347\u7EA7\u3002",
27730
27833
  connectionInstall: "\u5B89\u88C5",
27731
27834
  connectionInstallDescription: "\u5C1A\u672A\u68C0\u6D4B\u5230\u8BE5 Harness\u3002",
27732
27835
  connectionInstallRunning: "\u6B63\u5728\u6240\u9009 Host \u4E0A\u5B89\u88C5\uFF0C\u79BB\u5F00\u9875\u9762\u4E0D\u4F1A\u4E2D\u65AD\u3002\u5B89\u88C5\u540E\u53EF\u80FD\u4ECD\u9700\u767B\u5F55\u6216\u914D\u7F6E\u3002",
@@ -29461,7 +29564,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
29461
29564
  }
29462
29565
  function rendererLiveCommandsPendingNotice(locale, harnessLabel) {
29463
29566
  const harness2 = harnessLabel.replace(/\s*[((][^))]*[))]\s*$/u, "").trim() || harnessLabel;
29464
- return locale === "zh-CN" ? `\u53D1\u9001\u4E00\u6761\u6D88\u606F\u540E\uFF0C\u4F1A\u52A0\u8F7D ${harness2} \u5728\u5F53\u524D\u9879\u76EE\u7684\u5168\u90E8\u547D\u4EE4\u548C\u6280\u80FD` : `Send a message to load all ${harness2} commands and skills for this project`;
29567
+ return locale === "zh-CN" ? `\u53D1\u9001\u4E00\u6761\u6D88\u606F\u540E\uFF0C\u4F1A\u52A0\u8F7D ${harness2} \u5728\u5F53\u524D\u9879\u76EE\u7684\u5168\u90E8\u547D\u4EE4` : `Send a message to load all ${harness2} commands for this project`;
29465
29568
  }
29466
29569
 
29467
29570
  // src/renderer-model-favorites.ts
@@ -32811,6 +32914,19 @@ Codex Fast mode prioritizes requests and may increase usage.`
32811
32914
  return externalThreadForkResultSchema.parse(result);
32812
32915
  },
32813
32916
  inspectHarness,
32917
+ async listSkills(params) {
32918
+ return skillsListResultSchema.parse(
32919
+ await manager.sendRequest(SKILLS_LIST_METHOD, skillsListParamsSchema.parse(params))
32920
+ );
32921
+ },
32922
+ subscribeSkillsChanged(listener) {
32923
+ return notificationTarget(source)?.addNotificationCallback?.(SKILLS_CHANGED_METHOD, (value) => {
32924
+ if (!isRecord8(value) || value.method !== SKILLS_CHANGED_METHOD) return;
32925
+ const parsed = skillsChangedParamsSchema.safeParse(value.params);
32926
+ if (parsed.success) listener(parsed.data);
32927
+ }) ?? (() => {
32928
+ });
32929
+ },
32814
32930
  async listHarnessPlugins() {
32815
32931
  return harnessPluginListResultSchema.parse(
32816
32932
  await manager.sendRequest(HARNESS_PLUGIN_LIST_METHOD, {})
@@ -33707,7 +33823,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
33707
33823
  (method) => [
33708
33824
  THREAD_USAGE_UPDATED_METHOD,
33709
33825
  HARNESS_PREFERENCES_CHANGED_METHOD,
33710
- HARNESS_DISPLAY_CHANGED_METHOD
33826
+ HARNESS_DISPLAY_CHANGED_METHOD,
33827
+ SKILLS_CHANGED_METHOD
33711
33828
  ].includes(method)
33712
33829
  ))
33713
33830
  return () => unsubscribe?.();
@@ -33717,7 +33834,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
33717
33834
  if (disposed || !message2 || typeof message2 !== "object" || !("type" in message2) || message2.type !== "mcp-notification" || !("hostId" in message2) || message2.hostId !== route.hostId || !("method" in message2) || ![
33718
33835
  THREAD_USAGE_UPDATED_METHOD,
33719
33836
  HARNESS_PREFERENCES_CHANGED_METHOD,
33720
- HARNESS_DISPLAY_CHANGED_METHOD
33837
+ HARNESS_DISPLAY_CHANGED_METHOD,
33838
+ SKILLS_CHANGED_METHOD
33721
33839
  ].includes(String(message2.method)) || !(typeof methods === "string" ? [methods] : methods).includes(
33722
33840
  String(message2.method)
33723
33841
  ) || readRouting()?.forHost(route.hostId) !== route)
@@ -38375,6 +38493,10 @@ ${detail}` : ""}`
38375
38493
  missing: "Codex Desktop was not found",
38376
38494
  stopped: "codexhost is not running",
38377
38495
  stoppedDetail: "Start codexhost to use Codex Desktop with your Harnesses.",
38496
+ desktopStopped: "Codex Desktop is not running",
38497
+ desktopStoppedDetail: "codexhost Host is running. Start Desktop to use Codex Desktop with your Harnesses.",
38498
+ hostRunningDesktopStopped: "Host running \xB7 Desktop stopped",
38499
+ lastStartSucceeded: "Last start succeeded",
38378
38500
  start: "Start codexhost",
38379
38501
  restart: "Restart codexhost",
38380
38502
  restartConfirm: "Restart now",
@@ -38573,6 +38695,10 @@ ${detail}` : ""}`
38573
38695
  missing: "\u672A\u627E\u5230 Codex Desktop",
38574
38696
  stopped: "codexhost \u672A\u8FD0\u884C",
38575
38697
  stoppedDetail: "\u542F\u52A8 codexhost \u540E\u5373\u53EF\u5728 Codex Desktop \u4E2D\u4F7F\u7528\u5404\u4E2A Harness\u3002",
38698
+ desktopStopped: "Codex Desktop \u672A\u8FD0\u884C",
38699
+ desktopStoppedDetail: "codexhost \u670D\u52A1\u4ECD\u5728\u8FD0\u884C\u3002\u542F\u52A8 Desktop \u540E\u5373\u53EF\u5728 Codex Desktop \u4E2D\u4F7F\u7528\u5404\u4E2A Harness\u3002",
38700
+ hostRunningDesktopStopped: "\u670D\u52A1\u8FD0\u884C\u4E2D \xB7 Desktop \u672A\u8FD0\u884C",
38701
+ lastStartSucceeded: "\u4E0A\u6B21\u542F\u52A8\u6210\u529F",
38576
38702
  start: "\u542F\u52A8 codexhost",
38577
38703
  restart: "\u91CD\u65B0\u542F\u52A8 codexhost",
38578
38704
  restartConfirm: "\u7ACB\u5373\u91CD\u65B0\u542F\u52A8",
@@ -49907,6 +50033,98 @@ ${renderer_brand_mark_default}`;
49907
50033
  };
49908
50034
  }
49909
50035
 
50036
+ // src/renderer-skill-library.ts
50037
+ function createRendererSkillLibrary(options) {
50038
+ let active = null;
50039
+ const key = (context2) => JSON.stringify(context2.params);
50040
+ const current = (state) => {
50041
+ const context2 = options.context(state.editor);
50042
+ return active === state && context2?.client === state.context.client && key(context2) === state.key;
50043
+ };
50044
+ const close = () => {
50045
+ active?.unsubscribe?.();
50046
+ active = null;
50047
+ };
50048
+ const query = async (state) => {
50049
+ if (state.pending) {
50050
+ state.dirty = true;
50051
+ return;
50052
+ }
50053
+ do {
50054
+ state.dirty = false;
50055
+ state.pending = true;
50056
+ delete state.error;
50057
+ try {
50058
+ if (!state.context.client.listSkills)
50059
+ throw new Error("This Host does not support the Skill Library");
50060
+ const result = await state.context.client.listSkills(state.context.params);
50061
+ if (!current(state)) return;
50062
+ state.result = result;
50063
+ } catch (error51) {
50064
+ if (!current(state)) return;
50065
+ state.error = error51 instanceof Error ? error51.message : String(error51);
50066
+ } finally {
50067
+ state.pending = false;
50068
+ }
50069
+ options.changed();
50070
+ } while (state.dirty && current(state));
50071
+ };
50072
+ const open = (editor) => {
50073
+ const context2 = options.context(editor);
50074
+ if (!context2) {
50075
+ close();
50076
+ return;
50077
+ }
50078
+ if (active?.context.client === context2.client && active.key === key(context2)) {
50079
+ active.editor = editor;
50080
+ return;
50081
+ }
50082
+ close();
50083
+ const state = {
50084
+ editor,
50085
+ context: context2,
50086
+ key: key(context2),
50087
+ pending: false,
50088
+ dirty: false
50089
+ };
50090
+ active = state;
50091
+ if (context2.client.subscribeSkillsChanged) {
50092
+ state.unsubscribe = context2.client.subscribeSkillsChanged((change) => {
50093
+ if (!current(state)) return;
50094
+ if (change.cwd && !context2.params.threadId && change.cwd !== context2.params.cwd) return;
50095
+ void query(state);
50096
+ });
50097
+ }
50098
+ void query(state);
50099
+ };
50100
+ return {
50101
+ open,
50102
+ close,
50103
+ read(editor) {
50104
+ const context2 = options.context(editor);
50105
+ if (!context2) return null;
50106
+ if (!active || active.context.client !== context2.client || active.key !== key(context2))
50107
+ open(editor);
50108
+ const state = active;
50109
+ if (!state) return null;
50110
+ const zh = options.locale() === "zh-CN";
50111
+ return {
50112
+ skills: state.result?.skills ?? [],
50113
+ ...!state.result && state.pending ? { notice: zh ? "\u6B63\u5728\u52A0\u8F7D Skill\u2026" : "Loading Skills\u2026" } : state.result?.complete === false ? { notice: zh ? "\u6B63\u5728\u53D1\u73B0 Skill\u2026" : "Discovering Skills\u2026" } : {},
50114
+ ...state.result?.warnings?.length ? { warning: state.result.warnings.join("\n") } : {},
50115
+ ...state.error ? { error: state.error } : {},
50116
+ retry: () => {
50117
+ if (current(state)) {
50118
+ void query(state);
50119
+ options.changed();
50120
+ }
50121
+ }
50122
+ };
50123
+ },
50124
+ dispose: close
50125
+ };
50126
+ }
50127
+
49910
50128
  // src/renderer-native-composer-controller.ts
49911
50129
  var MAX_ELEMENT_DEPTH = 4;
49912
50130
  var MAX_FIBER_DEPTH = 40;
@@ -49961,6 +50179,39 @@ ${renderer_brand_mark_default}`;
49961
50179
  return false;
49962
50180
  }
49963
50181
  }
50182
+ function nativeSelectionMarkdown(editor) {
50183
+ const controller = findNativeComposerController(editor);
50184
+ if (!controller?.getMarkdownSerializer) return null;
50185
+ const { doc, selection } = controller.view.state;
50186
+ const cut = doc.cut;
50187
+ if (!cut) return null;
50188
+ try {
50189
+ const serialize = controller.getMarkdownSerializer("markdown");
50190
+ return serialize?.(cut.call(doc, selection.from, selection.to)) ?? null;
50191
+ } catch {
50192
+ return null;
50193
+ }
50194
+ }
50195
+ function insertNativeMentionContent(editor, parts) {
50196
+ const controller = findNativeComposerController(editor);
50197
+ if (!controller) return false;
50198
+ const { schema, selection, tr } = controller.view.state;
50199
+ const nodeType = schema.nodes.agentMention;
50200
+ const text = schema.text;
50201
+ const create = nodeType?.create;
50202
+ const replace2 = tr.replaceWith;
50203
+ if (!text || !create || !replace2) return false;
50204
+ try {
50205
+ const literal2 = schema.marks?.literalPaste?.create();
50206
+ const content = parts.filter((part) => part !== "").map(
50207
+ (part) => typeof part === "string" ? text.call(schema, part, literal2 ? [literal2] : void 0) : create.call(nodeType, { conversationId: null, ...part })
50208
+ );
50209
+ controller.view.dispatch(replace2.call(tr, selection.from, selection.to, content));
50210
+ return true;
50211
+ } catch {
50212
+ return false;
50213
+ }
50214
+ }
49964
50215
  function insertNativeAgentMention(editor, range, mention) {
49965
50216
  const controller = findNativeComposerController(editor);
49966
50217
  const nodeType = controller?.view.state.schema.nodes.agentMention;
@@ -49987,9 +50238,82 @@ ${renderer_brand_mark_default}`;
49987
50238
  }
49988
50239
  }
49989
50240
 
50241
+ // src/renderer-skill-reference.ts
50242
+ var STYLE_ATTRIBUTE3 = "data-codexhost-skill-reference-style";
50243
+ var SVG_NS3 = "http://www.w3.org/2000/svg";
50244
+ var CUBE = "M12 3 20 7.5v9L12 21l-8-4.5v-9ZM4 7.5 12 12l8-4.5M12 12v9";
50245
+ function createSkillIcon(ownerDocument) {
50246
+ const svg2 = ownerDocument.createElementNS(SVG_NS3, "svg");
50247
+ svg2.setAttribute("viewBox", "0 0 24 24");
50248
+ svg2.setAttribute("fill", "none");
50249
+ svg2.setAttribute("stroke", "currentColor");
50250
+ svg2.setAttribute("stroke-width", "1.7");
50251
+ svg2.setAttribute("stroke-linejoin", "round");
50252
+ svg2.setAttribute("aria-hidden", "true");
50253
+ const path = ownerDocument.createElementNS(SVG_NS3, "path");
50254
+ path.setAttribute("d", CUBE);
50255
+ svg2.append(path);
50256
+ return svg2;
50257
+ }
50258
+ function skillMention(skill) {
50259
+ return { name: skill.name, displayName: skill.name, path: desktopSkillMentionPath(skill) };
50260
+ }
50261
+ function installRendererSkillReferences(ownerDocument, isExternalEditor) {
50262
+ const style = ownerDocument.createElement("style");
50263
+ style.setAttribute(STYLE_ATTRIBUTE3, "true");
50264
+ const selector = `[agent-mention-path^="${DESKTOP_SKILL_MENTION_PATH_PREFIX}"][agent-mention-display-name]`;
50265
+ const icon2 = encodeURIComponent(
50266
+ `<svg xmlns="${SVG_NS3}" viewBox="0 0 24 24" fill="none" stroke="#808080" stroke-width="1.7" stroke-linejoin="round"><path d="${CUBE}"/></svg>`
50267
+ );
50268
+ style.textContent = `${selector}>span{display:none;}
50269
+ ${selector}::before{content:"";display:inline-block;width:16px;height:16px;margin-inline-end:3px;vertical-align:-3px;background:url("data:image/svg+xml,${icon2}") center/contain no-repeat;}
50270
+ ${selector}::after{content:attr(agent-mention-display-name);}`;
50271
+ (ownerDocument.head ?? ownerDocument.documentElement).append(style);
50272
+ const selectedEditor = () => {
50273
+ const node = ownerDocument.getSelection()?.anchorNode;
50274
+ const element = node?.nodeType === node?.ELEMENT_NODE ? node : node?.parentElement;
50275
+ const editor = element?.closest('[contenteditable="true"]');
50276
+ return editor && isExternalEditor(editor) ? editor : null;
50277
+ };
50278
+ const copy = (event) => {
50279
+ const editor = selectedEditor();
50280
+ if (!editor || !event.clipboardData) return;
50281
+ const text = nativeSelectionMarkdown(editor) ?? event.clipboardData.getData("text/plain");
50282
+ const canonical = restoreDesktopSkillMentions(text);
50283
+ if (canonical === text) return;
50284
+ event.clipboardData.setData("text/plain", canonical);
50285
+ event.preventDefault();
50286
+ event.stopImmediatePropagation();
50287
+ };
50288
+ const paste = (event) => {
50289
+ const editor = selectedEditor();
50290
+ if (!editor || !event.clipboardData || event.clipboardData.files.length) return;
50291
+ const text = event.clipboardData.getData("text/plain");
50292
+ const references = skillReferences(text);
50293
+ if (!references.length) return;
50294
+ const parts = [];
50295
+ let cursor = 0;
50296
+ for (const reference of references) {
50297
+ parts.push(text.slice(cursor, reference.start), skillMention(reference));
50298
+ cursor = reference.end;
50299
+ }
50300
+ parts.push(text.slice(cursor));
50301
+ if (!insertNativeMentionContent(editor, parts)) return;
50302
+ event.preventDefault();
50303
+ event.stopImmediatePropagation();
50304
+ };
50305
+ ownerDocument.addEventListener("copy", copy, true);
50306
+ ownerDocument.addEventListener("paste", paste, true);
50307
+ return () => {
50308
+ ownerDocument.removeEventListener("copy", copy, true);
50309
+ ownerDocument.removeEventListener("paste", paste, true);
50310
+ style.remove();
50311
+ };
50312
+ }
50313
+
49990
50314
  // src/renderer-delegation-mention.ts
49991
50315
  var MENU_ATTRIBUTE = "data-codexhost-delegation-mention-menu";
49992
- var STYLE_ATTRIBUTE3 = "data-codexhost-delegation-mention-style";
50316
+ var STYLE_ATTRIBUTE4 = "data-codexhost-delegation-mention-style";
49993
50317
  var MENU_MAX_HEIGHT = 320;
49994
50318
  var SOURCE_TAG = "codexhost";
49995
50319
  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";
@@ -50034,27 +50358,13 @@ ${renderer_brand_mark_default}`;
50034
50358
  return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ command }) => command);
50035
50359
  }
50036
50360
  function harnessCommandDisplayName(label) {
50037
- const slug = label.trim().replace(/^\//u, "").replace(/^skill:/u, "");
50361
+ const slug = label.trim().replace(/^\//u, "");
50038
50362
  if (!slug || /\s/u.test(slug) || /[A-Z]/u.test(slug) || /[^\x00-\x7F]/u.test(slug)) {
50039
50363
  return slug || label;
50040
50364
  }
50041
50365
  const name = slug.split(":").filter(Boolean).at(-1) ?? slug;
50042
50366
  return name.split(/[-_.]+/u).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
50043
50367
  }
50044
- var SVG_NS3 = "http://www.w3.org/2000/svg";
50045
- function createSkillIcon(ownerDocument) {
50046
- const svg2 = ownerDocument.createElementNS(SVG_NS3, "svg");
50047
- svg2.setAttribute("viewBox", "0 0 24 24");
50048
- svg2.setAttribute("fill", "none");
50049
- svg2.setAttribute("stroke", "currentColor");
50050
- svg2.setAttribute("stroke-width", "1.7");
50051
- svg2.setAttribute("stroke-linejoin", "round");
50052
- svg2.setAttribute("aria-hidden", "true");
50053
- const path = ownerDocument.createElementNS(SVG_NS3, "path");
50054
- path.setAttribute("d", "M12 3 20 7.5v9L12 21l-8-4.5v-9ZM4 7.5 12 12l8-4.5M12 12v9");
50055
- svg2.append(path);
50056
- return svg2;
50057
- }
50058
50368
  function agentsTitle(locale) {
50059
50369
  return locale === "zh-CN" ? "\u59D4\u6D3E\u7ED9 Agent" : "Delegate to agent";
50060
50370
  }
@@ -50076,10 +50386,10 @@ ${renderer_brand_mark_default}`;
50076
50386
  return `"${value.replace(/["\\\n]/gu, (character) => `\\${character === "\n" ? "a " : character}`)}"`;
50077
50387
  }
50078
50388
  function syncChipStyle(ownerDocument, targets, cache) {
50079
- let style = ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE3}]`);
50389
+ let style = ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`);
50080
50390
  if (!style) {
50081
50391
  style = ownerDocument.createElement("style");
50082
- style.setAttribute(STYLE_ATTRIBUTE3, "true");
50392
+ style.setAttribute(STYLE_ATTRIBUTE4, "true");
50083
50393
  (ownerDocument.head ?? ownerDocument.documentElement).append(style);
50084
50394
  }
50085
50395
  const chip = [DELEGATION_MENTION_PATH_PREFIX, HARNESS_COMMAND_MENTION_PATH_PREFIX].map((prefix) => `[agent-mention-path^=${cssString(prefix)}][agent-mention-display-name]`).join(",");
@@ -50101,6 +50411,13 @@ ${renderer_brand_mark_default}`;
50101
50411
  const text = rules.join("\n");
50102
50412
  if (style.textContent !== text) style.textContent = text;
50103
50413
  }
50414
+ function filterDelegationSkills(skills, query) {
50415
+ const needle = query.trim().toLowerCase();
50416
+ return skills.filter(
50417
+ (skill) => `${skill.name}
50418
+ ${skill.description ?? ""}`.toLowerCase().includes(needle)
50419
+ );
50420
+ }
50104
50421
  function installRendererDelegationMention(ownerDocument, options) {
50105
50422
  const view = ownerDocument.defaultView;
50106
50423
  if (!view) {
@@ -50135,9 +50452,11 @@ ${renderer_brand_mark_default}`;
50135
50452
  let rowsRendered = 0;
50136
50453
  const close = () => {
50137
50454
  active = null;
50455
+ openedFor = null;
50138
50456
  entries = [];
50139
50457
  setMenuOpen(false);
50140
50458
  list.replaceChildren();
50459
+ options.onClose?.();
50141
50460
  };
50142
50461
  const highlight = () => {
50143
50462
  [...list.querySelectorAll("[role=option]")].forEach((item, index) => {
@@ -50210,7 +50529,7 @@ ${renderer_brand_mark_default}`;
50210
50529
  item.addEventListener("click", () => void choose(entry));
50211
50530
  return item;
50212
50531
  };
50213
- const render = (trigger, commands, targets) => {
50532
+ const render = (trigger, commands, targets, skills) => {
50214
50533
  const locale = options.readLocale();
50215
50534
  const rows = [];
50216
50535
  entries = [];
@@ -50230,18 +50549,13 @@ ${renderer_brand_mark_default}`;
50230
50549
  }
50231
50550
  }
50232
50551
  if (commands) {
50233
- const groups = [
50234
- [commandsTitle(locale), commands.matches.filter(({ kind }) => kind !== "skill")],
50235
- [skillsTitle(locale), commands.matches.filter(({ kind }) => kind === "skill")]
50236
- ];
50237
- for (const [title, group] of groups) {
50238
- if (group.length === 0) continue;
50239
- rows.push(sectionHeader(title));
50240
- for (const command of group) {
50552
+ if (commands.matches.length) {
50553
+ rows.push(sectionHeader(commandsTitle(locale)));
50554
+ for (const command of commands.matches) {
50241
50555
  const reason = commands.source.disabledReason(command);
50242
50556
  const presentation = rendererHarnessCommandPresentation(command, locale);
50243
50557
  const content = rowContent(
50244
- command.kind === "skill" ? createSkillIcon(ownerDocument) : createHarnessCommandIcon(ownerDocument),
50558
+ createHarnessCommandIcon(ownerDocument),
50245
50559
  harnessCommandDisplayName(presentation.label),
50246
50560
  reason ?? presentation.description
50247
50561
  );
@@ -50269,6 +50583,44 @@ ${renderer_brand_mark_default}`;
50269
50583
  hint.textContent = notice;
50270
50584
  rows.push(hint);
50271
50585
  }
50586
+ if (skills) {
50587
+ rows.push(sectionHeader(skillsTitle(locale)));
50588
+ const matches = filterDelegationSkills(skills.skills, trigger.query);
50589
+ for (const skill of matches) {
50590
+ const scope = locale === "zh-CN" ? skill.scope === "project" ? "\u9879\u76EE" : "\u5168\u5C40" : skill.scope === "project" ? "Project" : "Global";
50591
+ const detail = `${scope} \xB7 ${skill.source} \xB7 ${skill.path}${skill.description ? ` \u2014 ${skill.description}` : ""}`;
50592
+ const content = rowContent(createSkillIcon(ownerDocument), skill.name, detail);
50593
+ content.setAttribute("data-skill-path", skill.path);
50594
+ content.title = detail;
50595
+ rows.push(optionRow({ kind: "librarySkill", skill }, content));
50596
+ }
50597
+ const hint = (label, detail = "") => {
50598
+ const row = ownerDocument.createElement("div");
50599
+ row.className = `${ROW_CLASS} opacity-50`;
50600
+ row.setAttribute("aria-disabled", "true");
50601
+ row.title = detail;
50602
+ row.append(rowContent(null, label, detail));
50603
+ rows.push(row);
50604
+ };
50605
+ if (skills.error) {
50606
+ rows.push(
50607
+ optionRow(
50608
+ { kind: "retrySkills", retry: skills.retry },
50609
+ rowContent(
50610
+ null,
50611
+ locale === "zh-CN" ? "\u91CD\u8BD5 Skill \u5E93" : "Retry Skill Library",
50612
+ skills.error
50613
+ )
50614
+ )
50615
+ );
50616
+ } else if (skills.notice) hint(skills.notice);
50617
+ else if (!matches.length) hint(locale === "zh-CN" ? "\u672A\u627E\u5230 Skill" : "No Skills found");
50618
+ if (skills.warning)
50619
+ hint(
50620
+ locale === "zh-CN" ? "\u90E8\u5206 Skill \u65E0\u6CD5\u8BFB\u53D6" : "Some Skills could not be read",
50621
+ skills.warning
50622
+ );
50623
+ }
50272
50624
  rowsRendered = rows.length;
50273
50625
  list.replaceChildren(...rows);
50274
50626
  activeIndex = Math.min(activeIndex, Math.max(0, entries.length - 1));
@@ -50311,15 +50663,16 @@ ${renderer_brand_mark_default}`;
50311
50663
  const targets = filterDelegationTargets(allTargets, trigger.query);
50312
50664
  const source = options.readCommands(trigger.editor);
50313
50665
  const commandMatches = source ? filterDelegationCommands(source.commands, trigger.query) : [];
50666
+ const skills = options.readSkills?.(trigger.editor) ?? null;
50314
50667
  const showsNotice = Boolean(source?.pendingNotice) && trigger.query === "";
50315
- if (targets.length === 0 && commandMatches.length === 0 && !showsNotice) {
50668
+ if (targets.length === 0 && commandMatches.length === 0 && !showsNotice && !skills) {
50316
50669
  close();
50317
50670
  return;
50318
50671
  }
50319
50672
  const sameQuery = active?.query === trigger.query && active.node === trigger.node;
50320
50673
  active = trigger;
50321
50674
  if (!sameQuery) activeIndex = 0;
50322
- render(trigger, source ? { source, matches: commandMatches } : null, targets);
50675
+ render(trigger, source ? { source, matches: commandMatches } : null, targets, skills);
50323
50676
  if (rowsRendered === 0) close();
50324
50677
  };
50325
50678
  const waitForSelectionSync = () => new Promise((resolve) => view.setTimeout(resolve, 0));
@@ -50373,7 +50726,12 @@ ${renderer_brand_mark_default}`;
50373
50726
  source.select(command);
50374
50727
  };
50375
50728
  const choose = async (entry) => {
50729
+ if (entry.kind === "retrySkills") {
50730
+ entry.retry();
50731
+ return;
50732
+ }
50376
50733
  const trigger = active;
50734
+ if (entry.kind === "librarySkill" && trigger && !options.readSkills?.(trigger.editor)) return;
50377
50735
  close();
50378
50736
  if (!trigger || !trigger.node.isConnected) return;
50379
50737
  const expected = `#${trigger.query}`;
@@ -50382,7 +50740,15 @@ ${renderer_brand_mark_default}`;
50382
50740
  inserting = true;
50383
50741
  try {
50384
50742
  if (entry.kind === "agent") await insertAgent(trigger, range, entry.target);
50385
- else await runCommand(trigger, range, entry);
50743
+ else if (entry.kind === "librarySkill") {
50744
+ const mention = skillMention(entry.skill);
50745
+ if (!insertNativeAgentMention(trigger.editor, range, mention)) {
50746
+ if (!await selectTriggerText(trigger)) return;
50747
+ const carrier = `[@${mention.name}](${mention.path}) `;
50748
+ if (!dispatchPlainTextPaste(trigger.editor, carrier))
50749
+ ownerDocument.execCommand("insertText", false, carrier);
50750
+ }
50751
+ } else await runCommand(trigger, range, entry);
50386
50752
  } finally {
50387
50753
  inserting = false;
50388
50754
  }
@@ -50434,8 +50800,9 @@ ${renderer_brand_mark_default}`;
50434
50800
  ownerDocument.removeEventListener("pointerdown", onPointerDown, true);
50435
50801
  view.removeEventListener("resize", onViewportChange);
50436
50802
  view.removeEventListener("scroll", onViewportChange, true);
50803
+ options.onClose?.();
50437
50804
  menu.remove();
50438
- ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE3}]`)?.remove();
50805
+ ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`)?.remove();
50439
50806
  };
50440
50807
  const openFor = (editor) => {
50441
50808
  editor.focus({ preventScroll: true });
@@ -51880,6 +52247,28 @@ ${renderer_brand_mark_default}`;
51880
52247
  }
51881
52248
  }
51882
52249
  }
52250
+ const skillContext = (editor) => {
52251
+ const composer = composerForElement(editor);
52252
+ const mounted = composer ? mountedByComposer.get(composer) : void 0;
52253
+ if (!mounted || !editor.isContentEditable || controller.get(mounted.composer).agent === "codex" || isOwnershipSubmissionBlocked(mounted.ownershipStatus))
52254
+ return null;
52255
+ const threadId = threadIdFromComposerModelTarget(mounted.modelTarget);
52256
+ const hostId2 = threadId ? mounted.hostId : activeModelHostId(mounted.composer);
52257
+ if (hostId2 !== "local") return null;
52258
+ const client = modelClientForHost(hostId2);
52259
+ if (!client) return null;
52260
+ const cwd = draftWorkspaces.get(hostId2);
52261
+ return { client, params: threadId ? { threadId } : cwd ? { cwd } : {} };
52262
+ };
52263
+ const skillLibrary = createRendererSkillLibrary({
52264
+ context: skillContext,
52265
+ locale: () => settingsLifecycle.locale,
52266
+ changed: () => delegationMention?.refresh()
52267
+ });
52268
+ const disposeSkillReferences = installRendererSkillReferences(
52269
+ document,
52270
+ (editor) => skillContext(editor) !== null
52271
+ );
51883
52272
  const refreshCommands = async (mounted, { keepCurrent = false } = {}) => {
51884
52273
  const generation = ++mounted.commandRequestGeneration;
51885
52274
  const agent = controller.get(mounted.composer).agent;
@@ -53709,6 +54098,7 @@ ${renderer_brand_mark_default}`;
53709
54098
  const { hostId: hostId2, cwd } = detail;
53710
54099
  if (typeof hostId2 !== "string" || typeof cwd !== "string" || cwd.length === 0) return;
53711
54100
  draftWorkspaces.set(hostId2, cwd);
54101
+ delegationMention?.refresh();
53712
54102
  for (const mounted of mountedByComposer.values()) {
53713
54103
  if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId(mounted.composer) === hostId2 && controller.get(mounted.composer).agent !== "codex") {
53714
54104
  void refreshCommands(mounted, { keepCurrent: true });
@@ -53745,7 +54135,10 @@ ${renderer_brand_mark_default}`;
53745
54135
  window.addEventListener(CODEX_USAGE_BANNER_CHANGE_EVENT, onUsageBannerPreference);
53746
54136
  window.addEventListener("storage", onUsageBannerStorage);
53747
54137
  delegationMention = installRendererDelegationMention(document, {
54138
+ readSkills: (editor) => skillLibrary.read(editor),
54139
+ onClose: () => skillLibrary.close(),
53748
54140
  onOpen: (editor) => {
54141
+ skillLibrary.open(editor);
53749
54142
  const composer = composerForElement(editor);
53750
54143
  const mounted = composer ? mountedByComposer.get(composer) : void 0;
53751
54144
  if (mounted && controller.get(mounted.composer).agent !== "codex") {
@@ -53963,6 +54356,8 @@ ${renderer_brand_mark_default}`;
53963
54356
  mutationObserver.disconnect();
53964
54357
  disposeReasoningSoftWrap();
53965
54358
  delegationMention?.dispose();
54359
+ skillLibrary.dispose();
54360
+ disposeSkillReferences();
53966
54361
  sidebarAgentIcons.dispose();
53967
54362
  stopVoiceSync();
53968
54363
  sidebarThreadState.dispose();