dsh-remote-vs 0.22.0 → 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.
package/src/p2/worlds.ts CHANGED
@@ -18,7 +18,8 @@ import type {} from '@deepseek-ai/dsh-working-directory'
18
18
  import type {} from '@deepseek-ai/dsh-workspace'
19
19
  import type { RemoteStore } from '../store.ts'
20
20
  import type { RemotePool } from '../pool.ts'
21
- import { deployFailure, probe, pushPipeline } from '../deploy.ts'
21
+ import { EXPECTED_HELPER_PROTOCOL, deployFailure, probe, protocolOfStoredHelper, pushPipeline, type PushReport } from '../deploy.ts'
22
+ import { pushHostNotice } from '../notices.ts'
22
23
  import { aliasRoot } from '../paths.ts'
23
24
  import type { RemoteHostEntry, RemoteWorkspaceBinding } from '../protocol.ts'
24
25
  import { RpcConnection } from './helper-rpc.ts'
@@ -716,7 +717,7 @@ export class RemoteWorlds {
716
717
  })
717
718
  }
718
719
 
719
- private async createRpc(alias: string): Promise<RpcConnection> {
720
+ private async createRpc(alias: string, allowRedeploy = true): Promise<RpcConnection> {
720
721
  const entry: RemoteHostEntry = this.deps.store.require(alias)
721
722
  let deploy = entry.deploy
722
723
  if (deploy?.artifact === undefined || !deploy.artifact.startsWith('dsh-ssh-helper/') || deploy.helper === undefined) {
@@ -738,6 +739,7 @@ export class RemoteWorlds {
738
739
  if (report.action === 'failed') {
739
740
  throw new Error(`helper auto-deploy failed: ${report.detail}`)
740
741
  }
742
+ if (report.action === 'pushed') this.notifyHelperPush(alias, report)
741
743
  deploy = this.deps.store.require(alias).deploy
742
744
  }
743
745
  const helper = deploy?.helper
@@ -754,6 +756,33 @@ export class RemoteWorlds {
754
756
  platform = platform && platform !== '' ? platform : probed.platform === 'unknown' ? undefined : probed.platform
755
757
  if (platform === undefined) throw new Error(`cannot locate helper platform for ${alias}`)
756
758
  }
759
+ // Upgrade-day self-heal: a record written by an older plugin names a helper
760
+ // of another wire protocol. Both sides pin the protocol as a literal, so
761
+ // dialing it can only fail — and the first-contact predicate above never
762
+ // re-runs the pipeline for a record that already has a helper. The local
763
+ // cache still knows that build's protocol, so a foreign generation is
764
+ // treated as stale and the cached build this plugin speaks is pushed. A pin
765
+ // to an older build of the SAME protocol is left alone (rollback stays
766
+ // intact); an uncached build is left for the handshake to explain.
767
+ const storedProtocol = protocolOfStoredHelper(helper.sha256, platform)
768
+ if (allowRedeploy && storedProtocol !== undefined && storedProtocol !== EXPECTED_HELPER_PROTOCOL) {
769
+ try {
770
+ this.ctx.logger.info(
771
+ `[remote-vs] helper on ${alias} speaks wire protocol ${storedProtocol}, this build speaks `
772
+ + `${EXPECTED_HELPER_PROTOCOL}; re-deploying before dialing`,
773
+ )
774
+ } catch {
775
+ // Logging must never prevent the heal.
776
+ }
777
+ const report = await pushPipeline(this.deps.pool, this.deps.store, alias)
778
+ if (report.action === 'failed') {
779
+ throw new Error(`helper re-deploy after a wire-protocol change failed: ${report.detail}`)
780
+ }
781
+ if (report.action === 'pushed') this.notifyHelperPush(alias, report)
782
+ // Re-read the refreshed record; a second mismatch is handed to the
783
+ // handshake so its error explains what the pipeline could not fix.
784
+ return this.createRpc(alias, false)
785
+ }
757
786
  const helperPath = `${home}/.dsh-helpers/dsh-ssh-helper-${helper.version}-${platform}/dsh-ssh-helper`
758
787
  const conn = new RpcConnection({
759
788
  entry: this.deps.store.require(alias),
@@ -770,4 +799,19 @@ export class RemoteWorlds {
770
799
  }
771
800
  return conn
772
801
  }
802
+
803
+ /**
804
+ * Queue a browser notice for an automatic helper push.
805
+ *
806
+ * Only a REAL push is announced: `skipped-same` means the host already runs
807
+ * this build (the self-heal case where an earlier push updated the remote),
808
+ * and announcing an upload that did not happen would be a lie. The notice
809
+ * rides the next JSON response (`src/notices.ts`), which is exactly the
810
+ * request whose dial needed the helper — the surface the user is looking at.
811
+ */
812
+ private notifyHelperPush(alias: string, report: PushReport): void {
813
+ const version = report.installed?.helper?.version ?? this.deps.store.require(alias).deploy?.helper?.version
814
+ if (version === undefined || version === '') return
815
+ pushHostNotice({ kind: 'helper-pushed', alias, version })
816
+ }
773
817
  }
@@ -0,0 +1,19 @@
1
+ {
2
+ "kind": "executable",
3
+ "version": "0.2.2-rc.4",
4
+ "platform": "linux-x64",
5
+ "target": "node24-linux-x64",
6
+ "tarball": "dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz",
7
+ "tarballSha256": "05c50b383b1f0b5c5673d7ef962cb0ab36774b40e2beb523ffef0ce92b075705",
8
+ "binarySha256": "8b400153e7071825402faf76ed7dd50deb0c81babd9f961307e18a278dcf27e1",
9
+ "protocol": 3,
10
+ "nodeVersion": "v24.22.3",
11
+ "glibcCeiling": "2.35",
12
+ "builtAt": "2026-11-18T14:21:26+08:00",
13
+ "builtOn": "WSL2 Ubuntu-22.04 (glibc 2.35), build host node v24.21.0 / pkg-embedded node v24.22.3, pnpm 11.28.5, tag dsh-v0.2.2-rc.4 (3f321d32bfe382212a8ed8785c1d47a5a300aa23)",
14
+ "sourcePatch": [
15
+ "glibc-ceiling.patch",
16
+ "ssh-helper-runtime-deps.patch"
17
+ ],
18
+ "notes": "Protocol 3 (generation G2: fs.patch/fs.delete/fs.move present). Two upstream tag defects required source patches: (1) @deepseek-ai/dsh-error is a required peer of dsh-llm/dsh-sandbox/dsh-subprocess/dsh-win32-process but missing from packages/ssh/ssh-helper-runtime dependencies -> verifyRuntimeClosure aborts; (2) @deepseek-ai/dsh-fs-patch is a dependency of dsh-fs-local but compileRuntime() only builds packages listed in that manifest, so its lib/ never existed -> probeHelper handshake ERR_MODULE_NOT_FOUND. Both fixed by ssh-helper-runtime-deps.patch (2 added dependencies). glibc ceiling relaxed from upstream 2.28 to 2.35 because there is no docker for the manylinux pty recompile and the fleet glibc is 2.35. Official 8-check suite passed (verify-ssh-helper-artifact --archive=... --sandbox=required): executable-handshake, guarded-files-and-streams, managed-process-output, process-cancellation, native-pty, native-flock, embedded-ptc-and-deadline, sandbox-enforcement."
19
+ }
@@ -0,0 +1,4 @@
1
+ [diffend] Oversized file quarantined before diffing.
2
+ name: package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz
3
+ size: 47234718 bytes
4
+ sha256: 05c50b383b1f0b5c5673d7ef962cb0ab36774b40e2beb523ffef0ce92b075705
@@ -0,0 +1 @@
1
+ 05c50b383b1f0b5c5673d7ef962cb0ab36774b40e2beb523ffef0ce92b075705 dsh-ssh-helper-0.2.2-rc.4-linux-x64.tar.gz
@@ -0,0 +1,14 @@
1
+ diff --git a/packages/ssh/ssh-helper-runtime/package.json b/packages/ssh/ssh-helper-runtime/package.json
2
+ index f58eabc2..34dd09c8 100644
3
+ --- a/packages/ssh/ssh-helper-runtime/package.json
4
+ +++ b/packages/ssh/ssh-helper-runtime/package.json
5
+ @@ -62,6 +62,8 @@
6
+ "@deepseek-ai/dsh-util-values": "workspace:*",
7
+ "@deepseek-ai/dsh-win32-process": "workspace:*",
8
+ "@deepseek-ai/node-addon-system": "workspace:~",
9
+ - "@deepseek-ai/schemastery": "workspace:~"
10
+ + "@deepseek-ai/schemastery": "workspace:~",
11
+ + "@deepseek-ai/dsh-error": "workspace:*",
12
+ + "@deepseek-ai/dsh-fs-patch": "workspace:*"
13
+ }
14
+ }
@@ -1,16 +0,0 @@
1
- {
2
- "kind": "executable",
3
- "version": "0.2.1-alpha.2",
4
- "platform": "linux-x64",
5
- "target": "node24-linux-x64",
6
- "tarball": "dsh-ssh-helper-0.2.1-alpha.2-linux-x64.tar.gz",
7
- "tarballSha256": "241c1e96e4fec14808440ac767bce5df64d566164f9fb3f338f2474aa2c50421",
8
- "binarySha256": "a19a508d4e0659713f88ea32307a2cec4b4c16afa62e92c0a9fb8e41bdf7c3da",
9
- "protocol": 2,
10
- "nodeVersion": "v24.21.0",
11
- "glibcCeiling": "2.35",
12
- "builtAt": "2026-10-12T14:27:00+08:00",
13
- "builtOn": "WSL2 Ubuntu-22.04 (glibc 2.35), node v24.21.0, pnpm 11.28.5, tag dsh-v0.2.1-alpha.2 (d7432673)",
14
- "sourcePatch": "glibc-ceiling.patch",
15
- "notes": "Upstream gate (2.28) relaxed to 2.35 via DSH_GLIBC_CEILING: no docker for the manylinux pty recompile; fleet glibc is 2.35. Official 8-check suite passed (verify-ssh-helper-artifact --sandbox=required)."
16
- }
@@ -1,4 +0,0 @@
1
- [diffend] Oversized file quarantined before diffing.
2
- name: package/vendor/dsh-remote-helpers/dsh-ssh-helper-0.2.1-alpha.2-linux-x64.tar.gz
3
- size: 46734323 bytes
4
- sha256: 241c1e96e4fec14808440ac767bce5df64d566164f9fb3f338f2474aa2c50421
@@ -1 +0,0 @@
1
- 241c1e96e4fec14808440ac767bce5df64d566164f9fb3f338f2474aa2c50421 dsh-ssh-helper-0.2.1-alpha.2-linux-x64.tar.gz