@goodandready/dsh-cost-meter 0.8.5 → 0.8.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.
Files changed (2) hide show
  1. package/lib/client.js +8 -4
  2. package/package.json +1 -1
package/lib/client.js CHANGED
@@ -459,7 +459,7 @@ window.__ModuleLoader__.load({
459
459
  const [updateState, setUpdateState] = React.useState({
460
460
  checking: false,
461
461
  updating: false,
462
- currentVersion: '0.8.3',
462
+ currentVersion: '',
463
463
  latestVersion: '',
464
464
  updateAvailable: false,
465
465
  canAutoUpdate: true,
@@ -1014,11 +1014,15 @@ window.__ModuleLoader__.load({
1014
1014
  React.useEffect(() => { ensureStyles() }, [])
1015
1015
 
1016
1016
  const settingsScope = getSettingsScope(ctx)
1017
+ const scope = React.useMemo(
1018
+ () => (settingsScope && typeof settingsScope.bind === 'function' ? settingsScope.bind({ namespace: NS }) : undefined),
1019
+ [settingsScope],
1020
+ )
1017
1021
  const settingsSnap = React.useSyncExternalStore
1018
1022
  ? React.useSyncExternalStore(
1019
- (cb) => (settingsScope && typeof settingsScope.subscribe === 'function' ? settingsScope.subscribe(cb) : () => {}),
1020
- () => (settingsScope && typeof settingsScope.get === 'function' ? settingsScope.get(NS) : null),
1021
- () => null,
1023
+ React.useMemo(() => (cb) => (scope && typeof scope.subscribe === 'function' ? scope.subscribe(cb) : () => {}), [scope]),
1024
+ React.useCallback(() => (scope && typeof scope.getSnapshot === 'function' ? scope.getSnapshot() : (settingsScope && typeof settingsScope.get === 'function' ? settingsScope.get(NS) : null)), [scope, settingsScope]),
1025
+ React.useCallback(() => null, []),
1022
1026
  )
1023
1027
  : null
1024
1028
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-cost-meter",
3
- "version": "0.8.5",
3
+ "version": "0.8.7",
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",