dsh-subagent-default-model 0.3.1 → 0.3.2
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/CHANGELOG.md +8 -1
- package/README.en.md +14 -11
- package/README.md +15 -12
- package/lib/client.js +35 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.3.2 (2026-08-24)
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- **设置面板迁移到「插件配置」**: 设置行从 `settings.general.item`(通用设置)迁移到 `settings.plugin.item`(插件配置),key 为 `subagent-default-model`。新增 `SubagentModelCard` 折叠卡片外壳,默认收起、点击展开,样式与其它可配置插件一致;卡片标题带插件名括号(如「子代理默认模型(dsh-subagent-default-model)」)。
|
|
8
|
+
- 文档同步:`README.md`、`plugin/README.md`、`PLUGIN_REQUIREMENTS.md`、`DEVELOPMENT.md` 中的「设置 → 通用设置 → 子代理默认模型」更新为「设置 → 插件配置 → 子代理默认模型」。
|
|
9
|
+
|
|
3
10
|
## 0.3.1 (2026-08-24)
|
|
4
11
|
|
|
5
12
|
### Docs
|
|
@@ -30,7 +37,7 @@
|
|
|
30
37
|
|
|
31
38
|
### Features
|
|
32
39
|
|
|
33
|
-
- Web
|
|
40
|
+
- Web 设置面板(插件配置 → 子代理默认模型)
|
|
34
41
|
- 保存成功 Toast 通知
|
|
35
42
|
|
|
36
43
|
## 0.1.0 (2026-08-16)
|
package/README.en.md
CHANGED
|
@@ -44,20 +44,23 @@ dsh plugin --profile desktop add dsh-subagent-default-model
|
|
|
44
44
|
|
|
45
45
|
## Release / Publish
|
|
46
46
|
|
|
47
|
-
Publish to the npm registry
|
|
47
|
+
Publish to the npm registry. **The full authoritative flow lives in [`RELEASING.md`](../../RELEASING.md)** (2FA confirmation, tag fix, proxy, verification).
|
|
48
|
+
|
|
49
|
+
Quick reference:
|
|
48
50
|
|
|
49
51
|
```sh
|
|
50
|
-
# 1.
|
|
51
|
-
# 2.
|
|
52
|
-
|
|
53
|
-
git
|
|
54
|
-
git
|
|
55
|
-
git
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
# 1. Test: npm --prefix plugin test
|
|
53
|
+
# 2. Bump version (plugin/package.json `version`) and update CHANGELOG.md
|
|
54
|
+
# 3. Commit and tag
|
|
55
|
+
git add plugin/package.json plugin/CHANGELOG.md
|
|
56
|
+
git commit -m "chore: bump version to X.Y.Z"
|
|
57
|
+
git tag -a vX.Y.Z -m "vX.Y.Z: <summary>"
|
|
58
|
+
git push origin main
|
|
59
|
+
git push origin vX.Y.Z
|
|
60
|
+
|
|
61
|
+
# 4. Publish to npm (if the account has 2FA, confirm in the browser)
|
|
58
62
|
cd plugin
|
|
59
|
-
npm
|
|
60
|
-
npm publish # `files` limits the published content: lib/, cordis.patch.yml, etc.
|
|
63
|
+
npm publish
|
|
61
64
|
```
|
|
62
65
|
|
|
63
66
|
> ⚠️ Run the tests first: `npm --prefix plugin test`.
|
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
|
|
17
17
|
## 截图
|
|
18
18
|
|
|
19
|
-
**设置面板**(`设置 →
|
|
19
|
+
**设置面板**(`设置 → 插件配置 → 子代理默认模型`):配置一个或多个模型路由,支持 `round-robin` / `random` 分配策略与每路由推理强度。
|
|
20
20
|
|
|
21
21
|

|
|
22
22
|
|
|
@@ -44,20 +44,23 @@ dsh plugin --profile desktop add dsh-subagent-default-model
|
|
|
44
44
|
|
|
45
45
|
## 发布(Release / Publish)
|
|
46
46
|
|
|
47
|
-
发布到 npm registry
|
|
47
|
+
发布到 npm registry。**完整权威流程见仓库根目录 [`RELEASING.md`](../../RELEASING.md)**(含 2FA 确认、tag 修正、代理、验证步骤)。
|
|
48
|
+
|
|
49
|
+
要点速览:
|
|
48
50
|
|
|
49
51
|
```sh
|
|
50
|
-
# 1.
|
|
51
|
-
# 2.
|
|
52
|
-
|
|
53
|
-
git
|
|
54
|
-
git
|
|
55
|
-
git
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
# 1. 测试:npm --prefix plugin test
|
|
53
|
+
# 2. 更新版本号(plugin/package.json 的 version 字段)和 CHANGELOG.md
|
|
54
|
+
# 3. 提交并打标签
|
|
55
|
+
git add plugin/package.json plugin/CHANGELOG.md
|
|
56
|
+
git commit -m "chore: 版本升级至 X.Y.Z"
|
|
57
|
+
git tag -a vX.Y.Z -m "vX.Y.Z: <说明>"
|
|
58
|
+
git push origin main
|
|
59
|
+
git push origin vX.Y.Z
|
|
60
|
+
|
|
61
|
+
# 4. 发布到 npm(账号若开启 2FA,需在浏览器确认一步)
|
|
58
62
|
cd plugin
|
|
59
|
-
npm
|
|
60
|
-
npm publish # files 字段已限定发布内容:lib/、cordis.patch.yml 等
|
|
63
|
+
npm publish
|
|
61
64
|
```
|
|
62
65
|
|
|
63
66
|
> ⚠️ 发布前先跑一遍测试:`npm --prefix plugin test`。
|
package/lib/client.js
CHANGED
|
@@ -11,7 +11,7 @@ window.__ModuleLoader__.load({
|
|
|
11
11
|
var Toast = primitives.Toast;
|
|
12
12
|
|
|
13
13
|
// ── CSS ──────────────────────────────────────────────────────────────
|
|
14
|
-
var SETTINGS_CSS = ".dsm-model-settings{display:flex;flex-direction:column;gap:14px;margin:20px 0;padding:14px 16px;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-1,#1c1d21));border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:12px}.dsm-model-settings-head{display:flex;flex-direction:column;gap:4px}.dsm-model-settings-title{font-size:14px;line-height:20px;font-weight:600;color:var(--dsw-alias-label-primary,#e6e6e6)}.dsm-model-settings-desc{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-list{display:flex;flex-direction:column;gap:8px}.dsm-model-settings-route{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;padding:8px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px}.dsm-model-settings-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-select{width:100%;height:32px;padding:0 28px 0 9px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:var(--dsw-alias-bg-layer-2,#232529);color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit}.dsm-model-settings-select:focus{outline:2px solid var(--dsw-alias-state-business-primary,#5686fe);outline-offset:1px}.dsm-model-settings-remove{height:32px;min-width:32px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer}.dsm-model-settings-remove:hover{color:var(--dsw-alias-state-error-primary,#ef4444);background:var(--dsw-alias-interactive-bg-hover-danger,rgba(242,90,90,.15))}.dsm-model-settings-options{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap}.dsm-model-settings-strategy{min-width:180px}.dsm-model-settings-actions{display:flex;align-items:center;gap:8px}.dsm-model-settings-status{font-size:12px;line-height:18px;color:var(--dsw-alias-state-success-primary,#22c55e)}.dsm-model-settings-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}";
|
|
14
|
+
var SETTINGS_CSS = ".dsm-model-settings{display:flex;flex-direction:column;gap:14px;margin:20px 0;padding:14px 16px;background:var(--dsw-alias-bg-module-platform,var(--dsw-alias-bg-layer-1,#1c1d21));border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:12px}.dsm-model-settings-head{display:flex;flex-direction:column;gap:4px}.dsm-model-settings-title{font-size:14px;line-height:20px;font-weight:600;color:var(--dsw-alias-label-primary,#e6e6e6)}.dsm-model-settings-desc{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-list{display:flex;flex-direction:column;gap:8px}.dsm-model-settings-route{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) auto;gap:8px;align-items:end;padding:8px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px}.dsm-model-settings-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}.dsm-model-settings-select{width:100%;height:32px;padding:0 28px 0 9px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:var(--dsw-alias-bg-layer-2,#232529);color:var(--dsw-alias-label-primary,#e6e6e6);font:inherit}.dsm-model-settings-select:focus{outline:2px solid var(--dsw-alias-state-business-primary,#5686fe);outline-offset:1px}.dsm-model-settings-remove{height:32px;min-width:32px;border:1px solid var(--dsw-alias-border-l2,#36373b);border-radius:8px;background:transparent;color:var(--dsw-alias-label-secondary,#b8b8b8);cursor:pointer}.dsm-model-settings-remove:hover{color:var(--dsw-alias-state-error-primary,#ef4444);background:var(--dsw-alias-interactive-bg-hover-danger,rgba(242,90,90,.15))}.dsm-model-settings-options{display:flex;align-items:end;justify-content:space-between;gap:12px;flex-wrap:wrap}.dsm-model-settings-strategy{min-width:180px}.dsm-model-settings-actions{display:flex;align-items:center;gap:8px}.dsm-model-settings-status{font-size:12px;line-height:18px;color:var(--dsw-alias-state-success-primary,#22c55e)}.dsm-plugin-card{border:1px solid var(--dsw-alias-border-l2,#36373b);background:var(--dsw-alias-bg-layer-3,#202126);border-radius:12px;list-style:none;transition:border-color .16s,background .16s}.dsm-plugin-card:hover{border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-open{background:var(--dsw-alias-bg-layer-2,#25262b);border-color:var(--dsw-alias-label-dimmed,#777)}.dsm-plugin-card-header{appearance:none;width:100%;font:inherit;color:inherit;text-align:left;cursor:pointer;background:transparent;border:0;border-radius:12px;align-items:center;gap:12px;padding:14px 16px;display:flex}.dsm-plugin-card-header:focus-visible{outline:2px solid var(--dsw-alias-brand-primary,#5686fe);outline-offset:-2px}.dsm-plugin-card-head{flex-direction:column;flex:1;gap:4px;min-width:0;display:flex}.dsm-plugin-card-title{color:var(--dsw-alias-label-primary,#e6e6e6);font-size:15px;font-weight:600;line-height:1.4}.dsm-plugin-card-description{color:var(--dsw-alias-label-tertiary,#999);font-size:13px;line-height:1.5}.dsm-plugin-card-chevron{color:var(--dsw-alias-label-tertiary,#999);flex:none;transition:transform .16s}.dsm-plugin-card-chevron-open{transform:rotate(180deg)}.dsm-plugin-card-body{border-top:1px solid var(--dsw-alias-border-l2,#36373b);margin:0 16px;padding:0 0 8px}.dsm-plugin-card-body .dsm-model-settings{margin:0;padding:12px 0 0;background:transparent;border:0;border-radius:0}.dsm-plugin-card-body .dsm-model-settings-head{display:none}.dsm-model-settings-hint{font-size:12px;line-height:18px;color:var(--dsw-alias-label-secondary,#b8b8b8)}";
|
|
15
15
|
|
|
16
16
|
if (typeof document !== "undefined") {
|
|
17
17
|
var cssId = "dsh-subagent-default-model/client.css";
|
|
@@ -27,7 +27,7 @@ window.__ModuleLoader__.load({
|
|
|
27
27
|
// ── locale ───────────────────────────────────────────────────────────
|
|
28
28
|
var SUBAGENT_ROW_LOCALE = "settings.subagentModel";
|
|
29
29
|
var SUBAGENT_ROW_ZH = {
|
|
30
|
-
"row.title": "
|
|
30
|
+
"row.title": "子代理默认模型(dsh-subagent-default-model)",
|
|
31
31
|
"row.desc": "为 subagent / subagent_fork 选择一个或多个默认路由;清空后子代理继承父会话路由。",
|
|
32
32
|
"row.provider": "Provider",
|
|
33
33
|
"row.model": "Model",
|
|
@@ -47,7 +47,7 @@ window.__ModuleLoader__.load({
|
|
|
47
47
|
"row.toastSaved": "子代理默认模型设置已保存。"
|
|
48
48
|
};
|
|
49
49
|
var SUBAGENT_ROW_EN = {
|
|
50
|
-
"row.title": "Subagent default model",
|
|
50
|
+
"row.title": "Subagent default model (dsh-subagent-default-model)",
|
|
51
51
|
"row.desc": "Choose one or more default routes for subagent / subagent_fork; clear them to inherit the parent session route.",
|
|
52
52
|
"row.provider": "Provider",
|
|
53
53
|
"row.model": "Model",
|
|
@@ -327,6 +327,34 @@ window.__ModuleLoader__.load({
|
|
|
327
327
|
);
|
|
328
328
|
}
|
|
329
329
|
|
|
330
|
+
// ── SubagentModelCard: collapsible card shell (default collapsed) ─────
|
|
331
|
+
function SubagentModelCard(props) {
|
|
332
|
+
var openState = React.useState(false);
|
|
333
|
+
var open = openState[0];
|
|
334
|
+
var setOpen = openState[1];
|
|
335
|
+
var t = props.t;
|
|
336
|
+
var title = t("row.title");
|
|
337
|
+
var description = t("row.desc");
|
|
338
|
+
return React.createElement("li", { className: "dsm-plugin-card" + (open ? " dsm-plugin-card-open" : "") },
|
|
339
|
+
React.createElement("button", {
|
|
340
|
+
type: "button",
|
|
341
|
+
className: "dsm-plugin-card-header",
|
|
342
|
+
"aria-expanded": open,
|
|
343
|
+
"aria-label": title,
|
|
344
|
+
onClick: function () { setOpen(!open); }
|
|
345
|
+
},
|
|
346
|
+
React.createElement("span", { className: "dsm-plugin-card-head" },
|
|
347
|
+
React.createElement("span", { className: "dsm-plugin-card-title" }, title),
|
|
348
|
+
React.createElement("span", { className: "dsm-plugin-card-description" }, description)
|
|
349
|
+
),
|
|
350
|
+
React.createElement("span", { className: "dsm-plugin-card-chevron" + (open ? " dsm-plugin-card-chevron-open" : "") }, "\u25be")
|
|
351
|
+
),
|
|
352
|
+
React.createElement("div", { className: "dsm-plugin-card-body", hidden: !open },
|
|
353
|
+
React.createElement(SubagentModelRow, props)
|
|
354
|
+
)
|
|
355
|
+
);
|
|
356
|
+
}
|
|
357
|
+
|
|
330
358
|
// ── apply: inject settings row ───────────────────────────────────────
|
|
331
359
|
var inject = ["sessions", "connection", "slots", "locale", "settingsScope", "remote"];
|
|
332
360
|
|
|
@@ -353,14 +381,13 @@ window.__ModuleLoader__.load({
|
|
|
353
381
|
};
|
|
354
382
|
};
|
|
355
383
|
|
|
356
|
-
ctx.slots.inject("settings.
|
|
384
|
+
ctx.slots.inject("settings.plugin.item", function () {
|
|
357
385
|
return ctx.slots.register({
|
|
358
|
-
name: "settings.
|
|
359
|
-
|
|
360
|
-
order: 5,
|
|
386
|
+
name: "settings.plugin.item",
|
|
387
|
+
key: "subagent-default-model",
|
|
361
388
|
locale: SUBAGENT_ROW_LOCALE,
|
|
362
389
|
inject: subagentRowInjected
|
|
363
|
-
},
|
|
390
|
+
}, SubagentModelCard);
|
|
364
391
|
});
|
|
365
392
|
}
|
|
366
393
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-subagent-default-model",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "Default model for subagent delegations, configurable via the `subagent-default-model` settings section (no explicit per-call model keeps inheriting the parent route).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|