dsh-local-link 1.2.5 → 1.2.7

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/lib/index.d.mts CHANGED
@@ -1,6 +1,5 @@
1
1
  import z from "@deepseek-ai/schemastery";
2
2
  import { Context } from "@deepseek-ai/cordis";
3
- //#region src/config.d.ts
4
3
  type AccessMode = 'pairing' | 'trusted-lan';
5
4
  interface PluginConfig {
6
5
  listenHost?: string;
@@ -15,8 +14,6 @@ interface PluginConfig {
15
14
  stateFile: string;
16
15
  }
17
16
  declare const Config: z<PluginConfig>;
18
- //#endregion
19
- //#region src/plugin.d.ts
20
17
  interface LocalLinkGatewayService {
21
18
  readonly trustedHosts: readonly string[];
22
19
  }
@@ -28,6 +25,5 @@ declare module '@deepseek-ai/cordis' {
28
25
  declare const name = "dsh-local-link";
29
26
  declare const inject: string[];
30
27
  declare function apply(ctx: Context, config: PluginConfig): Promise<void>;
31
- //#endregion
32
28
  export { type AccessMode, Config, type PluginConfig, apply, inject, name };
33
29
  //# sourceMappingURL=index.d.mts.map
package/lib/index.mjs CHANGED
@@ -6,7 +6,7 @@ import { networkInterfaces } from "node:os";
6
6
  import { createServer, request } from "node:http";
7
7
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
8
8
  import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
9
- //#region src/network.ts
9
+ // src/network.ts
10
10
  function normalizeAddress(address) {
11
11
  const zone = address.indexOf("%");
12
12
  return zone < 0 ? address : address.slice(0, zone);
@@ -60,8 +60,7 @@ function allowedGatewayHost(value, listenHost, listenPort, addresses) {
60
60
  if (parsed === void 0 || parsed.port !== listenPort) return false;
61
61
  return (listenHost === "0.0.0.0" ? addresses : [listenHost]).includes(parsed.hostname);
62
62
  }
63
- //#endregion
64
- //#region src/config.ts
63
+ // src/config.ts
65
64
  const Config = z.object({
66
65
  listenHost: z.string().default("0.0.0.0"),
67
66
  listenPort: z.natural().max(65535).default(3088),
@@ -103,8 +102,7 @@ function parseConfig(value) {
103
102
  stateFile
104
103
  });
105
104
  }
106
- //#endregion
107
- //#region src/gateway/admin-auth.ts
105
+ // src/gateway/admin-auth.ts
108
106
  function loopbackHostname(value) {
109
107
  const hostname = value.toLowerCase().replace(/^\[|\]$/gu, "");
110
108
  if (hostname === "localhost" || hostname === "::1") return true;
@@ -138,8 +136,7 @@ function isLoopbackAdminSource(remoteAddress, host, origin) {
138
136
  const remote = remoteAddress?.replace(/^::ffff:/u, "");
139
137
  return (remote === "127.0.0.1" || remote === "::1") && loopbackAuthority(host) && loopbackOrigin(origin);
140
138
  }
141
- //#endregion
142
- //#region src/auth/device-store.ts
139
+ // src/auth/device-store.ts
143
140
  function hashToken(token) {
144
141
  return createHash("sha256").update(token, "utf8").digest();
145
142
  }
@@ -278,8 +275,7 @@ var DeviceStore = class {
278
275
  return write;
279
276
  }
280
277
  };
281
- //#endregion
282
- //#region src/auth/pairing.ts
278
+ // src/auth/pairing.ts
283
279
  var PairingTokens = class {
284
280
  ttlMs;
285
281
  current;
@@ -319,8 +315,7 @@ var PairingTokens = class {
319
315
  return this.current.status;
320
316
  }
321
317
  };
322
- //#endregion
323
- //#region src/diagnostics.ts
318
+ // src/diagnostics.ts
324
319
  const SAFE_CONTEXT_KEYS = /* @__PURE__ */ new Set([
325
320
  "reason",
326
321
  "method",
@@ -447,10 +442,13 @@ var DiagnosticStore = class {
447
442
  return write;
448
443
  }
449
444
  };
450
- //#endregion
451
- //#region src/gateway/html.ts
445
+ // src/gateway/html.ts
452
446
  const CLIENT_ID = "dsh-local-link";
453
- const HOST_DIRECTORY_PICKER_IDS = /* @__PURE__ */ new Set(["@deepseek-ai/dsh-client-ui-directory-picker-native", "@deepseek-ai/dsh-client-ui-directory-picker-browse"]);
447
+ const HOST_ONLY_CLIENT_IDS = /* @__PURE__ */ new Set([
448
+ "@deepseek-ai/dsh-client-ui-directory-picker-native",
449
+ "@deepseek-ai/dsh-client-ui-directory-picker-browse",
450
+ "@deepseek-ai/dsh-client-ui-open-in-app"
451
+ ]);
454
452
  const RANDOM_UUID_POLYFILL = `if(!window.crypto.randomUUID){window.crypto.randomUUID=function(){const b=new Uint8Array(16);window.crypto.getRandomValues(b);b[6]=(b[6]&15)|64;b[8]=(b[8]&63)|128;const h=Array.from(b,value=>value.toString(16).padStart(2,'0'));return h.slice(0,4).join('')+'-'+h.slice(4,6).join('')+'-'+h.slice(6,8).join('')+'-'+h.slice(8,10).join('')+'-'+h.slice(10).join('')}};`;
455
453
  function ensureResponsiveViewport(html) {
456
454
  const match = /<meta\b(?=[^>]*\bname\s*=\s*["']viewport["'])[^>]*>/iu.exec(html);
@@ -465,11 +463,11 @@ function ensureResponsiveViewport(html) {
465
463
  const replacement = content.test(match[0]) ? match[0].replace(content, (_whole, quote, value) => `content=${quote}${value},viewport-fit=cover${quote}`) : match[0].replace(/\s*\/?>$/u, " content=\"width=device-width,initial-scale=1,viewport-fit=cover\">");
466
464
  return `${html.slice(0, match.index)}${replacement}${html.slice(match.index + match[0].length)}`;
467
465
  }
468
- function removeHostDirectoryPickers(manifest, entries) {
466
+ function removeHostOnlyCapabilities(manifest, entries) {
469
467
  const removed = /* @__PURE__ */ new Set();
470
468
  for (let index = entries.length - 1; index >= 0; index -= 1) {
471
469
  const id = String(entries[index]?.id);
472
- if (!HOST_DIRECTORY_PICKER_IDS.has(id)) continue;
470
+ if (!HOST_ONLY_CLIENT_IDS.has(id)) continue;
473
471
  removed.add(id);
474
472
  entries.splice(index, 1);
475
473
  }
@@ -482,7 +480,7 @@ function removeHostDirectoryPickers(manifest, entries) {
482
480
  }
483
481
  /**
484
482
  * Keep the shipped Harness root and every dynamic child slot. The gateway only
485
- * removes Host-side directory picker capabilities from remote browsers and
483
+ * removes Host-side directory picker and native app capabilities from remote browsers and
486
484
  * adds the secure-context polyfill required by the stock browser transport.
487
485
  */
488
486
  function rewriteAuthenticatedIndex(html) {
@@ -496,11 +494,10 @@ function rewriteAuthenticatedIndex(html) {
496
494
  if (!Array.isArray(manifest.entries)) throw new Error("DSH boot manifest has no entries");
497
495
  const entries = manifest.entries;
498
496
  if (!entries.some((entry) => entry.id === CLIENT_ID)) throw new Error("dsh-local-link client is absent from DSH boot manifest");
499
- removeHostDirectoryPickers(manifest, entries);
497
+ removeHostOnlyCapabilities(manifest, entries);
500
498
  return ensureResponsiveViewport(`${html.slice(0, assignment.index)}${RANDOM_UUID_POLYFILL}${assignment[0]}${JSON.stringify(manifest)};${html.slice(scriptEnd)}`);
501
499
  }
502
- //#endregion
503
- //#region src/locales/en.json
500
+ // src/locales/en.json
504
501
  var pair_title$1 = "Connecting to DeepSeek Harness";
505
502
  var pair_connecting$1 = "Connecting this device…";
506
503
  var pair_incomplete$1 = "This connection link is incomplete.";
@@ -508,8 +505,7 @@ var pair_expired$1 = "This QR code expired or was already used.";
508
505
  var pair_failed$1 = "Could not connect this device.";
509
506
  var pair_unreachable$1 = "Could not reach this computer. Check the local network and try again.";
510
507
  var pair_timeout$1 = "Connection timed out. Generate a new code and try again.";
511
- //#endregion
512
- //#region src/locales/zh.json
508
+ // src/locales/zh.json
513
509
  var pair_title = "正在连接 DeepSeek Harness";
514
510
  var pair_connecting = "正在连接此设备…";
515
511
  var pair_incomplete = "此连接链接不完整。";
@@ -517,8 +513,7 @@ var pair_expired = "此二维码已过期或已被使用。";
517
513
  var pair_failed = "无法连接此设备。";
518
514
  var pair_unreachable = "无法访问此计算机。请检查本地网络后重试。";
519
515
  var pair_timeout = "连接超时。请生成新二维码后重试。";
520
- //#endregion
521
- //#region src/gateway/pair-page.ts
516
+ // src/gateway/pair-page.ts
522
517
  const PAIR_PATH = "/__dsh-local-link/pair";
523
518
  const CONNECT_PATH = "/__dsh-local-link/connect";
524
519
  const pairCopies = {
@@ -585,8 +580,7 @@ const PAIR_PAGE = `<!doctype html>
585
580
  }catch(error){stop(error instanceof Error?error.message:copy.failed);}})();
586
581
  <\/script>
587
582
  </html>`;
588
- //#endregion
589
- //#region src/gateway/local-gateway.ts
583
+ // src/gateway/local-gateway.ts
590
584
  const COOKIE_NAME = "dsh_local_link_device";
591
585
  const MAX_PAIR_BODY = 4096;
592
586
  const STREAM_PATHS = /* @__PURE__ */ new Set([
@@ -710,7 +704,16 @@ function supportedWebSocketTarget(target) {
710
704
  function isLoopbackOnlyRpcTarget(target) {
711
705
  if (!target.pathname.startsWith("/api/")) return false;
712
706
  try {
713
- return LOOPBACK_ONLY_RPC_METHODS.has(decodeURIComponent(target.pathname.slice(5)));
707
+ const method = decodeURIComponent(target.pathname.slice(5)).replaceAll("/", ".").replace(/^agentPresets\./u, "agentPreset.");
708
+ return LOOPBACK_ONLY_RPC_METHODS.has(method);
709
+ } catch {
710
+ return true;
711
+ }
712
+ }
713
+ function isLoopbackOnlyNativeTarget(target) {
714
+ try {
715
+ const pathname = decodeURIComponent(target.pathname);
716
+ return pathname === "/open-in-app" || pathname.startsWith("/open-in-app/");
714
717
  } catch {
715
718
  return true;
716
719
  }
@@ -897,7 +900,7 @@ var LocalGateway = class {
897
900
  }
898
901
  return;
899
902
  }
900
- if (isLoopbackOnlyRpcTarget(url)) {
903
+ if (isLoopbackOnlyRpcTarget(url) || isLoopbackOnlyNativeTarget(url)) {
901
904
  this.diagnostics.record("warn", "REQUEST_REJECTED", { reason: "loopback_only_rpc" });
902
905
  send(response, 403, "This DeepSeek Harness action is available only on the host computer.");
903
906
  return;
@@ -998,8 +1001,7 @@ var LocalGateway = class {
998
1001
  });
999
1002
  }
1000
1003
  };
1001
- //#endregion
1002
- //#region src/plugin.ts
1004
+ // src/plugin.ts
1003
1005
  const name = "dsh-local-link";
1004
1006
  const inject = ["webServer"];
1005
1007
  const ADMIN_PREFIX = "/__dsh-local-link/admin";
@@ -1130,7 +1132,6 @@ async function apply(ctx, config) {
1130
1132
  };
1131
1133
  }, "dsh-local-link: local authenticated mobile gateway");
1132
1134
  }
1133
- //#endregion
1134
1135
  export { Config, apply, inject, name };
1135
1136
 
1136
1137
  //# sourceMappingURL=index.mjs.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dsh-local-link",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "DeepSeek Harness plugin for lightweight LAN access to the current Web UI from phones, tablets, and other computers.",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -58,15 +58,17 @@
58
58
  },
59
59
  "scripts": {
60
60
  "build": "tsdown",
61
+ "prepublishOnly": "node scripts/npm-publish.ts --check",
61
62
  "prepack": "npm run build",
62
- "release:check": "npm run verify && pnpm audit --prod && npm publish --dry-run",
63
+ "release:check": "npm run verify && pnpm audit --prod && npm run release:publish -- --dry-run",
64
+ "release:publish": "node scripts/npm-publish.ts",
63
65
  "test": "vitest run",
64
66
  "typecheck": "tsc --noEmit",
65
67
  "verify": "npm run typecheck && npm run test && npm pack --dry-run"
66
68
  },
67
69
  "engines": {
68
70
  "node": "^22.19.0 || >=24.0.0",
69
- "dsh": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.7-rc.2 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-rc.2 || 0.2.1-rc.5"
71
+ "dsh": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.7-rc.2 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-rc.2 || 0.2.1-rc.5 || 0.2.2-rc.1 || 0.2.2-rc.5"
70
72
  },
71
73
  "keywords": [
72
74
  "deepseek",
@@ -90,7 +92,7 @@
90
92
  "author": "DoNotEatMe",
91
93
  "peerDependencies": {
92
94
  "@deepseek-ai/cordis": "^4.0.2",
93
- "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.7-rc.2 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-rc.2 || 0.2.1-rc.5",
95
+ "@deepseek-ai/dsh-host-webserver": "0.1.0-rc.8 || 0.1.1-rc.2 || 0.1.2-rc.1 || 0.1.5-rc.1 || 0.1.5-rc.2 || 0.1.7-rc.2 || 0.2.0-rc.2 || 0.2.1-alpha.2 || 0.2.1-rc.2 || 0.2.1-rc.5 || 0.2.2-rc.1 || 0.2.2-rc.5",
94
96
  "react": "^18.2.0"
95
97
  },
96
98
  "peerDependenciesMeta": {
@@ -105,49 +107,49 @@
105
107
  }
106
108
  },
107
109
  "dependencies": {
108
- "@deepseek-ai/schemastery": "^3.18.5",
110
+ "@deepseek-ai/schemastery": "~3.19.0",
109
111
  "qrcode": "^1.5.4"
110
112
  },
111
113
  "devDependencies": {
112
- "@deepseek-ai/cordis": "^4.0.5",
113
- "@deepseek-ai/cordis-plugin-include": "1.0.10",
114
- "@deepseek-ai/dsh-agent": "0.2.1-rc.5",
115
- "@deepseek-ai/dsh-agent-default-model": "0.2.1-rc.5",
116
- "@deepseek-ai/dsh-api-gateway": "0.2.1-rc.5",
117
- "@deepseek-ai/dsh-api-session-controller": "0.2.1-rc.5",
118
- "@deepseek-ai/dsh-atomic-write": "0.2.1-rc.5",
119
- "@deepseek-ai/dsh-attachment": "0.2.1-rc.5",
120
- "@deepseek-ai/dsh-client-connection": "0.2.1-rc.5",
121
- "@deepseek-ai/dsh-client-locale": "0.2.1-rc.5",
122
- "@deepseek-ai/dsh-client-ui-conversation": "0.2.1-rc.5",
123
- "@deepseek-ai/dsh-client-ui-layout": "0.2.1-rc.5",
124
- "@deepseek-ai/dsh-client-ui-primitives": "0.2.1-rc.5",
125
- "@deepseek-ai/dsh-client-ui-renderer": "0.2.1-rc.5",
126
- "@deepseek-ai/dsh-client-ui-session": "0.2.1-rc.5",
127
- "@deepseek-ai/dsh-client-ui-settings": "0.2.1-rc.5",
128
- "@deepseek-ai/dsh-client-ui-sidebar": "0.2.1-rc.5",
129
- "@deepseek-ai/dsh-client-ui-slots": "0.2.1-rc.5",
130
- "@deepseek-ai/dsh-client-ui-theme": "0.2.1-rc.5",
131
- "@deepseek-ai/dsh-file-reference": "0.2.1-rc.5",
132
- "@deepseek-ai/dsh-home-paths": "0.2.1-rc.5",
133
- "@deepseek-ai/dsh-host-webserver": "0.2.1-rc.5",
134
- "@deepseek-ai/dsh-llm": "0.2.1-rc.5",
135
- "@deepseek-ai/dsh-native-command": "0.2.1-rc.5",
136
- "@deepseek-ai/dsh-sandbox": "0.2.1-rc.5",
137
- "@deepseek-ai/dsh-scope": "0.2.1-rc.5",
138
- "@deepseek-ai/dsh-session": "0.2.1-rc.5",
139
- "@deepseek-ai/dsh-session-log-export": "0.2.1-rc.5",
140
- "@deepseek-ai/dsh-session-persistence": "0.2.1-rc.5",
141
- "@deepseek-ai/dsh-session-projection": "0.2.1-rc.5",
142
- "@deepseek-ai/dsh-session-query": "0.2.1-rc.5",
143
- "@deepseek-ai/dsh-session-title": "0.2.1-rc.5",
144
- "@deepseek-ai/dsh-settings": "0.2.1-rc.5",
145
- "@deepseek-ai/dsh-skill": "0.2.1-rc.5",
146
- "@deepseek-ai/dsh-storage": "0.2.1-rc.5",
147
- "@deepseek-ai/dsh-storage-domain": "0.2.1-rc.5",
148
- "@deepseek-ai/dsh-subagent": "0.2.1-rc.5",
149
- "@deepseek-ai/dsh-system-prompt": "0.2.1-rc.5",
150
- "@deepseek-ai/dsh-timeout": "0.2.1-rc.5",
114
+ "@deepseek-ai/cordis": "~4.1.0",
115
+ "@deepseek-ai/cordis-plugin-include": "~1.1.0",
116
+ "@deepseek-ai/dsh-agent": "0.2.2-rc.5",
117
+ "@deepseek-ai/dsh-agent-default-model": "0.2.2-rc.5",
118
+ "@deepseek-ai/dsh-api-gateway": "0.2.2-rc.5",
119
+ "@deepseek-ai/dsh-api-session-controller": "0.2.2-rc.5",
120
+ "@deepseek-ai/dsh-atomic-write": "0.2.2-rc.5",
121
+ "@deepseek-ai/dsh-attachment": "0.2.2-rc.5",
122
+ "@deepseek-ai/dsh-client-connection": "0.2.2-rc.5",
123
+ "@deepseek-ai/dsh-client-locale": "0.2.2-rc.5",
124
+ "@deepseek-ai/dsh-client-ui-conversation": "0.2.2-rc.5",
125
+ "@deepseek-ai/dsh-client-ui-layout": "0.2.2-rc.5",
126
+ "@deepseek-ai/dsh-client-ui-primitives": "0.2.2-rc.5",
127
+ "@deepseek-ai/dsh-client-ui-renderer": "0.2.2-rc.5",
128
+ "@deepseek-ai/dsh-client-ui-session": "0.2.2-rc.5",
129
+ "@deepseek-ai/dsh-client-ui-settings": "0.2.2-rc.5",
130
+ "@deepseek-ai/dsh-client-ui-sidebar": "0.2.2-rc.5",
131
+ "@deepseek-ai/dsh-client-ui-slots": "0.2.2-rc.5",
132
+ "@deepseek-ai/dsh-client-ui-theme": "0.2.2-rc.5",
133
+ "@deepseek-ai/dsh-file-reference": "0.2.2-rc.5",
134
+ "@deepseek-ai/dsh-home-paths": "0.2.2-rc.5",
135
+ "@deepseek-ai/dsh-host-webserver": "0.2.2-rc.5",
136
+ "@deepseek-ai/dsh-llm": "0.2.2-rc.5",
137
+ "@deepseek-ai/dsh-native-command": "0.2.2-rc.5",
138
+ "@deepseek-ai/dsh-sandbox": "0.2.2-rc.5",
139
+ "@deepseek-ai/dsh-scope": "0.2.2-rc.5",
140
+ "@deepseek-ai/dsh-session": "0.2.2-rc.5",
141
+ "@deepseek-ai/dsh-session-log-export": "0.2.2-rc.5",
142
+ "@deepseek-ai/dsh-session-persistence": "0.2.2-rc.5",
143
+ "@deepseek-ai/dsh-session-projection": "0.2.2-rc.5",
144
+ "@deepseek-ai/dsh-session-query": "0.2.2-rc.5",
145
+ "@deepseek-ai/dsh-session-title": "0.2.2-rc.5",
146
+ "@deepseek-ai/dsh-settings": "0.2.2-rc.5",
147
+ "@deepseek-ai/dsh-skill": "0.2.2-rc.5",
148
+ "@deepseek-ai/dsh-storage": "0.2.2-rc.5",
149
+ "@deepseek-ai/dsh-storage-domain": "0.2.2-rc.5",
150
+ "@deepseek-ai/dsh-subagent": "0.2.2-rc.5",
151
+ "@deepseek-ai/dsh-system-prompt": "0.2.2-rc.5",
152
+ "@deepseek-ai/dsh-timeout": "0.2.2-rc.5",
151
153
  "@types/node": "^24.3.0",
152
154
  "@types/qrcode": "^1.5.5",
153
155
  "@types/react": "~18.3.1",
@@ -164,5 +166,7 @@
164
166
  "bugs": {
165
167
  "url": "https://github.com/donoteatme/dsh-local-link/issues"
166
168
  },
167
- "homepage": "https://github.com/donoteatme/dsh-local-link#readme"
169
+ "homepage": "https://github.com/donoteatme/dsh-local-link#readme",
170
+ "readme": "# dsh-local-link\n\n**English** | [中文](README.zh.md) | [Русский](README.ru.md)\n\n[![CI](https://github.com/donoteatme/dsh-local-link/actions/workflows/ci.yml/badge.svg)](https://github.com/donoteatme/dsh-local-link/actions/workflows/ci.yml)\n[![npm](https://img.shields.io/npm/v/dsh-local-link.svg)](https://www.npmjs.com/package/dsh-local-link)\n[![npm downloads](https://img.shields.io/npm/dm/dsh-local-link.svg)](https://www.npmjs.com/package/dsh-local-link)\n[![Awesome DSH Plugin](https://awesome-dsh-plugin.com/badge.svg)](https://awesome-dsh-plugin.com/p/donoteatme/dsh-local-link/)\n[![DSH Market](https://raw.githubusercontent.com/2BingLing/dsh-market/master/assets/readme/badge-listed-en.svg)](https://dsh.market/)\n[![license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nUse the same [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) Web session from a phone, tablet, or another computer on your trusted private network. `dsh-local-link` adds one-time QR pairing and a responsive Mobile View to the stock DSH client—without a hosted relay, cloud account, native app, replacement chat UI, or second workspace picker.\n\nOpen `Local access`, scan the QR code, and the paired browser arrives at the desktop's currently selected Harness session with the same live conversation, permissions, workspaces, and plugin surfaces.\n\nLocal Link `1.2.7` supports DeepSeek Harness `0.2.2-rc.5` and the earlier Hosts declared in `engines.dsh`. It reorganizes the stock Web interface into responsive drawers, compact session controls, and touch-friendly actions while keeping the same client, session, plugin slots, permissions, and live agent stream.\n\n> **Security boundary:** the gateway uses plain HTTP and is intended only for a trusted private network. Do not expose its port to the internet or use it on public Wi-Fi.\n\n<p align=\"center\">\n <img src=\"docs/images/local-access-qr.jpg\" width=\"960\" alt=\"DeepSeek Harness with dsh-local-link open: one-time QR pairing to the current stock Harness session\">\n</p>\n\n<p align=\"center\"><sub>One Harness session, paired directly across the trusted LAN.</sub></p>\n\n## Features and scope\n\nLocal Link is intentionally a small LAN companion for the existing Harness Web client, not a general remote-access platform. Its purpose is to make one path dependable: open the Harness instance already running on a computer from another trusted device on the same private network, then use the same sessions and interface in a browser.\n\nDevelopment stays focused on:\n\n- reliable same-LAN browser access to the current Harness Host;\n- short-lived invitations and understandable paired-device lifecycle controls;\n- responsive presentation of the stock client without duplicating Harness business logic;\n- compatibility with registered Harness views, slots, permissions, themes, and session state;\n- accessibility, localization, bounded diagnostics, and security hardening inside that boundary.\n\nThe following are deliberate non-goals:\n\n- public-internet exposure, hosted relays, managed tunnels, or cloud accounts;\n- a separate native phone or desktop application;\n- a replacement chat client or fork of the Harness interface;\n- independent workspace, file, or session synchronization outside Harness;\n- a general-purpose remote extension runtime unrelated to opening the current Web UI.\n\nThis does not mean the plugin is finished or frozen. It means future changes should make the local browser path simpler, safer, more compatible, or easier to diagnose instead of widening the product into a different class of system.\n\n## Install\n\n### npm — recommended\n\nStop a running `dsh web` process, install the plugin into the Web profile, then start Harness again:\n\n```shell\ndsh plugin --profile web add dsh-local-link\ndsh web\n```\n\n### Git clone — development checkout\n\nRequirements for this checkout: Git, Node.js 24.9+, Corepack, and a global `dsh` installation compatible with the package's declared `engines.dsh` range. Harness `0.2.2` requires Node.js 24.9+; the plugin retains its Node.js 22.19 baseline for older declared Hosts.\n\n```shell\ngit clone https://github.com/donoteatme/dsh-local-link.git\ncd dsh-local-link\ncorepack pnpm install --frozen-lockfile\nnpm run verify\ndsh plugin --profile web add .\ndsh web\n```\n\nThe profile points at the checkout, so rebuild after changing client code and restart `dsh web` after Host-side changes.\n\n## Compatibility\n\nLocal Link `1.2.7` is built and checked against DeepSeek Harness `0.2.2-rc.5`, including ordinary plugin startup without a version exemption. Its mobile adapter supports the native sidebar mask and navigation lifecycle. The gateway recognizes both legacy dotted and current slash-based API names, while native app launching and Host administration remain available only on the Harness computer. Existing `webStartup` / `webRuntime`, public Session scopes, and native Settings navigation integrations are retained.\n\nThe installable DeepSeek Harness range is declared in `package.json` through `engines.dsh`. Compatibility is checked against exact releases—not inferred from a successful installation or a moving dist-tag.\n\nAcceptance on `0.2.2-rc.5` covers pairing, selected-chat QR handoff, authenticated HTTP/WebSocket access, immediate socket closure on revoke, Host-only API and native-app restrictions, new-chat creation, paired-device controls, and mobile layouts at 320–768 CSS pixels in EN and ZH. These checks used isolated profiles with fictional data and a loopback gateway. Earlier Host declarations retain the historical acceptance recorded in the [changelog](CHANGELOG.md); the full old-version matrix and physical-phone checks were not rerun. Mobile microphone capture over plain LAN HTTP remains unsupported; this release adds neither HTTPS nor voice input.\n\n## Use\n\n### Open Harness on another device\n\n1. Open the session you want on the computer.\n2. Click `Local access` at the bottom of the Harness sidebar.\n3. Scan the QR code or copy the one-time link to another device on the same network.\n4. The first browser to use the invitation opens the stock Harness client at the selected session. Host-level administration that Harness reserves for loopback remains unavailable remotely.\n\nThe invitation is one-use, expires after five minutes by default, and is replaced immediately when `Generate another code` is selected. After successful pairing, the QR panel closes automatically. Reopen `Local access` to generate a fresh invitation for another browser or device.\n\nPhone and tablet browsers automatically receive Mobile View when the viewport is at most 834 CSS pixels wide. The same responsive behavior can be previewed with browser device emulation; no URL parameter, user-agent switch, or second client is involved.\n\n## Mobile View\n\nThe stock Harness Web interface is difficult to operate on a phone: persistent desktop navigation consumes the viewport, session controls compete with the conversation title, several actions depend on hover or long press, and subagent information is too dense for a narrow screen. Mobile View makes that existing interface usable without introducing a second client or duplicating Harness business logic.\n\n| Stock narrow-screen behavior | Mobile View in `1.2.x` |\n| --- | --- |\n| Desktop navigation competes with the conversation | Workspace and session navigation opens as a dismissible left drawer |\n| Session metadata crowds the header | Context, model, access, preset, activity, and export move into a compact right drawer |\n| Subagent details are difficult to scan or reach | On 0.1.5, a composer chip opens the catalog in a bottom sheet; on 0.1.7 and 0.2, Harness owns its header catalog and navigation |\n| Hover-oriented session and workspace actions | Overflow actions remain visible and touch-accessible |\n| Session changes can summon the software keyboard | Automatic composer focus is suppressed while intentional input focus still works |\n| Desktop spacing ignores phone safe areas | Header, composer, tabs, media, overlays, and scrolling adapt to narrow viewports |\n\nThe implementation changes presentation, not Harness ownership or behavior:\n\n- the native workspace/session browser becomes a left drawer;\n- dynamic Chat, Trajectory, composer, overlay, and third-party plugin slots remain intact;\n- Current session opens from the header with context breakdown, model, workspace access, preset, activity, and session-log download;\n- on mobile, the duplicate stock context meter below the chat and the Host-app opener (Explorer/VS Code/Rider) are hidden; the context meter remains available on desktop, and native app launching remains available on the loopback desktop only;\n- on 0.1.5, child-agent status opens the nested catalog in a touch-friendly bottom sheet; on 0.1.7 and 0.2, the native Harness subagent header action owns that navigation;\n- the Harness theme service powers a compact sun/moon action;\n- desktop-only Settings and the nested Local access action are omitted from mobile navigation, while the appearance action remains available;\n- session and active-workspace menus stay immediately available on touch screens;\n- safe areas, scrollable tabs, bounded media, and virtual-keyboard behavior are adapted for narrow viewports;\n- plugin-owned modal drawers contain keyboard focus and return it to the invoking control when closed;\n- existing workspaces remain available, while the misleading remote `Add workspace` directory picker is omitted.\n\nThese dark-theme previews were captured from real Harness `0.2.2-rc.1` browser sessions: mobile frames are `430 × 932`, desktop frames are `1440 × 1000`. The isolated profiles contain fictional workspaces, conversations, models, devices, and usage only. The Chinese README has its own Simplified Chinese captures; Russian documentation shares the English images. Subagents use the native Harness header catalog.\n\n| Navigation | Current session | Subagents | Conversation |\n| :---: | :---: | :---: | :---: |\n| <img src=\"docs/images/mobile-navigation.png\" width=\"210\" alt=\"Dark Mobile View navigation drawer with a synthetic workspace and session\"> | <img src=\"docs/images/mobile-session-info.png\" width=\"210\" alt=\"Dark Mobile View Current session drawer with synthetic model, workspace access, statistics, and session log data\"> | <img src=\"docs/images/mobile-subagents.png\" width=\"210\" alt=\"Native dark Harness header catalog with two synthetic child agents\"> | <img src=\"docs/images/mobile-chat.png\" width=\"210\" alt=\"Dark Mobile View Harness conversation with native message actions and one-line composer controls\"> |\n\n### Permissions\n\nThe remote browser inherits the selected Harness session's **Read only**, **Workspace write**, or **Full access** authority. Mobile View displays that value but does not create or weaken a permission layer. This applies to ordinary session operations; Settings, credentials, native Host actions, and agent-preset authoring remain loopback-only. Hiding `Add workspace` is a usability constraint, not an authorization boundary.\n\nThe responsive enhancements target viewports from 360 through 834 CSS pixels wide. The release matrix defines checks at `360 × 800`, `390 × 844`, `430 × 932`, and `768 × 1024`; release acceptance also requires portrait and landscape checks on a real phone. See [Mobile View](docs/MOBILE_VIEW.md) for behavior, theme persistence, compatibility surfaces, and the complete acceptance checklist.\n\n### Manage trusted browsers\n\nOn the Harness computer, use `Paired devices` in the QR panel or open `Settings → Local access`. Each new browser starts as `My device`; its subtitle is detected automatically, for example `Phone · Chrome`, `Tablet · Safari`, or `Computer · Edge`.\n\n- `Rename` changes display metadata only.\n- `Revoke` invalidates the browser credential and immediately closes its open Local Link WebSocket connections.\n- A cleared cookie, private window, new browser profile, or revoked device needs a new invitation.\n\nBrowsers do not reliably distinguish laptops from desktop computers, so both are shown as `Computer`.\n\n<p align=\"center\">\n <img src=\"docs/images/local-access-devices.jpg\" width=\"960\" alt=\"DeepSeek Harness Settings opened directly on the compact Local access paired-device list\">\n</p>\n\nExpand `Diagnostics` on the same Settings page to inspect the most recent local gateway events. `Copy report` produces issue-ready JSON and `Clear` removes the local history. The report contains event codes, timestamps, severity, and a small allowlisted context only; it never includes pairing tokens, cookies, IP addresses, device or session IDs, device names, request paths, prompts, conversations, or project files.\n\n<p align=\"center\">\n <img src=\"docs/images/local-access-diagnostics.jpg\" width=\"960\" alt=\"DeepSeek Harness Local access settings with the native-style Diagnostics panel expanded\">\n</p>\n\n## Why it stays small\n\n- **Stock Harness UI:** the plugin opens the existing Web client and live agent stream.\n- **Local only:** one private-network gateway forwards to the loopback Harness Host.\n- **Two runtime dependencies:** configuration schema support and QR generation.\n- **No fingerprinting:** access is a random per-browser credential, not a device identity guess.\n- **Native extension points:** sidebar and Settings content use Harness slots and locale services.\n- **Native responsive enhancement:** the shipped Harness AppFrame stays mounted; registered conversation views and overlays remain dynamic.\n- **JSON localization:** all visible plugin copy lives in matching locale dictionaries.\n- **Local diagnostics:** a bounded, redacted event history helps debug installs without analytics or an external collector.\n\n## How it works\n\n```text\nDesktop browser on 127.0.0.1:3080\n └─ Local access → one-use invitation\n │\nPhone / tablet / computer on the private LAN\n └─ 192.168.x.x:3088 → network + Host validation\n → pairing or device-cookie validation\n → HTTP / WebSocket proxy\n → 127.0.0.1:3080 (the same Harness Host)\n```\n\nThe gateway does not create a second Harness session. During first connection it transfers the desktop browser's current session selection to the new browser origin; session data and ongoing conversation events still come from the same Host.\n\nAuthorization uses a 256-bit random cookie credential. Only its SHA-256 hash is stored. The editable name and detected device/browser text never grant access.\n\nThe LAN authority is declared through Harness's official connection `trustedHosts` contract. This enables authenticated session API and WebSocket traffic without pretending that the phone is loopback. Harness `0.1.2-rc.1` and the verified `0.1.5` and `0.1.7` builds authenticate the transport as a whole, so Local Link itself rejects the configuration, credential, native Host-action, and agent-preset-authoring RPCs that earlier supported Harness builds kept loopback-only.\n\n## Configuration\n\nThe bundled profile patch installs conservative defaults:\n\n| Option | Default | Purpose |\n| --- | --- | --- |\n| `listenHost` | `0.0.0.0` | Listen on local interfaces; request validation still accepts only private/loopback sources. |\n| `listenPort` | `3088` | LAN gateway port. |\n| `upstreamOrigin` | `http://127.0.0.1:3080` | Existing loopback Harness Web server. |\n| `accessMode` | `pairing` | Require a one-use invitation and device cookie. |\n| `pairingTtlSeconds` | `300` | Invitation lifetime. |\n| `deviceTtlDays` | `90` | Remembered-browser lifetime. |\n| `diagnosticsEnabled` | `true` | Keep the bounded local diagnostic history. |\n| `diagnosticsMaxEntries` | `15` | Maximum retained events (`5`–`200`). |\n| `diagnosticsFile` | next to `stateFile` | Local JSON event store; the bundled profile uses `~/.dsh/local-link/diagnostics.json`. |\n\n`listenHost` accepts only `0.0.0.0` or an explicit private/loopback IP literal. Public listener addresses are rejected during startup; this configuration guard complements, rather than replaces, the operating-system firewall.\n\n`trusted-lan` disables per-device authorization and should be reserved for isolated development networks. `pairing` is the supported default because a connected Harness browser can read files, submit prompts, approve actions, and trigger commands.\n\nThe plugin never creates firewall rules. If Windows prompts for network access, allow only the **Private** network profile and never forward port `3088` on the router.\n\n## Troubleshooting and diagnostics\n\nDiagnostics are a local, event-driven history of failures—not a request log. The plugin retains 15 events by default, shows the newest 12, coalesces identical five-second bursts, and records nothing for successful starts, requests, pairing, copies, renames, or revocations.\n\nFor support:\n\n1. Reproduce the failed action once.\n2. Open `Settings → Local access → Diagnostics`.\n3. Click `Refresh` if the panel was already open.\n4. Use the newest stable event code to identify the failed boundary.\n5. Click `Copy report`, review the JSON, and attach it to an issue if needed.\n\nThe report never includes secrets, addresses, IDs, names, URLs, paths, prompts, conversations, or project data and is never uploaded automatically. See the [event reference and first checks](docs/DIAGNOSTICS.md) for every tracked failure.\n\n## Localization\n\nHarness's active language selects the plugin dictionary; the plugin has no separate language switch.\n\nThe minimal automatic pairing page loads before Harness locale services are available. It reuses the same dictionaries and selects English or Chinese from the connecting browser's language list; English is the fallback.\n\n| Language | Dictionary | Status |\n| --- | --- | --- |\n| English | `src/locales/en.json` | Included |\n| Chinese | `src/locales/zh.json` | Included |\n\nDictionary keys are checked for parity in tests. To add a locale, copy `en.json`, translate values without changing keys, register the locale ID in `src/client.tsx`, extend the pre-client pairing-page language map in `src/gateway/pair-page.ts`, and run `npm test`.\n\n## Development\n\n```shell\ncorepack pnpm install --frozen-lockfile\nnpm run typecheck\nnpm test\nnpm run build\nnpm run verify\n```\n\nProject documentation:\n\n- [Architecture and compatibility boundaries](docs/ARCHITECTURE.md)\n- [Mobile View behavior and release matrix](docs/MOBILE_VIEW.md)\n- [Local diagnostics and event codes](docs/DIAGNOSTICS.md)\n- [Security model](docs/SECURITY.md)\n- [Contributing](CONTRIBUTING.md)\n- [Security reporting](SECURITY.md)\n\n## Known limitations\n\n- LAN traffic is not encrypted; the current gateway uses plain HTTP.\n- Revocation blocks new requests and reconnects and terminates every open Local Link WebSocket authenticated by the revoked device.\n- A light/dark choice made from a remote browser is page-scoped in the supported Harness builds; reload returns to the Host preference and resolves `system` against the remote device.\n- Invitations use the highest-ranked private IPv4 interface detected at startup; choosing among multiple LAN interfaces is not exposed yet.\n- The shortcut that opens a specific Settings section uses a small semantic compatibility bridge because Harness does not expose a general settings-navigation service.\n- Harness's footer-action container needs a compatibility layout rule when the full-width Cordis action is present.\n- Mobile View targets viewports from 360 CSS pixels wide, but third-party fixed-width views, virtual keyboards, orientation changes, split-screen browsers, and operating-system text scaling still require real-device acceptance.\n- Plugin-owned buttons and text inputs use Harness `Button` and `Input` primitives and their semantic variants. The supported Harness builds do not expose a complete public responsive-shell, spacing, or radius contract, so mobile geometry and responsive compositions remain documented design-system compatibility risks; icon export changes are handled by a version-tolerant adapter.\n\n## Development disclosure\n\nThe initial implementation and documentation were developed collaboratively with OpenAI Codex. Changes remain subject to maintainer review, automated tests, security review, and the same contribution requirements as human-authored changes. No runtime AI service, telemetry, or generated-code dependency is included in the package.\n\n## License\n\n[MIT](LICENSE) © 2026 dsh-local-link contributors.\n",
171
+ "readmeFilename": "README.md"
168
172
  }