@codexhost/cli-darwin-x64 0.19.0 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +45 -4
- package/app/console-web.js +1124 -684
- package/app/desktop-controller.mjs +197 -50
- package/app/host-runtime.mjs +36192 -29254
- package/app/plugins/antigravity/assets/icon.svg +1 -1
- package/app/plugins/antigravity/plugin.mjs +8863 -4094
- package/app/plugins/claude-code/plugin.mjs +173 -26
- package/app/plugins/codebuddy/plugin.mjs +71 -6
- package/app/plugins/codex-usage/plugin.mjs +56 -4
- package/app/plugins/copilot/plugin.mjs +48 -4
- package/app/plugins/cursor-cli/plugin.mjs +48 -4
- package/app/plugins/deepseek-harness/plugin.mjs +73 -9
- package/app/plugins/devin/plugin.mjs +47 -4
- package/app/plugins/grok/plugin.mjs +84 -13
- package/app/plugins/hermes/plugin.mjs +47 -4
- package/app/plugins/kimi-code/plugin.mjs +73 -14
- package/app/plugins/kiro-cli/plugin.mjs +48 -4
- package/app/plugins/omp/plugin.mjs +74 -7
- package/app/plugins/opencode/plugin.mjs +74 -13
- package/app/plugins/pi/plugin.mjs +75 -7
- package/app/plugins/qoder/plugin.mjs +85 -5
- package/app/plugins/qoder-cn/plugin.mjs +85 -5
- package/app/plugins/qwen-code/plugin.mjs +48 -4
- package/app/plugins/workbuddy/plugin.mjs +75 -9
- package/app/plugins/zcode/plugin.mjs +56 -4
- package/app/renderer-extension.js +1431 -737
- package/app/web/assets/index-BdmZfTRW.js +201 -0
- package/app/web/assets/index-DJW4bmyx.css +1 -0
- package/app/web/assets/langs/{graphql-B8vkg11W.js → graphql-ChAeyPkT.js} +1 -1
- package/app/web/assets/langs/{http-DmoDEjMt.js → http-BvreBIbD.js} +1 -1
- package/app/web/assets/langs/{php-DJ5ovfAM.js → php-D8omCIuJ.js} +1 -1
- package/app/web/assets/langs/{rst-U5-R5x3p.js → rst-Do7RLLCS.js} +1 -1
- package/app/web/assets/langs/{ruby-VKVsnS0H.js → ruby-rH_O_vse.js} +1 -1
- package/app/web/assets/langs/{svelte-C20lOv9V.js → svelte-xZy73wAj.js} +1 -1
- package/app/web/assets/langs/{vue-z6Y-lzP-.js → vue-C4DW8agZ.js} +1 -1
- package/app/web/assets/{vendor-dSL872WO.js → vendor-C9g2bw8s.js} +3 -3
- package/app/web/codexhost-settings.js +1130 -686
- package/app/web/index.html +4 -3
- package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -69
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +7 -7
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +27 -27
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-session/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar-documentpreview/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-tool/client.js +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +7 -7
- package/app/web-modules/server.mjs +1144 -731
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-BNQIOOHE.css +0 -1
- package/app/web/assets/index-Feo4BkqN.js +0 -199
|
@@ -15059,13 +15059,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15059
15059
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15060
15060
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15061
15061
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15062
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
15063
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15064
|
+
requestId: external_exports.string().min(1),
|
|
15065
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
15066
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
15067
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
15068
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15069
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15062
15070
|
var usageMeasurementSchema = external_exports.object({
|
|
15071
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15063
15072
|
value: finiteNonNegativeNumberSchema,
|
|
15064
15073
|
turnId: external_exports.string().min(1).max(1024),
|
|
15065
15074
|
at: nonNegativeSafeIntegerSchema
|
|
15066
15075
|
}).strict();
|
|
15067
15076
|
var usageMeasurementsSchema = external_exports.object({
|
|
15068
|
-
|
|
15077
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15078
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15079
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15080
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15069
15081
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15070
15082
|
}).strict();
|
|
15071
15083
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text4) => text4.length <= maximum));
|
|
@@ -15085,6 +15097,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15085
15097
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15086
15098
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15087
15099
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15100
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15088
15101
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15089
15102
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15090
15103
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15496,6 +15509,10 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15496
15509
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15497
15510
|
}).strict();
|
|
15498
15511
|
|
|
15512
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15513
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15514
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15515
|
+
|
|
15499
15516
|
// ../../shared-contracts/dist/client-channel.js
|
|
15500
15517
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15501
15518
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -15526,6 +15543,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15526
15543
|
cursor: clientChannelCursorSchema,
|
|
15527
15544
|
cwd: external_exports.string().optional()
|
|
15528
15545
|
}),
|
|
15546
|
+
external_exports.object({
|
|
15547
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15548
|
+
cursor: clientChannelCursorSchema,
|
|
15549
|
+
harnessId: external_exports.string().min(1)
|
|
15550
|
+
}),
|
|
15529
15551
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15530
15552
|
external_exports.object({
|
|
15531
15553
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15597,6 +15619,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15597
15619
|
var clientTurnSchema = external_exports.object({
|
|
15598
15620
|
id: external_exports.string().min(1),
|
|
15599
15621
|
status: external_exports.string().min(1),
|
|
15622
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15623
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15600
15624
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15601
15625
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15602
15626
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -15635,7 +15659,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15635
15659
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15636
15660
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15637
15661
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15638
|
-
command: external_exports.object({
|
|
15662
|
+
command: external_exports.object({
|
|
15663
|
+
name: external_exports.string().min(1),
|
|
15664
|
+
turn: clientTurnSchema,
|
|
15665
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15666
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15667
|
+
}).optional(),
|
|
15639
15668
|
thread: external_exports.object({
|
|
15640
15669
|
id: external_exports.string().min(1),
|
|
15641
15670
|
cwd: external_exports.string(),
|
|
@@ -15843,7 +15872,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
15843
15872
|
quotaUntil: external_exports.string().optional()
|
|
15844
15873
|
}).strict().optional()
|
|
15845
15874
|
}).strict();
|
|
15846
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
15847
15875
|
|
|
15848
15876
|
// ../../shared-contracts/dist/delegation-read.js
|
|
15849
15877
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -16809,6 +16837,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16809
16837
|
"completed",
|
|
16810
16838
|
"failed",
|
|
16811
16839
|
"interrupted",
|
|
16840
|
+
"needsInput",
|
|
16812
16841
|
"timedOut",
|
|
16813
16842
|
"unreadable",
|
|
16814
16843
|
"notFound"
|
|
@@ -16855,13 +16884,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16855
16884
|
var thread = { ...target, threadId: identity };
|
|
16856
16885
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16857
16886
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16887
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16858
16888
|
external_exports.strictObject({
|
|
16859
16889
|
kind: external_exports.literal("list"),
|
|
16860
16890
|
...target,
|
|
16861
16891
|
cursor: external_exports.string().nullable(),
|
|
16862
16892
|
archived: external_exports.boolean()
|
|
16863
16893
|
}),
|
|
16864
|
-
external_exports.strictObject({
|
|
16894
|
+
external_exports.strictObject({
|
|
16895
|
+
kind: external_exports.literal("read"),
|
|
16896
|
+
...thread,
|
|
16897
|
+
page: external_exports.strictObject({
|
|
16898
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16899
|
+
epoch: identity.optional(),
|
|
16900
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16901
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16902
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16903
|
+
message: "A history continuation requires its connection epoch"
|
|
16904
|
+
}).optional()
|
|
16905
|
+
}),
|
|
16865
16906
|
external_exports.strictObject({
|
|
16866
16907
|
kind: external_exports.literal("configure"),
|
|
16867
16908
|
...thread,
|
|
@@ -17130,6 +17171,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
17130
17171
|
"totalCredits",
|
|
17131
17172
|
"contextUsagePercent",
|
|
17132
17173
|
"outputTokensPerSecond",
|
|
17174
|
+
"sessionOutputTokensPerSecond",
|
|
17133
17175
|
"apiOutputTokensPerSecond",
|
|
17134
17176
|
"costSource",
|
|
17135
17177
|
"unpricedModels"
|
|
@@ -17152,6 +17194,7 @@ function parseHostUsage(value) {
|
|
|
17152
17194
|
for (const field2 of [
|
|
17153
17195
|
"totalCredits",
|
|
17154
17196
|
"contextUsagePercent",
|
|
17197
|
+
"sessionOutputTokensPerSecond",
|
|
17155
17198
|
"apiOutputTokensPerSecond"
|
|
17156
17199
|
]) {
|
|
17157
17200
|
const candidate = value[field2];
|
|
@@ -17230,6 +17273,7 @@ var requestTokenFields = [
|
|
|
17230
17273
|
"cacheWrite1hInputTokens",
|
|
17231
17274
|
"outputTokens",
|
|
17232
17275
|
"reasoningOutputTokens",
|
|
17276
|
+
"timedOutputTokens",
|
|
17233
17277
|
"startedAtMs",
|
|
17234
17278
|
"completedAtMs"
|
|
17235
17279
|
];
|
|
@@ -17282,6 +17326,14 @@ function parseHostUsageRequest(value) {
|
|
|
17282
17326
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17283
17327
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17284
17328
|
}
|
|
17329
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17330
|
+
if (request.startedAtMs === void 0) {
|
|
17331
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17332
|
+
}
|
|
17333
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17334
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17335
|
+
}
|
|
17336
|
+
}
|
|
17285
17337
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17286
17338
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17287
17339
|
}
|
|
@@ -21879,6 +21931,7 @@ var PiRpcSession = class {
|
|
|
21879
21931
|
#autonomousLifecycleHandler = null;
|
|
21880
21932
|
#usageHandler = null;
|
|
21881
21933
|
#usageRequestStartedAtMs = null;
|
|
21934
|
+
#usageRequestTimingUnavailable = false;
|
|
21882
21935
|
// Pieces of the unterminated frame; joined once at its newline so a large frame (a long
|
|
21883
21936
|
// Session's get_entries) costs linear rather than quadratic copying on the Host event loop.
|
|
21884
21937
|
#buffer = [];
|
|
@@ -21954,14 +22007,29 @@ var PiRpcSession = class {
|
|
|
21954
22007
|
/** Every finished assistant message is one model request, with or without an active Turn. */
|
|
21955
22008
|
#observeUsage(value) {
|
|
21956
22009
|
if (value.type === "message_start") {
|
|
21957
|
-
if (isRecord9(value.message) && value.message.role === "assistant")
|
|
22010
|
+
if (isRecord9(value.message) && value.message.role === "assistant") {
|
|
21958
22011
|
this.#usageRequestStartedAtMs = null;
|
|
22012
|
+
this.#usageRequestTimingUnavailable = false;
|
|
22013
|
+
}
|
|
21959
22014
|
return;
|
|
21960
22015
|
}
|
|
21961
22016
|
if (value.type === "message_update") {
|
|
21962
22017
|
const event = value.assistantMessageEvent;
|
|
21963
|
-
if (this.#usageRequestStartedAtMs === null && isRecord9(event) && typeof event.type === "string"
|
|
21964
|
-
|
|
22018
|
+
if (this.#usageRequestStartedAtMs === null && !this.#usageRequestTimingUnavailable && isRecord9(event) && typeof event.type === "string") {
|
|
22019
|
+
if (
|
|
22020
|
+
// Native thinking starts can precede visible text by seconds; output usage includes it.
|
|
22021
|
+
/^(thinking|reasoning|thought)_start$/u.test(event.type) || /^(text|thinking|reasoning|thought)_delta$/u.test(event.type) && typeof event.delta === "string" && event.delta.length > 0
|
|
22022
|
+
)
|
|
22023
|
+
this.#usageRequestStartedAtMs = Date.now();
|
|
22024
|
+
else if (event.type === "toolcall_delta" && typeof event.delta === "string" && event.delta.length > 0) {
|
|
22025
|
+
try {
|
|
22026
|
+
JSON.parse(event.delta);
|
|
22027
|
+
this.#usageRequestTimingUnavailable = true;
|
|
22028
|
+
} catch {
|
|
22029
|
+
this.#usageRequestStartedAtMs = Date.now();
|
|
22030
|
+
}
|
|
22031
|
+
} else if (event.type === "toolcall_end")
|
|
22032
|
+
this.#usageRequestTimingUnavailable = true;
|
|
21965
22033
|
}
|
|
21966
22034
|
return;
|
|
21967
22035
|
}
|
|
@@ -27648,13 +27648,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
27648
27648
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
27649
27649
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
27650
27650
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
27651
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
27652
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27653
|
+
requestId: external_exports.string().min(1),
|
|
27654
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
27655
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
27656
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
27657
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
27658
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
27651
27659
|
var usageMeasurementSchema = external_exports.object({
|
|
27660
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27652
27661
|
value: finiteNonNegativeNumberSchema,
|
|
27653
27662
|
turnId: external_exports.string().min(1).max(1024),
|
|
27654
27663
|
at: nonNegativeSafeIntegerSchema
|
|
27655
27664
|
}).strict();
|
|
27656
27665
|
var usageMeasurementsSchema = external_exports.object({
|
|
27657
|
-
|
|
27666
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
27667
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
27668
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
27669
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
27658
27670
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
27659
27671
|
}).strict();
|
|
27660
27672
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -27674,6 +27686,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
27674
27686
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27675
27687
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27676
27688
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
27689
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
27677
27690
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
27678
27691
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
27679
27692
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -28085,6 +28098,10 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
28085
28098
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
28086
28099
|
}).strict();
|
|
28087
28100
|
|
|
28101
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
28102
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
28103
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
28104
|
+
|
|
28088
28105
|
// ../../shared-contracts/dist/client-channel.js
|
|
28089
28106
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
28090
28107
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -28115,6 +28132,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
28115
28132
|
cursor: clientChannelCursorSchema,
|
|
28116
28133
|
cwd: external_exports.string().optional()
|
|
28117
28134
|
}),
|
|
28135
|
+
external_exports.object({
|
|
28136
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
28137
|
+
cursor: clientChannelCursorSchema,
|
|
28138
|
+
harnessId: external_exports.string().min(1)
|
|
28139
|
+
}),
|
|
28118
28140
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
28119
28141
|
external_exports.object({
|
|
28120
28142
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -28186,6 +28208,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
28186
28208
|
var clientTurnSchema = external_exports.object({
|
|
28187
28209
|
id: external_exports.string().min(1),
|
|
28188
28210
|
status: external_exports.string().min(1),
|
|
28211
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
28212
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
28189
28213
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
28190
28214
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
28191
28215
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -28224,7 +28248,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
28224
28248
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
28225
28249
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
28226
28250
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
28227
|
-
command: external_exports.object({
|
|
28251
|
+
command: external_exports.object({
|
|
28252
|
+
name: external_exports.string().min(1),
|
|
28253
|
+
turn: clientTurnSchema,
|
|
28254
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
28255
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
28256
|
+
}).optional(),
|
|
28228
28257
|
thread: external_exports.object({
|
|
28229
28258
|
id: external_exports.string().min(1),
|
|
28230
28259
|
cwd: external_exports.string(),
|
|
@@ -28432,7 +28461,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
28432
28461
|
quotaUntil: external_exports.string().optional()
|
|
28433
28462
|
}).strict().optional()
|
|
28434
28463
|
}).strict();
|
|
28435
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
28436
28464
|
|
|
28437
28465
|
// ../../shared-contracts/dist/delegation-read.js
|
|
28438
28466
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -29398,6 +29426,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
29398
29426
|
"completed",
|
|
29399
29427
|
"failed",
|
|
29400
29428
|
"interrupted",
|
|
29429
|
+
"needsInput",
|
|
29401
29430
|
"timedOut",
|
|
29402
29431
|
"unreadable",
|
|
29403
29432
|
"notFound"
|
|
@@ -29444,13 +29473,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
29444
29473
|
var thread = { ...target, threadId: identity };
|
|
29445
29474
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
29446
29475
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
29476
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
29447
29477
|
external_exports.strictObject({
|
|
29448
29478
|
kind: external_exports.literal("list"),
|
|
29449
29479
|
...target,
|
|
29450
29480
|
cursor: external_exports.string().nullable(),
|
|
29451
29481
|
archived: external_exports.boolean()
|
|
29452
29482
|
}),
|
|
29453
|
-
external_exports.strictObject({
|
|
29483
|
+
external_exports.strictObject({
|
|
29484
|
+
kind: external_exports.literal("read"),
|
|
29485
|
+
...thread,
|
|
29486
|
+
page: external_exports.strictObject({
|
|
29487
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
29488
|
+
epoch: identity.optional(),
|
|
29489
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
29490
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
29491
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
29492
|
+
message: "A history continuation requires its connection epoch"
|
|
29493
|
+
}).optional()
|
|
29494
|
+
}),
|
|
29454
29495
|
external_exports.strictObject({
|
|
29455
29496
|
kind: external_exports.literal("configure"),
|
|
29456
29497
|
...thread,
|
|
@@ -29608,12 +29649,14 @@ function discoverySpec(variant) {
|
|
|
29608
29649
|
installRoots: {
|
|
29609
29650
|
posix: [
|
|
29610
29651
|
"~/.local/bin",
|
|
29652
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29611
29653
|
`~/${configDirectory}/bin`,
|
|
29612
29654
|
VERSION_MANAGER_ROOTS,
|
|
29613
29655
|
"/usr/local/bin",
|
|
29614
29656
|
"/opt/homebrew/bin"
|
|
29615
29657
|
],
|
|
29616
29658
|
windows: [
|
|
29659
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29617
29660
|
`\${LOCALAPPDATA}/Programs/${productName}`,
|
|
29618
29661
|
`\${LOCALAPPDATA}/${productName}`,
|
|
29619
29662
|
`~/${configDirectory}/bin`,
|
|
@@ -29995,6 +30038,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
29995
30038
|
"totalCredits",
|
|
29996
30039
|
"contextUsagePercent",
|
|
29997
30040
|
"outputTokensPerSecond",
|
|
30041
|
+
"sessionOutputTokensPerSecond",
|
|
29998
30042
|
"apiOutputTokensPerSecond",
|
|
29999
30043
|
"costSource",
|
|
30000
30044
|
"unpricedModels"
|
|
@@ -30017,6 +30061,7 @@ function parseHostUsage(value) {
|
|
|
30017
30061
|
for (const field2 of [
|
|
30018
30062
|
"totalCredits",
|
|
30019
30063
|
"contextUsagePercent",
|
|
30064
|
+
"sessionOutputTokensPerSecond",
|
|
30020
30065
|
"apiOutputTokensPerSecond"
|
|
30021
30066
|
]) {
|
|
30022
30067
|
const candidate = value[field2];
|
|
@@ -30095,6 +30140,7 @@ var requestTokenFields = [
|
|
|
30095
30140
|
"cacheWrite1hInputTokens",
|
|
30096
30141
|
"outputTokens",
|
|
30097
30142
|
"reasoningOutputTokens",
|
|
30143
|
+
"timedOutputTokens",
|
|
30098
30144
|
"startedAtMs",
|
|
30099
30145
|
"completedAtMs"
|
|
30100
30146
|
];
|
|
@@ -53046,6 +53092,8 @@ var QoderSession = class {
|
|
|
53046
53092
|
}
|
|
53047
53093
|
}
|
|
53048
53094
|
async #dispatchMessage(message) {
|
|
53095
|
+
if ((message.type === "assistant" || message.type === "stream_event" || message.type === "user") && message.parent_tool_use_id !== null && message.parent_tool_use_id !== void 0)
|
|
53096
|
+
return;
|
|
53049
53097
|
switch (message.type) {
|
|
53050
53098
|
case "system":
|
|
53051
53099
|
this.#handleSystemMessage(message);
|
|
@@ -53222,7 +53270,17 @@ var QoderSession = class {
|
|
|
53222
53270
|
if (!Array.isArray(content))
|
|
53223
53271
|
return;
|
|
53224
53272
|
const hasToolUseInMessage = content.some((block) => typeof block === "object" && block !== null && block.type === "tool_use");
|
|
53225
|
-
for (const block of content) {
|
|
53273
|
+
for (const [index, block] of content.entries()) {
|
|
53274
|
+
if (message.uuid && typeof block === "object" && block !== null) {
|
|
53275
|
+
const raw = block;
|
|
53276
|
+
const text = raw.type === "text" ? raw.text : raw.type === "thinking" ? raw.thinking : void 0;
|
|
53277
|
+
if (typeof text === "string") {
|
|
53278
|
+
const key = JSON.stringify([message.uuid, index, raw.type, text]);
|
|
53279
|
+
if (this.#activeTurn.projectedTextSnapshots.has(key))
|
|
53280
|
+
continue;
|
|
53281
|
+
this.#activeTurn.projectedTextSnapshots.add(key);
|
|
53282
|
+
}
|
|
53283
|
+
}
|
|
53226
53284
|
this.#projectAssistantBlock(block, hasToolUseInMessage);
|
|
53227
53285
|
}
|
|
53228
53286
|
}
|
|
@@ -53344,6 +53402,11 @@ var QoderSession = class {
|
|
|
53344
53402
|
});
|
|
53345
53403
|
}
|
|
53346
53404
|
} else if (rawBlock.type === "tool_use") {
|
|
53405
|
+
if (typeof rawBlock.id === "string" && rawBlock.id.trim()) {
|
|
53406
|
+
if (this.#activeTurn.startedToolIds.has(rawBlock.id))
|
|
53407
|
+
return;
|
|
53408
|
+
this.#activeTurn.startedToolIds.add(rawBlock.id);
|
|
53409
|
+
}
|
|
53347
53410
|
if (this.#activeTurn.activeStreamingMessageItemId) {
|
|
53348
53411
|
this.#emitEvent({
|
|
53349
53412
|
type: "item.completed",
|
|
@@ -53823,6 +53886,8 @@ var QoderSession = class {
|
|
|
53823
53886
|
this.#activeTurn = {
|
|
53824
53887
|
turnId: command.turnId,
|
|
53825
53888
|
userMessageUuid,
|
|
53889
|
+
startedToolIds: /* @__PURE__ */ new Set(),
|
|
53890
|
+
projectedTextSnapshots: /* @__PURE__ */ new Set(),
|
|
53826
53891
|
accumulatedStreamingText: "",
|
|
53827
53892
|
accumulatedStreamingReasoning: ""
|
|
53828
53893
|
};
|
|
@@ -54211,6 +54276,8 @@ var QoderSession = class {
|
|
|
54211
54276
|
this.#activeTurn = {
|
|
54212
54277
|
turnId: command.turnId,
|
|
54213
54278
|
userMessageUuid,
|
|
54279
|
+
startedToolIds: /* @__PURE__ */ new Set(),
|
|
54280
|
+
projectedTextSnapshots: /* @__PURE__ */ new Set(),
|
|
54214
54281
|
accumulatedStreamingText: "",
|
|
54215
54282
|
accumulatedStreamingReasoning: "",
|
|
54216
54283
|
isCompaction,
|
|
@@ -55344,6 +55411,19 @@ function createQoderInstallation(environment, command, variant = "global") {
|
|
|
55344
55411
|
message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
|
|
55345
55412
|
};
|
|
55346
55413
|
const output = await run(["update", "--check"]);
|
|
55414
|
+
if (/unable to determine installation method/i.test(output))
|
|
55415
|
+
return {
|
|
55416
|
+
currentVersion,
|
|
55417
|
+
latestVersion: "Unknown",
|
|
55418
|
+
updateAvailable: false,
|
|
55419
|
+
canUpdate: false,
|
|
55420
|
+
messageCode: "qoder-check-unavailable",
|
|
55421
|
+
notice: {
|
|
55422
|
+
en: "This Qoder CLI cannot determine how it was installed and cannot check for updates. Use the installer or application that installed it.",
|
|
55423
|
+
"zh-CN": "当前 Qoder CLI 无法识别自身的安装方式,不能检查更新。请使用安装它的安装程序或应用进行更新。"
|
|
55424
|
+
},
|
|
55425
|
+
message: "This Qoder CLI cannot determine how it was installed and cannot check for updates."
|
|
55426
|
+
};
|
|
55347
55427
|
const available = output.match(/Update available:\s*\S+\s*(?:->|\u2192)\s*(\S+)/i);
|
|
55348
55428
|
if (available?.[1])
|
|
55349
55429
|
return {
|