@syncended/dsh-usage 0.2.0 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -46,7 +46,7 @@ dsh plugin --profile web remove @syncended/dsh-usage
46
46
 
47
47
  ## Pricing
48
48
 
49
- Cost is an estimate derived from provider-reported token buckets and USD-per-million-token rules. The built-in catalog was verified on **2026-08-26 UTC** and contains 120 price/tier entries compiled into 259 exact provider-route rules for OpenAI GPT, Anthropic Claude, Google Gemini, DeepSeek, Z.AI GLM, Moonshot/Kimi, xAI Grok, Mistral, Cohere, Alibaba Qwen, and MiniMax.
49
+ Cost is an estimate derived from provider-reported token buckets and USD-per-million-token rules. The built-in catalog was verified on **2026-08-26 UTC** and contains 128 price/tier entries compiled into 289 provider-route rules for OpenAI GPT, Anthropic Claude, Google Gemini, DeepSeek, Z.AI GLM, Moonshot/Kimi, xAI Grok, Mistral, Cohere, Alibaba Qwen, and MiniMax.
50
50
 
51
51
  See the [complete generated catalog](docs/pricing-catalog.md) for every model, price, condition, caveat, and official source URL. The engine handles prompt-length tiers and DeepSeek's recurring UTC peak/off-peak windows. It deliberately does not guess broad future model families: a route without a matching rule remains visible as **UNPRICED** and is excluded from estimated spend, while the dashboard reports pricing coverage.
52
52
 
package/dist/index.js CHANGED
@@ -21,7 +21,9 @@ const PriceSchema = z.object({
21
21
  cacheWrite: z.number().min(0).default(0),
22
22
  minPromptTokens: z.number().min(0),
23
23
  maxPromptTokens: z.number().min(0),
24
- utcWindows: z.array(UtcWindowSchema),
24
+ // Schemastery arrays default to [], so wrap this optional field in a union
25
+ // to preserve undefined for ordinary flat/context-tiered prices.
26
+ utcWindows: z.union([z.array(UtcWindowSchema), z.const(undefined)]),
25
27
  outsideUtcWindows: z.boolean(),
26
28
  validFrom: z.string(),
27
29
  validTo: z.string(),
@@ -121,7 +121,7 @@ addFlat('gemini', 'Gemini 3.1 Flash-Lite', GEMINI, ['gemini-3.1-flash-lite'], 0.
121
121
  addContextTiered('gemini', 'Gemini 2.5 Pro', GEMINI, ['gemini-2.5-pro'], 200_001, { input: 1.25, cacheRead: 0.125, output: 10 }, { input: 2.5, cacheRead: 0.25, output: 15 }, 'Cache storage token-hours are excluded.');
122
122
  addFlat('gemini', 'Gemini 2.5 Flash', GEMINI, ['gemini-2.5-flash'], 0.3, 0.03, 2.5, { note: 'Text/image/video rate; audio and cache storage are excluded.' });
123
123
  addFlat('gemini', 'Gemini 2.5 Flash-Lite', GEMINI, ['gemini-2.5-flash-lite'], 0.1, 0.01, 0.4, { note: 'Text/image/video rate; audio and cache storage are excluded.' });
124
- const DEEPSEEK = ['deepseek', 'deepseek-api'];
124
+ const DEEPSEEK = ['deepseek', 'deepseek-api', 'deepseek-official', 'eliza/deepseek'];
125
125
  function addDeepSeek(family, model, offPeak, peak) {
126
126
  add({ source: 'deepseek', family: `${family} · peak`, providers: DEEPSEEK, models: [model], input: peak[0], cacheRead: peak[1], cacheWrite: peak[0], output: peak[2], utcWindows: WEEKDAY_DEEPSEEK_PEAK });
127
127
  add({ source: 'deepseek', family: `${family} · off-peak`, providers: DEEPSEEK, models: [model], input: offPeak[0], cacheRead: offPeak[1], cacheWrite: offPeak[0], output: offPeak[2], utcWindows: WEEKDAY_DEEPSEEK_PEAK, outsideUtcWindows: true });
@@ -61,10 +61,10 @@ Catalog entries: **128**. Generated route rules include provider aliases and con
61
61
  | Gemini 2.5 Pro | google, gemini, google-ai | gemini-2.5-pro | $1.25 | $0.125 | $1.25 | $10 | prompt ≤ 200,000 | Cache storage token-hours are excluded. |
62
62
  | Gemini 2.5 Flash | google, gemini, google-ai | gemini-2.5-flash | $0.3 | $0.03 | $0.3 | $2.5 | standard | Text/image/video rate; audio and cache storage are excluded. |
63
63
  | Gemini 2.5 Flash-Lite | google, gemini, google-ai | gemini-2.5-flash-lite | $0.1 | $0.01 | $0.1 | $0.4 | standard | Text/image/video rate; audio and cache storage are excluded. |
64
- | DeepSeek V4 Flash · peak | deepseek, deepseek-api | deepseek-v4-flash | $0.44 | $0.014 | $0.44 | $1.32 | inside listed UTC windows | |
65
- | DeepSeek V4 Flash · off-peak | deepseek, deepseek-api | deepseek-v4-flash | $0.22 | $0.007 | $0.22 | $0.66 | outside listed UTC windows | |
66
- | DeepSeek V4 Pro · peak | deepseek, deepseek-api | deepseek-v4-pro | $1.32 | $0.044 | $1.32 | $3.96 | inside listed UTC windows | |
67
- | DeepSeek V4 Pro · off-peak | deepseek, deepseek-api | deepseek-v4-pro | $0.66 | $0.022 | $0.66 | $1.98 | outside listed UTC windows | |
64
+ | DeepSeek V4 Flash · peak | deepseek, deepseek-api, deepseek-official, eliza/deepseek | deepseek-v4-flash | $0.44 | $0.014 | $0.44 | $1.32 | inside listed UTC windows | |
65
+ | DeepSeek V4 Flash · off-peak | deepseek, deepseek-api, deepseek-official, eliza/deepseek | deepseek-v4-flash | $0.22 | $0.007 | $0.22 | $0.66 | outside listed UTC windows | |
66
+ | DeepSeek V4 Pro · peak | deepseek, deepseek-api, deepseek-official, eliza/deepseek | deepseek-v4-pro | $1.32 | $0.044 | $1.32 | $3.96 | inside listed UTC windows | |
67
+ | DeepSeek V4 Pro · off-peak | deepseek, deepseek-api, deepseek-official, eliza/deepseek | deepseek-v4-pro | $0.66 | $0.022 | $0.66 | $1.98 | outside listed UTC windows | |
68
68
  | DeepSeek Chat legacy | deepseek | deepseek-chat | $0.28 | $0.028 | $0.28 | $0.42 | before 2026-07-24T16:00:00.000Z | Retired after 2026-07-24 15:59 UTC; retained for historical logs. |
69
69
  | DeepSeek Reasoner legacy | deepseek | deepseek-reasoner | $0.55 | $0.14 | $0.55 | $2.19 | before 2026-07-24T16:00:00.000Z | Retired after 2026-07-24 15:59 UTC; retained for historical logs. |
70
70
  | GLM-5.3 | zai, z-ai, zhipu, bigmodel | glm-5.3 | $1.4 | $0.26 | $1.4 | $4.4 | standard | Global Z.AI endpoint; cached-input storage is currently free. |
package/lib/client.js CHANGED
@@ -251,6 +251,15 @@ window.__ModuleLoader__.load({
251
251
  catch (error) { console.error("dsh usage: could not mount center workspace", error); disclosure.close(); }
252
252
  };
253
253
  ctx.effect(() => { const tag = document.createElement("style"); tag.setAttribute("data-plugin", "@syncended/dsh-usage"); tag.textContent = STYLE_CSS; document.head.appendChild(tag); return () => tag.remove(); }, "@syncended/dsh-usage: client styles");
254
+ ctx.effect(() => {
255
+ const dismissOnExternalNavigation = (event) => {
256
+ if (!disclosure.getSnapshot() || !(event.target instanceof Element)) return;
257
+ if (event.target.closest(".dsh-usage-sidebar,.dsh-usage-workspace")) return;
258
+ disclosure.close();
259
+ };
260
+ document.addEventListener("pointerdown", dismissOnExternalNavigation, true);
261
+ return () => document.removeEventListener("pointerdown", dismissOnExternalNavigation, true);
262
+ }, "@syncended/dsh-usage: dismiss on external navigation");
254
263
  ctx.effect(() => ctx.slots.inject("conversation", () => { centerDeclared = true; mount(); return () => { centerDeclared = false; unmount(); }; }), "@syncended/dsh-usage: center workspace");
255
264
  ctx.effect(() => { const unsubscribe = disclosure.subscribe(() => disclosure.getSnapshot() ? mount() : unmount()); return () => { unsubscribe(); unmount(); disclosure.dispose(); }; }, "@syncended/dsh-usage: workspace state");
256
265
  ctx.slots.inject("sidebar.footer.action", () => ctx.slots.register({ name: "sidebar.footer.action", id: "usage", order: 45, label: "Usage", inject: () => ({ disclosure }) }, SidebarAction));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syncended/dsh-usage",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Token usage, model cost analytics, trends, and activity heatmaps for DeepSeek Harness",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",