@deepseek-ai/dsh-client-ui-model-selection 0.1.6-alpha.2 → 0.1.7-alpha.1
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/README.i18n.yaml +2 -2
- package/README.md +4 -0
- package/README.zh.md +4 -0
- package/lib/client.js +12 -9
- package/package.json +18 -18
package/README.i18n.yaml
CHANGED
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
3
|
# after editing either side, bring the other along and re-record with:
|
|
4
4
|
# pnpm run verify-translation-pairing --write packages/client/ui-model-selection/README.md
|
|
5
|
-
README.md:
|
|
6
|
-
README.zh.md:
|
|
5
|
+
README.md: 37253cf04242275f22d646da0e65cfd44f4fefbf
|
|
6
|
+
README.zh.md: 4e339e6a6c6db8c3125e6ccc19c0fc3af9947f88
|
package/README.md
CHANGED
|
@@ -31,10 +31,14 @@ Mount this plugin alongside `ui-conversation` and the commands package; the comp
|
|
|
31
31
|
|
|
32
32
|
Models stay grouped by provider. The composer menu shows model and effort names only. The `/model` popup shows provider names and catalog descriptions; it localizes the two built-in DeepSeek descriptions and leaves external provider descriptions verbatim. The popup applies the selected model's default effort; the composer can then choose any advertised effort. An adapter without reasoning metadata leaves the Effort row absent; there is no arbitrary effort input.
|
|
33
33
|
|
|
34
|
+
The composer replaces the model and effort text with the Models icon when the expanded controls cannot share one line, and restores the text when space permits. The full selection remains available in the trigger's accessible name, tooltip, and menu.
|
|
35
|
+
|
|
34
36
|
### Unroutable sessions
|
|
35
37
|
|
|
36
38
|
When the Host reports that no adapter serves the session's route, this plugin raises a composer block and the input goes inert with its own copy; recovering clears it without a reload. A `null` before the first load or after one failed never blocks, and catalog membership never blocks either — a route serving a model it does not advertise is missing from the groups yet usable.
|
|
37
39
|
|
|
40
|
+
Only the current Client binding's directory can publish its composer block. Cleanup from an older binding preserves a replacement directory's block; without a replacement directory, cleanup removes the obsolete block.
|
|
41
|
+
|
|
38
42
|
### Selection failures
|
|
39
43
|
|
|
40
44
|
When another writer owns the Session, model-selection failures tell the user to quit other running DSH instances and retry.
|
package/README.zh.md
CHANGED
|
@@ -31,10 +31,14 @@ Web GUI 允许用户通过 `/model` 弹窗或 composer 模型控件切换既有
|
|
|
31
31
|
|
|
32
32
|
模型按提供方分组。composer 菜单只显示模型与推理强度名称。`/model` 弹窗显示提供方名称与目录说明;其中两个内置 DeepSeek 模型的说明使用当前语言,外部提供方说明保持原文。弹窗应用所选模型的默认推理强度;composer 随后可以选择任一已公布的推理强度。适配器没有推理元数据时不显示 Effort 行;不存在任意推理强度输入。
|
|
33
33
|
|
|
34
|
+
展开的控件无法排在同一行时,composer 将模型与推理强度文字替换为模型图标;空间足够后恢复文字。触发器的无障碍名称、提示和菜单仍提供完整选择。
|
|
35
|
+
|
|
34
36
|
### 不可路由的会话
|
|
35
37
|
|
|
36
38
|
当 Host 报告没有适配器服务该会话的路由时,本插件注册一个 composer 阻塞块,输入框随之停用并显示本插件自己的文案;恢复后无需重新加载即清除。首次加载之前或加载失败之后的 `null` 绝不阻断;目录成员关系同样不阻断——一条仍在服务、只是不公布该模型的路由不在分组里,却可用。
|
|
37
39
|
|
|
40
|
+
只有当前 Client binding 的目录可以发布对应的 composer 阻塞块。旧 binding 的清理保留后继目录的阻塞块;若尚无后继目录,则移除已失效的阻塞块。
|
|
41
|
+
|
|
38
42
|
### 选择失败
|
|
39
43
|
|
|
40
44
|
当会话被其他写句柄占用时,模型选择失败提示用户退出其他正在运行的 DSH 后重试。
|
package/lib/client.js
CHANGED
|
@@ -375,6 +375,7 @@ window.__ModuleLoader__.load({
|
|
|
375
375
|
const conversation = this.ctx.get("conversation");
|
|
376
376
|
if (conversation !== void 0) {
|
|
377
377
|
const publish = () => {
|
|
378
|
+
if (sessions.binding(sessionId) !== binding) return;
|
|
378
379
|
conversation.blocks.set(sessionId, directory.store.getSnapshot().routable === false ? { reason: this.blockReason() } : void 0);
|
|
379
380
|
};
|
|
380
381
|
publish();
|
|
@@ -382,6 +383,8 @@ window.__ModuleLoader__.load({
|
|
|
382
383
|
const stop = directory.store.subscribe(publish);
|
|
383
384
|
return () => {
|
|
384
385
|
stop();
|
|
386
|
+
const current = sessions.binding(sessionId);
|
|
387
|
+
if (current !== void 0 && current !== binding && live.directories.get(current) !== void 0) return;
|
|
385
388
|
conversation.blocks.set(sessionId, void 0);
|
|
386
389
|
};
|
|
387
390
|
}, "ui-model-selection: composer block");
|
|
@@ -410,7 +413,7 @@ window.__ModuleLoader__.load({
|
|
|
410
413
|
}
|
|
411
414
|
//#endregion
|
|
412
415
|
//#region \0dsh-css:/home/runner/work/deepseek-harness/deepseek-harness/packages/client/ui-model-selection/src/client/ModelSelect.module.css.mjs
|
|
413
|
-
const css = "._7KE1Ra_root{min-width:0;position:relative}._7KE1Ra_trigger{min-width:0;max-width:min(360px,45cqw);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:24px;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:flex}._7KE1Ra_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}._7KE1Ra_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._7KE1Ra_triggerEffort{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-caption);flex-shrink:1000;overflow:hidden}._7KE1Ra_triggerIcon{
|
|
416
|
+
const css = "._7KE1Ra_root{min-width:0;position:relative}._7KE1Ra_trigger{min-width:0;max-width:min(360px,45cqw);height:28px;color:var(--dsw-alias-label-secondary);cursor:pointer;background:0 0;border:none;border-radius:24px;outline:none;align-items:center;gap:4px;padding:0 4px 0 8px;font-size:13px;font-weight:500;line-height:20px;display:flex}._7KE1Ra_trigger:hover:not(:disabled){background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_trigger:focus-visible{box-shadow:0 0 0 2px var(--dsw-alias-border-l3)}._7KE1Ra_trigger:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_triggerLabel{text-overflow:ellipsis;white-space:nowrap;min-width:0;overflow:hidden}._7KE1Ra_triggerEffort{text-overflow:ellipsis;white-space:nowrap;min-width:0;color:var(--dsw-alias-label-caption);flex-shrink:1000;overflow:hidden}._7KE1Ra_triggerIcon{display:var(--dsh-composer-model-icon-display,none);flex:none}._7KE1Ra_triggerLabel,._7KE1Ra_triggerEffort{display:var(--dsh-composer-model-text-display,block)}._7KE1Ra_chevron{color:var(--dsw-alias-label-caption);flex:none;transition:transform .12s}._7KE1Ra_chevronOpen{transform:rotate(180deg)}._7KE1Ra_menu{z-index:1100;background:var(--dsw-specific-menu);width:max-content;min-width:min(240px,100vw - 32px);max-width:min(420px,100vw - 32px);max-height:min(360px,100vh - 96px);backdrop-filter:var(--dsw-menu-backdrop-filter);--dsw-elevation-stroke-color:var(--dsw-alias-border-l1);box-shadow:var(--dsw-elevation-prominent);color:var(--dsw-alias-label-primary);--dsh-scrollbar-thumb:var(--dsw-alias-scrollbar-bg-l2);--dsh-scrollbar-thumb-hover:var(--dsw-alias-scrollbar-hover-l2);border:0;border-radius:16px;flex-direction:column;padding:3px;display:flex;position:fixed;overflow:hidden}._7KE1Ra_status,._7KE1Ra_empty{color:var(--dsw-alias-label-tertiary);padding:8px;font-size:12px;line-height:18px}._7KE1Ra_error,._7KE1Ra_warning{background:var(--dsw-alias-interactive-bg-hover-danger);color:var(--dsw-alias-state-error-primary);border-radius:7px;justify-content:space-between;align-items:flex-start;gap:6px;margin-bottom:3px;padding:6px 7px;font-size:11px;line-height:16px;display:flex}._7KE1Ra_warning{background:var(--dsw-alias-bg-module-platform);color:var(--dsw-alias-state-warn-label)}._7KE1Ra_retry{color:inherit;font:inherit;cursor:pointer;background:0 0;border:none;flex:none;padding:0;font-weight:600}._7KE1Ra_groups{min-height:0;overflow-y:auto}._7KE1Ra_group+._7KE1Ra_group{margin-top:3px}._7KE1Ra_groupTitle{z-index:1;background:var(--dsw-specific-menu);color:var(--dsw-alias-label-tertiary);padding:4px 7px 2px;font-size:11px;font-weight:500;line-height:16px;position:sticky;top:0}._7KE1Ra_option{box-sizing:border-box;width:auto;min-width:100%;min-height:34px;color:inherit;text-align:left;cursor:pointer;background:0 0;border:none;border-radius:8px;outline:none;align-items:center;gap:6px;padding:5px 7px;display:flex}._7KE1Ra_option:hover:not(:disabled),._7KE1Ra_option:focus-visible{background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_selected{background:0 0}._7KE1Ra_option:disabled{color:var(--dsw-alias-label-dimmed);cursor:default}._7KE1Ra_optionCopy{flex-direction:column;flex:1;min-width:0;display:flex}._7KE1Ra_modelName{color:inherit;text-overflow:ellipsis;white-space:nowrap;font-size:13px;font-weight:500;line-height:18px;overflow:hidden}._7KE1Ra_check{color:var(--dsw-alias-label-primary);flex:0 0 14px;place-items:center;display:grid}._7KE1Ra_check svg{width:14px;height:14px}._7KE1Ra_cell{box-sizing:border-box;width:auto;min-width:100%;height:34px;color:var(--dsw-alias-label-primary);cursor:pointer;text-align:left;background:0 0;border:none;border-radius:8px;align-items:center;gap:6px;padding:0 8px;font-size:13px;line-height:20px;display:flex}._7KE1Ra_cell:hover{background:var(--dsw-alias-interactive-bg-hover)}._7KE1Ra_cellLabel{white-space:nowrap;flex:none}._7KE1Ra_cellValue{text-overflow:ellipsis;white-space:nowrap;text-align:right;min-width:0;color:var(--dsw-alias-label-tertiary);flex:auto;overflow:hidden}._7KE1Ra_cellChevron{width:12px;height:12px;color:var(--dsw-alias-label-tertiary);flex:none}";
|
|
414
417
|
const tagId = "@deepseek-ai/dsh-client-ui-model-selection/ModelSelect.module.css";
|
|
415
418
|
if (typeof document !== "undefined" && document.querySelector("style[data-plugin-css=" + JSON.stringify(tagId) + "]") === null) {
|
|
416
419
|
const tag = document.createElement("style");
|
|
@@ -711,7 +714,7 @@ window.__ModuleLoader__.load({
|
|
|
711
714
|
else show();
|
|
712
715
|
},
|
|
713
716
|
children: [
|
|
714
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
717
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconDataOutlineRegular, {
|
|
715
718
|
className: ModelSelect_module_css_default.triggerIcon,
|
|
716
719
|
size: 16
|
|
717
720
|
}),
|
|
@@ -723,7 +726,7 @@ window.__ModuleLoader__.load({
|
|
|
723
726
|
className: ModelSelect_module_css_default.triggerEffort,
|
|
724
727
|
children: effortLabel
|
|
725
728
|
}),
|
|
726
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
729
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronDownOutlineRegular, { className: clsx(ModelSelect_module_css_default.chevron, open && ModelSelect_module_css_default.chevronOpen) })
|
|
727
730
|
]
|
|
728
731
|
}),
|
|
729
732
|
open && (0, react_dom.createPortal)((0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -752,7 +755,7 @@ window.__ModuleLoader__.load({
|
|
|
752
755
|
className: ModelSelect_module_css_default.cellValue,
|
|
753
756
|
children: modelLabel
|
|
754
757
|
}),
|
|
755
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
758
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular, { className: ModelSelect_module_css_default.cellChevron })
|
|
756
759
|
]
|
|
757
760
|
}), reasoning !== void 0 && (0, react_jsx_runtime.jsxs)("button", {
|
|
758
761
|
ref: itemRef(),
|
|
@@ -771,7 +774,7 @@ window.__ModuleLoader__.load({
|
|
|
771
774
|
className: ModelSelect_module_css_default.cellValue,
|
|
772
775
|
children: effortLabel
|
|
773
776
|
}),
|
|
774
|
-
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
777
|
+
(0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconChevronRightOutlineRegular, { className: ModelSelect_module_css_default.cellChevron })
|
|
775
778
|
]
|
|
776
779
|
})] }),
|
|
777
780
|
pane === "model" && (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
@@ -836,7 +839,7 @@ window.__ModuleLoader__.load({
|
|
|
836
839
|
})
|
|
837
840
|
}), (0, react_jsx_runtime.jsx)("span", {
|
|
838
841
|
className: ModelSelect_module_css_default.check,
|
|
839
|
-
children: selected ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
842
|
+
children: selected ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : null
|
|
840
843
|
})]
|
|
841
844
|
}, model.id);
|
|
842
845
|
})]
|
|
@@ -877,14 +880,14 @@ window.__ModuleLoader__.load({
|
|
|
877
880
|
})
|
|
878
881
|
}), (0, react_jsx_runtime.jsx)("span", {
|
|
879
882
|
className: ModelSelect_module_css_default.check,
|
|
880
|
-
children: effectiveEffort === level.effort ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
883
|
+
children: effectiveEffort === level.effort ? (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconCheckOutlineRegular, {}) : null
|
|
881
884
|
})]
|
|
882
885
|
}, level.key))] })
|
|
883
886
|
]
|
|
884
887
|
}), document.body),
|
|
885
888
|
toast !== null && (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.Toast, {
|
|
886
889
|
text: toast.text,
|
|
887
|
-
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.
|
|
890
|
+
icon: (0, react_jsx_runtime.jsx)(_deepseek_ai_dsh_client_ui_primitives.IconWarningOutlineRegular, {}),
|
|
888
891
|
anchor: rootRef.current?.closest("[data-composer-card]") ?? null,
|
|
889
892
|
onDone: () => {
|
|
890
893
|
setToast(null);
|
|
@@ -1037,7 +1040,7 @@ window.__ModuleLoader__.load({
|
|
|
1037
1040
|
name: "model",
|
|
1038
1041
|
label: () => t("command.label"),
|
|
1039
1042
|
description: () => t("command.description"),
|
|
1040
|
-
icon: _deepseek_ai_dsh_client_ui_primitives.
|
|
1043
|
+
icon: _deepseek_ai_dsh_client_ui_primitives.IconDataOutlineRegular,
|
|
1041
1044
|
available: (session) => sessions.subagentAddress(session.sessionId) === void 0,
|
|
1042
1045
|
ui: {
|
|
1043
1046
|
kind: "popupSelect",
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-client-ui-model-selection",
|
|
3
3
|
"description": "Model selection over the shared model catalog, Session projection, and session.selectModel",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.7-alpha.1",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"license": "MIT",
|
|
40
40
|
"peerDependencies": {
|
|
41
|
-
"@deepseek-ai/cordis": "^4.0.
|
|
41
|
+
"@deepseek-ai/cordis": "^4.0.3"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@types/react": "~18.3.1",
|
|
@@ -46,22 +46,22 @@
|
|
|
46
46
|
"react-dom": "^18.2.0",
|
|
47
47
|
"@types/react-dom": "~18.3.0",
|
|
48
48
|
"clsx": "^2.1.1",
|
|
49
|
-
"@deepseek-ai/dsh-api-
|
|
50
|
-
"@deepseek-ai/dsh-
|
|
51
|
-
"@deepseek-ai/dsh-client-
|
|
52
|
-
"@deepseek-ai/dsh-client-
|
|
53
|
-
"@deepseek-ai/dsh-client-ui-
|
|
54
|
-
"@deepseek-ai/dsh-client-ui-
|
|
55
|
-
"@deepseek-ai/dsh-client-ui-
|
|
56
|
-
"@deepseek-ai/dsh-
|
|
57
|
-
"@deepseek-ai/
|
|
58
|
-
"@deepseek-ai/
|
|
59
|
-
"@deepseek-ai/dsh-
|
|
60
|
-
"@deepseek-ai/dsh-
|
|
61
|
-
"@deepseek-ai/dsh-session": "^0.1.
|
|
62
|
-
"@deepseek-ai/dsh-
|
|
63
|
-
"@deepseek-ai/dsh-
|
|
64
|
-
"@deepseek-ai/dsh-client-
|
|
49
|
+
"@deepseek-ai/dsh-api-session-controller": "^0.1.7-alpha.1",
|
|
50
|
+
"@deepseek-ai/dsh-client-test-runtime": "^0.1.7-alpha.1",
|
|
51
|
+
"@deepseek-ai/dsh-client-ui-commands": "^0.1.7-alpha.1",
|
|
52
|
+
"@deepseek-ai/dsh-client-ui-conversation": "^0.1.7-alpha.1",
|
|
53
|
+
"@deepseek-ai/dsh-client-ui-input-trigger": "^0.1.7-alpha.1",
|
|
54
|
+
"@deepseek-ai/dsh-client-ui-primitives": "^0.1.7-alpha.1",
|
|
55
|
+
"@deepseek-ai/dsh-client-ui-slots": "^0.1.7-alpha.1",
|
|
56
|
+
"@deepseek-ai/dsh-typert-protocol": "^0.1.7-alpha.1",
|
|
57
|
+
"@deepseek-ai/cordis": "^4.0.3",
|
|
58
|
+
"@deepseek-ai/dsh-client-store": "^0.1.7-alpha.1",
|
|
59
|
+
"@deepseek-ai/dsh-api-remotes": "^0.1.7-alpha.1",
|
|
60
|
+
"@deepseek-ai/dsh-util-values": "^0.1.7-alpha.1",
|
|
61
|
+
"@deepseek-ai/dsh-client-ui-session": "^0.1.7-alpha.1",
|
|
62
|
+
"@deepseek-ai/dsh-client-ui-renderer": "^0.1.7-alpha.1",
|
|
63
|
+
"@deepseek-ai/dsh-session": "^0.1.7-alpha.1",
|
|
64
|
+
"@deepseek-ai/dsh-client-locale": "^0.1.7-alpha.1"
|
|
65
65
|
},
|
|
66
66
|
"files": [
|
|
67
67
|
"lib/index.js",
|