@laoyuehanni/dsh-token-usage 0.4.4-rc.1 → 0.4.6
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/lib/client/CostDeltaFlyLabel.js +1 -1
- package/lib/client/CostDeltaFlyLabel.js.map +1 -1
- package/lib/client/CostPill.d.ts +74 -0
- package/lib/client/CostPill.d.ts.map +1 -0
- package/lib/client/CostPill.js +242 -0
- package/lib/client/CostPill.js.map +1 -0
- package/lib/client/cost-inflate-motion.d.ts +7 -2
- package/lib/client/cost-inflate-motion.d.ts.map +1 -1
- package/lib/client/cost-inflate-motion.js +14 -10
- package/lib/client/cost-inflate-motion.js.map +1 -1
- package/lib/client/format.d.ts +7 -5
- package/lib/client/format.d.ts.map +1 -1
- package/lib/client/format.js +11 -7
- package/lib/client/format.js.map +1 -1
- package/lib/client/index.d.ts.map +1 -1
- package/lib/client/index.js +17 -22
- package/lib/client/index.js.map +1 -1
- package/lib/client/locales.d.ts +12 -3
- package/lib/client/locales.d.ts.map +1 -1
- package/lib/client/locales.js +24 -6
- package/lib/client/locales.js.map +1 -1
- package/lib/client/use-cost-inflate.d.ts +4 -4
- package/lib/client/use-cost-inflate.js +5 -5
- package/lib/client/use-cost-inflate.js.map +1 -1
- package/lib/client.js +1188 -935
- package/lib/client.js.map +1 -1
- package/locale/en.json +3 -0
- package/locale/zh.json +6 -0
- package/package.json +33 -31
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useLayoutEffect, useRef } from 'react';
|
|
3
3
|
import { runDeltaFly } from "./cost-inflate-motion.js";
|
|
4
|
-
import styles from './
|
|
4
|
+
import styles from './CostPill.module.css';
|
|
5
5
|
/** One +Δ fly label; animation starts on mount via WAAPI. */
|
|
6
6
|
export function CostDeltaFlyLabel({ text, vars }) {
|
|
7
7
|
const ref = useRef(null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CostDeltaFlyLabel.js","sourceRoot":"","sources":["../../src/client/CostDeltaFlyLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,MAAM,MAAM
|
|
1
|
+
{"version":3,"file":"CostDeltaFlyLabel.js","sourceRoot":"","sources":["../../src/client/CostDeltaFlyLabel.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAEtD,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAE1C,6DAA6D;AAC7D,MAAM,UAAU,iBAAiB,CAAC,EAAE,IAAI,EAAE,IAAI,EAA2C;IACvF,MAAM,GAAG,GAAG,MAAM,CAAkB,IAAI,CAAC,CAAA;IAEzC,eAAe,CAAC,GAAG,EAAE;QACnB,MAAM,EAAE,GAAG,GAAG,CAAC,OAAO,CAAA;QACtB,IAAI,EAAE,KAAK,IAAI;YAAE,OAAM;QACvB,MAAM,IAAI,GAAG,WAAW,CAAC,EAAE,EAAE,IAAI,CAAC,CAAA;QAClC,IAAI,IAAI,KAAK,IAAI,EAAE,CAAC;YAClB,sEAAsE;YACtE,qEAAqE;YACrE,mDAAmD;YACnD,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,QAAQ,CAAA;YAC9B,OAAM;QACR,CAAC;QACD,OAAO,GAAG,EAAE,GAAG,IAAI,CAAC,MAAM,EAAE,CAAA,CAAC,CAAC,CAAA;IAChC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IAEV,OAAO,CACL,eAAM,GAAG,EAAE,GAAG,EAAE,SAAS,EAAE,MAAM,CAAC,UAAU,CAAC,YAC1C,IAAI,GACA,CACR,CAAA;AACH,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composer-dock usage pill (browser half): a cost trigger registered into
|
|
3
|
+
* the `conversation.composer.dock` slot (`order: 10`, after the official
|
|
4
|
+
* stats pills at `order: 0`), rendered as one capsule in the official
|
|
5
|
+
* StatsPills skin. The figure is the WITH-SUBAGENTS fold — the one number
|
|
6
|
+
* no official surface carries — suffixed with a quiet "with subagents"
|
|
7
|
+
* badge only when the scope actually spans a subtree; a solo session's
|
|
8
|
+
* cost renders bare, same scope as the official pills beside it.
|
|
9
|
+
*
|
|
10
|
+
* Clicking opens a detail panel (harness menu chrome, upward of the dock)
|
|
11
|
+
* that explains the total: the folded token figure and cache-hit rate next
|
|
12
|
+
* to it (official pills carry only the single-session token count, so the
|
|
13
|
+
* subtree share has no home but here), the session / subagents split, and
|
|
14
|
+
* a per-model breakdown with the unpriced-models footnote. Panel data is
|
|
15
|
+
* LAZY: the trigger polls `fields=chip` (totals only, subtree scope); the
|
|
16
|
+
* two richer reads (`fields=session` for byModel, a solo-session `chip`
|
|
17
|
+
* read for the split) fire when the panel first opens and again whenever
|
|
18
|
+
* request churn debounces through.
|
|
19
|
+
*
|
|
20
|
+
* The pill refreshes at REQUEST granularity (the header chip's former
|
|
21
|
+
* cadence, inherited whole): `sessionStats` projection churn plus mirror
|
|
22
|
+
* `updatedAt` is debounced 250 ms into one fetch, a failed FIRST fetch
|
|
23
|
+
* retries itself on a 3 s cadence, and later failures keep the prior
|
|
24
|
+
* figures. When cost rises on a new request the figure plays `costPop`
|
|
25
|
+
* and a +Δ label FALLS below the pill (the dock sits under the composer;
|
|
26
|
+
* the header chip's upward rise would climb into the message scrollport).
|
|
27
|
+
* Reduced-motion users get silent figure updates.
|
|
28
|
+
*
|
|
29
|
+
* Visibility contract: a session with no recorded requests renders
|
|
30
|
+
* nothing; a transient fetch miss keeps the previous render.
|
|
31
|
+
*
|
|
32
|
+
* @module token-usage/client/CostPill
|
|
33
|
+
*/
|
|
34
|
+
import type { ReactNode } from 'react';
|
|
35
|
+
import type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots';
|
|
36
|
+
import type { UsageSummary } from '../wire.ts';
|
|
37
|
+
/** Self-heal cadence after a failed first fetch: refresh failures after the
|
|
38
|
+
* first land keep the prior figures (silent mode) and self-heal on the next
|
|
39
|
+
* request churn, so they never reach the error state. */
|
|
40
|
+
export declare const FETCH_FAILURE_RETRY_MS = 3000;
|
|
41
|
+
/** Props the pill binds for the composer-dock slot: the framework's session
|
|
42
|
+
* kit (`sessionId` + the global `useSessions` mirror used to walk the
|
|
43
|
+
* subagent tree) plus the locale seat from the registration's `locale:`
|
|
44
|
+
* declaration. The dock slot declares no owner share. */
|
|
45
|
+
export type CostPillProps = PropsRuntime<'conversation.composer.dock'> & PropsLocale<'token-usage'>;
|
|
46
|
+
/**
|
|
47
|
+
* The session / subagents split of one folded summary. Subagent figures are
|
|
48
|
+
* derived by subtraction (folded minus solo) and clamped at zero — a stale
|
|
49
|
+
* solo read against a fresher fold must never paint a negative share.
|
|
50
|
+
*/
|
|
51
|
+
export interface UsageSplit {
|
|
52
|
+
selfCost: number;
|
|
53
|
+
subsCost: number;
|
|
54
|
+
selfTokens: number;
|
|
55
|
+
subsTokens: number;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Subtract a solo-session summary from its subtree fold.
|
|
59
|
+
* @param tree - the subtree-scoped folded summary.
|
|
60
|
+
* @param self - the solo-session summary (same session, no children).
|
|
61
|
+
* @returns the two shares; costs and tokens are additive so subtraction is
|
|
62
|
+
* exact, and the hit rate is NEVER split (a ratio is not subtractable — the
|
|
63
|
+
* panel recomputes the folded rate from the tree totals instead).
|
|
64
|
+
*/
|
|
65
|
+
export declare function splitUsage(tree: UsageSummary, self: UsageSummary): UsageSplit;
|
|
66
|
+
/**
|
|
67
|
+
* Render the composer-dock usage pill for the active session. Renders
|
|
68
|
+
* nothing when the session has no recorded usage or while the first fetch
|
|
69
|
+
* is in flight — the "data has no value, the block does not render" rule.
|
|
70
|
+
* @param props - framework session id, the session-list mirror, and the locale seat.
|
|
71
|
+
* @returns the pill (plus its open detail panel), or null when empty/unavailable.
|
|
72
|
+
*/
|
|
73
|
+
export declare function CostPill({ sessionId, useSessions, useProjection, t }: CostPillProps): ReactNode | null;
|
|
74
|
+
//# sourceMappingURL=CostPill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CostPill.d.ts","sourceRoot":"","sources":["../../src/client/CostPill.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAGH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACtC,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAQjF,OAAO,KAAK,EAAkB,YAAY,EAAE,MAAM,YAAY,CAAA;AAe9D;;yDAEyD;AACzD,eAAO,MAAM,sBAAsB,OAAQ,CAAA;AAM3C;;;yDAGyD;AACzD,MAAM,MAAM,aAAa,GACvB,YAAY,CAAC,4BAA4B,CAAC,GACxC,WAAW,CAAC,aAAa,CAAC,CAAA;AAE9B;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;CACnB;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,YAAY,GAAG,UAAU,CAQ7E;AAED;;;;;;GAMG;AACH,wBAAgB,QAAQ,CAAC,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,aAAa,GAAG,SAAS,GAAG,IAAI,CA8NtG"}
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* Composer-dock usage pill (browser half): a cost trigger registered into
|
|
4
|
+
* the `conversation.composer.dock` slot (`order: 10`, after the official
|
|
5
|
+
* stats pills at `order: 0`), rendered as one capsule in the official
|
|
6
|
+
* StatsPills skin. The figure is the WITH-SUBAGENTS fold — the one number
|
|
7
|
+
* no official surface carries — suffixed with a quiet "with subagents"
|
|
8
|
+
* badge only when the scope actually spans a subtree; a solo session's
|
|
9
|
+
* cost renders bare, same scope as the official pills beside it.
|
|
10
|
+
*
|
|
11
|
+
* Clicking opens a detail panel (harness menu chrome, upward of the dock)
|
|
12
|
+
* that explains the total: the folded token figure and cache-hit rate next
|
|
13
|
+
* to it (official pills carry only the single-session token count, so the
|
|
14
|
+
* subtree share has no home but here), the session / subagents split, and
|
|
15
|
+
* a per-model breakdown with the unpriced-models footnote. Panel data is
|
|
16
|
+
* LAZY: the trigger polls `fields=chip` (totals only, subtree scope); the
|
|
17
|
+
* two richer reads (`fields=session` for byModel, a solo-session `chip`
|
|
18
|
+
* read for the split) fire when the panel first opens and again whenever
|
|
19
|
+
* request churn debounces through.
|
|
20
|
+
*
|
|
21
|
+
* The pill refreshes at REQUEST granularity (the header chip's former
|
|
22
|
+
* cadence, inherited whole): `sessionStats` projection churn plus mirror
|
|
23
|
+
* `updatedAt` is debounced 250 ms into one fetch, a failed FIRST fetch
|
|
24
|
+
* retries itself on a 3 s cadence, and later failures keep the prior
|
|
25
|
+
* figures. When cost rises on a new request the figure plays `costPop`
|
|
26
|
+
* and a +Δ label FALLS below the pill (the dock sits under the composer;
|
|
27
|
+
* the header chip's upward rise would climb into the message scrollport).
|
|
28
|
+
* Reduced-motion users get silent figure updates.
|
|
29
|
+
*
|
|
30
|
+
* Visibility contract: a session with no recorded requests renders
|
|
31
|
+
* nothing; a transient fetch miss keeps the previous render.
|
|
32
|
+
*
|
|
33
|
+
* @module token-usage/client/CostPill
|
|
34
|
+
*/
|
|
35
|
+
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
36
|
+
import { STATS_PATH, encodeStatsQuery } from "../wire.js";
|
|
37
|
+
import { useAsyncResource, useDebouncedValue } from "./async-resource.js";
|
|
38
|
+
import { totalTokens } from "./day.js";
|
|
39
|
+
import { currencyViewOf, formatCost, formatTokens, hitRateDisplay } from "./format.js";
|
|
40
|
+
import { buildChildIndex, buildStatsFreshnessKey, subtreeIds } from "./session-stats.js";
|
|
41
|
+
import { useColorSchemeMirror } from "./use-color-scheme.js";
|
|
42
|
+
import { CostDeltaFlyLabel } from "./CostDeltaFlyLabel.js";
|
|
43
|
+
import { useCostInflate } from "./use-cost-inflate.js";
|
|
44
|
+
import styles from './CostPill.module.css';
|
|
45
|
+
/** Refresh debounce: bursts of session-mirror updates (one request's events)
|
|
46
|
+
* collapse into a single fetch — the header chip's request-scale cadence. */
|
|
47
|
+
const REFRESH_DEBOUNCE_MS = 250;
|
|
48
|
+
/** Self-heal cadence after a failed first fetch: refresh failures after the
|
|
49
|
+
* first land keep the prior figures (silent mode) and self-heal on the next
|
|
50
|
+
* request churn, so they never reach the error state. */
|
|
51
|
+
export const FETCH_FAILURE_RETRY_MS = 3_000;
|
|
52
|
+
/** Detail panel width (px); the viewport-clamped centering uses it. */
|
|
53
|
+
const PANEL_WIDTH = 300;
|
|
54
|
+
const PANEL_VIEWPORT_MARGIN = 16;
|
|
55
|
+
/**
|
|
56
|
+
* Subtract a solo-session summary from its subtree fold.
|
|
57
|
+
* @param tree - the subtree-scoped folded summary.
|
|
58
|
+
* @param self - the solo-session summary (same session, no children).
|
|
59
|
+
* @returns the two shares; costs and tokens are additive so subtraction is
|
|
60
|
+
* exact, and the hit rate is NEVER split (a ratio is not subtractable — the
|
|
61
|
+
* panel recomputes the folded rate from the tree totals instead).
|
|
62
|
+
*/
|
|
63
|
+
export function splitUsage(tree, self) {
|
|
64
|
+
const sub = (whole, part) => (whole - part > 0 ? whole - part : 0);
|
|
65
|
+
return {
|
|
66
|
+
selfCost: self.totalCost,
|
|
67
|
+
subsCost: sub(tree.totalCost, self.totalCost),
|
|
68
|
+
selfTokens: totalTokens(self.total),
|
|
69
|
+
subsTokens: sub(totalTokens(tree.total), totalTokens(self.total)),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Render the composer-dock usage pill for the active session. Renders
|
|
74
|
+
* nothing when the session has no recorded usage or while the first fetch
|
|
75
|
+
* is in flight — the "data has no value, the block does not render" rule.
|
|
76
|
+
* @param props - framework session id, the session-list mirror, and the locale seat.
|
|
77
|
+
* @returns the pill (plus its open detail panel), or null when empty/unavailable.
|
|
78
|
+
*/
|
|
79
|
+
export function CostPill({ sessionId, useSessions, useProjection, t }) {
|
|
80
|
+
const rootRef = useRef(null);
|
|
81
|
+
const costRef = useRef(null);
|
|
82
|
+
useColorSchemeMirror(rootRef);
|
|
83
|
+
const [open, setOpen] = useState(false);
|
|
84
|
+
// Same membership as the Usage tab's "with subagents" scope: the active
|
|
85
|
+
// session plus every origin=subagent descendant. An ordinary fork is not
|
|
86
|
+
// a subagent and does not join the fold.
|
|
87
|
+
const byId = useSessions(state => state.byId);
|
|
88
|
+
const childIndex = useMemo(() => buildChildIndex(byId), [byId]);
|
|
89
|
+
const scopeIds = useMemo(() => (sessionId === '' ? [] : subtreeIds(byId, sessionId, childIndex)), [byId, sessionId, childIndex]);
|
|
90
|
+
const hasSubs = scopeIds.length > 1;
|
|
91
|
+
const liveStats = useProjection('sessionStats');
|
|
92
|
+
const freshnessKey = buildStatsFreshnessKey(scopeIds, {
|
|
93
|
+
activeSessionId: sessionId,
|
|
94
|
+
rows: byId,
|
|
95
|
+
liveSessionStats: liveStats,
|
|
96
|
+
});
|
|
97
|
+
const requestKey = `${scopeIds.join('\n')}\n\t${freshnessKey}`;
|
|
98
|
+
const debouncedKey = useDebouncedValue(requestKey, REFRESH_DEBOUNCE_MS);
|
|
99
|
+
const scopeResetKey = scopeIds.join('\n');
|
|
100
|
+
const { flies, onSummary } = useCostInflate(scopeResetKey, costRef);
|
|
101
|
+
// The trigger's poll: subtree totals only (`fields=chip`), the lightest
|
|
102
|
+
// read that feeds cost / tokens / hit rate.
|
|
103
|
+
const [treeRes, retryTree] = useAsyncResource(signal => {
|
|
104
|
+
const [idsPart] = debouncedKey.split('\n\t');
|
|
105
|
+
const ids = (idsPart ?? '').split('\n').filter(id => id !== '');
|
|
106
|
+
return fetchSummary(ids, 'chip', signal);
|
|
107
|
+
}, [debouncedKey], { silentAfterFirst: true, retryToken: 0 });
|
|
108
|
+
const summary = treeRes.status === 'ready' ? treeRes.value : null;
|
|
109
|
+
useEffect(() => {
|
|
110
|
+
if (summary !== null)
|
|
111
|
+
onSummary(summary);
|
|
112
|
+
}, [summary, onSummary]);
|
|
113
|
+
// A failed first fetch renders nothing and self-heals on the retry
|
|
114
|
+
// cadence; later failures keep the prior render (silent mode).
|
|
115
|
+
useEffect(() => {
|
|
116
|
+
if (treeRes.status !== 'error')
|
|
117
|
+
return;
|
|
118
|
+
const timer = window.setTimeout(retryTree, FETCH_FAILURE_RETRY_MS);
|
|
119
|
+
return () => { window.clearTimeout(timer); };
|
|
120
|
+
}, [treeRes, retryTree]);
|
|
121
|
+
// Panel reads, LAZY: nothing flies while the panel is closed. The detail
|
|
122
|
+
// read (`fields=session`) carries byModel; the solo read splits the fold.
|
|
123
|
+
// Both re-fire when request churn debounces through while open.
|
|
124
|
+
const [detailRes] = useAsyncResource(signal => {
|
|
125
|
+
if (!open)
|
|
126
|
+
return Promise.resolve(null);
|
|
127
|
+
const [idsPart] = debouncedKey.split('\n\t');
|
|
128
|
+
const ids = (idsPart ?? '').split('\n').filter(id => id !== '');
|
|
129
|
+
return fetchSummary(ids, 'session', signal);
|
|
130
|
+
}, [open, debouncedKey], { silentAfterFirst: true, retryToken: 0 });
|
|
131
|
+
const [selfRes] = useAsyncResource(signal => {
|
|
132
|
+
if (!open || sessionId === '')
|
|
133
|
+
return Promise.resolve(null);
|
|
134
|
+
return fetchSummary([sessionId], 'chip', signal);
|
|
135
|
+
}, [open, sessionId, debouncedKey], { silentAfterFirst: true, retryToken: 0 });
|
|
136
|
+
// Session switches close the panel — the split it explains no longer holds.
|
|
137
|
+
useEffect(() => {
|
|
138
|
+
setOpen(false);
|
|
139
|
+
}, [sessionId]);
|
|
140
|
+
// Outside pointer / Escape close — the harness popup pattern (ContextMeter
|
|
141
|
+
// and the quota button share it), anchored while open.
|
|
142
|
+
useEffect(() => {
|
|
143
|
+
if (!open)
|
|
144
|
+
return;
|
|
145
|
+
const onPointerDown = (event) => {
|
|
146
|
+
if (event.target instanceof Node && rootRef.current?.contains(event.target) === true)
|
|
147
|
+
return;
|
|
148
|
+
setOpen(false);
|
|
149
|
+
};
|
|
150
|
+
const onKeyDown = (event) => {
|
|
151
|
+
if (event.key === 'Escape')
|
|
152
|
+
setOpen(false);
|
|
153
|
+
};
|
|
154
|
+
document.addEventListener('pointerdown', onPointerDown);
|
|
155
|
+
document.addEventListener('keydown', onKeyDown);
|
|
156
|
+
return () => {
|
|
157
|
+
document.removeEventListener('pointerdown', onPointerDown);
|
|
158
|
+
document.removeEventListener('keydown', onKeyDown);
|
|
159
|
+
};
|
|
160
|
+
}, [open]);
|
|
161
|
+
// Center the panel on the pill, clamped to the viewport's margins (the
|
|
162
|
+
// dock row is full-width, but a bare left:0 could still skew off-screen
|
|
163
|
+
// on narrow windows). Measured at open, refreshed on resize while open.
|
|
164
|
+
const [panelLeft, setPanelLeft] = useState(undefined);
|
|
165
|
+
const measurePanelLeft = useCallback(() => {
|
|
166
|
+
const wrapper = rootRef.current;
|
|
167
|
+
if (wrapper === null)
|
|
168
|
+
return;
|
|
169
|
+
const { left: wrapperLeft, width: wrapperWidth } = wrapper.getBoundingClientRect();
|
|
170
|
+
const panelWidth = Math.min(PANEL_WIDTH, window.innerWidth - 2 * PANEL_VIEWPORT_MARGIN);
|
|
171
|
+
const desired = (wrapperWidth - panelWidth) / 2;
|
|
172
|
+
const minLeft = PANEL_VIEWPORT_MARGIN - wrapperLeft;
|
|
173
|
+
const maxLeft = window.innerWidth - PANEL_VIEWPORT_MARGIN - panelWidth - wrapperLeft;
|
|
174
|
+
setPanelLeft(Math.min(Math.max(desired, minLeft), Math.max(minLeft, maxLeft)));
|
|
175
|
+
}, []);
|
|
176
|
+
useEffect(() => {
|
|
177
|
+
if (!open)
|
|
178
|
+
return;
|
|
179
|
+
measurePanelLeft();
|
|
180
|
+
window.addEventListener('resize', measurePanelLeft);
|
|
181
|
+
return () => { window.removeEventListener('resize', measurePanelLeft); };
|
|
182
|
+
}, [open, measurePanelLeft]);
|
|
183
|
+
if (summary === null || summary.total.requests === 0)
|
|
184
|
+
return null;
|
|
185
|
+
const view = currencyViewOf(summary);
|
|
186
|
+
const costText = formatCost(summary.totalCost, view);
|
|
187
|
+
const tokensValue = formatTokens(totalTokens(summary.total));
|
|
188
|
+
const hit = hitRateDisplay(summary.total);
|
|
189
|
+
const ariaLabel = hasSubs
|
|
190
|
+
? t('pill.costWithSubs', { value: costText })
|
|
191
|
+
: t('pill.cost', { value: costText });
|
|
192
|
+
// Panel shares: the split waits on the solo read; per-model waits on the
|
|
193
|
+
// detail read. While either is in flight its block shows a quiet ellipsis.
|
|
194
|
+
const selfSummary = selfRes.status === 'ready' ? selfRes.value : null;
|
|
195
|
+
const detail = detailRes.status === 'ready' ? detailRes.value : null;
|
|
196
|
+
const split = selfSummary !== null ? splitUsage(summary, selfSummary) : null;
|
|
197
|
+
const subCount = scopeIds.length - 1;
|
|
198
|
+
return (_jsxs("span", { ref: rootRef, className: styles.root, children: [_jsxs("button", { type: "button", className: styles.pill, "aria-haspopup": "dialog", "aria-expanded": open, "aria-label": `${ariaLabel},${t('panel.openHint')}`, onClick: () => { setOpen(!open); }, children: [_jsxs("svg", { className: styles.glyph, viewBox: "0 0 14 14", width: "14", height: "14", "aria-hidden": true, children: [_jsx("circle", { cx: "7", cy: "7", r: "5.5", fill: "none", stroke: "currentColor", strokeWidth: "1.2" }), _jsx("path", { d: "M4.8 4.5 L7 7.2 L9.2 4.5 M7 7.2 V10 M5.2 8 H8.8 M5.2 9.4 H8.8", fill: "none", stroke: "currentColor", strokeWidth: "1.2" })] }), _jsx("span", { ref: costRef, className: styles.cost, children: costText }), _jsx("span", { className: styles.deltaLayer, "aria-hidden": "true", children: flies.map(fly => (_jsx(CostDeltaFlyLabel, { text: fly.text, vars: fly.vars }, fly.id))) })] }), open && (_jsxs("span", { className: styles.panel, role: "dialog", "aria-label": t('panel.title'), style: { left: panelLeft }, children: [_jsxs("span", { className: styles.panelHead, children: [_jsxs("span", { className: styles.panelTitle, children: [t('panel.title'), hasSubs && _jsx("span", { className: styles.scopeTag, children: t('pill.scopeTag') })] }), _jsx("span", { className: styles.panelTotal, children: costText })] }), _jsxs("span", { className: styles.usageLine, children: [_jsx("span", { children: t('panel.tokens', { value: tokensValue }) }), _jsx("span", { className: styles.dot, children: "\u00B7" }), _jsx("span", { children: t('panel.hitRate', { value: hit.text }) })] }), _jsxs("span", { className: styles.rows, children: [_jsxs("span", { className: styles.row, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.self') }), _jsx("span", { className: styles.rowValue, children: split === null
|
|
199
|
+
? _jsx("span", { className: styles.pending, children: "\u2026" })
|
|
200
|
+
: _jsxs(_Fragment, { children: [formatCost(split.selfCost, view), _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.selfTokens) }) })] }) })] }), hasSubs && (_jsxs("span", { className: `${styles.row} ${styles.rowSub}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.subs', { count: subCount }) }), _jsx("span", { className: styles.rowValue, children: split === null
|
|
201
|
+
? _jsx("span", { className: styles.pending, children: "\u2026" })
|
|
202
|
+
: _jsxs(_Fragment, { children: [formatCost(split.subsCost, view), _jsx("span", { className: styles.tok, children: t('panel.tokens', { value: formatTokens(split.subsTokens) }) })] }) })] }))] }), _jsx("span", { className: styles.groupLabel, children: t('panel.byModel') }), _jsx("span", { className: styles.rows, children: detail === null
|
|
203
|
+
? (_jsx("span", { className: styles.row, children: _jsx("span", { className: styles.pending, children: "\u2026" }) }))
|
|
204
|
+
: (_jsxs(_Fragment, { children: [detail.byModel.map(row => (_jsx(ModelRow, { row: row, view: view }, row.model))), detail.unpricedModels.length > 0 && (_jsxs("span", { className: `${styles.row} ${styles.unpriced}`, children: [_jsx("span", { className: styles.rowLabel, children: t('panel.unpriced', { count: detail.unpricedModels.length }) }), _jsx("span", { className: styles.rowValue, children: t('panel.unpricedNote') })] }))] })) })] }))] }));
|
|
205
|
+
}
|
|
206
|
+
/** One per-model breakdown row: model id + request count, billed cost, tokens. */
|
|
207
|
+
function ModelRow({ row, view }) {
|
|
208
|
+
return (_jsxs("span", { className: styles.row, children: [_jsxs("span", { className: styles.rowLabel, children: [row.model, _jsxs("span", { className: styles.requests, children: ["\u00D7 ", row.totals.requests] })] }), _jsxs("span", { className: styles.rowValue, children: [formatCost(row.cost, view), _jsx("span", { className: styles.tok, children: formatTokens(totalTokens(row.totals)) })] })] }));
|
|
209
|
+
}
|
|
210
|
+
/** Defensive shape check: an older host build or a misrouted response
|
|
211
|
+
* would otherwise paint the pill with garbage. */
|
|
212
|
+
function looksLikeUsageSummary(value) {
|
|
213
|
+
return typeof value === 'object' && value !== null
|
|
214
|
+
&& typeof value.total === 'object'
|
|
215
|
+
&& value.total !== null;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Fetch one stats summary. Throws on transport failure (network, abort,
|
|
219
|
+
* non-2xx response, or a payload that doesn't look like a stats summary) so
|
|
220
|
+
* the hook can keep the previous render in place.
|
|
221
|
+
* @param sessionIds - the scope's session ids; an empty list skips the
|
|
222
|
+
* fetch (returning null rather than throwing, so the hook's first-load
|
|
223
|
+
* gate stays at "loading").
|
|
224
|
+
* @param fields - `chip` for totals-only reads, `session` when byModel is
|
|
225
|
+
* needed (the detail panel's per-model block).
|
|
226
|
+
* @param signal - the cancellation signal from the hook.
|
|
227
|
+
*/
|
|
228
|
+
async function fetchSummary(sessionIds, fields, signal) {
|
|
229
|
+
if (sessionIds.length === 0)
|
|
230
|
+
return null;
|
|
231
|
+
const response = await fetch(STATS_PATH + encodeStatsQuery({ sessionIds, fields }), {
|
|
232
|
+
headers: { accept: 'application/json' },
|
|
233
|
+
signal,
|
|
234
|
+
});
|
|
235
|
+
if (!response.ok)
|
|
236
|
+
throw new Error(`HTTP ${String(response.status)}`);
|
|
237
|
+
const value = await response.json();
|
|
238
|
+
if (!looksLikeUsageSummary(value))
|
|
239
|
+
throw new Error('unexpected stats response');
|
|
240
|
+
return value;
|
|
241
|
+
}
|
|
242
|
+
//# sourceMappingURL=CostPill.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CostPill.js","sourceRoot":"","sources":["../../src/client/CostPill.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAWzE,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AACzD,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACzE,OAAO,EAAE,WAAW,EAAE,MAAM,UAAU,CAAA;AACtC,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACtF,OAAO,EAAE,eAAe,EAAE,sBAAsB,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AACxF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAyB,CAAA;AAC3D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACtD,OAAO,MAAM,MAAM,uBAAuB,CAAA;AAE1C;6EAC6E;AAC7E,MAAM,mBAAmB,GAAG,GAAG,CAAA;AAE/B;;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AE,MAAM,EAAE,kBAAkB,EAAE;QACvC,MAAM;KACP,CAAC,CAAA;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE;QAAE,MAAM,IAAI,KAAK,CAAC,QAAQ,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE,CAAC,CAAA;IACpE,MAAM,KAAK,GAAY,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAA;IAC5C,IAAI,CAAC,qBAAqB,CAAC,KAAK,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAA;IAC/E,OAAO,KAAK,CAAA;AACd,CAAC"}
|
|
@@ -10,8 +10,13 @@ import type { CostInflateVars } from './cost-inflate.ts';
|
|
|
10
10
|
* skip spawning the DOM for flies that would never animate — a static +Δ
|
|
11
11
|
* flash reads as a glitch, not information. */
|
|
12
12
|
export declare function motionAllowed(): boolean;
|
|
13
|
-
/** Scale bounce on the cost figure (`costPop`).
|
|
13
|
+
/** Scale bounce on the cost figure (`costPop`). The mix base is the pill's
|
|
14
|
+
* resting tertiary (NOT label-primary): the pill reads tertiary beside the
|
|
15
|
+
* official pills, and a primary-tinted final frame would leave the figure
|
|
16
|
+
* permanently highlighted after the animation's fill. */
|
|
14
17
|
export declare function runCostPop(el: HTMLElement, v: CostInflateVars): Animation | null;
|
|
15
|
-
/** +Δ label
|
|
18
|
+
/** +Δ label fall (`deltaFall`). Caller must position the element (absolute,
|
|
19
|
+
* below the pill — the dock sits under the composer, so the label falls
|
|
20
|
+
* away from the message scrollport rather than climbing into it). */
|
|
16
21
|
export declare function runDeltaFly(el: HTMLElement, v: CostInflateVars): Animation | null;
|
|
17
22
|
//# sourceMappingURL=cost-inflate-motion.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost-inflate-motion.d.ts","sourceRoot":"","sources":["../../src/client/cost-inflate-motion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;+CAG+C;AAC/C,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAMD
|
|
1
|
+
{"version":3,"file":"cost-inflate-motion.d.ts","sourceRoot":"","sources":["../../src/client/cost-inflate-motion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAA;AAExD;;;+CAG+C;AAC/C,wBAAgB,aAAa,IAAI,OAAO,CAGvC;AAMD;;;yDAGyD;AACzD,wBAAgB,UAAU,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAsBhF;AAED;;qEAEqE;AACrE,wBAAgB,WAAW,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,EAAE,eAAe,GAAG,SAAS,GAAG,IAAI,CAcjF"}
|
|
@@ -15,7 +15,10 @@ export function motionAllowed() {
|
|
|
15
15
|
function waapiAvailable(el) {
|
|
16
16
|
return typeof el.animate === 'function';
|
|
17
17
|
}
|
|
18
|
-
/** Scale bounce on the cost figure (`costPop`).
|
|
18
|
+
/** Scale bounce on the cost figure (`costPop`). The mix base is the pill's
|
|
19
|
+
* resting tertiary (NOT label-primary): the pill reads tertiary beside the
|
|
20
|
+
* official pills, and a primary-tinted final frame would leave the figure
|
|
21
|
+
* permanently highlighted after the animation's fill. */
|
|
19
22
|
export function runCostPop(el, v) {
|
|
20
23
|
if (!motionAllowed() || !waapiAvailable(el))
|
|
21
24
|
return null;
|
|
@@ -23,34 +26,35 @@ export function runCostPop(el, v) {
|
|
|
23
26
|
const echo = 1 + (popScale - 1) * 0.28;
|
|
24
27
|
const warnMix = v.warnMix;
|
|
25
28
|
return el.animate([
|
|
26
|
-
{ transform: 'scale(1)', color: 'var(--dsw-alias-label-
|
|
29
|
+
{ transform: 'scale(1)', color: 'var(--dsw-alias-label-tertiary)' },
|
|
27
30
|
{
|
|
28
31
|
transform: `scale(${String(popScale)})`,
|
|
29
|
-
color: `color-mix(in srgb, var(--dsw-alias-state-warn-primary) ${warnMix}, var(--dsw-alias-label-
|
|
32
|
+
color: `color-mix(in srgb, var(--dsw-alias-state-warn-primary) ${warnMix}, var(--dsw-alias-label-tertiary))`,
|
|
30
33
|
offset: 0.35,
|
|
31
34
|
},
|
|
32
35
|
{
|
|
33
36
|
transform: `scale(${String(echo)})`,
|
|
34
|
-
color: `color-mix(in srgb, var(--dsw-alias-state-warn-primary) ${warnMix}, var(--dsw-alias-label-
|
|
37
|
+
color: `color-mix(in srgb, var(--dsw-alias-state-warn-primary) ${warnMix}, var(--dsw-alias-label-tertiary))`,
|
|
35
38
|
offset: 0.70,
|
|
36
39
|
},
|
|
37
|
-
{ transform: 'scale(1)', color: 'var(--dsw-alias-label-
|
|
40
|
+
{ transform: 'scale(1)', color: 'var(--dsw-alias-label-tertiary)' },
|
|
38
41
|
], {
|
|
39
42
|
duration: v.inflateMs,
|
|
40
43
|
easing: 'cubic-bezier(0.25, 0.85, 0.35, 1)',
|
|
41
|
-
fill: 'both',
|
|
42
44
|
});
|
|
43
45
|
}
|
|
44
|
-
/** +Δ label
|
|
46
|
+
/** +Δ label fall (`deltaFall`). Caller must position the element (absolute,
|
|
47
|
+
* below the pill — the dock sits under the composer, so the label falls
|
|
48
|
+
* away from the message scrollport rather than climbing into it). */
|
|
45
49
|
export function runDeltaFly(el, v) {
|
|
46
50
|
if (!motionAllowed() || !waapiAvailable(el))
|
|
47
51
|
return null;
|
|
48
52
|
return el.animate([
|
|
49
|
-
{ opacity: 0, transform: 'translate(-50%,
|
|
50
|
-
{ opacity: 1, transform: 'translate(-50%,
|
|
53
|
+
{ opacity: 0, transform: 'translate(-50%, 20%)' },
|
|
54
|
+
{ opacity: 1, transform: 'translate(-50%, 20%)', offset: 0.15 },
|
|
51
55
|
{
|
|
52
56
|
opacity: 0,
|
|
53
|
-
transform: `translate(calc(-50% + ${v.flyX}), calc(
|
|
57
|
+
transform: `translate(calc(-50% + ${v.flyX}), calc(100% + ${v.flyY}))`,
|
|
54
58
|
},
|
|
55
59
|
], {
|
|
56
60
|
duration: v.inflateMs,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cost-inflate-motion.js","sourceRoot":"","sources":["../../src/client/cost-inflate-motion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;+CAG+C;AAC/C,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;WACzC,CAAC,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAA;AACrE,CAAC;AAED,SAAS,cAAc,CAAC,EAAe;IACrC,OAAO,OAAO,EAAE,CAAC,OAAO,KAAK,UAAU,CAAA;AACzC,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"cost-inflate-motion.js","sourceRoot":"","sources":["../../src/client/cost-inflate-motion.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;+CAG+C;AAC/C,MAAM,UAAU,aAAa;IAC3B,OAAO,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;WACzC,CAAC,MAAM,CAAC,UAAU,CAAC,kCAAkC,CAAC,CAAC,OAAO,CAAA;AACrE,CAAC;AAED,SAAS,cAAc,CAAC,EAAe;IACrC,OAAO,OAAO,EAAE,CAAC,OAAO,KAAK,UAAU,CAAA;AACzC,CAAC;AAED;;;yDAGyD;AACzD,MAAM,UAAU,UAAU,CAAC,EAAe,EAAE,CAAkB;IAC5D,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAA;IACxD,MAAM,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAA;IACnC,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC,QAAQ,GAAG,CAAC,CAAC,GAAG,IAAI,CAAA;IACtC,MAAM,OAAO,GAAG,CAAC,CAAC,OAAO,CAAA;IACzB,OAAO,EAAE,CAAC,OAAO,CAAC;QAChB,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,iCAAiC,EAAE;QACnE;YACE,SAAS,EAAE,SAAS,MAAM,CAAC,QAAQ,CAAC,GAAG;YACvC,KAAK,EAAE,0DAA0D,OAAO,oCAAoC;YAC5G,MAAM,EAAE,IAAI;SACb;QACD;YACE,SAAS,EAAE,SAAS,MAAM,CAAC,IAAI,CAAC,GAAG;YACnC,KAAK,EAAE,0DAA0D,OAAO,oCAAoC;YAC5G,MAAM,EAAE,IAAI;SACb;QACD,EAAE,SAAS,EAAE,UAAU,EAAE,KAAK,EAAE,iCAAiC,EAAE;KACpE,EAAE;QACD,QAAQ,EAAE,CAAC,CAAC,SAAS;QACrB,MAAM,EAAE,mCAAmC;KAC5C,CAAC,CAAA;AACJ,CAAC;AAED;;qEAEqE;AACrE,MAAM,UAAU,WAAW,CAAC,EAAe,EAAE,CAAkB;IAC7D,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAA;IACxD,OAAO,EAAE,CAAC,OAAO,CAAC;QAChB,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE;QACjD,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,EAAE,sBAAsB,EAAE,MAAM,EAAE,IAAI,EAAE;QAC/D;YACE,OAAO,EAAE,CAAC;YACV,SAAS,EAAE,yBAAyB,CAAC,CAAC,IAAI,kBAAkB,CAAC,CAAC,IAAI,IAAI;SACvE;KACF,EAAE;QACD,QAAQ,EAAE,CAAC,CAAC,SAAS;QACrB,MAAM,EAAE,mCAAmC;QAC3C,IAAI,EAAE,MAAM;KACb,CAAC,CAAA;AACJ,CAAC"}
|
package/lib/client/format.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export declare function hitRateDisplay(totals: UsageTotals): HitRateDisplay;
|
|
|
66
66
|
* divisor every wire amount (always RMB) divides by for display.
|
|
67
67
|
*/
|
|
68
68
|
export interface CurrencyView {
|
|
69
|
-
symbol: '
|
|
69
|
+
symbol: '¥' | '$';
|
|
70
70
|
/** RMB per USD; 1 in the CNY view (amounts pass through untouched). */
|
|
71
71
|
rate: number;
|
|
72
72
|
}
|
|
@@ -78,12 +78,14 @@ export interface CurrencyView {
|
|
|
78
78
|
*/
|
|
79
79
|
export declare function currencyViewOf(summary: Pick<UsageSummary, 'currency' | 'usdExchangeRate'>): CurrencyView;
|
|
80
80
|
/**
|
|
81
|
-
* Cost as display text: the view's symbol
|
|
82
|
-
*
|
|
83
|
-
*
|
|
81
|
+
* Cost as display text: two decimals plus the view's symbol SUFFIXED —
|
|
82
|
+
* `1.25¥` — matching the dock row's number-first unit idiom (`12.2M tok`,
|
|
83
|
+
* `98%`), where every reading leads with its magnitude. USD divides the
|
|
84
|
+
* wire's RMB amount by the exchange rate (`0.18$` under a rate-7 view).
|
|
85
|
+
* A cost is always shown, never omitted.
|
|
84
86
|
* @param cost - a non-negative cost in ¥ (as carried on the wire).
|
|
85
87
|
* @param view - the display currency view.
|
|
86
|
-
* @returns e.g.
|
|
88
|
+
* @returns e.g. `1.25¥`, or `0.18$` under a rate-7 USD view.
|
|
87
89
|
*/
|
|
88
90
|
export declare function formatCost(cost: number, view?: CurrencyView): string;
|
|
89
91
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/client/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,YAAY,CAAA;AAgC3D;;;;;;;;GAQG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKlD;AAQD;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,WAAW,GAAG,MAAM,CAEzD;AAED;;;;;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cAAc,CAQlE;AAED;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,MAAM,EAAE,GAAG,GAAG,GAAG,CAAA;IACjB,uEAAuE;IACvE,IAAI,EAAE,MAAM,CAAA;CACb;AAOD;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,iBAAiB,CAAC,GAAG,YAAY,CAExG;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAuB,GAAG,MAAM,CAE9E;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAuB,GAAG,MAAM,CAU9E;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,YAAuB,GAAG,MAAM,CAExF;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAK7C;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAG3D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,EAC1C,CAAC,EAAE,WAAW,CAAC,aAAa,CAAC,GAC5B,MAAM,CAOR"}
|
package/lib/client/format.js
CHANGED
|
@@ -103,8 +103,10 @@ export function hitRateDisplay(totals) {
|
|
|
103
103
|
band: bandOf(rate),
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
/** The RMB display view: amounts render as stored.
|
|
107
|
-
|
|
106
|
+
/** The RMB display view: amounts render as stored. The CNY sign is the
|
|
107
|
+
* fullwidth ¥ (U+FFE5) — the standard RMB glyph in a Chinese UI, and the
|
|
108
|
+
* suffix the number-first cost idiom reads naturally with. */
|
|
109
|
+
const CNY_VIEW = { symbol: '¥', rate: 1 };
|
|
108
110
|
/**
|
|
109
111
|
* The display view of one stats summary: USD when the region pick says so
|
|
110
112
|
* (amounts ÷ `usdExchangeRate`, `$` prefix), else RMB as stored.
|
|
@@ -115,15 +117,17 @@ export function currencyViewOf(summary) {
|
|
|
115
117
|
return summary.currency === 'USD' ? { symbol: '$', rate: summary.usdExchangeRate } : CNY_VIEW;
|
|
116
118
|
}
|
|
117
119
|
/**
|
|
118
|
-
* Cost as display text: the view's symbol
|
|
119
|
-
*
|
|
120
|
-
*
|
|
120
|
+
* Cost as display text: two decimals plus the view's symbol SUFFIXED —
|
|
121
|
+
* `1.25¥` — matching the dock row's number-first unit idiom (`12.2M tok`,
|
|
122
|
+
* `98%`), where every reading leads with its magnitude. USD divides the
|
|
123
|
+
* wire's RMB amount by the exchange rate (`0.18$` under a rate-7 view).
|
|
124
|
+
* A cost is always shown, never omitted.
|
|
121
125
|
* @param cost - a non-negative cost in ¥ (as carried on the wire).
|
|
122
126
|
* @param view - the display currency view.
|
|
123
|
-
* @returns e.g.
|
|
127
|
+
* @returns e.g. `1.25¥`, or `0.18$` under a rate-7 USD view.
|
|
124
128
|
*/
|
|
125
129
|
export function formatCost(cost, view = CNY_VIEW) {
|
|
126
|
-
return `${
|
|
130
|
+
return `${(cost / view.rate).toFixed(2)}${view.symbol}`;
|
|
127
131
|
}
|
|
128
132
|
/**
|
|
129
133
|
* A per-million-token rate as display text, converted through the view:
|
package/lib/client/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/client/format.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH;yEACyE;AACzE,MAAM,uBAAuB,GAAG;IAC9B,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,WAAW;IACjB,uBAAuB,EAAE,8BAA8B;IACvD,cAAc,EAAE,qBAAqB;IACrC,SAAS,EAAE,gBAAgB;IAC3B,kBAAkB,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CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAC5E,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,GAAG,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,KAAK,EAAE,CAAC;SAChE,IAAI,CAAC,IAAI,CAAC,CAAA;AACf,CAAC;AAED,sEAAsE;AACtE,SAAS,gBAAgB,CAAC,IAAY,EAAE,CAA6B;IACnE,IAAI,MAAM,CAAC,MAAM,CAAC,uBAAuB,EAAE,IAAI,CAAC,EAAE,CAAC;QACjD,OAAO,CAAC,CAAC,uBAAuB,CAAC,IAA4C,CAAC,CAAC,CAAA;IACjF,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAYnE,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,OAAO;QACf;;WAEG;QACH,uBAAuB,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE;gBAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAA;aAAE,CAAA;SAAE,CAAA;KACxG;CACF;AAmFD;;;;qFAIqF;AACrF,eAAO,MAAM,MAAM,UAAuF,CAAA;AAE1G;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,qBAAqB,CAAA;AAYnE,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,OAAO;QACf;;WAEG;QACH,uBAAuB,EAAE;YAAE,IAAI,EAAE,OAAO,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE;gBAAE,QAAQ,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CAAA;aAAE,CAAA;SAAE,CAAA;KACxG;CACF;AAmFD;;;;qFAIqF;AACrF,eAAO,MAAM,MAAM,UAAuF,CAAA;AAE1G;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CA+M9C"}
|