dsh-remote-vs 0.21.1 → 0.23.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 (52) hide show
  1. package/README.en.md +489 -473
  2. package/README.md +434 -424
  3. package/cordis.patch.yml +13 -5
  4. package/lib/client.js +946 -256
  5. package/lib/index.js +187 -15
  6. package/lib/p2-router-fs.js +6 -7
  7. package/lib/types/changes/recorder.d.ts +21 -0
  8. package/lib/types/changes/status.d.ts +41 -1
  9. package/lib/types/changes/text-diff.d.ts +18 -0
  10. package/lib/types/client/changes/ChangesDock.d.ts +9 -2
  11. package/lib/types/client/changes/model.d.ts +3 -1
  12. package/lib/types/client/changes/review-state.d.ts +67 -0
  13. package/lib/types/client/notices.d.ts +35 -0
  14. package/lib/types/client/store.d.ts +51 -0
  15. package/lib/types/client/vsc/change-marks.d.ts +17 -0
  16. package/lib/types/client/vsc/kit.d.ts +9 -0
  17. package/lib/types/deploy.d.ts +28 -2
  18. package/lib/types/notices.d.ts +22 -0
  19. package/lib/types/p2/router-fs.d.ts +4 -5
  20. package/lib/types/p2/worlds.d.ts +10 -0
  21. package/lib/types/protocol.d.ts +37 -1
  22. package/lib/{worlds-DSzyajOB.js → worlds-DXdP4SMn.js} +80 -4
  23. package/package.json +37 -37
  24. package/src/changes/recorder.ts +93 -28
  25. package/src/changes/status.ts +69 -2
  26. package/src/changes/text-diff.ts +42 -0
  27. package/src/client/DirectoryFlow.tsx +65 -5
  28. package/src/client/api.ts +5 -0
  29. package/src/client/changes/ChangesDock.tsx +241 -39
  30. package/src/client/changes/changes.css +122 -9
  31. package/src/client/changes/model.ts +106 -22
  32. package/src/client/changes/review-state.ts +133 -0
  33. package/src/client/i18n.ts +48 -8
  34. package/src/client/index.tsx +24 -5
  35. package/src/client/notices.ts +86 -0
  36. package/src/client/store.tsx +186 -2
  37. package/src/client/vsc/change-marks.ts +39 -6
  38. package/src/client/vsc/kit.tsx +16 -1
  39. package/src/client/vsc/vsc.css +23 -0
  40. package/src/deploy.ts +38 -2
  41. package/src/http.ts +12 -1
  42. package/src/notices.ts +37 -0
  43. package/src/p2/router-fs.ts +5 -6
  44. package/src/p2/worlds.ts +46 -2
  45. package/src/protocol.ts +37 -1
  46. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.helper.json +19 -0
  47. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz +4 -0
  48. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz.sha256 +1 -0
  49. package/vendor/dsh-remote-helpers/ssh-helper-runtime-deps.patch +14 -0
  50. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.1-alpha.2-linux-x64.helper.json +0 -16
  51. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.1-alpha.2-linux-x64.tar.gz +0 -4
  52. package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.1-alpha.2-linux-x64.tar.gz.sha256 +0 -1
@@ -290,6 +290,12 @@ export interface ExplorerValue {
290
290
  * `changeSet.marks`,`hunk` 是 `patches` 的下标)。
291
291
  */
292
292
  undoChange: (tabId: string, mark: ChangeMark) => Promise<void>;
293
+ /**
294
+ * 撤销本会话对某个文件的**全部**改动(改动面板那一行的动作)。
295
+ *
296
+ * @returns 远端是否真的写了(`false` = 被某道门拒了,文件未变)。
297
+ */
298
+ revertFileChanges: (target: RevertFileTarget) => Promise<boolean>;
293
299
  /**
294
300
  * Write one file tab back to the remote host.
295
301
  * @returns true only when the write really succeeded — the caller uses it to
@@ -765,5 +771,50 @@ export declare function gotoChange(tabId: string, dir: 1 | -1): number | undefin
765
771
  */
766
772
  export declare function markChangeStale(tabId: string): void;
767
773
  export declare function undoChange(tabId: string, mark: ChangeMark): Promise<void>;
774
+ /**
775
+ * Coordinates for "undo everything this session did to this file".
776
+ *
777
+ * Handed over by the change panel, which is the only surface that knows both the
778
+ * file and the session it belongs to. `mode` comes from the HOST
779
+ * (`RemoteChangedFile.revert`), never from the client: only git can say whether a
780
+ * creation has a copy to fall back on.
781
+ */
782
+ export interface RevertFileTarget {
783
+ sessionId: string;
784
+ bindingId: string;
785
+ alias: string;
786
+ root: string;
787
+ path: string;
788
+ display: string;
789
+ mode: 'patch' | 'delete';
790
+ }
791
+ /**
792
+ * Revert one file's WHOLE session change set (the panel row's action).
793
+ *
794
+ * Three things make this a separate path from `undoChange`, and each one is
795
+ * load-bearing:
796
+ *
797
+ * 1. **It works without an open tab.** The panel lists files nobody opened, so
798
+ * the coordinates cannot come from `undoContext()` (which describes the tab on
799
+ * screen). They arrive with the call and are validated by the SAME rules
800
+ * (`resolveUndoTarget`: session agreement, binding identity, path under the
801
+ * ledger root) — a row from another conversation, or from a sibling binding
802
+ * that happens to share the alias, is refused rather than guessed.
803
+ * 2. **It is ONE remote write.** The host serves the file as a single patch, which
804
+ * is exactly what `git apply -R` needs to restore the session baseline; a loop
805
+ * of per-hunk applies would shift every later hunk and report a conflict
806
+ * halfway through, leaving the file half reverted.
807
+ * 3. **A creation is not a patch.** `mode: 'delete'` (a tracked addition, where
808
+ * git still holds the bytes) deletes the file behind an explicit confirmation;
809
+ * an untracked creation never reaches here, because the host offers no mode
810
+ * for it.
811
+ *
812
+ * The order of the gates is the one `undoChange` established: an unsaved buffer
813
+ * refuses first (a remote write must never overwrite what the user has not
814
+ * saved), then the offline check, then the coordinates, then the patch.
815
+ *
816
+ * @returns whether the remote was actually written.
817
+ */
818
+ export declare function revertFileChanges(target: RevertFileTarget): Promise<boolean>;
768
819
  /** Mount-time hook: boot the store for a given ctx. */
769
820
  export declare function useBootstrap(ctx: Context): void;
@@ -54,6 +54,14 @@ export interface RemovedChip {
54
54
  truncated: boolean;
55
55
  /** 这个 chip 落在哪一行(1-based)。**省略 = 所属 mark 的 `from` 行**。 */
56
56
  line?: number;
57
+ /**
58
+ * 这个 chip 代表的**被删行数**(省略或 1 = 单行/行内片段)。
59
+ *
60
+ * 一个整块删除(例如删掉 10 行)不能画成 10 个 chip 叠在同一列上 —— 那既读不出
61
+ * "删了 10 行",也读不出内容。此时 `count > 1`,`text` 改为携带**预览**(前若干
62
+ * 行的原文,供 tooltip),渲染成一个 `−N 行已删除` 的可读胶囊。
63
+ */
64
+ count?: number;
57
65
  }
58
66
  /**
59
67
  * 一处改动:**1-based、闭区间**的行号。
@@ -95,6 +103,15 @@ export interface ChangeSet {
95
103
  * 护栏,比在浏览器里重算一遍替换区间可靠。
96
104
  */
97
105
  patches?: string[];
106
+ /**
107
+ * 整文件的补丁(一个文件头 + 全部 hunk),用于"撤销该文件的全部改动"。
108
+ *
109
+ * 一次远端写而不是逐 hunk 循环:后者会让后面每个 hunk 的行号整体错位,撤到一半
110
+ * 报冲突,文件就停在半截状态。补丁由 Host 生成(浏览器一侧没有基线内容,自己拼
111
+ * 出来的补丁只会把别人的改动一起盖掉)。省略 = 这个文件没有可整体撤销的补丁
112
+ * (新建 / 二进制 / 字节被上限扣下)。
113
+ */
114
+ filePatch?: string;
98
115
  }
99
116
  /** 换一份改动标记;`null` = 清空(有改动数据,但没有任何要画的东西)。 */
100
117
  export declare const setChangeSet: import("@codemirror/state").StateEffectType<ChangeSet | null>;
@@ -195,6 +195,15 @@ export declare function ContextMenu(props: {
195
195
  y: number;
196
196
  entries: MenuEntry[];
197
197
  onClose: () => void;
198
+ /**
199
+ * Extra class on the menu box, for a surface that lives OUTSIDE `.rvs-root`.
200
+ *
201
+ * The menu is portalled to `document.body`, so the `--rvs-*` variables defined
202
+ * on the root never reach it: an outside surface (the change panel above the
203
+ * composer) supplies its own palette through this hook instead of forking the
204
+ * component.
205
+ */
206
+ className?: string;
198
207
  }): ReactNode;
199
208
  /** Hook: context-menu state + the handler that opens it. */
200
209
  export declare function useContextMenu(): {
@@ -49,8 +49,16 @@ export interface HelperCacheEntry {
49
49
  protocol: number;
50
50
  nodeVersion: string;
51
51
  }
52
- /** Wire protocol this plugin's `dsh-ssh` generation speaks (see MAINTENANCE §2.7). */
53
- export declare const EXPECTED_HELPER_PROTOCOL = 2;
52
+ /**
53
+ * Wire protocol this plugin's `dsh-ssh` generation speaks (see MAINTENANCE §2.7).
54
+ *
55
+ * Derived from the installed package instead of hardcoded: helper and client
56
+ * handshake on a strict literal, so a constant that drifts from the package
57
+ * silently selects a helper the handshake will reject. Before 0.23.0 this was a
58
+ * hand-maintained `2`; the protocol-3 move (MAINTENANCE §2.51) is why it can no
59
+ * longer be a second source of truth.
60
+ */
61
+ export declare const EXPECTED_HELPER_PROTOCOL = 3;
54
62
  /** Absolute path of one cached helper tarball; throws when it is not inside the cache. */
55
63
  export declare function helperTarballPath(helper: HelperCacheEntry, dir?: string): string;
56
64
  /** Scan the local helper cache; invalid/incomplete entries are skipped. */
@@ -73,6 +81,24 @@ export declare function compareHelperVersions(left: string, right: string): numb
73
81
  * then fail the runtime handshake, so it is not a candidate at all.
74
82
  */
75
83
  export declare function pickCached(platform: string, version?: string, expectedProtocol?: number): HelperCacheEntry | undefined;
84
+ /**
85
+ * Wire protocol of the helper build a deploy record points at, when this machine
86
+ * still has that build cached.
87
+ *
88
+ * Upgrade-day support for `createRpc`: it re-runs the deploy pipeline only when
89
+ * the record carries NO helper, so a host deployed by an older plugin keeps
90
+ * dialing a binary from another protocol generation — both sides pin a literal,
91
+ * so the handshake can only fail and nothing self-heals. The local cache is the
92
+ * one place that still knows that build's protocol, so the record is classified
93
+ * here:
94
+ * - unknown build (not cached here, e.g. deployed from another machine) →
95
+ * `undefined`: keep the record and let the handshake report the real error;
96
+ * - cached build of THIS protocol → returns the expected value, so a deliberate
97
+ * rollback pin (an older build of the same generation) stays pinned;
98
+ * - cached build of ANOTHER protocol → returns the foreign value; the caller
99
+ * re-deploys instead of dialing a doomed handshake.
100
+ */
101
+ export declare function protocolOfStoredHelper(binarySha256: string, platform: string | undefined, entries?: HelperCacheEntry[]): number | undefined;
76
102
  /** Honest availability of the helper channels. */
77
103
  export declare function helperAvailability(): HelperAvailability[];
78
104
  export declare function isHelperAvailable(kind: HelperKind): boolean;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * One-shot notices the Host hands to the browser on the next JSON response.
3
+ *
4
+ * Why a queue instead of a push channel: the Host half is request/response, and
5
+ * an event that matters (an automatic helper push) is produced *inside* a
6
+ * request the browser already made — the remote operation that needed a dial.
7
+ * Attaching the notice to that response reaches the surface that caused it with
8
+ * no extra connection, and a queue means a push during a streaming response or
9
+ * a failed request still arrives on the next successful one.
10
+ */
11
+ export interface HostNotice {
12
+ /** What happened. Only kinds the client knows how to render belong here. */
13
+ kind: 'helper-pushed';
14
+ /** Host alias the helper was pushed to. */
15
+ alias: string;
16
+ /** Helper version that was installed. */
17
+ version: string;
18
+ }
19
+ /** Queue one notice for the next JSON response. */
20
+ export declare function pushHostNotice(notice: HostNotice): void;
21
+ /** Take everything queued; the caller attaches it and the queue starts over. */
22
+ export declare function drainHostNotices(): HostNotice[];
@@ -90,11 +90,10 @@ export default class TransparentFileSystem extends FileSystem {
90
90
  }, signal?: AbortSignal, sandboxPolicy?: SandboxExecutionPolicy): Promise<FsEditOutcome>;
91
91
  /**
92
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.
93
+ * apply_patch tool. As of 0.23.0 every provider this plugin mounts implements
94
+ * all three — fs-ssh 0.2.2 talks the protocol-3 helper, which serves
95
+ * `fs.patch`/`fs.delete`/`fs.move` — so the guards below are defensive: they
96
+ * turn a thinner provider into a typed FsError instead of a TypeError.
98
97
  */
99
98
  private unsupportedRemote;
100
99
  patchText(target: FsTarget, hunks: Parameters<FileSystem['patchText']>[1], expected?: {
@@ -187,4 +187,14 @@ export declare class RemoteWorlds {
187
187
  private assertDialAllowed;
188
188
  private noteDialFailure;
189
189
  private createRpc;
190
+ /**
191
+ * Queue a browser notice for an automatic helper push.
192
+ *
193
+ * Only a REAL push is announced: `skipped-same` means the host already runs
194
+ * this build (the self-heal case where an earlier push updated the remote),
195
+ * and announcing an upload that did not happen would be a lie. The notice
196
+ * rides the next JSON response (`src/notices.ts`), which is exactly the
197
+ * request whose dial needed the helper — the surface the user is looking at.
198
+ */
199
+ private notifyHelperPush;
190
200
  }
@@ -471,6 +471,18 @@ export interface RemoteChangedFile {
471
471
  oversized?: true;
472
472
  /** Change kind from --name-status; undefined when git gave none. */
473
473
  status?: 'A' | 'M' | 'D' | 'R' | 'C' | 'T' | 'U';
474
+ /**
475
+ * What "undo this file" may do, decided by the HOST (the client never guesses).
476
+ *
477
+ * - `patch`: a real reverse patch exists — reverting restores the session
478
+ * baseline in one `git apply -R`.
479
+ * - `delete`: the file is a whole-file CREATION git has a copy of (a tracked
480
+ * addition), so the only reverse is deleting it. Recoverable from the index,
481
+ * but still a destructive write, so the client must confirm it.
482
+ * - absent: nothing can be undone — an UNTRACKED creation (git holds no copy),
483
+ * a binary, or a file whose bytes were withheld by the size caps.
484
+ */
485
+ revert?: 'patch' | 'delete';
474
486
  }
475
487
  /**
476
488
  * What one session changed on its remote host since the session's baseline.
@@ -492,8 +504,23 @@ export interface RemoteChangesSummary {
492
504
  deleted: number;
493
505
  /** Wall-clock ms when this summary was last recomputed. */
494
506
  at: number;
495
- /** More files than the cap: `files` is truncated but the totals are whole. */
507
+ /**
508
+ * More files than the cap: `files` is truncated and so are `added` / `deleted`.
509
+ *
510
+ * The totals are summed from the rows that made it into `files` (the cost of
511
+ * counting the rest is a read per path), which is why the panel says "N files
512
+ * changed" about a subset and must not present the counts as whole-tree
513
+ * totals.
514
+ */
496
515
  truncated?: true;
516
+ /**
517
+ * Directory names the new-file scan was told to skip (build output, caches).
518
+ *
519
+ * Present only when the exclusion ran, and listed rather than merely applied:
520
+ * a file the user expected to see must never be missing without a reason. The
521
+ * SCM panel stays the surface that shows every path.
522
+ */
523
+ excludedDirs?: string[];
497
524
  /** A scan is running right now (the slow one counts); the list will refresh. */
498
525
  pending: boolean;
499
526
  /** Why this session has no ledger (local session, no git, timeout, …). */
@@ -507,6 +534,15 @@ export interface RemoteChangesDiff {
507
534
  display: string;
508
535
  /** Text hunks (empty for binary/missing). */
509
536
  hunks: UnifiedHunk[];
537
+ /**
538
+ * The WHOLE file as one reverse-applicable patch (`git apply -R`).
539
+ *
540
+ * One write instead of one per hunk, which is what "revert everything this
541
+ * session did to this file" needs. Empty when the reverse is not expressible
542
+ * as a patch (see `RemoteChangedFile.revert`), which is the fail-closed answer
543
+ * the client must not try to build itself.
544
+ */
545
+ patch?: string;
510
546
  /** File status at turn end (A/M/D/…), when git reported one. */
511
547
  status?: 'A' | 'M' | 'D' | 'R' | 'C' | 'T' | 'U';
512
548
  /** The diff was cut at the byte cap: `hunks` is a prefix. */
@@ -6,8 +6,8 @@ import { createHash, randomBytes } from "node:crypto";
6
6
  import path, { dirname, isAbsolute, join, posix, relative, resolve, sep } from "node:path";
7
7
  import { homedir } from "node:os";
8
8
  import { fileURLToPath } from "node:url";
9
- import { Context } from "@deepseek-ai/cordis";
10
9
  import { SSH_PROTOCOL_VERSION, SshRpcPeer } from "@deepseek-ai/dsh-ssh/protocol";
10
+ import { Context } from "@deepseek-ai/cordis";
11
11
  import { helloSchema } from "@deepseek-ai/dsh-ssh/schemas";
12
12
  import { z } from "zod";
13
13
  //#region \0rolldown/runtime.js
@@ -18449,6 +18449,16 @@ const HELPER_PLATFORMS = /* @__PURE__ */ new Set([
18449
18449
  "macos-x64",
18450
18450
  "macos-arm64"
18451
18451
  ]);
18452
+ /**
18453
+ * Wire protocol this plugin's `dsh-ssh` generation speaks (see MAINTENANCE §2.7).
18454
+ *
18455
+ * Derived from the installed package instead of hardcoded: helper and client
18456
+ * handshake on a strict literal, so a constant that drifts from the package
18457
+ * silently selects a helper the handshake will reject. Before 0.23.0 this was a
18458
+ * hand-maintained `2`; the protocol-3 move (MAINTENANCE §2.51) is why it can no
18459
+ * longer be a second source of truth.
18460
+ */
18461
+ const EXPECTED_HELPER_PROTOCOL = SSH_PROTOCOL_VERSION;
18452
18462
  /** Resolve one cached tarball, or `undefined` when the name escapes the cache dir. */
18453
18463
  function safeHelperTarball(dir, tarball) {
18454
18464
  if (typeof tarball !== "string" || tarball === "" || tarball === "." || tarball === "..") return void 0;
@@ -18551,11 +18561,31 @@ function compareHelperVersionsDesc(a, b) {
18551
18561
  * choice: a cached build whose protocol does not match would install fine and
18552
18562
  * then fail the runtime handshake, so it is not a candidate at all.
18553
18563
  */
18554
- function pickCached(platform, version, expectedProtocol = 2) {
18564
+ function pickCached(platform, version, expectedProtocol = EXPECTED_HELPER_PROTOCOL) {
18555
18565
  const matches = listCachedHelpers().filter((h) => h.platform === platform && h.protocol === expectedProtocol);
18556
18566
  if (version !== void 0 && version !== "") return matches.find((h) => h.version === version);
18557
18567
  return matches[0];
18558
18568
  }
18569
+ /**
18570
+ * Wire protocol of the helper build a deploy record points at, when this machine
18571
+ * still has that build cached.
18572
+ *
18573
+ * Upgrade-day support for `createRpc`: it re-runs the deploy pipeline only when
18574
+ * the record carries NO helper, so a host deployed by an older plugin keeps
18575
+ * dialing a binary from another protocol generation — both sides pin a literal,
18576
+ * so the handshake can only fail and nothing self-heals. The local cache is the
18577
+ * one place that still knows that build's protocol, so the record is classified
18578
+ * here:
18579
+ * - unknown build (not cached here, e.g. deployed from another machine) →
18580
+ * `undefined`: keep the record and let the handshake report the real error;
18581
+ * - cached build of THIS protocol → returns the expected value, so a deliberate
18582
+ * rollback pin (an older build of the same generation) stays pinned;
18583
+ * - cached build of ANOTHER protocol → returns the foreign value; the caller
18584
+ * re-deploys instead of dialing a doomed handshake.
18585
+ */
18586
+ function protocolOfStoredHelper(binarySha256, platform, entries = listCachedHelpers()) {
18587
+ return entries.find((entry) => entry.binarySha256 === binarySha256 && (platform === void 0 || entry.platform === platform))?.protocol;
18588
+ }
18559
18589
  /** Honest availability of the helper channels. */
18560
18590
  function helperAvailability() {
18561
18591
  const cached = listCachedHelpers();
@@ -18955,6 +18985,23 @@ function shRoot(path) {
18955
18985
  return `'${path.replace(/'/g, `'\\''`)}'`;
18956
18986
  }
18957
18987
  //#endregion
18988
+ //#region src/notices.ts
18989
+ /** Bounded so an unreachable client cannot grow Host memory without limit. */
18990
+ const MAX_PENDING$1 = 8;
18991
+ let pending = [];
18992
+ /** Queue one notice for the next JSON response. */
18993
+ function pushHostNotice(notice) {
18994
+ if (pending.length >= MAX_PENDING$1) return;
18995
+ pending = [...pending, notice];
18996
+ }
18997
+ /** Take everything queued; the caller attaches it and the queue starts over. */
18998
+ function drainHostNotices() {
18999
+ if (pending.length === 0) return [];
19000
+ const drained = pending;
19001
+ pending = [];
19002
+ return drained;
19003
+ }
19004
+ //#endregion
18958
19005
  //#region src/p2/in-flight-gate.ts
18959
19006
  var import_lib = require_lib();
18960
19007
  /**
@@ -19925,13 +19972,14 @@ var RemoteWorlds = class {
19925
19972
  reason: error instanceof Error ? error.message : String(error)
19926
19973
  });
19927
19974
  }
19928
- async createRpc(alias) {
19975
+ async createRpc(alias, allowRedeploy = true) {
19929
19976
  let deploy = this.deps.store.require(alias).deploy;
19930
19977
  if (deploy?.artifact === void 0 || !deploy.artifact.startsWith("dsh-ssh-helper/") || deploy.helper === void 0) {
19931
19978
  const failure = deployFailure(deploy);
19932
19979
  if (failure !== void 0 && failure.retryInMs > 0) throw new Error(`helper deploy for ${alias} failed ${failure.attempts} time(s); next automatic attempt in ${Math.ceil(failure.retryInMs / 1e3)}s (deploy it again from Settings to force one now)`);
19933
19980
  const report = await pushPipeline(this.deps.pool, this.deps.store, alias);
19934
19981
  if (report.action === "failed") throw new Error(`helper auto-deploy failed: ${report.detail}`);
19982
+ if (report.action === "pushed") this.notifyHelperPush(alias, report);
19935
19983
  deploy = this.deps.store.require(alias).deploy;
19936
19984
  }
19937
19985
  const helper = deploy?.helper;
@@ -19945,6 +19993,16 @@ var RemoteWorlds = class {
19945
19993
  platform = platform && platform !== "" ? platform : probed.platform === "unknown" ? void 0 : probed.platform;
19946
19994
  if (platform === void 0) throw new Error(`cannot locate helper platform for ${alias}`);
19947
19995
  }
19996
+ const storedProtocol = protocolOfStoredHelper(helper.sha256, platform);
19997
+ if (allowRedeploy && storedProtocol !== void 0 && storedProtocol !== EXPECTED_HELPER_PROTOCOL) {
19998
+ try {
19999
+ this.ctx.logger.info(`[remote-vs] helper on ${alias} speaks wire protocol ${storedProtocol}, this build speaks ${EXPECTED_HELPER_PROTOCOL}; re-deploying before dialing`);
20000
+ } catch {}
20001
+ const report = await pushPipeline(this.deps.pool, this.deps.store, alias);
20002
+ if (report.action === "failed") throw new Error(`helper re-deploy after a wire-protocol change failed: ${report.detail}`);
20003
+ if (report.action === "pushed") this.notifyHelperPush(alias, report);
20004
+ return this.createRpc(alias, false);
20005
+ }
19948
20006
  const helperPath = `${home}/.dsh-helpers/dsh-ssh-helper-${helper.version}-${platform}/dsh-ssh-helper`;
19949
20007
  const conn = new RpcConnection({
19950
20008
  entry: this.deps.store.require(alias),
@@ -19961,6 +20019,24 @@ var RemoteWorlds = class {
19961
20019
  }
19962
20020
  return conn;
19963
20021
  }
20022
+ /**
20023
+ * Queue a browser notice for an automatic helper push.
20024
+ *
20025
+ * Only a REAL push is announced: `skipped-same` means the host already runs
20026
+ * this build (the self-heal case where an earlier push updated the remote),
20027
+ * and announcing an upload that did not happen would be a lie. The notice
20028
+ * rides the next JSON response (`src/notices.ts`), which is exactly the
20029
+ * request whose dial needed the helper — the surface the user is looking at.
20030
+ */
20031
+ notifyHelperPush(alias, report) {
20032
+ const version = report.installed?.helper?.version ?? this.deps.store.require(alias).deploy?.helper?.version;
20033
+ if (version === void 0 || version === "") return;
20034
+ pushHostNotice({
20035
+ kind: "helper-pushed",
20036
+ alias,
20037
+ version
20038
+ });
20039
+ }
19964
20040
  };
19965
20041
  //#endregion
19966
- export { keysDir as C, ensurePrivateDir as S, clampExecTimeout as _, probe as a, aliasRoot as b, RemoteFiles as c, DEFAULT_GIT_TIMEOUT_MS as d, DEFAULT_READ_TIMEOUT_MS as f, MIN_TIMEOUT_MS as g, MAX_TIMEOUT_MS as h, helperAvailability as i, WriteConflictError as l, DeadlineError as m, TombstonedError as n, pushPipeline as o, DEFAULT_TIMEOUTS as p, isWindowsAbsolute as r, seedHelperCache as s, RemoteWorlds as t, attachmentHeader as u, resolveTimeouts as v, storePath as w, dshHome as x, require_lib as y };
20042
+ export { ensurePrivateDir as C, dshHome as S, storePath as T, MIN_TIMEOUT_MS as _, helperAvailability as a, require_lib as b, seedHelperCache as c, attachmentHeader as d, DEFAULT_GIT_TIMEOUT_MS as f, MAX_TIMEOUT_MS as g, DeadlineError as h, drainHostNotices as i, RemoteFiles as l, DEFAULT_TIMEOUTS as m, TombstonedError as n, probe as o, DEFAULT_READ_TIMEOUT_MS as p, isWindowsAbsolute as r, pushPipeline as s, RemoteWorlds as t, WriteConflictError as u, clampExecTimeout as v, keysDir as w, aliasRoot as x, resolveTimeouts as y };
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.21.1",
4
+ "version": "0.23.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.2 <0.3.0"
62
+ "dsh": ">=0.2.2-rc.4 <0.3.0"
63
63
  },
64
64
  "dsh": {
65
65
  "bundle": {
@@ -120,54 +120,54 @@
120
120
  "@codemirror/search": "6.5.11",
121
121
  "@codemirror/state": "^6.7.6",
122
122
  "@codemirror/view": "^6.43.14",
123
- "@deepseek-ai/dsh-fs-ssh": "0.2.1-rc.2",
124
- "@deepseek-ai/dsh-ssh": "0.2.1-rc.2",
123
+ "@deepseek-ai/dsh-fs-ssh": "0.2.2-rc.4",
124
+ "@deepseek-ai/dsh-ssh": "0.2.2-rc.4",
125
125
  "@deepseek-ai/schemastery": "3.19.0",
126
126
  "@lezer/highlight": "1.2.3",
127
127
  "@xterm/addon-fit": "^0.11.0",
128
128
  "@xterm/xterm": "^6.0.0",
129
129
  "ws": "^8.18.0",
130
- "zod": "4.4.3"
130
+ "zod": "4.6.6"
131
131
  },
132
132
  "peerDependencies": {
133
133
  "@deepseek-ai/cordis": "^4.1.0",
134
- "@deepseek-ai/dsh-agent-preset": "^0.2.2-rc.2",
135
- "@deepseek-ai/dsh-bash-local": "^0.2.2-rc.2",
136
- "@deepseek-ai/dsh-file-reference": "^0.2.2-rc.2",
137
- "@deepseek-ai/dsh-fs": "^0.2.2-rc.2",
138
- "@deepseek-ai/dsh-shell": "^0.2.2-rc.2",
139
- "@deepseek-ai/dsh-spill": "^0.2.2-rc.2",
140
- "@deepseek-ai/dsh-subprocess": "^0.2.2-rc.2",
141
- "@deepseek-ai/dsh-tools": "^0.2.2-rc.2",
134
+ "@deepseek-ai/dsh-agent-preset": "^0.2.2-rc.4",
135
+ "@deepseek-ai/dsh-bash-local": "^0.2.2-rc.4",
136
+ "@deepseek-ai/dsh-file-reference": "^0.2.2-rc.4",
137
+ "@deepseek-ai/dsh-fs": "^0.2.2-rc.4",
138
+ "@deepseek-ai/dsh-shell": "^0.2.2-rc.4",
139
+ "@deepseek-ai/dsh-spill": "^0.2.2-rc.4",
140
+ "@deepseek-ai/dsh-subprocess": "^0.2.2-rc.4",
141
+ "@deepseek-ai/dsh-tools": "^0.2.2-rc.4",
142
142
  "react": "^18.2.0",
143
143
  "react-dom": "^18.2.0"
144
144
  },
145
145
  "devDependencies": {
146
146
  "@deepseek-ai/cordis": "^4.1.0",
147
- "@deepseek-ai/dsh-agent": "0.2.2-rc.2",
148
- "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.2",
149
- "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.2",
150
- "@deepseek-ai/dsh-bash-local": "0.2.2-rc.2",
151
- "@deepseek-ai/dsh-client-locale": "0.2.2-rc.2",
152
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.2",
153
- "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.2",
154
- "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.2",
155
- "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.2",
156
- "@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.2",
157
- "@deepseek-ai/dsh-file-reference": "0.2.2-rc.2",
158
- "@deepseek-ai/dsh-fs": "0.2.2-rc.2",
159
- "@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.2",
160
- "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.2",
161
- "@deepseek-ai/dsh-llm": "0.2.2-rc.2",
162
- "@deepseek-ai/dsh-sandbox": "0.2.2-rc.2",
163
- "@deepseek-ai/dsh-session": "0.2.2-rc.2",
164
- "@deepseek-ai/dsh-shell": "0.2.2-rc.2",
165
- "@deepseek-ai/dsh-spill": "0.2.2-rc.2",
166
- "@deepseek-ai/dsh-subprocess": "0.2.2-rc.2",
167
- "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.2",
168
- "@deepseek-ai/dsh-tools": "0.2.2-rc.2",
169
- "@deepseek-ai/dsh-working-directory": "0.2.2-rc.2",
170
- "@deepseek-ai/dsh-workspace": "0.2.2-rc.2",
147
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.4",
148
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.2-rc.4",
149
+ "@deepseek-ai/dsh-api-remotes": "0.2.2-rc.4",
150
+ "@deepseek-ai/dsh-bash-local": "0.2.2-rc.4",
151
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.4",
152
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.4",
153
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.4",
154
+ "@deepseek-ai/dsh-client-ui-sidebar-right": "0.2.2-rc.4",
155
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.4",
156
+ "@deepseek-ai/dsh-client-ui-workspace": "0.2.2-rc.4",
157
+ "@deepseek-ai/dsh-file-reference": "0.2.2-rc.4",
158
+ "@deepseek-ai/dsh-fs": "0.2.2-rc.4",
159
+ "@deepseek-ai/dsh-host-directory-picker": "0.2.2-rc.4",
160
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.4",
161
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.4",
162
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.4",
163
+ "@deepseek-ai/dsh-session": "0.2.2-rc.4",
164
+ "@deepseek-ai/dsh-shell": "0.2.2-rc.4",
165
+ "@deepseek-ai/dsh-spill": "0.2.2-rc.4",
166
+ "@deepseek-ai/dsh-subprocess": "0.2.2-rc.4",
167
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.4",
168
+ "@deepseek-ai/dsh-tools": "0.2.2-rc.4",
169
+ "@deepseek-ai/dsh-working-directory": "0.2.2-rc.4",
170
+ "@deepseek-ai/dsh-workspace": "0.2.2-rc.4",
171
171
  "@types/node": "^22.20.0",
172
172
  "@types/react": "~18.3.1",
173
173
  "@types/react-dom": "^18.3.5",