dsh-plugin-mesh 0.3.31 → 0.3.33

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/README.en.md CHANGED
@@ -67,7 +67,7 @@ deciding to talk to them.
67
67
 
68
68
  On an untrusted network (café, dorm, office):
69
69
 
70
- 1. Set `requirePairing: true` in your profile's `cordis.patch.yml`.
70
+ 1. Flip the switch in the Mesh panel's **pairing** card — it takes effect immediately, no restart. (Writing `requirePairing: true` in `cordis.patch.yml` also works and pins it on, so the UI cannot turn it off.)
71
71
  2. Make the pairing secret identical on both machines (the Mesh panel has a field for it).
72
72
 
73
73
  Note the token travels in a plain HTTP header: it guards against stray devices on
package/README.md CHANGED
@@ -650,7 +650,7 @@ agent 多出四个工具:
650
650
  pingIntervalMs: 10000 # ping 保活;0 = 关闭
651
651
  announceIntervalMs: 5000
652
652
  peerTtlMs: 20000 # 多久没消息算离线
653
- requirePairing: false # 见下
653
+ requirePairing: false # 见下(也可以用页面上的开关,不必写配置)
654
654
  agentPreset: standard
655
655
  permissionPreset: workspace-write
656
656
  workspaceRoot: ''
package/client/client.js CHANGED
@@ -202,6 +202,22 @@ window.__ModuleLoader__.load({
202
202
  const [msg, setMsg] = react.useState("");
203
203
  const secret = (self && self.secret) || "";
204
204
  const required = !!(config && config.requirePairing);
205
+ // 配置里写死了 requirePairing: true 时,界面只能显示,不能关
206
+ const pinned = !!(config && config.requirePairingPinned);
207
+ const [toggling, setToggling] = react.useState(false);
208
+
209
+ const toggle = async () => {
210
+ setToggling(true);
211
+ const r = await call("/pairing", { enabled: !required });
212
+ setToggling(false);
213
+ if (r && r.ok) {
214
+ setMsg(r.requirePairing ? "配对码已启用 —— 两台机器要码一致才能互相派任务" : "配对码已停用 —— 同内网发现即可派任务");
215
+ onSaved && onSaved();
216
+ } else {
217
+ setMsg(`切换失败:${(r && r.error) || "未知错误"}`);
218
+ }
219
+ setTimeout(() => setMsg(""), 5000);
220
+ };
205
221
 
206
222
  const copy = async () => {
207
223
  try {
@@ -241,8 +257,25 @@ window.__ModuleLoader__.load({
241
257
  "div",
242
258
  { style: { ...S.muted, marginTop: 8 } },
243
259
  required
244
- ? "当前要求两端配对码一致才能互相派发任务。"
245
- : "默认不需要配对:同一内网发现即可互相派发任务。若你的网络不完全可信(合租/公司/有访客设备),在插件配置里把 requirePairing 设为 true 再回来对码。",
260
+ ? "当前要求两端配对码一致才能互相派发任务。不匹配的请求会被直接拒绝。"
261
+ : "默认不需要配对:同一内网发现即可互相派发任务。若你的网络不完全可信(合租 / 公司 / 有访客设备),打开下面的开关,再把两台机器的配对码对成同一个。",
262
+ ),
263
+ // 开关:状态能看见就要能改。原来只能去改 cordis.patch.yml 再重启。
264
+ h(
265
+ "div",
266
+ { style: { ...S.row, marginTop: 10 } },
267
+ h(
268
+ "button",
269
+ {
270
+ style: required ? S.btn : S.btnPrimary,
271
+ onClick: toggle,
272
+ disabled: toggling || pinned,
273
+ },
274
+ toggling ? "切换中…" : required ? "停用配对码" : "启用配对码",
275
+ ),
276
+ pinned
277
+ ? h("span", { style: { ...S.muted, fontSize: 12 } }, "已由插件配置 requirePairing: true 固定开启,界面不能关闭")
278
+ : h("span", { style: { ...S.muted, fontSize: 12 } }, "改完立即生效,不用重启"),
246
279
  ),
247
280
  open
248
281
  ? h(
@@ -999,7 +1032,7 @@ window.__ModuleLoader__.load({
999
1032
  // 也没有 react-dom,所以没有别的方式在无浏览器环境下验证渲染逻辑。
1000
1033
  // 组件都是纯函数(CapabilityLine 不用 hook),拿 createElement 的返回树
1001
1034
  // 直接走一遍就能断言文案与标记 —— 比"看代码觉得对"强得多。
1002
- exports.__test = { CapabilityLine, PeerRow, MeshPage, TsnetCard };
1035
+ exports.__test = { CapabilityLine, PeerRow, MeshPage, TsnetCard, SecretBox };
1003
1036
  return module.exports;
1004
1037
  },
1005
1038
  });
@@ -138,7 +138,7 @@ test("apply() 注册两个槽位:侧栏图标 + 主面板", () => {
138
138
  assert.ok(regs.includes("main"), `主面板槽未注册:${JSON.stringify(regs)}`);
139
139
  });
140
140
 
141
- const { CapabilityLine, PeerRow, TsnetCard } = mod.__test;
141
+ const { CapabilityLine, PeerRow, TsnetCard, SecretBox } = mod.__test;
142
142
 
143
143
  console.log("\n── CapabilityLine:三种「不知道」必须分开渲染 ──");
144
144
 
@@ -302,5 +302,39 @@ test("enabled 状态下设置面板默认收起(不占版面)", () => {
302
302
  assert.ok(!txt.includes("console.tailscale.com"), "收起时不该显示取码步骤");
303
303
  });
304
304
 
305
+ console.log("\n── SecretBox:配对码要有开关,不能只显示状态 ──");
306
+
307
+ test("未启用时给出「启用配对码」按钮(而不是叫人去改 YAML)", () => {
308
+ const txt = textOf(SecretBox({ self: { secret: "x".repeat(32) }, config: { requirePairing: false }, onSaved: noop })).join(" ");
309
+ assert.ok(txt.includes("启用配对码"), txt.slice(0, 200));
310
+ assert.ok(!txt.includes("在插件配置里把 requirePairing 设为 true"), "不能只让人去翻配置文件");
311
+ });
312
+
313
+ test("已启用时按钮变成「停用配对码」", () => {
314
+ const txt = textOf(SecretBox({ self: { secret: "x".repeat(32) }, config: { requirePairing: true }, onSaved: noop })).join(" ");
315
+ assert.ok(txt.includes("停用配对码"), txt.slice(0, 200));
316
+ });
317
+
318
+ test("说明改动立即生效、不用重启", () => {
319
+ const txt = textOf(SecretBox({ self: { secret: "x".repeat(32) }, config: { requirePairing: false }, onSaved: noop })).join(" ");
320
+ assert.ok(txt.includes("立即生效"), txt.slice(0, 300));
321
+ });
322
+
323
+ test("配置钉死时按钮禁用并说明原因(不能让人以为点了有用)", () => {
324
+ const el = SecretBox({ self: { secret: "x".repeat(32) }, config: { requirePairing: true, requirePairingPinned: true }, onSaved: noop });
325
+ const txt = textOf(el).join(" ");
326
+ assert.ok(txt.includes("固定开启"), txt.slice(0, 300));
327
+ let disabled = false;
328
+ (function walk(n) {
329
+ if (!n || typeof n !== "object") return;
330
+ if (Array.isArray(n)) return n.forEach(walk);
331
+ if (typeof n.type === "function") return walk(n.type(n.props));
332
+ if (n.props && n.props.disabled === true) disabled = true;
333
+ walk(n.children);
334
+ if (n.props && n.props.children !== undefined) walk(n.props.children);
335
+ })(el);
336
+ assert.ok(disabled, "钉死时开关应被禁用");
337
+ });
338
+
305
339
  console.log(`\n${failed === 0 ? "全部通过" : "有失败"}:${passed} 通过 / ${failed} 失败\n`);
306
340
  process.exit(failed === 0 ? 0 : 1);
@@ -0,0 +1,77 @@
1
+ /**
2
+ * 配对码开关的自测。
3
+ *
4
+ * 为什么单独测这一段:它**安全相关**,而且判错的后果是**静默的** ——
5
+ * 配对码没生效时,任务照样能派过去,一切看起来正常,只是不再有保护。
6
+ * 这种东西必须有断言盯着。
7
+ *
8
+ * node lib/_selftest-pairing.mjs
9
+ */
10
+ import { strict as assert } from "node:assert";
11
+ import { resolvePairing } from "./pairing.js";
12
+
13
+ let passed = 0;
14
+ let failed = 0;
15
+ function test(name, fn) {
16
+ try {
17
+ fn();
18
+ passed += 1;
19
+ console.log(` ✓ ${name}`);
20
+ } catch (err) {
21
+ failed += 1;
22
+ console.log(` ✗ ${name}`);
23
+ console.log(` ${err?.message ?? err}`);
24
+ }
25
+ }
26
+
27
+ console.log("\n── 默认必须是关闭(降低上手成本,也是历史默认值)──");
28
+
29
+ test("配置与 state 都没有 → 不需要配对", () => {
30
+ assert.deepEqual(resolvePairing({ config: {}, state: {} }), { required: false, pinned: false });
31
+ });
32
+ test("全空入参 → 不需要配对,且不崩", () => {
33
+ assert.deepEqual(resolvePairing(), { required: false, pinned: false });
34
+ assert.deepEqual(resolvePairing({}), { required: false, pinned: false });
35
+ });
36
+
37
+ console.log("\n── 界面开关:写 state.json,不钉死 ──");
38
+
39
+ test("state.requirePairing = true → 启用,但界面可以再关掉", () => {
40
+ assert.deepEqual(resolvePairing({ config: {}, state: { requirePairing: true } }), {
41
+ required: true,
42
+ pinned: false,
43
+ });
44
+ });
45
+ test("state.requirePairing = false → 关闭", () => {
46
+ assert.equal(resolvePairing({ config: {}, state: { requirePairing: false } }).required, false);
47
+ });
48
+
49
+ console.log("\n── 配置钉死:部署方强制,界面关不掉 ──");
50
+
51
+ test("config.requirePairing = true → 启用且 pinned", () => {
52
+ assert.deepEqual(resolvePairing({ config: { requirePairing: true }, state: {} }), {
53
+ required: true,
54
+ pinned: true,
55
+ });
56
+ });
57
+ test("配置钉死时,state 里写 false 也关不掉(配置优先)", () => {
58
+ const r = resolvePairing({ config: { requirePairing: true }, state: { requirePairing: false } });
59
+ assert.equal(r.required, true);
60
+ assert.equal(r.pinned, true);
61
+ });
62
+
63
+ console.log("\n── 只认严格的布尔 true(防 YAML 字符串坑)──");
64
+
65
+ test('字符串 "true" 不算开启 —— 否则会让人以为配对生效了,实际没有', () => {
66
+ assert.equal(resolvePairing({ config: { requirePairing: "true" }, state: {} }).required, false);
67
+ assert.equal(resolvePairing({ config: {}, state: { requirePairing: "true" } }).required, false);
68
+ });
69
+ test("数字 1 / 空对象等非 true 值都不算开启", () => {
70
+ for (const v of [1, "1", "yes", {}, [], null, undefined]) {
71
+ assert.equal(resolvePairing({ config: { requirePairing: v }, state: {} }).required, false, `config=${JSON.stringify(v)}`);
72
+ assert.equal(resolvePairing({ config: {}, state: { requirePairing: v } }).required, false, `state=${JSON.stringify(v)}`);
73
+ }
74
+ });
75
+
76
+ console.log(`\n${failed === 0 ? "全部通过" : "有失败"}:${passed} 通过 / ${failed} 失败\n`);
77
+ process.exit(failed === 0 ? 0 : 1);
package/lib/index.js CHANGED
@@ -38,13 +38,14 @@ import {
38
38
  } from "./capabilities.js";
39
39
  import { conversationKey, replyTarget } from "./conversation.js";
40
40
  import { buildPrompt } from "./prompt.js";
41
+ import { resolvePairing } from "./pairing.js";
41
42
  import { TsnetNode } from "./tsnet/manager.js";
42
43
  import { tailnetFetch, tailnetOrigin } from "./tsnet/bridge.js";
43
44
 
44
45
  export const name = "dsh-plugin-mesh";
45
46
  export const inject = ["tools", "webServer"];
46
47
 
47
- const VERSION = "0.3.31";
48
+ const VERSION = "0.3.33";
48
49
  const RULE_ID = "mesh-inbound";
49
50
  const RULE_KIND = "mesh";
50
51
  const MAX_BODY = 256 * 1024;
@@ -318,6 +319,30 @@ function saveState(patch) {
318
319
  return next;
319
320
  }
320
321
 
322
+ /**
323
+ * 配对码是否真的要用 —— **每次请求都现算**,所以界面上一开关就立即生效。
324
+ *
325
+ * 两种来源,规则和 tsnet 一致:
326
+ * · 配置里写 `requirePairing: true` → **钉死开启**(部署方强制,界面关不掉)
327
+ * · 否则看 `state.json` 里的 `requirePairing` —— 那是界面上那个开关写的
328
+ *
329
+ * 为什么要界面开关:原来只有配置文件一条路,页面上写着"未启用(默认)"却
330
+ * 没有开关,用户只能去翻 YAML。用户实测就卡在这里("启动开关在哪?")。
331
+ * 默认值仍然是**关闭** —— 这一点没变,打开只是变得可发现、可操作。
332
+ */
333
+ function pairingState(config) {
334
+ return resolvePairing({ config, state: loadState() });
335
+ }
336
+
337
+ function pairingRequired(config) {
338
+ return pairingState(config).required;
339
+ }
340
+
341
+ /** 配置是否把开关钉死了(钉死时界面只能显示、不能改)。 */
342
+ function pairingPinned(config) {
343
+ return pairingState(config).pinned;
344
+ }
345
+
321
346
  /**
322
347
  * 解析 tailnet 的有效配置。
323
348
  *
@@ -1375,9 +1400,11 @@ function startPeerServer(ctx, { config, discovery, inbound, log, warn, waker, th
1375
1400
  res.end(body);
1376
1401
  };
1377
1402
 
1378
- // 默认免配对:内网里发现即可连。只有显式开启 requirePairing 才校验配对码。
1403
+ // 默认免配对:内网里发现即可连。开启配对后才校验配对码。
1404
+ // 注意这里调 pairingRequired() 而**不是**读 config —— 界面上的开关要立即生效,
1405
+ // 不能要求重启(重启会打断用户正在做的事)。
1379
1406
  const authed = (req) =>
1380
- !config.requirePairing || safeEqual(req.headers["x-dsh-mesh-token"], currentSecret());
1407
+ !pairingRequired(config) || safeEqual(req.headers["x-dsh-mesh-token"], currentSecret());
1381
1408
 
1382
1409
  const server = createServer(async (req, res) => {
1383
1410
  const url = new URL(req.url, "http://localhost");
@@ -1385,12 +1412,14 @@ function startPeerServer(ctx, { config, discovery, inbound, log, warn, waker, th
1385
1412
  const self = { ...discovery.selfRecord(), instanceId: discovery.instanceId };
1386
1413
 
1387
1414
  // 免鉴权:只暴露身份,用于连通性探测、主动扫描与配对握手
1388
- if (path === "/mesh/v1/health") return send(res, 200, { ok: true, ...self, requirePairing: config.requirePairing === true });
1415
+ if (path === "/mesh/v1/health") return send(res, 200, { ok: true, ...self, requirePairing: pairingRequired(config) });
1389
1416
  if (path === "/mesh/v1/hello") {
1390
1417
  return send(res, 200, {
1391
1418
  ok: true,
1392
1419
  ...self,
1393
- requirePairing: config.requirePairing === true,
1420
+ requirePairing: pairingRequired(config),
1421
+ // true = 由插件配置钉死,界面上不能关(界面据此禁用开关并说明原因)
1422
+ requirePairingPinned: pairingPinned(config),
1394
1423
  peerPaired: authed(req),
1395
1424
  });
1396
1425
  }
@@ -1767,7 +1796,10 @@ function registerUiRoutes(ctx, { discovery, config, identity, inbound, outbound,
1767
1796
  workspaceRoot: config.workspaceRoot,
1768
1797
  peerTtlMs: config.peerTtlMs,
1769
1798
  announceIntervalMs: config.announceIntervalMs,
1770
- requirePairing: config.requirePairing === true,
1799
+ // 必须用生效值,不能用 config —— 这个接口是 UI 读的,
1800
+ // 界面开关一改就得立刻反映出来(端到端测试就是在这抓到过一次 stale)。
1801
+ requirePairing: pairingRequired(config),
1802
+ requirePairingPinned: pairingPinned(config),
1771
1803
  useMulticast: config.useMulticast !== false,
1772
1804
  scanOnStart: config.scanOnStart !== false,
1773
1805
  scanIntervalMs: config.scanIntervalMs,
@@ -1899,6 +1931,31 @@ function registerUiRoutes(ctx, { discovery, config, identity, inbound, outbound,
1899
1931
  }
1900
1932
  });
1901
1933
 
1934
+ /**
1935
+ * 界面上的「配对码开关」。
1936
+ *
1937
+ * 为什么需要这个接口:原来开启配对只能改 profile 的 cordis.patch.yml 再重启,
1938
+ * 而页面上却明晃晃写着"未启用(默认)"—— 用户在页面上找不到开关,实测就问
1939
+ * 了一句"启动开关在哪?"。状态能看见、却改不了,比不显示更让人困惑。
1940
+ *
1941
+ * 写进 state.json 而不是改写用户的配置文件:配置文件是用户手写的、还带着注释,
1942
+ * 程序去改它风险太大(YAML 注释会被吃掉)。这也是 tsnet 开关一直在用的做法。
1943
+ * 配置里写死 requirePairing: true 的情况仍然优先(部署方能强制)。
1944
+ */
1945
+ route("/mesh/api/pairing", async (req, res) => {
1946
+ const body = await readJson(req);
1947
+ const want = body?.enabled === true;
1948
+ if (pairingPinned(config)) {
1949
+ return send(res, 409, {
1950
+ ok: false,
1951
+ error: "配对码已由插件配置 requirePairing: true 固定开启,界面无法关闭",
1952
+ });
1953
+ }
1954
+ saveState({ requirePairing: want });
1955
+ log(`配对码${want ? "已启用" : "已停用"}(界面切换,立即生效,无需重启)`);
1956
+ return send(res, 200, { ok: true, requirePairing: want });
1957
+ });
1958
+
1902
1959
  route("/mesh/api/secret", async (req, res) => {
1903
1960
  const body = await readJson(req);
1904
1961
  const secret = String(body?.secret ?? "").trim();
package/lib/pairing.js ADDED
@@ -0,0 +1,25 @@
1
+ /**
2
+ * 配对码开关的判定。
3
+ *
4
+ * 单独成模块的理由:这段逻辑**安全相关** —— 判错了配对码会悄悄不生效,
5
+ * 而表面上一切正常(任务照样能派过去)。埋在大文件里的三行 `if` 没人会为它
6
+ * 写测试,所以拆出来、单测它。
7
+ *
8
+ * 两种来源,规则和 tsnet 开关一致:
9
+ * · 插件配置里写 `requirePairing: true` → **钉死开启**(部署方强制,界面关不掉)
10
+ * · 否则看 `state.json` 里的 `requirePairing` —— 那是界面上那个开关写的
11
+ *
12
+ * 默认是**关闭**:同一内网发现即可派任务,降低上手的门槛。这一点没变过 ——
13
+ * 界面开关只是让它变得可发现、可操作,而不是改变默认。
14
+ *
15
+ * @param {{config?: object, state?: object}} input
16
+ * @returns {{required: boolean, pinned: boolean}} pinned = 由配置钉死,界面不可改
17
+ */
18
+ export function resolvePairing({ config, state } = {}) {
19
+ // 只有严格的布尔 true 才算开启。字符串 "true"、数字 1 都不算 ——
20
+ // 从 YAML 里读出来的 "true" 是字符串,把它当开启会让人以为配对生效了。
21
+ if (config && config.requirePairing === true) {
22
+ return { required: true, pinned: true };
23
+ }
24
+ return { required: !!(state && state.requirePairing === true), pinned: false };
25
+ }
package/llms.txt CHANGED
@@ -71,7 +71,7 @@ Override by id in the profile's `cordis.patch.yml`:
71
71
  | `scanTimeoutMs` | natural | `800` | |
72
72
  | `pingIntervalMs` | natural | `10000` | LAN health probe period |
73
73
  | `tsnetProbeIntervalMs` | natural | `60000` | Tailnet health probe period |
74
- | `requirePairing` | boolean | `false` | **Default off: the peer API accepts unauthenticated task POSTs** |
74
+ | `requirePairing` | boolean | `false` | **Default off: the peer API accepts unauthenticated task POSTs.** Setting it `true` here pins pairing on; otherwise the Mesh panel's pairing switch (persisted in `state.json`) decides |
75
75
  | `agentPreset` | string | `"standard"` | Agent preset for auto-created sessions |
76
76
  | `permissionPreset` | string | `"workspace-write"` | Permission preset for auto-created sessions |
77
77
  | `workspaceRoot` | string | `""` | |
@@ -102,7 +102,7 @@ to hunt for it.
102
102
 
103
103
  - Ports: TCP `45917` (peer HTTP), UDP `45892` (multicast group `239.255.42.99`).
104
104
  - Discovery is intentionally public: any host on the same L2 network can see the machine and its self-reported card.
105
- - With `requirePairing: false` (the default), **any host that can reach TCP 45917 can POST a task, which wakes an agent session** using `permissionPreset`. Enable `requirePairing` and share one secret between machines on untrusted networks. The token travels in a plain HTTP header — it guards against stray devices, not against a network sniffer.
105
+ - With `requirePairing: false` (the default), **any host that can reach TCP 45917 can POST a task, which wakes an agent session** using `permissionPreset`. Turn on the pairing switch in the Mesh panel (immediate, no restart) or set `requirePairing: true`, and make both machines share one secret, on untrusted networks. The token travels in a plain HTTP header — it guards against stray devices, not against a network sniffer.
106
106
  - The shared secret is stored in `~/.dsh/mesh/state.json` (mode 0600) alongside `machineName`, the persisted `instanceIds`, and the tsnet auth key. It is never included in the multicast card.
107
107
  - Persistent identity is a UUID per profile; the OS machine fingerprint is used only to reclaim a reinstalled device (same name, or the old record already offline). Two live instances on one physical machine are kept separate.
108
108
  - Sidecar binaries are verified against sha256 checksums pinned in `lib/tsnet/checksums.js` — deliberately not fetched from the same release, so a hostile mirror cannot swap both.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-plugin-mesh",
3
- "version": "0.3.31",
3
+ "version": "0.3.33",
4
4
  "type": "module",
5
5
  "description": "DSH Mesh:局域网自动发现同网段的 DSH 实例、显示每台机器上报的能力,并双向派发任务;可用内置的用户态 Tailscale 节点跨互联网组网。Discovers other DSH instances on the LAN, shows the capabilities each one reports, and dispatches tasks between machines in both directions, with an optional userspace Tailscale node for links across networks.",
6
6
  "license": "MIT",
@@ -58,15 +58,16 @@
58
58
  "selftest:prompt": "node lib/_selftest-prompt.mjs",
59
59
  "selftest:caps": "node lib/_selftest-capabilities.mjs",
60
60
  "selftest:newsession": "node lib/_selftest-newsession.mjs",
61
- "test": "npm run check && npm run selftest && npm run selftest:prompt && npm run selftest:client && npm run selftest:caps",
62
- "check": "node scripts/check-version.mjs && node scripts/check-tdz.mjs && node --check lib/index.js && node --check lib/discovery.js && node --check lib/conversation.js && node --check lib/identity.js && node --check lib/capabilities.js && node --check lib/prompt.js && node --check lib/scan.js && node --check lib/tsnet/download.js && node --check lib/tsnet/manager.js && node --check lib/tsnet/bridge.js && node --check client/client.js && npm run check:loadable && npm run check:docs",
61
+ "test": "npm run check && npm run selftest && npm run selftest:prompt && npm run selftest:pairing && npm run selftest:client && npm run selftest:caps",
62
+ "check": "node scripts/check-version.mjs && node scripts/check-tdz.mjs && node --check lib/index.js && node --check lib/discovery.js && node --check lib/conversation.js && node --check lib/identity.js && node --check lib/capabilities.js && node --check lib/prompt.js && node --check lib/pairing.js && node --check lib/scan.js && node --check lib/tsnet/download.js && node --check lib/tsnet/manager.js && node --check lib/tsnet/bridge.js && node --check client/client.js && npm run check:loadable && npm run check:docs",
63
63
  "build:sidecar": "bash scripts/build-sidecar.sh",
64
64
  "verify:mirror": "node scripts/verify-lan-mirror.mjs",
65
65
  "check:loadable": "node scripts/check-loadable.mjs --allow-missing-runtime-dep",
66
66
  "check:deploy": "node scripts/check-loadable.mjs",
67
67
  "check:scope": "python3 tools/scopecheck.py lib/index.js",
68
68
  "prepublishOnly": "npm test && node scripts/check-tarball.mjs",
69
- "check:docs": "node scripts/sync-llms.mjs"
69
+ "check:docs": "node scripts/sync-llms.mjs",
70
+ "selftest:pairing": "node lib/_selftest-pairing.mjs"
70
71
  },
71
72
  "publishConfig": {
72
73
  "registry": "https://registry.npmjs.org/",