dsh-plugin-session-console-sleepcat 0.17.4
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 +76 -0
- package/lib/client.js +1344 -0
- package/lib/index.js +11 -0
- package/package.json +47 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 dsh-plugin-session-console contributors
|
|
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,76 @@
|
|
|
1
|
+
# dsh-plugin-session-console-sleepcat
|
|
2
|
+
|
|
3
|
+
<img src="icon-v2.png" alt="dsh-plugin-session-console-sleepcat" width="128">
|
|
4
|
+
|
|
5
|
+
DSH(DeepSeek Harness)**客户端 UI 插件**:对话内部的**小型工具栏**(工具坞)+ 会话记录工具,带一只睡觉小猫。
|
|
6
|
+
|
|
7
|
+
## 功能
|
|
8
|
+
|
|
9
|
+
- **工具栏(嵌入式窄条)**:嵌在对话界面最左侧(贴 DSH 侧边栏右缘,随侧边栏宽度逐帧平滑跟随);对话内容自动让出左侧空间(不遮挡消息);竖排工具图标(会话记录、设置、一键收起所有过程),底部 **« 收起** 后,对话左缘中间只剩一只**睡觉小猫按钮**,点击展开;
|
|
10
|
+
- **工具:会话记录(问题面板)**:可拖拽、位置记忆、**📌 固定**(固定后点击外部不关闭)、**Esc/点击外部**关闭;
|
|
11
|
+
- **问题列表**:当前会话的用户提问(最新在前,时间显示"月日 时分"),打开时自动扩展窗口加载更早内容;点击条目**自动加载并跳转**到对应位置并高亮;
|
|
12
|
+
- **二级明细**:有 AI 提问的问题可展开,显示"AI 提问 / 回答"时间线(ask-user 按 callId 匹配),点击跳转、悬浮查看详情;
|
|
13
|
+
- **每回合收起/展开**:用户问题旁的"收起过程/展开过程"——隐藏该回合全部工作过程(思考块、工具调用/结果、命令行、中间步骤),只留问题与最终输出;**模型回答完成后默认自动收起**;
|
|
14
|
+
- **设置(独立设置界面)**:工具栏 ⚙️ 打开,按区块组织,后续定制项直接加区块:
|
|
15
|
+
- 通用:打开时自动加载更早内容、最多扩展页数(1–12)、问题列表最多显示条数(10–500)
|
|
16
|
+
- 回答收起:模型回答完成后自动收起过程(默认开启)
|
|
17
|
+
- 纯客户端插件,无 Host 侧能力;数据来自浏览器内会话快照(`ctx.sessions` → `ConversationSnapshot`),实时跟随当前会话。
|
|
18
|
+
|
|
19
|
+
## 安装(npm 发布后)
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
dsh plugin --profile web add dsh-plugin-session-console-sleepcat
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
然后在 profile 的 `cordis.patch.yml` 里启用该行:
|
|
26
|
+
|
|
27
|
+
```yaml
|
|
28
|
+
- insert:
|
|
29
|
+
- id: session-console
|
|
30
|
+
name: dsh-plugin-session-console-sleepcat
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
重启 `dsh web` 生效(浏览器请硬刷新 `Ctrl+Shift+R`)。
|
|
34
|
+
|
|
35
|
+
## 本地开发安装(未发布时)
|
|
36
|
+
|
|
37
|
+
```sh
|
|
38
|
+
dsh plugin --profile web add "file:E:/Project/dsh-space/search-one/dsh-plugin-session-console"
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
同样在 `cordis.patch.yml` 加行后重启。
|
|
42
|
+
|
|
43
|
+
## 使用
|
|
44
|
+
|
|
45
|
+
1. 进入任意会话,对话区左侧出现嵌入式工具栏(或收起态的小猫按钮);
|
|
46
|
+
2. 点 **会话记录** 打开问题面板:点击问题条目跳转到对话中对应位置(并高亮);有 AI 提问的问题可展开二级明细,点击条目跳转、悬浮查看详情;
|
|
47
|
+
3. 点 **一键收起所有过程**:所有回合只显示问题与最终输出;每回合也可单独"收起过程/展开过程";
|
|
48
|
+
4. 关闭面板:**📌 固定**后点击外部不关闭,否则点击外部或 **Esc** 关闭;
|
|
49
|
+
5. 设置面板可调整自动加载、扩展页数、列表条数、自动收起等选项。
|
|
50
|
+
|
|
51
|
+
## 开发
|
|
52
|
+
|
|
53
|
+
- `lib/client.js` —— 客户端插件主体(`window.__ModuleLoader__.load({ id, factory })` 形态,纯 JS,无构建步骤)。
|
|
54
|
+
- `lib/index.js` —— Host 半身(no-op;仅用于让加载器启用 client bundle)。
|
|
55
|
+
- 本地改完 `lib/client.js` 后重启 profile 生效(当前 profile 的 HMR 处于 disabled 状态)。
|
|
56
|
+
|
|
57
|
+
## 发布(npm)
|
|
58
|
+
|
|
59
|
+
```sh
|
|
60
|
+
npm login --registry https://registry.npmjs.org
|
|
61
|
+
npm publish --registry https://registry.npmjs.org
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
包名 `dsh-plugin-session-console-sleepcat` 已在 npm 验证可用(未占用)。
|
|
65
|
+
|
|
66
|
+
## 原理摘要(接口依据)
|
|
67
|
+
|
|
68
|
+
- 槽位契约:`shell.overlay` 为 `{ kind: 'list', scope: 'root' }`;浮层层 `pointer-events: none`,条目自身需 `pointerEvents: 'auto'` 才可交互。
|
|
69
|
+
- 会话数据:`ctx.sessions.list`(`SessionListState`:`current` + `byId`)→ `ctx.sessions.binding(id).session`(`SessionFace = ISession & ObservableSnapshot<ConversationSnapshot>`,`getSnapshot()/subscribe()`;`loadOlder()` 分页扩展窗口)。
|
|
70
|
+
- 消息结构:`ConversationSnapshot.nodes`(`ConversationNode` 判别联合:user / assistant / steering / context / tool-result / command / compaction / turn-error / model-retry / turn-max-tokens / unknown)。
|
|
71
|
+
- 跳转锚点:`snapshot.chat.nodes.values()` 里的 `ChatConversationViewNode` 带 `anchorSeq` 与 `key`;工具卡片锚定在 tool/CALL 事件 seq,按 `callId` 匹配;对话区每行 DOM 带 `data-chat-anchor-key`,`scrollIntoView` 定位。
|
|
72
|
+
- 收起/展开:`[data-chat-anchor-key]` 行按 DOM 顺序折叠;思考块 `data-variant="think"`;状态以模块级 Set 维护,快照变化时统一同步按钮文字。
|
|
73
|
+
|
|
74
|
+
## License
|
|
75
|
+
|
|
76
|
+
MIT
|