dsh-plugin-mesh 0.5.14 → 0.5.15

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/client/client.js CHANGED
@@ -6904,6 +6904,10 @@ window.__ModuleLoader__.load({
6904
6904
  const failed = !!report && report.ok !== true;
6905
6905
  const incomparable = !!report && report.ok === true && report.comparable === false;
6906
6906
  const canInstall = hasUpdate && !pending && report.diskVersion !== report.latest;
6907
+ // 查完「没有新版本」以前什么都不渲染,看上去就像检查没生效;
6908
+ // 这里补一个结果:已是最新 vX(点完能看见查到的版本号)。
6909
+ const upToDate =
6910
+ !!report && report.ok === true && !hasUpdate && !incomparable && !pending && !!(report.latest || report.current);
6907
6911
  const label = checking ? "检查中…" : "检查更新";
6908
6912
  const title = failed
6909
6913
  ? `上次检查失败:${String(report.error || "未知原因")}(点一下重试)`
@@ -6935,6 +6939,16 @@ window.__ModuleLoader__.load({
6935
6939
  `已安装 v${pending.version}`,
6936
6940
  )
6937
6941
  : null,
6942
+ upToDate
6943
+ ? h(
6944
+ "span",
6945
+ {
6946
+ className: "mesh-meta-pill",
6947
+ title: `当前 v${report.current};registry 最新 v${report.latest || report.current}${report.cached ? "(本次为缓存结果)" : ""}`,
6948
+ },
6949
+ `已是最新 v${report.latest || report.current}`,
6950
+ )
6951
+ : null,
6938
6952
  pending && pending.restartRequired
6939
6953
  ? h(
6940
6954
  "button",
package/lib/index.js CHANGED
@@ -129,7 +129,7 @@ import {
129
129
  export const name = "dsh-plugin-mesh";
130
130
  export const inject = ["tools", "webServer"];
131
131
 
132
- const VERSION = "0.5.14";
132
+ const VERSION = "0.5.15";
133
133
  // 诊断用:进程启动时间 + 入口真实路径。磁盘上的版本**不在这里缓存** ——
134
134
  // 升级之后进程还跑旧代码,版本号必须现读磁盘才能立刻反映出来(真踩过:
135
135
  // 磁盘升到 0.5.1,进程还在 0.5.0,界面显示 0.5.0)。
@@ -9,11 +9,11 @@
9
9
  * 键是资产名,值是 gzip 压缩后的 sha256。
10
10
  */
11
11
  export const PINNED_CHECKSUMS = {
12
- "dsh-mesh-tsnet-android-amd64.gz": "2b97c82036f361dfda83551fb5a80f84edfc86630df393cc06153f277725e95f",
13
- "dsh-mesh-tsnet-android-arm64.gz": "e88385ad8e1746620564543d201fb9f7d4cb3b26b4a12b5c45e56b35cafba449",
14
- "dsh-mesh-tsnet-darwin-amd64.gz": "793c775bd6b65c491cfa754fe3df3533ef423c0a1d43b95a1a537c7cbe53c8d3",
15
- "dsh-mesh-tsnet-darwin-arm64.gz": "9256a636787956de4a62a651b999e6a336aeffbf8e6eff4f0b558cf22f9fa321",
16
- "dsh-mesh-tsnet-linux-amd64.gz": "1a8df647bba95524c32eb277aeb1eec89a2991e9b0ef04f18255379e0fe35d21",
17
- "dsh-mesh-tsnet-linux-arm64.gz": "c8a3d8d4cad7bf3e28a265b27d79f74c4c807ebb50cb76baef87b8c3cf962bcd",
18
- "dsh-mesh-tsnet-windows-amd64.exe.gz": "4e9676fe371656a91c8d019c9483e0836cea8d28f46a625780cb593419cd6637",
12
+ "dsh-mesh-tsnet-android-amd64.gz": "5bdaaae79ba6530a89b2abcbeb9b3ab211bc9c9bb789cd400575208ef8e4289b",
13
+ "dsh-mesh-tsnet-android-arm64.gz": "b10f13079b5b699d56009890a876f8cef8d391d393da37d348b4012684ffa2cd",
14
+ "dsh-mesh-tsnet-darwin-amd64.gz": "1bdb986591c5bfee6ec1539cf2f7322f4067a700626199254f77d2d9905416f9",
15
+ "dsh-mesh-tsnet-darwin-arm64.gz": "bfe1b07a5be5c4f1841131afbfc319017dd79c3440860e829d8151187845e218",
16
+ "dsh-mesh-tsnet-linux-amd64.gz": "9e5800927abbda33e7c0828ecd882381c8fcab3a7b066491a5eaaee97a22714e",
17
+ "dsh-mesh-tsnet-linux-arm64.gz": "226b6478c35ad893b4d53705103cc4c5233fc4016ee7da2b00b277b1d915a86e",
18
+ "dsh-mesh-tsnet-windows-amd64.exe.gz": "d86b269bdf5d7b04615f911c0462ff5437433e26652cbe65a7780be5a31606ed",
19
19
  };
@@ -25,8 +25,14 @@ import { dirname, join } from "node:path";
25
25
  import { homedir } from "node:os";
26
26
  import { PINNED_CHECKSUMS } from "./checksums.js";
27
27
 
28
- /** Sidecar 控制协议版本;与 sidecar/main.go 的 ProtocolVersion 必须一致。 */
29
- export const SIDECAR_PROTOCOL = 1;
28
+ /**
29
+ * Sidecar 控制协议版本;与 sidecar/main.go 的 ProtocolVersion 必须一致。
30
+ *
31
+ * v2 起才有 /__tsnet/dial(出站流)与 /__tsnet/listen(入站暴露)。v1 的二进制
32
+ * 没有这两个端点,且老插件钉着 v1 那批 sha256 —— 换二进制必须新开 sidecar-v<N>,
33
+ * 覆盖同名资产会让老版本校验失败。
34
+ */
35
+ export const SIDECAR_PROTOCOL = 2;
30
36
  const RELEASE_TAG = `sidecar-v${SIDECAR_PROTOCOL}`;
31
37
  const REPO = "peng456/dsh-plugin-mesh";
32
38
  const ASSET_BASE = `https://github.com/${REPO}/releases/download/${RELEASE_TAG}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-mesh",
3
- "version": "0.5.14",
3
+ "version": "0.5.15",
4
4
  "type": "module",
5
5
  "description": "把跑不完的活交给另一台电脑;跑完,结果回到你面前。两台装了 DSH 的电脑各装一次,自动互相发现,任务派过去由对端的 agent 执行,结果派回来。Hand a long task to another machine: your DSH instances find each other, the peer runs it, and the result comes back. No pairing codes, no IPs, no Tailscale client.",
6
6
  "license": "MIT",
@@ -19,7 +19,9 @@ DIST_DIR="$REPO_ROOT/dist/sidecar"
19
19
 
20
20
  # The release tag is tied to the sidecar control-API protocol, not the plugin
21
21
  # version: the plugin pins a protocol number and refuses mismatched binaries.
22
- PROTOCOL_VERSION=1
22
+ # 必须与 sidecar/main.go 的 ProtocolVersion、lib/tsnet/download.js 的
23
+ # SIDECAR_PROTOCOL 三处一致(脚本里自己会校验前两者)。
24
+ PROTOCOL_VERSION=2
23
25
  RELEASE_TAG="sidecar-v${PROTOCOL_VERSION}"
24
26
  # 发布目标仓库。必须与 lib/tsnet/download.js 里的 REPO 一致,否则插件会去
25
27
  # 另一个仓库找二进制。
package/sidecar/main.go CHANGED
@@ -51,7 +51,11 @@ import (
51
51
 
52
52
  // ProtocolVersion is bumped whenever the control API changes shape, so the
53
53
  // plugin can refuse a stale cached binary instead of failing in confusing ways.
54
- const ProtocolVersion = 1
54
+ //
55
+ // v2:新增出站流 /__tsnet/dial + /__tsnet/undial(SSH 走 tailnet 的前提)和
56
+ // 入站 /__tsnet/listen(把本机端口暴露到 tailnet)。v1 的二进制没有这两个端点,
57
+ // 而老插件钉的是 v1 那批 sha256 —— 所以只能新开 sidecar-v2,不能覆盖 v1 资产。
58
+ const ProtocolVersion = 2
55
59
 
56
60
  var (
57
61
  flHostname = flag.String("hostname", "", "tailnet node name (DNS label); required")