feat: migrate to DSH 0.1.5-rc.2 with TypeScript refactor, official slot footer and codex selector

This commit is contained in:
2026-09-11 13:58:29 +08:00
parent 4401e9cea7
commit fa098b5192
27 changed files with 4976 additions and 6727 deletions
+28 -22
View File
@@ -1,41 +1,47 @@
# dsh-plugin-model-enhancer
DeepSeek Harness (DSH) 自定义模型增强与交互插件。
DeepSeek Harness (DSH) Model Settings Enhancer & Codex Selector Plugin (Compatible with DSH 0.1.5-rc.2).
## ✨ 特性一览
## ✨ Features
1. **设置页面模型目录增强**
- 支持图像/视觉(Vision)输入模态开关。
- 支持多档位推理思考深度(Reasoning Efforts,包含 `minimal` / `low` / `medium` / `high` / `xhigh` / `max`)。
- 官方模型目录与模型条目右侧状态胶囊徽标展示(图像、思考档位)。
- **models.dev 智能预填充**
- 单模型「智能补全」与对比确认弹窗(支持按项选用推荐值)。
- 顶部一键「一键补全」批量安全清洗与参数匹配。
1. **Official Extension Slots Integration (Non-destructive to `ui-settings-models`)**:
- Integrates model enhancement configuration via `settings.models.footer` and `settings.models.provider-card` (targeted at `llm-pi-ai`).
- Supports models.dev auto-fill matching, prefilling missing capacities, image modalities (`input: ["text", "image"]`), and multi-level reasoning efforts (`minimal` / `low` / `medium` / `high` / `xhigh` / `max`).
- Uses `ctx.remote.settings.mutate` with revision fence checking for safe, non-destructive configuration persistence.
- Preserves official file attachment and upload pipeline (`ui-attachment` & `file-upload`), removing obsolete custom upload endpoint routes.
2. **输入栏左侧连体药丸操作小岛(Pill Island)**
- 整合 `[+]`(命令菜单)与 `[📎]`(多模态图片/文件上传)为一体化胶囊岛。
- 正圆形 Hover 微光微交互。
2. **Codex-style Model & Reasoning Effort Selector**:
- Injected into `conversation.input.right` seamlessly alongside the official composer.
- Reuses `ctx.modelDirectories` (`ModelDirectoryResolver`) for per-session directory resolution and selection dispatch.
- Interactive sliding track for reasoning effort adjustments and grouped model picker popup.
3. **输入栏右下角 Codex 风格推理滑块与模型切换**
- 无边框极简常态,悬浮/激活呈现通透线框轮廓。
- 水平胶囊滑轨与海蓝渐变激活填充(Soft Sky-Blue Gradient)。
- 饱满悬浮大圆球(Thumb),突破滑槽高度,悬停/拖拽轻微弹性放大。
- 点击顶部模型名平滑展开带供应商分类徽标与细分割线的模型选择树。
3. **models.dev Cache & Proxy**:
- Exposes exact WebServer proxy route `/api/models-dev/models` with in-memory caching and fallback.
4. **全面双语支持(i18n**
- 自动跟随 DSH 系统语言(中文 / English)无缝切换所有文案与档位标签。
4. **Full Bilingual Support (i18n)**:
- Dynamic localization supporting Simplified Chinese (`zh`) and English (`en`).
## 📦 安装与配置
## 🛠 Building & Development
在 DSH Web Profile 的 `package.json` 中添加依赖并注册 bundle
```bash
npm run build # Bundles client code to lib/client.js and emits types
npm test # Runs Vitest unit tests
npm run typecheck # TypeScript static type check
```
## 📦 Profile Configuration
In your profile's `package.json`:
```json
{
"dependencies": {
"dsh-plugin-model-enhancer": "^1.0.0"
"dsh-plugin-model-enhancer": "file:../dsh-plugin-model-enhancer"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-plugin-model-enhancer"
]
}