ddtcorex/dsh-maestro-config-lib1

@ddtcorex/dsh-maestro-config-lib

Maestro 设置存储库:供 dsh-maestro-* 插件共享的原子命名空间 JSON 存储库(作为嵌入式依赖,无 Cordis 配置行)。

AI 分析

核心用途是作为底层库为 Maestro 插件提供本地 JSON 配置文件的安全读写与深层合并。适合作为开发依赖嵌入,使插件能够脱离公共配置服务独立运行。

套件
@ddtcorex/dsh-maestro-config-lib
版本
0.1.1
最近更新
2026年8月28日

安裝

此插件尚未提供可驗證的 bundle,或相容性檢查未通過。請先閱讀倉庫說明。 閱讀完整 README ↗

@ddtcorex/dsh-maestro-config-lib

Embedded settings-store library shared by every dsh-maestro-* plugin: ONE atomic namespaced JSON store at ~/.dsh/maestro/settings.json (chmod 600). No Cordis surface — install it as a plain dependency so any subset of plugins works standalone.

API

defineDomain(name, validator)          // owner registers a schema (validated on write)
load({ dshHome? })                     // memoized read; runs one-shot legacy migration
get(domain, { dshHome? })              // domain value or undefined
set(domain, patch, { dshHome? })       // exclusive-lock write, deep-merge patch, 600 mode
onChange(cb)                           // fires after writes made through this instance
definedDomains()                       // schema-registered names

Legacy migration: first load with no modern store transforms ~/.dsh/dsh-maestro-{harness,remote,review}/config.json into the namespaced store, renames consumed files .bak, drops runtime state (lastTunnelRunning), parks unknown keys under _legacy. Never destructive on corrupt input.