@karlorz/codexhost-cli-win32-x64 0.14.0-2 → 0.14.0-4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +62 -6
- package/app/console-web.js +90 -34
- package/app/cpa-live-voice-hook.js +123 -30
- package/app/desktop-controller.mjs +60 -3
- package/app/host-runtime.mjs +621 -405
- package/app/plugins/antigravity/plugin.mjs +62 -3
- package/app/plugins/claude-code/plugin.mjs +83 -24
- package/app/plugins/codebuddy/plugin.mjs +80 -21
- package/app/plugins/codex-usage/plugin.mjs +84 -28
- package/app/plugins/copilot/plugin.mjs +112 -53
- package/app/plugins/cursor-cli/plugin.mjs +80 -21
- package/app/plugins/deepseek-harness/plugin.mjs +91 -32
- package/app/plugins/grok/plugin.mjs +411 -87
- package/app/plugins/hermes/plugin.mjs +62 -3
- package/app/plugins/kimi-code/plugin.mjs +74 -15
- package/app/plugins/kiro-cli/plugin.mjs +74 -15
- package/app/plugins/omp/plugin.mjs +94 -35
- package/app/plugins/opencode/plugin.mjs +116 -57
- package/app/plugins/pi/plugin.mjs +96 -37
- package/app/plugins/qoder/plugin.mjs +84 -25
- package/app/plugins/qoder-cn/plugin.mjs +84 -25
- package/app/plugins/workbuddy/plugin.mjs +80 -21
- package/app/plugins/zcode/plugin.mjs +85 -26
- package/app/renderer-extension.js +884 -158
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -3035,10 +3035,10 @@
|
|
|
3035
3035
|
const shape = def.shape;
|
|
3036
3036
|
const propValues = {};
|
|
3037
3037
|
for (const key in shape) {
|
|
3038
|
-
const
|
|
3039
|
-
if (
|
|
3038
|
+
const field2 = shape[key]._zod;
|
|
3039
|
+
if (field2.values) {
|
|
3040
3040
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3041
|
-
for (const v of
|
|
3041
|
+
for (const v of field2.values)
|
|
3042
3042
|
propValues[key].add(v);
|
|
3043
3043
|
}
|
|
3044
3044
|
}
|
|
@@ -14928,6 +14928,65 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14928
14928
|
// ../shared-contracts/dist/version.js
|
|
14929
14929
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14930
14930
|
|
|
14931
|
+
// ../shared-contracts/dist/thread-questions.js
|
|
14932
|
+
var THREAD_QUESTIONS_LIST_METHOD = "codexhost/thread/questions/list";
|
|
14933
|
+
var THREAD_QUESTION_RESPOND_METHOD = "codexhost/thread/question/respond";
|
|
14934
|
+
var THREAD_QUESTION_ACTIVITY_METHOD = "codexhost/thread/question/activity";
|
|
14935
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
14936
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
14937
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
14938
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
14939
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
14940
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
14941
|
+
});
|
|
14942
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
14943
|
+
interactionId: hostInteractionIdSchema,
|
|
14944
|
+
turnId: hostTurnIdSchema,
|
|
14945
|
+
title: external_exports.string().optional(),
|
|
14946
|
+
expiresAt: external_exports.string().optional(),
|
|
14947
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
14948
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
14949
|
+
external_exports.strictObject({
|
|
14950
|
+
...field,
|
|
14951
|
+
type: external_exports.literal("choice"),
|
|
14952
|
+
multiple: external_exports.boolean(),
|
|
14953
|
+
allowOther: external_exports.boolean(),
|
|
14954
|
+
options: external_exports.array(external_exports.strictObject({
|
|
14955
|
+
value: external_exports.string().min(1),
|
|
14956
|
+
label: external_exports.string(),
|
|
14957
|
+
description: external_exports.string().optional()
|
|
14958
|
+
})).min(1)
|
|
14959
|
+
}),
|
|
14960
|
+
external_exports.strictObject({
|
|
14961
|
+
...field,
|
|
14962
|
+
type: external_exports.literal("text"),
|
|
14963
|
+
multiline: external_exports.boolean(),
|
|
14964
|
+
secret: external_exports.literal(false),
|
|
14965
|
+
placeholder: external_exports.string().optional(),
|
|
14966
|
+
prefill: external_exports.string().optional()
|
|
14967
|
+
})
|
|
14968
|
+
])).min(1)
|
|
14969
|
+
});
|
|
14970
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
14971
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
14972
|
+
});
|
|
14973
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
14974
|
+
threadId: hostThreadIdSchema,
|
|
14975
|
+
interactionId: hostInteractionIdSchema,
|
|
14976
|
+
turnId: hostTurnIdSchema,
|
|
14977
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
14978
|
+
cancelled: external_exports.boolean().optional()
|
|
14979
|
+
});
|
|
14980
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
14981
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
14982
|
+
threadId: hostThreadIdSchema,
|
|
14983
|
+
interactionId: hostInteractionIdSchema,
|
|
14984
|
+
turnId: hostTurnIdSchema
|
|
14985
|
+
});
|
|
14986
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
14987
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
14988
|
+
});
|
|
14989
|
+
|
|
14931
14990
|
// ../shared-contracts/dist/idle-release.js
|
|
14932
14991
|
var IDLE_RELEASE_SETTINGS_METHOD = "codexhost/settings/idle-release/set";
|
|
14933
14992
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
@@ -16288,6 +16347,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16288
16347
|
enabled: true,
|
|
16289
16348
|
auditedDesktopVersion: value.auditedDesktopVersion,
|
|
16290
16349
|
auditedAppInitialAsset: value.auditedAppInitialAsset,
|
|
16350
|
+
...typeof value.desktopPlatform === "string" ? { desktopPlatform: value.desktopPlatform } : {},
|
|
16291
16351
|
...typeof value.desktopVersion === "string" ? { desktopVersion: value.desktopVersion } : {}
|
|
16292
16352
|
};
|
|
16293
16353
|
}
|
|
@@ -16414,21 +16474,20 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16414
16474
|
function supportsVoiceVersion(profiles, version2) {
|
|
16415
16475
|
return version2 === void 0 || profiles.some((profile) => profile.version === version2);
|
|
16416
16476
|
}
|
|
16417
|
-
function selectVoiceAssets(profiles, names, version2) {
|
|
16477
|
+
function selectVoiceAssets(profiles, names, version2, platform) {
|
|
16418
16478
|
const present = profiles.filter(
|
|
16419
|
-
(
|
|
16479
|
+
(profile) => [profile.initial, profile.shared].some((asset) => auditedAppInitialAssetPresent(names, asset))
|
|
16420
16480
|
);
|
|
16421
|
-
|
|
16422
|
-
|
|
16423
|
-
|
|
16424
|
-
|
|
16425
|
-
const complete = [profile2.initial, profile2.shared].every(
|
|
16481
|
+
const matchesMetadata = (profile) => (version2 === void 0 || profile.version === version2) && (platform === void 0 || profile.platform === platform);
|
|
16482
|
+
if (present.length > 0) {
|
|
16483
|
+
const profile = present.length === 1 ? present[0] : void 0;
|
|
16484
|
+
return profile && matchesMetadata(profile) && [profile.initial, profile.shared].every(
|
|
16426
16485
|
(asset) => auditedAppInitialAssetPresent(names, asset)
|
|
16427
|
-
);
|
|
16428
|
-
return complete || present.length === 0 ? profile2 : void 0;
|
|
16486
|
+
) ? profile : void 0;
|
|
16429
16487
|
}
|
|
16430
|
-
|
|
16431
|
-
|
|
16488
|
+
if (version2 === void 0) return void 0;
|
|
16489
|
+
const candidates = profiles.filter(matchesMetadata);
|
|
16490
|
+
return candidates.length === 1 ? candidates[0] : void 0;
|
|
16432
16491
|
}
|
|
16433
16492
|
|
|
16434
16493
|
// src/renderer-native-chat-voice-assets.ts
|
|
@@ -16437,6 +16496,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16437
16496
|
var START_ASSET = "entity-business-profile-reference-b68063dfc05d.js";
|
|
16438
16497
|
var NATIVE_CHAT_VOICE_ASSETS = [
|
|
16439
16498
|
{
|
|
16499
|
+
platform: "darwin",
|
|
16440
16500
|
version: NATIVE_CHAT_VOICE_VERSION,
|
|
16441
16501
|
initial: NATIVE_CHAT_INITIAL_ASSET,
|
|
16442
16502
|
shared: "app-shared-2cae01273bae.js",
|
|
@@ -16446,6 +16506,17 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16446
16506
|
settings: "voice-settings-14000f5c9fc2.js"
|
|
16447
16507
|
},
|
|
16448
16508
|
{
|
|
16509
|
+
platform: "win32",
|
|
16510
|
+
version: NATIVE_CHAT_VOICE_VERSION,
|
|
16511
|
+
initial: "app-initial-438d1df57f70.js",
|
|
16512
|
+
shared: "app-shared-955d52676f9c.js",
|
|
16513
|
+
primary: "app-primary-844e405f2b90.js",
|
|
16514
|
+
start: "entity-business-profile-reference-241c52d811f4.js",
|
|
16515
|
+
prewarm: "voice-prewarm-8b47c50a17ae.js",
|
|
16516
|
+
settings: "voice-settings-b1c1633136a5.js"
|
|
16517
|
+
},
|
|
16518
|
+
{
|
|
16519
|
+
platform: "darwin",
|
|
16449
16520
|
version: "26.1016.62342",
|
|
16450
16521
|
initial: "app-initial-dddef47d6ef6.js",
|
|
16451
16522
|
shared: "app-shared-fc3316d48427.js",
|
|
@@ -16453,6 +16524,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16453
16524
|
prewarm: "voice-prewarm-5d107129ac1c.js"
|
|
16454
16525
|
},
|
|
16455
16526
|
{
|
|
16527
|
+
platform: "darwin",
|
|
16456
16528
|
version: "26.1016.61520",
|
|
16457
16529
|
initial: "app-initial-c95ddb62696e.js",
|
|
16458
16530
|
shared: "app-shared-2eda13eb7044.js",
|
|
@@ -16933,7 +17005,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16933
17005
|
if (renderFailed) throw new Error();
|
|
16934
17006
|
if (!modules) {
|
|
16935
17007
|
const names = loadedAssetNames(doc, target.performance);
|
|
16936
|
-
const assets = selectVoiceAssets(
|
|
17008
|
+
const assets = selectVoiceAssets(
|
|
17009
|
+
NATIVE_CHAT_VOICE_ASSETS,
|
|
17010
|
+
names,
|
|
17011
|
+
config2.desktopVersion,
|
|
17012
|
+
config2.desktopPlatform
|
|
17013
|
+
);
|
|
16937
17014
|
if (!assets) {
|
|
16938
17015
|
if (Date.now() - started >= 6e4) {
|
|
16939
17016
|
handle.status = "unsupported";
|
|
@@ -17419,6 +17496,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17419
17496
|
var CLIENT_OWNED_VOICE_OVERLAY_ASSET = "avatar-overlay-native-page-d549db3706f1.js";
|
|
17420
17497
|
var CLIENT_OWNED_VOICE_ASSETS = [
|
|
17421
17498
|
{
|
|
17499
|
+
platform: "darwin",
|
|
17422
17500
|
version: CLIENT_OWNED_VOICE_VERSION,
|
|
17423
17501
|
initial: CLIENT_OWNED_VOICE_INITIAL_ASSET,
|
|
17424
17502
|
shared: CLIENT_OWNED_VOICE_SHARED_ASSET,
|
|
@@ -17432,6 +17510,21 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17432
17510
|
inferenceGateFamily: "Cnr"
|
|
17433
17511
|
},
|
|
17434
17512
|
{
|
|
17513
|
+
platform: "win32",
|
|
17514
|
+
version: CLIENT_OWNED_VOICE_VERSION,
|
|
17515
|
+
initial: "app-initial-438d1df57f70.js",
|
|
17516
|
+
shared: "app-shared-955d52676f9c.js",
|
|
17517
|
+
overlay: "avatar-overlay-native-page-1549fe5955e1.js",
|
|
17518
|
+
fetch: "Htr",
|
|
17519
|
+
fetchFrom: "initial",
|
|
17520
|
+
bridge: "bIt",
|
|
17521
|
+
services: "Qot",
|
|
17522
|
+
capabilityInit: "l0n",
|
|
17523
|
+
capabilityFamily: "c0n",
|
|
17524
|
+
inferenceGateFamily: "Cnr"
|
|
17525
|
+
},
|
|
17526
|
+
{
|
|
17527
|
+
platform: "darwin",
|
|
17435
17528
|
version: "26.1016.62342",
|
|
17436
17529
|
initial: "app-initial-dddef47d6ef6.js",
|
|
17437
17530
|
shared: "app-shared-fc3316d48427.js",
|
|
@@ -17446,6 +17539,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17446
17539
|
inferenceGateFamily: "uBr"
|
|
17447
17540
|
},
|
|
17448
17541
|
{
|
|
17542
|
+
platform: "darwin",
|
|
17449
17543
|
version: "26.1016.61520",
|
|
17450
17544
|
initial: "app-initial-c95ddb62696e.js",
|
|
17451
17545
|
shared: "app-shared-2eda13eb7044.js",
|
|
@@ -17686,7 +17780,12 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17686
17780
|
const attempt = async () => {
|
|
17687
17781
|
if (disposed) return;
|
|
17688
17782
|
const names = loadedAssetNames(target.document, target.performance);
|
|
17689
|
-
const assets = selectVoiceAssets(
|
|
17783
|
+
const assets = selectVoiceAssets(
|
|
17784
|
+
CLIENT_OWNED_VOICE_ASSETS,
|
|
17785
|
+
names,
|
|
17786
|
+
config2.desktopVersion,
|
|
17787
|
+
config2.desktopPlatform
|
|
17788
|
+
);
|
|
17690
17789
|
if (assets) {
|
|
17691
17790
|
try {
|
|
17692
17791
|
const sharedModule = await importModule(`app://-/assets/${assets.shared}`);
|
|
@@ -17792,6 +17891,645 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17792
17891
|
};
|
|
17793
17892
|
}
|
|
17794
17893
|
|
|
17894
|
+
// ../../node_modules/lucide/dist/esm/defaultAttributes.mjs
|
|
17895
|
+
var defaultAttributes = {
|
|
17896
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
17897
|
+
width: 24,
|
|
17898
|
+
height: 24,
|
|
17899
|
+
viewBox: "0 0 24 24",
|
|
17900
|
+
fill: "none",
|
|
17901
|
+
stroke: "currentColor",
|
|
17902
|
+
"stroke-width": 2,
|
|
17903
|
+
"stroke-linecap": "round",
|
|
17904
|
+
"stroke-linejoin": "round"
|
|
17905
|
+
};
|
|
17906
|
+
|
|
17907
|
+
// ../../node_modules/lucide/dist/esm/createElement.mjs
|
|
17908
|
+
var createSVGElement = ([tag, attrs, children]) => {
|
|
17909
|
+
const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
|
|
17910
|
+
Object.keys(attrs).forEach((name) => {
|
|
17911
|
+
element.setAttribute(name, String(attrs[name]));
|
|
17912
|
+
});
|
|
17913
|
+
if (children?.length) {
|
|
17914
|
+
children.forEach((child) => {
|
|
17915
|
+
const childElement = createSVGElement(child);
|
|
17916
|
+
element.appendChild(childElement);
|
|
17917
|
+
});
|
|
17918
|
+
}
|
|
17919
|
+
return element;
|
|
17920
|
+
};
|
|
17921
|
+
var createElement = (iconNode, customAttrs = {}) => {
|
|
17922
|
+
const tag = "svg";
|
|
17923
|
+
const attrs = {
|
|
17924
|
+
...defaultAttributes,
|
|
17925
|
+
...customAttrs
|
|
17926
|
+
};
|
|
17927
|
+
return createSVGElement([tag, attrs, iconNode]);
|
|
17928
|
+
};
|
|
17929
|
+
|
|
17930
|
+
// ../../node_modules/lucide/dist/esm/icons/check.mjs
|
|
17931
|
+
var Check = [["path", { d: "M20 6 9 17l-5-5" }]];
|
|
17932
|
+
|
|
17933
|
+
// ../../node_modules/lucide/dist/esm/icons/message-circle-question-mark.mjs
|
|
17934
|
+
var MessageCircleQuestionMark = [
|
|
17935
|
+
[
|
|
17936
|
+
"path",
|
|
17937
|
+
{
|
|
17938
|
+
d: "M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"
|
|
17939
|
+
}
|
|
17940
|
+
],
|
|
17941
|
+
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3" }],
|
|
17942
|
+
["path", { d: "M12 17h.01" }]
|
|
17943
|
+
];
|
|
17944
|
+
|
|
17945
|
+
// ../../node_modules/lucide/dist/esm/icons/pencil.mjs
|
|
17946
|
+
var Pencil = [
|
|
17947
|
+
[
|
|
17948
|
+
"path",
|
|
17949
|
+
{
|
|
17950
|
+
d: "M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"
|
|
17951
|
+
}
|
|
17952
|
+
],
|
|
17953
|
+
["path", { d: "m15 5 4 4" }]
|
|
17954
|
+
];
|
|
17955
|
+
|
|
17956
|
+
// ../../node_modules/lucide/dist/esm/icons/x.mjs
|
|
17957
|
+
var X = [
|
|
17958
|
+
["path", { d: "M18 6 6 18" }],
|
|
17959
|
+
["path", { d: "m6 6 12 12" }]
|
|
17960
|
+
];
|
|
17961
|
+
|
|
17962
|
+
// src/renderer-question-card-style.ts
|
|
17963
|
+
var QUESTION_CARD_CSS = `
|
|
17964
|
+
:host {
|
|
17965
|
+
display: block;
|
|
17966
|
+
min-width: 0;
|
|
17967
|
+
margin: 8px 0;
|
|
17968
|
+
color-scheme: inherit;
|
|
17969
|
+
--question-text: light-dark(#171717, #ececec);
|
|
17970
|
+
--question-muted: light-dark(#737373, #a3a3a3);
|
|
17971
|
+
--question-border: light-dark(rgb(0 0 0 / 8%), rgb(255 255 255 / 8%));
|
|
17972
|
+
--question-selected: light-dark(#e9e9e9, #333333);
|
|
17973
|
+
--question-primary: light-dark(#202020, #ececec);
|
|
17974
|
+
--question-primary-text: light-dark(#fff, #171717);
|
|
17975
|
+
}
|
|
17976
|
+
*, ::before, ::after { box-sizing: border-box; }
|
|
17977
|
+
.card {
|
|
17978
|
+
display: flex;
|
|
17979
|
+
flex-direction: column;
|
|
17980
|
+
max-height: min(60vh, 560px);
|
|
17981
|
+
overflow: hidden;
|
|
17982
|
+
padding: 16px 12px 12px;
|
|
17983
|
+
border: 1px solid var(--question-border);
|
|
17984
|
+
border-radius: 24px;
|
|
17985
|
+
background: light-dark(#f7f7f7, #262626);
|
|
17986
|
+
color: var(--question-text);
|
|
17987
|
+
font: 13px/1.5 system-ui, sans-serif;
|
|
17988
|
+
}
|
|
17989
|
+
.title { display: flex; align-items: center; gap: 10px; flex-shrink: 0; margin: 0 6px 14px; color: var(--question-muted); font-weight: 400; }
|
|
17990
|
+
.question-icon { display: inline-flex; justify-content: center; align-items: center; width: 16px; height: 16px; flex-shrink: 0; }
|
|
17991
|
+
.countdown { margin-left: auto; font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; }
|
|
17992
|
+
.countdown[hidden] { display: none; }
|
|
17993
|
+
.countdown:not([hidden]) + .dismiss { margin-left: 0; }
|
|
17994
|
+
svg { display: block; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
|
|
17995
|
+
.body { min-height: 0; overflow: auto; }
|
|
17996
|
+
fieldset { min-width: 0; border: 0; padding: 0; margin: 0 0 14px; }
|
|
17997
|
+
fieldset:last-child { margin-bottom: 0; }
|
|
17998
|
+
legend { width: 100%; padding: 0 6px; margin-bottom: 14px; font: inherit; }
|
|
17999
|
+
.hint { color: var(--question-muted); font-size: 12px; margin: -10px 6px 10px; }
|
|
18000
|
+
.option {
|
|
18001
|
+
position: relative;
|
|
18002
|
+
display: flex;
|
|
18003
|
+
align-items: flex-start;
|
|
18004
|
+
gap: 10px;
|
|
18005
|
+
min-height: 34px;
|
|
18006
|
+
padding: 6px;
|
|
18007
|
+
margin: 2px 0;
|
|
18008
|
+
border-radius: 12px;
|
|
18009
|
+
cursor: pointer;
|
|
18010
|
+
background: transparent;
|
|
18011
|
+
overflow-wrap: anywhere;
|
|
18012
|
+
}
|
|
18013
|
+
.option:hover, .option:has(:checked) { background: var(--question-selected); }
|
|
18014
|
+
input[type=checkbox], input[type=radio] {
|
|
18015
|
+
appearance: none;
|
|
18016
|
+
display: block;
|
|
18017
|
+
flex: 0 0 21px;
|
|
18018
|
+
width: 21px;
|
|
18019
|
+
height: 21px;
|
|
18020
|
+
margin: 0;
|
|
18021
|
+
padding: 0;
|
|
18022
|
+
border: 1px solid var(--question-border);
|
|
18023
|
+
border-radius: 5px;
|
|
18024
|
+
background: light-dark(#ededed, #303030);
|
|
18025
|
+
cursor: pointer;
|
|
18026
|
+
}
|
|
18027
|
+
.shortcut { position: absolute; top: 6px; left: 6px; width: 21px; height: 21px; text-align: center; line-height: 21px; color: var(--question-muted); pointer-events: none; font-size: 12px; }
|
|
18028
|
+
.option-copy { flex: 1; min-width: 0; white-space: pre-wrap; }
|
|
18029
|
+
.option-name { display: block; font-weight: 400; }
|
|
18030
|
+
.description { display: block; color: var(--question-muted); font-size: 12px; margin-top: 1px; }
|
|
18031
|
+
.selected-indicator { align-self: center; visibility: hidden; color: var(--question-muted); padding-right: 4px; }
|
|
18032
|
+
:checked ~ .selected-indicator { visibility: visible; }
|
|
18033
|
+
.other { align-items: center; flex: 1; min-width: 0; margin: 0; }
|
|
18034
|
+
.other input[type=checkbox], .other input[type=radio] { background: transparent; border-color: transparent; }
|
|
18035
|
+
.other:has(:checked), .other:focus-within { background: var(--question-selected); }
|
|
18036
|
+
.other:has(:checked) .pencil { color: var(--question-text); }
|
|
18037
|
+
.pencil { display: flex; align-items: center; justify-content: center; }
|
|
18038
|
+
.other-copy { display: flex; flex: 1; min-width: 0; }
|
|
18039
|
+
input:not([type=checkbox]):not([type=radio]), textarea {
|
|
18040
|
+
appearance: none;
|
|
18041
|
+
display: block;
|
|
18042
|
+
min-width: 0;
|
|
18043
|
+
width: 100%;
|
|
18044
|
+
padding: 6px;
|
|
18045
|
+
border: 1px solid var(--question-border);
|
|
18046
|
+
border-radius: 8px;
|
|
18047
|
+
background: transparent;
|
|
18048
|
+
color: var(--question-text);
|
|
18049
|
+
font: inherit;
|
|
18050
|
+
}
|
|
18051
|
+
.other-copy input:not([type=checkbox]):not([type=radio]) { border: 0; padding: 0; }
|
|
18052
|
+
textarea { min-height: 60px; resize: vertical; }
|
|
18053
|
+
input::placeholder, textarea::placeholder { color: var(--question-muted); opacity: .65; }
|
|
18054
|
+
input:focus-visible, textarea:focus-visible, button:focus-visible {
|
|
18055
|
+
outline: 2px solid var(--question-muted);
|
|
18056
|
+
outline-offset: 2px;
|
|
18057
|
+
}
|
|
18058
|
+
.other-copy input:focus-visible { outline: none; }
|
|
18059
|
+
.other:has(input:focus-visible) { outline: 2px solid var(--question-muted); outline-offset: -2px; }
|
|
18060
|
+
.error { flex-shrink: 0; color: light-dark(#b42318, #ffaaa3); font-size: 12px; }
|
|
18061
|
+
.error:not(:empty) { margin: 8px 6px 0; }
|
|
18062
|
+
.footer { display: flex; align-items: center; gap: 8px; flex-shrink: 0; margin-top: 8px; }
|
|
18063
|
+
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-left: auto; flex-shrink: 0; }
|
|
18064
|
+
button {
|
|
18065
|
+
appearance: none;
|
|
18066
|
+
min-height: 28px;
|
|
18067
|
+
padding: 3px 10px;
|
|
18068
|
+
border: 1px solid var(--question-border);
|
|
18069
|
+
border-radius: 999px;
|
|
18070
|
+
background: transparent;
|
|
18071
|
+
color: var(--question-text);
|
|
18072
|
+
font: inherit;
|
|
18073
|
+
font-weight: 400;
|
|
18074
|
+
cursor: pointer;
|
|
18075
|
+
}
|
|
18076
|
+
button:hover { background: var(--question-selected); }
|
|
18077
|
+
button.primary { background: var(--question-primary); color: var(--question-primary-text); border-color: transparent; }
|
|
18078
|
+
button.primary:hover { opacity: .85; }
|
|
18079
|
+
button.dismiss { display: flex; align-items: center; justify-content: center; border: 0; padding: 0; min-height: 24px; width: 24px; margin-left: auto; color: var(--question-muted); }
|
|
18080
|
+
:disabled { cursor: wait; opacity: .5; }
|
|
18081
|
+
@media (max-width: 420px) { .footer { flex-wrap: wrap; } .footer > .other { flex-basis: 100%; } }
|
|
18082
|
+
@media (forced-colors: active) {
|
|
18083
|
+
.card, input, textarea { background: Canvas; color: CanvasText; }
|
|
18084
|
+
button, .card, input[type=checkbox], input[type=radio] { border-color: ButtonBorder; }
|
|
18085
|
+
.option:has(:checked) { outline: 1px solid Highlight; outline-offset: -1px; }
|
|
18086
|
+
button.primary { background: Highlight; color: HighlightText; }
|
|
18087
|
+
}
|
|
18088
|
+
`;
|
|
18089
|
+
|
|
18090
|
+
// src/renderer-question-card.ts
|
|
18091
|
+
function createQuestionCard(document2, question, submit, initial = {}) {
|
|
18092
|
+
const icon2 = (node) => document2.adoptNode(
|
|
18093
|
+
createElement(node, {
|
|
18094
|
+
width: 16,
|
|
18095
|
+
height: 16,
|
|
18096
|
+
"aria-hidden": "true",
|
|
18097
|
+
focusable: "false"
|
|
18098
|
+
})
|
|
18099
|
+
);
|
|
18100
|
+
const selectedIndicator = () => {
|
|
18101
|
+
const selected = document2.createElement("span");
|
|
18102
|
+
selected.className = "selected-indicator";
|
|
18103
|
+
selected.setAttribute("aria-hidden", "true");
|
|
18104
|
+
selected.append(icon2(Check));
|
|
18105
|
+
return selected;
|
|
18106
|
+
};
|
|
18107
|
+
const root = document2.createElement("section");
|
|
18108
|
+
root.dataset.codexhostQuestion = question.interactionId;
|
|
18109
|
+
root.setAttribute("aria-label", question.title ?? "Question");
|
|
18110
|
+
root.addEventListener("keydown", (event) => {
|
|
18111
|
+
event.stopPropagation();
|
|
18112
|
+
if (event.key === "Enter" && event.composedPath()[0] instanceof HTMLInputElement)
|
|
18113
|
+
event.preventDefault();
|
|
18114
|
+
});
|
|
18115
|
+
const shadow = root.attachShadow({ mode: "open" });
|
|
18116
|
+
const style = document2.createElement("style");
|
|
18117
|
+
style.textContent = QUESTION_CARD_CSS;
|
|
18118
|
+
const surface = document2.createElement("div");
|
|
18119
|
+
surface.className = "card";
|
|
18120
|
+
shadow.append(style, surface);
|
|
18121
|
+
const title = document2.createElement("div");
|
|
18122
|
+
title.className = "title";
|
|
18123
|
+
const titleIcon = document2.createElement("span");
|
|
18124
|
+
titleIcon.className = "question-icon";
|
|
18125
|
+
titleIcon.append(icon2(MessageCircleQuestionMark));
|
|
18126
|
+
titleIcon.setAttribute("aria-hidden", "true");
|
|
18127
|
+
const titleText = document2.createElement("span");
|
|
18128
|
+
titleText.textContent = "Question";
|
|
18129
|
+
const countdown = document2.createElement("span");
|
|
18130
|
+
countdown.className = "countdown";
|
|
18131
|
+
countdown.setAttribute("role", "timer");
|
|
18132
|
+
countdown.title = "The Harness owns this timeout and its result.";
|
|
18133
|
+
let autoResolution = question.autoResolution;
|
|
18134
|
+
const updateCountdown2 = () => {
|
|
18135
|
+
const timeout = autoResolution;
|
|
18136
|
+
countdown.hidden = !timeout;
|
|
18137
|
+
if (!timeout) return;
|
|
18138
|
+
const remaining = Math.max(0, Math.ceil((timeout.deadlineUnixMs - Date.now()) / 1e3));
|
|
18139
|
+
const clock = `${Math.floor(remaining / 60)}:${String(remaining % 60).padStart(2, "0")}`;
|
|
18140
|
+
const action = timeout.action === "recommended" ? "Auto-select recommended" : "Question timeout";
|
|
18141
|
+
const text = remaining ? `${action} in ${clock}` : "Waiting for Harness\u2026";
|
|
18142
|
+
if (countdown.textContent !== text) countdown.textContent = text;
|
|
18143
|
+
};
|
|
18144
|
+
updateCountdown2();
|
|
18145
|
+
let countdownTimer = autoResolution ? document2.defaultView?.setInterval(updateCountdown2, 250) : void 0;
|
|
18146
|
+
const dismiss = document2.createElement("button");
|
|
18147
|
+
dismiss.type = "button";
|
|
18148
|
+
dismiss.className = "dismiss";
|
|
18149
|
+
dismiss.append(icon2(X));
|
|
18150
|
+
dismiss.setAttribute("aria-label", "Dismiss question");
|
|
18151
|
+
title.append(titleIcon, titleText, countdown, dismiss);
|
|
18152
|
+
const body = document2.createElement("div");
|
|
18153
|
+
body.className = "body";
|
|
18154
|
+
surface.append(title, body);
|
|
18155
|
+
const footer = document2.createElement("div");
|
|
18156
|
+
footer.className = "footer";
|
|
18157
|
+
const readers = /* @__PURE__ */ new Map();
|
|
18158
|
+
const controls = [dismiss];
|
|
18159
|
+
const validOther = [];
|
|
18160
|
+
for (const [index, field2] of question.questions.entries()) {
|
|
18161
|
+
const group = document2.createElement("fieldset");
|
|
18162
|
+
const legend = document2.createElement("legend");
|
|
18163
|
+
legend.textContent = field2.prompt;
|
|
18164
|
+
group.append(legend);
|
|
18165
|
+
const saved = initial[field2.id] ?? [];
|
|
18166
|
+
if (field2.type === "text") {
|
|
18167
|
+
const input = document2.createElement(field2.multiline ? "textarea" : "input");
|
|
18168
|
+
input.value = saved[0] ?? field2.prefill ?? "";
|
|
18169
|
+
input.placeholder = field2.placeholder ?? "Your answer";
|
|
18170
|
+
input.setAttribute("aria-label", field2.prompt);
|
|
18171
|
+
controls.push(input);
|
|
18172
|
+
group.append(input);
|
|
18173
|
+
readers.set(field2.id, () => input.value.trim() ? [input.value] : []);
|
|
18174
|
+
} else {
|
|
18175
|
+
const hint = document2.createElement("div");
|
|
18176
|
+
hint.className = "hint";
|
|
18177
|
+
hint.textContent = "Select all that apply";
|
|
18178
|
+
if (field2.multiple) group.append(hint);
|
|
18179
|
+
const inputs = [];
|
|
18180
|
+
const name = `codexhost-${question.interactionId}-${index}`;
|
|
18181
|
+
for (const [optionIndex, option] of field2.options.entries()) {
|
|
18182
|
+
const label = document2.createElement("label");
|
|
18183
|
+
label.className = "option";
|
|
18184
|
+
const input = document2.createElement("input");
|
|
18185
|
+
input.type = field2.multiple ? "checkbox" : "radio";
|
|
18186
|
+
input.name = name;
|
|
18187
|
+
input.value = option.value;
|
|
18188
|
+
input.checked = saved.includes(option.value);
|
|
18189
|
+
const shortcut = document2.createElement("span");
|
|
18190
|
+
shortcut.className = "shortcut";
|
|
18191
|
+
shortcut.setAttribute("aria-hidden", "true");
|
|
18192
|
+
shortcut.textContent = String(optionIndex + 1);
|
|
18193
|
+
const selected = selectedIndicator();
|
|
18194
|
+
const text = document2.createElement("span");
|
|
18195
|
+
text.className = "option-copy";
|
|
18196
|
+
const optionName = document2.createElement("span");
|
|
18197
|
+
optionName.className = "option-name";
|
|
18198
|
+
optionName.textContent = option.label;
|
|
18199
|
+
text.append(optionName);
|
|
18200
|
+
if (option.description) {
|
|
18201
|
+
const description = document2.createElement("span");
|
|
18202
|
+
description.className = "description";
|
|
18203
|
+
description.textContent = option.description;
|
|
18204
|
+
text.append(description);
|
|
18205
|
+
}
|
|
18206
|
+
label.append(input, shortcut, text, selected);
|
|
18207
|
+
group.append(label);
|
|
18208
|
+
inputs.push(input);
|
|
18209
|
+
controls.push(input);
|
|
18210
|
+
}
|
|
18211
|
+
let other;
|
|
18212
|
+
let notes;
|
|
18213
|
+
if (field2.allowOther) {
|
|
18214
|
+
const label = document2.createElement("label");
|
|
18215
|
+
label.className = "option other";
|
|
18216
|
+
other = document2.createElement("input");
|
|
18217
|
+
other.type = field2.multiple ? "checkbox" : "radio";
|
|
18218
|
+
other.name = name;
|
|
18219
|
+
other.setAttribute("aria-label", `Other: ${field2.prompt}`);
|
|
18220
|
+
const unknown2 = saved.find(
|
|
18221
|
+
(value) => !field2.options.some((option) => option.value === value)
|
|
18222
|
+
);
|
|
18223
|
+
other.checked = unknown2 !== void 0;
|
|
18224
|
+
notes = document2.createElement("input");
|
|
18225
|
+
notes.value = unknown2 ?? "";
|
|
18226
|
+
notes.placeholder = "Or write your own response";
|
|
18227
|
+
notes.setAttribute("aria-label", `${field2.prompt}: Other`);
|
|
18228
|
+
const checkbox = other;
|
|
18229
|
+
const otherText = notes;
|
|
18230
|
+
validOther.push(() => !checkbox.checked || otherText.value.trim().length > 0);
|
|
18231
|
+
notes.addEventListener("input", () => {
|
|
18232
|
+
checkbox.checked = true;
|
|
18233
|
+
});
|
|
18234
|
+
const copy = document2.createElement("span");
|
|
18235
|
+
copy.className = "other-copy";
|
|
18236
|
+
copy.append(notes);
|
|
18237
|
+
const pencil = document2.createElement("span");
|
|
18238
|
+
pencil.className = "shortcut pencil";
|
|
18239
|
+
pencil.append(icon2(Pencil));
|
|
18240
|
+
pencil.setAttribute("aria-hidden", "true");
|
|
18241
|
+
const selected = selectedIndicator();
|
|
18242
|
+
label.append(other, pencil, copy, selected);
|
|
18243
|
+
if (question.questions.length === 1) footer.append(label);
|
|
18244
|
+
else group.append(label);
|
|
18245
|
+
controls.push(other, notes);
|
|
18246
|
+
}
|
|
18247
|
+
readers.set(field2.id, () => [
|
|
18248
|
+
...inputs.filter((input) => input.checked).map((input) => input.value),
|
|
18249
|
+
...other?.checked && notes?.value.trim() ? [notes.value] : []
|
|
18250
|
+
]);
|
|
18251
|
+
}
|
|
18252
|
+
body.append(group);
|
|
18253
|
+
}
|
|
18254
|
+
const error51 = document2.createElement("div");
|
|
18255
|
+
error51.setAttribute("role", "alert");
|
|
18256
|
+
error51.className = "error";
|
|
18257
|
+
const actions = document2.createElement("div");
|
|
18258
|
+
actions.className = "actions";
|
|
18259
|
+
const readAnswers = () => Object.fromEntries([...readers].map(([id, read]) => [id, read()]));
|
|
18260
|
+
let busy = false;
|
|
18261
|
+
const send = async (cancelled) => {
|
|
18262
|
+
if (busy) return;
|
|
18263
|
+
const answers = cancelled ? {} : readAnswers();
|
|
18264
|
+
if (!cancelled && validOther.some((valid) => !valid())) {
|
|
18265
|
+
error51.textContent = "Type an answer for each selected Other option.";
|
|
18266
|
+
return;
|
|
18267
|
+
}
|
|
18268
|
+
if (!cancelled && question.questions.some((field2) => !field2.optional && !answers[field2.id]?.length)) {
|
|
18269
|
+
error51.textContent = "Answer each required question before submitting.";
|
|
18270
|
+
return;
|
|
18271
|
+
}
|
|
18272
|
+
busy = true;
|
|
18273
|
+
error51.textContent = "";
|
|
18274
|
+
for (const control of controls) control.disabled = true;
|
|
18275
|
+
try {
|
|
18276
|
+
await submit(answers, cancelled);
|
|
18277
|
+
} catch {
|
|
18278
|
+
error51.textContent = "Could not submit. The question may have closed. Try again if it is still available.";
|
|
18279
|
+
} finally {
|
|
18280
|
+
busy = false;
|
|
18281
|
+
for (const control of controls) control.disabled = false;
|
|
18282
|
+
}
|
|
18283
|
+
};
|
|
18284
|
+
for (const [label, cancelled] of [
|
|
18285
|
+
["Skip", true],
|
|
18286
|
+
["Send", false]
|
|
18287
|
+
]) {
|
|
18288
|
+
const button2 = document2.createElement("button");
|
|
18289
|
+
button2.type = "button";
|
|
18290
|
+
button2.textContent = label;
|
|
18291
|
+
if (!cancelled) button2.className = "primary";
|
|
18292
|
+
button2.addEventListener("click", () => {
|
|
18293
|
+
void send(cancelled);
|
|
18294
|
+
});
|
|
18295
|
+
controls.push(button2);
|
|
18296
|
+
actions.append(button2);
|
|
18297
|
+
}
|
|
18298
|
+
dismiss.addEventListener("click", () => {
|
|
18299
|
+
void send(true);
|
|
18300
|
+
});
|
|
18301
|
+
footer.append(actions);
|
|
18302
|
+
surface.append(error51, footer);
|
|
18303
|
+
return {
|
|
18304
|
+
root,
|
|
18305
|
+
readAnswers,
|
|
18306
|
+
get autoResolution() {
|
|
18307
|
+
return autoResolution;
|
|
18308
|
+
},
|
|
18309
|
+
updateAutoResolution(next) {
|
|
18310
|
+
if (autoResolution && (!next || next.deadlineUnixMs < autoResolution.deadlineUnixMs)) return;
|
|
18311
|
+
autoResolution = next;
|
|
18312
|
+
if (next && countdownTimer === void 0)
|
|
18313
|
+
countdownTimer = document2.defaultView?.setInterval(updateCountdown2, 250);
|
|
18314
|
+
updateCountdown2();
|
|
18315
|
+
},
|
|
18316
|
+
dispose() {
|
|
18317
|
+
if (countdownTimer !== void 0) document2.defaultView?.clearInterval(countdownTimer);
|
|
18318
|
+
root.remove();
|
|
18319
|
+
}
|
|
18320
|
+
};
|
|
18321
|
+
}
|
|
18322
|
+
|
|
18323
|
+
// src/renderer-question-activity.ts
|
|
18324
|
+
function installQuestionActivity(window2, root, enabled, reset) {
|
|
18325
|
+
let disposed = false;
|
|
18326
|
+
let inFlight = false;
|
|
18327
|
+
let queued = false;
|
|
18328
|
+
let blurred = false;
|
|
18329
|
+
let timer;
|
|
18330
|
+
const available = () => !disposed && root.isConnected && enabled();
|
|
18331
|
+
const schedule = () => {
|
|
18332
|
+
if (timer !== void 0 || inFlight || !queued || !available()) return;
|
|
18333
|
+
timer = window2.setTimeout(() => {
|
|
18334
|
+
void flush();
|
|
18335
|
+
}, 250);
|
|
18336
|
+
};
|
|
18337
|
+
const flush = async () => {
|
|
18338
|
+
timer = void 0;
|
|
18339
|
+
if (!available()) {
|
|
18340
|
+
queued = false;
|
|
18341
|
+
return;
|
|
18342
|
+
}
|
|
18343
|
+
queued = false;
|
|
18344
|
+
inFlight = true;
|
|
18345
|
+
try {
|
|
18346
|
+
await reset();
|
|
18347
|
+
} catch {
|
|
18348
|
+
} finally {
|
|
18349
|
+
inFlight = false;
|
|
18350
|
+
schedule();
|
|
18351
|
+
}
|
|
18352
|
+
};
|
|
18353
|
+
const activity = (event) => {
|
|
18354
|
+
if (!event.isTrusted || !available()) return;
|
|
18355
|
+
queued = true;
|
|
18356
|
+
schedule();
|
|
18357
|
+
};
|
|
18358
|
+
const blur = (event) => {
|
|
18359
|
+
if (event.isTrusted) blurred = true;
|
|
18360
|
+
};
|
|
18361
|
+
const focus = (event) => {
|
|
18362
|
+
if (!blurred) return;
|
|
18363
|
+
blurred = false;
|
|
18364
|
+
activity(event);
|
|
18365
|
+
};
|
|
18366
|
+
const events = ["pointerdown", "keydown", "input", "wheel"];
|
|
18367
|
+
for (const event of events) root.addEventListener(event, activity, { passive: true });
|
|
18368
|
+
window2.addEventListener("blur", blur);
|
|
18369
|
+
window2.addEventListener("focus", focus);
|
|
18370
|
+
return () => {
|
|
18371
|
+
disposed = true;
|
|
18372
|
+
queued = false;
|
|
18373
|
+
if (timer !== void 0) window2.clearTimeout(timer);
|
|
18374
|
+
for (const event of events) root.removeEventListener(event, activity);
|
|
18375
|
+
window2.removeEventListener("blur", blur);
|
|
18376
|
+
window2.removeEventListener("focus", focus);
|
|
18377
|
+
};
|
|
18378
|
+
}
|
|
18379
|
+
|
|
18380
|
+
// src/renderer-request-sender.ts
|
|
18381
|
+
var RendererMethodUnavailableError = class extends Error {
|
|
18382
|
+
constructor(method, cause) {
|
|
18383
|
+
super(`${method} is unsupported on this Host connection`, { cause });
|
|
18384
|
+
this.method = method;
|
|
18385
|
+
this.name = "RendererMethodUnavailableError";
|
|
18386
|
+
}
|
|
18387
|
+
method;
|
|
18388
|
+
code = -32601;
|
|
18389
|
+
};
|
|
18390
|
+
function isUnsupportedMethod(error51, method) {
|
|
18391
|
+
if (typeof error51 !== "object" || error51 === null) return false;
|
|
18392
|
+
const code = "code" in error51 ? error51.code : void 0;
|
|
18393
|
+
const message2 = "message" in error51 ? error51.message : void 0;
|
|
18394
|
+
return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
|
|
18395
|
+
}
|
|
18396
|
+
function createRendererRequestSender(send) {
|
|
18397
|
+
const unsupported = /* @__PURE__ */ new Map();
|
|
18398
|
+
return async (method, params, options) => {
|
|
18399
|
+
const known = unsupported.get(method);
|
|
18400
|
+
if (known) throw known;
|
|
18401
|
+
try {
|
|
18402
|
+
return await (options === void 0 ? send(method, params) : send(method, params, options));
|
|
18403
|
+
} catch (error51) {
|
|
18404
|
+
if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
|
|
18405
|
+
const unavailable = new RendererMethodUnavailableError(method, error51);
|
|
18406
|
+
unsupported.set(method, unavailable);
|
|
18407
|
+
throw unavailable;
|
|
18408
|
+
}
|
|
18409
|
+
};
|
|
18410
|
+
}
|
|
18411
|
+
|
|
18412
|
+
// src/renderer-questions.ts
|
|
18413
|
+
function same(a, b) {
|
|
18414
|
+
return a?.hostId === b?.hostId && a?.threadId === b?.threadId && a?.composer === b?.composer && a?.route === b?.route;
|
|
18415
|
+
}
|
|
18416
|
+
function installRendererQuestions(window2, readContext) {
|
|
18417
|
+
let disposed = false;
|
|
18418
|
+
let inFlight = false;
|
|
18419
|
+
let context = null;
|
|
18420
|
+
let card = null;
|
|
18421
|
+
let cardId = null;
|
|
18422
|
+
let stopActivity;
|
|
18423
|
+
const unsupported = /* @__PURE__ */ new WeakSet();
|
|
18424
|
+
const drafts = /* @__PURE__ */ new Map();
|
|
18425
|
+
const key = (id) => JSON.stringify([context?.hostId, context?.threadId, id]);
|
|
18426
|
+
const clear = (retain = true) => {
|
|
18427
|
+
stopActivity?.();
|
|
18428
|
+
stopActivity = void 0;
|
|
18429
|
+
if (retain && card && cardId) {
|
|
18430
|
+
drafts.set(key(cardId), card.readAnswers());
|
|
18431
|
+
const oldest = drafts.keys().next().value;
|
|
18432
|
+
if (drafts.size > 50 && oldest !== void 0) drafts.delete(oldest);
|
|
18433
|
+
}
|
|
18434
|
+
card?.dispose();
|
|
18435
|
+
card = null;
|
|
18436
|
+
cardId = null;
|
|
18437
|
+
};
|
|
18438
|
+
const refresh = async () => {
|
|
18439
|
+
if (disposed) return;
|
|
18440
|
+
const next = readContext();
|
|
18441
|
+
if (!same(context, next)) {
|
|
18442
|
+
clear();
|
|
18443
|
+
context = next;
|
|
18444
|
+
}
|
|
18445
|
+
const current = context;
|
|
18446
|
+
if (!current || inFlight || unsupported.has(current.route)) return;
|
|
18447
|
+
inFlight = true;
|
|
18448
|
+
try {
|
|
18449
|
+
const raw = await current.route.sendRequest(
|
|
18450
|
+
THREAD_QUESTIONS_LIST_METHOD,
|
|
18451
|
+
{ threadId: current.threadId },
|
|
18452
|
+
{ priority: "background", timeoutMs: 5e3 }
|
|
18453
|
+
);
|
|
18454
|
+
if (disposed || !same(current, readContext())) return;
|
|
18455
|
+
const question = threadQuestionsResultSchema.parse(raw).questions[0];
|
|
18456
|
+
if (!question) {
|
|
18457
|
+
if (cardId) drafts.delete(key(cardId));
|
|
18458
|
+
clear(false);
|
|
18459
|
+
return;
|
|
18460
|
+
}
|
|
18461
|
+
if (cardId === question.interactionId && card?.root.isConnected) {
|
|
18462
|
+
card.updateAutoResolution(question.autoResolution);
|
|
18463
|
+
return;
|
|
18464
|
+
}
|
|
18465
|
+
clear(cardId === question.interactionId);
|
|
18466
|
+
cardId = question.interactionId;
|
|
18467
|
+
card = createQuestionCard(
|
|
18468
|
+
current.composer.ownerDocument,
|
|
18469
|
+
question,
|
|
18470
|
+
async (answers, cancelled) => {
|
|
18471
|
+
if (disposed || !same(current, readContext()) || cardId !== question.interactionId)
|
|
18472
|
+
throw new Error("Question owner changed");
|
|
18473
|
+
const result = await current.route.sendRequest(
|
|
18474
|
+
THREAD_QUESTION_RESPOND_METHOD,
|
|
18475
|
+
{
|
|
18476
|
+
threadId: current.threadId,
|
|
18477
|
+
turnId: question.turnId,
|
|
18478
|
+
interactionId: question.interactionId,
|
|
18479
|
+
answers,
|
|
18480
|
+
cancelled
|
|
18481
|
+
},
|
|
18482
|
+
{ priority: "interactive", timeoutMs: 1e4 }
|
|
18483
|
+
);
|
|
18484
|
+
threadQuestionRespondResultSchema.parse(result);
|
|
18485
|
+
drafts.delete(JSON.stringify([current.hostId, current.threadId, question.interactionId]));
|
|
18486
|
+
if (same(current, context) && cardId === question.interactionId) clear(false);
|
|
18487
|
+
},
|
|
18488
|
+
drafts.get(key(question.interactionId))
|
|
18489
|
+
);
|
|
18490
|
+
current.composer.before(card.root);
|
|
18491
|
+
const mounted = card;
|
|
18492
|
+
stopActivity = installQuestionActivity(
|
|
18493
|
+
window2,
|
|
18494
|
+
card.root,
|
|
18495
|
+
() => same(current, readContext()) && card === mounted && mounted.autoResolution?.resetOnActivity === true,
|
|
18496
|
+
async () => {
|
|
18497
|
+
const raw2 = await current.route.sendRequest(
|
|
18498
|
+
THREAD_QUESTION_ACTIVITY_METHOD,
|
|
18499
|
+
{
|
|
18500
|
+
threadId: current.threadId,
|
|
18501
|
+
turnId: question.turnId,
|
|
18502
|
+
interactionId: question.interactionId
|
|
18503
|
+
},
|
|
18504
|
+
{ priority: "background", timeoutMs: 4e3 }
|
|
18505
|
+
);
|
|
18506
|
+
if (disposed || card !== mounted || !same(current, readContext())) return;
|
|
18507
|
+
const ack = threadQuestionActivityResultSchema.parse(raw2).autoResolution;
|
|
18508
|
+
if (ack) mounted.updateAutoResolution(ack);
|
|
18509
|
+
}
|
|
18510
|
+
);
|
|
18511
|
+
} catch (error51) {
|
|
18512
|
+
if (isUnsupportedMethod(error51, THREAD_QUESTIONS_LIST_METHOD)) unsupported.add(current.route);
|
|
18513
|
+
if (same(current, context)) clear();
|
|
18514
|
+
} finally {
|
|
18515
|
+
inFlight = false;
|
|
18516
|
+
}
|
|
18517
|
+
};
|
|
18518
|
+
const timer = window2.setInterval(() => {
|
|
18519
|
+
void refresh();
|
|
18520
|
+
}, 750);
|
|
18521
|
+
void refresh();
|
|
18522
|
+
return {
|
|
18523
|
+
refresh,
|
|
18524
|
+
dispose() {
|
|
18525
|
+
disposed = true;
|
|
18526
|
+
window2.clearInterval(timer);
|
|
18527
|
+
clear(false);
|
|
18528
|
+
drafts.clear();
|
|
18529
|
+
}
|
|
18530
|
+
};
|
|
18531
|
+
}
|
|
18532
|
+
|
|
17795
18533
|
// src/codex-native-services.ts
|
|
17796
18534
|
async function loadCodexNativeServices(ownerWindow, matchesServices, importModule = (url2) => import(url2)) {
|
|
17797
18535
|
if (!ownerWindow.document || !ownerWindow.location) return null;
|
|
@@ -18332,42 +19070,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18332
19070
|
return fallback;
|
|
18333
19071
|
}
|
|
18334
19072
|
|
|
18335
|
-
// ../../node_modules/lucide/dist/esm/defaultAttributes.mjs
|
|
18336
|
-
var defaultAttributes = {
|
|
18337
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
18338
|
-
width: 24,
|
|
18339
|
-
height: 24,
|
|
18340
|
-
viewBox: "0 0 24 24",
|
|
18341
|
-
fill: "none",
|
|
18342
|
-
stroke: "currentColor",
|
|
18343
|
-
"stroke-width": 2,
|
|
18344
|
-
"stroke-linecap": "round",
|
|
18345
|
-
"stroke-linejoin": "round"
|
|
18346
|
-
};
|
|
18347
|
-
|
|
18348
|
-
// ../../node_modules/lucide/dist/esm/createElement.mjs
|
|
18349
|
-
var createSVGElement = ([tag, attrs, children]) => {
|
|
18350
|
-
const element = document.createElementNS("http://www.w3.org/2000/svg", tag);
|
|
18351
|
-
Object.keys(attrs).forEach((name) => {
|
|
18352
|
-
element.setAttribute(name, String(attrs[name]));
|
|
18353
|
-
});
|
|
18354
|
-
if (children?.length) {
|
|
18355
|
-
children.forEach((child) => {
|
|
18356
|
-
const childElement = createSVGElement(child);
|
|
18357
|
-
element.appendChild(childElement);
|
|
18358
|
-
});
|
|
18359
|
-
}
|
|
18360
|
-
return element;
|
|
18361
|
-
};
|
|
18362
|
-
var createElement = (iconNode, customAttrs = {}) => {
|
|
18363
|
-
const tag = "svg";
|
|
18364
|
-
const attrs = {
|
|
18365
|
-
...defaultAttributes,
|
|
18366
|
-
...customAttrs
|
|
18367
|
-
};
|
|
18368
|
-
return createSVGElement([tag, attrs, iconNode]);
|
|
18369
|
-
};
|
|
18370
|
-
|
|
18371
19073
|
// ../../node_modules/lucide/dist/esm/icons/boxes.mjs
|
|
18372
19074
|
var Boxes = [
|
|
18373
19075
|
[
|
|
@@ -18672,12 +19374,6 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18672
19374
|
["path", { d: "M12 17h.01" }]
|
|
18673
19375
|
];
|
|
18674
19376
|
|
|
18675
|
-
// ../../node_modules/lucide/dist/esm/icons/x.mjs
|
|
18676
|
-
var X = [
|
|
18677
|
-
["path", { d: "M18 6 6 18" }],
|
|
18678
|
-
["path", { d: "m6 6 12 12" }]
|
|
18679
|
-
];
|
|
18680
|
-
|
|
18681
19377
|
// ../../node_modules/lucide/dist/esm/icons/users.mjs
|
|
18682
19378
|
var Users = [
|
|
18683
19379
|
["path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }],
|
|
@@ -18999,8 +19695,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
18999
19695
|
return input;
|
|
19000
19696
|
}
|
|
19001
19697
|
function createNumberField(document2, input) {
|
|
19002
|
-
const
|
|
19003
|
-
|
|
19698
|
+
const field2 = document2.createElement("div");
|
|
19699
|
+
field2.className = "flex h-8 shrink-0 items-center gap-1.5 rounded-md border border-settings-border bg-settings-surface px-2.5 transition-colors focus-within:border-settings-focus data-[invalid=true]:border-settings-danger";
|
|
19004
19700
|
const control = document2.createElement("input");
|
|
19005
19701
|
control.type = "number";
|
|
19006
19702
|
control.id = input.id;
|
|
@@ -19013,8 +19709,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
19013
19709
|
unit.className = "text-xs text-settings-muted";
|
|
19014
19710
|
unit.setAttribute("aria-hidden", "true");
|
|
19015
19711
|
unit.textContent = input.unit;
|
|
19016
|
-
|
|
19017
|
-
return { field, control };
|
|
19712
|
+
field2.append(control, unit);
|
|
19713
|
+
return { field: field2, control };
|
|
19018
19714
|
}
|
|
19019
19715
|
|
|
19020
19716
|
// src/settings/grok-computer-use-controls.ts
|
|
@@ -23547,9 +24243,6 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
23547
24243
|
syncModelSelectionNotice(control, view, locale);
|
|
23548
24244
|
}
|
|
23549
24245
|
|
|
23550
|
-
// ../../node_modules/lucide/dist/esm/icons/check.mjs
|
|
23551
|
-
var Check = [["path", { d: "M20 6 9 17l-5-5" }]];
|
|
23552
|
-
|
|
23553
24246
|
// ../../node_modules/lucide/dist/esm/icons/lock.mjs
|
|
23554
24247
|
var Lock = [
|
|
23555
24248
|
["rect", { width: "18", height: "11", x: "3", y: "11", rx: "2", ry: "2" }],
|
|
@@ -24389,6 +25082,21 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24389
25082
|
};
|
|
24390
25083
|
}
|
|
24391
25084
|
|
|
25085
|
+
// src/renderer-composer-request.ts
|
|
25086
|
+
var NATIVE_COMPOSER_REQUEST_ATTRIBUTES = [
|
|
25087
|
+
"data-codex-composer-request-navigation",
|
|
25088
|
+
"data-codex-composer-request"
|
|
25089
|
+
];
|
|
25090
|
+
var NATIVE_REQUEST_SELECTOR = NATIVE_COMPOSER_REQUEST_ATTRIBUTES.map(
|
|
25091
|
+
(attribute) => `[${attribute}]`
|
|
25092
|
+
).join(", ");
|
|
25093
|
+
function isNativeComposerRequest(element) {
|
|
25094
|
+
return element.closest(NATIVE_REQUEST_SELECTOR) !== null;
|
|
25095
|
+
}
|
|
25096
|
+
function hasNativeComposerRequest(composer) {
|
|
25097
|
+
return isNativeComposerRequest(composer) || composer.querySelector(NATIVE_REQUEST_SELECTOR) !== null;
|
|
25098
|
+
}
|
|
25099
|
+
|
|
24392
25100
|
// src/renderer-harness-command-control.ts
|
|
24393
25101
|
var CONTROL_ATTRIBUTE2 = "data-codexhost-harness-command-control";
|
|
24394
25102
|
var SVG_NS2 = "http://www.w3.org/2000/svg";
|
|
@@ -24572,9 +25280,12 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24572
25280
|
return buttons.length > 0 && buttons.every((button2) => isComposerTrailingActionButton(button2));
|
|
24573
25281
|
}
|
|
24574
25282
|
function sendButtonWithin(root) {
|
|
24575
|
-
return
|
|
24576
|
-
|
|
24577
|
-
|
|
25283
|
+
return composerButtonsWithin(root).find((button2) => isComposerSubmitButton(button2)) ?? null;
|
|
25284
|
+
}
|
|
25285
|
+
function composerButtonsWithin(root) {
|
|
25286
|
+
return [...root.querySelectorAll("button")].filter(
|
|
25287
|
+
(button2) => !isNativeComposerRequest(button2)
|
|
25288
|
+
);
|
|
24578
25289
|
}
|
|
24579
25290
|
function leftmostTrailingSibling(container, before) {
|
|
24580
25291
|
for (const child of container.children) {
|
|
@@ -24616,6 +25327,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24616
25327
|
return composerForElement(editor);
|
|
24617
25328
|
}
|
|
24618
25329
|
function composerForElement(element) {
|
|
25330
|
+
if (isNativeComposerRequest(element)) return null;
|
|
24619
25331
|
const composer = element.closest(CODEX_COMPOSER_SELECTOR);
|
|
24620
25332
|
return composer && !isOrbitComposer(composer) ? composer : null;
|
|
24621
25333
|
}
|
|
@@ -24758,7 +25470,7 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24758
25470
|
return root?.parentElement ? root : null;
|
|
24759
25471
|
}
|
|
24760
25472
|
function lastNativeButtonWithin(composer) {
|
|
24761
|
-
const buttons =
|
|
25473
|
+
const buttons = composerButtonsWithin(composer);
|
|
24762
25474
|
for (let index = buttons.length - 1; index >= 0; index -= 1) {
|
|
24763
25475
|
const button2 = buttons[index];
|
|
24764
25476
|
if (button2 && !isInsideOwnedRendererControl(button2, composer)) return button2;
|
|
@@ -24773,7 +25485,8 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
24773
25485
|
}
|
|
24774
25486
|
function refreshSendButton(control) {
|
|
24775
25487
|
const current = control.sendButton;
|
|
24776
|
-
if (current?.isConnected && control.composer.contains(current)
|
|
25488
|
+
if (current?.isConnected && control.composer.contains(current) && !isNativeComposerRequest(current))
|
|
25489
|
+
return current;
|
|
24777
25490
|
const replacement = sendButtonWithin(control.composer) ?? (current && !isComposerSubmitButton(current) ? lastNativeButtonWithin(control.composer) : null);
|
|
24778
25491
|
if (!replacement) return null;
|
|
24779
25492
|
if (control.sendDisabledBeforeSwitch !== null) {
|
|
@@ -25610,38 +26323,6 @@ Codex Fast mode prioritizes requests and may increase usage.`
|
|
|
25610
26323
|
return task.result;
|
|
25611
26324
|
}
|
|
25612
26325
|
|
|
25613
|
-
// src/renderer-request-sender.ts
|
|
25614
|
-
var RendererMethodUnavailableError = class extends Error {
|
|
25615
|
-
constructor(method, cause) {
|
|
25616
|
-
super(`${method} is unsupported on this Host connection`, { cause });
|
|
25617
|
-
this.method = method;
|
|
25618
|
-
this.name = "RendererMethodUnavailableError";
|
|
25619
|
-
}
|
|
25620
|
-
method;
|
|
25621
|
-
code = -32601;
|
|
25622
|
-
};
|
|
25623
|
-
function isUnsupportedMethod(error51, method) {
|
|
25624
|
-
if (typeof error51 !== "object" || error51 === null) return false;
|
|
25625
|
-
const code = "code" in error51 ? error51.code : void 0;
|
|
25626
|
-
const message2 = "message" in error51 ? error51.message : void 0;
|
|
25627
|
-
return code === -32601 || code === -32600 && typeof message2 === "string" && message2.startsWith(`Invalid request: unknown variant \`${method}\``);
|
|
25628
|
-
}
|
|
25629
|
-
function createRendererRequestSender(send) {
|
|
25630
|
-
const unsupported = /* @__PURE__ */ new Map();
|
|
25631
|
-
return async (method, params, options) => {
|
|
25632
|
-
const known = unsupported.get(method);
|
|
25633
|
-
if (known) throw known;
|
|
25634
|
-
try {
|
|
25635
|
-
return await (options === void 0 ? send(method, params) : send(method, params, options));
|
|
25636
|
-
} catch (error51) {
|
|
25637
|
-
if (!method.startsWith("codexhost/") || !isUnsupportedMethod(error51, method)) throw error51;
|
|
25638
|
-
const unavailable = new RendererMethodUnavailableError(method, error51);
|
|
25639
|
-
unsupported.set(method, unavailable);
|
|
25640
|
-
throw unavailable;
|
|
25641
|
-
}
|
|
25642
|
-
};
|
|
25643
|
-
}
|
|
25644
|
-
|
|
25645
26326
|
// src/renderer-native-thread.ts
|
|
25646
26327
|
function isRecord6(value) {
|
|
25647
26328
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -28103,10 +28784,10 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
28103
28784
|
if (!locale) throw new Error("Codex locale override is invalid");
|
|
28104
28785
|
return { value: locale };
|
|
28105
28786
|
}
|
|
28106
|
-
function optionalLocale(value,
|
|
28787
|
+
function optionalLocale(value, field2) {
|
|
28107
28788
|
if (value === void 0 || value === null) return void 0;
|
|
28108
28789
|
const locale = canonicalLocale(value);
|
|
28109
|
-
if (!locale) throw new Error(`Codex ${
|
|
28790
|
+
if (!locale) throw new Error(`Codex ${field2} is invalid`);
|
|
28110
28791
|
return locale;
|
|
28111
28792
|
}
|
|
28112
28793
|
function parseLocaleInfo(value) {
|
|
@@ -29016,7 +29697,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29016
29697
|
var DECIMAL = /^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu;
|
|
29017
29698
|
function modelPriceDraft(key, price) {
|
|
29018
29699
|
const prices = Object.fromEntries(
|
|
29019
|
-
MODEL_PRICE_FIELDS.map((
|
|
29700
|
+
MODEL_PRICE_FIELDS.map((field2) => [field2, price?.[field2]?.toString() ?? ""])
|
|
29020
29701
|
);
|
|
29021
29702
|
return { model: key, prices };
|
|
29022
29703
|
}
|
|
@@ -29027,18 +29708,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29027
29708
|
return { error: { kind: "duplicate", key } };
|
|
29028
29709
|
}
|
|
29029
29710
|
const price = {};
|
|
29030
|
-
for (const
|
|
29031
|
-
const text = draft.prices[
|
|
29711
|
+
for (const field2 of MODEL_PRICE_FIELDS) {
|
|
29712
|
+
const text = draft.prices[field2].trim();
|
|
29032
29713
|
if (text === "") {
|
|
29033
|
-
if (
|
|
29034
|
-
return { error: { kind: "priceRequired", field } };
|
|
29714
|
+
if (field2 === "input" || field2 === "output")
|
|
29715
|
+
return { error: { kind: "priceRequired", field: field2 } };
|
|
29035
29716
|
continue;
|
|
29036
29717
|
}
|
|
29037
29718
|
const value = Number(text);
|
|
29038
29719
|
if (!DECIMAL.test(text) || !Number.isFinite(value)) {
|
|
29039
|
-
return { error: { kind: "priceInvalid", field } };
|
|
29720
|
+
return { error: { kind: "priceInvalid", field: field2 } };
|
|
29040
29721
|
}
|
|
29041
|
-
price[
|
|
29722
|
+
price[field2] = value;
|
|
29042
29723
|
}
|
|
29043
29724
|
return {
|
|
29044
29725
|
change: {
|
|
@@ -29058,7 +29739,7 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29058
29739
|
}
|
|
29059
29740
|
function formatPrice(messages, price) {
|
|
29060
29741
|
return MODEL_PRICE_FIELDS.map(
|
|
29061
|
-
(
|
|
29742
|
+
(field2) => `${messages.fields[field2]} ${price[field2] ?? messages.unset}`
|
|
29062
29743
|
).join(" \xB7 ");
|
|
29063
29744
|
}
|
|
29064
29745
|
function draftErrorText(messages, error51) {
|
|
@@ -29126,18 +29807,18 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29126
29807
|
function renderEditor(modelId, view, isCurrent) {
|
|
29127
29808
|
const existing = view.entries.find((entry) => entry.key === modelId);
|
|
29128
29809
|
const draft = modelPriceDraft(modelId, existing?.price ?? null);
|
|
29129
|
-
const
|
|
29810
|
+
const field2 = (label, value, placeholder = "") => h(document2, "input", {
|
|
29130
29811
|
type: "text",
|
|
29131
29812
|
className: "console-input",
|
|
29132
29813
|
value,
|
|
29133
29814
|
placeholder,
|
|
29134
29815
|
"aria-label": label
|
|
29135
29816
|
});
|
|
29136
|
-
const model2 =
|
|
29817
|
+
const model2 = field2(messages.model, modelId);
|
|
29137
29818
|
model2.readOnly = true;
|
|
29138
29819
|
const prices = Object.fromEntries(
|
|
29139
29820
|
MODEL_PRICE_FIELDS.map((name) => {
|
|
29140
|
-
const input =
|
|
29821
|
+
const input = field2(
|
|
29141
29822
|
messages.fields[name],
|
|
29142
29823
|
draft.prices[name],
|
|
29143
29824
|
name === "input" || name === "output" ? messages.required : messages.notSet
|
|
@@ -29949,8 +30630,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
29949
30630
|
for (const cell of options.cells) {
|
|
29950
30631
|
const key = options.singleDay ? cell.hour : cell.weekday * 24 + cell.hour;
|
|
29951
30632
|
const totals2 = byHour.get(key) ?? emptyTotals();
|
|
29952
|
-
for (const
|
|
29953
|
-
totals2[
|
|
30633
|
+
for (const field2 of Object.keys(totals2))
|
|
30634
|
+
totals2[field2] += cell.totals[field2];
|
|
29954
30635
|
byHour.set(key, totals2);
|
|
29955
30636
|
}
|
|
29956
30637
|
const max = Math.max(0, ...[...byHour.values()].map((totals2) => measured(totals2, measure)));
|
|
@@ -30313,8 +30994,8 @@ ${text.includes("## My request:") ? "" : "\n## My request:\n"}`,
|
|
|
30313
30994
|
save();
|
|
30314
30995
|
load();
|
|
30315
30996
|
}
|
|
30316
|
-
function toggleFilter(
|
|
30317
|
-
view[
|
|
30997
|
+
function toggleFilter(field2, key) {
|
|
30998
|
+
view[field2] = view[field2] === key ? "" : key;
|
|
30318
30999
|
changed();
|
|
30319
31000
|
}
|
|
30320
31001
|
function selectDate(next) {
|
|
@@ -30730,8 +31411,8 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
30730
31411
|
}
|
|
30731
31412
|
];
|
|
30732
31413
|
}
|
|
30733
|
-
function rowFilter(
|
|
30734
|
-
const selected = view[
|
|
31414
|
+
function rowFilter(field2, key, label, detail) {
|
|
31415
|
+
const selected = view[field2] === key;
|
|
30735
31416
|
const button2 = focusKey(
|
|
30736
31417
|
h(
|
|
30737
31418
|
document2,
|
|
@@ -30745,9 +31426,9 @@ ${detail}` : ""}`
|
|
|
30745
31426
|
},
|
|
30746
31427
|
label
|
|
30747
31428
|
),
|
|
30748
|
-
`${
|
|
31429
|
+
`${field2}:row:${key}`
|
|
30749
31430
|
);
|
|
30750
|
-
button2.addEventListener("click", () => toggleFilter(
|
|
31431
|
+
button2.addEventListener("click", () => toggleFilter(field2, key));
|
|
30751
31432
|
return button2;
|
|
30752
31433
|
}
|
|
30753
31434
|
function panel(title, content, extra = null, wide = false) {
|
|
@@ -31973,7 +32654,7 @@ ${detail}` : ""}`
|
|
|
31973
32654
|
);
|
|
31974
32655
|
if (!dialog) return;
|
|
31975
32656
|
const document2 = options.container.ownerDocument;
|
|
31976
|
-
const
|
|
32657
|
+
const field2 = (label, value, placeholder = "", hint = "") => {
|
|
31977
32658
|
const wrapper = remoteElement(document2, "div", "settings-credential-dialog__field");
|
|
31978
32659
|
const input = remoteElement(document2, "input");
|
|
31979
32660
|
input.id = preferenceId("remote-field");
|
|
@@ -31993,13 +32674,13 @@ ${detail}` : ""}`
|
|
|
31993
32674
|
dialog.body.append(wrapper);
|
|
31994
32675
|
return input;
|
|
31995
32676
|
};
|
|
31996
|
-
const name =
|
|
32677
|
+
const name = field2(t("\u540D\u79F0", "Name"), previous?.displayName ?? "");
|
|
31997
32678
|
name.required = true;
|
|
31998
32679
|
const addressHint = t(
|
|
31999
32680
|
"user@hostname\uFF0C\u6216 ~/.ssh/config \u4E2D\u7684\u4E3B\u673A\u522B\u540D",
|
|
32000
32681
|
"user@hostname, or a host alias from ~/.ssh/config"
|
|
32001
32682
|
);
|
|
32002
|
-
const hostname3 =
|
|
32683
|
+
const hostname3 = field2(
|
|
32003
32684
|
t("SSH \u5730\u5740", "SSH address"),
|
|
32004
32685
|
previous?.sshHost ?? "",
|
|
32005
32686
|
"user@hostname",
|
|
@@ -32008,7 +32689,7 @@ ${detail}` : ""}`
|
|
|
32008
32689
|
hostname3.required = true;
|
|
32009
32690
|
hostname3.pattern = "[^\\s\\-]\\S*";
|
|
32010
32691
|
hostname3.title = addressHint;
|
|
32011
|
-
const port =
|
|
32692
|
+
const port = field2(
|
|
32012
32693
|
t("\u7AEF\u53E3\uFF08\u53EF\u9009\uFF09", "Port (optional)"),
|
|
32013
32694
|
previous?.sshPort?.toString() ?? "",
|
|
32014
32695
|
"22"
|
|
@@ -32017,7 +32698,7 @@ ${detail}` : ""}`
|
|
|
32017
32698
|
port.min = "1";
|
|
32018
32699
|
port.max = "65535";
|
|
32019
32700
|
port.step = "1";
|
|
32020
|
-
const identity =
|
|
32701
|
+
const identity = field2(
|
|
32021
32702
|
t("\u79C1\u94A5\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09", "Identity file (optional)"),
|
|
32022
32703
|
previous?.identity ?? "",
|
|
32023
32704
|
"~/.ssh/id_ed25519"
|
|
@@ -33449,14 +34130,14 @@ ${detail}` : ""}`
|
|
|
33449
34130
|
description: messages.idleReleaseTimeoutDescription,
|
|
33450
34131
|
controlId: minutesId
|
|
33451
34132
|
});
|
|
33452
|
-
const { field, control: minutes } = createNumberField(document2, {
|
|
34133
|
+
const { field: field2, control: minutes } = createNumberField(document2, {
|
|
33453
34134
|
id: minutesId,
|
|
33454
34135
|
describedBy: timeout.description.id,
|
|
33455
34136
|
unit: messages.idleReleaseMinutes,
|
|
33456
34137
|
min: IDLE_RELEASE_TIMEOUT_MINUTES_MIN,
|
|
33457
34138
|
max: IDLE_RELEASE_TIMEOUT_MINUTES_MAX
|
|
33458
34139
|
});
|
|
33459
|
-
timeout.item.append(
|
|
34140
|
+
timeout.item.append(field2);
|
|
33460
34141
|
timeout.item.id = preferenceId("idle-release-timeout");
|
|
33461
34142
|
enabled.setAttribute("aria-controls", timeout.item.id);
|
|
33462
34143
|
card.append(toggle.item, timeout.item);
|
|
@@ -33477,7 +34158,7 @@ ${detail}` : ""}`
|
|
|
33477
34158
|
statusText.textContent = value === "applied" ? "" : statusMessages[value];
|
|
33478
34159
|
};
|
|
33479
34160
|
const setInvalid = (invalid) => {
|
|
33480
|
-
|
|
34161
|
+
field2.dataset.invalid = String(invalid);
|
|
33481
34162
|
timeout.description.dataset.invalid = String(invalid);
|
|
33482
34163
|
timeout.description.textContent = invalid ? messages.idleReleaseInvalid : messages.idleReleaseTimeoutDescription;
|
|
33483
34164
|
minutes.setAttribute("aria-invalid", String(invalid));
|
|
@@ -42638,7 +43319,7 @@ ${usage_default}`;
|
|
|
42638
43319
|
const ownershipRecovery = /* @__PURE__ */ new WeakMap();
|
|
42639
43320
|
const modelRecovery = /* @__PURE__ */ new WeakMap();
|
|
42640
43321
|
const isRetainedComposer = (mounted) => mounted.composer.isConnected && mounted.composer.matches(CODEX_COMPOSER_SELECTOR) && mountedByComposer.get(mounted.composer) === mounted;
|
|
42641
|
-
const isMountedComposer = (composer) => composer.isConnected && composer.matches(CODEX_COMPOSER_SELECTOR) && orbitComposerKind(composer) === "codex" && mountedByComposer.has(composer);
|
|
43322
|
+
const isMountedComposer = (composer) => composer.isConnected && composer.matches(CODEX_COMPOSER_SELECTOR) && !hasNativeComposerRequest(composer) && orbitComposerKind(composer) === "codex" && mountedByComposer.has(composer);
|
|
42642
43323
|
const isCurrentModelRequest = (mounted, generation) => isMountedComposer(mounted.composer) && mountedByComposer.get(mounted.composer) === mounted && controller.isCurrentModelRequest(mounted.composer, generation);
|
|
42643
43324
|
const isCurrentOwnershipRequest = (mounted, generation) => isMountedComposer(mounted.composer) && mountedByComposer.get(mounted.composer) === mounted && controller.isCurrentOwnershipRequest(mounted.composer, generation);
|
|
42644
43325
|
const finishModelRequest = (mounted, generation) => {
|
|
@@ -44045,11 +44726,11 @@ ${usage_default}`;
|
|
|
44045
44726
|
}
|
|
44046
44727
|
};
|
|
44047
44728
|
const mount = (composer) => {
|
|
44048
|
-
if (mountedByComposer.has(composer) || !composer.isConnected || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
|
|
44729
|
+
if (mountedByComposer.has(composer) || !composer.isConnected || hasNativeComposerRequest(composer) || orbitComposerKind(composer) !== "codex" || !composer.matches(CODEX_COMPOSER_SELECTOR)) {
|
|
44049
44730
|
return;
|
|
44050
44731
|
}
|
|
44051
|
-
const allButtons =
|
|
44052
|
-
const sendButton =
|
|
44732
|
+
const allButtons = composerButtonsWithin(composer);
|
|
44733
|
+
const sendButton = allButtons.find(isComposerSubmitButton) ?? allButtons.at(-1) ?? null;
|
|
44053
44734
|
if (!sendButton) return;
|
|
44054
44735
|
const modelTarget = findComposerModelTarget(composer);
|
|
44055
44736
|
const hostId2 = activeModelHostId(composer);
|
|
@@ -44160,7 +44841,7 @@ ${usage_default}`;
|
|
|
44160
44841
|
}
|
|
44161
44842
|
for (const [composer, mounted] of mountedByComposer) {
|
|
44162
44843
|
const kind = orbitComposerKind(composer);
|
|
44163
|
-
if (!composer.isConnected || kind === "orbit" || !composer.matches(CODEX_COMPOSER_SELECTOR) || !mounted.control.root.isConnected) {
|
|
44844
|
+
if (!composer.isConnected || hasNativeComposerRequest(composer) || kind === "orbit" || !composer.matches(CODEX_COMPOSER_SELECTOR) || !mounted.control.root.isConnected) {
|
|
44164
44845
|
mounted.usageRequestGeneration += 1;
|
|
44165
44846
|
usageRefreshAttempts.delete(composer);
|
|
44166
44847
|
const timer = usageRefreshTimers.get(composer);
|
|
@@ -44209,6 +44890,7 @@ ${usage_default}`;
|
|
|
44209
44890
|
void refreshHarnessAvailability();
|
|
44210
44891
|
}
|
|
44211
44892
|
pendingReplacements.clear();
|
|
44893
|
+
void questions.refresh();
|
|
44212
44894
|
};
|
|
44213
44895
|
const scheduleScan = (refreshTargets = false) => {
|
|
44214
44896
|
refreshTargetsOnNextScan ||= refreshTargets;
|
|
@@ -44392,7 +45074,12 @@ ${usage_default}`;
|
|
|
44392
45074
|
};
|
|
44393
45075
|
mutationObserver.observe(document.documentElement, {
|
|
44394
45076
|
attributes: true,
|
|
44395
|
-
attributeFilter: [
|
|
45077
|
+
attributeFilter: [
|
|
45078
|
+
"hidden",
|
|
45079
|
+
"aria-hidden",
|
|
45080
|
+
"data-codex-composer-root",
|
|
45081
|
+
...NATIVE_COMPOSER_REQUEST_ATTRIBUTES
|
|
45082
|
+
],
|
|
44396
45083
|
characterData: true,
|
|
44397
45084
|
childList: true,
|
|
44398
45085
|
subtree: true
|
|
@@ -44503,6 +45190,21 @@ ${usage_default}`;
|
|
|
44503
45190
|
const connectedComposers = () => [...mountedByComposer.values()].filter(
|
|
44504
45191
|
(mounted) => isMountedComposer(mounted.composer) && mounted.control.root.isConnected
|
|
44505
45192
|
);
|
|
45193
|
+
const questions = installRendererQuestions(window, () => {
|
|
45194
|
+
const visible = connectedComposers().filter(
|
|
45195
|
+
(mounted2) => mounted2.composer.getClientRects().length > 0 && controller.get(mounted2.composer).agent !== "codex"
|
|
45196
|
+
);
|
|
45197
|
+
const mounted = visible.length === 1 ? visible[0] : void 0;
|
|
45198
|
+
const threadId = mounted ? threadIdFromComposerModelTarget(findComposerModelTarget(mounted.composer)) : null;
|
|
45199
|
+
const hostId2 = mounted?.hostId;
|
|
45200
|
+
const route = hostId2 ? window.__codexhostHostRoutingV1?.forHost(hostId2) : null;
|
|
45201
|
+
return mounted && threadId && hostId2 && route ? {
|
|
45202
|
+
hostId: hostId2,
|
|
45203
|
+
threadId,
|
|
45204
|
+
composer: mounted.composer,
|
|
45205
|
+
route: route.manager
|
|
45206
|
+
} : null;
|
|
45207
|
+
});
|
|
44506
45208
|
const api = {
|
|
44507
45209
|
remoteConnections: (request) => handleRemoteConnectionsRequest(remoteConnections, request),
|
|
44508
45210
|
currentThreadId() {
|
|
@@ -44594,6 +45296,7 @@ ${usage_default}`;
|
|
|
44594
45296
|
dispose() {
|
|
44595
45297
|
if (disposed) return;
|
|
44596
45298
|
disposed = true;
|
|
45299
|
+
questions.dispose();
|
|
44597
45300
|
usageNotificationDispose();
|
|
44598
45301
|
adapterDispose?.();
|
|
44599
45302
|
adapterDispose = null;
|
|
@@ -44669,6 +45372,7 @@ ${usage_default}`;
|
|
|
44669
45372
|
var LAUNCH_ASSETS = [
|
|
44670
45373
|
...CLIENT_OWNED_VOICE_ASSETS,
|
|
44671
45374
|
{
|
|
45375
|
+
platform: "darwin",
|
|
44672
45376
|
version: AUDITED_CPA_LIVE_VOICE_DESKTOP_VERSION,
|
|
44673
45377
|
initial: AUDITED_CPA_LIVE_VOICE_APP_INITIAL_ASSET,
|
|
44674
45378
|
shared: SHARED_ASSET,
|
|
@@ -44736,7 +45440,12 @@ ${usage_default}`;
|
|
|
44736
45440
|
if (disposed) return;
|
|
44737
45441
|
try {
|
|
44738
45442
|
const names = loadedAssetNames(target.document, target.performance);
|
|
44739
|
-
const assets = selectVoiceAssets(
|
|
45443
|
+
const assets = selectVoiceAssets(
|
|
45444
|
+
LAUNCH_ASSETS,
|
|
45445
|
+
names,
|
|
45446
|
+
config2.desktopVersion,
|
|
45447
|
+
config2.desktopPlatform
|
|
45448
|
+
);
|
|
44740
45449
|
if (assets) {
|
|
44741
45450
|
module ??= await importModule(`app://-/assets/${assets.shared}`);
|
|
44742
45451
|
if (disposed) return;
|
|
@@ -44975,26 +45684,35 @@ ${usage_default}`;
|
|
|
44975
45684
|
for (const restore of restores.reverse()) restore();
|
|
44976
45685
|
throw error51;
|
|
44977
45686
|
}
|
|
45687
|
+
const alignedSnapshot = ({ subscriber, instance }) => {
|
|
45688
|
+
try {
|
|
45689
|
+
const snapshot = subscriber.getSnapshot();
|
|
45690
|
+
const instanceSnapshot = instance.getSnapshot();
|
|
45691
|
+
if (!capable(snapshot) || !capable(instanceSnapshot) || !equal(snapshot, instanceSnapshot))
|
|
45692
|
+
return void 0;
|
|
45693
|
+
return snapshot;
|
|
45694
|
+
} catch {
|
|
45695
|
+
return void 0;
|
|
45696
|
+
}
|
|
45697
|
+
};
|
|
44978
45698
|
return {
|
|
44979
45699
|
dispose() {
|
|
44980
45700
|
for (const restore of restores.splice(0).reverse()) restore();
|
|
44981
45701
|
},
|
|
44982
45702
|
current() {
|
|
44983
45703
|
const current = [...currentFibers()].flatMap(hooks);
|
|
44984
|
-
return bindings.every((
|
|
44985
|
-
|
|
44986
|
-
|
|
44987
|
-
|
|
44988
|
-
|
|
44989
|
-
|
|
44990
|
-
return
|
|
44991
|
-
|
|
44992
|
-
return Array.isArray(hook.memoizedState) && hook.memoizedState[0] === subscriber && hook.memoizedState[1]?.[0] === signal && hook.next?.queue === instance && capable(committed) && equal(committed, snapshot) && (!realtimeOnly || snapshot.isCapable);
|
|
44993
|
-
});
|
|
44994
|
-
} catch {
|
|
44995
|
-
return false;
|
|
44996
|
-
}
|
|
45704
|
+
return bindings.every((binding) => {
|
|
45705
|
+
const snapshot = alignedSnapshot(binding);
|
|
45706
|
+
if (!snapshot) return false;
|
|
45707
|
+
const { subscriber, signal, instance } = binding;
|
|
45708
|
+
return current.some((hook) => {
|
|
45709
|
+
const committed = hook.next?.memoizedState;
|
|
45710
|
+
return Array.isArray(hook.memoizedState) && hook.memoizedState[0] === subscriber && hook.memoizedState[1]?.[0] === signal && hook.next?.queue === instance && capable(committed) && equal(committed, snapshot) && (!realtimeOnly || snapshot.isCapable);
|
|
45711
|
+
});
|
|
44997
45712
|
});
|
|
45713
|
+
},
|
|
45714
|
+
projectedCapable() {
|
|
45715
|
+
return bindings.length > 0 && bindings.every((binding) => alignedSnapshot(binding)?.isCapable === true);
|
|
44998
45716
|
}
|
|
44999
45717
|
};
|
|
45000
45718
|
}
|
|
@@ -45047,7 +45765,12 @@ ${usage_default}`;
|
|
|
45047
45765
|
if (disposed) return;
|
|
45048
45766
|
try {
|
|
45049
45767
|
const names = loadedAssetNames(target.document, target.performance);
|
|
45050
|
-
const assets = selectVoiceAssets(
|
|
45768
|
+
const assets = selectVoiceAssets(
|
|
45769
|
+
CLIENT_OWNED_VOICE_ASSETS,
|
|
45770
|
+
names,
|
|
45771
|
+
config2.desktopVersion,
|
|
45772
|
+
config2.desktopPlatform
|
|
45773
|
+
);
|
|
45051
45774
|
if (!assets) {
|
|
45052
45775
|
handle.status = "unsupported";
|
|
45053
45776
|
} else if (!allowed()) handle.status = "pending";
|
|
@@ -45064,7 +45787,7 @@ ${usage_default}`;
|
|
|
45064
45787
|
(element) => element.getBoundingClientRect().width > 0 && !element.closest("[hidden], [inert]")
|
|
45065
45788
|
);
|
|
45066
45789
|
if (composers.length !== 1) throw new Error("Voice composer unavailable");
|
|
45067
|
-
if (composers[0] !== composer || !binding
|
|
45790
|
+
if (composers[0] !== composer || !binding || !binding.current() && binding.projectedCapable()) {
|
|
45068
45791
|
binding?.dispose();
|
|
45069
45792
|
binding = void 0;
|
|
45070
45793
|
composer = composers[0];
|
|
@@ -45077,12 +45800,12 @@ ${usage_default}`;
|
|
|
45077
45800
|
chatGateway()
|
|
45078
45801
|
);
|
|
45079
45802
|
}
|
|
45080
|
-
handle.status = "active";
|
|
45803
|
+
handle.status = binding.projectedCapable() ? "active" : "native-ineligible";
|
|
45081
45804
|
}
|
|
45082
45805
|
} catch {
|
|
45083
45806
|
handle.status = "unsupported";
|
|
45084
45807
|
}
|
|
45085
|
-
if (handle.status !== "active") {
|
|
45808
|
+
if (handle.status !== "active" && handle.status !== "native-ineligible") {
|
|
45086
45809
|
binding?.dispose();
|
|
45087
45810
|
binding = void 0;
|
|
45088
45811
|
composer = void 0;
|
|
@@ -45558,7 +46281,8 @@ ${usage_default}`;
|
|
|
45558
46281
|
const assets = selectVoiceAssets(
|
|
45559
46282
|
NATIVE_CHAT_VOICE_ASSETS,
|
|
45560
46283
|
loadedAssetNames(target.document, target.performance),
|
|
45561
|
-
config2.desktopVersion
|
|
46284
|
+
config2.desktopVersion,
|
|
46285
|
+
config2.desktopPlatform
|
|
45562
46286
|
);
|
|
45563
46287
|
if (!assets?.settings) return;
|
|
45564
46288
|
const load = options.importModule ?? ((url2) => import(url2));
|
|
@@ -45615,6 +46339,10 @@ ${usage_default}`;
|
|
|
45615
46339
|
|
|
45616
46340
|
lucide/dist/esm/defaultAttributes.mjs:
|
|
45617
46341
|
lucide/dist/esm/createElement.mjs:
|
|
46342
|
+
lucide/dist/esm/icons/check.mjs:
|
|
46343
|
+
lucide/dist/esm/icons/message-circle-question-mark.mjs:
|
|
46344
|
+
lucide/dist/esm/icons/pencil.mjs:
|
|
46345
|
+
lucide/dist/esm/icons/x.mjs:
|
|
45618
46346
|
lucide/dist/esm/icons/boxes.mjs:
|
|
45619
46347
|
lucide/dist/esm/icons/circle-check.mjs:
|
|
45620
46348
|
lucide/dist/esm/icons/chevron-down.mjs:
|
|
@@ -45650,11 +46378,9 @@ lucide/dist/esm/icons/terminal.mjs:
|
|
|
45650
46378
|
lucide/dist/esm/icons/scroll-text.mjs:
|
|
45651
46379
|
lucide/dist/esm/icons/search.mjs:
|
|
45652
46380
|
lucide/dist/esm/icons/circle-question-mark.mjs:
|
|
45653
|
-
lucide/dist/esm/icons/x.mjs:
|
|
45654
46381
|
lucide/dist/esm/icons/users.mjs:
|
|
45655
46382
|
lucide/dist/esm/icons/plus.mjs:
|
|
45656
46383
|
lucide/dist/esm/icons/circle-alert.mjs:
|
|
45657
|
-
lucide/dist/esm/icons/check.mjs:
|
|
45658
46384
|
lucide/dist/esm/icons/lock.mjs:
|
|
45659
46385
|
lucide/dist/esm/icons/shield.mjs:
|
|
45660
46386
|
lucide/dist/esm/icons/shield-alert.mjs:
|