dsh-remote-vs 0.17.0 → 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/README.en.md +6 -6
- package/README.md +5 -5
- package/cordis.patch.yml +5 -0
- package/lib/client.js +3 -3
- package/lib/p2-router-fs.js +28 -0
- package/lib/types/p2/router-fs.d.ts +17 -1
- package/package.json +37 -37
- package/src/p2/router-fs.ts +58 -0
package/README.en.md
CHANGED
|
@@ -37,9 +37,9 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
37
37
|
(From npm, recommended; installing straight from the repository also works:
|
|
38
38
|
`dsh plugin --profile web add github:xiray-xia/dsh-remote-vs`.)
|
|
39
39
|
|
|
40
|
-
Requires DSH `0.2.2-alpha.
|
|
41
|
-
baseline is `0.2.2-alpha.
|
|
42
|
-
|
|
40
|
+
**Requires DSH `0.2.2-alpha.3` or newer and below `0.3.0`** (`engines.dsh` enforces the range;
|
|
41
|
+
**the tested baseline is `0.2.2-alpha.3`**). On Host `0.2.2-alpha.2` use plugin `0.17.0` (or
|
|
42
|
+
upgrade DSH first); the `0.2.1-rc.2` generation needs `0.9.3`. `--profile web` selects which profile to install into —
|
|
43
43
|
this is a Web plugin, so it has to go into the profile your Web GUI runs from (`web` is
|
|
44
44
|
the common name; use your own profile's name). Desktop uses the reserved `desktop`
|
|
45
45
|
profile instead — see [Desktop](#desktop-dsh-desktop) below.
|
|
@@ -74,7 +74,7 @@ Install either way:
|
|
|
74
74
|
`desktop` is reserved for the Electron application: an **npm-installed `dsh` cannot manage
|
|
75
75
|
it** (it answers `profile "desktop" is managed exclusively by the Electron application`),
|
|
76
76
|
so one of the two routes above is required. The Desktop release version equals the DSH
|
|
77
|
-
runtime it bundles, and it must satisfy `engines.dsh` (`>=0.2.2-alpha.
|
|
77
|
+
runtime it bundles, and it must satisfy `engines.dsh` (`>=0.2.2-alpha.3`; check About);
|
|
78
78
|
older releases make the Plugins page refuse the install. Desktop opens no visible Web
|
|
79
79
|
port, but the plugin's HTTP routes and terminal socket are forwarded through Desktop's
|
|
80
80
|
Host (the terminal resolves its address from `__DSH_TRANSPORT__.streamBaseUrl`), so no
|
|
@@ -215,7 +215,7 @@ dsh_remote_vs/
|
|
|
215
215
|
├── vendor/dsh-remote-helpers/ # helper seeds (shipped, seeded into cache at startup, see below)
|
|
216
216
|
├── docs/ # local-only working docs (only docs/media/ screenshots ship)
|
|
217
217
|
│ ├── MAINTENANCE.md # local-only (.gitignore), not shipped: upgrade impact, checklist, pitfalls, release
|
|
218
|
-
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.
|
|
218
|
+
│ ├── VERSION-HISTORY.md # local-only: per-release change log (0.7.1 → 0.18.0)
|
|
219
219
|
│ └── GATES.md # local-only: local gate inventory and measured assertion counts
|
|
220
220
|
├── locale/ # bilingual plugin metadata
|
|
221
221
|
└── lib/ # build output (**must be committed**; only .map is ignored; restart after link install)
|
|
@@ -369,7 +369,7 @@ over helper RPC (fs) / ssh2 (processes), local stays untouched; both share one H
|
|
|
369
369
|
Upstream never published helper binaries (all Release assets are empty), so this plugin builds its own:
|
|
370
370
|
|
|
371
371
|
- Build machine: WSL2 Ubuntu-22.04 (glibc 2.35, matching the remote targets), Node v24.21.0 + pnpm 11.28.5
|
|
372
|
-
- Sources: the `dsh-v0.2.1-alpha.2` tag (the **build baseline**: what must match is the wire protocol version, not the Host version — our protocol is still **2**, so a Host upgrade to `0.2.2-alpha.
|
|
372
|
+
- Sources: the `dsh-v0.2.1-alpha.2` tag (the **build baseline**: what must match is the wire protocol version, not the Host version — our protocol is still **2**, so a Host upgrade to `0.2.2-alpha.3` needs no rebuild either: the plugin intentionally stays on `dsh-ssh@0.2.1-rc.2`, and the new generation's protocol 3 is deliberately not followed — see §2.26 of the maintenance notes)
|
|
373
373
|
- Command: stock script `pnpm exec tsx scripts/build-exe-for-ssh-helper.ts --target=node24-linux-x64`
|
|
374
374
|
- Only deviation: no docker for the manylinux 2.28 rebuild, so a `DSH_GLIBC_CEILING`
|
|
375
375
|
env override was added (default stays 2.28); this build targets 2.35 (see `glibc-ceiling.patch` in the cache dir)
|
package/README.md
CHANGED
|
@@ -34,8 +34,8 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
34
34
|
|
|
35
35
|
(从 npm 装,推荐;也可以直接跟仓库装:`dsh plugin --profile web add github:xiray-xia/dsh-remote-vs`。)
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
37
|
+
**需要 DSH `0.2.2-alpha.3` 及以上、`0.3.0` 以下**(`engines.dsh` 门到底;当前实测基线 `0.2.2-alpha.3`)。
|
|
38
|
+
Host 仍是 `0.2.2-alpha.2` 的请用插件 `0.17.0`(或先把 DSH 升到 `0.2.2-alpha.3`);`0.2.1-rc.2` 一代请用 `0.9.3`。
|
|
39
39
|
`--profile web` 指明装进哪个 profile —— 本插件是 Web 插件,
|
|
40
40
|
要装进 Web GUI 所用的那个(`web` 是常见命名,以你自己的 profile 名为准);
|
|
41
41
|
桌面端用的是保留 profile `desktop`,见下面「桌面端」。
|
|
@@ -63,7 +63,7 @@ dsh plugin --profile web add dsh-remote-vs
|
|
|
63
63
|
注意:`desktop` 是桌面端独占的保留 profile,**npm 全局安装的 `dsh` 不能管理它**
|
|
64
64
|
(会报 `profile "desktop" is managed exclusively by the Electron application`),
|
|
65
65
|
只能走上面两条路径。桌面端的版本号等于它捆绑的 DSH 运行时版本,同样要满足
|
|
66
|
-
`engines.dsh` 要求(`>=0.2.2-alpha.
|
|
66
|
+
`engines.dsh` 要求(`>=0.2.2-alpha.3`,关于面板可看);低于该版本时插件页会直接拒绝
|
|
67
67
|
安装。桌面端没有可见的 Web 端口,但本插件的 HTTP 路由与终端 socket 都经桌面端的
|
|
68
68
|
Host 转发(终端按 `__DSH_TRANSPORT__.streamBaseUrl` 解析地址),无需额外设置。
|
|
69
69
|
|
|
@@ -200,7 +200,7 @@ dsh_remote_vs/
|
|
|
200
200
|
├── vendor/dsh-remote-helpers/ # helper 种子(随包发布,启动铺缓存,见下)
|
|
201
201
|
├── docs/ # 本地工作文档(不推送 GitHub;只有 docs/media/ 的截图随仓库公开)
|
|
202
202
|
│ ├── MAINTENANCE.md # 本地私有(.gitignore,不入库):升级影响面/检查清单/踩坑/发布流程
|
|
203
|
-
│ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.
|
|
203
|
+
│ ├── VERSION-HISTORY.md # 本地私有:逐版本变更纪要(0.7.1 → 0.18.0)
|
|
204
204
|
│ └── GATES.md # 本地私有:本地门禁清单与实跑条数
|
|
205
205
|
├── locale/ # 插件元信息双语
|
|
206
206
|
└── lib/ # 构建产物(**必须入库**,只有 .map 忽略;link 安装后重启即生效)
|
|
@@ -329,7 +329,7 @@ helper RPC(fs)/ ssh2(进程),本地一切不变;两者同 Host、共
|
|
|
329
329
|
|
|
330
330
|
- 构建机:WSL2 Ubuntu-22.04(glibc 2.35,与目标远端一致),Node v24.21.0 + pnpm 11.28.5
|
|
331
331
|
- 源码:`dsh-v0.2.1-alpha.2` tag(**构建基线**:对齐的是 wire 协议号,不是 Host 版本号 —— 我们用到的
|
|
332
|
-
协议号仍是 **2**,Host 升到 `0.2.2-alpha.
|
|
332
|
+
协议号仍是 **2**,Host 升到 `0.2.2-alpha.3` 也不需要重编:插件自行停在 `dsh-ssh@0.2.1-rc.2`,
|
|
333
333
|
新 Host 那一代 `dsh-ssh` 的协议 3 我们故意不跟,差异见维护文档 §2.26)
|
|
334
334
|
- 命令:官方原脚本 `pnpm exec tsx scripts/build-exe-for-ssh-helper.ts --target=node24-linux-x64`
|
|
335
335
|
- 唯一偏离:无 docker 跑不了 manylinux 2.28 重编,加了 `DSH_GLIBC_CEILING`
|
package/cordis.patch.yml
CHANGED
|
@@ -111,6 +111,11 @@
|
|
|
111
111
|
name: '@deepseek-ai/dsh-tool-bash'
|
|
112
112
|
- id: tool-fs
|
|
113
113
|
name: '@deepseek-ai/dsh-tool-fs'
|
|
114
|
+
config:
|
|
115
|
+
# alpha.3 stock pins this explicitly; false is the alpha.3 default.
|
|
116
|
+
# Kept explicit so the remote mirror cannot silently grow apply_patch
|
|
117
|
+
# (its remote half is protocol-2 and has no patch/delete/move yet).
|
|
118
|
+
applyPatch: false
|
|
114
119
|
- id: tool-fs-search
|
|
115
120
|
name: '@deepseek-ai/dsh-tool-fs-search'
|
|
116
121
|
config:
|
package/lib/client.js
CHANGED
|
@@ -40807,7 +40807,7 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
40807
40807
|
const primary = host.querySelectorAll("[class*=\"rvs-ck-\"]").length;
|
|
40808
40808
|
const fallback = host.querySelectorAll("span[class^=\"rvs-t-\"]").length;
|
|
40809
40809
|
const count = primary > 0 ? primary : fallback;
|
|
40810
|
-
console.info(`[dsh-remote-vs] build 1103-
|
|
40810
|
+
console.info(`[dsh-remote-vs] build 1103-1842 · ${source} · colored tokens: ${count} (${propsRef.current.path})`);
|
|
40811
40811
|
propsRef.current.onTokens?.(count);
|
|
40812
40812
|
};
|
|
40813
40813
|
const armFallback = () => {
|
|
@@ -48031,8 +48031,8 @@ Integer Float Double Long Int32 Int64 Uint8 uint32_t int32_t uint64_t int64_t si
|
|
|
48031
48031
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(ConnectionStatusChip, { compact: true }),
|
|
48032
48032
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
48033
48033
|
className: "rvs-build",
|
|
48034
|
-
title: `dsh-remote-vs build 1103-
|
|
48035
|
-
children: "1103-
|
|
48034
|
+
title: `dsh-remote-vs build 1103-1842`,
|
|
48035
|
+
children: "1103-1842"
|
|
48036
48036
|
}),
|
|
48037
48037
|
tokenCount !== void 0 && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
48038
48038
|
className: "rvs-build",
|
package/lib/p2-router-fs.js
CHANGED
|
@@ -243,6 +243,34 @@ var TransparentFileSystem = class extends FileSystem {
|
|
|
243
243
|
const { fs, world } = await this.backendOf(target);
|
|
244
244
|
return fs.editText(target, edit, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
|
|
245
245
|
}
|
|
246
|
+
/**
|
|
247
|
+
* alpha.3 added patch/delete/move to the FileSystem contract for the
|
|
248
|
+
* apply_patch tool. Local providers implement all three; the deliberately
|
|
249
|
+
* pinned protocol-2 remote backend (dsh-fs-ssh 0.2.1-rc.2) predates them, so
|
|
250
|
+
* remote targets get a typed error instead of a TypeError. The apply_patch
|
|
251
|
+
* tool is off by default in every stock preset (alpha.3 dsh-base and presets
|
|
252
|
+
* pin `applyPatch: false`), so this only matters when it is enabled.
|
|
253
|
+
*/
|
|
254
|
+
unsupportedRemote(what) {
|
|
255
|
+
return new FsError(`${what} is not supported on remote workspaces yet (fs-ssh protocol 2); run it in a local workspace`, "FS_IO_ERROR");
|
|
256
|
+
}
|
|
257
|
+
async patchText(target, hunks, expected, signal, sandboxPolicy) {
|
|
258
|
+
const { fs, world } = await this.backendOf(target);
|
|
259
|
+
if (typeof fs.patchText !== "function") throw this.unsupportedRemote("apply_patch");
|
|
260
|
+
return fs.patchText(target, hunks, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
|
|
261
|
+
}
|
|
262
|
+
async deleteFile(target, expected, signal, sandboxPolicy) {
|
|
263
|
+
const { fs, world } = await this.backendOf(target);
|
|
264
|
+
if (typeof fs.deleteFile !== "function") throw this.unsupportedRemote("deleting files");
|
|
265
|
+
return fs.deleteFile(target, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
|
|
266
|
+
}
|
|
267
|
+
async moveFile(source, destination, options, signal, sandboxPolicy) {
|
|
268
|
+
const { fs, world } = await this.backendOf(source);
|
|
269
|
+
const destinationWorld = this.worlds.get(destination);
|
|
270
|
+
if (!(destinationWorld !== void 0 && destinationWorld.kind === world.kind && (world.kind === "local" || destinationWorld.kind === "remote" && destinationWorld.id === world.id))) throw new FsError("cannot move a file across local and remote worlds", "FS_IO_ERROR");
|
|
271
|
+
if (typeof fs.moveFile !== "function") throw this.unsupportedRemote("moving files");
|
|
272
|
+
return fs.moveFile(source, destination, options, signal, this.remote.rewritePolicy(sandboxPolicy, world));
|
|
273
|
+
}
|
|
246
274
|
async watch(target, changed, signal) {
|
|
247
275
|
const { fs } = await this.backendOf(target);
|
|
248
276
|
return fs.watch(target, changed, signal);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* extra fields); unknown targets fail closed.
|
|
6
6
|
*/
|
|
7
7
|
import { FileSystem } from '@deepseek-ai/dsh-fs';
|
|
8
|
-
import type { FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsPathInfo, FsTarget, FsVersion, FsWriteIntent, FsWriteOutcome } from '@deepseek-ai/dsh-fs';
|
|
8
|
+
import type { FsDeleteOutcome, FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsMoveOutcome, FsPathInfo, FsTarget, FsVersion, FsWriteIntent, FsWriteOutcome } from '@deepseek-ai/dsh-fs';
|
|
9
9
|
import type { SandboxExecutionPolicy, SandboxMode } from '@deepseek-ai/dsh-sandbox';
|
|
10
10
|
export default class TransparentFileSystem extends FileSystem {
|
|
11
11
|
static inject: string[];
|
|
@@ -88,5 +88,21 @@ export default class TransparentFileSystem extends FileSystem {
|
|
|
88
88
|
editText(target: FsTarget, edit: FsEditRequest, expected?: {
|
|
89
89
|
version: FsVersion;
|
|
90
90
|
}, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsEditOutcome>;
|
|
91
|
+
/**
|
|
92
|
+
* alpha.3 added patch/delete/move to the FileSystem contract for the
|
|
93
|
+
* apply_patch tool. Local providers implement all three; the deliberately
|
|
94
|
+
* pinned protocol-2 remote backend (dsh-fs-ssh 0.2.1-rc.2) predates them, so
|
|
95
|
+
* remote targets get a typed error instead of a TypeError. The apply_patch
|
|
96
|
+
* tool is off by default in every stock preset (alpha.3 dsh-base and presets
|
|
97
|
+
* pin `applyPatch: false`), so this only matters when it is enabled.
|
|
98
|
+
*/
|
|
99
|
+
private unsupportedRemote;
|
|
100
|
+
patchText(target: FsTarget, hunks: Parameters<FileSystem['patchText']>[1], expected?: {
|
|
101
|
+
version: FsVersion;
|
|
102
|
+
}, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsEditOutcome>;
|
|
103
|
+
deleteFile(target: FsTarget, expected?: {
|
|
104
|
+
version: FsVersion;
|
|
105
|
+
}, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsDeleteOutcome>;
|
|
106
|
+
moveFile(source: FsTarget, destination: FsTarget, options: Parameters<FileSystem['moveFile']>[2], signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsMoveOutcome>;
|
|
91
107
|
watch(target: FsTarget, changed: (error?: Error) => void, signal: AbortSignal): Promise<() => Promise<void>>;
|
|
92
108
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-remote-vs",
|
|
3
3
|
"description": "VSCode-style remote development for DSH: SSH host manager (key/password), helper deploy pipeline with version check, remote file explorer + editor + terminal in dsh-better-sidebar.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.18.0",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"dsh",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"./locale/*.json": "./locale/*.json"
|
|
60
60
|
},
|
|
61
61
|
"engines": {
|
|
62
|
-
"dsh": ">=0.2.2-alpha.
|
|
62
|
+
"dsh": ">=0.2.2-alpha.3 <0.3.0"
|
|
63
63
|
},
|
|
64
64
|
"dsh": {
|
|
65
65
|
"bundle": {
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
"@codemirror/view": "^6.43.14",
|
|
123
123
|
"@deepseek-ai/dsh-fs-ssh": "0.2.1-rc.2",
|
|
124
124
|
"@deepseek-ai/dsh-ssh": "0.2.1-rc.2",
|
|
125
|
-
"@deepseek-ai/schemastery": "3.18.6-alpha.
|
|
125
|
+
"@deepseek-ai/schemastery": "3.18.6-alpha.2",
|
|
126
126
|
"@lezer/highlight": "1.2.3",
|
|
127
127
|
"@xterm/addon-fit": "^0.11.0",
|
|
128
128
|
"@xterm/xterm": "^6.0.0",
|
|
@@ -130,44 +130,44 @@
|
|
|
130
130
|
"zod": "4.4.3"
|
|
131
131
|
},
|
|
132
132
|
"peerDependencies": {
|
|
133
|
-
"@deepseek-ai/cordis": "^4.0.6-alpha.
|
|
134
|
-
"@deepseek-ai/dsh-agent-preset": "^0.2.2-alpha.
|
|
135
|
-
"@deepseek-ai/dsh-bash-local": "^0.2.2-alpha.
|
|
136
|
-
"@deepseek-ai/dsh-file-reference": "^0.2.2-alpha.
|
|
137
|
-
"@deepseek-ai/dsh-fs": "^0.2.2-alpha.
|
|
138
|
-
"@deepseek-ai/dsh-shell": "^0.2.2-alpha.
|
|
139
|
-
"@deepseek-ai/dsh-spill": "^0.2.2-alpha.
|
|
140
|
-
"@deepseek-ai/dsh-subprocess": "^0.2.2-alpha.
|
|
141
|
-
"@deepseek-ai/dsh-tools": "^0.2.2-alpha.
|
|
133
|
+
"@deepseek-ai/cordis": "^4.0.6-alpha.2",
|
|
134
|
+
"@deepseek-ai/dsh-agent-preset": "^0.2.2-alpha.3",
|
|
135
|
+
"@deepseek-ai/dsh-bash-local": "^0.2.2-alpha.3",
|
|
136
|
+
"@deepseek-ai/dsh-file-reference": "^0.2.2-alpha.3",
|
|
137
|
+
"@deepseek-ai/dsh-fs": "^0.2.2-alpha.3",
|
|
138
|
+
"@deepseek-ai/dsh-shell": "^0.2.2-alpha.3",
|
|
139
|
+
"@deepseek-ai/dsh-spill": "^0.2.2-alpha.3",
|
|
140
|
+
"@deepseek-ai/dsh-subprocess": "^0.2.2-alpha.3",
|
|
141
|
+
"@deepseek-ai/dsh-tools": "^0.2.2-alpha.3",
|
|
142
142
|
"react": "^18.2.0",
|
|
143
143
|
"react-dom": "^18.2.0"
|
|
144
144
|
},
|
|
145
145
|
"devDependencies": {
|
|
146
|
-
"@deepseek-ai/cordis": "^4.0.6-alpha.
|
|
147
|
-
"@deepseek-ai/dsh-agent": "0.2.2-alpha.
|
|
148
|
-
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-alpha.
|
|
149
|
-
"@deepseek-ai/dsh-api-remotes": "0.2.2-alpha.
|
|
150
|
-
"@deepseek-ai/dsh-bash-local": "0.2.2-alpha.
|
|
151
|
-
"@deepseek-ai/dsh-client-locale": "0.2.2-alpha.
|
|
152
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-alpha.
|
|
153
|
-
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-alpha.
|
|
154
|
-
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-alpha.
|
|
155
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-alpha.
|
|
156
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-alpha.
|
|
157
|
-
"@deepseek-ai/dsh-file-reference": "0.2.2-alpha.
|
|
158
|
-
"@deepseek-ai/dsh-fs": "0.2.2-alpha.
|
|
159
|
-
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-alpha.
|
|
160
|
-
"@deepseek-ai/dsh-host-webserver": "0.2.2-alpha.
|
|
161
|
-
"@deepseek-ai/dsh-llm": "0.2.2-alpha.
|
|
162
|
-
"@deepseek-ai/dsh-sandbox": "0.2.2-alpha.
|
|
163
|
-
"@deepseek-ai/dsh-session": "0.2.2-alpha.
|
|
164
|
-
"@deepseek-ai/dsh-shell": "0.2.2-alpha.
|
|
165
|
-
"@deepseek-ai/dsh-spill": "0.2.2-alpha.
|
|
166
|
-
"@deepseek-ai/dsh-subprocess": "0.2.2-alpha.
|
|
167
|
-
"@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.
|
|
168
|
-
"@deepseek-ai/dsh-tools": "0.2.2-alpha.
|
|
169
|
-
"@deepseek-ai/dsh-working-directory": "0.2.2-alpha.
|
|
170
|
-
"@deepseek-ai/dsh-workspace": "0.2.2-alpha.
|
|
146
|
+
"@deepseek-ai/cordis": "^4.0.6-alpha.2",
|
|
147
|
+
"@deepseek-ai/dsh-agent": "0.2.2-alpha.3",
|
|
148
|
+
"@deepseek-ai/dsh-agent-preset-registry": "0.2.2-alpha.3",
|
|
149
|
+
"@deepseek-ai/dsh-api-remotes": "0.2.2-alpha.3",
|
|
150
|
+
"@deepseek-ai/dsh-bash-local": "0.2.2-alpha.3",
|
|
151
|
+
"@deepseek-ai/dsh-client-locale": "0.2.2-alpha.3",
|
|
152
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.2-alpha.3",
|
|
153
|
+
"@deepseek-ai/dsh-client-ui-settings": "0.2.2-alpha.3",
|
|
154
|
+
"@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-alpha.3",
|
|
155
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.2-alpha.3",
|
|
156
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.2-alpha.3",
|
|
157
|
+
"@deepseek-ai/dsh-file-reference": "0.2.2-alpha.3",
|
|
158
|
+
"@deepseek-ai/dsh-fs": "0.2.2-alpha.3",
|
|
159
|
+
"@deepseek-ai/dsh-host-directory-picker": "0.2.2-alpha.3",
|
|
160
|
+
"@deepseek-ai/dsh-host-webserver": "0.2.2-alpha.3",
|
|
161
|
+
"@deepseek-ai/dsh-llm": "0.2.2-alpha.3",
|
|
162
|
+
"@deepseek-ai/dsh-sandbox": "0.2.2-alpha.3",
|
|
163
|
+
"@deepseek-ai/dsh-session": "0.2.2-alpha.3",
|
|
164
|
+
"@deepseek-ai/dsh-shell": "0.2.2-alpha.3",
|
|
165
|
+
"@deepseek-ai/dsh-spill": "0.2.2-alpha.3",
|
|
166
|
+
"@deepseek-ai/dsh-subprocess": "0.2.2-alpha.3",
|
|
167
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.2-alpha.3",
|
|
168
|
+
"@deepseek-ai/dsh-tools": "0.2.2-alpha.3",
|
|
169
|
+
"@deepseek-ai/dsh-working-directory": "0.2.2-alpha.3",
|
|
170
|
+
"@deepseek-ai/dsh-workspace": "0.2.2-alpha.3",
|
|
171
171
|
"@types/node": "^22.20.0",
|
|
172
172
|
"@types/react": "~18.3.1",
|
|
173
173
|
"@types/react-dom": "^18.3.5",
|
package/src/p2/router-fs.ts
CHANGED
|
@@ -6,10 +6,12 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { FileSystem, FsError, type FsErrorCode } from '@deepseek-ai/dsh-fs'
|
|
8
8
|
import type {
|
|
9
|
+
FsDeleteOutcome,
|
|
9
10
|
FsDirEntry,
|
|
10
11
|
FsEditOutcome,
|
|
11
12
|
FsEditRequest,
|
|
12
13
|
FsInfo,
|
|
14
|
+
FsMoveOutcome,
|
|
13
15
|
FsPathInfo,
|
|
14
16
|
FsTarget,
|
|
15
17
|
FsVersion,
|
|
@@ -320,6 +322,62 @@ export default class TransparentFileSystem extends FileSystem {
|
|
|
320
322
|
return fs.editText(target, edit, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world))
|
|
321
323
|
}
|
|
322
324
|
|
|
325
|
+
/**
|
|
326
|
+
* alpha.3 added patch/delete/move to the FileSystem contract for the
|
|
327
|
+
* apply_patch tool. Local providers implement all three; the deliberately
|
|
328
|
+
* pinned protocol-2 remote backend (dsh-fs-ssh 0.2.1-rc.2) predates them, so
|
|
329
|
+
* remote targets get a typed error instead of a TypeError. The apply_patch
|
|
330
|
+
* tool is off by default in every stock preset (alpha.3 dsh-base and presets
|
|
331
|
+
* pin `applyPatch: false`), so this only matters when it is enabled.
|
|
332
|
+
*/
|
|
333
|
+
private unsupportedRemote(what: string): FsError {
|
|
334
|
+
return new FsError(
|
|
335
|
+
`${what} is not supported on remote workspaces yet (fs-ssh protocol 2); run it in a local workspace`,
|
|
336
|
+
'FS_IO_ERROR',
|
|
337
|
+
)
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
async patchText(
|
|
341
|
+
target: FsTarget,
|
|
342
|
+
hunks: Parameters<FileSystem['patchText']>[1],
|
|
343
|
+
expected?: { version: FsVersion },
|
|
344
|
+
signal?: AbortSignal,
|
|
345
|
+
sandboxPolicy?: SandboxExecutionPolicy,
|
|
346
|
+
): Promise<FsEditOutcome> {
|
|
347
|
+
const { fs, world } = await this.backendOf(target)
|
|
348
|
+
if (typeof fs.patchText !== 'function') throw this.unsupportedRemote('apply_patch')
|
|
349
|
+
return fs.patchText(target, hunks, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world))
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
async deleteFile(
|
|
353
|
+
target: FsTarget,
|
|
354
|
+
expected?: { version: FsVersion },
|
|
355
|
+
signal?: AbortSignal,
|
|
356
|
+
sandboxPolicy?: SandboxExecutionPolicy,
|
|
357
|
+
): Promise<FsDeleteOutcome> {
|
|
358
|
+
const { fs, world } = await this.backendOf(target)
|
|
359
|
+
if (typeof fs.deleteFile !== 'function') throw this.unsupportedRemote('deleting files')
|
|
360
|
+
return fs.deleteFile(target, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world))
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
async moveFile(
|
|
364
|
+
source: FsTarget,
|
|
365
|
+
destination: FsTarget,
|
|
366
|
+
options: Parameters<FileSystem['moveFile']>[2],
|
|
367
|
+
signal?: AbortSignal,
|
|
368
|
+
sandboxPolicy?: SandboxExecutionPolicy,
|
|
369
|
+
): Promise<FsMoveOutcome> {
|
|
370
|
+
const { fs, world } = await this.backendOf(source)
|
|
371
|
+
const destinationWorld = this.worlds.get(destination)
|
|
372
|
+
const sameWorld =
|
|
373
|
+
destinationWorld !== undefined &&
|
|
374
|
+
destinationWorld.kind === world.kind &&
|
|
375
|
+
(world.kind === 'local' || (destinationWorld.kind === 'remote' && destinationWorld.id === world.id))
|
|
376
|
+
if (!sameWorld) throw new FsError('cannot move a file across local and remote worlds', 'FS_IO_ERROR')
|
|
377
|
+
if (typeof fs.moveFile !== 'function') throw this.unsupportedRemote('moving files')
|
|
378
|
+
return fs.moveFile(source, destination, options, signal, this.remote.rewritePolicy(sandboxPolicy, world))
|
|
379
|
+
}
|
|
380
|
+
|
|
323
381
|
async watch(target: FsTarget, changed: (error?: Error) => void, signal: AbortSignal): Promise<() => Promise<void>> {
|
|
324
382
|
const { fs } = await this.backendOf(target)
|
|
325
383
|
return fs.watch(target, changed, signal)
|