Skip to content

dsh-model-enhance

Verified

@qq410350809/dsh-model-enhance · v0.1.2 · MIT · Web UI

模型增强:编辑推理强度(reasoningEfforts)与模型选择器接入方显示模式

Install

dsh plugin add @qq410350809/dsh-model-enhance

Confirm the layer applied with dsh --profile default --dump-config — see the install guide.

Source

Creators

Readme

dsh-model-enhance

在 DeepSeek Harness(DSH)Web 设置页新增「模型增强」板块的插件,按提供方与模型编辑:

  • 推理强度reasoningEfforts)——开关 + 多选等级(off / minimal / low / medium / high / xhigh / max),对应 DSH llm-pi-ai 适配器接受的全部思维等级。
  • 接入方显示模式——可选开关:在模型选择器中,于模型名称前显示接入方(提供方)名称徽标,数据取自同一份 llm-pi-ai 配置。

改动即时生效(llm-pi-ai 命名空间以 live 语义注册),并保留配置里的其他字段。

工作原理

llm-pi-ai.providers 这一节由 DSH 暴露为同名设置命名空间(llm-pi-ai,由 dsh-llm-pi-ai 通过 installSettingsSection 注册),所以本插件不需要任何 host 端逻辑

  • host 端只是一个空的注册标记(src/index.ts),让该包进入 host Loader 与客户端 boot graph;
  • 浏览器端(src/client/**)通过 connection.api.settings.describe / settings.mutate 读写 llm-pi-ai 命名空间,并通过 settings.section slot 注册设置页板块。

目录结构

src/
  index.ts                     # host 插件入口(空 apply 标记)
  contract.ts                  # 共享类型与常量(纯 TS,无 React/DOM)
  client/
    index.ts                   # 客户端插件入口(slot + locale + 失效订阅)
    store.ts                   # 纯逻辑:readConfig / buildOps
    ModelEnhanceSection.tsx    # 设置页 React 组件
    styles.ts                  # 注入的样式表(--dsw-alias-* 设计令牌)
    locales.ts                 # 中英文字典
tests/
  store.spec.mjs               # readConfig / buildOps 单元测试(node:test)

构建

pnpm install               # 安装 esbuild / typescript 等 devDependencies
bash scripts/link-types.sh # 把 @deepseek-ai/* 类型包链接进 node_modules(仅 tsc 需要)
node build.mjs             # esbuild 产出 lib/index.js + lib/client.js + lib/store.js,再 tsc 产出 .d.ts
node --test tests/*.spec.mjs   # 运行单元测试

说明:src/ 里所有 @deepseek-ai/* 导入都是 import type(esbuild 会抹除、并 external 化), 因此编译产物不依赖它们;只有 tsc 类型检查与 .d.ts 产出需要这些类型。 link-types.sh 默认从 /usr/local/lib/node_modules/@deepseek-ai/dsh/node_modules/@deepseek-ai 链接,可用 DSH_NM=... 覆盖为你的 DSH checkout 路径。

安装到 Web profile

从 npm 安装(已发布为 @qq410350809/dsh-model-enhance):

dsh plugin --profile web add @qq410350809/dsh-model-enhance

或从 GitHub tag 安装(仓库已含编译好的 lib/):

dsh plugin --profile web add https://github.com/qq410350809/dsh-model-enhance/archive/refs/tags/v0.1.0.tar.gz

请固定到 tag 而不是 mainrefs/heads/main 的 tarball 每次 push 都会变,会导致后续 pnpm install 的 lockfile 校验和报错。

或在 ~/.dsh/profiles/web/package.json 手工添加依赖与 bundle 条目:

{
  "dependencies": {
    "@qq410350809/dsh-model-enhance": "^0.1.0"
  },
  "dsh": {
    "profile": {
      "bundles": [
        "@deepseek-ai/dsh-base",
        "@deepseek-ai/dsh-web-app",
        "@qq410350809/dsh-model-enhance"
      ]
    }
  }
}

随后在该 profile 目录执行 pnpm install,重启 dsh web 即可在「设置 → 模型增强」看到板块。

本地开发调试时可改用 link: 安装: dsh plugin --profile web add link:/Applications/custom/dsh-plugins/dsh-model-enhance