dsh-multi-chat 0.6.7 → 1.0.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.
Files changed (63) hide show
  1. package/README.md +20 -21
  2. package/README.zh.md +20 -21
  3. package/bin/dsh-multi-chat.mjs +5 -9
  4. package/lib/client.js +778 -0
  5. package/lib/client.js.map +1 -0
  6. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/index.js +57 -69
  7. package/lib/tsconfig.tsbuildinfo +1 -0
  8. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallToggle.d.ts +1 -1
  9. package/lib/types/client/WallToggle.d.ts.map +1 -0
  10. package/lib/types/client/WallToggle.js +36 -0
  11. package/lib/types/client/WallToggle.js.map +1 -0
  12. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/WallView.d.ts +1 -1
  13. package/lib/types/client/WallView.d.ts.map +1 -0
  14. package/lib/types/client/WallView.js +218 -0
  15. package/lib/types/client/WallView.js.map +1 -0
  16. package/lib/types/client/index.d.ts.map +1 -0
  17. package/lib/types/client/index.js +59 -0
  18. package/lib/types/client/index.js.map +1 -0
  19. package/lib/types/client/locales.d.ts.map +1 -0
  20. package/lib/types/client/locales.js +96 -0
  21. package/lib/types/client/locales.js.map +1 -0
  22. package/lib/types/client/store.d.ts.map +1 -0
  23. package/lib/types/client/store.js +27 -0
  24. package/lib/types/client/store.js.map +1 -0
  25. package/lib/types/client/wall-injected.d.ts.map +1 -0
  26. package/lib/types/client/wall-injected.js +76 -0
  27. package/lib/types/client/wall-injected.js.map +1 -0
  28. package/lib/types/gateway.d.ts +57 -0
  29. package/lib/types/gateway.d.ts.map +1 -0
  30. package/lib/types/gateway.js +566 -0
  31. package/lib/types/gateway.js.map +1 -0
  32. package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/index.d.ts +1 -16
  33. package/lib/types/index.d.ts.map +1 -0
  34. package/lib/types/index.js +550 -0
  35. package/lib/types/index.js.map +1 -0
  36. package/lib/types/invariant.d.ts.map +1 -0
  37. package/lib/types/invariant.js +26 -0
  38. package/lib/types/invariant.js.map +1 -0
  39. package/package.json +31 -17
  40. package/scripts/install-plugin.ps1 +6 -9
  41. package/src/client/WallToggle.module.css +26 -0
  42. package/src/client/WallToggle.tsx +52 -0
  43. package/src/client/WallView.module.css +190 -0
  44. package/src/client/WallView.tsx +406 -0
  45. package/src/client/index.ts +103 -0
  46. package/src/client/locales.ts +100 -0
  47. package/src/client/store.ts +40 -0
  48. package/src/client/wall-injected.ts +123 -0
  49. package/src/css-modules.d.ts +5 -0
  50. package/src/gateway.ts +627 -0
  51. package/src/index.ts +618 -0
  52. package/src/invariant.ts +34 -0
  53. package/plugin/dsh-client-ui-multi-wall/README.md +0 -26
  54. package/plugin/dsh-client-ui-multi-wall/README.zh.md +0 -26
  55. package/plugin/dsh-client-ui-multi-wall/cordis.patch.yml +0 -7
  56. package/plugin/dsh-client-ui-multi-wall/lib/client.js +0 -781
  57. package/plugin/dsh-client-ui-multi-wall/lib/invariant.js +0 -27
  58. package/plugin/dsh-client-ui-multi-wall/package.json +0 -88
  59. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/index.d.ts +0 -0
  60. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/locales.d.ts +0 -0
  61. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/store.d.ts +0 -0
  62. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/client/wall-injected.d.ts +0 -0
  63. /package/{plugin/dsh-client-ui-multi-wall/lib → lib}/types/invariant.d.ts +0 -0
@@ -0,0 +1,550 @@
1
+ /**
2
+ * Multi-window wall plugin, node half: registers the `/multi/api/*` routes
3
+ * on the webserver. The browser half fetches these same-origin to discover
4
+ * which local ports are live DSH instances, to poll liveness, and to
5
+ * terminate a chosen instance (`/multi/api/stop`). The wall itself is pure
6
+ * UI — this half answers a few small JSON requests.
7
+ * @module @deepseek-ai/dsh-client-ui-multi-wall
8
+ */
9
+ import { execFile, spawn } from 'node:child_process';
10
+ import { randomBytes } from 'node:crypto';
11
+ import { existsSync } from 'node:fs';
12
+ import { networkInterfaces } from 'node:os';
13
+ import z from '@deepseek-ai/schemastery';
14
+ import { startGateway } from './gateway';
15
+ /** Stable Cordis plugin name. */
16
+ export const name = 'client-ui-multi-wall';
17
+ /** Services required before the probe routes can be registered. */
18
+ export const inject = ['webServer'];
19
+ /** Schema-validated config (the Loader resolves defaults for absent keys). */
20
+ export const Config = z.object({
21
+ scanFrom: z.natural().default(3070),
22
+ scanTo: z.natural().default(3110),
23
+ ports: z.array(z.natural()).default([]),
24
+ publicUrl: z.string().default(''),
25
+ gatewayPort: z.number().default(0),
26
+ gatewayToken: z.string().default(''),
27
+ });
28
+ /** MIME for JSON probe answers. */
29
+ const JSON_TYPE = 'application/json; charset=utf-8';
30
+ /** GET one local URL with a short timeout; resolve {status, body} or reject. */
31
+ async function request(url, timeoutMs = 600) {
32
+ const controller = new AbortController();
33
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
34
+ try {
35
+ const res = await fetch(url, { signal: controller.signal });
36
+ return { status: res.status, body: await res.text() };
37
+ }
38
+ finally {
39
+ clearTimeout(timer);
40
+ }
41
+ }
42
+ /** Is this local port a live DSH instance (index.html carries __DSH_BOOT__)? */
43
+ async function probePort(port) {
44
+ try {
45
+ const { status, body } = await request(`http://127.0.0.1:${port}/`);
46
+ return { port, alive: status === 200 && body.includes('__DSH_BOOT__'), status };
47
+ }
48
+ catch {
49
+ return { port, alive: false, status: 0 };
50
+ }
51
+ }
52
+ /** Concurrent probe of many ports (bounded chunking). */
53
+ async function probePorts(ports) {
54
+ const CHUNK = 16;
55
+ const out = [];
56
+ for (let i = 0; i < ports.length; i += CHUNK) {
57
+ out.push(...(await Promise.all(ports.slice(i, i + CHUNK).map(port => probePort(port)))));
58
+ }
59
+ return out;
60
+ }
61
+ /** Send a small JSON response. */
62
+ function json(res, value, status = 200) {
63
+ res.writeHead(status, { 'content-type': JSON_TYPE, 'cache-control': 'no-store' });
64
+ res.end(JSON.stringify(value));
65
+ }
66
+ /**
67
+ * Run a command and resolve its stdout text. Rejects on non-zero exit.
68
+ * @param file - the executable path.
69
+ * @param args - CLI arguments.
70
+ * @returns the trimmed stdout.
71
+ */
72
+ function execStdout(file, args) {
73
+ return new Promise((resolve, reject) => {
74
+ execFile(file, args, { timeout: 5000 }, (error, stdout) => {
75
+ if (error !== null) {
76
+ reject(error);
77
+ return;
78
+ }
79
+ resolve(stdout);
80
+ });
81
+ });
82
+ }
83
+ /**
84
+ * Resolve the PIDs listening on a local TCP port. Windows uses `netstat`;
85
+ * POSIX uses `lsof` (present on macOS and most Linux installs).
86
+ * @param port - the listening port.
87
+ * @returns the listener PIDs (possibly empty).
88
+ */
89
+ async function listeningPids(port) {
90
+ if (process.platform === 'win32') {
91
+ const stdout = await execStdout('netstat', ['-ano', '-p', 'tcp']);
92
+ const pids = new Set();
93
+ for (const line of stdout.split(/\r?\n/)) {
94
+ // TCP 127.0.0.1:3080 0.0.0.0:0 LISTENING 12345
95
+ const m = /^\s*TCP\s+([0-9.]+|\*|\[::\]):(\d+)\s+\S+\s+LISTENING\s+(\d+)\s*$/.exec(line);
96
+ if (m !== null && Number(m[2]) === port)
97
+ pids.add(Number(m[3]));
98
+ }
99
+ return [...pids];
100
+ }
101
+ const stdout = await execStdout('lsof', ['-ti', `tcp:${port}`, '-sTCP:LISTEN']);
102
+ return stdout.split(/\s+/).map(Number).filter(pid => Number.isInteger(pid) && pid > 0);
103
+ }
104
+ /**
105
+ * Terminate one PID. Windows uses `taskkill /F` (force); POSIX sends SIGTERM
106
+ * then SIGKILL after a grace period.
107
+ * @param pid - the process id to terminate.
108
+ */
109
+ async function killPid(pid) {
110
+ if (process.platform === 'win32') {
111
+ await execStdout('taskkill', ['/PID', String(pid), '/F', '/T']);
112
+ return;
113
+ }
114
+ try {
115
+ process.kill(pid, 'SIGTERM');
116
+ }
117
+ catch {
118
+ // Race: process already gone — treat as terminated.
119
+ }
120
+ await new Promise(resolve => setTimeout(resolve, 500));
121
+ try {
122
+ process.kill(pid, 'SIGKILL');
123
+ }
124
+ catch {
125
+ // Already gone.
126
+ }
127
+ }
128
+ /**
129
+ * Terminate the DSH instance listening on one local port. The port serving
130
+ * this wall may also be terminated (the user may want to stop the instance
131
+ * they are viewing): the kill is deferred a beat so the HTTP response is
132
+ * written before the process dies, then the listener's PIDs are force-killed.
133
+ * @param port - the target port.
134
+ * @param selfPort - this instance's own listening port.
135
+ * @returns the stop result.
136
+ */
137
+ export async function stopPort(port, selfPort) {
138
+ try {
139
+ const pids = await listeningPids(port);
140
+ if (pids.length === 0) {
141
+ return { port, ok: false, error: 'no listener on this port' };
142
+ }
143
+ const kill = () => Promise.all(pids.map(pid => killPid(pid).catch(() => { })));
144
+ if (port === selfPort) {
145
+ // Let the response flush before taking ourselves down.
146
+ setTimeout(() => { void kill(); }, 250);
147
+ return { port, ok: true };
148
+ }
149
+ await kill();
150
+ return { port, ok: true };
151
+ }
152
+ catch (error) {
153
+ return { port, ok: false, error: error instanceof Error ? error.message : String(error) };
154
+ }
155
+ }
156
+ /**
157
+ * Resolve how to launch a new DSH instance. Primary path: the current
158
+ * process's own entry (`node <bin> web` under `process.argv[1]`), so the new
159
+ * instance inherits the exact CLI/profile already running. Fallback: the
160
+ * `dsh` command from PATH when the entry cannot be derived (unusual host
161
+ * launcher, missing file).
162
+ * @returns the launcher description.
163
+ */
164
+ function resolveLauncher() {
165
+ const first = process.argv[1];
166
+ if (first !== undefined && existsSync(first)) {
167
+ return { file: process.execPath, args: [first, 'web', '--port'], shell: false };
168
+ }
169
+ return { file: 'dsh', args: ['web', '--port'], shell: process.platform === 'win32' };
170
+ }
171
+ /**
172
+ * Collect every distinct local TCP port that is listening, in ONE command
173
+ * (not one `netstat`/`lsof` per candidate, which the old free-port scan ran
174
+ * sequentially and could take many seconds on slow Windows boxes). Windows
175
+ * parses `netstat`; POSIX parses `lsof` `(LISTEN)` lines.
176
+ * @returns the set of busy ports.
177
+ */
178
+ async function listeningPorts() {
179
+ const set = new Set();
180
+ if (process.platform === 'win32') {
181
+ const stdout = await execStdout('netstat', ['-ano', '-p', 'tcp']);
182
+ for (const line of stdout.split(/\r?\n/)) {
183
+ // TCP 127.0.0.1:3080 0.0.0.0:0 LISTENING 12345
184
+ const m = /^\s*TCP\s+([0-9.]+|\*|\[::\]):(\d+)\s+\S+\s+LISTENING\s+(\d+)\s*$/.exec(line);
185
+ if (m !== null)
186
+ set.add(Number(m[2]));
187
+ }
188
+ return set;
189
+ }
190
+ const stdout = await execStdout('lsof', ['-nP', '-iTCP', '-sTCP:LISTEN']);
191
+ for (const line of stdout.split(/\r?\n/)) {
192
+ // node 1234 user 13u IPv4 12345 0t0 TCP 127.0.0.1:3080 (LISTEN)
193
+ const m = /:(\d+)\s+\(LISTEN\)\s*$/.exec(line.trim());
194
+ if (m !== null)
195
+ set.add(Number(m[1]));
196
+ }
197
+ return set;
198
+ }
199
+ /**
200
+ * Pick the first free port in [lo, hi] that is neither the serving port nor
201
+ * already listening. The busy set is resolved once (a single command), then
202
+ * scanned in memory.
203
+ * @param lo - first port of the range.
204
+ * @param hi - last port of the range.
205
+ * @param selfPort - the port serving this wall (never chosen).
206
+ * @returns a free port, or undefined when the range is exhausted.
207
+ */
208
+ async function pickFreePort(lo, hi, selfPort) {
209
+ const busy = await listeningPorts();
210
+ for (let port = lo; port <= hi; port++) {
211
+ if (port === selfPort)
212
+ continue;
213
+ if (busy.has(port))
214
+ continue;
215
+ return port;
216
+ }
217
+ return undefined;
218
+ }
219
+ /**
220
+ * Spawn a new `dsh web` instance on a port and decide quickly whether it is
221
+ * viable. Detached so it outlives this process. This is intentionally NOT a
222
+ * full readiness gate: the wall polls liveness itself, so the create response
223
+ * returns fast and a still-booting instance simply shows a pane that lights up
224
+ * when the server finishes. A short bounded wait still catches immediate
225
+ * spawn failures (bad bin, ENOENT) and very fast boots.
226
+ *
227
+ * On a genuine launch failure the child is killed so no orphan lingers; on a
228
+ * slow-but-viable start the deadline returns ok:true and the child keeps
229
+ * booting in the background (the pane already mounted, liveness confirms when
230
+ * alive). The child's stderr is captured and quoted into every failure so a
231
+ * crash or a bad bin surfaces a concrete reason instead of a bare timeout.
232
+ * @param launcher - how to spawn the dsh CLI.
233
+ * @param port - the port for the new instance.
234
+ * @param timeoutMs - how long to wait before handing back ok:true.
235
+ * @param pollMs - readiness probe interval while waiting.
236
+ * @returns ok plus the port, or ok:false with a reason.
237
+ */
238
+ async function startInstance(launcher, port, timeoutMs = 3000, pollMs = 300) {
239
+ const child = spawn(launcher.file, [...launcher.args, String(port)], {
240
+ detached: true,
241
+ stdio: ['ignore', 'ignore', 'pipe'],
242
+ windowsHide: true,
243
+ shell: launcher.shell,
244
+ });
245
+ child.unref();
246
+ let stderr = '';
247
+ // Held by property so flow analysis cannot conclude the closure assignment
248
+ // never runs (a local assigned only inside a callback narrows to never at
249
+ // the check).
250
+ const spawnFailure = { error: null };
251
+ child.stderr?.on('data', chunk => {
252
+ stderr += String(chunk);
253
+ if (stderr.length > 2000)
254
+ stderr = stderr.slice(-2000);
255
+ });
256
+ child.once('error', error => { spawnFailure.error = error; });
257
+ const detail = () => {
258
+ const tail = stderr.trim().split(/\r?\n/).slice(-3).join(' | ');
259
+ return tail === '' ? '' : ` (${tail})`;
260
+ };
261
+ const deadline = Date.now() + timeoutMs;
262
+ for (;;) {
263
+ if (spawnFailure.error !== null) {
264
+ // Can't launch at all: reap the child so no orphan lingers.
265
+ try {
266
+ child.kill();
267
+ }
268
+ catch { /* already gone */ }
269
+ return { ok: false, port, error: `new instance failed to start: ${spawnFailure.error.message}` };
270
+ }
271
+ if (child.exitCode !== null) {
272
+ return { ok: false, port, error: `new instance exited early (code ${child.exitCode})${detail()}` };
273
+ }
274
+ const row = await probePort(port);
275
+ if (row.alive)
276
+ return { ok: true, port };
277
+ if (Date.now() > deadline) {
278
+ // Not ready yet but viable: hand back ok so the create response isn't
279
+ // blocked on a slow boot — the pane mounts and the wall's own liveness
280
+ // poll lights it up when the server finishes starting.
281
+ return { ok: true, port };
282
+ }
283
+ await new Promise(resolve => setTimeout(resolve, pollMs));
284
+ }
285
+ }
286
+ /**
287
+ * Interface-name patterns that mark a *virtual* NIC (VM bridge, WSL,
288
+ * Docker, Hyper-V, VPN adapters, Loopback Pseudo-Instance, etc.). These
289
+ * interfaces are never reachable from a phone on the same LAN, so they are
290
+ * dropped from the link list entirely.
291
+ */
292
+ const VIRTUAL_IFACE_PATTERNS = [
293
+ /vEthernet/i, // Hyper-V virtual switch
294
+ /vmware/i, // VMware VMnet adapters
295
+ /virtualbox/i, // VirtualBox host-only
296
+ /^vbox/i,
297
+ /wsl/i, // Windows Subsystem for Linux
298
+ /docker/i, // Docker / DockerNAT
299
+ /hyper-v/i,
300
+ /tap-windows/i, // OpenVPN TAP
301
+ /^tap/i,
302
+ /^tun/i, // TUN VPN tunnels
303
+ /ppp/i,
304
+ /loopback/i, // Loopback Pseudo-Interface 1
305
+ /apipa/i, // automatic private IP (169.254.*.*)
306
+ /^utun/i, // macOS TUN
307
+ /^awdl/i, // macOS Apple Wireless Direct Link
308
+ /^llw/i, // macOS low-latency WLAN
309
+ /^bridge/i,
310
+ /bluetooth/i,
311
+ ];
312
+ /**
313
+ * Interface-name patterns that mark a *physical* NIC (Wi-Fi / Ethernet).
314
+ * Matches kept addresses are ordered before any unknown-but-surviving
315
+ * address so the phone-first address is the machine's real NIC.
316
+ */
317
+ const PHYSICAL_IFACE_PATTERNS = [
318
+ /^(wi-?fi|wlan|wireless)/i,
319
+ /^(eth(ernet)?|以太网|以太)/i,
320
+ /^(en|wan)[0-9]/i, // macOS en0 / en1
321
+ /^本地连接/i,
322
+ /^e[0-9]+$/i, // bare ethernet (linux)
323
+ /^w[0-9]+$/i, // bare wlan (linux)
324
+ ];
325
+ /**
326
+ * The non-loopback IPv4 addresses of this machine (the LAN reachable URLs).
327
+ * Virtual NICs (VM/WSL/Docker/VPN/loopback pseudo) are filtered out; the
328
+ * remaining addresses are ordered with physical NICs (Wi-Fi/Ethernet) first
329
+ * so the phone shows the actually-reachable LAN address at the top.
330
+ * @returns the address list (possibly empty).
331
+ */
332
+ function lanAddresses() {
333
+ const candidates = [];
334
+ for (const [name, ifaces] of Object.entries(networkInterfaces())) {
335
+ const virtual = VIRTUAL_IFACE_PATTERNS.some(re => re.test(name));
336
+ const physical = !virtual && PHYSICAL_IFACE_PATTERNS.some(re => re.test(name));
337
+ for (const iface of ifaces ?? []) {
338
+ if (iface.family !== 'IPv4' || iface.internal)
339
+ continue;
340
+ if (virtual)
341
+ continue; // drop virtual NICs entirely
342
+ candidates.push({ address: iface.address, physical, virtual: false });
343
+ }
344
+ }
345
+ candidates.sort((a, b) => Number(b.physical) - Number(a.physical));
346
+ return candidates.map(c => c.address);
347
+ }
348
+ /**
349
+ * Register the probe routes. Everything lives under `/multi/api` so the
350
+ * plugin is purely additive: exact `ports` (auto-discovery) and `status`
351
+ * (liveness of a specific port list).
352
+ * @param ctx - plugin context carrying the webServer service.
353
+ * @param config - validated {@link MultiWallConfig}.
354
+ */
355
+ export function apply(ctx, config = {}) {
356
+ const scanFrom = config.scanFrom ?? 3070;
357
+ const scanTo = config.scanTo ?? 3110;
358
+ const fixedPorts = config.ports ?? [];
359
+ // Inline gateway state: lazily started on first `/multi/api/link` call and
360
+ // reused until the target port changes (or the instance restarts).
361
+ let gateway = null;
362
+ let gatewayTargetPort = -1;
363
+ ctx.effect(() => ctx.webServer.register({
364
+ kind: 'exact',
365
+ path: '/multi/api/ports',
366
+ handler: (req, res) => {
367
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
368
+ res.writeHead(405);
369
+ res.end();
370
+ return;
371
+ }
372
+ const url = new URL(req.url ?? '/', 'http://x');
373
+ const qFromRaw = url.searchParams.get('from');
374
+ const qToRaw = url.searchParams.get('to');
375
+ const qFrom = qFromRaw !== null ? Number(qFromRaw) : NaN;
376
+ const qTo = qToRaw !== null ? Number(qToRaw) : NaN;
377
+ const lo = Number.isInteger(qFrom) ? qFrom : scanFrom;
378
+ const hi = Number.isInteger(qTo) ? qTo : scanTo;
379
+ const ports = fixedPorts.length > 0 ? [...fixedPorts] : [];
380
+ if (fixedPorts.length === 0) {
381
+ for (let p = lo; p <= hi; p++)
382
+ ports.push(p);
383
+ }
384
+ // The serving instance is a discoverable target too: the user may want
385
+ // to watch (or stop) the very instance hosting the wall. Recursion is
386
+ // prevented client-side by the ?multi-wall=embed pane flag, not by
387
+ // hiding the self port.
388
+ probePorts(ports).then(results => {
389
+ json(res, { ports: results.filter(row => row.alive) });
390
+ }).catch(() => json(res, { ports: [] }, 500));
391
+ },
392
+ }), 'multi-wall: /multi/api/ports');
393
+ ctx.effect(() => ctx.webServer.register({
394
+ kind: 'exact',
395
+ path: '/multi/api/status',
396
+ handler: (req, res) => {
397
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
398
+ res.writeHead(405);
399
+ res.end();
400
+ return;
401
+ }
402
+ const url = new URL(req.url ?? '/', 'http://x');
403
+ const ports = (url.searchParams.get('ports') ?? '')
404
+ .split(',')
405
+ .map(Number)
406
+ .filter(p => Number.isInteger(p) && p > 0);
407
+ probePorts(ports).then(results => {
408
+ json(res, { ports: results });
409
+ }).catch(() => json(res, { ports: [] }, 500));
410
+ },
411
+ }), 'multi-wall: /multi/api/status');
412
+ // Terminate the DSH instance on a specific port (closes that session).
413
+ // GET /multi/api/stop?port=3080 or ?ports=3080,3081
414
+ ctx.effect(() => ctx.webServer.register({
415
+ kind: 'exact',
416
+ path: '/multi/api/stop',
417
+ handler: (req, res) => {
418
+ if (req.method !== 'GET' && req.method !== 'POST') {
419
+ res.writeHead(405);
420
+ res.end();
421
+ return;
422
+ }
423
+ const url = new URL(req.url ?? '/', 'http://x');
424
+ const raw = url.searchParams.get('ports') ?? url.searchParams.get('port') ?? '';
425
+ const ports = raw.split(',').map(Number).filter(p => Number.isInteger(p) && p > 0);
426
+ const selfPort = ctx.webServer.port;
427
+ Promise.all(ports.map(port => stopPort(port, selfPort))).then(results => {
428
+ json(res, { ports: results });
429
+ }).catch(() => json(res, { ports: [] }, 500));
430
+ },
431
+ }), 'multi-wall: /multi/api/stop');
432
+ // Start a NEW DSH instance and return its port, so the wall can grow a
433
+ // fresh window without leaving the page. Spawns `dsh web` on the first
434
+ // free port of the scan range (never the serving port). The response
435
+ // returns as soon as a port is allocated (a couple seconds max) instead of
436
+ // blocking on the new instance's readiness — the wall's own liveness poll
437
+ // confirms the server when it finishes booting, and a spawn failure is
438
+ // surfaced immediately as ok:false with a concrete reason.
439
+ // POST /multi/api/create (GET also accepted for convenience)
440
+ ctx.effect(() => ctx.webServer.register({
441
+ kind: 'exact',
442
+ path: '/multi/api/create',
443
+ handler: (req, res) => {
444
+ if (req.method !== 'GET' && req.method !== 'POST') {
445
+ res.writeHead(405);
446
+ res.end();
447
+ return;
448
+ }
449
+ const launcher = resolveLauncher();
450
+ const selfPort = ctx.webServer.port;
451
+ void pickFreePort(scanFrom, scanTo, selfPort).then(port => {
452
+ if (port === undefined) {
453
+ json(res, { ok: false, error: `no free port in ${scanFrom}–${scanTo}` }, 409);
454
+ return;
455
+ }
456
+ return startInstance(launcher, port).then(result => {
457
+ json(res, result.ok ? { ok: true, port } : { ok: false, error: result.error }, result.ok ? 200 : 500);
458
+ if (!result.ok)
459
+ ctx.logger.warn(`multi-wall create failed: ${result.error}`);
460
+ });
461
+ }).catch((error) => {
462
+ const message = error instanceof Error ? error.message : String(error);
463
+ ctx.logger.warn(`multi-wall create error: ${message}`);
464
+ json(res, { ok: false, error: message }, 500);
465
+ });
466
+ },
467
+ }), 'multi-wall: /multi/api/create');
468
+ // The phone-reachable URL for this instance. The official CLI forbids
469
+ // `--host 0.0.0.0` (it would expose remote code execution), so a loopback
470
+ // instance is reached from a phone through an auth-gated gateway. When
471
+ // `publicUrl` is configured, that URL is reported verbatim. Otherwise this
472
+ // route lazily starts the inline gateway (target 127.0.0.1:<selfPort>) and
473
+ // answers with the LAN URLs plus the generated/fixed login token.
474
+ // GET /multi/api/link
475
+ ctx.effect(() => ctx.webServer.register({
476
+ kind: 'exact',
477
+ path: '/multi/api/link',
478
+ handler: (req, res) => {
479
+ if (req.method !== 'GET' && req.method !== 'HEAD') {
480
+ res.writeHead(405);
481
+ res.end();
482
+ return;
483
+ }
484
+ const port = ctx.webServer.port;
485
+ const host = ctx.webServer.host;
486
+ const publicUrl = (config.publicUrl ?? '').replace(/\/+$/, '');
487
+ if (publicUrl !== '') {
488
+ json(res, { port, host, lan: [`${publicUrl}/`], reachable: true });
489
+ return;
490
+ }
491
+ // Ensure the inline gateway targets THIS instance's port.
492
+ const ensureGateway = () => {
493
+ if (gateway !== null && gatewayTargetPort === port) {
494
+ return Promise.resolve(gateway);
495
+ }
496
+ // Target changed (or first start): close the stale gateway first.
497
+ if (gateway !== null) {
498
+ gateway.close();
499
+ gateway = null;
500
+ }
501
+ const token = config.gatewayToken && config.gatewayToken !== '' ? config.gatewayToken : randomBytes(6).toString('hex');
502
+ const gatewayPort = config.gatewayPort && config.gatewayPort !== 0 ? config.gatewayPort : port + 5000;
503
+ gatewayTargetPort = port;
504
+ // Allow the gateway's `/gw/<port>` route only for ports a DSH instance
505
+ // can actually live on: the scan range plus any fixed ports.
506
+ const routed = [];
507
+ for (let p = scanFrom; p <= scanTo; p++)
508
+ routed.push(p);
509
+ for (const p of fixedPorts)
510
+ if (!routed.includes(p))
511
+ routed.push(p);
512
+ return startGateway({
513
+ targetPort: port,
514
+ port: gatewayPort,
515
+ token,
516
+ name: 'DSH',
517
+ routedPorts: routed,
518
+ log: (msg) => ctx.logger.info(`multi-wall gateway: ${msg}`),
519
+ }).then(handle => {
520
+ gateway = handle;
521
+ return handle;
522
+ });
523
+ };
524
+ ensureGateway().then(handle => {
525
+ const urls = lanAddresses().map(ip => `http://${ip}:${handle.port}/`);
526
+ json(res, {
527
+ port,
528
+ host,
529
+ lan: urls,
530
+ gatewayPort: handle.port,
531
+ token: handle.token,
532
+ reachable: urls.length > 0,
533
+ hint: urls.length === 0
534
+ ? 'no LAN address detected; connect this machine to a network first'
535
+ : undefined,
536
+ });
537
+ }).catch((error) => {
538
+ ctx.logger.warn(`multi-wall gateway start failed: ${error instanceof Error ? error.message : String(error)}`);
539
+ json(res, {
540
+ port,
541
+ host,
542
+ lan: [],
543
+ reachable: false,
544
+ hint: error instanceof Error ? error.message : String(error),
545
+ }, 500);
546
+ });
547
+ },
548
+ }), 'multi-wall: /multi/api/link');
549
+ }
550
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAA;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AACpC,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAE3C,OAAO,CAAC,MAAM,0BAA0B,CAAA;AAExC,OAAO,EAAE,YAAY,EAAsB,MAAM,WAAW,CAAA;AAE5D,iCAAiC;AACjC,MAAM,CAAC,MAAM,IAAI,GAAG,sBAAsB,CAAA;AAE1C,mEAAmE;AACnE,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,WAAW,CAAC,CAAA;AA4BnC,8EAA8E;AAC9E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,QAAQ,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACnC,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC;IACjC,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC;IACvC,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,OAAO,CA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AC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;iBAC7D,EAAE,GAAG,CAAC,CAAA;YACT,CAAC,CAAC,CAAA;QACJ,CAAC;KACF,CAAC,EAAE,6BAA6B,CAAC,CAAA;AACpC,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,mCAAmC,CAAA;AACpD,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAWpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Package-owned invariant companion for
3
+ * `@deepseek-ai/dsh-client-ui-multi-wall`.
4
+ * @module @deepseek-ai/dsh-client-ui-multi-wall/invariant
5
+ */
6
+ const PACKAGE_NAME = '@deepseek-ai/dsh-client-ui-multi-wall';
7
+ /** Cordis companion plugin name. */
8
+ export const name = 'client-ui-multi-wall-invariant';
9
+ /** Service required before the companion can reserve package ownership. */
10
+ export const inject = ['invariants'];
11
+ /**
12
+ * No runtime invariant: the wall contributes the conversation view-ring entry
13
+ * (the wall surface) and the sidebar footer shortcut, whose disposal is
14
+ * proven by the HMR-safety spec — the plugin owns one store handle used by
15
+ * the view entry, emits no cordis events, and holds no cross-plugin mutable
16
+ * state.
17
+ */
18
+ const install = () => { };
19
+ /**
20
+ * Register this package's invariant companion.
21
+ * @param ctx - Cordis context carrying the invariant service.
22
+ * @returns the installed registration's disposer after setup succeeds.
23
+ */
24
+ export const apply = (ctx) => Promise.resolve(ctx.invariants.register(PACKAGE_NAME, install));
25
+ /* jscpd:ignore-end */
26
+ //# sourceMappingURL=invariant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"invariant.js","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,MAAM,YAAY,GAAG,uCAAuC,CAAA;AAE5D,oCAAoC;AACpC,MAAM,CAAC,MAAM,IAAI,GAAG,gCAAgC,CAAA;AACpD,2EAA2E;AAC3E,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,YAAY,CAAC,CAAA;AAEpC;;;;;;GAMG;AACH,MAAM,OAAO,GAAuB,GAAG,EAAE,GAAE,CAAC,CAAA;AAE5C;;;;GAIG;AACH,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,GAAY,EAAuB,EAAE,CACzD,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC,CAAA;AACjE,sBAAsB"}