dsh-granular-settings
在终端中运行以下命令:
dsh plugin install joao-paulo-santos/dsh-granular-settings
将以下提示词粘贴到 DeepSeek Harness 对话框中:
在 DeepSeek Harness 中执行 dsh plugin install joao-paulo-santos/dsh-granular-settings 即可安装该插件,完整源码地址为 https://github.com/joao-paulo-santos/dsh-granular-settings
插件介绍
Across the DSH ecosystem, plugins need user-facing knobs at different granularities: a model choice for one session, a build flag for a workspace, an accent color for the whole install. Before dsh-granular-settings, every plugin had to build its own settings plumbing. This plugin is the shared platform: one registration API namespaced by package name so dsh-foo and dsh-bar never collide, eight control types, and three scopes, all rendered into a single Granular Settings page inside the settings dialog, grouped one box per owning plugin.
The eight controls—toggle, text, color, number, slider, enum, multiselect, path—cover most real-world configuration needs. Enum and multiselect accept a zero-argument function in place of a static option list, evaluated at describe time, so an option list can track a live library without re-registration. Session, workspace, and global values land in their own JSON stores under / or ~. On the browser side a single useSetting hook handles context derivation, doorbell subscriptions, reconnect, window-focus refresh, and optimistic writes; no session open means session and workspace values read as undefined while global values keep working. When rows are not enough, an entire custom tab component can be contributed into the page scroll area.
This plugin is for DSH plugin authors who want users to tune behaviour without hand-rolling settings UI. Register your controls, declare scopes and defaults, and the page appears. The companion dsh-bouncing-squares-example ships three bouncing squares bound one-per-scope exercising seven control types—fork it and you have a working starting point.
截图预览
使用场景
- 插件作者需要让用户按会话、工作区、全局三级粒度配置行为,但不想每次都手写设置界面。
- 多个 DSH 插件共存于同一配置对话框,需要按命名空间隔离各插件的设置项且互不冲突。
- 插件需要暴露 enum 或 multiselect 控件,且选项列表需随运行时库动态更新而非硬编码。
适合人员
- 需要为用户提供可配置行为的 DSH 插件开发者。
- 同时维护多个 DSH 插件、希望共享同一设置页面的团队。
- 希望避免手写设置表单、快速完成配置注册的小型插件作者。