dsh-sidenote 0.1.0
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 +60 -0
- package/cordis.patch.yml +16 -0
- package/lib/client.js +2143 -0
- package/lib/index.js +6 -0
- package/lib/types/client/annotate/anchor.d.ts +57 -0
- package/lib/types/client/annotate/chip.d.ts +11 -0
- package/lib/types/client/annotate/draft.d.ts +29 -0
- package/lib/types/client/annotate/format.d.ts +52 -0
- package/lib/types/client/annotate/index.d.ts +2 -0
- package/lib/types/client/annotate/model.d.ts +59 -0
- package/lib/types/client/annotate/overlay.d.ts +27 -0
- package/lib/types/client/annotate/selection.d.ts +49 -0
- package/lib/types/client/bridge.d.ts +19 -0
- package/lib/types/client/index.d.ts +12 -0
- package/lib/types/client/locales.d.ts +77 -0
- package/lib/types/client/sidechat/SideChatPanel.d.ts +2 -0
- package/lib/types/client/sidechat/composer.d.ts +26 -0
- package/lib/types/client/sidechat/index.d.ts +2 -0
- package/lib/types/client/sidechat/model.d.ts +101 -0
- package/lib/types/client/sidechat/open.d.ts +16 -0
- package/lib/types/client/sidechat/slash.d.ts +12 -0
- package/lib/types/context-types.d.ts +335 -0
- package/lib/types/index.d.ts +9 -0
- package/package.json +96 -0
- package/src/client/annotate/anchor.ts +158 -0
- package/src/client/annotate/annotate.module.css +301 -0
- package/src/client/annotate/chip.tsx +115 -0
- package/src/client/annotate/css.d.ts +9 -0
- package/src/client/annotate/draft.ts +67 -0
- package/src/client/annotate/format.ts +83 -0
- package/src/client/annotate/index.tsx +66 -0
- package/src/client/annotate/model.ts +138 -0
- package/src/client/annotate/overlay.tsx +531 -0
- package/src/client/annotate/selection.ts +203 -0
- package/src/client/bridge.ts +19 -0
- package/src/client/index.tsx +22 -0
- package/src/client/locales.ts +175 -0
- package/src/client/sidechat/SideChatPanel.tsx +366 -0
- package/src/client/sidechat/composer.ts +129 -0
- package/src/client/sidechat/css-modules.d.ts +5 -0
- package/src/client/sidechat/index.tsx +56 -0
- package/src/client/sidechat/model.ts +331 -0
- package/src/client/sidechat/open.ts +66 -0
- package/src/client/sidechat/sidechat.module.css +230 -0
- package/src/client/sidechat/slash.ts +84 -0
- package/src/context-types.ts +369 -0
- package/src/index.ts +13 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 gyixuan
|
|
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,60 @@
|
|
|
1
|
+
# dsh-sidenote
|
|
2
|
+
|
|
3
|
+
DSH(DeepSeek Harness)web 插件:Codex 风格的**侧边聊天**与**划选注释**。[dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar) 的薄消费插件(thin consumer),通过 `ctx.betterSidebar` 服务注册侧边栏 Tab。
|
|
4
|
+
|
|
5
|
+
[English](README_EN.md) · 中文
|
|
6
|
+
|
|
7
|
+
## 功能一览
|
|
8
|
+
|
|
9
|
+
### 💬 侧边聊天
|
|
10
|
+
|
|
11
|
+
从当前主会话 **fork**(全量历史快照)出独立的侧边会话,在右侧栏的「侧边」Tab 里多轮对话——主线思路不打断,支线问题随手开:
|
|
12
|
+
|
|
13
|
+
- 右侧栏 `+` 菜单 →「侧边聊天」,或斜杠命令 `/side`;
|
|
14
|
+
- fork 时刻带主会话完整上下文,之后两个会话各自独立演进;
|
|
15
|
+
- 多实例并存(「侧边」「侧边 2」…),各自独立关闭;
|
|
16
|
+
- 模型跟随主会话当前选择(fork 时同步);
|
|
17
|
+
- 持久化:刷新/重启后随布局恢复;不进左侧会话列表(归档隐藏);仅手动关闭 Tab 从界面消失。
|
|
18
|
+
|
|
19
|
+

|
|
20
|
+
|
|
21
|
+
### 🗒️ 划选注释
|
|
22
|
+
|
|
23
|
+
在 assistant 消息上划选文本,把「引用 + 你的注解」变成发送给模型的上下文:
|
|
24
|
+
|
|
25
|
+
- **添加到对话**:选中文本高亮 + 蓝色编号角标 + 注解编辑器(可空注解);主输入框出现「N 条注释」chip,全部存活注释随下一条消息发出;
|
|
26
|
+
- **在侧边聊天中提问**:注解编辑后引用 + 注解直接进入侧边聊天输入框;
|
|
27
|
+
- 点角标可重开编辑器修改/删除;编号按创建顺序、删除不重排;页面级生命周期(刷新即失)。
|
|
28
|
+
|
|
29
|
+
| 划选浮层 | 注解编辑器 | 角标 + 注释 chip |
|
|
30
|
+
|---|---|---|
|
|
31
|
+
|  |  |  |
|
|
32
|
+
|
|
33
|
+
## 安装
|
|
34
|
+
|
|
35
|
+
前置:已安装 [dsh-better-sidebar](https://github.com/omdsh-dev/DSH-better-sidebar)(本插件的硬依赖)。
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
dsh plugin --profile web add dsh-sidenote
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
本地开发挂载:`dsh plugin --profile web add link:<本仓库路径>`(client 改动热重载,host 改动需重启 `dsh web`)。
|
|
42
|
+
|
|
43
|
+
## 设计要点
|
|
44
|
+
|
|
45
|
+
- **真 fork,不压缩**:侧边会话是真实 DSH 会话(fork 全量历史),拥有与主会话对等的能力(工具调用、继续深挖、再 fork);不是「压缩成摘要 + 一次性问答」。
|
|
46
|
+
- **列表卫生**:侧边会话归档隐藏,左侧列表永远干净。
|
|
47
|
+
- **可累积的标注工作流**:多次划选累积多条注释,编辑、删除、随消息一起发出——不是一次性单引文。
|
|
48
|
+
|
|
49
|
+
## 开发
|
|
50
|
+
|
|
51
|
+
| 命令 | 说明 |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `pnpm typecheck` | tsc --noEmit |
|
|
54
|
+
| `pnpm test` | vitest 纯函数单测 |
|
|
55
|
+
| `pnpm build` | 类型声明 + tsdown(host ESM + client CJS bundle,纯度门) |
|
|
56
|
+
| `pnpm test:mount` | 挂载冒烟:scratch profile + 伪造会话 jsonl + 真实 `dsh web` + Playwright 七条 journey lane(支持 `BS_VERSION` 切换 better-sidebar 版本做前向兼容验证) |
|
|
57
|
+
|
|
58
|
+
## License
|
|
59
|
+
|
|
60
|
+
MIT
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# dsh-sidenote bundle patch
|
|
2
|
+
#
|
|
3
|
+
# `dsh.bundle.patch` layer of the published package: installing through the
|
|
4
|
+
# official CLI —
|
|
5
|
+
#
|
|
6
|
+
# dsh plugin --profile <name> add dsh-sidenote
|
|
7
|
+
#
|
|
8
|
+
# — appends this single `insert` (one plugin row) to the bundle stack. No
|
|
9
|
+
# manual profile edits.
|
|
10
|
+
#
|
|
11
|
+
# dsh-sidenote requires dsh-better-sidebar as a hard peer dependency: the
|
|
12
|
+
# client half declares `inject = ['betterSidebar', ...]`, so it stays inactive
|
|
13
|
+
# (no UI, no behavior) until better-sidebar provides the service.
|
|
14
|
+
- insert:
|
|
15
|
+
- id: side-chat
|
|
16
|
+
name: 'dsh-sidenote'
|