dsh-linked-workspace 0.22.0 → 0.24.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/CHANGELOG.md CHANGED
@@ -2,6 +2,23 @@
2
2
 
3
3
  English · [简体中文](CHANGELOG.zh.md)
4
4
 
5
+ ## 0.24.0 — 2026-11-22
6
+
7
+ - Auto push moved from one global switch to **each linked workspace card**: every workspace has its own on/off switch, its own debounce (300–60000 ms) and its own include/exclude globs, so "watch this repo" no longer means "watch all of them".
8
+ - The Host keeps one `fs.watch` per enabled workspace (`linked.json` → `autoPush`), re-reads the record before every push and stops the watcher the moment the switch goes off or the workspace is removed.
9
+ - `linked.list` now reports each record's `autoPush`, and `linked.update { id, autoPush }` writes it (the debounce is clamped, globs are trimmed, de-duplicated and capped at 100). The four old global `autoPush*` settings are still accepted so an existing `settings.json` loads unchanged, but they no longer drive anything.
10
+ - The first time you turn it on for a workspace, an inline confirmation still explains that files will be written behind your back; cancelling leaves the switch off.
11
+ - The "allowed workspaces (second layer)" list in the remote-exec settings now starts **collapsed**, with a button that shows how many are ticked and expands the list only when you ask for it.
12
+
13
+ ## 0.23.0 — 2026-11-21
14
+
15
+ - Models can read the **text of PDF / Word / Excel / PowerPoint** files: new `read_doc` action and `docs.text` method (PDF page by page, Word paragraphs and tables, one block per Excel sheet, PPT slides plus notes, 40k characters by default). No more installing PyPDF2 to read one paper.
16
+ - `sync` is now observable: new `sync_status` action. The prompt used to tell models to poll `linked.syncStatus` while the action list never had it.
17
+ - Port forwards: `forward` / `forwards` / `unforward` actions plus a "Port forwards" settings block that maps a remote TensorBoard or Jupyter onto a local `127.0.0.1` port; tunnels are closed when the plugin unloads.
18
+ - Paths outside the workspace have a supported route: the "Extra roots" setting plus `read_outside` / `write_outside` / `list_outside`. Every access is appended to `outside-audit.jsonl`, and paths that match no prefix still fail hard with a hint pointing at the setting.
19
+ - `info` now spells out the two easiest things to misread: in a linked workspace `.remote/` is that workspace's own mirror (not another workspace's placeholder), and inside a remote workspace's placeholder the host tools (read/grep/glob) see no remote files at all.
20
+ - The binary-file hint points at `read_doc` instead of telling models to download the file locally.
21
+
5
22
  ## 0.22.0 — 2026-11-20
6
23
 
7
24
  - Workspace cards gained a **Reconnect** button: it drops the pooled socket, dials once and reports either “Reconnected” with the round-trip time or the host's own error message. New host method `hosts.reconnect` — the read-only `hosts.status` snapshot never dials, so a stale “Not connected” chip previously had no way to refresh itself.
package/README.en.md CHANGED
@@ -119,6 +119,13 @@ Appears automatically for sessions that belong to a remote workspace (and can be
119
119
 
120
120
  The workspace resolves automatically when the session cwd falls inside a linked workspace or a remote workspace placeholder; use the `workspace` argument (id, local/placeholder path or name) across workspaces. The remote server only needs SSH — no plugin or Python installation.
121
121
 
122
+ ### Documents, tunnels and paths outside the workspace (0.23.0)
123
+
124
+ - Models can read the **text of PDF / Word / Excel / PowerPoint** files directly (`read_doc`) instead of installing a parser.
125
+ - When TensorBoard or Jupyter runs remotely, map it onto a local `127.0.0.1` port under Settings → Linked workspaces → **Port forwards** and open the URL in a browser; tunnels close with the plugin.
126
+ - To touch a shared drive outside the workspace, add the prefix under Settings → Linked workspaces → **Extra roots** first; only then can the model use `read_outside` / `write_outside` / `list_outside`, and every access lands in `outside-audit.jsonl`.
127
+ - `sync_status` reports progress and counters while a mirror sync runs.
128
+
122
129
  ### Remote command execution (0.17.0, off by default)
123
130
 
124
131
  `exec` lets the model run **one non-interactive command** on the remote host (builds, tests, logs) instead of composing `ssh` itself. It is off unless three things line up:
@@ -280,4 +287,4 @@ On Windows, run `test/host-api.mjs` with DSH's bundled Electron Node (system Nod
280
287
 
281
288
  MIT © 2026 Huangjh
282
289
 
283
- Since 0.21.0 the diff preview follows your entry point: right-click a folder or select several items and only those rows appear, each with its size, both mtimes and the first eight hash characters, plus a “conflicts only” filter; “removed remotely” rows can delete the leftover file. The clock button in the toolbar opens the transfer and push history, and the “auto push” chip in the directory header shows when it last pushed — auto push now follows workspace creation and removal and backs off after five failed attempts.
290
+ Since 0.21.0 the diff preview follows your entry point: right-click a folder or select several items and only those rows appear, each with its size, both mtimes and the first eight hash characters, plus a “conflicts only” filter; “removed remotely” rows can delete the leftover file. The clock button in the toolbar opens the transfer and push history, and the “auto push” chip in the directory header shows when it last pushed — auto push now follows workspace creation and removal and backs off after five failed attempts; since 0.24.0 it lives on **each linked workspace card**, so every workspace has its own switch, debounce and include/exclude globs.
package/README.md CHANGED
@@ -118,6 +118,13 @@
118
118
 
119
119
  会话工作目录落在某个联动工作区或远程工作区的占位目录时会自动解析;跨工作区可用 `workspace` 参数指定(支持 id、本地/占位路径或名称)。远端服务器只需要 SSH,不需要安装插件或 Python。
120
120
 
121
+ ### 读文档、开隧道、访问工作区外(0.23.0)
122
+
123
+ - 模型可以直接读 **PDF / Word / Excel / PowerPoint 的文字**(`read_doc`),不用再自己装解析库。
124
+ - 远端跑着 TensorBoard、Jupyter 时,可以在 设置 → 联动工作区 → **端口转发** 里把它映射到本机 `127.0.0.1` 的端口,点 URL 就能在浏览器打开;插件退出时隧道自动关闭。
125
+ - 需要碰工作区之外的共享盘时,先在 设置 → 联动工作区 → **额外根目录** 里加前缀,模型才能用 `read_outside` / `write_outside` / `list_outside` 访问,而且每次访问都会记进 `outside-audit.jsonl`。
126
+ - 镜像同步进行中可以用 `sync_status` 看进度与计数。
127
+
121
128
  ### 远端命令执行(0.17.0,默认关闭)
122
129
 
123
130
  `exec` 让模型在远端跑**一条非交互命令**(编译、跑测试、看日志),不用再自己拼 `ssh`。它默认是关的,要同时满足三件事才会执行:
@@ -280,4 +287,4 @@ node test/ssh-smoke.mjs # 真实 SSH 传输自检(按需)
280
287
 
281
288
  MIT © 2026 Huangjh
282
289
 
283
- 从 0.21.0 起,差异预览会跟着你的入口收窄:右键文件夹或选中若干项再推送,预览里只有这些范围内的条目,每行还带大小、两边时间与 hash 前 8 位,可以勾「只看冲突」;「远端已删」的行能直接删掉远端残留。工具栏的时钟按钮打开「传输与推送历史」,目录栏的「自动推送」chip 显示最近一次推送时间——自动推送现在跟随工作区增删,失败会退避重试最多 5 次。
290
+ 从 0.21.0 起,差异预览会跟着你的入口收窄:右键文件夹或选中若干项再推送,预览里只有这些范围内的条目,每行还带大小、两边时间与 hash 前 8 位,可以勾「只看冲突」;「远端已删」的行能直接删掉远端残留。工具栏的时钟按钮打开「传输与推送历史」,目录栏的「自动推送」chip 显示最近一次推送时间——自动推送现在跟随工作区增删,失败会退避重试最多 5 次;从 0.24.0 起它下沉到**每个联动工作区卡片**上,各工作区可以单独开关,并各自配置 debounce 与「包含/排除」glob。
package/docs/API.md CHANGED
@@ -21,6 +21,7 @@ Codes: `BAD_REQUEST`, `NOT_FOUND`, `SSH_CONNECT`, `AUTH_FAILED`,
21
21
  | Method | Params | Result |
22
22
  | --- | --- | --- |
23
23
  | `docs.read` | `{ path, linkedId?, remoteId? }` | kind-specific document model |
24
+ | `docs.text` | `{ path, linkedId?, remoteId?, maxChars? }` | `{ kind, path, size, mtime, pageCount?, text, truncated }` (plain text out of PDF / Word / Excel / PowerPoint; `maxChars` is clamped to 1000–200000, default 40000) |
24
25
  | `docs.write` | `{ path, data, expectedMtime?, linkedId?, remoteId? }` | `{ kind, path, size, mtime }` |
25
26
  | `docs.create` | `{ path, kind?, linkedId?, remoteId? }` | `{ kind, path, size, mtime }` |
26
27
  | `docs.mdPreview` | `{ path, text?, linkedId?, remoteId? }` | `{ kind, html }` |
@@ -58,6 +59,12 @@ scope root, or absolute inside it.
58
59
  | `hosts.hostKeys` | `{}` | `{ entries: [{ authority, fingerprint, firstSeen, hostId?, hostName? }] }` — the keys remembered in `known_hosts.json`; `hostId` is filled in when the authority still matches a configured host |
59
60
  | `hosts.forgetHostKey` | `{ hostId?/authority? }` | `{ authority, removed }` — drops the stored key (and the live connection) so the next connect trusts the host again; `settings.hostKeyPolicy` decides whether an unknown key is accepted (`tofu`, default) or refused (`strict`) |
60
61
  | `hosts.status` | `{ hostIds? }` | `{ statuses: { [hostId]: { state, reason?, message?, latencyMs?, checkedAt? } } }` (in-memory snapshot of the pool, never dials; an `error` older than 60 s is reported as `idle`; defaults to every known host of the host list plus every workspace's host id) |
62
+ | `fs.readOutside` | `{ linkedId?, remoteId?, path, maxBytes? }` | `{ path, size, mtime, binary, truncated, content }` (only under an `extraRoots` prefix; audited) |
63
+ | `fs.writeOutside` | `{ linkedId?, remoteId?, path, content, ifModifiedSince? }` | `{ path, size, mtime, created }` (8 MB limit; only under an `extraRoots` prefix; audited) |
64
+ | `fs.listOutside` | `{ linkedId?, remoteId?, path }` | `{ path, entries }` (only under an `extraRoots` prefix; audited) |
65
+ | `hosts.forward` | `{ hostId, remotePort, remoteHost?, localPort? }` | `{ forward: { id, hostId, hostName, remoteHost, remotePort, localPort, startedAt, url } }` (localhost TCP tunnel; reuses an identical one) |
66
+ | `hosts.forwards` | `{}` | `{ forwards: [...] }` |
67
+ | `hosts.unforward` | `{ id }` | `{ removed }` |
61
68
  | `hosts.reconnect` | `{ hostId }` | `{ hostId, state, reason?, message?, latencyMs?, checkedAt? }` (drops the pooled socket and dials again; returns the resulting status instead of throwing, so the UI can show the reason) |
62
69
  | `hosts.mkdir` | `{ hostId, path?, name }` | `{ path }` (creates `name` inside `path`; defaults to the login home; `409`/`FS_EXISTS` when it already exists) |
63
70
  | `hosts.exec` | `{ hostId?/linkedId?/remoteId?, command, cwd?, timeoutMs? }` | `{ hostId, hostName, workspaceId, kind, command, cwd, exitCode, stdout, stderr, stdoutBytes, stderrBytes, truncated, durationMs, startedAt, auditId }` — runs **one** non-interactive command on the remote host. Three gates: `settings.execEnabled` must be `true`, the host must be in `settings.execHostIds`, and — when `settings.execWorkspaceIds` is non-empty — the workspace must be in it. Refusals are audited too and answer `403` (`EXEC_DISABLED` / `EXEC_HOST_NOT_ALLOWED` / `EXEC_WORKSPACE_NOT_ALLOWED`); a timeout answers `504` `EXEC_TIMEOUT`, other failures `502` `EXEC_FAILED`. Output is clipped to `settings.execMaxOutputChars` per stream (default 200000, head+tail). `cwd` is resolved inside the workspace root and may not escape it. Output is decoded with `settings.outputEncoding` (`utf8` by default, `gbk` for Chinese Windows remotes). |
@@ -140,7 +147,8 @@ Under `$DSH_HOME/linked-workspace/`:
140
147
 
141
148
  - `linked.json` — linked workspaces (no credentials).
142
149
  - `remote-workspaces.json` — remote workspaces (no credentials).
143
- - `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell, autoPushEnabled, autoPushDebounceMs, autoPushInclude, autoPushExclude, hostKeyPolicy, outputEncoding }`.
150
+ - `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell, hostKeyPolicy, outputEncoding, extraRoots }`. The four `autoPush*` keys are still accepted so an old file loads unchanged, but since 0.24.0 auto push is configured per workspace (`linked.json` → each record's `autoPush`), and those keys no longer drive any watcher.
151
+ - `linked.json` — every record carries `autoPush: { enabled, debounceMs, include[], exclude[] }` (`debounceMs` clamped to 300–60000, default 1500). `linked.list` returns it, `linked.update { id, autoPush }` writes it, and the Host starts/stops one `fs.watch` per enabled workspace.
144
152
  The exec keys are off unless you turn them on: `execEnabled` defaults to
145
153
  `false`, `execHostIds` (host allow-list) starts empty, and
146
154
  `execWorkspaceIds` is an optional second layer where an empty list means
package/docs/VERIFY.md CHANGED
@@ -15,7 +15,8 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
15
15
  2. 点「推送(跳过冲突)」后提示「已推送 N 个文件」,远端目录刷新后能看到新内容(`ssh … cat` 核对)。
16
16
  3. 在**远端**改同一个文件、本地再改一次,重新打开差异预览:该文件出现在「冲突」里;点「推送(跳过冲突)」后远端内容保持不变,提示里带「1 个冲突未处理」;点「推送并覆盖冲突」才会用本地版本覆盖。
17
17
  4. 在行菜单上对某个远端文件点「把这个推送到远端」:差异预览只包含该文件。
18
- 5. 设置 → 联动工作区 → 「自动推回远端」:打开开关会先出现黄色说明与「我明白,开启自动推送」,未确认前不会开启;确认后本地保存文件约 1.5 秒后自动出现在远端,同一文件远端也改过时保留远端版本。
18
+ 5. 设置 → 联动工作区 → 某个联动工作区卡片上的「自动推回远端」:打开开关会先出现黄色说明与「我明白,开启自动推送」,未确认前不会开启;确认后下方出现 debounce 与「包含/排除」两个输入框(按行写 glob,如 `src/**`)。保存文件约 1.5 秒后自动出现在远端,同一文件远端也改过时保留远端版本。
19
+ > 0.24.0 起这个开关属于**每个工作区自己**:卡片 A 开着、卡片 B 关着互不影响,各自的 debounce 与 glob 也独立生效;两个工作区都开着时,只会有匹配 glob 的文件被推送。
19
20
  6. 断网或 SSH 断开时推送会失败并显示原因,本地文件不受影响。
20
21
 
21
22
  ## @ 引用与搜索增强(0.18.0)
@@ -329,6 +330,15 @@ Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-wor
329
330
  20. **其它覆盖层(0.20.1)**:右键「移动到…」等确认对话框与首次运行欢迎卡片同样走 `.rw-top-layer`;Esc、点遮罩、点关闭按钮三种方式都能把宿主一起移除。
330
331
  21. **重新连接(0.22.0)**:刚重启 DSH 后打开设置 →「联动工作区」,卡片状态为「未连接」(这是「本进程还没连过」,不是故障)。点卡片上的**重新连接**:成功时出现绿色「已重新连接」且状态变「已连接」;把某个主机的端口临时改成不可达再点,则应出现红色「连接失败:…」并带上主机的原话(例如 `ECONNREFUSED`)。绕过界面调用 `hosts.reconnect { hostId: '不存在的 id' }` 返回 404。
331
332
  22. **镜像开关不再卡住同步(0.22.0)**:对开启镜像的联动工作区连续执行 `linked.update { mirror: false }` → `linked.update { mirror: true }` → `linked.sync`,轮询 `linked.syncStatus` 应最终为 `done`(不是 `cancelled`)且 `files >= 1`。
333
+ ## 文档文本、端口转发与额外根目录(0.23.0)
334
+
335
+ 1. 让模型读一篇 PDF:`read_doc` 返回按页拼接的文字(含 `pageCount`),不再提示「二进制文件请下载」。
336
+ 2. 读一个 Word / Excel / PowerPoint:分别返回段落与表格、每个工作表的行、每页文字与备注;超出 40000 字符时末尾标 `(truncated)`。
337
+ 3. 触发一次镜像同步后调用 `sync_status`:能看到 `state` 与计数(以前只有提示词提到过这个名字)。
338
+ 4. 设置 → 联动工作区 → 端口转发:填 `127.0.0.1:6006` 开一条隧道,点「打开」能在浏览器看到远端页面;「停止」后隧道从列表消失,端口不可再连。
339
+ 5. 设置 → 联动工作区 → 额外根目录:填入 `/tmp` 后,`write_outside` / `read_outside` / `list_outside` 可以访问 `/tmp` 下的文件,且 `<DSH_HOME>/linked-workspace/outside-audit.jsonl` 每次都有记录;清空前缀后同样的调用返回 400 并提示去哪儿添加。
340
+ 6. 工作区内部的路径用 `*_outside` 访问会被拒绝(400),避免把「额外根目录」当成万能后门。
341
+
332
342
  ## 旧 Host 自检(0.15.0)
333
343
 
334
344
  1. **正常时不打扰**:插件已重启过后打开任意目录树,顶部**不应**出现任何黄色提示条。