@linxin666/dsh-remote-web-ui 0.1.18 → 0.1.20

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 (100) hide show
  1. package/lib/client.js +54 -11
  2. package/lib/client.js.map +1 -1
  3. package/lib/index.js +137 -96
  4. package/lib/mobile.js +18 -5
  5. package/lib/mobile.js.map +1 -1
  6. package/lib/types/client/FooterRemoteEntry.js +1 -1
  7. package/lib/types/client/PluginSettingsCard.d.ts +1 -1
  8. package/lib/types/client/PluginSettingsCard.d.ts.map +1 -1
  9. package/lib/types/client/RemoteEntry.d.ts.map +1 -1
  10. package/lib/types/client/RemoteEntry.js +41 -11
  11. package/lib/types/client/RemotePanel.d.ts +1 -0
  12. package/lib/types/client/RemotePanel.d.ts.map +1 -1
  13. package/lib/types/client/RemotePanel.js +2 -2
  14. package/lib/types/client/RemoteSettingsCard.d.ts +5 -0
  15. package/lib/types/client/RemoteSettingsCard.d.ts.map +1 -1
  16. package/lib/types/client/RemoteSettingsCard.js +9 -2
  17. package/lib/types/client/UpdateEntry.js +1 -1
  18. package/lib/types/client/UpdatePanel.js +1 -1
  19. package/lib/types/client/deep-link.js +1 -1
  20. package/lib/types/client/index.d.ts.map +1 -1
  21. package/lib/types/client/index.js +20 -14
  22. package/lib/types/client/settings-form.d.ts +8 -0
  23. package/lib/types/client/settings-form.d.ts.map +1 -1
  24. package/lib/types/client/settings-form.js +15 -1
  25. package/lib/types/client/update-api.d.ts.map +1 -1
  26. package/lib/types/gate.d.ts +4 -9
  27. package/lib/types/gate.d.ts.map +1 -1
  28. package/lib/types/gate.js +5 -32
  29. package/lib/types/http.d.ts +14 -0
  30. package/lib/types/http.d.ts.map +1 -0
  31. package/lib/types/http.js +27 -0
  32. package/lib/types/index.d.ts +3 -1
  33. package/lib/types/index.d.ts.map +1 -1
  34. package/lib/types/index.js +12 -10
  35. package/lib/types/invariant.d.ts.map +1 -1
  36. package/lib/types/loopback.d.ts +25 -0
  37. package/lib/types/loopback.d.ts.map +1 -0
  38. package/lib/types/loopback.js +68 -0
  39. package/lib/types/mobile/api.js +1 -1
  40. package/lib/types/mobile/index.js +3 -3
  41. package/lib/types/mobile/markdown.d.ts +6 -4
  42. package/lib/types/mobile/markdown.d.ts.map +1 -1
  43. package/lib/types/mobile/markdown.js +8 -4
  44. package/lib/types/mobile/markdown.test.js +5 -1
  45. package/lib/types/mobile/messages.d.ts.map +1 -1
  46. package/lib/types/mobile/messages.js +14 -1
  47. package/lib/types/mobile/messages.test.js +1 -1
  48. package/lib/types/mobile/mobile-theme.test.js +2 -2
  49. package/lib/types/mobile/mux.d.ts.map +1 -1
  50. package/lib/types/mobile/mux.js +1 -1
  51. package/lib/types/mobile/mux.test.js +1 -1
  52. package/lib/types/mobile/rpc.d.ts.map +1 -1
  53. package/lib/types/mobile/theme-toggle.js +1 -1
  54. package/lib/types/mobile/views/App.d.ts +0 -11
  55. package/lib/types/mobile/views/App.d.ts.map +1 -1
  56. package/lib/types/mobile/views/App.js +6 -6
  57. package/lib/types/mobile/views/ChatView.js +6 -6
  58. package/lib/types/mobile/views/ChatView.test.js +3 -3
  59. package/lib/types/mobile/views/SessionListView.js +3 -3
  60. package/lib/types/mobile/views/SessionListView.test.js +2 -2
  61. package/lib/types/mobile/views/WorkspaceView.js +3 -3
  62. package/lib/types/mobile/views/WorkspaceView.test.js +3 -3
  63. package/lib/types/mobile-api.d.ts +1 -1
  64. package/lib/types/mobile-api.d.ts.map +1 -1
  65. package/lib/types/mobile-api.js +11 -18
  66. package/lib/types/mobile-routes.d.ts.map +1 -1
  67. package/lib/types/mobile-routes.js +17 -11
  68. package/lib/types/mount-once.d.ts +25 -0
  69. package/lib/types/mount-once.d.ts.map +1 -0
  70. package/lib/types/mount-once.js +42 -0
  71. package/lib/types/pairing.d.ts.map +1 -1
  72. package/lib/types/routes.d.ts +6 -6
  73. package/lib/types/routes.d.ts.map +1 -1
  74. package/lib/types/routes.js +14 -19
  75. package/lib/types/tunnel.d.ts.map +1 -1
  76. package/lib/types/update-routes.d.ts +2 -2
  77. package/lib/types/update-routes.d.ts.map +1 -1
  78. package/lib/types/update-routes.js +1 -6
  79. package/lib/types/update.d.ts.map +1 -1
  80. package/lib/types/update.js +6 -3
  81. package/package.json +1 -1
  82. package/src/client/RemoteEntry.tsx +38 -6
  83. package/src/client/RemotePanel.tsx +1 -1
  84. package/src/client/RemoteSettingsCard.tsx +8 -0
  85. package/src/client/index.ts +13 -7
  86. package/src/client/settings-form.ts +15 -1
  87. package/src/gate.ts +5 -30
  88. package/src/http.ts +30 -0
  89. package/src/index.ts +4 -1
  90. package/src/loopback.ts +63 -0
  91. package/src/mobile/markdown.test.ts +5 -0
  92. package/src/mobile/markdown.ts +7 -4
  93. package/src/mobile/messages.ts +14 -1
  94. package/src/mobile/views/App.tsx +0 -12
  95. package/src/mobile-api.ts +9 -17
  96. package/src/mobile-routes.ts +16 -10
  97. package/src/mount-once.ts +48 -0
  98. package/src/routes.ts +11 -17
  99. package/src/update-routes.ts +1 -7
  100. package/src/update.ts +6 -3
@@ -1,5 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { RemoteEntry } from "./RemoteEntry.js";
2
+ import { RemoteEntry } from './RemoteEntry.js';
3
3
  /**
4
4
  * Render the remote-control trigger + pairing panel from the footer seat.
5
5
  * @param props - composed slot props (footer seat subset).
@@ -9,7 +9,7 @@
9
9
  import { type ReactNode } from 'react';
10
10
  import type { CardShell } from './settings-form.ts';
11
11
  /** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */
12
- export declare const CARD_COPY_KEYS: readonly ["settings.collapse", "settings.expand", "settings.notExposed", "settings.unsaved", "settings.readOnly", "settings.saveFailed", "settings.discard", "settings.save", "settings.saving"];
12
+ export declare const CARD_COPY_KEYS: readonly ['settings.collapse', 'settings.expand', 'settings.notExposed', 'settings.unsaved', 'settings.readOnly', 'settings.saveFailed', 'settings.discard', 'settings.save', 'settings.saving'];
13
13
  /** Copy key the card chrome itself reads. */
14
14
  export type CardCopyKey = (typeof CARD_COPY_KEYS)[number];
15
15
  /** Key domain for the plugin's own copy (inferred per consumer). */
@@ -1 +1 @@
1
- {"version":3,"file":"PluginSettingsCard.d.ts","sourceRoot":"","sources":["../../../src/client/PluginSettingsCard.tsx"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,EAAY,KAAK,SAAS,EAAE,MAAM,OAAO,CAAA;AAChD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAGnD,oGAAoG;AACpG,eAAO,MAAM,cAAc,kMAUjB,CAAA;AAEV,6CAA6C;AAC7C,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAA;AAEzD,oEAAoE;AACpE,MAAM,MAAM,eAAe,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM,IAAI,IAAI,GAAG,WAAW,CAAA;AAE9E,wDAAwD;AACxD,MAAM,WAAW,uBAAuB,CAAC,IAAI,SAAS,MAAM,GAAG,MAAM;IACnE,0CAA0C;IAC1C,CAAC,EAAE,CAAC,GAAG,EAAE,eAAe,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC,KAAK,MAAM,CAAA;IACnF,uCAAuC;IACvC,QAAQ,EAAE,IAAI,CAAA;IACd,4EAA4E;IAC5E,cAAc,EAAE,IAAI,CAAA;IACpB,kFAAkF;IAClF,KAAK,EAAE,SAAS,CAAA;IAChB,+BAA+B;IAC/B,MAAM,EAAE,MAAM,IAAI,CAAA;IAClB,8BAA8B;IAC9B,SAAS,EAAE,MAAM,IAAI,CAAA;IACrB;;;OAGG;IACH,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB;;;;OAIG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,6BAA6B;IAC7B,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;G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+B;IAC/B,QAAQ,EAAE,MAAM,CAAA;CACjB,+BAmCA;AAED,sDAAsD;AACtD,wBAAgB,WAAW,CAAC,KAAK,EAAE,UAAU,GAAG;IAC9C,oEAAoE;IACpE,YAAY,EAAE,MAAM,CAAA;IACpB,mEAAmE;IACnE,OAAO,EAAE,aAAa,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CACzD,+BAsCA"}
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteEntry.d.ts","sourceRoot":"","sources":["../../../src/client/RemoteEntry.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAQjF,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAA;AAcrF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,gBAAgB,+BAuJvE"}
1
+ {"version":3,"file":"RemoteEntry.d.ts","sourceRoot":"","sources":["../../../src/client/RemoteEntry.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAA;AAQjF,wEAAwE;AACxE,MAAM,MAAM,gBAAgB,GAAG,YAAY,CAAC,gBAAgB,CAAC,GAAG,WAAW,CAAC,QAAQ,CAAC,CAAA;AAwBrF;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,CAAC,EAAE,EAAE,gBAAgB,+BA6KvE"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * The sidebar remote-control seat: the update trigger plus the phone-icon
4
4
  * trigger beside the settings button, and the pairing panel modal. Owns the
@@ -10,13 +10,23 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
10
10
  */
11
11
  import { useCallback, useEffect, useRef, useState } from 'react';
12
12
  import { createPortal } from 'react-dom';
13
- import { RemotePanel } from "./RemotePanel.js";
14
- import { copyText, issuePair, stopPair } from "./pair-api.js";
15
- import { PhoneIcon } from "./PhoneIcon.js";
16
- import { UpdateEntry } from "./UpdateEntry.js";
13
+ import { RemotePanel } from './RemotePanel.js';
14
+ import { copyText, issuePair, stopPair } from './pair-api.js';
15
+ import { PhoneIcon } from './PhoneIcon.js';
16
+ import { UpdateEntry } from './UpdateEntry.js';
17
17
  import css from './remote.module.css';
18
- /** Apply one status frame onto the current ready state. */
18
+ /**
19
+ * Apply one status frame onto the current state: the ready state mirrors
20
+ * the full phase/device picture, while the lan-required banner only keeps
21
+ * the auto-tunnel frame (the signal for the running re-issue).
22
+ */
19
23
  function mergeFrame(state, frame) {
24
+ if (state.kind === 'lan-required') {
25
+ return {
26
+ ...state,
27
+ ...(frame.tunnel !== undefined ? { tunnel: frame.tunnel } : {}),
28
+ };
29
+ }
20
30
  if (state.kind !== 'ready')
21
31
  return state;
22
32
  return {
@@ -35,6 +45,11 @@ function mergeFrame(state, frame) {
35
45
  export function RemoteEntry({ wide, useWorkspaces, t }) {
36
46
  const [open, setOpen] = useState(false);
37
47
  const [state, setState] = useState({ kind: 'lan-required' });
48
+ // Latest-state mirror for the EventSource callback: transition detection
49
+ // must live outside setState updaters (updaters may run twice and must be
50
+ // pure), so mint decisions read this ref instead.
51
+ const stateRef = useRef(state);
52
+ useEffect(() => { stateRef.current = state; }, [state]);
38
53
  const [copied, setCopied] = useState(false);
39
54
  const eventSource = useRef(undefined);
40
55
  // The current workspace (the recent-workspace projection the shell's New
@@ -87,10 +102,12 @@ export function RemoteEntry({ wide, useWorkspaces, t }) {
87
102
  const next = await mint();
88
103
  setState(next);
89
104
  // Live status: the desktop panel mirrors the pairing service state. The
90
- // stream only makes sense in the ready state — on a failure banner the
91
- // events endpoint is unreachable too (loopback fence), so opening it
92
- // would just start a doomed reconnect loop.
93
- if (next.kind !== 'ready')
105
+ // stream makes sense in the ready state and on the lan-required banner —
106
+ // there the auto-tunnel may still be starting, and following its frames
107
+ // lets the panel re-issue once it runs. The loopback-required and
108
+ // unreachable origins are fenced out of the events endpoint, so opening
109
+ // it there would just start a doomed reconnect loop.
110
+ if (next.kind !== 'ready' && next.kind !== 'lan-required')
94
111
  return;
95
112
  const source = new EventSource('/api/pair/events');
96
113
  eventSource.current = source;
@@ -99,7 +116,20 @@ export function RemoteEntry({ wide, useWorkspaces, t }) {
99
116
  const frame = JSON.parse(event.data);
100
117
  if (frame.type !== 'state')
101
118
  return;
102
- setState(previous => mergeFrame(previous, frame));
119
+ // The auto-tunnel crossed into running while the panel sat on the
120
+ // lan-required banner: re-issue so the server hands back a ready QR
121
+ // built on the public base (only on the transition into running, to
122
+ // avoid mint storms). Detected on the ref, outside the updater: an
123
+ // updater may be invoked twice and must stay pure, so mint() cannot
124
+ // run inside it.
125
+ const previous = stateRef.current;
126
+ if (previous.kind === 'lan-required'
127
+ && frame.tunnel?.state === 'running'
128
+ && previous.tunnel?.state !== 'running') {
129
+ void mint().then(setState);
130
+ return;
131
+ }
132
+ setState(current => mergeFrame(current, frame));
103
133
  }
104
134
  catch {
105
135
  // Malformed frames are dropped; the snapshot on open is authoritative.
@@ -4,6 +4,7 @@ import { type TunnelStatusFrame } from './pair-api.ts';
4
4
  /** The panel's view state, owned by the entry component. */
5
5
  export type PanelState = {
6
6
  kind: 'lan-required';
7
+ tunnel?: TunnelStatusFrame;
7
8
  } | {
8
9
  kind: 'loopback-required';
9
10
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"RemotePanel.d.ts","sourceRoot":"","sources":["../../../src/client/RemotePanel.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,WAAW,E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AAI,IAAI,CAAA;IACd,SAAS,IAAI,IAAI,CAAA;IACjB,MAAM,IAAI,IAAI,CAAA;IACd,sDAAsD;IACtD,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACpC,oEAAoE;IACpE,YAAY,IAAI,IAAI,CAAA;CACrB;AAgBD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,aAAa,EAAE,YAAY,EAAE,EAAE,gBAAgB,+BA8GlI"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * The mobile remote-control panel body: status card (state text + badge),
4
4
  * the QR code, the open-on-phone hint with the link text, and the three
@@ -8,7 +8,7 @@ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-run
8
8
  import clsx from 'clsx';
9
9
  import { QRCodeSVG } from 'qrcode.react';
10
10
  import { IconCloseOutline16, IconCopyOutline16, IconLinkOutline16, IconRefreshOutline16, IconStopFill16, } from '@deepseek-ai/dsh-client-ui-primitives';
11
- import { formatClock } from "./pair-api.js";
11
+ import { formatClock } from './pair-api.js';
12
12
  import css from './remote.module.css';
13
13
  /** Badge text + tone per phase (ready states only). */
14
14
  function statusOf(t, state) {
@@ -67,6 +67,11 @@ export declare class RemoteSettingsCardController {
67
67
  * @returns the card's snapshot and its form actions.
68
68
  */
69
69
  inject(): RemoteSettingsCardFace;
70
+ /**
71
+ * Release the card's scope subscription and bound stores; the slot
72
+ * disposer calls this on teardown.
73
+ */
74
+ dispose(): void;
70
75
  }
71
76
  /** Props the renderer binds for the remote-control card. */
72
77
  export type RemoteSettingsCardProps = PropsRuntime<'web-ui.plugin.item'> & PropsLocale<'remote'> & InjectFace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a,CAAC,cAAc,CAAC,EAa/C;IAED,OAAO,CAAC,UAAU;IAelB;;;OAGG;IACH,MAAM,IAAI,sBAAsB,CAE/B;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,CAEd;CACF;AAED,4DAA4D;AAC5D,MAAM,MAAM,uBAAuB,GACjC,YAAY,CAAC,oBAAoB,CAAC,GAChC,WAAW,CAAC,QAAQ,CAAC,GACrB,UAAU,CAAC,sBAAsB,CAAC,CAAA;AAEtC;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,uBAAuB,+BAsHhE"}
@@ -1,6 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { PluginSettingsCard, ValueField, BooleanField } from "./PluginSettingsCard.js";
3
- import { CardForm, booleanField, numberField, textField } from "./settings-form.js";
2
+ import { PluginSettingsCard, ValueField, BooleanField } from './PluginSettingsCard.js';
3
+ import { CardForm, booleanField, numberField, textField } from './settings-form.js';
4
4
  /** Bridges the `remote-web-ui` scope onto the card's staged form. */
5
5
  export class RemoteSettingsCardController {
6
6
  form;
@@ -41,6 +41,13 @@ export class RemoteSettingsCardController {
41
41
  inject() {
42
42
  return { hooks: { remoteSettingsCard: this.store }, ...this.form.actions() };
43
43
  }
44
+ /**
45
+ * Release the card's scope subscription and bound stores; the slot
46
+ * disposer calls this on teardown.
47
+ */
48
+ dispose() {
49
+ this.form.dispose();
50
+ }
44
51
  }
45
52
  /**
46
53
  * Render the remote-control card.
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  /**
3
3
  * The sidebar update seat: the download trigger beside the remote-control
4
4
  * trigger plus the update panel modal. Owns the flow — probe the registry
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { IconCloseOutline16, IconRefreshOutline16 } from '@deepseek-ai/dsh-client-ui-primitives';
3
3
  import css from "./remote.module.css";
4
4
  /** The anchor package name (aggregate first) for copy purposes. */
@@ -9,7 +9,7 @@
9
9
  * Failure of accept leaves a sessionStorage marker the entry renders as a
10
10
  * one-time notice.
11
11
  */
12
- import { acceptPair, readPairParams } from "./pair-api.js";
12
+ import { acceptPair, readPairParams } from './pair-api.js';
13
13
  /** sessionStorage key for the failed-pair notice. */
14
14
  export const PAIR_FAILED_MARKER = 'dsh-remote-pair-failed';
15
15
  /** Poll budget for the runtime services (activation order is unconstrained). */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,wCAAwC,CAAA;AAa7G,OAAO,EAAU,KAAK,SAAS,EAAE,MAAM,cAAc,CAAA;AAIrD,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,YAAY,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACrE,YAAY,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAA;AACnE,YAAY,EAAE,SAAS,EAAE,MAAM,cAAc,CAAA;AAC7C,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAC/F,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAErE,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,0CAA0C;QAC1C,MAAM,EAAE,SAAS,CAAA;KAClB;IAED,UAAU,OAAO;QACf;;;;WAIG;QACH,gBAAgB,EAAE;YAAE,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,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,0BAA0B,CAAA;AAC/F,YAAY,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAA;AACzD,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAErE,OAAO,QAAQ,kCAAkC,CAAC;IAChD,UAAU,kBAAkB;QAC1B,0CAA0C;QAC1C,MAAM,EAAE,SAAS,CAAA;KAClB;IAED,UAAU,OAAO;QACf;;;;WAIG;QACH,gBAAgB,EAAE;YAAE,IAAI,EAAE,QAAQ,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,uBAAuB,CAAA;SAAE,CAAA;QACnF;;;;;WAKG;QACH,oBAAoB,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,4BAA4B,CAAA;SAAE,CAAA;KAC3F;CACF;AAED,4GAA4G;AAC5G,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,IAAI,EAAE,OAAO,CAAA;CACd;AAED,mEAAmE;AACnE,MAAM,WAAW,4BAA4B;IAC3C,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB;AAED,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,OAAO;QACf;;;;WAIG;QACH,aAAa,CAAC,EAAE;YAAE,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAAA;SAAE,CAAA;KAC1E;CACF;AAYD,wCAAwC;AACxC,eAAO,MAAM,MAAM,UAA+D,CAAA;AAElF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,aAAa,GAAG,IAAI,CAgH9C"}
@@ -8,13 +8,13 @@
8
8
  */
9
9
  import { createElement } from 'react';
10
10
  import { createRoot } from 'react-dom/client';
11
- import { FooterRemoteEntry } from "./FooterRemoteEntry.js";
12
- import { RemoteEntry } from "./RemoteEntry.js";
13
- import { PairFailedNotice } from "./PairFailedNotice.js";
14
- import { RemoteSettingsCard, RemoteSettingsCardController } from "./RemoteSettingsCard.js";
15
- import { en, zh } from "./locales.js";
16
- import { PAIR_FAILED_MARKER, runPairBootFlow } from "./deep-link.js";
17
- import { sendHeartbeat } from "./pair-api.js";
11
+ import { FooterRemoteEntry } from './FooterRemoteEntry.js';
12
+ import { RemoteEntry } from './RemoteEntry.js';
13
+ import { PairFailedNotice } from './PairFailedNotice.js';
14
+ import { RemoteSettingsCard, RemoteSettingsCardController } from './RemoteSettingsCard.js';
15
+ import { en, zh } from './locales.js';
16
+ import { PAIR_FAILED_MARKER, runPairBootFlow } from './deep-link.js';
17
+ import { sendHeartbeat } from './pair-api.js';
18
18
  /** Dictionary namespace owned by this plugin. */
19
19
  const NS = 'remote';
20
20
  /** Settings namespace the remote-control card edits (the Host plugin registers it). */
@@ -86,13 +86,19 @@ export function apply(ctx) {
86
86
  // Plugin configuration card: one staged form over the `remote-web-ui`
87
87
  // settings namespace, contributed to the Web UI plugin group.
88
88
  const remoteSettings = new RemoteSettingsCardController(settingsScope);
89
- ctx.slots.inject('web-ui.plugin.item', () => ctx.slots.register({
90
- name: 'web-ui.plugin.item',
91
- id: 'remote-web-ui',
92
- order: 90,
93
- locale: NS,
94
- inject: () => remoteSettings.inject(),
95
- }, RemoteSettingsCard));
89
+ ctx.slots.inject('web-ui.plugin.item', () => {
90
+ const unregister = ctx.slots.register({
91
+ name: 'web-ui.plugin.item',
92
+ id: 'remote-web-ui',
93
+ order: 90,
94
+ locale: NS,
95
+ inject: () => remoteSettings.inject(),
96
+ }, RemoteSettingsCard);
97
+ return () => {
98
+ remoteSettings.dispose();
99
+ unregister();
100
+ };
101
+ });
96
102
  // Phone-side boot flow + heartbeats. Loopback pages (the desktop) never
97
103
  // heartbeat; the server ignores unpaired heartbeats anyway. Both run only
98
104
  // while the plugin is enabled.
@@ -149,11 +149,19 @@ export declare class CardForm<T> {
149
149
  private readonly specs;
150
150
  private readonly staged;
151
151
  private readonly listeners;
152
+ /** The scope subscription installed in the constructor; released by dispose(). */
153
+ private readonly disposeScope;
154
+ private disposed;
152
155
  private saving;
153
156
  private failed;
154
157
  private failedReason;
155
158
  /** @param scope - the bound settings scope for this card's namespace. */
156
159
  constructor(scope: SettingsScope<T>, specs: FieldSpec[]);
160
+ /**
161
+ * Release the scope subscription and every bound store listener. The card
162
+ * must call this on teardown; later calls are no-ops.
163
+ */
164
+ dispose(): void;
157
165
  /** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */
158
166
  bind<S>(project: () => S): SnapshotStore<S>;
159
167
  /** Read the card-level state: what the Host serves, and what a save would do. */
@@ -1 +1 @@
1
- {"version":3,"file":"settings-form.d.ts","sourceRoot":"","sources":["../../../src/client/settings-form.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAyB,aAAa,EAAE,MAAM,wCAAwC,CAAA;AAGjH,yEAAyE;AACzE,MAAM,MAAM,UAAU,GAClB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,GAC/B;IAAE,IAAI,EAAE,OAAO,CAAA;CAAE,CAAA;AAErB,0EAA0E;AAC1E,MAAM,WAAW,SAAS;IACxB,+CAA+C;IAC/C,KAAK,EAAE,MAAM,CAAA;IACb;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,2FAA2F;IAC3F,MAAM,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,MAAM,CAAA;IAClC;;;OAGG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,GAAG,SAAS,CAAA;CAChD;AAED,wCAAwC;AACxC,MAAM,WAAW,UAAU;IACzB,sCAAsC;IACtC,IAAI,EAAE,MAAM,CAAA;IACZ,oEAAoE;IACpE,UAAU,EAAE,OAAO,CAAA;IACnB,gF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C,CAAC,EACxC,KAAK,EAAE,SAAS,EAAE,EAInB;IAED;;;OAGG;IACH,OAAO,IAAI,IAAI,CAKd;IAED,wFAAwF;IACxF,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAI1C;IAED,iFAAiF;IACjF,KAAK,IAAI,SAAS,CAajB;IAED,8EAA8E;IAC9E,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,UAAU,CAY/B;IAED,wDAAwD;IACxD,OAAO,IAAI,WAAW,CAerB;IAED;;;;;;;;;;OAUG;IACG,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAkC1B;IAED,0FAA0F;IAC1F,OAAO,CAAC,YAAY;IAKpB;;;;;;OAMG;IACH,OAAO,CAAC,IAAI;YAiBE,KAAK;YAKL,KAAK;IAUnB,OAAO,CAAC,KAAK;IAOb,OAAO,CAAC,MAAM;IAQd,OAAO,CAAC,UAAU;IAIlB,OAAO,CAAC,YAAY;IAIpB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,SAAS;IAIjB,OAAO,CAAC,MAAM;IAKd,OAAO,CAAC,OAAO;CAGhB"}
@@ -91,6 +91,9 @@ export class CardForm {
91
91
  specs;
92
92
  staged = new Map();
93
93
  listeners = new Set();
94
+ /** The scope subscription installed in the constructor; released by dispose(). */
95
+ disposeScope;
96
+ disposed = false;
94
97
  saving = false;
95
98
  failed = false;
96
99
  failedReason;
@@ -98,7 +101,18 @@ export class CardForm {
98
101
  constructor(scope, specs) {
99
102
  this.scope = scope;
100
103
  this.specs = new Map(specs.map(spec => [spec.field, spec]));
101
- scope.subscribe(() => { this.publish(); });
104
+ this.disposeScope = scope.subscribe(() => { this.publish(); });
105
+ }
106
+ /**
107
+ * Release the scope subscription and every bound store listener. The card
108
+ * must call this on teardown; later calls are no-ops.
109
+ */
110
+ dispose() {
111
+ if (this.disposed)
112
+ return;
113
+ this.disposed = true;
114
+ this.disposeScope();
115
+ this.listeners.clear();
102
116
  }
103
117
  /** Publish a projection of this form, rebuilt whenever the scope or a draft changes. */
104
118
  bind(project) {
@@ -1 +1 @@
1
- {"version":3,"file":"update-api.d.ts","sourceRoot":"","sources":["../../../src/client/update-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEjE;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;gBACX,MAAM,EAAE,MAAM;CAI3B;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,CAU/D;AAED;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CAI1D"}
1
+ {"version":3,"file":"update-api.d.ts","sourceRoot":"","sources":["../../../src/client/update-api.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAEjE;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C,4EAA4E;IAC5E,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;IACvB,YAAY,MAAM,EAAE,MAAM,EAGzB;CACF;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,YAAY,CAAC,CAU/D;AAED;;;;GAIG;AACH,wBAAsB,SAAS,IAAI,OAAO,CAAC,eAAe,CAAC,CAI1D"}
@@ -13,18 +13,13 @@
13
13
  import type { IncomingMessage } from 'node:http';
14
14
  import type { PairingService } from './pairing.ts';
15
15
  /**
16
- * Whether a normalized URL hostname names the local loopback authority.
17
- * Semantics mirror the connection package's internal predicate (localhost,
18
- * IPv6 loopback, any IPv4 address in 127/8); it is reimplemented here because
19
- * the connection package no longer exports it — the fence now lives inside
20
- * the connection plugin, and external host plugins only need the
21
- * classification, not the whole trust decision.
16
+ * Loopback classification for the desktop client. The predicates now live in
17
+ * the shared synced copy (shared/host/loopback.ts, mirrored to ./loopback.ts
18
+ * by scripts/sync-shared.mjs): localhost, IPv6 loopback, and any IPv4 address
19
+ * in 127/8.
22
20
  * @param hostname - WHATWG URL hostname (IPv6 literals retain brackets).
23
21
  * @returns true for localhost, IPv6 loopback, or any IPv4 address in 127/8.
24
22
  */
25
- export declare function isLoopbackHostname(hostname: string): boolean;
26
- /** Whether a socket remote address names the loopback range (127/8, ::1, IPv4-mapped). */
27
- export declare function isLoopbackAddress(address: string | undefined): boolean;
28
23
  /**
29
24
  * Read one cookie value from a Cookie header.
30
25
  * @param header - the raw Cookie header value (or undefined).
@@ -1 +1 @@
1
- {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAM5D;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMtE;AAUD;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASvF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAQvE;AAED,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAKlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,cAAc,EACvB,oBAAoB,GAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAQ,EACtD,OAAO,GAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAQ,GACxC,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAW9H"}
1
+ {"version":3,"file":"gate.d.ts","sourceRoot":"","sources":["../../src/gate.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGlD;;;;;;;GAOG;AAEH;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CASvF;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,OAAO,EAAE,eAAe,GAAG,MAAM,GAAG,SAAS,CAQvE;AAED,oGAAoG;AACpG,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAKlE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,cAAc,EACvB,oBAAoB,GAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAQ,EACtD,OAAO,GAAE,OAAO,GAAG,CAAC,MAAM,OAAO,CAAQ,GACxC,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAW9H"}
package/lib/types/gate.js CHANGED
@@ -10,42 +10,15 @@
10
10
  * gives "停止" real teeth: revoked devices 403 on their next request,
11
11
  * including the mux/SSE stream (which then dies on reconnect).
12
12
  */
13
+ import { isLoopbackAddress, isLoopbackHostname } from './loopback.js';
13
14
  /**
14
- * Whether a normalized URL hostname names the local loopback authority.
15
- * Semantics mirror the connection package's internal predicate (localhost,
16
- * IPv6 loopback, any IPv4 address in 127/8); it is reimplemented here because
17
- * the connection package no longer exports it — the fence now lives inside
18
- * the connection plugin, and external host plugins only need the
19
- * classification, not the whole trust decision.
15
+ * Loopback classification for the desktop client. The predicates now live in
16
+ * the shared synced copy (shared/host/loopback.ts, mirrored to ./loopback.ts
17
+ * by scripts/sync-shared.mjs): localhost, IPv6 loopback, and any IPv4 address
18
+ * in 127/8.
20
19
  * @param hostname - WHATWG URL hostname (IPv6 literals retain brackets).
21
20
  * @returns true for localhost, IPv6 loopback, or any IPv4 address in 127/8.
22
21
  */
23
- export function isLoopbackHostname(hostname) {
24
- if (hostname === 'localhost' || hostname === '[::1]')
25
- return true;
26
- const parts = hostname.split('.');
27
- return parts.length === 4
28
- && parts[0] === '127'
29
- && parts.every(part => /^\d{1,3}$/.test(part) && Number(part) <= 255);
30
- }
31
- /** Whether a socket remote address names the loopback range (127/8, ::1, IPv4-mapped). */
32
- export function isLoopbackAddress(address) {
33
- if (address === undefined)
34
- return false;
35
- const normalized = address.toLowerCase();
36
- if (normalized === '::1')
37
- return true;
38
- if (normalized.startsWith('::ffff:'))
39
- return isIPv4Loopback(normalized.slice('::ffff:'.length));
40
- return isIPv4Loopback(normalized);
41
- }
42
- /** IPv4 127/8 predicate (four decimal octets, first == 127). */
43
- function isIPv4Loopback(v4) {
44
- const parts = v4.split('.');
45
- return parts.length === 4
46
- && parts[0] === '127'
47
- && parts.every(part => /^\d{1,3}$/.test(part) && Number(part) <= 255);
48
- }
49
22
  /**
50
23
  * Read one cookie value from a Cookie header.
51
24
  * @param header - the raw Cookie header value (or undefined).
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Shared HTTP helpers for the route families: one JSON writer and one
3
+ * bounded JSON body reader. Previously copy-pasted across routes.ts,
4
+ * update-routes.ts, and mobile-api.ts with drifting failure contracts.
5
+ */
6
+ import type { IncomingMessage, ServerResponse } from 'node:http';
7
+ /** One JSON response. */
8
+ export declare function writeJson(res: ServerResponse, status: number, body: unknown): void;
9
+ /**
10
+ * Read a request body up to maxBytes and parse it as JSON.
11
+ * @throws 'body too large' beyond the cap, or the JSON.parse error.
12
+ */
13
+ export declare function readBoundedJson(req: IncomingMessage, maxBytes: number): Promise<unknown>;
14
+ //# sourceMappingURL=http.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAEhE,yBAAyB;AACzB,wBAAgB,SAAS,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,GAAG,IAAI,CAIlF;AAED;;;GAGG;AACH,wBAAsB,eAAe,CAAC,GAAG,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAU9F"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Shared HTTP helpers for the route families: one JSON writer and one
3
+ * bounded JSON body reader. Previously copy-pasted across routes.ts,
4
+ * update-routes.ts, and mobile-api.ts with drifting failure contracts.
5
+ */
6
+ /** One JSON response. */
7
+ export function writeJson(res, status, body) {
8
+ const payload = JSON.stringify(body);
9
+ res.writeHead(status, { 'content-type': 'application/json; charset=utf-8', 'referrer-policy': 'no-referrer' });
10
+ res.end(payload);
11
+ }
12
+ /**
13
+ * Read a request body up to maxBytes and parse it as JSON.
14
+ * @throws 'body too large' beyond the cap, or the JSON.parse error.
15
+ */
16
+ export async function readBoundedJson(req, maxBytes) {
17
+ const chunks = [];
18
+ let size = 0;
19
+ for await (const chunk of req) {
20
+ const buffer = chunk;
21
+ size += buffer.length;
22
+ if (size > maxBytes)
23
+ throw new Error('body too large');
24
+ chunks.push(buffer);
25
+ }
26
+ return JSON.parse(Buffer.concat(chunks).toString('utf8'));
27
+ }
@@ -81,5 +81,7 @@ export declare const Config: z<Config>;
81
81
  * @param ctx - host plugin context carrying webServer.
82
82
  * @param config - resolved plugin config (schema defaults applied by the loader).
83
83
  */
84
- export declare function apply(ctx: Context, config?: Config): void;
84
+ export declare const apply: typeof applyImpl;
85
+ declare function applyImpl(ctx: Context, config?: Config): void;
86
+ export {};
85
87
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,CAAC,MAAM,aAAa,CAAA;AAmB3B,OAAO,QAAQ,qBAAqB,CAAC;IACnC,UAAU,MAAM;QACd;;;;;WAKG;QACH,UAAU,CACR,IAAI,EAAE,OAAO,EACb,OAAO,EAAE,eAAe,EACxB,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,IAAI,EAAE,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,GACrC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAA;KAC9B;CACF;AAED,iCAAiC;AACjC,eAAO,MAAM,IAAI,kBAAkB,CAAA;AAEnC,+DAA+D;AAC/D,eAAO,MAAM,MAAM,UAA4B,CAAA;AAE/C;;;;GAIG;AACH,eAAO,MAAM,gCAAgC,uDAAqC,CAAA;AAElF,qEAAqE;AACrE,MAAM,WAAW,MAAM;IACrB,yDAAyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,C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AyD;IACzD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,yEAAyE;IACzE,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB;;;;;OAKG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAA;IAC9B;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB;;;;;;OAMG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAA;IAC3B,2EAA2E;IAC3E,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB;AAED,eAAO,MAAM,MAAM,EAAE,CAAC,CAAC,MAAM,CAU3B,CAAA;AAyBF;;;;GAIG;AACH,eAAO,MAAM,KAAK,kBAAuD,CAAA;AAEzE,iBAAS,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAkOtD"}
@@ -11,15 +11,16 @@ import { createRequire } from 'node:module';
11
11
  import { setInterval as nodeSetInterval } from 'node:timers';
12
12
  import { installSettingsSection, settingsNamespace } from '@deepseek-ai/dsh-settings';
13
13
  import z from 'schemastery';
14
- import { PairingService } from "./pairing.js";
15
- import { makeGateListener } from "./gate.js";
16
- import { isTrustedApiRequest, makeRoutes } from "./routes.js";
17
- import { makeMobileRoutes } from "./mobile-routes.js";
18
- import { makeMobileApiRoutes } from "./mobile-api.js";
19
- import { lanIPv4Addresses } from "./lan.js";
20
- import { TunnelManager } from "./tunnel.js";
21
- import { checkUpdates, fetchLatestVersion, resolveAnchorManifest, resolveUpdateTarget, runUpdateVerified, } from "./update.js";
22
- import { makeUpdateRoutes } from "./update-routes.js";
14
+ import { PairingService } from './pairing.js';
15
+ import { makeGateListener } from './gate.js';
16
+ import { isTrustedApiRequest, makeRoutes } from './routes.js';
17
+ import { makeMobileRoutes } from './mobile-routes.js';
18
+ import { makeMobileApiRoutes } from './mobile-api.js';
19
+ import { lanIPv4Addresses } from './lan.js';
20
+ import { TunnelManager } from './tunnel.js';
21
+ import { checkUpdates, fetchLatestVersion, resolveAnchorManifest, resolveUpdateTarget, runUpdateVerified, } from './update.js';
22
+ import { makeUpdateRoutes } from './update-routes.js';
23
+ import { mountOnce } from './mount-once.js';
23
24
  /** Stable cordis plugin name. */
24
25
  export const name = 'remote-web-ui';
25
26
  /** Services required before the pairing surfaces can mount. */
@@ -60,7 +61,8 @@ const DEFAULTS = {
60
61
  * @param ctx - host plugin context carrying webServer.
61
62
  * @param config - resolved plugin config (schema defaults applied by the loader).
62
63
  */
63
- export function apply(ctx, config) {
64
+ export const apply = mountOnce('@linxin666/dsh-remote-web-ui', applyImpl);
65
+ function applyImpl(ctx, config) {
64
66
  const resolved = {
65
67
  tokenTtlMs: config?.tokenTtlMs ?? DEFAULTS.tokenTtlMs,
66
68
  offlineAfterMs: config?.offlineAfterMs ?? DEFAULTS.offlineAfterMs,
@@ -1 +1 @@
1
- {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,4BAA4B,CAAA;AAC7C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAUpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,GAAI,KAAK,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
1
+ {"version":3,"file":"invariant.d.ts","sourceRoot":"","sources":["../../src/invariant.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAKlD,oCAAoC;AACpC,eAAO,MAAM,IAAI,4BAA4B,CAAA;AAC7C,2EAA2E;AAC3E,eAAO,MAAM,MAAM,UAAiB,CAAA;AAUpC;;;;GAIG;AACH,eAAO,MAAM,KAAK,QAAS,OAAO,KAAG,OAAO,CAAC,MAAM,IAAI,CACU,CAAA"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Loopback trust fence shared by the host route families: socket address,
3
+ * Host header, and browser same-origin markers. Packages receive this file as
4
+ * a generated copy via scripts/sync-shared.mjs; edit the shared source and
5
+ * re-run the sync instead of editing a copy.
6
+ *
7
+ * Semantics: RFC 5735 IPv4 127/8, ::1, IPv4-mapped ::ffff:127/8 (matching the
8
+ * remote-web-ui gate), localhost hostnames, plus the browser same-origin
9
+ * markers (sec-fetch-site and Origin) for the request-level fence.
10
+ * @module dsh-web-ui-shared/host/loopback
11
+ */
12
+ import type { IncomingMessage } from 'node:http';
13
+ /** IPv4 127/8 predicate (four decimal octets, first == 127). */
14
+ export declare function isIPv4Loopback(v4: string): boolean;
15
+ /** Whether a socket remote address names the loopback range (127/8, ::1, IPv4-mapped). */
16
+ export declare function isLoopbackAddress(address: string | undefined): boolean;
17
+ /** Whether a normalized URL hostname names the loopback authority (localhost, [::1], 127/8). */
18
+ export declare function isLoopbackHostname(hostname: string): boolean;
19
+ /**
20
+ * Request-level trust fence: a loopback socket address AND a loopback Host
21
+ * header, plus browser same-origin markers. The socket address is
22
+ * authoritative; X-Forwarded-For is never trusted.
23
+ */
24
+ export declare function isLoopbackRequest(request: IncomingMessage): boolean;
25
+ //# sourceMappingURL=loopback.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loopback.d.ts","sourceRoot":"","sources":["../../src/loopback.ts"],"names":[],"mappings":"AACA;;;;;;;;;;GAUG;AAEH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAEhD,gEAAgE;AAChE,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAKlD;AAED,0FAA0F;AAC1F,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAMtE;AAED,gGAAgG;AAChG,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAG5D;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,eAAe,GAAG,OAAO,CAmBnE"}