dsh-multi-chat 1.0.3 → 1.0.4
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.md +287 -269
- package/README.zh.md +269 -233
- package/lib/client.js +66 -28
- package/lib/client.js.map +1 -1
- package/lib/index.js +211 -22
- package/lib/invariant.js +23 -0
- package/lib/tsconfig.tsbuildinfo +1 -1
- package/lib/types/client/WallToggle.js +2 -2
- package/lib/types/client/WallToggle.js.map +1 -1
- package/lib/types/client/WallView.js +8 -8
- package/lib/types/client/WallView.js.map +1 -1
- package/lib/types/client/index.d.ts +1 -1
- package/lib/types/client/index.d.ts.map +1 -1
- package/lib/types/client/index.js.map +1 -1
- package/lib/types/client/store.d.ts +1 -1
- package/lib/types/client/store.d.ts.map +1 -1
- package/lib/types/client/store.js +1 -1
- package/lib/types/client/store.js.map +1 -1
- package/lib/types/index.d.ts +80 -80
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +117 -12
- package/lib/types/index.js.map +1 -1
- package/package.json +139 -108
- package/scripts/check-platform-contract.mjs +171 -0
- package/src/client/WallToggle.tsx +52 -52
- package/src/client/WallView.tsx +406 -406
- package/src/client/index.ts +108 -103
- package/src/client/store.ts +40 -40
- package/src/index.ts +715 -618
- package/scripts/sync-vitest-paths.mjs +0 -63
package/lib/client.js
CHANGED
|
@@ -23,7 +23,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
}) : target, mod));
|
|
24
24
|
|
|
25
25
|
//#endregion
|
|
26
|
-
const
|
|
26
|
+
const __deepseek_ai_dsh_client_store = __toESM(require("@deepseek-ai/dsh-client-store"));
|
|
27
27
|
const react = __toESM(require("react"));
|
|
28
28
|
const __deepseek_ai_dsh_client_ui_primitives = __toESM(require("@deepseek-ai/dsh-client-ui-primitives"));
|
|
29
29
|
const react_jsx_runtime = __toESM(require("react/jsx-runtime"));
|
|
@@ -128,12 +128,16 @@ const en = {
|
|
|
128
128
|
//#endregion
|
|
129
129
|
//#region src/client/store.ts
|
|
130
130
|
/**
|
|
131
|
+
|
|
131
132
|
* Create the wall store handle. Persisted under `dsh.multi-wall` so the port
|
|
133
|
+
|
|
132
134
|
* set and column choice survive view switches and reloads.
|
|
135
|
+
|
|
133
136
|
* @returns the store handle (spec + type + identity + factory in one).
|
|
137
|
+
|
|
134
138
|
*/
|
|
135
139
|
function createWallStore() {
|
|
136
|
-
return (0,
|
|
140
|
+
return (0, __deepseek_ai_dsh_client_store.defineStore)({
|
|
137
141
|
init: () => ({
|
|
138
142
|
ports: [],
|
|
139
143
|
columns: "auto"
|
|
@@ -266,27 +270,27 @@ if (typeof document !== "undefined" && document.querySelector("style[data-plugin
|
|
|
266
270
|
document.head.appendChild(tag);
|
|
267
271
|
}
|
|
268
272
|
var WallView_module_css_default = {
|
|
269
|
-
"
|
|
273
|
+
"controls": "sRUrTW_controls",
|
|
270
274
|
"hint": "sRUrTW_hint",
|
|
275
|
+
"paneActions": "sRUrTW_paneActions",
|
|
276
|
+
"status": "sRUrTW_status",
|
|
277
|
+
"action": "sRUrTW_action",
|
|
271
278
|
"wall": "sRUrTW_wall",
|
|
272
279
|
"danger": "sRUrTW_danger",
|
|
273
|
-
"
|
|
274
|
-
"
|
|
280
|
+
"toolbar": "sRUrTW_toolbar",
|
|
281
|
+
"paneHead": "sRUrTW_paneHead",
|
|
275
282
|
"paneTitle": "sRUrTW_paneTitle",
|
|
276
|
-
"
|
|
277
|
-
"
|
|
278
|
-
"
|
|
283
|
+
"dot": "sRUrTW_dot",
|
|
284
|
+
"confirm": "sRUrTW_confirm",
|
|
285
|
+
"linkBar": "sRUrTW_linkBar",
|
|
279
286
|
"title": "sRUrTW_title",
|
|
287
|
+
"field": "sRUrTW_field",
|
|
288
|
+
"grid": "sRUrTW_grid",
|
|
289
|
+
"pane": "sRUrTW_pane",
|
|
280
290
|
"linkText": "sRUrTW_linkText",
|
|
281
|
-
"paneActions": "sRUrTW_paneActions",
|
|
282
|
-
"status": "sRUrTW_status",
|
|
283
|
-
"confirm": "sRUrTW_confirm",
|
|
284
|
-
"controls": "sRUrTW_controls",
|
|
285
|
-
"paneHead": "sRUrTW_paneHead",
|
|
286
|
-
"empty": "sRUrTW_empty",
|
|
287
291
|
"zoomed": "sRUrTW_zoomed",
|
|
288
|
-
"
|
|
289
|
-
"
|
|
292
|
+
"paneBody": "sRUrTW_paneBody",
|
|
293
|
+
"empty": "sRUrTW_empty"
|
|
290
294
|
};
|
|
291
295
|
|
|
292
296
|
//#endregion
|
|
@@ -303,29 +307,43 @@ const COLUMN_PRESETS = [
|
|
|
303
307
|
/** Embed flag appended to every pane URL; such pages register no wall UI. */
|
|
304
308
|
const EMBED_FLAG = "multi-wall=embed";
|
|
305
309
|
/**
|
|
310
|
+
|
|
306
311
|
* Whether this wall is being viewed through the phone gateway (a non-loopback
|
|
312
|
+
|
|
307
313
|
* host) rather than on the machine running DSH. When remote, pane iframes must
|
|
314
|
+
|
|
308
315
|
* load through the gateway's `/gw/<port>` route — a phone's `127.0.0.1` points
|
|
316
|
+
|
|
309
317
|
* at the phone itself, not the host.
|
|
318
|
+
|
|
310
319
|
*/
|
|
311
320
|
function isRemoteViewer() {
|
|
312
321
|
const host = typeof window !== "undefined" ? window.location.hostname : "";
|
|
313
322
|
return host !== "localhost" && host !== "127.0.0.1" && host !== "::1";
|
|
314
323
|
}
|
|
315
324
|
/**
|
|
325
|
+
|
|
316
326
|
* The iframe URL for a pane. Local viewers embed the loopback instance
|
|
327
|
+
|
|
317
328
|
* directly; remote (phone) viewers route through the gateway that is already
|
|
329
|
+
|
|
318
330
|
* serving this page, appending the port so the gateway proxies to it.
|
|
331
|
+
|
|
319
332
|
* @param port - target DSH instance port.
|
|
333
|
+
|
|
320
334
|
* @returns the pane URL.
|
|
335
|
+
|
|
321
336
|
*/
|
|
322
337
|
function paneUrl(port) {
|
|
323
338
|
if (isRemoteViewer()) return `${window.location.origin}/gw/${port}/?${EMBED_FLAG}`;
|
|
324
339
|
return `http://127.0.0.1:${port}/?${EMBED_FLAG}`;
|
|
325
340
|
}
|
|
326
341
|
/**
|
|
342
|
+
|
|
327
343
|
* One pane: header (port, liveness dot, zoom/refresh/open/stop/remove) plus
|
|
344
|
+
|
|
328
345
|
* the embedded original DSH UI.
|
|
346
|
+
|
|
329
347
|
*/
|
|
330
348
|
function WallPane(props) {
|
|
331
349
|
const { port, alive, zoomed, stopping, onZoom, onStop, onRemove, t } = props;
|
|
@@ -352,7 +370,7 @@ function WallPane(props) {
|
|
|
352
370
|
className: WallView_module_css_default.action,
|
|
353
371
|
title: t("zoom"),
|
|
354
372
|
onClick: onZoom,
|
|
355
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
373
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutlineRegular, { size: 14 })
|
|
356
374
|
}),
|
|
357
375
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
358
376
|
type: "button",
|
|
@@ -361,7 +379,7 @@ function WallPane(props) {
|
|
|
361
379
|
onClick: (e) => {
|
|
362
380
|
e.currentTarget.closest("section")?.querySelector("iframe")?.contentWindow?.location.reload();
|
|
363
381
|
},
|
|
364
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
382
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 14 })
|
|
365
383
|
}),
|
|
366
384
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
367
385
|
type: "button",
|
|
@@ -370,21 +388,21 @@ function WallPane(props) {
|
|
|
370
388
|
onClick: () => {
|
|
371
389
|
window.open(paneUrl(port), "_blank");
|
|
372
390
|
},
|
|
373
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
391
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRightUpOutlineRegular, { size: 14 })
|
|
374
392
|
}),
|
|
375
393
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
376
394
|
type: "button",
|
|
377
395
|
className: clsx_default(WallView_module_css_default.action, WallView_module_css_default.danger, stopping && WallView_module_css_default.confirm),
|
|
378
396
|
title: t("stop"),
|
|
379
397
|
onClick: onStop,
|
|
380
|
-
children: stopping ? t("stop.confirm") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
398
|
+
children: stopping ? t("stop.confirm") : /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconStopFillRegular, { size: 14 })
|
|
381
399
|
}),
|
|
382
400
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
383
401
|
type: "button",
|
|
384
402
|
className: WallView_module_css_default.action,
|
|
385
403
|
title: t("remove"),
|
|
386
404
|
onClick: onRemove,
|
|
387
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
405
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 14 })
|
|
388
406
|
})
|
|
389
407
|
]
|
|
390
408
|
})
|
|
@@ -400,11 +418,17 @@ function WallPane(props) {
|
|
|
400
418
|
});
|
|
401
419
|
}
|
|
402
420
|
/**
|
|
421
|
+
|
|
403
422
|
* Render the wall: toolbar plus the horizontally-filled pane grid. Discovery
|
|
423
|
+
|
|
404
424
|
* runs on mount and liveness polls every 5s; the store's persisted ports
|
|
425
|
+
|
|
405
426
|
* survive view switches and reloads.
|
|
427
|
+
|
|
406
428
|
* @param props - composed slot props.
|
|
429
|
+
|
|
407
430
|
* @returns the wall surface.
|
|
431
|
+
|
|
408
432
|
*/
|
|
409
433
|
function WallView({ useStore, actions, discover, probe, stop, create, link, t }) {
|
|
410
434
|
const ports = useStore((s) => s.ports);
|
|
@@ -558,7 +582,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
558
582
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
559
583
|
variant: "toolbar",
|
|
560
584
|
size: "sm",
|
|
561
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
585
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconPlusOutlineRegular, { size: 14 }),
|
|
562
586
|
disabled: creating,
|
|
563
587
|
onClick: () => {
|
|
564
588
|
handleCreate();
|
|
@@ -570,7 +594,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
570
594
|
anchor: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
571
595
|
variant: "toolbar",
|
|
572
596
|
size: "sm",
|
|
573
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
597
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRightUpOutlineRegular, { size: 14 }),
|
|
574
598
|
onClick: () => {
|
|
575
599
|
setColsMenuOpen(true);
|
|
576
600
|
},
|
|
@@ -593,7 +617,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
593
617
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
594
618
|
variant: "toolbar",
|
|
595
619
|
size: "sm",
|
|
596
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
620
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconRefreshOutlineRegular, { size: 14 }),
|
|
597
621
|
onClick: () => {
|
|
598
622
|
document.querySelectorAll(`.${WallView_module_css_default.paneBody} iframe`).forEach((f) => {
|
|
599
623
|
f.contentWindow?.location.reload();
|
|
@@ -605,7 +629,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
605
629
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
606
630
|
variant: "toolbar",
|
|
607
631
|
size: "sm",
|
|
608
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
632
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconGlobeOutlineRegular, { size: 14 }),
|
|
609
633
|
"aria-label": t("link.aria"),
|
|
610
634
|
onClick: () => {
|
|
611
635
|
handleLink();
|
|
@@ -615,7 +639,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
615
639
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
616
640
|
variant: "toolbar",
|
|
617
641
|
size: "sm",
|
|
618
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
642
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 14 }),
|
|
619
643
|
"aria-label": t("exit.aria"),
|
|
620
644
|
title: t("exit"),
|
|
621
645
|
onClick: () => {
|
|
@@ -645,7 +669,7 @@ function WallView({ useStore, actions, discover, probe, stop, create, link, t })
|
|
|
645
669
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.Button, {
|
|
646
670
|
variant: "ghost",
|
|
647
671
|
size: "sm",
|
|
648
|
-
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
672
|
+
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconCloseOutlineRegular, { size: 14 }),
|
|
649
673
|
onClick: () => {
|
|
650
674
|
setLinkOpen(false);
|
|
651
675
|
},
|
|
@@ -700,9 +724,13 @@ var WallToggle_module_css_default = {
|
|
|
700
724
|
//#endregion
|
|
701
725
|
//#region src/client/WallToggle.tsx
|
|
702
726
|
/**
|
|
727
|
+
|
|
703
728
|
* Render the wall shortcut row (icon; label only in the wide column).
|
|
729
|
+
|
|
704
730
|
* @param props - composed slot props.
|
|
731
|
+
|
|
705
732
|
* @returns the shortcut row.
|
|
733
|
+
|
|
706
734
|
*/
|
|
707
735
|
function WallToggle({ wide, t }) {
|
|
708
736
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
@@ -715,7 +743,7 @@ function WallToggle({ wide, t }) {
|
|
|
715
743
|
const tab = Array.from(document.querySelectorAll("[role=\"tab\"]")).find((el) => el.textContent?.trim() === label);
|
|
716
744
|
tab?.click();
|
|
717
745
|
},
|
|
718
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.
|
|
746
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(__deepseek_ai_dsh_client_ui_primitives.IconFullscreenOutlineRegular, { size: wide ? 16 : 18 }), wide && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
719
747
|
className: WallToggle_module_css_default.label,
|
|
720
748
|
children: t("toggle")
|
|
721
749
|
})]
|
|
@@ -729,19 +757,29 @@ const NS = "multiWall";
|
|
|
729
757
|
/** Required services: slots for both registrations, locale for copy. */
|
|
730
758
|
const inject = ["slots", "locale"];
|
|
731
759
|
/**
|
|
760
|
+
|
|
732
761
|
* Whether this page is an embedded wall pane. Panes load
|
|
762
|
+
|
|
733
763
|
* `?multi-wall=embed`; such pages register no wall UI at all, which stops a
|
|
764
|
+
|
|
734
765
|
* wall inside a wall (the pane would otherwise recursively embed the
|
|
766
|
+
|
|
735
767
|
* serving instance).
|
|
768
|
+
|
|
736
769
|
* @returns true when the query flag is present.
|
|
770
|
+
|
|
737
771
|
*/
|
|
738
772
|
function isEmbeddedPane() {
|
|
739
773
|
return new URLSearchParams(window.location.search).has("multi-wall");
|
|
740
774
|
}
|
|
741
775
|
/**
|
|
776
|
+
|
|
742
777
|
* Client plugin body: register the dictionaries, the view-ring entry (the
|
|
778
|
+
|
|
743
779
|
* wall), and the sidebar footer shortcut. Embedded panes register nothing.
|
|
780
|
+
|
|
744
781
|
* @param ctx - client root context.
|
|
782
|
+
|
|
745
783
|
*/
|
|
746
784
|
function apply(ctx) {
|
|
747
785
|
if (isEmbeddedPane()) return;
|
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["ports: number[]","port: number","columns: string","ports: number[]","port: number","data: Partial<CreateRow>","port: number","props: {\n port: number\n alive: boolean\n zoomed: boolean\n stopping: boolean\n onZoom: () => void\n onStop: () => void\n onRemove: () => void\n t: TranslateNS<'multiWall'>\n}","css","StateDot","IconFullscreenOutline16","IconRefreshOutline16","IconRightUpOutline16","IconStopFill16","IconCloseOutline16","next: Record<number, boolean>","Input","Button","IconPlusOutline16","Menu","IconRefreshOutline14","IconGlobeOutline14","css","IconFullscreenOutline16","ctx: ClientContext"],"sources":["../src/client/locales.ts","../src/client/store.ts","../src/client/wall-injected.ts","../node_modules/clsx/dist/clsx.mjs","../src/client/WallView.tsx","../src/client/WallToggle.tsx","../src/client/index.ts"],"sourcesContent":["/** `multiWall` namespace dictionaries. */\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'toggle': '多窗口',\n 'toggle.aria': '打开或关闭多窗口',\n 'view.multiWall': '多窗口',\n 'overlay.title': '多窗口',\n 'overlay.close': '关闭',\n 'scan': '发现实例',\n 'scan.from': '起始端口',\n 'scan.to': '结束端口',\n 'create': '新建窗口',\n 'create.pending': '启动中…',\n 'create.done': '已创建窗口 :{port}',\n 'create.failed': '创建失败:{error}',\n 'create.unknown': '未知原因',\n 'exit': '退出',\n 'exit.aria': '退出多窗口,返回对话',\n 'link': '手机访问',\n 'link.aria': '获取手机访问链接',\n 'link.fetching': '正在获取链接…',\n 'link.none': '未检测到局域网地址',\n 'link.copy': '复制链接',\n 'link.copied': '已复制',\n 'link.hint': '提示:{hint}',\n 'link.reachable': '手机在同一网络时可用:{urls}',\n 'link.unreachable': '当前实例仅绑定本机,手机无法访问。{hint}',\n 'link.token': '口令:{token}',\n 'columns': '列数',\n 'columns.auto': '自动',\n 'refresh': '全部刷新',\n 'openTab': '新标签页打开',\n 'reload': '重新加载',\n 'remove': '从视图移除',\n 'stop': '关闭实例',\n 'stop.confirm': '确定关闭?',\n 'stop.self': '即将关闭当前实例(本页面将断开)',\n 'stop.done': '已关闭 :{port}',\n 'stop.failed': '关闭 :{port} 失败:{error}',\n 'zoom': '放大',\n 'loading': '加载中',\n 'empty': '没有检测到 DSH 实例',\n 'empty.hint': '先启动若干 dsh web --port <n> 实例,再点击「发现实例」或手动添加端口。',\n 'status.scanning': '扫描 {from}–{to} …',\n 'status.found': '发现 {count} 个实例:{ports}',\n 'status.none': '区间 {from}–{to} 未发现 DSH 实例',\n 'status.refreshed': '已刷新全部窗口',\n} satisfies Record<string, string>\n\n/** The multi-wall namespace key union. */\nexport type MultiWallKey = keyof typeof zh\n\n/** English dictionary, checked complete against the zh key set. */\nexport const en = {\n 'toggle': 'Multi-Window',\n 'toggle.aria': 'Toggle multi-window',\n 'view.multiWall': 'Multi-Window',\n 'overlay.title': 'Multi-Window',\n 'overlay.close': 'Close',\n 'scan': 'Discover',\n 'scan.from': 'Start port',\n 'scan.to': 'End port',\n 'create': 'New window',\n 'create.pending': 'Starting…',\n 'create.done': 'Created window :{port}',\n 'create.failed': 'Create failed: {error}',\n 'create.unknown': 'unknown reason',\n 'exit': 'Exit',\n 'exit.aria': 'Exit multi-window and return to chat',\n 'link': 'Phone access',\n 'link.aria': 'Get phone access link',\n 'link.fetching': 'Fetching link…',\n 'link.none': 'No LAN address detected',\n 'link.copy': 'Copy link',\n 'link.copied': 'Copied',\n 'link.hint': 'Hint: {hint}',\n 'link.reachable': 'Reachable on the same network: {urls}',\n 'link.unreachable': 'This instance binds loopback only; phones cannot reach it. {hint}',\n 'link.token': 'Token: {token}',\n 'columns': 'Columns',\n 'columns.auto': 'Auto',\n 'refresh': 'Refresh all',\n 'openTab': 'Open in new tab',\n 'reload': 'Reload',\n 'remove': 'Remove from view',\n 'stop': 'Stop instance',\n 'stop.confirm': 'Confirm stop?',\n 'stop.self': 'Stopping the current instance (this page will disconnect)',\n 'stop.done': 'Stopped :{port}',\n 'stop.failed': 'Failed to stop :{port}: {error}',\n 'zoom': 'Zoom',\n 'loading': 'Loading',\n 'empty': 'No DSH instances found',\n 'empty.hint': 'Start a few `dsh web --port <n>` instances first, then click \"Discover\" or add a port manually.',\n 'status.scanning': 'Scanning {from}–{to} …',\n 'status.found': 'Found {count} instance(s): {ports}',\n 'status.none': 'No DSH instances in {from}–{to}',\n 'status.refreshed': 'Refreshed all windows',\n} satisfies Record<MultiWallKey, string>\n","/**\n * Wall store: which instances are shown and the grid columns. The ports list\n * is the wall's whole business state — discovery writes it, removal filters\n * it, and the grid renders from it. Open/closed is NOT stored here: the wall\n * is a `conversation.view` ring entry, so the active view (chat store's\n * `view` field) decides whether it renders.\n */\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-runtime/client'\n\n/** Wall viewing state: displayed ports and grid columns. */\nexport type WallState = {\n ports: number[]\n columns: string\n}\n\n/** The wall store's complete write set. */\nexport type WallActions = {\n setPorts: (draft: WallState, ports: number[]) => void\n addPort: (draft: WallState, port: number) => void\n removePort: (draft: WallState, port: number) => void\n setColumns: (draft: WallState, columns: string) => void\n}\n\n/**\n * Create the wall store handle. Persisted under `dsh.multi-wall` so the port\n * set and column choice survive view switches and reloads.\n * @returns the store handle (spec + type + identity + factory in one).\n */\nexport function createWallStore(): EngineStoreHandle<WallState, WallActions> {\n return defineStore({\n init: (): WallState => ({ ports: [], columns: 'auto' }),\n persist: 'dsh.multi-wall',\n actions: {\n setPorts: (d, ports: number[]) => { d.ports = ports },\n addPort: (d, port: number) => { if (!d.ports.includes(port)) d.ports = [...d.ports, port] },\n removePort: (d, port: number) => { d.ports = d.ports.filter(p => p !== port) },\n setColumns: (d, columns: string) => { d.columns = columns },\n },\n })\n}\n","/**\n * Injected probe face for the wall view: same-origin fetches to the node\n * half's /multi/api routes. Callbacks only — components never see ctx.\n */\n\n/** One liveness row from /multi/api/status. */\nexport interface ProbeRow {\n port: number\n alive: boolean\n status: number\n}\n\n/** One stop result row from /multi/api/stop. */\nexport interface StopRow {\n port: number\n ok: boolean\n error?: string\n}\n\n/** One create result row from /multi/api/create. */\nexport interface CreateRow {\n ok: boolean\n port?: number\n error?: string\n}\n\n/** The phone-reachable link info from /multi/api/link. */\nexport interface LinkRow {\n port: number\n host: string\n /** LAN URLs (`http://<lan-ip>:<gateway-port>/`), possibly empty. */\n lan: string[]\n /** Whether the instance is reachable off-loopback (gateway running). */\n reachable: boolean\n /** The inline gateway's listen port (when started). */\n gatewayPort?: number\n /** The login token (generated or configured). */\n token?: string\n /** Human hint when not reachable. */\n hint?: string\n}\n\n/** The inject face delivered to the wall view registration. */\nexport interface WallInjected {\n /** Discover live DSH instances (same-origin /multi/api/ports). */\n discover: () => Promise<number[]>\n /** Probe liveness of specific ports (same-origin /multi/api/status). */\n probe: (ports: number[]) => Promise<ProbeRow[]>\n /** Terminate the DSH instance on one port (same-origin /multi/api/stop). */\n stop: (port: number) => Promise<StopRow>\n /** Start a new DSH instance and return its port (same-origin /multi/api/create). */\n create: () => Promise<CreateRow>\n /** The phone-reachable link for this instance (same-origin /multi/api/link). */\n link: () => Promise<LinkRow>\n}\n\n/**\n * Build the probe face bound to this origin's /multi/api routes.\n * @param mount - the API base path ('' at the root, '/multi' when mounted).\n * @returns the injected callbacks.\n */\nexport function createWallInjected(mount = ''): WallInjected {\n const base = mount.replace(/\\/+$/, '')\n return {\n discover: async () => {\n const res = await fetch(`${base}/multi/api/ports`)\n if (!res.ok) return []\n const data = (await res.json()) as { ports?: { port: number; alive: boolean }[] }\n return (data.ports ?? []).filter(p => p.alive).map(p => p.port)\n },\n probe: async (ports: number[]) => {\n const res = await fetch(`${base}/multi/api/status?ports=${ports.join(',')}`)\n if (!res.ok) return []\n const data = (await res.json()) as { ports?: ProbeRow[] }\n return data.ports ?? []\n },\n stop: async (port: number) => {\n const res = await fetch(`${base}/multi/api/stop?port=${port}`, { method: 'POST' })\n if (!res.ok) return { port, ok: false, error: `HTTP ${res.status}` }\n const data = (await res.json()) as { ports?: StopRow[] }\n return data.ports?.[0] ?? { port, ok: false, error: 'no result' }\n },\n create: async () => {\n // Harden the failure surface: a non-2xx answer, an HTML fallback page\n // (route missing) or a truncated body must never degrade into the bare\n // \"unknown\" the UI shows for a missing error field.\n const res = await fetch(`${base}/multi/api/create`, { method: 'POST' })\n if (!res.ok) {\n return { ok: false, error: `HTTP ${res.status}` }\n }\n const text = await res.text()\n let data: Partial<CreateRow>\n try {\n data = JSON.parse(text) as Partial<CreateRow>\n } catch {\n const snippet = text.trim().slice(0, 120)\n return { ok: false, error: `invalid response: ${snippet === '' ? '<empty body>' : snippet}` }\n }\n if (data.ok === true) {\n return data.port !== undefined\n ? { ok: true, port: data.port }\n : { ok: false, error: 'no port in response' }\n }\n return {\n ok: false,\n ...(typeof data.error === 'string' ? { error: data.error } : { error: 'server returned no reason' }),\n }\n },\n link: async () => {\n const res = await fetch(`${base}/multi/api/link`)\n const data = (await res.json().catch(() => ({}))) as Partial<LinkRow>\n return {\n port: data.port ?? 0,\n host: data.host ?? 'unknown',\n lan: data.lan ?? [],\n reachable: data.reachable === true,\n ...(typeof data.gatewayPort === 'number' ? { gatewayPort: data.gatewayPort } : {}),\n ...(typeof data.token === 'string' ? { token: data.token } : {}),\n ...(typeof data.hint === 'string' ? { hint: data.hint } : {}),\n }\n },\n }\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\n * WallView: the multi-window wall as a `conversation.view` ring entry. When\n * the header's \"多窗口\" tab is selected, the right panel swaps from the\n * chat to this view — a toolbar plus a grid of iframes, one pane per running\n * DSH instance (127.0.0.1:<port>). Pure additive UI; no existing slot is\n * replaced.\n *\n * Recursion guard: panes embed `?multi-wall=embed` (the embedded page\n * registers no wall UI). The serving instance is itself a pane, so the user\n * can watch — or stop — the very instance they are in.\n *\n * Live data channels: the store owns ports/columns; discovery writes\n * `setPorts` from /multi/api/ports (same-origin, served by the node half);\n * per-pane liveness arrives from /multi/api/status polls. Components never\n * see ctx — the fetch helpers are injected through the registration.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport clsx from 'clsx'\nimport {\n IconCloseOutline16, IconFullscreenOutline16, IconGlobeOutline14, IconPlusOutline16,\n IconRefreshOutline14, IconRefreshOutline16, IconRightUpOutline16, IconStopFill16,\n Button, Input, Menu, StateDot,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale, PropsStore, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { HandleOf } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/client'\nimport type { createWallStore } from './store.ts'\nimport type { WallInjected } from './wall-injected.ts'\nimport css from './WallView.module.css'\n\n/** Composed props: the view-ring runtime share, the store, the probe face, and locale. */\nexport type WallViewProps =\n & ConvViewProps\n & PropsStore<HandleOf<typeof createWallStore>>\n & WallInjected\n & PropsLocale<'multiWall'>\n\n/** Grid column presets, driven by the toolbar menu. 'auto' fills the row. */\nconst COLUMN_PRESETS = ['auto', '1', '2', '3', '4', '6'] as const\n\n/** Embed flag appended to every pane URL; such pages register no wall UI. */\nconst EMBED_FLAG = 'multi-wall=embed'\n\n/**\n * Whether this wall is being viewed through the phone gateway (a non-loopback\n * host) rather than on the machine running DSH. When remote, pane iframes must\n * load through the gateway's `/gw/<port>` route — a phone's `127.0.0.1` points\n * at the phone itself, not the host.\n */\nfunction isRemoteViewer(): boolean {\n const host = typeof window !== 'undefined' ? window.location.hostname : ''\n return host !== 'localhost' && host !== '127.0.0.1' && host !== '::1'\n}\n\n/**\n * The iframe URL for a pane. Local viewers embed the loopback instance\n * directly; remote (phone) viewers route through the gateway that is already\n * serving this page, appending the port so the gateway proxies to it.\n * @param port - target DSH instance port.\n * @returns the pane URL.\n */\nfunction paneUrl(port: number): string {\n if (isRemoteViewer()) {\n return `${window.location.origin}/gw/${port}/?${EMBED_FLAG}`\n }\n return `http://127.0.0.1:${port}/?${EMBED_FLAG}`\n}\n\n/**\n * One pane: header (port, liveness dot, zoom/refresh/open/stop/remove) plus\n * the embedded original DSH UI.\n */\nfunction WallPane(props: {\n port: number\n alive: boolean\n zoomed: boolean\n stopping: boolean\n onZoom: () => void\n onStop: () => void\n onRemove: () => void\n t: TranslateNS<'multiWall'>\n}) {\n const { port, alive, zoomed, stopping, onZoom, onStop, onRemove, t } = props\n return (\n <section className={clsx(css.pane, zoomed && css.zoomed)} data-port={port}>\n <div className={css.paneHead}>\n <StateDot state={alive ? 'done' : 'warning'} size={8} className={css.dot} />\n <span className={css.paneTitle}>127.0.0.1:{port}</span>\n <div className={css.paneActions}>\n <button type=\"button\" className={css.action} title={t('zoom')} onClick={onZoom}>\n <IconFullscreenOutline16 size={14} />\n </button>\n <button type=\"button\" className={css.action} title={t('reload')} onClick={(e) => {\n e.currentTarget.closest('section')?.querySelector('iframe')?.contentWindow?.location.reload()\n }}>\n <IconRefreshOutline16 size={14} />\n </button>\n <button type=\"button\" className={css.action} title={t('openTab')} onClick={() => {\n window.open(paneUrl(port), '_blank')\n }}>\n <IconRightUpOutline16 size={14} />\n </button>\n <button\n type=\"button\"\n className={clsx(css.action, css.danger, stopping && css.confirm)}\n title={t('stop')}\n onClick={onStop}\n >\n {stopping ? t('stop.confirm') : <IconStopFill16 size={14} />}\n </button>\n <button type=\"button\" className={css.action} title={t('remove')} onClick={onRemove}>\n <IconCloseOutline16 size={14} />\n </button>\n </div>\n </div>\n <div className={css.paneBody}>\n <iframe\n title={`DSH :${port}`}\n src={paneUrl(port)}\n loading=\"lazy\"\n />\n </div>\n </section>\n )\n}\n\n/**\n * Render the wall: toolbar plus the horizontally-filled pane grid. Discovery\n * runs on mount and liveness polls every 5s; the store's persisted ports\n * survive view switches and reloads.\n * @param props - composed slot props.\n * @returns the wall surface.\n */\nexport function WallView({ useStore, actions, discover, probe, stop, create, link, t }: WallViewProps) {\n const ports = useStore(s => s.ports)\n const columns = useStore(s => s.columns)\n const [alive, setAlive] = useState<Record<number, boolean>>({})\n const [zoomedPort, setZoomedPort] = useState<number | null>(null)\n const [confirmingStop, setConfirmingStop] = useState<number | null>(null)\n const [scanFrom, setScanFrom] = useState(3070)\n const [scanTo, setScanTo] = useState(3110)\n const [colsMenuOpen, setColsMenuOpen] = useState(false)\n const [creating, setCreating] = useState(false)\n const [linkOpen, setLinkOpen] = useState(false)\n const [linkInfo, setLinkInfo] = useState<Awaited<ReturnType<WallViewProps['link']>> | null>(null)\n const [linkCopied, setLinkCopied] = useState(false)\n const [status, setStatus] = useState('')\n const aliveRef = useRef<Record<number, boolean>>({})\n aliveRef.current = alive\n\n // Discover on mount (the view renders only while selected), then poll\n // liveness while the view stays mounted.\n useEffect(() => {\n void discover().then(found => {\n if (found.length > 0) actions.setPorts(found)\n setStatus(found.length > 0 ? t('status.found').replace('{count}', String(found.length)).replace('{ports}', found.join(', ')) : '')\n })\n const timer = setInterval(() => {\n if (ports.length === 0) return\n void probe(ports).then(rows => {\n const next: Record<number, boolean> = {}\n for (const row of rows) next[row.port] = row.alive\n setAlive(next)\n })\n }, 5000)\n return () => { clearInterval(timer) }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n // Stop is destructive: the first click arms a per-pane confirm, the second\n // executes it. Any other interaction clears the arm. The serving instance\n // itself may be stopped too (the user may want to take this port down).\n const handleStop = async (port: number) => {\n if (confirmingStop !== port) {\n setConfirmingStop(port)\n return\n }\n setConfirmingStop(null)\n const result = await stop(port)\n if (result.ok) {\n actions.removePort(port)\n setAlive(current => ({ ...current, [port]: false }))\n setStatus(t('stop.done').replace('{port}', String(port)))\n } else {\n setStatus(t('stop.failed').replace('{port}', String(port)).replace('{error}', result.error ?? ''))\n }\n }\n\n const runDiscovery = async () => {\n setStatus(t('status.scanning').replace('{from}', String(scanFrom)).replace('{to}', String(scanTo)))\n const found = await discover()\n if (found.length === 0) {\n setStatus(t('status.none').replace('{from}', String(scanFrom)).replace('{to}', String(scanTo)))\n return\n }\n actions.setPorts(found)\n setStatus(t('status.found').replace('{count}', String(found.length)).replace('{ports}', found.join(', ')))\n }\n\n // Start a brand-new DSH instance and add it to the wall. Failures always\n // surface a concrete reason: the injected face reports HTTP status / body\n // problems, and a thrown fetch surfaces its message — never a silent stall.\n const handleCreate = async () => {\n setCreating(true)\n setStatus('')\n try {\n const result = await create()\n if (result.ok && result.port !== undefined) {\n actions.addPort(result.port)\n setAlive(current => ({ ...current, [result.port!]: true }))\n setStatus(t('create.done').replace('{port}', String(result.port)))\n } else {\n setStatus(t('create.failed').replace('{error}', result.error ?? t('create.unknown')))\n }\n } catch (error) {\n setStatus(t('create.failed').replace('{error}', error instanceof Error ? error.message : String(error)))\n } finally {\n setCreating(false)\n }\n }\n\n // Leave the wall: switch the view ring back to the default chat view. The\n // ring's active view lives in the chat store and only the header tab's\n // click handler mutates it, so exit reuses that sanctioned path — the chat\n // entry is always the first tab (order 0), which makes the click\n // locale-independent. No tab (blank session) is a no-op.\n const exitWall = () => {\n const tab = document.querySelector<HTMLButtonElement>('[role=\"tablist\"] [role=\"tab\"]')\n tab?.click()\n }\n\n // Fetch the phone-reachable link(s) for this instance and open the sheet.\n const handleLink = async () => {\n if (linkInfo === null) {\n setStatus(t('link.fetching'))\n const info = await link()\n setLinkInfo(info)\n }\n setLinkOpen(true)\n setLinkCopied(false)\n setStatus('')\n }\n\n // Copy the first phone-reachable link to the clipboard. When the gateway\n // issued a token it is appended as `?token=` so the phone bypasses the login\n // form entirely (the gateway accepts a matching `?token=` query); the URL is\n // otherwise the bare link. The standalone token line is still shown above so\n // users who prefer typing it can.\n const copyFirstLink = async () => {\n if (linkInfo === null || linkInfo.lan.length === 0) return\n try {\n const base = linkInfo.lan[0] ?? ''\n const token = linkInfo.token ?? ''\n const url = token !== '' ? `${base}?token=${encodeURIComponent(token)}` : base\n await navigator.clipboard.writeText(url)\n setLinkCopied(true)\n } catch {\n setLinkCopied(false)\n }\n }\n\n // Every discovered port renders, including the one serving this wall: the\n // user may want to watch (or stop) the instance they are in. Recursion is\n // prevented by the embed flag, not by hiding the self pane.\n const shown = ports\n\n return (\n <div className={css.wall} role=\"region\" aria-label={t('overlay.title')} data-wall-view=\"\">\n <div className={css.toolbar}>\n <span className={css.title}>{t('overlay.title')}</span>\n <span className={css.status}>{status}</span>\n <div className={css.controls}>\n <label className={css.field}>{t('scan.from')}\n <Input\n type=\"number\"\n value={scanFrom}\n onChange={e => setScanFrom(Number(e.target.value))}\n />\n </label>\n <label className={css.field}>{t('scan.to')}\n <Input\n type=\"number\"\n value={scanTo}\n onChange={e => setScanTo(Number(e.target.value))}\n />\n </label>\n <Button variant=\"toolbar\" size=\"sm\" onClick={() => { void runDiscovery() }}>{t('scan')}</Button>\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n icon={<IconPlusOutline16 size={14} />}\n disabled={creating}\n onClick={() => { void handleCreate() }}\n >\n {creating ? t('create.pending') : t('create')}\n </Button>\n <Menu\n open={colsMenuOpen}\n anchor={\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n icon={<IconRightUpOutline16 size={14} />}\n onClick={() => { setColsMenuOpen(true) }}\n >\n {columns === 'auto' ? t('columns.auto') : columns}\n </Button>\n }\n items={COLUMN_PRESETS.map(c => ({\n id: c,\n label: c === 'auto' ? t('columns.auto') : c,\n }))}\n selectedId={columns}\n onSelect={(id) => {\n actions.setColumns(id)\n setColsMenuOpen(false)\n }}\n onClose={() => { setColsMenuOpen(false) }}\n compact\n />\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n icon={<IconRefreshOutline14 size={14} />}\n onClick={() => {\n document.querySelectorAll(`.${css.paneBody} iframe`).forEach(f => {\n (f as HTMLIFrameElement).contentWindow?.location.reload()\n })\n setStatus(t('status.refreshed'))\n }}\n >\n {t('refresh')}\n </Button>\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n icon={<IconGlobeOutline14 size={14} />}\n aria-label={t('link.aria')}\n onClick={() => { void handleLink() }}\n >\n {t('link')}\n </Button>\n <Button\n variant=\"toolbar\"\n size=\"sm\"\n icon={<IconCloseOutline16 size={14} />}\n aria-label={t('exit.aria')}\n title={t('exit')}\n onClick={() => { exitWall() }}\n >\n {t('exit')}\n </Button>\n </div>\n </div>\n {linkOpen && linkInfo !== null && (\n <div className={css.linkBar}>\n {linkInfo.reachable\n ? (\n <>\n <span className={css.linkText}>\n {t('link.reachable').replace('{urls}', linkInfo.lan.join(' '))}\n {linkInfo.token !== undefined && linkInfo.token !== ''\n ? ` ${t('link.token').replace('{token}', linkInfo.token)}`\n : ''}\n </span>\n {linkInfo.lan.length > 0 && (\n <Button variant=\"outline\" size=\"sm\" onClick={() => { void copyFirstLink() }}>\n {linkCopied ? t('link.copied') : t('link.copy')}\n </Button>\n )}\n </>\n )\n : (\n <span className={css.linkText}>\n {t('link.unreachable').replace('{hint}', linkInfo.hint ?? '')}\n </span>\n )}\n <Button variant=\"ghost\" size=\"sm\" icon={<IconCloseOutline16 size={14} />} onClick={() => { setLinkOpen(false) }}>\n {t('overlay.close')}\n </Button>\n </div>\n )}\n <div className={css.grid} data-cols={columns}>\n {shown.map(port => (\n <WallPane\n key={port}\n port={port}\n alive={aliveRef.current[port] ?? true}\n zoomed={zoomedPort === port}\n stopping={confirmingStop === port}\n onZoom={() => setZoomedPort(zoomedPort === port ? null : port)}\n onStop={() => { void handleStop(port) }}\n onRemove={() => { setConfirmingStop(null); actions.removePort(port) }}\n t={t}\n />\n ))}\n {shown.length === 0 && (\n <div className={css.empty}>\n <p>{t('empty')}</p>\n <p className={css.hint}>{t('empty.hint')}</p>\n </div>\n )}\n </div>\n </div>\n )\n}\n","/**\n * WallToggle: the sidebar-foot shortcut. Clicking it opens the wall view —\n * the `conversation.view` ring switches to the 'multi-wall' entry, which the\n * header renders as the \"多窗口\" tab. The click is a plain user-equivalent\n * activation: it finds the header's view-ring tab for this plugin's label and\n * clicks it, so the official view-ring state machine (the chat store's active\n * view field) performs the switch. No store is declared: the ring decides\n * what renders, so this row owns no state.\n *\n * Session-scoped by design: the view ring (and its header tabs) only renders\n * with an active session, so the shortcut is inert on the empty-hero screen —\n * the user first opens or creates a session (the official flow), after which\n * the tab is present and the click lands.\n */\nimport { IconFullscreenOutline16 } from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport css from './WallToggle.module.css'\n\n/** Composed props: sidebar column state + locale. */\nexport type WallToggleProps =\n & PropsRuntime<'sidebar.footer.action'>\n & PropsLocale<'multiWall'>\n\n/**\n * Render the wall shortcut row (icon; label only in the wide column).\n * @param props - composed slot props.\n * @returns the shortcut row.\n */\nexport function WallToggle({ wide, t }: WallToggleProps) {\n return (\n <button\n type=\"button\"\n className={css.row}\n aria-label={t('toggle.aria')}\n title={t('toggle')}\n onClick={() => {\n // The official view ring renders the active entry through\n // `only: <active id>`; the only sanctioned way to move it is the\n // header tab's click handler (actions.setView). Trigger that same\n // element instead of reaching into the chat store from the root\n // scope. No tab (no active session) is a no-op.\n const label = t('view.multiWall')\n const tab = Array.from(document.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]'))\n .find(el => el.textContent?.trim() === label)\n tab?.click()\n }}\n >\n <IconFullscreenOutline16 size={wide ? 16 : 18} />\n {wide && <span className={css.label}>{t('toggle')}</span>}\n </button>\n )\n}\n","/**\n * Multi-window wall plugin, browser half: contributes the wall as a\n * `conversation.view` ring entry (the official replace-the-chat-surface\n * mechanism — the header grows a \"多窗口墙\" tab and the right panel swaps to\n * the wall) plus a sidebar footer shortcut that jumps to that view. No\n * existing slot is replaced and no original interaction logic changes; the\n * wall is pure UI over the node half's /multi/api probe routes.\n *\n * Recursion guard: a wall pane embeds each instance as\n * `http://127.0.0.1:<port>/?multi-wall=embed`; the embedded page sees the\n * query flag and registers nothing, so a pane can never grow a wall of its\n * own. The wall also never renders the port it is served on (SELF_PORT is\n * filtered at render time and by the node half's discovery).\n */\nimport type { ClientContext } from '@deepseek-ai/dsh-client-runtime/client'\n// Type-only: pulls the layout-owned slot declarations (sidebar footer,\n// shell.overlay) into this program.\nimport type {} from '@deepseek-ai/dsh-client-ui-layout/client'\n// Type-only: pulls the conversation package's view-ring declaration\n// ('conversation.view') into this program.\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\n// Type-only: pulls the sidebar footer action owner props into this program.\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\n// Type-only: pulls ctx.locale into this program.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\nimport { en, zh, type MultiWallKey } from './locales.ts'\nimport { createWallStore } from './store.ts'\nimport { createWallInjected } from './wall-injected.ts'\nimport { WallView } from './WallView.tsx'\nimport { WallToggle } from './WallToggle.tsx'\n\nexport { WallView } from './WallView.tsx'\nexport type { WallViewProps } from './WallView.tsx'\nexport { WallToggle } from './WallToggle.tsx'\nexport type { WallToggleProps } from './WallToggle.tsx'\nexport type { MultiWallKey } from './locales.ts'\nexport { createWallStore } from './store.ts'\nexport type { WallState, WallActions } from './store.ts'\nexport type { ProbeRow, StopRow, WallInjected } from './wall-injected.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Multi-window wall copy. */\n multiWall: MultiWallKey\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'multiWall'\n\n/** Required services: slots for both registrations, locale for copy. */\nexport const inject = ['slots', 'locale']\n\n/**\n * Whether this page is an embedded wall pane. Panes load\n * `?multi-wall=embed`; such pages register no wall UI at all, which stops a\n * wall inside a wall (the pane would otherwise recursively embed the\n * serving instance).\n * @returns true when the query flag is present.\n */\nfunction isEmbeddedPane(): boolean {\n return new URLSearchParams(window.location.search).has('multi-wall')\n}\n\n/**\n * Client plugin body: register the dictionaries, the view-ring entry (the\n * wall), and the sidebar footer shortcut. Embedded panes register nothing.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n if (isEmbeddedPane()) return\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'ui-multi-wall: dictionaries')\n\n // Registration-time text (the view tab label) reads through the bound\n // translate as a thunk, so it follows the active locale without\n // re-registration.\n const t = ctx.locale.bind(NS)\n\n // One wall store handle rides both registrations (ports, columns).\n const wallStore = createWallStore()\n\n // The wall itself: a 'conversation.view' ring entry. The header projects\n // the tab from the registration options; selecting it swaps the right\n // panel from the chat to the wall (official view-ring behavior).\n ctx.slots.inject('conversation.view', () => ctx.slots.register({\n name: 'conversation.view',\n id: 'multi-wall',\n order: 20,\n label: () => t('view.multiWall'),\n locale: NS,\n store: wallStore,\n inject: () => createWallInjected(),\n }, WallView))\n\n // The sidebar footer shortcut: jumps to the wall view. It owns no state —\n // the view ring decides what renders — so it is a plain action row.\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register({\n name: 'sidebar.footer.action',\n id: 'multi-wall',\n order: 10,\n locale: NS,\n }, WallToggle))\n}\n"],"x_google_ignoreList":[3],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,KAAK;CAChB,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,aAAa;CACb,WAAW;CACX,UAAU;CACV,kBAAkB;CAClB,eAAe;CACf,iBAAiB;CACjB,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,aAAa;CACb,eAAe;CACf,aAAa;CACb,kBAAkB;CAClB,oBAAoB;CACpB,cAAc;CACd,WAAW;CACX,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,aAAa;CACb,aAAa;CACb,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,cAAc;CACd,mBAAmB;CACnB,gBAAgB;CAChB,eAAe;CACf,oBAAoB;AACrB;;AAMD,MAAa,KAAK;CAChB,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,aAAa;CACb,WAAW;CACX,UAAU;CACV,kBAAkB;CAClB,eAAe;CACf,iBAAiB;CACjB,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,aAAa;CACb,eAAe;CACf,aAAa;CACb,kBAAkB;CAClB,oBAAoB;CACpB,cAAc;CACd,WAAW;CACX,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,aAAa;CACb,aAAa;CACb,eAAe;CACf,QAAQ;CACR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AI;EAAE;EAAI;CAAI,EAAC,EAAE,8BAA8B;CAKpF,MAAM,IAAI,IAAI,OAAO,KAAK,GAAG;CAG7B,MAAM,YAAY,iBAAiB;AAKnC,KAAI,MAAM,OAAO,qBAAqB,MAAM,IAAI,MAAM,SAAS;EAC7D,MAAM;EACN,IAAI;EACJ,OAAO;EACP,OAAO,MAAM,EAAE,iBAAiB;EAChC,QAAQ;EACR,OAAO;EACP,QAAQ,MAAM,oBAAoB;CACnC,GAAE,SAAS,CAAC;AAIb,KAAI,MAAM,OAAO,yBAAyB,MAAM,IAAI,MAAM,SAAS;EACjE,MAAM;EACN,IAAI;EACJ,OAAO;EACP,QAAQ;CACT,GAAE,WAAW,CAAC;AAChB"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["ports: number[]","port: number","columns: string","ports: number[]","port: number","data: Partial<CreateRow>","port: number","props: {\r\n port: number\r\n alive: boolean\r\n zoomed: boolean\r\n stopping: boolean\r\n onZoom: () => void\r\n onStop: () => void\r\n onRemove: () => void\r\n t: TranslateNS<'multiWall'>\r\n}","css","StateDot","IconFullscreenOutlineRegular","IconRefreshOutlineRegular","IconRightUpOutlineRegular","IconStopFillRegular","IconCloseOutlineRegular","next: Record<number, boolean>","Input","Button","IconPlusOutlineRegular","Menu","IconGlobeOutlineRegular","css","IconFullscreenOutlineRegular","ctx: ClientContext"],"sources":["../src/client/locales.ts","../src/client/store.ts","../src/client/wall-injected.ts","../node_modules/clsx/dist/clsx.mjs","../src/client/WallView.tsx","../src/client/WallToggle.tsx","../src/client/index.ts"],"sourcesContent":["/** `multiWall` namespace dictionaries. */\n\n/** Simplified Chinese dictionary (the key-set source of truth). */\nexport const zh = {\n 'toggle': '多窗口',\n 'toggle.aria': '打开或关闭多窗口',\n 'view.multiWall': '多窗口',\n 'overlay.title': '多窗口',\n 'overlay.close': '关闭',\n 'scan': '发现实例',\n 'scan.from': '起始端口',\n 'scan.to': '结束端口',\n 'create': '新建窗口',\n 'create.pending': '启动中…',\n 'create.done': '已创建窗口 :{port}',\n 'create.failed': '创建失败:{error}',\n 'create.unknown': '未知原因',\n 'exit': '退出',\n 'exit.aria': '退出多窗口,返回对话',\n 'link': '手机访问',\n 'link.aria': '获取手机访问链接',\n 'link.fetching': '正在获取链接…',\n 'link.none': '未检测到局域网地址',\n 'link.copy': '复制链接',\n 'link.copied': '已复制',\n 'link.hint': '提示:{hint}',\n 'link.reachable': '手机在同一网络时可用:{urls}',\n 'link.unreachable': '当前实例仅绑定本机,手机无法访问。{hint}',\n 'link.token': '口令:{token}',\n 'columns': '列数',\n 'columns.auto': '自动',\n 'refresh': '全部刷新',\n 'openTab': '新标签页打开',\n 'reload': '重新加载',\n 'remove': '从视图移除',\n 'stop': '关闭实例',\n 'stop.confirm': '确定关闭?',\n 'stop.self': '即将关闭当前实例(本页面将断开)',\n 'stop.done': '已关闭 :{port}',\n 'stop.failed': '关闭 :{port} 失败:{error}',\n 'zoom': '放大',\n 'loading': '加载中',\n 'empty': '没有检测到 DSH 实例',\n 'empty.hint': '先启动若干 dsh web --port <n> 实例,再点击「发现实例」或手动添加端口。',\n 'status.scanning': '扫描 {from}–{to} …',\n 'status.found': '发现 {count} 个实例:{ports}',\n 'status.none': '区间 {from}–{to} 未发现 DSH 实例',\n 'status.refreshed': '已刷新全部窗口',\n} satisfies Record<string, string>\n\n/** The multi-wall namespace key union. */\nexport type MultiWallKey = keyof typeof zh\n\n/** English dictionary, checked complete against the zh key set. */\nexport const en = {\n 'toggle': 'Multi-Window',\n 'toggle.aria': 'Toggle multi-window',\n 'view.multiWall': 'Multi-Window',\n 'overlay.title': 'Multi-Window',\n 'overlay.close': 'Close',\n 'scan': 'Discover',\n 'scan.from': 'Start port',\n 'scan.to': 'End port',\n 'create': 'New window',\n 'create.pending': 'Starting…',\n 'create.done': 'Created window :{port}',\n 'create.failed': 'Create failed: {error}',\n 'create.unknown': 'unknown reason',\n 'exit': 'Exit',\n 'exit.aria': 'Exit multi-window and return to chat',\n 'link': 'Phone access',\n 'link.aria': 'Get phone access link',\n 'link.fetching': 'Fetching link…',\n 'link.none': 'No LAN address detected',\n 'link.copy': 'Copy link',\n 'link.copied': 'Copied',\n 'link.hint': 'Hint: {hint}',\n 'link.reachable': 'Reachable on the same network: {urls}',\n 'link.unreachable': 'This instance binds loopback only; phones cannot reach it. {hint}',\n 'link.token': 'Token: {token}',\n 'columns': 'Columns',\n 'columns.auto': 'Auto',\n 'refresh': 'Refresh all',\n 'openTab': 'Open in new tab',\n 'reload': 'Reload',\n 'remove': 'Remove from view',\n 'stop': 'Stop instance',\n 'stop.confirm': 'Confirm stop?',\n 'stop.self': 'Stopping the current instance (this page will disconnect)',\n 'stop.done': 'Stopped :{port}',\n 'stop.failed': 'Failed to stop :{port}: {error}',\n 'zoom': 'Zoom',\n 'loading': 'Loading',\n 'empty': 'No DSH instances found',\n 'empty.hint': 'Start a few `dsh web --port <n>` instances first, then click \"Discover\" or add a port manually.',\n 'status.scanning': 'Scanning {from}–{to} …',\n 'status.found': 'Found {count} instance(s): {ports}',\n 'status.none': 'No DSH instances in {from}–{to}',\n 'status.refreshed': 'Refreshed all windows',\n} satisfies Record<MultiWallKey, string>\n","/**\r\n * Wall store: which instances are shown and the grid columns. The ports list\r\n * is the wall's whole business state — discovery writes it, removal filters\r\n * it, and the grid renders from it. Open/closed is NOT stored here: the wall\r\n * is a `conversation.view` ring entry, so the active view (chat store's\r\n * `view` field) decides whether it renders.\r\n */\r\nimport { defineStore, type EngineStoreHandle } from '@deepseek-ai/dsh-client-store'\r\n\r\n/** Wall viewing state: displayed ports and grid columns. */\r\nexport type WallState = {\r\n ports: number[]\r\n columns: string\r\n}\r\n\r\n/** The wall store's complete write set. */\r\nexport type WallActions = {\r\n setPorts: (draft: WallState, ports: number[]) => void\r\n addPort: (draft: WallState, port: number) => void\r\n removePort: (draft: WallState, port: number) => void\r\n setColumns: (draft: WallState, columns: string) => void\r\n}\r\n\r\n/**\r\n * Create the wall store handle. Persisted under `dsh.multi-wall` so the port\r\n * set and column choice survive view switches and reloads.\r\n * @returns the store handle (spec + type + identity + factory in one).\r\n */\r\nexport function createWallStore(): EngineStoreHandle<WallState, WallActions> {\r\n return defineStore({\r\n init: (): WallState => ({ ports: [], columns: 'auto' }),\r\n persist: 'dsh.multi-wall',\r\n actions: {\r\n setPorts: (d, ports: number[]) => { d.ports = ports },\r\n addPort: (d, port: number) => { if (!d.ports.includes(port)) d.ports = [...d.ports, port] },\r\n removePort: (d, port: number) => { d.ports = d.ports.filter(p => p !== port) },\r\n setColumns: (d, columns: string) => { d.columns = columns },\r\n },\r\n })\r\n}\r\n","/**\n * Injected probe face for the wall view: same-origin fetches to the node\n * half's /multi/api routes. Callbacks only — components never see ctx.\n */\n\n/** One liveness row from /multi/api/status. */\nexport interface ProbeRow {\n port: number\n alive: boolean\n status: number\n}\n\n/** One stop result row from /multi/api/stop. */\nexport interface StopRow {\n port: number\n ok: boolean\n error?: string\n}\n\n/** One create result row from /multi/api/create. */\nexport interface CreateRow {\n ok: boolean\n port?: number\n error?: string\n}\n\n/** The phone-reachable link info from /multi/api/link. */\nexport interface LinkRow {\n port: number\n host: string\n /** LAN URLs (`http://<lan-ip>:<gateway-port>/`), possibly empty. */\n lan: string[]\n /** Whether the instance is reachable off-loopback (gateway running). */\n reachable: boolean\n /** The inline gateway's listen port (when started). */\n gatewayPort?: number\n /** The login token (generated or configured). */\n token?: string\n /** Human hint when not reachable. */\n hint?: string\n}\n\n/** The inject face delivered to the wall view registration. */\nexport interface WallInjected {\n /** Discover live DSH instances (same-origin /multi/api/ports). */\n discover: () => Promise<number[]>\n /** Probe liveness of specific ports (same-origin /multi/api/status). */\n probe: (ports: number[]) => Promise<ProbeRow[]>\n /** Terminate the DSH instance on one port (same-origin /multi/api/stop). */\n stop: (port: number) => Promise<StopRow>\n /** Start a new DSH instance and return its port (same-origin /multi/api/create). */\n create: () => Promise<CreateRow>\n /** The phone-reachable link for this instance (same-origin /multi/api/link). */\n link: () => Promise<LinkRow>\n}\n\n/**\n * Build the probe face bound to this origin's /multi/api routes.\n * @param mount - the API base path ('' at the root, '/multi' when mounted).\n * @returns the injected callbacks.\n */\nexport function createWallInjected(mount = ''): WallInjected {\n const base = mount.replace(/\\/+$/, '')\n return {\n discover: async () => {\n const res = await fetch(`${base}/multi/api/ports`)\n if (!res.ok) return []\n const data = (await res.json()) as { ports?: { port: number; alive: boolean }[] }\n return (data.ports ?? []).filter(p => p.alive).map(p => p.port)\n },\n probe: async (ports: number[]) => {\n const res = await fetch(`${base}/multi/api/status?ports=${ports.join(',')}`)\n if (!res.ok) return []\n const data = (await res.json()) as { ports?: ProbeRow[] }\n return data.ports ?? []\n },\n stop: async (port: number) => {\n const res = await fetch(`${base}/multi/api/stop?port=${port}`, { method: 'POST' })\n if (!res.ok) return { port, ok: false, error: `HTTP ${res.status}` }\n const data = (await res.json()) as { ports?: StopRow[] }\n return data.ports?.[0] ?? { port, ok: false, error: 'no result' }\n },\n create: async () => {\n // Harden the failure surface: a non-2xx answer, an HTML fallback page\n // (route missing) or a truncated body must never degrade into the bare\n // \"unknown\" the UI shows for a missing error field.\n const res = await fetch(`${base}/multi/api/create`, { method: 'POST' })\n if (!res.ok) {\n return { ok: false, error: `HTTP ${res.status}` }\n }\n const text = await res.text()\n let data: Partial<CreateRow>\n try {\n data = JSON.parse(text) as Partial<CreateRow>\n } catch {\n const snippet = text.trim().slice(0, 120)\n return { ok: false, error: `invalid response: ${snippet === '' ? '<empty body>' : snippet}` }\n }\n if (data.ok === true) {\n return data.port !== undefined\n ? { ok: true, port: data.port }\n : { ok: false, error: 'no port in response' }\n }\n return {\n ok: false,\n ...(typeof data.error === 'string' ? { error: data.error } : { error: 'server returned no reason' }),\n }\n },\n link: async () => {\n const res = await fetch(`${base}/multi/api/link`)\n const data = (await res.json().catch(() => ({}))) as Partial<LinkRow>\n return {\n port: data.port ?? 0,\n host: data.host ?? 'unknown',\n lan: data.lan ?? [],\n reachable: data.reachable === true,\n ...(typeof data.gatewayPort === 'number' ? { gatewayPort: data.gatewayPort } : {}),\n ...(typeof data.token === 'string' ? { token: data.token } : {}),\n ...(typeof data.hint === 'string' ? { hint: data.hint } : {}),\n }\n },\n }\n}\n","function r(e){var t,f,n=\"\";if(\"string\"==typeof e||\"number\"==typeof e)n+=e;else if(\"object\"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(f=r(e[t]))&&(n&&(n+=\" \"),n+=f)}else for(f in e)e[f]&&(n&&(n+=\" \"),n+=f);return n}export function clsx(){for(var e,t,f=0,n=\"\",o=arguments.length;f<o;f++)(e=arguments[f])&&(t=r(e))&&(n&&(n+=\" \"),n+=t);return n}export default clsx;","/**\r\n * WallView: the multi-window wall as a `conversation.view` ring entry. When\r\n * the header's \"多窗口\" tab is selected, the right panel swaps from the\r\n * chat to this view — a toolbar plus a grid of iframes, one pane per running\r\n * DSH instance (127.0.0.1:<port>). Pure additive UI; no existing slot is\r\n * replaced.\r\n *\r\n * Recursion guard: panes embed `?multi-wall=embed` (the embedded page\r\n * registers no wall UI). The serving instance is itself a pane, so the user\r\n * can watch — or stop — the very instance they are in.\r\n *\r\n * Live data channels: the store owns ports/columns; discovery writes\r\n * `setPorts` from /multi/api/ports (same-origin, served by the node half);\r\n * per-pane liveness arrives from /multi/api/status polls. Components never\r\n * see ctx — the fetch helpers are injected through the registration.\r\n */\r\nimport { useEffect, useRef, useState } from 'react'\r\nimport clsx from 'clsx'\r\nimport {\r\n IconCloseOutlineRegular, IconFullscreenOutlineRegular, IconGlobeOutlineRegular, IconPlusOutlineRegular,\r\n IconRefreshOutlineRegular, IconRightUpOutlineRegular, IconStopFillRegular,\r\n Button, Input, Menu, StateDot,\r\n} from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { PropsLocale, PropsStore, TranslateNS } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { HandleOf } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport type { ConvViewProps } from '@deepseek-ai/dsh-client-ui-conversation/client'\r\nimport type { createWallStore } from './store.ts'\r\nimport type { WallInjected } from './wall-injected.ts'\r\nimport css from './WallView.module.css'\r\n\r\n/** Composed props: the view-ring runtime share, the store, the probe face, and locale. */\r\nexport type WallViewProps =\r\n & ConvViewProps\r\n & PropsStore<HandleOf<typeof createWallStore>>\r\n & WallInjected\r\n & PropsLocale<'multiWall'>\r\n\r\n/** Grid column presets, driven by the toolbar menu. 'auto' fills the row. */\r\nconst COLUMN_PRESETS = ['auto', '1', '2', '3', '4', '6'] as const\r\n\r\n/** Embed flag appended to every pane URL; such pages register no wall UI. */\r\nconst EMBED_FLAG = 'multi-wall=embed'\r\n\r\n/**\r\n * Whether this wall is being viewed through the phone gateway (a non-loopback\r\n * host) rather than on the machine running DSH. When remote, pane iframes must\r\n * load through the gateway's `/gw/<port>` route — a phone's `127.0.0.1` points\r\n * at the phone itself, not the host.\r\n */\r\nfunction isRemoteViewer(): boolean {\r\n const host = typeof window !== 'undefined' ? window.location.hostname : ''\r\n return host !== 'localhost' && host !== '127.0.0.1' && host !== '::1'\r\n}\r\n\r\n/**\r\n * The iframe URL for a pane. Local viewers embed the loopback instance\r\n * directly; remote (phone) viewers route through the gateway that is already\r\n * serving this page, appending the port so the gateway proxies to it.\r\n * @param port - target DSH instance port.\r\n * @returns the pane URL.\r\n */\r\nfunction paneUrl(port: number): string {\r\n if (isRemoteViewer()) {\r\n return `${window.location.origin}/gw/${port}/?${EMBED_FLAG}`\r\n }\r\n return `http://127.0.0.1:${port}/?${EMBED_FLAG}`\r\n}\r\n\r\n/**\r\n * One pane: header (port, liveness dot, zoom/refresh/open/stop/remove) plus\r\n * the embedded original DSH UI.\r\n */\r\nfunction WallPane(props: {\r\n port: number\r\n alive: boolean\r\n zoomed: boolean\r\n stopping: boolean\r\n onZoom: () => void\r\n onStop: () => void\r\n onRemove: () => void\r\n t: TranslateNS<'multiWall'>\r\n}) {\r\n const { port, alive, zoomed, stopping, onZoom, onStop, onRemove, t } = props\r\n return (\r\n <section className={clsx(css.pane, zoomed && css.zoomed)} data-port={port}>\r\n <div className={css.paneHead}>\r\n <StateDot state={alive ? 'done' : 'warning'} size={8} className={css.dot} />\r\n <span className={css.paneTitle}>127.0.0.1:{port}</span>\r\n <div className={css.paneActions}>\r\n <button type=\"button\" className={css.action} title={t('zoom')} onClick={onZoom}>\r\n <IconFullscreenOutlineRegular size={14} />\r\n </button>\r\n <button type=\"button\" className={css.action} title={t('reload')} onClick={(e) => {\r\n e.currentTarget.closest('section')?.querySelector('iframe')?.contentWindow?.location.reload()\r\n }}>\r\n <IconRefreshOutlineRegular size={14} />\r\n </button>\r\n <button type=\"button\" className={css.action} title={t('openTab')} onClick={() => {\r\n window.open(paneUrl(port), '_blank')\r\n }}>\r\n <IconRightUpOutlineRegular size={14} />\r\n </button>\r\n <button\r\n type=\"button\"\r\n className={clsx(css.action, css.danger, stopping && css.confirm)}\r\n title={t('stop')}\r\n onClick={onStop}\r\n >\r\n {stopping ? t('stop.confirm') : <IconStopFillRegular size={14} />}\r\n </button>\r\n <button type=\"button\" className={css.action} title={t('remove')} onClick={onRemove}>\r\n <IconCloseOutlineRegular size={14} />\r\n </button>\r\n </div>\r\n </div>\r\n <div className={css.paneBody}>\r\n <iframe\r\n title={`DSH :${port}`}\r\n src={paneUrl(port)}\r\n loading=\"lazy\"\r\n />\r\n </div>\r\n </section>\r\n )\r\n}\r\n\r\n/**\r\n * Render the wall: toolbar plus the horizontally-filled pane grid. Discovery\r\n * runs on mount and liveness polls every 5s; the store's persisted ports\r\n * survive view switches and reloads.\r\n * @param props - composed slot props.\r\n * @returns the wall surface.\r\n */\r\nexport function WallView({ useStore, actions, discover, probe, stop, create, link, t }: WallViewProps) {\r\n const ports = useStore(s => s.ports)\r\n const columns = useStore(s => s.columns)\r\n const [alive, setAlive] = useState<Record<number, boolean>>({})\r\n const [zoomedPort, setZoomedPort] = useState<number | null>(null)\r\n const [confirmingStop, setConfirmingStop] = useState<number | null>(null)\r\n const [scanFrom, setScanFrom] = useState(3070)\r\n const [scanTo, setScanTo] = useState(3110)\r\n const [colsMenuOpen, setColsMenuOpen] = useState(false)\r\n const [creating, setCreating] = useState(false)\r\n const [linkOpen, setLinkOpen] = useState(false)\r\n const [linkInfo, setLinkInfo] = useState<Awaited<ReturnType<WallViewProps['link']>> | null>(null)\r\n const [linkCopied, setLinkCopied] = useState(false)\r\n const [status, setStatus] = useState('')\r\n const aliveRef = useRef<Record<number, boolean>>({})\r\n aliveRef.current = alive\r\n\r\n // Discover on mount (the view renders only while selected), then poll\r\n // liveness while the view stays mounted.\r\n useEffect(() => {\r\n void discover().then(found => {\r\n if (found.length > 0) actions.setPorts(found)\r\n setStatus(found.length > 0 ? t('status.found').replace('{count}', String(found.length)).replace('{ports}', found.join(', ')) : '')\r\n })\r\n const timer = setInterval(() => {\r\n if (ports.length === 0) return\r\n void probe(ports).then(rows => {\r\n const next: Record<number, boolean> = {}\r\n for (const row of rows) next[row.port] = row.alive\r\n setAlive(next)\r\n })\r\n }, 5000)\r\n return () => { clearInterval(timer) }\r\n // eslint-disable-next-line react-hooks/exhaustive-deps\r\n }, [])\r\n\r\n // Stop is destructive: the first click arms a per-pane confirm, the second\r\n // executes it. Any other interaction clears the arm. The serving instance\r\n // itself may be stopped too (the user may want to take this port down).\r\n const handleStop = async (port: number) => {\r\n if (confirmingStop !== port) {\r\n setConfirmingStop(port)\r\n return\r\n }\r\n setConfirmingStop(null)\r\n const result = await stop(port)\r\n if (result.ok) {\r\n actions.removePort(port)\r\n setAlive(current => ({ ...current, [port]: false }))\r\n setStatus(t('stop.done').replace('{port}', String(port)))\r\n } else {\r\n setStatus(t('stop.failed').replace('{port}', String(port)).replace('{error}', result.error ?? ''))\r\n }\r\n }\r\n\r\n const runDiscovery = async () => {\r\n setStatus(t('status.scanning').replace('{from}', String(scanFrom)).replace('{to}', String(scanTo)))\r\n const found = await discover()\r\n if (found.length === 0) {\r\n setStatus(t('status.none').replace('{from}', String(scanFrom)).replace('{to}', String(scanTo)))\r\n return\r\n }\r\n actions.setPorts(found)\r\n setStatus(t('status.found').replace('{count}', String(found.length)).replace('{ports}', found.join(', ')))\r\n }\r\n\r\n // Start a brand-new DSH instance and add it to the wall. Failures always\r\n // surface a concrete reason: the injected face reports HTTP status / body\r\n // problems, and a thrown fetch surfaces its message — never a silent stall.\r\n const handleCreate = async () => {\r\n setCreating(true)\r\n setStatus('')\r\n try {\r\n const result = await create()\r\n if (result.ok && result.port !== undefined) {\r\n actions.addPort(result.port)\r\n setAlive(current => ({ ...current, [result.port!]: true }))\r\n setStatus(t('create.done').replace('{port}', String(result.port)))\r\n } else {\r\n setStatus(t('create.failed').replace('{error}', result.error ?? t('create.unknown')))\r\n }\r\n } catch (error) {\r\n setStatus(t('create.failed').replace('{error}', error instanceof Error ? error.message : String(error)))\r\n } finally {\r\n setCreating(false)\r\n }\r\n }\r\n\r\n // Leave the wall: switch the view ring back to the default chat view. The\r\n // ring's active view lives in the chat store and only the header tab's\r\n // click handler mutates it, so exit reuses that sanctioned path — the chat\r\n // entry is always the first tab (order 0), which makes the click\r\n // locale-independent. No tab (blank session) is a no-op.\r\n const exitWall = () => {\r\n const tab = document.querySelector<HTMLButtonElement>('[role=\"tablist\"] [role=\"tab\"]')\r\n tab?.click()\r\n }\r\n\r\n // Fetch the phone-reachable link(s) for this instance and open the sheet.\r\n const handleLink = async () => {\r\n if (linkInfo === null) {\r\n setStatus(t('link.fetching'))\r\n const info = await link()\r\n setLinkInfo(info)\r\n }\r\n setLinkOpen(true)\r\n setLinkCopied(false)\r\n setStatus('')\r\n }\r\n\r\n // Copy the first phone-reachable link to the clipboard. When the gateway\r\n // issued a token it is appended as `?token=` so the phone bypasses the login\r\n // form entirely (the gateway accepts a matching `?token=` query); the URL is\r\n // otherwise the bare link. The standalone token line is still shown above so\r\n // users who prefer typing it can.\r\n const copyFirstLink = async () => {\r\n if (linkInfo === null || linkInfo.lan.length === 0) return\r\n try {\r\n const base = linkInfo.lan[0] ?? ''\r\n const token = linkInfo.token ?? ''\r\n const url = token !== '' ? `${base}?token=${encodeURIComponent(token)}` : base\r\n await navigator.clipboard.writeText(url)\r\n setLinkCopied(true)\r\n } catch {\r\n setLinkCopied(false)\r\n }\r\n }\r\n\r\n // Every discovered port renders, including the one serving this wall: the\r\n // user may want to watch (or stop) the instance they are in. Recursion is\r\n // prevented by the embed flag, not by hiding the self pane.\r\n const shown = ports\r\n\r\n return (\r\n <div className={css.wall} role=\"region\" aria-label={t('overlay.title')} data-wall-view=\"\">\r\n <div className={css.toolbar}>\r\n <span className={css.title}>{t('overlay.title')}</span>\r\n <span className={css.status}>{status}</span>\r\n <div className={css.controls}>\r\n <label className={css.field}>{t('scan.from')}\r\n <Input\r\n type=\"number\"\r\n value={scanFrom}\r\n onChange={e => setScanFrom(Number(e.target.value))}\r\n />\r\n </label>\r\n <label className={css.field}>{t('scan.to')}\r\n <Input\r\n type=\"number\"\r\n value={scanTo}\r\n onChange={e => setScanTo(Number(e.target.value))}\r\n />\r\n </label>\r\n <Button variant=\"toolbar\" size=\"sm\" onClick={() => { void runDiscovery() }}>{t('scan')}</Button>\r\n <Button\r\n variant=\"toolbar\"\r\n size=\"sm\"\r\n icon={<IconPlusOutlineRegular size={14} />}\r\n disabled={creating}\r\n onClick={() => { void handleCreate() }}\r\n >\r\n {creating ? t('create.pending') : t('create')}\r\n </Button>\r\n <Menu\r\n open={colsMenuOpen}\r\n anchor={\r\n <Button\r\n variant=\"toolbar\"\r\n size=\"sm\"\r\n icon={<IconRightUpOutlineRegular size={14} />}\r\n onClick={() => { setColsMenuOpen(true) }}\r\n >\r\n {columns === 'auto' ? t('columns.auto') : columns}\r\n </Button>\r\n }\r\n items={COLUMN_PRESETS.map(c => ({\r\n id: c,\r\n label: c === 'auto' ? t('columns.auto') : c,\r\n }))}\r\n selectedId={columns}\r\n onSelect={(id) => {\r\n actions.setColumns(id)\r\n setColsMenuOpen(false)\r\n }}\r\n onClose={() => { setColsMenuOpen(false) }}\r\n compact\r\n />\r\n <Button\r\n variant=\"toolbar\"\r\n size=\"sm\"\r\n icon={<IconRefreshOutlineRegular size={14} />}\r\n onClick={() => {\r\n document.querySelectorAll(`.${css.paneBody} iframe`).forEach(f => {\r\n (f as HTMLIFrameElement).contentWindow?.location.reload()\r\n })\r\n setStatus(t('status.refreshed'))\r\n }}\r\n >\r\n {t('refresh')}\r\n </Button>\r\n <Button\r\n variant=\"toolbar\"\r\n size=\"sm\"\r\n icon={<IconGlobeOutlineRegular size={14} />}\r\n aria-label={t('link.aria')}\r\n onClick={() => { void handleLink() }}\r\n >\r\n {t('link')}\r\n </Button>\r\n <Button\r\n variant=\"toolbar\"\r\n size=\"sm\"\r\n icon={<IconCloseOutlineRegular size={14} />}\r\n aria-label={t('exit.aria')}\r\n title={t('exit')}\r\n onClick={() => { exitWall() }}\r\n >\r\n {t('exit')}\r\n </Button>\r\n </div>\r\n </div>\r\n {linkOpen && linkInfo !== null && (\r\n <div className={css.linkBar}>\r\n {linkInfo.reachable\r\n ? (\r\n <>\r\n <span className={css.linkText}>\r\n {t('link.reachable').replace('{urls}', linkInfo.lan.join(' '))}\r\n {linkInfo.token !== undefined && linkInfo.token !== ''\r\n ? ` ${t('link.token').replace('{token}', linkInfo.token)}`\r\n : ''}\r\n </span>\r\n {linkInfo.lan.length > 0 && (\r\n <Button variant=\"outline\" size=\"sm\" onClick={() => { void copyFirstLink() }}>\r\n {linkCopied ? t('link.copied') : t('link.copy')}\r\n </Button>\r\n )}\r\n </>\r\n )\r\n : (\r\n <span className={css.linkText}>\r\n {t('link.unreachable').replace('{hint}', linkInfo.hint ?? '')}\r\n </span>\r\n )}\r\n <Button variant=\"ghost\" size=\"sm\" icon={<IconCloseOutlineRegular size={14} />} onClick={() => { setLinkOpen(false) }}>\r\n {t('overlay.close')}\r\n </Button>\r\n </div>\r\n )}\r\n <div className={css.grid} data-cols={columns}>\r\n {shown.map(port => (\r\n <WallPane\r\n key={port}\r\n port={port}\r\n alive={aliveRef.current[port] ?? true}\r\n zoomed={zoomedPort === port}\r\n stopping={confirmingStop === port}\r\n onZoom={() => setZoomedPort(zoomedPort === port ? null : port)}\r\n onStop={() => { void handleStop(port) }}\r\n onRemove={() => { setConfirmingStop(null); actions.removePort(port) }}\r\n t={t}\r\n />\r\n ))}\r\n {shown.length === 0 && (\r\n <div className={css.empty}>\r\n <p>{t('empty')}</p>\r\n <p className={css.hint}>{t('empty.hint')}</p>\r\n </div>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n}\r\n","/**\r\n * WallToggle: the sidebar-foot shortcut. Clicking it opens the wall view —\r\n * the `conversation.view` ring switches to the 'multi-wall' entry, which the\r\n * header renders as the \"多窗口\" tab. The click is a plain user-equivalent\r\n * activation: it finds the header's view-ring tab for this plugin's label and\r\n * clicks it, so the official view-ring state machine (the chat store's active\r\n * view field) performs the switch. No store is declared: the ring decides\r\n * what renders, so this row owns no state.\r\n *\r\n * Session-scoped by design: the view ring (and its header tabs) only renders\r\n * with an active session, so the shortcut is inert on the empty-hero screen —\r\n * the user first opens or creates a session (the official flow), after which\r\n * the tab is present and the click lands.\r\n */\r\nimport { IconFullscreenOutlineRegular } from '@deepseek-ai/dsh-client-ui-primitives'\r\nimport type { PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\r\nimport css from './WallToggle.module.css'\r\n\r\n/** Composed props: sidebar column state + locale. */\r\nexport type WallToggleProps =\r\n & PropsRuntime<'sidebar.footer.action'>\r\n & PropsLocale<'multiWall'>\r\n\r\n/**\r\n * Render the wall shortcut row (icon; label only in the wide column).\r\n * @param props - composed slot props.\r\n * @returns the shortcut row.\r\n */\r\nexport function WallToggle({ wide, t }: WallToggleProps) {\r\n return (\r\n <button\r\n type=\"button\"\r\n className={css.row}\r\n aria-label={t('toggle.aria')}\r\n title={t('toggle')}\r\n onClick={() => {\r\n // The official view ring renders the active entry through\r\n // `only: <active id>`; the only sanctioned way to move it is the\r\n // header tab's click handler (actions.setView). Trigger that same\r\n // element instead of reaching into the chat store from the root\r\n // scope. No tab (no active session) is a no-op.\r\n const label = t('view.multiWall')\r\n const tab = Array.from(document.querySelectorAll<HTMLButtonElement>('[role=\"tab\"]'))\r\n .find(el => el.textContent?.trim() === label)\r\n tab?.click()\r\n }}\r\n >\r\n <IconFullscreenOutlineRegular size={wide ? 16 : 18} />\r\n {wide && <span className={css.label}>{t('toggle')}</span>}\r\n </button>\r\n )\r\n}\r\n","/**\r\n * Multi-window wall plugin, browser half: contributes the wall as a\r\n * `conversation.view` ring entry (the official replace-the-chat-surface\r\n * mechanism — the header grows a \"多窗口墙\" tab and the right panel swaps to\r\n * the wall) plus a sidebar footer shortcut that jumps to that view. No\r\n * existing slot is replaced and no original interaction logic changes; the\r\n * wall is pure UI over the node half's /multi/api probe routes.\r\n *\r\n * Recursion guard: a wall pane embeds each instance as\r\n * `http://127.0.0.1:<port>/?multi-wall=embed`; the embedded page sees the\r\n * query flag and registers nothing, so a pane can never grow a wall of its\r\n * own. The wall also never renders the port it is served on (SELF_PORT is\r\n * filtered at render time and by the node half's discovery).\r\n */\r\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\r\n// Type-only: pulls ctx.slots (the renderer-owned SlotRegistry service) into\r\n// this program. Must stay type-only — dsh-client-ui-renderer is a boot-graph\r\n// plugin package, not a platform seed word, so a value import would not\r\n// resolve inside the plugin bundle.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\r\n// Type-only: pulls the layout-owned slot declarations (sidebar footer,\r\n// shell.overlay) into this program.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-layout/client'\r\n// Type-only: pulls the conversation package's view-ring declaration\r\n// ('conversation.view') into this program.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-conversation/client'\r\n// Type-only: pulls the sidebar footer action owner props into this program.\r\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar/client'\r\n// Type-only: pulls ctx.locale into this program.\r\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\r\nimport { en, zh, type MultiWallKey } from './locales.ts'\r\nimport { createWallStore } from './store.ts'\r\nimport { createWallInjected } from './wall-injected.ts'\r\nimport { WallView } from './WallView.tsx'\r\nimport { WallToggle } from './WallToggle.tsx'\r\n\r\nexport { WallView } from './WallView.tsx'\r\nexport type { WallViewProps } from './WallView.tsx'\r\nexport { WallToggle } from './WallToggle.tsx'\r\nexport type { WallToggleProps } from './WallToggle.tsx'\r\nexport type { MultiWallKey } from './locales.ts'\r\nexport { createWallStore } from './store.ts'\r\nexport type { WallState, WallActions } from './store.ts'\r\nexport type { ProbeRow, StopRow, WallInjected } from './wall-injected.ts'\r\n\r\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\r\n interface LocaleNamespaceMap {\r\n /** Multi-window wall copy. */\r\n multiWall: MultiWallKey\r\n }\r\n}\r\n\r\n/** Dictionary namespace owned by this plugin. */\r\nconst NS = 'multiWall'\r\n\r\n/** Required services: slots for both registrations, locale for copy. */\r\nexport const inject = ['slots', 'locale']\r\n\r\n/**\r\n * Whether this page is an embedded wall pane. Panes load\r\n * `?multi-wall=embed`; such pages register no wall UI at all, which stops a\r\n * wall inside a wall (the pane would otherwise recursively embed the\r\n * serving instance).\r\n * @returns true when the query flag is present.\r\n */\r\nfunction isEmbeddedPane(): boolean {\r\n return new URLSearchParams(window.location.search).has('multi-wall')\r\n}\r\n\r\n/**\r\n * Client plugin body: register the dictionaries, the view-ring entry (the\r\n * wall), and the sidebar footer shortcut. Embedded panes register nothing.\r\n * @param ctx - client root context.\r\n */\r\nexport function apply(ctx: ClientContext): void {\r\n if (isEmbeddedPane()) return\r\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'ui-multi-wall: dictionaries')\r\n\r\n // Registration-time text (the view tab label) reads through the bound\r\n // translate as a thunk, so it follows the active locale without\r\n // re-registration.\r\n const t = ctx.locale.bind(NS)\r\n\r\n // One wall store handle rides both registrations (ports, columns).\r\n const wallStore = createWallStore()\r\n\r\n // The wall itself: a 'conversation.view' ring entry. The header projects\r\n // the tab from the registration options; selecting it swaps the right\r\n // panel from the chat to the wall (official view-ring behavior).\r\n ctx.slots.inject('conversation.view', () => ctx.slots.register({\r\n name: 'conversation.view',\r\n id: 'multi-wall',\r\n order: 20,\r\n label: () => t('view.multiWall'),\r\n locale: NS,\r\n store: wallStore,\r\n inject: () => createWallInjected(),\r\n }, WallView))\r\n\r\n // The sidebar footer shortcut: jumps to the wall view. It owns no state —\r\n // the view ring decides what renders — so it is a plain action row.\r\n ctx.slots.inject('sidebar.footer.action', () => ctx.slots.register({\r\n name: 'sidebar.footer.action',\r\n id: 'multi-wall',\r\n order: 10,\r\n locale: NS,\r\n }, WallToggle))\r\n}\r\n"],"x_google_ignoreList":[3],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,MAAa,KAAK;CAChB,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,aAAa;CACb,WAAW;CACX,UAAU;CACV,kBAAkB;CAClB,eAAe;CACf,iBAAiB;CACjB,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,aAAa;CACb,iBAAiB;CACjB,aAAa;CACb,aAAa;CACb,eAAe;CACf,aAAa;CACb,kBAAkB;CAClB,oBAAoB;CACpB,cAAc;CACd,WAAW;CACX,gBAAgB;CAChB,WAAW;CACX,WAAW;CACX,UAAU;CACV,UAAU;CACV,QAAQ;CACR,gBAAgB;CAChB,aAAa;CACb,aAAa;CACb,eAAe;CACf,QAAQ;CACR,WAAW;CACX,SAAS;CACT,cAAc;CACd,mBAAmB;CACnB,gBAAgB;CAChB,eAAe;CACf,oBAAoB;AACrB;;AAMD,MAAa,KAAK;CAChB,UAAU;CACV,eAAe;CACf,kBAAkB;CAClB,iBAAiB;CACjB,iBAAiB;CACjB,QAAQ;CACR,aAAa;CACb,WAAW;CACX,UAAU;CACV,kBAAkB;CAClB,eAAe;CACf,iBAAiB;CACjB,kBAAkB;CAClB,QAAQ;CACR,aAAa;CACb,QAAQ;CACR,aAAa;CACb,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