@karlorz/codexhost-cli-darwin-x64 0.20.0-0 → 0.21.0-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 +62 -14
- package/app/console-web.js +34 -7
- package/app/cpa-live-voice-hook.js +26 -6
- package/app/desktop-controller.mjs +164 -51
- package/app/host-runtime.mjs +21746 -15276
- 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-D6-hvggd.css → index-DJW4bmyx.css} +1 -1
- package/app/web/assets/{index-B5OfOGb8.js → index-DLXdvkWR.js} +63 -63
- 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 +57 -57
- 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 +16 -16
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +2 -2
- package/app/web-modules/server.mjs +1017 -672
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
|
@@ -15033,7 +15033,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15033
15033
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15034
15034
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15035
15035
|
var usageOutputTimingSchema = external_exports.object({
|
|
15036
|
-
version: external_exports.literal(3).optional(),
|
|
15036
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15037
15037
|
requestId: external_exports.string().min(1),
|
|
15038
15038
|
turnId: external_exports.string().min(1).max(1024),
|
|
15039
15039
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15041,16 +15041,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15041
15041
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15042
15042
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15043
15043
|
var usageMeasurementSchema = external_exports.object({
|
|
15044
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15044
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15045
15045
|
value: finiteNonNegativeNumberSchema,
|
|
15046
15046
|
turnId: external_exports.string().min(1).max(1024),
|
|
15047
15047
|
at: nonNegativeSafeIntegerSchema
|
|
15048
15048
|
}).strict();
|
|
15049
15049
|
var usageMeasurementsSchema = external_exports.object({
|
|
15050
|
-
//
|
|
15051
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15050
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15051
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15052
15052
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15053
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15053
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15054
15054
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15055
15055
|
}).strict();
|
|
15056
15056
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -15564,6 +15564,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15564
15564
|
cursor: clientChannelCursorSchema,
|
|
15565
15565
|
cwd: external_exports.string().optional()
|
|
15566
15566
|
}),
|
|
15567
|
+
external_exports.object({
|
|
15568
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15569
|
+
cursor: clientChannelCursorSchema,
|
|
15570
|
+
harnessId: external_exports.string().min(1)
|
|
15571
|
+
}),
|
|
15567
15572
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15568
15573
|
external_exports.object({
|
|
15569
15574
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15635,6 +15640,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15635
15640
|
var clientTurnSchema = external_exports.object({
|
|
15636
15641
|
id: external_exports.string().min(1),
|
|
15637
15642
|
status: external_exports.string().min(1),
|
|
15643
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15644
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15638
15645
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15639
15646
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15640
15647
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16900,6 +16907,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16900
16907
|
"completed",
|
|
16901
16908
|
"failed",
|
|
16902
16909
|
"interrupted",
|
|
16910
|
+
"needsInput",
|
|
16903
16911
|
"timedOut",
|
|
16904
16912
|
"unreadable",
|
|
16905
16913
|
"notFound"
|
|
@@ -16946,13 +16954,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16946
16954
|
var thread = { ...target, threadId: identity };
|
|
16947
16955
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16948
16956
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16957
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16949
16958
|
external_exports.strictObject({
|
|
16950
16959
|
kind: external_exports.literal("list"),
|
|
16951
16960
|
...target,
|
|
16952
16961
|
cursor: external_exports.string().nullable(),
|
|
16953
16962
|
archived: external_exports.boolean()
|
|
16954
16963
|
}),
|
|
16955
|
-
external_exports.strictObject({
|
|
16964
|
+
external_exports.strictObject({
|
|
16965
|
+
kind: external_exports.literal("read"),
|
|
16966
|
+
...thread,
|
|
16967
|
+
page: external_exports.strictObject({
|
|
16968
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16969
|
+
epoch: identity.optional(),
|
|
16970
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16971
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16972
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16973
|
+
message: "A history continuation requires its connection epoch"
|
|
16974
|
+
}).optional()
|
|
16975
|
+
}),
|
|
16956
16976
|
external_exports.strictObject({
|
|
16957
16977
|
kind: external_exports.literal("configure"),
|
|
16958
16978
|
...thread,
|
|
@@ -17353,6 +17373,7 @@ var requestTokenFields = [
|
|
|
17353
17373
|
"cacheWrite1hInputTokens",
|
|
17354
17374
|
"outputTokens",
|
|
17355
17375
|
"reasoningOutputTokens",
|
|
17376
|
+
"timedOutputTokens",
|
|
17356
17377
|
"startedAtMs",
|
|
17357
17378
|
"completedAtMs"
|
|
17358
17379
|
];
|
|
@@ -17405,6 +17426,14 @@ function parseHostUsageRequest(value) {
|
|
|
17405
17426
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17406
17427
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17407
17428
|
}
|
|
17429
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17430
|
+
if (request.startedAtMs === void 0) {
|
|
17431
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17432
|
+
}
|
|
17433
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17434
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17435
|
+
}
|
|
17436
|
+
}
|
|
17408
17437
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17409
17438
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17410
17439
|
}
|
|
@@ -56132,6 +56161,8 @@ function parseClaudeWorkflowAgents(value) {
|
|
|
56132
56161
|
var ClaudeNativeTurnAccumulator = class {
|
|
56133
56162
|
#provider;
|
|
56134
56163
|
#activeRootStreamMessageId = null;
|
|
56164
|
+
/** Native record UUIDs already published, across stream and request message IDs. */
|
|
56165
|
+
#publishedCheckpointIds = /* @__PURE__ */ new Set();
|
|
56135
56166
|
#assistantErrors = [];
|
|
56136
56167
|
#cancelRequested = false;
|
|
56137
56168
|
#compactionState = "idle";
|
|
@@ -56472,6 +56503,25 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
56472
56503
|
const messageId = this.#activeRootStreamMessageId ?? nativeMessageId ?? checkpointId ?? this.#nextMessageId();
|
|
56473
56504
|
const state = this.#messageState(messageId);
|
|
56474
56505
|
if (state.completed) {
|
|
56506
|
+
const splitText = checkpointId && !this.#publishedCheckpointIds.has(checkpointId) ? assistantText(message) : null;
|
|
56507
|
+
if (checkpointId && splitText) {
|
|
56508
|
+
this.#publishedCheckpointIds.add(checkpointId);
|
|
56509
|
+
state.text += splitText;
|
|
56510
|
+
events.push({ type: "text.delta", messageId, delta: splitText });
|
|
56511
|
+
this.#consumeToolUseBlocks(message, events, true);
|
|
56512
|
+
if (!this.#protocolConflict && !this.#textConflict) {
|
|
56513
|
+
const usage2 = state.usagePublished ? void 0 : assistantRequestUsage(message, this.#provider);
|
|
56514
|
+
if (usage2)
|
|
56515
|
+
state.usagePublished = true;
|
|
56516
|
+
events.push({
|
|
56517
|
+
type: "message.completed",
|
|
56518
|
+
messageId,
|
|
56519
|
+
checkpointId,
|
|
56520
|
+
...usage2 ? { lastRequestUsage: usage2 } : {}
|
|
56521
|
+
});
|
|
56522
|
+
}
|
|
56523
|
+
return;
|
|
56524
|
+
}
|
|
56475
56525
|
this.#consumeToolUseBlocks(message, events, true);
|
|
56476
56526
|
const usage = assistantRequestUsage(message, this.#provider);
|
|
56477
56527
|
if (usage && !state.usagePublished) {
|
|
@@ -56512,6 +56562,8 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
56512
56562
|
});
|
|
56513
56563
|
}
|
|
56514
56564
|
state.completed = true;
|
|
56565
|
+
if (checkpointId)
|
|
56566
|
+
this.#publishedCheckpointIds.add(checkpointId);
|
|
56515
56567
|
if (this.#activeRootStreamMessageId === messageId)
|
|
56516
56568
|
this.#activeRootStreamMessageId = null;
|
|
56517
56569
|
}
|
|
@@ -56654,7 +56706,12 @@ var ClaudeNativeTurnAccumulator = class {
|
|
|
56654
56706
|
const existing = this.#messages.get(messageId);
|
|
56655
56707
|
if (existing)
|
|
56656
56708
|
return existing;
|
|
56657
|
-
const created = {
|
|
56709
|
+
const created = {
|
|
56710
|
+
completed: false,
|
|
56711
|
+
reasoning: "",
|
|
56712
|
+
text: "",
|
|
56713
|
+
usagePublished: false
|
|
56714
|
+
};
|
|
56658
56715
|
this.#messages.set(messageId, created);
|
|
56659
56716
|
return created;
|
|
56660
56717
|
}
|
|
@@ -56802,6 +56859,25 @@ function readClaudeQueuedCommand(value, sessionId) {
|
|
|
56802
56859
|
|
|
56803
56860
|
// dist/claude-history.js
|
|
56804
56861
|
var claudeCodeHarnessId = harnessIdSchema.parse("claude-code");
|
|
56862
|
+
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;
|
|
56863
|
+
function matchesClaudeCheckpointId(persistedId, expectedId) {
|
|
56864
|
+
if (persistedId === expectedId)
|
|
56865
|
+
return true;
|
|
56866
|
+
if (!CLAUDE_BLOCK_SPLIT_UUID_PATTERN.test(expectedId))
|
|
56867
|
+
return false;
|
|
56868
|
+
return persistedId.length === 36 && persistedId.slice(0, 24).toLowerCase() === expectedId.slice(0, 24).toLowerCase();
|
|
56869
|
+
}
|
|
56870
|
+
function isPersistedClaudeMessageId(expectedId, persistedIds) {
|
|
56871
|
+
if (persistedIds.has(expectedId))
|
|
56872
|
+
return true;
|
|
56873
|
+
if (!CLAUDE_BLOCK_SPLIT_UUID_PATTERN.test(expectedId))
|
|
56874
|
+
return false;
|
|
56875
|
+
for (const id2 of persistedIds) {
|
|
56876
|
+
if (matchesClaudeCheckpointId(id2, expectedId))
|
|
56877
|
+
return true;
|
|
56878
|
+
}
|
|
56879
|
+
return false;
|
|
56880
|
+
}
|
|
56805
56881
|
function isRecord10(value) {
|
|
56806
56882
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
56807
56883
|
}
|
|
@@ -56875,6 +56951,12 @@ function visibleUserTextParts(message) {
|
|
|
56875
56951
|
return [];
|
|
56876
56952
|
return parts.filter((part) => !isLocalCommandRecord(part) && !isTaskNotificationRecord(part));
|
|
56877
56953
|
}
|
|
56954
|
+
function hasRootToolResult(message) {
|
|
56955
|
+
if (message.type !== "user" || message.nested || !Array.isArray(message.message.content)) {
|
|
56956
|
+
return false;
|
|
56957
|
+
}
|
|
56958
|
+
return message.message.content.some((block) => isRecord10(block) && block.type === "tool_result");
|
|
56959
|
+
}
|
|
56878
56960
|
function isInterruptionRecord(value, promptId) {
|
|
56879
56961
|
if (value.type !== "user" || promptId === null || value.promptId !== promptId || value.promptSource !== void 0 || !isRecord10(value.message))
|
|
56880
56962
|
return false;
|
|
@@ -56934,7 +57016,7 @@ function conversationMessages(values, sessionId) {
|
|
|
56934
57016
|
interrupted,
|
|
56935
57017
|
startsTurn: false,
|
|
56936
57018
|
...isRecord10(value.forkedFrom) && typeof value.forkedFrom.messageUuid === "string" ? { forkSourceUuid: value.forkedFrom.messageUuid } : {},
|
|
56937
|
-
syntheticUser: value.type === "user" && (interrupted || value.isSynthetic === true || value.isMeta === true || isTaskNotificationOrigin(value) || value.toolUseResult !== void 0 && value.toolUseResult !== null),
|
|
57019
|
+
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),
|
|
56938
57020
|
...value.toolUseResult !== void 0 || value.tool_use_result !== void 0 ? { toolUseResult: value.toolUseResult ?? value.tool_use_result } : {}
|
|
56939
57021
|
};
|
|
56940
57022
|
const notification = message.type === "user" && !message.nested && (isTaskNotificationOrigin(value) || textParts(message.message.content).some(isTaskNotificationRecord));
|
|
@@ -57041,9 +57123,16 @@ function itemOutcome(outcome) {
|
|
|
57041
57123
|
}
|
|
57042
57124
|
return { status: "succeeded" };
|
|
57043
57125
|
}
|
|
57126
|
+
function isCheckpointCandidate(message) {
|
|
57127
|
+
return !message.nested && (message.type === "assistant" || message.interrupted || hasRootToolResult(message));
|
|
57128
|
+
}
|
|
57044
57129
|
function mapClaudeSnapshot(values, sessionId) {
|
|
57130
|
+
return mapClaudeSnapshotWithCheckpointIds(values, sessionId).snapshot;
|
|
57131
|
+
}
|
|
57132
|
+
function mapClaudeSnapshotWithCheckpointIds(values, sessionId) {
|
|
57045
57133
|
const messages = conversationMessages(values, sessionId);
|
|
57046
57134
|
const turns = [];
|
|
57135
|
+
const turnCheckpointIds = [];
|
|
57047
57136
|
for (let index = 0; index < messages.length; ) {
|
|
57048
57137
|
const user = messages[index];
|
|
57049
57138
|
if (!user || !user.startsTurn) {
|
|
@@ -57058,12 +57147,13 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
57058
57147
|
const turnMessages = messages.slice(index, end);
|
|
57059
57148
|
const outcome = turnOutcome(turnMessages);
|
|
57060
57149
|
const results = toolResultBlocks(turnMessages);
|
|
57061
|
-
const checkpointIndex = turnMessages.findLastIndex(
|
|
57150
|
+
const checkpointIndex = turnMessages.findLastIndex(isCheckpointCandidate);
|
|
57062
57151
|
const lastSteering = turnMessages.findLastIndex(({ type }) => type === "steering");
|
|
57063
57152
|
const checkpointMessage = checkpointIndex > lastSteering ? turnMessages[checkpointIndex] : void 0;
|
|
57064
57153
|
let agentMessageOrdinal = 0;
|
|
57065
57154
|
let reasoningOrdinal = 0;
|
|
57066
57155
|
let toolOrdinal = 0;
|
|
57156
|
+
turnCheckpointIds.push(turnMessages.filter(isCheckpointCandidate).map((message) => message.uuid));
|
|
57067
57157
|
turns.push({
|
|
57068
57158
|
nativeTurnRef: nativeTurnRefSchema.parse({
|
|
57069
57159
|
harnessId: claudeCodeHarnessId,
|
|
@@ -57209,7 +57299,7 @@ function mapClaudeSnapshot(values, sessionId) {
|
|
|
57209
57299
|
});
|
|
57210
57300
|
index = end;
|
|
57211
57301
|
}
|
|
57212
|
-
return { turns };
|
|
57302
|
+
return { snapshot: { turns }, turnCheckpointIds };
|
|
57213
57303
|
}
|
|
57214
57304
|
function toolResultBlocks(messages) {
|
|
57215
57305
|
const results = /* @__PURE__ */ new Map();
|
|
@@ -57413,6 +57503,10 @@ function nativeIds(snapshot) {
|
|
|
57413
57503
|
]));
|
|
57414
57504
|
}
|
|
57415
57505
|
async function readSnapshot(dependencies, cwd, sessionId) {
|
|
57506
|
+
const history = await readHistory(dependencies, cwd, sessionId);
|
|
57507
|
+
return history.ok ? { ok: true, value: history.value.snapshot } : history;
|
|
57508
|
+
}
|
|
57509
|
+
async function readHistory(dependencies, cwd, sessionId) {
|
|
57416
57510
|
let messages;
|
|
57417
57511
|
try {
|
|
57418
57512
|
messages = await dependencies.readSessionMessages({ cwd, sessionId }) ?? [];
|
|
@@ -57429,7 +57523,7 @@ async function readSnapshot(dependencies, cwd, sessionId) {
|
|
|
57429
57523
|
};
|
|
57430
57524
|
}
|
|
57431
57525
|
try {
|
|
57432
|
-
return { ok: true, value:
|
|
57526
|
+
return { ok: true, value: mapClaudeSnapshotWithCheckpointIds(messages, sessionId) };
|
|
57433
57527
|
} catch {
|
|
57434
57528
|
return {
|
|
57435
57529
|
ok: false,
|
|
@@ -57469,9 +57563,10 @@ async function forkClaudeSession(input) {
|
|
|
57469
57563
|
error: error51("protocolError", "Claude Code Session working directory is unavailable", false)
|
|
57470
57564
|
};
|
|
57471
57565
|
}
|
|
57472
|
-
const
|
|
57473
|
-
if (!
|
|
57474
|
-
return
|
|
57566
|
+
const sourceHistory = await readHistory(input.dependencies, input.cwd, sourceRef.data.nativeSessionId);
|
|
57567
|
+
if (!sourceHistory.ok)
|
|
57568
|
+
return sourceHistory;
|
|
57569
|
+
const source = { ok: true, value: sourceHistory.value.snapshot };
|
|
57475
57570
|
if (input.kind === "rollbackLastTurn" && source.value.turns.length === 0) {
|
|
57476
57571
|
return {
|
|
57477
57572
|
ok: false,
|
|
@@ -57501,7 +57596,12 @@ async function forkClaudeSession(input) {
|
|
|
57501
57596
|
value: { sessionId: nativeRef.nativeSessionId, nativeRef, openMode: "create" }
|
|
57502
57597
|
};
|
|
57503
57598
|
}
|
|
57504
|
-
const boundaryIndex = input.kind === "rollbackLastTurn" ? source.value.turns.length - 2 :
|
|
57599
|
+
const boundaryIndex = input.kind === "rollbackLastTurn" ? source.value.turns.length - 2 : (
|
|
57600
|
+
// A live checkpoint names the last root Assistant record seen while the Turn ran;
|
|
57601
|
+
// the persisted Turn checkpoint can be a later root tool_result of the same Turn.
|
|
57602
|
+
// Fork at that Turn's final checkpoint so the native prefix keeps the whole Turn.
|
|
57603
|
+
sourceHistory.value.turnCheckpointIds.findIndex((ids, index) => checkpoint?.success && source.value.turns[index]?.checkpoint !== void 0 && ids.some((id2) => matchesClaudeCheckpointId(id2, checkpoint.data.checkpointId)))
|
|
57604
|
+
);
|
|
57505
57605
|
const retained = source.value.turns[boundaryIndex];
|
|
57506
57606
|
const boundaryId = retained?.checkpoint?.checkpointId ?? (input.kind === "rollbackLastTurn" ? retained?.nativeTurnRef.nativeTurnKey : void 0);
|
|
57507
57607
|
if (boundaryIndex < 0 || !boundaryId) {
|
|
@@ -57564,12 +57664,13 @@ async function forkClaudeSession(input) {
|
|
|
57564
57664
|
|
|
57565
57665
|
// dist/claude-fork-references.js
|
|
57566
57666
|
import { randomUUID as randomUUID4 } from "node:crypto";
|
|
57567
|
-
import { readFile as
|
|
57667
|
+
import { readFile as readFile5, rename as rename4, rm as rm5, stat as stat5, writeFile as writeFile2 } from "node:fs/promises";
|
|
57568
57668
|
|
|
57569
57669
|
// dist/claude-transcript.js
|
|
57670
|
+
import { createReadStream as createReadStream4 } from "node:fs";
|
|
57570
57671
|
import os6 from "node:os";
|
|
57571
57672
|
import path12 from "node:path";
|
|
57572
|
-
import {
|
|
57673
|
+
import { readdir as readdir3, stat as stat4 } from "node:fs/promises";
|
|
57573
57674
|
function projectDirectoryName(cwd) {
|
|
57574
57675
|
return cwd.replace(/[^A-Za-z0-9]/gu, "-");
|
|
57575
57676
|
}
|
|
@@ -57602,6 +57703,28 @@ async function findClaudeTranscript(input) {
|
|
|
57602
57703
|
}
|
|
57603
57704
|
return null;
|
|
57604
57705
|
}
|
|
57706
|
+
async function* transcriptLines(transcript) {
|
|
57707
|
+
const stream = createReadStream4(transcript, { encoding: "utf8" });
|
|
57708
|
+
let pending = "";
|
|
57709
|
+
try {
|
|
57710
|
+
for await (const chunk of stream) {
|
|
57711
|
+
const contents = chunk;
|
|
57712
|
+
let start = 0;
|
|
57713
|
+
let newline;
|
|
57714
|
+
while ((newline = contents.indexOf("\n", start)) !== -1) {
|
|
57715
|
+
const line = pending + contents.slice(start, newline);
|
|
57716
|
+
pending = "";
|
|
57717
|
+
yield line;
|
|
57718
|
+
start = newline + 1;
|
|
57719
|
+
}
|
|
57720
|
+
pending += contents.slice(start);
|
|
57721
|
+
}
|
|
57722
|
+
if (pending.length > 0)
|
|
57723
|
+
yield pending;
|
|
57724
|
+
} finally {
|
|
57725
|
+
stream.destroy();
|
|
57726
|
+
}
|
|
57727
|
+
}
|
|
57605
57728
|
function isRecord11(value) {
|
|
57606
57729
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
57607
57730
|
}
|
|
@@ -57609,9 +57732,8 @@ async function readClaudeTranscript(input) {
|
|
|
57609
57732
|
const transcript = await findClaudeTranscript(input);
|
|
57610
57733
|
if (!transcript)
|
|
57611
57734
|
return null;
|
|
57612
|
-
const contents = await readFile5(transcript, "utf8");
|
|
57613
57735
|
const messages = /* @__PURE__ */ new Map();
|
|
57614
|
-
for (const line of
|
|
57736
|
+
for await (const line of transcriptLines(transcript)) {
|
|
57615
57737
|
if (line.trim().length === 0)
|
|
57616
57738
|
continue;
|
|
57617
57739
|
let entry;
|
|
@@ -57664,7 +57786,7 @@ async function remapForkedSessionReferences(input) {
|
|
|
57664
57786
|
const transcript = await findClaudeTranscript(input);
|
|
57665
57787
|
if (!transcript)
|
|
57666
57788
|
return 0;
|
|
57667
|
-
const contents = await
|
|
57789
|
+
const contents = await readFile5(transcript, "utf8");
|
|
57668
57790
|
if (!contents.includes('"sameAs"'))
|
|
57669
57791
|
return 0;
|
|
57670
57792
|
const lines = contents.split("\n");
|
|
@@ -57704,7 +57826,7 @@ async function remapForkedSessionReferences(input) {
|
|
|
57704
57826
|
|
|
57705
57827
|
// dist/model-catalog.js
|
|
57706
57828
|
import { Buffer as Buffer2 } from "node:buffer";
|
|
57707
|
-
import { readFile as
|
|
57829
|
+
import { readFile as readFile6 } from "node:fs/promises";
|
|
57708
57830
|
import os7 from "node:os";
|
|
57709
57831
|
import path13 from "node:path";
|
|
57710
57832
|
|
|
@@ -57757,7 +57879,7 @@ var CLAUDE_MODEL_VALUE_MAX_LENGTH = 512;
|
|
|
57757
57879
|
var modelInfoSchema = external_exports.object({
|
|
57758
57880
|
value: external_exports.string().trim().min(1).max(CLAUDE_MODEL_VALUE_MAX_LENGTH),
|
|
57759
57881
|
displayName: external_exports.string().trim().min(1).max(HARNESS_MODEL_LABEL_MAX_LENGTH),
|
|
57760
|
-
description: external_exports.string().trim().
|
|
57882
|
+
description: external_exports.string().trim().max(HARNESS_MODEL_LABEL_MAX_LENGTH).optional(),
|
|
57761
57883
|
resolvedModel: harnessResolvedModelLabelSchema.optional()
|
|
57762
57884
|
});
|
|
57763
57885
|
var modelPickerOptionSchema = external_exports.object({
|
|
@@ -57844,7 +57966,7 @@ async function readClaudeUserModelPicker(environment = process.env) {
|
|
|
57844
57966
|
const settingsPath = path13.join(resolveClaudeConfigDirectory(environment), "settings.json");
|
|
57845
57967
|
let raw;
|
|
57846
57968
|
try {
|
|
57847
|
-
raw = await
|
|
57969
|
+
raw = await readFile6(settingsPath, "utf8");
|
|
57848
57970
|
} catch {
|
|
57849
57971
|
return void 0;
|
|
57850
57972
|
}
|
|
@@ -60323,6 +60445,7 @@ var DEFAULT_CONTINUATION_QUIESCENCE_MS = 2e3;
|
|
|
60323
60445
|
function isRecord16(value) {
|
|
60324
60446
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
60325
60447
|
}
|
|
60448
|
+
var SYNTHETIC_AUTONOMOUS_TURN_KEY_PATTERN = /^autonomous-\d+$/u;
|
|
60326
60449
|
function safeNonNegativeInteger2(value) {
|
|
60327
60450
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0;
|
|
60328
60451
|
}
|
|
@@ -60659,7 +60782,7 @@ var ClaudeHarnessSession = class {
|
|
|
60659
60782
|
sessionId: this.#sessionId
|
|
60660
60783
|
}) ?? [];
|
|
60661
60784
|
const ids = new Set(messages.flatMap((message) => isRecord16(message) && typeof message.uuid === "string" ? [message.uuid] : []));
|
|
60662
|
-
if (this.#unpersistedMessageIds.every((id2) =>
|
|
60785
|
+
if (this.#unpersistedMessageIds.every((id2) => isPersistedClaudeMessageId(id2, ids))) {
|
|
60663
60786
|
this.#unpersistedMessageIds = [];
|
|
60664
60787
|
break;
|
|
60665
60788
|
}
|
|
@@ -62540,11 +62663,12 @@ var ClaudeHarnessSession = class {
|
|
|
62540
62663
|
checkpointId: active.checkpointId,
|
|
62541
62664
|
formatVersion: 1
|
|
62542
62665
|
}) : null;
|
|
62543
|
-
|
|
62666
|
+
const trackUserMessageId = active.userMessageId !== null && !SYNTHETIC_AUTONOMOUS_TURN_KEY_PATTERN.test(active.userMessageId) && (outcome.status !== "cancelled" || active.checkpointId !== null);
|
|
62667
|
+
if (trackUserMessageId || active.checkpointId) {
|
|
62544
62668
|
this.#unpersistedMessageIds = [
|
|
62545
62669
|
.../* @__PURE__ */ new Set([
|
|
62546
62670
|
...this.#unpersistedMessageIds,
|
|
62547
|
-
...active.userMessageId ? [active.userMessageId] : [],
|
|
62671
|
+
...trackUserMessageId && active.userMessageId ? [active.userMessageId] : [],
|
|
62548
62672
|
...active.checkpointId ? [active.checkpointId] : []
|
|
62549
62673
|
])
|
|
62550
62674
|
];
|
|
@@ -63149,11 +63273,11 @@ var ClaudeCodeAdapter = class {
|
|
|
63149
63273
|
};
|
|
63150
63274
|
|
|
63151
63275
|
// dist/installation.js
|
|
63152
|
-
import { readFile as
|
|
63276
|
+
import { readFile as readFile7, realpath as realpath5 } from "node:fs/promises";
|
|
63153
63277
|
import { homedir as homedir2 } from "node:os";
|
|
63154
63278
|
import path16 from "node:path";
|
|
63155
63279
|
async function readSettings(file2) {
|
|
63156
|
-
const text2 = await
|
|
63280
|
+
const text2 = await readFile7(file2, "utf8").catch((error52) => {
|
|
63157
63281
|
if (error52.code === "ENOENT")
|
|
63158
63282
|
return "{}";
|
|
63159
63283
|
throw error52;
|
|
@@ -15509,7 +15509,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15509
15509
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15510
15510
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15511
15511
|
var usageOutputTimingSchema = external_exports.object({
|
|
15512
|
-
version: external_exports.literal(3).optional(),
|
|
15512
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15513
15513
|
requestId: external_exports.string().min(1),
|
|
15514
15514
|
turnId: external_exports.string().min(1).max(1024),
|
|
15515
15515
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15517,16 +15517,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15517
15517
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15518
15518
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15519
15519
|
var usageMeasurementSchema = external_exports.object({
|
|
15520
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15520
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15521
15521
|
value: finiteNonNegativeNumberSchema,
|
|
15522
15522
|
turnId: external_exports.string().min(1).max(1024),
|
|
15523
15523
|
at: nonNegativeSafeIntegerSchema
|
|
15524
15524
|
}).strict();
|
|
15525
15525
|
var usageMeasurementsSchema = external_exports.object({
|
|
15526
|
-
//
|
|
15527
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15526
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15527
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15528
15528
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15529
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15529
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15530
15530
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15531
15531
|
}).strict();
|
|
15532
15532
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -16040,6 +16040,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
16040
16040
|
cursor: clientChannelCursorSchema,
|
|
16041
16041
|
cwd: external_exports.string().optional()
|
|
16042
16042
|
}),
|
|
16043
|
+
external_exports.object({
|
|
16044
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
16045
|
+
cursor: clientChannelCursorSchema,
|
|
16046
|
+
harnessId: external_exports.string().min(1)
|
|
16047
|
+
}),
|
|
16043
16048
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
16044
16049
|
external_exports.object({
|
|
16045
16050
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -16111,6 +16116,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
16111
16116
|
var clientTurnSchema = external_exports.object({
|
|
16112
16117
|
id: external_exports.string().min(1),
|
|
16113
16118
|
status: external_exports.string().min(1),
|
|
16119
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
16120
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
16114
16121
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
16115
16122
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
16116
16123
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -17376,6 +17383,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
17376
17383
|
"completed",
|
|
17377
17384
|
"failed",
|
|
17378
17385
|
"interrupted",
|
|
17386
|
+
"needsInput",
|
|
17379
17387
|
"timedOut",
|
|
17380
17388
|
"unreadable",
|
|
17381
17389
|
"notFound"
|
|
@@ -17422,13 +17430,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
17422
17430
|
var thread = { ...target, threadId: identity };
|
|
17423
17431
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17424
17432
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17433
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17425
17434
|
external_exports.strictObject({
|
|
17426
17435
|
kind: external_exports.literal("list"),
|
|
17427
17436
|
...target,
|
|
17428
17437
|
cursor: external_exports.string().nullable(),
|
|
17429
17438
|
archived: external_exports.boolean()
|
|
17430
17439
|
}),
|
|
17431
|
-
external_exports.strictObject({
|
|
17440
|
+
external_exports.strictObject({
|
|
17441
|
+
kind: external_exports.literal("read"),
|
|
17442
|
+
...thread,
|
|
17443
|
+
page: external_exports.strictObject({
|
|
17444
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
17445
|
+
epoch: identity.optional(),
|
|
17446
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
17447
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
17448
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
17449
|
+
message: "A history continuation requires its connection epoch"
|
|
17450
|
+
}).optional()
|
|
17451
|
+
}),
|
|
17432
17452
|
external_exports.strictObject({
|
|
17433
17453
|
kind: external_exports.literal("configure"),
|
|
17434
17454
|
...thread,
|
|
@@ -17858,6 +17878,7 @@ var requestTokenFields = [
|
|
|
17858
17878
|
"cacheWrite1hInputTokens",
|
|
17859
17879
|
"outputTokens",
|
|
17860
17880
|
"reasoningOutputTokens",
|
|
17881
|
+
"timedOutputTokens",
|
|
17861
17882
|
"startedAtMs",
|
|
17862
17883
|
"completedAtMs"
|
|
17863
17884
|
];
|
|
@@ -17910,6 +17931,14 @@ function parseHostUsageRequest(value) {
|
|
|
17910
17931
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17911
17932
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17912
17933
|
}
|
|
17934
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17935
|
+
if (request.startedAtMs === void 0) {
|
|
17936
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17937
|
+
}
|
|
17938
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17939
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17940
|
+
}
|
|
17941
|
+
}
|
|
17913
17942
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17914
17943
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17915
17944
|
}
|
|
@@ -15027,7 +15027,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15027
15027
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15028
15028
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15029
15029
|
var usageOutputTimingSchema = external_exports.object({
|
|
15030
|
-
version: external_exports.literal(3).optional(),
|
|
15030
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15031
15031
|
requestId: external_exports.string().min(1),
|
|
15032
15032
|
turnId: external_exports.string().min(1).max(1024),
|
|
15033
15033
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15035,16 +15035,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15035
15035
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15036
15036
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15037
15037
|
var usageMeasurementSchema = external_exports.object({
|
|
15038
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15038
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15039
15039
|
value: finiteNonNegativeNumberSchema,
|
|
15040
15040
|
turnId: external_exports.string().min(1).max(1024),
|
|
15041
15041
|
at: nonNegativeSafeIntegerSchema
|
|
15042
15042
|
}).strict();
|
|
15043
15043
|
var usageMeasurementsSchema = external_exports.object({
|
|
15044
|
-
//
|
|
15045
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15044
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15045
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15046
15046
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15047
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15047
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15048
15048
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15049
15049
|
}).strict();
|
|
15050
15050
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text2) => text2.length <= maximum));
|
|
@@ -15558,6 +15558,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15558
15558
|
cursor: clientChannelCursorSchema,
|
|
15559
15559
|
cwd: external_exports.string().optional()
|
|
15560
15560
|
}),
|
|
15561
|
+
external_exports.object({
|
|
15562
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15563
|
+
cursor: clientChannelCursorSchema,
|
|
15564
|
+
harnessId: external_exports.string().min(1)
|
|
15565
|
+
}),
|
|
15561
15566
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15562
15567
|
external_exports.object({
|
|
15563
15568
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15629,6 +15634,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15629
15634
|
var clientTurnSchema = external_exports.object({
|
|
15630
15635
|
id: external_exports.string().min(1),
|
|
15631
15636
|
status: external_exports.string().min(1),
|
|
15637
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15638
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15632
15639
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15633
15640
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15634
15641
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16889,6 +16896,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16889
16896
|
"completed",
|
|
16890
16897
|
"failed",
|
|
16891
16898
|
"interrupted",
|
|
16899
|
+
"needsInput",
|
|
16892
16900
|
"timedOut",
|
|
16893
16901
|
"unreadable",
|
|
16894
16902
|
"notFound"
|
|
@@ -16935,13 +16943,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16935
16943
|
var thread = { ...target, threadId: identity };
|
|
16936
16944
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16937
16945
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16946
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16938
16947
|
external_exports.strictObject({
|
|
16939
16948
|
kind: external_exports.literal("list"),
|
|
16940
16949
|
...target,
|
|
16941
16950
|
cursor: external_exports.string().nullable(),
|
|
16942
16951
|
archived: external_exports.boolean()
|
|
16943
16952
|
}),
|
|
16944
|
-
external_exports.strictObject({
|
|
16953
|
+
external_exports.strictObject({
|
|
16954
|
+
kind: external_exports.literal("read"),
|
|
16955
|
+
...thread,
|
|
16956
|
+
page: external_exports.strictObject({
|
|
16957
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16958
|
+
epoch: identity.optional(),
|
|
16959
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16960
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16961
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16962
|
+
message: "A history continuation requires its connection epoch"
|
|
16963
|
+
}).optional()
|
|
16964
|
+
}),
|
|
16945
16965
|
external_exports.strictObject({
|
|
16946
16966
|
kind: external_exports.literal("configure"),
|
|
16947
16967
|
...thread,
|
|
@@ -18272,6 +18292,7 @@ var requestTokenFields = [
|
|
|
18272
18292
|
"cacheWrite1hInputTokens",
|
|
18273
18293
|
"outputTokens",
|
|
18274
18294
|
"reasoningOutputTokens",
|
|
18295
|
+
"timedOutputTokens",
|
|
18275
18296
|
"startedAtMs",
|
|
18276
18297
|
"completedAtMs"
|
|
18277
18298
|
];
|
|
@@ -18324,6 +18345,14 @@ function parseHostUsageRequest(value) {
|
|
|
18324
18345
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
18325
18346
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
18326
18347
|
}
|
|
18348
|
+
if (request.timedOutputTokens !== void 0) {
|
|
18349
|
+
if (request.startedAtMs === void 0) {
|
|
18350
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
18351
|
+
}
|
|
18352
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
18353
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
18354
|
+
}
|
|
18355
|
+
}
|
|
18327
18356
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
18328
18357
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
18329
18358
|
}
|