dsh-maestro-config-lib
开发工具 活跃维护

dsh-maestro-config-lib

ddtcorex/dsh-maestro-config-lib

提供原子级命名空间JSON存储能力,是dsh-maestro系列插件的共享嵌入式依赖,无需额外引入Cordis row,可直接用于Maestro生态的配置存储管理。

1
Stars 标星
0
Forks 分支
1
Watchers 关注
0
Open Issues
TypeScript
主要语言
None
开源协议
62 KB
仓库大小
20 天前
最后推送
一键安装扩展 / 插件指令
dsh plugin --profile web add github:ddtcorex/dsh-maestro-config-lib
git clone https://github.com/ddtcorex/dsh-maestro-config-lib.git
git clone git@github.com:ddtcorex/dsh-maestro-config-lib.git
README.md master

@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.