@qzsy/dsh-bridge 3.1.0 → 3.1.1

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.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # 更新日志
2
2
 
3
+ ## [v3.1.1] - 2026-11-02
4
+
5
+ ### 🐛 修复
6
+
7
+ - 修复启用时 `TypeError: Invalid effect` 导致插件无法激活:`apply()` 不再返回实例对象(宿主会把 async apply 的解析值当作 disposer),改为通过 `getApplyState()` 暴露给单测。
8
+
9
+
3
10
  ## [v3.0.2] - 2026-11-01
4
11
 
5
12
  ### 🐛 修复
package/lib/index.js CHANGED
@@ -68,6 +68,13 @@ function registerRpc(ctx, handler, logger) {
68
68
  }
69
69
  }
70
70
 
71
+ let lastApplyState = null;
72
+
73
+ /** 仅供单测读取 apply 产出的实例(宿主不允许 apply 返回值,见下方注释)。 */
74
+ export function getApplyState() {
75
+ return lastApplyState;
76
+ }
77
+
71
78
  export async function apply(ctx, pluginConfig = {}) {
72
79
  const logger = ctx?.logger?.(name) ?? console;
73
80
  const dshPort = Number(ctx?.webServer?.port) || Number(pluginConfig.targetPort) || 3080;
@@ -404,7 +411,10 @@ export async function apply(ctx, pluginConfig = {}) {
404
411
  };
405
412
  try { ctx.effect?.(() => dispose, `${PLUGIN_ID}: lifecycle`); } catch {}
406
413
 
407
- return { gate, dispose };
414
+ // 宿主(cordis)会把 async apply 的解析值当作 disposer 处理,返回对象会抛
415
+ // TypeError: Invalid effect,导致 "entry did not activate"。这里只暴露给单测,不返回值。
416
+ lastApplyState = { gate, dispose };
417
+ return undefined;
408
418
  }
409
419
 
410
420
  export { GateProxy } from './gate.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qzsy/dsh-bridge",
3
- "version": "3.1.0",
3
+ "version": "3.1.1",
4
4
  "description": "DSH 远程隧道云官方客户端插件:一条命令把本机 DeepSeek Harness 接入云端隧道(设备码绑定、短期令牌、本地门禁代理、HTTP/SSE/WebSocket 反向隧道)。",
5
5
  "releaseNotes": "【v3.1.0】无感登录授权与扫码进入\\n• 面板新增「立即登录授权」:自动申请设备码、浏览器授权、绑定后自动开隧道,无需输入设备码或设置本地口令\\n• 新增扫码入口二维码:https://<控制面>/open/<publicId>,扫码登录 SaaS 账号即可进入隧道\\n• 网关信任头 x-qzsy-gate(HMAC-SHA256,±60 秒):验签通过即免本地口令,未验签隧道来源一律 401\\n• hello-ack 支持 gate.secret 每连接随机下发;改口令/断线自动清理信任密钥\\n• 本地口令降级为可选「高级」局域网能力",
6
6
  "type": "module",