dsh-enhance 0.1.0 → 0.3.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 laughmaker
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 CHANGED
@@ -1,18 +1,26 @@
1
1
  # dsh-enhance
2
2
 
3
- DeepSeek Harness(DSH)增强插件:Markdown 主题统一、划词批注、侧栏更窄。
3
+ DeepSeek Harness(DSH)增强插件:Markdown 主题统一、划词批注、侧栏更窄、启动默认状态。
4
4
 
5
5
  ## 功能
6
6
 
7
7
  - **Markdown 主题** — 统一主对话、侧栏对话、文件预览等所有 `MarkdownText` 渲染的排版:标题配色、加粗、行内代码、代码块、表格、引用块。浅色/深色两套配色自动跟随主题。
8
- - **划词批注** — 选中文字弹出小面板写一句要求(Enter 确认,Esc 取消)。确认后汇总为输入框内的 `N annotations` 胶囊:
8
+ - **划词批注** — 选中文字弹出小面板写一句要求(Enter 确认,Esc 取消;弹窗出现即自动聚焦输入框,光标落在末尾)。确认后汇总为输入框内的 `N annotations` 胶囊:
9
9
  - 悬停胶囊展开列表,每行显示要求与引文
10
10
  - 悬停行会在正文高亮对应段落,点击行滚动定位到原文
11
11
  - 每行右侧可编辑(弹窗)或删除,胶囊右侧一键清空
12
- - 已批注段落在正文保留琥珀色图钉,点击图钉直接编辑该批注
13
- - 发送消息时自动拼进消息,输入框保持干净
12
+ - 已批注段落在正文保留带序号的蓝色圆标(图钉与编号合为一个图标),点击圆标直接编辑该批注,并在正文保持该段落的高亮
13
+ - 编辑弹窗内可直接删除该批注
14
+ - 有批注挂起时发送按钮即刻可用,而输入框保持空白;发送瞬间才把引文拼进消息
15
+ - 弹窗输入框无内边距、贴合面板,高度随内容自动增长且不出现滚动条
14
16
  - **侧栏提问** — 从同一面板把段落送到右侧栏的侧边对话,不打断当前对话。首次创建,之后复用同一标签页。
15
- - **侧栏更窄** — 侧栏可拖到 214px(上游限制 264px),文字相应缩小一档。
17
+ - **侧栏更窄** — 侧栏可拖到 214px(上游限制 264px),文字相应缩小一档;文件夹图标换成展开/收起三角,文件夹标题与会话标题同字号、左端对齐。
18
+ - **面板图标置顶** — Plugins / 自动化等面板图标移到侧栏顶部、工作区列表之上,并排成一行;每行最多 5 个,超出换行。上游是带文字的竖排列表,此前本插件把它放在右下角。只改位置与排版,宿主的选中态、悬停态和那个「更多」菜单都照旧。
19
+ - **插件图标也置顶** — 新装的插件如果把图标注册到侧栏底部(`sidebar.footer.action`,比如「远程访问」的电话图标),它的按钮会被搬进同一行顶部列表,同样按 5 个一行、超出换行。搬的是宿主自己的容器而不是插件的按钮,所以插件自己的选中态、悬停态和弹层都照常工作;折叠成图标轨时交回宿主布局。
20
+ - **启动即最窄** — 首次启动侧栏直接是 214px(上游每次加载都回到 280px),之后按你上次拖到的宽度打开。折叠/展开不会丢掉这个宽度。
21
+ - **窗口铺满屏幕** — 首次启动主窗口铺满可用区域(菜单栏与 Dock 保留,等同绿色按钮的缩放);之后按上次关闭时的窗口位置与大小重新打开。保存的窗口若超出当前显示器(换屏、改分辨率)会被拉回可见区域。
22
+ - **运行中彩色转圈** — 侧栏里正在运行的会话,状态环不再是宿主那样的灰色,而是一圈彩色:蓝→紫→洋红→琥珀的 4 秒色相循环,浅色与深色主题下都清晰。环的转动与虚线段仍由宿主驱动,本插件只改颜色;其他位置的状态点(任务、审批、工作流)保持原样。
23
+ - **Dock 完成角标** — macOS Dock 图标上的红色数字 = 侧栏「绿点未读会话」的数量:某会话跑完而你没在看它(切到别的会话或别的 App)就 +1,点开读一下即 -1,全部读完角标消失。直接映射宿主 `uiSession.sessionStatus.completionUnread`(与侧栏绿点同一数据源),走标准 Badging API(`navigator.setAppBadge`),宿主不支持时静默降级。
16
24
 
17
25
  ## 安装
18
26
 
@@ -23,9 +31,9 @@ DSH 打开 **Plugins** 页面 → 添加插件 → 输入 `dsh-enhance` → 安
23
31
  ### 方式二:本地 tar 包
24
32
 
25
33
  ```bash
26
- # 从 Releases 下载 dsh-enhance-0.1.0.tgz 后
34
+ # 从 Releases 下载 dsh-enhance-0.3.1.tgz 后
27
35
  cd ~/.dsh/profiles/desktop
28
- npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.1.0.tgz"
36
+ npx pnpm@11.28.5 add "file:/绝对路径/dsh-enhance-0.3.1.tgz"
29
37
  ```
30
38
 
31
39
  再编辑 `~/.dsh/profiles/desktop/package.json`,把 `dsh-enhance` 加入 `dsh.profile.bundles`:
@@ -79,6 +87,10 @@ npx pnpm@11.28.5 remove dsh-enhance
79
87
  - 批注保存在浏览器内存,不落盘,**刷新页面后清空**。
80
88
  - 批注按会话隔离,切换会话不会串。
81
89
  - 划词手势只在主对话生效;侧边对话通过「侧栏提问」接收批注。
90
+ - 窗口几何与侧栏宽度存在渲染进程的 `localStorage`(`dsh-enhance.window-geometry.v1`、`dsh-enhance.sidebar-width.v1`),清缓存或换机器后回到默认:铺满 + 214px。
91
+ - 窗口由页面侧调用 `resizeTo`/`moveTo` 驱动,因此是「缩放铺满」而不是系统全屏;全屏仍走绿色按钮或系统菜单。
92
+ - macOS 下渲染进程收不到纯移动(`move`)事件,窗口位置在最后一次改变大小、失焦或页面隐藏时记录;只拖动位置未改大小就立即强退,位置可能停在上一次记录的点。
93
+ - 首次启动只有在没有任何已保存状态时才铺满;想回到默认,清掉上述两个键后重启。
82
94
 
83
95
  ---
84
96
 
@@ -95,9 +107,12 @@ npx pnpm@11.28.5 remove dsh-enhance
95
107
  | `src/client/AnnotationTray.tsx` | 胶囊列表与编辑弹窗 |
96
108
  | `src/client/annotations.ts` | 批注存储(会话维度) |
97
109
  | `src/client/anchors.ts` | 在转录区重新定位段落、绘制高亮与图钉 |
98
- | `src/client/sidebar-floor.ts` | 侧栏拖拽下限(264 → 214) |
110
+ | `src/client/sidebar-floor.ts` | 侧栏拖拽下限(264 → 214)、启动宽度应用与拖拽落定回调 |
111
+ | `src/client/sidebar-width.ts` | 记住侧栏宽度(首次 214,之后按上次拖到的值) |
112
+ | `src/client/window-geometry.ts` | 窗口几何:首次铺满可用区域,之后恢复上次的窗口位置与大小 |
113
+ | `src/client/turn-badge.ts` | Dock 未读会话角标(映射宿主 completionUnread) |
99
114
  | `src/client/side-chat.ts` | 侧栏对话资源与标签页 |
100
- | `src/client/styles/` | 各样式表(每个文件导出一个 `String.raw` 模板) |
115
+ | `src/client/styles/` | 各样式表(每个文件导出一个 `String.raw` 模板);`running-spinner.ts` 负责侧栏运行中色环 |
101
116
  | `lib/` | 构建产物,即 `npm pack` 打包内容 |
102
117
 
103
118
  ### 构建与测试
@@ -110,6 +125,15 @@ npx pnpm@11.28.5 remove dsh-enhance
110
125
  ./node_modules/.bin/vitest run plugins/dsh-enhance/tests
111
126
  ```
112
127
 
128
+ 本机 `tsdown`/`vitest` 依赖的 rolldown 原生绑定存在代码签名问题,可能无法运行(报 `Cannot find module '@rolldown/binding-darwin-universal'` 或 `different Team IDs`)。这种情况下改样式表后可用同步脚本落地,它只替换 `lib/client.js` 中对应 `//#region` 的 `String.raw` 负载,其余字节保持不变:
129
+
130
+ ```bash
131
+ node script/sync-style.mjs # 同步全部样式表
132
+ node script/sync-style.mjs toolbar # 只同步某一张
133
+ ```
134
+
135
+ 脚本会拒绝含反引号或 `${` 的 CSS——样式表被包在 `String.raw` 模板里,这类字符会提前闭合模板并静默截断整张表。
136
+
113
137
  ### 发布
114
138
 
115
139
  ```bash
package/cordis.patch.yml CHANGED
@@ -1,9 +1,8 @@
1
1
  # dsh-enhance bundle patch
2
2
  #
3
- # The plugin's one row. The installer links this package into the desktop
4
- # profile and lists it under `dsh.profile.bundles`, so this insert is what
5
- # mounts the client half; the browser bundle itself is served by the host's
6
- # client module system from the package's `./client` export.
3
+ # The single row this bundle contributes. A profile that lists `dsh-enhance`
4
+ # under `dsh.profile.bundles` mounts that row, and the host's client module
5
+ # system then serves the browser half from the package's `./client` export.
7
6
  - insert:
8
7
  - id: dsh-enhance
9
8
  name: 'dsh-enhance'