dsh-usage-peak 0.0.0-stage → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3 @@
1
+ - insert:
2
+ - id: dsh-usage-peak
3
+ name: 'dsh-usage-peak'
package/icon.svg ADDED
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">
2
+ <rect x="6" y="34" width="10" height="22" rx="2" fill="#2f9e6a"/>
3
+ <rect x="20" y="22" width="10" height="34" rx="2" fill="#d98b2b"/>
4
+ <rect x="34" y="30" width="10" height="26" rx="2" fill="#2f9e6a"/>
5
+ <rect x="48" y="14" width="10" height="42" rx="2" fill="#d98b2b"/>
6
+ </svg>
package/index.js ADDED
@@ -0,0 +1,539 @@
1
+ /**
2
+ * dsh-usage-peak — Host half.
3
+ *
4
+ * Reads the session logs (~/.dsh/sessions/<cwd>/<session>/session.v4.jsonl.zstd),
5
+ * reconstructs every model request from its `assistant/message` usage, prices it
6
+ * with the DeepSeek peak/valley tariff (Beijing time), and serves the result as
7
+ * JSON for the Settings page dashboard implemented in ./client.js.
8
+ *
9
+ * The whale ledger (~/.dsh/.dshw-usage.json) is only used as a cross-check:
10
+ * it knows account-level spend but not the input/cache/output split.
11
+ */
12
+ import fs from 'node:fs';
13
+ import os from 'node:os';
14
+ import path from 'node:path';
15
+ import zlib from 'node:zlib';
16
+
17
+ const NS = 'dsh-usage-peak';
18
+ const ROUTE_BASE = '/plugin/dsh-usage-peak';
19
+ const SNAPSHOT_TTL_MS = 15_000;
20
+ const BJ_OFFSET = 8 * 60 * 60 * 1000;
21
+ const DAY_MS = 24 * 60 * 60 * 1000;
22
+ const DEFAULT_DAYS = 14;
23
+ const WINDOW_DAYS = [7, 14, 30];
24
+ const MAGIC = Buffer.from([0x28, 0xb5, 0x2f, 0xfd]); // zstd frame magic, little endian
25
+
26
+ /** CNY per million tokens, [valley, peak]. */
27
+ const PRICING = [
28
+ { id: 'flash', label: 'DeepSeek Flash', match: 'flash', hit: [0.02, 0.04], miss: [1, 2], out: [4, 8] },
29
+ { id: 'pro', label: 'DeepSeek Pro', match: 'pro', hit: [0.15, 0.3], miss: [4.5, 9], out: [13.5, 27] },
30
+ ];
31
+
32
+ export function priceFor(model) {
33
+ const name = String(model || '').toLowerCase();
34
+ if (name.includes('pro')) return PRICING[1];
35
+ return PRICING[0];
36
+ }
37
+
38
+ export function bjDate(ts) {
39
+ return new Date(ts + BJ_OFFSET);
40
+ }
41
+
42
+ export function dayKey(ts) {
43
+ return bjDate(ts).toISOString().slice(0, 10);
44
+ }
45
+
46
+ /** Peak = Beijing Mon-Fri 09:00-12:00 and 14:00-18:00; everything else is valley (half price). */
47
+ export function isPeakAt(ts) {
48
+ const d = bjDate(ts);
49
+ const dow = d.getUTCDay();
50
+ if (dow === 0 || dow === 6) return false;
51
+ const minutes = d.getUTCHours() * 60 + d.getUTCMinutes();
52
+ return (minutes >= 540 && minutes < 720) || (minutes >= 840 && minutes < 1080);
53
+ }
54
+
55
+ /** Next tariff switch after `ts`, with the status it switches into. */
56
+ export function nextSwitch(ts) {
57
+ const d = bjDate(ts);
58
+ const y = d.getUTCFullYear();
59
+ const mo = d.getUTCMonth();
60
+ const da = d.getUTCDate();
61
+ for (let k = 0; k < 9; k += 1) {
62
+ const probe = new Date(Date.UTC(y, mo, da + k));
63
+ const dow = probe.getUTCDay();
64
+ if (dow === 0 || dow === 6) continue;
65
+ for (const hour of [9, 12, 14, 18]) {
66
+ const at = Date.UTC(probe.getUTCFullYear(), probe.getUTCMonth(), probe.getUTCDate(), hour, 0, 0) - BJ_OFFSET;
67
+ if (at > ts) return { at, status: hour === 9 || hour === 14 ? 'peak' : 'valley' };
68
+ }
69
+ }
70
+ return { at: ts + 3600_000, status: 'valley' };
71
+ }
72
+
73
+ /* ------------------------------------------------------------------ */
74
+ /* Session log decoding */
75
+ /* ------------------------------------------------------------------ */
76
+
77
+ /**
78
+ * Session logs are concatenated zstd frames; Node's zstd entry points stop after
79
+ * the first frame. Split on the frame magic and stitch the frames back together.
80
+ */
81
+ export function decodeSessionFile(file) {
82
+ const buf = fs.readFileSync(file);
83
+ const starts = [];
84
+ let cursor = 0;
85
+ for (;;) {
86
+ const at = buf.indexOf(MAGIC, cursor);
87
+ if (at < 0) break;
88
+ starts.push(at);
89
+ cursor = at + 4;
90
+ }
91
+ if (starts.length === 0) return buf.toString('utf8');
92
+ const chunks = [];
93
+ let index = 0;
94
+ while (index < starts.length) {
95
+ let accepted;
96
+ for (let end = index + 1; end <= starts.length; end += 1) {
97
+ const stop = end < starts.length ? starts[end] : buf.length;
98
+ try {
99
+ accepted = { data: zlib.zstdDecompressSync(buf.subarray(starts[index], stop)), next: end };
100
+ break;
101
+ } catch {
102
+ /* a magic-looking byte inside a frame: keep growing the slice */
103
+ }
104
+ }
105
+ if (!accepted) {
106
+ index += 1;
107
+ continue;
108
+ }
109
+ chunks.push(accepted.data);
110
+ index = accepted.next;
111
+ }
112
+ return Buffer.concat(chunks).toString('utf8');
113
+ }
114
+
115
+ /** One turn per billed model request: { t, model, input, cache, output }. */
116
+ export function parseSessionTurns(text) {
117
+ const turns = [];
118
+ for (const line of text.split('\n')) {
119
+ if (line.length < 2) continue;
120
+ let record;
121
+ try {
122
+ record = JSON.parse(line);
123
+ } catch {
124
+ continue;
125
+ }
126
+ if (record.type !== 'assistant/message') continue;
127
+ const usage = record.data && record.data.usage;
128
+ if (!usage) continue;
129
+ const model = (record.data.message && record.data.message.source && record.data.message.source.model) || 'unknown';
130
+ turns.push({
131
+ t: record.time,
132
+ model,
133
+ input: usage.inputTokens || 0,
134
+ cache: usage.cacheReadTokens || 0,
135
+ output: usage.outputTokens || 0,
136
+ });
137
+ }
138
+ return turns;
139
+ }
140
+
141
+ /* ------------------------------------------------------------------ */
142
+ /* Aggregation */
143
+ /* ------------------------------------------------------------------ */
144
+
145
+ const fileCache = new Map(); // file -> { mtimeMs, size, turns }
146
+ const snapshotCache = new Map(); // window days -> { builtAt, payload }
147
+
148
+ export function normalizeDays(value) {
149
+ const days = Number(value);
150
+ return WINDOW_DAYS.includes(days) ? days : DEFAULT_DAYS;
151
+ }
152
+
153
+ export function collectTurns() {
154
+ const root = path.join(os.homedir(), '.dsh', 'sessions');
155
+ const turns = [];
156
+ let workspaceDirs;
157
+ try {
158
+ workspaceDirs = fs.readdirSync(root, { withFileTypes: true });
159
+ } catch {
160
+ return turns;
161
+ }
162
+ for (const workspace of workspaceDirs) {
163
+ if (!workspace.isDirectory()) continue;
164
+ const workspacePath = path.join(root, workspace.name);
165
+ let sessions;
166
+ try {
167
+ sessions = fs.readdirSync(workspacePath, { withFileTypes: true });
168
+ } catch {
169
+ continue;
170
+ }
171
+ for (const session of sessions) {
172
+ if (!session.isDirectory()) continue;
173
+ const dir = path.join(workspacePath, session.name);
174
+ const file = path.join(dir, 'session.v4.jsonl.zstd');
175
+ let stat;
176
+ try {
177
+ stat = fs.statSync(file);
178
+ } catch {
179
+ continue;
180
+ }
181
+ let entry = fileCache.get(file);
182
+ if (!entry || entry.mtimeMs !== stat.mtimeMs || entry.size !== stat.size) {
183
+ let parsed = [];
184
+ try {
185
+ parsed = parseSessionTurns(decodeSessionFile(file));
186
+ } catch {
187
+ parsed = [];
188
+ }
189
+ entry = { mtimeMs: stat.mtimeMs, size: stat.size, turns: parsed };
190
+ fileCache.set(file, entry);
191
+ }
192
+ for (const turn of entry.turns) turns.push(turn);
193
+ }
194
+ }
195
+ return turns;
196
+ }
197
+
198
+ export function emptyDay(day) {
199
+ const hours = [];
200
+ for (let hour = 0; hour < 24; hour += 1) hours.push({ hour, cost: 0, calls: 0 });
201
+ return {
202
+ day,
203
+ calls: 0,
204
+ inputTokens: 0,
205
+ cacheTokens: 0,
206
+ outputTokens: 0,
207
+ cost: 0,
208
+ costCache: 0,
209
+ costMiss: 0,
210
+ costOut: 0,
211
+ peakCost: 0,
212
+ valleyCost: 0,
213
+ hours,
214
+ models: {},
215
+ firstAt: 0,
216
+ lastAt: 0,
217
+ };
218
+ }
219
+
220
+ export function addTurn(day, turn) {
221
+ const price = priceFor(turn.model);
222
+ const peak = isPeakAt(turn.t);
223
+ const offset = peak ? 1 : 0;
224
+ const costCache = (turn.cache / 1e6) * price.hit[offset];
225
+ const costMiss = (turn.input / 1e6) * price.miss[offset];
226
+ const costOut = (turn.output / 1e6) * price.out[offset];
227
+ const cost = costCache + costMiss + costOut;
228
+
229
+ day.calls += 1;
230
+ day.inputTokens += turn.input;
231
+ day.cacheTokens += turn.cache;
232
+ day.outputTokens += turn.output;
233
+ day.cost += cost;
234
+ day.costCache += costCache;
235
+ day.costMiss += costMiss;
236
+ day.costOut += costOut;
237
+ if (peak) day.peakCost += cost;
238
+ else day.valleyCost += cost;
239
+ if (!day.firstAt || turn.t < day.firstAt) day.firstAt = turn.t;
240
+ if (turn.t > day.lastAt) day.lastAt = turn.t;
241
+
242
+ const hour = bjDate(turn.t).getUTCHours();
243
+ const bucket = day.hours[hour];
244
+ bucket.cost += cost;
245
+ bucket.calls += 1;
246
+
247
+ const modelKey = price.id;
248
+ const slot = day.models[modelKey] || (day.models[modelKey] = { calls: 0, cost: 0, tokens: 0 });
249
+ slot.calls += 1;
250
+ slot.cost += cost;
251
+ slot.tokens += turn.input + turn.cache + turn.output;
252
+ }
253
+
254
+ export function readLedger() {
255
+ const file = path.join(os.homedir(), '.dsh', '.dshw-usage.json');
256
+ try {
257
+ const raw = JSON.parse(fs.readFileSync(file, 'utf8'));
258
+ return {
259
+ file,
260
+ ok: true,
261
+ date: raw.date,
262
+ todayUsage: typeof raw.todayUsage === 'number' ? raw.todayUsage : null,
263
+ balance: typeof raw.lastBalance === 'number' ? raw.lastBalance : null,
264
+ dayStart: typeof raw.dayStart === 'number' ? raw.dayStart : null,
265
+ history: raw.history && typeof raw.history === 'object' ? raw.history : {},
266
+ updatedAt: fs.statSync(file).mtimeMs,
267
+ };
268
+ } catch {
269
+ return { file, ok: false, history: {} };
270
+ }
271
+ }
272
+
273
+ export function shapeDay(day) {
274
+ const tokens = day.inputTokens + day.cacheTokens + day.outputTokens;
275
+ const billable = day.cacheTokens + day.inputTokens;
276
+ return {
277
+ day: day.day,
278
+ calls: day.calls,
279
+ tokens,
280
+ inputTokens: day.inputTokens,
281
+ cacheTokens: day.cacheTokens,
282
+ outputTokens: day.outputTokens,
283
+ cost: round(day.cost),
284
+ costCache: round(day.costCache),
285
+ costMiss: round(day.costMiss),
286
+ costOut: round(day.costOut),
287
+ peakCost: round(day.peakCost),
288
+ valleyCost: round(day.valleyCost),
289
+ // Peak is exactly 2x valley, so moving these peak tokens to valley saves half.
290
+ savingIfValley: round(day.peakCost / 2),
291
+ peakShare: day.cost > 0 ? day.peakCost / day.cost : 0,
292
+ hitRate: billable > 0 ? day.cacheTokens / billable : 0,
293
+ avgTokens: day.calls > 0 ? Math.round(tokens / day.calls) : 0,
294
+ firstAt: day.firstAt,
295
+ lastAt: day.lastAt,
296
+ models: day.models,
297
+ };
298
+ }
299
+
300
+ export function round(value) {
301
+ return Math.round(value * 10000) / 10000;
302
+ }
303
+
304
+ export function hoursOf(day) {
305
+ const midnight = Date.parse(`${day.day}T00:00:00Z`) - BJ_OFFSET;
306
+ return day.hours.map((bucket) => ({
307
+ hour: bucket.hour,
308
+ cost: round(bucket.cost),
309
+ calls: bucket.calls,
310
+ peak: isPeakAt(midnight + bucket.hour * 3600_000),
311
+ }));
312
+ }
313
+
314
+ /**
315
+ * Pure aggregation over decoded turns.
316
+ *
317
+ * The window is a contiguous calendar range ending today (Beijing): days
318
+ * without any request are zero-filled so the chart keeps all its columns and
319
+ * "last N days" means the same thing everywhere.
320
+ */
321
+ export function aggregateTurns(turns, options = {}) {
322
+ const now = Number.isFinite(options.now) ? options.now : Date.now();
323
+ const days = normalizeDays(options.days);
324
+ const byDay = new Map();
325
+ const unknownModels = new Set();
326
+
327
+ for (const turn of turns || []) {
328
+ if (!turn || !Number.isFinite(turn.t)) continue;
329
+ const key = dayKey(turn.t);
330
+ let day = byDay.get(key);
331
+ if (!day) {
332
+ day = emptyDay(key);
333
+ byDay.set(key, day);
334
+ }
335
+ addTurn(day, turn);
336
+ if (!/flash|pro/i.test(turn.model)) unknownModels.add(turn.model);
337
+ }
338
+
339
+ const window = [];
340
+ for (let offset = days - 1; offset >= 0; offset -= 1) {
341
+ const key = dayKey(now - offset * DAY_MS);
342
+ const day = byDay.get(key) || emptyDay(key);
343
+ const shaped = shapeDay(day);
344
+ shaped.hours = hoursOf(day);
345
+ window.push(shaped);
346
+ }
347
+
348
+ const today = window[window.length - 1];
349
+ const week = window.slice(-7).reduce(
350
+ (acc, entry) => ({
351
+ cost: acc.cost + entry.cost,
352
+ calls: acc.calls + entry.calls,
353
+ tokens: acc.tokens + entry.tokens,
354
+ peakCost: acc.peakCost + entry.peakCost,
355
+ costCache: acc.costCache + entry.costCache,
356
+ costMiss: acc.costMiss + entry.costMiss,
357
+ costOut: acc.costOut + entry.costOut,
358
+ savingIfValley: acc.savingIfValley + entry.savingIfValley,
359
+ days: acc.days + 1,
360
+ }),
361
+ { cost: 0, calls: 0, tokens: 0, peakCost: 0, costCache: 0, costMiss: 0, costOut: 0, savingIfValley: 0, days: 0 },
362
+ );
363
+
364
+ const models = PRICING.map((price) => {
365
+ let calls = 0;
366
+ let cost = 0;
367
+ let tokens = 0;
368
+ for (const entry of window) {
369
+ const slot = entry.models[price.id];
370
+ if (!slot) continue;
371
+ calls += slot.calls;
372
+ cost += slot.cost;
373
+ tokens += slot.tokens;
374
+ }
375
+ return { id: price.id, label: price.label, calls, cost: round(cost), tokens };
376
+ });
377
+
378
+ return {
379
+ windowDays: days,
380
+ today,
381
+ hours: today ? today.hours : [],
382
+ window,
383
+ week: {
384
+ cost: round(week.cost),
385
+ calls: week.calls,
386
+ tokens: week.tokens,
387
+ peakCost: round(week.peakCost),
388
+ costCache: round(week.costCache),
389
+ costMiss: round(week.costMiss),
390
+ costOut: round(week.costOut),
391
+ savingIfValley: round(week.savingIfValley),
392
+ peakShare: week.cost > 0 ? week.peakCost / week.cost : 0,
393
+ avgPerDay: week.days > 0 ? round(week.cost / week.days) : 0,
394
+ avgTokensPerCall: week.calls > 0 ? Math.round(week.tokens / week.calls) : 0,
395
+ },
396
+ models,
397
+ warnings: unknownModels.size > 0 ? [{ code: 'unknown-model', models: [...unknownModels] }] : [],
398
+ };
399
+ }
400
+
401
+ export function buildSnapshot(options = {}) {
402
+ const now = Number.isFinite(options.now) ? options.now : Date.now();
403
+ const days = normalizeDays(options.days);
404
+ const cached = snapshotCache.get(days);
405
+ if (cached && !options.fresh && now - cached.builtAt < SNAPSHOT_TTL_MS) return cached.payload;
406
+
407
+ const agg = aggregateTurns(collectTurns(), { now, days });
408
+ const ledger = readLedger();
409
+ if (ledger.ok) {
410
+ for (const entry of agg.window) {
411
+ const booked = ledger.history && ledger.history[entry.day];
412
+ entry.ledger = typeof booked === 'number' ? round(booked) : null;
413
+ }
414
+ }
415
+
416
+ const switchPoint = nextSwitch(now);
417
+ const peakNow = isPeakAt(now);
418
+ const currentPrice = PRICING[0];
419
+
420
+ const payload = {
421
+ ok: true,
422
+ generatedAt: now,
423
+ tz: 'Asia/Shanghai',
424
+ windowDays: days,
425
+ now: {
426
+ ts: now,
427
+ day: dayKey(now),
428
+ peak: peakNow,
429
+ hour: bjDate(now).getUTCHours(),
430
+ minutesIntoHour: bjDate(now).getUTCMinutes(),
431
+ nextAt: switchPoint.at,
432
+ nextStatus: switchPoint.status,
433
+ price: {
434
+ hit: currentPrice.hit[peakNow ? 1 : 0],
435
+ miss: currentPrice.miss[peakNow ? 1 : 0],
436
+ out: currentPrice.out[peakNow ? 1 : 0],
437
+ },
438
+ },
439
+ today: agg.today,
440
+ hours: agg.hours,
441
+ days: agg.window,
442
+ week: agg.week,
443
+ models: agg.models,
444
+ pricing: PRICING.map((price) => ({
445
+ id: price.id,
446
+ label: price.label,
447
+ hit: price.hit,
448
+ miss: price.miss,
449
+ out: price.out,
450
+ })),
451
+ ledger,
452
+ warnings: agg.warnings,
453
+ };
454
+
455
+ snapshotCache.set(days, { builtAt: now, payload });
456
+ return payload;
457
+ }
458
+
459
+ /* ------------------------------------------------------------------ */
460
+ /* HTTP surface */
461
+ /* ------------------------------------------------------------------ */
462
+
463
+ function sendJson(res, status, payload) {
464
+ const body = Buffer.from(JSON.stringify(payload), 'utf8');
465
+ res.writeHead(status, {
466
+ 'Content-Type': 'application/json; charset=utf-8',
467
+ 'Cache-Control': 'no-store',
468
+ 'Content-Length': String(body.length),
469
+ });
470
+ res.end(body);
471
+ }
472
+
473
+ export const name = NS;
474
+
475
+ /**
476
+ * Wait for the HTTP carrier before applying.
477
+ *
478
+ * Without this the bundle can be applied before `webServer` exists (cold start
479
+ * ordering), the route never gets registered, and the client half sits on a 404
480
+ * until someone reloads the plugin by hand.
481
+ */
482
+ export const inject = ['webServer'];
483
+
484
+ export function apply(ctx) {
485
+ const webServer = (typeof ctx.get === 'function' && ctx.get('webServer')) || ctx.webServer;
486
+ if (!webServer || typeof webServer.register !== 'function') {
487
+ ctx.logger?.warn?.(`[${NS}] no webServer in this profile; dashboard route skipped`);
488
+ return;
489
+ }
490
+
491
+ const trustCheck = (req, res) => {
492
+ try {
493
+ const connection = (typeof ctx.get === 'function' && ctx.get('connection')) || ctx.connection;
494
+ if (!connection || typeof connection.requestRejection !== 'function') return false;
495
+ const rejection = connection.requestRejection(req);
496
+ if (rejection === undefined || rejection === null || rejection === false) return false;
497
+ res.statusCode = typeof rejection === 'number' ? rejection : 403;
498
+ res.end();
499
+ return true;
500
+ } catch {
501
+ return false;
502
+ }
503
+ };
504
+
505
+ const register = (route) => {
506
+ try {
507
+ return webServer.register(route);
508
+ } catch (error) {
509
+ // Hot reload can apply the new half before the old one finalises; a
510
+ // duplicate route must not take the whole plugin down.
511
+ ctx.logger?.warn?.(`[${NS}] route ${route.path} not registered: ${String((error && error.message) || error)}`);
512
+ return () => {};
513
+ }
514
+ };
515
+
516
+ const dispose = register({
517
+ kind: 'exact',
518
+ path: `${ROUTE_BASE}/data`,
519
+ handler: async (req, res) => {
520
+ if (trustCheck(req, res)) return;
521
+ if ((req.method || 'GET').toUpperCase() !== 'GET') {
522
+ sendJson(res, 405, { ok: false, error: 'method not allowed' });
523
+ return;
524
+ }
525
+ const url = new URL(req.url || '/', 'http://127.0.0.1');
526
+ const fresh = url.searchParams.get('fresh') === '1' || url.searchParams.get('fresh') === 'true';
527
+ const days = normalizeDays(url.searchParams.get('days'));
528
+ try {
529
+ sendJson(res, 200, buildSnapshot({ days, fresh }));
530
+ } catch (error) {
531
+ sendJson(res, 500, { ok: false, error: String((error && error.stack) || error) });
532
+ }
533
+ },
534
+ });
535
+
536
+ ctx.effect(() => () => {
537
+ dispose();
538
+ }, `${NS}: dashboard route`);
539
+ }
package/locale/en.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "Usage Dashboard",
4
+ "description": "Peak/valley pricing windows plus daily spend, requests and cache hits, rebuilt from this machine's session logs."
5
+ }
6
+ }
package/locale/zh.json ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "meta": {
3
+ "title": "用量仪表盘",
4
+ "description": "看峰谷时段,以及每天的花费、请求量、缓存命中;数据由本机会话日志重算。"
5
+ }
6
+ }
package/package.json CHANGED
@@ -1,6 +1,72 @@
1
1
  {
2
2
  "name": "dsh-usage-peak",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.1.0",
4
+ "type": "module",
5
+ "description": "DeepSeek Harness 用量峰谷仪表盘:峰/谷时段、今日花费与 tokens、7/14/30 天窗口、缓存命中、谷时更省与花费构成,侧栏常驻胶囊 + 设置页详情。",
6
+ "exports": {
7
+ ".": "./index.js",
8
+ "./client": "./client.js",
9
+ "./locale/*.json": "./locale/*.json",
10
+ "./icon": "./icon.svg"
11
+ },
12
+ "files": [
13
+ "index.js",
14
+ "client.js",
15
+ "cordis.patch.yml",
16
+ "locale/*.json",
17
+ "icon.svg",
18
+ "README.md",
19
+ "LICENSE",
20
+ "CHANGELOG.md",
21
+ "assets/*.webp",
22
+ "test/*.js"
23
+ ],
24
+ "dsh": {
25
+ "bundle": {
26
+ "patch": "./cordis.patch.yml"
27
+ },
28
+ "client": {
29
+ "platform": "web",
30
+ "immediately": true,
31
+ "inject": []
32
+ },
33
+ "compatibility": {
34
+ "dshReleases": {
35
+ "0.2.1-rc.3": "compatible"
36
+ }
37
+ }
38
+ },
39
+ "license": "MIT",
40
+ "engines": {
41
+ "node": ">=22.15.0"
42
+ },
43
+ "keywords": [
44
+ "dsh",
45
+ "dsh-plugin",
46
+ "deepseek-harness",
47
+ "usage",
48
+ "tokens",
49
+ "cost",
50
+ "deepseek-api",
51
+ "peak-pricing",
52
+ "cordis",
53
+ "react"
54
+ ],
55
+ "private": false,
56
+ "author": "mumuhmumu",
57
+ "repository": {
58
+ "type": "git",
59
+ "url": "git+https://github.com/hhse/dsh-usage-peak.git"
60
+ },
61
+ "homepage": "https://github.com/hhse/dsh-usage-peak#readme",
62
+ "bugs": {
63
+ "url": "https://github.com/hhse/dsh-usage-peak/issues"
64
+ },
65
+ "publishConfig": {
66
+ "access": "public"
67
+ },
68
+ "scripts": {
69
+ "test": "node --test test/core.test.js",
70
+ "check": "node --check index.js && node --check client.js && npm test"
71
+ }
72
+ }