@liberseek/boft-cli-win32-arm64 0.7.1 → 0.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/desktop-controller.mjs +49 -18
- package/app/host-runtime.mjs +1025 -671
- package/app/plugins/antigravity/plugin.mjs +18 -3
- package/app/plugins/claude-code/plugin.mjs +214 -7
- package/app/plugins/codebuddy/plugin.mjs +103 -5
- package/app/plugins/cursor-cli/plugin.mjs +152 -53
- package/app/plugins/deepseek-harness/plugin.mjs +34 -21
- package/app/plugins/enabled.json +2 -1
- package/app/plugins/grok/plugin.mjs +281 -88
- package/app/plugins/hermes/plugin.mjs +162 -63
- package/app/plugins/kimi-code/manifest.json +11 -0
- package/app/plugins/kimi-code/plugin.mjs +24259 -0
- package/app/plugins/kiro-cli/plugin.mjs +257 -65
- package/app/plugins/muse/plugin.mjs +18 -3
- package/app/plugins/omp/plugin.mjs +258 -67
- package/app/plugins/opencode/plugin.mjs +18 -3
- package/app/plugins/pi/plugin.mjs +211 -4
- package/app/plugins/qoder/plugin.mjs +285 -193
- package/app/plugins/qoder-cn/plugin.mjs +285 -193
- package/app/plugins/workbuddy/plugin.mjs +102 -5
- package/app/renderer-extension.js +1304 -468
- package/bin/boft.exe +0 -0
- package/libexec/boft-node-repl.exe +0 -0
- package/libexec/boft-shim.exe +0 -0
- package/libexec/boft-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"workbuddy",
|
|
24
24
|
"cursor-cli",
|
|
25
25
|
"qoder",
|
|
26
|
-
"qoder-cn"
|
|
26
|
+
"qoder-cn",
|
|
27
|
+
"kimi-code"
|
|
27
28
|
];
|
|
28
29
|
var DEFAULT_RENDERER_AGENTS = KNOWN_RENDERER_AGENTS;
|
|
29
30
|
function defaultIdFactory(sequence) {
|
|
@@ -160,6 +161,8 @@
|
|
|
160
161
|
else if (agent === "qoder") delete state.qoderModel;
|
|
161
162
|
if (agent === "qoder-cn" && model) state.qoderCnModel = model;
|
|
162
163
|
else if (agent === "qoder-cn") delete state.qoderCnModel;
|
|
164
|
+
if (agent === "kimi-code" && model) state.kimiCodeModel = model;
|
|
165
|
+
else if (agent === "kimi-code") delete state.kimiCodeModel;
|
|
163
166
|
if (agent === "pi" && thinkingOptionId) state.piThinkingOptionId = thinkingOptionId;
|
|
164
167
|
else if (agent === "pi") delete state.piThinkingOptionId;
|
|
165
168
|
if (agent === "claude-code" && thinkingOptionId) {
|
|
@@ -193,6 +196,9 @@
|
|
|
193
196
|
if (agent === "qoder-cn" && thinkingOptionId) {
|
|
194
197
|
state.qoderCnThinkingOptionId = thinkingOptionId;
|
|
195
198
|
} else if (agent === "qoder-cn") delete state.qoderCnThinkingOptionId;
|
|
199
|
+
if (agent === "kimi-code" && thinkingOptionId) {
|
|
200
|
+
state.kimiCodeThinkingOptionId = thinkingOptionId;
|
|
201
|
+
} else if (agent === "kimi-code") delete state.kimiCodeThinkingOptionId;
|
|
196
202
|
if (agent !== "codex") {
|
|
197
203
|
const permissionModeByAgent = {};
|
|
198
204
|
for (const candidate of [
|
|
@@ -210,7 +216,8 @@
|
|
|
210
216
|
"workbuddy",
|
|
211
217
|
"cursor-cli",
|
|
212
218
|
"qoder",
|
|
213
|
-
"qoder-cn"
|
|
219
|
+
"qoder-cn",
|
|
220
|
+
"kimi-code"
|
|
214
221
|
]) {
|
|
215
222
|
const current = state.permissionModeByAgent?.[candidate];
|
|
216
223
|
if (candidate !== agent && current) permissionModeByAgent[candidate] = current;
|
|
@@ -241,6 +248,7 @@
|
|
|
241
248
|
if (agent === "cursor-cli") return state.cursorCliModel;
|
|
242
249
|
if (agent === "qoder") return state.qoderModel;
|
|
243
250
|
if (agent === "qoder-cn") return state.qoderCnModel;
|
|
251
|
+
if (agent === "kimi-code") return state.kimiCodeModel;
|
|
244
252
|
return void 0;
|
|
245
253
|
}
|
|
246
254
|
thinkingOptionForAgent(composer, agent) {
|
|
@@ -257,6 +265,7 @@
|
|
|
257
265
|
if (agent === "workbuddy") return state.workBuddyThinkingOptionId;
|
|
258
266
|
if (agent === "qoder") return state.qoderThinkingOptionId;
|
|
259
267
|
if (agent === "qoder-cn") return state.qoderCnThinkingOptionId;
|
|
268
|
+
if (agent === "kimi-code") return state.kimiCodeThinkingOptionId;
|
|
260
269
|
return void 0;
|
|
261
270
|
}
|
|
262
271
|
permissionModeForAgent(composer, agent) {
|
|
@@ -287,6 +296,7 @@
|
|
|
287
296
|
else if (agent === "cursor-cli") state.cursorCliModel = model;
|
|
288
297
|
else if (agent === "qoder") state.qoderModel = model;
|
|
289
298
|
else if (agent === "qoder-cn") state.qoderCnModel = model;
|
|
299
|
+
else if (agent === "kimi-code") state.kimiCodeModel = model;
|
|
290
300
|
else state.antigravityModel = model;
|
|
291
301
|
return state;
|
|
292
302
|
}
|
|
@@ -348,6 +358,10 @@
|
|
|
348
358
|
state.qoderCnThinkingOptionId = thinkingOptionId;
|
|
349
359
|
} else if (agent === "qoder-cn") {
|
|
350
360
|
delete state.qoderCnThinkingOptionId;
|
|
361
|
+
} else if (agent === "kimi-code" && thinkingOptionId) {
|
|
362
|
+
state.kimiCodeThinkingOptionId = thinkingOptionId;
|
|
363
|
+
} else if (agent === "kimi-code") {
|
|
364
|
+
delete state.kimiCodeThinkingOptionId;
|
|
351
365
|
}
|
|
352
366
|
return state;
|
|
353
367
|
}
|
|
@@ -15770,10 +15784,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15770
15784
|
invocation: commandInvocationSchema,
|
|
15771
15785
|
label: commandLabelSchema,
|
|
15772
15786
|
description: commandDescriptionSchema.optional(),
|
|
15773
|
-
argumentMode: external_exports.enum(["none", "text"])
|
|
15787
|
+
argumentMode: external_exports.enum(["none", "text"]),
|
|
15788
|
+
/**
|
|
15789
|
+
* Native distinction reported by the Harness. Omitted when the Harness does
|
|
15790
|
+
* not tell skills and commands apart; consumers treat that as "command".
|
|
15791
|
+
*/
|
|
15792
|
+
kind: external_exports.enum(["command", "skill"]).optional()
|
|
15774
15793
|
}).strict();
|
|
15775
15794
|
var harnessCommandCatalogSchema = external_exports.object({
|
|
15776
|
-
commands: external_exports.array(harnessCommandDescriptorSchema)
|
|
15795
|
+
commands: external_exports.array(harnessCommandDescriptorSchema),
|
|
15796
|
+
/**
|
|
15797
|
+
* `live` when the catalog includes what a native Session reports for its
|
|
15798
|
+
* workspace (custom commands, skills); `static` for Adapter built-ins only.
|
|
15799
|
+
* Omitted by Adapters; set by the Host on inspection results.
|
|
15800
|
+
*/
|
|
15801
|
+
source: external_exports.enum(["live", "static"]).optional()
|
|
15777
15802
|
}).strict().superRefine((catalog, context) => {
|
|
15778
15803
|
const ids = /* @__PURE__ */ new Set();
|
|
15779
15804
|
for (const [index, command] of catalog.commands.entries()) {
|
|
@@ -15787,7 +15812,11 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15787
15812
|
ids.add(command.id);
|
|
15788
15813
|
}
|
|
15789
15814
|
});
|
|
15790
|
-
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
15815
|
+
var harnessCommandsInspectParamsSchema = external_exports.object({
|
|
15816
|
+
harnessId: harnessIdSchema,
|
|
15817
|
+
/** Workspace of a draft without a Thread, for its live catalog when known. */
|
|
15818
|
+
cwd: external_exports.string().min(1).optional()
|
|
15819
|
+
}).strict();
|
|
15791
15820
|
var threadCommandsInspectParamsSchema = external_exports.object({
|
|
15792
15821
|
threadId: hostThreadIdSchema
|
|
15793
15822
|
}).strict();
|
|
@@ -15926,6 +15955,30 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
15926
15955
|
status: updateStatusSchema.nullable()
|
|
15927
15956
|
});
|
|
15928
15957
|
|
|
15958
|
+
// ../shared-contracts/dist/delegation-mention.js
|
|
15959
|
+
var DELEGATION_MENTION_PATH_PREFIX = "subagent://codexhost.";
|
|
15960
|
+
var HARNESS_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/u;
|
|
15961
|
+
function delegationMentionPath(harnessId) {
|
|
15962
|
+
if (!HARNESS_ID_PATTERN.test(harnessId)) {
|
|
15963
|
+
throw new Error(`Invalid delegation mention Harness id: ${harnessId}`);
|
|
15964
|
+
}
|
|
15965
|
+
return `${DELEGATION_MENTION_PATH_PREFIX}${harnessId}`;
|
|
15966
|
+
}
|
|
15967
|
+
function sanitizeLabel(label) {
|
|
15968
|
+
const cleaned = label.replace(/[[\]()\n\r]+/gu, " ").replace(/\s+/gu, " ").trim();
|
|
15969
|
+
return cleaned.length > 0 ? cleaned : "agent";
|
|
15970
|
+
}
|
|
15971
|
+
function formatDelegationMentionLink(mention) {
|
|
15972
|
+
return `[@${sanitizeLabel(mention.label)}](${delegationMentionPath(mention.harnessId)})`;
|
|
15973
|
+
}
|
|
15974
|
+
var HARNESS_COMMAND_MENTION_PATH_PREFIX = "subagent://codexhost-command.";
|
|
15975
|
+
function harnessCommandMentionPath(invocation) {
|
|
15976
|
+
const name = invocation.trim().replace(/^\//u, "");
|
|
15977
|
+
if (!name || /\s/u.test(name))
|
|
15978
|
+
throw new Error(`Invalid Harness command: ${invocation}`);
|
|
15979
|
+
return `${HARNESS_COMMAND_MENTION_PATH_PREFIX}${encodeURIComponent(name).replace(/[()]/gu, (character) => `%${character.charCodeAt(0).toString(16).toUpperCase()}`)}`;
|
|
15980
|
+
}
|
|
15981
|
+
|
|
15929
15982
|
// ../shared-contracts/dist/index.js
|
|
15930
15983
|
var workspaceContractVersionSchema = external_exports.literal(WORKSPACE_CONTRACT_VERSION);
|
|
15931
15984
|
|
|
@@ -16086,6 +16139,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16086
16139
|
return sharedStore;
|
|
16087
16140
|
}
|
|
16088
16141
|
|
|
16142
|
+
// src/assets/kimi-agent.svg
|
|
16143
|
+
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';
|
|
16144
|
+
|
|
16089
16145
|
// src/assets/codex-agent.png
|
|
16090
16146
|
var codex_agent_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGgAAABoCAYAAAAdHLWhAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAJnFJREFUeAHtfQuYFdW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WJq4+bkVLU1717atXXtPEpXXZKW/pGVYhij9bXT/HRrnsAzLsAzLsAzLsAzLsHwl5f8DGzhXq3EeY8wAAAAASUVORK5CYII=";
|
|
16091
16147
|
|
|
@@ -16136,7 +16192,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16136
16192
|
workbuddy: "WorkBuddy",
|
|
16137
16193
|
"cursor-cli": "Cursor CLI (Experimental)",
|
|
16138
16194
|
qoder: "Qoder",
|
|
16139
|
-
"qoder-cn": "Qoder CN"
|
|
16195
|
+
"qoder-cn": "Qoder CN",
|
|
16196
|
+
"kimi-code": "Kimi Code"
|
|
16140
16197
|
};
|
|
16141
16198
|
var PI_PATHS = [
|
|
16142
16199
|
{
|
|
@@ -16211,9 +16268,9 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16211
16268
|
image.style.flex = "none";
|
|
16212
16269
|
return image;
|
|
16213
16270
|
}
|
|
16214
|
-
if (agent === "antigravity" || agent === "kiro-cli" || agent === "codebuddy" || agent === "workbuddy" || agent === "cursor-cli") {
|
|
16271
|
+
if (agent === "antigravity" || agent === "kiro-cli" || agent === "codebuddy" || agent === "workbuddy" || agent === "cursor-cli" || agent === "kimi-code") {
|
|
16215
16272
|
const image = ownerDocument.createElement("img");
|
|
16216
|
-
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;
|
|
16273
|
+
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;
|
|
16217
16274
|
image.alt = "";
|
|
16218
16275
|
image.draggable = false;
|
|
16219
16276
|
image.style.width = `${size}px`;
|
|
@@ -16881,6 +16938,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16881
16938
|
binary: "qoderclicn",
|
|
16882
16939
|
posix: "npm install -g @qodercn-ai/qoderclicn",
|
|
16883
16940
|
windows: "npm install -g @qodercn-ai/qoderclicn"
|
|
16941
|
+
},
|
|
16942
|
+
"kimi-code": {
|
|
16943
|
+
url: "https://moonshotai.github.io/kimi-code/en/guides/getting-started.html",
|
|
16944
|
+
binary: "kimi",
|
|
16945
|
+
posix: "curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash",
|
|
16946
|
+
windows: "irm https://code.kimi.com/kimi-code/install.ps1 | iex"
|
|
16884
16947
|
}
|
|
16885
16948
|
});
|
|
16886
16949
|
function harnessInstallPlatform(window2) {
|
|
@@ -17110,6 +17173,12 @@ ${error51.stderrTail}`] : []
|
|
|
17110
17173
|
const body = document2.createElement("div");
|
|
17111
17174
|
body.className = "settings-connection-inline-detail";
|
|
17112
17175
|
body.dataset.connectionDetail = item.key;
|
|
17176
|
+
if (item.agentSnapshot?.agent === "deepseek-harness") {
|
|
17177
|
+
const compatibility = document2.createElement("p");
|
|
17178
|
+
compatibility.className = "settings-connection-compatibility";
|
|
17179
|
+
compatibility.textContent = messages.connectionDeepSeekTestedVersions;
|
|
17180
|
+
body.append(compatibility);
|
|
17181
|
+
}
|
|
17113
17182
|
if (item.agentSnapshot?.availability === "notInstalled") {
|
|
17114
17183
|
const guide = harnessInstallGuide(
|
|
17115
17184
|
item.agentSnapshot.agent,
|
|
@@ -18029,6 +18098,7 @@ ${error51.stderrTail}`] : []
|
|
|
18029
18098
|
launchPathSaveError: "Could not save. Enter an existing absolute installation folder on this Host and check configuration permissions.",
|
|
18030
18099
|
connectionOpenInstallation: "Open official installation page",
|
|
18031
18100
|
connectionOpenHarnessWeb: "Open DeepSeek Harness Web",
|
|
18101
|
+
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.",
|
|
18032
18102
|
connectionInstall: "Install",
|
|
18033
18103
|
connectionInstallDescription: "This Harness was not detected. Copy the official install command, copy an install prompt for another Agent, or open the official installation page. After installing, return here and run the check again.",
|
|
18034
18104
|
connectionInstallCommand: "Install command",
|
|
@@ -18072,7 +18142,8 @@ ${error51.stderrTail}`] : []
|
|
|
18072
18142
|
updateWaitingForExit: "Waiting for the application to close...",
|
|
18073
18143
|
updateInstalling: "Installing update...",
|
|
18074
18144
|
updateInstallingNpm: "Installing update through npm...",
|
|
18075
|
-
updateRequestTimeout: "The update service did not respond.
|
|
18145
|
+
updateRequestTimeout: "The update service did not respond. Download the latest version from GitHub Releases below.",
|
|
18146
|
+
updateServiceUnavailable: "Automatic updates are unavailable right now. Download the latest version from GitHub Releases below.",
|
|
18076
18147
|
updateRestarting: "Restarting to finish the update...",
|
|
18077
18148
|
updateSucceeded: "Update installed successfully.",
|
|
18078
18149
|
updateFailed: "Update failed.",
|
|
@@ -18295,6 +18366,7 @@ ${error51.stderrTail}`] : []
|
|
|
18295
18366
|
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",
|
|
18296
18367
|
connectionOpenInstallation: "\u524D\u5F80\u5B98\u65B9\u5B89\u88C5\u9875\u9762",
|
|
18297
18368
|
connectionOpenHarnessWeb: "\u6253\u5F00 DeepSeek Harness Web",
|
|
18369
|
+
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",
|
|
18298
18370
|
connectionInstall: "\u5B89\u88C5",
|
|
18299
18371
|
connectionInstallDescription: "\u5C1A\u672A\u68C0\u6D4B\u5230\u8BE5 Harness\u3002\u53EF\u4EE5\u590D\u5236\u5B98\u65B9\u5B89\u88C5\u547D\u4EE4\u3001\u590D\u5236\u5B89\u88C5 Prompt \u4EA4\u7ED9\u5176\u4ED6 Agent \u6267\u884C\uFF0C\u6216\u524D\u5F80\u5B98\u65B9\u5B89\u88C5\u9875\u9762\u3002\u5B89\u88C5\u5B8C\u6210\u540E\u8BF7\u8FD4\u56DE\u6B64\u9875\u9762\u91CD\u65B0\u68C0\u67E5\u3002",
|
|
18300
18372
|
connectionInstallCommand: "\u5B89\u88C5\u547D\u4EE4",
|
|
@@ -18338,7 +18410,8 @@ ${error51.stderrTail}`] : []
|
|
|
18338
18410
|
updateWaitingForExit: "\u6B63\u5728\u7B49\u5F85\u5E94\u7528\u9000\u51FA...",
|
|
18339
18411
|
updateInstalling: "\u6B63\u5728\u5B89\u88C5\u66F4\u65B0...",
|
|
18340
18412
|
updateInstallingNpm: "\u6B63\u5728\u901A\u8FC7 npm \u5B89\u88C5...",
|
|
18341
|
-
updateRequestTimeout: "\u66F4\u65B0\u670D\u52A1\u672A\u54CD\u5E94\uFF0C\u8BF7\
|
|
18413
|
+
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",
|
|
18414
|
+
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",
|
|
18342
18415
|
updateRestarting: "\u6B63\u5728\u91CD\u542F\u4EE5\u5B8C\u6210\u66F4\u65B0...",
|
|
18343
18416
|
updateSucceeded: "\u66F4\u65B0\u5B89\u88C5\u6210\u529F\u3002",
|
|
18344
18417
|
updateFailed: "\u66F4\u65B0\u5931\u8D25\u3002",
|
|
@@ -19893,26 +19966,30 @@ ${error51.stderrTail}`] : []
|
|
|
19893
19966
|
harnessCommands: "Harness commands",
|
|
19894
19967
|
commandsUnavailable: "No Harness commands available yet",
|
|
19895
19968
|
commandRequiresConversation: "Start a conversation before running this command",
|
|
19969
|
+
commandMenuHint: "Type # for commands, skills and agents",
|
|
19896
19970
|
textArgument: "Text",
|
|
19897
19971
|
permissionMode: "Permission mode",
|
|
19898
19972
|
permissions: "Permissions",
|
|
19899
19973
|
loadingPermissions: "Loading permissions...",
|
|
19900
19974
|
selecting: "Selecting...",
|
|
19901
19975
|
permissionsUnavailable: "Permissions unavailable",
|
|
19902
|
-
permissionModeFixedAtCreate: "Grok fixes its Permission Mode when the Session is created. Start a new Thread to change it."
|
|
19976
|
+
permissionModeFixedAtCreate: "Grok fixes its Permission Mode when the Session is created. Start a new Thread to change it.",
|
|
19977
|
+
codexUsageGateUnavailable: "Could not separate this Harness from the Codex usage limit in this Desktop version. Codex usage limits still apply to sending."
|
|
19903
19978
|
});
|
|
19904
19979
|
var CHINESE_HARNESS_MESSAGES = Object.freeze({
|
|
19905
19980
|
commands: "\u547D\u4EE4",
|
|
19906
19981
|
harnessCommands: "Harness \u547D\u4EE4",
|
|
19907
19982
|
commandsUnavailable: "\u6682\u65E0\u53EF\u7528\u7684 Harness \u547D\u4EE4",
|
|
19908
19983
|
commandRequiresConversation: "\u8BF7\u5148\u5F00\u59CB\u5BF9\u8BDD\uFF0C\u518D\u6267\u884C\u6B64\u547D\u4EE4",
|
|
19984
|
+
commandMenuHint: "\u8F93\u5165 # \u6253\u5F00\u547D\u4EE4\u3001\u6280\u80FD\u548C Agent",
|
|
19909
19985
|
textArgument: "\u6587\u672C",
|
|
19910
19986
|
permissionMode: "\u6743\u9650\u6A21\u5F0F",
|
|
19911
19987
|
permissions: "\u6743\u9650",
|
|
19912
19988
|
loadingPermissions: "\u6B63\u5728\u52A0\u8F7D\u6743\u9650...",
|
|
19913
19989
|
selecting: "\u6B63\u5728\u9009\u62E9...",
|
|
19914
19990
|
permissionsUnavailable: "\u6743\u9650\u4E0D\u53EF\u7528",
|
|
19915
|
-
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"
|
|
19991
|
+
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",
|
|
19992
|
+
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"
|
|
19916
19993
|
});
|
|
19917
19994
|
var ENGLISH_PERMISSION_MODE_LABELS = /* @__PURE__ */ new Map([
|
|
19918
19995
|
["read-only", "Read only"],
|
|
@@ -20034,6 +20111,10 @@ ${error51.stderrTail}`] : []
|
|
|
20034
20111
|
description: mode.description === void 0 ? void 0 : CHINESE_PERMISSION_MODE_DESCRIPTIONS.get(mode.description) ?? mode.description
|
|
20035
20112
|
};
|
|
20036
20113
|
}
|
|
20114
|
+
function rendererLiveCommandsPendingNotice(locale, harnessLabel) {
|
|
20115
|
+
const harness = harnessLabel.replace(/\s*[((][^))]*[))]\s*$/u, "").trim() || harnessLabel;
|
|
20116
|
+
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`;
|
|
20117
|
+
}
|
|
20037
20118
|
|
|
20038
20119
|
// src/renderer-permission-mode-picker.ts
|
|
20039
20120
|
var MENU_CLASSES2 = `fixed z-50 overflow-hidden ${PICKER_POPOVER_CLASS}`;
|
|
@@ -21179,71 +21260,15 @@ ${error51.stderrTail}`] : []
|
|
|
21179
21260
|
return true;
|
|
21180
21261
|
}
|
|
21181
21262
|
|
|
21182
|
-
// src/renderer-harness-command-claim.ts
|
|
21183
|
-
function inputEvent(editor, text) {
|
|
21184
|
-
const view = editor.ownerDocument.defaultView;
|
|
21185
|
-
return view?.InputEvent ? new view.InputEvent("input", {
|
|
21186
|
-
bubbles: true,
|
|
21187
|
-
composed: true,
|
|
21188
|
-
data: text,
|
|
21189
|
-
inputType: "insertText"
|
|
21190
|
-
}) : new (view?.Event ?? Event)("input", { bubbles: true, composed: true });
|
|
21191
|
-
}
|
|
21192
|
-
function prependTextarea(editor, prefix) {
|
|
21193
|
-
const view = editor.ownerDocument.defaultView;
|
|
21194
|
-
if (!view || !(editor instanceof view.HTMLTextAreaElement)) return false;
|
|
21195
|
-
const setter = Object.getOwnPropertyDescriptor(view.HTMLTextAreaElement.prototype, "value")?.set;
|
|
21196
|
-
if (!setter) return false;
|
|
21197
|
-
const start = editor.selectionStart;
|
|
21198
|
-
const end = editor.selectionEnd;
|
|
21199
|
-
setter.call(editor, prefix + editor.value);
|
|
21200
|
-
editor.dispatchEvent(inputEvent(editor, prefix));
|
|
21201
|
-
editor.focus({ preventScroll: true });
|
|
21202
|
-
if (start !== null && end !== null) {
|
|
21203
|
-
editor.setSelectionRange(start + prefix.length, end + prefix.length);
|
|
21204
|
-
}
|
|
21205
|
-
return true;
|
|
21206
|
-
}
|
|
21207
|
-
function prependContentEditable(editor, prefix) {
|
|
21208
|
-
if (editor.getAttribute("contenteditable") !== "true") return false;
|
|
21209
|
-
const document2 = editor.ownerDocument;
|
|
21210
|
-
const selection = document2.getSelection();
|
|
21211
|
-
if (!selection || typeof document2.execCommand !== "function") return false;
|
|
21212
|
-
const range = document2.createRange();
|
|
21213
|
-
range.selectNodeContents(editor);
|
|
21214
|
-
range.collapse(true);
|
|
21215
|
-
editor.focus({ preventScroll: true });
|
|
21216
|
-
selection.removeAllRanges();
|
|
21217
|
-
selection.addRange(range);
|
|
21218
|
-
return document2.execCommand("insertText", false, prefix);
|
|
21219
|
-
}
|
|
21220
|
-
function prependEditor(editor, prefix) {
|
|
21221
|
-
return prependTextarea(editor, prefix) || prependContentEditable(editor, prefix);
|
|
21222
|
-
}
|
|
21223
|
-
function rendererHarnessCommandExecutesDirectly(command) {
|
|
21224
|
-
return command.invocation === "/compact" || command.argumentMode === "none";
|
|
21225
|
-
}
|
|
21226
|
-
function routeRendererHarnessCommandSelection(editor, command, execute) {
|
|
21227
|
-
if (rendererHarnessCommandExecutesDirectly(command)) {
|
|
21228
|
-
execute();
|
|
21229
|
-
return true;
|
|
21230
|
-
}
|
|
21231
|
-
return editor !== null && prependEditor(editor, `${command.invocation} `);
|
|
21232
|
-
}
|
|
21233
|
-
|
|
21234
21263
|
// src/renderer-harness-command-control.ts
|
|
21235
21264
|
var CONTROL_ATTRIBUTE2 = "data-codexhost-harness-command-control";
|
|
21236
|
-
var MENU_ATTRIBUTE = "data-codexhost-harness-command-menu";
|
|
21237
|
-
var MENU_WIDTH = 320;
|
|
21238
|
-
var VIEWPORT_MARGIN = 8;
|
|
21239
|
-
var MENU_GAP2 = 8;
|
|
21240
21265
|
var SVG_NS2 = "http://www.w3.org/2000/svg";
|
|
21241
21266
|
var COMMAND_ICON_PATHS = [
|
|
21242
21267
|
"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",
|
|
21243
21268
|
"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",
|
|
21244
21269
|
"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"
|
|
21245
21270
|
];
|
|
21246
|
-
function
|
|
21271
|
+
function createHarnessCommandIcon(ownerDocument) {
|
|
21247
21272
|
const svg = ownerDocument.createElementNS(SVG_NS2, "svg");
|
|
21248
21273
|
svg.setAttribute("viewBox", "0 0 1024 1024");
|
|
21249
21274
|
svg.setAttribute("width", "15");
|
|
@@ -21257,85 +21282,25 @@ ${error51.stderrTail}`] : []
|
|
|
21257
21282
|
}
|
|
21258
21283
|
return svg;
|
|
21259
21284
|
}
|
|
21260
|
-
function
|
|
21261
|
-
|
|
21262
|
-
|
|
21263
|
-
|
|
21264
|
-
|
|
21265
|
-
|
|
21266
|
-
|
|
21267
|
-
|
|
21268
|
-
|
|
21269
|
-
|
|
21270
|
-
|
|
21271
|
-
|
|
21272
|
-
|
|
21273
|
-
|
|
21274
|
-
|
|
21275
|
-
|
|
21276
|
-
item.style.gap = "8px";
|
|
21277
|
-
item.style.padding = "6px 8px";
|
|
21278
|
-
item.style.border = "0";
|
|
21279
|
-
item.style.borderRadius = "6px";
|
|
21280
|
-
item.style.background = "transparent";
|
|
21281
|
-
item.style.color = "inherit";
|
|
21282
|
-
item.style.textAlign = "left";
|
|
21283
|
-
item.style.cursor = "pointer";
|
|
21284
|
-
const updateHighlight = (active) => {
|
|
21285
|
-
item.style.background = active ? "rgba(127, 127, 127, 0.12)" : "transparent";
|
|
21286
|
-
};
|
|
21287
|
-
item.addEventListener("pointerenter", () => updateHighlight(true));
|
|
21288
|
-
item.addEventListener("pointerleave", () => updateHighlight(false));
|
|
21289
|
-
item.addEventListener("focus", () => updateHighlight(true));
|
|
21290
|
-
item.addEventListener("blur", () => updateHighlight(false));
|
|
21291
|
-
item.addEventListener("click", onSelect);
|
|
21292
|
-
const copy = ownerDocument.createElement("span");
|
|
21293
|
-
copy.style.display = "flex";
|
|
21294
|
-
copy.style.flexDirection = "column";
|
|
21295
|
-
copy.style.minWidth = "0";
|
|
21296
|
-
copy.style.flex = "1 1 auto";
|
|
21297
|
-
const title = ownerDocument.createElement("span");
|
|
21298
|
-
title.textContent = command.invocation;
|
|
21299
|
-
title.style.font = "600 13px/18px system-ui, sans-serif";
|
|
21300
|
-
title.style.whiteSpace = "nowrap";
|
|
21301
|
-
const description = ownerDocument.createElement("span");
|
|
21302
|
-
description.textContent = disabledReason ?? presentation.description;
|
|
21303
|
-
description.style.overflow = "hidden";
|
|
21304
|
-
description.style.color = "rgba(127, 127, 127, 0.9)";
|
|
21305
|
-
description.style.font = "400 11px/16px system-ui, sans-serif";
|
|
21306
|
-
description.style.textOverflow = "ellipsis";
|
|
21307
|
-
description.style.whiteSpace = "nowrap";
|
|
21308
|
-
const hint = ownerDocument.createElement("span");
|
|
21309
|
-
hint.textContent = rendererHarnessCommandExecutesDirectly(command) ? "\u21B5" : messages.textArgument;
|
|
21310
|
-
hint.style.flex = "0 0 auto";
|
|
21311
|
-
hint.style.color = "rgba(127, 127, 127, 0.75)";
|
|
21312
|
-
hint.style.font = "400 11px/16px ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
21313
|
-
copy.append(title, description);
|
|
21314
|
-
item.append(copy, hint);
|
|
21315
|
-
return item;
|
|
21316
|
-
}
|
|
21317
|
-
function clamp(value, minimum, maximum) {
|
|
21318
|
-
return Math.max(minimum, Math.min(value, maximum));
|
|
21319
|
-
}
|
|
21320
|
-
function setButtonClass(button) {
|
|
21321
|
-
button.style.display = "inline-flex";
|
|
21322
|
-
button.style.alignItems = "center";
|
|
21323
|
-
button.style.justifyContent = "center";
|
|
21324
|
-
button.style.gap = "0";
|
|
21325
|
-
button.style.width = "28px";
|
|
21326
|
-
button.style.height = "28px";
|
|
21327
|
-
button.style.padding = "0";
|
|
21328
|
-
button.style.border = "0";
|
|
21329
|
-
button.style.borderRadius = "8px";
|
|
21330
|
-
button.style.background = "transparent";
|
|
21331
|
-
button.style.color = "inherit";
|
|
21332
|
-
button.style.cursor = "pointer";
|
|
21333
|
-
button.style.whiteSpace = "nowrap";
|
|
21334
|
-
}
|
|
21335
|
-
function mountRendererHarnessCommandControl(parent, insertBefore, onCommandSelected, initialLocale = "en") {
|
|
21285
|
+
function styleButton(button) {
|
|
21286
|
+
Object.assign(button.style, {
|
|
21287
|
+
display: "inline-flex",
|
|
21288
|
+
alignItems: "center",
|
|
21289
|
+
justifyContent: "center",
|
|
21290
|
+
width: "28px",
|
|
21291
|
+
height: "28px",
|
|
21292
|
+
padding: "0",
|
|
21293
|
+
border: "0",
|
|
21294
|
+
borderRadius: "8px",
|
|
21295
|
+
background: "transparent",
|
|
21296
|
+
color: "inherit",
|
|
21297
|
+
cursor: "pointer"
|
|
21298
|
+
});
|
|
21299
|
+
}
|
|
21300
|
+
function mountRendererHarnessCommandControl(parent, insertBefore, onOpenMenu, initialLocale = "en") {
|
|
21336
21301
|
const ownerDocument = parent.ownerDocument;
|
|
21302
|
+
let messages = rendererHarnessMessages(initialLocale);
|
|
21337
21303
|
let locale = initialLocale;
|
|
21338
|
-
let messages = rendererHarnessMessages(locale);
|
|
21339
21304
|
const root = ownerDocument.createElement("div");
|
|
21340
21305
|
root.setAttribute(CONTROL_ATTRIBUTE2, "true");
|
|
21341
21306
|
root.style.display = "inline-flex";
|
|
@@ -21343,186 +21308,39 @@ ${error51.stderrTail}`] : []
|
|
|
21343
21308
|
root.style.minWidth = "0";
|
|
21344
21309
|
const trigger = ownerDocument.createElement("button");
|
|
21345
21310
|
trigger.type = "button";
|
|
21346
|
-
trigger
|
|
21347
|
-
trigger.
|
|
21348
|
-
trigger.setAttribute("aria-label", messages.harnessCommands);
|
|
21349
|
-
trigger.title = messages.harnessCommands;
|
|
21350
|
-
setButtonClass(trigger);
|
|
21351
|
-
trigger.append(commandIcon(ownerDocument));
|
|
21311
|
+
styleButton(trigger);
|
|
21312
|
+
trigger.append(createHarnessCommandIcon(ownerDocument));
|
|
21352
21313
|
root.append(trigger);
|
|
21353
|
-
const menu = ownerDocument.createElement("div");
|
|
21354
|
-
menu.setAttribute(MENU_ATTRIBUTE, "true");
|
|
21355
|
-
menu.setAttribute("role", "menu");
|
|
21356
|
-
menu.setAttribute("aria-label", messages.harnessCommands);
|
|
21357
|
-
menu.hidden = true;
|
|
21358
|
-
menu.style.position = "fixed";
|
|
21359
|
-
menu.style.inset = "auto";
|
|
21360
|
-
menu.style.zIndex = "2147483647";
|
|
21361
|
-
menu.style.width = `${MENU_WIDTH}px`;
|
|
21362
|
-
menu.style.maxWidth = `calc(100vw - ${VIEWPORT_MARGIN * 2}px)`;
|
|
21363
|
-
menu.style.maxHeight = "min(360px, calc(100vh - 16px))";
|
|
21364
|
-
menu.style.overflowY = "auto";
|
|
21365
|
-
menu.style.padding = "4px";
|
|
21366
|
-
applyRendererPopoverChrome(menu);
|
|
21367
|
-
ownerDocument.body.append(menu);
|
|
21368
|
-
if (insertBefore?.parentElement === parent) parent.insertBefore(root, insertBefore);
|
|
21369
|
-
else parent.append(root);
|
|
21370
21314
|
let commands = [];
|
|
21371
|
-
let items = [];
|
|
21372
|
-
let activeIndex = 0;
|
|
21373
|
-
let executingCommandId = null;
|
|
21374
21315
|
let hasSession = true;
|
|
21375
|
-
let
|
|
21376
|
-
let
|
|
21377
|
-
|
|
21378
|
-
|
|
21379
|
-
|
|
21380
|
-
|
|
21381
|
-
|
|
21382
|
-
|
|
21383
|
-
|
|
21384
|
-
|
|
21385
|
-
|
|
21386
|
-
|
|
21387
|
-
|
|
21388
|
-
};
|
|
21389
|
-
const
|
|
21390
|
-
|
|
21391
|
-
|
|
21392
|
-
|
|
21393
|
-
|
|
21394
|
-
|
|
21395
|
-
|
|
21396
|
-
|
|
21397
|
-
|
|
21398
|
-
|
|
21399
|
-
|
|
21400
|
-
|
|
21401
|
-
};
|
|
21402
|
-
const syncTriggerState = () => {
|
|
21403
|
-
trigger.disabled = commands.length === 0 || executingCommandId !== null;
|
|
21404
|
-
trigger.style.opacity = trigger.disabled ? "0.65" : "1";
|
|
21405
|
-
trigger.title = commands.length === 0 ? messages.commandsUnavailable : messages.harnessCommands;
|
|
21406
|
-
syncTriggerBackground();
|
|
21407
|
-
};
|
|
21408
|
-
const close = () => {
|
|
21409
|
-
menu.hidden = true;
|
|
21410
|
-
trigger.setAttribute("aria-expanded", "false");
|
|
21411
|
-
syncTriggerBackground();
|
|
21412
|
-
};
|
|
21413
|
-
const open = (shouldFocus = true) => {
|
|
21414
|
-
if (commands.length === 0 || executingCommandId !== null) return;
|
|
21415
|
-
menu.hidden = false;
|
|
21416
|
-
positionMenu2();
|
|
21417
|
-
trigger.setAttribute("aria-expanded", "true");
|
|
21418
|
-
syncTriggerBackground();
|
|
21419
|
-
if (shouldFocus) queueMicrotask(focusActive);
|
|
21420
|
-
};
|
|
21421
|
-
let closeTimer = null;
|
|
21422
|
-
const cancelClose = () => {
|
|
21423
|
-
if (closeTimer === null) return;
|
|
21424
|
-
window.clearTimeout(closeTimer);
|
|
21425
|
-
closeTimer = null;
|
|
21426
|
-
};
|
|
21427
|
-
const scheduleClose = () => {
|
|
21428
|
-
cancelClose();
|
|
21429
|
-
closeTimer = window.setTimeout(() => {
|
|
21430
|
-
closeTimer = null;
|
|
21431
|
-
if (!trigger.matches(":hover") && !menu.matches(":hover")) close();
|
|
21432
|
-
}, 140);
|
|
21433
|
-
};
|
|
21434
|
-
const select = (command) => {
|
|
21435
|
-
close();
|
|
21436
|
-
onCommandSelected(command);
|
|
21437
|
-
};
|
|
21438
|
-
const renderItems = () => {
|
|
21439
|
-
menu.replaceChildren();
|
|
21440
|
-
const header = ownerDocument.createElement("div");
|
|
21441
|
-
header.textContent = messages.commands;
|
|
21442
|
-
header.style.padding = "5px 8px 4px";
|
|
21443
|
-
header.style.color = "rgba(127, 127, 127, 0.75)";
|
|
21444
|
-
header.style.font = "600 11px/16px system-ui, sans-serif";
|
|
21445
|
-
menu.append(header);
|
|
21446
|
-
items = commands.map(
|
|
21447
|
-
(command) => menuItem(
|
|
21448
|
-
ownerDocument,
|
|
21449
|
-
command,
|
|
21450
|
-
locale,
|
|
21451
|
-
messages,
|
|
21452
|
-
() => select(command),
|
|
21453
|
-
!hasSession && rendererHarnessCommandExecutesDirectly(command) ? messages.commandRequiresConversation : void 0
|
|
21454
|
-
)
|
|
21455
|
-
);
|
|
21456
|
-
menu.append(...items);
|
|
21457
|
-
activeIndex = Math.min(activeIndex, Math.max(0, items.length - 1));
|
|
21458
|
-
if (executingCommandId !== null) {
|
|
21459
|
-
for (const item of items) {
|
|
21460
|
-
const isExecuting = item.dataset.commandId === executingCommandId;
|
|
21461
|
-
item.disabled = true;
|
|
21462
|
-
item.style.opacity = isExecuting ? "1" : "0.5";
|
|
21463
|
-
if (isExecuting) item.setAttribute("aria-busy", "true");
|
|
21464
|
-
}
|
|
21465
|
-
}
|
|
21466
|
-
};
|
|
21467
|
-
const onTriggerKeyDown = (event) => {
|
|
21468
|
-
if (event.key === "ArrowDown" || event.key === "Enter" || event.key === " ") {
|
|
21469
|
-
event.preventDefault();
|
|
21470
|
-
open();
|
|
21471
|
-
}
|
|
21472
|
-
};
|
|
21473
|
-
const onMenuKeyDown = (event) => {
|
|
21474
|
-
if (event.key === "Escape") {
|
|
21475
|
-
event.preventDefault();
|
|
21476
|
-
close();
|
|
21477
|
-
trigger.focus();
|
|
21478
|
-
return;
|
|
21479
|
-
}
|
|
21480
|
-
if (event.key === "ArrowDown" || event.key === "ArrowUp") {
|
|
21481
|
-
event.preventDefault();
|
|
21482
|
-
const delta = event.key === "ArrowDown" ? 1 : -1;
|
|
21483
|
-
activeIndex = (activeIndex + delta + items.length) % items.length;
|
|
21484
|
-
focusActive(delta);
|
|
21485
|
-
return;
|
|
21486
|
-
}
|
|
21487
|
-
if (event.key === "Enter") {
|
|
21488
|
-
event.preventDefault();
|
|
21489
|
-
items[activeIndex]?.click();
|
|
21490
|
-
}
|
|
21491
|
-
};
|
|
21492
|
-
const onDocumentPointerDown = (event) => {
|
|
21493
|
-
if (!menu.hidden && !root.contains(event.target) && !menu.contains(event.target)) {
|
|
21494
|
-
close();
|
|
21495
|
-
}
|
|
21496
|
-
};
|
|
21497
|
-
const onViewportChange = () => {
|
|
21498
|
-
if (!menu.hidden) positionMenu2();
|
|
21499
|
-
};
|
|
21500
|
-
trigger.addEventListener("click", () => {
|
|
21501
|
-
cancelClose();
|
|
21502
|
-
open(true);
|
|
21503
|
-
});
|
|
21504
|
-
trigger.addEventListener("pointerenter", () => {
|
|
21505
|
-
triggerHovered = true;
|
|
21506
|
-
syncTriggerBackground();
|
|
21507
|
-
cancelClose();
|
|
21508
|
-
if (menu.hidden) open(false);
|
|
21509
|
-
});
|
|
21510
|
-
trigger.addEventListener("pointerleave", () => {
|
|
21511
|
-
triggerHovered = false;
|
|
21512
|
-
syncTriggerBackground();
|
|
21513
|
-
scheduleClose();
|
|
21514
|
-
});
|
|
21515
|
-
trigger.addEventListener("keydown", onTriggerKeyDown);
|
|
21516
|
-
menu.addEventListener("pointerenter", cancelClose);
|
|
21517
|
-
menu.addEventListener("pointerleave", scheduleClose);
|
|
21518
|
-
menu.addEventListener("keydown", onMenuKeyDown);
|
|
21519
|
-
ownerDocument.addEventListener("pointerdown", onDocumentPointerDown, true);
|
|
21520
|
-
ownerDocument.defaultView?.addEventListener("resize", onViewportChange);
|
|
21521
|
-
ownerDocument.defaultView?.addEventListener("scroll", onViewportChange, true);
|
|
21522
|
-
const control = {
|
|
21316
|
+
let source;
|
|
21317
|
+
let executingCommandId = null;
|
|
21318
|
+
let hovered = false;
|
|
21319
|
+
const syncTrigger = () => {
|
|
21320
|
+
trigger.setAttribute("aria-label", messages.commandMenuHint);
|
|
21321
|
+
trigger.title = messages.commandMenuHint;
|
|
21322
|
+
trigger.style.background = hovered ? "rgba(127, 127, 127, 0.16)" : "transparent";
|
|
21323
|
+
};
|
|
21324
|
+
const onMouseDown = (event) => event.preventDefault();
|
|
21325
|
+
const onClick = () => onOpenMenu();
|
|
21326
|
+
const onEnter = () => {
|
|
21327
|
+
hovered = true;
|
|
21328
|
+
syncTrigger();
|
|
21329
|
+
};
|
|
21330
|
+
const onLeave = () => {
|
|
21331
|
+
hovered = false;
|
|
21332
|
+
syncTrigger();
|
|
21333
|
+
};
|
|
21334
|
+
trigger.addEventListener("mousedown", onMouseDown);
|
|
21335
|
+
trigger.addEventListener("click", onClick);
|
|
21336
|
+
trigger.addEventListener("pointerenter", onEnter);
|
|
21337
|
+
trigger.addEventListener("pointerleave", onLeave);
|
|
21338
|
+
if (insertBefore?.parentElement === parent) parent.insertBefore(root, insertBefore);
|
|
21339
|
+
else parent.append(root);
|
|
21340
|
+
syncTrigger();
|
|
21341
|
+
return {
|
|
21523
21342
|
root,
|
|
21524
21343
|
trigger,
|
|
21525
|
-
menu,
|
|
21526
21344
|
placeBefore(reference) {
|
|
21527
21345
|
if (!reference?.parentElement) return false;
|
|
21528
21346
|
if (root.parentElement === reference.parentElement && root.nextElementSibling === reference) {
|
|
@@ -21531,46 +21349,31 @@ ${error51.stderrTail}`] : []
|
|
|
21531
21349
|
reference.parentElement.insertBefore(root, reference);
|
|
21532
21350
|
return true;
|
|
21533
21351
|
},
|
|
21534
|
-
setCommands(nextCommands, nextHasSession = true) {
|
|
21352
|
+
setCommands(nextCommands, nextHasSession = true, nextSource) {
|
|
21535
21353
|
commands = [...nextCommands];
|
|
21536
21354
|
hasSession = nextHasSession;
|
|
21537
|
-
|
|
21538
|
-
|
|
21539
|
-
|
|
21355
|
+
source = nextSource;
|
|
21356
|
+
},
|
|
21357
|
+
snapshot() {
|
|
21358
|
+
return { commands, hasSession, executingCommandId, source };
|
|
21540
21359
|
},
|
|
21541
21360
|
setExecuting(commandId) {
|
|
21542
21361
|
executingCommandId = commandId;
|
|
21543
|
-
renderItems();
|
|
21544
|
-
syncTriggerState();
|
|
21545
21362
|
},
|
|
21546
21363
|
setLocale(nextLocale) {
|
|
21547
21364
|
if (locale === nextLocale) return;
|
|
21548
21365
|
locale = nextLocale;
|
|
21549
21366
|
messages = rendererHarnessMessages(locale);
|
|
21550
|
-
|
|
21551
|
-
menu.setAttribute("aria-label", messages.harnessCommands);
|
|
21552
|
-
renderItems();
|
|
21553
|
-
syncTriggerState();
|
|
21367
|
+
syncTrigger();
|
|
21554
21368
|
},
|
|
21555
|
-
close,
|
|
21556
21369
|
dispose() {
|
|
21557
|
-
|
|
21558
|
-
|
|
21559
|
-
|
|
21560
|
-
|
|
21561
|
-
ownerDocument.removeEventListener("pointerdown", onDocumentPointerDown, true);
|
|
21562
|
-
ownerDocument.defaultView?.removeEventListener("resize", onViewportChange);
|
|
21563
|
-
ownerDocument.defaultView?.removeEventListener("scroll", onViewportChange, true);
|
|
21564
|
-
trigger.removeEventListener("keydown", onTriggerKeyDown);
|
|
21565
|
-
menu.removeEventListener("pointerenter", cancelClose);
|
|
21566
|
-
menu.removeEventListener("pointerleave", scheduleClose);
|
|
21567
|
-
menu.removeEventListener("keydown", onMenuKeyDown);
|
|
21568
|
-
menu.remove();
|
|
21370
|
+
trigger.removeEventListener("mousedown", onMouseDown);
|
|
21371
|
+
trigger.removeEventListener("click", onClick);
|
|
21372
|
+
trigger.removeEventListener("pointerenter", onEnter);
|
|
21373
|
+
trigger.removeEventListener("pointerleave", onLeave);
|
|
21569
21374
|
root.remove();
|
|
21570
21375
|
}
|
|
21571
21376
|
};
|
|
21572
|
-
syncTriggerState();
|
|
21573
|
-
return control;
|
|
21574
21377
|
}
|
|
21575
21378
|
|
|
21576
21379
|
// src/renderer-composer-dom.ts
|
|
@@ -21797,12 +21600,33 @@ ${error51.stderrTail}`] : []
|
|
|
21797
21600
|
var TRAILING_CLUSTER_GAP_PX = 4;
|
|
21798
21601
|
function applyTrailingClusterSpacing(...roots) {
|
|
21799
21602
|
for (const root of roots) {
|
|
21603
|
+
if (!root.style) continue;
|
|
21800
21604
|
root.style.marginInlineStart = "0";
|
|
21801
21605
|
root.style.marginInlineEnd = `${TRAILING_CLUSTER_GAP_PX}px`;
|
|
21802
21606
|
}
|
|
21803
21607
|
}
|
|
21608
|
+
function lastNativeButtonWithin(composer) {
|
|
21609
|
+
const buttons = [...composer.querySelectorAll("button")];
|
|
21610
|
+
for (let index = buttons.length - 1; index >= 0; index -= 1) {
|
|
21611
|
+
const button = buttons[index];
|
|
21612
|
+
if (button && !isInsideOwnedRendererControl(button)) return button;
|
|
21613
|
+
}
|
|
21614
|
+
return null;
|
|
21615
|
+
}
|
|
21616
|
+
function refreshSendButton(control) {
|
|
21617
|
+
const current = control.sendButton;
|
|
21618
|
+
if (current?.isConnected && control.composer.contains(current)) return current;
|
|
21619
|
+
const replacement = sendButtonWithin(control.composer) ?? (current && !isComposerSubmitButton(current) ? lastNativeButtonWithin(control.composer) : null);
|
|
21620
|
+
if (!replacement) return null;
|
|
21621
|
+
if (control.sendDisabledBeforeSwitch !== null) {
|
|
21622
|
+
control.sendDisabledBeforeSwitch = replacement.disabled;
|
|
21623
|
+
replacement.disabled = true;
|
|
21624
|
+
}
|
|
21625
|
+
control.sendButton = replacement;
|
|
21626
|
+
return replacement;
|
|
21627
|
+
}
|
|
21804
21628
|
function refreshTrailingClusterPlacement(control) {
|
|
21805
|
-
const sendButton = control
|
|
21629
|
+
const sendButton = refreshSendButton(control);
|
|
21806
21630
|
const modelRoot = control.modelPicker?.root;
|
|
21807
21631
|
const agentRoot = control.root ?? control.picker?.root;
|
|
21808
21632
|
if (!sendButton || !modelRoot || !agentRoot) return;
|
|
@@ -21810,6 +21634,7 @@ ${error51.stderrTail}`] : []
|
|
|
21810
21634
|
const parent = anchor.parentElement;
|
|
21811
21635
|
if (!parent || typeof parent.insertBefore !== "function") return;
|
|
21812
21636
|
applyTrailingClusterSpacing(modelRoot, agentRoot);
|
|
21637
|
+
if (!parent.isConnected || !control.composer.contains(parent)) return;
|
|
21813
21638
|
if (modelRoot.parentElement === parent && agentRoot.parentElement === parent && modelRoot.nextElementSibling === agentRoot && agentRoot.nextElementSibling === anchor) {
|
|
21814
21639
|
return;
|
|
21815
21640
|
}
|
|
@@ -21904,7 +21729,7 @@ ${error51.stderrTail}`] : []
|
|
|
21904
21729
|
setNativeControlHidden(control.nativeContextUsageControl, false);
|
|
21905
21730
|
setNativeControlHidden(control.nativePermissionModeControl, hidePermissionMode);
|
|
21906
21731
|
}
|
|
21907
|
-
function mountComposerAgentControl(composer, composerId, sendButton, enabledAgents, onSelect, onOpenProviderPicker, onSelectModel, onSelectThinking, onSelectPermissionMode,
|
|
21732
|
+
function mountComposerAgentControl(composer, composerId, sendButton, enabledAgents, onSelect, onOpenProviderPicker, onSelectModel, onSelectThinking, onSelectPermissionMode, onOpenCommandMenu) {
|
|
21908
21733
|
if (composer instanceof HTMLElement) composer.style.minWidth = "0";
|
|
21909
21734
|
const nativeModelControl = captureNativeControl(nativeModelControlForComposer(composer));
|
|
21910
21735
|
const nativeContextUsageControl = captureNativeControl(
|
|
@@ -21929,7 +21754,7 @@ ${error51.stderrTail}`] : []
|
|
|
21929
21754
|
const harnessCommands = mountRendererHarnessCommandControl(
|
|
21930
21755
|
toolbar ?? composer,
|
|
21931
21756
|
trailingActionAnchor(sendButton),
|
|
21932
|
-
|
|
21757
|
+
onOpenCommandMenu
|
|
21933
21758
|
);
|
|
21934
21759
|
const permissionParent = nativePermissionModeControl?.element.parentElement;
|
|
21935
21760
|
if (permissionParent && nativePermissionModeControl && nativePermissionModeControlVerified) {
|
|
@@ -21961,6 +21786,11 @@ ${error51.stderrTail}`] : []
|
|
|
21961
21786
|
refreshCreditsPlacement(control);
|
|
21962
21787
|
return control;
|
|
21963
21788
|
}
|
|
21789
|
+
function nativeSendDisabled(button, fallback) {
|
|
21790
|
+
const key = Object.getOwnPropertyNames(button).find((name) => name.startsWith("__reactProps$"));
|
|
21791
|
+
const props = key ? Object.getOwnPropertyDescriptor(button, key)?.value : void 0;
|
|
21792
|
+
return typeof props === "object" && props !== null && "disabled" in props && typeof props.disabled === "boolean" ? props.disabled : fallback;
|
|
21793
|
+
}
|
|
21964
21794
|
function renderComposerAgentControl(control, state, adapterState, switching, availability = {}, modelView = { status: "idle" }, permissionModeView = { status: "idle" }, usage = null, accountCredits = null, locale = "en", currentCodexAccount = null, ownershipError = false) {
|
|
21965
21795
|
if (control.usage === null) {
|
|
21966
21796
|
control.usage = mountRendererUsageControl(control.composerId, locale);
|
|
@@ -21979,7 +21809,10 @@ ${error51.stderrTail}`] : []
|
|
|
21979
21809
|
control.sendDisabledBeforeSwitch = control.sendButton.disabled;
|
|
21980
21810
|
control.sendButton.disabled = true;
|
|
21981
21811
|
} else if (!submissionBlocked && control.sendDisabledBeforeSwitch !== null) {
|
|
21982
|
-
control.sendButton.disabled =
|
|
21812
|
+
control.sendButton.disabled = nativeSendDisabled(
|
|
21813
|
+
control.sendButton,
|
|
21814
|
+
control.sendDisabledBeforeSwitch
|
|
21815
|
+
);
|
|
21983
21816
|
control.sendDisabledBeforeSwitch = null;
|
|
21984
21817
|
}
|
|
21985
21818
|
const pickerView = renderRendererAgentPicker(
|
|
@@ -22017,16 +21850,19 @@ ${error51.stderrTail}`] : []
|
|
|
22017
21850
|
control.harnessCommands.setLocale(locale);
|
|
22018
21851
|
control.harnessCommands.root.hidden = state.agent === "codex";
|
|
22019
21852
|
control.harnessCommands.root.style.display = state.agent === "codex" ? "none" : "inline-flex";
|
|
22020
|
-
if (state.agent === "codex") control.harnessCommands.close();
|
|
22021
21853
|
renderRendererCreditsControl(
|
|
22022
21854
|
control.credits,
|
|
22023
21855
|
selectedCodexAccount && codexAccountAuthKind(selectedCodexAccount) === "api" ? null : accountCredits,
|
|
22024
21856
|
locale
|
|
22025
21857
|
);
|
|
21858
|
+
return state.agent !== "codex" && adapterState === "ready" && !submissionBlocked;
|
|
22026
21859
|
}
|
|
22027
21860
|
function disposeComposerAgentControl(control) {
|
|
22028
21861
|
if (control.sendDisabledBeforeSwitch !== null) {
|
|
22029
|
-
control.sendButton.disabled =
|
|
21862
|
+
control.sendButton.disabled = nativeSendDisabled(
|
|
21863
|
+
control.sendButton,
|
|
21864
|
+
control.sendDisabledBeforeSwitch
|
|
21865
|
+
);
|
|
22030
21866
|
}
|
|
22031
21867
|
restoreNativeControl(control.nativeModelControl);
|
|
22032
21868
|
restoreNativeControl(control.nativeContextUsageControl);
|
|
@@ -22154,6 +21990,270 @@ ${error51.stderrTail}`] : []
|
|
|
22154
21990
|
}
|
|
22155
21991
|
};
|
|
22156
21992
|
|
|
21993
|
+
// ../desktop-control/dist/renderer-react-ownership.js
|
|
21994
|
+
function committedReactAncestors(value) {
|
|
21995
|
+
const MAX_VISITED_FIBERS = 2e4;
|
|
21996
|
+
const fiber = (value2) => typeof value2 === "object" && value2 !== null ? value2 : null;
|
|
21997
|
+
const first = fiber(value);
|
|
21998
|
+
if (!first)
|
|
21999
|
+
return [];
|
|
22000
|
+
const previous = [];
|
|
22001
|
+
const seen = /* @__PURE__ */ new Set();
|
|
22002
|
+
for (let node = first; node; node = fiber(node.return)) {
|
|
22003
|
+
if (seen.has(node) || seen.size >= MAX_VISITED_FIBERS)
|
|
22004
|
+
return [];
|
|
22005
|
+
seen.add(node);
|
|
22006
|
+
previous.push(node);
|
|
22007
|
+
}
|
|
22008
|
+
const rootState = fiber(previous.at(-1)?.stateNode);
|
|
22009
|
+
if (!rootState || !("current" in rootState))
|
|
22010
|
+
return previous;
|
|
22011
|
+
const current = fiber(rootState.current);
|
|
22012
|
+
if (!current)
|
|
22013
|
+
return [];
|
|
22014
|
+
const stack = [{ node: current, parent: null }];
|
|
22015
|
+
const alternate = fiber(first.alternate);
|
|
22016
|
+
seen.clear();
|
|
22017
|
+
while (stack.length > 0 && seen.size < MAX_VISITED_FIBERS) {
|
|
22018
|
+
const entry = stack.pop();
|
|
22019
|
+
if (!entry)
|
|
22020
|
+
break;
|
|
22021
|
+
if (seen.has(entry.node))
|
|
22022
|
+
return [];
|
|
22023
|
+
seen.add(entry.node);
|
|
22024
|
+
if (entry.node === first || entry.node === alternate) {
|
|
22025
|
+
const ancestors = [];
|
|
22026
|
+
for (let cursor = entry; cursor; cursor = cursor.parent)
|
|
22027
|
+
ancestors.push(cursor.node);
|
|
22028
|
+
return ancestors;
|
|
22029
|
+
}
|
|
22030
|
+
const sibling = entry.parent && fiber(entry.node.sibling);
|
|
22031
|
+
if (sibling)
|
|
22032
|
+
stack.push({ node: sibling, parent: entry.parent });
|
|
22033
|
+
const child = fiber(entry.node.child);
|
|
22034
|
+
if (child)
|
|
22035
|
+
stack.push({ node: child, parent: entry });
|
|
22036
|
+
}
|
|
22037
|
+
return [];
|
|
22038
|
+
}
|
|
22039
|
+
|
|
22040
|
+
// src/renderer-codex-usage-gate.ts
|
|
22041
|
+
var EDITOR_SELECTOR2 = '[contenteditable="true"][role="textbox"]';
|
|
22042
|
+
var MAX_HOOKS = 4096;
|
|
22043
|
+
var MAX_DOM_DEPTH = 12;
|
|
22044
|
+
var RETRY_DELAY_MS = 1e3;
|
|
22045
|
+
function isRecord2(value) {
|
|
22046
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22047
|
+
}
|
|
22048
|
+
function hooksOf(fiber) {
|
|
22049
|
+
const result = [];
|
|
22050
|
+
let hook = isRecord2(fiber) ? fiber.memoizedState : null;
|
|
22051
|
+
while (isRecord2(hook) && result.length < MAX_HOOKS) {
|
|
22052
|
+
result.push(hook);
|
|
22053
|
+
hook = hook.next;
|
|
22054
|
+
}
|
|
22055
|
+
return hook == null ? result : [];
|
|
22056
|
+
}
|
|
22057
|
+
function submitOwners(composer) {
|
|
22058
|
+
let element = composer.querySelector(EDITOR_SELECTOR2) ?? composer;
|
|
22059
|
+
for (let depth = 0; element && depth < MAX_DOM_DEPTH; depth += 1) {
|
|
22060
|
+
const key = Object.getOwnPropertyNames(element).find(
|
|
22061
|
+
(name) => name.startsWith("__reactFiber$")
|
|
22062
|
+
);
|
|
22063
|
+
if (key) {
|
|
22064
|
+
const owners = committedReactAncestors(
|
|
22065
|
+
Object.getOwnPropertyDescriptor(element, key)?.value
|
|
22066
|
+
).filter(
|
|
22067
|
+
({ memoizedProps: props }) => isRecord2(props) && "onLocalSubmitStart" in props && typeof props.submitDisabled === "boolean"
|
|
22068
|
+
);
|
|
22069
|
+
return owners;
|
|
22070
|
+
}
|
|
22071
|
+
element = element.parentElement;
|
|
22072
|
+
}
|
|
22073
|
+
return [];
|
|
22074
|
+
}
|
|
22075
|
+
function findSubmitOwner(composer) {
|
|
22076
|
+
const owners = submitOwners(composer);
|
|
22077
|
+
return owners.length === 1 ? owners[0] ?? null : null;
|
|
22078
|
+
}
|
|
22079
|
+
function subscriptionAt(hook) {
|
|
22080
|
+
const memo = hook.memoizedState;
|
|
22081
|
+
if (!Array.isArray(memo) || !Array.isArray(memo[1])) return null;
|
|
22082
|
+
const [subscriber, [store, atom]] = memo;
|
|
22083
|
+
const instance = hook.next?.queue;
|
|
22084
|
+
const effect = hook.next?.next?.memoizedState;
|
|
22085
|
+
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) {
|
|
22086
|
+
return null;
|
|
22087
|
+
}
|
|
22088
|
+
return {
|
|
22089
|
+
subscriber,
|
|
22090
|
+
store,
|
|
22091
|
+
atom,
|
|
22092
|
+
instance,
|
|
22093
|
+
subscribeEffect: effect.create
|
|
22094
|
+
};
|
|
22095
|
+
}
|
|
22096
|
+
function gateKind({ store, atom }) {
|
|
22097
|
+
const read = /* @__PURE__ */ new Set();
|
|
22098
|
+
const trace = (value, prefix) => new Proxy(
|
|
22099
|
+
{ ...value },
|
|
22100
|
+
{
|
|
22101
|
+
get(target, property, receiver) {
|
|
22102
|
+
if (typeof property === "string") read.add(`${prefix}.${property}`);
|
|
22103
|
+
return Reflect.get(target, property, receiver);
|
|
22104
|
+
}
|
|
22105
|
+
}
|
|
22106
|
+
);
|
|
22107
|
+
try {
|
|
22108
|
+
const native = store.get(atom);
|
|
22109
|
+
const replayed = atom.read((dependency) => {
|
|
22110
|
+
const value = store.get(dependency);
|
|
22111
|
+
if (!isRecord2(value)) return value;
|
|
22112
|
+
if (typeof value.hardBlocked === "boolean") return trace(value, "reserve");
|
|
22113
|
+
if ("authMethod" in value) return trace(value, "auth");
|
|
22114
|
+
if (isRecord2(value.data) && isRecord2(value.data.rate_limit)) {
|
|
22115
|
+
return {
|
|
22116
|
+
...value,
|
|
22117
|
+
data: { ...value.data, rate_limit: trace(value.data.rate_limit, "limit") }
|
|
22118
|
+
};
|
|
22119
|
+
}
|
|
22120
|
+
return value;
|
|
22121
|
+
});
|
|
22122
|
+
if (typeof native !== "boolean" || replayed !== native) return null;
|
|
22123
|
+
} catch {
|
|
22124
|
+
return null;
|
|
22125
|
+
}
|
|
22126
|
+
if (read.has("reserve.hardBlocked") && !read.has("reserve.active")) return "reserve";
|
|
22127
|
+
if (read.has("auth.authMethod") && read.has("limit.allowed")) return "account";
|
|
22128
|
+
return null;
|
|
22129
|
+
}
|
|
22130
|
+
function gateSubscriptions(owner) {
|
|
22131
|
+
const found = { account: [], reserve: [] };
|
|
22132
|
+
for (const hook of hooksOf(owner)) {
|
|
22133
|
+
const subscription = subscriptionAt(hook);
|
|
22134
|
+
const kind = subscription && gateKind(subscription);
|
|
22135
|
+
if (subscription && kind) found[kind].push(subscription);
|
|
22136
|
+
}
|
|
22137
|
+
return found;
|
|
22138
|
+
}
|
|
22139
|
+
function discoverGates(owner) {
|
|
22140
|
+
const found = /* @__PURE__ */ new Map();
|
|
22141
|
+
for (const [kind, subscriptions] of Object.entries(gateSubscriptions(owner))) {
|
|
22142
|
+
if (subscriptions.length > 1) return null;
|
|
22143
|
+
if (subscriptions[0]) found.set(kind, subscriptions[0]);
|
|
22144
|
+
}
|
|
22145
|
+
return found;
|
|
22146
|
+
}
|
|
22147
|
+
function project({ subscriber, store, atom, instance, subscribeEffect }) {
|
|
22148
|
+
for (const [target, key] of [
|
|
22149
|
+
[store, "sub"],
|
|
22150
|
+
[subscriber, "getSnapshot"],
|
|
22151
|
+
[instance, "getSnapshot"]
|
|
22152
|
+
]) {
|
|
22153
|
+
if (Object.getOwnPropertyDescriptor(target, key)?.writable !== true) {
|
|
22154
|
+
throw new Error("Codex usage gate is not writable");
|
|
22155
|
+
}
|
|
22156
|
+
}
|
|
22157
|
+
let notify;
|
|
22158
|
+
const originalSub = store.sub;
|
|
22159
|
+
try {
|
|
22160
|
+
store.sub = (candidate, listener) => {
|
|
22161
|
+
if (candidate !== atom || notify) throw new Error("Unexpected Codex usage subscription");
|
|
22162
|
+
notify = listener;
|
|
22163
|
+
return () => void 0;
|
|
22164
|
+
};
|
|
22165
|
+
subscribeEffect();
|
|
22166
|
+
} finally {
|
|
22167
|
+
store.sub = originalSub;
|
|
22168
|
+
}
|
|
22169
|
+
if (!notify) throw new Error("Codex usage gate listener is unavailable");
|
|
22170
|
+
const onChange = notify;
|
|
22171
|
+
const original = subscriber.getSnapshot;
|
|
22172
|
+
const allowed = () => false;
|
|
22173
|
+
subscriber.getSnapshot = allowed;
|
|
22174
|
+
instance.getSnapshot = allowed;
|
|
22175
|
+
if (instance.value !== false) onChange();
|
|
22176
|
+
return {
|
|
22177
|
+
subscriber,
|
|
22178
|
+
instance,
|
|
22179
|
+
restore() {
|
|
22180
|
+
if (subscriber.getSnapshot === allowed) subscriber.getSnapshot = original;
|
|
22181
|
+
if (instance.getSnapshot === allowed) instance.getSnapshot = original;
|
|
22182
|
+
onChange();
|
|
22183
|
+
}
|
|
22184
|
+
};
|
|
22185
|
+
}
|
|
22186
|
+
function isBound(owner, projections) {
|
|
22187
|
+
const alternate = isRecord2(owner.alternate) ? owner.alternate : null;
|
|
22188
|
+
const bound = [...projections];
|
|
22189
|
+
return [owner, alternate].some((fiber) => {
|
|
22190
|
+
const hooks = hooksOf(fiber);
|
|
22191
|
+
return bound.every(
|
|
22192
|
+
({ subscriber, instance }) => hooks.some(
|
|
22193
|
+
(hook) => Array.isArray(hook.memoizedState) && hook.memoizedState[0] === subscriber && hook.next?.queue === instance
|
|
22194
|
+
)
|
|
22195
|
+
);
|
|
22196
|
+
});
|
|
22197
|
+
}
|
|
22198
|
+
function createRendererCodexUsageGate(composer) {
|
|
22199
|
+
let owner = null;
|
|
22200
|
+
const projections = /* @__PURE__ */ new Map();
|
|
22201
|
+
let retryAt = 0;
|
|
22202
|
+
let allowed = false;
|
|
22203
|
+
const release = () => {
|
|
22204
|
+
const previous = [...projections.values()];
|
|
22205
|
+
owner = null;
|
|
22206
|
+
projections.clear();
|
|
22207
|
+
for (const projection of previous) {
|
|
22208
|
+
try {
|
|
22209
|
+
projection.restore();
|
|
22210
|
+
} catch {
|
|
22211
|
+
}
|
|
22212
|
+
}
|
|
22213
|
+
};
|
|
22214
|
+
const bind = () => {
|
|
22215
|
+
const current = owner ?? findSubmitOwner(composer);
|
|
22216
|
+
const gates = current && discoverGates(current);
|
|
22217
|
+
if (!current || !gates?.has("reserve")) throw new Error("Codex usage gate is unavailable");
|
|
22218
|
+
owner = current;
|
|
22219
|
+
for (const [kind, gate] of gates) {
|
|
22220
|
+
if (!projections.has(kind)) projections.set(kind, project(gate));
|
|
22221
|
+
}
|
|
22222
|
+
return "bypassed";
|
|
22223
|
+
};
|
|
22224
|
+
const apply = () => {
|
|
22225
|
+
if (!allowed || !composer.isConnected) {
|
|
22226
|
+
release();
|
|
22227
|
+
retryAt = 0;
|
|
22228
|
+
return "native";
|
|
22229
|
+
}
|
|
22230
|
+
if (owner && !isBound(owner, projections.values())) {
|
|
22231
|
+
release();
|
|
22232
|
+
retryAt = 0;
|
|
22233
|
+
}
|
|
22234
|
+
if (owner && projections.size === 2) return "bypassed";
|
|
22235
|
+
if (Date.now() < retryAt) return owner ? "bypassed" : "unsupported";
|
|
22236
|
+
retryAt = Date.now() + RETRY_DELAY_MS;
|
|
22237
|
+
try {
|
|
22238
|
+
return bind();
|
|
22239
|
+
} catch {
|
|
22240
|
+
release();
|
|
22241
|
+
return "unsupported";
|
|
22242
|
+
}
|
|
22243
|
+
};
|
|
22244
|
+
return {
|
|
22245
|
+
update(next) {
|
|
22246
|
+
allowed = next;
|
|
22247
|
+
return apply();
|
|
22248
|
+
},
|
|
22249
|
+
refresh: apply,
|
|
22250
|
+
dispose() {
|
|
22251
|
+
allowed = false;
|
|
22252
|
+
release();
|
|
22253
|
+
}
|
|
22254
|
+
};
|
|
22255
|
+
}
|
|
22256
|
+
|
|
22157
22257
|
// src/renderer-request-sender.ts
|
|
22158
22258
|
var RendererMethodUnavailableError = class extends Error {
|
|
22159
22259
|
constructor(method, cause) {
|
|
@@ -22261,15 +22361,15 @@ ${error51.stderrTail}`] : []
|
|
|
22261
22361
|
var CODEX_ACCOUNT_LIST_METHOD = "codexhost/account/list";
|
|
22262
22362
|
var CODEX_ACCOUNT_REFRESH_METHOD = "codexhost/account/refresh";
|
|
22263
22363
|
var CODEX_ACCOUNT_CHANGED_METHOD = "codexhost/account/changed";
|
|
22264
|
-
function
|
|
22364
|
+
function isRecord3(value) {
|
|
22265
22365
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
22266
22366
|
}
|
|
22267
22367
|
function notifiedThreadId(notification) {
|
|
22268
|
-
if (!
|
|
22368
|
+
if (!isRecord3(notification) || !THREAD_USAGE_REFRESH_METHODS.includes(notification.method)) {
|
|
22269
22369
|
return null;
|
|
22270
22370
|
}
|
|
22271
22371
|
const params = notification.params;
|
|
22272
|
-
if (!
|
|
22372
|
+
if (!isRecord3(params)) return null;
|
|
22273
22373
|
const parsed = hostThreadIdSchema.safeParse(params.threadId);
|
|
22274
22374
|
return parsed.success ? parsed.data : null;
|
|
22275
22375
|
}
|
|
@@ -22426,8 +22526,8 @@ ${error51.stderrTail}`] : []
|
|
|
22426
22526
|
threadId: params.threadId,
|
|
22427
22527
|
includeTurns: false
|
|
22428
22528
|
});
|
|
22429
|
-
const thread =
|
|
22430
|
-
if (!
|
|
22529
|
+
const thread = isRecord3(native) ? native.thread : null;
|
|
22530
|
+
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") {
|
|
22431
22531
|
throw new Error("Native Thread response cannot establish Codex ownership");
|
|
22432
22532
|
}
|
|
22433
22533
|
return { owner: "codex", locked: true };
|
|
@@ -22554,7 +22654,7 @@ ${error51.stderrTail}`] : []
|
|
|
22554
22654
|
throw new Error("Renderer Account notification callback is unavailable");
|
|
22555
22655
|
}
|
|
22556
22656
|
return notifications.addNotificationCallback(CODEX_ACCOUNT_CHANGED_METHOD, (notification) => {
|
|
22557
|
-
if (!
|
|
22657
|
+
if (!isRecord3(notification) || notification.method !== CODEX_ACCOUNT_CHANGED_METHOD) return;
|
|
22558
22658
|
const state = codexAccountChangedSchema.safeParse(notification.params);
|
|
22559
22659
|
if (state.success) listener(state.data);
|
|
22560
22660
|
});
|
|
@@ -22563,16 +22663,16 @@ ${error51.stderrTail}`] : []
|
|
|
22563
22663
|
}
|
|
22564
22664
|
|
|
22565
22665
|
// src/renderer-external-queue.ts
|
|
22566
|
-
function
|
|
22666
|
+
function isRecord4(value) {
|
|
22567
22667
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22568
22668
|
}
|
|
22569
22669
|
function installRendererExternalQueue(target) {
|
|
22570
|
-
if (!
|
|
22670
|
+
if (!isRecord4(target) || typeof target.getTurnCoordinator !== "function" || typeof target.getConversation !== "function") {
|
|
22571
22671
|
return null;
|
|
22572
22672
|
}
|
|
22573
22673
|
const coordinator = target.getTurnCoordinator();
|
|
22574
|
-
const queue =
|
|
22575
|
-
if (!
|
|
22674
|
+
const queue = isRecord4(coordinator) ? coordinator.serverQueue : null;
|
|
22675
|
+
if (!isRecord4(queue) || typeof queue.isEnabled !== "function") return null;
|
|
22576
22676
|
const descriptor = Object.getOwnPropertyDescriptor(queue, "isEnabled");
|
|
22577
22677
|
if (!descriptor?.writable) return null;
|
|
22578
22678
|
const original = queue.isEnabled;
|
|
@@ -22581,7 +22681,7 @@ ${error51.stderrTail}`] : []
|
|
|
22581
22681
|
const threadId = args[0];
|
|
22582
22682
|
if (typeof threadId === "string") {
|
|
22583
22683
|
const conversation = getConversation.call(target, threadId);
|
|
22584
|
-
if (
|
|
22684
|
+
if (isRecord4(conversation) && conversation.id === threadId && // Reserved transport marker from externalThreadValue, retained by
|
|
22585
22685
|
// Desktop in both newly created and hydrated conversation metadata.
|
|
22586
22686
|
conversation.modelProvider === "codexhost") {
|
|
22587
22687
|
return false;
|
|
@@ -22596,19 +22696,19 @@ ${error51.stderrTail}`] : []
|
|
|
22596
22696
|
}
|
|
22597
22697
|
|
|
22598
22698
|
// src/renderer-external-steering.ts
|
|
22599
|
-
function
|
|
22699
|
+
function isRecord5(value) {
|
|
22600
22700
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
22601
22701
|
}
|
|
22602
22702
|
function isManager(value) {
|
|
22603
|
-
return
|
|
22703
|
+
return isRecord5(value) && ["sendRequest", "steerTurn", "startTurn", "getTurnCoordinator"].every(
|
|
22604
22704
|
(key) => typeof value[key] === "function"
|
|
22605
22705
|
);
|
|
22606
22706
|
}
|
|
22607
22707
|
function submissionHost(manager) {
|
|
22608
22708
|
const coordinator = manager.getTurnCoordinator();
|
|
22609
|
-
const options =
|
|
22610
|
-
const host =
|
|
22611
|
-
if (!
|
|
22709
|
+
const options = isRecord5(coordinator) ? coordinator.options : null;
|
|
22710
|
+
const host = isRecord5(options) ? options.submissionHost : null;
|
|
22711
|
+
if (!isRecord5(host) || typeof host.getActiveTurnId !== "function" || typeof host.hasPendingTurnStart !== "function") {
|
|
22612
22712
|
throw new Error("Desktop turn submission binding is unavailable");
|
|
22613
22713
|
}
|
|
22614
22714
|
return {
|
|
@@ -22650,20 +22750,20 @@ ${error51.stderrTail}`] : []
|
|
|
22650
22750
|
var INTERRUPTED_QUEUE_REASON = "Interrupted before the steer was accepted.";
|
|
22651
22751
|
async function preserveQueuedFollowUps(manager, threadId) {
|
|
22652
22752
|
const coordinator = manager.getTurnCoordinator();
|
|
22653
|
-
if (!
|
|
22753
|
+
if (!isRecord5(coordinator) || typeof coordinator.loadMessages !== "function" || typeof coordinator.readMessages !== "function" || typeof coordinator.mutate !== "function") {
|
|
22654
22754
|
throw new Error("Desktop follow-up queue binding is unavailable");
|
|
22655
22755
|
}
|
|
22656
22756
|
await coordinator.loadMessages.call(coordinator, threadId);
|
|
22657
22757
|
const messages = coordinator.readMessages.call(coordinator, threadId);
|
|
22658
22758
|
if (!Array.isArray(messages)) throw new Error("Desktop follow-up queue is unavailable");
|
|
22659
22759
|
const alreadyPaused = new Set(
|
|
22660
|
-
messages.filter((message) =>
|
|
22760
|
+
messages.filter((message) => isRecord5(message) && message.pausedReason != null).map((message) => message.id)
|
|
22661
22761
|
);
|
|
22662
22762
|
return () => {
|
|
22663
22763
|
coordinator.mutate.call(coordinator, threadId, (current) => {
|
|
22664
22764
|
if (!Array.isArray(current)) return current;
|
|
22665
22765
|
return current.map((message) => {
|
|
22666
|
-
if (!
|
|
22766
|
+
if (!isRecord5(message) || alreadyPaused.has(message.id) || message.pausedReason !== INTERRUPTED_QUEUE_REASON)
|
|
22667
22767
|
return message;
|
|
22668
22768
|
const resumed = { ...message };
|
|
22669
22769
|
delete resumed.pausedReason;
|
|
@@ -22681,9 +22781,9 @@ ${error51.stderrTail}`] : []
|
|
|
22681
22781
|
const pending = /* @__PURE__ */ new Map();
|
|
22682
22782
|
let disposed = false;
|
|
22683
22783
|
const send = function(method, params, options) {
|
|
22684
|
-
const messageId =
|
|
22685
|
-
const route = typeof messageId === "string" &&
|
|
22686
|
-
if (method !== "turn/start" || !
|
|
22784
|
+
const messageId = isRecord5(params) ? params.clientUserMessageId : null;
|
|
22785
|
+
const route = typeof messageId === "string" && isRecord5(params) ? routes.get(`${params.threadId}\0${messageId}`) : void 0;
|
|
22786
|
+
if (method !== "turn/start" || !isRecord5(params) || !route || route.threadId !== params.threadId) {
|
|
22687
22787
|
return originalSend.call(manager, method, params, options);
|
|
22688
22788
|
}
|
|
22689
22789
|
if (disposed) return Promise.reject(new Error("External steering binding was disposed"));
|
|
@@ -22702,7 +22802,7 @@ ${error51.stderrTail}`] : []
|
|
|
22702
22802
|
options
|
|
22703
22803
|
)
|
|
22704
22804
|
).then((response) => {
|
|
22705
|
-
if (!
|
|
22805
|
+
if (!isRecord5(response) || typeof response.turnId !== "string" || !response.turnId) {
|
|
22706
22806
|
throw new Error("External steering returned no replacement Turn identity");
|
|
22707
22807
|
}
|
|
22708
22808
|
return {
|
|
@@ -22733,7 +22833,7 @@ ${error51.stderrTail}`] : []
|
|
|
22733
22833
|
] = args;
|
|
22734
22834
|
if (typeof threadId !== "string") return originalSteer.apply(manager, args);
|
|
22735
22835
|
const role = manager.getStreamRole?.(threadId);
|
|
22736
|
-
if (
|
|
22836
|
+
if (isRecord5(role) && role.role === "follower") return originalSteer.apply(manager, args);
|
|
22737
22837
|
let host = null;
|
|
22738
22838
|
let expectedTurnId;
|
|
22739
22839
|
try {
|
|
@@ -22752,15 +22852,15 @@ ${error51.stderrTail}`] : []
|
|
|
22752
22852
|
if (owner === "codex") return originalSteer.apply(manager, args);
|
|
22753
22853
|
if (!host) throw new Error("Desktop turn submission binding is unavailable");
|
|
22754
22854
|
const currentRole = manager.getStreamRole?.(threadId);
|
|
22755
|
-
if (
|
|
22855
|
+
if (isRecord5(currentRole) && currentRole.role === "follower")
|
|
22756
22856
|
return originalSteer.apply(manager, args);
|
|
22757
22857
|
if (!Array.isArray(input) || input.length === 0 || input.some(
|
|
22758
|
-
(item) => !
|
|
22759
|
-
) || !input.some((item) =>
|
|
22858
|
+
(item) => !isRecord5(item) || item.type !== "text" || typeof item.text !== "string"
|
|
22859
|
+
) || !input.some((item) => isRecord5(item) && typeof item.text === "string" && item.text.trim())) {
|
|
22760
22860
|
throw new Error("External steering requires non-empty text input");
|
|
22761
22861
|
}
|
|
22762
22862
|
if (toolOutput != null) throw new Error("External steering cannot replace a tool response");
|
|
22763
|
-
if (!
|
|
22863
|
+
if (!isRecord5(restoreMessage) || !isRecord5(restoreMessage.context)) {
|
|
22764
22864
|
throw new Error("Desktop steering message context is unavailable");
|
|
22765
22865
|
}
|
|
22766
22866
|
const messageId = typeof clientUserMessageId === "string" && clientUserMessageId ? clientUserMessageId : typeof restoreMessage.id === "string" && restoreMessage.id ? restoreMessage.id : crypto.randomUUID();
|
|
@@ -22808,7 +22908,7 @@ ${error51.stderrTail}`] : []
|
|
|
22808
22908
|
},
|
|
22809
22909
|
onMessageAdded
|
|
22810
22910
|
);
|
|
22811
|
-
if (!
|
|
22911
|
+
if (!isRecord5(response) || !isRecord5(response.turn) || typeof response.turn.id !== "string") {
|
|
22812
22912
|
throw new Error("Desktop returned no replacement Turn identity");
|
|
22813
22913
|
}
|
|
22814
22914
|
try {
|
|
@@ -23000,7 +23100,7 @@ ${error51.stderrTail}`] : []
|
|
|
23000
23100
|
var SIDEBAR_EXTERNAL_THREAD_ATTRIBUTE = "data-codexhost-sidebar-external-thread";
|
|
23001
23101
|
var OWNERSHIP_RETRY_DELAYS_MS = [100, 300, 800, 1500, 3e3];
|
|
23002
23102
|
var PIN_REPLAY_RETRY_DELAYS_MS = [50, 150, 300];
|
|
23003
|
-
function
|
|
23103
|
+
function isRecord6(value) {
|
|
23004
23104
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23005
23105
|
}
|
|
23006
23106
|
function sidebarThreadAttributes(element) {
|
|
@@ -23027,19 +23127,19 @@ ${error51.stderrTail}`] : []
|
|
|
23027
23127
|
const fiberName = fiberNames[0];
|
|
23028
23128
|
if (fiberNames.length !== 1 || !fiberName) return null;
|
|
23029
23129
|
const firstFiber2 = Object.getOwnPropertyDescriptor(element, fiberName)?.value;
|
|
23030
|
-
if (!
|
|
23130
|
+
if (!isRecord6(firstFiber2)) return null;
|
|
23031
23131
|
const candidates = /* @__PURE__ */ new Set();
|
|
23032
23132
|
let fiber = firstFiber2;
|
|
23033
23133
|
for (let depth = 0; fiber && depth < 12; depth += 1) {
|
|
23034
23134
|
const props = fiber.memoizedProps;
|
|
23035
|
-
if (
|
|
23135
|
+
if (isRecord6(props) && isRecord6(props.dataAttributes)) {
|
|
23036
23136
|
const dataAttributes = props.dataAttributes;
|
|
23037
23137
|
const threadId = hostThreadIdSchema.safeParse(props.conversationId);
|
|
23038
23138
|
if (threadId.success && dataAttributes[SIDEBAR_THREAD_ROW_ATTRIBUTE] === rowMarker && dataAttributes[SIDEBAR_THREAD_ID_ATTRIBUTE] === taskKey && dataAttributes[SIDEBAR_THREAD_HOST_ID_ATTRIBUTE] === hostId) {
|
|
23039
23139
|
candidates.add(threadId.data);
|
|
23040
23140
|
}
|
|
23041
23141
|
}
|
|
23042
|
-
fiber =
|
|
23142
|
+
fiber = isRecord6(fiber.return) ? fiber.return : null;
|
|
23043
23143
|
}
|
|
23044
23144
|
return candidates.size === 1 ? candidates.values().next().value ?? null : null;
|
|
23045
23145
|
}
|
|
@@ -23457,7 +23557,7 @@ ${error51.stderrTail}`] : []
|
|
|
23457
23557
|
if (row) finish(row);
|
|
23458
23558
|
});
|
|
23459
23559
|
}
|
|
23460
|
-
function
|
|
23560
|
+
function isRecord7(value) {
|
|
23461
23561
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23462
23562
|
}
|
|
23463
23563
|
function firstFiber(element) {
|
|
@@ -23467,7 +23567,7 @@ ${error51.stderrTail}`] : []
|
|
|
23467
23567
|
const name = names[0];
|
|
23468
23568
|
if (names.length !== 1 || !name) return null;
|
|
23469
23569
|
const value = Object.getOwnPropertyDescriptor(element, name)?.value;
|
|
23470
|
-
return
|
|
23570
|
+
return isRecord7(value) ? value : null;
|
|
23471
23571
|
}
|
|
23472
23572
|
function rendererForkTargetFromButton(button) {
|
|
23473
23573
|
const annotation = button.closest(`[${RESPONSE_CONVERSATION_ATTRIBUTE}]`);
|
|
@@ -23484,10 +23584,10 @@ ${error51.stderrTail}`] : []
|
|
|
23484
23584
|
let hasForkCallback = false;
|
|
23485
23585
|
let fiber = firstFiber(button);
|
|
23486
23586
|
const buttonProps = fiber?.memoizedProps;
|
|
23487
|
-
if (!
|
|
23587
|
+
if (!isRecord7(buttonProps) || !Object.hasOwn(buttonProps, "aria-busy")) return null;
|
|
23488
23588
|
for (let depth = 0; fiber && depth < 24; depth += 1) {
|
|
23489
23589
|
const props = fiber.memoizedProps;
|
|
23490
|
-
if (
|
|
23590
|
+
if (isRecord7(props)) {
|
|
23491
23591
|
if (typeof props.conversationId === "string") conversationIds.add(props.conversationId);
|
|
23492
23592
|
if (typeof props.turnId === "string") turnIds.add(props.turnId);
|
|
23493
23593
|
if (typeof props.hostId === "string") hostIds.add(props.hostId);
|
|
@@ -23496,7 +23596,7 @@ ${error51.stderrTail}`] : []
|
|
|
23496
23596
|
}
|
|
23497
23597
|
if (typeof props.onFork === "function") hasForkCallback = true;
|
|
23498
23598
|
}
|
|
23499
|
-
fiber =
|
|
23599
|
+
fiber = isRecord7(fiber.return) ? fiber.return : null;
|
|
23500
23600
|
}
|
|
23501
23601
|
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) {
|
|
23502
23602
|
return null;
|
|
@@ -23613,7 +23713,7 @@ ${error51.stderrTail}`] : []
|
|
|
23613
23713
|
if (agent === "codex") return null;
|
|
23614
23714
|
return encodeHarnessPluginRoute({ harnessId: harnessPluginIdSchema.parse(agent) });
|
|
23615
23715
|
}
|
|
23616
|
-
function
|
|
23716
|
+
function isRecord8(value) {
|
|
23617
23717
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
23618
23718
|
}
|
|
23619
23719
|
function piTransportModelId(model, thinkingOptionId) {
|
|
@@ -23872,7 +23972,7 @@ ${error51.stderrTail}`] : []
|
|
|
23872
23972
|
let fiber = findComposerFiber(composer);
|
|
23873
23973
|
for (let depth = 0; fiber && depth < 120; depth += 1) {
|
|
23874
23974
|
const props = fiber.memoizedProps;
|
|
23875
|
-
if (
|
|
23975
|
+
if (isRecord8(props) && "conversationId" in props && props.conversationId != null) {
|
|
23876
23976
|
const candidate = hostThreadIdSchema.safeParse(props.conversationId);
|
|
23877
23977
|
if (!candidate.success || threadId !== void 0 && threadId !== candidate.data) {
|
|
23878
23978
|
return null;
|
|
@@ -23885,12 +23985,12 @@ ${error51.stderrTail}`] : []
|
|
|
23885
23985
|
return threadId;
|
|
23886
23986
|
}
|
|
23887
23987
|
function isLegacySevenSlotDraftWrapper(value) {
|
|
23888
|
-
if (!Array.isArray(value) || value.length !== 7 || value[3] !== value[5] || value[3] !== value[6] || !
|
|
23988
|
+
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) {
|
|
23889
23989
|
return false;
|
|
23890
23990
|
}
|
|
23891
23991
|
try {
|
|
23892
23992
|
const draft = value[3].get();
|
|
23893
|
-
return
|
|
23993
|
+
return isRecord8(draft) && "modelSettings" in draft && "isManuallyChanged" in draft;
|
|
23894
23994
|
} catch {
|
|
23895
23995
|
return false;
|
|
23896
23996
|
}
|
|
@@ -23924,8 +24024,8 @@ ${error51.stderrTail}`] : []
|
|
|
23924
24024
|
let fiber = findComposerFiber(composer);
|
|
23925
24025
|
for (let depth = 0; fiber && depth < 120; depth += 1) {
|
|
23926
24026
|
const updateQueue = fiber.updateQueue;
|
|
23927
|
-
const memoCache =
|
|
23928
|
-
const data =
|
|
24027
|
+
const memoCache = isRecord8(updateQueue) ? updateQueue.memoCache : null;
|
|
24028
|
+
const data = isRecord8(memoCache) && Array.isArray(memoCache.data) ? memoCache.data : [];
|
|
23929
24029
|
for (const value of data) {
|
|
23930
24030
|
const draftId = draftIdFromMemoValue(value);
|
|
23931
24031
|
if (draftId) draftIds.add(draftId);
|
|
@@ -23952,7 +24052,7 @@ ${error51.stderrTail}`] : []
|
|
|
23952
24052
|
return ["default", draftIds.values().next().value];
|
|
23953
24053
|
}
|
|
23954
24054
|
function isDraftPrewarmPolicyReady(value) {
|
|
23955
|
-
return
|
|
24055
|
+
return isRecord8(value) && value.state === "ready" && typeof value.hostId === "string" && value.hostId.length > 0 && typeof value.select === "function" && typeof value.clear === "function";
|
|
23956
24056
|
}
|
|
23957
24057
|
async function waitForRendererDraftPrewarmPolicy(target, composer) {
|
|
23958
24058
|
const deadline = Date.now() + DRAFT_PREWARM_POLICY_WAIT_TIMEOUT_MS;
|
|
@@ -24164,16 +24264,16 @@ ${error51.stderrTail}`] : []
|
|
|
24164
24264
|
}
|
|
24165
24265
|
|
|
24166
24266
|
// src/renderer-subagent-thread-model.ts
|
|
24167
|
-
function
|
|
24267
|
+
function isRecord9(value) {
|
|
24168
24268
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24169
24269
|
}
|
|
24170
24270
|
function nonBlank(value) {
|
|
24171
24271
|
return typeof value === "string" && value.trim().length > 0;
|
|
24172
24272
|
}
|
|
24173
24273
|
function threadFromReadResult(value, expectedThreadId) {
|
|
24174
|
-
if (!
|
|
24175
|
-
const directThread =
|
|
24176
|
-
const nestedThread =
|
|
24274
|
+
if (!isRecord9(value)) return null;
|
|
24275
|
+
const directThread = isRecord9(value.thread) ? value.thread : null;
|
|
24276
|
+
const nestedThread = isRecord9(value.result) && isRecord9(value.result.thread) ? value.result.thread : null;
|
|
24177
24277
|
const thread = directThread ?? nestedThread;
|
|
24178
24278
|
if (!thread) return null;
|
|
24179
24279
|
if (expectedThreadId && (!nonBlank(thread.id) || thread.id.trim() !== expectedThreadId)) {
|
|
@@ -24187,7 +24287,7 @@ ${error51.stderrTail}`] : []
|
|
|
24187
24287
|
if (typeof policy?.requestTarget !== "function") return null;
|
|
24188
24288
|
try {
|
|
24189
24289
|
const target = policy.requestTarget();
|
|
24190
|
-
return
|
|
24290
|
+
return isRecord9(target) && typeof target.sendRequest === "function" ? target : null;
|
|
24191
24291
|
} catch {
|
|
24192
24292
|
return null;
|
|
24193
24293
|
}
|
|
@@ -24228,10 +24328,10 @@ ${error51.stderrTail}`] : []
|
|
|
24228
24328
|
function subagentStatusFromReadResult(value, expectedThreadId) {
|
|
24229
24329
|
const thread = threadFromReadResult(value, expectedThreadId);
|
|
24230
24330
|
if (!thread) return null;
|
|
24231
|
-
const threadStatus =
|
|
24331
|
+
const threadStatus = isRecord9(thread.status) && nonBlank(thread.status.type) ? thread.status.type : void 0;
|
|
24232
24332
|
if (threadStatus === "systemError") return "failed";
|
|
24233
24333
|
const turns = Array.isArray(thread.turns) ? thread.turns : [];
|
|
24234
|
-
const lastTurn = [...turns].reverse().find(
|
|
24334
|
+
const lastTurn = [...turns].reverse().find(isRecord9);
|
|
24235
24335
|
const turnStatus = lastTurn && nonBlank(lastTurn.status) ? lastTurn.status : void 0;
|
|
24236
24336
|
if (turnStatus === "completed") return "completed";
|
|
24237
24337
|
if (turnStatus === "failed") return "failed";
|
|
@@ -24375,7 +24475,7 @@ ${error51.stderrTail}`] : []
|
|
|
24375
24475
|
var SUBAGENT_ROW_COPY_ATTRIBUTE = "data-codexhost-subagent-copy";
|
|
24376
24476
|
var SUBAGENT_ITEM_BUTTON_SELECTOR = 'button[data-slot="thread-summary-panel-item-button"]';
|
|
24377
24477
|
var SUBAGENT_ITEM_LABEL_SELECTOR = '[data-slot="thread-summary-panel-item-label"]';
|
|
24378
|
-
function
|
|
24478
|
+
function isRecord10(value) {
|
|
24379
24479
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24380
24480
|
}
|
|
24381
24481
|
function nonBlank2(value) {
|
|
@@ -24493,12 +24593,12 @@ ${error51.stderrTail}`] : []
|
|
|
24493
24593
|
if (nonBlank2(source.status) && !target.status) {
|
|
24494
24594
|
target.status = source.status.trim();
|
|
24495
24595
|
}
|
|
24496
|
-
if (
|
|
24596
|
+
if (isRecord10(source.agentState) && nonBlank2(source.agentState.status) && !target.status) {
|
|
24497
24597
|
target.status = source.agentState.status.trim();
|
|
24498
24598
|
}
|
|
24499
|
-
if (
|
|
24599
|
+
if (isRecord10(source.agentsStates) && target.conversationId) {
|
|
24500
24600
|
const state = source.agentsStates[target.conversationId];
|
|
24501
|
-
if (
|
|
24601
|
+
if (isRecord10(state) && nonBlank2(state.status) && !target.status) {
|
|
24502
24602
|
target.status = state.status.trim();
|
|
24503
24603
|
}
|
|
24504
24604
|
}
|
|
@@ -24509,28 +24609,28 @@ ${error51.stderrTail}`] : []
|
|
|
24509
24609
|
if (Array.isArray(item.receiverThreadIds) && item.receiverThreadIds.includes(conversationId)) {
|
|
24510
24610
|
return true;
|
|
24511
24611
|
}
|
|
24512
|
-
return
|
|
24612
|
+
return isRecord10(item.agentsStates) && conversationId in item.agentsStates;
|
|
24513
24613
|
}
|
|
24514
24614
|
function harvestFromValue(value, target) {
|
|
24515
|
-
if (!
|
|
24615
|
+
if (!isRecord10(value)) return;
|
|
24516
24616
|
contribute(target, value);
|
|
24517
24617
|
const nested = [
|
|
24518
|
-
|
|
24519
|
-
|
|
24520
|
-
|
|
24521
|
-
|
|
24522
|
-
|
|
24523
|
-
|
|
24618
|
+
isRecord10(value.row) ? value.row : null,
|
|
24619
|
+
isRecord10(value.backgroundAgent) ? value.backgroundAgent : null,
|
|
24620
|
+
isRecord10(value.item) ? value.item : null,
|
|
24621
|
+
isRecord10(value.item) && isRecord10(value.item.backgroundAgent) ? value.item.backgroundAgent : null,
|
|
24622
|
+
isRecord10(value.thread) && (!target.conversationId || nonBlank2(value.thread.id) && value.thread.id.trim() === target.conversationId) ? value.thread : null,
|
|
24623
|
+
isRecord10(value.childConversation) ? value.childConversation : null
|
|
24524
24624
|
];
|
|
24525
24625
|
for (const source of nested) {
|
|
24526
24626
|
if (source) contribute(target, source);
|
|
24527
24627
|
}
|
|
24528
24628
|
if (!target.conversationId) return;
|
|
24529
24629
|
const items = Array.isArray(value.items) ? value.items : Array.isArray(value.turns) ? value.turns.flatMap(
|
|
24530
|
-
(turn) =>
|
|
24630
|
+
(turn) => isRecord10(turn) && Array.isArray(turn.items) ? turn.items : []
|
|
24531
24631
|
) : [];
|
|
24532
24632
|
for (const item of items) {
|
|
24533
|
-
if (!
|
|
24633
|
+
if (!isRecord10(item)) continue;
|
|
24534
24634
|
if (collabMatches(item, target.conversationId)) contribute(target, item, true);
|
|
24535
24635
|
}
|
|
24536
24636
|
}
|
|
@@ -24597,7 +24697,7 @@ ${error51.stderrTail}`] : []
|
|
|
24597
24697
|
const name = names[0];
|
|
24598
24698
|
if (!name) return null;
|
|
24599
24699
|
const fiber = Object.getOwnPropertyDescriptor(element, name)?.value ?? element[name];
|
|
24600
|
-
return
|
|
24700
|
+
return isRecord10(fiber) ? fiber : null;
|
|
24601
24701
|
}
|
|
24602
24702
|
function metaFromFiberProps(fiber) {
|
|
24603
24703
|
if (!fiber) return null;
|
|
@@ -24626,7 +24726,7 @@ ${error51.stderrTail}`] : []
|
|
|
24626
24726
|
};
|
|
24627
24727
|
}
|
|
24628
24728
|
function metaFromDescendants(start) {
|
|
24629
|
-
if (!start || !
|
|
24729
|
+
if (!start || !isRecord10(start.child)) return null;
|
|
24630
24730
|
const stack = [start.child];
|
|
24631
24731
|
const seen = /* @__PURE__ */ new Set();
|
|
24632
24732
|
let found = null;
|
|
@@ -24637,8 +24737,8 @@ ${error51.stderrTail}`] : []
|
|
|
24637
24737
|
seen.add(fiber);
|
|
24638
24738
|
steps += 1;
|
|
24639
24739
|
found = mergeRow(found, metaFromFiberProps(fiber));
|
|
24640
|
-
if (
|
|
24641
|
-
if (
|
|
24740
|
+
if (isRecord10(fiber.child)) stack.push(fiber.child);
|
|
24741
|
+
if (isRecord10(fiber.sibling)) stack.push(fiber.sibling);
|
|
24642
24742
|
}
|
|
24643
24743
|
return found;
|
|
24644
24744
|
}
|
|
@@ -24647,7 +24747,7 @@ ${error51.stderrTail}`] : []
|
|
|
24647
24747
|
let found = metaFromDescendants(fiber);
|
|
24648
24748
|
for (let depth = 0; fiber && depth < 12; depth += 1) {
|
|
24649
24749
|
found = mergeRow(found, metaFromFiberProps(fiber));
|
|
24650
|
-
fiber =
|
|
24750
|
+
fiber = isRecord10(fiber.return) ? fiber.return : null;
|
|
24651
24751
|
}
|
|
24652
24752
|
return found;
|
|
24653
24753
|
}
|
|
@@ -24834,11 +24934,11 @@ ${error51.stderrTail}`] : []
|
|
|
24834
24934
|
return null;
|
|
24835
24935
|
}
|
|
24836
24936
|
}
|
|
24837
|
-
function
|
|
24937
|
+
function isRecord11(value) {
|
|
24838
24938
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24839
24939
|
}
|
|
24840
24940
|
function parseExternalConfiguration(value) {
|
|
24841
|
-
if (!
|
|
24941
|
+
if (!isRecord11(value)) return void 0;
|
|
24842
24942
|
const model = harnessModelRefSchema.safeParse(value.model);
|
|
24843
24943
|
if (!model.success) return void 0;
|
|
24844
24944
|
const thinkingOptionId = harnessThinkingOptionIdSchema.safeParse(value.thinkingOptionId);
|
|
@@ -24855,9 +24955,9 @@ ${error51.stderrTail}`] : []
|
|
|
24855
24955
|
const raw = storage.getItem(RENDERER_NEW_THREAD_PREFERENCE_KEY);
|
|
24856
24956
|
if (!raw) return void 0;
|
|
24857
24957
|
const parsed = JSON.parse(raw);
|
|
24858
|
-
if (!
|
|
24958
|
+
if (!isRecord11(parsed) || parsed.version !== 1) return void 0;
|
|
24859
24959
|
if (!KNOWN_RENDERER_AGENTS.some((agent) => agent === parsed.lastAgent)) return void 0;
|
|
24860
|
-
const externalByAgent =
|
|
24960
|
+
const externalByAgent = isRecord11(parsed.externalByAgent) ? parsed.externalByAgent : {};
|
|
24861
24961
|
const parsedExternal = Object.fromEntries(
|
|
24862
24962
|
KNOWN_RENDERER_AGENTS.filter(
|
|
24863
24963
|
(agent) => agent !== "codex"
|
|
@@ -24929,11 +25029,63 @@ ${error51.stderrTail}`] : []
|
|
|
24929
25029
|
);
|
|
24930
25030
|
}
|
|
24931
25031
|
|
|
25032
|
+
// src/renderer-harness-command-claim.ts
|
|
25033
|
+
function inputEvent(editor, text) {
|
|
25034
|
+
const view = editor.ownerDocument.defaultView;
|
|
25035
|
+
return view?.InputEvent ? new view.InputEvent("input", {
|
|
25036
|
+
bubbles: true,
|
|
25037
|
+
composed: true,
|
|
25038
|
+
data: text,
|
|
25039
|
+
inputType: "insertText"
|
|
25040
|
+
}) : new (view?.Event ?? Event)("input", { bubbles: true, composed: true });
|
|
25041
|
+
}
|
|
25042
|
+
function prependTextarea(editor, prefix) {
|
|
25043
|
+
const view = editor.ownerDocument.defaultView;
|
|
25044
|
+
if (!view || !(editor instanceof view.HTMLTextAreaElement)) return false;
|
|
25045
|
+
const setter = Object.getOwnPropertyDescriptor(view.HTMLTextAreaElement.prototype, "value")?.set;
|
|
25046
|
+
if (!setter) return false;
|
|
25047
|
+
const start = editor.selectionStart;
|
|
25048
|
+
const end = editor.selectionEnd;
|
|
25049
|
+
setter.call(editor, prefix + editor.value);
|
|
25050
|
+
editor.dispatchEvent(inputEvent(editor, prefix));
|
|
25051
|
+
editor.focus({ preventScroll: true });
|
|
25052
|
+
if (start !== null && end !== null) {
|
|
25053
|
+
editor.setSelectionRange(start + prefix.length, end + prefix.length);
|
|
25054
|
+
}
|
|
25055
|
+
return true;
|
|
25056
|
+
}
|
|
25057
|
+
function prependContentEditable(editor, prefix) {
|
|
25058
|
+
if (editor.getAttribute("contenteditable") !== "true") return false;
|
|
25059
|
+
const document2 = editor.ownerDocument;
|
|
25060
|
+
const selection = document2.getSelection();
|
|
25061
|
+
if (!selection || typeof document2.execCommand !== "function") return false;
|
|
25062
|
+
const range = document2.createRange();
|
|
25063
|
+
range.selectNodeContents(editor);
|
|
25064
|
+
range.collapse(true);
|
|
25065
|
+
editor.focus({ preventScroll: true });
|
|
25066
|
+
selection.removeAllRanges();
|
|
25067
|
+
selection.addRange(range);
|
|
25068
|
+
return document2.execCommand("insertText", false, prefix);
|
|
25069
|
+
}
|
|
25070
|
+
function prependEditor(editor, prefix) {
|
|
25071
|
+
return prependTextarea(editor, prefix) || prependContentEditable(editor, prefix);
|
|
25072
|
+
}
|
|
25073
|
+
function rendererHarnessCommandExecutesDirectly(command) {
|
|
25074
|
+
return command.invocation === "/compact" || command.argumentMode === "none";
|
|
25075
|
+
}
|
|
25076
|
+
function routeRendererHarnessCommandSelection(editor, command, execute) {
|
|
25077
|
+
if (rendererHarnessCommandExecutesDirectly(command)) {
|
|
25078
|
+
execute();
|
|
25079
|
+
return true;
|
|
25080
|
+
}
|
|
25081
|
+
return editor !== null && prependEditor(editor, `${command.invocation} `);
|
|
25082
|
+
}
|
|
25083
|
+
|
|
24932
25084
|
// src/codex-locale-adapter.ts
|
|
24933
25085
|
var GET_LOCALE_OVERRIDE_URL = "vscode://codex/get-setting";
|
|
24934
25086
|
var GET_LOCALE_INFO_URL = "vscode://codex/locale-info";
|
|
24935
25087
|
var DEFAULT_LOCALE_REQUEST_TIMEOUT_MS = 750;
|
|
24936
|
-
function
|
|
25088
|
+
function isRecord12(value) {
|
|
24937
25089
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
24938
25090
|
}
|
|
24939
25091
|
function canonicalLocale(value) {
|
|
@@ -24955,7 +25107,7 @@ ${error51.stderrTail}`] : []
|
|
|
24955
25107
|
return new DOMException("The operation was aborted", "AbortError");
|
|
24956
25108
|
}
|
|
24957
25109
|
function parseLocaleOverride(value) {
|
|
24958
|
-
if (!
|
|
25110
|
+
if (!isRecord12(value) || !("value" in value)) {
|
|
24959
25111
|
throw new Error("Codex locale override response is malformed");
|
|
24960
25112
|
}
|
|
24961
25113
|
if (value.value === null) return { value: null };
|
|
@@ -24970,7 +25122,7 @@ ${error51.stderrTail}`] : []
|
|
|
24970
25122
|
return locale;
|
|
24971
25123
|
}
|
|
24972
25124
|
function parseLocaleInfo(value) {
|
|
24973
|
-
if (!
|
|
25125
|
+
if (!isRecord12(value)) throw new Error("Codex locale info response is malformed");
|
|
24974
25126
|
return {
|
|
24975
25127
|
ideLocale: optionalLocale(value.ideLocale, "IDE locale"),
|
|
24976
25128
|
systemLocale: optionalLocale(value.systemLocale, "system locale")
|
|
@@ -24999,7 +25151,7 @@ ${error51.stderrTail}`] : []
|
|
|
24999
25151
|
const onAbort = () => settle(() => reject(abortError2()));
|
|
25000
25152
|
const onMessage = (event) => {
|
|
25001
25153
|
const message2 = event.data;
|
|
25002
|
-
if (!
|
|
25154
|
+
if (!isRecord12(message2) || message2.type !== "fetch-response") return;
|
|
25003
25155
|
if (message2.requestId !== requestId) return;
|
|
25004
25156
|
if (message2.responseType !== "success" || typeof message2.status !== "number" || message2.status < 200 || message2.status >= 300 || typeof message2.bodyJsonString !== "string") {
|
|
25005
25157
|
settle(() => reject(new Error("Codex locale request failed")));
|
|
@@ -26237,6 +26389,7 @@ ${error51.stderrTail}`] : []
|
|
|
26237
26389
|
var ORDERED_ITEM_PATTERN = /^\d+[.)][ \t]+(.+?)\s*$/u;
|
|
26238
26390
|
var FENCE_PATTERN = /^```([\w+-]*)\s*$/u;
|
|
26239
26391
|
var THEMATIC_BREAK_PATTERN = /^(?:---|___|\*\*\*)[ \t]*$/u;
|
|
26392
|
+
var CJK_PATTERN = /[\u3040-\u30ff\u3400-\u9fff\uac00-\ud7af]/u;
|
|
26240
26393
|
var INLINE_PATTERN = /(`+)((?:(?!\1).)+)\1|\*\*(.+?)\*\*|\[([^\]]+)\]\(([^)\s]+)\)/gu;
|
|
26241
26394
|
function createReleaseNotesElement(document2, markdown) {
|
|
26242
26395
|
const root = document2.createElement("div");
|
|
@@ -26358,9 +26511,20 @@ ${error51.stderrTail}`] : []
|
|
|
26358
26511
|
index += 1;
|
|
26359
26512
|
}
|
|
26360
26513
|
const paragraph = document2.createElement("p");
|
|
26514
|
+
const primaryIsCjk = CJK_PATTERN.test(paragraphLines[0] ?? "");
|
|
26515
|
+
let previousWasTranslation = false;
|
|
26361
26516
|
paragraphLines.forEach((line, lineIndex) => {
|
|
26517
|
+
if (lineIndex > 0 && !primaryIsCjk && CJK_PATTERN.test(line)) {
|
|
26518
|
+
const translation = document2.createElement("span");
|
|
26519
|
+
translation.className = "release-note-translation";
|
|
26520
|
+
appendInline(document2, translation, line);
|
|
26521
|
+
paragraph.append(translation);
|
|
26522
|
+
previousWasTranslation = true;
|
|
26523
|
+
return;
|
|
26524
|
+
}
|
|
26525
|
+
if (lineIndex > 0 && !previousWasTranslation) paragraph.append(document2.createElement("br"));
|
|
26526
|
+
previousWasTranslation = false;
|
|
26362
26527
|
appendInline(document2, paragraph, line);
|
|
26363
|
-
if (lineIndex < paragraphLines.length - 1) paragraph.append(document2.createElement("br"));
|
|
26364
26528
|
});
|
|
26365
26529
|
root.append(paragraph);
|
|
26366
26530
|
return index;
|
|
@@ -28229,6 +28393,7 @@ ${error51.stderrTail}`] : []
|
|
|
28229
28393
|
notes.className = "settings-update-notes-section";
|
|
28230
28394
|
context.content.append(header, metadata, panel, controls, notes);
|
|
28231
28395
|
const setManualFallback = (fallback) => {
|
|
28396
|
+
controls.className = !fallback && !windows ? "settings-update-controls is-quiet" : "settings-update-controls";
|
|
28232
28397
|
manualNpmDescription.textContent = windows ? messages.updateWindowsNpmDescription : fallback ? messages.updateManualFallbackDescription : messages.updateManualNpmDescription;
|
|
28233
28398
|
manualNpmDescription.className = fallback ? "settings-update-manual-description is-fallback" : "settings-update-manual-description";
|
|
28234
28399
|
};
|
|
@@ -28243,6 +28408,7 @@ ${error51.stderrTail}`] : []
|
|
|
28243
28408
|
};
|
|
28244
28409
|
const renderUnavailable = (detail) => {
|
|
28245
28410
|
panel.dataset.updateState = "unavailable";
|
|
28411
|
+
delete panel.dataset.inline;
|
|
28246
28412
|
panel.replaceChildren();
|
|
28247
28413
|
const copy = document2.createElement("p");
|
|
28248
28414
|
copy.className = "settings-update-summary";
|
|
@@ -28251,9 +28417,10 @@ ${error51.stderrTail}`] : []
|
|
|
28251
28417
|
notes.replaceChildren();
|
|
28252
28418
|
};
|
|
28253
28419
|
const renderRequestFailure = (error51) => {
|
|
28420
|
+
console.error("codexhost update request failed", error51);
|
|
28254
28421
|
renderPendingStatus(
|
|
28255
28422
|
null,
|
|
28256
|
-
error51 instanceof RendererUpdateRequestTimeoutError ? messages.updateRequestTimeout :
|
|
28423
|
+
error51 instanceof RendererUpdateRequestTimeoutError ? messages.updateRequestTimeout : messages.updateServiceUnavailable,
|
|
28257
28424
|
"failed"
|
|
28258
28425
|
);
|
|
28259
28426
|
};
|
|
@@ -28271,11 +28438,17 @@ ${error51.stderrTail}`] : []
|
|
|
28271
28438
|
{
|
|
28272
28439
|
success(result) {
|
|
28273
28440
|
const message = statusMessage(result.status, messages);
|
|
28274
|
-
if (isPendingStatus(result.status)) scheduleStatusPoll(client);
|
|
28275
28441
|
if (message) renderPendingStatus(result.status, message);
|
|
28442
|
+
if (result.status === null || isPendingStatus(result.status)) {
|
|
28443
|
+
scheduleStatusPoll(client);
|
|
28444
|
+
}
|
|
28276
28445
|
},
|
|
28277
28446
|
failure(error51) {
|
|
28278
|
-
|
|
28447
|
+
if (error51 instanceof RendererUpdateRequestTimeoutError) {
|
|
28448
|
+
scheduleStatusPoll(client);
|
|
28449
|
+
} else {
|
|
28450
|
+
renderRequestFailure(error51);
|
|
28451
|
+
}
|
|
28279
28452
|
}
|
|
28280
28453
|
}
|
|
28281
28454
|
);
|
|
@@ -28283,19 +28456,11 @@ ${error51.stderrTail}`] : []
|
|
|
28283
28456
|
};
|
|
28284
28457
|
const renderPendingStatus = (status, message, viewPhase = status?.phase ?? "pending") => {
|
|
28285
28458
|
panel.dataset.updateState = viewPhase;
|
|
28459
|
+
delete panel.dataset.inline;
|
|
28286
28460
|
panel.replaceChildren();
|
|
28287
28461
|
const head = createPanelHead(document2, viewPhase, message);
|
|
28288
28462
|
setManualFallback(viewPhase === "failed");
|
|
28289
|
-
|
|
28290
|
-
const retry = document2.createElement("button");
|
|
28291
|
-
retry.type = "button";
|
|
28292
|
-
retry.className = "settings-command-button settings-command-button--secondary";
|
|
28293
|
-
retry.append(createRendererSettingsIcon("refresh", 16), messages.updateRetry);
|
|
28294
|
-
retry.addEventListener("click", () => void load());
|
|
28295
|
-
panel.append(createPanelStatusRow(document2, head, retry));
|
|
28296
|
-
} else {
|
|
28297
|
-
panel.append(head);
|
|
28298
|
-
}
|
|
28463
|
+
panel.append(head);
|
|
28299
28464
|
if (status?.phase === "downloading" && status.totalBytes !== void 0 && status.downloadedBytes !== void 0) {
|
|
28300
28465
|
const progress = document2.createElement("progress");
|
|
28301
28466
|
progress.className = "settings-update-progress";
|
|
@@ -28329,7 +28494,11 @@ ${error51.stderrTail}`] : []
|
|
|
28329
28494
|
},
|
|
28330
28495
|
failure(error51) {
|
|
28331
28496
|
pending = false;
|
|
28332
|
-
|
|
28497
|
+
if (error51 instanceof RendererUpdateRequestTimeoutError) {
|
|
28498
|
+
scheduleStatusPoll(client, true);
|
|
28499
|
+
} else {
|
|
28500
|
+
renderRequestFailure(error51);
|
|
28501
|
+
}
|
|
28333
28502
|
}
|
|
28334
28503
|
}
|
|
28335
28504
|
);
|
|
@@ -29708,11 +29877,13 @@ ${error51.stderrTail}`] : []
|
|
|
29708
29877
|
.settings-connection-install-callout p,
|
|
29709
29878
|
.settings-connection-error-summary p,
|
|
29710
29879
|
.settings-connection-state-summary p,
|
|
29711
|
-
.settings-connection-issue-note
|
|
29880
|
+
.settings-connection-issue-note,
|
|
29881
|
+
.settings-connection-compatibility {
|
|
29712
29882
|
margin: 0;
|
|
29713
29883
|
color: var(--settings-muted);
|
|
29714
29884
|
font-size: 11px;
|
|
29715
29885
|
line-height: 16px;
|
|
29886
|
+
overflow-wrap: anywhere;
|
|
29716
29887
|
}
|
|
29717
29888
|
|
|
29718
29889
|
.settings-connection-install-command {
|
|
@@ -30142,7 +30313,7 @@ ${error51.stderrTail}`] : []
|
|
|
30142
30313
|
}
|
|
30143
30314
|
|
|
30144
30315
|
/* The only emphasis on this screen: a latest version newer than the installed one. */
|
|
30145
|
-
.settings-update-metadata__value--newer {
|
|
30316
|
+
.settings-update-metadata__item strong.settings-update-metadata__value--newer {
|
|
30146
30317
|
color: var(--settings-focus);
|
|
30147
30318
|
}
|
|
30148
30319
|
|
|
@@ -30283,7 +30454,7 @@ ${error51.stderrTail}`] : []
|
|
|
30283
30454
|
display: grid;
|
|
30284
30455
|
min-width: 0;
|
|
30285
30456
|
gap: 12px;
|
|
30286
|
-
color: var(--settings-
|
|
30457
|
+
color: var(--settings-text);
|
|
30287
30458
|
font-size: 14px;
|
|
30288
30459
|
line-height: 22px;
|
|
30289
30460
|
overflow-wrap: anywhere;
|
|
@@ -30309,13 +30480,13 @@ ${error51.stderrTail}`] : []
|
|
|
30309
30480
|
}
|
|
30310
30481
|
|
|
30311
30482
|
.settings-update-notes h1 {
|
|
30312
|
-
font-size:
|
|
30313
|
-
line-height:
|
|
30483
|
+
font-size: 16px;
|
|
30484
|
+
line-height: 24px;
|
|
30314
30485
|
}
|
|
30315
30486
|
|
|
30316
30487
|
.settings-update-notes h2 {
|
|
30317
|
-
font-size:
|
|
30318
|
-
line-height:
|
|
30488
|
+
font-size: 15px;
|
|
30489
|
+
line-height: 22px;
|
|
30319
30490
|
}
|
|
30320
30491
|
|
|
30321
30492
|
.settings-update-notes h3,
|
|
@@ -30349,7 +30520,7 @@ ${error51.stderrTail}`] : []
|
|
|
30349
30520
|
}
|
|
30350
30521
|
|
|
30351
30522
|
.settings-update-notes li + li {
|
|
30352
|
-
margin-top:
|
|
30523
|
+
margin-top: 6px;
|
|
30353
30524
|
}
|
|
30354
30525
|
|
|
30355
30526
|
.settings-update-notes .release-note-translation {
|
|
@@ -30423,6 +30594,27 @@ ${error51.stderrTail}`] : []
|
|
|
30423
30594
|
margin-top: 24px;
|
|
30424
30595
|
}
|
|
30425
30596
|
|
|
30597
|
+
.settings-update-controls.is-quiet {
|
|
30598
|
+
margin-top: 10px;
|
|
30599
|
+
}
|
|
30600
|
+
|
|
30601
|
+
.settings-update-controls.is-quiet .settings-update-manual-title {
|
|
30602
|
+
display: none;
|
|
30603
|
+
}
|
|
30604
|
+
|
|
30605
|
+
.settings-update-controls.is-quiet .settings-update-link {
|
|
30606
|
+
min-height: 0;
|
|
30607
|
+
padding: 0;
|
|
30608
|
+
color: var(--settings-muted);
|
|
30609
|
+
background: transparent;
|
|
30610
|
+
border: 0;
|
|
30611
|
+
}
|
|
30612
|
+
|
|
30613
|
+
.settings-update-controls.is-quiet .settings-update-link:hover {
|
|
30614
|
+
color: var(--settings-text);
|
|
30615
|
+
background: transparent;
|
|
30616
|
+
}
|
|
30617
|
+
|
|
30426
30618
|
.settings-update-manual-title {
|
|
30427
30619
|
color: var(--settings-text);
|
|
30428
30620
|
font-size: 15px;
|
|
@@ -31614,7 +31806,7 @@ ${error51.stderrTail}`] : []
|
|
|
31614
31806
|
`;
|
|
31615
31807
|
|
|
31616
31808
|
// src/settings/tailwind.css
|
|
31617
|
-
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}.blur{--tw-blur:blur(8px);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,)}.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';
|
|
31809
|
+
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}.blur{--tw-blur:blur(8px);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,)}.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';
|
|
31618
31810
|
|
|
31619
31811
|
// src/settings/shell.ts
|
|
31620
31812
|
var SETTINGS_SHELL_ATTRIBUTE = "data-codexhost-settings-shell";
|
|
@@ -32008,6 +32200,7 @@ ${accounts_default}`;
|
|
|
32008
32200
|
updateButton.style.display = "inline-flex";
|
|
32009
32201
|
updateButton.style.alignItems = "center";
|
|
32010
32202
|
updateButton.style.justifyContent = "center";
|
|
32203
|
+
updateButton.style.width = "28px";
|
|
32011
32204
|
updateButton.style.height = "28px";
|
|
32012
32205
|
updateButton.style.maxWidth = "0";
|
|
32013
32206
|
updateButton.style.padding = "0";
|
|
@@ -32376,6 +32569,565 @@ ${accounts_default}`;
|
|
|
32376
32569
|
};
|
|
32377
32570
|
}
|
|
32378
32571
|
|
|
32572
|
+
// src/renderer-native-composer-controller.ts
|
|
32573
|
+
var MAX_ELEMENT_DEPTH = 4;
|
|
32574
|
+
var MAX_FIBER_DEPTH = 40;
|
|
32575
|
+
function isController(value, editor) {
|
|
32576
|
+
if (typeof value !== "object" || value === null) return false;
|
|
32577
|
+
const candidate = value;
|
|
32578
|
+
return candidate.view?.dom === editor && typeof candidate.view.posAtDOM === "function" && typeof candidate.insertMentionNodeInRange === "function";
|
|
32579
|
+
}
|
|
32580
|
+
function fiberOf(element) {
|
|
32581
|
+
const key = Object.keys(element).find((name) => name.startsWith("__reactFiber$"));
|
|
32582
|
+
return key ? element[key] : null;
|
|
32583
|
+
}
|
|
32584
|
+
function findNativeComposerController(editor) {
|
|
32585
|
+
let element = editor;
|
|
32586
|
+
for (let depth = 0; element && depth < MAX_ELEMENT_DEPTH; depth += 1) {
|
|
32587
|
+
let fiber = fiberOf(element);
|
|
32588
|
+
for (let level = 0; fiber && level < MAX_FIBER_DEPTH; level += 1) {
|
|
32589
|
+
const props = fiber.memoizedProps;
|
|
32590
|
+
if (props && isController(props.composerController, editor)) return props.composerController;
|
|
32591
|
+
fiber = fiber.return;
|
|
32592
|
+
}
|
|
32593
|
+
element = element.parentElement;
|
|
32594
|
+
}
|
|
32595
|
+
return null;
|
|
32596
|
+
}
|
|
32597
|
+
function resolveRange(controller, range) {
|
|
32598
|
+
const from = controller.view.posAtDOM(range.node, range.start);
|
|
32599
|
+
const to = controller.view.posAtDOM(range.node, range.end);
|
|
32600
|
+
return controller.view.state.doc.textBetween(from, to) === range.expected ? { from, to } : null;
|
|
32601
|
+
}
|
|
32602
|
+
function insertNativeTextAtSelection(editor, build) {
|
|
32603
|
+
const controller = findNativeComposerController(editor);
|
|
32604
|
+
if (!controller || typeof controller.view.dispatch !== "function") return false;
|
|
32605
|
+
try {
|
|
32606
|
+
const { from } = controller.view.state.selection;
|
|
32607
|
+
const previous = from > 0 ? controller.view.state.doc.textBetween(from - 1, from) : "";
|
|
32608
|
+
controller.view.dispatch(controller.view.state.tr.insertText(build(previous)));
|
|
32609
|
+
return true;
|
|
32610
|
+
} catch {
|
|
32611
|
+
return false;
|
|
32612
|
+
}
|
|
32613
|
+
}
|
|
32614
|
+
function deleteNativeRange(editor, range) {
|
|
32615
|
+
const controller = findNativeComposerController(editor);
|
|
32616
|
+
if (!controller || typeof controller.view.dispatch !== "function") return false;
|
|
32617
|
+
try {
|
|
32618
|
+
const resolved = resolveRange(controller, range);
|
|
32619
|
+
if (!resolved) return false;
|
|
32620
|
+
controller.view.dispatch(controller.view.state.tr.delete(resolved.from, resolved.to));
|
|
32621
|
+
return true;
|
|
32622
|
+
} catch {
|
|
32623
|
+
return false;
|
|
32624
|
+
}
|
|
32625
|
+
}
|
|
32626
|
+
function insertNativeAgentMention(editor, range, mention) {
|
|
32627
|
+
const controller = findNativeComposerController(editor);
|
|
32628
|
+
const nodeType = controller?.view.state.schema.nodes.agentMention;
|
|
32629
|
+
if (!controller || !nodeType) return false;
|
|
32630
|
+
try {
|
|
32631
|
+
const resolved = resolveRange(controller, range);
|
|
32632
|
+
if (!resolved) return false;
|
|
32633
|
+
const { from, to } = resolved;
|
|
32634
|
+
controller.insertMentionNodeInRange(
|
|
32635
|
+
nodeType,
|
|
32636
|
+
{
|
|
32637
|
+
conversationId: null,
|
|
32638
|
+
displayName: mention.displayName,
|
|
32639
|
+
name: mention.name,
|
|
32640
|
+
path: mention.path
|
|
32641
|
+
},
|
|
32642
|
+
from,
|
|
32643
|
+
to,
|
|
32644
|
+
true
|
|
32645
|
+
);
|
|
32646
|
+
return true;
|
|
32647
|
+
} catch {
|
|
32648
|
+
return false;
|
|
32649
|
+
}
|
|
32650
|
+
}
|
|
32651
|
+
|
|
32652
|
+
// src/renderer-delegation-mention.ts
|
|
32653
|
+
var MENU_ATTRIBUTE = "data-codexhost-delegation-mention-menu";
|
|
32654
|
+
var STYLE_ATTRIBUTE4 = "data-codexhost-delegation-mention-style";
|
|
32655
|
+
var MENU_MAX_HEIGHT = 320;
|
|
32656
|
+
var SOURCE_TAG = "BANK OF TOKEN";
|
|
32657
|
+
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";
|
|
32658
|
+
var LIST_CLASS = "vertical-scroll-fade-mask flex w-full flex-1 flex-col overflow-y-auto";
|
|
32659
|
+
var HEADER_CLASS = "text-codex-description sticky top-0 z-10 px-row-x py-1 text-sm bg-surface-elevated-secondary";
|
|
32660
|
+
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";
|
|
32661
|
+
var ROW_CONTENT_CLASS = "flex w-full min-w-0 items-center gap-[var(--spacing-menu-item-content,calc(var(--spacing)*1.5))]";
|
|
32662
|
+
var ROW_HIGHLIGHT_CLASSES = ["bg-primary-ghost-hover", "opacity-100"];
|
|
32663
|
+
var ROW_IDLE_CLASS = "menu-row-opacity";
|
|
32664
|
+
var VIEWPORT_MARGIN = 8;
|
|
32665
|
+
var MENU_GAP2 = 4;
|
|
32666
|
+
var MAX_QUERY_LENGTH = 32;
|
|
32667
|
+
var TRIGGER_PATTERN = /(?:^|\s)#([^\s#]*)$/u;
|
|
32668
|
+
function findDelegationTrigger(textBeforeCaret) {
|
|
32669
|
+
const match = TRIGGER_PATTERN.exec(textBeforeCaret);
|
|
32670
|
+
if (!match) return null;
|
|
32671
|
+
const query = match[1] ?? "";
|
|
32672
|
+
if (query.length > MAX_QUERY_LENGTH || /^\d/u.test(query)) return null;
|
|
32673
|
+
return { query, start: textBeforeCaret.length - query.length - 1 };
|
|
32674
|
+
}
|
|
32675
|
+
function filterDelegationTargets(targets, query) {
|
|
32676
|
+
const needle = query.trim().toLowerCase();
|
|
32677
|
+
if (!needle) return [...targets];
|
|
32678
|
+
const scored = targets.flatMap((target, index) => {
|
|
32679
|
+
const label = target.label.toLowerCase();
|
|
32680
|
+
const id = target.agent.toLowerCase();
|
|
32681
|
+
const score = label.startsWith(needle) || id.startsWith(needle) ? 2 : label.includes(needle) || id.includes(needle) ? 1 : 0;
|
|
32682
|
+
return score > 0 ? [{ target, score, index }] : [];
|
|
32683
|
+
});
|
|
32684
|
+
return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ target }) => target);
|
|
32685
|
+
}
|
|
32686
|
+
function filterDelegationCommands(commands, query) {
|
|
32687
|
+
const needle = query.trim().toLowerCase().replace(/^\//u, "");
|
|
32688
|
+
if (!needle) return [...commands];
|
|
32689
|
+
const scored = commands.flatMap((command, index) => {
|
|
32690
|
+
const invocation = command.invocation.toLowerCase().replace(/^\//u, "");
|
|
32691
|
+
const label = command.label.toLowerCase();
|
|
32692
|
+
const display = harnessCommandDisplayName(command.label).toLowerCase();
|
|
32693
|
+
const score = invocation.startsWith(needle) || display.startsWith(needle) ? 2 : invocation.includes(needle) || label.includes(needle) || display.includes(needle) ? 1 : 0;
|
|
32694
|
+
return score > 0 ? [{ command, score, index }] : [];
|
|
32695
|
+
});
|
|
32696
|
+
return scored.sort((left, right) => right.score - left.score || left.index - right.index).map(({ command }) => command);
|
|
32697
|
+
}
|
|
32698
|
+
function menuTitleWord(word) {
|
|
32699
|
+
return word.toLowerCase() === "codexhost" ? "BOFT" : word.charAt(0).toUpperCase() + word.slice(1);
|
|
32700
|
+
}
|
|
32701
|
+
function harnessCommandDisplayName(label) {
|
|
32702
|
+
const slug = label.trim().replace(/^\//u, "").replace(/^skill:/u, "");
|
|
32703
|
+
if (!slug || /\s/u.test(slug) || /[A-Z]/u.test(slug) || /[^\x00-\x7F]/u.test(slug)) {
|
|
32704
|
+
return (slug || label).replace(/\bcodexhost\b/giu, "BOFT");
|
|
32705
|
+
}
|
|
32706
|
+
const name = slug.split(":").filter(Boolean).at(-1) ?? slug;
|
|
32707
|
+
return name.split(/[-_.]+/u).filter(Boolean).map(menuTitleWord).join(" ");
|
|
32708
|
+
}
|
|
32709
|
+
var SVG_NS3 = "http://www.w3.org/2000/svg";
|
|
32710
|
+
function createSkillIcon(ownerDocument) {
|
|
32711
|
+
const svg = ownerDocument.createElementNS(SVG_NS3, "svg");
|
|
32712
|
+
svg.setAttribute("viewBox", "0 0 24 24");
|
|
32713
|
+
svg.setAttribute("fill", "none");
|
|
32714
|
+
svg.setAttribute("stroke", "currentColor");
|
|
32715
|
+
svg.setAttribute("stroke-width", "1.7");
|
|
32716
|
+
svg.setAttribute("stroke-linejoin", "round");
|
|
32717
|
+
svg.setAttribute("aria-hidden", "true");
|
|
32718
|
+
const path = ownerDocument.createElementNS(SVG_NS3, "path");
|
|
32719
|
+
path.setAttribute("d", "M12 3 20 7.5v9L12 21l-8-4.5v-9ZM4 7.5 12 12l8-4.5M12 12v9");
|
|
32720
|
+
svg.append(path);
|
|
32721
|
+
return svg;
|
|
32722
|
+
}
|
|
32723
|
+
function agentsTitle(locale) {
|
|
32724
|
+
return locale === "zh-CN" ? "\u59D4\u6D3E\u7ED9 Agent" : "Delegate to agent";
|
|
32725
|
+
}
|
|
32726
|
+
function commandsTitle(locale) {
|
|
32727
|
+
return locale === "zh-CN" ? "\u547D\u4EE4" : "Commands";
|
|
32728
|
+
}
|
|
32729
|
+
function skillsTitle(locale) {
|
|
32730
|
+
return locale === "zh-CN" ? "\u6280\u80FD" : "Skills";
|
|
32731
|
+
}
|
|
32732
|
+
function iconUrl(agent, ownerDocument) {
|
|
32733
|
+
const icon2 = createRendererAgentIcon(agent, 16, ownerDocument);
|
|
32734
|
+
if (icon2.tagName.toLowerCase() === "img") return icon2.src || null;
|
|
32735
|
+
const view = ownerDocument.defaultView;
|
|
32736
|
+
if (!view?.XMLSerializer) return null;
|
|
32737
|
+
const markup = new view.XMLSerializer().serializeToString(icon2).replaceAll("currentColor", "#808080");
|
|
32738
|
+
return `data:image/svg+xml;charset=utf-8,${encodeURIComponent(markup)}`;
|
|
32739
|
+
}
|
|
32740
|
+
function cssString(value) {
|
|
32741
|
+
return `"${value.replace(/["\\\n]/gu, (character) => `\\${character === "\n" ? "a " : character}`)}"`;
|
|
32742
|
+
}
|
|
32743
|
+
function syncChipStyle(ownerDocument, targets, cache) {
|
|
32744
|
+
let style = ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`);
|
|
32745
|
+
if (!style) {
|
|
32746
|
+
style = ownerDocument.createElement("style");
|
|
32747
|
+
style.setAttribute(STYLE_ATTRIBUTE4, "true");
|
|
32748
|
+
(ownerDocument.head ?? ownerDocument.documentElement).append(style);
|
|
32749
|
+
}
|
|
32750
|
+
const chip = [DELEGATION_MENTION_PATH_PREFIX, HARNESS_COMMAND_MENTION_PATH_PREFIX].map((prefix) => `[agent-mention-path^=${cssString(prefix)}][agent-mention-display-name]`).join(",");
|
|
32751
|
+
const withPseudo = (pseudo) => chip.split(",").map((selector) => `${selector}${pseudo}`).join(",");
|
|
32752
|
+
const rules = [
|
|
32753
|
+
withPseudo(" > span:last-child") + "{display:none;}",
|
|
32754
|
+
withPseudo("::after") + "{content:attr(agent-mention-display-name);}",
|
|
32755
|
+
...targets.flatMap(({ agent }) => {
|
|
32756
|
+
if (!cache.has(agent)) cache.set(agent, iconUrl(agent, ownerDocument));
|
|
32757
|
+
const url2 = cache.get(agent);
|
|
32758
|
+
if (!url2) return [];
|
|
32759
|
+
const selector = `[agent-mention-path=${cssString(delegationMentionPath(agent))}]::before`;
|
|
32760
|
+
return [
|
|
32761
|
+
`${selector}{content:"";display:inline-block;width:16px;height:16px;margin-inline-end:3px;vertical-align:-3px;background:url(${cssString(url2)}) center/contain no-repeat;}`
|
|
32762
|
+
];
|
|
32763
|
+
})
|
|
32764
|
+
];
|
|
32765
|
+
const text = rules.join("\n");
|
|
32766
|
+
if (style.textContent !== text) style.textContent = text;
|
|
32767
|
+
}
|
|
32768
|
+
function installRendererDelegationMention(ownerDocument, options) {
|
|
32769
|
+
const view = ownerDocument.defaultView;
|
|
32770
|
+
if (!view) {
|
|
32771
|
+
return { refresh: () => void 0, openFor: () => void 0, dispose: () => void 0 };
|
|
32772
|
+
}
|
|
32773
|
+
const iconCache = /* @__PURE__ */ new Map();
|
|
32774
|
+
const menu = ownerDocument.createElement("div");
|
|
32775
|
+
menu.setAttribute(MENU_ATTRIBUTE, "true");
|
|
32776
|
+
menu.className = MENU_CLASS;
|
|
32777
|
+
Object.assign(menu.style, {
|
|
32778
|
+
display: "none",
|
|
32779
|
+
position: "fixed",
|
|
32780
|
+
zIndex: "2147483647",
|
|
32781
|
+
maxHeight: `min(${MENU_MAX_HEIGHT}px, calc(100vh - ${VIEWPORT_MARGIN * 2}px))`,
|
|
32782
|
+
padding: "var(--spacing)"
|
|
32783
|
+
});
|
|
32784
|
+
const list = ownerDocument.createElement("div");
|
|
32785
|
+
list.className = LIST_CLASS;
|
|
32786
|
+
list.setAttribute("role", "listbox");
|
|
32787
|
+
menu.append(list);
|
|
32788
|
+
ownerDocument.body.append(menu);
|
|
32789
|
+
const isMenuOpen = () => menu.style.display !== "none";
|
|
32790
|
+
const setMenuOpen = (open) => {
|
|
32791
|
+
menu.style.display = open ? "flex" : "none";
|
|
32792
|
+
};
|
|
32793
|
+
let active = null;
|
|
32794
|
+
let entries = [];
|
|
32795
|
+
let activeIndex = 0;
|
|
32796
|
+
let composing = false;
|
|
32797
|
+
let inserting = false;
|
|
32798
|
+
let openedFor = null;
|
|
32799
|
+
let rowsRendered = 0;
|
|
32800
|
+
const close = () => {
|
|
32801
|
+
active = null;
|
|
32802
|
+
entries = [];
|
|
32803
|
+
setMenuOpen(false);
|
|
32804
|
+
list.replaceChildren();
|
|
32805
|
+
};
|
|
32806
|
+
const highlight = () => {
|
|
32807
|
+
[...list.querySelectorAll("[role=option]")].forEach((item, index) => {
|
|
32808
|
+
const selected = index === activeIndex;
|
|
32809
|
+
item.setAttribute("aria-selected", String(selected));
|
|
32810
|
+
for (const name of ROW_HIGHLIGHT_CLASSES) item.classList.toggle(name, selected);
|
|
32811
|
+
item.classList.toggle(ROW_IDLE_CLASS, !selected);
|
|
32812
|
+
if (selected) item.scrollIntoView({ block: "nearest" });
|
|
32813
|
+
});
|
|
32814
|
+
};
|
|
32815
|
+
const position = (trigger) => {
|
|
32816
|
+
const anchor = options.anchorForEditor(trigger.editor) ?? trigger.editor;
|
|
32817
|
+
const rect = anchor.getBoundingClientRect();
|
|
32818
|
+
const width = Math.min(rect.width, view.innerWidth - VIEWPORT_MARGIN * 2);
|
|
32819
|
+
const left = Math.max(
|
|
32820
|
+
VIEWPORT_MARGIN,
|
|
32821
|
+
Math.min(rect.left, view.innerWidth - width - VIEWPORT_MARGIN)
|
|
32822
|
+
);
|
|
32823
|
+
menu.style.width = `${width}px`;
|
|
32824
|
+
menu.style.left = `${left}px`;
|
|
32825
|
+
const height = menu.getBoundingClientRect().height;
|
|
32826
|
+
const above = rect.top >= height + MENU_GAP2 + VIEWPORT_MARGIN;
|
|
32827
|
+
menu.style.top = above ? `${rect.top - height - MENU_GAP2}px` : `${Math.min(view.innerHeight - height - VIEWPORT_MARGIN, rect.bottom + MENU_GAP2)}px`;
|
|
32828
|
+
};
|
|
32829
|
+
const sectionHeader = (title) => {
|
|
32830
|
+
const header = ownerDocument.createElement("div");
|
|
32831
|
+
header.className = `${HEADER_CLASS} flex items-center justify-between gap-2`;
|
|
32832
|
+
const label = ownerDocument.createElement("span");
|
|
32833
|
+
label.className = "min-w-0 truncate";
|
|
32834
|
+
label.textContent = title;
|
|
32835
|
+
const source = ownerDocument.createElement("span");
|
|
32836
|
+
source.className = "shrink-0 text-sm text-codex-description";
|
|
32837
|
+
source.setAttribute("data-codexhost-source", "");
|
|
32838
|
+
source.textContent = SOURCE_TAG;
|
|
32839
|
+
header.append(label, source);
|
|
32840
|
+
return header;
|
|
32841
|
+
};
|
|
32842
|
+
const rowContent = (leading, labelText, detailText) => {
|
|
32843
|
+
const content = ownerDocument.createElement("div");
|
|
32844
|
+
content.className = ROW_CONTENT_CLASS;
|
|
32845
|
+
if (leading) {
|
|
32846
|
+
leading.classList.add("icon-xs", "shrink-0");
|
|
32847
|
+
content.append(leading);
|
|
32848
|
+
}
|
|
32849
|
+
const label = ownerDocument.createElement("span");
|
|
32850
|
+
label.className = "min-w-0 shrink truncate";
|
|
32851
|
+
label.textContent = labelText;
|
|
32852
|
+
content.append(label);
|
|
32853
|
+
if (detailText) {
|
|
32854
|
+
const detail = ownerDocument.createElement("span");
|
|
32855
|
+
detail.className = "flex-1 truncate text-codex-description";
|
|
32856
|
+
detail.textContent = detailText;
|
|
32857
|
+
content.append(detail);
|
|
32858
|
+
}
|
|
32859
|
+
return content;
|
|
32860
|
+
};
|
|
32861
|
+
const optionRow = (entry, content) => {
|
|
32862
|
+
const index = entries.length;
|
|
32863
|
+
entries.push(entry);
|
|
32864
|
+
const item = ownerDocument.createElement("div");
|
|
32865
|
+
item.setAttribute("role", "option");
|
|
32866
|
+
item.className = ROW_CLASS;
|
|
32867
|
+
item.append(content);
|
|
32868
|
+
item.addEventListener("pointermove", () => {
|
|
32869
|
+
if (activeIndex === index) return;
|
|
32870
|
+
activeIndex = index;
|
|
32871
|
+
highlight();
|
|
32872
|
+
});
|
|
32873
|
+
item.addEventListener("mousedown", (event) => event.preventDefault());
|
|
32874
|
+
item.addEventListener("click", () => void choose(entry));
|
|
32875
|
+
return item;
|
|
32876
|
+
};
|
|
32877
|
+
const render = (trigger, commands, targets) => {
|
|
32878
|
+
const locale = options.readLocale();
|
|
32879
|
+
const rows = [];
|
|
32880
|
+
entries = [];
|
|
32881
|
+
if (targets.length > 0) {
|
|
32882
|
+
rows.push(sectionHeader(agentsTitle(locale)));
|
|
32883
|
+
for (const target of targets) {
|
|
32884
|
+
rows.push(
|
|
32885
|
+
optionRow(
|
|
32886
|
+
{ kind: "agent", target },
|
|
32887
|
+
rowContent(createRendererAgentIcon(target.agent, 16, ownerDocument), target.label, "")
|
|
32888
|
+
)
|
|
32889
|
+
);
|
|
32890
|
+
}
|
|
32891
|
+
}
|
|
32892
|
+
if (commands) {
|
|
32893
|
+
const groups = [
|
|
32894
|
+
[commandsTitle(locale), commands.matches.filter(({ kind }) => kind !== "skill")],
|
|
32895
|
+
[skillsTitle(locale), commands.matches.filter(({ kind }) => kind === "skill")]
|
|
32896
|
+
];
|
|
32897
|
+
for (const [title, group] of groups) {
|
|
32898
|
+
if (group.length === 0) continue;
|
|
32899
|
+
rows.push(sectionHeader(title));
|
|
32900
|
+
for (const command of group) {
|
|
32901
|
+
const reason = commands.source.disabledReason(command);
|
|
32902
|
+
const presentation = rendererHarnessCommandPresentation(command, locale);
|
|
32903
|
+
const content = rowContent(
|
|
32904
|
+
command.kind === "skill" ? createSkillIcon(ownerDocument) : createHarnessCommandIcon(ownerDocument),
|
|
32905
|
+
harnessCommandDisplayName(presentation.label),
|
|
32906
|
+
reason ?? presentation.description
|
|
32907
|
+
);
|
|
32908
|
+
content.setAttribute("data-command-id", command.id);
|
|
32909
|
+
if (reason === null) {
|
|
32910
|
+
rows.push(optionRow({ kind: "command", command, source: commands.source }, content));
|
|
32911
|
+
} else {
|
|
32912
|
+
const disabled = ownerDocument.createElement("div");
|
|
32913
|
+
disabled.setAttribute("aria-disabled", "true");
|
|
32914
|
+
disabled.className = `${ROW_CLASS} opacity-50`;
|
|
32915
|
+
disabled.append(content);
|
|
32916
|
+
rows.push(disabled);
|
|
32917
|
+
}
|
|
32918
|
+
}
|
|
32919
|
+
}
|
|
32920
|
+
}
|
|
32921
|
+
const notice = commands?.source.pendingNotice;
|
|
32922
|
+
if (notice && (rows.length > 0 || trigger.query === "")) {
|
|
32923
|
+
if (!rows.some((row) => row.querySelector("[data-command-id]"))) {
|
|
32924
|
+
rows.push(sectionHeader(commandsTitle(locale)));
|
|
32925
|
+
}
|
|
32926
|
+
const hint = ownerDocument.createElement("div");
|
|
32927
|
+
hint.setAttribute("data-codexhost-command-notice", "");
|
|
32928
|
+
hint.className = "px-row-x py-1.5 text-sm text-codex-description";
|
|
32929
|
+
hint.textContent = notice;
|
|
32930
|
+
rows.push(hint);
|
|
32931
|
+
}
|
|
32932
|
+
rowsRendered = rows.length;
|
|
32933
|
+
list.replaceChildren(...rows);
|
|
32934
|
+
activeIndex = Math.min(activeIndex, Math.max(0, entries.length - 1));
|
|
32935
|
+
setMenuOpen(true);
|
|
32936
|
+
highlight();
|
|
32937
|
+
position(trigger);
|
|
32938
|
+
};
|
|
32939
|
+
const readTrigger = () => {
|
|
32940
|
+
const selection = ownerDocument.getSelection();
|
|
32941
|
+
if (!selection?.isCollapsed || selection.rangeCount === 0) return null;
|
|
32942
|
+
const node = selection.anchorNode;
|
|
32943
|
+
if (!node || node.nodeType !== node.TEXT_NODE) return null;
|
|
32944
|
+
const editor = node.parentElement?.closest('[contenteditable="true"]');
|
|
32945
|
+
if (!editor || !options.isComposerEditor(editor)) return null;
|
|
32946
|
+
const text = node;
|
|
32947
|
+
const found = findDelegationTrigger(text.data.slice(0, selection.anchorOffset));
|
|
32948
|
+
if (!found) return null;
|
|
32949
|
+
return {
|
|
32950
|
+
editor,
|
|
32951
|
+
node: text,
|
|
32952
|
+
start: found.start,
|
|
32953
|
+
end: selection.anchorOffset,
|
|
32954
|
+
query: found.query
|
|
32955
|
+
};
|
|
32956
|
+
};
|
|
32957
|
+
const refresh = () => {
|
|
32958
|
+
if (inserting || composing) return;
|
|
32959
|
+
const trigger = readTrigger();
|
|
32960
|
+
if (!trigger) {
|
|
32961
|
+
openedFor = null;
|
|
32962
|
+
close();
|
|
32963
|
+
return;
|
|
32964
|
+
}
|
|
32965
|
+
if (openedFor?.node !== trigger.node || openedFor.start !== trigger.start) {
|
|
32966
|
+
openedFor = { node: trigger.node, start: trigger.start };
|
|
32967
|
+
options.onOpen?.(trigger.editor);
|
|
32968
|
+
}
|
|
32969
|
+
const allTargets = options.readTargets();
|
|
32970
|
+
syncChipStyle(ownerDocument, allTargets, iconCache);
|
|
32971
|
+
const targets = filterDelegationTargets(allTargets, trigger.query);
|
|
32972
|
+
const source = options.readCommands(trigger.editor);
|
|
32973
|
+
const commandMatches = source ? filterDelegationCommands(source.commands, trigger.query) : [];
|
|
32974
|
+
const showsNotice = Boolean(source?.pendingNotice) && trigger.query === "";
|
|
32975
|
+
if (targets.length === 0 && commandMatches.length === 0 && !showsNotice) {
|
|
32976
|
+
close();
|
|
32977
|
+
return;
|
|
32978
|
+
}
|
|
32979
|
+
const sameQuery = active?.query === trigger.query && active.node === trigger.node;
|
|
32980
|
+
active = trigger;
|
|
32981
|
+
if (!sameQuery) activeIndex = 0;
|
|
32982
|
+
render(trigger, source ? { source, matches: commandMatches } : null, targets);
|
|
32983
|
+
if (rowsRendered === 0) close();
|
|
32984
|
+
};
|
|
32985
|
+
const waitForSelectionSync = () => new Promise((resolve) => view.setTimeout(resolve, 0));
|
|
32986
|
+
const selectTriggerText = async (trigger) => {
|
|
32987
|
+
const selection = ownerDocument.getSelection();
|
|
32988
|
+
if (!selection) return false;
|
|
32989
|
+
const range = ownerDocument.createRange();
|
|
32990
|
+
range.setStart(trigger.node, trigger.start);
|
|
32991
|
+
range.setEnd(trigger.node, trigger.end);
|
|
32992
|
+
trigger.editor.focus({ preventScroll: true });
|
|
32993
|
+
selection.removeAllRanges();
|
|
32994
|
+
selection.addRange(range);
|
|
32995
|
+
await waitForSelectionSync();
|
|
32996
|
+
return true;
|
|
32997
|
+
};
|
|
32998
|
+
const insertAgent = async (trigger, range, target) => {
|
|
32999
|
+
const path = delegationMentionPath(target.agent);
|
|
33000
|
+
if (insertNativeAgentMention(trigger.editor, range, {
|
|
33001
|
+
name: target.label,
|
|
33002
|
+
displayName: target.label,
|
|
33003
|
+
path
|
|
33004
|
+
})) {
|
|
33005
|
+
return;
|
|
33006
|
+
}
|
|
33007
|
+
if (!await selectTriggerText(trigger)) return;
|
|
33008
|
+
const carrier = `${formatDelegationMentionLink({ harnessId: target.agent, label: target.label })} `;
|
|
33009
|
+
const pasted = dispatchPlainTextPaste(trigger.editor, carrier);
|
|
33010
|
+
if (!pasted) ownerDocument.execCommand("insertText", false, carrier);
|
|
33011
|
+
};
|
|
33012
|
+
const runCommand = async (trigger, range, entry) => {
|
|
33013
|
+
const { command, source } = entry;
|
|
33014
|
+
if (!rendererHarnessCommandExecutesDirectly(command)) {
|
|
33015
|
+
let path = null;
|
|
33016
|
+
try {
|
|
33017
|
+
path = harnessCommandMentionPath(command.invocation);
|
|
33018
|
+
} catch {
|
|
33019
|
+
path = null;
|
|
33020
|
+
}
|
|
33021
|
+
if (path && insertNativeAgentMention(trigger.editor, range, {
|
|
33022
|
+
name: command.invocation,
|
|
33023
|
+
displayName: command.invocation,
|
|
33024
|
+
path
|
|
33025
|
+
})) {
|
|
33026
|
+
return;
|
|
33027
|
+
}
|
|
33028
|
+
}
|
|
33029
|
+
if (!deleteNativeRange(trigger.editor, range)) {
|
|
33030
|
+
if (!await selectTriggerText(trigger)) return;
|
|
33031
|
+
ownerDocument.execCommand("delete");
|
|
33032
|
+
}
|
|
33033
|
+
source.select(command);
|
|
33034
|
+
};
|
|
33035
|
+
const choose = async (entry) => {
|
|
33036
|
+
const trigger = active;
|
|
33037
|
+
close();
|
|
33038
|
+
if (!trigger || !trigger.node.isConnected) return;
|
|
33039
|
+
const expected = `#${trigger.query}`;
|
|
33040
|
+
if (trigger.node.data.slice(trigger.start, trigger.end) !== expected) return;
|
|
33041
|
+
const range = { node: trigger.node, start: trigger.start, end: trigger.end, expected };
|
|
33042
|
+
inserting = true;
|
|
33043
|
+
try {
|
|
33044
|
+
if (entry.kind === "agent") await insertAgent(trigger, range, entry.target);
|
|
33045
|
+
else await runCommand(trigger, range, entry);
|
|
33046
|
+
} finally {
|
|
33047
|
+
inserting = false;
|
|
33048
|
+
}
|
|
33049
|
+
};
|
|
33050
|
+
const onKeyDown = (event) => {
|
|
33051
|
+
if (!isMenuOpen() || !active || event.isComposing) return;
|
|
33052
|
+
if (entries.length === 0 && event.key !== "Escape") return;
|
|
33053
|
+
let handled = true;
|
|
33054
|
+
if (event.key === "ArrowDown") activeIndex = (activeIndex + 1) % entries.length;
|
|
33055
|
+
else if (event.key === "ArrowUp") {
|
|
33056
|
+
activeIndex = (activeIndex - 1 + entries.length) % entries.length;
|
|
33057
|
+
} else if (event.key === "Enter" || event.key === "Tab") {
|
|
33058
|
+
const entry = entries[activeIndex];
|
|
33059
|
+
if (entry) void choose(entry);
|
|
33060
|
+
} else if (event.key === "Escape") close();
|
|
33061
|
+
else handled = false;
|
|
33062
|
+
if (!handled) return;
|
|
33063
|
+
event.preventDefault();
|
|
33064
|
+
event.stopImmediatePropagation();
|
|
33065
|
+
if (isMenuOpen()) highlight();
|
|
33066
|
+
};
|
|
33067
|
+
const onCompositionStart = () => {
|
|
33068
|
+
composing = true;
|
|
33069
|
+
};
|
|
33070
|
+
const onCompositionEnd = () => {
|
|
33071
|
+
composing = false;
|
|
33072
|
+
refresh();
|
|
33073
|
+
};
|
|
33074
|
+
const onPointerDown = (event) => {
|
|
33075
|
+
if (isMenuOpen() && !menu.contains(event.target)) close();
|
|
33076
|
+
};
|
|
33077
|
+
const onViewportChange = () => {
|
|
33078
|
+
if (active && isMenuOpen()) position(active);
|
|
33079
|
+
};
|
|
33080
|
+
view.addEventListener("keydown", onKeyDown, true);
|
|
33081
|
+
ownerDocument.addEventListener("input", refresh, true);
|
|
33082
|
+
ownerDocument.addEventListener("selectionchange", refresh);
|
|
33083
|
+
ownerDocument.addEventListener("compositionstart", onCompositionStart, true);
|
|
33084
|
+
ownerDocument.addEventListener("compositionend", onCompositionEnd, true);
|
|
33085
|
+
ownerDocument.addEventListener("pointerdown", onPointerDown, true);
|
|
33086
|
+
view.addEventListener("resize", onViewportChange);
|
|
33087
|
+
view.addEventListener("scroll", onViewportChange, true);
|
|
33088
|
+
const dispose = () => {
|
|
33089
|
+
view.removeEventListener("keydown", onKeyDown, true);
|
|
33090
|
+
ownerDocument.removeEventListener("input", refresh, true);
|
|
33091
|
+
ownerDocument.removeEventListener("selectionchange", refresh);
|
|
33092
|
+
ownerDocument.removeEventListener("compositionstart", onCompositionStart, true);
|
|
33093
|
+
ownerDocument.removeEventListener("compositionend", onCompositionEnd, true);
|
|
33094
|
+
ownerDocument.removeEventListener("pointerdown", onPointerDown, true);
|
|
33095
|
+
view.removeEventListener("resize", onViewportChange);
|
|
33096
|
+
view.removeEventListener("scroll", onViewportChange, true);
|
|
33097
|
+
menu.remove();
|
|
33098
|
+
ownerDocument.querySelector(`style[${STYLE_ATTRIBUTE4}]`)?.remove();
|
|
33099
|
+
};
|
|
33100
|
+
const openFor = (editor) => {
|
|
33101
|
+
editor.focus({ preventScroll: true });
|
|
33102
|
+
const trigger = (previous2) => previous2 && !/\s/u.test(previous2) ? " #" : "#";
|
|
33103
|
+
if (insertNativeTextAtSelection(editor, trigger)) return;
|
|
33104
|
+
const selection = ownerDocument.getSelection();
|
|
33105
|
+
const node = selection?.anchorNode;
|
|
33106
|
+
const previous = node?.nodeType === node?.TEXT_NODE && selection && selection.anchorOffset > 0 ? node.data.charAt(selection.anchorOffset - 1) : "";
|
|
33107
|
+
ownerDocument.execCommand("insertText", false, trigger(previous));
|
|
33108
|
+
};
|
|
33109
|
+
return {
|
|
33110
|
+
openFor,
|
|
33111
|
+
refresh: () => {
|
|
33112
|
+
if (openedFor) refresh();
|
|
33113
|
+
},
|
|
33114
|
+
dispose
|
|
33115
|
+
};
|
|
33116
|
+
}
|
|
33117
|
+
function dispatchPlainTextPaste(editor, text) {
|
|
33118
|
+
const view = editor.ownerDocument.defaultView;
|
|
33119
|
+
if (!view?.DataTransfer || !view.ClipboardEvent) return false;
|
|
33120
|
+
const data = new view.DataTransfer();
|
|
33121
|
+
data.setData("text/plain", text);
|
|
33122
|
+
const event = new view.ClipboardEvent("paste", {
|
|
33123
|
+
bubbles: true,
|
|
33124
|
+
cancelable: true,
|
|
33125
|
+
clipboardData: data
|
|
33126
|
+
});
|
|
33127
|
+
editor.dispatchEvent(event);
|
|
33128
|
+
return event.defaultPrevented;
|
|
33129
|
+
}
|
|
33130
|
+
|
|
32379
33131
|
// src/renderer-binding-probe.ts
|
|
32380
33132
|
var externalHarnessIds = {
|
|
32381
33133
|
pi: harnessIdSchema.parse("pi"),
|
|
@@ -32392,7 +33144,8 @@ ${accounts_default}`;
|
|
|
32392
33144
|
workbuddy: harnessIdSchema.parse("workbuddy"),
|
|
32393
33145
|
"cursor-cli": harnessIdSchema.parse("cursor-cli"),
|
|
32394
33146
|
qoder: harnessIdSchema.parse("qoder"),
|
|
32395
|
-
"qoder-cn": harnessIdSchema.parse("qoder-cn")
|
|
33147
|
+
"qoder-cn": harnessIdSchema.parse("qoder-cn"),
|
|
33148
|
+
"kimi-code": harnessIdSchema.parse("kimi-code")
|
|
32396
33149
|
};
|
|
32397
33150
|
var externalAgents = [
|
|
32398
33151
|
"pi",
|
|
@@ -32409,7 +33162,8 @@ ${accounts_default}`;
|
|
|
32409
33162
|
"workbuddy",
|
|
32410
33163
|
"cursor-cli",
|
|
32411
33164
|
"qoder",
|
|
32412
|
-
"qoder-cn"
|
|
33165
|
+
"qoder-cn",
|
|
33166
|
+
"kimi-code"
|
|
32413
33167
|
];
|
|
32414
33168
|
function isRetryableHarnessAvailability(availability, error51) {
|
|
32415
33169
|
return availability !== void 0 && availability !== "ready" && availability !== "notInstalled" && error51?.retryable === true;
|
|
@@ -32808,7 +33562,8 @@ ${accounts_default}`;
|
|
|
32808
33562
|
workbuddy: void 0,
|
|
32809
33563
|
"cursor-cli": void 0,
|
|
32810
33564
|
qoder: void 0,
|
|
32811
|
-
"qoder-cn": void 0
|
|
33565
|
+
"qoder-cn": void 0,
|
|
33566
|
+
"kimi-code": void 0
|
|
32812
33567
|
},
|
|
32813
33568
|
webUi: Object.fromEntries(
|
|
32814
33569
|
externalAgents.map((agent) => [agent, false])
|
|
@@ -32885,12 +33640,16 @@ ${accounts_default}`;
|
|
|
32885
33640
|
})
|
|
32886
33641
|
);
|
|
32887
33642
|
};
|
|
33643
|
+
const showCodexUsageGateStatus = (mounted, status) => {
|
|
33644
|
+
const title = status === "unsupported" ? rendererHarnessMessages(settingsLifecycle.locale).codexUsageGateUnavailable : "";
|
|
33645
|
+
if (mounted.control.root.title !== title) mounted.control.root.title = title;
|
|
33646
|
+
};
|
|
32888
33647
|
const renderMounted = (mounted) => {
|
|
32889
33648
|
const accounts = composerCodexAccounts(mounted.composer);
|
|
32890
33649
|
const currentCodexAccount = accounts?.accounts.find(
|
|
32891
33650
|
({ accountId }) => accountId === accounts.readyAccountId
|
|
32892
33651
|
);
|
|
32893
|
-
renderComposerAgentControl(
|
|
33652
|
+
const externalSubmissionReady = renderComposerAgentControl(
|
|
32894
33653
|
mounted.control,
|
|
32895
33654
|
controller.get(mounted.composer),
|
|
32896
33655
|
adapterStatus.state,
|
|
@@ -32904,6 +33663,7 @@ ${accounts_default}`;
|
|
|
32904
33663
|
currentCodexAccount ?? null,
|
|
32905
33664
|
mounted.ownershipStatus === "error"
|
|
32906
33665
|
);
|
|
33666
|
+
showCodexUsageGateStatus(mounted, mounted.codexUsageGate.update(externalSubmissionReady));
|
|
32907
33667
|
if (mounted.control.usage) {
|
|
32908
33668
|
mounted.control.usage.onOpen = () => {
|
|
32909
33669
|
void refreshThreadUsage(
|
|
@@ -32913,22 +33673,38 @@ ${accounts_default}`;
|
|
|
32913
33673
|
};
|
|
32914
33674
|
}
|
|
32915
33675
|
};
|
|
32916
|
-
|
|
33676
|
+
let delegationMention = null;
|
|
33677
|
+
const draftWorkspaces = /* @__PURE__ */ new Map();
|
|
33678
|
+
{
|
|
33679
|
+
const published = Reflect.get(window, "__codexhostDraftWorkspacesV1");
|
|
33680
|
+
if (typeof published === "object" && published !== null) {
|
|
33681
|
+
for (const [hostId, cwd] of Object.entries(published)) {
|
|
33682
|
+
if (typeof cwd === "string" && cwd.length > 0) draftWorkspaces.set(hostId, cwd);
|
|
33683
|
+
}
|
|
33684
|
+
}
|
|
33685
|
+
}
|
|
33686
|
+
const refreshCommands = async (mounted, { keepCurrent = false } = {}) => {
|
|
32917
33687
|
const generation = ++mounted.commandRequestGeneration;
|
|
32918
33688
|
const agent = controller.get(mounted.composer).agent;
|
|
32919
|
-
const
|
|
33689
|
+
const threadId = threadIdFromComposerModelTarget(mounted.modelTarget);
|
|
33690
|
+
const hostId = threadId ? mounted.hostId : activeModelHostId();
|
|
32920
33691
|
const requestControl = modelControl;
|
|
32921
33692
|
const client = modelClientForHostFrom(requestControl, hostId);
|
|
32922
|
-
mounted.control.harnessCommands.setCommands([]);
|
|
33693
|
+
if (!keepCurrent || agent === "codex") mounted.control.harnessCommands.setCommands([]);
|
|
32923
33694
|
if (agent === "codex" || !client) return;
|
|
32924
33695
|
try {
|
|
32925
|
-
const catalog = await client.
|
|
33696
|
+
const catalog = threadId ? await client.inspectThreadCommands({ threadId }) : await client.inspectHarnessCommands({
|
|
33697
|
+
harnessId: externalHarnessIds[agent],
|
|
33698
|
+
...hostId && draftWorkspaces.has(hostId) ? { cwd: draftWorkspaces.get(hostId) } : {}
|
|
33699
|
+
});
|
|
32926
33700
|
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)
|
|
32927
33701
|
return;
|
|
32928
33702
|
mounted.control.harnessCommands.setCommands(
|
|
32929
33703
|
catalog.commands,
|
|
32930
|
-
threadIdFromComposerModelTarget(mounted.modelTarget) !== null
|
|
33704
|
+
threadIdFromComposerModelTarget(mounted.modelTarget) !== null,
|
|
33705
|
+
catalog.source
|
|
32931
33706
|
);
|
|
33707
|
+
delegationMention?.refresh();
|
|
32932
33708
|
} catch {
|
|
32933
33709
|
}
|
|
32934
33710
|
};
|
|
@@ -34136,15 +34912,16 @@ ${accounts_default}`;
|
|
|
34136
34912
|
if (!composer.isConnected || !mounted2) return;
|
|
34137
34913
|
void selectPermissionMode(mounted2, permissionModeId);
|
|
34138
34914
|
},
|
|
34139
|
-
(
|
|
34140
|
-
const
|
|
34141
|
-
if (
|
|
34915
|
+
() => {
|
|
34916
|
+
const editor2 = composer.querySelector(EDITOR_SELECTOR);
|
|
34917
|
+
if (editor2) delegationMention?.openFor(editor2);
|
|
34142
34918
|
}
|
|
34143
34919
|
);
|
|
34144
34920
|
const mounted = {
|
|
34145
34921
|
composer,
|
|
34146
34922
|
composerId: state.composerId,
|
|
34147
34923
|
control,
|
|
34924
|
+
codexUsageGate: createRendererCodexUsageGate(composer),
|
|
34148
34925
|
modelTarget,
|
|
34149
34926
|
modelView: inherited?.modelView ?? { status: "idle" },
|
|
34150
34927
|
permissionModeView: inherited?.permissionModeView ?? { status: "idle" },
|
|
@@ -34204,6 +34981,7 @@ ${accounts_default}`;
|
|
|
34204
34981
|
window.clearTimeout(timer);
|
|
34205
34982
|
usageRefreshTimers.delete(composer);
|
|
34206
34983
|
}
|
|
34984
|
+
mounted.codexUsageGate.dispose();
|
|
34207
34985
|
disposeComposerAgentControl(mounted.control);
|
|
34208
34986
|
mountedByComposer.delete(composer);
|
|
34209
34987
|
continue;
|
|
@@ -34212,6 +34990,7 @@ ${accounts_default}`;
|
|
|
34212
34990
|
const hideCodexControls = controller.isSwitching(composer) || state.agent !== "codex";
|
|
34213
34991
|
reconcileComposerNativeControls(mounted.control, hideCodexControls, hideCodexControls);
|
|
34214
34992
|
if (refreshTargets) refreshMountedConversationTarget(mounted);
|
|
34993
|
+
showCodexUsageGateStatus(mounted, mounted.codexUsageGate.refresh());
|
|
34215
34994
|
}
|
|
34216
34995
|
for (const editor of document.querySelectorAll(EDITOR_SELECTOR)) {
|
|
34217
34996
|
const composer = composerForEditor(editor);
|
|
@@ -34361,7 +35140,7 @@ ${accounts_default}`;
|
|
|
34361
35140
|
const candidate = composerForElement(button);
|
|
34362
35141
|
const composer = candidate && isMountedComposer(candidate) ? candidate : null;
|
|
34363
35142
|
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
34364
|
-
if (!composer || mounted
|
|
35143
|
+
if (!composer || !mounted || refreshSendButton(mounted.control) !== button) return;
|
|
34365
35144
|
if (!prepareComposer(composer)) {
|
|
34366
35145
|
blockEvent(event);
|
|
34367
35146
|
return;
|
|
@@ -34434,9 +35213,63 @@ ${accounts_default}`;
|
|
|
34434
35213
|
void refreshHarnessAvailability(true);
|
|
34435
35214
|
}
|
|
34436
35215
|
};
|
|
35216
|
+
const onDraftWorkspace = (event) => {
|
|
35217
|
+
const detail = event.detail;
|
|
35218
|
+
if (typeof detail !== "object" || detail === null) return;
|
|
35219
|
+
const { hostId, cwd } = detail;
|
|
35220
|
+
if (typeof hostId !== "string" || typeof cwd !== "string" || cwd.length === 0) return;
|
|
35221
|
+
draftWorkspaces.set(hostId, cwd);
|
|
35222
|
+
for (const mounted of mountedByComposer.values()) {
|
|
35223
|
+
if (!threadIdFromComposerModelTarget(mounted.modelTarget) && activeModelHostId() === hostId && controller.get(mounted.composer).agent !== "codex") {
|
|
35224
|
+
void refreshCommands(mounted, { keepCurrent: true });
|
|
35225
|
+
}
|
|
35226
|
+
}
|
|
35227
|
+
};
|
|
34437
35228
|
window.addEventListener("codexhost:draft-prewarm-policy-changed", onHostRouteChange);
|
|
35229
|
+
window.addEventListener("codexhost:draft-workspace", onDraftWorkspace);
|
|
34438
35230
|
window.addEventListener("codexhost:renderer-adapter-status", onAdapterStatus);
|
|
34439
35231
|
window.addEventListener("focus", onWindowFocus);
|
|
35232
|
+
delegationMention = installRendererDelegationMention(document, {
|
|
35233
|
+
onOpen: (editor) => {
|
|
35234
|
+
const composer = composerForElement(editor);
|
|
35235
|
+
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
35236
|
+
if (mounted && controller.get(mounted.composer).agent !== "codex") {
|
|
35237
|
+
void refreshCommands(mounted, { keepCurrent: true });
|
|
35238
|
+
}
|
|
35239
|
+
},
|
|
35240
|
+
readTargets: () => {
|
|
35241
|
+
const availability = activeHarnessAvailabilityState().availability;
|
|
35242
|
+
return enabledAgents.filter((agent) => agent === "codex" || availability[agent] === "ready").map((agent) => ({ agent, label: RENDERER_AGENT_LABELS[agent] }));
|
|
35243
|
+
},
|
|
35244
|
+
isComposerEditor: (editor) => {
|
|
35245
|
+
const composer = composerForElement(editor);
|
|
35246
|
+
return composer !== null && mountedByComposer.has(composer);
|
|
35247
|
+
},
|
|
35248
|
+
readLocale: () => settingsLifecycle.locale,
|
|
35249
|
+
// Desktop's own suggestion menu hugs the input card and covers the
|
|
35250
|
+
// top tray (workspace / branch bar), so anchor to the card when present.
|
|
35251
|
+
anchorForEditor: (editor) => editor.closest("[data-composer-body]") ?? composerForElement(editor),
|
|
35252
|
+
readCommands: (editor) => {
|
|
35253
|
+
const composer = composerForElement(editor);
|
|
35254
|
+
const mounted = composer ? mountedByComposer.get(composer) : void 0;
|
|
35255
|
+
if (!mounted || controller.get(mounted.composer).agent === "codex") return null;
|
|
35256
|
+
const { commands, hasSession, executingCommandId, source } = mounted.control.harnessCommands.snapshot();
|
|
35257
|
+
if (executingCommandId !== null) return null;
|
|
35258
|
+
const messages = rendererHarnessMessages(settingsLifecycle.locale);
|
|
35259
|
+
const agent = controller.get(mounted.composer).agent;
|
|
35260
|
+
const pendingNotice = source === "static" ? rendererLiveCommandsPendingNotice(
|
|
35261
|
+
settingsLifecycle.locale,
|
|
35262
|
+
RENDERER_AGENT_LABELS[agent]
|
|
35263
|
+
) : null;
|
|
35264
|
+
if (commands.length === 0 && pendingNotice === null) return null;
|
|
35265
|
+
return {
|
|
35266
|
+
commands,
|
|
35267
|
+
pendingNotice,
|
|
35268
|
+
disabledReason: (command) => !hasSession && rendererHarnessCommandExecutesDirectly(command) ? messages.commandRequiresConversation : null,
|
|
35269
|
+
select: (command) => selectCommand(mounted, command)
|
|
35270
|
+
};
|
|
35271
|
+
}
|
|
35272
|
+
});
|
|
34440
35273
|
const connectedComposers = () => [...mountedByComposer.values()].filter(
|
|
34441
35274
|
(mounted) => mounted.composer.isConnected && mounted.control.root.isConnected
|
|
34442
35275
|
);
|
|
@@ -34542,6 +35375,7 @@ ${accounts_default}`;
|
|
|
34542
35375
|
modelControl = null;
|
|
34543
35376
|
mutationObserver.disconnect();
|
|
34544
35377
|
disposeReasoningSoftWrap();
|
|
35378
|
+
delegationMention?.dispose();
|
|
34545
35379
|
sidebarAgentIcons.dispose();
|
|
34546
35380
|
stopSidebarExternalPinning();
|
|
34547
35381
|
settingsLifecycle.dispose();
|
|
@@ -34550,6 +35384,7 @@ ${accounts_default}`;
|
|
|
34550
35384
|
document.removeEventListener("keydown", onKeyDown, true);
|
|
34551
35385
|
document.removeEventListener("click", onClick, true);
|
|
34552
35386
|
window.removeEventListener("codexhost:draft-prewarm-policy-changed", onHostRouteChange);
|
|
35387
|
+
window.removeEventListener("codexhost:draft-workspace", onDraftWorkspace);
|
|
34553
35388
|
window.removeEventListener("codexhost:renderer-adapter-status", onAdapterStatus);
|
|
34554
35389
|
window.removeEventListener("focus", onWindowFocus);
|
|
34555
35390
|
for (const state of harnessAvailabilityByHost.values()) {
|
|
@@ -34563,6 +35398,7 @@ ${accounts_default}`;
|
|
|
34563
35398
|
for (const mounted of mountedByComposer.values()) {
|
|
34564
35399
|
mounted.usageRequestGeneration += 1;
|
|
34565
35400
|
usageRefreshAttempts.delete(mounted.composer);
|
|
35401
|
+
mounted.codexUsageGate.dispose();
|
|
34566
35402
|
disposeComposerAgentControl(mounted.control);
|
|
34567
35403
|
}
|
|
34568
35404
|
mountedByComposer.clear();
|