dsh-synapse 0.4.1 → 0.4.2
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 -21
- package/README.md +79 -81
- package/app.js +1344 -1344
- package/client.js +336 -241
- package/cordis.patch.yml +13 -13
- package/deepseek-mark.svg +3 -3
- package/docs/architecture.md +127 -104
- package/docs/development.md +138 -137
- package/docs/en/README.md +161 -161
- package/docs/images/native-webui.jpg +0 -0
- package/docs/images/synapse-map.jpg +0 -0
- package/docs/zh-CN/README.md +154 -154
- package/index.js +761 -754
- package/package.json +47 -45
- package/styles.css +317 -317
- package/docs/images/native-webui.png +0 -0
- package/docs/images/synapse-ui.png +0 -0
package/docs/en/README.md
CHANGED
|
@@ -1,161 +1,161 @@
|
|
|
1
|
-
# dsh-synapse English Guide
|
|
2
|
-
|
|
3
|
-
`dsh-synapse` is a Web plugin for DeepSeek Harness (DSH). It adds a session map to the native conversation interface and organizes sessions, follow-ups, and forks from the same workspace as a browsable, draggable, and zoomable canvas.
|
|
4
|
-
|
|
5
|
-
The plugin does not replace DSH models, tools, sessions, permissions, or the Web server. DSH remains responsible for every conversation operation.
|
|
6
|
-
|
|
7
|
-
## Prerequisites
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
- Node.js `>= 22.19.0`.
|
|
11
|
-
- The `web` profile; other profiles are not currently supported.
|
|
12
|
-
|
|
13
|
-
## Installation
|
|
14
|
-
|
|
15
|
-
### Install from npm
|
|
16
|
-
|
|
17
|
-
```powershell
|
|
18
|
-
corepack pnpm dsh plugin --profile web add dsh-synapse
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
The npm package ships prebuilt code, so no build-script permission is needed — the simplest install. GitHub and local-checkout routes below are alternatives.
|
|
22
|
-
|
|
23
|
-
### Install from GitHub
|
|
24
|
-
|
|
25
|
-
```powershell
|
|
26
|
-
corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
GitHub installs run the package `prepare` script, which validates JavaScript syntax with `node --check`.
|
|
30
|
-
|
|
31
|
-
### pnpm 10+ allowBuilds
|
|
32
|
-
|
|
33
|
-
pnpm 10 and later may block build scripts for Git dependencies by default. If installation is blocked, copy the **complete key printed by pnpm** into the DSH Web profile's `pnpm-workspace.yaml`:
|
|
34
|
-
|
|
35
|
-
```yaml
|
|
36
|
-
allowBuilds:
|
|
37
|
-
"dsh-synapse@https://codeload.github.com/liangmianya/dsh-synapse/tar.gz/<commit>": true
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
Use the complete key containing the tarball URL and commit, not the bare package name `dsh-synapse`. The key changes when the upstream commit changes, so use the newly printed value when upgrading.
|
|
41
|
-
|
|
42
|
-
### Install a local checkout
|
|
43
|
-
|
|
44
|
-
```powershell
|
|
45
|
-
corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
The `link:` form references the local checkout directly and is recommended for development. In a normal run, restart `dsh web` and refresh the page after editing the plugin.
|
|
49
|
-
|
|
50
|
-
## Start DSH Web
|
|
51
|
-
|
|
52
|
-
```powershell
|
|
53
|
-
corepack pnpm dsh web
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
Default address:
|
|
57
|
-
|
|
58
|
-
```text
|
|
59
|
-
http://127.0.0.1:3080/
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Let DSH choose a free port when 3080 is occupied:
|
|
63
|
-
|
|
64
|
-
```powershell
|
|
65
|
-
corepack pnpm dsh web --port 0
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
Open the top **Session Map** switch after startup. Do not run two `dsh web` processes that share the same profile.
|
|
69
|
-
|
|
70
|
-
## Usage
|
|
71
|
-
|
|
72
|
-
1. Select a working directory in DSH or open an existing session.
|
|
73
|
-
2. Send at least one message so the session enters workspace history.
|
|
74
|
-
3. Open **Session Map** from the top switch.
|
|
75
|
-
4. Click a card or sidebar session to synchronize the current session between the map and native chat.
|
|
76
|
-
5. Use **Branch** on a completed answer to preserve an alternative path.
|
|
77
|
-
6. Open **Details** from a card to inspect the complete conversation.
|
|
78
|
-
7. Use **Open in DSH** or the top **Dialogue** switch to return to native chat.
|
|
79
|
-
|
|
80
|
-
The canvas supports:
|
|
81
|
-
|
|
82
|
-
- Panning and zooming up to 4×.
|
|
83
|
-
- Dragging cards with persisted positions.
|
|
84
|
-
- Expanding or collapsing descendant conversation subtrees.
|
|
85
|
-
- One-click focus on the current session.
|
|
86
|
-
- Smooth card scrolling and Markdown table rendering.
|
|
87
|
-
- Folding tool calls and results into the related assistant answer by `callId`.
|
|
88
|
-
|
|
89
|
-
## Configuration
|
|
90
|
-
|
|
91
|
-
The plugin is inserted through the profile's `cordis.patch.yml`. Override it in your own patch by targeting the row id `synapse`.
|
|
92
|
-
|
|
93
|
-
> A DSH patch replaces the row's complete `config`, so restate every value that must remain active.
|
|
94
|
-
|
|
95
|
-
| Key | Default | Description |
|
|
96
|
-
|---|---|---|
|
|
97
|
-
| `dataFile` | `$DSH_HOME/synapse/workspaces.json` | Canvas metadata persistence file |
|
|
98
|
-
| `autoProjection` | `true` | Automatically project committed DSH session events into cards |
|
|
99
|
-
| `projectionWorkspaceTitle` | `DSH 任务` | Title of the automatically projected workspace |
|
|
100
|
-
| `trustedHosts` | `[]` | Extra host or `host:port` values accepted by the `/synapse` Host check; `localhost` and `127.0.0.1` are always accepted |
|
|
101
|
-
|
|
102
|
-
Example:
|
|
103
|
-
|
|
104
|
-
```yaml
|
|
105
|
-
- id: synapse
|
|
106
|
-
config:
|
|
107
|
-
dataFile: !!js dshHomePath('synapse/my-workspaces.json')
|
|
108
|
-
autoProjection: true
|
|
109
|
-
projectionWorkspaceTitle: My tasks
|
|
110
|
-
trustedHosts: []
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
Add the actual host to `trustedHosts` when exposing DSH on a LAN.
|
|
114
|
-
|
|
115
|
-
## Uninstall and data cleanup
|
|
116
|
-
|
|
117
|
-
Remove the plugin:
|
|
118
|
-
|
|
119
|
-
```powershell
|
|
120
|
-
corepack pnpm dsh plugin --profile web remove dsh-synapse
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
`remove` deletes the dependency and profile activation layer but keeps canvas data. Reinstalling reuses and migrates the old data when necessary.
|
|
124
|
-
|
|
125
|
-
For a complete cleanup, manually remove:
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
$DSH_HOME/synapse/
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
A leftover `allowBuilds` key in `pnpm-workspace.yaml` is harmless and may also be removed.
|
|
132
|
-
|
|
133
|
-
## Data and runtime boundaries
|
|
134
|
-
|
|
135
|
-
- DSH session logs own the actual conversation content.
|
|
136
|
-
- Synapse `workspaces.json` stores only canvas metadata, layout, and branch anchors.
|
|
137
|
-
- Deleting `workspaces.json` loses canvas layout, never DSH sessions.
|
|
138
|
-
- Projected message text is capped at 8000 characters; longer card text ends with “—…(详情查看全文)”, while the full content remains available in conversation details.
|
|
139
|
-
- The plugin starts no second Web server and creates no second agent system.
|
|
140
|
-
|
|
141
|
-
See [Architecture and runtime boundaries](../architecture.md) for details.
|
|
142
|
-
|
|
143
|
-
## Model Experience
|
|
144
|
-
|
|
145
|
-
None, as dsh-synapse only reads committed session events and renders them; it adds no system-prompt prose, tool schemas, or request-context content to any model request.
|
|
146
|
-
|
|
147
|
-
### KV Cache effect
|
|
148
|
-
|
|
149
|
-
Does not invalidate. The plugin never changes request headers, system prompts, or tool registries, so an already-reusable KV prefix stays reusable; canvas projection consumes session logs only after they are committed.
|
|
150
|
-
|
|
151
|
-
## Known limitations
|
|
152
|
-
|
|
153
|
-
- Only the `web` profile is supported.
|
|
154
|
-
- Two DSH Web instances sharing one profile write the same `workspaces.json`. A cross-process write lock and external-modification warnings exist, but last-writer-wins replacement remains possible; run one instance.
|
|
155
|
-
- During v3 migration, legacy tool cards pair each call with the next result by order. Live events pair by `callId`.
|
|
156
|
-
|
|
157
|
-
## Development and releases
|
|
158
|
-
|
|
159
|
-
Contributor commands, GitHub Actions, and npm publishing are documented in the [Development and release guide](../development.md).
|
|
160
|
-
|
|
161
|
-
Return to the [project overview](../../README.md).
|
|
1
|
+
# dsh-synapse English Guide
|
|
2
|
+
|
|
3
|
+
`dsh-synapse` is a Web plugin for DeepSeek Harness (DSH). It adds a session map to the native conversation interface and organizes sessions, follow-ups, and forks from the same workspace as a browsable, draggable, and zoomable canvas.
|
|
4
|
+
|
|
5
|
+
The plugin does not replace DSH models, tools, sessions, permissions, or the Web server. DSH remains responsible for every conversation operation.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
- DeepSeek Harness `>= 0.1.7-rc.2`; this revision targets that release's Host session and Client service interfaces.
|
|
10
|
+
- Node.js `>= 22.19.0`.
|
|
11
|
+
- The `web` profile; other profiles are not currently supported.
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
### Install from npm
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
corepack pnpm dsh plugin --profile web add dsh-synapse
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
The npm package ships prebuilt code, so no build-script permission is needed — the simplest install. GitHub and local-checkout routes below are alternatives.
|
|
22
|
+
|
|
23
|
+
### Install from GitHub
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
GitHub installs run the package `prepare` script, which validates JavaScript syntax with `node --check`.
|
|
30
|
+
|
|
31
|
+
### pnpm 10+ allowBuilds
|
|
32
|
+
|
|
33
|
+
pnpm 10 and later may block build scripts for Git dependencies by default. If installation is blocked, copy the **complete key printed by pnpm** into the DSH Web profile's `pnpm-workspace.yaml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
allowBuilds:
|
|
37
|
+
"dsh-synapse@https://codeload.github.com/liangmianya/dsh-synapse/tar.gz/<commit>": true
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Use the complete key containing the tarball URL and commit, not the bare package name `dsh-synapse`. The key changes when the upstream commit changes, so use the newly printed value when upgrading.
|
|
41
|
+
|
|
42
|
+
### Install a local checkout
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
The `link:` form references the local checkout directly and is recommended for development. In a normal run, restart `dsh web` and refresh the page after editing the plugin.
|
|
49
|
+
|
|
50
|
+
## Start DSH Web
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
corepack pnpm dsh web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Default address:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
http://127.0.0.1:3080/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Let DSH choose a free port when 3080 is occupied:
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
corepack pnpm dsh web --port 0
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Open the top **Session Map** switch after startup. Do not run two `dsh web` processes that share the same profile.
|
|
69
|
+
|
|
70
|
+
## Usage
|
|
71
|
+
|
|
72
|
+
1. Select a working directory in DSH or open an existing session.
|
|
73
|
+
2. Send at least one message so the session enters workspace history.
|
|
74
|
+
3. Open **Session Map** from the top switch.
|
|
75
|
+
4. Click a card or sidebar session to synchronize the current session between the map and native chat.
|
|
76
|
+
5. Use **Branch** on a completed answer to preserve an alternative path.
|
|
77
|
+
6. Open **Details** from a card to inspect the complete conversation.
|
|
78
|
+
7. Use **Open in DSH** or the top **Dialogue** switch to return to native chat.
|
|
79
|
+
|
|
80
|
+
The canvas supports:
|
|
81
|
+
|
|
82
|
+
- Panning and zooming up to 4×.
|
|
83
|
+
- Dragging cards with persisted positions.
|
|
84
|
+
- Expanding or collapsing descendant conversation subtrees.
|
|
85
|
+
- One-click focus on the current session.
|
|
86
|
+
- Smooth card scrolling and Markdown table rendering.
|
|
87
|
+
- Folding tool calls and results into the related assistant answer by `callId`.
|
|
88
|
+
|
|
89
|
+
## Configuration
|
|
90
|
+
|
|
91
|
+
The plugin is inserted through the profile's `cordis.patch.yml`. Override it in your own patch by targeting the row id `synapse`.
|
|
92
|
+
|
|
93
|
+
> A DSH patch replaces the row's complete `config`, so restate every value that must remain active.
|
|
94
|
+
|
|
95
|
+
| Key | Default | Description |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `dataFile` | `$DSH_HOME/synapse/workspaces.json` | Canvas metadata persistence file |
|
|
98
|
+
| `autoProjection` | `true` | Automatically project committed DSH session events into cards |
|
|
99
|
+
| `projectionWorkspaceTitle` | `DSH 任务` | Title of the automatically projected workspace |
|
|
100
|
+
| `trustedHosts` | `[]` | Extra host or `host:port` values accepted by the `/synapse` Host check; `localhost` and `127.0.0.1` are always accepted |
|
|
101
|
+
|
|
102
|
+
Example:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
- id: synapse
|
|
106
|
+
config:
|
|
107
|
+
dataFile: !!js dshHomePath('synapse/my-workspaces.json')
|
|
108
|
+
autoProjection: true
|
|
109
|
+
projectionWorkspaceTitle: My tasks
|
|
110
|
+
trustedHosts: []
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Add the actual host to `trustedHosts` when exposing DSH on a LAN.
|
|
114
|
+
|
|
115
|
+
## Uninstall and data cleanup
|
|
116
|
+
|
|
117
|
+
Remove the plugin:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
corepack pnpm dsh plugin --profile web remove dsh-synapse
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`remove` deletes the dependency and profile activation layer but keeps canvas data. Reinstalling reuses and migrates the old data when necessary.
|
|
124
|
+
|
|
125
|
+
For a complete cleanup, manually remove:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
$DSH_HOME/synapse/
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
A leftover `allowBuilds` key in `pnpm-workspace.yaml` is harmless and may also be removed.
|
|
132
|
+
|
|
133
|
+
## Data and runtime boundaries
|
|
134
|
+
|
|
135
|
+
- DSH session logs own the actual conversation content.
|
|
136
|
+
- Synapse `workspaces.json` stores only canvas metadata, layout, and branch anchors.
|
|
137
|
+
- Deleting `workspaces.json` loses canvas layout, never DSH sessions.
|
|
138
|
+
- Projected message text is capped at 8000 characters; longer card text ends with “—…(详情查看全文)”, while the full content remains available in conversation details.
|
|
139
|
+
- The plugin starts no second Web server and creates no second agent system.
|
|
140
|
+
|
|
141
|
+
See [Architecture and runtime boundaries](../architecture.md) for details.
|
|
142
|
+
|
|
143
|
+
## Model Experience
|
|
144
|
+
|
|
145
|
+
None, as dsh-synapse only reads committed session events and renders them; it adds no system-prompt prose, tool schemas, or request-context content to any model request.
|
|
146
|
+
|
|
147
|
+
### KV Cache effect
|
|
148
|
+
|
|
149
|
+
Does not invalidate. The plugin never changes request headers, system prompts, or tool registries, so an already-reusable KV prefix stays reusable; canvas projection consumes session logs only after they are committed.
|
|
150
|
+
|
|
151
|
+
## Known limitations
|
|
152
|
+
|
|
153
|
+
- Only the `web` profile is supported.
|
|
154
|
+
- Two DSH Web instances sharing one profile write the same `workspaces.json`. A cross-process write lock and external-modification warnings exist, but last-writer-wins replacement remains possible; run one instance.
|
|
155
|
+
- During v3 migration, legacy tool cards pair each call with the next result by order. Live events pair by `callId`.
|
|
156
|
+
|
|
157
|
+
## Development and releases
|
|
158
|
+
|
|
159
|
+
Contributor commands, GitHub Actions, and npm publishing are documented in the [Development and release guide](../development.md).
|
|
160
|
+
|
|
161
|
+
Return to the [project overview](../../README.md).
|
|
Binary file
|
|
Binary file
|
package/docs/zh-CN/README.md
CHANGED
|
@@ -1,154 +1,154 @@
|
|
|
1
|
-
# dsh-synapse 中文指南
|
|
2
|
-
|
|
3
|
-
`dsh-synapse` 是 DeepSeek Harness(DSH)的 Web 插件。它在 DSH 原生对话界面上增加会话地图,把同一工作区中的会话、追问和分支组织成可浏览、可拖拽和可缩放的画布。
|
|
4
|
-
|
|
5
|
-
插件不替代 DSH 的模型、工具、会话、权限或 Web 服务;所有对话操作仍由 DSH 完成。
|
|
6
|
-
|
|
7
|
-
## 前提条件
|
|
8
|
-
|
|
9
|
-
-
|
|
10
|
-
- Node.js `>= 22.19.0`。
|
|
11
|
-
- 使用 `web` profile;其他 profile 暂不支持。
|
|
12
|
-
|
|
13
|
-
## 安装
|
|
14
|
-
|
|
15
|
-
### 从 npm 安装
|
|
16
|
-
|
|
17
|
-
```powershell
|
|
18
|
-
corepack pnpm dsh plugin --profile web add dsh-synapse
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
npm 包分发的是预构建产物,无需任何构建授权——最简单的安装方式。下方 GitHub 与本地 checkout 为备选。
|
|
22
|
-
|
|
23
|
-
### 从 GitHub 安装
|
|
24
|
-
|
|
25
|
-
```powershell
|
|
26
|
-
corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
|
|
27
|
-
```
|
|
28
|
-
|
|
29
|
-
GitHub 安装会运行本包的 `prepare` 脚本,通过 `node --check` 验证 JavaScript 语法。
|
|
30
|
-
|
|
31
|
-
### pnpm 10+ 的 allowBuilds
|
|
32
|
-
|
|
33
|
-
pnpm 10 及之后版本默认可能阻止 Git 依赖执行构建脚本。如果安装被拦截,请将 pnpm 输出的**完整键**复制到 DSH Web profile 的 `pnpm-workspace.yaml`:
|
|
34
|
-
|
|
35
|
-
```yaml
|
|
36
|
-
allowBuilds:
|
|
37
|
-
"dsh-synapse@https://codeload.github.com/liangmianya/dsh-synapse/tar.gz/<commit>": true
|
|
38
|
-
```
|
|
39
|
-
|
|
40
|
-
必须使用包含 tarball URL 和 commit 的完整键,不能只填写裸包名 `dsh-synapse`。上游 commit 变化后,键也会变化;届时使用 pnpm 新输出的值。
|
|
41
|
-
|
|
42
|
-
### 本地开发安装
|
|
43
|
-
|
|
44
|
-
```powershell
|
|
45
|
-
corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
`link:` 会直接引用本地 checkout,适合开发和调试。普通运行模式下修改代码后,建议重启 `dsh web` 并刷新页面。
|
|
49
|
-
|
|
50
|
-
## 启动
|
|
51
|
-
|
|
52
|
-
```powershell
|
|
53
|
-
corepack pnpm dsh web
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
默认地址:
|
|
57
|
-
|
|
58
|
-
```text
|
|
59
|
-
http://127.0.0.1:3080/
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
如果 3080 被占用,可以让 DSH 自动选择端口:
|
|
63
|
-
|
|
64
|
-
```powershell
|
|
65
|
-
corepack pnpm dsh web --port 0
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
启动后点击顶部“会话地图”进入 Synapse。不要同时运行两个共享同一 profile 的 `dsh web` 实例。
|
|
69
|
-
|
|
70
|
-
## 使用方式
|
|
71
|
-
|
|
72
|
-
1. 在 DSH 中选择工作目录,或打开已有会话。
|
|
73
|
-
2. 发送至少一条消息,使会话进入工作区历史。
|
|
74
|
-
3. 点击顶部“会话地图”。
|
|
75
|
-
4. 点击卡片或侧边栏会话,在地图与原生对话之间同步当前会话。
|
|
76
|
-
5. 使用“分支”从已完成的回答创建替代路径。
|
|
77
|
-
6. 点击卡片底部“详情”查看完整会话记录。
|
|
78
|
-
7. 使用“打开 DSH”或顶部“对话”返回原生对话界面。
|
|
79
|
-
|
|
80
|
-
画布支持:
|
|
81
|
-
|
|
82
|
-
- 拖动画布和缩放视图(最高 4×)。
|
|
83
|
-
- 拖动卡片并自动保存位置。
|
|
84
|
-
- 展开或折叠后续对话子树。
|
|
85
|
-
- 一键定位当前会话。
|
|
86
|
-
- 卡片内部平滑滚动和 Markdown 表格渲染。
|
|
87
|
-
- 将工具调用和结果按 `callId` 折叠到对应助手回答中。
|
|
88
|
-
|
|
89
|
-
## 配置
|
|
90
|
-
|
|
91
|
-
插件通过 profile 的 `cordis.patch.yml` 注入。可以在自己的 patch 中通过行 id `synapse` 覆盖配置。
|
|
92
|
-
|
|
93
|
-
> DSH patch 会整体替换该行的 `config`,覆盖时需要重述所有需要保留的键。
|
|
94
|
-
|
|
95
|
-
| 键 | 默认值 | 说明 |
|
|
96
|
-
|---|---|---|
|
|
97
|
-
| `dataFile` | `$DSH_HOME/synapse/workspaces.json` | 画布元数据持久化文件 |
|
|
98
|
-
| `autoProjection` | `true` | 自动将已提交的 DSH 会话事件投影为卡片 |
|
|
99
|
-
| `projectionWorkspaceTitle` | `DSH 任务` | 自动投影工作区的标题 |
|
|
100
|
-
| `trustedHosts` | `[]` | `/synapse` Host 检查额外允许的主机名或 `主机:端口`;`localhost` 和 `127.0.0.1` 始终允许 |
|
|
101
|
-
|
|
102
|
-
配置示例:
|
|
103
|
-
|
|
104
|
-
```yaml
|
|
105
|
-
- id: synapse
|
|
106
|
-
config:
|
|
107
|
-
dataFile: !!js dshHomePath('synapse/my-workspaces.json')
|
|
108
|
-
autoProjection: true
|
|
109
|
-
projectionWorkspaceTitle: 我的任务
|
|
110
|
-
trustedHosts: []
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
局域网访问时,需要将实际访问主机加入 `trustedHosts`。
|
|
114
|
-
|
|
115
|
-
## 卸载与数据清理
|
|
116
|
-
|
|
117
|
-
卸载插件:
|
|
118
|
-
|
|
119
|
-
```powershell
|
|
120
|
-
corepack pnpm dsh plugin --profile web remove dsh-synapse
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
`remove` 只移除插件依赖和 profile 激活层,不会删除画布数据。重新安装后,旧数据会继续使用并按需迁移。
|
|
124
|
-
|
|
125
|
-
彻底清理时,手动删除:
|
|
126
|
-
|
|
127
|
-
```text
|
|
128
|
-
$DSH_HOME/synapse/
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
`pnpm-workspace.yaml` 中遗留的 `allowBuilds` 键没有副作用,也可以一并移除。
|
|
132
|
-
|
|
133
|
-
## 数据与运行边界
|
|
134
|
-
|
|
135
|
-
- DSH session log 保存真实对话内容。
|
|
136
|
-
- Synapse 的 `workspaces.json` 只保存画布元数据、布局和分支锚点。
|
|
137
|
-
- 删除 `workspaces.json` 会丢失画布布局,但不会删除 DSH 会话。
|
|
138
|
-
- 单条消息投影上限为 8000 字符;超出部分在卡片中截断并标注“—…(详情查看全文)”,完整内容仍可在会话详情中查看。
|
|
139
|
-
- 插件不启动第二个 Web 服务,也不创建第二套 Agent。
|
|
140
|
-
- 插件只读取已经提交的会话事件,不修改模型请求、系统提示、工具 schema 或 KV cache 前缀。
|
|
141
|
-
|
|
142
|
-
更详细的内部说明见[架构与运行边界](../architecture.md)。
|
|
143
|
-
|
|
144
|
-
## 已知限制
|
|
145
|
-
|
|
146
|
-
- 仅支持 `web` profile。
|
|
147
|
-
- 两个 DSH Web 实例共享同一个 profile 时会写入同一个 `workspaces.json`。虽然存在跨进程写锁和外部修改警告,仍可能出现最后写入覆盖,请只运行一个实例。
|
|
148
|
-
- v3 数据迁移时,旧工具卡片按顺序将每次调用与下一条结果配对;实时事件使用 `callId`。
|
|
149
|
-
|
|
150
|
-
## 开发与发布
|
|
151
|
-
|
|
152
|
-
贡献者命令、GitHub Actions 和 npm 发布流程见[开发与发布指南](../development.md)。
|
|
153
|
-
|
|
154
|
-
返回[项目主页](../../README.md)。
|
|
1
|
+
# dsh-synapse 中文指南
|
|
2
|
+
|
|
3
|
+
`dsh-synapse` 是 DeepSeek Harness(DSH)的 Web 插件。它在 DSH 原生对话界面上增加会话地图,把同一工作区中的会话、追问和分支组织成可浏览、可拖拽和可缩放的画布。
|
|
4
|
+
|
|
5
|
+
插件不替代 DSH 的模型、工具、会话、权限或 Web 服务;所有对话操作仍由 DSH 完成。
|
|
6
|
+
|
|
7
|
+
## 前提条件
|
|
8
|
+
|
|
9
|
+
- DeepSeek Harness `>= 0.1.7-rc.2`(本插件依赖该版本的 Host 会话与 Client 服务接口)。
|
|
10
|
+
- Node.js `>= 22.19.0`。
|
|
11
|
+
- 使用 `web` profile;其他 profile 暂不支持。
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
### 从 npm 安装
|
|
16
|
+
|
|
17
|
+
```powershell
|
|
18
|
+
corepack pnpm dsh plugin --profile web add dsh-synapse
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
npm 包分发的是预构建产物,无需任何构建授权——最简单的安装方式。下方 GitHub 与本地 checkout 为备选。
|
|
22
|
+
|
|
23
|
+
### 从 GitHub 安装
|
|
24
|
+
|
|
25
|
+
```powershell
|
|
26
|
+
corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
GitHub 安装会运行本包的 `prepare` 脚本,通过 `node --check` 验证 JavaScript 语法。
|
|
30
|
+
|
|
31
|
+
### pnpm 10+ 的 allowBuilds
|
|
32
|
+
|
|
33
|
+
pnpm 10 及之后版本默认可能阻止 Git 依赖执行构建脚本。如果安装被拦截,请将 pnpm 输出的**完整键**复制到 DSH Web profile 的 `pnpm-workspace.yaml`:
|
|
34
|
+
|
|
35
|
+
```yaml
|
|
36
|
+
allowBuilds:
|
|
37
|
+
"dsh-synapse@https://codeload.github.com/liangmianya/dsh-synapse/tar.gz/<commit>": true
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
必须使用包含 tarball URL 和 commit 的完整键,不能只填写裸包名 `dsh-synapse`。上游 commit 变化后,键也会变化;届时使用 pnpm 新输出的值。
|
|
41
|
+
|
|
42
|
+
### 本地开发安装
|
|
43
|
+
|
|
44
|
+
```powershell
|
|
45
|
+
corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
`link:` 会直接引用本地 checkout,适合开发和调试。普通运行模式下修改代码后,建议重启 `dsh web` 并刷新页面。
|
|
49
|
+
|
|
50
|
+
## 启动
|
|
51
|
+
|
|
52
|
+
```powershell
|
|
53
|
+
corepack pnpm dsh web
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
默认地址:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
http://127.0.0.1:3080/
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
如果 3080 被占用,可以让 DSH 自动选择端口:
|
|
63
|
+
|
|
64
|
+
```powershell
|
|
65
|
+
corepack pnpm dsh web --port 0
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
启动后点击顶部“会话地图”进入 Synapse。不要同时运行两个共享同一 profile 的 `dsh web` 实例。
|
|
69
|
+
|
|
70
|
+
## 使用方式
|
|
71
|
+
|
|
72
|
+
1. 在 DSH 中选择工作目录,或打开已有会话。
|
|
73
|
+
2. 发送至少一条消息,使会话进入工作区历史。
|
|
74
|
+
3. 点击顶部“会话地图”。
|
|
75
|
+
4. 点击卡片或侧边栏会话,在地图与原生对话之间同步当前会话。
|
|
76
|
+
5. 使用“分支”从已完成的回答创建替代路径。
|
|
77
|
+
6. 点击卡片底部“详情”查看完整会话记录。
|
|
78
|
+
7. 使用“打开 DSH”或顶部“对话”返回原生对话界面。
|
|
79
|
+
|
|
80
|
+
画布支持:
|
|
81
|
+
|
|
82
|
+
- 拖动画布和缩放视图(最高 4×)。
|
|
83
|
+
- 拖动卡片并自动保存位置。
|
|
84
|
+
- 展开或折叠后续对话子树。
|
|
85
|
+
- 一键定位当前会话。
|
|
86
|
+
- 卡片内部平滑滚动和 Markdown 表格渲染。
|
|
87
|
+
- 将工具调用和结果按 `callId` 折叠到对应助手回答中。
|
|
88
|
+
|
|
89
|
+
## 配置
|
|
90
|
+
|
|
91
|
+
插件通过 profile 的 `cordis.patch.yml` 注入。可以在自己的 patch 中通过行 id `synapse` 覆盖配置。
|
|
92
|
+
|
|
93
|
+
> DSH patch 会整体替换该行的 `config`,覆盖时需要重述所有需要保留的键。
|
|
94
|
+
|
|
95
|
+
| 键 | 默认值 | 说明 |
|
|
96
|
+
|---|---|---|
|
|
97
|
+
| `dataFile` | `$DSH_HOME/synapse/workspaces.json` | 画布元数据持久化文件 |
|
|
98
|
+
| `autoProjection` | `true` | 自动将已提交的 DSH 会话事件投影为卡片 |
|
|
99
|
+
| `projectionWorkspaceTitle` | `DSH 任务` | 自动投影工作区的标题 |
|
|
100
|
+
| `trustedHosts` | `[]` | `/synapse` Host 检查额外允许的主机名或 `主机:端口`;`localhost` 和 `127.0.0.1` 始终允许 |
|
|
101
|
+
|
|
102
|
+
配置示例:
|
|
103
|
+
|
|
104
|
+
```yaml
|
|
105
|
+
- id: synapse
|
|
106
|
+
config:
|
|
107
|
+
dataFile: !!js dshHomePath('synapse/my-workspaces.json')
|
|
108
|
+
autoProjection: true
|
|
109
|
+
projectionWorkspaceTitle: 我的任务
|
|
110
|
+
trustedHosts: []
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
局域网访问时,需要将实际访问主机加入 `trustedHosts`。
|
|
114
|
+
|
|
115
|
+
## 卸载与数据清理
|
|
116
|
+
|
|
117
|
+
卸载插件:
|
|
118
|
+
|
|
119
|
+
```powershell
|
|
120
|
+
corepack pnpm dsh plugin --profile web remove dsh-synapse
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
`remove` 只移除插件依赖和 profile 激活层,不会删除画布数据。重新安装后,旧数据会继续使用并按需迁移。
|
|
124
|
+
|
|
125
|
+
彻底清理时,手动删除:
|
|
126
|
+
|
|
127
|
+
```text
|
|
128
|
+
$DSH_HOME/synapse/
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`pnpm-workspace.yaml` 中遗留的 `allowBuilds` 键没有副作用,也可以一并移除。
|
|
132
|
+
|
|
133
|
+
## 数据与运行边界
|
|
134
|
+
|
|
135
|
+
- DSH session log 保存真实对话内容。
|
|
136
|
+
- Synapse 的 `workspaces.json` 只保存画布元数据、布局和分支锚点。
|
|
137
|
+
- 删除 `workspaces.json` 会丢失画布布局,但不会删除 DSH 会话。
|
|
138
|
+
- 单条消息投影上限为 8000 字符;超出部分在卡片中截断并标注“—…(详情查看全文)”,完整内容仍可在会话详情中查看。
|
|
139
|
+
- 插件不启动第二个 Web 服务,也不创建第二套 Agent。
|
|
140
|
+
- 插件只读取已经提交的会话事件,不修改模型请求、系统提示、工具 schema 或 KV cache 前缀。
|
|
141
|
+
|
|
142
|
+
更详细的内部说明见[架构与运行边界](../architecture.md)。
|
|
143
|
+
|
|
144
|
+
## 已知限制
|
|
145
|
+
|
|
146
|
+
- 仅支持 `web` profile。
|
|
147
|
+
- 两个 DSH Web 实例共享同一个 profile 时会写入同一个 `workspaces.json`。虽然存在跨进程写锁和外部修改警告,仍可能出现最后写入覆盖,请只运行一个实例。
|
|
148
|
+
- v3 数据迁移时,旧工具卡片按顺序将每次调用与下一条结果配对;实时事件使用 `callId`。
|
|
149
|
+
|
|
150
|
+
## 开发与发布
|
|
151
|
+
|
|
152
|
+
贡献者命令、GitHub Actions 和 npm 发布流程见[开发与发布指南](../development.md)。
|
|
153
|
+
|
|
154
|
+
返回[项目主页](../../README.md)。
|