Skip to content

v1.8.2 - 适配 DSH 0.1.7 的设置模型(Config 投影 / configForms)

Latest

Choose a tag to compare

@Alan2Z Alan2Z released this 26 Sep 08:08
· 1 commit to main since this release

中文

适配 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: 0 macOS 不限长、throttleMs: 0 不合并,此前会被兜底吞成 50/1500);越界值在送进引擎前钳制(volume 0-100、Windows rate -10..10 —— SAPI 遇越界会抛异常,表现是无声无提示)
  • 写入被拒不无声:宿主拒绝写入时浏览器告警,数字输入框回退到已保存的值(此前会一直显示一个没保存的数)
  • 重复实例守卫:同一 profile 意外挂载两次时第二个实例不挂载并写日志,避免两个语音队列把每条播报念两遍
  • 文档与测试:两份 README 的故障表新增四条;测试新增 README 选项表 ↔ Config schema 一致性、spawn 参数规整(显式 0 与越界钳制)、install.ps1 的 UTF-8 BOM 与 PowerShell 解析检查

⚠️ 宿主要求升到 >=0.1.7-rc.2(engines.dsh,市场的「适配当前 DSH」筛选读它)。DSH ≤0.1.6 上语音仍能按 patch config 播报,但设置页与会话里的 🔊 按钮不会加载,请继续用 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 exported Config into the settings form, replacing the browser-side settingsScope with configForms. The host half exports a static Config (all 25 fields .volatile()), the settings namespace is the entry id, and the config is re-derived on loader/volatile-update — edits apply immediately, no restart
  • Settings writes now persist: an editable config must sit on a top-level profile-patch row. Nested inside the insert: row, the UI accepts the edit and the running plugin obeys it, but the config editor silently rolls the write back (while still answering ok: true) — the value reverts at the next boot
  • A duplicated registration no longer kills settings: with the package in dsh.profile.bundles and a hand-written insert: row, the entry id stops being unique and the config editor rejects every write with the misleading overridden 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 0 is honored (volume: 0 silences, maxChars: 0 is unlimited on macOS, throttleMs: 0 announces without merging — they used to be swallowed into 50/1500); out-of-range values are clamped before reaching the engine (volume 0-100, Windows rate -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 ↔ Config schema, spawn-argument normalization (explicit 0 and clamping), and the UTF-8 BOM plus PowerShell parse check for install.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 patch config, 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)