@laoyuehanni/dsh-token-usage 0.3.7
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/LICENSE +21 -0
- package/README.md +178 -0
- package/README.zh.md +182 -0
- package/cordis.patch.yml +7 -0
- package/lib/client/CostDeltaFlyLabel.d.ts +8 -0
- package/lib/client/CostDeltaFlyLabel.d.ts.map +1 -0
- package/lib/client/CostDeltaFlyLabel.js +24 -0
- package/lib/client/CostDeltaFlyLabel.js.map +1 -0
- package/lib/client/HitRateText.d.ts +21 -0
- package/lib/client/HitRateText.d.ts.map +1 -0
- package/lib/client/HitRateText.js +16 -0
- package/lib/client/HitRateText.js.map +1 -0
- package/lib/client/QuotaButton.d.ts +70 -0
- package/lib/client/QuotaButton.d.ts.map +1 -0
- package/lib/client/QuotaButton.js +346 -0
- package/lib/client/QuotaButton.js.map +1 -0
- package/lib/client/SessionStatsChip.d.ts +47 -0
- package/lib/client/SessionStatsChip.d.ts.map +1 -0
- package/lib/client/SessionStatsChip.js +141 -0
- package/lib/client/SessionStatsChip.js.map +1 -0
- package/lib/client/StatCard.d.ts +26 -0
- package/lib/client/StatCard.d.ts.map +1 -0
- package/lib/client/StatCard.js +10 -0
- package/lib/client/StatCard.js.map +1 -0
- package/lib/client/TokenUsageCard.d.ts +41 -0
- package/lib/client/TokenUsageCard.d.ts.map +1 -0
- package/lib/client/TokenUsageCard.js +164 -0
- package/lib/client/TokenUsageCard.js.map +1 -0
- package/lib/client/TokenUsageSection.d.ts +32 -0
- package/lib/client/TokenUsageSection.d.ts.map +1 -0
- package/lib/client/TokenUsageSection.js +266 -0
- package/lib/client/TokenUsageSection.js.map +1 -0
- package/lib/client/TrendChart.d.ts +53 -0
- package/lib/client/TrendChart.d.ts.map +1 -0
- package/lib/client/TrendChart.js +141 -0
- package/lib/client/TrendChart.js.map +1 -0
- package/lib/client/UsageView.d.ts +42 -0
- package/lib/client/UsageView.d.ts.map +1 -0
- package/lib/client/UsageView.js +158 -0
- package/lib/client/UsageView.js.map +1 -0
- package/lib/client/async-resource.d.ts +54 -0
- package/lib/client/async-resource.d.ts.map +1 -0
- package/lib/client/async-resource.js +90 -0
- package/lib/client/async-resource.js.map +1 -0
- package/lib/client/card-form.d.ts +171 -0
- package/lib/client/card-form.d.ts.map +1 -0
- package/lib/client/card-form.js +300 -0
- package/lib/client/card-form.js.map +1 -0
- package/lib/client/cost-inflate-motion.d.ts +17 -0
- package/lib/client/cost-inflate-motion.d.ts.map +1 -0
- package/lib/client/cost-inflate-motion.js +61 -0
- package/lib/client/cost-inflate-motion.js.map +1 -0
- package/lib/client/cost-inflate.d.ts +28 -0
- package/lib/client/cost-inflate.d.ts.map +1 -0
- package/lib/client/cost-inflate.js +49 -0
- package/lib/client/cost-inflate.js.map +1 -0
- package/lib/client/day.d.ts +49 -0
- package/lib/client/day.d.ts.map +1 -0
- package/lib/client/day.js +84 -0
- package/lib/client/day.js.map +1 -0
- package/lib/client/format.d.ts +120 -0
- package/lib/client/format.d.ts.map +1 -0
- package/lib/client/format.js +163 -0
- package/lib/client/format.js.map +1 -0
- package/lib/client/index.d.ts +26 -0
- package/lib/client/index.d.ts.map +1 -0
- package/lib/client/index.js +131 -0
- package/lib/client/index.js.map +1 -0
- package/lib/client/locales.d.ts +131 -0
- package/lib/client/locales.d.ts.map +1 -0
- package/lib/client/locales.js +230 -0
- package/lib/client/locales.js.map +1 -0
- package/lib/client/quota-format.d.ts +69 -0
- package/lib/client/quota-format.d.ts.map +1 -0
- package/lib/client/quota-format.js +147 -0
- package/lib/client/quota-format.js.map +1 -0
- package/lib/client/session-stats.d.ts +105 -0
- package/lib/client/session-stats.d.ts.map +1 -0
- package/lib/client/session-stats.js +142 -0
- package/lib/client/session-stats.js.map +1 -0
- package/lib/client/trend-chart/axis.d.ts +21 -0
- package/lib/client/trend-chart/axis.d.ts.map +1 -0
- package/lib/client/trend-chart/axis.js +33 -0
- package/lib/client/trend-chart/axis.js.map +1 -0
- package/lib/client/trend-chart/bucket.d.ts +24 -0
- package/lib/client/trend-chart/bucket.d.ts.map +1 -0
- package/lib/client/trend-chart/bucket.js +28 -0
- package/lib/client/trend-chart/bucket.js.map +1 -0
- package/lib/client/trend-chart/index.d.ts +12 -0
- package/lib/client/trend-chart/index.d.ts.map +1 -0
- package/lib/client/trend-chart/index.js +9 -0
- package/lib/client/trend-chart/index.js.map +1 -0
- package/lib/client/trend-chart/points.d.ts +46 -0
- package/lib/client/trend-chart/points.d.ts.map +1 -0
- package/lib/client/trend-chart/points.js +82 -0
- package/lib/client/trend-chart/points.js.map +1 -0
- package/lib/client/trend-chart/scale.d.ts +47 -0
- package/lib/client/trend-chart/scale.d.ts.map +1 -0
- package/lib/client/trend-chart/scale.js +75 -0
- package/lib/client/trend-chart/scale.js.map +1 -0
- package/lib/client/use-color-scheme.d.ts +18 -0
- package/lib/client/use-color-scheme.d.ts.map +1 -0
- package/lib/client/use-color-scheme.js +37 -0
- package/lib/client/use-color-scheme.js.map +1 -0
- package/lib/client/use-cost-inflate.d.ts +33 -0
- package/lib/client/use-cost-inflate.d.ts.map +1 -0
- package/lib/client/use-cost-inflate.js +108 -0
- package/lib/client/use-cost-inflate.js.map +1 -0
- package/lib/client.js +3892 -0
- package/lib/client.js.map +1 -0
- package/lib/index.d.ts +132 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +599 -0
- package/lib/index.js.map +1 -0
- package/lib/migrate.d.ts +60 -0
- package/lib/migrate.d.ts.map +1 -0
- package/lib/migrate.js +126 -0
- package/lib/migrate.js.map +1 -0
- package/lib/pricing.d.ts +212 -0
- package/lib/pricing.d.ts.map +1 -0
- package/lib/pricing.js +492 -0
- package/lib/pricing.js.map +1 -0
- package/lib/quota/adapters/deepseek-balance.d.ts +18 -0
- package/lib/quota/adapters/deepseek-balance.d.ts.map +1 -0
- package/lib/quota/adapters/deepseek-balance.js +76 -0
- package/lib/quota/adapters/deepseek-balance.js.map +1 -0
- package/lib/quota/adapters/kimi.d.ts +26 -0
- package/lib/quota/adapters/kimi.d.ts.map +1 -0
- package/lib/quota/adapters/kimi.js +91 -0
- package/lib/quota/adapters/kimi.js.map +1 -0
- package/lib/quota/adapters/minimax.d.ts +24 -0
- package/lib/quota/adapters/minimax.d.ts.map +1 -0
- package/lib/quota/adapters/minimax.js +136 -0
- package/lib/quota/adapters/minimax.js.map +1 -0
- package/lib/quota/adapters/opencode-go.d.ts +25 -0
- package/lib/quota/adapters/opencode-go.d.ts.map +1 -0
- package/lib/quota/adapters/opencode-go.js +105 -0
- package/lib/quota/adapters/opencode-go.js.map +1 -0
- package/lib/quota/adapters/openrouter.d.ts +15 -0
- package/lib/quota/adapters/openrouter.d.ts.map +1 -0
- package/lib/quota/adapters/openrouter.js +54 -0
- package/lib/quota/adapters/openrouter.js.map +1 -0
- package/lib/quota/adapters/zhipu.d.ts +38 -0
- package/lib/quota/adapters/zhipu.d.ts.map +1 -0
- package/lib/quota/adapters/zhipu.js +246 -0
- package/lib/quota/adapters/zhipu.js.map +1 -0
- package/lib/quota/credentials.d.ts +79 -0
- package/lib/quota/credentials.d.ts.map +1 -0
- package/lib/quota/credentials.js +130 -0
- package/lib/quota/credentials.js.map +1 -0
- package/lib/quota/http.d.ts +49 -0
- package/lib/quota/http.d.ts.map +1 -0
- package/lib/quota/http.js +114 -0
- package/lib/quota/http.js.map +1 -0
- package/lib/quota/provider-tracking.d.ts +45 -0
- package/lib/quota/provider-tracking.d.ts.map +1 -0
- package/lib/quota/provider-tracking.js +52 -0
- package/lib/quota/provider-tracking.js.map +1 -0
- package/lib/quota/quota-route.d.ts +22 -0
- package/lib/quota/quota-route.d.ts.map +1 -0
- package/lib/quota/quota-route.js +57 -0
- package/lib/quota/quota-route.js.map +1 -0
- package/lib/quota/quota-service.d.ts +54 -0
- package/lib/quota/quota-service.d.ts.map +1 -0
- package/lib/quota/quota-service.js +171 -0
- package/lib/quota/quota-service.js.map +1 -0
- package/lib/quota/registry.d.ts +24 -0
- package/lib/quota/registry.d.ts.map +1 -0
- package/lib/quota/registry.js +38 -0
- package/lib/quota/registry.js.map +1 -0
- package/lib/quota/types.d.ts +79 -0
- package/lib/quota/types.d.ts.map +1 -0
- package/lib/quota/types.js +24 -0
- package/lib/quota/types.js.map +1 -0
- package/lib/record-cache.d.ts +38 -0
- package/lib/record-cache.d.ts.map +1 -0
- package/lib/record-cache.js +143 -0
- package/lib/record-cache.js.map +1 -0
- package/lib/rollup.d.ts +52 -0
- package/lib/rollup.d.ts.map +1 -0
- package/lib/rollup.js +117 -0
- package/lib/rollup.js.map +1 -0
- package/lib/stats-route.d.ts +88 -0
- package/lib/stats-route.d.ts.map +1 -0
- package/lib/stats-route.js +313 -0
- package/lib/stats-route.js.map +1 -0
- package/lib/stats.d.ts +158 -0
- package/lib/stats.d.ts.map +1 -0
- package/lib/stats.js +426 -0
- package/lib/stats.js.map +1 -0
- package/lib/sync-state.d.ts +27 -0
- package/lib/sync-state.d.ts.map +1 -0
- package/lib/sync-state.js +56 -0
- package/lib/sync-state.js.map +1 -0
- package/lib/sync.d.ts +74 -0
- package/lib/sync.d.ts.map +1 -0
- package/lib/sync.js +64 -0
- package/lib/sync.js.map +1 -0
- package/lib/trend-bucket.d.ts +48 -0
- package/lib/trend-bucket.d.ts.map +1 -0
- package/lib/trend-bucket.js +87 -0
- package/lib/trend-bucket.js.map +1 -0
- package/lib/usage-log.d.ts +64 -0
- package/lib/usage-log.d.ts.map +1 -0
- package/lib/usage-log.js +144 -0
- package/lib/usage-log.js.map +1 -0
- package/lib/usage-record.d.ts +59 -0
- package/lib/usage-record.d.ts.map +1 -0
- package/lib/usage-record.js +115 -0
- package/lib/usage-record.js.map +1 -0
- package/lib/wire.d.ts +452 -0
- package/lib/wire.d.ts.map +1 -0
- package/lib/wire.js +144 -0
- package/lib/wire.js.map +1 -0
- package/package.json +100 -0
package/lib/migrate.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data-directory migration of the token-usage plugin: copies every file from
|
|
3
|
+
* one data directory into another, physically and verbatim — the per-day
|
|
4
|
+
* JSONL shards, the pricing files, the sync marker, and the stats rollup all
|
|
5
|
+
* keep their exact names and contents; no row is re-bucketed or rewritten.
|
|
6
|
+
*
|
|
7
|
+
* Two-phase commit, in the shape of a database switch: every file copies
|
|
8
|
+
* first (a failure aborts with the source untouched); the caller then flips
|
|
9
|
+
* its running configuration to the new directory; only after that switch
|
|
10
|
+
* succeeds does the caller run the cleanup, which removes the source files
|
|
11
|
+
* that verifiably landed (same size) and the emptied directory. At every
|
|
12
|
+
* intermediate point the data exists in both places or only in the source —
|
|
13
|
+
* never only in the target.
|
|
14
|
+
*
|
|
15
|
+
* The caller guarantees a quiesced source (no active sessions, log flushed)
|
|
16
|
+
* before starting, so a file copied once cannot change underneath.
|
|
17
|
+
*
|
|
18
|
+
* @module token-usage/migrate
|
|
19
|
+
*/
|
|
20
|
+
/** Progress report of one migration phase. */
|
|
21
|
+
export interface MigrationProgress {
|
|
22
|
+
/** Files finished so far, across copy and cleanup phases. */
|
|
23
|
+
done: number;
|
|
24
|
+
/** Total files this migration will touch. */
|
|
25
|
+
total: number;
|
|
26
|
+
/** Human-readable phase label ('copying' | 'cleaning'). */
|
|
27
|
+
phase: 'copying' | 'cleaning';
|
|
28
|
+
}
|
|
29
|
+
/** What one migration did, for the startup line and the tests. */
|
|
30
|
+
export interface MigrationResult {
|
|
31
|
+
/** Files copied into the target directory. */
|
|
32
|
+
copied: number;
|
|
33
|
+
/** Files removed from the source after the switch. */
|
|
34
|
+
cleaned: number;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Phase one: copy every owned file into the target, verbatim. A target file
|
|
38
|
+
* with the same name is NOT overwritten — the caller switched writes to the
|
|
39
|
+
* target first, so a same-named file there is either newer live data or a
|
|
40
|
+
* user placement, and either way it wins. Any copy failure aborts with the
|
|
41
|
+
* source directory fully intact (the half-copied target is left behind; it
|
|
42
|
+
* is outside every configured directory until the switch names it).
|
|
43
|
+
* @param oldDir - the quiesced source directory.
|
|
44
|
+
* @param newDir - the target directory (created when missing).
|
|
45
|
+
* @param onProgress - per-file progress callback.
|
|
46
|
+
* @returns names of the files that were copied.
|
|
47
|
+
*/
|
|
48
|
+
export declare function copyData(oldDir: string, newDir: string, onProgress?: (progress: MigrationProgress) => void): Promise<string[]>;
|
|
49
|
+
/**
|
|
50
|
+
* Phase three (after the caller's configuration switch): remove the source
|
|
51
|
+
* files that verifiably landed — same name present in the target with the
|
|
52
|
+
* same size — then the emptied directory. A source file whose copy cannot be
|
|
53
|
+
* proven stays; unknown files keep the directory in place.
|
|
54
|
+
* @param oldDir - the previous data directory.
|
|
55
|
+
* @param newDir - the directory now in force.
|
|
56
|
+
* @param onProgress - per-file progress callback.
|
|
57
|
+
* @returns what the cleanup did.
|
|
58
|
+
*/
|
|
59
|
+
export declare function cleanSource(oldDir: string, newDir: string, onProgress?: (progress: MigrationProgress) => void): Promise<MigrationResult>;
|
|
60
|
+
//# sourceMappingURL=migrate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.d.ts","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAsBH,8CAA8C;AAC9C,MAAM,WAAW,iBAAiB;IAChC,6DAA6D;IAC7D,IAAI,EAAE,MAAM,CAAA;IACZ,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAA;IACb,2DAA2D;IAC3D,KAAK,EAAE,SAAS,GAAG,UAAU,CAAA;CAC9B;AACD,kEAAkE;AAClE,MAAM,WAAW,eAAe;IAC9B,8CAA8C;IAC9C,MAAM,EAAE,MAAM,CAAA;IACd,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAA;CAChB;AAkBD;;;;;;;;;;;GAWG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,GACjD,OAAO,CAAC,MAAM,EAAE,CAAC,CA0BnB;AAED;;;;;;;;;GASG;AACH,wBAAsB,WAAW,CAC/B,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,iBAAiB,KAAK,IAAI,GACjD,OAAO,CAAC,eAAe,CAAC,CAyB1B"}
|
package/lib/migrate.js
ADDED
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Data-directory migration of the token-usage plugin: copies every file from
|
|
3
|
+
* one data directory into another, physically and verbatim — the per-day
|
|
4
|
+
* JSONL shards, the pricing files, the sync marker, and the stats rollup all
|
|
5
|
+
* keep their exact names and contents; no row is re-bucketed or rewritten.
|
|
6
|
+
*
|
|
7
|
+
* Two-phase commit, in the shape of a database switch: every file copies
|
|
8
|
+
* first (a failure aborts with the source untouched); the caller then flips
|
|
9
|
+
* its running configuration to the new directory; only after that switch
|
|
10
|
+
* succeeds does the caller run the cleanup, which removes the source files
|
|
11
|
+
* that verifiably landed (same size) and the emptied directory. At every
|
|
12
|
+
* intermediate point the data exists in both places or only in the source —
|
|
13
|
+
* never only in the target.
|
|
14
|
+
*
|
|
15
|
+
* The caller guarantees a quiesced source (no active sessions, log flushed)
|
|
16
|
+
* before starting, so a file copied once cannot change underneath.
|
|
17
|
+
*
|
|
18
|
+
* @module token-usage/migrate
|
|
19
|
+
*/
|
|
20
|
+
import { access, copyFile, mkdir, readdir, rmdir, stat, unlink } from 'node:fs/promises';
|
|
21
|
+
import { join } from 'node:path';
|
|
22
|
+
/** Files that belong to this plugin; anything else in the directory stays. */
|
|
23
|
+
const OWNED_PATTERNS = [
|
|
24
|
+
/^usage-\d{4}-\d{2}-\d{2}\.jsonl$/u,
|
|
25
|
+
/^state\.json$/u,
|
|
26
|
+
/^pricing\.json$/u,
|
|
27
|
+
/^pricing\.ccsa\.json$/u,
|
|
28
|
+
];
|
|
29
|
+
/**
|
|
30
|
+
* The stats rollup is derived state: it rebuilds from the day files on the
|
|
31
|
+
* next stats read, so it neither migrates nor blocks the source cleanup. A
|
|
32
|
+
* stale one in the target (user-copied, half-written) would serve wrong
|
|
33
|
+
* aggregates until rebuilt, so the migration removes it from the target and
|
|
34
|
+
* lets the rebuild produce a cache consistent with the copied day files.
|
|
35
|
+
*/
|
|
36
|
+
const ROLLUP_FILE = 'rollup.json';
|
|
37
|
+
/** Whether a path exists; a stat failure of any kind reads as absent. */
|
|
38
|
+
async function exists(path) {
|
|
39
|
+
return access(path).then(() => true, () => false);
|
|
40
|
+
}
|
|
41
|
+
/** Whether a file name belongs to this plugin's data. */
|
|
42
|
+
function isOwned(name) {
|
|
43
|
+
return OWNED_PATTERNS.some(pattern => pattern.test(name));
|
|
44
|
+
}
|
|
45
|
+
/** List this plugin's files in a directory (names, not paths). */
|
|
46
|
+
async function ownedFiles(dir) {
|
|
47
|
+
const names = await readdir(dir).catch(() => []);
|
|
48
|
+
return names.filter(isOwned);
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Phase one: copy every owned file into the target, verbatim. A target file
|
|
52
|
+
* with the same name is NOT overwritten — the caller switched writes to the
|
|
53
|
+
* target first, so a same-named file there is either newer live data or a
|
|
54
|
+
* user placement, and either way it wins. Any copy failure aborts with the
|
|
55
|
+
* source directory fully intact (the half-copied target is left behind; it
|
|
56
|
+
* is outside every configured directory until the switch names it).
|
|
57
|
+
* @param oldDir - the quiesced source directory.
|
|
58
|
+
* @param newDir - the target directory (created when missing).
|
|
59
|
+
* @param onProgress - per-file progress callback.
|
|
60
|
+
* @returns names of the files that were copied.
|
|
61
|
+
*/
|
|
62
|
+
export async function copyData(oldDir, newDir, onProgress) {
|
|
63
|
+
await mkdir(newDir, { recursive: true });
|
|
64
|
+
// A stale rollup in the target would aggregate the OLD day files until its
|
|
65
|
+
// next lazy rebuild; drop it so the first stats read after the switch
|
|
66
|
+
// rebuilds from the copied day files.
|
|
67
|
+
await unlink(join(newDir, ROLLUP_FILE)).catch(() => undefined);
|
|
68
|
+
const names = await ownedFiles(oldDir);
|
|
69
|
+
const copied = [];
|
|
70
|
+
for (const name of names) {
|
|
71
|
+
const destination = join(newDir, name);
|
|
72
|
+
if (await exists(destination)) {
|
|
73
|
+
copied.push(name);
|
|
74
|
+
onProgress?.({ done: copied.length, total: names.length, phase: 'copying' });
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
await copyFile(join(oldDir, name), destination);
|
|
78
|
+
// Verify the landed bytes before counting the file: a copy that lied
|
|
79
|
+
// about succeeding must not enable a later delete.
|
|
80
|
+
const [source, target] = await Promise.all([stat(join(oldDir, name)), stat(destination)]);
|
|
81
|
+
if (source.size !== target.size) {
|
|
82
|
+
throw new Error(`size mismatch after copying ${name}: ${String(source.size)} -> ${String(target.size)}`);
|
|
83
|
+
}
|
|
84
|
+
copied.push(name);
|
|
85
|
+
onProgress?.({ done: copied.length, total: names.length, phase: 'copying' });
|
|
86
|
+
}
|
|
87
|
+
return copied;
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Phase three (after the caller's configuration switch): remove the source
|
|
91
|
+
* files that verifiably landed — same name present in the target with the
|
|
92
|
+
* same size — then the emptied directory. A source file whose copy cannot be
|
|
93
|
+
* proven stays; unknown files keep the directory in place.
|
|
94
|
+
* @param oldDir - the previous data directory.
|
|
95
|
+
* @param newDir - the directory now in force.
|
|
96
|
+
* @param onProgress - per-file progress callback.
|
|
97
|
+
* @returns what the cleanup did.
|
|
98
|
+
*/
|
|
99
|
+
export async function cleanSource(oldDir, newDir, onProgress) {
|
|
100
|
+
const names = await ownedFiles(oldDir);
|
|
101
|
+
const removable = [];
|
|
102
|
+
for (const name of names) {
|
|
103
|
+
const landed = await access(join(newDir, name)).then(() => true, () => false)
|
|
104
|
+
&& await stat(join(oldDir, name)).then(s => s.size, () => -1)
|
|
105
|
+
=== await stat(join(newDir, name)).then(s => s.size, () => -2);
|
|
106
|
+
if (landed)
|
|
107
|
+
removable.push(name);
|
|
108
|
+
}
|
|
109
|
+
let cleaned = 0;
|
|
110
|
+
for (const name of removable) {
|
|
111
|
+
await unlink(join(oldDir, name)).catch((error) => {
|
|
112
|
+
console.error(`[token-usage] cannot remove ${name}:`, error);
|
|
113
|
+
});
|
|
114
|
+
cleaned += 1;
|
|
115
|
+
onProgress?.({ done: cleaned, total: removable.length, phase: 'cleaning' });
|
|
116
|
+
}
|
|
117
|
+
// The source rollup is derived state with no target-side counterpart; it
|
|
118
|
+
// leaves with the directory so an emptied source can actually go away.
|
|
119
|
+
await unlink(join(oldDir, ROLLUP_FILE)).catch(() => undefined);
|
|
120
|
+
// The directory itself goes only when nothing owned or unknown remains.
|
|
121
|
+
if ((await readdir(oldDir).catch(() => null))?.length === 0) {
|
|
122
|
+
await rmdir(oldDir).catch(() => undefined);
|
|
123
|
+
}
|
|
124
|
+
return { copied: names.length, cleaned };
|
|
125
|
+
}
|
|
126
|
+
//# sourceMappingURL=migrate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"migrate.js","sourceRoot":"","sources":["../src/migrate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAA;AACxF,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,8EAA8E;AAC9E,MAAM,cAAc,GAAG;IACrB,mCAAmC;IACnC,gBAAgB;IAChB,kBAAkB;IAClB,wBAAwB;CAChB,CAAA;AAEV;;;;;;GAMG;AACH,MAAM,WAAW,GAAG,aAAa,CAAA;AAmBjC,yEAAyE;AACzE,KAAK,UAAU,MAAM,CAAC,IAAY;IAChC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,G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,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,OAAO,EAAE,CAAA;AAC1C,CAAC"}
|
package/lib/pricing.d.ts
ADDED
|
@@ -0,0 +1,212 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pricing vocabulary and store of the token-usage plugin: the per-model
|
|
3
|
+
* price rules (¥ per million tokens) backing the cost figures of the stats
|
|
4
|
+
* page. Two sources merge on read — the cloud feed mirrored on every dsh
|
|
5
|
+
* startup into `<data dir>/pricing.ccsa.json` (the same model-price-table
|
|
6
|
+
* source cc-switch-analyzer pulls), and the hand-edited `<data
|
|
7
|
+
* dir>/pricing.json`, whose entries always win and replace a model's cloud
|
|
8
|
+
* rules wholesale. Absent files mean no pricing; a malformed file logs once
|
|
9
|
+
* and reads as empty, so a broken table never blocks the stats route.
|
|
10
|
+
*
|
|
11
|
+
* Every record is priced individually through the analyzer's rule chain —
|
|
12
|
+
* time-rule container first, then context tier, then peak slot — and the
|
|
13
|
+
* aggregation keeps rows per (day, model, rate identity), so re-pricing
|
|
14
|
+
* under an updated table needs no rollup rebuild. The context size for tier
|
|
15
|
+
* matching is approximated by the request's input-side tokens (input +
|
|
16
|
+
* cacheRead + cacheWrite): the log does not carry the raw context size.
|
|
17
|
+
*
|
|
18
|
+
* @module token-usage/pricing
|
|
19
|
+
*/
|
|
20
|
+
import type { ModelPricing, ModelRates, PricingTable, RateKey, UsageTotals } from './wire.ts';
|
|
21
|
+
/** The hand-maintained pricing file inside the data directory. */
|
|
22
|
+
export declare const PRICING_FILE = "pricing.json";
|
|
23
|
+
/** The cloud-feed mirror written on every startup. */
|
|
24
|
+
export declare const PRICING_CCSA_FILE = "pricing.ccsa.json";
|
|
25
|
+
/**
|
|
26
|
+
* The default domestic (China) cloud pricing feed: the model-price-table
|
|
27
|
+
* repository the analyzer also pulls from (¥ per million tokens, currency
|
|
28
|
+
* RMB). Overridden through the `pricingUrlDomestic` config key.
|
|
29
|
+
*/
|
|
30
|
+
export declare const DEFAULT_PRICING_URL_DOMESTIC = "https://gitee.com/oyw125/model-price-table/raw/master/model_pricing.json";
|
|
31
|
+
/**
|
|
32
|
+
* The default overseas cloud pricing feed: the same model-price-table,
|
|
33
|
+
* mirrored to GitHub because the gitee CDN is slow or unreliable outside
|
|
34
|
+
* mainland China. Overridden through the `pricingUrlOverseas` config key.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DEFAULT_PRICING_URL_OVERSEAS = "https://raw.githubusercontent.com/LaoYueHanNi/model-price-table/master/model_pricing.json";
|
|
37
|
+
/** Backward-compatible alias: the domestic (gitee) default feed. */
|
|
38
|
+
export declare const DEFAULT_PRICING_URL = "https://gitee.com/oyw125/model-price-table/raw/master/model_pricing.json";
|
|
39
|
+
/**
|
|
40
|
+
* The RMB-per-USD rate used for display conversion when the cloud feed's
|
|
41
|
+
* envelope does not carry a usable `usdExchangeRate` (older mirrors). The
|
|
42
|
+
* feed owns the number; this is only the stand-in until it lands.
|
|
43
|
+
*/
|
|
44
|
+
export declare const DEFAULT_USD_EXCHANGE_RATE = 7;
|
|
45
|
+
/** Which cloud mirror the pricing sync prefers when no explicit URL is set. */
|
|
46
|
+
export type PricingRegion = 'domestic' | 'overseas';
|
|
47
|
+
/** The URL inputs of the pricing sync: an explicit single feed, or the
|
|
48
|
+
* per-region mirrors plus the chosen region. */
|
|
49
|
+
export interface PricingSourceInput {
|
|
50
|
+
/** Explicit single feed URL; wins over every region/mirror setting. */
|
|
51
|
+
pricingUrl?: string;
|
|
52
|
+
/** Domestic mirror override; defaults to the gitee feed. */
|
|
53
|
+
pricingUrlDomestic?: string;
|
|
54
|
+
/** Overseas mirror override; defaults to the github feed. */
|
|
55
|
+
pricingUrlOverseas?: string;
|
|
56
|
+
/** Which mirror to pull when `pricingUrl` is unset; defaults to `domestic`. */
|
|
57
|
+
pricingRegion?: PricingRegion;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Resolve the feed URL to fetch: an explicit `pricingUrl` wins outright;
|
|
61
|
+
* otherwise `pricingRegion` picks the domestic (default) or overseas mirror,
|
|
62
|
+
* each overridable through its own key. Deliberately no IP sniffing — the
|
|
63
|
+
* deployer sets the region once in the profile config, so the choice is
|
|
64
|
+
* predictable and never depends on a third-party geo lookup.
|
|
65
|
+
*/
|
|
66
|
+
export declare function resolvePricingUrl(input?: PricingSourceInput): string;
|
|
67
|
+
/** One raw rate node of the cloud feed. */
|
|
68
|
+
interface CloudRates {
|
|
69
|
+
inputCostPerMillion: number;
|
|
70
|
+
outputCostPerMillion: number;
|
|
71
|
+
cacheReadCostPerMillion?: number;
|
|
72
|
+
cacheCreationCostPerMillion?: number;
|
|
73
|
+
dailySlots?: CloudSlot[];
|
|
74
|
+
}
|
|
75
|
+
/** One raw context tier of the cloud feed. */
|
|
76
|
+
interface CloudTier extends CloudRates {
|
|
77
|
+
threshold: number;
|
|
78
|
+
}
|
|
79
|
+
/** One raw time rule of the cloud feed. */
|
|
80
|
+
interface CloudTimeRule extends CloudRates {
|
|
81
|
+
label?: string;
|
|
82
|
+
startTime: number;
|
|
83
|
+
endTime: number;
|
|
84
|
+
contextTiers?: CloudTier[];
|
|
85
|
+
}
|
|
86
|
+
/** One raw peak slot of the cloud feed. */
|
|
87
|
+
interface CloudSlot {
|
|
88
|
+
label?: string;
|
|
89
|
+
windows: Array<{
|
|
90
|
+
startMinute: number;
|
|
91
|
+
endMinute: number;
|
|
92
|
+
}>;
|
|
93
|
+
inputCostPerMillion: number;
|
|
94
|
+
outputCostPerMillion: number;
|
|
95
|
+
cacheReadCostPerMillion?: number;
|
|
96
|
+
cacheCreationCostPerMillion?: number;
|
|
97
|
+
}
|
|
98
|
+
/** One raw model row of the cloud feed. */
|
|
99
|
+
export interface CloudPricingModel extends CloudRates {
|
|
100
|
+
modelId: string;
|
|
101
|
+
contextTiers?: CloudTier[];
|
|
102
|
+
timeRules?: CloudTimeRule[];
|
|
103
|
+
aliases?: string[];
|
|
104
|
+
}
|
|
105
|
+
/** The cloud feed envelope. */
|
|
106
|
+
export interface CloudPricingData {
|
|
107
|
+
version: number;
|
|
108
|
+
updatedAt: number;
|
|
109
|
+
currency: string;
|
|
110
|
+
/** RMB per USD for display conversion; absent when the feed omits it or
|
|
111
|
+
* the value is not a positive finite number. */
|
|
112
|
+
usdExchangeRate?: number;
|
|
113
|
+
models: CloudPricingModel[];
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Coerce an unknown value into the cloud feed shape, dropping invalid model
|
|
117
|
+
* rows. A wrong envelope (non-array models, non-object) reads as null, and
|
|
118
|
+
* so does a non-RMB `currency` — this plugin bills in ¥ only.
|
|
119
|
+
* @param value - the parsed `pricing.ccsa.json` content.
|
|
120
|
+
* @returns the feed, or null when the value is not a usable RMB feed.
|
|
121
|
+
*/
|
|
122
|
+
export declare function coerceCloudPricing(value: unknown): CloudPricingData | null;
|
|
123
|
+
/**
|
|
124
|
+
* Flatten one cloud feed into a pricing table: every `modelId` becomes a key
|
|
125
|
+
* and every alias becomes a key holding the same rule set. Aliases land
|
|
126
|
+
* first, ids last, so a model id always wins a collision with another
|
|
127
|
+
* model's alias.
|
|
128
|
+
* @param feed - the coerced cloud feed.
|
|
129
|
+
* @returns the flat table keyed by model ids and aliases.
|
|
130
|
+
*/
|
|
131
|
+
export declare function cloudToTable(feed: CloudPricingData): PricingTable;
|
|
132
|
+
/**
|
|
133
|
+
* Resolve the rate one request was billed at, mirroring the analyzer's chain:
|
|
134
|
+
* the time rule covering the timestamp first (its tiers, its slots), else
|
|
135
|
+
* the model root (its tiers, its slots), else the base rates.
|
|
136
|
+
* @param rates - the model's full rule set.
|
|
137
|
+
* @param timeMs - the request's epoch milliseconds.
|
|
138
|
+
* @param contextTokens - the request's input-side tokens (tier approximation).
|
|
139
|
+
* @param tzOffsetHours - local tz offset in hours for peak windows
|
|
140
|
+
* (defaults to the host's).
|
|
141
|
+
* @returns the billed prices plus the identity they resolved through.
|
|
142
|
+
*/
|
|
143
|
+
export declare function resolveRate(rates: ModelRates, timeMs: number, contextTokens: number, tzOffsetHours?: number): {
|
|
144
|
+
prices: ModelPricing;
|
|
145
|
+
key: RateKey;
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Look the prices of a rate identity back up under the current rule set —
|
|
149
|
+
* the re-pricing path for aggregated rows. Structural drift (a rule window
|
|
150
|
+
* or tier threshold that no longer exists) falls back toward the base rates,
|
|
151
|
+
* so an edited table degrades gracefully instead of mis-billing.
|
|
152
|
+
* @param rates - the model's full rule set.
|
|
153
|
+
* @param key - the identity one aggregation row carries.
|
|
154
|
+
* @returns the prices the key resolves to.
|
|
155
|
+
*/
|
|
156
|
+
export declare function ratesForKey(rates: ModelRates, key: RateKey): ModelPricing;
|
|
157
|
+
/**
|
|
158
|
+
* Billed cost of one totals row at resolved prices: each bucket billed at
|
|
159
|
+
* its own per-million rate, cache buckets billed at their rate when present
|
|
160
|
+
* and at the plain input rate otherwise (providers that fold cache tokens
|
|
161
|
+
* into input still bill them, just at the same rate).
|
|
162
|
+
* @param totals - the aggregated token buckets.
|
|
163
|
+
* @param prices - the resolved per-million prices.
|
|
164
|
+
* @returns the cost in ¥.
|
|
165
|
+
*/
|
|
166
|
+
export declare function costOf(totals: UsageTotals, prices: ModelPricing): number;
|
|
167
|
+
/**
|
|
168
|
+
* Coerce a hand-edited file body into flat table entries (base rates only):
|
|
169
|
+
* non-object values read as empty, invalid entries drop.
|
|
170
|
+
* @param value - the parsed `pricing.json` content.
|
|
171
|
+
* @returns model id → base rates.
|
|
172
|
+
*/
|
|
173
|
+
export declare function coercePricingTable(value: unknown): Record<string, ModelPricing>;
|
|
174
|
+
/**
|
|
175
|
+
* Load the merged pricing table of one data directory: the synced cloud
|
|
176
|
+
* mirror as the base, the hand-edited `pricing.json` layered on top — a
|
|
177
|
+
* manual entry wins for its whole model (base rates, no cloud rules), so
|
|
178
|
+
* manual tweaks survive re-syncs. A missing or malformed file contributes
|
|
179
|
+
* nothing, keeping the stats route alive while the user fixes their table.
|
|
180
|
+
* @param dir - the plugin's data directory.
|
|
181
|
+
* @returns the validated, merged table (possibly empty).
|
|
182
|
+
*/
|
|
183
|
+
export declare function readPricingTable(dir: string): Promise<PricingTable>;
|
|
184
|
+
/**
|
|
185
|
+
* The effective USD conversion rate (RMB per USD) of one data directory:
|
|
186
|
+
* the cloud feed envelope's `usdExchangeRate` when it carries a usable one,
|
|
187
|
+
* else {@link DEFAULT_USD_EXCHANGE_RATE}. Absent, malformed, or non-RMB
|
|
188
|
+
* mirrors fall back the same way — display conversion never blocks on a
|
|
189
|
+
* broken feed. Hand-edited `pricing.json` carries no rate and never wins.
|
|
190
|
+
* @param dir - the plugin's data directory.
|
|
191
|
+
* @returns the positive rate the stats page converts display costs with.
|
|
192
|
+
*/
|
|
193
|
+
export declare function readUsdExchangeRate(dir: string): Promise<number>;
|
|
194
|
+
/** The outcome of one successful cloud sync, for the command's reply. */
|
|
195
|
+
export interface CloudSyncResult {
|
|
196
|
+
version: number;
|
|
197
|
+
updatedAt: number;
|
|
198
|
+
models: number;
|
|
199
|
+
aliases: number;
|
|
200
|
+
usdExchangeRate: number;
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Fetch the cloud pricing feed and mirror it verbatim into
|
|
204
|
+
* `<data dir>/pricing.ccsa.json` (atomically: temp file + rename). The raw
|
|
205
|
+
* feed is stored as received; the flatten-and-merge happens on read.
|
|
206
|
+
* @param dir - the plugin's data directory.
|
|
207
|
+
* @param url - the feed URL (the config override or the default gitee feed).
|
|
208
|
+
* @returns the sync summary.
|
|
209
|
+
*/
|
|
210
|
+
export declare function syncCloudPricing(dir: string, url: string): Promise<CloudSyncResult>;
|
|
211
|
+
export {};
|
|
212
|
+
//# sourceMappingURL=pricing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pricing.d.ts","sourceRoot":"","sources":["../src/pricing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAIH,OAAO,KAA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