dsh-codinput 0.3.7 → 0.3.8
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 +40 -13
- package/NOTICE +18 -3
- package/README.en.md +10 -7
- package/README.md +10 -7
- package/TESTING.md +19 -5
- package/lib/client.js +66 -56
- package/package.json +2 -2
- package/src/client/components/StatsRow.tsx +199 -78
- package/src/client/components/UserMessageMarkdown.tsx +115 -30
- package/src/client/i18n.ts +13 -9
- package/src/client/index.tsx +6 -1
- package/src/client/styles.ts +40 -24
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
本项目遵循 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/) 与 [语义化版本](https://semver.org/lang/zh-CN/)。
|
|
4
4
|
|
|
5
|
+
## [0.3.8] — 2026-10-30
|
|
6
|
+
|
|
7
|
+
数据行三枚详情面板改为官方同构的 portal + fixed 锚定定位(滚动/尺寸变化跟随、Escape 与点外关闭、三面板单一展开);设置页开关样式与面板背景/圆角 token 对齐官方;修复 patchReload live 热更新后新增样式类不注入;修复 0.3.7 带图用户消息渲染崩溃(P0)并收紧用户消息 Markdown 的安全基线(P1)。
|
|
8
|
+
|
|
9
|
+
### 变更
|
|
10
|
+
|
|
11
|
+
- **数据行详情面板 portal 化**(`StatsRow`):会话统计 / Token 用量 / 上下文分段三枚面板改为 `createPortal(document.body)` + `position: fixed`,插件侧移植官方 `useAnchoredPosition` / `useStatDialog` 语义——side top / align start、gap 8、视口 margin 12、帧顶 clearance(`--dsh-frame-top-clearance`,`data-fullscreen` 归零)、滚动(捕获相位)/窗口 resize/面板尺寸变化重算并夹进视口。三枚面板各有独立 seat;新增 Escape 与点外关闭(点面板内部不关),并保持三枚单一展开态互斥。
|
|
12
|
+
- **设置页开关对齐官方 primitives**:`Switch.module.css` 逐值对齐——`999px` 圆角 + `corner-shape: round`、`disabled` 态、`focus-visible` 走官方 focus ring token、滑块走 `--dsw-alias-switch-thumb`;ON 轨道用 `--dsw-alias-brand-primary`(随宿主主题,与官方 Switch 同款)。
|
|
13
|
+
- **面板与数据行 token 对齐官方**:面板背景优先 `--dsw-specific-menu`、保留 `--dsw-menu-surface-fill` 旧宿主回退链;圆角改 `var(--dsw-radius-lg)`;数据行胶囊 expanded 态、上下文仪表条 `corner-shape`、trigger 字号 token 与官方对齐。
|
|
14
|
+
- **npm 包描述**:`package.json` description 扩为「DSH 插件……web 与桌面端通用」。
|
|
15
|
+
|
|
16
|
+
### 修复
|
|
17
|
+
|
|
18
|
+
- **样式热更新失效**(`injectStyles`):宿主 `patchReload: live` 原地更新插件后,旧 `<style id="dsh-codinput-styles">` 仍在、原实现「已存在即 return」导致新版新增类名(如 `.dci-umsg-*`)永不注入;现改为已存在时按内容原位刷新 `textContent`。
|
|
19
|
+
- **带图用户消息渲染崩溃(0.3.7 发布回归,P0)**:`contentParts` 把 `ImageAttachmentRef` 裸传给官方 `renderMessageImages`,官方 `ImageGallery` 计算 React key 时读 `image.attachment.attachmentId` 抛错;宿主 `SlotErrorBoundary` 捕获后**废黜**该键控条目,该页此后所有用户/插队消息退回官方纯文本(静默失效)。现按官方形状包成 `{ attachment }`;并补图片降级卡——宿主缺 `renderMessageImages` 座位 prop 时不再静默丢图。
|
|
20
|
+
- **用户消息 Markdown 安全基线收紧(P1)**:marked 透传的原始 HTML 经 DOMPurify 白名单收敛(禁 `style` / `form` / 控件 / 媒体 / 行内 style 等原始 HTML),链接与图片 URI 只放行 http(s)/mailto(非白名单链接拆成纯文本、破图降级为 alt 文本),与官方 `MarkdownText` 的 `sanitizeUrl` / `remoteImageUrl` 口径对齐;http(s) 链接统一新开页。
|
|
21
|
+
- **用户消息 Markdown 细节**:补 `useT` 订阅(宿主语言切换后复制钮/引用摘要等文案即时更新);复制成功态定时器在卸载时清理;文件夹 chip 与官方一致不可点;chip 点击实时读取最新 `openFile`/`openSkill`(晚到不再失效);组件加 `memo`;0 字节文件卡显示 `0B`;`bindForeign` 不再缓存 null(宿主 locale 晚到仍能绑定)。
|
|
22
|
+
|
|
23
|
+
### 说明
|
|
24
|
+
|
|
25
|
+
- 本版发布材料确认范围:`npm run typecheck` 通过、两次发布构建字节一致(sha256 可复现)。
|
|
26
|
+
- 已在隔离 web 宿主 `0.2.0-rc.2`(独立 `DSH_HOME` + 无头 Edge + `link:` 安装本仓库构建产物)实测:三枚面板均为 `body` 直接子节点、`position: fixed`,几何逐像素吻合(面板底距锚点顶 8px、左缘对齐锚点);互斥、点外关闭、点面板内不关、Escape 关闭、窗口 resize 后跟随且不出视口均通过。用户消息 Markdown(strong/code/pre/list/link、@引用 chip、复制态)正常,XSS 探针(`<img onerror>`、`<script>`)被净化且未执行,`__dshCodinputErrs` 为空。未单独覆盖:滚动跟随、面板自身 ResizeObserver 分支、macOS 桌面实机目检。
|
|
27
|
+
- 桌面 `0.2.1-rc.3` 取证:从该版 `app.asar` 提取官方 CSS Modules 与主题 token,逐值核对 Switch 规则、stats / ContextMeter 面板的 portal+fixed 与背景/圆角、`--dsh-frame-top-clearance`,与 0.3.8 实现一致;macOS 毛玻璃/不透明度差异未实机目检。
|
|
28
|
+
- 0.3.7 已发布的三项功能(用户消息 Markdown、插件页图标、数据行三面板互斥)机制不变;本版修正其带图崩溃与安全基线,以及交互/样式细节。
|
|
29
|
+
|
|
30
|
+
[0.3.8]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.7...v0.3.8
|
|
31
|
+
|
|
5
32
|
## [0.3.7] — 2026-10-29
|
|
6
33
|
|
|
7
34
|
用户消息 Markdown 渲染:右侧自己发出的消息按 Markdown 排版(设置可关);插件页图标接入;数据行三面板唯一展开修复。
|
|
@@ -59,19 +86,6 @@
|
|
|
59
86
|
|
|
60
87
|
[0.3.5]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.4...v0.3.5
|
|
61
88
|
|
|
62
|
-
## [0.3.3] — 2026-10-23
|
|
63
|
-
|
|
64
|
-
主题/皮肤插件兼容:错误色与预览链接逐值对齐官方;README 增补皮肤作者指南。
|
|
65
|
-
|
|
66
|
-
### 变更
|
|
67
|
-
|
|
68
|
-
- **错误色回退值逐值对齐官方**:`.dci-error` 与完全权限确认警示图标的错误色回退值由 `#ff6b6b` 改为官方同款 `#d54941`(token 仍走 `--dsw-alias-state-error-primary`,仅无该令牌的宿主回退时可见差异)。
|
|
69
|
-
- **预览链接走官方 alias-link token**:markdown 预览的链接色由写死 `#4c8dff` 改为 `var(--dsw-alias-link, #4c8dff)`,换肤下与官方 markdown 链接同进退。
|
|
70
|
-
|
|
71
|
-
### 新增
|
|
72
|
-
|
|
73
|
-
- **README 皮肤作者指南(中英)**:新增「主题 / 皮肤插件兼容」章节——覆写宿主 `--dsw-*` token 即全盘生效(含 token 定义在 body 层、覆写需写同层的注意点);官方写死的值清单(发送钮图标前景白等,属预期不跟 token);稳定的 `dci-` 前缀类名契约与注入顺序(皮肤后注入按常规 CSS 权重覆盖)。
|
|
74
|
-
|
|
75
89
|
## [0.3.4] — 2026-10-23
|
|
76
90
|
|
|
77
91
|
第三方输入条目兼容(issue #1 之右座):接管后 `conversation.input.right` 座条目恢复显示(已实测 dsh-prompt-enhancer 的 ✨/🎤);模型/推理强度弹层恢复官方形态。
|
|
@@ -95,6 +109,19 @@
|
|
|
95
109
|
|
|
96
110
|
[0.3.4]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.3...v0.3.4
|
|
97
111
|
|
|
112
|
+
## [0.3.3] — 2026-10-23
|
|
113
|
+
|
|
114
|
+
主题/皮肤插件兼容:错误色与预览链接逐值对齐官方;README 增补皮肤作者指南。
|
|
115
|
+
|
|
116
|
+
### 变更
|
|
117
|
+
|
|
118
|
+
- **错误色回退值逐值对齐官方**:`.dci-error` 与完全权限确认警示图标的错误色回退值由 `#ff6b6b` 改为官方同款 `#d54941`(token 仍走 `--dsw-alias-state-error-primary`,仅无该令牌的宿主回退时可见差异)。
|
|
119
|
+
- **预览链接走官方 alias-link token**:markdown 预览的链接色由写死 `#4c8dff` 改为 `var(--dsw-alias-link, #4c8dff)`,换肤下与官方 markdown 链接同进退。
|
|
120
|
+
|
|
121
|
+
### 新增
|
|
122
|
+
|
|
123
|
+
- **README 皮肤作者指南(中英)**:新增「主题 / 皮肤插件兼容」章节——覆写宿主 `--dsw-*` token 即全盘生效(含 token 定义在 body 层、覆写需写同层的注意点);官方写死的值清单(发送钮图标前景白等,属预期不跟 token);稳定的 `dci-` 前缀类名契约与注入顺序(皮肤后注入按常规 CSS 权重覆盖)。
|
|
124
|
+
|
|
98
125
|
[0.3.3]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.2...v0.3.3
|
|
99
126
|
|
|
100
127
|
## [0.3.2] — 2026-10-18
|
package/NOTICE
CHANGED
|
@@ -23,15 +23,30 @@ alongside this repository's LICENSE file.
|
|
|
23
23
|
发布产物 `lib/client.js` 内置以下第三方库(压缩构建剥离了许可注释,故在此
|
|
24
24
|
集中保留其版权行;许可全文见各上游仓库 / npm 包):
|
|
25
25
|
|
|
26
|
-
- CodeMirror 6(@codemirror/state / view
|
|
26
|
+
- CodeMirror 6(@codemirror/state 6.7.5 / @codemirror/view 6.43.12 /
|
|
27
|
+
@codemirror/language 6.12.4 / @codemirror/commands 6.11.1)
|
|
27
28
|
MIT License
|
|
28
29
|
Copyright (C) 2018-2021 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
29
30
|
|
|
30
|
-
- marked
|
|
31
|
+
- marked 15.0.12
|
|
31
32
|
MIT License
|
|
32
33
|
Copyright (c) 2018+, MarkedJS (https://github.com/markedjs/)
|
|
33
34
|
Copyright (c) 2011-2018, Christopher Jeffrey (https://github.com/chjj/)
|
|
34
35
|
|
|
35
|
-
- DOMPurify
|
|
36
|
+
- DOMPurify 3.4.15
|
|
36
37
|
(MPL-2.0 OR Apache-2.0) 双许可,本项目按 Apache-2.0 条款使用
|
|
37
38
|
Copyright (c) Cure53 and contributors (https://cure53.de/)
|
|
39
|
+
|
|
40
|
+
- CodeMirror 6 的传递依赖(随 bundle 内置,均 MIT License)
|
|
41
|
+
@lezer/common 1.5.2 / @lezer/highlight 1.2.3 / @lezer/lr 1.4.10
|
|
42
|
+
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
43
|
+
style-mod 4.1.3
|
|
44
|
+
Copyright (C) 2018 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
45
|
+
w3c-keyname 2.2.8
|
|
46
|
+
Copyright (C) 2016 by Marijn Haverbeke <marijn@haverbeke.berlin> and others
|
|
47
|
+
crelt 1.0.7
|
|
48
|
+
Copyright (C) 2020 by Marijn Haverbeke <marijn@haverbeke.berlin>
|
|
49
|
+
|
|
50
|
+
以上版本为本仓库 v0.3.8 的 package-lock.json 锁定值。react / react-dom 为宿主平台
|
|
51
|
+
模块(bundle external,未随本包分发),esbuild / typescript 仅为构建期开发依赖,
|
|
52
|
+
均不在内置清单内。
|
package/README.en.md
CHANGED
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
- **Model & reasoning effort**: read from the official shared directory (the same state source as `/model`). **Permissions**: the three official presets plus the RiskConfirmation modal for full access.
|
|
44
44
|
- **Attachments**: slash Add · File (the takeover surface binds the shell's file-picker contract, so the entry keeps working while Codinput owns the composer), **paste images directly**, or **drop files onto the card** (clicking an image thumbnail opens the original-image lightbox, an ImageLightbox replica; the rail is a faithful replica of the official one: 64×64 image thumbnails, file cards with type glyph/name/size, upload spinner, progress bar, retry on failure).
|
|
45
45
|
- **Voice input sync (official desktop app)**: when the official desktop composer ships a voice button, Codinput renders **the very same button in the very same place** — it renders the official voice component itself (mic trigger, recording waveform, transcription, setup prompt and all copy are official code); hosts without the native voice button (all web channels) render none.
|
|
46
|
-
- **Performance & usage**: a replica of the official stats dock — turns/steps · tok/s, total tok · cache hit, plus the context-usage dial — with value-for-value parity in data and formatting, each opening a detail panel; available in all three modes.
|
|
46
|
+
- **Performance & usage**: a replica of the official stats dock — turns/steps · tok/s, total tok · cache hit, plus the context-usage dial — with value-for-value parity in data and formatting, each opening a detail panel; available in all three modes. The three detail panels (session stats / token usage / context segments) are portal-positioned, follow scrolling and size changes, close on Escape or outside click, and only one is open at a time.
|
|
47
|
+
- **User-message Markdown (0.3.7)**: messages sent by the user render as Markdown (GFM + breaks via marked, sanitised with DOMPurify) while keeping the official bubble chrome — attachment rows, @file/@session//skill reference chips (clickable), copy button and timestamp, reference summary and hover reveal. Settings → Codinput → User-message Markdown rendering (on by default); turning it off restores official plain text without a reload.
|
|
48
|
+
- **Plugin-page icon (0.3.7)**: the packaged `assets/icon.png` is exposed through the `package.json` top-level `icon` field (manifest-relative path, SVG/PNG/JPEG/WebP, 256 KiB max), so the installed-plugins list no longer falls back to the default image.
|
|
47
49
|
- **Settings**: Settings → Codinput (takeover on/off, line numbers, font, **fully custom send / line-break shortcuts** via a recorder, default view); with the takeover off, **opening the Codinput tab in the right sidebar enables it directly**.
|
|
48
50
|
|
|
49
51
|
## Installation
|
|
@@ -89,7 +91,7 @@ To pin a version or maintain the profile by hand, the manual equivalent of **Met
|
|
|
89
91
|
```jsonc
|
|
90
92
|
{
|
|
91
93
|
"dependencies": {
|
|
92
|
-
"dsh-codinput": "^0.3.
|
|
94
|
+
"dsh-codinput": "^0.3.8" // for local development: "link:/abs/path/to/DSH-Codinput"
|
|
93
95
|
},
|
|
94
96
|
"dsh": {
|
|
95
97
|
"profile": {
|
|
@@ -108,17 +110,18 @@ After editing the profile by hand, run `pnpm install` inside the profile directo
|
|
|
108
110
|
|
|
109
111
|
## Compatibility
|
|
110
112
|
|
|
111
|
-
The host publishes **rc** builds on npm
|
|
113
|
+
The host publishes **rc** builds on npm: `latest` is the current stable rc, `next` the following rc, `alpha` further ahead (as of 2026-10-30, `latest` / `next` both point at `0.2.1-rc.5`, `alpha` is `0.2.2-alpha.2`), so a plain install gives you an rc.
|
|
112
114
|
|
|
113
115
|
| Host version | Status |
|
|
114
116
|
| --- | --- |
|
|
115
|
-
| Desktop app (Electron, `0.2.
|
|
116
|
-
| `0.
|
|
117
|
+
| Desktop app (Electron, `0.2.1-rc.3`) | ✅ Static alignment (0.3.8 extracts this build's official CSS Modules and theme tokens from `app.asar` and checks them value by value: Switch rules, the stats / ContextMeter panels' portal+fixed placement, background and radius, and `--dsh-frame-top-clearance` all match; the macOS vibrancy/opacity difference was not eyeballed on a real desktop). The `0.2.1-rc.2` real-instance run recorded in 0.3.2 still holds (official voice-input button synced — mic permission → recording → transcription verified end to end; the button hides itself when the voice plugin is absent or off) |
|
|
118
|
+
| web `0.2.0-rc.2` | ✅ Verified on a real instance (this machine's current web host; the slot mirrors, model-seat delegation, user-message Markdown and three-panel exclusivity from 0.3.5–0.3.7 were verified on this build with Chromium automation probes; the 0.3.8 portal-panel placement/Escape/outside-close and Markdown hardening were additionally re-checked in an isolated host with headless Edge — see CHANGELOG) |
|
|
119
|
+
| `0.1.7-rc.2` | ✅ Verified on a real instance (the acrylic candidate menu, the relocated context meter and the dock row layout are aligned to this build) |
|
|
117
120
|
| `0.1.5-rc.2` | ✅ Verified on a real instance |
|
|
118
121
|
| `0.1.6-alpha.2` | ✅ Current development baseline; every feature verified end to end |
|
|
119
|
-
| others (incl. `0.1
|
|
122
|
+
| others (incl. current `latest` / `next` = `0.2.1-rc.5`) | untested; older hosts lack the rc.2 tokens, so the fallback chain keeps each host's official look |
|
|
120
123
|
|
|
121
|
-
For `0.1.7-rc.2`, on top of the real-instance run, the official CSS for the candidate menu, the context meter
|
|
124
|
+
For `0.1.7-rc.2` / web `0.2.0-rc.2`, on top of the real-instance run, the official CSS for the candidate menu, the context meter, the stats dock and the user-message bubble were extracted value by value from the corresponding version's client packages (`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`) and checked against the replicas. The contracts this plugin relies on were verified per version: the slots it uses (`conversation.composer.bar`, `sidebar.right.pane.tab`, `settings.section`, plus `conversation.chat.node` and the `conversation.input.*` sub-seats), the `sidebarRight` / `sidebarRightTabs` / `locale` services and `openTabIn`, the sidebar expansion planner (dockkit `planSetExpanded`), the file-picker and tab-close contracts (`shell.bindFilePicker` / `tab.actions.close`), and the official primitives the replicas are copied from (`fileSizeText` / `fileExtension` and the attachment glyph paths, byte for byte); the desktop `0.2.1-rc.3` build was additionally checked statically against the official CSS Modules and theme tokens extracted from its `app.asar`. For how to re-run this on another channel, see the “Verifying on another channel” section of [TESTING.md](./TESTING.md).
|
|
122
125
|
|
|
123
126
|
The plugin leans on host internals (slot shadowing, `useTabInfo`, `sidebarRight`, `--dsw-*` tokens). Every call site guards with `typeof` checks and degrades gracefully, but a major host upgrade can still break it. **After upgrading the host, walk through [TESTING.md](./TESTING.md).**
|
|
124
127
|
|
package/README.md
CHANGED
|
@@ -43,7 +43,9 @@
|
|
|
43
43
|
- **模型与权限**:模型与思考强度读官方共享目录(与 `/model` 同一状态源);权限为官方三预设,含完全权限的风险确认模态。
|
|
44
44
|
- **附件**:slash「添加 · 文件」、**粘贴图片**、**拖文件进卡片**三条路径;点图片缩略图弹**原图预览**(官方 ImageLightbox 同构);上传中/失败有状态芯片,失败可整卡重试。
|
|
45
45
|
- **语音输入同步(官方桌面版)**:官方桌面版的输入框带语音按钮时,Codinput 在一模一样的位置渲染**一模一样的按钮**——直接渲染官方语音组件本体(麦克风钮、录音波形、转写、未就绪引导与文案全部是官方代码);原生没有语音按钮的宿主(web 端各版本)同样不渲染。
|
|
46
|
-
- **性能与用量**:复刻官方 stats dock——轮次/步数 · tok/s、累计 tok ·
|
|
46
|
+
- **性能与用量**:复刻官方 stats dock——轮次/步数 · tok/s、累计 tok · 缓存命中、上下文占用小圈,取数与格式化逐值同官方,均可点开详情面板;三形态都有。三枚详情面板(会话统计 / Token 用量 / 上下文分段)经 portal 定位、滚动与尺寸变化跟随,Escape 与点外关闭,任意时刻至多一个展开。
|
|
47
|
+
- **用户消息 Markdown(0.3.7)**:右侧自己发出的消息按 Markdown 排版(GFM + breaks,marked + DOMPurify 净化),保留官方气泡形态——附件行、@文件/@会话//技能 引用 chip(可点开)、复制钮与时间戳、引用摘要、悬停显形;设置 → Codinput「用户消息 Markdown 渲染」开关默认开,关闭即还原官方纯文本、无需刷新页面。
|
|
48
|
+
- **插件页图标(0.3.7)**:包内 `assets/icon.png` 经 `package.json` 顶层 `icon` 字段接入宿主插件列表(manifest 相对路径、限 SVG/PNG/JPEG/WebP、≤256 KiB),已装插件不再落默认图。
|
|
47
49
|
- **设置**:设置 → Codinput——启用接管、行号、字体、发送/换行快捷键**任意组合录制**、默认视图;未启用时**打开右侧栏的 Codinput 标签即直接启用**。
|
|
48
50
|
|
|
49
51
|
## 安装
|
|
@@ -89,7 +91,7 @@ dsh plugin --profile web add link:/abs/path/to/DSH-Codinput
|
|
|
89
91
|
```jsonc
|
|
90
92
|
{
|
|
91
93
|
"dependencies": {
|
|
92
|
-
"dsh-codinput": "^0.3.
|
|
94
|
+
"dsh-codinput": "^0.3.8" // 本地开发用 "link:/abs/path/to/DSH-Codinput"
|
|
93
95
|
},
|
|
94
96
|
"dsh": {
|
|
95
97
|
"profile": {
|
|
@@ -108,17 +110,18 @@ dsh plugin --profile web add link:/abs/path/to/DSH-Codinput
|
|
|
108
110
|
|
|
109
111
|
## 兼容性
|
|
110
112
|
|
|
111
|
-
宿主通过 npm 发的是 **rc**
|
|
113
|
+
宿主通过 npm 发的是 **rc** 版本:`latest` 是当前稳定 rc、`next` 是下个 rc、`alpha` 更超前(2026-10-30 实测 `latest` / `next` 同指 `0.2.1-rc.5`,`alpha` 为 `0.2.2-alpha.2`),所以普通用户装到的就是 rc。
|
|
112
114
|
|
|
113
115
|
| 宿主版本 | 状态 |
|
|
114
116
|
| --- | --- |
|
|
115
|
-
| 桌面版(Electron,`0.2.
|
|
116
|
-
| `0.
|
|
117
|
+
| 桌面版(Electron,`0.2.1-rc.3`) | ✅ 静态对齐(0.3.8 从该版 `app.asar` 取出官方 CSS Modules 与主题 token 逐值核对:Switch 规则、stats 面板 / ContextMeter 面板的 portal+fixed 与背景/圆角、`--dsh-frame-top-clearance` 均一致;macOS 的毛玻璃/不透明度差异未实机目检)。0.3.2 记录的 `0.2.1-rc.2` 实机实测仍有效(官方语音输入按钮同步——授权 → 录音 → 转写端到端验证;语音插件缺席或关闭时按钮自动隐藏) |
|
|
118
|
+
| web `0.2.0-rc.2` | ✅ 实机实测通过(本机当前 web 宿主;0.3.5–0.3.7 的座位镜像、模型座让位、用户消息 Markdown 与三面板互斥均在此版本以 Chromium 自动化探针实测;0.3.8 的 portal 面板定位/Escape/点外关闭与 Markdown 安全硬化另在隔离宿主以无头 Edge 探针复核,见 CHANGELOG) |
|
|
119
|
+
| `0.1.7-rc.2` | ✅ 实机实测通过(候选菜单亚克力、上下文小圈挪位、dock 行布局即为此版对齐) |
|
|
117
120
|
| `0.1.5-rc.2` | ✅ 实机实测通过 |
|
|
118
121
|
| `0.1.6-alpha.2` | ✅ 开发基线,全部功能端到端实测通过 |
|
|
119
|
-
|
|
|
122
|
+
| 其它(含现网 `latest` / `next` = `0.2.1-rc.5`) | 未实测;旧宿主无 rc.2 新 token,回退链自动保持各版官方原形态 |
|
|
120
123
|
|
|
121
|
-
对 `0.1.7-rc.2`
|
|
124
|
+
对 `0.1.7-rc.2` / web `0.2.0-rc.2`,除实机验证外,还从对应版本的客户端包(`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`)逐值提取了候选菜单、上下文小圈、stats dock 与用户消息气泡的官方 CSS 核对;桌面 `0.2.1-rc.3` 另从该版 `app.asar` 取出官方 CSS Modules 与主题 token 做静态逐值核对。插件依赖的契约按版本核对过:用到的槽位(`conversation.composer.bar`、`sidebar.right.pane.tab`、`settings.section`,以及 `conversation.chat.node` 与 `conversation.input.*` 子座)、`sidebarRight` / `sidebarRightTabs` / `locale` 服务与 `openTabIn`、侧栏展开规划(dockkit `planSetExpanded`)、文件拾取与 tab 关闭契约(`shell.bindFilePicker` / `tab.actions.close`)、以及复刻所依据的官方原语(`fileSizeText` / `fileExtension` 与附件 glyph 路径,逐字一致)。插件对宿主内部结构的依赖较多(槽位遮蔽、`useTabInfo`、`sidebarRight`、`--dsw-*` 令牌),代码里处处用 `typeof` 守卫 + `try/catch` 降级,但宿主大版本升级仍可能失效。**升级宿主后请按 [TESTING.md](./TESTING.md) 走一遍冒烟清单。**
|
|
122
125
|
|
|
123
126
|
### 主题 / 皮肤插件兼容(皮肤作者必读)
|
|
124
127
|
|
package/TESTING.md
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
## 0. 载入与健康
|
|
14
14
|
|
|
15
15
|
- [ ] 页面刷新后无报错:`window.__dshCodinputErrs.length === 0`
|
|
16
|
-
- [ ] `window.__dshCodinputShell` 含 `apply: 'done'`、`bar: 'registered'`、`settings: 'registered'`、`sidebar.body: 'registered'`
|
|
16
|
+
- [ ] `window.__dshCodinputShell` 含 `apply: 'done'`、`bar: 'registered'`、`settings: 'registered'`、`sidebar.body: 'registered'`、`md.user: 'mounted'`、`md.steering: 'mounted'`(用户消息 Markdown 开关关闭时为 `unmounted`)
|
|
17
17
|
- [ ] `__dshCodinputShell` 里没有 `failed` 项(槽位废黜会记 `slot.entry` 错误)
|
|
18
18
|
|
|
19
19
|
## 1. 三态单实例(核心不变式)
|
|
@@ -65,10 +65,14 @@
|
|
|
65
65
|
- [ ] **停止形态**:流式回复期间主按钮变停止(停止方块 glyph、aria「停止」,含 blocked 审批等待),点击即中断(会话尾部出官方「已停止」状态);回复结束/中断后恢复发送;运行中草稿非空时按钮保持发送(提交走 steer/queue)
|
|
66
66
|
- [ ] 数据行与官方逐值一致:`{turns} 轮 {steps} 步 · {tps} tok/s`(tok/s = decodeTokens÷decodeMs,历史会话也有值)+ `{total} · 缓存命中 {pct}%` + 小圈;统计面板四行(模型用时/工具调用用时/TTFT 均值/TPS)与用量面板(缓存命中/未缓存输入/缓存读取/缓存写入(≠0)/输出)同官方语义
|
|
67
67
|
- [ ] 上下文小圈:百分比与分段面板数据合理
|
|
68
|
+
- [ ] **三枚详情面板互斥**:会话统计 / Token 用量 / 上下文分段任意时刻至多一个展开;开新面板关旧面板,再点同一枚收起
|
|
69
|
+
- [ ] **面板 portal 定位**:戳开面板后滚动页面、改窗口尺寸 → 面板跟随锚点、夹在视口内(margin 12 / 帧顶 clearance),不被输入卡片或 overflow 容器裁剪;点面板内部不关闭,Escape / 点外关闭;面板背景走 `--dsw-specific-menu`(旧宿主回退 `--dsw-menu-surface-fill`)、圆角 `--dsw-radius-lg`
|
|
68
70
|
|
|
69
71
|
## 5. 设置
|
|
70
72
|
|
|
71
73
|
- [ ] 设置 → Codinput:启用接管(关闭后官方输入框原样恢复、草稿不丢)、行号、字体、发送/换行快捷键录制(任意组合、冲突拒绝)
|
|
74
|
+
- [ ] **用户消息 Markdown 开关**:设置 → Codinput 打开/关闭「用户消息 Markdown 渲染」→ 已落库的用户消息即时在 Markdown / 官方纯文本间切换(不刷新页面),关闭状态刷新后保持
|
|
75
|
+
- [ ] **设置页开关样式**:36×20、999px 圆角;ON 轨道颜色随宿主 `--dsw-alias-brand-primary`(浅/深主题各自跟随)、滑块走 `--dsw-alias-switch-thumb`;disabled 半透明、键盘 focus-visible 出官方 focus ring
|
|
72
76
|
- [ ] 偏好刷新后保持(`localStorage['dsh-codinput.prefs.v2']`)
|
|
73
77
|
|
|
74
78
|
## 6. 回归提示
|
|
@@ -81,19 +85,19 @@
|
|
|
81
85
|
宿主在 npm 上有三个通道,**普通用户拿到的不是 alpha**:
|
|
82
86
|
|
|
83
87
|
```bash
|
|
84
|
-
npm view @deepseek-ai/dsh dist-tags # latest
|
|
88
|
+
npm view @deepseek-ai/dsh dist-tags # latest / next = 当前 rc(2026-10-30 同指 0.2.1-rc.5);alpha = 更超前
|
|
85
89
|
dsh --version # 你本机实际跑的那个
|
|
86
90
|
```
|
|
87
91
|
|
|
88
|
-
`latest` 通道发的是 rc
|
|
92
|
+
`latest` 通道发的是 rc(当前 `latest` / `next` 同指 `0.2.1-rc.5`),所以「装了 dsh 插件却跑不起来」的报障大概率发生在 rc 上。开发机可以待在 alpha,但**对外声称的兼容范围应当以 rc 为准**,至少在 rc 上跑一遍第 1、3 节。
|
|
89
93
|
|
|
90
|
-
>
|
|
94
|
+
> **已验记录**:web 宿主 `0.2.0-rc.2` 为当前实机验证基线(0.3.5–0.3.7 均在本机 link 安装下以 Chromium 自动化探针实测,见 CHANGELOG);桌面版 `0.2.1-rc.2` 的语音同步于 0.3.2 实测通过;现网 `latest` / `next` = `0.2.1-rc.5`(2026-10-30 实测)。换宿主版本后请重新走一遍下面这节。
|
|
91
95
|
|
|
92
96
|
不动现有安装的验证方式(独立 prefix + 独立 `DSH_HOME`,不碰你在用的 profile 与会话):
|
|
93
97
|
|
|
94
98
|
```bash
|
|
95
99
|
# 1) 把另一个通道装到临时 prefix,不覆盖全局安装
|
|
96
|
-
npm i --prefix /tmp/dsh-rc @deepseek-ai/dsh@0.1
|
|
100
|
+
npm i --prefix /tmp/dsh-rc @deepseek-ai/dsh@0.2.1-rc.5
|
|
97
101
|
|
|
98
102
|
# 2) 复制一份独立 home(含带 codinput 的 profile)
|
|
99
103
|
cp -r ~/.dsh /tmp/dsh-rc-home
|
|
@@ -104,3 +108,13 @@ DSH_HOME=/tmp/dsh-rc-home /tmp/dsh-rc/node_modules/.bin/dsh web --port 3081 --no
|
|
|
104
108
|
|
|
105
109
|
重点复验:第 1 节**三态与侧栏承载**(`conversation.composer.bar` 遮蔽、`sidebar.right.pane.tab` 承载判定、收起后的唤回小球)与第 3 节**触发管线与菜单**——宿主契约变化最先断在这两处,其余功能是自绘的,跨通道风险低。
|
|
106
110
|
|
|
111
|
+
## 8. 0.3.7 / 0.3.8 新功能与回归
|
|
112
|
+
|
|
113
|
+
- [ ] **用户消息 Markdown**:发送一条含 `**加粗**`、行内代码、围栏代码块、列表的消息 → 落库后右侧气泡按 Markdown 渲染,ARIA 语义(paragraph/strong/code/list)正确;@文件 / @会话 / //技能 引用 chip 显示并可点开;复制钮与时间戳、引用摘要行、悬停显形正常;`__dshCodinputErrs` 为空。设置开关即时切换(见第 5 节)。切换宿主语言后复制钮/引用摘要文案即时更新(不刷新);连续复制后卸载/切形态无残留定时器报错。
|
|
114
|
+
- [ ] **带图用户消息(0.3.7 P0 回归点)**:发一条带图片附件的消息(或打开历史带图消息)→ 图片经官方 `renderMessageImages` 正常显示、无 `data-slot-error` 崩溃面;此后继续发送的用户/插队消息仍是 Markdown 形态(条目未被废黜);`__dshCodinputErrs` 为空。
|
|
115
|
+
- [ ] **Markdown 安全基线**:用户消息里输入 `<style>body{display:none}</style>`、`<form><input></form>`、`[x](javascript:alert(1))` → 气泡只显示纯文本/安全元素,页面样式不被改写、无表单/控件、非 http(s)/mailto 链接不可点;`` 不渲染为图片(降级为 alt 文本)。
|
|
116
|
+
- [ ] **插件页图标**:宿主插件列表/已装插件卡显示 `assets/icon.png`(与文件逐字节一致),不再落默认图;包的 `package.json` 顶层 `icon` 为相对路径。
|
|
117
|
+
- [ ] **数据行三面板互斥 + portal 定位**:见第 4 节两条新增条目(互斥、滚动跟随 / resize 夹取 / Escape 与点外关闭 / 不被输入卡片裁剪)。
|
|
118
|
+
- [ ] **桌面端开关样式**:桌面版(当前 `0.2.1-rc.3`)设置页开关与官方 primitives Switch 同款(ON 轨道随宿主品牌色,深色主题下为近白)——本项为 0.3.8 静态对齐项;桌面实机回归前按「待验」记录。
|
|
119
|
+
- [ ] **样式热更新(patchReload live)**:替换 `lib/client.js` 后强刷(或宿主原地更新插件)→ 新增的 `dci-` 类样式生效,不出现「旧 `<style>` 仍在、新类永不注入」;无需清缓存或重装插件。
|
|
120
|
+
|