dsh-plugin-effort-declare 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (62) hide show
  1. package/CONTRIBUTING.en.md +57 -0
  2. package/CONTRIBUTING.md +57 -0
  3. package/INSTALL.en.md +62 -0
  4. package/INSTALL.md +62 -0
  5. package/LICENSE +21 -0
  6. package/README.en.md +64 -0
  7. package/README.md +64 -0
  8. package/cordis.patch.yml +5 -0
  9. package/lib/client.js +1237 -0
  10. package/lib/client.js.map +1 -0
  11. package/lib/index.js +6 -0
  12. package/lib/types/client/EffortDeclareSection.d.ts +24 -0
  13. package/lib/types/client/EffortDeclareSection.d.ts.map +1 -0
  14. package/lib/types/client/index.d.ts +15 -0
  15. package/lib/types/client/index.d.ts.map +1 -0
  16. package/lib/types/client/load-drafts.d.ts +20 -0
  17. package/lib/types/client/load-drafts.d.ts.map +1 -0
  18. package/lib/types/client/locales.d.ts +8 -0
  19. package/lib/types/client/locales.d.ts.map +1 -0
  20. package/lib/types/client/schema-ops.d.ts +13 -0
  21. package/lib/types/client/schema-ops.d.ts.map +1 -0
  22. package/lib/types/core/catalog.d.ts +31 -0
  23. package/lib/types/core/catalog.d.ts.map +1 -0
  24. package/lib/types/core/drafts.d.ts +53 -0
  25. package/lib/types/core/drafts.d.ts.map +1 -0
  26. package/lib/types/core/efforts.d.ts +32 -0
  27. package/lib/types/core/efforts.d.ts.map +1 -0
  28. package/lib/types/core/filter.d.ts +28 -0
  29. package/lib/types/core/filter.d.ts.map +1 -0
  30. package/lib/types/core/path-ops.d.ts +40 -0
  31. package/lib/types/core/path-ops.d.ts.map +1 -0
  32. package/lib/types/core/paths.d.ts +16 -0
  33. package/lib/types/core/paths.d.ts.map +1 -0
  34. package/lib/types/core/presets.d.ts +31 -0
  35. package/lib/types/core/presets.d.ts.map +1 -0
  36. package/lib/types/core/validate.d.ts +3 -0
  37. package/lib/types/core/validate.d.ts.map +1 -0
  38. package/lib/types/index.d.ts +10 -0
  39. package/lib/types/index.d.ts.map +1 -0
  40. package/package.json +87 -0
  41. package/src/README.en.md +23 -0
  42. package/src/README.md +23 -0
  43. package/src/client/EffortDeclareSection.tsx +496 -0
  44. package/src/client/README.en.md +27 -0
  45. package/src/client/README.md +27 -0
  46. package/src/client/effort-declare.module.css +278 -0
  47. package/src/client/index.ts +97 -0
  48. package/src/client/load-drafts.ts +83 -0
  49. package/src/client/locales.ts +133 -0
  50. package/src/client/schema-ops.ts +20 -0
  51. package/src/core/README.en.md +27 -0
  52. package/src/core/README.md +27 -0
  53. package/src/core/catalog.ts +61 -0
  54. package/src/core/drafts.ts +137 -0
  55. package/src/core/efforts.ts +119 -0
  56. package/src/core/filter.ts +82 -0
  57. package/src/core/path-ops.ts +65 -0
  58. package/src/core/paths.ts +45 -0
  59. package/src/core/presets.ts +104 -0
  60. package/src/core/validate.ts +7 -0
  61. package/src/css-modules.d.ts +6 -0
  62. package/src/index.ts +11 -0
@@ -0,0 +1,57 @@
1
+ # Contributing
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <a href="./CONTRIBUTING.md">中文</a> ·
6
+ <strong>English</strong>
7
+ </samp>
8
+ </p>
9
+
10
+ Back to the [README](./README.en.md). Issues and pull requests are welcome.
11
+
12
+ ## Boundary
13
+
14
+ Write `llm-pi-ai` settings only:
15
+
16
+ - No `llm/stream` intercept
17
+ - No fork of the official Models page
18
+ - No parallel effort table
19
+ - No per-model `reasoningEfforts` in the bundle layer (settings dict merge has no delete semantics)
20
+ - Do not set route-level `reasoning` to `high`
21
+
22
+ Any new model-visible input must land in a session-log-rebuildable mechanism. This plugin does not inject prompt text.
23
+
24
+ Clearing a declaration unsets `reasoningEfforts` (absence = default off). Do not write `false`.
25
+
26
+ ## Development
27
+
28
+ ```bash
29
+ pnpm install
30
+ pnpm test
31
+ pnpm typecheck
32
+ pnpm build
33
+ ```
34
+
35
+ - Host and client must use separate `tsconfig` files (their Context merges cannot share one TypeScript program)
36
+ - The client bundle must not inline `@deepseek-ai/*` except platform modules in the shell’s frozen table. Collaborate through Cordis services; do not value-import the official Models page
37
+ - Source: [src/README.md](./src/README.md); domain logic: [src/core/README.md](./src/core/README.md); settings UI: [src/client/README.md](./src/client/README.md); tests: [tests/README.md](./tests/README.md)
38
+
39
+ Before sending a change, say whether it is a bugfix, UI improvement, or an alignment with a newer DSH / pi-ai schema. Update zh and en docs together. The root README and [INSTALL.en.md](./INSTALL.en.md) are for users; this file and the READMEs under `src/` and `tests/` are for people changing code.
40
+
41
+ Canonical level names and `thinkingFormat` enums come from the installed `llm-pi-ai` schema / catalog. The repo keeps a fallback whitelist pinned by tests; if the schema drifts, update the tests first, then the UI.
42
+
43
+ ## Publishing to npm
44
+
45
+ The package name is unscoped `dsh-plugin-effort-declare`. After `npm login`, with a clean working tree:
46
+
47
+ ```bash
48
+ pnpm test && pnpm typecheck && pnpm build
49
+ pnpm pack # confirm the tarball contains lib/ and cordis.patch.yml
50
+ pnpm publish
51
+ ```
52
+
53
+ `pnpm publish` fails on an unclean Git tree. Commit first (and preferably push). Do not pass `--no-git-checks`.
54
+
55
+ ## Security
56
+
57
+ Do not paste API keys or `.credentials.yaml` values into logs, screenshots, docs, or issues.
@@ -0,0 +1,57 @@
1
+ # 贡献
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <strong>中文</strong> ·
6
+ <a href="./CONTRIBUTING.en.md">English</a>
7
+ </samp>
8
+ </p>
9
+
10
+ 回到 [README](./README.md)。欢迎 Issue 与 Pull Request。
11
+
12
+ ## 边界
13
+
14
+ 只写 `llm-pi-ai` 配置:
15
+
16
+ - 不要加 `llm/stream` 拦截
17
+ - 不要 fork 官方模型页
18
+ - 不要平行再存一份档位表
19
+ - 不要在 bundle 层预置 per-model `reasoningEfforts`(settings 字典合并没有删除语义)
20
+ - 不要把路由级 `reasoning` 写成 `high`
21
+
22
+ 新增任何模型可见输入,必须走会话日志可重建的机制。本插件不向模型注入提示词。
23
+
24
+ 「清除声明」是删掉 `reasoningEfforts`(缺席 = 默认关闭),不要写成 `false`。
25
+
26
+ ## 开发
27
+
28
+ ```bash
29
+ pnpm install
30
+ pnpm test
31
+ pnpm typecheck
32
+ pnpm build
33
+ ```
34
+
35
+ - Host 与 client 必须分 `tsconfig`(两边 Context merge 不能共一个 TypeScript Program)
36
+ - 客户端 bundle 禁止把 `@deepseek-ai/*` 打进包内(shell 冻结模块表里的平台模块除外)。跨插件协作走 Cordis 服务,不要 value-import 官方模型页
37
+ - 源码:[src/README.md](./src/README.md);领域逻辑:[src/core/README.md](./src/core/README.md);设置页:[src/client/README.md](./src/client/README.md);测试:[tests/README.md](./tests/README.md)
38
+
39
+ 提交前请说明改动是修 bug、增强 UI,还是对齐新的 DSH / pi-ai schema。中英文档一起改。根 README 和 [INSTALL.md](./INSTALL.md) 面向使用者;本文件与 `src/`、`tests/` 的 README 面向改代码的人。
40
+
41
+ 上游档位名与 `thinkingFormat` 枚举以 DSH 安装里 `llm-pi-ai` 的 schema / catalog 为准。仓库内有一份回退白名单,并由测试钉住;schema 漂移时应先改测试再改 UI。
42
+
43
+ ## 发布到 npm
44
+
45
+ 包名 `dsh-plugin-effort-declare`(未加 scope)。先 `npm login`,工作区干净后再:
46
+
47
+ ```bash
48
+ pnpm test && pnpm typecheck && pnpm build
49
+ pnpm pack # 确认 tarball 含 lib/ 与 cordis.patch.yml
50
+ pnpm publish
51
+ ```
52
+
53
+ `pnpm publish` 在 Git 有未提交改动时会失败。应先 commit(建议再 push),不要用 `--no-git-checks` 绕过。
54
+
55
+ ## 安全
56
+
57
+ 不要在日志、截图、文档或 issue 中粘贴 API 密钥或 `.credentials.yaml` 的值。
package/INSTALL.en.md ADDED
@@ -0,0 +1,62 @@
1
+ # Install
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <a href="./INSTALL.md">中文</a> ·
6
+ <strong>English</strong>
7
+ </samp>
8
+ </p>
9
+
10
+ Back to the [README](./README.en.md). Requires DeepSeek Harness **0.1.0-rc.8 or newer**. Do not use `npm install`; use `dsh plugin` below.
11
+
12
+ ## Desktop users: do this first
13
+
14
+ `dsh plugin` installs into the **current** `DSH_HOME`. If unset, that is `.dsh` in your user folder — **not** Desktop’s data directory.
15
+
16
+ PowerShell:
17
+
18
+ ```powershell
19
+ $env:DSH_HOME = "$env:APPDATA\io.github.hairyf.deepseek-harness-desktop\data\dsh"
20
+ ```
21
+
22
+ Set this before the install command. The profile name is usually `web`.
23
+
24
+ ## From npm (recommended)
25
+
26
+ ```bash
27
+ dsh plugin --profile web add dsh-plugin-effort-declare
28
+ ```
29
+
30
+ Optional: confirm it is loaded:
31
+
32
+ ```bash
33
+ dsh --profile web --dump-config
34
+ ```
35
+
36
+ The output should mention `dsh-plugin-effort-declare`.
37
+
38
+ ## Other methods
39
+
40
+ GitHub:
41
+
42
+ ```bash
43
+ dsh plugin --profile web add github:zimodzh/dsh-plugin-effort-declare
44
+ ```
45
+
46
+ If pnpm refuses to build, add the package name to `allowBuilds` in that profile’s `pnpm-workspace.yaml`, then `add` again.
47
+
48
+ Local folder (`lib/` must already exist; on Windows prefer forward slashes):
49
+
50
+ ```bash
51
+ dsh plugin --profile web add file:/absolute/path/to/dsh-plugin-effort-declare
52
+ ```
53
+
54
+ ## After install
55
+
56
+ Restart DSH (on Desktop, restart its backend). Open **Settings → Reasoning efforts**. Add a custom provider on the Models page first; otherwise this page has nothing to edit.
57
+
58
+ ## Uninstall
59
+
60
+ ```bash
61
+ dsh plugin --profile web remove dsh-plugin-effort-declare
62
+ ```
package/INSTALL.md ADDED
@@ -0,0 +1,62 @@
1
+ # 安装
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <strong>中文</strong> ·
6
+ <a href="./INSTALL.en.md">English</a>
7
+ </samp>
8
+ </p>
9
+
10
+ 回到 [README](./README.md)。需要 DeepSeek Harness **0.1.0-rc.8 或更新**。不要用 `npm install`,必须用下面的 `dsh plugin` 命令。
11
+
12
+ ## Desktop 用户请先做这一步
13
+
14
+ `dsh plugin` 会装进**当前** `DSH_HOME`。没设置时默认是用户目录下的 `.dsh`,**不是** Desktop 自己的数据目录。
15
+
16
+ PowerShell:
17
+
18
+ ```powershell
19
+ $env:DSH_HOME = "$env:APPDATA\io.github.hairyf.deepseek-harness-desktop\data\dsh"
20
+ ```
21
+
22
+ 设好后再跑安装命令。配置档名称一般是 `web`。
23
+
24
+ ## 从 npm 安装(推荐)
25
+
26
+ ```bash
27
+ dsh plugin --profile web add dsh-plugin-effort-declare
28
+ ```
29
+
30
+ 可选:确认已经装上:
31
+
32
+ ```bash
33
+ dsh --profile web --dump-config
34
+ ```
35
+
36
+ 输出里应出现 `dsh-plugin-effort-declare`。
37
+
38
+ ## 其他方式
39
+
40
+ GitHub:
41
+
42
+ ```bash
43
+ dsh plugin --profile web add github:zimodzh/dsh-plugin-effort-declare
44
+ ```
45
+
46
+ 如果 pnpm 拒绝构建,把包名加进该配置档里 `pnpm-workspace.yaml` 的 `allowBuilds`,再 `add` 一次。
47
+
48
+ 本地文件夹(仓库里需要已有 `lib/`;Windows 建议用正斜杠):
49
+
50
+ ```bash
51
+ dsh plugin --profile web add file:/绝对路径/dsh-plugin-effort-declare
52
+ ```
53
+
54
+ ## 装完之后
55
+
56
+ 重启 DSH(Desktop 请重启其后端)。打开 **设置 → 推理档位**。先在「模型」页添加第三方提供方,本页才会出现可编辑的条目。
57
+
58
+ ## 卸载
59
+
60
+ ```bash
61
+ dsh plugin --profile web remove dsh-plugin-effort-declare
62
+ ```
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Stardust
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.en.md ADDED
@@ -0,0 +1,64 @@
1
+ # dsh-plugin-effort-declare
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <a href="./README.md">中文</a> ·
6
+ <strong>English</strong>
7
+ </samp>
8
+ </p>
9
+
10
+ Add reasoning-effort options to OpenAI-compatible models you added yourself, so the Effort row shows up in the composer.
11
+
12
+ This is a community plugin. It is not an official DeepSeek project and is not endorsed by DeepSeek. Requires DeepSeek Harness **0.1.0-rc.8 or newer**.
13
+
14
+ ## Why
15
+
16
+ Custom providers you add on the Models page usually have no reasoning levels, so the composer hides Effort. This plugin adds a **Reasoning efforts** page in Settings: you pick which levels a model can offer. The per-turn choice and the HTTP request still go through DSH. This plugin only writes settings, not API keys.
17
+
18
+ - Does not change models you have not saved
19
+ - Does not change the current or default effort
20
+ - Does not replace the official Models page
21
+
22
+ ## Features
23
+
24
+ | Feature | What it does |
25
+ | --- | --- |
26
+ | Reasoning efforts page | Choose levels per model; change the gateway spelling if it differs |
27
+ | Presets | DeepSeek compatible, OpenAI compatible, or on/off only. A preset **replaces** that dialect; it does not stack |
28
+ | vs Models | Models owns the endpoint, keys, and model list; this page only declares which reasoning levels are offered |
29
+
30
+ ## Install
31
+
32
+ Do not use `npm install`. In a terminal:
33
+
34
+ ```bash
35
+ dsh plugin --profile web add dsh-plugin-effort-declare
36
+ ```
37
+
38
+ If you use **DeepSeek Harness Desktop**, set `DSH_HOME` first or the package lands in the wrong folder. See the [install guide](./INSTALL.en.md).
39
+
40
+ Restart DSH, then open **Settings → Reasoning efforts**. Add a custom provider on the Models page first. GitHub, local folder, and uninstall: [install guide](./INSTALL.en.md).
41
+
42
+ ## Usage
43
+
44
+ 1. Open the provider card, or apply a preset first.
45
+ 2. Check the levels that should appear in the picker. Change the spelling if the gateway uses different names. Off (no thinking) can be: not offered; offered without sending a parameter; or send `none` (or another string).
46
+ 3. You can usually leave **Advanced** collapsed.
47
+ 4. Save. If you selected no thinking level, or only Off, the error is shown on that card.
48
+
49
+ Saving is disabled when settings are read-only.
50
+
51
+ ## Limits
52
+
53
+ - Only custom providers you added on Models, using the OpenAI Completions protocol
54
+ - Official DeepSeek, catalog models, and Anthropic endpoints are not edited here
55
+ - **Clear this model’s declaration** hides the Effort row again for that model
56
+ - Will not silently turn thinking on for background work such as titles or compaction
57
+
58
+ ## Development
59
+
60
+ Code, pull requests, and npm publishing: [CONTRIBUTING.en.md](./CONTRIBUTING.en.md).
61
+
62
+ ## License
63
+
64
+ [MIT](./LICENSE) © 2026 Stardust
package/README.md ADDED
@@ -0,0 +1,64 @@
1
+ # dsh-plugin-effort-declare
2
+
3
+ <p align="center">
4
+ <samp>
5
+ <strong>中文</strong> ·
6
+ <a href="./README.en.md">English</a>
7
+ </samp>
8
+ </p>
9
+
10
+ 给自己添加的 OpenAI 兼容模型补上「推理强度」选项,对话里的 Effort 行就会出现。
11
+
12
+ 这是社区插件,不是 DeepSeek 官方项目,也未获官方背书。需要 DeepSeek Harness **0.1.0-rc.8 或更新**。
13
+
14
+ ## 它解决什么
15
+
16
+ 你在「模型」页手工加的第三方接口,通常没有推理档位,所以对话里看不到 Effort。装上本插件后,设置里会多一页 **推理档位**:勾选这个模型能提供哪些档。对话里怎么选、请求怎么发给接口,仍由 DSH 处理。本插件只改设置,不改密钥。
17
+
18
+ - 不会自动改你没保存过的模型
19
+ - 不会改你当前选中的档位,也不会改默认档位
20
+ - 不会替换官方「模型」页
21
+
22
+ ## 功能
23
+
24
+ | 功能 | 说明 |
25
+ | --- | --- |
26
+ | 推理档位页 | 按模型勾选可选档位;网关用的名字如果不同,可以改拼写 |
27
+ | 预设 | DeepSeek 兼容、OpenAI 兼容、只开/关思考。点预设会换成那一套,不是叠加上去 |
28
+ | 和「模型」页 | 「模型」管地址、密钥和模型名单;本页只管「能选哪些推理档」 |
29
+
30
+ ## 安装
31
+
32
+ 不要用 `npm install`。在终端执行:
33
+
34
+ ```bash
35
+ dsh plugin --profile web add dsh-plugin-effort-declare
36
+ ```
37
+
38
+ 若使用 **DeepSeek Harness Desktop**,必须先设置 `DSH_HOME`,否则会装到另一份目录。步骤见 [安装说明](./INSTALL.md)。
39
+
40
+ 装完后重启 DSH,打开 **设置 → 推理档位**。请先在「模型」页添加过第三方提供方。GitHub、本地文件夹和卸载也在 [安装说明](./INSTALL.md)。
41
+
42
+ ## 使用
43
+
44
+ 1. 打开对应提供方的卡片,或先点一个预设。
45
+ 2. 勾选这个模型要出现在选择器里的档位。网关名字不同就改拼写。关闭思考(Off)可以:不提供、提供但不发参数、或发送 `none` 等字符串。
46
+ 3. 一般不用打开「高级」。
47
+ 4. 点保存。若一个思考档都没选、或只开了 Off,错误会显示在这张卡片上。
48
+
49
+ 当前设置为只读时无法保存。
50
+
51
+ ## 限制
52
+
53
+ - 只对你在「模型」页**手工添加**、协议为 OpenAI Completions 的提供方生效
54
+ - 官方 DeepSeek、目录自带的模型、Anthropic 接口不在本页编辑
55
+ - 「清除本模型声明」之后,这个模型会重新没有 Effort 行
56
+ - 不会在生成标题、压缩等后台请求里偷偷打开思考
57
+
58
+ ## 开发
59
+
60
+ 改代码、提 PR、发布到 npm:见 [CONTRIBUTING.md](./CONTRIBUTING.md)。
61
+
62
+ ## License
63
+
64
+ [MIT](./LICENSE) © 2026 Stardust
@@ -0,0 +1,5 @@
1
+ # Inserts the dual-face plugin row. Host apply is empty in v1; the browser
2
+ # half (package.json dsh.client) registers the settings.section.
3
+ - insert:
4
+ - id: dsh-plugin-effort-declare
5
+ name: 'dsh-plugin-effort-declare'