@goodandready/dsh-model-sync 0.2.3 → 0.2.4

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 +6 -5
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -21,7 +21,8 @@ export const Config = Schema.object({
21
21
  })
22
22
 
23
23
  export function apply(ctx, config) {
24
- let liveConfig = Config(structuredClone(config || {}))
24
+ const baseConfig = structuredClone(config || {})
25
+ let liveConfig = Config(baseConfig)
25
26
  let reconfigure = () => {}
26
27
  let saveConfigImpl
27
28
  // ctx.inject starts a child fiber; keep a stable function reference for the
@@ -36,17 +37,17 @@ export function apply(ctx, config) {
36
37
  // The settings capability is injected as sctx.settings; ctx.get('settings')
37
38
  // returns the provider service and does not expose the register API.
38
39
  ctx.inject(['settings'], (sctx) => {
39
- const scope = sctx.settings.register(NS, Config, { base: config })
40
- liveConfig = Config(scope.get() || config)
40
+ const scope = sctx.settings.register(NS, Config, { base: baseConfig })
41
+ liveConfig = Config(scope.get() || baseConfig)
41
42
  const stop = scope.watch((next) => {
42
- liveConfig = Config(next || config)
43
+ liveConfig = Config(next || baseConfig)
43
44
  reconfigure()
44
45
  })
45
46
  saveConfigImpl = async (patch) => {
46
47
  const result = await scope.update(patch)
47
48
  // Settings watchers are serialized asynchronously; refresh the snapshot
48
49
  // synchronously as well so a following request sees the new allowlist.
49
- liveConfig = Config(scope.get() || config)
50
+ liveConfig = Config(scope.get() || baseConfig)
50
51
  return result
51
52
  }
52
53
  sctx.effect(() => () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-model-sync",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "description": "Automatic model catalog synchronization for API-key DeepSeek Harness providers.",
5
5
  "keywords": [
6
6
  "deepseek-harness",