dsh-linked-workspace 0.16.1 → 0.18.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 +17 -0
- package/README.en.md +19 -1
- package/README.md +20 -1
- package/docs/API.md +25 -4
- package/docs/VERIFY.md +24 -0
- package/lib/client.js +326 -3
- package/lib/index.js +585 -33
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,23 @@
|
|
|
2
2
|
|
|
3
3
|
English · [简体中文](CHANGELOG.zh.md)
|
|
4
4
|
|
|
5
|
+
## 0.18.0 — 2026-11-19
|
|
6
|
+
|
|
7
|
+
- New `fs.references` and a `references` action on `linked_workspace`: case-insensitive path completion with the **best match first** (exact name → prefix → substring) and directories flagged `dir`; it stops after 20000 entries or 3 s and reports `truncated`. The model can now resolve a remote path you mention by name.
|
|
8
|
+
- The sidebar context menu gained “Copy as @ reference”, which puts `@relative/path` (for example `@src/app.py`) on the clipboard, ready to paste into the chat.
|
|
9
|
+
- Content search options: a “search usually ignored folders” switch (`includeIgnored` — `node_modules`/`.venv`/`dist` … are searched too while `.git`/`.hg`/`.svn` stay out), a files-only mode (`resultMode: 'files'`), and adjustable `maxFiles`/`maxFileBytes`/`timeoutMs` (5 s by default, 10 s at most). The search bar has two more chips for these.
|
|
10
|
+
- Content search now reports what it walked (`scannedFiles`/`scannedBytes`/`skippedFiles`) and shows “Scanned N files · X” above the results, and it can be **stopped midway**: new `fs.grepCancel { jobId }` backs a “Stop” button in the search bar, and a cancelled sweep reports `truncatedReason: 'cancelled'`.
|
|
11
|
+
- Known limitation (0.18.0): DSH's `@` completion popup cannot be extended by a plugin — the Host `fileReferences` service only exposes `list(agent, query, signal)` with no provider registration — so remote paths do not appear in that popup; use the `references` action or “Copy as @ reference”.
|
|
12
|
+
- Host API revision is now `apiRevision: 4`.
|
|
13
|
+
|
|
14
|
+
## 0.17.0 — 2026-11-19
|
|
15
|
+
|
|
16
|
+
- New `hosts.exec`: let the model run **one** non-interactive command on the remote host (builds, tests, logs) instead of composing `ssh`. Off by default and gated three ways: the `execEnabled` switch, the host allow-list `execHostIds`, and the optional workspace allow-list `execWorkspaceIds` (empty means no restriction). Refusals are audited too.
|
|
17
|
+
- Every attempt is written to `$DSH_HOME/linked-workspace/exec-audit.jsonl`: command, `cwd`, exit code, duration, the first 4 KB of output and any refusal reason; rotated to `.1` past 5 MB. `meta.info` returns that path and the settings block can open it.
|
|
18
|
+
- Output and time are bounded: each stream is clipped to `execMaxOutputChars` (200000 by default, head+tail, flagged `truncated`), timeouts follow `execTimeoutMs` (60 s by default, 600 s per call at most) and surface as `EXEC_TIMEOUT`; `cwd` may not escape the workspace root.
|
|
19
|
+
- `linked_workspace` gained an `exec` action (`command` up to 8000 characters, optional `cwd` and `timeout_ms`) and its prompt now prefers it over hand-written `ssh`. The settings page has a “Remote command execution” block (switch, both allow-lists, timeout/output caps, open audit log).
|
|
20
|
+
- Host API revision is now `apiRevision: 3`: a Host still running older code shows the “restart DSH” banner above the tree.
|
|
21
|
+
|
|
5
22
|
## 0.16.1 — 2026-11-19
|
|
6
23
|
|
|
7
24
|
- The hover card's connection state now follows reality in both directions: the
|
package/README.en.md
CHANGED
|
@@ -112,11 +112,28 @@ Appears automatically for sessions that belong to a remote workspace (and can be
|
|
|
112
112
|
|
|
113
113
|
| Tool | Purpose |
|
|
114
114
|
| --- | --- |
|
|
115
|
-
| `linked_workspace` | `list`, `info`, `list_dir`, `read`, `write`, `replace`, `stat`, `mkdir`, `rename`, `delete`, `sync`; paths are relative to the remote root, writes are atomic, `if_modified_since` provides optimistic concurrency. Works for both linked and remote workspaces (`sync` only applies to a linked workspace with the mirror on) |
|
|
115
|
+
| `linked_workspace` | `list`, `info`, `list_dir`, `read`, `write`, `replace`, `stat`, `mkdir`, `rename`, `delete`, `sync`, `exec`; paths are relative to the remote root, writes are atomic, `if_modified_since` provides optimistic concurrency. Works for both linked and remote workspaces (`sync` only applies to a linked workspace with the mirror on) |
|
|
116
116
|
| `linked_skills` | `list` / `read` local skills (`~/.dsh/skills`, `~/.agents/skills`, `<local>/.dsh/skills`, `<local>/.agents/skills`) |
|
|
117
117
|
|
|
118
118
|
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.
|
|
119
119
|
|
|
120
|
+
### Remote command execution (0.17.0, off by default)
|
|
121
|
+
|
|
122
|
+
`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:
|
|
123
|
+
|
|
124
|
+
1. the `execEnabled` switch under Settings → Linked workspaces → “Remote command execution”;
|
|
125
|
+
2. the host is in the **host allow-list** `execHostIds`;
|
|
126
|
+
3. if the optional **workspace allow-list** `execWorkspaceIds` is filled in, the current workspace must be listed (an empty list means “no restriction”).
|
|
127
|
+
|
|
128
|
+
Every attempt — including refused ones — appends a line to `$DSH_HOME/linked-workspace/exec-audit.jsonl` (command, exit code, duration, first 4 KB of output, refusal reason), rotated to `.1` past 5 MB; the settings block has an “Open audit log” button. Output is clipped per stream to `execMaxOutputChars` (200000 by default), timeouts come from `execTimeoutMs` (60 s by default, 600 s per call at most), and `cwd` may not escape the workspace root.
|
|
129
|
+
|
|
130
|
+
### @ references and finer search (0.18.0)
|
|
131
|
+
|
|
132
|
+
- The `references` action (backed by `fs.references`) matches **path names** case-insensitively with the best match first (exact name → prefix → substring) and directories flagged `dir`, so the model can turn a file name you mention into a real remote path.
|
|
133
|
+
- Right-click a file or folder → “Copy as @ reference” to put `@relative/path` (e.g. `@src/app.py`) on the clipboard.
|
|
134
|
+
- Content search gained two switches — “search usually ignored folders” (`node_modules`/`.venv`/`dist` included, `.git` always out) and “file names only” — plus a “Stop” button that cancels a running sweep; the scan stats (“Scanned N files · X”) appear above the results.
|
|
135
|
+
- Known limitation: DSH's `@` completion popup is not extensible by plugins (the Host `fileReferences` service only offers `list()`, with no registration hook), so remote paths do not show up in that dropdown — use the `references` action or copy-as-reference instead.
|
|
136
|
+
|
|
120
137
|
### Running icon / local skills
|
|
121
138
|
|
|
122
139
|
- While a linked workspace has a running session, its link icon turns **blue** (refreshed about every 5 seconds).
|
|
@@ -191,6 +208,7 @@ The npm package is `dsh-linked-workspace`; released versions can also be install
|
|
|
191
208
|
- Single-file saves are capped at 8 MB; mirror sync runs in the background (500 files / 50 MB by default, skipping oversized files), excludes `.git`/`node_modules`/caches, uses a 30 s per-file timeout and never blocks an HTTP request. “Transfer” and “Download to default folder” handle at most 150 files / 15 MB per run and report partial transfers.
|
|
192
209
|
- The page HTTP API accepts loopback same-origin requests only (remote deployments fall back to the DSH `connection` service's Host/Origin authentication).
|
|
193
210
|
- HTML previews run inside a `sandbox="allow-scripts"` iframe: the page's own scripts execute (so plotly-style charts actually draw) but in a separate opaque origin that cannot reach the DSH UI, host storage or tabs. Markdown/document previews still strip scripts, inline styles, event attributes and `javascript:`/`vbscript:` links, keeping safe links and image `data:` URLs.
|
|
211
|
+
- Remote command execution is off by default and, once enabled, still limited by the host allow-list (plus the optional workspace allow-list). Every attempt is audited, output is length-capped, commands have a timeout, and `cwd` cannot escape the workspace root.
|
|
194
212
|
|
|
195
213
|
## FAQ
|
|
196
214
|
|
package/README.md
CHANGED
|
@@ -111,11 +111,29 @@
|
|
|
111
111
|
|
|
112
112
|
| 工具 | 用途 |
|
|
113
113
|
| --- | --- |
|
|
114
|
-
| `linked_workspace` | `list`、`info`、`list_dir`、`read`、`write`、`replace`、`stat`、`mkdir`、`rename`、`delete`、`sync`;路径相对远端根目录,写入原子化,`if_modified_since` 做乐观并发控制。联动工作区与远程工作区都适用(远程工作区没有本地副本,`sync` 只用于开启镜像的联动工作区) |
|
|
114
|
+
| `linked_workspace` | `list`、`info`、`list_dir`、`read`、`write`、`replace`、`stat`、`mkdir`、`rename`、`delete`、`sync`、`exec`;路径相对远端根目录,写入原子化,`if_modified_since` 做乐观并发控制。联动工作区与远程工作区都适用(远程工作区没有本地副本,`sync` 只用于开启镜像的联动工作区) |
|
|
115
115
|
| `linked_skills` | `list`、`read` 本地技能(`~/.dsh/skills`、`~/.agents/skills`、`<local>/.dsh/skills`、`<local>/.agents/skills`) |
|
|
116
116
|
|
|
117
117
|
会话工作目录落在某个联动工作区或远程工作区的占位目录时会自动解析;跨工作区可用 `workspace` 参数指定(支持 id、本地/占位路径或名称)。远端服务器只需要 SSH,不需要安装插件或 Python。
|
|
118
118
|
|
|
119
|
+
### 远端命令执行(0.17.0,默认关闭)
|
|
120
|
+
|
|
121
|
+
`exec` 让模型在远端跑**一条非交互命令**(编译、跑测试、看日志),不用再自己拼 `ssh`。它默认是关的,要同时满足三件事才会执行:
|
|
122
|
+
|
|
123
|
+
1. 设置 → 联动工作区 → 「远端命令执行」里的总开关 `execEnabled`;
|
|
124
|
+
2. 该主机在**主机白名单** `execHostIds` 里;
|
|
125
|
+
3. 若填了**工作区白名单** `execWorkspaceIds`,当前工作区必须在其中(留空表示不限制)。
|
|
126
|
+
|
|
127
|
+
每次尝试——包括被拒绝的——都会写一行到 `$DSH_HOME/linked-workspace/exec-audit.jsonl`(含命令、退出码、耗时、输出的前 4 KB、拒绝原因),超过 5 MB 自动轮转为 `.1`;设置页有「打开审计日志」按钮。输出按 `execMaxOutputChars`(默认 200000 字符/流)截断,超时由 `execTimeoutMs`(默认 60 秒,单次最多 600 秒)控制,`cwd` 不能跑出工作区根目录。
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
### @ 引用与更细的搜索(0.18.0)
|
|
131
|
+
|
|
132
|
+
- `references` 动作(对应 `fs.references`)按**路径名**做大小写不敏感匹配,最佳匹配排在最前(完全同名 → 前缀 → 包含),目录带 `dir` 标记;模型可以用它把你口头提到的文件名解析成远端真实路径。
|
|
133
|
+
- 右键文件或目录 →「复制为 @ 引用」,把 `@相对路径`(如 `@src/app.py`)复制到剪贴板。
|
|
134
|
+
- 内容搜索多了两枚开关:「包含通常忽略的目录」(`node_modules`/`.venv`/`dist` 也会搜,`.git` 始终排除)、「只列文件名」;搜索中可以点「停止」中途取消,结果上方会显示「扫描 N 个文件 · X」。
|
|
135
|
+
- 已知限制:DSH 的 `@` 补全弹窗没有开放给插件(宿主 `fileReferences` 服务只提供 `list()`,没有注册入口),所以远端路径不会出现在 `@` 下拉里,请用 `references` 动作或右键复制。
|
|
136
|
+
|
|
119
137
|
### 运行中图标 / 本地技能
|
|
120
138
|
|
|
121
139
|
- 联动工作区下若有正在运行的会话(本地会话 turn 进行中),左侧工作区的链环图标会变成**蓝色**;刷新间隔约 5 秒。
|
|
@@ -190,6 +208,7 @@ npm 包名为 `dsh-linked-workspace`,也可以从 npm 安装已发布版本(
|
|
|
190
208
|
- 单文件保存上限 8 MB;镜像同步在后台执行,默认最多 500 文件 / 50 MB(跳过超大文件),默认排除 `.git`/`node_modules`/各类缓存目录,单文件读取 30 s 超时,不再阻塞 HTTP 请求。右键「传输」与「下载到默认文件夹」单次最多 150 文件 / 15 MB(超限会提示未全部传输)。
|
|
191
209
|
- 页面 HTTP API 只接受本机回环同源请求(远程部署时回落到 DSH `connection` 服务的 Host/Origin 鉴权)。
|
|
192
210
|
- HTML 预览跑在 `sandbox="allow-scripts"` 的 iframe 里:脚本能执行(plotly 这类图表才有内容),但处于独立的不透明源,访问不到 DSH 界面、宿主存储与标签页;Markdown/文档预览仍会移除脚本、内联样式、事件属性与 `javascript:`/`vbscript:` 等危险链接,只保留安全链接与图片 `data:` URL。
|
|
211
|
+
- 远端命令执行默认关闭,开启后仍受主机白名单(以及可选的工作区白名单)限制;每次执行(含被拒绝的尝试)都写审计日志,输出有长度上限、命令有超时,`cwd` 不能跑出工作区根目录。
|
|
193
212
|
|
|
194
213
|
## 常见问题
|
|
195
214
|
|
package/docs/API.md
CHANGED
|
@@ -57,6 +57,7 @@ scope root, or absolute inside it.
|
|
|
57
57
|
| `hosts.df` | `{ hostId, path? }` | `{ disk: { path, size, used, avail, percent } \| null }` (free space of the volume holding `path`; defaults to the login home) |
|
|
58
58
|
| `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) |
|
|
59
59
|
| `hosts.mkdir` | `{ hostId, path?, name }` | `{ path }` (creates `name` inside `path`; defaults to the login home; `409`/`FS_EXISTS` when it already exists) |
|
|
60
|
+
| `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. |
|
|
60
61
|
| `remote_workspaces.list` | `{}` | `{ workspaces: RemoteWorkspaceInfo[] }` |
|
|
61
62
|
| `remote_workspaces.create` | `{ hostId, remotePath, name? }` | `{ workspace }` |
|
|
62
63
|
| `remote_workspaces.get` | `{ id }` | `{ workspace }` |
|
|
@@ -95,7 +96,9 @@ scope root, or absolute inside it.
|
|
|
95
96
|
| `skills.read` | `{ linkedId, name }` | `{ name, description, content, path }` |
|
|
96
97
|
| `git.status` | `{ linkedId?/remoteId?, side: 'remote'|'local' }` | `{ ok, repo, root, branch, changes, error? }` (remote workspaces only support `side: 'remote'`) |
|
|
97
98
|
| `fs.search` | `{ linkedId?/remoteId?, side, query, maxResults? }` | `{ ok, query, entries, truncated }` (matches **file names**, not contents; use `fs.grep` for contents) |
|
|
98
|
-
| `fs.grep` | `{ linkedId?/remoteId?, side, query, maxResults?, path?, ignoreCase?, regex? }` | `{ ok, query, entries: [{ path, relative, size, line, preview }], truncated, truncatedReason }` (searches file **contents**; `path` narrows the scan to a sub-folder; `ignoreCase` defaults to `true`; `regex` treats `query` as a regular expression; limits are 1 MB per file, 2000 files, 8 MB and 5 s for both sides, and `truncatedReason` is one of `files`, `bytes`, `deadline`, `results`; max 1000 rows) |
|
|
99
|
+
| `fs.grep` | `{ linkedId?/remoteId?, side, query, maxResults?, path?, ignoreCase?, regex?, includeIgnored?, resultMode?, maxFiles?, maxFileBytes?, timeoutMs?, jobId? }` | `{ ok, query, entries: [{ path, relative, size, line, preview, matches }], truncated, truncatedReason, scannedFiles, scannedBytes, skippedFiles }` (searches file **contents**; `path` narrows the scan to a sub-folder; `ignoreCase` defaults to `true`; `regex` treats `query` as a regular expression; `includeIgnored: true` also walks usually ignored folders such as `node_modules`/`.venv`/`dist` (`.git`/`.hg`/`.svn` always stay out); `resultMode: 'files'` lists file names only (`line: 0`, empty `preview`, `matches` = hit count); `maxFiles` (default 2000), `maxFileBytes` (default 1 MB) and `timeoutMs` (default 5 s, max 10 s) raise or lower the sweep; limits are 1 MB per file, 2000 files, 8 MB and 5 s for both sides, and `truncatedReason` is one of `files`, `bytes`, `deadline`, `results`, `cancelled`; max 1000 rows) |
|
|
100
|
+
| `fs.grepCancel` | `{ jobId }` | `{ cancelled }` (marks the job started by `fs.grep`'s `jobId`; the Host checks it between files and answers `truncatedReason: 'cancelled'`) |
|
|
101
|
+
| `fs.references` | `{ linkedId?/remoteId?, query, limit?, includeIgnored?, side? }` | `{ ok, query, candidates: [{ path, relative, name, kind }], total, truncated, scannedEntries }` (path completion for `@`-style references: matches the **path**, case-insensitive, best match first — exact name, then prefix, then substring; `limit` defaults to 50 and caps at 200; walking stops after 20000 entries or 3 s; `side: 'local'` searches the local tree of a linked workspace) |
|
|
99
102
|
| `fs.compare` | `{ linkedId?, path? }` | `{ path, relative, localPath, localMissing, counts: { onlyLocal, onlyRemote, changed, same }, onlyLocal, onlyRemote, changed, truncated, remoteTruncated, localTruncated, skippedLinks }` (linked workspaces only; excludes `.git`, `node_modules`, `.local`, `.remote`; 4000 files and depth 12 **per side**, 200 rows per group; `skippedLinks` counts symlinks and non-regular files) |
|
|
100
103
|
| `fs.pullToLocal` | `{ linkedId?, path, targetDir?, conflict? }` | `{ path, relative, size, mtime }` (linked workspaces only; single file, ≤64 MB; `targetDir` must stay inside the local root; `conflict` is `error` (default), `overwrite` or `unique`) |
|
|
101
104
|
| `fs.upload` | `{ linkedId?/remoteId?, path, paths, conflict? }` | `{ side: 'remote', target, files, bytes, skipped }` (≤50 local files, 64 MB each; `conflict` is `error` (default), `overwrite` or `unique`; a missing target directory is created) |
|
|
@@ -130,7 +133,17 @@ Under `$DSH_HOME/linked-workspace/`:
|
|
|
130
133
|
|
|
131
134
|
- `linked.json` — linked workspaces (no credentials).
|
|
132
135
|
- `remote-workspaces.json` — remote workspaces (no credentials).
|
|
133
|
-
- `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave }`.
|
|
136
|
+
- `settings.json` — `{ editorTheme, editorThemeFamily, editorThemeMode, fileOpenMode, autoSave, execEnabled, execHostIds, execWorkspaceIds, execTimeoutMs, execMaxOutputChars, execShell }`.
|
|
137
|
+
The exec keys are off unless you turn them on: `execEnabled` defaults to
|
|
138
|
+
`false`, `execHostIds` (host allow-list) starts empty, and
|
|
139
|
+
`execWorkspaceIds` is an optional second layer where an empty list means
|
|
140
|
+
"every workspace on an allowed host".
|
|
141
|
+
- `exec-audit.jsonl` — one JSON line per `hosts.exec` attempt (accepted or
|
|
142
|
+
refused): `{ ts, auditId, hostId, hostName, workspaceId, kind, command, cwd?,
|
|
143
|
+
exitCode?, durationMs?, stdoutBytes?, stderrBytes?, truncated?, stdoutHead?,
|
|
144
|
+
stderrHead?, refusal?, message? }`. Rotated to `exec-audit.jsonl.1` past 5 MB.
|
|
145
|
+
`meta.info` returns its absolute path as `execAuditFile` so the settings page
|
|
146
|
+
can open it.
|
|
134
147
|
- `known_hosts.json` — trust-on-first-use host key fingerprints.
|
|
135
148
|
- `ssh-credentials.json` — `{ version, byHostId: { <hostId>: { password?, privateKey?, passphrase? } } }`,
|
|
136
149
|
written by `hosts.credentials` with mode `0600`. Hosts listed in `~/.ssh/config`
|
|
@@ -144,13 +157,21 @@ Under `$DSH_HOME/linked-workspace/`:
|
|
|
144
157
|
|
|
145
158
|
`linked_workspace` (Host tool, JSON-Schema parameters) actions: `list`, `info`,
|
|
146
159
|
`list_dir`, `read`, `write`, `replace`, `stat`, `mkdir`, `rename`, `delete`,
|
|
147
|
-
`sync`. It resolves the workspace from the session working directory (a linked
|
|
160
|
+
`sync`, `exec`, `references`. It resolves the workspace from the session working directory (a linked
|
|
148
161
|
local directory or a remote workspace placeholder) or from an explicit
|
|
149
162
|
`workspace` reference (id, local/placeholder path, or name), confines paths to
|
|
150
163
|
the remote root, and mirrors reads/writes into `.remote/` when a linked
|
|
151
164
|
workspace mirrors. `list` shows both kinds, labelled `(linked)` and `(remote)`;
|
|
152
165
|
`info` returns `kind: "linked" | "remote"` and `sync` is rejected for remote
|
|
153
|
-
workspaces.
|
|
166
|
+
workspaces. `exec` takes `command` (≤ 8000 characters), an optional `cwd`
|
|
167
|
+
(inside the workspace root) and `timeout_ms`, and refuses unless the switches
|
|
168
|
+
described under `hosts.exec` are on. `references` takes `query` (≤ 200
|
|
169
|
+
characters) and an optional `limit`, and lists matching paths best-match first
|
|
170
|
+
(directories marked `dir`) — that is how the model resolves a remote path a user
|
|
171
|
+
mentioned by name. The `@` completion popup itself is **not** extensible: the
|
|
172
|
+
Host `fileReferences` service only exposes `list(agent, query, signal)` and has
|
|
173
|
+
no provider registration, so remote candidates cannot be injected into it; use
|
|
174
|
+
the action or the sidebar's “Copy as @ reference”.
|
|
154
175
|
|
|
155
176
|
`linked_skills` (Host tool) actions: `list`, `read` — local skills
|
|
156
177
|
(`~/.dsh/skills`, `~/.agents/skills`, `<local>/.dsh/skills`,
|
package/docs/VERIFY.md
CHANGED
|
@@ -2,6 +2,30 @@
|
|
|
2
2
|
|
|
3
3
|
Host code (lib/) reloads live with `plugin_manager set_plugin include:linked-workspace-ui`; client changes load with **应用 → 重新加载界面** (a full restart is only needed after re-installing the package). Then verify:
|
|
4
4
|
|
|
5
|
+
## @ 引用与搜索增强(0.18.0)
|
|
6
|
+
|
|
7
|
+
1. 内容搜索栏在「内容」模式下有五枚 chip(`Aa`、`.*`、目录范围、`.*/`、文件图标)与一个「停止」按钮(仅在搜索中、且有 jobId 时出现)。
|
|
8
|
+
2. 打开「只列文件名」→ 结果行不再显示命中行与行号,只列文件;打开「包含通常忽略的目录」→ 原本被跳过的 `node_modules`/`.venv`/`dist` 中的文件也会出现(`.git` 始终不出现)。
|
|
9
|
+
3. 搜索一段较大的目录时点「停止」→ 请求 `fs.grepCancel { jobId }`,结果提前结束并在 `truncatedReason` 里给出 `cancelled`。
|
|
10
|
+
4. 结果上方显示「扫描 N 个文件 · X(跳过 M 个)」,数字来自 `scannedFiles`/`scannedBytes`/`skippedFiles`。
|
|
11
|
+
5. 右键任一文件或目录 → 「复制为 @ 引用」→ 剪贴板得到 `@相对路径`(如 `@src/app.py`),提示「已复制 @src/app.py」。
|
|
12
|
+
6. `fs.references { linkedId, query: 'a.txt' }` → `{ candidates: [{ relative, name, kind }], scannedEntries }`,完全同名的排最前;`limit` 生效;空 query 返回空候选而不是报错。
|
|
13
|
+
7. 模型侧:让它「用 linked_workspace 的 references 动作找一下 xxx 文件」→ 工具卡片按「dir/file + 相对路径」列出候选。
|
|
14
|
+
8. 已知限制(需人工确认未变化):`@` 补全弹窗里不会出现远端路径 —— 宿主 `fileReferences` 服务只有 `list(agent, query, signal)`,没有 provider 注册入口。
|
|
15
|
+
|
|
16
|
+
## 远端命令执行(0.17.0)
|
|
17
|
+
|
|
18
|
+
> 注意:本机这套 DSH **Web** 构建里没有可见的设置入口(账号菜单只有「意见反馈 / 退出登录」,`Ctrl+K` 是会话搜索,插件详情页只有「卸载」),所以设置区块的渲染要在**桌面端**确认;Host 侧行为可以直接用下面的 API 命令验证。
|
|
19
|
+
|
|
20
|
+
1. 设置 → 联动工作区 → 「远端命令执行」:默认总开关关闭、两个白名单为空、超时 60 秒、输出上限 200000;打开开关后才出现黄色警告行与两个白名单列表。
|
|
21
|
+
2. 开关关闭时执行:`hosts.exec { linkedId, command: 'echo x' }` → `403 EXEC_DISABLED`,提示里指向设置页路径。
|
|
22
|
+
3. 开关打开但主机白名单为空 → `403 EXEC_HOST_NOT_ALLOWED`;把该主机加进白名单 → `echo hi; pwd` 返回 `exitCode: 0`、`stdout` 含 `hi`、`cwd` 等于工作区远端根。
|
|
23
|
+
4. 工作区白名单填一个不相干的值 → `403 EXEC_WORKSPACE_NOT_ALLOWED`;留空表示不限制。
|
|
24
|
+
5. `command: ''` → `400 BAD_REQUEST`;`cwd: '../..'` → `400 BAD_REQUEST`;`timeoutMs: 1000` 配 `sleep 5` → `504 EXEC_TIMEOUT`。
|
|
25
|
+
6. 审计:每次尝试(含被拒绝)都往 `$DSH_HOME/linked-workspace/exec-audit.jsonl` 追加一行 JSON,含 `auditId`、`hostId`、`command`、成功时的 `exitCode`/`durationMs`/`stdoutHead`、失败时的 `refusal`/`message`;文件超过 5 MB 时轮转为 `exec-audit.jsonl.1`;设置页「打开审计日志」用系统默认应用打开它。
|
|
26
|
+
7. 模型侧:在联动/远程工作区的会话里让它「用 linked_workspace 的 exec 动作跑 uname -a」→ 工具卡片返回退出码与输出;开关关闭时模型会收到 `EXEC_DISABLED` 与开启指引。
|
|
27
|
+
8. 旧 Host:`meta.info` 的 `apiRevision` < 3 时目录树顶部出现「DSH 的插件进程仍在运行旧版代码」横幅。
|
|
28
|
+
|
|
5
29
|
## 设置 → 联动工作区
|
|
6
30
|
|
|
7
31
|
1. 左下角「账号菜单」→ 设置 →「联动工作区」。
|