@goodandready/dsh-model-sync 0.2.5 → 0.2.6

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 +5 -4
  2. package/package.json +1 -1
package/lib/index.js CHANGED
@@ -22,7 +22,8 @@ export const Config = Schema.object({
22
22
 
23
23
  export function apply(ctx, config) {
24
24
  const baseConfig = structuredClone(config || {})
25
- let liveConfig = Config(baseConfig)
25
+ const resolveConfig = (value) => Config(structuredClone(value || {}))
26
+ let liveConfig = resolveConfig(baseConfig)
26
27
  let reconfigure = () => {}
27
28
  let saveConfigImpl
28
29
  // ctx.inject starts a child fiber; keep a stable function reference for the
@@ -39,14 +40,14 @@ export function apply(ctx, config) {
39
40
  if (settingsScope || !settings?.register) return false
40
41
  const scope = settings.register(NS, Config, { base: baseConfig })
41
42
  settingsScope = scope
42
- liveConfig = Config(scope.get() || baseConfig)
43
+ liveConfig = resolveConfig(scope.get() || baseConfig)
43
44
  const stop = scope.watch((next) => {
44
- liveConfig = Config(next || baseConfig)
45
+ liveConfig = resolveConfig(next || baseConfig)
45
46
  reconfigure()
46
47
  })
47
48
  saveConfigImpl = async (patch) => {
48
49
  const result = await scope.update(patch)
49
- liveConfig = Config(scope.get() || baseConfig)
50
+ liveConfig = resolveConfig(scope.get() || baseConfig)
50
51
  return result
51
52
  }
52
53
  ownerCtx.effect(() => () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-model-sync",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "Automatic model catalog synchronization for API-key DeepSeek Harness providers.",
5
5
  "keywords": [
6
6
  "deepseek-harness",