@karlorz/codexhost-cli-win32-x64 0.18.0-1 → 0.19.0-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.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +59 -2
- package/app/console-web.js +76 -4
- package/app/cpa-live-voice-hook.js +59 -2
- package/app/desktop-controller.mjs +290 -12
- package/app/host-runtime.mjs +12896 -2966
- package/app/plugins/antigravity/plugin.mjs +654 -216
- package/app/plugins/claude-code/plugin.mjs +138 -11
- package/app/plugins/codebuddy/plugin.mjs +152 -20
- package/app/plugins/codex-usage/plugin.mjs +59 -2
- package/app/plugins/copilot/plugin.mjs +59 -2
- package/app/plugins/cursor-cli/plugin.mjs +134 -12
- package/app/plugins/deepseek-harness/manifest.json +2 -2
- package/app/plugins/deepseek-harness/plugin.mjs +86 -7
- package/app/plugins/devin/plugin.mjs +59 -2
- package/app/plugins/grok/plugin.mjs +1093 -970
- package/app/plugins/hermes/plugin.mjs +138 -14
- package/app/plugins/kimi-code/plugin.mjs +59 -2
- package/app/plugins/kiro-cli/plugin.mjs +287 -18
- package/app/plugins/omp/plugin.mjs +789 -628
- package/app/plugins/opencode/plugin.mjs +59 -2
- package/app/plugins/pi/plugin.mjs +786 -660
- package/app/plugins/qoder/plugin.mjs +61 -6
- package/app/plugins/qoder-cn/plugin.mjs +61 -6
- package/app/plugins/qwen-code/plugin.mjs +168 -94
- package/app/plugins/workbuddy/plugin.mjs +152 -20
- package/app/plugins/zcode/plugin.mjs +132 -5
- package/app/renderer-extension.js +426 -39
- package/app/web/assets/{index-py6Ho-Dy.js → index-BCyiiDDL.js} +62 -62
- package/app/web/assets/index-BNQIOOHE.css +1 -0
- package/app/web/codexhost-settings.js +76 -4
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-file-upload/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +129 -8
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +8 -6
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +95 -93
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.excel.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-files/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +16 -16
- package/app/web/plugins/deepseek-ai__dsh-client-ui-user-questions/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +11 -11
- package/app/web-modules/server.mjs +2345 -1518
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
- 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
|
-
|
|
18504
|
-
|
|
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.
|
|
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.
|
|
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
|
|
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)
|
|
@@ -49907,6 +50025,98 @@ ${renderer_brand_mark_default}`;
|
|
|
49907
50025
|
};
|
|
49908
50026
|
}
|
|
49909
50027
|
|
|
50028
|
+
// src/renderer-skill-library.ts
|
|
50029
|
+
function createRendererSkillLibrary(options) {
|
|
50030
|
+
let active = null;
|
|
50031
|
+
const key = (context2) => JSON.stringify(context2.params);
|
|
50032
|
+
const current = (state) => {
|
|
50033
|
+
const context2 = options.context(state.editor);
|
|
50034
|
+
return active === state && context2?.client === state.context.client && key(context2) === state.key;
|
|
50035
|
+
};
|
|
50036
|
+
const close = () => {
|
|
50037
|
+
active?.unsubscribe?.();
|
|
50038
|
+
active = null;
|
|
50039
|
+
};
|
|
50040
|
+
const query = async (state) => {
|
|
50041
|
+
if (state.pending) {
|
|
50042
|
+
state.dirty = true;
|
|
50043
|
+
return;
|
|
50044
|
+
}
|
|
50045
|
+
do {
|
|
50046
|
+
state.dirty = false;
|
|
50047
|
+
state.pending = true;
|
|
50048
|
+
delete state.error;
|
|
50049
|
+
try {
|
|
50050
|
+
if (!state.context.client.listSkills)
|
|
50051
|
+
throw new Error("This Host does not support the Skill Library");
|
|
50052
|
+
const result = await state.context.client.listSkills(state.context.params);
|
|
50053
|
+
if (!current(state)) return;
|
|
50054
|
+
state.result = result;
|
|
50055
|
+
} catch (error51) {
|
|
50056
|
+
if (!current(state)) return;
|
|
50057
|
+
state.error = error51 instanceof Error ? error51.message : String(error51);
|
|
50058
|
+
} finally {
|
|
50059
|
+
state.pending = false;
|
|
50060
|
+
}
|
|
50061
|
+
options.changed();
|
|
50062
|
+
} while (state.dirty && current(state));
|
|
50063
|
+
};
|
|
50064
|
+
const open = (editor) => {
|
|
50065
|
+
const context2 = options.context(editor);
|
|
50066
|
+
if (!context2) {
|
|
50067
|
+
close();
|
|
50068
|
+
return;
|
|
50069
|
+
}
|
|
50070
|
+
if (active?.context.client === context2.client && active.key === key(context2)) {
|
|
50071
|
+
active.editor = editor;
|
|
50072
|
+
return;
|
|
50073
|
+
}
|
|
50074
|
+
close();
|
|
50075
|
+
const state = {
|
|
50076
|
+
editor,
|
|
50077
|
+
context: context2,
|
|
50078
|
+
key: key(context2),
|
|
50079
|
+
pending: false,
|
|
50080
|
+
dirty: false
|
|
50081
|
+
};
|
|
50082
|
+
active = state;
|
|
50083
|
+
if (context2.client.subscribeSkillsChanged) {
|
|
50084
|
+
state.unsubscribe = context2.client.subscribeSkillsChanged((change) => {
|
|
50085
|
+
if (!current(state)) return;
|
|
50086
|
+
if (change.cwd && !context2.params.threadId && change.cwd !== context2.params.cwd) return;
|
|
50087
|
+
void query(state);
|
|
50088
|
+
});
|
|
50089
|
+
}
|
|
50090
|
+
void query(state);
|
|
50091
|
+
};
|
|
50092
|
+
return {
|
|
50093
|
+
open,
|
|
50094
|
+
close,
|
|
50095
|
+
read(editor) {
|
|
50096
|
+
const context2 = options.context(editor);
|
|
50097
|
+
if (!context2) return null;
|
|
50098
|
+
if (!active || active.context.client !== context2.client || active.key !== key(context2))
|
|
50099
|
+
open(editor);
|
|
50100
|
+
const state = active;
|
|
50101
|
+
if (!state) return null;
|
|
50102
|
+
const zh = options.locale() === "zh-CN";
|
|
50103
|
+
return {
|
|
50104
|
+
skills: state.result?.skills ?? [],
|
|
50105
|
+
...!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" } : {},
|
|
50106
|
+
...state.result?.warnings?.length ? { warning: state.result.warnings.join("\n") } : {},
|
|
50107
|
+
...state.error ? { error: state.error } : {},
|
|
50108
|
+
retry: () => {
|
|
50109
|
+
if (current(state)) {
|
|
50110
|
+
void query(state);
|
|
50111
|
+
options.changed();
|
|
50112
|
+
}
|
|
50113
|
+
}
|
|
50114
|
+
};
|
|
50115
|
+
},
|
|
50116
|
+
dispose: close
|
|
50117
|
+
};
|
|
50118
|
+
}
|
|
50119
|
+
|
|
49910
50120
|
// src/renderer-native-composer-controller.ts
|
|
49911
50121
|
var MAX_ELEMENT_DEPTH = 4;
|
|
49912
50122
|
var MAX_FIBER_DEPTH = 40;
|
|
@@ -49961,6 +50171,39 @@ ${renderer_brand_mark_default}`;
|
|
|
49961
50171
|
return false;
|
|
49962
50172
|
}
|
|
49963
50173
|
}
|
|
50174
|
+
function nativeSelectionMarkdown(editor) {
|
|
50175
|
+
const controller = findNativeComposerController(editor);
|
|
50176
|
+
if (!controller?.getMarkdownSerializer) return null;
|
|
50177
|
+
const { doc, selection } = controller.view.state;
|
|
50178
|
+
const cut = doc.cut;
|
|
50179
|
+
if (!cut) return null;
|
|
50180
|
+
try {
|
|
50181
|
+
const serialize = controller.getMarkdownSerializer("markdown");
|
|
50182
|
+
return serialize?.(cut.call(doc, selection.from, selection.to)) ?? null;
|
|
50183
|
+
} catch {
|
|
50184
|
+
return null;
|
|
50185
|
+
}
|
|
50186
|
+
}
|
|
50187
|
+
function insertNativeMentionContent(editor, parts) {
|
|
50188
|
+
const controller = findNativeComposerController(editor);
|
|
50189
|
+
if (!controller) return false;
|
|
50190
|
+
const { schema, selection, tr } = controller.view.state;
|
|
50191
|
+
const nodeType = schema.nodes.agentMention;
|
|
50192
|
+
const text = schema.text;
|
|
50193
|
+
const create = nodeType?.create;
|
|
50194
|
+
const replace2 = tr.replaceWith;
|
|
50195
|
+
if (!text || !create || !replace2) return false;
|
|
50196
|
+
try {
|
|
50197
|
+
const literal2 = schema.marks?.literalPaste?.create();
|
|
50198
|
+
const content = parts.filter((part) => part !== "").map(
|
|
50199
|
+
(part) => typeof part === "string" ? text.call(schema, part, literal2 ? [literal2] : void 0) : create.call(nodeType, { conversationId: null, ...part })
|
|
50200
|
+
);
|
|
50201
|
+
controller.view.dispatch(replace2.call(tr, selection.from, selection.to, content));
|
|
50202
|
+
return true;
|
|
50203
|
+
} catch {
|
|
50204
|
+
return false;
|
|
50205
|
+
}
|
|
50206
|
+
}
|
|
49964
50207
|
function insertNativeAgentMention(editor, range, mention) {
|
|
49965
50208
|
const controller = findNativeComposerController(editor);
|
|
49966
50209
|
const nodeType = controller?.view.state.schema.nodes.agentMention;
|
|
@@ -49987,9 +50230,82 @@ ${renderer_brand_mark_default}`;
|
|
|
49987
50230
|
}
|
|
49988
50231
|
}
|
|
49989
50232
|
|
|
50233
|
+
// src/renderer-skill-reference.ts
|
|
50234
|
+
var STYLE_ATTRIBUTE3 = "data-codexhost-skill-reference-style";
|
|
50235
|
+
var SVG_NS3 = "http://www.w3.org/2000/svg";
|
|
50236
|
+
var CUBE = "M12 3 20 7.5v9L12 21l-8-4.5v-9ZM4 7.5 12 12l8-4.5M12 12v9";
|
|
50237
|
+
function createSkillIcon(ownerDocument) {
|
|
50238
|
+
const svg2 = ownerDocument.createElementNS(SVG_NS3, "svg");
|
|
50239
|
+
svg2.setAttribute("viewBox", "0 0 24 24");
|
|
50240
|
+
svg2.setAttribute("fill", "none");
|
|
50241
|
+
svg2.setAttribute("stroke", "currentColor");
|
|
50242
|
+
svg2.setAttribute("stroke-width", "1.7");
|
|
50243
|
+
svg2.setAttribute("stroke-linejoin", "round");
|
|
50244
|
+
svg2.setAttribute("aria-hidden", "true");
|
|
50245
|
+
const path = ownerDocument.createElementNS(SVG_NS3, "path");
|
|
50246
|
+
path.setAttribute("d", CUBE);
|
|
50247
|
+
svg2.append(path);
|
|
50248
|
+
return svg2;
|
|
50249
|
+
}
|
|
50250
|
+
function skillMention(skill) {
|
|
50251
|
+
return { name: skill.name, displayName: skill.name, path: desktopSkillMentionPath(skill) };
|
|
50252
|
+
}
|
|
50253
|
+
function installRendererSkillReferences(ownerDocument, isExternalEditor) {
|
|
50254
|
+
const style = ownerDocument.createElement("style");
|
|
50255
|
+
style.setAttribute(STYLE_ATTRIBUTE3, "true");
|
|
50256
|
+
const selector = `[agent-mention-path^="${DESKTOP_SKILL_MENTION_PATH_PREFIX}"][agent-mention-display-name]`;
|
|
50257
|
+
const icon2 = encodeURIComponent(
|
|
50258
|
+
`<svg xmlns="${SVG_NS3}" viewBox="0 0 24 24" fill="none" stroke="#808080" stroke-width="1.7" stroke-linejoin="round"><path d="${CUBE}"/></svg>`
|
|
50259
|
+
);
|
|
50260
|
+
style.textContent = `${selector}>span{display:none;}
|
|
50261
|
+
${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;}
|
|
50262
|
+
${selector}::after{content:attr(agent-mention-display-name);}`;
|
|
50263
|
+
(ownerDocument.head ?? ownerDocument.documentElement).append(style);
|
|
50264
|
+
const selectedEditor = () => {
|
|
50265
|
+
const node = ownerDocument.getSelection()?.anchorNode;
|
|
50266
|
+
const element = node?.nodeType === node?.ELEMENT_NODE ? node : node?.parentElement;
|
|
50267
|
+
const editor = element?.closest('[contenteditable="true"]');
|
|
50268
|
+
return editor && isExternalEditor(editor) ? editor : null;
|
|
50269
|
+
};
|
|
50270
|
+
const copy = (event) => {
|
|
50271
|
+
const editor = selectedEditor();
|
|
50272
|
+
if (!editor || !event.clipboardData) return;
|
|
50273
|
+
const text = nativeSelectionMarkdown(editor) ?? event.clipboardData.getData("text/plain");
|
|
50274
|
+
const canonical = restoreDesktopSkillMentions(text);
|
|
50275
|
+
if (canonical === text) return;
|
|
50276
|
+
event.clipboardData.setData("text/plain", canonical);
|
|
50277
|
+
event.preventDefault();
|
|
50278
|
+
event.stopImmediatePropagation();
|
|
50279
|
+
};
|
|
50280
|
+
const paste = (event) => {
|
|
50281
|
+
const editor = selectedEditor();
|
|
50282
|
+
if (!editor || !event.clipboardData || event.clipboardData.files.length) return;
|
|
50283
|
+
const text = event.clipboardData.getData("text/plain");
|
|
50284
|
+
const references = skillReferences(text);
|
|
50285
|
+
if (!references.length) return;
|
|
50286
|
+
const parts = [];
|
|
50287
|
+
let cursor = 0;
|
|
50288
|
+
for (const reference of references) {
|
|
50289
|
+
parts.push(text.slice(cursor, reference.start), skillMention(reference));
|
|
50290
|
+
cursor = reference.end;
|
|
50291
|
+
}
|
|
50292
|
+
parts.push(text.slice(cursor));
|
|
50293
|
+
if (!insertNativeMentionContent(editor, parts)) return;
|
|
50294
|
+
event.preventDefault();
|
|
50295
|
+
event.stopImmediatePropagation();
|
|
50296
|
+
};
|
|
50297
|
+
ownerDocument.addEventListener("copy", copy, true);
|
|
50298
|
+
ownerDocument.addEventListener("paste", paste, true);
|
|
50299
|
+
return () => {
|
|
50300
|
+
ownerDocument.removeEventListener("copy", copy, true);
|
|
50301
|
+
ownerDocument.removeEventListener("paste", paste, true);
|
|
50302
|
+
style.remove();
|
|
50303
|
+
};
|
|
50304
|
+
}
|
|
50305
|
+
|
|
49990
50306
|
// src/renderer-delegation-mention.ts
|
|
49991
50307
|
var MENU_ATTRIBUTE = "data-codexhost-delegation-mention-menu";
|
|
49992
|
-
var
|
|
50308
|
+
var STYLE_ATTRIBUTE4 = "data-codexhost-delegation-mention-style";
|
|
49993
50309
|
var MENU_MAX_HEIGHT = 320;
|
|
49994
50310
|
var SOURCE_TAG = "codexhost";
|
|
49995
50311
|
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 +50350,13 @@ ${renderer_brand_mark_default}`;
|
|
|
50034
50350
|
return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ command }) => command);
|
|
50035
50351
|
}
|
|
50036
50352
|
function harnessCommandDisplayName(label) {
|
|
50037
|
-
const slug = label.trim().replace(/^\//u, "")
|
|
50353
|
+
const slug = label.trim().replace(/^\//u, "");
|
|
50038
50354
|
if (!slug || /\s/u.test(slug) || /[A-Z]/u.test(slug) || /[^\x00-\x7F]/u.test(slug)) {
|
|
50039
50355
|
return slug || label;
|
|
50040
50356
|
}
|
|
50041
50357
|
const name = slug.split(":").filter(Boolean).at(-1) ?? slug;
|
|
50042
50358
|
return name.split(/[-_.]+/u).filter(Boolean).map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");
|
|
50043
50359
|
}
|
|
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
50360
|
function agentsTitle(locale) {
|
|
50059
50361
|
return locale === "zh-CN" ? "\u59D4\u6D3E\u7ED9 Agent" : "Delegate to agent";
|
|
50060
50362
|
}
|
|
@@ -50076,10 +50378,10 @@ ${renderer_brand_mark_default}`;
|
|
|
50076
50378
|
return `"${value.replace(/["\\\n]/gu, (character) => `\\${character === "\n" ? "a " : character}`)}"`;
|
|
50077
50379
|
}
|
|
50078
50380
|
function syncChipStyle(ownerDocument, targets, cache) {
|
|
50079
|
-
let style = ownerDocument.querySelector(`style[${
|
|
50381
|
+
let style = ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`);
|
|
50080
50382
|
if (!style) {
|
|
50081
50383
|
style = ownerDocument.createElement("style");
|
|
50082
|
-
style.setAttribute(
|
|
50384
|
+
style.setAttribute(STYLE_ATTRIBUTE4, "true");
|
|
50083
50385
|
(ownerDocument.head ?? ownerDocument.documentElement).append(style);
|
|
50084
50386
|
}
|
|
50085
50387
|
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 +50403,13 @@ ${renderer_brand_mark_default}`;
|
|
|
50101
50403
|
const text = rules.join("\n");
|
|
50102
50404
|
if (style.textContent !== text) style.textContent = text;
|
|
50103
50405
|
}
|
|
50406
|
+
function filterDelegationSkills(skills, query) {
|
|
50407
|
+
const needle = query.trim().toLowerCase();
|
|
50408
|
+
return skills.filter(
|
|
50409
|
+
(skill) => `${skill.name}
|
|
50410
|
+
${skill.description ?? ""}`.toLowerCase().includes(needle)
|
|
50411
|
+
);
|
|
50412
|
+
}
|
|
50104
50413
|
function installRendererDelegationMention(ownerDocument, options) {
|
|
50105
50414
|
const view = ownerDocument.defaultView;
|
|
50106
50415
|
if (!view) {
|
|
@@ -50135,9 +50444,11 @@ ${renderer_brand_mark_default}`;
|
|
|
50135
50444
|
let rowsRendered = 0;
|
|
50136
50445
|
const close = () => {
|
|
50137
50446
|
active = null;
|
|
50447
|
+
openedFor = null;
|
|
50138
50448
|
entries = [];
|
|
50139
50449
|
setMenuOpen(false);
|
|
50140
50450
|
list.replaceChildren();
|
|
50451
|
+
options.onClose?.();
|
|
50141
50452
|
};
|
|
50142
50453
|
const highlight = () => {
|
|
50143
50454
|
[...list.querySelectorAll("[role=option]")].forEach((item, index) => {
|
|
@@ -50210,7 +50521,7 @@ ${renderer_brand_mark_default}`;
|
|
|
50210
50521
|
item.addEventListener("click", () => void choose(entry));
|
|
50211
50522
|
return item;
|
|
50212
50523
|
};
|
|
50213
|
-
const render = (trigger, commands, targets) => {
|
|
50524
|
+
const render = (trigger, commands, targets, skills) => {
|
|
50214
50525
|
const locale = options.readLocale();
|
|
50215
50526
|
const rows = [];
|
|
50216
50527
|
entries = [];
|
|
@@ -50230,18 +50541,13 @@ ${renderer_brand_mark_default}`;
|
|
|
50230
50541
|
}
|
|
50231
50542
|
}
|
|
50232
50543
|
if (commands) {
|
|
50233
|
-
|
|
50234
|
-
|
|
50235
|
-
|
|
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) {
|
|
50544
|
+
if (commands.matches.length) {
|
|
50545
|
+
rows.push(sectionHeader(commandsTitle(locale)));
|
|
50546
|
+
for (const command of commands.matches) {
|
|
50241
50547
|
const reason = commands.source.disabledReason(command);
|
|
50242
50548
|
const presentation = rendererHarnessCommandPresentation(command, locale);
|
|
50243
50549
|
const content = rowContent(
|
|
50244
|
-
|
|
50550
|
+
createHarnessCommandIcon(ownerDocument),
|
|
50245
50551
|
harnessCommandDisplayName(presentation.label),
|
|
50246
50552
|
reason ?? presentation.description
|
|
50247
50553
|
);
|
|
@@ -50269,6 +50575,44 @@ ${renderer_brand_mark_default}`;
|
|
|
50269
50575
|
hint.textContent = notice;
|
|
50270
50576
|
rows.push(hint);
|
|
50271
50577
|
}
|
|
50578
|
+
if (skills) {
|
|
50579
|
+
rows.push(sectionHeader(skillsTitle(locale)));
|
|
50580
|
+
const matches = filterDelegationSkills(skills.skills, trigger.query);
|
|
50581
|
+
for (const skill of matches) {
|
|
50582
|
+
const scope = locale === "zh-CN" ? skill.scope === "project" ? "\u9879\u76EE" : "\u5168\u5C40" : skill.scope === "project" ? "Project" : "Global";
|
|
50583
|
+
const detail = `${scope} \xB7 ${skill.source} \xB7 ${skill.path}${skill.description ? ` \u2014 ${skill.description}` : ""}`;
|
|
50584
|
+
const content = rowContent(createSkillIcon(ownerDocument), skill.name, detail);
|
|
50585
|
+
content.setAttribute("data-skill-path", skill.path);
|
|
50586
|
+
content.title = detail;
|
|
50587
|
+
rows.push(optionRow({ kind: "librarySkill", skill }, content));
|
|
50588
|
+
}
|
|
50589
|
+
const hint = (label, detail = "") => {
|
|
50590
|
+
const row = ownerDocument.createElement("div");
|
|
50591
|
+
row.className = `${ROW_CLASS} opacity-50`;
|
|
50592
|
+
row.setAttribute("aria-disabled", "true");
|
|
50593
|
+
row.title = detail;
|
|
50594
|
+
row.append(rowContent(null, label, detail));
|
|
50595
|
+
rows.push(row);
|
|
50596
|
+
};
|
|
50597
|
+
if (skills.error) {
|
|
50598
|
+
rows.push(
|
|
50599
|
+
optionRow(
|
|
50600
|
+
{ kind: "retrySkills", retry: skills.retry },
|
|
50601
|
+
rowContent(
|
|
50602
|
+
null,
|
|
50603
|
+
locale === "zh-CN" ? "\u91CD\u8BD5 Skill \u5E93" : "Retry Skill Library",
|
|
50604
|
+
skills.error
|
|
50605
|
+
)
|
|
50606
|
+
)
|
|
50607
|
+
);
|
|
50608
|
+
} else if (skills.notice) hint(skills.notice);
|
|
50609
|
+
else if (!matches.length) hint(locale === "zh-CN" ? "\u672A\u627E\u5230 Skill" : "No Skills found");
|
|
50610
|
+
if (skills.warning)
|
|
50611
|
+
hint(
|
|
50612
|
+
locale === "zh-CN" ? "\u90E8\u5206 Skill \u65E0\u6CD5\u8BFB\u53D6" : "Some Skills could not be read",
|
|
50613
|
+
skills.warning
|
|
50614
|
+
);
|
|
50615
|
+
}
|
|
50272
50616
|
rowsRendered = rows.length;
|
|
50273
50617
|
list.replaceChildren(...rows);
|
|
50274
50618
|
activeIndex = Math.min(activeIndex, Math.max(0, entries.length - 1));
|
|
@@ -50311,15 +50655,16 @@ ${renderer_brand_mark_default}`;
|
|
|
50311
50655
|
const targets = filterDelegationTargets(allTargets, trigger.query);
|
|
50312
50656
|
const source = options.readCommands(trigger.editor);
|
|
50313
50657
|
const commandMatches = source ? filterDelegationCommands(source.commands, trigger.query) : [];
|
|
50658
|
+
const skills = options.readSkills?.(trigger.editor) ?? null;
|
|
50314
50659
|
const showsNotice = Boolean(source?.pendingNotice) && trigger.query === "";
|
|
50315
|
-
if (targets.length === 0 && commandMatches.length === 0 && !showsNotice) {
|
|
50660
|
+
if (targets.length === 0 && commandMatches.length === 0 && !showsNotice && !skills) {
|
|
50316
50661
|
close();
|
|
50317
50662
|
return;
|
|
50318
50663
|
}
|
|
50319
50664
|
const sameQuery = active?.query === trigger.query && active.node === trigger.node;
|
|
50320
50665
|
active = trigger;
|
|
50321
50666
|
if (!sameQuery) activeIndex = 0;
|
|
50322
|
-
render(trigger, source ? { source, matches: commandMatches } : null, targets);
|
|
50667
|
+
render(trigger, source ? { source, matches: commandMatches } : null, targets, skills);
|
|
50323
50668
|
if (rowsRendered === 0) close();
|
|
50324
50669
|
};
|
|
50325
50670
|
const waitForSelectionSync = () => new Promise((resolve) => view.setTimeout(resolve, 0));
|
|
@@ -50373,7 +50718,12 @@ ${renderer_brand_mark_default}`;
|
|
|
50373
50718
|
source.select(command);
|
|
50374
50719
|
};
|
|
50375
50720
|
const choose = async (entry) => {
|
|
50721
|
+
if (entry.kind === "retrySkills") {
|
|
50722
|
+
entry.retry();
|
|
50723
|
+
return;
|
|
50724
|
+
}
|
|
50376
50725
|
const trigger = active;
|
|
50726
|
+
if (entry.kind === "librarySkill" && trigger && !options.readSkills?.(trigger.editor)) return;
|
|
50377
50727
|
close();
|
|
50378
50728
|
if (!trigger || !trigger.node.isConnected) return;
|
|
50379
50729
|
const expected = `#${trigger.query}`;
|
|
@@ -50382,7 +50732,15 @@ ${renderer_brand_mark_default}`;
|
|
|
50382
50732
|
inserting = true;
|
|
50383
50733
|
try {
|
|
50384
50734
|
if (entry.kind === "agent") await insertAgent(trigger, range, entry.target);
|
|
50385
|
-
else
|
|
50735
|
+
else if (entry.kind === "librarySkill") {
|
|
50736
|
+
const mention = skillMention(entry.skill);
|
|
50737
|
+
if (!insertNativeAgentMention(trigger.editor, range, mention)) {
|
|
50738
|
+
if (!await selectTriggerText(trigger)) return;
|
|
50739
|
+
const carrier = `[@${mention.name}](${mention.path}) `;
|
|
50740
|
+
if (!dispatchPlainTextPaste(trigger.editor, carrier))
|
|
50741
|
+
ownerDocument.execCommand("insertText", false, carrier);
|
|
50742
|
+
}
|
|
50743
|
+
} else await runCommand(trigger, range, entry);
|
|
50386
50744
|
} finally {
|
|
50387
50745
|
inserting = false;
|
|
50388
50746
|
}
|
|
@@ -50434,8 +50792,9 @@ ${renderer_brand_mark_default}`;
|
|
|
50434
50792
|
ownerDocument.removeEventListener("pointerdown", onPointerDown, true);
|
|
50435
50793
|
view.removeEventListener("resize", onViewportChange);
|
|
50436
50794
|
view.removeEventListener("scroll", onViewportChange, true);
|
|
50795
|
+
options.onClose?.();
|
|
50437
50796
|
menu.remove();
|
|
50438
|
-
ownerDocument.querySelector(`style[${
|
|
50797
|
+
ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`)?.remove();
|
|
50439
50798
|
};
|
|
50440
50799
|
const openFor = (editor) => {
|
|
50441
50800
|
editor.focus({ preventScroll: true });
|
|
@@ -51880,6 +52239,28 @@ ${renderer_brand_mark_default}`;
|
|
|
51880
52239
|
}
|
|
51881
52240
|
}
|
|
51882
52241
|
}
|
|
52242
|
+
const skillContext = (editor) => {
|
|
52243
|
+
const composer = composerForElement(editor);
|
|
52244
|
+
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
52245
|
+
if (!mounted || !editor.isContentEditable || controller.get(mounted.composer).agent === "codex" || isOwnershipSubmissionBlocked(mounted.ownershipStatus))
|
|
52246
|
+
return null;
|
|
52247
|
+
const threadId = threadIdFromComposerModelTarget(mounted.modelTarget);
|
|
52248
|
+
const hostId2 = threadId ? mounted.hostId : activeModelHostId(mounted.composer);
|
|
52249
|
+
if (hostId2 !== "local") return null;
|
|
52250
|
+
const client = modelClientForHost(hostId2);
|
|
52251
|
+
if (!client) return null;
|
|
52252
|
+
const cwd = draftWorkspaces.get(hostId2);
|
|
52253
|
+
return { client, params: threadId ? { threadId } : cwd ? { cwd } : {} };
|
|
52254
|
+
};
|
|
52255
|
+
const skillLibrary = createRendererSkillLibrary({
|
|
52256
|
+
context: skillContext,
|
|
52257
|
+
locale: () => settingsLifecycle.locale,
|
|
52258
|
+
changed: () => delegationMention?.refresh()
|
|
52259
|
+
});
|
|
52260
|
+
const disposeSkillReferences = installRendererSkillReferences(
|
|
52261
|
+
document,
|
|
52262
|
+
(editor) => skillContext(editor) !== null
|
|
52263
|
+
);
|
|
51883
52264
|
const refreshCommands = async (mounted, { keepCurrent = false } = {}) => {
|
|
51884
52265
|
const generation = ++mounted.commandRequestGeneration;
|
|
51885
52266
|
const agent = controller.get(mounted.composer).agent;
|
|
@@ -53709,6 +54090,7 @@ ${renderer_brand_mark_default}`;
|
|
|
53709
54090
|
const { hostId: hostId2, cwd } = detail;
|
|
53710
54091
|
if (typeof hostId2 !== "string" || typeof cwd !== "string" || cwd.length === 0) return;
|
|
53711
54092
|
draftWorkspaces.set(hostId2, cwd);
|
|
54093
|
+
delegationMention?.refresh();
|
|
53712
54094
|
for (const mounted of mountedByComposer.values()) {
|
|
53713
54095
|
if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId(mounted.composer) === hostId2 && controller.get(mounted.composer).agent !== "codex") {
|
|
53714
54096
|
void refreshCommands(mounted, { keepCurrent: true });
|
|
@@ -53745,7 +54127,10 @@ ${renderer_brand_mark_default}`;
|
|
|
53745
54127
|
window.addEventListener(CODEX_USAGE_BANNER_CHANGE_EVENT, onUsageBannerPreference);
|
|
53746
54128
|
window.addEventListener("storage", onUsageBannerStorage);
|
|
53747
54129
|
delegationMention = installRendererDelegationMention(document, {
|
|
54130
|
+
readSkills: (editor) => skillLibrary.read(editor),
|
|
54131
|
+
onClose: () => skillLibrary.close(),
|
|
53748
54132
|
onOpen: (editor) => {
|
|
54133
|
+
skillLibrary.open(editor);
|
|
53749
54134
|
const composer = composerForElement(editor);
|
|
53750
54135
|
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
53751
54136
|
if (mounted && controller.get(mounted.composer).agent !== "codex") {
|
|
@@ -53963,6 +54348,8 @@ ${renderer_brand_mark_default}`;
|
|
|
53963
54348
|
mutationObserver.disconnect();
|
|
53964
54349
|
disposeReasoningSoftWrap();
|
|
53965
54350
|
delegationMention?.dispose();
|
|
54351
|
+
skillLibrary.dispose();
|
|
54352
|
+
disposeSkillReferences();
|
|
53966
54353
|
sidebarAgentIcons.dispose();
|
|
53967
54354
|
stopVoiceSync();
|
|
53968
54355
|
sidebarThreadState.dispose();
|