dsh-remote-vs 0.30.0 → 0.31.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.
Files changed (40) hide show
  1. package/README.en.md +40 -18
  2. package/README.md +32 -17
  3. package/THIRD-PARTY-NOTICES.md +6 -6
  4. package/cordis.patch.yml +31 -76
  5. package/lib/client.js +61 -9
  6. package/lib/index.js +25 -3
  7. package/lib/p2-router-fs.js +15 -1
  8. package/lib/types/client/WorkspacesView.d.ts +2 -0
  9. package/lib/types/client/composer.d.ts +8 -1
  10. package/lib/types/client/selection-popup.d.ts +1 -1
  11. package/lib/types/client/ui.d.ts +7 -4
  12. package/lib/types/p2/router-fs.d.ts +9 -1
  13. package/lib/types/p2/worlds.d.ts +23 -0
  14. package/lib/{worlds-CRRZMZhg.js → worlds-BdxLeKul.js} +49 -1
  15. package/package.json +46 -46
  16. package/src/client/DirectoryFlow.tsx +8 -0
  17. package/src/client/EditorPane.tsx +5 -1
  18. package/src/client/HostsView.tsx +2 -0
  19. package/src/client/RemoteExplorer.tsx +11 -2
  20. package/src/client/RemoteRoot.tsx +1 -0
  21. package/src/client/SettingsHosts.tsx +1 -0
  22. package/src/client/WorkspaceWizard.tsx +1 -0
  23. package/src/client/WorkspacesView.tsx +21 -1
  24. package/src/client/composer.ts +8 -1
  25. package/src/client/scm/DiffView.tsx +5 -2
  26. package/src/client/selection-popup.ts +1 -1
  27. package/src/client/ui.tsx +9 -7
  28. package/src/client/vsc/vsc.css +55 -3
  29. package/src/index.ts +31 -0
  30. package/src/p2/router-fs.ts +29 -1
  31. package/src/p2/worlds.ts +68 -1
  32. package/src/routes.ts +19 -13
  33. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.3-alpha.3-linux-x64.helper.json +20 -0
  34. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.3-alpha.3-linux-x64.tar.gz +4 -0
  35. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.3-alpha.3-linux-x64.tar.gz.sha256 +1 -0
  36. package/vendor/dsh-remote-helpers/pkg-sea-bare-import.patch +30 -0
  37. package/vendor/dsh-remote-helpers/ssh-helper-runtime-deps.patch +4 -3
  38. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.helper.json +0 -19
  39. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz +0 -4
  40. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz.sha256 +0 -1
package/lib/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as dshHome, D as viewSettingsPath, E as storePath, S as aliasRoot, T as keysDir, _ as MAX_TIMEOUT_MS, a as takeHostNotices, b as resolveTimeouts, c as pushPipeline, d as WriteConflictError, f as attachmentHeader, g as DeadlineError, h as DEFAULT_TIMEOUTS, i as drainHostNotices, l as seedHelperCache, m as DEFAULT_READ_TIMEOUT_MS, n as TombstonedError, o as helperAvailability, p as DEFAULT_GIT_TIMEOUT_MS, s as probe, t as RemoteWorlds, u as RemoteFiles, v as MIN_TIMEOUT_MS, w as ensurePrivateDir, x as require_lib, y as clampExecTimeout } from "./worlds-CRRZMZhg.js";
1
+ import { C as dshHome, D as viewSettingsPath, E as storePath, S as aliasRoot, T as keysDir, _ as MAX_TIMEOUT_MS, a as takeHostNotices, b as resolveTimeouts, c as pushPipeline, d as WriteConflictError, f as attachmentHeader, g as DeadlineError, h as DEFAULT_TIMEOUTS, i as drainHostNotices, l as seedHelperCache, m as DEFAULT_READ_TIMEOUT_MS, n as TombstonedError, o as helperAvailability, p as DEFAULT_GIT_TIMEOUT_MS, s as probe, t as RemoteWorlds, u as RemoteFiles, v as MIN_TIMEOUT_MS, w as ensurePrivateDir, x as require_lib, y as clampExecTimeout } from "./worlds-BdxLeKul.js";
2
2
  import z from "@deepseek-ai/schemastery";
3
3
  import { chmodSync, closeSync, existsSync, fsyncSync, mkdirSync, openSync, readFileSync, renameSync, statSync, writeSync } from "node:fs";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -6244,7 +6244,7 @@ function makeRoutes(deps) {
6244
6244
  writeJson(res, 404, { error: `unknown host alias: ${alias}` });
6245
6245
  return;
6246
6246
  }
6247
- worlds.syncWorkspaces().catch(() => void 0);
6247
+ await worlds.syncWorkspaces().catch(() => void 0);
6248
6248
  writeJson(res, 200, { ok: true });
6249
6249
  return;
6250
6250
  }
@@ -6875,7 +6875,7 @@ function makeRoutes(deps) {
6875
6875
  writeJson(res, 404, { error: `unknown workspace id: ${id}` });
6876
6876
  return;
6877
6877
  }
6878
- worlds.syncWorkspaces().catch(() => void 0);
6878
+ await worlds.syncWorkspaces().catch(() => void 0);
6879
6879
  writeJson(res, 200, { ok: true });
6880
6880
  }
6881
6881
  },
@@ -10491,6 +10491,28 @@ function apply(ctx, config) {
10491
10491
  changes.dispose();
10492
10492
  }, "dsh-remote-vs: changes ledger");
10493
10493
  /**
10494
+ * DSH's own sidebar can delete a Workspace. That is the user removing it
10495
+ * outright, so the remote binding that named it must go too (tombstoned by
10496
+ * `removeWorkspace`, keeping sessions readable). The REVERSE direction is
10497
+ * deliberately asymmetric: unbinding from this plugin keeps the native
10498
+ * Workspace record and only adds a fail-closed tombstone — the user asked for
10499
+ * exactly that, so a tombstone never vanishes from DSH's workspace list.
10500
+ *
10501
+ * `domain/changed` is a host-internal event, hence the structural cast: it is
10502
+ * not part of this plugin's inject surface, and a host without it simply keeps
10503
+ * the old behaviour (the deletion stays local).
10504
+ */
10505
+ try {
10506
+ ctx.on("domain/changed", (change) => {
10507
+ try {
10508
+ if (change.domain !== "workspace" || change.table !== "workspaces") return;
10509
+ if (change.operation !== "deleted" || typeof change.key !== "string") return;
10510
+ const removed = worlds.forgetNativeWorkspace(change.key);
10511
+ if (removed !== void 0) ctx.logger.info(`[remote-vs] native workspace deleted: binding ${removed} unbound`);
10512
+ } catch {}
10513
+ });
10514
+ } catch {}
10515
+ /**
10494
10516
  * Local port forwards (`ssh -L`) — resident listeners with their own
10495
10517
  * lifecycle, on purpose.
10496
10518
  *
@@ -1,4 +1,4 @@
1
- import { S as aliasRoot, r as isWindowsAbsolute } from "./worlds-CRRZMZhg.js";
1
+ import { S as aliasRoot, r as isWindowsAbsolute } from "./worlds-BdxLeKul.js";
2
2
  import { FileSystem, FsError } from "@deepseek-ai/dsh-fs";
3
3
  //#region src/p2/router-fs.ts
4
4
  /**
@@ -179,6 +179,8 @@ var TransparentFileSystem = class extends FileSystem {
179
179
  if (pw.kind === "local") return this.localFs.contains(parent, child);
180
180
  if (pw.id !== cw.id) return false;
181
181
  try {
182
+ const remoteFs = this.remote.cachedFs(pw.alias);
183
+ if (remoteFs !== void 0) return remoteFs.contains(parent, child);
182
184
  const left = this.processPath(parent);
183
185
  const right = this.processPath(child);
184
186
  return right === left || right.startsWith(left.endsWith("/") ? left : `${left}/`);
@@ -239,6 +241,18 @@ var TransparentFileSystem = class extends FileSystem {
239
241
  const { fs, world } = await this.backendOf(target);
240
242
  return fs.writeText(target, content, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
241
243
  }
244
+ /**
245
+ * alpha.3's `FileSystem` gained verbatim byte writes. The base class rejects
246
+ * them, so a router that only forwards text silently turned every remote byte
247
+ * write (document-preview renders, attachment materialization) into a
248
+ * capability regression. Delegate like `writeText`; a provider from an older
249
+ * generation still fails as a typed `FsError` instead of a `TypeError`.
250
+ */
251
+ async writeBytes(target, data, expected, signal, sandboxPolicy) {
252
+ const { fs, world } = await this.backendOf(target);
253
+ if (typeof fs.writeBytes !== "function") throw this.unsupportedRemote("writing bytes");
254
+ return fs.writeBytes(target, data, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
255
+ }
242
256
  async editText(target, edit, expected, signal, sandboxPolicy) {
243
257
  const { fs, world } = await this.backendOf(target);
244
258
  return fs.editText(target, edit, expected, signal, this.remote.rewritePolicy(sandboxPolicy, world));
@@ -9,6 +9,8 @@ export declare function WorkspacesView(props: {
9
9
  workspaces: RemoteWorkspaceBinding[];
10
10
  routing: RemoteRoutingStatus;
11
11
  onChanged: () => void;
12
+ /** False while the panel is off screen: the live poll below only runs on screen. */
13
+ visible?: boolean;
12
14
  /** Open the files view for a binding; omitted where no files view exists (settings section hides the button). */
13
15
  onOpenFiles?: (workspaceId: string) => void;
14
16
  }): ReactNode;
@@ -37,10 +37,17 @@
37
37
  * - `remoteRelativePath`: POSIX-only prefix strip against `remoteRoot`
38
38
  * (case-sensitive; outside/traversal refuses with `undefined`, never an
39
39
  * absolute mention — the local `workspaceRelativePath` policy).
40
+ * **`remoteRoot` is always the BINDING's workspace root, never the SCM
41
+ * repo root.** The model resolves mentions against the session workspace
42
+ * root, so rooting them at a selected repository would both drop every file
43
+ * outside that repository and shift every file inside it by the repository
44
+ * prefix (the repository may be a subdirectory of the workspace, or enclose
45
+ * it).
40
46
  * - `insertRemoteReference`: the caller passes `remoteRoot` directly; there is
41
47
  * no workspaces-membership lookup here because the binding gate lives in
42
48
  * `use-remote-chat-target.ts` (current session must belong to the viewed
43
- * binding, else the button is disabled).
49
+ * binding, else the button is disabled). Callers must pass the workspace
50
+ * root — `store.root`/the explorer's `root` — not `repoRoot`.
44
51
  * - `sameLocalDir`: Windows-tolerant alias-dir comparison for that gate.
45
52
  *
46
53
  * No ctx reads at module scope (explicit `ctx` params only) so every function
@@ -50,7 +50,7 @@ export interface SelectionPopupControls<T> {
50
50
  /** The current popup (null = hidden). */
51
51
  popup: SelectionPopup<T> | null;
52
52
  /** Attach to the portaled button element. */
53
- buttonRef: RefObject<HTMLButtonElement>;
53
+ buttonRef: RefObject<HTMLButtonElement | null>;
54
54
  /** Anchor the popup above a selection (viewport-clamped). */
55
55
  show(insert: T, left: number, top: number): void;
56
56
  /** Hide the popup (idempotent). */
@@ -8,12 +8,15 @@ export declare const hairline: CSSProperties;
8
8
  export declare const inputStyle: CSSProperties;
9
9
  /**
10
10
  * Native dropdown that follows the DSH theme in BOTH states: the closed box
11
- * uses the translucent surface, while the open option popup (which Chrome
12
- * renders from `color-scheme`, ignoring translucent backgrounds) gets
13
- * explicit Canvas colors + a declared scheme so dark theme stays readable.
11
+ * uses the translucent surface, while the open option popup is painted by the
12
+ * browser from each option's own colors. Themed through the `.rvs-dropdown`
13
+ * class (vsc.css) — `Canvas`/`CanvasText` used to resolve against the page
14
+ * scheme, which DSH never switches, so the dark theme kept a white list.
15
+ * `color-scheme` is deliberately NOT set here: an inline `light dark` would
16
+ * override the class's per-theme value.
14
17
  */
15
18
  export declare const selectStyle: CSSProperties;
16
- /** Option rows of the open popup: explicit theme-following colors. */
19
+ /** Option rows of the open popup: opaque, theme-following, measured ≥7:1. */
17
20
  export declare const optionStyle: CSSProperties;
18
21
  export declare const btnStyle: CSSProperties;
19
22
  export declare const btnPrimaryStyle: CSSProperties;
@@ -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 { FsDeleteOutcome, FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsMoveOutcome, FsPathInfo, FsTarget, FsVersion, FsWriteIntent, FsWriteOutcome } from '@deepseek-ai/dsh-fs';
8
+ import type { FsDeleteOutcome, FsDirEntry, FsEditOutcome, FsEditRequest, FsInfo, FsMoveOutcome, FsPathInfo, FsTarget, FsVersion, FsWriteBytesOutcome, 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[];
@@ -85,6 +85,14 @@ export default class TransparentFileSystem extends FileSystem {
85
85
  }, signal?: AbortSignal): Promise<Uint8Array>;
86
86
  listDir(target: FsTarget, signal?: AbortSignal): Promise<FsDirEntry[]>;
87
87
  writeText(target: FsTarget, content: string, expected?: FsWriteIntent, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsWriteOutcome>;
88
+ /**
89
+ * alpha.3's `FileSystem` gained verbatim byte writes. The base class rejects
90
+ * them, so a router that only forwards text silently turned every remote byte
91
+ * write (document-preview renders, attachment materialization) into a
92
+ * capability regression. Delegate like `writeText`; a provider from an older
93
+ * generation still fails as a typed `FsError` instead of a `TypeError`.
94
+ */
95
+ writeBytes(target: FsTarget, data: Uint8Array, expected?: FsWriteIntent, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsWriteBytesOutcome>;
88
96
  editText(target: FsTarget, edit: FsEditRequest, expected?: {
89
97
  version: FsVersion;
90
98
  }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsEditOutcome>;
@@ -48,6 +48,12 @@ export declare class RemoteWorlds {
48
48
  */
49
49
  private readonly dialingRpc;
50
50
  private readonly fsViews;
51
+ /**
52
+ * Native Workspace registration id -> alias dir, refreshed by every
53
+ * `syncWorkspaces()`. DSH reports a sidebar workspace deletion by its own id,
54
+ * which carries no path, so this is the only way back to the binding.
55
+ */
56
+ private readonly nativeWorkspaces;
51
57
  private readonly fsReady;
52
58
  private readonly procs;
53
59
  /** Consecutive dial failures per alias; while the cooldown is set, no dial is attempted. */
@@ -131,6 +137,8 @@ export declare class RemoteWorlds {
131
137
  toSessionPath(route: Extract<WorldRoute, {
132
138
  kind: 'remote';
133
139
  }>, remoteAbsPath: string): string;
140
+ /** One binding's remote root, without a trailing slash (except `/` itself). */
141
+ private remoteRoot;
134
142
  /** Inverse of {@link toRemotePath}: the alias spelling of a remote path. */
135
143
  toAliasPath(route: Extract<WorldRoute, {
136
144
  kind: 'remote';
@@ -158,6 +166,21 @@ export declare class RemoteWorlds {
158
166
  note(route: WorldRoute, what: string): void;
159
167
  /** Ensure alias dirs + native registry entries for every binding. */
160
168
  syncWorkspaces(): Promise<void>;
169
+ /**
170
+ * A native Workspace under the alias root was deleted by the user (DSH's own
171
+ * sidebar): its binding follows — unbind + tombstone.
172
+ *
173
+ * The reverse direction is deliberately NOT symmetric: unbinding from this
174
+ * plugin keeps the native Workspace record (the user asked for exactly that —
175
+ * the workspace stays listed and only a fail-closed tombstone is added), while
176
+ * deleting the Workspace in DSH's sidebar is the user removing it outright, so
177
+ * the binding that named it goes with it. Without this, a deleted native
178
+ * workspace left a binding routing into an alias dir nobody can reach.
179
+ *
180
+ * @param nativeId - DSH's Workspace registration id.
181
+ * @returns the binding id that was removed, when one matched.
182
+ */
183
+ forgetNativeWorkspace(nativeId: string): string | undefined;
161
184
  /** Remote $HOME for one host alias (deploy record, else one probe). */
162
185
  homeFor(alias: string): Promise<string>;
163
186
  /** Best-effort remote mkdir -p (for paths the fs seam cannot create). */
@@ -19660,6 +19660,12 @@ var RemoteWorlds = class {
19660
19660
  */
19661
19661
  dialingRpc = /* @__PURE__ */ new Map();
19662
19662
  fsViews = /* @__PURE__ */ new Map();
19663
+ /**
19664
+ * Native Workspace registration id -> alias dir, refreshed by every
19665
+ * `syncWorkspaces()`. DSH reports a sidebar workspace deletion by its own id,
19666
+ * which carries no path, so this is the only way back to the binding.
19667
+ */
19668
+ nativeWorkspaces = /* @__PURE__ */ new Map();
19663
19669
  fsReady = /* @__PURE__ */ new Map();
19664
19670
  procs = /* @__PURE__ */ new Map();
19665
19671
  /** Consecutive dial failures per alias; while the cooldown is set, no dial is attempted. */
@@ -19835,6 +19841,7 @@ var RemoteWorlds = class {
19835
19841
  */
19836
19842
  toSessionPath(route, remoteAbsPath) {
19837
19843
  if (!this.underRemoteBase(route, remoteAbsPath)) return remoteAbsPath;
19844
+ if (remoteAbsPath === this.remoteRoot(route)) return route.aliasPath;
19838
19845
  let routed;
19839
19846
  try {
19840
19847
  routed = this.routeDir(remoteAbsPath);
@@ -19844,9 +19851,14 @@ var RemoteWorlds = class {
19844
19851
  if (routed.kind === "remote" && routed.id === route.id) return remoteAbsPath;
19845
19852
  return this.toAliasPath(route, remoteAbsPath);
19846
19853
  }
19854
+ /** One binding's remote root, without a trailing slash (except `/` itself). */
19855
+ remoteRoot(route) {
19856
+ const root = route.remotePath;
19857
+ return root.endsWith("/") && root !== "/" ? root.slice(0, -1) : root;
19858
+ }
19847
19859
  /** Inverse of {@link toRemotePath}: the alias spelling of a remote path. */
19848
19860
  toAliasPath(route, remoteAbsPath) {
19849
- const base = route.remotePath.endsWith("/") && route.remotePath !== "/" ? route.remotePath.slice(0, -1) : route.remotePath;
19861
+ const base = this.remoteRoot(route);
19850
19862
  if (!this.containsRemote(base, remoteAbsPath)) return remoteAbsPath;
19851
19863
  if (remoteAbsPath === base) return route.aliasPath;
19852
19864
  const rel = remoteAbsPath.slice(base === "/" ? 1 : base.length + 1);
@@ -19922,6 +19934,42 @@ var RemoteWorlds = class {
19922
19934
  } catch {}
19923
19935
  }
19924
19936
  }
19937
+ this.nativeWorkspaces.clear();
19938
+ if (registry === void 0 || typeof registry.list !== "function") return;
19939
+ let registered;
19940
+ try {
19941
+ registered = registry.list();
19942
+ } catch {
19943
+ return;
19944
+ }
19945
+ for (const workspace of registered) try {
19946
+ if (!this.contains(aliasRoot(), workspace.path)) continue;
19947
+ this.nativeWorkspaces.set(String(workspace.id), workspace.path);
19948
+ } catch {}
19949
+ }
19950
+ /**
19951
+ * A native Workspace under the alias root was deleted by the user (DSH's own
19952
+ * sidebar): its binding follows — unbind + tombstone.
19953
+ *
19954
+ * The reverse direction is deliberately NOT symmetric: unbinding from this
19955
+ * plugin keeps the native Workspace record (the user asked for exactly that —
19956
+ * the workspace stays listed and only a fail-closed tombstone is added), while
19957
+ * deleting the Workspace in DSH's sidebar is the user removing it outright, so
19958
+ * the binding that named it goes with it. Without this, a deleted native
19959
+ * workspace left a binding routing into an alias dir nobody can reach.
19960
+ *
19961
+ * @param nativeId - DSH's Workspace registration id.
19962
+ * @returns the binding id that was removed, when one matched.
19963
+ */
19964
+ forgetNativeWorkspace(nativeId) {
19965
+ const path = this.nativeWorkspaces.get(nativeId);
19966
+ if (path === void 0) return void 0;
19967
+ this.nativeWorkspaces.delete(nativeId);
19968
+ if (!this.contains(aliasRoot(), path)) return void 0;
19969
+ const basename = path.replace(/[\\/]+$/u, "").split(/[\\/]/u).pop() ?? "";
19970
+ if (basename === "") return void 0;
19971
+ if (!this.deps.store.listWorkspaces().some((binding) => binding.id === basename)) return void 0;
19972
+ return this.deps.store.removeWorkspace(basename) ? basename : void 0;
19925
19973
  }
19926
19974
  /** Remote $HOME for one host alias (deploy record, else one probe). */
19927
19975
  async homeFor(alias) {
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.30.0",
4
+ "version": "0.31.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-rc.5 <0.3.0"
62
+ "dsh": ">=0.2.3-alpha.3 <0.3.0"
63
63
  },
64
64
  "dsh": {
65
65
  "bundle": {
@@ -121,9 +121,9 @@
121
121
  "@codemirror/search": "6.5.11",
122
122
  "@codemirror/state": "^6.7.6",
123
123
  "@codemirror/view": "^6.43.14",
124
- "@deepseek-ai/dsh-fs-ssh": "0.2.2-rc.5",
125
- "@deepseek-ai/dsh-ssh": "0.2.2-rc.5",
126
- "@deepseek-ai/schemastery": "3.19.0",
124
+ "@deepseek-ai/dsh-fs-ssh": "0.2.3-alpha.3",
125
+ "@deepseek-ai/dsh-ssh": "0.2.3-alpha.3",
126
+ "@deepseek-ai/schemastery": "3.20.0-alpha.2",
127
127
  "@lezer/highlight": "1.2.3",
128
128
  "@xterm/addon-fit": "^0.11.0",
129
129
  "@xterm/xterm": "^6.0.0",
@@ -131,53 +131,53 @@
131
131
  "zod": "4.6.6"
132
132
  },
133
133
  "peerDependencies": {
134
- "@deepseek-ai/cordis": "^4.1.0",
135
- "@deepseek-ai/dsh-agent-preset": "^0.2.2-rc.5",
136
- "@deepseek-ai/dsh-bash-local": "^0.2.2-rc.5",
137
- "@deepseek-ai/dsh-file-reference": "^0.2.2-rc.5",
138
- "@deepseek-ai/dsh-fs": "^0.2.2-rc.5",
139
- "@deepseek-ai/dsh-shell": "^0.2.2-rc.5",
140
- "@deepseek-ai/dsh-spill": "^0.2.2-rc.5",
141
- "@deepseek-ai/dsh-subprocess": "^0.2.2-rc.5",
142
- "@deepseek-ai/dsh-tools": "^0.2.2-rc.5",
143
- "react": "^18.2.0",
144
- "react-dom": "^18.2.0"
134
+ "@deepseek-ai/cordis": "^4.2.0-alpha.2",
135
+ "@deepseek-ai/dsh-agent-preset": "^0.2.3-alpha.3",
136
+ "@deepseek-ai/dsh-bash-local": "^0.2.3-alpha.3",
137
+ "@deepseek-ai/dsh-file-reference": "^0.2.3-alpha.3",
138
+ "@deepseek-ai/dsh-fs": "^0.2.3-alpha.3",
139
+ "@deepseek-ai/dsh-shell": "^0.2.3-alpha.3",
140
+ "@deepseek-ai/dsh-spill": "^0.2.3-alpha.3",
141
+ "@deepseek-ai/dsh-subprocess": "^0.2.3-alpha.3",
142
+ "@deepseek-ai/dsh-tools": "^0.2.3-alpha.3",
143
+ "react": "^19.3.1",
144
+ "react-dom": "^19.3.1"
145
145
  },
146
146
  "devDependencies": {
147
- "@deepseek-ai/cordis": "^4.1.0",
148
- "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
149
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.5",
150
- "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.5",
151
- "@deepseek-ai/dsh-bash-local": "0.2.2-rc.5",
152
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
153
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
154
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
155
- "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.5",
156
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.5",
157
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
158
- "@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.5",
159
- "@deepseek-ai/dsh-file-reference": "0.2.2-rc.5",
160
- "@deepseek-ai/dsh-fs": "0.2.2-rc.5",
161
- "@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.5",
162
- "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.5",
163
- "@deepseek-ai/dsh-llm": "0.2.2-rc.5",
164
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.5",
165
- "@deepseek-ai/dsh-session": "0.2.2-rc.5",
166
- "@deepseek-ai/dsh-shell": "0.2.2-rc.5",
167
- "@deepseek-ai/dsh-spill": "0.2.2-rc.5",
168
- "@deepseek-ai/dsh-subprocess": "0.2.2-rc.5",
169
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.5",
170
- "@deepseek-ai/dsh-tools": "0.2.2-rc.5",
171
- "@deepseek-ai/dsh-working-directory": "0.2.2-rc.5",
172
- "@deepseek-ai/dsh-workspace": "0.2.2-rc.5",
147
+ "@deepseek-ai/cordis": "^4.2.0-alpha.2",
148
+ "@deepseek-ai/dsh-agent": "0.2.3-alpha.3",
149
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.3-alpha.3",
150
+ "@deepseek-ai/dsh-api-remotes": "0.2.3-alpha.3",
151
+ "@deepseek-ai/dsh-bash-local": "0.2.3-alpha.3",
152
+ "@deepseek-ai/dsh-client-locale": "0.2.3-alpha.3",
153
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.3-alpha.3",
154
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.3-alpha.3",
155
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.3-alpha.3",
156
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.3-alpha.3",
157
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.3-alpha.3",
158
+ "@deepseek-ai/dsh-client-ui-workspace": "0.2.3-alpha.3",
159
+ "@deepseek-ai/dsh-file-reference": "0.2.3-alpha.3",
160
+ "@deepseek-ai/dsh-fs": "0.2.3-alpha.3",
161
+ "@deepseek-ai/dsh-host-directory-picker": "0.2.3-alpha.3",
162
+ "@deepseek-ai/dsh-host-webserver": "0.2.3-alpha.3",
163
+ "@deepseek-ai/dsh-llm": "0.2.3-alpha.3",
164
+ "@deepseek-ai/dsh-sandbox": "0.2.3-alpha.3",
165
+ "@deepseek-ai/dsh-session": "0.2.3-alpha.3",
166
+ "@deepseek-ai/dsh-shell": "0.2.3-alpha.3",
167
+ "@deepseek-ai/dsh-spill": "0.2.3-alpha.3",
168
+ "@deepseek-ai/dsh-subprocess": "0.2.3-alpha.3",
169
+ "@deepseek-ai/dsh-system-prompt": "0.2.3-alpha.3",
170
+ "@deepseek-ai/dsh-tools": "0.2.3-alpha.3",
171
+ "@deepseek-ai/dsh-working-directory": "0.2.3-alpha.3",
172
+ "@deepseek-ai/dsh-workspace": "0.2.3-alpha.3",
173
173
  "@types/node": "^22.20.0",
174
- "@types/react": "~18.3.1",
175
- "@types/react-dom": "^18.3.5",
174
+ "@types/react": "~19.3.3",
175
+ "@types/react-dom": "~19.3.0",
176
176
  "@types/ssh2": "^1.15.5",
177
177
  "@types/ws": "^8.5.13",
178
178
  "jsdom": "^30.1.2",
179
- "react": "^18.3.1",
180
- "react-dom": "^18.3.1",
179
+ "react": "^19.3.1",
180
+ "react-dom": "^19.3.1",
181
181
  "ssh2": "^1.17.0",
182
182
  "tsdown": "0.22.2",
183
183
  "typescript": "~5.7.2"
@@ -25,6 +25,7 @@ import type { RemoteHostSummary } from '../protocol.ts'
25
25
  import { RemoteApiError, api } from './api.ts'
26
26
  import { WorkspaceWizard } from './WorkspaceWizard.tsx'
27
27
  import { detectLang, makeT } from './i18n.ts'
28
+ import { refreshAll } from './store.tsx'
28
29
  import { Btn, Notice } from './ui.tsx'
29
30
 
30
31
  /**
@@ -378,6 +379,13 @@ function RemoteLeg(props: {
378
379
  onSaved={(_workspace, aliasPath) => {
379
380
  setDone(true)
380
381
  traceFlow('remote wizard saved', aliasPath)
382
+ // The workbench store (hosts + bindings + routing) is module state
383
+ // bootstrapped once per page; adopting a NEW binding through this
384
+ // stock-owner dialog used to leave it stale, so the Remote panel's
385
+ // 「工作区」 list did not show the workspace the user just created
386
+ // until a page reload. The panel's own wizard refreshes through
387
+ // `onDone`; this path has no such hook, so it refreshes here.
388
+ refreshAll()
381
389
  props.onPicked(aliasPath)
382
390
  }}
383
391
  />
@@ -1727,7 +1727,11 @@ export function EditorPane(props: { visible: boolean }): ReactNode {
1727
1727
  wrap={settings.wrap}
1728
1728
  ctx={store.ctx}
1729
1729
  sessionId={chat.sessionId}
1730
- remoteRoot={store.repoRoot ?? store.root}
1730
+ // The mention geometry is workspace-rooted. `repoRoot` is
1731
+ // the SCM panel's selected repository and may be a
1732
+ // subdirectory of the workspace (or an enclosing one), so
1733
+ // rooting selections there silently drops or shifts paths.
1734
+ remoteRoot={store.root}
1731
1735
  chatEnabled={chatEnabled}
1732
1736
  addLabel={t('files.addToConversation')}
1733
1737
  {...(activeTab.line === undefined ? {} : { revealLine: activeTab.line })}
@@ -287,6 +287,7 @@ export function ProxyFields(props: {
287
287
  <div style={{ flex: 1.1 }}>
288
288
  <Field label={t('proxy.kind')}>
289
289
  <select
290
+ className="rvs-dropdown"
290
291
  value={state.kind}
291
292
  disabled={disabled}
292
293
  onChange={(e) => set({ kind: e.target.value === 'socks5' ? 'socks5' : 'http' })}
@@ -445,6 +446,7 @@ function HostProxySection(props: {
445
446
  <>
446
447
  <Field label={t('proxy.jumpVia')}>
447
448
  <select
449
+ className="rvs-dropdown"
448
450
  value={state.viaAlias}
449
451
  disabled={props.busy}
450
452
  onChange={(e) => set({ viaAlias: e.target.value })}
@@ -2641,7 +2641,14 @@ export function RemoteExplorer(props: { showHidden: boolean; onToggleHidden: ()
2641
2641
  onSelect: () => {
2642
2642
  if (chatTarget.sessionId === undefined) return
2643
2643
  for (const item of targets) {
2644
- insertRemoteReference(ctx, chatTarget.sessionId, repoRoot ?? root, item.path, item.isDir)
2644
+ // The mention is WORKSPACE-relative: the model resolves it against
2645
+ // the session workspace root. `repoRoot` is the SCM panel's selected
2646
+ // repository, which may be a SUBDIRECTORY of the workspace (or an
2647
+ // enclosing repository above it) — rooting mentions there made every
2648
+ // file outside that repository unrepresentable and every file inside
2649
+ // it off by the repository prefix. See the reference-root rule in
2650
+ // composer.ts's `remoteRelativePath`.
2651
+ insertRemoteReference(ctx, chatTarget.sessionId, root, item.path, item.isDir)
2645
2652
  }
2646
2653
  },
2647
2654
  disabled: !chatEnabled,
@@ -2887,7 +2894,9 @@ export function RemoteExplorer(props: { showHidden: boolean; onToggleHidden: ()
2887
2894
  cancelRename: () => setRenaming(undefined),
2888
2895
  reference: (entry) => {
2889
2896
  if (chatTarget.sessionId === undefined) return
2890
- insertRemoteReference(ctx, chatTarget.sessionId, repoRoot ?? root, entry.path, entry.isDir)
2897
+ // Workspace-rooted, never `repoRoot`: see the rule at the context-menu
2898
+ // call site above (the selected repository may be a workspace subdir).
2899
+ insertRemoteReference(ctx, chatTarget.sessionId, root, entry.path, entry.isDir)
2891
2900
  },
2892
2901
  keyDown: onRowKeyDown,
2893
2902
  focusPath: (path) => { setFocusedPath(path) },
@@ -502,6 +502,7 @@ function Shell(props: { ctx: Context; visible: boolean }): ReactNode {
502
502
  workspaces={store.workspaces}
503
503
  routing={store.routing}
504
504
  onChanged={store.refreshAll}
505
+ visible={panelLive('workspaces')}
505
506
  onOpenFiles={openWorkspaceFiles}
506
507
  />
507
508
  </div>
@@ -188,6 +188,7 @@ export function SettingsHostsSection(_props: SettingsSectionOwnerProps): ReactNo
188
188
  <Row>
189
189
  <span style={{ fontSize: 12, opacity: 0.75 }}>{t('route.mode')}</span>
190
190
  <select
191
+ className="rvs-dropdown"
191
192
  value={mode}
192
193
  disabled={saving}
193
194
  onChange={(e) => changeMode(e.target.value as 'off' | 'shadow' | 'enforce')}
@@ -222,6 +222,7 @@ export function WorkspaceWizard(props: {
222
222
  <div style={{ marginTop: 8, fontWeight: 600 }}>{t('ws.step1')}</div>
223
223
  <Row>
224
224
  <select
225
+ className="rvs-dropdown"
225
226
  value={alias}
226
227
  disabled={disabled || props.hosts.length === 0}
227
228
  onChange={(e) => pick(e.target.value)}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Workspaces view: bindings list + the shared new-remote-workspace wizard.
3
3
  */
4
- import { useState, type ReactNode } from 'react'
4
+ import { useEffect, useRef, useState, type ReactNode } from 'react'
5
5
  import type { RemoteHostSummary, RemoteRoutingStatus, RemoteWorkspaceBinding } from '../protocol.ts'
6
6
  import { RemoteApiError, api } from './api.ts'
7
7
  import { WorkspaceWizard } from './WorkspaceWizard.tsx'
@@ -18,6 +18,8 @@ export function WorkspacesView(props: {
18
18
  workspaces: RemoteWorkspaceBinding[]
19
19
  routing: RemoteRoutingStatus
20
20
  onChanged: () => void
21
+ /** False while the panel is off screen: the live poll below only runs on screen. */
22
+ visible?: boolean
21
23
  /** Open the files view for a binding; omitted where no files view exists (settings section hides the button). */
22
24
  onOpenFiles?: (workspaceId: string) => void
23
25
  }): ReactNode {
@@ -26,6 +28,24 @@ export function WorkspacesView(props: {
26
28
  const [notice, setNotice] = useState<string | undefined>(undefined)
27
29
  const [error, setError] = useState<string | undefined>(undefined)
28
30
  const [busy, setBusy] = useState<string | undefined>(undefined)
31
+ /**
32
+ * Keep the list live without asking the user to close and reopen the panel.
33
+ *
34
+ * Two changes happen OUTSIDE this panel and used to stay invisible until a
35
+ * page reload: another window creating a binding, and the user deleting a
36
+ * workspace in DSH's own sidebar (which the Host turns into an unbind). The
37
+ * store is module state bootstrapped once, so a light poll while this panel is
38
+ * actually on screen is the cheap, reliable way to follow both.
39
+ */
40
+ const changedRef = useRef(props.onChanged)
41
+ changedRef.current = props.onChanged
42
+ const visible = props.visible !== false
43
+ useEffect(() => {
44
+ if (!visible) return
45
+ changedRef.current()
46
+ const timer = window.setInterval(() => { changedRef.current() }, 2500)
47
+ return () => { window.clearInterval(timer) }
48
+ }, [visible])
29
49
 
30
50
  /**
31
51
  * Unbind one workspace, after a confirmation.
@@ -37,10 +37,17 @@
37
37
  * - `remoteRelativePath`: POSIX-only prefix strip against `remoteRoot`
38
38
  * (case-sensitive; outside/traversal refuses with `undefined`, never an
39
39
  * absolute mention — the local `workspaceRelativePath` policy).
40
+ * **`remoteRoot` is always the BINDING's workspace root, never the SCM
41
+ * repo root.** The model resolves mentions against the session workspace
42
+ * root, so rooting them at a selected repository would both drop every file
43
+ * outside that repository and shift every file inside it by the repository
44
+ * prefix (the repository may be a subdirectory of the workspace, or enclose
45
+ * it).
40
46
  * - `insertRemoteReference`: the caller passes `remoteRoot` directly; there is
41
47
  * no workspaces-membership lookup here because the binding gate lives in
42
48
  * `use-remote-chat-target.ts` (current session must belong to the viewed
43
- * binding, else the button is disabled).
49
+ * binding, else the button is disabled). Callers must pass the workspace
50
+ * root — `store.root`/the explorer's `root` — not `repoRoot`.
44
51
  * - `sameLocalDir`: Windows-tolerant alias-dir comparison for that gate.
45
52
  *
46
53
  * No ctx reads at module scope (explicit `ctx` params only) so every function
@@ -419,7 +419,7 @@ function createSideTokens(text: string, lang: LangId | undefined): SideTokens {
419
419
  * a `thin`, low-contrast thumb it read as "there is no horizontal scrollbar".
420
420
  */
421
421
  function HScrollBar(props: {
422
- barRef: React.RefObject<HTMLDivElement>
422
+ barRef: React.RefObject<HTMLDivElement | null>
423
423
  width: number
424
424
  hint: string
425
425
  onScroll: (left: number) => void
@@ -1063,7 +1063,10 @@ export function DiffView(props: { tab: EditorTab; visible: boolean; offline?: bo
1063
1063
  tabId={tab.id}
1064
1064
  ctx={store.ctx}
1065
1065
  sessionId={chat.sessionId}
1066
- remoteRoot={store.repoRoot ?? store.root}
1066
+ // Workspace-rooted, not `repoRoot`: a mention is resolved by the
1067
+ // model against the session workspace root, while the selected
1068
+ // repository may be a workspace subdirectory.
1069
+ remoteRoot={store.root}
1067
1070
  chatEnabled={chatEnabled}
1068
1071
  addLabel={t('files.addToConversation')}
1069
1072
  onSave={() => { void saveAfter() }}
@@ -53,7 +53,7 @@ export interface SelectionPopupControls<T> {
53
53
  /** The current popup (null = hidden). */
54
54
  popup: SelectionPopup<T> | null
55
55
  /** Attach to the portaled button element. */
56
- buttonRef: RefObject<HTMLButtonElement>
56
+ buttonRef: RefObject<HTMLButtonElement | null>
57
57
  /** Anchor the popup above a selection (viewport-clamped). */
58
58
  show(insert: T, left: number, top: number): void
59
59
  /** Hide the popup (idempotent). */