lakerian/dsh-plugin-term-dictionary ↗★ 0

dsh-plugin-term-dictionary

术语词典:自动识别对话中的生僻术语并建立词条,左侧插件区提供词典面板。已收录的词在回复中被划出,鼠标靠近显示简短解释,点击进入词典对应词条;选中词句可一键添加词条。 适合在对话中频繁遇到生僻术语,需要快速记录、划词解释和检索的用户。

패키지
dsh-plugin-term-dictionary
호환성
미검증
버전
1.0.0
라이선스
MIT
최근 업데이트
2026. 10. 9.

설치

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:lakerian/dsh-plugin-term-dictionary

配置

cordis.patch.yml 的 config 三项都可留空:

- insert:
    - id: term-dictionary
      name: 'dsh-plugin-term-dictionary'
      config:
        provider: deepseek-account   # 留空则用 profile 的默认模型路由(agentDefaultModel)
        model: deepseek-flash        # 留空则用该路由自己的默认模型
        dataDir: ''                  # 留空则用 $DSH_HOME/dsh-plugin-term-dictionary

本插件刻意不导出 Config。 Cordis 用 runtime.Config["~standard"].validate(config) 校验行配置,也就是要求一个 Standard Schema; 而 @deepseek-ai/schemastery(DSH 自己声明 schema 用的库)是宿主包,从 link 进 profile 的 插件里解析不到——本机已安装的第三方插件没有一个引用它。

这里曾经导出过一份 JSON Schema,后果不是「配置不校验」,而是整个插件无法激活:

TypeError: Cannot read properties of undefined (reading 'validate')
    at resolveConfig (.../cordis/lib/index.js:958:45)

看起来像插件坏了,实际是 schema 形状不对。不导出 Config 时 resolveConfig 原样返回行配置, 而上面三个字段在 lib/index.js 里都被防御性读取(类型不对就用回退值),所以空配置、错类型、 缺字段都不会让插件挂掉。代价是插件管理器里没有这张配置表单,改配置要写 cordis.patch.yml。 测试 manifest: the host half exports no activation-blocking Config 守住了这一点。