@codexhost/cli-darwin-x64 0.19.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 +45 -4
- package/app/console-web.js +1124 -684
- package/app/desktop-controller.mjs +197 -50
- package/app/host-runtime.mjs +36192 -29254
- package/app/plugins/antigravity/assets/icon.svg +1 -1
- package/app/plugins/antigravity/plugin.mjs +8863 -4094
- package/app/plugins/claude-code/plugin.mjs +173 -26
- package/app/plugins/codebuddy/plugin.mjs +71 -6
- package/app/plugins/codex-usage/plugin.mjs +56 -4
- package/app/plugins/copilot/plugin.mjs +48 -4
- package/app/plugins/cursor-cli/plugin.mjs +48 -4
- package/app/plugins/deepseek-harness/plugin.mjs +73 -9
- package/app/plugins/devin/plugin.mjs +47 -4
- package/app/plugins/grok/plugin.mjs +84 -13
- package/app/plugins/hermes/plugin.mjs +47 -4
- package/app/plugins/kimi-code/plugin.mjs +73 -14
- package/app/plugins/kiro-cli/plugin.mjs +48 -4
- package/app/plugins/omp/plugin.mjs +74 -7
- package/app/plugins/opencode/plugin.mjs +74 -13
- package/app/plugins/pi/plugin.mjs +75 -7
- package/app/plugins/qoder/plugin.mjs +85 -5
- package/app/plugins/qoder-cn/plugin.mjs +85 -5
- package/app/plugins/qwen-code/plugin.mjs +48 -4
- package/app/plugins/workbuddy/plugin.mjs +75 -9
- package/app/plugins/zcode/plugin.mjs +56 -4
- package/app/renderer-extension.js +1431 -737
- package/app/web/assets/index-BdmZfTRW.js +201 -0
- package/app/web/assets/index-DJW4bmyx.css +1 -0
- package/app/web/assets/langs/{graphql-B8vkg11W.js → graphql-ChAeyPkT.js} +1 -1
- package/app/web/assets/langs/{http-DmoDEjMt.js → http-BvreBIbD.js} +1 -1
- package/app/web/assets/langs/{php-DJ5ovfAM.js → php-D8omCIuJ.js} +1 -1
- package/app/web/assets/langs/{rst-U5-R5x3p.js → rst-Do7RLLCS.js} +1 -1
- package/app/web/assets/langs/{ruby-VKVsnS0H.js → ruby-rH_O_vse.js} +1 -1
- package/app/web/assets/langs/{svelte-C20lOv9V.js → svelte-xZy73wAj.js} +1 -1
- package/app/web/assets/langs/{vue-z6Y-lzP-.js → vue-C4DW8agZ.js} +1 -1
- package/app/web/assets/{vendor-dSL872WO.js → vendor-C9g2bw8s.js} +3 -3
- package/app/web/codexhost-settings.js +1130 -686
- package/app/web/index.html +4 -3
- package/app/web/plugins/deepseek-ai__dsh-api-gateway/client.js +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 +8 -8
- package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-ui-chat/client.js +74 -69
- package/app/web/plugins/deepseek-ai__dsh-client-ui-codexhost/client.js +7 -7
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +27 -27
- 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-session/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 +18 -18
- package/app/web/plugins/deepseek-ai__dsh-client-ui-workspace/client.js +7 -7
- package/app/web-modules/server.mjs +1144 -731
- package/bin/codexhost +0 -0
- package/libexec/codexhost-shim +0 -0
- package/libexec/codexhost-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-BNQIOOHE.css +0 -1
- package/app/web/assets/index-Feo4BkqN.js +0 -199
|
@@ -14998,13 +14998,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
14998
14998
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
14999
14999
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15000
15000
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15001
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
15002
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15003
|
+
requestId: external_exports.string().min(1),
|
|
15004
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
15005
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
15006
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
15007
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15008
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15001
15009
|
var usageMeasurementSchema = external_exports.object({
|
|
15010
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15002
15011
|
value: finiteNonNegativeNumberSchema,
|
|
15003
15012
|
turnId: external_exports.string().min(1).max(1024),
|
|
15004
15013
|
at: nonNegativeSafeIntegerSchema
|
|
15005
15014
|
}).strict();
|
|
15006
15015
|
var usageMeasurementsSchema = external_exports.object({
|
|
15007
|
-
|
|
15016
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15017
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15018
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15019
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15008
15020
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15009
15021
|
}).strict();
|
|
15010
15022
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15024,6 +15036,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15024
15036
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15025
15037
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15026
15038
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15039
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15027
15040
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15028
15041
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15029
15042
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15435,6 +15448,10 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15435
15448
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15436
15449
|
}).strict();
|
|
15437
15450
|
|
|
15451
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15452
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15453
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15454
|
+
|
|
15438
15455
|
// ../../shared-contracts/dist/client-channel.js
|
|
15439
15456
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15440
15457
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -15465,6 +15482,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15465
15482
|
cursor: clientChannelCursorSchema,
|
|
15466
15483
|
cwd: external_exports.string().optional()
|
|
15467
15484
|
}),
|
|
15485
|
+
external_exports.object({
|
|
15486
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15487
|
+
cursor: clientChannelCursorSchema,
|
|
15488
|
+
harnessId: external_exports.string().min(1)
|
|
15489
|
+
}),
|
|
15468
15490
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15469
15491
|
external_exports.object({
|
|
15470
15492
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15536,6 +15558,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15536
15558
|
var clientTurnSchema = external_exports.object({
|
|
15537
15559
|
id: external_exports.string().min(1),
|
|
15538
15560
|
status: external_exports.string().min(1),
|
|
15561
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15562
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15539
15563
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15540
15564
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15541
15565
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -15574,7 +15598,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15574
15598
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15575
15599
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15576
15600
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15577
|
-
command: external_exports.object({
|
|
15601
|
+
command: external_exports.object({
|
|
15602
|
+
name: external_exports.string().min(1),
|
|
15603
|
+
turn: clientTurnSchema,
|
|
15604
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15605
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15606
|
+
}).optional(),
|
|
15578
15607
|
thread: external_exports.object({
|
|
15579
15608
|
id: external_exports.string().min(1),
|
|
15580
15609
|
cwd: external_exports.string(),
|
|
@@ -15782,7 +15811,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
15782
15811
|
quotaUntil: external_exports.string().optional()
|
|
15783
15812
|
}).strict().optional()
|
|
15784
15813
|
}).strict();
|
|
15785
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
15786
15814
|
|
|
15787
15815
|
// ../../shared-contracts/dist/delegation-read.js
|
|
15788
15816
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -16748,6 +16776,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16748
16776
|
"completed",
|
|
16749
16777
|
"failed",
|
|
16750
16778
|
"interrupted",
|
|
16779
|
+
"needsInput",
|
|
16751
16780
|
"timedOut",
|
|
16752
16781
|
"unreadable",
|
|
16753
16782
|
"notFound"
|
|
@@ -16794,13 +16823,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16794
16823
|
var thread = { ...target, threadId: identity };
|
|
16795
16824
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16796
16825
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16826
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16797
16827
|
external_exports.strictObject({
|
|
16798
16828
|
kind: external_exports.literal("list"),
|
|
16799
16829
|
...target,
|
|
16800
16830
|
cursor: external_exports.string().nullable(),
|
|
16801
16831
|
archived: external_exports.boolean()
|
|
16802
16832
|
}),
|
|
16803
|
-
external_exports.strictObject({
|
|
16833
|
+
external_exports.strictObject({
|
|
16834
|
+
kind: external_exports.literal("read"),
|
|
16835
|
+
...thread,
|
|
16836
|
+
page: external_exports.strictObject({
|
|
16837
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16838
|
+
epoch: identity.optional(),
|
|
16839
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16840
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16841
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16842
|
+
message: "A history continuation requires its connection epoch"
|
|
16843
|
+
}).optional()
|
|
16844
|
+
}),
|
|
16804
16845
|
external_exports.strictObject({
|
|
16805
16846
|
kind: external_exports.literal("configure"),
|
|
16806
16847
|
...thread,
|
|
@@ -17118,6 +17159,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
17118
17159
|
"totalCredits",
|
|
17119
17160
|
"contextUsagePercent",
|
|
17120
17161
|
"outputTokensPerSecond",
|
|
17162
|
+
"sessionOutputTokensPerSecond",
|
|
17121
17163
|
"apiOutputTokensPerSecond",
|
|
17122
17164
|
"costSource",
|
|
17123
17165
|
"unpricedModels"
|
|
@@ -17140,6 +17182,7 @@ function parseHostUsage(value) {
|
|
|
17140
17182
|
for (const field2 of [
|
|
17141
17183
|
"totalCredits",
|
|
17142
17184
|
"contextUsagePercent",
|
|
17185
|
+
"sessionOutputTokensPerSecond",
|
|
17143
17186
|
"apiOutputTokensPerSecond"
|
|
17144
17187
|
]) {
|
|
17145
17188
|
const candidate = value[field2];
|
|
@@ -17218,6 +17261,7 @@ var requestTokenFields = [
|
|
|
17218
17261
|
"cacheWrite1hInputTokens",
|
|
17219
17262
|
"outputTokens",
|
|
17220
17263
|
"reasoningOutputTokens",
|
|
17264
|
+
"timedOutputTokens",
|
|
17221
17265
|
"startedAtMs",
|
|
17222
17266
|
"completedAtMs"
|
|
17223
17267
|
];
|
|
@@ -15059,13 +15059,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15059
15059
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15060
15060
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15061
15061
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15062
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
15063
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15064
|
+
requestId: external_exports.string().min(1),
|
|
15065
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
15066
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
15067
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
15068
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15069
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15062
15070
|
var usageMeasurementSchema = external_exports.object({
|
|
15071
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15063
15072
|
value: finiteNonNegativeNumberSchema,
|
|
15064
15073
|
turnId: external_exports.string().min(1).max(1024),
|
|
15065
15074
|
at: nonNegativeSafeIntegerSchema
|
|
15066
15075
|
}).strict();
|
|
15067
15076
|
var usageMeasurementsSchema = external_exports.object({
|
|
15068
|
-
|
|
15077
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15078
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15079
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15080
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15069
15081
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15070
15082
|
}).strict();
|
|
15071
15083
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15085,6 +15097,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15085
15097
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15086
15098
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15087
15099
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15100
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15088
15101
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15089
15102
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15090
15103
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15496,6 +15509,10 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15496
15509
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15497
15510
|
}).strict();
|
|
15498
15511
|
|
|
15512
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15513
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15514
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15515
|
+
|
|
15499
15516
|
// ../../shared-contracts/dist/client-channel.js
|
|
15500
15517
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15501
15518
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -15526,6 +15543,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15526
15543
|
cursor: clientChannelCursorSchema,
|
|
15527
15544
|
cwd: external_exports.string().optional()
|
|
15528
15545
|
}),
|
|
15546
|
+
external_exports.object({
|
|
15547
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15548
|
+
cursor: clientChannelCursorSchema,
|
|
15549
|
+
harnessId: external_exports.string().min(1)
|
|
15550
|
+
}),
|
|
15529
15551
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15530
15552
|
external_exports.object({
|
|
15531
15553
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15597,6 +15619,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15597
15619
|
var clientTurnSchema = external_exports.object({
|
|
15598
15620
|
id: external_exports.string().min(1),
|
|
15599
15621
|
status: external_exports.string().min(1),
|
|
15622
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15623
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15600
15624
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15601
15625
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15602
15626
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -15635,7 +15659,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15635
15659
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15636
15660
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15637
15661
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15638
|
-
command: external_exports.object({
|
|
15662
|
+
command: external_exports.object({
|
|
15663
|
+
name: external_exports.string().min(1),
|
|
15664
|
+
turn: clientTurnSchema,
|
|
15665
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15666
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15667
|
+
}).optional(),
|
|
15639
15668
|
thread: external_exports.object({
|
|
15640
15669
|
id: external_exports.string().min(1),
|
|
15641
15670
|
cwd: external_exports.string(),
|
|
@@ -15843,7 +15872,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
15843
15872
|
quotaUntil: external_exports.string().optional()
|
|
15844
15873
|
}).strict().optional()
|
|
15845
15874
|
}).strict();
|
|
15846
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
15847
15875
|
|
|
15848
15876
|
// ../../shared-contracts/dist/delegation-read.js
|
|
15849
15877
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -16809,6 +16837,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16809
16837
|
"completed",
|
|
16810
16838
|
"failed",
|
|
16811
16839
|
"interrupted",
|
|
16840
|
+
"needsInput",
|
|
16812
16841
|
"timedOut",
|
|
16813
16842
|
"unreadable",
|
|
16814
16843
|
"notFound"
|
|
@@ -16855,13 +16884,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16855
16884
|
var thread = { ...target, threadId: identity };
|
|
16856
16885
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
16857
16886
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
16887
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
16858
16888
|
external_exports.strictObject({
|
|
16859
16889
|
kind: external_exports.literal("list"),
|
|
16860
16890
|
...target,
|
|
16861
16891
|
cursor: external_exports.string().nullable(),
|
|
16862
16892
|
archived: external_exports.boolean()
|
|
16863
16893
|
}),
|
|
16864
|
-
external_exports.strictObject({
|
|
16894
|
+
external_exports.strictObject({
|
|
16895
|
+
kind: external_exports.literal("read"),
|
|
16896
|
+
...thread,
|
|
16897
|
+
page: external_exports.strictObject({
|
|
16898
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
16899
|
+
epoch: identity.optional(),
|
|
16900
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
16901
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
16902
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
16903
|
+
message: "A history continuation requires its connection epoch"
|
|
16904
|
+
}).optional()
|
|
16905
|
+
}),
|
|
16865
16906
|
external_exports.strictObject({
|
|
16866
16907
|
kind: external_exports.literal("configure"),
|
|
16867
16908
|
...thread,
|
|
@@ -17138,6 +17179,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
17138
17179
|
"totalCredits",
|
|
17139
17180
|
"contextUsagePercent",
|
|
17140
17181
|
"outputTokensPerSecond",
|
|
17182
|
+
"sessionOutputTokensPerSecond",
|
|
17141
17183
|
"apiOutputTokensPerSecond",
|
|
17142
17184
|
"costSource",
|
|
17143
17185
|
"unpricedModels"
|
|
@@ -17160,6 +17202,7 @@ function parseHostUsage(value) {
|
|
|
17160
17202
|
for (const field2 of [
|
|
17161
17203
|
"totalCredits",
|
|
17162
17204
|
"contextUsagePercent",
|
|
17205
|
+
"sessionOutputTokensPerSecond",
|
|
17163
17206
|
"apiOutputTokensPerSecond"
|
|
17164
17207
|
]) {
|
|
17165
17208
|
const candidate = value[field2];
|
|
@@ -17238,6 +17281,7 @@ var requestTokenFields = [
|
|
|
17238
17281
|
"cacheWrite1hInputTokens",
|
|
17239
17282
|
"outputTokens",
|
|
17240
17283
|
"reasoningOutputTokens",
|
|
17284
|
+
"timedOutputTokens",
|
|
17241
17285
|
"startedAtMs",
|
|
17242
17286
|
"completedAtMs"
|
|
17243
17287
|
];
|
|
@@ -17290,6 +17334,14 @@ function parseHostUsageRequest(value) {
|
|
|
17290
17334
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17291
17335
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17292
17336
|
}
|
|
17337
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17338
|
+
if (request.startedAtMs === void 0) {
|
|
17339
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17340
|
+
}
|
|
17341
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17342
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17343
|
+
}
|
|
17344
|
+
}
|
|
17293
17345
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17294
17346
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17295
17347
|
}
|
|
@@ -18483,7 +18535,7 @@ var ompDiscoverySpec = {
|
|
|
18483
18535
|
"/opt/homebrew/bin",
|
|
18484
18536
|
"/usr/local/bin"
|
|
18485
18537
|
],
|
|
18486
|
-
windows: ["${APPDATA}/npm", "~/.local/bin", VERSION_MANAGER_ROOTS]
|
|
18538
|
+
windows: ["${APPDATA}/npm", "${LOCALAPPDATA}/omp", "~/.local/bin", VERSION_MANAGER_ROOTS]
|
|
18487
18539
|
}
|
|
18488
18540
|
};
|
|
18489
18541
|
function resolveOmpExecutable(input, dependencies = {}) {
|
|
@@ -18969,6 +19021,7 @@ var OmpRpcSession = class {
|
|
|
18969
19021
|
#latestCacheHitRatePercent;
|
|
18970
19022
|
#manualCompaction = null;
|
|
18971
19023
|
#usageRequestStartedAtMs = null;
|
|
19024
|
+
#usageRequestTimingUnavailable = false;
|
|
18972
19025
|
#stderrTail = "";
|
|
18973
19026
|
#frameDecoder = new OmpFrameDecoder();
|
|
18974
19027
|
#startupFaultResolve = null;
|
|
@@ -19610,12 +19663,26 @@ var OmpRpcSession = class {
|
|
|
19610
19663
|
#observeUsage(value) {
|
|
19611
19664
|
if (value.type === "message_start") {
|
|
19612
19665
|
this.#usageRequestStartedAtMs = null;
|
|
19666
|
+
this.#usageRequestTimingUnavailable = false;
|
|
19613
19667
|
return;
|
|
19614
19668
|
}
|
|
19615
19669
|
if (value.type === "message_update") {
|
|
19616
19670
|
const event = value.assistantMessageEvent;
|
|
19617
|
-
if (this.#usageRequestStartedAtMs === null && isRecord8(event) && typeof event.type === "string"
|
|
19618
|
-
|
|
19671
|
+
if (this.#usageRequestStartedAtMs === null && !this.#usageRequestTimingUnavailable && isRecord8(event) && typeof event.type === "string") {
|
|
19672
|
+
if (
|
|
19673
|
+
// Native thinking starts can precede visible text by seconds; output usage includes it.
|
|
19674
|
+
/^(thinking|reasoning|thought)_start$/u.test(event.type) || /^(text|thinking|reasoning|thought)_delta$/u.test(event.type) && typeof event.delta === "string" && event.delta.length > 0
|
|
19675
|
+
)
|
|
19676
|
+
this.#usageRequestStartedAtMs = Date.now();
|
|
19677
|
+
else if (event.type === "toolcall_delta" && typeof event.delta === "string" && event.delta.length > 0) {
|
|
19678
|
+
try {
|
|
19679
|
+
JSON.parse(event.delta);
|
|
19680
|
+
this.#usageRequestTimingUnavailable = true;
|
|
19681
|
+
} catch {
|
|
19682
|
+
this.#usageRequestStartedAtMs = Date.now();
|
|
19683
|
+
}
|
|
19684
|
+
} else if (event.type === "toolcall_end")
|
|
19685
|
+
this.#usageRequestTimingUnavailable = true;
|
|
19619
19686
|
}
|
|
19620
19687
|
return;
|
|
19621
19688
|
}
|
|
@@ -15202,13 +15202,25 @@ var threadPermissionModeSelectParamsSchema = external_exports.object({
|
|
|
15202
15202
|
var nonNegativeSafeIntegerSchema = external_exports.number().int().safe().nonnegative();
|
|
15203
15203
|
var finiteNonNegativeNumberSchema = external_exports.number().finite().nonnegative();
|
|
15204
15204
|
var cacheHitRatePercentSchema = external_exports.number().finite().min(0).max(100);
|
|
15205
|
+
var usageOutputTimingSchema = external_exports.object({
|
|
15206
|
+
version: external_exports.union([external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15207
|
+
requestId: external_exports.string().min(1),
|
|
15208
|
+
turnId: external_exports.string().min(1).max(1024),
|
|
15209
|
+
outputTokens: nonNegativeSafeIntegerSchema,
|
|
15210
|
+
startedAtMs: nonNegativeSafeIntegerSchema,
|
|
15211
|
+
completedAtMs: nonNegativeSafeIntegerSchema
|
|
15212
|
+
}).strict().refine((value) => value.completedAtMs > value.startedAtMs);
|
|
15205
15213
|
var usageMeasurementSchema = external_exports.object({
|
|
15214
|
+
version: external_exports.union([external_exports.literal(2), external_exports.literal(3), external_exports.literal(4)]).optional(),
|
|
15206
15215
|
value: finiteNonNegativeNumberSchema,
|
|
15207
15216
|
turnId: external_exports.string().min(1).max(1024),
|
|
15208
15217
|
at: nonNegativeSafeIntegerSchema
|
|
15209
15218
|
}).strict();
|
|
15210
15219
|
var usageMeasurementsSchema = external_exports.object({
|
|
15211
|
-
|
|
15220
|
+
// Older intervals can omit hidden thinking time; do not restore them into averages.
|
|
15221
|
+
outputTimings: external_exports.array(usageOutputTimingSchema).transform((values) => values.filter((value) => value.version === 4)).optional(),
|
|
15222
|
+
// Retain independent TTFT facts when dropping incompatible speed measurements.
|
|
15223
|
+
outputTokensPerSecond: usageMeasurementSchema.refine((value) => value.version === 4).optional().catch(void 0),
|
|
15212
15224
|
timeToFirstOutputMs: usageMeasurementSchema.extend({ value: nonNegativeSafeIntegerSchema }).optional()
|
|
15213
15225
|
}).strict();
|
|
15214
15226
|
var indicatorTextSchema = (maximum) => harnessLocalizedTextSchema.refine((entries) => Object.values(entries).every((text) => text.length <= maximum));
|
|
@@ -15228,6 +15240,7 @@ var threadUsageSnapshotSchema = external_exports.object({
|
|
|
15228
15240
|
cacheWriteInputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15229
15241
|
outputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15230
15242
|
outputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15243
|
+
sessionOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15231
15244
|
apiOutputTokensPerSecond: finiteNonNegativeNumberSchema.optional(),
|
|
15232
15245
|
reasoningOutputTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
15233
15246
|
totalTokens: nonNegativeSafeIntegerSchema.optional(),
|
|
@@ -15639,6 +15652,10 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15639
15652
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15640
15653
|
}).strict();
|
|
15641
15654
|
|
|
15655
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15656
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15657
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15658
|
+
|
|
15642
15659
|
// ../../shared-contracts/dist/client-channel.js
|
|
15643
15660
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15644
15661
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
@@ -15669,6 +15686,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15669
15686
|
cursor: clientChannelCursorSchema,
|
|
15670
15687
|
cwd: external_exports.string().optional()
|
|
15671
15688
|
}),
|
|
15689
|
+
external_exports.object({
|
|
15690
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15691
|
+
cursor: clientChannelCursorSchema,
|
|
15692
|
+
harnessId: external_exports.string().min(1)
|
|
15693
|
+
}),
|
|
15672
15694
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15673
15695
|
external_exports.object({
|
|
15674
15696
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15740,6 +15762,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15740
15762
|
var clientTurnSchema = external_exports.object({
|
|
15741
15763
|
id: external_exports.string().min(1),
|
|
15742
15764
|
status: external_exports.string().min(1),
|
|
15765
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15766
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15743
15767
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15744
15768
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15745
15769
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -15778,7 +15802,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15778
15802
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15779
15803
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15780
15804
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15781
|
-
command: external_exports.object({
|
|
15805
|
+
command: external_exports.object({
|
|
15806
|
+
name: external_exports.string().min(1),
|
|
15807
|
+
turn: clientTurnSchema,
|
|
15808
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15809
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15810
|
+
}).optional(),
|
|
15782
15811
|
thread: external_exports.object({
|
|
15783
15812
|
id: external_exports.string().min(1),
|
|
15784
15813
|
cwd: external_exports.string(),
|
|
@@ -15986,7 +16015,6 @@ var webAccessStateSchema = external_exports.object({
|
|
|
15986
16015
|
quotaUntil: external_exports.string().optional()
|
|
15987
16016
|
}).strict().optional()
|
|
15988
16017
|
}).strict();
|
|
15989
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
15990
16018
|
|
|
15991
16019
|
// ../../shared-contracts/dist/delegation-read.js
|
|
15992
16020
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
@@ -16952,6 +16980,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16952
16980
|
"completed",
|
|
16953
16981
|
"failed",
|
|
16954
16982
|
"interrupted",
|
|
16983
|
+
"needsInput",
|
|
16955
16984
|
"timedOut",
|
|
16956
16985
|
"unreadable",
|
|
16957
16986
|
"notFound"
|
|
@@ -16998,13 +17027,25 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
16998
17027
|
var thread = { ...target, threadId: identity };
|
|
16999
17028
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17000
17029
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17030
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17001
17031
|
external_exports.strictObject({
|
|
17002
17032
|
kind: external_exports.literal("list"),
|
|
17003
17033
|
...target,
|
|
17004
17034
|
cursor: external_exports.string().nullable(),
|
|
17005
17035
|
archived: external_exports.boolean()
|
|
17006
17036
|
}),
|
|
17007
|
-
external_exports.strictObject({
|
|
17037
|
+
external_exports.strictObject({
|
|
17038
|
+
kind: external_exports.literal("read"),
|
|
17039
|
+
...thread,
|
|
17040
|
+
page: external_exports.strictObject({
|
|
17041
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
17042
|
+
epoch: identity.optional(),
|
|
17043
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
17044
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
17045
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
17046
|
+
message: "A history continuation requires its connection epoch"
|
|
17047
|
+
}).optional()
|
|
17048
|
+
}),
|
|
17008
17049
|
external_exports.strictObject({
|
|
17009
17050
|
kind: external_exports.literal("configure"),
|
|
17010
17051
|
...thread,
|
|
@@ -17281,6 +17322,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
17281
17322
|
"totalCredits",
|
|
17282
17323
|
"contextUsagePercent",
|
|
17283
17324
|
"outputTokensPerSecond",
|
|
17325
|
+
"sessionOutputTokensPerSecond",
|
|
17284
17326
|
"apiOutputTokensPerSecond",
|
|
17285
17327
|
"costSource",
|
|
17286
17328
|
"unpricedModels"
|
|
@@ -17303,6 +17345,7 @@ function parseHostUsage(value) {
|
|
|
17303
17345
|
for (const field2 of [
|
|
17304
17346
|
"totalCredits",
|
|
17305
17347
|
"contextUsagePercent",
|
|
17348
|
+
"sessionOutputTokensPerSecond",
|
|
17306
17349
|
"apiOutputTokensPerSecond"
|
|
17307
17350
|
]) {
|
|
17308
17351
|
const candidate2 = value[field2];
|
|
@@ -17381,6 +17424,7 @@ var requestTokenFields = [
|
|
|
17381
17424
|
"cacheWrite1hInputTokens",
|
|
17382
17425
|
"outputTokens",
|
|
17383
17426
|
"reasoningOutputTokens",
|
|
17427
|
+
"timedOutputTokens",
|
|
17384
17428
|
"startedAtMs",
|
|
17385
17429
|
"completedAtMs"
|
|
17386
17430
|
];
|
|
@@ -17433,6 +17477,14 @@ function parseHostUsageRequest(value) {
|
|
|
17433
17477
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17434
17478
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17435
17479
|
}
|
|
17480
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17481
|
+
if (request.startedAtMs === void 0) {
|
|
17482
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17483
|
+
}
|
|
17484
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17485
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17486
|
+
}
|
|
17487
|
+
}
|
|
17436
17488
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17437
17489
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17438
17490
|
}
|
|
@@ -17440,11 +17492,12 @@ function parseHostUsageRequest(value) {
|
|
|
17440
17492
|
}
|
|
17441
17493
|
|
|
17442
17494
|
// dist/v2/usage.js
|
|
17443
|
-
function v2UsageRequest(message, historical,
|
|
17495
|
+
function v2UsageRequest(message, historical, timing) {
|
|
17444
17496
|
if (message.type !== "assistant" || !message.tokens)
|
|
17445
17497
|
return null;
|
|
17446
17498
|
const { input, output, reasoning, cache } = message.tokens;
|
|
17447
17499
|
const { streamed } = message.time;
|
|
17500
|
+
const firstOutputAtMs = timing?.firstOutputAtMs;
|
|
17448
17501
|
return parseHostUsageRequest({
|
|
17449
17502
|
requestId: message.id,
|
|
17450
17503
|
...historical ? { historical: true } : {},
|
|
@@ -17458,8 +17511,8 @@ function v2UsageRequest(message, historical, firstOutputAtMs) {
|
|
|
17458
17511
|
outputTokens: output + reasoning,
|
|
17459
17512
|
reasoningOutputTokens: reasoning,
|
|
17460
17513
|
// End at stream completion, not step completion, which can include tool execution.
|
|
17461
|
-
// Without a
|
|
17462
|
-
...!historical && firstOutputAtMs !== void 0 && streamed !== void 0 && streamed >= firstOutputAtMs ? { startedAtMs: firstOutputAtMs, completedAtMs: streamed } : {}
|
|
17514
|
+
// Without a stream end or a boundary covering reasoning, retain usage without timing.
|
|
17515
|
+
...!historical && (reasoning === 0 || timing?.reasoningObserved) && firstOutputAtMs !== void 0 && streamed !== void 0 && streamed >= firstOutputAtMs ? { startedAtMs: firstOutputAtMs, completedAtMs: streamed } : {}
|
|
17463
17516
|
});
|
|
17464
17517
|
}
|
|
17465
17518
|
|
|
@@ -28100,8 +28153,6 @@ var V2Session = class {
|
|
|
28100
28153
|
#cacheHitRatePercent;
|
|
28101
28154
|
/** Assistant messages already published as usage requests. */
|
|
28102
28155
|
#meteredMessages = /* @__PURE__ */ new Set();
|
|
28103
|
-
/** Adapter receive time of each assistant message's first reasoning, text or tool input. */
|
|
28104
|
-
#firstOutputAt = /* @__PURE__ */ new Map();
|
|
28105
28156
|
constructor(client2, connection, info, catalog, policy, limit, onClosed) {
|
|
28106
28157
|
this.client = client2;
|
|
28107
28158
|
this.connection = connection;
|
|
@@ -28265,6 +28316,7 @@ var V2Session = class {
|
|
|
28265
28316
|
baseline: /* @__PURE__ */ new Set(),
|
|
28266
28317
|
live: /* @__PURE__ */ new Map(),
|
|
28267
28318
|
assistants: /* @__PURE__ */ new Set(),
|
|
28319
|
+
outputTiming: /* @__PURE__ */ new Map(),
|
|
28268
28320
|
transient: /* @__PURE__ */ new Map(),
|
|
28269
28321
|
interactions: /* @__PURE__ */ new Map(),
|
|
28270
28322
|
replying: /* @__PURE__ */ new Set(),
|
|
@@ -28315,8 +28367,16 @@ var V2Session = class {
|
|
|
28315
28367
|
const active = this.#active;
|
|
28316
28368
|
if (!active || !("data" in event) || !("sessionID" in event.data) || event.data.sessionID !== this.info.id)
|
|
28317
28369
|
return;
|
|
28318
|
-
if (FIRST_OUTPUT_EVENTS.has(event.type) && "assistantMessageID" in event.data && typeof event.data.assistantMessageID === "string" && !this.#
|
|
28319
|
-
|
|
28370
|
+
if (FIRST_OUTPUT_EVENTS.has(event.type) && "assistantMessageID" in event.data && typeof event.data.assistantMessageID === "string" && !this.#meteredMessages.has(event.data.assistantMessageID) && (!event.type.endsWith(".delta") || "delta" in event.data && event.data.delta.length > 0)) {
|
|
28371
|
+
const id = event.data.assistantMessageID;
|
|
28372
|
+
const timing = active.outputTiming.get(id) ?? {
|
|
28373
|
+
firstOutputAtMs: Date.now(),
|
|
28374
|
+
reasoningObserved: false
|
|
28375
|
+
};
|
|
28376
|
+
if (event.type === "session.reasoning.started" || event.type === "session.reasoning.delta")
|
|
28377
|
+
timing.reasoningObserved = true;
|
|
28378
|
+
active.outputTiming.set(id, timing);
|
|
28379
|
+
}
|
|
28320
28380
|
if (event.type === "session.step.started")
|
|
28321
28381
|
active.assistants.add(event.data.assistantMessageID);
|
|
28322
28382
|
if ((event.type === "session.text.delta" || event.type === "session.reasoning.delta") && active.assistants.has(event.data.assistantMessageID)) {
|
|
@@ -28343,8 +28403,9 @@ var V2Session = class {
|
|
|
28343
28403
|
for (const message of messages) {
|
|
28344
28404
|
let request;
|
|
28345
28405
|
try {
|
|
28346
|
-
request = v2UsageRequest(message, historical, this.#
|
|
28406
|
+
request = v2UsageRequest(message, historical, this.#active?.outputTiming.get(message.id));
|
|
28347
28407
|
} catch {
|
|
28408
|
+
this.#active?.outputTiming.delete(message.id);
|
|
28348
28409
|
this.#cacheHitRatePercent = void 0;
|
|
28349
28410
|
if (this.#meteredMessages.has(message.id))
|
|
28350
28411
|
continue;
|
|
@@ -28360,7 +28421,7 @@ var V2Session = class {
|
|
|
28360
28421
|
if (this.#meteredMessages.has(message.id))
|
|
28361
28422
|
continue;
|
|
28362
28423
|
this.#meteredMessages.add(message.id);
|
|
28363
|
-
this.#
|
|
28424
|
+
this.#active?.outputTiming.delete(message.id);
|
|
28364
28425
|
this.#emit({ type: "usage.request", request });
|
|
28365
28426
|
}
|
|
28366
28427
|
if (this.#cacheHitRatePercent !== previousCacheHitRate)
|