@karlorz/codexhost-cli-win32-x64 0.14.0-3 → 0.14.0-5
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 +187 -18
- package/app/desktop-controller.mjs +59 -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 +916 -138
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Run Pi and Claude Code as first-class external harnesses inside Codex Desktop.
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm install -g @karlorz/codexhost-cli@0.14.0-
|
|
10
|
+
npm install -g @karlorz/codexhost-cli@0.14.0-5
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
Do not install this package directly. npm selects it through the optional dependencies of `@karlorz/codexhost-cli`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"schemaVersion":1,"version":"0.14.0-
|
|
1
|
+
{"schemaVersion":1,"version":"0.14.0-5","distribution":"npm","target":"windows-x64"}
|
package/app/console-server.mjs
CHANGED
|
@@ -3926,10 +3926,10 @@ var $ZodObject = /* @__PURE__ */ $constructor("$ZodObject", (inst, def) => {
|
|
|
3926
3926
|
const shape = def.shape;
|
|
3927
3927
|
const propValues = {};
|
|
3928
3928
|
for (const key in shape) {
|
|
3929
|
-
const
|
|
3930
|
-
if (
|
|
3929
|
+
const field2 = shape[key]._zod;
|
|
3930
|
+
if (field2.values) {
|
|
3931
3931
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3932
|
-
for (const v of
|
|
3932
|
+
for (const v of field2.values)
|
|
3933
3933
|
propValues[key].add(v);
|
|
3934
3934
|
}
|
|
3935
3935
|
}
|
|
@@ -15759,6 +15759,62 @@ function isConsoleHostMethod(method) {
|
|
|
15759
15759
|
// packages/shared-contracts/dist/version.js
|
|
15760
15760
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
15761
15761
|
|
|
15762
|
+
// packages/shared-contracts/dist/thread-questions.js
|
|
15763
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
15764
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
15765
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
15766
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
15767
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
15768
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
15769
|
+
});
|
|
15770
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
15771
|
+
interactionId: hostInteractionIdSchema,
|
|
15772
|
+
turnId: hostTurnIdSchema,
|
|
15773
|
+
title: external_exports.string().optional(),
|
|
15774
|
+
expiresAt: external_exports.string().optional(),
|
|
15775
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
15776
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
15777
|
+
external_exports.strictObject({
|
|
15778
|
+
...field,
|
|
15779
|
+
type: external_exports.literal("choice"),
|
|
15780
|
+
multiple: external_exports.boolean(),
|
|
15781
|
+
allowOther: external_exports.boolean(),
|
|
15782
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15783
|
+
value: external_exports.string().min(1),
|
|
15784
|
+
label: external_exports.string(),
|
|
15785
|
+
description: external_exports.string().optional()
|
|
15786
|
+
})).min(1)
|
|
15787
|
+
}),
|
|
15788
|
+
external_exports.strictObject({
|
|
15789
|
+
...field,
|
|
15790
|
+
type: external_exports.literal("text"),
|
|
15791
|
+
multiline: external_exports.boolean(),
|
|
15792
|
+
secret: external_exports.literal(false),
|
|
15793
|
+
placeholder: external_exports.string().optional(),
|
|
15794
|
+
prefill: external_exports.string().optional()
|
|
15795
|
+
})
|
|
15796
|
+
])).min(1)
|
|
15797
|
+
});
|
|
15798
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15799
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15800
|
+
});
|
|
15801
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15802
|
+
threadId: hostThreadIdSchema,
|
|
15803
|
+
interactionId: hostInteractionIdSchema,
|
|
15804
|
+
turnId: hostTurnIdSchema,
|
|
15805
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15806
|
+
cancelled: external_exports.boolean().optional()
|
|
15807
|
+
});
|
|
15808
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15809
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15810
|
+
threadId: hostThreadIdSchema,
|
|
15811
|
+
interactionId: hostInteractionIdSchema,
|
|
15812
|
+
turnId: hostTurnIdSchema
|
|
15813
|
+
});
|
|
15814
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15815
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15816
|
+
});
|
|
15817
|
+
|
|
15762
15818
|
// packages/shared-contracts/dist/idle-release.js
|
|
15763
15819
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
15764
15820
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -17992,9 +18048,9 @@ function parseAnnouncement(document) {
|
|
|
17992
18048
|
const fields = /* @__PURE__ */ new Map();
|
|
17993
18049
|
for (const line of (match[1] ?? "").split("\n")) {
|
|
17994
18050
|
if (!line.trim()) continue;
|
|
17995
|
-
const
|
|
17996
|
-
if (!
|
|
17997
|
-
fields.set(
|
|
18051
|
+
const field2 = /^(enabled|title|type):[ \t]*(.+?)\s*$/u.exec(line);
|
|
18052
|
+
if (!field2?.[1] || !field2[2] || fields.has(field2[1])) return null;
|
|
18053
|
+
fields.set(field2[1], field2[2]);
|
|
17998
18054
|
}
|
|
17999
18055
|
if (fields.get("enabled") !== "true") return null;
|
|
18000
18056
|
let title = fields.get("title");
|
package/app/console-web.js
CHANGED
|
@@ -3105,10 +3105,10 @@
|
|
|
3105
3105
|
const shape = def.shape;
|
|
3106
3106
|
const propValues = {};
|
|
3107
3107
|
for (const key in shape) {
|
|
3108
|
-
const
|
|
3109
|
-
if (
|
|
3108
|
+
const field2 = shape[key]._zod;
|
|
3109
|
+
if (field2.values) {
|
|
3110
3110
|
propValues[key] ?? (propValues[key] = /* @__PURE__ */ new Set());
|
|
3111
|
-
for (const v of
|
|
3111
|
+
for (const v of field2.values)
|
|
3112
3112
|
propValues[key].add(v);
|
|
3113
3113
|
}
|
|
3114
3114
|
}
|
|
@@ -14977,6 +14977,62 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14977
14977
|
// ../shared-contracts/dist/version.js
|
|
14978
14978
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14979
14979
|
|
|
14980
|
+
// ../shared-contracts/dist/thread-questions.js
|
|
14981
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
14982
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
14983
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
14984
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
14985
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
14986
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
14987
|
+
});
|
|
14988
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
14989
|
+
interactionId: hostInteractionIdSchema,
|
|
14990
|
+
turnId: hostTurnIdSchema,
|
|
14991
|
+
title: external_exports.string().optional(),
|
|
14992
|
+
expiresAt: external_exports.string().optional(),
|
|
14993
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
14994
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
14995
|
+
external_exports.strictObject({
|
|
14996
|
+
...field,
|
|
14997
|
+
type: external_exports.literal("choice"),
|
|
14998
|
+
multiple: external_exports.boolean(),
|
|
14999
|
+
allowOther: external_exports.boolean(),
|
|
15000
|
+
options: external_exports.array(external_exports.strictObject({
|
|
15001
|
+
value: external_exports.string().min(1),
|
|
15002
|
+
label: external_exports.string(),
|
|
15003
|
+
description: external_exports.string().optional()
|
|
15004
|
+
})).min(1)
|
|
15005
|
+
}),
|
|
15006
|
+
external_exports.strictObject({
|
|
15007
|
+
...field,
|
|
15008
|
+
type: external_exports.literal("text"),
|
|
15009
|
+
multiline: external_exports.boolean(),
|
|
15010
|
+
secret: external_exports.literal(false),
|
|
15011
|
+
placeholder: external_exports.string().optional(),
|
|
15012
|
+
prefill: external_exports.string().optional()
|
|
15013
|
+
})
|
|
15014
|
+
])).min(1)
|
|
15015
|
+
});
|
|
15016
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
15017
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
15018
|
+
});
|
|
15019
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
15020
|
+
threadId: hostThreadIdSchema,
|
|
15021
|
+
interactionId: hostInteractionIdSchema,
|
|
15022
|
+
turnId: hostTurnIdSchema,
|
|
15023
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
15024
|
+
cancelled: external_exports.boolean().optional()
|
|
15025
|
+
});
|
|
15026
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
15027
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
15028
|
+
threadId: hostThreadIdSchema,
|
|
15029
|
+
interactionId: hostInteractionIdSchema,
|
|
15030
|
+
turnId: hostTurnIdSchema
|
|
15031
|
+
});
|
|
15032
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
15033
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
15034
|
+
});
|
|
15035
|
+
|
|
14980
15036
|
// ../shared-contracts/dist/idle-release.js
|
|
14981
15037
|
var IDLE_RELEASE_SETTINGS_METHOD = "codexhost/settings/idle-release/set";
|
|
14982
15038
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
@@ -19188,8 +19244,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19188
19244
|
return input;
|
|
19189
19245
|
}
|
|
19190
19246
|
function createNumberField(document2, input) {
|
|
19191
|
-
const
|
|
19192
|
-
|
|
19247
|
+
const field2 = document2.createElement("div");
|
|
19248
|
+
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";
|
|
19193
19249
|
const control = document2.createElement("input");
|
|
19194
19250
|
control.type = "number";
|
|
19195
19251
|
control.id = input.id;
|
|
@@ -19202,8 +19258,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
19202
19258
|
unit.className = "text-xs text-settings-muted";
|
|
19203
19259
|
unit.setAttribute("aria-hidden", "true");
|
|
19204
19260
|
unit.textContent = input.unit;
|
|
19205
|
-
|
|
19206
|
-
return { field, control };
|
|
19261
|
+
field2.append(control, unit);
|
|
19262
|
+
return { field: field2, control };
|
|
19207
19263
|
}
|
|
19208
19264
|
|
|
19209
19265
|
// src/settings/voice-messages.ts
|
|
@@ -22574,7 +22630,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22574
22630
|
var DECIMAL = /^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/iu;
|
|
22575
22631
|
function modelPriceDraft(key, price) {
|
|
22576
22632
|
const prices = Object.fromEntries(
|
|
22577
|
-
MODEL_PRICE_FIELDS.map((
|
|
22633
|
+
MODEL_PRICE_FIELDS.map((field2) => [field2, price?.[field2]?.toString() ?? ""])
|
|
22578
22634
|
);
|
|
22579
22635
|
return { model: key, prices };
|
|
22580
22636
|
}
|
|
@@ -22585,18 +22641,18 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22585
22641
|
return { error: { kind: "duplicate", key } };
|
|
22586
22642
|
}
|
|
22587
22643
|
const price = {};
|
|
22588
|
-
for (const
|
|
22589
|
-
const text = draft.prices[
|
|
22644
|
+
for (const field2 of MODEL_PRICE_FIELDS) {
|
|
22645
|
+
const text = draft.prices[field2].trim();
|
|
22590
22646
|
if (text === "") {
|
|
22591
|
-
if (
|
|
22592
|
-
return { error: { kind: "priceRequired", field } };
|
|
22647
|
+
if (field2 === "input" || field2 === "output")
|
|
22648
|
+
return { error: { kind: "priceRequired", field: field2 } };
|
|
22593
22649
|
continue;
|
|
22594
22650
|
}
|
|
22595
22651
|
const value = Number(text);
|
|
22596
22652
|
if (!DECIMAL.test(text) || !Number.isFinite(value)) {
|
|
22597
|
-
return { error: { kind: "priceInvalid", field } };
|
|
22653
|
+
return { error: { kind: "priceInvalid", field: field2 } };
|
|
22598
22654
|
}
|
|
22599
|
-
price[
|
|
22655
|
+
price[field2] = value;
|
|
22600
22656
|
}
|
|
22601
22657
|
return {
|
|
22602
22658
|
change: {
|
|
@@ -22616,7 +22672,7 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22616
22672
|
}
|
|
22617
22673
|
function formatPrice(messages, price) {
|
|
22618
22674
|
return MODEL_PRICE_FIELDS.map(
|
|
22619
|
-
(
|
|
22675
|
+
(field2) => `${messages.fields[field2]} ${price[field2] ?? messages.unset}`
|
|
22620
22676
|
).join(" \xB7 ");
|
|
22621
22677
|
}
|
|
22622
22678
|
function draftErrorText(messages, error51) {
|
|
@@ -22684,18 +22740,18 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
22684
22740
|
function renderEditor(modelId, view, isCurrent) {
|
|
22685
22741
|
const existing = view.entries.find((entry) => entry.key === modelId);
|
|
22686
22742
|
const draft = modelPriceDraft(modelId, existing?.price ?? null);
|
|
22687
|
-
const
|
|
22743
|
+
const field2 = (label, value, placeholder = "") => h(document2, "input", {
|
|
22688
22744
|
type: "text",
|
|
22689
22745
|
className: "console-input",
|
|
22690
22746
|
value,
|
|
22691
22747
|
placeholder,
|
|
22692
22748
|
"aria-label": label
|
|
22693
22749
|
});
|
|
22694
|
-
const model2 =
|
|
22750
|
+
const model2 = field2(messages.model, modelId);
|
|
22695
22751
|
model2.readOnly = true;
|
|
22696
22752
|
const prices = Object.fromEntries(
|
|
22697
22753
|
MODEL_PRICE_FIELDS.map((name) => {
|
|
22698
|
-
const input =
|
|
22754
|
+
const input = field2(
|
|
22699
22755
|
messages.fields[name],
|
|
22700
22756
|
draft.prices[name],
|
|
22701
22757
|
name === "input" || name === "output" ? messages.required : messages.notSet
|
|
@@ -23507,8 +23563,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
23507
23563
|
for (const cell of options.cells) {
|
|
23508
23564
|
const key = options.singleDay ? cell.hour : cell.weekday * 24 + cell.hour;
|
|
23509
23565
|
const totals2 = byHour.get(key) ?? emptyTotals();
|
|
23510
|
-
for (const
|
|
23511
|
-
totals2[
|
|
23566
|
+
for (const field2 of Object.keys(totals2))
|
|
23567
|
+
totals2[field2] += cell.totals[field2];
|
|
23512
23568
|
byHour.set(key, totals2);
|
|
23513
23569
|
}
|
|
23514
23570
|
const max = Math.max(0, ...[...byHour.values()].map((totals2) => measured(totals2, measure)));
|
|
@@ -23871,8 +23927,8 @@ th[aria-sort] .console-usage-sort__mark {
|
|
|
23871
23927
|
save();
|
|
23872
23928
|
load();
|
|
23873
23929
|
}
|
|
23874
|
-
function toggleFilter(
|
|
23875
|
-
view[
|
|
23930
|
+
function toggleFilter(field2, key) {
|
|
23931
|
+
view[field2] = view[field2] === key ? "" : key;
|
|
23876
23932
|
changed();
|
|
23877
23933
|
}
|
|
23878
23934
|
function selectDate(next) {
|
|
@@ -24288,8 +24344,8 @@ ${messages.creditsCoverage}: ${value.reportedRequests} / ${row.requests}` : void
|
|
|
24288
24344
|
}
|
|
24289
24345
|
];
|
|
24290
24346
|
}
|
|
24291
|
-
function rowFilter(
|
|
24292
|
-
const selected = view[
|
|
24347
|
+
function rowFilter(field2, key, label, detail) {
|
|
24348
|
+
const selected = view[field2] === key;
|
|
24293
24349
|
const button2 = focusKey(
|
|
24294
24350
|
h(
|
|
24295
24351
|
document2,
|
|
@@ -24303,9 +24359,9 @@ ${detail}` : ""}`
|
|
|
24303
24359
|
},
|
|
24304
24360
|
label
|
|
24305
24361
|
),
|
|
24306
|
-
`${
|
|
24362
|
+
`${field2}:row:${key}`
|
|
24307
24363
|
);
|
|
24308
|
-
button2.addEventListener("click", () => toggleFilter(
|
|
24364
|
+
button2.addEventListener("click", () => toggleFilter(field2, key));
|
|
24309
24365
|
return button2;
|
|
24310
24366
|
}
|
|
24311
24367
|
function panel(title, content, extra = null, wide = false) {
|
|
@@ -25145,7 +25201,7 @@ ${detail}` : ""}`
|
|
|
25145
25201
|
);
|
|
25146
25202
|
if (!dialog) return;
|
|
25147
25203
|
const document2 = options.container.ownerDocument;
|
|
25148
|
-
const
|
|
25204
|
+
const field2 = (label, value, placeholder = "", hint = "") => {
|
|
25149
25205
|
const wrapper = remoteElement(document2, "div", "settings-credential-dialog__field");
|
|
25150
25206
|
const input = remoteElement(document2, "input");
|
|
25151
25207
|
input.id = preferenceId("remote-field");
|
|
@@ -25165,13 +25221,13 @@ ${detail}` : ""}`
|
|
|
25165
25221
|
dialog.body.append(wrapper);
|
|
25166
25222
|
return input;
|
|
25167
25223
|
};
|
|
25168
|
-
const name =
|
|
25224
|
+
const name = field2(t("\u540D\u79F0", "Name"), previous?.displayName ?? "");
|
|
25169
25225
|
name.required = true;
|
|
25170
25226
|
const addressHint = t(
|
|
25171
25227
|
"user@hostname\uFF0C\u6216 ~/.ssh/config \u4E2D\u7684\u4E3B\u673A\u522B\u540D",
|
|
25172
25228
|
"user@hostname, or a host alias from ~/.ssh/config"
|
|
25173
25229
|
);
|
|
25174
|
-
const hostname3 =
|
|
25230
|
+
const hostname3 = field2(
|
|
25175
25231
|
t("SSH \u5730\u5740", "SSH address"),
|
|
25176
25232
|
previous?.sshHost ?? "",
|
|
25177
25233
|
"user@hostname",
|
|
@@ -25180,7 +25236,7 @@ ${detail}` : ""}`
|
|
|
25180
25236
|
hostname3.required = true;
|
|
25181
25237
|
hostname3.pattern = "[^\\s\\-]\\S*";
|
|
25182
25238
|
hostname3.title = addressHint;
|
|
25183
|
-
const port =
|
|
25239
|
+
const port = field2(
|
|
25184
25240
|
t("\u7AEF\u53E3\uFF08\u53EF\u9009\uFF09", "Port (optional)"),
|
|
25185
25241
|
previous?.sshPort?.toString() ?? "",
|
|
25186
25242
|
"22"
|
|
@@ -25189,7 +25245,7 @@ ${detail}` : ""}`
|
|
|
25189
25245
|
port.min = "1";
|
|
25190
25246
|
port.max = "65535";
|
|
25191
25247
|
port.step = "1";
|
|
25192
|
-
const identity =
|
|
25248
|
+
const identity = field2(
|
|
25193
25249
|
t("\u79C1\u94A5\u8DEF\u5F84\uFF08\u53EF\u9009\uFF09", "Identity file (optional)"),
|
|
25194
25250
|
previous?.identity ?? "",
|
|
25195
25251
|
"~/.ssh/id_ed25519"
|
|
@@ -28154,14 +28210,14 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
28154
28210
|
description: messages.idleReleaseTimeoutDescription,
|
|
28155
28211
|
controlId: minutesId
|
|
28156
28212
|
});
|
|
28157
|
-
const { field, control: minutes } = createNumberField(document2, {
|
|
28213
|
+
const { field: field2, control: minutes } = createNumberField(document2, {
|
|
28158
28214
|
id: minutesId,
|
|
28159
28215
|
describedBy: timeout.description.id,
|
|
28160
28216
|
unit: messages.idleReleaseMinutes,
|
|
28161
28217
|
min: IDLE_RELEASE_TIMEOUT_MINUTES_MIN,
|
|
28162
28218
|
max: IDLE_RELEASE_TIMEOUT_MINUTES_MAX
|
|
28163
28219
|
});
|
|
28164
|
-
timeout.item.append(
|
|
28220
|
+
timeout.item.append(field2);
|
|
28165
28221
|
timeout.item.id = preferenceId("idle-release-timeout");
|
|
28166
28222
|
enabled.setAttribute("aria-controls", timeout.item.id);
|
|
28167
28223
|
card.append(toggle.item, timeout.item);
|
|
@@ -28182,7 +28238,7 @@ ${messages.harnessVersionLatest}: ${harnessVersionLabel(version2.state, messages
|
|
|
28182
28238
|
statusText.textContent = value === "applied" ? "" : statusMessages[value];
|
|
28183
28239
|
};
|
|
28184
28240
|
const setInvalid = (invalid) => {
|
|
28185
|
-
|
|
28241
|
+
field2.dataset.invalid = String(invalid);
|
|
28186
28242
|
timeout.description.dataset.invalid = String(invalid);
|
|
28187
28243
|
timeout.description.textContent = invalid ? messages.idleReleaseInvalid : messages.idleReleaseTimeoutDescription;
|
|
28188
28244
|
minutes.setAttribute("aria-invalid", String(invalid));
|
|
@@ -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
|
}
|
|
@@ -14885,6 +14885,62 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
14885
14885
|
// ../shared-contracts/dist/version.js
|
|
14886
14886
|
var WORKSPACE_CONTRACT_VERSION = 1;
|
|
14887
14887
|
|
|
14888
|
+
// ../shared-contracts/dist/thread-questions.js
|
|
14889
|
+
var threadQuestionsParamsSchema = external_exports.strictObject({ threadId: hostThreadIdSchema });
|
|
14890
|
+
var field = { id: external_exports.string().min(1), prompt: external_exports.string(), optional: external_exports.boolean() };
|
|
14891
|
+
var questionAutoResolutionSchema = external_exports.strictObject({
|
|
14892
|
+
deadlineUnixMs: external_exports.number().int().min(0).max(864e13),
|
|
14893
|
+
action: external_exports.enum(["recommended", "decline"]),
|
|
14894
|
+
resetOnActivity: external_exports.boolean().optional()
|
|
14895
|
+
});
|
|
14896
|
+
var threadQuestionSchema = external_exports.strictObject({
|
|
14897
|
+
interactionId: hostInteractionIdSchema,
|
|
14898
|
+
turnId: hostTurnIdSchema,
|
|
14899
|
+
title: external_exports.string().optional(),
|
|
14900
|
+
expiresAt: external_exports.string().optional(),
|
|
14901
|
+
autoResolution: questionAutoResolutionSchema.optional(),
|
|
14902
|
+
questions: external_exports.array(external_exports.discriminatedUnion("type", [
|
|
14903
|
+
external_exports.strictObject({
|
|
14904
|
+
...field,
|
|
14905
|
+
type: external_exports.literal("choice"),
|
|
14906
|
+
multiple: external_exports.boolean(),
|
|
14907
|
+
allowOther: external_exports.boolean(),
|
|
14908
|
+
options: external_exports.array(external_exports.strictObject({
|
|
14909
|
+
value: external_exports.string().min(1),
|
|
14910
|
+
label: external_exports.string(),
|
|
14911
|
+
description: external_exports.string().optional()
|
|
14912
|
+
})).min(1)
|
|
14913
|
+
}),
|
|
14914
|
+
external_exports.strictObject({
|
|
14915
|
+
...field,
|
|
14916
|
+
type: external_exports.literal("text"),
|
|
14917
|
+
multiline: external_exports.boolean(),
|
|
14918
|
+
secret: external_exports.literal(false),
|
|
14919
|
+
placeholder: external_exports.string().optional(),
|
|
14920
|
+
prefill: external_exports.string().optional()
|
|
14921
|
+
})
|
|
14922
|
+
])).min(1)
|
|
14923
|
+
});
|
|
14924
|
+
var threadQuestionsResultSchema = external_exports.strictObject({
|
|
14925
|
+
questions: external_exports.array(threadQuestionSchema)
|
|
14926
|
+
});
|
|
14927
|
+
var threadQuestionRespondParamsSchema = external_exports.strictObject({
|
|
14928
|
+
threadId: hostThreadIdSchema,
|
|
14929
|
+
interactionId: hostInteractionIdSchema,
|
|
14930
|
+
turnId: hostTurnIdSchema,
|
|
14931
|
+
answers: external_exports.record(external_exports.string(), external_exports.array(external_exports.string())),
|
|
14932
|
+
cancelled: external_exports.boolean().optional()
|
|
14933
|
+
});
|
|
14934
|
+
var threadQuestionRespondResultSchema = external_exports.strictObject({ accepted: external_exports.literal(true) });
|
|
14935
|
+
var threadQuestionActivityParamsSchema = external_exports.strictObject({
|
|
14936
|
+
threadId: hostThreadIdSchema,
|
|
14937
|
+
interactionId: hostInteractionIdSchema,
|
|
14938
|
+
turnId: hostTurnIdSchema
|
|
14939
|
+
});
|
|
14940
|
+
var threadQuestionActivityResultSchema = external_exports.strictObject({
|
|
14941
|
+
autoResolution: questionAutoResolutionSchema.nullable()
|
|
14942
|
+
});
|
|
14943
|
+
|
|
14888
14944
|
// ../shared-contracts/dist/idle-release.js
|
|
14889
14945
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MIN = 5;
|
|
14890
14946
|
var IDLE_RELEASE_TIMEOUT_MINUTES_MAX = 1440;
|
|
@@ -16731,12 +16787,46 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16731
16787
|
function isRecord2(value) {
|
|
16732
16788
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
16733
16789
|
}
|
|
16734
|
-
function
|
|
16735
|
-
if (
|
|
16736
|
-
return
|
|
16737
|
-
}
|
|
16738
|
-
|
|
16739
|
-
|
|
16790
|
+
function notificationTarget(manager) {
|
|
16791
|
+
if (typeof manager.addNotificationCallback === "function") {
|
|
16792
|
+
return manager;
|
|
16793
|
+
}
|
|
16794
|
+
const nested = manager.requestClient;
|
|
16795
|
+
return isRecord2(nested) && typeof nested.addNotificationCallback === "function" ? nested : null;
|
|
16796
|
+
}
|
|
16797
|
+
function notificationParams(notification) {
|
|
16798
|
+
if (!isRecord2(notification)) return null;
|
|
16799
|
+
return isRecord2(notification.params) ? notification.params : notification;
|
|
16800
|
+
}
|
|
16801
|
+
function notificationThreadId(notification) {
|
|
16802
|
+
const params = notificationParams(notification);
|
|
16803
|
+
if (!params) return null;
|
|
16804
|
+
if (typeof params.threadId === "string" && params.threadId) return params.threadId;
|
|
16805
|
+
if (typeof params.conversationId === "string" && params.conversationId)
|
|
16806
|
+
return params.conversationId;
|
|
16807
|
+
return null;
|
|
16808
|
+
}
|
|
16809
|
+
function turnStatus(notification) {
|
|
16810
|
+
const params = notificationParams(notification);
|
|
16811
|
+
if (!params) return null;
|
|
16812
|
+
if (typeof params.status === "string") return params.status;
|
|
16813
|
+
const turn = params.turn;
|
|
16814
|
+
return isRecord2(turn) && typeof turn.status === "string" ? turn.status : null;
|
|
16815
|
+
}
|
|
16816
|
+
function isExternalConversation(conversation, threadId) {
|
|
16817
|
+
return isRecord2(conversation) && conversation.id === threadId && conversation.modelProvider === "codexhost";
|
|
16818
|
+
}
|
|
16819
|
+
function firstQueuedItemId(items) {
|
|
16820
|
+
if (!Array.isArray(items)) return null;
|
|
16821
|
+
for (const item of items) {
|
|
16822
|
+
if (!isRecord2(item) || item.pausedReason != null) continue;
|
|
16823
|
+
if (typeof item.id === "string" && item.id) return item.id;
|
|
16824
|
+
}
|
|
16825
|
+
return null;
|
|
16826
|
+
}
|
|
16827
|
+
function installLocalQueueGate(target) {
|
|
16828
|
+
const getTurnCoordinator = target.getTurnCoordinator;
|
|
16829
|
+
const coordinator = getTurnCoordinator.call(target);
|
|
16740
16830
|
const queue = isRecord2(coordinator) ? coordinator.serverQueue : null;
|
|
16741
16831
|
if (!isRecord2(queue) || typeof queue.isEnabled !== "function") return null;
|
|
16742
16832
|
const descriptor = Object.getOwnPropertyDescriptor(queue, "isEnabled");
|
|
@@ -16745,13 +16835,8 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16745
16835
|
const getConversation = target.getConversation;
|
|
16746
16836
|
const isEnabled = (...args) => {
|
|
16747
16837
|
const threadId = args[0];
|
|
16748
|
-
if (typeof threadId === "string") {
|
|
16749
|
-
|
|
16750
|
-
if (isRecord2(conversation) && conversation.id === threadId && // Reserved transport marker from externalThreadValue, retained by
|
|
16751
|
-
// Desktop in both newly created and hydrated conversation metadata.
|
|
16752
|
-
conversation.modelProvider === "codexhost") {
|
|
16753
|
-
return false;
|
|
16754
|
-
}
|
|
16838
|
+
if (typeof threadId === "string" && isExternalConversation(getConversation.call(target, threadId), threadId)) {
|
|
16839
|
+
return false;
|
|
16755
16840
|
}
|
|
16756
16841
|
return original.apply(queue, args);
|
|
16757
16842
|
};
|
|
@@ -16760,6 +16845,90 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
16760
16845
|
if (queue.isEnabled === isEnabled) Object.defineProperty(queue, "isEnabled", descriptor);
|
|
16761
16846
|
};
|
|
16762
16847
|
}
|
|
16848
|
+
function installServerQueueDrain(target) {
|
|
16849
|
+
if (typeof target.sendRequest !== "function") return null;
|
|
16850
|
+
const notifications = notificationTarget(target);
|
|
16851
|
+
if (!notifications) return null;
|
|
16852
|
+
const getConversation = target.getConversation;
|
|
16853
|
+
const getTurnCoordinator = target.getTurnCoordinator;
|
|
16854
|
+
const getStreamRole = target.getStreamRole;
|
|
16855
|
+
const sendRequest = target.sendRequest;
|
|
16856
|
+
const draining = /* @__PURE__ */ new Set();
|
|
16857
|
+
let disposed = false;
|
|
16858
|
+
const isExternalOwner = (threadId) => {
|
|
16859
|
+
if (!isExternalConversation(getConversation.call(target, threadId), threadId)) return false;
|
|
16860
|
+
const role = getStreamRole.call(target, threadId);
|
|
16861
|
+
return !(isRecord2(role) && role.role === "follower");
|
|
16862
|
+
};
|
|
16863
|
+
const isIdle = (threadId, coordinator) => {
|
|
16864
|
+
const options = isRecord2(coordinator) ? coordinator.options : null;
|
|
16865
|
+
const host = isRecord2(options) ? options.submissionHost : null;
|
|
16866
|
+
if (isRecord2(host) && typeof host.getActiveTurnId === "function" && typeof host.hasPendingTurnStart === "function") {
|
|
16867
|
+
return host.getActiveTurnId.call(host, threadId) == null && host.hasPendingTurnStart.call(host, threadId) !== true;
|
|
16868
|
+
}
|
|
16869
|
+
const conversation = getConversation.call(target, threadId);
|
|
16870
|
+
return isRecord2(conversation) && isRecord2(conversation.threadRuntimeStatus) && conversation.threadRuntimeStatus.type === "idle";
|
|
16871
|
+
};
|
|
16872
|
+
const queuedSubmissionId = (coordinator, threadId) => {
|
|
16873
|
+
if (isRecord2(coordinator) && typeof coordinator.readMessages === "function") {
|
|
16874
|
+
const messages = coordinator.readMessages.call(coordinator, threadId);
|
|
16875
|
+
if (Array.isArray(messages)) return firstQueuedItemId(messages);
|
|
16876
|
+
}
|
|
16877
|
+
const queue = isRecord2(coordinator) ? coordinator.serverQueue : null;
|
|
16878
|
+
if (isRecord2(queue) && typeof queue.read === "function") {
|
|
16879
|
+
return firstQueuedItemId(queue.read.call(queue, threadId));
|
|
16880
|
+
}
|
|
16881
|
+
return null;
|
|
16882
|
+
};
|
|
16883
|
+
const drain = (threadId) => {
|
|
16884
|
+
if (disposed || draining.has(threadId) || !isExternalOwner(threadId)) return;
|
|
16885
|
+
const coordinator = getTurnCoordinator.call(target);
|
|
16886
|
+
if (!isIdle(threadId, coordinator)) return;
|
|
16887
|
+
const queuedSubmissionIdValue = queuedSubmissionId(coordinator, threadId);
|
|
16888
|
+
if (!queuedSubmissionIdValue) return;
|
|
16889
|
+
draining.add(threadId);
|
|
16890
|
+
Promise.resolve(
|
|
16891
|
+
sendRequest.call(target, "thread/queue/start", {
|
|
16892
|
+
threadId,
|
|
16893
|
+
queuedSubmissionId: queuedSubmissionIdValue
|
|
16894
|
+
})
|
|
16895
|
+
).catch((error51) => {
|
|
16896
|
+
const message = error51 instanceof Error ? error51.message : String(error51);
|
|
16897
|
+
if (message.includes("Queued follow-up was not found")) return;
|
|
16898
|
+
console.error("codexhost could not start the queued follow-up", error51);
|
|
16899
|
+
}).finally(() => {
|
|
16900
|
+
draining.delete(threadId);
|
|
16901
|
+
});
|
|
16902
|
+
};
|
|
16903
|
+
const onNotification = (notification) => {
|
|
16904
|
+
if (disposed) return;
|
|
16905
|
+
const method = isRecord2(notification) && typeof notification.method === "string" ? notification.method : null;
|
|
16906
|
+
const threadId = notificationThreadId(notification);
|
|
16907
|
+
if (!threadId) return;
|
|
16908
|
+
if (method === "turn/completed") {
|
|
16909
|
+
if (turnStatus(notification) === "interrupted") return;
|
|
16910
|
+
drain(threadId);
|
|
16911
|
+
return;
|
|
16912
|
+
}
|
|
16913
|
+
if (method === "thread/queue/changed") drain(threadId);
|
|
16914
|
+
};
|
|
16915
|
+
const unsubscribe = notifications.addNotificationCallback(
|
|
16916
|
+
["turn/completed", "thread/queue/changed"],
|
|
16917
|
+
onNotification
|
|
16918
|
+
);
|
|
16919
|
+
return () => {
|
|
16920
|
+
disposed = true;
|
|
16921
|
+
draining.clear();
|
|
16922
|
+
if (typeof unsubscribe === "function") unsubscribe();
|
|
16923
|
+
};
|
|
16924
|
+
}
|
|
16925
|
+
function installRendererExternalQueue(target) {
|
|
16926
|
+
if (!isRecord2(target) || typeof target.getTurnCoordinator !== "function" || typeof target.getConversation !== "function") {
|
|
16927
|
+
return null;
|
|
16928
|
+
}
|
|
16929
|
+
if (typeof target.getStreamRole === "function") return installServerQueueDrain(target);
|
|
16930
|
+
return installLocalQueueGate(target);
|
|
16931
|
+
}
|
|
16763
16932
|
|
|
16764
16933
|
// src/renderer-native-thread.ts
|
|
16765
16934
|
function isRecord3(value) {
|
|
@@ -17147,7 +17316,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17147
17316
|
if (BLOCKED_METHODS.has(method)) return true;
|
|
17148
17317
|
return method.startsWith("turn/") || method.startsWith("item/");
|
|
17149
17318
|
}
|
|
17150
|
-
function
|
|
17319
|
+
function notificationThreadId2(params) {
|
|
17151
17320
|
if (!isRecord5(params)) return void 0;
|
|
17152
17321
|
if (typeof params.threadId === "string" && params.threadId.length > 0) return params.threadId;
|
|
17153
17322
|
const thread = params.thread;
|
|
@@ -17171,7 +17340,7 @@ Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.
|
|
|
17171
17340
|
const message = event.data;
|
|
17172
17341
|
if (!isRecord5(message) || message.type !== "mcp-notification") return;
|
|
17173
17342
|
if (typeof message.method !== "string") return;
|
|
17174
|
-
const threadId =
|
|
17343
|
+
const threadId = notificationThreadId2(message.params);
|
|
17175
17344
|
if (message.method === "thread/realtime/started" && threadId) {
|
|
17176
17345
|
voiceThreadIds.add(threadId);
|
|
17177
17346
|
return;
|