@goodandready/dsh-cost-meter 0.8.14 → 0.8.15

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.
Files changed (2) hide show
  1. package/lib/index.js +3 -2
  2. package/package.json +4 -1
package/lib/index.js CHANGED
@@ -37,7 +37,7 @@ export * from './tariff.js'
37
37
  import { indexCatalog, resolveTariff, matchModel } from './tariff.js'
38
38
 
39
39
  export const name = '@goodandready/dsh-cost-meter'
40
- export const inject = ['webServer']
40
+ export const inject = ['webServer', 'settings', 'sessionProjections']
41
41
 
42
42
  const NS = 'dsh-cost-meter'
43
43
  const STATE_PATH = '/dsh-cost-meter/state'
@@ -411,7 +411,8 @@ export function apply(ctx, config) {
411
411
 
412
412
  // Hook the session projection so the widget can show spend breakdown.
413
413
  ctx.inject(['sessionProjections'], (pctx) => {
414
- pctx.sessionProjections.register(usageByModelProjection)
414
+ const eff = typeof pctx.effect === 'function' ? pctx.effect.bind(pctx) : (typeof ctx.effect === 'function' ? ctx.effect.bind(ctx) : (fn) => fn())
415
+ eff(() => pctx.sessionProjections.register(usageByModelProjection))
415
416
  })
416
417
 
417
418
  // Route 1: POST /dsh-cost-meter/refresh (manual catalog reload)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cost-meter",
3
- "version": "0.8.14",
3
+ "version": "0.8.15",
4
4
  "description": "DeepSeek Harness plugin: a session cost chip in the conversation header - live token usage by bucket, peak/off-peak tariff, and a countdown to the next tariff switch.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
@@ -51,6 +51,9 @@
51
51
  },
52
52
  "peerDependencies": {
53
53
  "@deepseek-ai/cordis": "^4.0.1",
54
+ "@deepseek-ai/dsh-host-webserver": ">=0.1.7-rc.2 || >=0.2.0-rc.1",
55
+ "@deepseek-ai/dsh-session-projection": ">=0.1.7-rc.2 || >=0.2.0-rc.1",
56
+ "@deepseek-ai/dsh-settings": ">=0.1.7-rc.2 || >=0.2.0-rc.1",
54
57
  "@deepseek-ai/schemastery": "^3.18.1"
55
58
  },
56
59
  "dependencies": {