dsh-codinput 0.3.1 → 0.3.5
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 +76 -0
- package/README.en.md +9 -0
- package/README.md +9 -0
- package/lib/client.js +55 -46
- package/package.json +1 -1
- package/src/client/components/CodinputBar.tsx +6 -0
- package/src/client/components/CodinputSurface.tsx +7 -1
- package/src/client/components/InputLeftSlot.tsx +26 -0
- package/src/client/components/InputRightSlot.tsx +26 -0
- package/src/client/components/InputSlotSeat.tsx +80 -0
- package/src/client/components/MenuSurface.tsx +53 -23
- package/src/client/components/ModelLabel.tsx +57 -0
- package/src/client/components/ModelMenu.tsx +90 -30
- package/src/client/components/PopupSelectView.tsx +3 -2
- package/src/client/components/Toolbar.tsx +24 -3
- package/src/client/components/VoiceActivity.tsx +5 -62
- package/src/client/components/slotEntry.tsx +205 -0
- package/src/client/host-types.ts +2 -0
- package/src/client/icons.tsx +11 -2
- package/src/client/index.tsx +6 -1
- package/src/client/modeldir.ts +2 -0
- package/src/client/sidebar.tsx +41 -3
- package/src/client/styles.ts +22 -10
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,82 @@
|
|
|
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.5] — 2026-10-23
|
|
6
|
+
|
|
7
|
+
第三方输入座位补齐(issue #1 之左座):`conversation.input.left` 条目恢复显示;v0.3.4 的右座实现泛化为「座位镜像」层。
|
|
8
|
+
|
|
9
|
+
### 新增
|
|
10
|
+
|
|
11
|
+
- **左座 `conversation.input.left` 槽位转发渲染**:该子槽位位于官方工具行左区 `.tools` 内 modes(权限→计划)之后——issue 截图里的底栏按钮(如「上传视频」)、dsh-qoder-plugin 的额度读数等第三方条目注册在这里;遮蔽官方输入框后渲染点随条目一起消失。接管卡片工具行现于同位置(`.dci-tools` 内、权限触发器之后)复刻官方 renderer 的 list 合成,三形态(普通/悬浮/侧栏标签)同享。已在真实 web 宿主(`0.2.0-rc.2`)实测:座位条目渲染进左区几何正确位置、三形态一致、无横向溢出,卸载条目后零残留。
|
|
12
|
+
- **座位镜像通用引擎**:v0.3.4 的右座实现抽成 `InputSlotSeat`(座位名 + standard props 面参数化),左右两座共用同一套 list 合成(id 首占位去重 + order 升序)、条目 inject/`use<Name>` 钩子、条目 locale 的 `t`、standard props 原样通道与逐条目崩溃隔离;后续座位接入只需再加一片薄壳。
|
|
13
|
+
|
|
14
|
+
### 说明
|
|
15
|
+
|
|
16
|
+
- 检测即兼容:槽位无条目或宿主过旧(无该子槽位)时座位不渲染,零样式零行为残留;单个条目崩溃被边界隔离,不连坐输入面。
|
|
17
|
+
- 左右两座的 standard props 面同源:宿主下发给 bar/侧栏 body 条目的 kit 减去 owner props(侧栏再剔除注入的 `useTabInfo`)。
|
|
18
|
+
- **已知限制(本版边界)**:`conversation.input.model` 单座(如 dsh-model-accordion 类替换模型选择器的插件)与自绘模型芯片 UX 冲突,本版不镜像;`conversation.input.attachments` / `overlay` / `dock` 生态暂无租客,留扩展位。
|
|
19
|
+
- **覆盖边界(措辞分界)**:左座转发在真实 web 宿主(`0.2.0-rc.2`)上以确定性探针条目实测通过(渲染位置/三形态/卸载零残留);dsh-qoder-plugin 的左额度读数与右探针双座条目实测注册成功、无报错,但其组件按官方契约在未选中 Qoder provider 时返回 `null`,可见读数属机制推断、未实测;左座席位的「上传视频」类插件真身未在本环境出现,同属机制覆盖(其注册形态与已实测样本同轴)。右座既有租客(dsh-prompt-enhancer)端到端回归实测不受影响。
|
|
20
|
+
|
|
21
|
+
[0.3.5]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.4...v0.3.5
|
|
22
|
+
|
|
23
|
+
## [0.3.3] — 2026-10-23
|
|
24
|
+
|
|
25
|
+
主题/皮肤插件兼容:错误色与预览链接逐值对齐官方;README 增补皮肤作者指南。
|
|
26
|
+
|
|
27
|
+
### 变更
|
|
28
|
+
|
|
29
|
+
- **错误色回退值逐值对齐官方**:`.dci-error` 与完全权限确认警示图标的错误色回退值由 `#ff6b6b` 改为官方同款 `#d54941`(token 仍走 `--dsw-alias-state-error-primary`,仅无该令牌的宿主回退时可见差异)。
|
|
30
|
+
- **预览链接走官方 alias-link token**:markdown 预览的链接色由写死 `#4c8dff` 改为 `var(--dsw-alias-link, #4c8dff)`,换肤下与官方 markdown 链接同进退。
|
|
31
|
+
|
|
32
|
+
### 新增
|
|
33
|
+
|
|
34
|
+
- **README 皮肤作者指南(中英)**:新增「主题 / 皮肤插件兼容」章节——覆写宿主 `--dsw-*` token 即全盘生效(含 token 定义在 body 层、覆写需写同层的注意点);官方写死的值清单(发送钮图标前景白等,属预期不跟 token);稳定的 `dci-` 前缀类名契约与注入顺序(皮肤后注入按常规 CSS 权重覆盖)。
|
|
35
|
+
|
|
36
|
+
## [0.3.4] — 2026-10-23
|
|
37
|
+
|
|
38
|
+
第三方输入条目兼容(issue #1 之右座):接管后 `conversation.input.right` 座条目恢复显示(已实测 dsh-prompt-enhancer 的 ✨/🎤);模型/推理强度弹层恢复官方形态。
|
|
39
|
+
|
|
40
|
+
### 新增
|
|
41
|
+
|
|
42
|
+
- **`conversation.input.right` 槽位转发渲染**:该子槽位由官方 InputBar(`conversation.composer.bar` 缺省条目)声明并在其工具行内渲染;Codinput 以 priority -1 遮蔽官方条目后,槽位渲染点随官方输入框一起消失,注册在此槽位的第三方按钮(如 dsh-prompt-enhancer 的 ✨ 提示词优化 / 🎤 语音识别)无处挂载。接管卡片的工具行现于官方同座位(右侧标准控件区、模型选择之前)复刻官方 renderer 的 list 条目合成(id 首占位去重 + order 升序 + priority 遮蔽序、条目 inject/`use<Name>` 钩子、条目 locale 的 `t`、standard props 原样通道、逐条目崩溃隔离),三形态(普通/悬浮/侧栏标签)同享。
|
|
43
|
+
- **检测即兼容**:槽位无条目或宿主过旧(无该子槽位)时座位不渲染,零样式零行为残留;单个条目崩溃被边界隔离,不连坐输入面。
|
|
44
|
+
|
|
45
|
+
### 修复
|
|
46
|
+
|
|
47
|
+
- **菜单钻入子页后向下弹出**:`MenuSurface` 旧实现只在打开瞬间定位一次(尺寸变化不重算),从根菜单点进更长的「模型 / 推理强度」列表时,卡片保持小菜单算好的顶边向下生长、盖住触发器,视觉上变成「向下弹出」。现复刻官方 ModelSelect 的 `place()` 三路监听(ResizeObserver 挂卡片 + 页面 scroll/resize),内容尺寸每次变化即重算上方锚位并夹进视口。
|
|
48
|
+
- **模型选择框无滚动条**:旧 `.dci-menu` 把 `max-height: 100vh - 24px` 与 `overflow-y: auto` 压在卡片本体且未注入官方卡片的 `--dsh-scrollbar-thumb`(l2)变量;叠加上一条后卡片伸出视口被浏览器裁切,列表项既够不着也不出条。现按官方两级结构复刻——卡片 `overflow: hidden` + `max-height: min(360px, 100vh - 96px)`,列表在 `.dci-viewport` 内滚、细滚动条按官方 l2 变量着色;`popupSelect` 壳(命令选项弹层)同步内滚结构。
|
|
49
|
+
|
|
50
|
+
### 说明
|
|
51
|
+
|
|
52
|
+
- 官方渲染门槛同款复刻:`input === undefined || sessionId === undefined` 时整个座位不渲染。
|
|
53
|
+
- 条目声明 store 的 `useStore`/`actions` 面依赖宿主私有记账,插件侧不可复现;现网此类条目未出现。
|
|
54
|
+
- **覆盖边界**:本版转发的是 `conversation.input.right`(右座);`conversation.input.left`(左座,如部分插件的「上传视频」按钮与 qoder-plugin 的额度读数)暂未转发,后续版本补齐。
|
|
55
|
+
- **右座覆盖面**:同座其他条目(如各 Qoder 渠道插件的积分/余额读数)按同一合成机制恢复显示——推断自各包源码的槽位注册(五家 Qoder 桥接包均注册于 right 座),未逐一实测。
|
|
56
|
+
|
|
57
|
+
[0.3.4]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.3...v0.3.4
|
|
58
|
+
|
|
59
|
+
[0.3.3]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.2...v0.3.3
|
|
60
|
+
|
|
61
|
+
## [0.3.2] — 2026-10-18
|
|
62
|
+
|
|
63
|
+
桌面版 0.2.1 模型区同步(官方 1017 发布徽章);侧栏标签与指南页条目上品牌标。
|
|
64
|
+
|
|
65
|
+
### 新增
|
|
66
|
+
|
|
67
|
+
- **模型名 1017 发布徽章同步(桌面版 `0.2.1-rc.2`)**:官方给模型座位新增了模型名标签子槽位(`conversation.input.model.label`),并以内置插件给 DeepSeek 官方通道的 flash 模型显示名后追加一枚 info 色发布徽章「1017」。Codinput 原样渲染该槽位的官方条目组件——触发器、模型菜单根页与模型列表三处与原生输入框同款(徽章样式随官方插件自带注入)。官方未提供条目时(web 各版本、桌面 `0.2.0-rc.2` 及更早)自动回退纯模型名,与各自宿主的原生表现一致。
|
|
68
|
+
- **侧栏标签与指南页条目上品牌标**:侧栏标签芯片改走官方标签标题座位(`sidebar.right.pane.tab.title`,与官方 Files / Guide 标签同构),在标签名前渲染鲸鱼蓝 `#3964FE` 品牌标(此前是无图标的纯文本);指南页「Codinput」条目同样以品牌标替换官方的灰色立方体兜底图标;拖出浮动后窗口标题同享。
|
|
69
|
+
|
|
70
|
+
### 变更
|
|
71
|
+
|
|
72
|
+
- **思考强度显示对齐官方公式**:会话未显式指定强度时回落当前模型的默认强度并显示其名字(此前一律显示「Default」,官方显示的是默认强度名,如 Max / High);模型未提供推理元数据时显示会话保留强度。推理等级菜单在模型未声明默认强度时补官方的「Default(跟随提供方默认)」行;模型无推理元数据时不再显示强度入口(官方同款)。
|
|
73
|
+
- **触发器样式逐值对齐**:圆角走 `--dsw-radius-sm` 令牌链(无令牌的旧宿主回退原 24px 视觉);模型触发器字重 400、权限触发器保持 500——官方两款触发器本就不同,此前共用类一律 500。
|
|
74
|
+
|
|
75
|
+
### 说明
|
|
76
|
+
|
|
77
|
+
- **检测即兼容**:模型徽章经官方槽位条目渲染,条目缺席时自动回退纯名,无样式无行为残留。桌面版 `0.2.1-rc.2` 端到端实测(徽章、强度显示、品牌标、触发器);web `0.1.7-rc.2` 按官方包逐行取证(无该子槽位与徽章插件、目录快照字段一致)加守卫降级覆盖;`0.1.5-rc.2` / `0.1.6-alpha.2` 沿用既往结论。升级宿主后建议按 [TESTING.md](./TESTING.md) 冒烟。
|
|
78
|
+
|
|
79
|
+
[0.3.2]: https://github.com/Witherwithwinter/DSH-Codinput/compare/v0.3.1...v0.3.2
|
|
80
|
+
|
|
5
81
|
## [0.3.1] — 2026-10-11
|
|
6
82
|
|
|
7
83
|
编辑 + 预览分屏同步滚动;README 展示图与品牌视觉更新;第三方归属补全。
|
package/README.en.md
CHANGED
|
@@ -122,6 +122,15 @@ For `0.1.7-rc.2`, on top of the real-instance run, the official CSS for the cand
|
|
|
122
122
|
|
|
123
123
|
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
124
|
|
|
125
|
+
### Theme / skin plugin compatibility (for skin authors)
|
|
126
|
+
|
|
127
|
+
Codinput ships no colors of its own: every color comes from the host's `--dsw-*` design tokens (light/dark follows the host). How theme/skin plugins for the host get along with Codinput:
|
|
128
|
+
|
|
129
|
+
- **Overriding host tokens restyles everything at once** — once you override `--dsw-*` variables, Codinput's card, menus, buttons and badges follow along with the official UI; no per-plugin adaptation needed. Note the host defines its tokens on `body` (`body[data-ds-dark-theme]`), so overrides must live on that same level: ones written on `:root` are shadowed by the `body` definitions.
|
|
130
|
+
- **Values the official UI hardcodes, Codinput hardcodes too** (the white foreground of the send-button icon, the purple of the context meter's tools segment, etc.) — value-for-value parity with how the official UI behaves under a reskin. These do not follow tokens; that is expected.
|
|
131
|
+
- **To target Codinput precisely**: every element uses the stable `dci-` class prefix (card `.dci-card`, send button `.dci-send`, menus `.dci-menu` / `.dci-slash-menu`, stats row `.dci-stat-root`, recall ball `.dci-ball`, …) — use them directly as skin selectors. The plugin injects its styles once as `<style id="dsh-codinput-styles">`; skin styles injected later win by normal CSS specificity.
|
|
132
|
+
- The editor (CodeMirror) font is a user preference (monospace stack by default) and does not follow skin fonts; its colors do follow the tokens.
|
|
133
|
+
|
|
125
134
|
## Known limitations
|
|
126
135
|
|
|
127
136
|
- `/` `@` candidates come from host directories (skills / commands / files / sessions); when the host provides none, the menu is empty — the plugin cannot fill that in.
|
package/README.md
CHANGED
|
@@ -120,6 +120,15 @@ dsh plugin --profile web add link:/abs/path/to/DSH-Codinput
|
|
|
120
120
|
|
|
121
121
|
对 `0.1.7-rc.2` 除实机验证外,还从该版本的客户端包(`dsh-client-ui-theme` / `dsh-client-ui-input-trigger` / `dsh-client-ui-conversation` / `dsh-client-ui-chat`)逐值提取了候选菜单、上下文小圈与 stats dock 的官方 CSS 核对。插件依赖的契约按版本核对过:用到的 3 个槽位(`conversation.composer.bar`、`sidebar.right.pane.tab`、`settings.section`)、`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
122
|
|
|
123
|
+
### 主题 / 皮肤插件兼容(皮肤作者必读)
|
|
124
|
+
|
|
125
|
+
Codinput 不自带配色:全部颜色取自宿主的 `--dsw-*` 设计 token(亮暗主题随宿主切换)。给宿主做主题/皮肤的插件与 Codinput 的相处方式:
|
|
126
|
+
|
|
127
|
+
- **改宿主 token 即全盘生效**——覆写 `--dsw-*` 变量后,Codinput 的卡片、菜单、按钮、徽章与官方 UI 一同跟随,无需单独适配。注意宿主把 token 定义在 `body`(`body[data-ds-dark-theme]`)上,覆写要写在同一层:写在 `:root` 会被 `body` 上的定义盖掉。
|
|
128
|
+
- **官方写死的值 Codinput 同样写死**(发送钮图标的前景白、上下文仪表 tools 分段的紫等),与官方在换肤下的表现保持逐值一致——这些不跟 token 变,属预期行为。
|
|
129
|
+
- **要精确点妆 Codinput**:所有元素类名都是稳定的 `dci-` 前缀(卡片 `.dci-card`、发送钮 `.dci-send`、菜单 `.dci-menu` / `.dci-slash-menu`、数据行 `.dci-stat-root`、唤回小球 `.dci-ball` 等),可直接作皮肤选择器;插件样式一次性注入 `<style id="dsh-codinput-styles">`,皮肤在其后注入即可按常规 CSS 权重覆盖。
|
|
130
|
+
- 编辑器(CodeMirror)的字体是用户偏好(默认等宽栈),不跟随皮肤字体;其颜色同样走 token。
|
|
131
|
+
|
|
123
132
|
## 已知限制
|
|
124
133
|
|
|
125
134
|
- `/` `@` 的候选内容来自宿主目录(技能 / 命令 / 文件 / 会话);宿主不提供时为空,插件侧无法补。
|