@codexhost/cli-linux-arm64 0.20.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 +26 -6
- package/app/console-web.js +34 -7
- package/app/desktop-controller.mjs +162 -51
- package/app/host-runtime.mjs +35562 -29076
- package/app/plugins/antigravity/assets/icon.svg +1 -1
- package/app/plugins/antigravity/plugin.mjs +1112 -822
- package/app/plugins/claude-code/plugin.mjs +152 -28
- package/app/plugins/codebuddy/plugin.mjs +35 -6
- package/app/plugins/codex-usage/plugin.mjs +35 -6
- package/app/plugins/copilot/plugin.mjs +27 -6
- package/app/plugins/cursor-cli/plugin.mjs +27 -6
- package/app/plugins/deepseek-harness/plugin.mjs +52 -11
- package/app/plugins/devin/plugin.mjs +27 -6
- package/app/plugins/grok/plugin.mjs +63 -15
- package/app/plugins/hermes/plugin.mjs +27 -6
- package/app/plugins/kimi-code/plugin.mjs +52 -16
- package/app/plugins/kiro-cli/plugin.mjs +27 -6
- package/app/plugins/omp/plugin.mjs +35 -6
- package/app/plugins/opencode/plugin.mjs +53 -15
- package/app/plugins/pi/plugin.mjs +35 -6
- package/app/plugins/qoder/plugin.mjs +42 -6
- package/app/plugins/qoder-cn/plugin.mjs +42 -6
- package/app/plugins/qwen-code/plugin.mjs +27 -6
- package/app/plugins/workbuddy/plugin.mjs +35 -6
- package/app/plugins/zcode/plugin.mjs +35 -6
- package/app/renderer-extension.js +26 -6
- package/app/web/assets/{index-D85gPBbQ.js → index-BdmZfTRW.js} +62 -62
- package/app/web/assets/{index-D6-hvggd.css → index-DJW4bmyx.css} +1 -1
- package/app/web/codexhost-settings.js +34 -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 +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +68 -68
- 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 +1012 -667
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -14663,7 +14663,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
14663
14663
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
14664
14664
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14665
14665
|
var usageOutputTimingSchema = external_exports.object({
|
|
14666
|
-
version: external_exports.literal(3).optional(),
|
|
14666
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14667
14667
|
requestId: external_exports.string().min(1),
|
|
14668
14668
|
turnId: external_exports.string().min(1).max(1024),
|
|
14669
14669
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -14671,16 +14671,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
14671
14671
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
14672
14672
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
14673
14673
|
var usageMeasurementSchema = external_exports.object({
|
|
14674
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
14674
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14675
14675
|
value: finiteNonNegativeNumberSchema,
|
|
14676
14676
|
turnId: external_exports.string().min(1).max(1024),
|
|
14677
14677
|
at: nonNegativeSafeIntegerSchema
|
|
14678
14678
|
}).strict();
|
|
14679
14679
|
var usageMeasurementsSchema = external_exports.object({
|
|
14680
|
-
//
|
|
14681
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
14680
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
14681
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
14682
14682
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
14683
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
14683
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
14684
14684
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
14685
14685
|
}).strict();
|
|
14686
14686
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -15146,6 +15146,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15146
15146
|
cursor: clientChannelCursorSchema,
|
|
15147
15147
|
cwd: external_exports.string().optional()
|
|
15148
15148
|
}),
|
|
15149
|
+
external_exports.object({
|
|
15150
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15151
|
+
cursor: clientChannelCursorSchema,
|
|
15152
|
+
harnessId: external_exports.string().min(1)
|
|
15153
|
+
}),
|
|
15149
15154
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15150
15155
|
external_exports.object({
|
|
15151
15156
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15217,6 +15222,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15217
15222
|
var clientTurnSchema = external_exports.object({
|
|
15218
15223
|
id: external_exports.string().min(1),
|
|
15219
15224
|
status: external_exports.string().min(1),
|
|
15225
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15226
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15220
15227
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15221
15228
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15222
15229
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16433,6 +16440,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16433
16440
|
"completed",
|
|
16434
16441
|
"failed",
|
|
16435
16442
|
"interrupted",
|
|
16443
|
+
"needsInput",
|
|
16436
16444
|
"timedOut",
|
|
16437
16445
|
"unreadable",
|
|
16438
16446
|
"notFound"
|
|
@@ -16479,13 +16487,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16479
16487
|
var thread = { ...target, threadId: identity };
|
|
16480
16488
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16481
16489
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16490
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16482
16491
|
external_exports.strictObject({
|
|
16483
16492
|
kind: external_exports.literal("list"),
|
|
16484
16493
|
...target,
|
|
16485
16494
|
cursor: external_exports.string().nullable(),
|
|
16486
16495
|
archived: external_exports.boolean()
|
|
16487
16496
|
}),
|
|
16488
|
-
external_exports.strictObject({
|
|
16497
|
+
external_exports.strictObject({
|
|
16498
|
+
kind: external_exports.literal("read"),
|
|
16499
|
+
...thread,
|
|
16500
|
+
page: external_exports.strictObject({
|
|
16501
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16502
|
+
epoch: identity.optional(),
|
|
16503
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16504
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16505
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16506
|
+
message: "A history continuation requires its connection epoch"
|
|
16507
|
+
}).optional()
|
|
16508
|
+
}),
|
|
16489
16509
|
external_exports.strictObject({
|
|
16490
16510
|
kind: external_exports.literal("configure"),
|
|
16491
16511
|
...thread,
|
|
@@ -16852,6 +16872,7 @@ var requestTokenFields = [
|
|
|
16852
16872
|
"cacheWrite1hInputTokens",
|
|
16853
16873
|
"outputTokens",
|
|
16854
16874
|
"reasoningOutputTokens",
|
|
16875
|
+
"timedOutputTokens",
|
|
16855
16876
|
"startedAtMs",
|
|
16856
16877
|
"completedAtMs"
|
|
16857
16878
|
];
|
|
@@ -16904,6 +16925,14 @@ function parseHostUsageRequest(value) {
|
|
|
16904
16925
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
16905
16926
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
16906
16927
|
}
|
|
16928
|
+
if (request.timedOutputTokens !== void 0) {
|
|
16929
|
+
if (request.startedAtMs === void 0) {
|
|
16930
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
16931
|
+
}
|
|
16932
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
16933
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
16934
|
+
}
|
|
16935
|
+
}
|
|
16907
16936
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
16908
16937
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
16909
16938
|
}
|
|
@@ -55611,6 +55640,8 @@ function parseClaudeWorkflowAgents(value) {
|
|
|
55611
55640
|
var ClaudeNativeTurnAccumulator = class {
|
|
55612
55641
|
#provider;
|
|
55613
55642
|
#activeRootStreamMessageId = null;
|
|
55643
|
+
/** Native record UUIDs already published, across stream and request message IDs. */
|
|
55644
|
+
#publishedCheckpointIds = /* @__PURE__ */ new Set();
|
|
55614
55645
|
#assistantErrors = [];
|
|
55615
55646
|
#cancelRequested = false;
|
|
55616
55647
|
#compactionState = "idle";
|
|
@@ -55947,6 +55978,25 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
55947
55978
|
const messageId = this.#activeRootStreamMessageId ?? nativeMessageId ?? checkpointId ?? this.#nextMessageId();
|
|
55948
55979
|
const state = this.#messageState(messageId);
|
|
55949
55980
|
if (state.completed) {
|
|
55981
|
+
const splitText = checkpointId && !this.#publishedCheckpointIds.has(checkpointId) ? assistantText(message) : null;
|
|
55982
|
+
if (checkpointId && splitText) {
|
|
55983
|
+
this.#publishedCheckpointIds.add(checkpointId);
|
|
55984
|
+
state.text += splitText;
|
|
55985
|
+
events.push({ type: "text.delta", messageId, delta: splitText });
|
|
55986
|
+
this.#consumeToolUseBlocks(message, events, true);
|
|
55987
|
+
if (!this.#protocolConflict && !this.#textConflict) {
|
|
55988
|
+
const usage2 = state.usagePublished ? void 0 : assistantRequestUsage(message, this.#provider);
|
|
55989
|
+
if (usage2)
|
|
55990
|
+
state.usagePublished = true;
|
|
55991
|
+
events.push({
|
|
55992
|
+
type: "message.completed",
|
|
55993
|
+
messageId,
|
|
55994
|
+
checkpointId,
|
|
55995
|
+
...usage2 ? { lastRequestUsage: usage2 } : {}
|
|
55996
|
+
});
|
|
55997
|
+
}
|
|
55998
|
+
return;
|
|
55999
|
+
}
|
|
55950
56000
|
this.#consumeToolUseBlocks(message, events, true);
|
|
55951
56001
|
const usage = assistantRequestUsage(message, this.#provider);
|
|
55952
56002
|
if (usage && !state.usagePublished) {
|
|
@@ -55987,6 +56037,8 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
55987
56037
|
});
|
|
55988
56038
|
}
|
|
55989
56039
|
state.completed = true;
|
|
56040
|
+
if (checkpointId)
|
|
56041
|
+
this.#publishedCheckpointIds.add(checkpointId);
|
|
55990
56042
|
if (this.#activeRootStreamMessageId === messageId)
|
|
55991
56043
|
this.#activeRootStreamMessageId = null;
|
|
55992
56044
|
}
|
|
@@ -56127,7 +56179,12 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
56127
56179
|
const existing = this.#messages.get(messageId);
|
|
56128
56180
|
if (existing)
|
|
56129
56181
|
return existing;
|
|
56130
|
-
const created = {
|
|
56182
|
+
const created = {
|
|
56183
|
+
completed: false,
|
|
56184
|
+
reasoning: "",
|
|
56185
|
+
text: "",
|
|
56186
|
+
usagePublished: false
|
|
56187
|
+
};
|
|
56131
56188
|
this.#messages.set(messageId, created);
|
|
56132
56189
|
return created;
|
|
56133
56190
|
}
|
|
@@ -56159,6 +56216,25 @@ function readClaudeQueuedCommand(value, sessionId) {
|
|
|
56159
56216
|
|
|
56160
56217
|
// dist/claude-history.js
|
|
56161
56218
|
var claudeCodeHarnessId = harnessIdSchema.parse("claude-code");
|
|
56219
|
+
var CLAUDE_BLOCK_SPLIT_UUID_PATTERN = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-0{8}[0-9a-f]{4}$/iu;
|
|
56220
|
+
function matchesClaudeCheckpointId(persistedId, expectedId) {
|
|
56221
|
+
if (persistedId === expectedId)
|
|
56222
|
+
return true;
|
|
56223
|
+
if (!CLAUDE_BLOCK_SPLIT_UUID_PATTERN.test(expectedId))
|
|
56224
|
+
return false;
|
|
56225
|
+
return persistedId.length === 36 && persistedId.slice(0, 24).toLowerCase() === expectedId.slice(0, 24).toLowerCase();
|
|
56226
|
+
}
|
|
56227
|
+
function isPersistedClaudeMessageId(expectedId, persistedIds) {
|
|
56228
|
+
if (persistedIds.has(expectedId))
|
|
56229
|
+
return true;
|
|
56230
|
+
if (!CLAUDE_BLOCK_SPLIT_UUID_PATTERN.test(expectedId))
|
|
56231
|
+
return false;
|
|
56232
|
+
for (const id2 of persistedIds) {
|
|
56233
|
+
if (matchesClaudeCheckpointId(id2, expectedId))
|
|
56234
|
+
return true;
|
|
56235
|
+
}
|
|
56236
|
+
return false;
|
|
56237
|
+
}
|
|
56162
56238
|
function isRecord9(value) {
|
|
56163
56239
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56164
56240
|
}
|
|
@@ -56232,6 +56308,12 @@ function visibleUserTextParts(message) {
|
|
|
56232
56308
|
return [];
|
|
56233
56309
|
return parts.filter((part) => !isLocalCommandRecord(part) && !isTaskNotificationRecord(part));
|
|
56234
56310
|
}
|
|
56311
|
+
function hasRootToolResult(message) {
|
|
56312
|
+
if (message.type !== "user" || message.nested || !Array.isArray(message.message.content)) {
|
|
56313
|
+
return false;
|
|
56314
|
+
}
|
|
56315
|
+
return message.message.content.some((block) => isRecord9(block) && block.type === "tool_result");
|
|
56316
|
+
}
|
|
56235
56317
|
function isInterruptionRecord(value, promptId) {
|
|
56236
56318
|
if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !isRecord9(value.message))
|
|
56237
56319
|
return false;
|
|
@@ -56291,7 +56373,7 @@ function conversationMessages(values, sessionId) {
|
|
|
56291
56373
|
interrupted,
|
|
56292
56374
|
startsTurn: false,
|
|
56293
56375
|
...isRecord9(value.forkedFrom) && typeof value.forkedFrom.messageUuid === "string" ? { forkSourceUuid: value.forkedFrom.messageUuid } : {},
|
|
56294
|
-
syntheticUser: value.type === "user" && (interrupted || value.isSynthetic === true || value.isMeta === true || isTaskNotificationOrigin(value) || value.toolUseResult !== void 0 && value.toolUseResult !== null)
|
|
56376
|
+
syntheticUser: value.type === "user" && (interrupted || value.isSynthetic === true || value.isMeta === true || value.isCompactSummary === true || value.isVisibleInTranscriptOnly === true || isTaskNotificationOrigin(value) || value.toolUseResult !== void 0 && value.toolUseResult !== null)
|
|
56295
56377
|
};
|
|
56296
56378
|
const notification = message.type === "user" && !message.nested && (isTaskNotificationOrigin(value) || textParts(message.message.content).some(isTaskNotificationRecord));
|
|
56297
56379
|
message.startsTurn = isHumanUser(message) || notification && !occupancy.unsettled && !pendingNotification;
|
|
@@ -56397,9 +56479,16 @@ function itemOutcome(outcome) {
|
|
|
56397
56479
|
}
|
|
56398
56480
|
return { status: "succeeded" };
|
|
56399
56481
|
}
|
|
56482
|
+
function isCheckpointCandidate(message) {
|
|
56483
|
+
return !message.nested && (message.type === "assistant" || message.interrupted || hasRootToolResult(message));
|
|
56484
|
+
}
|
|
56400
56485
|
function mapClaudeSnapshot(values, sessionId) {
|
|
56486
|
+
return mapClaudeSnapshotWithCheckpointIds(values, sessionId).snapshot;
|
|
56487
|
+
}
|
|
56488
|
+
function mapClaudeSnapshotWithCheckpointIds(values, sessionId) {
|
|
56401
56489
|
const messages = conversationMessages(values, sessionId);
|
|
56402
56490
|
const turns = [];
|
|
56491
|
+
const turnCheckpointIds = [];
|
|
56403
56492
|
for (let index = 0; index < messages.length; ) {
|
|
56404
56493
|
const user = messages[index];
|
|
56405
56494
|
if (!user || !user.startsTurn) {
|
|
@@ -56414,12 +56503,13 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
56414
56503
|
const turnMessages = messages.slice(index, end);
|
|
56415
56504
|
const outcome = turnOutcome(turnMessages);
|
|
56416
56505
|
const results = toolResultBlocks(turnMessages);
|
|
56417
|
-
const checkpointIndex = turnMessages.findLastIndex(
|
|
56506
|
+
const checkpointIndex = turnMessages.findLastIndex(isCheckpointCandidate);
|
|
56418
56507
|
const lastSteering = turnMessages.findLastIndex(({ type }) => type === "steering");
|
|
56419
56508
|
const checkpointMessage = checkpointIndex > lastSteering ? turnMessages[checkpointIndex] : void 0;
|
|
56420
56509
|
let agentMessageOrdinal = 0;
|
|
56421
56510
|
let reasoningOrdinal = 0;
|
|
56422
56511
|
let toolOrdinal = 0;
|
|
56512
|
+
turnCheckpointIds.push(turnMessages.filter(isCheckpointCandidate).map((message) => message.uuid));
|
|
56423
56513
|
turns.push({
|
|
56424
56514
|
nativeTurnRef: nativeTurnRefSchema.parse({
|
|
56425
56515
|
harnessId: claudeCodeHarnessId,
|
|
@@ -56563,7 +56653,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
56563
56653
|
});
|
|
56564
56654
|
index = end;
|
|
56565
56655
|
}
|
|
56566
|
-
return { turns };
|
|
56656
|
+
return { snapshot: { turns }, turnCheckpointIds };
|
|
56567
56657
|
}
|
|
56568
56658
|
function toolResultBlocks(messages) {
|
|
56569
56659
|
const results = /* @__PURE__ */ new Map();
|
|
@@ -56762,6 +56852,10 @@ function nativeIds(snapshot) {
|
|
|
56762
56852
|
]));
|
|
56763
56853
|
}
|
|
56764
56854
|
async function readSnapshot(dependencies, cwd, sessionId) {
|
|
56855
|
+
const history = await readHistory(dependencies, cwd, sessionId);
|
|
56856
|
+
return history.ok ? { ok: true, value: history.value.snapshot } : history;
|
|
56857
|
+
}
|
|
56858
|
+
async function readHistory(dependencies, cwd, sessionId) {
|
|
56765
56859
|
let messages;
|
|
56766
56860
|
try {
|
|
56767
56861
|
messages = await dependencies.readSessionMessages({ cwd, sessionId }) ?? [];
|
|
@@ -56778,7 +56872,7 @@ async function readSnapshot(dependencies, cwd, sessionId) {
|
|
|
56778
56872
|
};
|
|
56779
56873
|
}
|
|
56780
56874
|
try {
|
|
56781
|
-
return { ok: true, value:
|
|
56875
|
+
return { ok: true, value: mapClaudeSnapshotWithCheckpointIds(messages, sessionId) };
|
|
56782
56876
|
} catch {
|
|
56783
56877
|
return {
|
|
56784
56878
|
ok: false,
|
|
@@ -56818,9 +56912,10 @@ async function forkClaudeSession(input) {
|
|
|
56818
56912
|
error: error51("protocolError", "Claude Code Session working directory is unavailable", false)
|
|
56819
56913
|
};
|
|
56820
56914
|
}
|
|
56821
|
-
const
|
|
56822
|
-
if (!
|
|
56823
|
-
return
|
|
56915
|
+
const sourceHistory = await readHistory(input.dependencies, input.cwd, sourceRef.data.nativeSessionId);
|
|
56916
|
+
if (!sourceHistory.ok)
|
|
56917
|
+
return sourceHistory;
|
|
56918
|
+
const source = { ok: true, value: sourceHistory.value.snapshot };
|
|
56824
56919
|
if (input.kind === "rollbackLastTurn" && source.value.turns.length === 0) {
|
|
56825
56920
|
return {
|
|
56826
56921
|
ok: false,
|
|
@@ -56850,7 +56945,12 @@ async function forkClaudeSession(input) {
|
|
|
56850
56945
|
value: { sessionId: nativeRef.nativeSessionId, nativeRef, openMode: "create" }
|
|
56851
56946
|
};
|
|
56852
56947
|
}
|
|
56853
|
-
const boundaryIndex = input.kind === "rollbackLastTurn" ? source.value.turns.length - 2 :
|
|
56948
|
+
const boundaryIndex = input.kind === "rollbackLastTurn" ? source.value.turns.length - 2 : (
|
|
56949
|
+
// A live checkpoint names the last root Assistant record seen while the Turn ran;
|
|
56950
|
+
// the persisted Turn checkpoint can be a later root tool_result of the same Turn.
|
|
56951
|
+
// Fork at that Turn's final checkpoint so the native prefix keeps the whole Turn.
|
|
56952
|
+
sourceHistory.value.turnCheckpointIds.findIndex((ids, index) => checkpoint?.success && source.value.turns[index]?.checkpoint !== void 0 && ids.some((id2) => matchesClaudeCheckpointId(id2, checkpoint.data.checkpointId)))
|
|
56953
|
+
);
|
|
56854
56954
|
const retained = source.value.turns[boundaryIndex];
|
|
56855
56955
|
const boundaryId = retained?.checkpoint?.checkpointId ?? (input.kind === "rollbackLastTurn" ? retained?.nativeTurnRef.nativeTurnKey : void 0);
|
|
56856
56956
|
if (boundaryIndex < 0 || !boundaryId) {
|
|
@@ -56913,12 +57013,13 @@ async function forkClaudeSession(input) {
|
|
|
56913
57013
|
|
|
56914
57014
|
// dist/claude-fork-references.js
|
|
56915
57015
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
56916
|
-
import { readFile as
|
|
57016
|
+
import { readFile as readFile5, rename as rename4, rm as rm5, stat as stat5, writeFile as writeFile2 } from "node:fs/promises";
|
|
56917
57017
|
|
|
56918
57018
|
// dist/claude-transcript.js
|
|
57019
|
+
import { createReadStream as createReadStream4 } from "node:fs";
|
|
56919
57020
|
import os6 from "node:os";
|
|
56920
57021
|
import path12 from "node:path";
|
|
56921
|
-
import {
|
|
57022
|
+
import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
|
|
56922
57023
|
function projectDirectoryName(cwd) {
|
|
56923
57024
|
return cwd.replace(/[^A-Za-z0-9]/gu, "-");
|
|
56924
57025
|
}
|
|
@@ -56951,6 +57052,28 @@ async function findClaudeTranscript(input) {
|
|
|
56951
57052
|
}
|
|
56952
57053
|
return null;
|
|
56953
57054
|
}
|
|
57055
|
+
async function* transcriptLines(transcript) {
|
|
57056
|
+
const stream = createReadStream4(transcript, { encoding: "utf8" });
|
|
57057
|
+
let pending = "";
|
|
57058
|
+
try {
|
|
57059
|
+
for await (const chunk of stream) {
|
|
57060
|
+
const contents = chunk;
|
|
57061
|
+
let start = 0;
|
|
57062
|
+
let newline;
|
|
57063
|
+
while ((newline = contents.indexOf("\n", start)) !== -1) {
|
|
57064
|
+
const line = pending + contents.slice(start, newline);
|
|
57065
|
+
pending = "";
|
|
57066
|
+
yield line;
|
|
57067
|
+
start = newline + 1;
|
|
57068
|
+
}
|
|
57069
|
+
pending += contents.slice(start);
|
|
57070
|
+
}
|
|
57071
|
+
if (pending.length > 0)
|
|
57072
|
+
yield pending;
|
|
57073
|
+
} finally {
|
|
57074
|
+
stream.destroy();
|
|
57075
|
+
}
|
|
57076
|
+
}
|
|
56954
57077
|
function isRecord10(value) {
|
|
56955
57078
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56956
57079
|
}
|
|
@@ -56958,9 +57081,8 @@ async function readClaudeTranscript(input) {
|
|
|
56958
57081
|
const transcript = await findClaudeTranscript(input);
|
|
56959
57082
|
if (!transcript)
|
|
56960
57083
|
return null;
|
|
56961
|
-
const contents = await readFile5(transcript, "utf8");
|
|
56962
57084
|
const messages = /* @__PURE__ */ new Map();
|
|
56963
|
-
for (const line of
|
|
57085
|
+
for await (const line of transcriptLines(transcript)) {
|
|
56964
57086
|
if (line.trim().length === 0)
|
|
56965
57087
|
continue;
|
|
56966
57088
|
let entry;
|
|
@@ -57013,7 +57135,7 @@ async function remapForkedSessionReferences(input) {
|
|
|
57013
57135
|
const transcript = await findClaudeTranscript(input);
|
|
57014
57136
|
if (!transcript)
|
|
57015
57137
|
return 0;
|
|
57016
|
-
const contents = await
|
|
57138
|
+
const contents = await readFile5(transcript, "utf8");
|
|
57017
57139
|
if (!contents.includes('"sameAs"'))
|
|
57018
57140
|
return 0;
|
|
57019
57141
|
const lines = contents.split("\n");
|
|
@@ -57053,7 +57175,7 @@ async function remapForkedSessionReferences(input) {
|
|
|
57053
57175
|
|
|
57054
57176
|
// dist/model-catalog.js
|
|
57055
57177
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
57056
|
-
import { readFile as
|
|
57178
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
57057
57179
|
import os7 from "node:os";
|
|
57058
57180
|
import path13 from "node:path";
|
|
57059
57181
|
|
|
@@ -57106,7 +57228,7 @@ var CLAUDE_MODEL_VALUE_MAX_LENGTH = 512;
|
|
|
57106
57228
|
var modelInfoSchema = external_exports.object({
|
|
57107
57229
|
value: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
57108
57230
|
displayName: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
57109
|
-
description: external_exports.string().trim().
|
|
57231
|
+
description: external_exports.string().trim().max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
57110
57232
|
resolvedModel: harnessResolvedModelLabelSchema.optional()
|
|
57111
57233
|
});
|
|
57112
57234
|
var modelPickerOptionSchema = external_exports.object({
|
|
@@ -57193,7 +57315,7 @@ async function readClaudeUserModelPicker(environment = process.env) {
|
|
|
57193
57315
|
const settingsPath = path13.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
57194
57316
|
let raw;
|
|
57195
57317
|
try {
|
|
57196
|
-
raw = await
|
|
57318
|
+
raw = await readFile6(settingsPath, "utf8");
|
|
57197
57319
|
} catch {
|
|
57198
57320
|
return void 0;
|
|
57199
57321
|
}
|
|
@@ -59670,6 +59792,7 @@ var DEFAULT_CONTINUATION_QUIESCENCE_MS = 2e3;
|
|
|
59670
59792
|
function isRecord15(value) {
|
|
59671
59793
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
59672
59794
|
}
|
|
59795
|
+
var SYNTHETIC_AUTONOMOUS_TURN_KEY_PATTERN = /^autonomous-\d+$/u;
|
|
59673
59796
|
function safeNonNegativeInteger2(value) {
|
|
59674
59797
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
59675
59798
|
}
|
|
@@ -60006,7 +60129,7 @@ var ClaudeHarnessSession = class {
|
|
|
60006
60129
|
sessionId: this.#sessionId
|
|
60007
60130
|
}) ?? [];
|
|
60008
60131
|
const ids = new Set(messages.flatMap((message) => isRecord15(message) && typeof message.uuid === "string" ? [message.uuid] : []));
|
|
60009
|
-
if (this.#unpersistedMessageIds.every((id2) =>
|
|
60132
|
+
if (this.#unpersistedMessageIds.every((id2) => isPersistedClaudeMessageId(id2, ids))) {
|
|
60010
60133
|
this.#unpersistedMessageIds = [];
|
|
60011
60134
|
break;
|
|
60012
60135
|
}
|
|
@@ -61887,11 +62010,12 @@ var ClaudeHarnessSession = class {
|
|
|
61887
62010
|
checkpointId: active.checkpointId,
|
|
61888
62011
|
formatVersion: 1
|
|
61889
62012
|
}) : null;
|
|
61890
|
-
|
|
62013
|
+
const trackUserMessageId = active.userMessageId !== null && !SYNTHETIC_AUTONOMOUS_TURN_KEY_PATTERN.test(active.userMessageId) && (outcome.status !== "cancelled" || active.checkpointId !== null);
|
|
62014
|
+
if (trackUserMessageId || active.checkpointId) {
|
|
61891
62015
|
this.#unpersistedMessageIds = [
|
|
61892
62016
|
.../* @__PURE__ */ new Set([
|
|
61893
62017
|
...this.#unpersistedMessageIds,
|
|
61894
|
-
...active.userMessageId ? [active.userMessageId] : [],
|
|
62018
|
+
...trackUserMessageId && active.userMessageId ? [active.userMessageId] : [],
|
|
61895
62019
|
...active.checkpointId ? [active.checkpointId] : []
|
|
61896
62020
|
])
|
|
61897
62021
|
];
|
|
@@ -62486,11 +62610,11 @@ var ClaudeCodeAdapter = class {
|
|
|
62486
62610
|
};
|
|
62487
62611
|
|
|
62488
62612
|
// dist/installation.js
|
|
62489
|
-
import { readFile as
|
|
62613
|
+
import { readFile as readFile7, realpath as realpath5 } from "node:fs/promises";
|
|
62490
62614
|
import { homedir as homedir2 } from "node:os";
|
|
62491
62615
|
import path16 from "node:path";
|
|
62492
62616
|
async function readSettings(file2) {
|
|
62493
|
-
const text2 = await
|
|
62617
|
+
const text2 = await readFile7(file2, "utf8").catch((error52) => {
|
|
62494
62618
|
if (error52.code === "ENOENT")
|
|
62495
62619
|
return "{}";
|
|
62496
62620
|
throw error52;
|
|
@@ -15139,7 +15139,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15139
15139
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15140
15140
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15141
15141
|
var usageOutputTimingSchema = external_exports.object({
|
|
15142
|
-
version: external_exports.literal(3).optional(),
|
|
15142
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15143
15143
|
requestId: external_exports.string().min(1),
|
|
15144
15144
|
turnId: external_exports.string().min(1).max(1024),
|
|
15145
15145
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15147,16 +15147,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15147
15147
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15148
15148
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15149
15149
|
var usageMeasurementSchema = external_exports.object({
|
|
15150
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15150
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15151
15151
|
value: finiteNonNegativeNumberSchema,
|
|
15152
15152
|
turnId: external_exports.string().min(1).max(1024),
|
|
15153
15153
|
at: nonNegativeSafeIntegerSchema
|
|
15154
15154
|
}).strict();
|
|
15155
15155
|
var usageMeasurementsSchema = external_exports.object({
|
|
15156
|
-
//
|
|
15157
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15156
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15157
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15158
15158
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15159
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15159
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15160
15160
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15161
15161
|
}).strict();
|
|
15162
15162
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -15622,6 +15622,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15622
15622
|
cursor: clientChannelCursorSchema,
|
|
15623
15623
|
cwd: external_exports.string().optional()
|
|
15624
15624
|
}),
|
|
15625
|
+
external_exports.object({
|
|
15626
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15627
|
+
cursor: clientChannelCursorSchema,
|
|
15628
|
+
harnessId: external_exports.string().min(1)
|
|
15629
|
+
}),
|
|
15625
15630
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15626
15631
|
external_exports.object({
|
|
15627
15632
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15693,6 +15698,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15693
15698
|
var clientTurnSchema = external_exports.object({
|
|
15694
15699
|
id: external_exports.string().min(1),
|
|
15695
15700
|
status: external_exports.string().min(1),
|
|
15701
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15702
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15696
15703
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15697
15704
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15698
15705
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16909,6 +16916,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16909
16916
|
"completed",
|
|
16910
16917
|
"failed",
|
|
16911
16918
|
"interrupted",
|
|
16919
|
+
"needsInput",
|
|
16912
16920
|
"timedOut",
|
|
16913
16921
|
"unreadable",
|
|
16914
16922
|
"notFound"
|
|
@@ -16955,13 +16963,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16955
16963
|
var thread = { ...target, threadId: identity };
|
|
16956
16964
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16957
16965
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16966
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16958
16967
|
external_exports.strictObject({
|
|
16959
16968
|
kind: external_exports.literal("list"),
|
|
16960
16969
|
...target,
|
|
16961
16970
|
cursor: external_exports.string().nullable(),
|
|
16962
16971
|
archived: external_exports.boolean()
|
|
16963
16972
|
}),
|
|
16964
|
-
external_exports.strictObject({
|
|
16973
|
+
external_exports.strictObject({
|
|
16974
|
+
kind: external_exports.literal("read"),
|
|
16975
|
+
...thread,
|
|
16976
|
+
page: external_exports.strictObject({
|
|
16977
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16978
|
+
epoch: identity.optional(),
|
|
16979
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16980
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16981
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16982
|
+
message: "A history continuation requires its connection epoch"
|
|
16983
|
+
}).optional()
|
|
16984
|
+
}),
|
|
16965
16985
|
external_exports.strictObject({
|
|
16966
16986
|
kind: external_exports.literal("configure"),
|
|
16967
16987
|
...thread,
|
|
@@ -17357,6 +17377,7 @@ var requestTokenFields = [
|
|
|
17357
17377
|
"cacheWrite1hInputTokens",
|
|
17358
17378
|
"outputTokens",
|
|
17359
17379
|
"reasoningOutputTokens",
|
|
17380
|
+
"timedOutputTokens",
|
|
17360
17381
|
"startedAtMs",
|
|
17361
17382
|
"completedAtMs"
|
|
17362
17383
|
];
|
|
@@ -17409,6 +17430,14 @@ function parseHostUsageRequest(value) {
|
|
|
17409
17430
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17410
17431
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17411
17432
|
}
|
|
17433
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17434
|
+
if (request.startedAtMs === void 0) {
|
|
17435
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17436
|
+
}
|
|
17437
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17438
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17439
|
+
}
|
|
17440
|
+
}
|
|
17412
17441
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17413
17442
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17414
17443
|
}
|
|
@@ -14657,7 +14657,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
14657
14657
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
14658
14658
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14659
14659
|
var usageOutputTimingSchema = external_exports.object({
|
|
14660
|
-
version: external_exports.literal(3).optional(),
|
|
14660
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14661
14661
|
requestId: external_exports.string().min(1),
|
|
14662
14662
|
turnId: external_exports.string().min(1).max(1024),
|
|
14663
14663
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -14665,16 +14665,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
14665
14665
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
14666
14666
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
14667
14667
|
var usageMeasurementSchema = external_exports.object({
|
|
14668
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
14668
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14669
14669
|
value: finiteNonNegativeNumberSchema,
|
|
14670
14670
|
turnId: external_exports.string().min(1).max(1024),
|
|
14671
14671
|
at: nonNegativeSafeIntegerSchema
|
|
14672
14672
|
}).strict();
|
|
14673
14673
|
var usageMeasurementsSchema = external_exports.object({
|
|
14674
|
-
//
|
|
14675
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
14674
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
14675
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
14676
14676
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
14677
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
14677
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
14678
14678
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
14679
14679
|
}).strict();
|
|
14680
14680
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -15140,6 +15140,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15140
15140
|
cursor: clientChannelCursorSchema,
|
|
15141
15141
|
cwd: external_exports.string().optional()
|
|
15142
15142
|
}),
|
|
15143
|
+
external_exports.object({
|
|
15144
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15145
|
+
cursor: clientChannelCursorSchema,
|
|
15146
|
+
harnessId: external_exports.string().min(1)
|
|
15147
|
+
}),
|
|
15143
15148
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15144
15149
|
external_exports.object({
|
|
15145
15150
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15211,6 +15216,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15211
15216
|
var clientTurnSchema = external_exports.object({
|
|
15212
15217
|
id: external_exports.string().min(1),
|
|
15213
15218
|
status: external_exports.string().min(1),
|
|
15219
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15220
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15214
15221
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15215
15222
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15216
15223
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16422,6 +16429,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16422
16429
|
"completed",
|
|
16423
16430
|
"failed",
|
|
16424
16431
|
"interrupted",
|
|
16432
|
+
"needsInput",
|
|
16425
16433
|
"timedOut",
|
|
16426
16434
|
"unreadable",
|
|
16427
16435
|
"notFound"
|
|
@@ -16468,13 +16476,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16468
16476
|
var thread = { ...target, threadId: identity };
|
|
16469
16477
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16470
16478
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16479
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16471
16480
|
external_exports.strictObject({
|
|
16472
16481
|
kind: external_exports.literal("list"),
|
|
16473
16482
|
...target,
|
|
16474
16483
|
cursor: external_exports.string().nullable(),
|
|
16475
16484
|
archived: external_exports.boolean()
|
|
16476
16485
|
}),
|
|
16477
|
-
external_exports.strictObject({
|
|
16486
|
+
external_exports.strictObject({
|
|
16487
|
+
kind: external_exports.literal("read"),
|
|
16488
|
+
...thread,
|
|
16489
|
+
page: external_exports.strictObject({
|
|
16490
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16491
|
+
epoch: identity.optional(),
|
|
16492
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16493
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16494
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16495
|
+
message: "A history continuation requires its connection epoch"
|
|
16496
|
+
}).optional()
|
|
16497
|
+
}),
|
|
16478
16498
|
external_exports.strictObject({
|
|
16479
16499
|
kind: external_exports.literal("configure"),
|
|
16480
16500
|
...thread,
|
|
@@ -17774,6 +17794,7 @@ var requestTokenFields = [
|
|
|
17774
17794
|
"cacheWrite1hInputTokens",
|
|
17775
17795
|
"outputTokens",
|
|
17776
17796
|
"reasoningOutputTokens",
|
|
17797
|
+
"timedOutputTokens",
|
|
17777
17798
|
"startedAtMs",
|
|
17778
17799
|
"completedAtMs"
|
|
17779
17800
|
];
|
|
@@ -17826,6 +17847,14 @@ function parseHostUsageRequest(value) {
|
|
|
17826
17847
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17827
17848
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17828
17849
|
}
|
|
17850
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17851
|
+
if (request.startedAtMs === void 0) {
|
|
17852
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17853
|
+
}
|
|
17854
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17855
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17856
|
+
}
|
|
17857
|
+
}
|
|
17829
17858
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17830
17859
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17831
17860
|
}
|