tokentracker-cli 1.5.15 → 1.5.17
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/dashboard/dist/assets/{AchievementBadge-CwjI28oT.js → AchievementBadge-BiEoQE7Z.js} +1 -1
- package/dashboard/dist/assets/{AchievementsPage-Dq544fjX.js → AchievementsPage-4g0Q8O0U.js} +2 -2
- package/dashboard/dist/assets/{AchievementsSection-DufV6nod.js → AchievementsSection-D5dyOWFj.js} +1 -1
- package/dashboard/dist/assets/{BadgeDetailModal-vw8xydKu.js → BadgeDetailModal-Bz067XUw.js} +1 -1
- package/dashboard/dist/assets/{BotAnimated-De0anwsh.js → BotAnimated-CFiGrlrg.js} +1 -1
- package/dashboard/dist/assets/{Card-CuSeWBDM.js → Card-CkYKahsn.js} +1 -1
- package/dashboard/dist/assets/{CloudCheckoutPage-CxFcOwAj.js → CloudCheckoutPage-BCzIRPkW.js} +1 -1
- package/dashboard/dist/assets/{CloudPage-Beb7_JLW.js → CloudPage-C0MZTK-9.js} +2 -2
- package/dashboard/dist/assets/{CommandPalette-PsUq2iRS.js → CommandPalette-DwSGE7c-.js} +1 -1
- package/dashboard/dist/assets/{CommunityStatsModal-b54WaPbK.js → CommunityStatsModal-B80ps9B5.js} +1 -1
- package/dashboard/dist/assets/{ConfirmModal-_NdunIh5.js → ConfirmModal-xthCJoY5.js} +1 -1
- package/dashboard/dist/assets/{Controls-5Is6MWln.js → Controls-DZ9vKkCI.js} +1 -1
- package/dashboard/dist/assets/{DashboardPage-C0n0qC7h.js → DashboardPage-C4SwA5lD.js} +1 -1
- package/dashboard/dist/assets/{DateRangePopover-C3WfGy-0.js → DateRangePopover-D8ihZ5SK.js} +1 -1
- package/dashboard/dist/assets/{DevicePage-Vn6k-mGd.js → DevicePage-OVnpUpAc.js} +1 -1
- package/dashboard/dist/assets/{DialogClose-CXttnna-.js → DialogClose-DpueWMdH.js} +1 -1
- package/dashboard/dist/assets/DialogDescription-CNb40Z5w.js +1 -0
- package/dashboard/dist/assets/{DialogTitle-B0cNIo0E.js → DialogTitle-Be_-fYZA.js} +1 -1
- package/dashboard/dist/assets/{ElectricLogo-DC3XSfIu.js → ElectricLogo-BJek75ac.js} +1 -1
- package/dashboard/dist/assets/{FadeIn-H7S3TMHi.js → FadeIn-HIpnpyJ-.js} +1 -1
- package/dashboard/dist/assets/{HeaderGithubStar-xgbIo5OP.js → HeaderGithubStar-Dj0guZ3R.js} +1 -1
- package/dashboard/dist/assets/{HoverTooltip-CpzM5Dju.js → HoverTooltip-B3p_QB2m.js} +1 -1
- package/dashboard/dist/assets/{IpCheckPage-BdV7S4dY.js → IpCheckPage-DrxLV2uL.js} +1 -1
- package/dashboard/dist/assets/{LandingPage-D9f28ryO.js → LandingPage-C3RPJvXW.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardPage--WUFpkBI.js → LeaderboardPage-CkVKRCA7.js} +2 -2
- package/dashboard/dist/assets/{LeaderboardProBadge-CEvrQ75Y.js → LeaderboardProBadge-C39qylf0.js} +1 -1
- package/dashboard/dist/assets/{LeaderboardProfileModal-Bn0HFr5h.js → LeaderboardProfileModal-D1DEHNRN.js} +3 -3
- package/dashboard/dist/assets/{LeaderboardProfilePage-DJ7fQI68.js → LeaderboardProfilePage-CoBBl1-f.js} +1 -1
- package/dashboard/dist/assets/{LimitsPage-7tPDheuX.js → LimitsPage-BnjPGpcE.js} +1 -1
- package/dashboard/dist/assets/{LocalOnlyNotice-DlGbVQS8.js → LocalOnlyNotice-CqCRY_ls.js} +1 -1
- package/dashboard/dist/assets/{LoginCard-BZZmzUGh.js → LoginCard-BeA3kcgy.js} +1 -1
- package/dashboard/dist/assets/{LoginModal-BT5_bIxU.js → LoginModal-D9S7DnuH.js} +1 -1
- package/dashboard/dist/assets/{LoginPage-DMjDUPPi.js → LoginPage-CXRATGB_.js} +1 -1
- package/dashboard/dist/assets/{PetPage-Dk3j6ITn.js → PetPage-0_l-kTr4.js} +2 -2
- package/dashboard/dist/assets/{PopoverPopup-pugRu3RC.js → PopoverPopup-CfPgHc44.js} +1 -1
- package/dashboard/dist/assets/{ProviderIcon-CtmL1CmY.js → ProviderIcon-DtjD5jVb.js} +1 -1
- package/dashboard/dist/assets/{ResetPasswordPage-BB6U7t8P.js → ResetPasswordPage-Bt8QpFOe.js} +1 -1
- package/dashboard/dist/assets/{Select-7w1su8lw.js → Select-BgQXA6kK.js} +1 -1
- package/dashboard/dist/assets/{SelectItemText-CaEUmWkj.js → SelectItemText-C7hWQpTf.js} +1 -1
- package/dashboard/dist/assets/{SelfHostPage-DctWoF-A.js → SelfHostPage-CUK_eL6K.js} +1 -1
- package/dashboard/dist/assets/{ServiceStatusPage-Dg3ljEXC.js → ServiceStatusPage-CF0nAsAf.js} +1 -1
- package/dashboard/dist/assets/{SessionsPage-B1dvW-be.js → SessionsPage-CE2cz-4_.js} +1 -1
- package/dashboard/dist/assets/{SettingsPage-DuXSX1R2.js → SettingsPage-su2wAKfz.js} +3 -3
- package/dashboard/dist/assets/{SkillsPage-CvXQFgc9.js → SkillsPage-Bp0PnSf_.js} +1 -1
- package/dashboard/dist/assets/{TokenGalaxy-DKC8Rk_Y.js → TokenGalaxy-CjY25cur.js} +1 -1
- package/dashboard/dist/assets/{TooltipPopup-Dp9EpHLG.js → TooltipPopup-DDztBp5x.js} +1 -1
- package/dashboard/dist/assets/{TrendMonitor-DWnlBn3H.js → TrendMonitor-CDaOhv8o.js} +1 -1
- package/dashboard/dist/assets/{WidgetsPage-GECNmb1Q.js → WidgetsPage-CjaQe3QN.js} +1 -1
- package/dashboard/dist/assets/{WrappedPage-Dq_1lOnb.js → WrappedPage-P4LVouC8.js} +1 -1
- package/dashboard/dist/assets/{__vite-browser-external-CkF0pdTJ.js → __vite-browser-external-CzHn8J8J.js} +2 -2
- package/dashboard/dist/assets/{agent-logos-Dqe3Vrah.js → agent-logos-CS9Iaf0t.js} +1 -1
- package/dashboard/dist/assets/{arrow-left-Cr_2QnDu.js → arrow-left-nH7mwAsq.js} +1 -1
- package/dashboard/dist/assets/{arrow-right-BsK2sJgt.js → arrow-right-BoRjpMCP.js} +1 -1
- package/dashboard/dist/assets/{arrow-up-right-DkWMGqXo.js → arrow-up-right-Cg0soM7i.js} +1 -1
- package/dashboard/dist/assets/{calendar-days-BB9VV438.js → calendar-days-6BSY0SCe.js} +1 -1
- package/dashboard/dist/assets/{check-bpSCJZWh.js → check-Ldxu9X3c.js} +1 -1
- package/dashboard/dist/assets/{chevron-down-CtECtDmx.js → chevron-down-Cl1UIsFC.js} +1 -1
- package/dashboard/dist/assets/{cloud-checkout-C4PrzKhN.js → cloud-checkout-CgoKsrLa.js} +1 -1
- package/dashboard/dist/assets/{composite-BHisG82k.js → composite-CqtsbFSD.js} +1 -1
- package/dashboard/dist/assets/{copy-Dmxzd-Sw.js → copy-CHDv4TDb.js} +1 -1
- package/dashboard/dist/assets/{download-CkdQzw2w.js → download-bExf6Ccu.js} +1 -1
- package/dashboard/dist/assets/{external-link-C971FjvC.js → external-link-DPe3LHcW.js} +1 -1
- package/dashboard/dist/assets/{flame-mKbp7kxw.js → flame-CYUEYQbn.js} +1 -1
- package/dashboard/dist/assets/{format-tokens-C35FrJnH.js → format-tokens-CJ73U0H5.js} +1 -1
- package/dashboard/dist/assets/{gift-BX2lSOmc.js → gift-BCmo7fKV.js} +1 -1
- package/dashboard/dist/assets/{icons-ov92u52T.js → icons-BtAa7a8Q.js} +1 -1
- package/dashboard/dist/assets/{index-Bgm38oHe.js → index--VJpPvce.js} +1 -1
- package/dashboard/dist/assets/{index-DF03nIHb.js → index-CKwNx_s1.js} +1 -1
- package/dashboard/dist/assets/{index-Ca5xkNrK.js → index-CSFt_XvV.js} +1 -1
- package/dashboard/dist/assets/{index-9OCL-BL8.js → index-CyhRNpQp.js} +1 -1
- package/dashboard/dist/assets/{info-B-f9hWcw.js → info-Cc5_kre6.js} +1 -1
- package/dashboard/dist/assets/{link-2-l1wuezTo.js → link-2-_RZOZ7kJ.js} +1 -1
- package/dashboard/dist/assets/{loader-circle-Lmjrs8XX.js → loader-circle-7GinPf0v.js} +1 -1
- package/dashboard/dist/assets/{local-usage-transfer-Ds6cF41d.js → local-usage-transfer-Cx5WBzma.js} +1 -1
- package/dashboard/dist/assets/{modifiers.esm-tVlltJXO.js → modifiers.esm-CO1bm3IT.js} +1 -1
- package/dashboard/dist/assets/{monitor-smartphone-XRiYiY8u.js → monitor-smartphone-CjBB2EQT.js} +1 -1
- package/dashboard/dist/assets/{play-DaD9EMjk.js → play-B9AHJ0ir.js} +1 -1
- package/dashboard/dist/assets/{plus-D30fbsKQ.js → plus-BYHC32xe.js} +1 -1
- package/dashboard/dist/assets/{provider-display-CKdhBOwz.js → provider-display-N2l_YZhb.js} +1 -1
- package/dashboard/dist/assets/{react-BY0y0K4x.js → react-DSS6zSQ7.js} +1 -1
- package/dashboard/dist/assets/{safePolygon-CSG_P7rG.js → safePolygon-BdbLh1jE.js} +1 -1
- package/dashboard/dist/assets/{search-Kiq8wVHA.js → search-D89mjm04.js} +1 -1
- package/dashboard/dist/assets/{server-CjovGBGz.js → server-PR9yTCiu.js} +1 -1
- package/dashboard/dist/assets/{shield-check-DF9MmMCq.js → shield-check-BYLC3hFn.js} +1 -1
- package/dashboard/dist/assets/{skills-api-CEzr6p92.js → skills-api-CM8yP8ZQ.js} +1 -1
- package/dashboard/dist/assets/{sortable.esm-D7jd9mE_.js → sortable.esm-4l8igdkd.js} +1 -1
- package/dashboard/dist/assets/{store-D9_jo_do.js → store-uku0hfBl.js} +1 -1
- package/dashboard/dist/assets/{terminal-CLOlvzR-.js → terminal-CQsyMIKh.js} +1 -1
- package/dashboard/dist/assets/{trash-DIe0fsDD.js → trash-Du6DwmPp.js} +1 -1
- package/dashboard/dist/assets/{use-community-stats-gDkdiRBz.js → use-community-stats-BI2Vkwhm.js} +1 -1
- package/dashboard/dist/assets/{use-latest-request-guard-tXGuKvua.js → use-latest-request-guard-AGXK-7W_.js} +1 -1
- package/dashboard/dist/assets/{use-limits-display-prefs-CCuLFy00.js → use-limits-display-prefs-XaEErSEN.js} +1 -1
- package/dashboard/dist/assets/{use-native-settings-hgYqaiR7.js → use-native-settings-BzNwI3lk.js} +1 -1
- package/dashboard/dist/assets/{use-ordered-list-D6-YzYJI.js → use-ordered-list-BUkFot2m.js} +1 -1
- package/dashboard/dist/assets/use-reduced-motion-Dl-5CnUW.js +1 -0
- package/dashboard/dist/assets/{use-transform-BEiXvAuE.js → use-transform-CRTGmr0C.js} +1 -1
- package/dashboard/dist/assets/{use-usage-limits-BlwtyPtT.js → use-usage-limits-DMHAKEU7.js} +1 -1
- package/dashboard/dist/assets/{useCurrency-CwCGJLHb.js → useCurrency-D7bYEIAY.js} +1 -1
- package/dashboard/dist/assets/{usePositioner-BqHtRIrE.js → usePositioner-PRBIy_6t.js} +1 -1
- package/dashboard/dist/assets/{useTokenFormat-BUNBUX-x.js → useTokenFormat-CGacmoDz.js} +1 -1
- package/dashboard/dist/assets/{zap-C0RFs2qQ.js → zap-B8svUQzd.js} +1 -1
- package/dashboard/dist/index.html +1 -1
- package/dashboard/dist/ip-check.html +1 -1
- package/dashboard/dist/leaderboard.html +1 -1
- package/dashboard/dist/share.html +1 -1
- package/package.json +1 -1
- package/src/lib/ark-agent-plan-limits.js +26 -55
- package/src/lib/ark-coding-plan-limits.js +31 -62
- package/src/lib/cloud-account.js +29 -3
- package/src/lib/dsh-session.js +81 -0
- package/src/lib/local-api.js +92 -5
- package/src/lib/pricing/curated-overrides.json +8 -0
- package/src/lib/pricing/seed-snapshot.json +1 -1
- package/src/lib/qoder-limits.js +35 -69
- package/src/lib/session-analytics.js +4 -1
- package/src/lib/session-performance.js +15 -0
- package/dashboard/dist/assets/DialogDescription-C3KGos_G.js +0 -1
- package/dashboard/dist/assets/use-reduced-motion-DfbDxs5a.js +0 -1
package/src/lib/qoder-limits.js
CHANGED
|
@@ -6,6 +6,7 @@ const net = require("node:net");
|
|
|
6
6
|
const os = require("node:os");
|
|
7
7
|
const path = require("node:path");
|
|
8
8
|
const { fetchQoderCnCliLimits } = require("./qoder-cn-cli-limits");
|
|
9
|
+
const { createLimitsCache } = require("./limits-cache");
|
|
9
10
|
|
|
10
11
|
const QODER_SITES = {
|
|
11
12
|
international: {
|
|
@@ -406,18 +407,40 @@ function writeQoderActivityCache(window, {
|
|
|
406
407
|
} catch (_error) {}
|
|
407
408
|
}
|
|
408
409
|
|
|
409
|
-
|
|
410
|
-
|
|
410
|
+
// The active region partitions the cache by filename (cn vs global); the
|
|
411
|
+
// record itself stays account-agnostic. A window without a parseable reset is
|
|
412
|
+
// kept only within the 12h unknown-reset TTL, and the global max-age only
|
|
413
|
+
// bounds snapshots with no future-dated window — a dated survivor outlives it.
|
|
414
|
+
// Provenance must describe the data's age, not the transport (#955): a fresh
|
|
415
|
+
// hit re-serves the winning source it was written with, an older hit honestly
|
|
416
|
+
// reports the disk cache.
|
|
417
|
+
const qoderLimitsCache = createLimitsCache({
|
|
418
|
+
file: ({ namespace }) => (namespace
|
|
411
419
|
? `qoder-${namespace}-usage-limits-cache.json`
|
|
412
|
-
: QODER_LIMITS_CACHE_FILE
|
|
413
|
-
|
|
414
|
-
|
|
420
|
+
: QODER_LIMITS_CACHE_FILE),
|
|
421
|
+
key: "qoder",
|
|
422
|
+
maxAgeMs: QODER_LIMITS_CACHE_MAX_AGE_MS,
|
|
423
|
+
maxAgeGate: "ifNoDatedSurvivor",
|
|
424
|
+
unknownResetTtlMs: QODER_LIMITS_CACHE_UNKNOWN_RESET_TTL_MS,
|
|
425
|
+
fields: {
|
|
426
|
+
plan_label: "string",
|
|
427
|
+
quota_exceeded: "boolTrue",
|
|
428
|
+
// Remember the winning source so a fresh re-serve keeps honest provenance
|
|
429
|
+
// instead of always claiming "disk-cache" (#955).
|
|
430
|
+
source: { write: (record) => (typeof record?.source === "string" ? record.source : null) },
|
|
431
|
+
},
|
|
432
|
+
windowKeys: ["primary_window", "secondary_window", "tertiary_window"],
|
|
433
|
+
// tertiary_window is written only when present and read back only when it
|
|
434
|
+
// survives — primary/secondary always appear (null when dead).
|
|
435
|
+
sparseWindowKeys: ["tertiary_window"],
|
|
436
|
+
stale: "byAge",
|
|
437
|
+
freshTtlMs: QODER_LIMITS_CACHE_FRESH_TTL_MS,
|
|
438
|
+
cachedFlag: true,
|
|
439
|
+
source: "provenance",
|
|
440
|
+
});
|
|
415
441
|
|
|
416
|
-
function
|
|
417
|
-
|
|
418
|
-
const resetAtMs = Date.parse(window.reset_at || "");
|
|
419
|
-
if (Number.isFinite(resetAtMs)) return resetAtMs > nowMs ? window : null;
|
|
420
|
-
return nowMs - cachedAtMs <= QODER_LIMITS_CACHE_UNKNOWN_RESET_TTL_MS ? window : null;
|
|
442
|
+
function qoderLimitsCachePath({ home = os.homedir(), namespace } = {}) {
|
|
443
|
+
return qoderLimitsCache.path({ home, namespace });
|
|
421
444
|
}
|
|
422
445
|
|
|
423
446
|
function readQoderLimitsCache({
|
|
@@ -425,44 +448,7 @@ function readQoderLimitsCache({
|
|
|
425
448
|
nowMs = Date.now(),
|
|
426
449
|
namespace,
|
|
427
450
|
} = {}) {
|
|
428
|
-
|
|
429
|
-
const raw = JSON.parse(fs.readFileSync(qoderLimitsCachePath({ home, namespace }), "utf8"))?.qoder;
|
|
430
|
-
const cachedAtMs = Date.parse(raw?.cached_at || "");
|
|
431
|
-
if (!Number.isFinite(cachedAtMs) || cachedAtMs > nowMs + 60_000) return null;
|
|
432
|
-
const primaryWindow = qoderCachedWindow(raw.primary_window, { cachedAtMs, nowMs });
|
|
433
|
-
const secondaryWindow = qoderCachedWindow(raw.secondary_window, { cachedAtMs, nowMs });
|
|
434
|
-
const tertiaryWindow = qoderCachedWindow(raw.tertiary_window, { cachedAtMs, nowMs });
|
|
435
|
-
if (!primaryWindow && !secondaryWindow && !tertiaryWindow) return null;
|
|
436
|
-
const hasUnexpiredDatedWindow = [primaryWindow, secondaryWindow, tertiaryWindow]
|
|
437
|
-
.some((window) => Number.isFinite(Date.parse(window?.reset_at || "")));
|
|
438
|
-
if (nowMs - cachedAtMs > QODER_LIMITS_CACHE_MAX_AGE_MS && !hasUnexpiredDatedWindow) {
|
|
439
|
-
return null;
|
|
440
|
-
}
|
|
441
|
-
// Provenance must describe the data's age, not the transport (#955): a
|
|
442
|
-
// successful refresh writes this cache and immediately floors later log
|
|
443
|
-
// scans, so the next refresh re-serves the same payload. Marking every
|
|
444
|
-
// hit stale/disk-cache made the Limits page permanently partial.
|
|
445
|
-
const ageMs = nowMs - cachedAtMs;
|
|
446
|
-
const fresh = ageMs <= QODER_LIMITS_CACHE_FRESH_TTL_MS;
|
|
447
|
-
const writtenSource = typeof raw.source === "string" && raw.source.trim()
|
|
448
|
-
? raw.source.trim()
|
|
449
|
-
: null;
|
|
450
|
-
return {
|
|
451
|
-
configured: true,
|
|
452
|
-
error: null,
|
|
453
|
-
plan_label: typeof raw.plan_label === "string" ? raw.plan_label : null,
|
|
454
|
-
quota_exceeded: raw.quota_exceeded === true,
|
|
455
|
-
primary_window: primaryWindow,
|
|
456
|
-
secondary_window: secondaryWindow,
|
|
457
|
-
...(tertiaryWindow ? { tertiary_window: tertiaryWindow } : {}),
|
|
458
|
-
cached: true,
|
|
459
|
-
stale: !fresh,
|
|
460
|
-
cached_at: raw.cached_at,
|
|
461
|
-
source: fresh && writtenSource ? writtenSource : "disk-cache",
|
|
462
|
-
};
|
|
463
|
-
} catch (_error) {
|
|
464
|
-
return null;
|
|
465
|
-
}
|
|
451
|
+
return qoderLimitsCache.read({ home, nowMs, namespace });
|
|
466
452
|
}
|
|
467
453
|
|
|
468
454
|
function writeQoderLimitsCache(limits, {
|
|
@@ -470,27 +456,7 @@ function writeQoderLimitsCache(limits, {
|
|
|
470
456
|
nowMs = Date.now(),
|
|
471
457
|
namespace,
|
|
472
458
|
} = {}) {
|
|
473
|
-
|
|
474
|
-
const cachePath = qoderLimitsCachePath({ home, namespace });
|
|
475
|
-
const payload = {
|
|
476
|
-
qoder: {
|
|
477
|
-
plan_label: limits.plan_label || null,
|
|
478
|
-
quota_exceeded: limits.quota_exceeded === true,
|
|
479
|
-
primary_window: limits.primary_window || null,
|
|
480
|
-
secondary_window: limits.secondary_window || null,
|
|
481
|
-
...(limits.tertiary_window ? { tertiary_window: limits.tertiary_window } : {}),
|
|
482
|
-
// Remember the winning source so a fresh re-serve keeps honest
|
|
483
|
-
// provenance instead of always claiming "disk-cache" (#955).
|
|
484
|
-
source: typeof limits.source === "string" ? limits.source : null,
|
|
485
|
-
cached_at: new Date(nowMs).toISOString(),
|
|
486
|
-
},
|
|
487
|
-
};
|
|
488
|
-
try {
|
|
489
|
-
fs.mkdirSync(path.dirname(cachePath), { recursive: true });
|
|
490
|
-
const tmpPath = `${cachePath}.${process.pid}.tmp`;
|
|
491
|
-
fs.writeFileSync(tmpPath, JSON.stringify(payload, null, 2), { encoding: "utf8", mode: 0o600 });
|
|
492
|
-
fs.renameSync(tmpPath, cachePath);
|
|
493
|
-
} catch (_error) {}
|
|
459
|
+
qoderLimitsCache.write(limits, { home, nowMs, namespace });
|
|
494
460
|
}
|
|
495
461
|
|
|
496
462
|
function buildQoderActivityHeaders(authStatus, {
|
|
@@ -95,7 +95,10 @@ const {
|
|
|
95
95
|
// v27 adds oh-my-pi (omp) sessions from ~/.omp/agent/sessions/**/*.jsonl.
|
|
96
96
|
// v28 records per-minute usage buckets for Claude and Grok, so date ranges
|
|
97
97
|
// recompute in-range tokens/cost instead of falling back to lifetime totals.
|
|
98
|
-
|
|
98
|
+
// v29 adds DSH request timing and first-response samples from step/stream metadata.
|
|
99
|
+
// v30 drops DSH v1 failed-finish chunks (error/aborted) from request samples.
|
|
100
|
+
// v29 cached those retries as clean timings; unchanged logs must be rebuilt.
|
|
101
|
+
const SIDECAR_VERSION = 30;
|
|
99
102
|
// Invalidate only Codex token summaries; other sources keep their cached rows.
|
|
100
103
|
const CODEX_USAGE_VERSION = 1;
|
|
101
104
|
const EDIT_TOOLS = new Set([
|
|
@@ -228,10 +228,25 @@ function createZcodePerformanceCollector() {
|
|
|
228
228
|
return { consumeUsage, finish: totals.finish };
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
+
function createDshPerformanceCollector() {
|
|
232
|
+
const totals = accumulator();
|
|
233
|
+
function consumeUsage({ model, outputTokens, start, end, firstToken } = {}) {
|
|
234
|
+
// Step boundaries surround model work, before tool execution. Retry and
|
|
235
|
+
// interrupted steps are filtered by the transcript reader.
|
|
236
|
+
if (!Number.isFinite(start) || !Number.isFinite(end) || end < start || end - start > MAX_DURATION_MS) return;
|
|
237
|
+
totals.request(model, outputTokens, start, end);
|
|
238
|
+
if (Number.isFinite(firstToken) && firstToken >= start && firstToken <= end) {
|
|
239
|
+
totals.add(model, { first_response_total_ms: firstToken - start, first_response_sample_count: 1 });
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return { consumeUsage, finish: totals.finish };
|
|
243
|
+
}
|
|
244
|
+
|
|
231
245
|
module.exports = {
|
|
232
246
|
normalizePerformance,
|
|
233
247
|
mergePerformance,
|
|
234
248
|
createClaudePerformanceCollector,
|
|
235
249
|
createCodexPerformanceCollector,
|
|
236
250
|
createZcodePerformanceCollector,
|
|
251
|
+
createDshPerformanceCollector,
|
|
237
252
|
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as n,J as a}from"./__vite-browser-external-CkF0pdTJ.js";import{u as p}from"./DialogTitle-B0cNIo0E.js";import{u as c}from"./composite-BHisG82k.js";const x=n.forwardRef(function(e,r){const{render:l,className:u,style:m,id:s,...t}=e,i=p(),o=c(s);return i.useSyncedValueWithCleanup("descriptionElementId",o),a("p",e,{ref:r,props:[{id:o},t]})});export{x as D};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as o}from"./__vite-browser-external-CkF0pdTJ.js";import{h as r,i as t,p as s}from"./react-BY0y0K4x.js";function i(){!r.current&&t();const[e]=o.useState(s.current);return e}export{i as u};
|