Repository navigation
中文
适配 DSH 0.1.7 的设置新模型(Config 投影 / configForms),并修掉两个会让设置"看起来生效、其实没保存"的静默坑。
- 适配 0.1.7 设置模型:上游删除了
settings.register(ns, schema, { base }),改为把每个 Loader 条目自己导出的Config投影成表单,浏览器侧settingsScope被configForms取代。宿主半侧改为静态导出Config(25 个字段全部.volatile()),设置 namespace 就是条目 id;配置在loader/volatile-update时重新解析,改设置无需重启即刻生效 - 修复设置写入不落盘:可编辑的
config必须写在 profile patch 的顶层行。嵌在insert:行里时界面接受修改、运行中的插件也立刻按新值工作,但 config-editor 会把这次写入静默回滚(仍回ok: true),下次启动 dsh 就变回旧值 - 修复重复注册导致设置全废:包既在
dsh.profile.bundles又手写了一行insert:时,条目 id 不再唯一,config-editor 会拒绝每一次写入并回误导性的overridden by a home patch or command-line overlay(语音照常工作,所以极难查)。文档改为"一个 profile 只能有一种注册方式",插件也会在日志里点名这个症状 - 数值不再"显示与行为不一致":显式的
0被尊重(volume: 0静音、maxChars: 0macOS 不限长、throttleMs: 0不合并,此前会被兜底吞成 50/1500);越界值在送进引擎前钳制(volume0-100、Windowsrate-10..10 —— SAPI 遇越界会抛异常,表现是无声无提示) - 写入被拒不无声:宿主拒绝写入时浏览器告警,数字输入框回退到已保存的值(此前会一直显示一个没保存的数)
- 重复实例守卫:同一 profile 意外挂载两次时第二个实例不挂载并写日志,避免两个语音队列把每条播报念两遍
- 文档与测试:两份 README 的故障表新增四条;测试新增 README 选项表 ↔
Configschema 一致性、spawn 参数规整(显式 0 与越界钳制)、install.ps1的 UTF-8 BOM 与 PowerShell 解析检查
⚠️ 宿主要求升到>=0.1.7-rc.2(engines.dsh,市场的「适配当前 DSH」筛选读它)。DSH ≤0.1.6 上语音仍能按 patchconfig播报,但设置页与会话里的 🔊 按钮不会加载,请继续用 1.8.1。
安装:npm install dsh-speak@1.8.2(Windows SAPI5 / macOS say)
English
Adapts to DSH 0.1.7's new settings model (Config projection / configForms) and fixes two silent traps where a setting looked saved but was not.
- 0.1.7 settings model: upstream deleted
settings.register(ns, schema, { base })and now projects each Loader entry's own exportedConfiginto the settings form, replacing the browser-sidesettingsScopewithconfigForms. The host half exports a staticConfig(all 25 fields.volatile()), the settings namespace is the entry id, and the config is re-derived onloader/volatile-update— edits apply immediately, no restart - Settings writes now persist: an editable
configmust sit on a top-level profile-patch row. Nested inside theinsert:row, the UI accepts the edit and the running plugin obeys it, but the config editor silently rolls the write back (while still answeringok: true) — the value reverts at the next boot - A duplicated registration no longer kills settings: with the package in
dsh.profile.bundlesand a hand-writteninsert:row, the entry id stops being unique and the config editor rejects every write with the misleadingoverridden by a home patch or command-line overlay(speech keeps working, which is what made it hard to find). The docs now insist on one registration path per profile, and the plugin names the symptom in its log - Numbers no longer disagree with the UI: an explicit
0is honored (volume: 0silences,maxChars: 0is unlimited on macOS,throttleMs: 0announces without merging — they used to be swallowed into 50/1500); out-of-range values are clamped before reaching the engine (volume0-100, Windowsrate-10..10, where SAPI throws and you just get silence) - A refused write is no longer silent: the browser warns and the numeric input falls back to the stored value (it used to keep showing an unsaved number)
- Duplicate-instance guard: if the plugin is mounted twice, the second instance stays inert and logs — no two speech queues doubling every announcement
- Docs and tests: four new troubleshooting rows in both READMEs; new assertions for README option tables ↔
Configschema, spawn-argument normalization (explicit 0 and clamping), and the UTF-8 BOM plus PowerShell parse check forinstall.ps1
⚠️ The host floor moves to>=0.1.7-rc.2(engines.dsh, which the market's "compatible with current DSH" filter reads). On DSH ≤0.1.6 speech still works from the composed patchconfig, but the settings page and the in-chat 🔊 button will not load — stay on 1.8.1.
Install: npm install dsh-speak@1.8.2 (Windows SAPI5 / macOS say)