dsh-synapse 0.5.5 → 0.5.7

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/README.md CHANGED
@@ -30,18 +30,26 @@
30
30
 
31
31
  | 你平时怎么用 DSH | 要装的 profile | 安装命令 |
32
32
  |---|---|---|
33
- | 桌面 App(DeepSeek Harness 客户端) | `desktop` | `corepack pnpm dsh plugin --profile desktop add dsh-synapse` |
34
- | 命令行 `dsh web` / 浏览器访问 | `web` | `corepack pnpm dsh plugin --profile web add dsh-synapse` |
35
- | 两种都用 | 两套各装一次 | 两条命令都执行 |
33
+ | 桌面 App(DeepSeek Harness 客户端) | `desktop` | `dsh plugin --profile desktop add dsh-synapse` |
34
+ | 命令行 `dsh web` / 浏览器访问(如果你也维护了这套) | `web` | `dsh plugin --profile web add dsh-synapse` |
36
35
 
37
36
  - 从 App 内的插件页面安装时,App 会自动装进它自己用的那套,不用管 profile。
38
- - **自检口诀:装完顶部看不到「会话地图」开关,就是装到另一套去了**,换成另一条命令再装一次即可。
37
+ - **自检口诀:装完顶部看不到「会话地图」开关,就是装到另一套去了**,把 `--profile` 换成另一套的名字再装一次即可。
39
38
  - 桌面 App 装完需要**重启 App**(Host 侧插件在启动时加载);命令行装的,重启 `dsh web` 并刷新页面。
40
39
 
40
+ `dsh` 是 DSH 运行时自带的 launcher,位于 App 安装目录的 `resources\runtime\cli\bin\dsh.cmd`。先确认它能调用:
41
+
41
42
  ```powershell
42
- # 命令行方式:装好后启动
43
- corepack pnpm dsh plugin --profile web add dsh-synapse
44
- corepack pnpm dsh web
43
+ dsh --version
44
+ ```
45
+
46
+ ```powershell
47
+ # 装进桌面 App 那套 profile
48
+ dsh plugin --profile desktop add dsh-synapse
49
+
50
+ # 需要命令行形态时(装完重启 dsh web 并刷新页面)
51
+ dsh plugin --profile web add dsh-synapse
52
+ dsh web
45
53
  ```
46
54
 
47
55
  启动后,在 DSH 顶部切换到 **会话地图**。Synapse 复用现有的 DSH Web Server,不会启动第二个应用或代理系统。
@@ -54,11 +62,28 @@ corepack pnpm dsh web
54
62
  | 保留真实分支 | 按 DSH 原生 fork 关系连接卡片,不制造另一套会话历史。 |
55
63
  | 追问更顺手 | 选中回答中的文字可直接带入新的追问;常用补充词可编辑。 |
56
64
  | 双向同步 | 在地图或 DSH 原生对话中切换会话,当前上下文保持一致。 |
65
+ | 过程不挡路 | 工具调用与结果按 `callId` 折叠进对应回答,只显示「工具 N」。 |
66
+ | 可移动入口 | 顶部「对话 / 会话地图」开关可拖动、记忆位置、双击复位。 |
67
+ | 详情侧栏 | 点卡片在右侧展开整轮详情:完整回答、工具过程、追问 / 分支 / 打开 DSH。 |
68
+ | 归档一致 | 归档在地图与 DSH 侧栏之间共用同一份集合,不会各记一套。 |
69
+
70
+ ## 最近更新
71
+
72
+ **0.5.6**
73
+
74
+ - 顶部开关可拖动、记忆位置(按浏览器)、双击复位、方向键微调,并保证不会被拖到屏幕外。
75
+ - 交互与渲染一致性修正:切会话会把该会话带入视野;折叠卡片不再移动画布;正文里有选区时侧栏与详情仍能更新;卡片右侧折叠 / 分支按钮不再被相邻卡片遮住。
76
+ - 工作区加载竞态修正:切换工作区不再被后台轮询顶掉;画布只在数据真变化时重建(此前每秒重建数次)。
77
+ - `workspaces.json` 读不出来时改为**明确报错并保持只读**,不再用旧备份覆盖原文件。
78
+
79
+ 历史版本见[提交记录](https://github.com/liangmianya/dsh-synapse/commits/main)。
57
80
 
58
81
  ## 从原生对话进入
59
82
 
60
83
  在 DSH 原生对话中,通过顶部的 **会话地图** 进入 Synapse;返回 **对话** 后,仍是同一个 DSH 会话。
61
84
 
85
+ 这个开关挡着内容时可以挪走:**按住左侧六点手柄拖动**,位置按浏览器记住;**双击手柄**复位;手柄聚焦后可用方向键微调。
86
+
62
87
  ![DSH 原生对话与会话地图入口](docs/images/native-webui.jpg)
63
88
 
64
89
  ## 文档
package/client.js CHANGED
@@ -39,6 +39,42 @@ window.__ModuleLoader__.load({
39
39
  return Array.isArray(snapshot.archivedSessionIds) ? snapshot.archivedSessionIds.map(String) : []
40
40
  }
41
41
 
42
+ // The pill can be dragged anywhere it stays reachable; the position survives
43
+ // reloads. Kept next to the module so the drag arithmetic is testable without
44
+ // a DOM (see test/switch-drag.test.js).
45
+ const SWITCH_POSITION_KEY = 'dsh-synapse:switch-position:v1'
46
+ const SWITCH_MARGIN = 8
47
+ const SWITCH_STEP = 8
48
+
49
+ /** Keep the pill fully inside the viewport, with a margin to grab it again. */
50
+ function clampSwitchPosition(position, viewport, size) {
51
+ const maxLeft = Math.max(SWITCH_MARGIN, viewport.width - size.width - SWITCH_MARGIN)
52
+ const maxTop = Math.max(SWITCH_MARGIN, viewport.height - size.height - SWITCH_MARGIN)
53
+ return {
54
+ left: Math.min(Math.max(SWITCH_MARGIN, Math.round(position.left)), maxLeft),
55
+ top: Math.min(Math.max(SWITCH_MARGIN, Math.round(position.top)), maxTop),
56
+ }
57
+ }
58
+
59
+ function readSwitchPosition(storage) {
60
+ try {
61
+ const value = JSON.parse(storage.getItem(SWITCH_POSITION_KEY) ?? 'null')
62
+ if (value === null || typeof value !== 'object') return null
63
+ if (!Number.isFinite(value.left) || !Number.isFinite(value.top)) return null
64
+ return { left: Math.round(value.left), top: Math.round(value.top) }
65
+ } catch {
66
+ return null
67
+ }
68
+ }
69
+
70
+ function writeSwitchPosition(storage, position) {
71
+ try { storage.setItem(SWITCH_POSITION_KEY, JSON.stringify(position)) } catch { /* private mode */ }
72
+ }
73
+
74
+ function clearSwitchPosition(storage) {
75
+ try { storage.removeItem(SWITCH_POSITION_KEY) } catch { /* private mode */ }
76
+ }
77
+
42
78
  module.exports.inject = ['sessions', 'workspaces', 'uiWorkspace', 'uiConversation']
43
79
  module.exports.apply = ctx => {
44
80
  const prompt = async (sessionId, text) => {
@@ -77,11 +113,11 @@ window.__ModuleLoader__.load({
77
113
  // rightward (title, lineage and agent-preset chips). Half the sidebar
78
114
  // width puts the pill over the centre of the content area instead of
79
115
  // the window; `min()` pulls it back in on narrow windows.
80
- style.textContent = '.dsh-synapse-switch{position:fixed;z-index:200;top:calc(var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,0px)) + 12px);left:min(calc(50% + 130px),calc(100% - 96px));display:flex;gap:2px;transform:translateX(-50%);border:1px solid #d1d5db;border-radius:999px;background:rgba(255,255,255,.96);padding:3px;backdrop-filter:blur(10px);-webkit-app-region:no-drag;box-shadow:0 2px 8px rgba(17,24,39,.1)}.dsh-synapse-switch button{height:28px;border:0;border-radius:999px;background:transparent;padding:0 11px;color:#6b7280;font:600 12px Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap;-webkit-app-region:no-drag}.dsh-synapse-switch button:hover{background:#f3f4f6;color:#111827}.dsh-synapse-switch button.active{background:#111827;color:#fff}.dsh-synapse-switch button:focus-visible{outline:2px solid #111827;outline-offset:2px}.dsh-synapse-overlay{position:fixed;z-index:100;inset:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,0px)) 0 0 0;background:#f5f7fa}.dsh-synapse-overlay.is-opening{visibility:hidden}.dsh-synapse-overlay[hidden]{display:none}.dsh-synapse-overlay iframe{display:block;width:100%;height:100%;border:0}html[data-fullscreen] .dsh-synapse-overlay{top:0}html[data-fullscreen] .dsh-synapse-switch{top:12px}'
116
+ style.textContent = '.dsh-synapse-switch{position:fixed;z-index:200;top:calc(var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,0px)) + 12px);left:min(calc(50% + 130px),calc(100% - 96px));display:flex;gap:2px;transform:translateX(-50%);border:1px solid #d1d5db;border-radius:999px;background:rgba(255,255,255,.96);padding:3px;backdrop-filter:blur(10px);-webkit-app-region:no-drag;box-shadow:0 2px 8px rgba(17,24,39,.1)}.dsh-synapse-switch button{height:28px;border:0;border-radius:999px;background:transparent;padding:0 11px;color:#6b7280;font:600 12px Inter,system-ui,sans-serif;cursor:pointer;white-space:nowrap;-webkit-app-region:no-drag}.dsh-synapse-switch button:hover{background:#f3f4f6;color:#111827}.dsh-synapse-switch button.active{background:#111827;color:#fff}.dsh-synapse-switch button:focus-visible{outline:2px solid #111827;outline-offset:2px}.dsh-synapse-overlay{position:fixed;z-index:100;inset:var(--dsh-frame-chrome-top,var(--dsh-frame-top-clearance,0px)) 0 0 0;background:#f5f7fa}.dsh-synapse-overlay.is-opening{visibility:hidden}.dsh-synapse-overlay[hidden]{display:none}.dsh-synapse-overlay iframe{display:block;width:100%;height:100%;border:0}html[data-fullscreen] .dsh-synapse-overlay{top:0}html[data-fullscreen] .dsh-synapse-switch{top:12px}.dsh-synapse-grip{display:grid;width:16px;height:28px;place-items:center;border-radius:999px;color:#9ca3af;background:transparent;cursor:grab;touch-action:none;-webkit-app-region:no-drag}.dsh-synapse-grip:hover{background:#f3f4f6;color:#4b5563}.dsh-synapse-grip:focus-visible{outline:2px solid #111827;outline-offset:2px}.dsh-synapse-grip svg{width:8px;height:14px;fill:currentColor}.dsh-synapse-switch.is-dragging .dsh-synapse-grip{cursor:grabbing}'
81
117
  document.head.append(style)
82
118
  const host = document.createElement('div')
83
119
  host.className = 'dsh-synapse-host'
84
- host.innerHTML = '<div class="dsh-synapse-switch" role="group" aria-label="视图切换"><button type="button" data-view="dialog" class="active" aria-pressed="true">对话</button><button type="button" data-view="map" aria-pressed="false">会话地图</button></div><section class="dsh-synapse-overlay" hidden><iframe title="会话地图" src="/synapse/"></iframe></section>'
120
+ host.innerHTML = '<div class="dsh-synapse-switch" role="group" aria-label="视图切换"><span class="dsh-synapse-grip" role="button" tabindex="0" aria-label="拖动位置" title="拖动位置(双击复位,方向键微调)"><svg aria-hidden="true" viewBox="0 0 8 14"><circle cx="2" cy="2" r="1.3"/><circle cx="6" cy="2" r="1.3"/><circle cx="2" cy="7" r="1.3"/><circle cx="6" cy="7" r="1.3"/><circle cx="2" cy="12" r="1.3"/><circle cx="6" cy="12" r="1.3"/></svg></span><button type="button" data-view="dialog" class="active" aria-pressed="true">对话</button><button type="button" data-view="map" aria-pressed="false">会话地图</button></div><section class="dsh-synapse-overlay" hidden><iframe title="会话地图" src="/synapse/"></iframe></section>'
85
121
  document.body.append(host)
86
122
  const switchEl = host.querySelector('.dsh-synapse-switch')
87
123
  // Two live instances (a bundle loaded twice, or a sibling that outlived a
@@ -107,6 +143,77 @@ window.__ModuleLoader__.load({
107
143
  const mapButton = host.querySelector('[data-view="map"]')
108
144
  const overlay = host.querySelector('.dsh-synapse-overlay')
109
145
  const frame = host.querySelector('iframe')
146
+ const grip = host.querySelector('.dsh-synapse-grip')
147
+
148
+ // --- dragging the pill -------------------------------------------------
149
+ // A stored position switches the pill from its CSS seat (centred, under the
150
+ // window chrome) to explicit viewport coordinates; `transform` has to be
151
+ // dropped with it or the pill would stay half a width to the left.
152
+ const switchSize = () => ({ width: switchEl.offsetWidth, height: switchEl.offsetHeight })
153
+ const viewportSize = () => ({ width: window.innerWidth, height: window.innerHeight })
154
+ const applySwitchPosition = position => {
155
+ if (position === null) {
156
+ switchEl.style.removeProperty('left')
157
+ switchEl.style.removeProperty('top')
158
+ switchEl.style.removeProperty('transform')
159
+ return
160
+ }
161
+ switchEl.style.left = `${position.left}px`
162
+ switchEl.style.top = `${position.top}px`
163
+ switchEl.style.transform = 'none'
164
+ }
165
+ const storedSwitchPosition = readSwitchPosition(window.localStorage)
166
+ if (storedSwitchPosition !== null) {
167
+ applySwitchPosition(clampSwitchPosition(storedSwitchPosition, viewportSize(), switchSize()))
168
+ }
169
+ let switchDrag = null
170
+ const finishSwitchDrag = event => {
171
+ if (switchDrag === null) return
172
+ const drag = switchDrag
173
+ switchDrag = null
174
+ switchEl.classList.remove('is-dragging')
175
+ try { grip.releasePointerCapture(event.pointerId) } catch { /* already released */ }
176
+ if (drag.moved && drag.position !== null) writeSwitchPosition(window.localStorage, drag.position)
177
+ }
178
+ grip.addEventListener('pointerdown', event => {
179
+ if (event.button !== 0) return
180
+ event.preventDefault()
181
+ const rect = switchEl.getBoundingClientRect()
182
+ switchDrag = { x: event.clientX, y: event.clientY, left: rect.left, top: rect.top, moved: false, position: null }
183
+ switchEl.classList.add('is-dragging')
184
+ try { grip.setPointerCapture(event.pointerId) } catch { /* capture is best effort */ }
185
+ })
186
+ grip.addEventListener('pointermove', event => {
187
+ if (switchDrag === null) return
188
+ const dx = event.clientX - switchDrag.x
189
+ const dy = event.clientY - switchDrag.y
190
+ if (!switchDrag.moved && Math.hypot(dx, dy) < 3) return
191
+ switchDrag.moved = true
192
+ switchDrag.position = clampSwitchPosition({ left: switchDrag.left + dx, top: switchDrag.top + dy }, viewportSize(), switchSize())
193
+ applySwitchPosition(switchDrag.position)
194
+ })
195
+ grip.addEventListener('pointerup', finishSwitchDrag)
196
+ grip.addEventListener('pointercancel', finishSwitchDrag)
197
+ // Double-click resets the pill to its shipped seat.
198
+ grip.addEventListener('dblclick', () => {
199
+ clearSwitchPosition(window.localStorage)
200
+ applySwitchPosition(null)
201
+ })
202
+ // Keyboard path: arrows nudge, so the control is usable without a pointer.
203
+ grip.addEventListener('keydown', event => {
204
+ const step = { ArrowLeft: [-SWITCH_STEP, 0], ArrowRight: [SWITCH_STEP, 0], ArrowUp: [0, -SWITCH_STEP], ArrowDown: [0, SWITCH_STEP] }[event.key]
205
+ if (step === undefined) return
206
+ event.preventDefault()
207
+ const rect = switchEl.getBoundingClientRect()
208
+ const position = clampSwitchPosition({ left: rect.left + step[0], top: rect.top + step[1] }, viewportSize(), switchSize())
209
+ applySwitchPosition(position)
210
+ writeSwitchPosition(window.localStorage, position)
211
+ })
212
+ const keepSwitchInView = () => {
213
+ const stored = readSwitchPosition(window.localStorage)
214
+ if (stored !== null) applySwitchPosition(clampSwitchPosition(stored, viewportSize(), switchSize()))
215
+ }
216
+ window.addEventListener('resize', keepSwitchInView)
110
217
 
111
218
  const setView = view => {
112
219
  const showingMap = view === 'map'
@@ -385,6 +492,7 @@ window.__ModuleLoader__.load({
385
492
  frame.removeEventListener('load', onFrameLoad)
386
493
  window.removeEventListener('message', onMessage)
387
494
  window.removeEventListener('keydown', onKeyDown)
495
+ window.removeEventListener('resize', keepSwitchInView)
388
496
  themeObserver?.disconnect()
389
497
  unsubscribeSessions()
390
498
  unsubscribeWorkspaces()
package/docs/en/README.md CHANGED
@@ -17,23 +17,28 @@ DSH installs plugins per profile. Each profile keeps its own plugin list and `no
17
17
  | How you run DSH | Profile to use |
18
18
  |---|---|
19
19
  | Desktop app (DeepSeek Harness client) | `desktop` |
20
- | `dsh web` on the command line | `web` |
21
- | Both | Install once per profile |
20
+ | `dsh web` on the command line (if you keep that profile) | `web` |
22
21
 
23
22
  - Installing from the app's plugin page already targets the profile the app uses, so you do not pick one there.
24
- - **Quick self-check: if the "会话地图 / Session map" switch never appears, the plugin went into the other profile** — run the other command and install again.
23
+ - **Quick self-check: if the "会话地图 / Session map" switch never appears, the plugin went into the other profile** — install again with the other `--profile`.
25
24
  - A desktop install takes effect after **restarting the app**; a command-line install takes effect after restarting `dsh web` and refreshing the page.
26
25
 
27
26
  ## Installation
28
27
 
28
+ `dsh` is the launcher that ships with the DSH runtime, at `resources\runtime\cli\bin\dsh.cmd` inside the app directory. Check that it responds first:
29
+
30
+ ```powershell
31
+ dsh --version
32
+ ```
33
+
29
34
  ### Install from npm
30
35
 
31
36
  ```powershell
32
37
  # Desktop app
33
- corepack pnpm dsh plugin --profile desktop add dsh-synapse
38
+ dsh plugin --profile desktop add dsh-synapse
34
39
 
35
- # Command line (dsh web)
36
- corepack pnpm dsh plugin --profile web add dsh-synapse
40
+ # Command line (only if you keep a web profile)
41
+ dsh plugin --profile web add dsh-synapse
37
42
  ```
38
43
 
39
44
  The npm package ships prebuilt code, so no build-script permission is needed — the simplest install. GitHub and local-checkout routes below are alternatives.
@@ -41,7 +46,7 @@ The npm package ships prebuilt code, so no build-script permission is needed —
41
46
  ### Install from GitHub
42
47
 
43
48
  ```powershell
44
- corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
49
+ dsh plugin --profile desktop add github:liangmianya/dsh-synapse
45
50
  ```
46
51
 
47
52
  GitHub installs run the package `prepare` script, which validates JavaScript syntax with `node --check`.
@@ -60,7 +65,7 @@ Use the complete key containing the tarball URL and commit, not the bare package
60
65
  ### Install a local checkout
61
66
 
62
67
  ```powershell
63
- corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
68
+ dsh plugin --profile desktop add link:E:\path\to\dsh-synapse
64
69
  ```
65
70
 
66
71
  The `link:` form references the local checkout directly and is recommended for development. In a normal run, restart the host (the desktop app or `dsh web`) and refresh the page after editing the plugin.
@@ -68,7 +73,7 @@ The `link:` form references the local checkout directly and is recommended for d
68
73
  ## Start DSH Web
69
74
 
70
75
  ```powershell
71
- corepack pnpm dsh web
76
+ dsh web
72
77
  ```
73
78
 
74
79
  Default address:
@@ -80,7 +85,7 @@ http://127.0.0.1:3080/
80
85
  Let DSH choose a free port when 3080 is occupied:
81
86
 
82
87
  ```powershell
83
- corepack pnpm dsh web --port 0
88
+ dsh web --port 0
84
89
  ```
85
90
 
86
91
  Open the top **Session Map** switch after startup. Do not run two `dsh web` processes that share the same profile.
@@ -104,6 +109,22 @@ The canvas supports:
104
109
  - Smooth card scrolling and Markdown table rendering.
105
110
  - Folding tool calls and results into the related assistant answer by `callId`.
106
111
 
112
+ The **Dialogue / Session Map** switch can be moved too:
113
+
114
+ - Drag it by the six-dot grip on its left edge; the position is remembered per browser.
115
+ - Double-click the grip to return it to its shipped seat (centred under the window chrome).
116
+ - With the grip focused, the arrow keys nudge it by 8px.
117
+ - It always keeps an 8px grab margin from the viewport edges, so shrinking the window cannot strand it off screen.
118
+
119
+ ## Recent changes
120
+
121
+ **0.5.6**
122
+
123
+ - The top switch is draggable, remembers where you left it, and resets on a double-click (new).
124
+ - Interaction and rendering consistency: switching a conversation now brings it into view; folding a card no longer moves the canvas; a text selection in an answer no longer freezes the sidebar and the details panel; the fold/branch buttons on a card's right edge are no longer covered by the neighbouring card.
125
+ - Workspace switching no longer races the background poll, and the canvas is rebuilt only when data actually changes instead of several times a second.
126
+ - An unreadable `workspaces.json` now fails loudly and read-only instead of restoring an old backup over it (the 0.5.5 fallback was reverted).
127
+
107
128
  ## Configuration
108
129
 
109
130
  The plugin is inserted through the profile's `cordis.patch.yml`. Override it in your own patch by targeting the row id `synapse`.
@@ -135,7 +156,7 @@ Add the actual host to `trustedHosts` when exposing DSH on a LAN.
135
156
  Remove the plugin:
136
157
 
137
158
  ```powershell
138
- corepack pnpm dsh plugin --profile web remove dsh-synapse
159
+ dsh plugin --profile web remove dsh-synapse
139
160
  ```
140
161
 
141
162
  `remove` deletes the dependency and profile activation layer but keeps canvas data. Reinstalling reuses and migrates the old data when necessary.
@@ -17,23 +17,28 @@ DSH 按 profile 分套安装插件:每套 profile 有自己的插件清单和
17
17
  | 你平时怎么用 DSH | 要装的 profile |
18
18
  |---|---|
19
19
  | 桌面 App(DeepSeek Harness 客户端) | `desktop` |
20
- | 命令行 `dsh web` / 浏览器访问 | `web` |
21
- | 两种都用 | 两套各装一次 |
20
+ | 命令行 `dsh web` / 浏览器访问(如果你自己也维护了这套) | `web` |
22
21
 
23
22
  - 从 App 内的插件页面安装时,App 会自动装进它自己用的那套,无需关心 profile。
24
- - **自检口诀:装完顶部看不到「会话地图」开关,就是装到另一套去了**,换成另一条命令再装一次即可。
23
+ - **自检口诀:装完顶部看不到「会话地图」开关,就是装到另一套去了**,把 `--profile` 换成另一套的名字再装一次即可。
25
24
  - 桌面 App 装完需要**重启 App**;命令行装的,重启 `dsh web` 并刷新页面。
26
25
 
27
26
  ## 安装
28
27
 
28
+ `dsh` 是 DSH 运行时自带的 launcher,位于 App 安装目录的 `resources\runtime\cli\bin\dsh.cmd`。先确认它能调用:
29
+
30
+ ```powershell
31
+ dsh --version
32
+ ```
33
+
29
34
  ### 从 npm 安装
30
35
 
31
36
  ```powershell
32
37
  # 桌面 App
33
- corepack pnpm dsh plugin --profile desktop add dsh-synapse
38
+ dsh plugin --profile desktop add dsh-synapse
34
39
 
35
- # 命令行 dsh web
36
- corepack pnpm dsh plugin --profile web add dsh-synapse
40
+ # 命令行形态(仅当你有对应的 web profile)
41
+ dsh plugin --profile web add dsh-synapse
37
42
  ```
38
43
 
39
44
  npm 包分发的是预构建产物,无需任何构建授权——最简单的安装方式。下方 GitHub 与本地 checkout 为备选。
@@ -41,7 +46,7 @@ npm 包分发的是预构建产物,无需任何构建授权——最简单的
41
46
  ### 从 GitHub 安装
42
47
 
43
48
  ```powershell
44
- corepack pnpm dsh plugin --profile web add github:liangmianya/dsh-synapse
49
+ dsh plugin --profile desktop add github:liangmianya/dsh-synapse
45
50
  ```
46
51
 
47
52
  GitHub 安装会运行本包的 `prepare` 脚本,通过 `node --check` 验证 JavaScript 语法。
@@ -60,7 +65,7 @@ allowBuilds:
60
65
  ### 本地开发安装
61
66
 
62
67
  ```powershell
63
- corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
68
+ dsh plugin --profile desktop add link:E:\path\to\dsh-synapse
64
69
  ```
65
70
 
66
71
  `link:` 会直接引用本地 checkout,适合开发和调试。普通运行模式下修改代码后,建议重启宿主(桌面 App 或 `dsh web`)并刷新页面。
@@ -68,7 +73,7 @@ corepack pnpm dsh plugin --profile web add link:E:\path\to\dsh-synapse
68
73
  ## 启动
69
74
 
70
75
  ```powershell
71
- corepack pnpm dsh web
76
+ dsh web
72
77
  ```
73
78
 
74
79
  默认地址:
@@ -80,7 +85,7 @@ http://127.0.0.1:3080/
80
85
  如果 3080 被占用,可以让 DSH 自动选择端口:
81
86
 
82
87
  ```powershell
83
- corepack pnpm dsh web --port 0
88
+ dsh web --port 0
84
89
  ```
85
90
 
86
91
  启动后点击顶部“会话地图”进入 Synapse。不要同时运行两个共享同一 profile 的 `dsh web` 实例。
@@ -104,6 +109,22 @@ corepack pnpm dsh web --port 0
104
109
  - 卡片内部平滑滚动和 Markdown 表格渲染。
105
110
  - 将工具调用和结果按 `callId` 折叠到对应助手回答中。
106
111
 
112
+ 顶部「对话 / 会话地图」开关也可以挪位置:
113
+
114
+ - 按住开关左侧的**六点手柄**拖动,鬆手即记忆(存在浏览器本地,按浏览器各自独立);
115
+ - **双击手柄**复位到默认位置(标题栏下方居中);
116
+ - 手柄获得焦点后可用**方向键**微调,每次 8px;
117
+ - 开关始终保留离屏幕边缘 8px 的余量,缩小窗口也不会被挤到看不见的地方。
118
+
119
+ ## 最近更新
120
+
121
+ **0.5.6**
122
+
123
+ - 顶部开关可以拖动、记忆位置、双击复位(本次新增)。
124
+ - 修正交互与渲染一致性:切换会话会把该会话带到视野内;折叠卡片不再移动画布;选区落在正文时侧栏与详情仍能更新;卡片右侧的折叠/分支按钮不再被相邻卡片遮住而点不到。
125
+ - 修正工作区加载竞态:切换工作区不会再被后台轮询顶掉,画布重建次数从「每秒数次」降到「仅在数据变化时一次」。
126
+ - `workspaces.json` 读不出来时改为**明确报错并保持只读**,不再用旧备份覆盖原文件(0.5.5 引入的回退已撤销)。
127
+
107
128
  ## 配置
108
129
 
109
130
  插件通过 profile 的 `cordis.patch.yml` 注入。可以在自己的 patch 中通过行 id `synapse` 覆盖配置。
@@ -135,7 +156,7 @@ corepack pnpm dsh web --port 0
135
156
  卸载插件:
136
157
 
137
158
  ```powershell
138
- corepack pnpm dsh plugin --profile web remove dsh-synapse
159
+ dsh plugin --profile web remove dsh-synapse
139
160
  ```
140
161
 
141
162
  `remove` 只移除插件依赖和 profile 激活层,不会删除画布数据。重新安装后,旧数据会继续使用并按需迁移。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-synapse",
3
- "version": "0.5.5",
3
+ "version": "0.5.7",
4
4
  "description": "A visual, non-linear conversation workspace plugin for DeepSeek Harness.",
5
5
  "type": "module",
6
6
  "main": "index.js",