@bittersmilezzz/dsh-model-selector 0.1.18
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/LICENSE +21 -0
- package/README.md +74 -0
- package/assets/cover.png +0 -0
- package/assets/menu-default.png +0 -0
- package/assets/menu-search.png +0 -0
- package/cordis.patch.yml +10 -0
- package/lib/client.js +2184 -0
- package/lib/client.js.map +1 -0
- package/lib/index.js +5 -0
- package/lib/index.js.map +1 -0
- package/lib/tsconfig.client.tsbuildinfo +1 -0
- package/lib/types/client/ModelSelect.d.ts +40 -0
- package/lib/types/client/ModelSelect.d.ts.map +1 -0
- package/lib/types/client/effort.d.ts +66 -0
- package/lib/types/client/effort.d.ts.map +1 -0
- package/lib/types/client/effortCanvas.d.ts +39 -0
- package/lib/types/client/effortCanvas.d.ts.map +1 -0
- package/lib/types/client/effortDrag.d.ts +39 -0
- package/lib/types/client/effortDrag.d.ts.map +1 -0
- package/lib/types/client/index.d.ts +20 -0
- package/lib/types/client/index.d.ts.map +1 -0
- package/lib/types/client/locales.d.ts +71 -0
- package/lib/types/client/locales.d.ts.map +1 -0
- package/lib/types/client/menuFit.d.ts +31 -0
- package/lib/types/client/menuFit.d.ts.map +1 -0
- package/lib/types/client/roving.d.ts +26 -0
- package/lib/types/client/roving.d.ts.map +1 -0
- package/lib/types/client/styles.d.ts +10 -0
- package/lib/types/client/styles.d.ts.map +1 -0
- package/lib/types/index.d.ts +13 -0
- package/lib/types/index.d.ts.map +1 -0
- package/package.json +126 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 bitterSmilezzz
|
|
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.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @bittersmilezzz/dsh-model-selector
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<img src="assets/cover.png" width="720" alt="dsh-model-selector:单层模型菜单 + 推理强度滑杆" />
|
|
5
|
+
</p>
|
|
6
|
+
|
|
7
|
+
DeepSeek Harness (DSH) 的**增强模型选择器(Model Selector)**:单层菜单(搜索 + 分组)+ 底部内联推理强度(Reasoning Effort)滑杆。从 dsh-ui-tweaks 按功能拆分出的独立插件包。
|
|
8
|
+
|
|
9
|
+
## 界面预览
|
|
10
|
+
|
|
11
|
+
默认菜单(分组折叠 + 推理滑杆) | 搜索过滤(跨供应商同名模型带供应商标)
|
|
12
|
+
:---: | :---:
|
|
13
|
+
<img src="assets/menu-default.png" width="360" alt="默认菜单" /> | <img src="assets/menu-search.png" width="360" alt="搜索过滤" />
|
|
14
|
+
|
|
15
|
+
## 功能
|
|
16
|
+
|
|
17
|
+
- 替换官方输入区的模型选择 seat(`conversation.input.model`,shadow 方式叠加,不禁用官方组件)
|
|
18
|
+
- 单层模型菜单:名称搜索过滤(命中片段高亮)+ 提供商分组折叠,选中行与供应商标可见高亮,打开自动滚到当前选中行
|
|
19
|
+
- 菜单高度按视口实测钳位,弹出方向自适应(取上下空间更大一侧),矮窗口自动收不溢出;seat 右缘放不下时水平钳到视口内
|
|
20
|
+
- 键盘可完整操作:方向键在结果间移动、搜索框内 Enter 选中首个命中、Escape 先清搜索词再关闭并还原焦点
|
|
21
|
+
- 选中模型后可展开底部内联**推理强度滑杆**,实时显示当前档位名与该档位说明
|
|
22
|
+
- 切换被宿主拒绝时,失败原因用官方 Toast 在输入区上方播报(菜单已关闭也能看到)
|
|
23
|
+
- 选择推理模型会自动落到**最强思考档**,并在成功后提示落到的档位(行上有「推理」标记说明)
|
|
24
|
+
- 与 `/model` 弹窗共用官方 `modelDirectories` 目录,两处实时同步
|
|
25
|
+
|
|
26
|
+
## 安装
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
# npm(推荐):包名 @bittersmilezzz/dsh-model-selector
|
|
30
|
+
dsh plugin --profile <profile> add @bittersmilezzz/dsh-model-selector
|
|
31
|
+
# 或从 GitHub
|
|
32
|
+
dsh plugin --profile <profile> add github:bitterSmilezzz/dsh-model-selector
|
|
33
|
+
# 或本地路径
|
|
34
|
+
dsh plugin --profile <profile> add <path-to-repo>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
启用后刷新浏览器页面(web profile),模型选择器即替换输入区原 seat。
|
|
38
|
+
|
|
39
|
+
## 配置
|
|
40
|
+
|
|
41
|
+
无设置项(纯 UI 插件),不占用「设置 → 插件 → 配置」卡片位。
|
|
42
|
+
|
|
43
|
+
## 外部依赖
|
|
44
|
+
|
|
45
|
+
- macOS / Windows / Linux 通用,无系统级依赖。
|
|
46
|
+
- 运行时依赖 DSH web profile(client 半区),需要 `@deepseek-ai/dsh-client-ui-slots` 等官方注入包(见 package.json peerDependencies)。
|
|
47
|
+
- 生命周期脚本:**无**(无 preinstall/install/postinstall/prepare)。
|
|
48
|
+
|
|
49
|
+
## 权限
|
|
50
|
+
|
|
51
|
+
**权限等级:low**。纯 client UI:不注册 host 工具、不读写宿主文件、不访问凭据、不发起自有网络请求。
|
|
52
|
+
|
|
53
|
+
模型目录与切换动作走**官方 session RPC**(`ctx.remote.session` 的目录加载与 `selectModel`),与官方模型选择器使用同一条通道、同一份 `modelDirectories` 目录状态;除此之外不与宿主通信。UI 反馈(Toast、图标、浮层定位)运行时复用官方 `@deepseek-ai/dsh-client-ui-primitives`。
|
|
54
|
+
|
|
55
|
+
## 已知风险
|
|
56
|
+
|
|
57
|
+
- 通过 slot 优先级(priority: -1)**shadow 官方 seat**:若官方后续改动该 seat 的注入面(`ModelSelectInjected`),需同步适配;这是官方认可的 slot 叠加机制,并非禁用官方 entry。
|
|
58
|
+
- 与其它也 shadow `conversation.input.model` 的插件同时安装时,优先级决定渲染赢家,可能互相覆盖(本插件优先级 -1 最低,默认胜出)。
|
|
59
|
+
|
|
60
|
+
## 开发
|
|
61
|
+
|
|
62
|
+
标准双半区结构,`lib/` 为构建产物:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
pnpm install
|
|
66
|
+
pnpm typecheck # 双 program(host + client)
|
|
67
|
+
pnpm build # tsc host + tsdown client bundle
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
调优常量集中在 `src/client/ModelSelect.tsx` 顶部(`DIRECTORY_STALE_MS` / `MAX_VISIBLE_HITS` / `EFFORT_COMMIT_TIMEOUT_MS`)与 `src/client/menuFit.ts`(`MENU_MAX_HEIGHT` / `MENU_VIEWPORT_MARGIN`),含义与调法见各常量旁注释;刻意不做配置化——纯 UI 插件无 settings namespace,不为此引入配置基建。
|
|
71
|
+
|
|
72
|
+
## License
|
|
73
|
+
|
|
74
|
+
MIT
|
package/assets/cover.png
ADDED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# dsh-model-selector — 增强模型选择器(独立插件包)
|
|
2
|
+
#
|
|
3
|
+
# 纯 UI 插件:host 半区为空 apply(占位,让插件出现在 Loader 与浏览器 roster),
|
|
4
|
+
# 实际逻辑全部在 client 半区(conversation.input.model seat 覆盖)。
|
|
5
|
+
# 无设置 namespace / 无设置卡片。
|
|
6
|
+
|
|
7
|
+
- insert:
|
|
8
|
+
- id: dsh-model-selector
|
|
9
|
+
name: '@bittersmilezzz/dsh-model-selector'
|
|
10
|
+
inject: []
|