@goodandready/dsh-clinebot 0.4.2 → 0.4.3

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/CHANGELOG.md CHANGED
@@ -5,6 +5,13 @@ All notable changes to `@goodandready/dsh-clinebot` will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.3] - 2026-09-24
9
+
10
+ ### Fixed
11
+ - **DSH Settings Reload & DataCloneError Normalization (#96)**: Extended `plainConfig` in `lib/config.js` to recursively resolve functional getters (`() => current`), nested volatile getter objects, and arrays before passing configuration to `structuredClone`, completely eliminating `DataCloneError: () => current could not be cloned` during Cordis plugin reload and settings updates.
12
+ - **Config Schema Non-Volatile Alignment (#96)**: Removed the `.volatile()` marker from `planSyncedAt`, ensuring that internal synchronization timestamps are preserved as runtime state and not serialized into user settings forms.
13
+ - **Boot and Reload Regression Test (#96)**: Added regression tests covering deep functional getter resolution in `plainConfig` and verifying host boot/reload stability with profile-shaped `dynamicModels`.
14
+
8
15
  ## [0.4.2] - 2026-09-24
9
16
 
10
17
  ### Fixed
package/lib/config.js CHANGED
@@ -52,7 +52,7 @@ export const Config = z.object({
52
52
  })).default([])
53
53
  .description('Models automatically discovered from the official ClinePass subscription plan.'),
54
54
  planSyncedAt: z.number().default(0)
55
- .description('Timestamp when models were last synchronized with active subscription plan.').volatile(),
55
+ .description('Timestamp when models were last synchronized with active subscription plan.'),
56
56
  timeoutMs: z.number().default(DEFAULT_TIMEOUT_MS)
57
57
  .description('HTTP probe timeout in milliseconds.').volatile(),
58
58
  smokeTimeoutMs: z.number().default(DEFAULT_SMOKE_TIMEOUT_MS)
@@ -73,15 +73,20 @@ function isVolatileRef(value) {
73
73
  return !!value && typeof value === 'object' && !Array.isArray(value) && typeof value.get === 'function'
74
74
  }
75
75
 
76
- // DSH stores each volatile field as { get }. structuredClone cannot copy that
77
- // getter, so callers need a plain snapshot before validation.
76
+ // DSH stores each volatile field as { get } or getter functions. structuredClone
77
+ // cannot copy functions or getters, so callers need a plain snapshot before validation.
78
78
  export function plainConfig(cfg) {
79
+ while (typeof cfg === 'function') {
80
+ cfg = cfg()
81
+ }
79
82
  if (isVolatileRef(cfg)) return plainConfig(cfg.get())
80
83
  if (!cfg || typeof cfg !== 'object') return cfg
84
+ if (Array.isArray(cfg)) {
85
+ return cfg.map((item) => plainConfig(item))
86
+ }
81
87
  const out = {}
82
88
  for (const key of Object.keys(cfg)) {
83
- const value = cfg[key]
84
- out[key] = isVolatileRef(value) ? value.get() : value
89
+ out[key] = plainConfig(cfg[key])
85
90
  }
86
91
  return out
87
92
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goodandready/dsh-clinebot",
3
- "version": "0.4.2",
3
+ "version": "0.4.3",
4
4
  "description": "DeepSeek Harness companion for ClineBot / ClinePass: dynamic subscription models sync, quota exhaustion warnings, session metrics, dedicated settings page, live usage limits, and /cline slash-command.",
5
5
  "license": "MIT",
6
6
  "type": "module",