@codexhost/cli-linux-arm64 0.20.0 → 0.22.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 +27 -6
- package/app/console-web.js +35 -7
- package/app/desktop-controller.mjs +166 -52
- package/app/host-runtime.mjs +35350 -28799
- package/app/plugins/antigravity/assets/icon.svg +1 -1
- package/app/plugins/antigravity/plugin.mjs +411 -231
- package/app/plugins/claude-code/plugin.mjs +538 -109
- package/app/plugins/codebuddy/plugin.mjs +36 -6
- package/app/plugins/codex-usage/plugin.mjs +36 -6
- package/app/plugins/copilot/plugin.mjs +28 -6
- package/app/plugins/cursor-cli/plugin.mjs +28 -6
- package/app/plugins/deepseek-harness/plugin.mjs +53 -11
- package/app/plugins/devin/plugin.mjs +28 -6
- package/app/plugins/grok/plugin.mjs +255 -192
- package/app/plugins/hermes/plugin.mjs +28 -6
- package/app/plugins/kimi-code/plugin.mjs +53 -16
- package/app/plugins/kiro-cli/plugin.mjs +28 -6
- package/app/plugins/omp/plugin.mjs +143 -28
- package/app/plugins/opencode/plugin.mjs +54 -15
- package/app/plugins/pi/plugin.mjs +154 -29
- package/app/plugins/qoder/plugin.mjs +43 -6
- package/app/plugins/qoder-cn/plugin.mjs +43 -6
- package/app/plugins/qwen-code/plugin.mjs +28 -6
- package/app/plugins/workbuddy/plugin.mjs +36 -6
- package/app/plugins/zcode/plugin.mjs +36 -6
- package/app/renderer-extension.js +27 -6
- package/app/web/assets/index-CN4a4sj0.js +201 -0
- package/app/web/assets/{index-D6-hvggd.css → index-DJW4bmyx.css} +1 -1
- package/app/web/codexhost-settings.js +35 -7
- package/app/web/index.html +2 -2
- package/app/web/plugins/deepseek-ai__dsh-api-remotes/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-api-session-controller/client.js +7 -7
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +9 -9
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +6 -6
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +22 -22
- package/app/web/plugins/deepseek-ai__dsh-client-ui-input-trigger/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-layout/client.js +2 -2
- package/app/web/plugins/deepseek-ai__dsh-client-ui-model-selection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-settings-general/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-sidebar/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 +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +2 -2
- package/app/web-modules/server.mjs +1123 -722
- 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-D85gPBbQ.js +0 -201
|
@@ -15060,7 +15060,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15060
15060
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15061
15061
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15062
15062
|
var usageOutputTimingSchema = external_exports.object({
|
|
15063
|
-
version: external_exports.literal(3).optional(),
|
|
15063
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15064
15064
|
requestId: external_exports.string().min(1),
|
|
15065
15065
|
turnId: external_exports.string().min(1).max(1024),
|
|
15066
15066
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15068,16 +15068,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15068
15068
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15069
15069
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15070
15070
|
var usageMeasurementSchema = external_exports.object({
|
|
15071
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15071
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15072
15072
|
value: finiteNonNegativeNumberSchema,
|
|
15073
15073
|
turnId: external_exports.string().min(1).max(1024),
|
|
15074
15074
|
at: nonNegativeSafeIntegerSchema
|
|
15075
15075
|
}).strict();
|
|
15076
15076
|
var usageMeasurementsSchema = external_exports.object({
|
|
15077
|
-
//
|
|
15078
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
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
15079
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15080
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15080
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15081
15081
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15082
15082
|
}).strict();
|
|
15083
15083
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text4) => text4.length <= maximum));
|
|
@@ -15543,6 +15543,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15543
15543
|
cursor: clientChannelCursorSchema,
|
|
15544
15544
|
cwd: external_exports.string().optional()
|
|
15545
15545
|
}),
|
|
15546
|
+
external_exports.object({
|
|
15547
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15548
|
+
cursor: clientChannelCursorSchema,
|
|
15549
|
+
harnessId: external_exports.string().min(1)
|
|
15550
|
+
}),
|
|
15546
15551
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15547
15552
|
external_exports.object({
|
|
15548
15553
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15614,6 +15619,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15614
15619
|
var clientTurnSchema = external_exports.object({
|
|
15615
15620
|
id: external_exports.string().min(1),
|
|
15616
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(),
|
|
15617
15624
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15618
15625
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15619
15626
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16830,6 +16837,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16830
16837
|
"completed",
|
|
16831
16838
|
"failed",
|
|
16832
16839
|
"interrupted",
|
|
16840
|
+
"needsInput",
|
|
16833
16841
|
"timedOut",
|
|
16834
16842
|
"unreadable",
|
|
16835
16843
|
"notFound"
|
|
@@ -16876,13 +16884,26 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16876
16884
|
var thread = { ...target, threadId: identity };
|
|
16877
16885
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16878
16886
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16887
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16879
16888
|
external_exports.strictObject({
|
|
16880
16889
|
kind: external_exports.literal("list"),
|
|
16881
16890
|
...target,
|
|
16882
16891
|
cursor: external_exports.string().nullable(),
|
|
16883
16892
|
archived: external_exports.boolean()
|
|
16884
16893
|
}),
|
|
16885
|
-
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
|
+
}),
|
|
16906
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
16886
16907
|
external_exports.strictObject({
|
|
16887
16908
|
kind: external_exports.literal("configure"),
|
|
16888
16909
|
...thread,
|
|
@@ -17107,18 +17128,6 @@ function sanitizeDiagnosticTail(value) {
|
|
|
17107
17128
|
return redacted.length <= DIAGNOSTIC_TAIL_MAX_LENGTH ? redacted : redacted.slice(-DIAGNOSTIC_TAIL_MAX_LENGTH);
|
|
17108
17129
|
}
|
|
17109
17130
|
|
|
17110
|
-
// ../../harness-adapter/dist/steer.js
|
|
17111
|
-
function unsupportedSteer(harnessLabel) {
|
|
17112
|
-
return {
|
|
17113
|
-
ok: false,
|
|
17114
|
-
error: {
|
|
17115
|
-
code: "unsupported",
|
|
17116
|
-
message: `${harnessLabel} cannot steer an active Turn natively`,
|
|
17117
|
-
retryable: false
|
|
17118
|
-
}
|
|
17119
|
-
};
|
|
17120
|
-
}
|
|
17121
|
-
|
|
17122
17131
|
// ../../harness-adapter/dist/usage.js
|
|
17123
17132
|
var tokenFields = [
|
|
17124
17133
|
"inputTokens",
|
|
@@ -17253,6 +17262,7 @@ var requestTokenFields = [
|
|
|
17253
17262
|
"cacheWrite1hInputTokens",
|
|
17254
17263
|
"outputTokens",
|
|
17255
17264
|
"reasoningOutputTokens",
|
|
17265
|
+
"timedOutputTokens",
|
|
17256
17266
|
"startedAtMs",
|
|
17257
17267
|
"completedAtMs"
|
|
17258
17268
|
];
|
|
@@ -17305,6 +17315,14 @@ function parseHostUsageRequest(value) {
|
|
|
17305
17315
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17306
17316
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17307
17317
|
}
|
|
17318
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17319
|
+
if (request.startedAtMs === void 0) {
|
|
17320
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17321
|
+
}
|
|
17322
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17323
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17324
|
+
}
|
|
17325
|
+
}
|
|
17308
17326
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17309
17327
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17310
17328
|
}
|
|
@@ -21644,6 +21662,15 @@ var PiRpcFaultError = class extends Error {
|
|
|
21644
21662
|
this.name = "PiRpcFaultError";
|
|
21645
21663
|
}
|
|
21646
21664
|
};
|
|
21665
|
+
var PiRpcSteerRejectedError = class extends Error {
|
|
21666
|
+
};
|
|
21667
|
+
var PiRpcSteerTargetEndedError = class extends PiRpcFaultError {
|
|
21668
|
+
history;
|
|
21669
|
+
constructor(history) {
|
|
21670
|
+
super("protocolError", "Pi Turn ended before steer admission could be confirmed; the isolated runtime was closed. Input hook effects are unknown, so do not automatically resend the input");
|
|
21671
|
+
this.history = history;
|
|
21672
|
+
}
|
|
21673
|
+
};
|
|
21647
21674
|
var PiRpcUnsupportedCommandError = class extends Error {
|
|
21648
21675
|
command;
|
|
21649
21676
|
constructor(command) {
|
|
@@ -22240,6 +22267,38 @@ var PiRpcSession = class {
|
|
|
22240
22267
|
throw fault;
|
|
22241
22268
|
}
|
|
22242
22269
|
}
|
|
22270
|
+
async steer(message3) {
|
|
22271
|
+
if (!this.#child || !this.#state || this.#closed || this.#failed) {
|
|
22272
|
+
throw new Error("Pi RPC Session is unavailable");
|
|
22273
|
+
}
|
|
22274
|
+
if (message3.length === 0)
|
|
22275
|
+
throw new Error("Pi steer text must not be empty");
|
|
22276
|
+
const target2 = this.#activeTurn;
|
|
22277
|
+
if (!target2 || target2.origin !== "requested" || target2.settlement !== "pending") {
|
|
22278
|
+
throw new PiRpcSteerRejectedError("Pi Turn is not accepting native input");
|
|
22279
|
+
}
|
|
22280
|
+
let admitted = false;
|
|
22281
|
+
const response = await this.#send("steer", { message: message3 }, () => {
|
|
22282
|
+
admitted = this.#activeTurn === target2 && target2.settlement === "pending";
|
|
22283
|
+
});
|
|
22284
|
+
if (isRecord9(response.data) && response.data.disposition !== void 0 && response.data.disposition !== "queued") {
|
|
22285
|
+
throw new Error("Pi steer was handled without confirming same-Turn queue admission");
|
|
22286
|
+
}
|
|
22287
|
+
if (!admitted) {
|
|
22288
|
+
let history;
|
|
22289
|
+
try {
|
|
22290
|
+
history = await this.getEntries();
|
|
22291
|
+
} finally {
|
|
22292
|
+
try {
|
|
22293
|
+
await this.close();
|
|
22294
|
+
} catch (error51) {
|
|
22295
|
+
if (history !== void 0)
|
|
22296
|
+
throw error51;
|
|
22297
|
+
}
|
|
22298
|
+
}
|
|
22299
|
+
throw new PiRpcSteerTargetEndedError(history);
|
|
22300
|
+
}
|
|
22301
|
+
}
|
|
22243
22302
|
async runTurn(text4, onEvent) {
|
|
22244
22303
|
if (!this.#child || !this.#state || this.#closed || this.#failed) {
|
|
22245
22304
|
throw new Error("Pi RPC Session is unavailable");
|
|
@@ -22803,7 +22862,9 @@ var PiRpcSession = class {
|
|
|
22803
22862
|
pending.resolve(value);
|
|
22804
22863
|
else {
|
|
22805
22864
|
const error51 = typeof value.error === "string" ? value.error : "Pi RPC command failed";
|
|
22806
|
-
if (
|
|
22865
|
+
if (pending.command === "steer" && value.command === "steer" && value.success === false) {
|
|
22866
|
+
pending.reject(new PiRpcSteerRejectedError(error51));
|
|
22867
|
+
} else if (value.command === pending.command && error51 === `Unknown command: ${pending.command}`) {
|
|
22807
22868
|
pending.reject(new PiRpcUnsupportedCommandError(pending.command));
|
|
22808
22869
|
} else {
|
|
22809
22870
|
pending.reject(new Error(error51));
|
|
@@ -23077,7 +23138,7 @@ var PiRpcSession = class {
|
|
|
23077
23138
|
child.stdin.write(frame, (error51) => error51 ? reject(error51) : resolve());
|
|
23078
23139
|
});
|
|
23079
23140
|
}
|
|
23080
|
-
#send(type, payload) {
|
|
23141
|
+
#send(type, payload, onResponse) {
|
|
23081
23142
|
const child = this.#child;
|
|
23082
23143
|
if (!child?.stdin.writable || this.#closed || this.#failed) {
|
|
23083
23144
|
return Promise.reject(new Error("Pi RPC stdin is unavailable"));
|
|
@@ -23086,7 +23147,10 @@ var PiRpcSession = class {
|
|
|
23086
23147
|
return new Promise((resolve, reject) => {
|
|
23087
23148
|
const pending = {
|
|
23088
23149
|
command: type,
|
|
23089
|
-
resolve
|
|
23150
|
+
resolve: (response) => {
|
|
23151
|
+
onResponse?.();
|
|
23152
|
+
resolve(response);
|
|
23153
|
+
},
|
|
23090
23154
|
reject,
|
|
23091
23155
|
timeout: null
|
|
23092
23156
|
};
|
|
@@ -23380,7 +23444,7 @@ var PiHarnessSession = class {
|
|
|
23380
23444
|
this.#requestedThinkingOptionId = options.thinkingOptionId;
|
|
23381
23445
|
this.#toolOutputLimit = options.toolOutputLimit;
|
|
23382
23446
|
this.#isFastSupported = options.isFastSupported;
|
|
23383
|
-
this.capabilities = {
|
|
23447
|
+
this.capabilities = ((session) => ({
|
|
23384
23448
|
configuration: {
|
|
23385
23449
|
selectModel: true,
|
|
23386
23450
|
selectThinkingOption: options.supportsThinkingSelection,
|
|
@@ -23389,8 +23453,12 @@ var PiHarnessSession = class {
|
|
|
23389
23453
|
},
|
|
23390
23454
|
history: { fork: true, forkAcrossCwd: true, rollbackLastTurn: true },
|
|
23391
23455
|
autonomousTurns: { observe: true },
|
|
23392
|
-
subagents: { observe: true, readTranscript: true }
|
|
23393
|
-
|
|
23456
|
+
subagents: { observe: true, readTranscript: true },
|
|
23457
|
+
// Root Tools provide an admission window; the transport also checks native receipt order.
|
|
23458
|
+
get steer() {
|
|
23459
|
+
return session.#canSteerActiveTurn();
|
|
23460
|
+
}
|
|
23461
|
+
}))(this);
|
|
23394
23462
|
this.commands = {
|
|
23395
23463
|
list: async () => ({ ok: true, value: await this.#refreshLiveCommands() }),
|
|
23396
23464
|
execute: (command) => this.#executeHarnessCommand(command)
|
|
@@ -23485,8 +23553,6 @@ var PiHarnessSession = class {
|
|
|
23485
23553
|
if (this.#phase !== "open") {
|
|
23486
23554
|
return { ok: false, error: invalidState("Pi Session is not open") };
|
|
23487
23555
|
}
|
|
23488
|
-
if (command.type === "turn.steer")
|
|
23489
|
-
return unsupportedSteer("Pi");
|
|
23490
23556
|
if (command.type === "turn.cancel")
|
|
23491
23557
|
return this.#cancel(command);
|
|
23492
23558
|
if (command.type === "interaction.respond")
|
|
@@ -23505,6 +23571,8 @@ var PiHarnessSession = class {
|
|
|
23505
23571
|
}
|
|
23506
23572
|
};
|
|
23507
23573
|
}
|
|
23574
|
+
if (command.type === "turn.steer")
|
|
23575
|
+
return this.#steer(command);
|
|
23508
23576
|
if (this.#acceptingTurn || this.#active || this.#configuring || this.#transport?.isBusy) {
|
|
23509
23577
|
return {
|
|
23510
23578
|
ok: false,
|
|
@@ -23564,6 +23632,9 @@ var PiHarnessSession = class {
|
|
|
23564
23632
|
agentMessageId: null,
|
|
23565
23633
|
compactionItem: null,
|
|
23566
23634
|
sawAssistantMessage: false,
|
|
23635
|
+
acceptedSteerCount: 0,
|
|
23636
|
+
acceptingSteers: true,
|
|
23637
|
+
pendingSteers: /* @__PURE__ */ new Set(),
|
|
23567
23638
|
reasoningItem: null,
|
|
23568
23639
|
tools: /* @__PURE__ */ new Map(),
|
|
23569
23640
|
interactions: /* @__PURE__ */ new Map(),
|
|
@@ -23825,6 +23896,47 @@ var PiHarnessSession = class {
|
|
|
23825
23896
|
this.#drainPendingAutonomousTurns(this.#transport);
|
|
23826
23897
|
}
|
|
23827
23898
|
}
|
|
23899
|
+
#canSteerActiveTurn() {
|
|
23900
|
+
const active = this.#active;
|
|
23901
|
+
return Boolean(this.#phase === "open" && active && !active.cancellationRequested && active.acceptingSteers && active.tools.size > 0 && this.#transport);
|
|
23902
|
+
}
|
|
23903
|
+
async #steer(command) {
|
|
23904
|
+
const text4 = command.input.map((input) => input.text).join("\n");
|
|
23905
|
+
if (text4.length === 0) {
|
|
23906
|
+
return {
|
|
23907
|
+
ok: false,
|
|
23908
|
+
error: {
|
|
23909
|
+
code: "invalidRequest",
|
|
23910
|
+
message: "Pi steer text must not be empty",
|
|
23911
|
+
retryable: false
|
|
23912
|
+
}
|
|
23913
|
+
};
|
|
23914
|
+
}
|
|
23915
|
+
const active = this.#active;
|
|
23916
|
+
const transport = this.#transport;
|
|
23917
|
+
if (!active || !transport || active.command.turnId !== command.turnId || !this.#canSteerActiveTurn()) {
|
|
23918
|
+
return { ok: false, error: invalidState("Pi Turn is not accepting native input") };
|
|
23919
|
+
}
|
|
23920
|
+
let accepted;
|
|
23921
|
+
try {
|
|
23922
|
+
accepted = transport.steer(text4).then(() => {
|
|
23923
|
+
active.acceptedSteerCount += 1;
|
|
23924
|
+
});
|
|
23925
|
+
active.pendingSteers.add(accepted);
|
|
23926
|
+
await accepted;
|
|
23927
|
+
return { ok: true, value: { accepted: true } };
|
|
23928
|
+
} catch (error51) {
|
|
23929
|
+
if (error51 instanceof PiRpcSteerRejectedError) {
|
|
23930
|
+
return { ok: false, error: invalidState(error51.message) };
|
|
23931
|
+
}
|
|
23932
|
+
if (error51 instanceof PiRpcSteerTargetEndedError)
|
|
23933
|
+
active.steerFailure = error51;
|
|
23934
|
+
throw error51;
|
|
23935
|
+
} finally {
|
|
23936
|
+
if (accepted)
|
|
23937
|
+
active.pendingSteers.delete(accepted);
|
|
23938
|
+
}
|
|
23939
|
+
}
|
|
23828
23940
|
async #cancel(command) {
|
|
23829
23941
|
const active = this.#active;
|
|
23830
23942
|
if (!active || active.command.turnId !== command.turnId) {
|
|
@@ -23948,6 +24060,9 @@ var PiHarnessSession = class {
|
|
|
23948
24060
|
agentMessageId: null,
|
|
23949
24061
|
compactionItem: null,
|
|
23950
24062
|
sawAssistantMessage: false,
|
|
24063
|
+
acceptedSteerCount: 0,
|
|
24064
|
+
acceptingSteers: false,
|
|
24065
|
+
pendingSteers: /* @__PURE__ */ new Set(),
|
|
23951
24066
|
reasoningItem: null,
|
|
23952
24067
|
tools: /* @__PURE__ */ new Map(),
|
|
23953
24068
|
interactions: /* @__PURE__ */ new Map(),
|
|
@@ -24214,6 +24329,9 @@ var PiHarnessSession = class {
|
|
|
24214
24329
|
agentMessageId: null,
|
|
24215
24330
|
compactionItem: null,
|
|
24216
24331
|
sawAssistantMessage: false,
|
|
24332
|
+
acceptedSteerCount: 0,
|
|
24333
|
+
acceptingSteers: false,
|
|
24334
|
+
pendingSteers: /* @__PURE__ */ new Set(),
|
|
24217
24335
|
reasoningItem: null,
|
|
24218
24336
|
tools: /* @__PURE__ */ new Map(),
|
|
24219
24337
|
interactions: /* @__PURE__ */ new Map(),
|
|
@@ -24656,13 +24774,16 @@ var PiHarnessSession = class {
|
|
|
24656
24774
|
}
|
|
24657
24775
|
}
|
|
24658
24776
|
async #completedTurnIdentity(active, transport) {
|
|
24659
|
-
|
|
24777
|
+
active.acceptingSteers = false;
|
|
24778
|
+
await Promise.allSettled([...active.pendingSteers]);
|
|
24779
|
+
const snapshot = mapPiSnapshot(active.steerFailure?.history ?? await transport.getEntries(), {
|
|
24660
24780
|
sessionId: transport.state.sessionId,
|
|
24661
24781
|
model: nativeModelForHistory(transport.state)
|
|
24662
24782
|
});
|
|
24663
24783
|
const created = snapshot.turns.filter((turn2) => turn2.input.length > 0 && !active.beforeNativeTurnKeys.has(turn2.nativeTurnRef.nativeTurnKey));
|
|
24664
|
-
|
|
24665
|
-
|
|
24784
|
+
const expected = 1 + active.acceptedSteerCount;
|
|
24785
|
+
if (created.length !== expected) {
|
|
24786
|
+
throw new Error(`Pi Turn persisted ${created.length} new User Entries; exactly ${expected} is required`);
|
|
24666
24787
|
}
|
|
24667
24788
|
const turn = created[0];
|
|
24668
24789
|
if (!turn)
|
|
@@ -24698,6 +24819,10 @@ var PiHarnessSession = class {
|
|
|
24698
24819
|
...nativeTurnRef ? { nativeTurnRef } : {}
|
|
24699
24820
|
});
|
|
24700
24821
|
active.resolveCompletion();
|
|
24822
|
+
if (active.steerFailure) {
|
|
24823
|
+
this.#fault(active.steerFailure);
|
|
24824
|
+
return;
|
|
24825
|
+
}
|
|
24701
24826
|
queueMicrotask(() => {
|
|
24702
24827
|
if (this.#phase !== "open")
|
|
24703
24828
|
return;
|
|
@@ -27649,7 +27649,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
27649
27649
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
27650
27650
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
27651
27651
|
var usageOutputTimingSchema = external_exports.object({
|
|
27652
|
-
version: external_exports.literal(3).optional(),
|
|
27652
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27653
27653
|
requestId: external_exports.string().min(1),
|
|
27654
27654
|
turnId: external_exports.string().min(1).max(1024),
|
|
27655
27655
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -27657,16 +27657,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
27657
27657
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
27658
27658
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
27659
27659
|
var usageMeasurementSchema = external_exports.object({
|
|
27660
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
27660
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27661
27661
|
value: finiteNonNegativeNumberSchema,
|
|
27662
27662
|
turnId: external_exports.string().min(1).max(1024),
|
|
27663
27663
|
at: nonNegativeSafeIntegerSchema
|
|
27664
27664
|
}).strict();
|
|
27665
27665
|
var usageMeasurementsSchema = external_exports.object({
|
|
27666
|
-
//
|
|
27667
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
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
27668
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
27669
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
27669
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
27670
27670
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
27671
27671
|
}).strict();
|
|
27672
27672
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -28132,6 +28132,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
28132
28132
|
cursor: clientChannelCursorSchema,
|
|
28133
28133
|
cwd: external_exports.string().optional()
|
|
28134
28134
|
}),
|
|
28135
|
+
external_exports.object({
|
|
28136
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
28137
|
+
cursor: clientChannelCursorSchema,
|
|
28138
|
+
harnessId: external_exports.string().min(1)
|
|
28139
|
+
}),
|
|
28135
28140
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
28136
28141
|
external_exports.object({
|
|
28137
28142
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -28203,6 +28208,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
28203
28208
|
var clientTurnSchema = external_exports.object({
|
|
28204
28209
|
id: external_exports.string().min(1),
|
|
28205
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(),
|
|
28206
28213
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
28207
28214
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
28208
28215
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -29419,6 +29426,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
29419
29426
|
"completed",
|
|
29420
29427
|
"failed",
|
|
29421
29428
|
"interrupted",
|
|
29429
|
+
"needsInput",
|
|
29422
29430
|
"timedOut",
|
|
29423
29431
|
"unreadable",
|
|
29424
29432
|
"notFound"
|
|
@@ -29465,13 +29473,26 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
29465
29473
|
var thread = { ...target, threadId: identity };
|
|
29466
29474
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
29467
29475
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
29476
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
29468
29477
|
external_exports.strictObject({
|
|
29469
29478
|
kind: external_exports.literal("list"),
|
|
29470
29479
|
...target,
|
|
29471
29480
|
cursor: external_exports.string().nullable(),
|
|
29472
29481
|
archived: external_exports.boolean()
|
|
29473
29482
|
}),
|
|
29474
|
-
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
|
+
}),
|
|
29495
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
29475
29496
|
external_exports.strictObject({
|
|
29476
29497
|
kind: external_exports.literal("configure"),
|
|
29477
29498
|
...thread,
|
|
@@ -29629,12 +29650,14 @@ function discoverySpec(variant) {
|
|
|
29629
29650
|
installRoots: {
|
|
29630
29651
|
posix: [
|
|
29631
29652
|
"~/.local/bin",
|
|
29653
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29632
29654
|
`~/${configDirectory}/bin`,
|
|
29633
29655
|
VERSION_MANAGER_ROOTS,
|
|
29634
29656
|
"/usr/local/bin",
|
|
29635
29657
|
"/opt/homebrew/bin"
|
|
29636
29658
|
],
|
|
29637
29659
|
windows: [
|
|
29660
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29638
29661
|
`\${LOCALAPPDATA}/Programs/${productName}`,
|
|
29639
29662
|
`\${LOCALAPPDATA}/${productName}`,
|
|
29640
29663
|
`~/${configDirectory}/bin`,
|
|
@@ -30118,6 +30141,7 @@ var requestTokenFields = [
|
|
|
30118
30141
|
"cacheWrite1hInputTokens",
|
|
30119
30142
|
"outputTokens",
|
|
30120
30143
|
"reasoningOutputTokens",
|
|
30144
|
+
"timedOutputTokens",
|
|
30121
30145
|
"startedAtMs",
|
|
30122
30146
|
"completedAtMs"
|
|
30123
30147
|
];
|
|
@@ -55388,6 +55412,19 @@ function createQoderInstallation(environment, command, variant = "global") {
|
|
|
55388
55412
|
message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
|
|
55389
55413
|
};
|
|
55390
55414
|
const output = await run(["update", "--check"]);
|
|
55415
|
+
if (/unable to determine installation method/i.test(output))
|
|
55416
|
+
return {
|
|
55417
|
+
currentVersion,
|
|
55418
|
+
latestVersion: "Unknown",
|
|
55419
|
+
updateAvailable: false,
|
|
55420
|
+
canUpdate: false,
|
|
55421
|
+
messageCode: "qoder-check-unavailable",
|
|
55422
|
+
notice: {
|
|
55423
|
+
en: "This Qoder CLI cannot determine how it was installed and cannot check for updates. Use the installer or application that installed it.",
|
|
55424
|
+
"zh-CN": "当前 Qoder CLI 无法识别自身的安装方式,不能检查更新。请使用安装它的安装程序或应用进行更新。"
|
|
55425
|
+
},
|
|
55426
|
+
message: "This Qoder CLI cannot determine how it was installed and cannot check for updates."
|
|
55427
|
+
};
|
|
55391
55428
|
const available = output.match(/Update available:\s*\S+\s*(?:->|\u2192)\s*(\S+)/i);
|
|
55392
55429
|
if (available?.[1])
|
|
55393
55430
|
return {
|
|
@@ -27246,7 +27246,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
27246
27246
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
27247
27247
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
27248
27248
|
var usageOutputTimingSchema = external_exports.object({
|
|
27249
|
-
version: external_exports.literal(3).optional(),
|
|
27249
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27250
27250
|
requestId: external_exports.string().min(1),
|
|
27251
27251
|
turnId: external_exports.string().min(1).max(1024),
|
|
27252
27252
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -27254,16 +27254,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
27254
27254
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
27255
27255
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
27256
27256
|
var usageMeasurementSchema = external_exports.object({
|
|
27257
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
27257
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
27258
27258
|
value: finiteNonNegativeNumberSchema,
|
|
27259
27259
|
turnId: external_exports.string().min(1).max(1024),
|
|
27260
27260
|
at: nonNegativeSafeIntegerSchema
|
|
27261
27261
|
}).strict();
|
|
27262
27262
|
var usageMeasurementsSchema = external_exports.object({
|
|
27263
|
-
//
|
|
27264
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
27263
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
27264
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
27265
27265
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
27266
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
27266
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
27267
27267
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
27268
27268
|
}).strict();
|
|
27269
27269
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -27729,6 +27729,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
27729
27729
|
cursor: clientChannelCursorSchema,
|
|
27730
27730
|
cwd: external_exports.string().optional()
|
|
27731
27731
|
}),
|
|
27732
|
+
external_exports.object({
|
|
27733
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
27734
|
+
cursor: clientChannelCursorSchema,
|
|
27735
|
+
harnessId: external_exports.string().min(1)
|
|
27736
|
+
}),
|
|
27732
27737
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
27733
27738
|
external_exports.object({
|
|
27734
27739
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -27800,6 +27805,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
27800
27805
|
var clientTurnSchema = external_exports.object({
|
|
27801
27806
|
id: external_exports.string().min(1),
|
|
27802
27807
|
status: external_exports.string().min(1),
|
|
27808
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
27809
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
27803
27810
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
27804
27811
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
27805
27812
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -29016,6 +29023,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
29016
29023
|
"completed",
|
|
29017
29024
|
"failed",
|
|
29018
29025
|
"interrupted",
|
|
29026
|
+
"needsInput",
|
|
29019
29027
|
"timedOut",
|
|
29020
29028
|
"unreadable",
|
|
29021
29029
|
"notFound"
|
|
@@ -29062,13 +29070,26 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
29062
29070
|
var thread = { ...target, threadId: identity };
|
|
29063
29071
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
29064
29072
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
29073
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
29065
29074
|
external_exports.strictObject({
|
|
29066
29075
|
kind: external_exports.literal("list"),
|
|
29067
29076
|
...target,
|
|
29068
29077
|
cursor: external_exports.string().nullable(),
|
|
29069
29078
|
archived: external_exports.boolean()
|
|
29070
29079
|
}),
|
|
29071
|
-
external_exports.strictObject({
|
|
29080
|
+
external_exports.strictObject({
|
|
29081
|
+
kind: external_exports.literal("read"),
|
|
29082
|
+
...thread,
|
|
29083
|
+
page: external_exports.strictObject({
|
|
29084
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
29085
|
+
epoch: identity.optional(),
|
|
29086
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
29087
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
29088
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
29089
|
+
message: "A history continuation requires its connection epoch"
|
|
29090
|
+
}).optional()
|
|
29091
|
+
}),
|
|
29092
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
29072
29093
|
external_exports.strictObject({
|
|
29073
29094
|
kind: external_exports.literal("configure"),
|
|
29074
29095
|
...thread,
|
|
@@ -29631,12 +29652,14 @@ function discoverySpec(variant) {
|
|
|
29631
29652
|
installRoots: {
|
|
29632
29653
|
posix: [
|
|
29633
29654
|
"~/.local/bin",
|
|
29655
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29634
29656
|
`~/${configDirectory}/bin`,
|
|
29635
29657
|
VERSION_MANAGER_ROOTS,
|
|
29636
29658
|
"/usr/local/bin",
|
|
29637
29659
|
"/opt/homebrew/bin"
|
|
29638
29660
|
],
|
|
29639
29661
|
windows: [
|
|
29662
|
+
`~/${configDirectory}/bin/${command}`,
|
|
29640
29663
|
`\${LOCALAPPDATA}/Programs/${productName}`,
|
|
29641
29664
|
`\${LOCALAPPDATA}/${productName}`,
|
|
29642
29665
|
`~/${configDirectory}/bin`,
|
|
@@ -30120,6 +30143,7 @@ var requestTokenFields = [
|
|
|
30120
30143
|
"cacheWrite1hInputTokens",
|
|
30121
30144
|
"outputTokens",
|
|
30122
30145
|
"reasoningOutputTokens",
|
|
30146
|
+
"timedOutputTokens",
|
|
30123
30147
|
"startedAtMs",
|
|
30124
30148
|
"completedAtMs"
|
|
30125
30149
|
];
|
|
@@ -55390,6 +55414,19 @@ function createQoderInstallation(environment, command, variant = "global") {
|
|
|
55390
55414
|
message: "This Qoder China release does not expose a non-installing update check. Use its original installer."
|
|
55391
55415
|
};
|
|
55392
55416
|
const output = await run(["update", "--check"]);
|
|
55417
|
+
if (/unable to determine installation method/i.test(output))
|
|
55418
|
+
return {
|
|
55419
|
+
currentVersion,
|
|
55420
|
+
latestVersion: "Unknown",
|
|
55421
|
+
updateAvailable: false,
|
|
55422
|
+
canUpdate: false,
|
|
55423
|
+
messageCode: "qoder-check-unavailable",
|
|
55424
|
+
notice: {
|
|
55425
|
+
en: "This Qoder CLI cannot determine how it was installed and cannot check for updates. Use the installer or application that installed it.",
|
|
55426
|
+
"zh-CN": "当前 Qoder CLI 无法识别自身的安装方式,不能检查更新。请使用安装它的安装程序或应用进行更新。"
|
|
55427
|
+
},
|
|
55428
|
+
message: "This Qoder CLI cannot determine how it was installed and cannot check for updates."
|
|
55429
|
+
};
|
|
55393
55430
|
const available = output.match(/Update available:\s*\S+\s*(?:->|\u2192)\s*(\S+)/i);
|
|
55394
55431
|
if (available?.[1])
|
|
55395
55432
|
return {
|