@dsh-electron/dsh-plugin-multi-root-workspace 0.1.4 → 0.1.6
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.en.md +19 -2
- package/CHANGELOG.md +19 -2
- package/README.en.md +17 -13
- package/README.md +16 -14
- package/cordis.patch.yml +4 -0
- package/lib/client.js +320 -18
- package/lib/client.js.map +1 -1
- package/lib/{command-DyOWujPo.js → command-CTdNvwt1.js} +107 -6
- package/lib/command.js +1 -1
- package/lib/{compat-PNEKXGa6.js → compat-B6ZqbQBy.js} +23 -3
- package/lib/compat.js +1 -1
- package/lib/index.js +5 -5
- package/lib/{instructions-Cn1Jj5Xi.js → instructions-DfzN-wVf.js} +106 -26
- package/lib/instructions.js +1 -1
- package/lib/lsp.js +38 -0
- package/lib/method-wrapper-Zc-JlDP3.js +51 -0
- package/lib/sandbox-BRXl_FpF.js +132 -0
- package/lib/sandbox.js +1 -1
- package/lib/scope.js +12 -6
- package/lib/session-directory-BLOstut1.js +9 -0
- package/lib/tool-context-CpgIFcCB.js +6 -0
- package/lib/types/client/RootFileTree.d.ts +12 -0
- package/lib/types/client/WorkspaceFoldersAction.d.ts +3 -0
- package/lib/types/client/index.d.ts +13 -2
- package/lib/types/client/locales.d.ts +14 -0
- package/lib/types/client/styles.d.ts +1 -1
- package/lib/types/compat/client-icons.d.ts +1 -1
- package/lib/types/compat/client-session.d.ts +2 -0
- package/lib/types/compat/dsh-version.d.ts +5 -3
- package/lib/types/compat/instruction-overlap.d.ts +7 -0
- package/lib/types/compat/session-directory.d.ts +4 -0
- package/lib/types/compat/tool-context.d.ts +9 -0
- package/lib/types/compat/tool-result.d.ts +1 -1
- package/lib/types/compat/workspace-files.d.ts +5 -0
- package/lib/types/contract.d.ts +24 -5
- package/lib/types/index.d.ts +2 -2
- package/lib/types/lsp.d.ts +4 -0
- package/lib/types/method-wrapper.d.ts +2 -0
- package/lib/types/panel-files.d.ts +3 -0
- package/lib/types/sandbox.d.ts +2 -11
- package/lib/types/scope.d.ts +3 -0
- package/lib/types/windows-profile.d.ts +13 -0
- package/lib/types/windows-runner.d.ts +1 -0
- package/lib/types/workspace-files.d.ts +4 -0
- package/lib/types/workspace-routing.d.ts +11 -0
- package/lib/{sandbox-D8Fw95FM.js → windows-profile-CiFsFYIV.js} +64 -138
- package/lib/windows-runner.js +68 -0
- package/lib/workspace-files.js +68 -0
- package/package.json +90 -47
|
@@ -1,27 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
/** Whether a value is a thenable, i.e. whether the installed `confine` is async. */
|
|
5
|
-
function isThenable(value) {
|
|
6
|
-
return typeof value?.then === "function";
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Call the upstream `confine` and widen its result, preserving sync/async shape.
|
|
10
|
-
*
|
|
11
|
-
* @param base - the upstream `confine`, already bound to its provider.
|
|
12
|
-
* @param widen - the pure transformation to apply to the upstream result. It
|
|
13
|
-
* runs exactly once per call, on whichever release; it may throw, and the
|
|
14
|
-
* throw surfaces synchronously or as a rejection to match the base shape.
|
|
15
|
-
* @param argv - the caller's argv, forwarded verbatim.
|
|
16
|
-
* @param policy - the per-call policy, forwarded verbatim.
|
|
17
|
-
* @param signal - forwarded when the installed release accepts it.
|
|
18
|
-
* @returns the widened result, in the shape the installed release uses.
|
|
19
|
-
*/
|
|
20
|
-
function widenConfined(base, widen, argv, policy, signal) {
|
|
21
|
-
const confined = base(argv, policy, signal);
|
|
22
|
-
return isThenable(confined) ? confined.then(widen) : widen(confined);
|
|
23
|
-
}
|
|
24
|
-
//#endregion
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { canonicalPath } from "@deepseek-ai/dsh-sandbox";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
25
4
|
//#region src/dialects.ts
|
|
26
5
|
/**
|
|
27
6
|
* Raised when a confined argv cannot be recognized or widened. The provider
|
|
@@ -100,7 +79,7 @@ function widenProfileArgs(dialect, profileArgs, policy, additionalRoots) {
|
|
|
100
79
|
case "seatbelt": return widenSeatbelt(profileArgs, additionalRoots);
|
|
101
80
|
case "bwrap": return widenBwrap(profileArgs, policy.workspaceRoot, additionalRoots);
|
|
102
81
|
case "landlock": return widenLandlock(profileArgs, policy.workspaceRoot, additionalRoots);
|
|
103
|
-
case "windows-acl":
|
|
82
|
+
case "windows-acl": throw new DialectUnrecognizedError("Windows ACL widening requires widenWindowsProfile");
|
|
104
83
|
}
|
|
105
84
|
}
|
|
106
85
|
/** Quote one path exactly the way the upstream Seatbelt profile builder does. */
|
|
@@ -172,119 +151,66 @@ function widenLandlock(profileArgs, workspaceRoot, additionalRoots) {
|
|
|
172
151
|
return [...profileArgs, ...added];
|
|
173
152
|
}
|
|
174
153
|
//#endregion
|
|
175
|
-
//#region src/
|
|
176
|
-
/**
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
* `ctx.sandbox`; the runner chain, probing, denial dialects, and Windows ACL
|
|
207
|
-
* grant mechanics stay the upstream implementation's.
|
|
208
|
-
*/
|
|
209
|
-
var MultiRootSandboxProvider = class extends LocalSandboxProvider {
|
|
210
|
-
static inject = [
|
|
211
|
-
"multiRootCompat",
|
|
212
|
-
"sandboxPolicy",
|
|
213
|
-
"multiRootScope"
|
|
214
|
-
];
|
|
215
|
-
/** Whether the Windows ACL limitation has already been reported (once per provider). */
|
|
216
|
-
warnedAboutWindowsAcl = false;
|
|
217
|
-
/**
|
|
218
|
-
* Wrap `argv` so it executes confined under `policy` on this host, granting
|
|
219
|
-
* the scope's additional roots inside the SAME dialect profile.
|
|
220
|
-
*
|
|
221
|
-
* Under `read-only` nothing is added (the mode denies every write, additional
|
|
222
|
-
* roots included), and `danger-full-access` never reaches here at all: the
|
|
223
|
-
* bash executor and the PTY backend both hand their argv straight to the local
|
|
224
|
-
* runtime in that mode. Widening therefore only ever ADDS the scope's
|
|
225
|
-
* additional roots to an upstream `workspace-write` profile.
|
|
226
|
-
*
|
|
227
|
-
* The return shape is the INSTALLED upstream provider's: synchronous on a
|
|
228
|
-
* release with a synchronous `confine`, a promise on a release with an
|
|
229
|
-
* asynchronous one. `widenConfined` preserves whichever it is — see
|
|
230
|
-
* `./compat/sandbox-confine.ts`.
|
|
231
|
-
* @param argv - the exact argv the caller is about to spawn.
|
|
232
|
-
* @param policy - the file-effect policy this execution runs under.
|
|
233
|
-
* @param signal - cancellation, forwarded to releases that accept it.
|
|
234
|
-
* @returns the argv to spawn instead, plus the selected backend's facts.
|
|
235
|
-
*/
|
|
236
|
-
confine(argv, policy, signal) {
|
|
237
|
-
const base = super.confine;
|
|
238
|
-
return widenConfined(base.bind(this), (confined) => this.widenForScope(confined, argv, policy), argv, policy, signal);
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Graft the scope's additional roots onto one upstream `confine` result.
|
|
242
|
-
*
|
|
243
|
-
* Pure with respect to the upstream call: it only ever reads the scope and
|
|
244
|
-
* rewrites `argv`. `enforcement`, `denialSignatures` and `runnerFailureRules`
|
|
245
|
-
* are passed through untouched, because the bash executor derives its denial
|
|
246
|
-
* and enforcement reporting from them.
|
|
247
|
-
* @param confined - the upstream result for this call.
|
|
248
|
-
* @param argv - the caller's argv, needed to re-split the wrapped form.
|
|
249
|
-
* @param policy - the per-call policy.
|
|
250
|
-
* @returns the upstream result element for element, or one with a widened argv.
|
|
251
|
-
*/
|
|
252
|
-
widenForScope(confined, argv, policy) {
|
|
253
|
-
if (policy.mode !== "workspace-write") return confined;
|
|
254
|
-
const scope = this.ctx.multiRootScope.resolve(policy);
|
|
255
|
-
if (scope.additionalRoots.length === 0) return confined;
|
|
256
|
-
try {
|
|
257
|
-
const shape = splitConfined(confined.argv, argv);
|
|
258
|
-
if (shape.dialect === "windows-acl") {
|
|
259
|
-
this.warnAboutWindowsAcl(scope.additionalRoots.length);
|
|
260
|
-
return confined;
|
|
261
|
-
}
|
|
262
|
-
const profileArgs = widenProfileArgs(shape.dialect, shape.profileArgs, policy, scope.additionalRoots);
|
|
263
|
-
return {
|
|
264
|
-
...confined,
|
|
265
|
-
argv: [
|
|
266
|
-
...profileArgs,
|
|
267
|
-
"--",
|
|
268
|
-
...argv
|
|
269
|
-
]
|
|
270
|
-
};
|
|
271
|
-
} catch (error) {
|
|
272
|
-
if (!(error instanceof DialectUnrecognizedError)) throw error;
|
|
273
|
-
throw new SandboxUnavailableError(policy.mode, `multi-root workspace: cannot grant the additional workspace roots [${scope.additionalRoots.join(", ")}] under the primary root ${scope.primaryRoot} — ${error.message}`);
|
|
154
|
+
//#region src/windows-profile.ts
|
|
155
|
+
/** Windows runner argv and capability identity. No Win32 calls at module load. */
|
|
156
|
+
/** A root-set capability: removing or adding a root changes the token's identity. */
|
|
157
|
+
function workspaceScopeSid(roots) {
|
|
158
|
+
const paths = [...new Set(roots.map((root) => root.toLowerCase()))].sort();
|
|
159
|
+
const hash = createHash("sha256").update("dsh-multi-root-workspace\0").update(JSON.stringify(paths)).digest();
|
|
160
|
+
return `S-1-4-${[
|
|
161
|
+
0,
|
|
162
|
+
4,
|
|
163
|
+
8,
|
|
164
|
+
12
|
|
165
|
+
].map((offset) => hash.readUInt32LE(offset) % (2 ** 30 - 1) + 1).join("-")}-2`;
|
|
166
|
+
}
|
|
167
|
+
/** Strictly recognize the upstream public runner contract, failing closed on new flags. */
|
|
168
|
+
function parseWindowsProfile(args, allowAdditional = false) {
|
|
169
|
+
const fields = /* @__PURE__ */ new Map();
|
|
170
|
+
const additionalRoots = [];
|
|
171
|
+
const known = /* @__PURE__ */ new Set([
|
|
172
|
+
"--workspace",
|
|
173
|
+
"--temp",
|
|
174
|
+
"--mode",
|
|
175
|
+
"--write-sid",
|
|
176
|
+
"--temp-write-sid"
|
|
177
|
+
]);
|
|
178
|
+
for (let index = 0; index < args.length; index += 2) {
|
|
179
|
+
const key = args[index];
|
|
180
|
+
const value = args[index + 1];
|
|
181
|
+
if (key === void 0 || value === void 0 || value === "") throw new DialectUnrecognizedError("Windows ACL profile has a missing value");
|
|
182
|
+
if (allowAdditional && key === "--additional-root") {
|
|
183
|
+
additionalRoots.push(value);
|
|
184
|
+
continue;
|
|
274
185
|
}
|
|
186
|
+
if (!known.has(key) || fields.has(key)) throw new DialectUnrecognizedError(`Windows ACL profile has unknown or duplicate flag ${key}`);
|
|
187
|
+
fields.set(key, value);
|
|
275
188
|
}
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
}
|
|
189
|
+
const workspace = fields.get("--workspace");
|
|
190
|
+
const temp = fields.get("--temp");
|
|
191
|
+
if (workspace === void 0 || temp === void 0 || fields.get("--mode") !== "workspace-write") throw new DialectUnrecognizedError("Windows multi-root requires --workspace, --temp and --mode workspace-write");
|
|
192
|
+
const writeSid = fields.get("--write-sid");
|
|
193
|
+
const tempWriteSid = fields.get("--temp-write-sid");
|
|
194
|
+
if (writeSid === void 0 !== (tempWriteSid === void 0)) throw new DialectUnrecognizedError("Windows ACL profile requires both capability SIDs or neither");
|
|
195
|
+
return {
|
|
196
|
+
workspace,
|
|
197
|
+
temp,
|
|
198
|
+
mode: "workspace-write",
|
|
199
|
+
additionalRoots,
|
|
200
|
+
...writeSid === void 0 ? {} : { writeSid },
|
|
201
|
+
...tempWriteSid === void 0 ? {} : { tempWriteSid }
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
function widenWindowsProfile(profile, roots, primaryRoot) {
|
|
205
|
+
if (profile.length < 2 || profile[0] === void 0 || profile[1]?.startsWith("--")) throw new DialectUnrecognizedError("Windows ACL runner invocation is not [node, runner, ...flags]");
|
|
206
|
+
const parsed = parseWindowsProfile(profile.slice(2));
|
|
207
|
+
if (primaryRoot !== void 0 && canonicalPath(parsed.workspace) !== primaryRoot) throw new DialectUnrecognizedError("Windows ACL profile workspace does not match the policy root");
|
|
208
|
+
return [
|
|
209
|
+
profile[0],
|
|
210
|
+
fileURLToPath(new URL("./windows-runner.js", import.meta.url)),
|
|
211
|
+
...profile.slice(2),
|
|
212
|
+
...roots.flatMap((root) => ["--additional-root", root])
|
|
213
|
+
];
|
|
214
|
+
}
|
|
289
215
|
//#endregion
|
|
290
|
-
export {
|
|
216
|
+
export { splitConfined as a, DialectUnrecognizedError as i, widenWindowsProfile as n, widenProfileArgs as o, workspaceScopeSid as r, parseWindowsProfile as t };
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { r as workspaceScopeSid, t as parseWindowsProfile } from "./windows-profile-CiFsFYIV.js";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { canonicalPath } from "@deepseek-ai/dsh-sandbox";
|
|
4
|
+
import { closeSync, mkdtempSync, rmSync, statSync } from "node:fs";
|
|
5
|
+
//#region src/windows-runner.ts
|
|
6
|
+
/** Standalone runner: public upstream AclSandbox with a capability for the whole root set. */
|
|
7
|
+
async function main() {
|
|
8
|
+
if (process.platform !== "win32") throw new Error("Windows ACL runner requires Windows");
|
|
9
|
+
const raw = process.argv.slice(2);
|
|
10
|
+
const separator = raw.indexOf("--");
|
|
11
|
+
if (separator < 0 || raw[separator + 1] === void 0) throw new Error("missing command after --");
|
|
12
|
+
const profile = parseWindowsProfile(raw.slice(0, separator), true);
|
|
13
|
+
const roots = [.../* @__PURE__ */ new Set([profile.workspace, ...profile.additionalRoots])];
|
|
14
|
+
for (const root of roots) if (!statSync(root).isDirectory() || canonicalPath(root) !== root) throw new Error(`workspace root was removed or redirected: ${root}`);
|
|
15
|
+
const { AclSandbox, assertTempRootOutsideWorkspace, workspaceWriteSid, tempWriteSid } = await import("@deepseek-ai/dsh-sandbox-windows-acl");
|
|
16
|
+
if (profile.writeSid !== void 0 && (profile.writeSid !== workspaceWriteSid(profile.workspace) || profile.tempWriteSid !== tempWriteSid(profile.temp))) throw new Error("upstream capability SIDs do not match their paths");
|
|
17
|
+
for (const root of roots) assertTempRootOutsideWorkspace(root, profile.temp);
|
|
18
|
+
const temp = mkdtempSync(join(profile.temp, "dsh-multi-root-"));
|
|
19
|
+
const sandbox = new AclSandbox({
|
|
20
|
+
writableDirs: roots,
|
|
21
|
+
tempDir: temp,
|
|
22
|
+
writeSid: workspaceScopeSid(roots),
|
|
23
|
+
tempWriteSid: tempWriteSid(temp),
|
|
24
|
+
mode: "workspace-write"
|
|
25
|
+
});
|
|
26
|
+
let initialized = false;
|
|
27
|
+
try {
|
|
28
|
+
await sandbox.init();
|
|
29
|
+
initialized = true;
|
|
30
|
+
process.env.TMP = temp;
|
|
31
|
+
process.env.TEMP = temp;
|
|
32
|
+
process.on("SIGINT", () => {});
|
|
33
|
+
const control = process.env.DSH_SUBPROCESS_CONTROL === "pipe";
|
|
34
|
+
const child = sandbox.spawn({
|
|
35
|
+
command: raw[separator + 1],
|
|
36
|
+
args: raw.slice(separator + 2),
|
|
37
|
+
stdio: "inherit",
|
|
38
|
+
...control ? { controlFileDescriptor: 7 } : {}
|
|
39
|
+
});
|
|
40
|
+
if (control) closeSync(7);
|
|
41
|
+
return (await child.wait()).exitCode;
|
|
42
|
+
} finally {
|
|
43
|
+
try {
|
|
44
|
+
if (initialized) sandbox.dispose();
|
|
45
|
+
} catch (error) {
|
|
46
|
+
reportCleanup(error);
|
|
47
|
+
}
|
|
48
|
+
try {
|
|
49
|
+
rmSync(temp, {
|
|
50
|
+
recursive: true,
|
|
51
|
+
force: true
|
|
52
|
+
});
|
|
53
|
+
} catch (error) {
|
|
54
|
+
reportCleanup(error);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
function reportCleanup(error) {
|
|
59
|
+
process.stderr.write(`windows-acl-run: cleanup: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
60
|
+
}
|
|
61
|
+
main().then((code) => {
|
|
62
|
+
process.exitCode = code;
|
|
63
|
+
}, (error) => {
|
|
64
|
+
process.stderr.write(`windows-acl-run: ${error instanceof Error ? error.message : String(error)}\n`);
|
|
65
|
+
process.exitCode = 127;
|
|
66
|
+
});
|
|
67
|
+
//#endregion
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { n as routeWorkspacePath, t as wrapMethod } from "./method-wrapper-Zc-JlDP3.js";
|
|
2
|
+
//#region src/compat/workspace-files.ts
|
|
3
|
+
function adaptPathWatch(service, wrap) {
|
|
4
|
+
return wrapMethod(service, "changes", (original) => original.length < 3 ? original : wrap(original));
|
|
5
|
+
}
|
|
6
|
+
//#endregion
|
|
7
|
+
//#region src/workspace-files.ts
|
|
8
|
+
const inject = ["multiRootCompat", "multiRootScope"];
|
|
9
|
+
function apply(ctx) {
|
|
10
|
+
ctx.inject(["workspaceFiles", "fs"], (scope) => {
|
|
11
|
+
const service = scope.get("workspaceFiles");
|
|
12
|
+
scope.effect(() => {
|
|
13
|
+
const rowLifetime = new AbortController();
|
|
14
|
+
const restoreList = wrapMethod(service, "list", (original) => async function(request, path, signal) {
|
|
15
|
+
if (scope.multiRootScope.scopeOf(request.workspaceRoot).length === 0) return original.call(this, request, path, signal);
|
|
16
|
+
const route = await routeWorkspacePath(scope, request.workspaceRoot, path, signal);
|
|
17
|
+
if (route === void 0 || route.workspaceRoot === route.primaryRoot) return original.call(this, request, path, signal);
|
|
18
|
+
const result = await original.call(this, {
|
|
19
|
+
...request,
|
|
20
|
+
workspaceRoot: route.workspaceRoot
|
|
21
|
+
}, route.absolutePath, signal);
|
|
22
|
+
if (!scope.multiRootScope.scopeOf(route.primaryRoot).includes(route.workspaceRoot)) throw await outside(path);
|
|
23
|
+
return result;
|
|
24
|
+
});
|
|
25
|
+
const restoreWatch = adaptPathWatch(service, (originalChanges) => async function* (request, path, signal) {
|
|
26
|
+
if (scope.multiRootScope.scopeOf(request.workspaceRoot).length === 0) {
|
|
27
|
+
yield* originalChanges.call(this, request, path, signal);
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
const route = await routeWorkspacePath(scope, request.workspaceRoot, path, signal);
|
|
31
|
+
if (route === void 0 || route.workspaceRoot === route.primaryRoot) {
|
|
32
|
+
yield* originalChanges.call(this, request, path, signal);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
const lifetime = new AbortController();
|
|
36
|
+
const unsubscribe = scope.multiRootScope.subscribe(() => {
|
|
37
|
+
if (!scope.multiRootScope.scopeOf(route.primaryRoot).includes(route.workspaceRoot)) lifetime.abort(/* @__PURE__ */ new Error("the additional root was revoked"));
|
|
38
|
+
});
|
|
39
|
+
try {
|
|
40
|
+
for await (const frame of originalChanges.call(this, {
|
|
41
|
+
...request,
|
|
42
|
+
workspaceRoot: route.workspaceRoot
|
|
43
|
+
}, route.absolutePath, AbortSignal.any([
|
|
44
|
+
signal,
|
|
45
|
+
lifetime.signal,
|
|
46
|
+
rowLifetime.signal
|
|
47
|
+
]))) {
|
|
48
|
+
if (!scope.multiRootScope.scopeOf(route.primaryRoot).includes(route.workspaceRoot)) throw await outside(path);
|
|
49
|
+
yield frame;
|
|
50
|
+
}
|
|
51
|
+
} finally {
|
|
52
|
+
unsubscribe();
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
return () => {
|
|
56
|
+
rowLifetime.abort(/* @__PURE__ */ new Error("multi-root workspace-files routing unloaded"));
|
|
57
|
+
restoreList();
|
|
58
|
+
restoreWatch();
|
|
59
|
+
};
|
|
60
|
+
}, "multi-root:workspace-files routing");
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
async function outside(path) {
|
|
64
|
+
const { RemoteError } = await import("@deepseek-ai/dsh-typert-protocol");
|
|
65
|
+
return new RemoteError("workspace-file/outside-workspace", `"${path}" is no longer in this workspace`, { path });
|
|
66
|
+
}
|
|
67
|
+
//#endregion
|
|
68
|
+
export { apply, inject };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dsh-electron/dsh-plugin-multi-root-workspace",
|
|
3
3
|
"description": "Multi-root Workspace for DeepSeek Harness: adds N additional roots to the workspace sandbox scope as an out-of-tree bundle",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.6",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
7
7
|
"types": "lib/types/index.d.ts",
|
|
@@ -42,7 +42,19 @@
|
|
|
42
42
|
"types": "./lib/types/client/index.d.ts",
|
|
43
43
|
"default": "./lib/client.js"
|
|
44
44
|
},
|
|
45
|
-
"./package.json": "./package.json"
|
|
45
|
+
"./package.json": "./package.json",
|
|
46
|
+
"./lsp": {
|
|
47
|
+
"types": "./lib/types/lsp.d.ts",
|
|
48
|
+
"default": "./lib/lsp.js"
|
|
49
|
+
},
|
|
50
|
+
"./workspace-files": {
|
|
51
|
+
"types": "./lib/types/workspace-files.d.ts",
|
|
52
|
+
"default": "./lib/workspace-files.js"
|
|
53
|
+
},
|
|
54
|
+
"./windows-runner": {
|
|
55
|
+
"types": "./lib/types/windows-runner.d.ts",
|
|
56
|
+
"default": "./lib/windows-runner.js"
|
|
57
|
+
}
|
|
46
58
|
},
|
|
47
59
|
"files": [
|
|
48
60
|
"lib/*.js",
|
|
@@ -67,21 +79,27 @@
|
|
|
67
79
|
},
|
|
68
80
|
"license": "MIT",
|
|
69
81
|
"peerDependencies": {
|
|
70
|
-
"@deepseek-ai/cordis": ">=4.0.1 <5.0.0",
|
|
71
|
-
"@deepseek-ai/dsh-agent": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
72
|
-
"@deepseek-ai/dsh-agent-instructions": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
73
|
-
"@deepseek-ai/dsh-client-connection": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
74
|
-
"@deepseek-ai/dsh-commands": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
75
|
-
"@deepseek-ai/dsh-fs": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
76
|
-
"@deepseek-ai/dsh-fs-local": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
77
|
-
"@deepseek-ai/dsh-llm": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
78
|
-
"@deepseek-ai/dsh-sandbox": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
79
|
-
"@deepseek-ai/dsh-sandbox-local": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
80
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
81
|
-
"@deepseek-ai/dsh-session": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
82
|
-
"@deepseek-ai/dsh-storage-domain": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
83
|
-
"@deepseek-ai/dsh-subprocess": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2",
|
|
84
|
-
"@deepseek-ai/dsh-system-prompt": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2"
|
|
82
|
+
"@deepseek-ai/cordis": ">=4.0.1 <5.0.0 || 4.0.5-alpha.1",
|
|
83
|
+
"@deepseek-ai/dsh-agent": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
84
|
+
"@deepseek-ai/dsh-agent-instructions": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
85
|
+
"@deepseek-ai/dsh-client-connection": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
86
|
+
"@deepseek-ai/dsh-commands": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
87
|
+
"@deepseek-ai/dsh-fs": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
88
|
+
"@deepseek-ai/dsh-fs-local": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
89
|
+
"@deepseek-ai/dsh-llm": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
90
|
+
"@deepseek-ai/dsh-sandbox": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
91
|
+
"@deepseek-ai/dsh-sandbox-local": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
92
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
93
|
+
"@deepseek-ai/dsh-session": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
94
|
+
"@deepseek-ai/dsh-storage-domain": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
95
|
+
"@deepseek-ai/dsh-subprocess": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
96
|
+
"@deepseek-ai/dsh-system-prompt": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
97
|
+
"@deepseek-ai/dsh-lsp": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
98
|
+
"@deepseek-ai/dsh-lsp-stdio": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
99
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
100
|
+
"@deepseek-ai/dsh-typert-protocol": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
101
|
+
"@deepseek-ai/dsh-sandbox-windows-acl": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2",
|
|
102
|
+
"@deepseek-ai/dsh-tools": "0.1.5-rc.2 || 0.1.6-alpha.1 || 0.1.6-alpha.2 || 0.1.7-alpha.1 || 0.1.7-alpha.2 || 0.1.7-rc.1 || 0.1.7-rc.2 || 0.2.0-rc.1 || 0.2.0-rc.2 || 0.2.1-alpha.1 || 0.2.1-alpha.2"
|
|
85
103
|
},
|
|
86
104
|
"peerDependenciesMeta": {
|
|
87
105
|
"@deepseek-ai/dsh-agent": {
|
|
@@ -107,38 +125,56 @@
|
|
|
107
125
|
},
|
|
108
126
|
"@deepseek-ai/dsh-system-prompt": {
|
|
109
127
|
"optional": true
|
|
128
|
+
},
|
|
129
|
+
"@deepseek-ai/dsh-lsp": {
|
|
130
|
+
"optional": true
|
|
131
|
+
},
|
|
132
|
+
"@deepseek-ai/dsh-lsp-stdio": {
|
|
133
|
+
"optional": true
|
|
134
|
+
},
|
|
135
|
+
"@deepseek-ai/dsh-api-workspace-files": {
|
|
136
|
+
"optional": true
|
|
137
|
+
},
|
|
138
|
+
"@deepseek-ai/dsh-typert-protocol": {
|
|
139
|
+
"optional": true
|
|
140
|
+
},
|
|
141
|
+
"@deepseek-ai/dsh-sandbox-windows-acl": {
|
|
142
|
+
"optional": true
|
|
143
|
+
},
|
|
144
|
+
"@deepseek-ai/dsh-tools": {
|
|
145
|
+
"optional": true
|
|
110
146
|
}
|
|
111
147
|
},
|
|
112
148
|
"devDependencies": {
|
|
113
|
-
"@deepseek-ai/cordis": "4.0.
|
|
114
|
-
"@deepseek-ai/dsh": "0.1
|
|
115
|
-
"@deepseek-ai/dsh-agent": "0.1
|
|
116
|
-
"@deepseek-ai/dsh-agent-instructions": "0.1
|
|
117
|
-
"@deepseek-ai/dsh-app-boot": "0.1
|
|
118
|
-
"@deepseek-ai/dsh-base": "0.1
|
|
119
|
-
"@deepseek-ai/dsh-client-connection": "0.1
|
|
120
|
-
"@deepseek-ai/dsh-client-locale": "0.1
|
|
121
|
-
"@deepseek-ai/dsh-client-ui-primitives": "0.1
|
|
122
|
-
"@deepseek-ai/dsh-client-ui-renderer": "0.1
|
|
123
|
-
"@deepseek-ai/dsh-client-ui-sidebar": "0.1
|
|
124
|
-
"@deepseek-ai/dsh-client-ui-slots": "0.1
|
|
125
|
-
"@deepseek-ai/dsh-client-ui-workspace": "0.1
|
|
126
|
-
"@deepseek-ai/dsh-commands": "0.1
|
|
127
|
-
"@deepseek-ai/dsh-fs": "0.1
|
|
128
|
-
"@deepseek-ai/dsh-fs-local": "0.1
|
|
129
|
-
"@deepseek-ai/dsh-fs-sandbox": "0.1
|
|
130
|
-
"@deepseek-ai/dsh-llm": "0.1
|
|
131
|
-
"@deepseek-ai/dsh-sandbox": "0.1
|
|
132
|
-
"@deepseek-ai/dsh-sandbox-local": "0.1
|
|
133
|
-
"@deepseek-ai/dsh-sandbox-policy": "0.1
|
|
134
|
-
"@deepseek-ai/dsh-session": "0.1
|
|
135
|
-
"@deepseek-ai/dsh-session-projection": "0.1
|
|
136
|
-
"@deepseek-ai/dsh-storage": "0.1
|
|
137
|
-
"@deepseek-ai/dsh-storage-domain": "0.1
|
|
138
|
-
"@deepseek-ai/dsh-storage-json": "0.1
|
|
139
|
-
"@deepseek-ai/dsh-subprocess": "0.1
|
|
140
|
-
"@deepseek-ai/dsh-system-prompt": "0.1
|
|
141
|
-
"@deepseek-ai/dsh-workspace": "0.1
|
|
149
|
+
"@deepseek-ai/cordis": "4.0.5-alpha.1",
|
|
150
|
+
"@deepseek-ai/dsh": "0.2.1-alpha.2",
|
|
151
|
+
"@deepseek-ai/dsh-agent": "0.2.1-alpha.2",
|
|
152
|
+
"@deepseek-ai/dsh-agent-instructions": "0.2.1-alpha.2",
|
|
153
|
+
"@deepseek-ai/dsh-app-boot": "0.2.1-alpha.2",
|
|
154
|
+
"@deepseek-ai/dsh-base": "0.2.1-alpha.2",
|
|
155
|
+
"@deepseek-ai/dsh-client-connection": "0.2.1-alpha.2",
|
|
156
|
+
"@deepseek-ai/dsh-client-locale": "0.2.1-alpha.2",
|
|
157
|
+
"@deepseek-ai/dsh-client-ui-primitives": "0.2.1-alpha.2",
|
|
158
|
+
"@deepseek-ai/dsh-client-ui-renderer": "0.2.1-alpha.2",
|
|
159
|
+
"@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-alpha.2",
|
|
160
|
+
"@deepseek-ai/dsh-client-ui-slots": "0.2.1-alpha.2",
|
|
161
|
+
"@deepseek-ai/dsh-client-ui-workspace": "0.2.1-alpha.2",
|
|
162
|
+
"@deepseek-ai/dsh-commands": "0.2.1-alpha.2",
|
|
163
|
+
"@deepseek-ai/dsh-fs": "0.2.1-alpha.2",
|
|
164
|
+
"@deepseek-ai/dsh-fs-local": "0.2.1-alpha.2",
|
|
165
|
+
"@deepseek-ai/dsh-fs-sandbox": "0.2.1-alpha.2",
|
|
166
|
+
"@deepseek-ai/dsh-llm": "0.2.1-alpha.2",
|
|
167
|
+
"@deepseek-ai/dsh-sandbox": "0.2.1-alpha.2",
|
|
168
|
+
"@deepseek-ai/dsh-sandbox-local": "0.2.1-alpha.2",
|
|
169
|
+
"@deepseek-ai/dsh-sandbox-policy": "0.2.1-alpha.2",
|
|
170
|
+
"@deepseek-ai/dsh-session": "0.2.1-alpha.2",
|
|
171
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-alpha.2",
|
|
172
|
+
"@deepseek-ai/dsh-storage": "0.2.1-alpha.2",
|
|
173
|
+
"@deepseek-ai/dsh-storage-domain": "0.2.1-alpha.2",
|
|
174
|
+
"@deepseek-ai/dsh-storage-json": "0.2.1-alpha.2",
|
|
175
|
+
"@deepseek-ai/dsh-subprocess": "0.2.1-alpha.2",
|
|
176
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-alpha.2",
|
|
177
|
+
"@deepseek-ai/dsh-workspace": "0.2.1-alpha.2",
|
|
142
178
|
"@testing-library/react": "^16.3.3",
|
|
143
179
|
"@types/node": "^22.0.0",
|
|
144
180
|
"@types/react": "~18.3.31",
|
|
@@ -150,7 +186,14 @@
|
|
|
150
186
|
"tsdown": "^0.22.0",
|
|
151
187
|
"typescript": "^6.0.3",
|
|
152
188
|
"vitest": "^4.1.8",
|
|
153
|
-
"yaml": "^2.9.0"
|
|
189
|
+
"yaml": "^2.9.0",
|
|
190
|
+
"@deepseek-ai/dsh-lsp": "0.2.1-alpha.2",
|
|
191
|
+
"@deepseek-ai/dsh-lsp-stdio": "0.2.1-alpha.2",
|
|
192
|
+
"@deepseek-ai/dsh-api-workspace-files": "0.2.1-alpha.2",
|
|
193
|
+
"@deepseek-ai/dsh-typert-protocol": "0.2.1-alpha.2",
|
|
194
|
+
"@deepseek-ai/dsh-sandbox-windows-acl": "0.2.1-alpha.2",
|
|
195
|
+
"@deepseek-ai/dsh-subprocess-local": "0.2.1-alpha.2",
|
|
196
|
+
"@deepseek-ai/dsh-tools": "0.2.1-alpha.2"
|
|
154
197
|
},
|
|
155
198
|
"dsh": {
|
|
156
199
|
"bundle": {
|