@karlorz/codexhost-cli-linux-x64 0.20.0-1 → 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 +26 -6
- 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
|
@@ -19084,7 +19084,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
19084
19084
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
19085
19085
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
19086
19086
|
var usageOutputTimingSchema = external_exports.object({
|
|
19087
|
-
version: external_exports.literal(3).optional(),
|
|
19087
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
19088
19088
|
requestId: external_exports.string().min(1),
|
|
19089
19089
|
turnId: external_exports.string().min(1).max(1024),
|
|
19090
19090
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -19092,16 +19092,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
19092
19092
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
19093
19093
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
19094
19094
|
var usageMeasurementSchema = external_exports.object({
|
|
19095
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
19095
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
19096
19096
|
value: finiteNonNegativeNumberSchema,
|
|
19097
19097
|
turnId: external_exports.string().min(1).max(1024),
|
|
19098
19098
|
at: nonNegativeSafeIntegerSchema
|
|
19099
19099
|
}).strict();
|
|
19100
19100
|
var usageMeasurementsSchema = external_exports.object({
|
|
19101
|
-
//
|
|
19102
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
19101
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
19102
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
19103
19103
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
19104
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
19104
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
19105
19105
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
19106
19106
|
}).strict();
|
|
19107
19107
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -19615,6 +19615,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
19615
19615
|
cursor: clientChannelCursorSchema,
|
|
19616
19616
|
cwd: external_exports.string().optional()
|
|
19617
19617
|
}),
|
|
19618
|
+
external_exports.object({
|
|
19619
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
19620
|
+
cursor: clientChannelCursorSchema,
|
|
19621
|
+
harnessId: external_exports.string().min(1)
|
|
19622
|
+
}),
|
|
19618
19623
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
19619
19624
|
external_exports.object({
|
|
19620
19625
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -19686,6 +19691,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
19686
19691
|
var clientTurnSchema = external_exports.object({
|
|
19687
19692
|
id: external_exports.string().min(1),
|
|
19688
19693
|
status: external_exports.string().min(1),
|
|
19694
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
19695
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
19689
19696
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
19690
19697
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
19691
19698
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -20951,6 +20958,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
20951
20958
|
"completed",
|
|
20952
20959
|
"failed",
|
|
20953
20960
|
"interrupted",
|
|
20961
|
+
"needsInput",
|
|
20954
20962
|
"timedOut",
|
|
20955
20963
|
"unreadable",
|
|
20956
20964
|
"notFound"
|
|
@@ -20997,13 +21005,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
20997
21005
|
var thread = { ...target, threadId: identity };
|
|
20998
21006
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
20999
21007
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
21008
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
21000
21009
|
external_exports.strictObject({
|
|
21001
21010
|
kind: external_exports.literal("list"),
|
|
21002
21011
|
...target,
|
|
21003
21012
|
cursor: external_exports.string().nullable(),
|
|
21004
21013
|
archived: external_exports.boolean()
|
|
21005
21014
|
}),
|
|
21006
|
-
external_exports.strictObject({
|
|
21015
|
+
external_exports.strictObject({
|
|
21016
|
+
kind: external_exports.literal("read"),
|
|
21017
|
+
...thread,
|
|
21018
|
+
page: external_exports.strictObject({
|
|
21019
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
21020
|
+
epoch: identity.optional(),
|
|
21021
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
21022
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
21023
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
21024
|
+
message: "A history continuation requires its connection epoch"
|
|
21025
|
+
}).optional()
|
|
21026
|
+
}),
|
|
21007
21027
|
external_exports.strictObject({
|
|
21008
21028
|
kind: external_exports.literal("configure"),
|
|
21009
21029
|
...thread,
|
|
@@ -33405,6 +33425,7 @@ var requestTokenFields = [
|
|
|
33405
33425
|
"cacheWrite1hInputTokens",
|
|
33406
33426
|
"outputTokens",
|
|
33407
33427
|
"reasoningOutputTokens",
|
|
33428
|
+
"timedOutputTokens",
|
|
33408
33429
|
"startedAtMs",
|
|
33409
33430
|
"completedAtMs"
|
|
33410
33431
|
];
|
|
@@ -15394,7 +15394,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15394
15394
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15395
15395
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15396
15396
|
var usageOutputTimingSchema = external_exports.object({
|
|
15397
|
-
version: external_exports.literal(3).optional(),
|
|
15397
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15398
15398
|
requestId: external_exports.string().min(1),
|
|
15399
15399
|
turnId: external_exports.string().min(1).max(1024),
|
|
15400
15400
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15402,16 +15402,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15402
15402
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15403
15403
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15404
15404
|
var usageMeasurementSchema = external_exports.object({
|
|
15405
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15405
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15406
15406
|
value: finiteNonNegativeNumberSchema,
|
|
15407
15407
|
turnId: external_exports.string().min(1).max(1024),
|
|
15408
15408
|
at: nonNegativeSafeIntegerSchema
|
|
15409
15409
|
}).strict();
|
|
15410
15410
|
var usageMeasurementsSchema = external_exports.object({
|
|
15411
|
-
//
|
|
15412
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15411
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15412
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15413
15413
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15414
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15414
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15415
15415
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15416
15416
|
}).strict();
|
|
15417
15417
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15925,6 +15925,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15925
15925
|
cursor: clientChannelCursorSchema,
|
|
15926
15926
|
cwd: external_exports.string().optional()
|
|
15927
15927
|
}),
|
|
15928
|
+
external_exports.object({
|
|
15929
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15930
|
+
cursor: clientChannelCursorSchema,
|
|
15931
|
+
harnessId: external_exports.string().min(1)
|
|
15932
|
+
}),
|
|
15928
15933
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15929
15934
|
external_exports.object({
|
|
15930
15935
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15996,6 +16001,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15996
16001
|
var clientTurnSchema = external_exports.object({
|
|
15997
16002
|
id: external_exports.string().min(1),
|
|
15998
16003
|
status: external_exports.string().min(1),
|
|
16004
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
16005
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15999
16006
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
16000
16007
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
16001
16008
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -17261,6 +17268,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
17261
17268
|
"completed",
|
|
17262
17269
|
"failed",
|
|
17263
17270
|
"interrupted",
|
|
17271
|
+
"needsInput",
|
|
17264
17272
|
"timedOut",
|
|
17265
17273
|
"unreadable",
|
|
17266
17274
|
"notFound"
|
|
@@ -17307,13 +17315,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
17307
17315
|
var thread = { ...target, threadId: identity };
|
|
17308
17316
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17309
17317
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17318
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17310
17319
|
external_exports.strictObject({
|
|
17311
17320
|
kind: external_exports.literal("list"),
|
|
17312
17321
|
...target,
|
|
17313
17322
|
cursor: external_exports.string().nullable(),
|
|
17314
17323
|
archived: external_exports.boolean()
|
|
17315
17324
|
}),
|
|
17316
|
-
external_exports.strictObject({
|
|
17325
|
+
external_exports.strictObject({
|
|
17326
|
+
kind: external_exports.literal("read"),
|
|
17327
|
+
...thread,
|
|
17328
|
+
page: external_exports.strictObject({
|
|
17329
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
17330
|
+
epoch: identity.optional(),
|
|
17331
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
17332
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
17333
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
17334
|
+
message: "A history continuation requires its connection epoch"
|
|
17335
|
+
}).optional()
|
|
17336
|
+
}),
|
|
17317
17337
|
external_exports.strictObject({
|
|
17318
17338
|
kind: external_exports.literal("configure"),
|
|
17319
17339
|
...thread,
|
|
@@ -17743,6 +17763,7 @@ var requestTokenFields = [
|
|
|
17743
17763
|
"cacheWrite1hInputTokens",
|
|
17744
17764
|
"outputTokens",
|
|
17745
17765
|
"reasoningOutputTokens",
|
|
17766
|
+
"timedOutputTokens",
|
|
17746
17767
|
"startedAtMs",
|
|
17747
17768
|
"completedAtMs"
|
|
17748
17769
|
];
|
|
@@ -19274,7 +19274,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
19274
19274
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
19275
19275
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
19276
19276
|
var usageOutputTimingSchema = external_exports.object({
|
|
19277
|
-
version: external_exports.literal(3).optional(),
|
|
19277
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
19278
19278
|
requestId: external_exports.string().min(1),
|
|
19279
19279
|
turnId: external_exports.string().min(1).max(1024),
|
|
19280
19280
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -19282,16 +19282,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
19282
19282
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
19283
19283
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
19284
19284
|
var usageMeasurementSchema = external_exports.object({
|
|
19285
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
19285
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
19286
19286
|
value: finiteNonNegativeNumberSchema,
|
|
19287
19287
|
turnId: external_exports.string().min(1).max(1024),
|
|
19288
19288
|
at: nonNegativeSafeIntegerSchema
|
|
19289
19289
|
}).strict();
|
|
19290
19290
|
var usageMeasurementsSchema = external_exports.object({
|
|
19291
|
-
//
|
|
19292
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
19291
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
19292
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
19293
19293
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
19294
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
19294
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
19295
19295
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
19296
19296
|
}).strict();
|
|
19297
19297
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -19805,6 +19805,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
19805
19805
|
cursor: clientChannelCursorSchema,
|
|
19806
19806
|
cwd: external_exports.string().optional()
|
|
19807
19807
|
}),
|
|
19808
|
+
external_exports.object({
|
|
19809
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
19810
|
+
cursor: clientChannelCursorSchema,
|
|
19811
|
+
harnessId: external_exports.string().min(1)
|
|
19812
|
+
}),
|
|
19808
19813
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
19809
19814
|
external_exports.object({
|
|
19810
19815
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -19876,6 +19881,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
19876
19881
|
var clientTurnSchema = external_exports.object({
|
|
19877
19882
|
id: external_exports.string().min(1),
|
|
19878
19883
|
status: external_exports.string().min(1),
|
|
19884
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
19885
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
19879
19886
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
19880
19887
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
19881
19888
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -21145,6 +21152,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
21145
21152
|
"completed",
|
|
21146
21153
|
"failed",
|
|
21147
21154
|
"interrupted",
|
|
21155
|
+
"needsInput",
|
|
21148
21156
|
"timedOut",
|
|
21149
21157
|
"unreadable",
|
|
21150
21158
|
"notFound"
|
|
@@ -21191,13 +21199,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
21191
21199
|
var thread = { ...target, threadId: identity };
|
|
21192
21200
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
21193
21201
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
21202
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
21194
21203
|
external_exports.strictObject({
|
|
21195
21204
|
kind: external_exports.literal("list"),
|
|
21196
21205
|
...target,
|
|
21197
21206
|
cursor: external_exports.string().nullable(),
|
|
21198
21207
|
archived: external_exports.boolean()
|
|
21199
21208
|
}),
|
|
21200
|
-
external_exports.strictObject({
|
|
21209
|
+
external_exports.strictObject({
|
|
21210
|
+
kind: external_exports.literal("read"),
|
|
21211
|
+
...thread,
|
|
21212
|
+
page: external_exports.strictObject({
|
|
21213
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
21214
|
+
epoch: identity.optional(),
|
|
21215
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
21216
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
21217
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
21218
|
+
message: "A history continuation requires its connection epoch"
|
|
21219
|
+
}).optional()
|
|
21220
|
+
}),
|
|
21201
21221
|
external_exports.strictObject({
|
|
21202
21222
|
kind: external_exports.literal("configure"),
|
|
21203
21223
|
...thread,
|
|
@@ -21632,6 +21652,7 @@ var requestTokenFields = [
|
|
|
21632
21652
|
"cacheWrite1hInputTokens",
|
|
21633
21653
|
"outputTokens",
|
|
21634
21654
|
"reasoningOutputTokens",
|
|
21655
|
+
"timedOutputTokens",
|
|
21635
21656
|
"startedAtMs",
|
|
21636
21657
|
"completedAtMs"
|
|
21637
21658
|
];
|
|
@@ -21684,6 +21705,14 @@ function parseHostUsageRequest(value) {
|
|
|
21684
21705
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
21685
21706
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
21686
21707
|
}
|
|
21708
|
+
if (request.timedOutputTokens !== void 0) {
|
|
21709
|
+
if (request.startedAtMs === void 0) {
|
|
21710
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
21711
|
+
}
|
|
21712
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
21713
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
21714
|
+
}
|
|
21715
|
+
}
|
|
21687
21716
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
21688
21717
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
21689
21718
|
}
|
|
@@ -23291,11 +23320,23 @@ function isRecord5(value) {
|
|
|
23291
23320
|
function count3(value) {
|
|
23292
23321
|
return typeof value === "number" && Number.isSafeInteger(value) && value >= 0 ? value : null;
|
|
23293
23322
|
}
|
|
23294
|
-
function firstTokenTime(chunks) {
|
|
23323
|
+
function firstTokenTime(chunks, reasoning2) {
|
|
23324
|
+
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))
|
|
23325
|
+
return null;
|
|
23295
23326
|
for (const { time: time3, chunk } of chunks) {
|
|
23296
|
-
if (
|
|
23327
|
+
if (chunk.type === "block-start" && chunk.blockType === "reasoning" || (chunk.type === "reasoning-delta" || chunk.type === "text-delta") && typeof chunk.text === "string" && chunk.text.length > 0) {
|
|
23297
23328
|
return time3;
|
|
23298
23329
|
}
|
|
23330
|
+
if (chunk.type === "tool-call-delta" && typeof chunk.argumentsDelta === "string" && chunk.argumentsDelta.trim().length > 0) {
|
|
23331
|
+
try {
|
|
23332
|
+
JSON.parse(chunk.argumentsDelta);
|
|
23333
|
+
} catch {
|
|
23334
|
+
if (typeof chunk.name === "string" && chunk.name.length > 0)
|
|
23335
|
+
return time3;
|
|
23336
|
+
continue;
|
|
23337
|
+
}
|
|
23338
|
+
return null;
|
|
23339
|
+
}
|
|
23299
23340
|
}
|
|
23300
23341
|
return null;
|
|
23301
23342
|
}
|
|
@@ -23333,8 +23374,8 @@ function deepSeekUsageRecord(event, historical) {
|
|
|
23333
23374
|
if (input === null || output === null || cacheRead === null || cacheWrite === null) {
|
|
23334
23375
|
return { kind: "missing" };
|
|
23335
23376
|
}
|
|
23336
|
-
const startedAtMs = historical ? null : firstTokenTime(chunks);
|
|
23337
|
-
const completedAtMs =
|
|
23377
|
+
const startedAtMs = historical ? null : count3(firstTokenTime(chunks, reasoning2));
|
|
23378
|
+
const completedAtMs = count3(event.time);
|
|
23338
23379
|
try {
|
|
23339
23380
|
return {
|
|
23340
23381
|
kind: "request",
|
|
@@ -23347,7 +23388,7 @@ function deepSeekUsageRecord(event, historical) {
|
|
|
23347
23388
|
cacheWriteInputTokens: cacheWrite,
|
|
23348
23389
|
outputTokens: output,
|
|
23349
23390
|
...reasoning2 !== null && reasoning2 <= output ? { reasoningOutputTokens: reasoning2 } : {},
|
|
23350
|
-
...startedAtMs !== null && completedAtMs !== null && completedAtMs
|
|
23391
|
+
...startedAtMs !== null && completedAtMs !== null && completedAtMs > startedAtMs ? { startedAtMs, completedAtMs } : {}
|
|
23351
23392
|
})
|
|
23352
23393
|
};
|
|
23353
23394
|
} catch {
|
|
@@ -15031,7 +15031,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15031
15031
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15032
15032
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15033
15033
|
var usageOutputTimingSchema = external_exports.object({
|
|
15034
|
-
version: external_exports.literal(3).optional(),
|
|
15034
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15035
15035
|
requestId: external_exports.string().min(1),
|
|
15036
15036
|
turnId: external_exports.string().min(1).max(1024),
|
|
15037
15037
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15039,16 +15039,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15039
15039
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15040
15040
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15041
15041
|
var usageMeasurementSchema = external_exports.object({
|
|
15042
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15042
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15043
15043
|
value: finiteNonNegativeNumberSchema,
|
|
15044
15044
|
turnId: external_exports.string().min(1).max(1024),
|
|
15045
15045
|
at: nonNegativeSafeIntegerSchema
|
|
15046
15046
|
}).strict();
|
|
15047
15047
|
var usageMeasurementsSchema = external_exports.object({
|
|
15048
|
-
//
|
|
15049
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15048
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15049
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15050
15050
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15051
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15051
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15052
15052
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15053
15053
|
}).strict();
|
|
15054
15054
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15562,6 +15562,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15562
15562
|
cursor: clientChannelCursorSchema,
|
|
15563
15563
|
cwd: external_exports.string().optional()
|
|
15564
15564
|
}),
|
|
15565
|
+
external_exports.object({
|
|
15566
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15567
|
+
cursor: clientChannelCursorSchema,
|
|
15568
|
+
harnessId: external_exports.string().min(1)
|
|
15569
|
+
}),
|
|
15565
15570
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15566
15571
|
external_exports.object({
|
|
15567
15572
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15633,6 +15638,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15633
15638
|
var clientTurnSchema = external_exports.object({
|
|
15634
15639
|
id: external_exports.string().min(1),
|
|
15635
15640
|
status: external_exports.string().min(1),
|
|
15641
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15642
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15636
15643
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15637
15644
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15638
15645
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -16898,6 +16905,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16898
16905
|
"completed",
|
|
16899
16906
|
"failed",
|
|
16900
16907
|
"interrupted",
|
|
16908
|
+
"needsInput",
|
|
16901
16909
|
"timedOut",
|
|
16902
16910
|
"unreadable",
|
|
16903
16911
|
"notFound"
|
|
@@ -16944,13 +16952,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16944
16952
|
var thread = { ...target, threadId: identity };
|
|
16945
16953
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16946
16954
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16955
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16947
16956
|
external_exports.strictObject({
|
|
16948
16957
|
kind: external_exports.literal("list"),
|
|
16949
16958
|
...target,
|
|
16950
16959
|
cursor: external_exports.string().nullable(),
|
|
16951
16960
|
archived: external_exports.boolean()
|
|
16952
16961
|
}),
|
|
16953
|
-
external_exports.strictObject({
|
|
16962
|
+
external_exports.strictObject({
|
|
16963
|
+
kind: external_exports.literal("read"),
|
|
16964
|
+
...thread,
|
|
16965
|
+
page: external_exports.strictObject({
|
|
16966
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16967
|
+
epoch: identity.optional(),
|
|
16968
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16969
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16970
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16971
|
+
message: "A history continuation requires its connection epoch"
|
|
16972
|
+
}).optional()
|
|
16973
|
+
}),
|
|
16954
16974
|
external_exports.strictObject({
|
|
16955
16975
|
kind: external_exports.literal("configure"),
|
|
16956
16976
|
...thread,
|
|
@@ -17278,6 +17298,7 @@ var requestTokenFields = [
|
|
|
17278
17298
|
"cacheWrite1hInputTokens",
|
|
17279
17299
|
"outputTokens",
|
|
17280
17300
|
"reasoningOutputTokens",
|
|
17301
|
+
"timedOutputTokens",
|
|
17281
17302
|
"startedAtMs",
|
|
17282
17303
|
"completedAtMs"
|
|
17283
17304
|
];
|
|
@@ -15414,7 +15414,7 @@ var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonneg
|
|
|
15414
15414
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15415
15415
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15416
15416
|
var usageOutputTimingSchema = external_exports.object({
|
|
15417
|
-
version: external_exports.literal(3).optional(),
|
|
15417
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15418
15418
|
requestId: external_exports.string().min(1),
|
|
15419
15419
|
turnId: external_exports.string().min(1).max(1024),
|
|
15420
15420
|
outputTokens: nonNegativeSafeIntegerSchema,
|
|
@@ -15422,16 +15422,16 @@ var usageOutputTimingSchema = external_exports.object({
|
|
|
15422
15422
|
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15423
15423
|
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15424
15424
|
var usageMeasurementSchema = external_exports.object({
|
|
15425
|
-
version: external_exports.union([external_exports.literal(2), external_exports.literal(3)]).optional(),
|
|
15425
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15426
15426
|
value: finiteNonNegativeNumberSchema,
|
|
15427
15427
|
turnId: external_exports.string().min(1).max(1024),
|
|
15428
15428
|
at: nonNegativeSafeIntegerSchema
|
|
15429
15429
|
}).strict();
|
|
15430
15430
|
var usageMeasurementsSchema = external_exports.object({
|
|
15431
|
-
//
|
|
15432
|
-
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version ===
|
|
15431
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15432
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15433
15433
|
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15434
|
-
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version ===
|
|
15434
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15435
15435
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15436
15436
|
}).strict();
|
|
15437
15437
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15945,6 +15945,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15945
15945
|
cursor: clientChannelCursorSchema,
|
|
15946
15946
|
cwd: external_exports.string().optional()
|
|
15947
15947
|
}),
|
|
15948
|
+
external_exports.object({
|
|
15949
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15950
|
+
cursor: clientChannelCursorSchema,
|
|
15951
|
+
harnessId: external_exports.string().min(1)
|
|
15952
|
+
}),
|
|
15948
15953
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15949
15954
|
external_exports.object({
|
|
15950
15955
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -16016,6 +16021,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
16016
16021
|
var clientTurnSchema = external_exports.object({
|
|
16017
16022
|
id: external_exports.string().min(1),
|
|
16018
16023
|
status: external_exports.string().min(1),
|
|
16024
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
16025
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
16019
16026
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
16020
16027
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
16021
16028
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -17281,6 +17288,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
17281
17288
|
"completed",
|
|
17282
17289
|
"failed",
|
|
17283
17290
|
"interrupted",
|
|
17291
|
+
"needsInput",
|
|
17284
17292
|
"timedOut",
|
|
17285
17293
|
"unreadable",
|
|
17286
17294
|
"notFound"
|
|
@@ -17327,13 +17335,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
17327
17335
|
var thread = { ...target, threadId: identity };
|
|
17328
17336
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17329
17337
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17338
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17330
17339
|
external_exports.strictObject({
|
|
17331
17340
|
kind: external_exports.literal("list"),
|
|
17332
17341
|
...target,
|
|
17333
17342
|
cursor: external_exports.string().nullable(),
|
|
17334
17343
|
archived: external_exports.boolean()
|
|
17335
17344
|
}),
|
|
17336
|
-
external_exports.strictObject({
|
|
17345
|
+
external_exports.strictObject({
|
|
17346
|
+
kind: external_exports.literal("read"),
|
|
17347
|
+
...thread,
|
|
17348
|
+
page: external_exports.strictObject({
|
|
17349
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
17350
|
+
epoch: identity.optional(),
|
|
17351
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
17352
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
17353
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
17354
|
+
message: "A history continuation requires its connection epoch"
|
|
17355
|
+
}).optional()
|
|
17356
|
+
}),
|
|
17337
17357
|
external_exports.strictObject({
|
|
17338
17358
|
kind: external_exports.literal("configure"),
|
|
17339
17359
|
...thread,
|
|
@@ -18044,6 +18064,7 @@ var requestTokenFields = [
|
|
|
18044
18064
|
"cacheWrite1hInputTokens",
|
|
18045
18065
|
"outputTokens",
|
|
18046
18066
|
"reasoningOutputTokens",
|
|
18067
|
+
"timedOutputTokens",
|
|
18047
18068
|
"startedAtMs",
|
|
18048
18069
|
"completedAtMs"
|
|
18049
18070
|
];
|
|
@@ -29242,6 +29263,9 @@ var GrokTurnUsage = class {
|
|
|
29242
29263
|
#compacting = false;
|
|
29243
29264
|
#startedAtMs;
|
|
29244
29265
|
#streamKey;
|
|
29266
|
+
#reasoningObserved = false;
|
|
29267
|
+
#textStartedOutput = false;
|
|
29268
|
+
#bufferedToolInput = false;
|
|
29245
29269
|
#outputTokens = 0;
|
|
29246
29270
|
#durationMs = 0;
|
|
29247
29271
|
#latestCacheHit;
|
|
@@ -29255,8 +29279,7 @@ var GrokTurnUsage = class {
|
|
|
29255
29279
|
}
|
|
29256
29280
|
observe(event) {
|
|
29257
29281
|
if (event.type === "compaction.started" || event.type === "compaction.completed") {
|
|
29258
|
-
this.#
|
|
29259
|
-
this.#streamKey = void 0;
|
|
29282
|
+
this.#resetResponse();
|
|
29260
29283
|
this.#compacting = event.type === "compaction.started";
|
|
29261
29284
|
}
|
|
29262
29285
|
if (this.#compacting)
|
|
@@ -29264,14 +29287,29 @@ var GrokTurnUsage = class {
|
|
|
29264
29287
|
if (event.type === "subagent.spawned")
|
|
29265
29288
|
this.#cacheComplete = false;
|
|
29266
29289
|
if (event.type === "agent.text" || event.type === "agent.thought" || event.type === "tool.input.delta") {
|
|
29267
|
-
if (!event.text)
|
|
29290
|
+
if (!event.text || event.type === "tool.input.delta" && !event.text.trim())
|
|
29268
29291
|
return null;
|
|
29269
29292
|
const key = event.metadata?.streamStartMs;
|
|
29270
29293
|
if (key !== void 0 && this.#streamKey !== void 0 && key !== this.#streamKey)
|
|
29271
|
-
this.#
|
|
29294
|
+
this.#resetResponse();
|
|
29272
29295
|
if (key !== void 0)
|
|
29273
29296
|
this.#streamKey = key;
|
|
29274
|
-
this.#
|
|
29297
|
+
if (this.#bufferedToolInput)
|
|
29298
|
+
return null;
|
|
29299
|
+
if (event.type === "tool.input.delta" && this.#startedAtMs === void 0) {
|
|
29300
|
+
try {
|
|
29301
|
+
JSON.parse(event.text);
|
|
29302
|
+
this.#bufferedToolInput = true;
|
|
29303
|
+
return null;
|
|
29304
|
+
} catch {
|
|
29305
|
+
}
|
|
29306
|
+
}
|
|
29307
|
+
if (event.type === "agent.thought")
|
|
29308
|
+
this.#reasoningObserved = true;
|
|
29309
|
+
if (this.#startedAtMs === void 0) {
|
|
29310
|
+
this.#startedAtMs = Date.now();
|
|
29311
|
+
this.#textStartedOutput = event.type === "agent.text";
|
|
29312
|
+
}
|
|
29275
29313
|
}
|
|
29276
29314
|
if (event.type !== "response.completed")
|
|
29277
29315
|
return null;
|
|
@@ -29281,9 +29319,12 @@ var GrokTurnUsage = class {
|
|
|
29281
29319
|
this.#seen.add(event.messageId);
|
|
29282
29320
|
}
|
|
29283
29321
|
const duration3 = this.#startedAtMs === void 0 ? 0 : Date.now() - this.#startedAtMs;
|
|
29284
|
-
this.#startedAtMs = void 0;
|
|
29285
|
-
this.#streamKey = void 0;
|
|
29286
29322
|
const usage = usageFromResponse(event.usage);
|
|
29323
|
+
const outputTokens = usage?.outputTokens;
|
|
29324
|
+
const reasoningOutputTokens = usage?.reasoningOutputTokens;
|
|
29325
|
+
const completeOutputBoundary = this.#reasoningObserved || reasoningOutputTokens === 0;
|
|
29326
|
+
const timedOutputTokens = completeOutputBoundary ? outputTokens : this.#textStartedOutput && outputTokens !== void 0 && reasoningOutputTokens !== void 0 && reasoningOutputTokens > 0 && reasoningOutputTokens < outputTokens ? outputTokens - reasoningOutputTokens : void 0;
|
|
29327
|
+
this.#resetResponse();
|
|
29287
29328
|
this.#latestCacheHit = usage?.cacheHitRatePercent;
|
|
29288
29329
|
if (usage?.inputTokens === void 0 || usage.cachedInputTokens === void 0)
|
|
29289
29330
|
this.#cacheComplete = false;
|
|
@@ -29293,13 +29334,20 @@ var GrokTurnUsage = class {
|
|
|
29293
29334
|
if (value !== void 0)
|
|
29294
29335
|
this.#totals[field2] = (this.#totals[field2] ?? 0) + value;
|
|
29295
29336
|
}
|
|
29296
|
-
if (duration3 > 0 &&
|
|
29297
|
-
this.#outputTokens +=
|
|
29337
|
+
if (duration3 > 0 && timedOutputTokens !== void 0) {
|
|
29338
|
+
this.#outputTokens += timedOutputTokens;
|
|
29298
29339
|
this.#durationMs += duration3;
|
|
29299
29340
|
}
|
|
29300
29341
|
}
|
|
29301
29342
|
return this.snapshot();
|
|
29302
29343
|
}
|
|
29344
|
+
#resetResponse() {
|
|
29345
|
+
this.#startedAtMs = void 0;
|
|
29346
|
+
this.#streamKey = void 0;
|
|
29347
|
+
this.#reasoningObserved = false;
|
|
29348
|
+
this.#textStartedOutput = false;
|
|
29349
|
+
this.#bufferedToolInput = false;
|
|
29350
|
+
}
|
|
29303
29351
|
metrics() {
|
|
29304
29352
|
return {
|
|
29305
29353
|
...this.#durationMs > 0 ? { outputTokensPerSecond: this.#outputTokens * 1e3 / this.#durationMs } : {},
|