@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
|
@@ -18714,7 +18714,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
18714
18714
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
18715
18715
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
18716
18716
|
var usageOutputTimingSchema = external_exports.object({
|
|
18717
|
-
version: external_exports.literal(3).optional(),
|
|
18717
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
18718
18718
|
requestId: external_exports.string().min(1),
|
|
18719
18719
|
turnId: external_exports.string().min(1).max(1024),
|
|
18720
18720
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -18722,16 +18722,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
18722
18722
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
18723
18723
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
18724
18724
|
var usageMeasurementSchema = external_exports.object({
|
|
18725
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
18725
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
18726
18726
|
value: finiteNonNegativeNumberSchema,
|
|
18727
18727
|
turnId: external_exports.string().min(1).max(1024),
|
|
18728
18728
|
at: nonNegativeSafeIntegerSchema
|
|
18729
18729
|
}).strict();
|
|
18730
18730
|
var usageMeasurementsSchema = external_exports.object({
|
|
18731
|
-
//
|
|
18732
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
18731
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
18732
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
18733
18733
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
18734
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
18734
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
18735
18735
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
18736
18736
|
}).strict();
|
|
18737
18737
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -19197,6 +19197,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
19197
19197
|
cursor: clientChannelCursorSchema,
|
|
19198
19198
|
cwd: external_exports.string().optional()
|
|
19199
19199
|
}),
|
|
19200
|
+
external_exports.object({
|
|
19201
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
19202
|
+
cursor: clientChannelCursorSchema,
|
|
19203
|
+
harnessId: external_exports.string().min(1)
|
|
19204
|
+
}),
|
|
19200
19205
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
19201
19206
|
external_exports.object({
|
|
19202
19207
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -19268,6 +19273,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
19268
19273
|
var clientTurnSchema = external_exports.object({
|
|
19269
19274
|
id: external_exports.string().min(1),
|
|
19270
19275
|
status: external_exports.string().min(1),
|
|
19276
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
19277
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
19271
19278
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
19272
19279
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
19273
19280
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -20484,6 +20491,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
20484
20491
|
"completed",
|
|
20485
20492
|
"failed",
|
|
20486
20493
|
"interrupted",
|
|
20494
|
+
"needsInput",
|
|
20487
20495
|
"timedOut",
|
|
20488
20496
|
"unreadable",
|
|
20489
20497
|
"notFound"
|
|
@@ -20530,13 +20538,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
20530
20538
|
var thread = { ...target, threadId: identity };
|
|
20531
20539
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
20532
20540
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
20541
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
20533
20542
|
external_exports.strictObject({
|
|
20534
20543
|
kind: external_exports.literal("list"),
|
|
20535
20544
|
...target,
|
|
20536
20545
|
cursor: external_exports.string().nullable(),
|
|
20537
20546
|
archived: external_exports.boolean()
|
|
20538
20547
|
}),
|
|
20539
|
-
external_exports.strictObject({
|
|
20548
|
+
external_exports.strictObject({
|
|
20549
|
+
kind: external_exports.literal("read"),
|
|
20550
|
+
...thread,
|
|
20551
|
+
page: external_exports.strictObject({
|
|
20552
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
20553
|
+
epoch: identity.optional(),
|
|
20554
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
20555
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
20556
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
20557
|
+
message: "A history continuation requires its connection epoch"
|
|
20558
|
+
}).optional()
|
|
20559
|
+
}),
|
|
20540
20560
|
external_exports.strictObject({
|
|
20541
20561
|
kind: external_exports.literal("configure"),
|
|
20542
20562
|
...thread,
|
|
@@ -32904,6 +32924,7 @@ var requestTokenFields = [
|
|
|
32904
32924
|
"cacheWrite1hInputTokens",
|
|
32905
32925
|
"outputTokens",
|
|
32906
32926
|
"reasoningOutputTokens",
|
|
32927
|
+
"timedOutputTokens",
|
|
32907
32928
|
"startedAtMs",
|
|
32908
32929
|
"completedAtMs"
|
|
32909
32930
|
];
|
|
@@ -15024,7 +15024,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15024
15024
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15025
15025
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15026
15026
|
var usageOutputTimingSchema = external_exports.object({
|
|
15027
|
-
version: external_exports.literal(3).optional(),
|
|
15027
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15028
15028
|
requestId: external_exports.string().min(1),
|
|
15029
15029
|
turnId: external_exports.string().min(1).max(1024),
|
|
15030
15030
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15032,16 +15032,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15032
15032
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15033
15033
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15034
15034
|
var usageMeasurementSchema = external_exports.object({
|
|
15035
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15035
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15036
15036
|
value: finiteNonNegativeNumberSchema,
|
|
15037
15037
|
turnId: external_exports.string().min(1).max(1024),
|
|
15038
15038
|
at: nonNegativeSafeIntegerSchema
|
|
15039
15039
|
}).strict();
|
|
15040
15040
|
var usageMeasurementsSchema = external_exports.object({
|
|
15041
|
-
//
|
|
15042
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15041
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15042
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15043
15043
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15044
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15044
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15045
15045
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15046
15046
|
}).strict();
|
|
15047
15047
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15507,6 +15507,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15507
15507
|
cursor: clientChannelCursorSchema,
|
|
15508
15508
|
cwd: external_exports.string().optional()
|
|
15509
15509
|
}),
|
|
15510
|
+
external_exports.object({
|
|
15511
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15512
|
+
cursor: clientChannelCursorSchema,
|
|
15513
|
+
harnessId: external_exports.string().min(1)
|
|
15514
|
+
}),
|
|
15510
15515
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15511
15516
|
external_exports.object({
|
|
15512
15517
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15578,6 +15583,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15578
15583
|
var clientTurnSchema = external_exports.object({
|
|
15579
15584
|
id: external_exports.string().min(1),
|
|
15580
15585
|
status: external_exports.string().min(1),
|
|
15586
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15587
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15581
15588
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15582
15589
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15583
15590
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16794,6 +16801,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16794
16801
|
"completed",
|
|
16795
16802
|
"failed",
|
|
16796
16803
|
"interrupted",
|
|
16804
|
+
"needsInput",
|
|
16797
16805
|
"timedOut",
|
|
16798
16806
|
"unreadable",
|
|
16799
16807
|
"notFound"
|
|
@@ -16840,13 +16848,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16840
16848
|
var thread = { ...target, threadId: identity };
|
|
16841
16849
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16842
16850
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16851
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16843
16852
|
external_exports.strictObject({
|
|
16844
16853
|
kind: external_exports.literal("list"),
|
|
16845
16854
|
...target,
|
|
16846
16855
|
cursor: external_exports.string().nullable(),
|
|
16847
16856
|
archived: external_exports.boolean()
|
|
16848
16857
|
}),
|
|
16849
|
-
external_exports.strictObject({
|
|
16858
|
+
external_exports.strictObject({
|
|
16859
|
+
kind: external_exports.literal("read"),
|
|
16860
|
+
...thread,
|
|
16861
|
+
page: external_exports.strictObject({
|
|
16862
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16863
|
+
epoch: identity.optional(),
|
|
16864
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16865
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16866
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16867
|
+
message: "A history continuation requires its connection epoch"
|
|
16868
|
+
}).optional()
|
|
16869
|
+
}),
|
|
16850
16870
|
external_exports.strictObject({
|
|
16851
16871
|
kind: external_exports.literal("configure"),
|
|
16852
16872
|
...thread,
|
|
@@ -17242,6 +17262,7 @@ var requestTokenFields = [
|
|
|
17242
17262
|
"cacheWrite1hInputTokens",
|
|
17243
17263
|
"outputTokens",
|
|
17244
17264
|
"reasoningOutputTokens",
|
|
17265
|
+
"timedOutputTokens",
|
|
17245
17266
|
"startedAtMs",
|
|
17246
17267
|
"completedAtMs"
|
|
17247
17268
|
];
|
|
@@ -18904,7 +18904,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
18904
18904
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
18905
18905
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
18906
18906
|
var usageOutputTimingSchema = external_exports.object({
|
|
18907
|
-
version: external_exports.literal(3).optional(),
|
|
18907
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
18908
18908
|
requestId: external_exports.string().min(1),
|
|
18909
18909
|
turnId: external_exports.string().min(1).max(1024),
|
|
18910
18910
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -18912,16 +18912,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
18912
18912
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
18913
18913
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
18914
18914
|
var usageMeasurementSchema = external_exports.object({
|
|
18915
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
18915
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
18916
18916
|
value: finiteNonNegativeNumberSchema,
|
|
18917
18917
|
turnId: external_exports.string().min(1).max(1024),
|
|
18918
18918
|
at: nonNegativeSafeIntegerSchema
|
|
18919
18919
|
}).strict();
|
|
18920
18920
|
var usageMeasurementsSchema = external_exports.object({
|
|
18921
|
-
//
|
|
18922
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
18921
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
18922
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
18923
18923
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
18924
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
18924
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
18925
18925
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
18926
18926
|
}).strict();
|
|
18927
18927
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -19387,6 +19387,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
19387
19387
|
cursor: clientChannelCursorSchema,
|
|
19388
19388
|
cwd: external_exports.string().optional()
|
|
19389
19389
|
}),
|
|
19390
|
+
external_exports.object({
|
|
19391
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
19392
|
+
cursor: clientChannelCursorSchema,
|
|
19393
|
+
harnessId: external_exports.string().min(1)
|
|
19394
|
+
}),
|
|
19390
19395
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
19391
19396
|
external_exports.object({
|
|
19392
19397
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -19458,6 +19463,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
19458
19463
|
var clientTurnSchema = external_exports.object({
|
|
19459
19464
|
id: external_exports.string().min(1),
|
|
19460
19465
|
status: external_exports.string().min(1),
|
|
19466
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
19467
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
19461
19468
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
19462
19469
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
19463
19470
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -20678,6 +20685,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
20678
20685
|
"completed",
|
|
20679
20686
|
"failed",
|
|
20680
20687
|
"interrupted",
|
|
20688
|
+
"needsInput",
|
|
20681
20689
|
"timedOut",
|
|
20682
20690
|
"unreadable",
|
|
20683
20691
|
"notFound"
|
|
@@ -20724,13 +20732,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
20724
20732
|
var thread = { ...target, threadId: identity };
|
|
20725
20733
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
20726
20734
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
20735
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
20727
20736
|
external_exports.strictObject({
|
|
20728
20737
|
kind: external_exports.literal("list"),
|
|
20729
20738
|
...target,
|
|
20730
20739
|
cursor: external_exports.string().nullable(),
|
|
20731
20740
|
archived: external_exports.boolean()
|
|
20732
20741
|
}),
|
|
20733
|
-
external_exports.strictObject({
|
|
20742
|
+
external_exports.strictObject({
|
|
20743
|
+
kind: external_exports.literal("read"),
|
|
20744
|
+
...thread,
|
|
20745
|
+
page: external_exports.strictObject({
|
|
20746
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
20747
|
+
epoch: identity.optional(),
|
|
20748
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
20749
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
20750
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
20751
|
+
message: "A history continuation requires its connection epoch"
|
|
20752
|
+
}).optional()
|
|
20753
|
+
}),
|
|
20734
20754
|
external_exports.strictObject({
|
|
20735
20755
|
kind: external_exports.literal("configure"),
|
|
20736
20756
|
...thread,
|
|
@@ -21131,6 +21151,7 @@ var requestTokenFields = [
|
|
|
21131
21151
|
"cacheWrite1hInputTokens",
|
|
21132
21152
|
"outputTokens",
|
|
21133
21153
|
"reasoningOutputTokens",
|
|
21154
|
+
"timedOutputTokens",
|
|
21134
21155
|
"startedAtMs",
|
|
21135
21156
|
"completedAtMs"
|
|
21136
21157
|
];
|
|
@@ -21183,6 +21204,14 @@ function parseHostUsageRequest(value) {
|
|
|
21183
21204
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
21184
21205
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
21185
21206
|
}
|
|
21207
|
+
if (request.timedOutputTokens !== void 0) {
|
|
21208
|
+
if (request.startedAtMs === void 0) {
|
|
21209
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
21210
|
+
}
|
|
21211
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
21212
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
21213
|
+
}
|
|
21214
|
+
}
|
|
21186
21215
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
21187
21216
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
21188
21217
|
}
|
|
@@ -22790,11 +22819,23 @@ function isRecord5(value) {
|
|
|
22790
22819
|
function count2(value) {
|
|
22791
22820
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
22792
22821
|
}
|
|
22793
|
-
function firstTokenTime(chunks) {
|
|
22822
|
+
function firstTokenTime(chunks, reasoning2) {
|
|
22823
|
+
if (reasoning2 !== null && reasoning2 > 0 && !chunks.some(({ chunk }) => chunk.type === "block-start" && chunk.blockType === "reasoning" || chunk.type === "reasoning-delta" && typeof chunk.text === "string" && chunk.text.length > 0))
|
|
22824
|
+
return null;
|
|
22794
22825
|
for (const { time: time3, chunk } of chunks) {
|
|
22795
|
-
if (
|
|
22826
|
+
if (chunk.type === "block-start" && chunk.blockType === "reasoning" || (chunk.type === "reasoning-delta" || chunk.type === "text-delta") && typeof chunk.text === "string" && chunk.text.length > 0) {
|
|
22796
22827
|
return time3;
|
|
22797
22828
|
}
|
|
22829
|
+
if (chunk.type === "tool-call-delta" && typeof chunk.argumentsDelta === "string" && chunk.argumentsDelta.trim().length > 0) {
|
|
22830
|
+
try {
|
|
22831
|
+
JSON.parse(chunk.argumentsDelta);
|
|
22832
|
+
} catch {
|
|
22833
|
+
if (typeof chunk.name === "string" && chunk.name.length > 0)
|
|
22834
|
+
return time3;
|
|
22835
|
+
continue;
|
|
22836
|
+
}
|
|
22837
|
+
return null;
|
|
22838
|
+
}
|
|
22798
22839
|
}
|
|
22799
22840
|
return null;
|
|
22800
22841
|
}
|
|
@@ -22832,8 +22873,8 @@ function deepSeekUsageRecord(event, historical) {
|
|
|
22832
22873
|
if (input === null || output === null || cacheRead === null || cacheWrite === null) {
|
|
22833
22874
|
return { kind: "missing" };
|
|
22834
22875
|
}
|
|
22835
|
-
const startedAtMs = historical ? null : firstTokenTime(chunks);
|
|
22836
|
-
const completedAtMs =
|
|
22876
|
+
const startedAtMs = historical ? null : count2(firstTokenTime(chunks, reasoning2));
|
|
22877
|
+
const completedAtMs = count2(event.time);
|
|
22837
22878
|
try {
|
|
22838
22879
|
return {
|
|
22839
22880
|
kind: "request",
|
|
@@ -22846,7 +22887,7 @@ function deepSeekUsageRecord(event, historical) {
|
|
|
22846
22887
|
cacheWriteInputTokens: cacheWrite,
|
|
22847
22888
|
outputTokens: output,
|
|
22848
22889
|
...reasoning2 !== null && reasoning2 <= output ? { reasoningOutputTokens: reasoning2 } : {},
|
|
22849
|
-
...startedAtMs !== null && completedAtMs !== null && completedAtMs
|
|
22890
|
+
...startedAtMs !== null && completedAtMs !== null && completedAtMs > startedAtMs ? { startedAtMs, completedAtMs } : {}
|
|
22850
22891
|
})
|
|
22851
22892
|
};
|
|
22852
22893
|
} catch {
|
|
@@ -14661,7 +14661,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
14661
14661
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
14662
14662
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
14663
14663
|
var usageOutputTimingSchema = external_exports.object({
|
|
14664
|
-
version: external_exports.literal(3).optional(),
|
|
14664
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14665
14665
|
requestId: external_exports.string().min(1),
|
|
14666
14666
|
turnId: external_exports.string().min(1).max(1024),
|
|
14667
14667
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -14669,16 +14669,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
14669
14669
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
14670
14670
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
14671
14671
|
var usageMeasurementSchema = external_exports.object({
|
|
14672
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
14672
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
14673
14673
|
value: finiteNonNegativeNumberSchema,
|
|
14674
14674
|
turnId: external_exports.string().min(1).max(1024),
|
|
14675
14675
|
at: nonNegativeSafeIntegerSchema
|
|
14676
14676
|
}).strict();
|
|
14677
14677
|
var usageMeasurementsSchema = external_exports.object({
|
|
14678
|
-
//
|
|
14679
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
14678
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
14679
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
14680
14680
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
14681
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
14681
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
14682
14682
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
14683
14683
|
}).strict();
|
|
14684
14684
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15144,6 +15144,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15144
15144
|
cursor: clientChannelCursorSchema,
|
|
15145
15145
|
cwd: external_exports.string().optional()
|
|
15146
15146
|
}),
|
|
15147
|
+
external_exports.object({
|
|
15148
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15149
|
+
cursor: clientChannelCursorSchema,
|
|
15150
|
+
harnessId: external_exports.string().min(1)
|
|
15151
|
+
}),
|
|
15147
15152
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15148
15153
|
external_exports.object({
|
|
15149
15154
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15215,6 +15220,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15215
15220
|
var clientTurnSchema = external_exports.object({
|
|
15216
15221
|
id: external_exports.string().min(1),
|
|
15217
15222
|
status: external_exports.string().min(1),
|
|
15223
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15224
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15218
15225
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15219
15226
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15220
15227
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16431,6 +16438,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16431
16438
|
"completed",
|
|
16432
16439
|
"failed",
|
|
16433
16440
|
"interrupted",
|
|
16441
|
+
"needsInput",
|
|
16434
16442
|
"timedOut",
|
|
16435
16443
|
"unreadable",
|
|
16436
16444
|
"notFound"
|
|
@@ -16477,13 +16485,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16477
16485
|
var thread = { ...target, threadId: identity };
|
|
16478
16486
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16479
16487
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16488
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16480
16489
|
external_exports.strictObject({
|
|
16481
16490
|
kind: external_exports.literal("list"),
|
|
16482
16491
|
...target,
|
|
16483
16492
|
cursor: external_exports.string().nullable(),
|
|
16484
16493
|
archived: external_exports.boolean()
|
|
16485
16494
|
}),
|
|
16486
|
-
external_exports.strictObject({
|
|
16495
|
+
external_exports.strictObject({
|
|
16496
|
+
kind: external_exports.literal("read"),
|
|
16497
|
+
...thread,
|
|
16498
|
+
page: external_exports.strictObject({
|
|
16499
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16500
|
+
epoch: identity.optional(),
|
|
16501
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16502
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16503
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16504
|
+
message: "A history continuation requires its connection epoch"
|
|
16505
|
+
}).optional()
|
|
16506
|
+
}),
|
|
16487
16507
|
external_exports.strictObject({
|
|
16488
16508
|
kind: external_exports.literal("configure"),
|
|
16489
16509
|
...thread,
|
|
@@ -16777,6 +16797,7 @@ var requestTokenFields = [
|
|
|
16777
16797
|
"cacheWrite1hInputTokens",
|
|
16778
16798
|
"outputTokens",
|
|
16779
16799
|
"reasoningOutputTokens",
|
|
16800
|
+
"timedOutputTokens",
|
|
16780
16801
|
"startedAtMs",
|
|
16781
16802
|
"completedAtMs"
|
|
16782
16803
|
];
|
|
@@ -15024,7 +15024,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15024
15024
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15025
15025
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15026
15026
|
var usageOutputTimingSchema = external_exports.object({
|
|
15027
|
-
version: external_exports.literal(3).optional(),
|
|
15027
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15028
15028
|
requestId: external_exports.string().min(1),
|
|
15029
15029
|
turnId: external_exports.string().min(1).max(1024),
|
|
15030
15030
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15032,16 +15032,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15032
15032
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15033
15033
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15034
15034
|
var usageMeasurementSchema = external_exports.object({
|
|
15035
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15035
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15036
15036
|
value: finiteNonNegativeNumberSchema,
|
|
15037
15037
|
turnId: external_exports.string().min(1).max(1024),
|
|
15038
15038
|
at: nonNegativeSafeIntegerSchema
|
|
15039
15039
|
}).strict();
|
|
15040
15040
|
var usageMeasurementsSchema = external_exports.object({
|
|
15041
|
-
//
|
|
15042
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15041
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15042
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15043
15043
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15044
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15044
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15045
15045
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15046
15046
|
}).strict();
|
|
15047
15047
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15507,6 +15507,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15507
15507
|
cursor: clientChannelCursorSchema,
|
|
15508
15508
|
cwd: external_exports.string().optional()
|
|
15509
15509
|
}),
|
|
15510
|
+
external_exports.object({
|
|
15511
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15512
|
+
cursor: clientChannelCursorSchema,
|
|
15513
|
+
harnessId: external_exports.string().min(1)
|
|
15514
|
+
}),
|
|
15510
15515
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15511
15516
|
external_exports.object({
|
|
15512
15517
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15578,6 +15583,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15578
15583
|
var clientTurnSchema = external_exports.object({
|
|
15579
15584
|
id: external_exports.string().min(1),
|
|
15580
15585
|
status: external_exports.string().min(1),
|
|
15586
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15587
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15581
15588
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15582
15589
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15583
15590
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16794,6 +16801,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16794
16801
|
"completed",
|
|
16795
16802
|
"failed",
|
|
16796
16803
|
"interrupted",
|
|
16804
|
+
"needsInput",
|
|
16797
16805
|
"timedOut",
|
|
16798
16806
|
"unreadable",
|
|
16799
16807
|
"notFound"
|
|
@@ -16840,13 +16848,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16840
16848
|
var thread = { ...target, threadId: identity };
|
|
16841
16849
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16842
16850
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16851
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16843
16852
|
external_exports.strictObject({
|
|
16844
16853
|
kind: external_exports.literal("list"),
|
|
16845
16854
|
...target,
|
|
16846
16855
|
cursor: external_exports.string().nullable(),
|
|
16847
16856
|
archived: external_exports.boolean()
|
|
16848
16857
|
}),
|
|
16849
|
-
external_exports.strictObject({
|
|
16858
|
+
external_exports.strictObject({
|
|
16859
|
+
kind: external_exports.literal("read"),
|
|
16860
|
+
...thread,
|
|
16861
|
+
page: external_exports.strictObject({
|
|
16862
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16863
|
+
epoch: identity.optional(),
|
|
16864
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16865
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16866
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16867
|
+
message: "A history continuation requires its connection epoch"
|
|
16868
|
+
}).optional()
|
|
16869
|
+
}),
|
|
16850
16870
|
external_exports.strictObject({
|
|
16851
16871
|
kind: external_exports.literal("configure"),
|
|
16852
16872
|
...thread,
|
|
@@ -17225,6 +17245,7 @@ var requestTokenFields = [
|
|
|
17225
17245
|
"cacheWrite1hInputTokens",
|
|
17226
17246
|
"outputTokens",
|
|
17227
17247
|
"reasoningOutputTokens",
|
|
17248
|
+
"timedOutputTokens",
|
|
17228
17249
|
"startedAtMs",
|
|
17229
17250
|
"completedAtMs"
|
|
17230
17251
|
];
|
|
@@ -25976,6 +25997,9 @@ var GrokTurnUsage = class {
|
|
|
25976
25997
|
#compacting = false;
|
|
25977
25998
|
#startedAtMs;
|
|
25978
25999
|
#streamKey;
|
|
26000
|
+
#reasoningObserved = false;
|
|
26001
|
+
#textStartedOutput = false;
|
|
26002
|
+
#bufferedToolInput = false;
|
|
25979
26003
|
#outputTokens = 0;
|
|
25980
26004
|
#durationMs = 0;
|
|
25981
26005
|
#latestCacheHit;
|
|
@@ -25989,8 +26013,7 @@ var GrokTurnUsage = class {
|
|
|
25989
26013
|
}
|
|
25990
26014
|
observe(event) {
|
|
25991
26015
|
if (event.type === "compaction.started" || event.type === "compaction.completed") {
|
|
25992
|
-
this.#
|
|
25993
|
-
this.#streamKey = void 0;
|
|
26016
|
+
this.#resetResponse();
|
|
25994
26017
|
this.#compacting = event.type === "compaction.started";
|
|
25995
26018
|
}
|
|
25996
26019
|
if (this.#compacting)
|
|
@@ -25998,14 +26021,29 @@ var GrokTurnUsage = class {
|
|
|
25998
26021
|
if (event.type === "subagent.spawned")
|
|
25999
26022
|
this.#cacheComplete = false;
|
|
26000
26023
|
if (event.type === "agent.text" || event.type === "agent.thought" || event.type === "tool.input.delta") {
|
|
26001
|
-
if (!event.text)
|
|
26024
|
+
if (!event.text || event.type === "tool.input.delta" && !event.text.trim())
|
|
26002
26025
|
return null;
|
|
26003
26026
|
const key = event.metadata?.streamStartMs;
|
|
26004
26027
|
if (key !== void 0 && this.#streamKey !== void 0 && key !== this.#streamKey)
|
|
26005
|
-
this.#
|
|
26028
|
+
this.#resetResponse();
|
|
26006
26029
|
if (key !== void 0)
|
|
26007
26030
|
this.#streamKey = key;
|
|
26008
|
-
this.#
|
|
26031
|
+
if (this.#bufferedToolInput)
|
|
26032
|
+
return null;
|
|
26033
|
+
if (event.type === "tool.input.delta" && this.#startedAtMs === void 0) {
|
|
26034
|
+
try {
|
|
26035
|
+
JSON.parse(event.text);
|
|
26036
|
+
this.#bufferedToolInput = true;
|
|
26037
|
+
return null;
|
|
26038
|
+
} catch {
|
|
26039
|
+
}
|
|
26040
|
+
}
|
|
26041
|
+
if (event.type === "agent.thought")
|
|
26042
|
+
this.#reasoningObserved = true;
|
|
26043
|
+
if (this.#startedAtMs === void 0) {
|
|
26044
|
+
this.#startedAtMs = Date.now();
|
|
26045
|
+
this.#textStartedOutput = event.type === "agent.text";
|
|
26046
|
+
}
|
|
26009
26047
|
}
|
|
26010
26048
|
if (event.type !== "response.completed")
|
|
26011
26049
|
return null;
|
|
@@ -26015,9 +26053,12 @@ var GrokTurnUsage = class {
|
|
|
26015
26053
|
this.#seen.add(event.messageId);
|
|
26016
26054
|
}
|
|
26017
26055
|
const duration3 = this.#startedAtMs === void 0 ? 0 : Date.now() - this.#startedAtMs;
|
|
26018
|
-
this.#startedAtMs = void 0;
|
|
26019
|
-
this.#streamKey = void 0;
|
|
26020
26056
|
const usage = usageFromResponse(event.usage);
|
|
26057
|
+
const outputTokens = usage?.outputTokens;
|
|
26058
|
+
const reasoningOutputTokens = usage?.reasoningOutputTokens;
|
|
26059
|
+
const completeOutputBoundary = this.#reasoningObserved || reasoningOutputTokens === 0;
|
|
26060
|
+
const timedOutputTokens = completeOutputBoundary ? outputTokens : this.#textStartedOutput && outputTokens !== void 0 && reasoningOutputTokens !== void 0 && reasoningOutputTokens > 0 && reasoningOutputTokens < outputTokens ? outputTokens - reasoningOutputTokens : void 0;
|
|
26061
|
+
this.#resetResponse();
|
|
26021
26062
|
this.#latestCacheHit = usage?.cacheHitRatePercent;
|
|
26022
26063
|
if (usage?.inputTokens === void 0 || usage.cachedInputTokens === void 0)
|
|
26023
26064
|
this.#cacheComplete = false;
|
|
@@ -26027,13 +26068,20 @@ var GrokTurnUsage = class {
|
|
|
26027
26068
|
if (value !== void 0)
|
|
26028
26069
|
this.#totals[field2] = (this.#totals[field2] ?? 0) + value;
|
|
26029
26070
|
}
|
|
26030
|
-
if (duration3 > 0 &&
|
|
26031
|
-
this.#outputTokens +=
|
|
26071
|
+
if (duration3 > 0 && timedOutputTokens !== void 0) {
|
|
26072
|
+
this.#outputTokens += timedOutputTokens;
|
|
26032
26073
|
this.#durationMs += duration3;
|
|
26033
26074
|
}
|
|
26034
26075
|
}
|
|
26035
26076
|
return this.snapshot();
|
|
26036
26077
|
}
|
|
26078
|
+
#resetResponse() {
|
|
26079
|
+
this.#startedAtMs = void 0;
|
|
26080
|
+
this.#streamKey = void 0;
|
|
26081
|
+
this.#reasoningObserved = false;
|
|
26082
|
+
this.#textStartedOutput = false;
|
|
26083
|
+
this.#bufferedToolInput = false;
|
|
26084
|
+
}
|
|
26037
26085
|
metrics() {
|
|
26038
26086
|
return {
|
|
26039
26087
|
...this.#durationMs > 0 ? { outputTokensPerSecond: this.#outputTokens * 1e3 / this.#durationMs } : {},
|