dsh-model-routing 0.0.0-stage → 1.2.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.
package/docs/DETAIL.md ADDED
@@ -0,0 +1,60 @@
1
+ # 模型分工 Model routing
2
+
3
+ ## 它做什么
4
+
5
+ 给五类工作各指定一个模型:
6
+
7
+ | 分类 | 适合的活 |
8
+ |---|---|
9
+ | 规划与文案 | 长文论证、写说明稿、审改文字 |
10
+ | 写代码 | 写脚本、改配置、生成图表的代码(只出内容,不改文件) |
11
+ | 出图 | 生成或改写图片、封面、插图(不写代码) |
12
+ | 看图审错 | 检查图纸、界面、版面,指出问题 |
13
+ | 决策与执行 | 唯一能改文件、跑脚本、做最终验证的那一类 |
14
+
15
+ 同一页还显示:中转方的调用次数与 token、本机(deepseek)最近 7 天的用量、以及一个手填的余额栏。
16
+
17
+ ## 模型列表是动态的
18
+
19
+ 下拉框的选项来自你在 DSH 里**已经配置好的提供方**,不是插件写死的名单:
20
+
21
+ ```
22
+ ~/.dsh/profiles/<profile>/cordis.patch.yml
23
+ └─ llm-pi-ai
24
+ └─ providers
25
+ └─ <providerId>: displayName / models[].id
26
+ ```
27
+
28
+ 所以换中转、加模型,只要在 DSH 设置里改一次,这里立刻能看到。
29
+ 一个提供方都没配时,五行会变灰,并提示去设置里添加;也可以用手动输入 `provider/model` 临时添加。
30
+
31
+ ## 存储位置
32
+
33
+ ```
34
+ ~/.dsh/model-routing.json 分工配置(routing + balances)
35
+ ~/.dsh/model-routing-usage.json 调用日志(可选;不记则"中转用量"为空)
36
+ ```
37
+
38
+ 本机用量读 `~/.dsh/storages/cost-meter/ledger.json`(需要 dsh-cost-meter 插件)。
39
+
40
+ ## 两个入口
41
+
42
+ - 左侧栏「模型分工」
43
+ - 设置 → 模型分工
44
+
45
+ 两处是同一个面板。
46
+
47
+ ## 局限
48
+
49
+ - **插件不调用模型。** 它只是一份"该用谁"的约定;真正发起调用的是 agent 或你自己的脚本。
50
+ - **余额只能手填**:中转站普遍没有公开的余额查询接口。
51
+ - **中转用量依赖外部记录**:没有脚本往 `model-routing-usage.json` 写,这一列就是空的。
52
+ - **模型列表靠解析 profile 配置**:DSH 大版本改动配置结构时,这里可能需要跟着改。
53
+
54
+ ## 卸载
55
+
56
+ ```bash
57
+ dsh plugin --profile <name> remove dsh-model-routing
58
+ ```
59
+
60
+ 配置文件保留,删掉 `~/.dsh/model-routing.json` 即彻底清空。
@@ -0,0 +1,75 @@
1
+ # 发布清单(dsh-model-routing)
2
+
3
+ > 查证时间 2026-12-03。规则来自 awesome-dsh-plugin 的贡献指南与 dshmarket 的 README。
4
+ > 市场规则会变,动手前以仓库里的 `contributing.md` 为准。
5
+
6
+ ## 结论:上架 = 一个仓库 + 一个 PR
7
+
8
+ ```
9
+ 插件列表的数据源 awesome-dsh-plugin 仓库的 data/plugins/*.yml
10
+ dshmarket(市场应用) 只是读这份列表,明确不直接收条目
11
+ 所以「上架」= 公开 GitHub 仓库 + 往 awesome-dsh-plugin 提一个 YAML PR
12
+ 合并后站点与市场一般 1 天内自动收录
13
+ ```
14
+
15
+ ## 硬门槛(CI 会查,逐条对)
16
+
17
+ | 项 | 现状 |
18
+ |---|---|
19
+ | 公开 GitHub 仓库 | ⬜ 待建(`sunner-ds/SUN`) |
20
+ | 仓库创建满 1 天 | ⬜ 建完要等到第二天 |
21
+ | 提交数 ≥ 10 | ⬜ 待补(现在还没初始化仓库) |
22
+ | `package.json` 声明 `dsh.bundle` | ✅ 已声明 |
23
+ | `cordis.patch.yml` 在默认分支 | ✅ 有 |
24
+ | 打 `dsh-plugin` topic | ⬜ 建仓库后点一下 |
25
+ | 中英双语展示元数据 | ✅ `locale/en.json` + `locale/zh.json` |
26
+ | MIT LICENSE / README / 图标 / 详情页 | ✅ 四项齐全 |
27
+ | 真实可用代码(占位仓库不收) | ✅ host + client 都能跑 |
28
+
29
+ ## 步骤
30
+
31
+ ### ① 建仓库并推送
32
+
33
+ ```bash
34
+ cd "D:\deep seek work\chajia\plugins\dsh-model-routing"
35
+ git init
36
+ git add .
37
+ git commit -m "feat: model routing panel for DSH"
38
+ # 再补到 10 个提交(CI 查提交数):可以按功能拆分提交,
39
+ # 例如 locale、docs、icon、client i18n、catalog 解析 各一个
40
+ git remote add origin https://github.com/sunner-ds/SUN.git
41
+ git push -u origin main
42
+ ```
43
+
44
+ **注意**:这台机器现在直连 GitHub 可能不通(之前的系统代理已关)。推之前先试 `git ls-remote`,不通就开代理或换 https + token。
45
+
46
+ ### ② 打 topic
47
+
48
+ GitHub 仓库页 → 右上 About 的齿轮 → Topics 填 `dsh-plugin` → 保存。
49
+
50
+ ### ③ (推荐)发 npm
51
+
52
+ 市场装包优先走 npm tarball,且会校验 `repository` 与仓库一致(防冒名)。
53
+
54
+ ```bash
55
+ # 本机 .npmrc 指向镜像时,必须显式指定官方源
56
+ pnpm publish --access public --no-git-checks --registry=https://registry.npmjs.org
57
+ ```
58
+
59
+ 包名 `dsh-model-routing` 先在 https://registry.npmjs.org/dsh-model-routing 确认没被占。
60
+
61
+ ### ④ 提 PR 到 awesome-dsh-plugin
62
+
63
+ 新增一个文件 `data/plugins/sunner-ds__SUN.yml`,内容见本目录 `market-entry.yml`。
64
+ 一个 PR 只加一个文件。
65
+
66
+ ### ⑤ 等收录
67
+
68
+ 合并后 `https://awesome-dsh-plugin.com/plugins.json` 重建,市场打开时实时拉取,一般 1 天内能看到。
69
+
70
+ ## 发布前最后一道自检
71
+
72
+ - [ ] 目录里没有真名、学号、手机号(`.gitignore` 已挡,但仓库是新的,再搜一次)
73
+ - [ ] 没有密钥(本插件不含 key,配置只存在用户本机 `~/.dsh/model-routing.json`)
74
+ - [ ] README 里「局限」那几条写的是真实行为
75
+ - [ ] 版本号 1.0.0,与 market-entry 里一致
package/icon.svg ADDED
@@ -0,0 +1,6 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" width="32" height="32">
2
+ <rect x="3" y="4" width="11" height="10" rx="1.5" fill="none" stroke="#2f6d8f" stroke-width="2"/>
3
+ <rect x="18" y="4" width="11" height="10" rx="1.5" fill="none" stroke="#2f6d8f" stroke-width="2"/>
4
+ <rect x="3" y="18" width="11" height="10" rx="1.5" fill="none" stroke="#2f6d8f" stroke-width="2"/>
5
+ <rect x="18" y="18" width="11" height="10" rx="1.5" fill="#2f6d8f"/>
6
+ </svg>