@liberseek/boft-cli-linux-x64 0.8.8 → 0.8.9
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 +59 -6
- package/app/console-web.js +1376 -1053
- package/app/desktop-controller.mjs +239 -57
- package/app/host-runtime.mjs +35964 -28304
- package/app/plugins/antigravity/assets/icon.svg +1 -1
- package/app/plugins/antigravity/plugin.mjs +9491 -4266
- package/app/plugins/claude-code/plugin.mjs +580 -116
- package/app/plugins/codebuddy/plugin.mjs +85 -8
- package/app/plugins/codex-usage/plugin.mjs +70 -6
- package/app/plugins/copilot/plugin.mjs +62 -6
- package/app/plugins/cursor-cli/plugin.mjs +62 -6
- package/app/plugins/deepseek-harness/plugin.mjs +87 -11
- package/app/plugins/devin/plugin.mjs +61 -6
- package/app/plugins/grok/plugin.mjs +320 -223
- package/app/plugins/hermes/plugin.mjs +61 -6
- package/app/plugins/kimi-code/plugin.mjs +87 -16
- package/app/plugins/kiro-cli/plugin.mjs +62 -6
- package/app/plugins/muse/plugin.mjs +61 -6
- package/app/plugins/omp/plugin.mjs +195 -31
- package/app/plugins/opencode/plugin.mjs +88 -15
- package/app/plugins/pi/plugin.mjs +207 -32
- package/app/plugins/qoder/plugin.mjs +99 -7
- package/app/plugins/qoder-cn/plugin.mjs +99 -7
- package/app/plugins/qwen-code/plugin.mjs +62 -6
- package/app/plugins/workbuddy/plugin.mjs +89 -11
- package/app/plugins/zcode/plugin.mjs +70 -6
- package/app/renderer-extension.js +1767 -1187
- package/app/web/assets/index-C2OA-eHT.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 +1383 -1056
- 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 +11 -11
- package/app/web/plugins/deepseek-ai__dsh-client-connection/client.js +1 -1
- package/app/web/plugins/deepseek-ai__dsh-client-locale/client.js +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-attachment/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 +3 -3
- package/app/web/plugins/deepseek-ai__dsh-client-ui-conversation/client.js +28 -28
- 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-sidebar-files/client.js +1 -1
- 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 +11 -11
- package/app/web-modules/server.mjs +2458 -1615
- package/bin/boft +0 -0
- package/libexec/boft-shim +0 -0
- package/libexec/boft-updater +0 -0
- package/package.json +1 -1
- package/app/web/assets/index-CP6wY-1D.css +0 -1
- package/app/web/assets/index-Da35Phrd.js +0 -199
|
@@ -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(),
|
|
@@ -15659,11 +15672,19 @@ var threadSteeringInspectResultSchema = external_exports.object({
|
|
|
15659
15672
|
delivery: external_exports.enum(["official", "activeTurn", "newTurn"])
|
|
15660
15673
|
}).strict();
|
|
15661
15674
|
|
|
15675
|
+
// ../../shared-contracts/dist/thread-archive-confirm.js
|
|
15676
|
+
var threadArchiveConfirmParamsSchema = external_exports.object({ threadId: hostThreadIdSchema }).strict();
|
|
15677
|
+
var threadArchiveConfirmResultSchema = external_exports.object({ confirmed: external_exports.boolean() }).strict();
|
|
15678
|
+
|
|
15662
15679
|
// ../../shared-contracts/dist/client-channel.js
|
|
15663
15680
|
var CLIENT_CHANNEL_VERSION = 1;
|
|
15664
15681
|
var CLIENT_REQUEST_LIMIT_BYTES = 128 * 1024 * 1024;
|
|
15665
15682
|
var clientThreadPinsSchema = external_exports.object({ threadIds: external_exports.array(external_exports.string().min(1)) }).strict();
|
|
15666
15683
|
var clientThreadPinParamsSchema = external_exports.object({ threadId: external_exports.string().min(1).max(1024), pinned: external_exports.boolean() }).strict();
|
|
15684
|
+
var clientThreadTreeReadParamsSchema = external_exports.object({}).strict();
|
|
15685
|
+
var clientThreadTreeSchema = external_exports.object({
|
|
15686
|
+
parents: external_exports.record(external_exports.string().min(1), external_exports.string().min(1))
|
|
15687
|
+
}).strict();
|
|
15667
15688
|
var clientProjectlessWorkspaceSchema = external_exports.object({
|
|
15668
15689
|
prompt: external_exports.string().max(16384).optional()
|
|
15669
15690
|
}).strict();
|
|
@@ -15685,6 +15706,11 @@ var clientChannelEventSchema = external_exports.discriminatedUnion("type", [
|
|
|
15685
15706
|
cursor: clientChannelCursorSchema,
|
|
15686
15707
|
cwd: external_exports.string().optional()
|
|
15687
15708
|
}),
|
|
15709
|
+
external_exports.object({
|
|
15710
|
+
type: external_exports.literal("harness-inspection-changed"),
|
|
15711
|
+
cursor: clientChannelCursorSchema,
|
|
15712
|
+
harnessId: external_exports.string().min(1)
|
|
15713
|
+
}),
|
|
15688
15714
|
external_exports.object({ type: external_exports.literal("display-settings-changed"), cursor: clientChannelCursorSchema }),
|
|
15689
15715
|
external_exports.object({
|
|
15690
15716
|
type: external_exports.literal("preferences-changed"),
|
|
@@ -15756,6 +15782,8 @@ var clientItemTruncationSchema = external_exports.object({
|
|
|
15756
15782
|
var clientTurnSchema = external_exports.object({
|
|
15757
15783
|
id: external_exports.string().min(1),
|
|
15758
15784
|
status: external_exports.string().min(1),
|
|
15785
|
+
/** Native history has no terminal evidence; Desktop's status vocabulary cannot express this. */
|
|
15786
|
+
codexhostTurnOutcome: external_exports.object({ status: external_exports.literal("unknown"), reason: external_exports.string() }).optional(),
|
|
15759
15787
|
items: external_exports.array(external_exports.object({ id: external_exports.string().min(1), type: external_exports.string().min(1) }).passthrough()),
|
|
15760
15788
|
/** Original file operations, independent of the cumulative Desktop fileChange card.
|
|
15761
15789
|
* Insert before the named non-file Item; null appends at the end of the Turn.
|
|
@@ -15794,7 +15822,12 @@ var clientThreadSnapshotSchema = external_exports.object({
|
|
|
15794
15822
|
/** Current interruptible Host Turn, including command Turns omitted from client history. */
|
|
15795
15823
|
activeTurnId: external_exports.string().min(1).nullable().optional(),
|
|
15796
15824
|
/** Most recent explicit command in this Host process; not native conversation history. */
|
|
15797
|
-
command: external_exports.object({
|
|
15825
|
+
command: external_exports.object({
|
|
15826
|
+
name: external_exports.string().min(1),
|
|
15827
|
+
turn: clientTurnSchema,
|
|
15828
|
+
/** First ordinary Turn started after this command; its retained result is not a new event. */
|
|
15829
|
+
subsequentTurnId: external_exports.string().min(1).optional()
|
|
15830
|
+
}).optional(),
|
|
15798
15831
|
thread: external_exports.object({
|
|
15799
15832
|
id: external_exports.string().min(1),
|
|
15800
15833
|
cwd: external_exports.string(),
|
|
@@ -16002,15 +16035,14 @@ var webAccessStateSchema = external_exports.object({
|
|
|
16002
16035
|
quotaUntil: external_exports.string().optional()
|
|
16003
16036
|
}).strict().optional()
|
|
16004
16037
|
}).strict();
|
|
16005
|
-
var webLocalAccessRequiredDetailsSchema = external_exports.object({ url: external_exports.string() }).strict();
|
|
16006
16038
|
|
|
16007
16039
|
// ../../shared-contracts/dist/delegation-read.js
|
|
16008
16040
|
var REMOTE_THREAD_REPLY_MAX_BYTES = 16 * 1024 * 1024;
|
|
16009
16041
|
var delegationReadParamsSchema = external_exports.strictObject({
|
|
16010
16042
|
threadId: external_exports.string().min(1).max(1024),
|
|
16011
16043
|
view: external_exports.enum(["result", "messages"]),
|
|
16012
|
-
|
|
16013
|
-
|
|
16044
|
+
from: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional(),
|
|
16045
|
+
to: external_exports.number().int().min(1).max(Number.MAX_SAFE_INTEGER).optional()
|
|
16014
16046
|
});
|
|
16015
16047
|
|
|
16016
16048
|
// ../../shared-contracts/dist/credential-imports.js
|
|
@@ -16995,6 +17027,7 @@ var THREAD_WATCH_NOTICE_OUTCOMES = [
|
|
|
16995
17027
|
"completed",
|
|
16996
17028
|
"failed",
|
|
16997
17029
|
"interrupted",
|
|
17030
|
+
"needsInput",
|
|
16998
17031
|
"timedOut",
|
|
16999
17032
|
"unreadable",
|
|
17000
17033
|
"notFound"
|
|
@@ -17041,13 +17074,26 @@ var target = { hostId: identity.regex(/^remote-(?:ssh(?:-|:)|control:)/u) };
|
|
|
17041
17074
|
var thread = { ...target, threadId: identity };
|
|
17042
17075
|
var remoteSessionOperationSchema = external_exports.discriminatedUnion("kind", [
|
|
17043
17076
|
external_exports.strictObject({ kind: external_exports.literal("hosts") }),
|
|
17077
|
+
external_exports.strictObject({ kind: external_exports.literal("status"), ...thread }),
|
|
17044
17078
|
external_exports.strictObject({
|
|
17045
17079
|
kind: external_exports.literal("list"),
|
|
17046
17080
|
...target,
|
|
17047
17081
|
cursor: external_exports.string().nullable(),
|
|
17048
17082
|
archived: external_exports.boolean()
|
|
17049
17083
|
}),
|
|
17050
|
-
external_exports.strictObject({
|
|
17084
|
+
external_exports.strictObject({
|
|
17085
|
+
kind: external_exports.literal("read"),
|
|
17086
|
+
...thread,
|
|
17087
|
+
page: external_exports.strictObject({
|
|
17088
|
+
cursor: external_exports.string().min(1).max(8192).nullable(),
|
|
17089
|
+
epoch: identity.optional(),
|
|
17090
|
+
sortDirection: external_exports.enum(["asc", "desc"]).optional(),
|
|
17091
|
+
limit: external_exports.number().int().min(1).max(20).optional()
|
|
17092
|
+
}).refine((page) => page.cursor === null || page.epoch !== void 0, {
|
|
17093
|
+
message: "A history continuation requires its connection epoch"
|
|
17094
|
+
}).optional()
|
|
17095
|
+
}),
|
|
17096
|
+
external_exports.strictObject({ kind: external_exports.literal("usage"), ...thread, epoch: identity }),
|
|
17051
17097
|
external_exports.strictObject({
|
|
17052
17098
|
kind: external_exports.literal("configure"),
|
|
17053
17099
|
...thread,
|
|
@@ -17128,6 +17174,13 @@ var remoteConnectionsReplySchema = external_exports.union([
|
|
|
17128
17174
|
external_exports.strictObject({ error: external_exports.strictObject({ code: external_exports.number().int(), message: external_exports.string() }) })
|
|
17129
17175
|
]);
|
|
17130
17176
|
|
|
17177
|
+
// ../../shared-contracts/dist/thread-title.js
|
|
17178
|
+
var threadTitleInputSchema = external_exports.strictObject({
|
|
17179
|
+
prompt: external_exports.string().trim().min(1).max(2e3),
|
|
17180
|
+
cwd: external_exports.string().max(4096).nullable()
|
|
17181
|
+
});
|
|
17182
|
+
var threadTitleResultSchema = external_exports.string().trim().min(1).max(60).nullable();
|
|
17183
|
+
|
|
17131
17184
|
// ../../shared-contracts/dist/web-ui-extensions.js
|
|
17132
17185
|
var webUiExtensionIdSchema = external_exports.string().max(214).regex(/^(?:@[a-z0-9][a-z0-9._-]*\/)?[a-z0-9][a-z0-9._-]*$/u);
|
|
17133
17186
|
var localizedTextSchema2 = external_exports.union([
|
|
@@ -17317,6 +17370,7 @@ var usageFields = /* @__PURE__ */ new Set([
|
|
|
17317
17370
|
"totalCredits",
|
|
17318
17371
|
"contextUsagePercent",
|
|
17319
17372
|
"outputTokensPerSecond",
|
|
17373
|
+
"sessionOutputTokensPerSecond",
|
|
17320
17374
|
"apiOutputTokensPerSecond",
|
|
17321
17375
|
"costSource",
|
|
17322
17376
|
"unpricedModels"
|
|
@@ -17339,6 +17393,7 @@ function parseHostUsage(value) {
|
|
|
17339
17393
|
for (const field2 of [
|
|
17340
17394
|
"totalCredits",
|
|
17341
17395
|
"contextUsagePercent",
|
|
17396
|
+
"sessionOutputTokensPerSecond",
|
|
17342
17397
|
"apiOutputTokensPerSecond"
|
|
17343
17398
|
]) {
|
|
17344
17399
|
const candidate2 = value[field2];
|
|
@@ -17423,6 +17478,7 @@ var requestTokenFields = [
|
|
|
17423
17478
|
"cacheWrite1hInputTokens",
|
|
17424
17479
|
"outputTokens",
|
|
17425
17480
|
"reasoningOutputTokens",
|
|
17481
|
+
"timedOutputTokens",
|
|
17426
17482
|
"startedAtMs",
|
|
17427
17483
|
"completedAtMs"
|
|
17428
17484
|
];
|
|
@@ -17475,6 +17531,14 @@ function parseHostUsageRequest(value) {
|
|
|
17475
17531
|
if (request.startedAtMs === void 0 !== (request.completedAtMs === void 0)) {
|
|
17476
17532
|
throw new Error("Harness Usage request timing fields must be provided together");
|
|
17477
17533
|
}
|
|
17534
|
+
if (request.timedOutputTokens !== void 0) {
|
|
17535
|
+
if (request.startedAtMs === void 0) {
|
|
17536
|
+
throw new Error("Harness Usage request 'timedOutputTokens' requires timing fields");
|
|
17537
|
+
}
|
|
17538
|
+
if (request.timedOutputTokens > request.outputTokens) {
|
|
17539
|
+
throw new Error("Harness Usage request 'timedOutputTokens' must not exceed 'outputTokens'");
|
|
17540
|
+
}
|
|
17541
|
+
}
|
|
17478
17542
|
if (request.startedAtMs !== void 0 && request.completedAtMs !== void 0 && request.completedAtMs < request.startedAtMs) {
|
|
17479
17543
|
throw new Error("Harness Usage request 'completedAtMs' must not precede 'startedAtMs'");
|
|
17480
17544
|
}
|
|
@@ -17482,11 +17546,12 @@ function parseHostUsageRequest(value) {
|
|
|
17482
17546
|
}
|
|
17483
17547
|
|
|
17484
17548
|
// dist/v2/usage.js
|
|
17485
|
-
function v2UsageRequest(message, historical,
|
|
17549
|
+
function v2UsageRequest(message, historical, timing) {
|
|
17486
17550
|
if (message.type !== "assistant" || !message.tokens)
|
|
17487
17551
|
return null;
|
|
17488
17552
|
const { input, output, reasoning, cache } = message.tokens;
|
|
17489
17553
|
const { streamed } = message.time;
|
|
17554
|
+
const firstOutputAtMs = timing?.firstOutputAtMs;
|
|
17490
17555
|
return parseHostUsageRequest({
|
|
17491
17556
|
requestId: message.id,
|
|
17492
17557
|
...historical ? { historical: true } : {},
|
|
@@ -17500,8 +17565,8 @@ function v2UsageRequest(message, historical, firstOutputAtMs) {
|
|
|
17500
17565
|
outputTokens: output + reasoning,
|
|
17501
17566
|
reasoningOutputTokens: reasoning,
|
|
17502
17567
|
// End at stream completion, not step completion, which can include tool execution.
|
|
17503
|
-
// Without a
|
|
17504
|
-
...!historical && firstOutputAtMs !== void 0 && streamed !== void 0 && streamed >= firstOutputAtMs ? { startedAtMs: firstOutputAtMs, completedAtMs: streamed } : {}
|
|
17568
|
+
// Without a stream end or a boundary covering reasoning, retain usage without timing.
|
|
17569
|
+
...!historical && (reasoning === 0 || timing?.reasoningObserved) && firstOutputAtMs !== void 0 && streamed !== void 0 && streamed >= firstOutputAtMs ? { startedAtMs: firstOutputAtMs, completedAtMs: streamed } : {}
|
|
17505
17570
|
});
|
|
17506
17571
|
}
|
|
17507
17572
|
|
|
@@ -28146,8 +28211,6 @@ var V2Session = class {
|
|
|
28146
28211
|
#cacheHitRatePercent;
|
|
28147
28212
|
/** Assistant messages already published as usage requests. */
|
|
28148
28213
|
#meteredMessages = /* @__PURE__ */ new Set();
|
|
28149
|
-
/** Adapter receive time of each assistant message's first reasoning, text or tool input. */
|
|
28150
|
-
#firstOutputAt = /* @__PURE__ */ new Map();
|
|
28151
28214
|
constructor(client2, connection, info, catalog, policy, limit, onClosed) {
|
|
28152
28215
|
this.client = client2;
|
|
28153
28216
|
this.connection = connection;
|
|
@@ -28312,6 +28375,7 @@ var V2Session = class {
|
|
|
28312
28375
|
baseline: /* @__PURE__ */ new Set(),
|
|
28313
28376
|
live: /* @__PURE__ */ new Map(),
|
|
28314
28377
|
assistants: /* @__PURE__ */ new Set(),
|
|
28378
|
+
outputTiming: /* @__PURE__ */ new Map(),
|
|
28315
28379
|
transient: /* @__PURE__ */ new Map(),
|
|
28316
28380
|
interactions: /* @__PURE__ */ new Map(),
|
|
28317
28381
|
replying: /* @__PURE__ */ new Set(),
|
|
@@ -28362,8 +28426,16 @@ var V2Session = class {
|
|
|
28362
28426
|
const active = this.#active;
|
|
28363
28427
|
if (!active || !("data" in event) || !("sessionID" in event.data) || event.data.sessionID !== this.info.id)
|
|
28364
28428
|
return;
|
|
28365
|
-
if (FIRST_OUTPUT_EVENTS.has(event.type) && "assistantMessageID" in event.data && typeof event.data.assistantMessageID === "string" && !this.#
|
|
28366
|
-
|
|
28429
|
+
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)) {
|
|
28430
|
+
const id = event.data.assistantMessageID;
|
|
28431
|
+
const timing = active.outputTiming.get(id) ?? {
|
|
28432
|
+
firstOutputAtMs: Date.now(),
|
|
28433
|
+
reasoningObserved: false
|
|
28434
|
+
};
|
|
28435
|
+
if (event.type === "session.reasoning.started" || event.type === "session.reasoning.delta")
|
|
28436
|
+
timing.reasoningObserved = true;
|
|
28437
|
+
active.outputTiming.set(id, timing);
|
|
28438
|
+
}
|
|
28367
28439
|
if (event.type === "session.step.started")
|
|
28368
28440
|
active.assistants.add(event.data.assistantMessageID);
|
|
28369
28441
|
if ((event.type === "session.text.delta" || event.type === "session.reasoning.delta") && active.assistants.has(event.data.assistantMessageID)) {
|
|
@@ -28390,8 +28462,9 @@ var V2Session = class {
|
|
|
28390
28462
|
for (const message of messages) {
|
|
28391
28463
|
let request;
|
|
28392
28464
|
try {
|
|
28393
|
-
request = v2UsageRequest(message, historical, this.#
|
|
28465
|
+
request = v2UsageRequest(message, historical, this.#active?.outputTiming.get(message.id));
|
|
28394
28466
|
} catch {
|
|
28467
|
+
this.#active?.outputTiming.delete(message.id);
|
|
28395
28468
|
this.#cacheHitRatePercent = void 0;
|
|
28396
28469
|
if (this.#meteredMessages.has(message.id))
|
|
28397
28470
|
continue;
|
|
@@ -28407,7 +28480,7 @@ var V2Session = class {
|
|
|
28407
28480
|
if (this.#meteredMessages.has(message.id))
|
|
28408
28481
|
continue;
|
|
28409
28482
|
this.#meteredMessages.add(message.id);
|
|
28410
|
-
this.#
|
|
28483
|
+
this.#active?.outputTiming.delete(message.id);
|
|
28411
28484
|
this.#emit({ type: "usage.request", request });
|
|
28412
28485
|
}
|
|
28413
28486
|
if (this.#cacheHitRatePercent !== previousCacheHitRate)
|