@linxin666/dsh-client-ui-browser-view 0.4.19 → 0.4.21
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.i18n.yaml +2 -2
- package/README.md +3 -3
- package/README.zh.md +3 -3
- package/lib/client.js +18 -2
- package/lib/client.js.map +1 -1
- package/lib/index.js +82 -9
- package/lib/types/client/settings-form.d.ts +2 -0
- package/lib/types/host/auth.d.ts +25 -0
- package/lib/types/host/service.d.ts +14 -3
- package/package.json +1 -1
package/lib/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","names":["css","StateDot","IconRefreshOutlineRegular","css","css","css","Children","css","css"],"sources":["../../../packages/dsh-browser-view/src/client/live-title.ts","../../../packages/dsh-browser-view/src/client/locales.ts","../../../packages/dsh-browser-view/src/core/protocol.ts","../../../packages/dsh-browser-view/src/client/semantic.ts","../../../packages/dsh-browser-view/src/client/socket.ts","../../../packages/dsh-browser-view/src/client/panel.tsx","../../../packages/dsh-browser-view/src/client/guide-icon.tsx","../../../packages/dsh-browser-view/src/client/tab-type.ts","../../../packages/dsh-browser-view/src/client/tab-title.tsx","../../../packages/dsh-browser-view/src/client/config.tsx","../../../packages/dsh-browser-view/src/client/RangeBubble.tsx","../../../packages/dsh-browser-view/src/client/SegmentGroup.tsx","../../../packages/dsh-browser-view/src/client/PluginSettingsCard.tsx","../../../packages/dsh-browser-view/src/client/settings-form.ts","../../../packages/dsh-browser-view/src/client/settings-entry-form.ts","../../../packages/dsh-browser-view/src/client/BrowserViewSettingsCard.tsx","../../../packages/dsh-browser-view/src/client/plugin-card-seat.ts","../../../packages/dsh-browser-view/src/client/index.ts"],"sourcesContent":["/**\n * The page title the tab body last saw, published for the tab's chip.\n *\n * The chip is drawn by the shell beside a body this plugin owns, so the two\n * cannot exchange props: the body learns the streamed page's title from its\n * socket, and the title component reads it here. A chip that says \"Browser\n * view\" for a session whose page is called \"Checkout\" is the worse of the two\n * labels, so the body publishes and the title prefers what it published.\n *\n * One browser-view tab per session is what the kind declares (no `multiple`),\n * so the session id alone identifies the entry: there is no second tab whose\n * title could overwrite the first one's.\n */\n\n/** Cross-component title channel, keyed by session. */\nexport interface BrowserViewLiveTitleStore {\n /**\n * The last published title for a session.\n * @param sessionId - session key, or undefined when the component has none.\n * @returns the title, or undefined when nothing is published.\n */\n get(sessionId: string | undefined): string | undefined\n /**\n * Publish a session's page title, or clear it with undefined or an empty one.\n * @param sessionId - session key, or undefined to drop the write.\n * @param title - the page title, or undefined when the page has none.\n */\n set(sessionId: string | undefined, title: string | undefined): void\n /**\n * Observe publications.\n * @param listener - synchronous invalidation callback.\n * @returns unsubscribe.\n */\n subscribe(listener: () => void): () => void\n}\n\n/**\n * Create one store for the plugin's lifetime.\n * @returns the channel.\n */\nexport function createLiveTitleStore(): BrowserViewLiveTitleStore {\n const titles = new Map<string, string>()\n const listeners = new Set<() => void>()\n const notify = (): void => {\n // Copy first: a listener may unsubscribe while being notified.\n for (const listener of [...listeners]) listener()\n }\n return {\n get(sessionId: string | undefined): string | undefined {\n return sessionId === undefined ? undefined : titles.get(sessionId)\n },\n set(sessionId: string | undefined, title: string | undefined): void {\n if (sessionId === undefined) return\n const current = titles.get(sessionId)\n if (title === undefined || title.length === 0) {\n if (current === undefined) return\n titles.delete(sessionId)\n notify()\n return\n }\n if (current === title) return\n titles.set(sessionId, title)\n notify()\n },\n subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n","/**\n * Locale dictionaries for the browser-view plugin. `zh` is the key-set source\n * of truth; `en` keeps a full key-for-key mirror (packages/AGENTS.md bilingual\n * rules). Registered through ctx.locale.register(NS, { zh, en }); the components\n * read every string through the injected `t` seat, so no copy is hardcoded in\n * JSX.\n *\n * The page-title keys are gone with the page header: a right-sidebar tab is\n * named by the shell's chip, and the chip's text comes from the tab type and\n * the published page title instead ('panel.title' / 'panel.close' had no\n * reader left once the \"back to the conversation\" control was removed).\n *\n * 'panel.tabs.empty' went with the always-drawn tab strip: the controlled\n * browser's chips now appear only when it holds more than one page, so there is\n * no empty strip left to caption.\n */\n\n/** Simplified Chinese dictionary (key-set source of truth). */\nexport const zh = {\n 'tab.title': '浏览器视图',\n 'guide.description': '看 agent 正在操作的网页',\n 'panel.tab.untitled': '未命名页面',\n 'panel.url.empty': '还没有打开页面',\n 'panel.address.label': '页面地址',\n 'panel.toolbar.refresh': '刷新画面',\n 'panel.frame.alt': 'agent 正在操作的页面画面',\n 'panel.empty.title': '还没有画面',\n 'panel.empty.hint': '让 agent 打开一个页面后,这里会实时显示它正在看的网页。',\n 'panel.error.title': '浏览器视图出错',\n 'panel.trace.idle': '暂无工具动作',\n 'panel.status.connecting': '正在连接',\n 'panel.status.loading': '加载中',\n 'panel.status.live': '实时',\n 'panel.mode.isolated': '隔离浏览器',\n 'panel.mode.real': '真实浏览器',\n 'config.summary': '真实浏览器 CDP 连接设置',\n 'config.realBrowserEnabled': '使用真实浏览器(CDP)',\n 'config.realBrowserEnabled.hint': '开启后,所有 DSH 会话都能操作此浏览器中的全部标签页。',\n 'config.cdpEndpoint': 'CDP 地址',\n 'config.cdpEndpoint.hint': '仅支持本机 loopback;Chrome 136+ 默认 profile 不支持远程调试。',\n 'config.idleCloseDays': '闲置关闭(天)',\n 'config.idleCloseDays.hint': 'DSH 自己打开的页面超过这个天数没有工具动作会被自动关闭;接管的真实页面不在此列,0 表示不关闭。',\n 'config.unavailable': '设置暂不可用',\n 'config.failed': '设置保存失败,请重试',\n 'settings.title': '真实浏览器',\n 'settings.description': '使用本机 Chrome / Edge 的登录状态与全部标签页。',\n 'settings.enabled': '启用 CDP 接管',\n 'settings.enabledHint': '开启后,所有 DSH 会话都能读取和操作此浏览器中的全部标签页。',\n 'settings.cdpEndpoint': 'CDP 地址',\n 'settings.cdpEndpointHint': '仅限本机 loopback;Chrome 136+ 默认 profile 不支持远程调试。',\n 'settings.idleCloseDays': '闲置自动关闭(天)',\n 'settings.idleCloseDaysHint': 'DSH 自己打开的页面超过这个天数没有工具动作就自动关闭;接管的真实页面不在此列,0 表示关闭该能力。',\n 'settings.inherit': '继承',\n 'settings.on': '开启',\n 'settings.off': '关闭',\n 'settings.overridden': '已覆盖',\n 'settings.reset': '重置',\n 'settings.invalidValue': '取值无效',\n 'settings.collapse': '收起',\n 'settings.expand': '展开',\n 'settings.notExposed': '此部署未提供该插件设置。',\n 'settings.readOnly': '只读',\n 'settings.saveFailed': '保存失败',\n}\n\n/** The browser-view namespace key union. */\nexport type BrowserViewKey = keyof typeof zh\n\n/** English dictionary, key-for-key complete against zh. */\nexport const en: Record<BrowserViewKey, string> = {\n 'tab.title': 'Browser view',\n 'guide.description': 'Watch the page the agent is driving',\n 'panel.tab.untitled': 'Untitled page',\n 'panel.url.empty': 'No page open yet',\n 'panel.address.label': 'Page address',\n 'panel.toolbar.refresh': 'Refresh the frame',\n 'panel.frame.alt': 'Live view of the page the agent is driving',\n 'panel.empty.title': 'No frames yet',\n 'panel.empty.hint': 'Once the agent opens a page, this tab shows the page it is looking at.',\n 'panel.error.title': 'Browser view error',\n 'panel.trace.idle': 'No tool actions yet',\n 'panel.status.connecting': 'Connecting',\n 'panel.status.loading': 'Loading',\n 'panel.status.live': 'Live',\n 'panel.mode.isolated': 'Isolated browser',\n 'panel.mode.real': 'Real browser',\n 'config.summary': 'Real-browser CDP connection settings',\n 'config.realBrowserEnabled': 'Use a real browser (CDP)',\n 'config.realBrowserEnabled.hint': 'When enabled, every DSH session can operate every tab in this browser.',\n 'config.cdpEndpoint': 'CDP endpoint',\n 'config.cdpEndpoint.hint': 'Loopback only. Chrome 136+ does not allow remote debugging on its default profile.',\n 'config.idleCloseDays': 'Idle close (days)',\n 'config.idleCloseDays.hint': 'Pages DSH opened itself close once no browser tool has touched them for this many days. Adopted real-browser pages are never closed; 0 disables it.',\n 'config.unavailable': 'Settings are unavailable',\n 'config.failed': 'Could not save settings. Try again.',\n 'settings.title': 'Real browser',\n 'settings.description': 'Use the sign-in state and every tab of this machine\\'s Chrome or Edge.',\n 'settings.enabled': 'Enable CDP takeover',\n 'settings.enabledHint': 'When enabled, every DSH session can read and operate every tab in this browser.',\n 'settings.cdpEndpoint': 'CDP endpoint',\n 'settings.cdpEndpointHint': 'Loopback only. Chrome 136+ does not allow remote debugging on its default profile.',\n 'settings.idleCloseDays': 'Auto-close idle pages (days)',\n 'settings.idleCloseDaysHint': 'Pages DSH opened itself close once no browser tool has touched them for this many days. Adopted real-browser pages are never closed; 0 disables it.',\n 'settings.inherit': 'Inherit',\n 'settings.on': 'On',\n 'settings.off': 'Off',\n 'settings.overridden': 'Overridden',\n 'settings.reset': 'Reset',\n 'settings.invalidValue': 'Invalid value',\n 'settings.collapse': 'Collapse',\n 'settings.expand': 'Expand',\n 'settings.notExposed': 'This deployment does not expose the plugin settings.',\n 'settings.readOnly': 'Read-only',\n 'settings.saveFailed': 'Save failed',\n}\n","/**\n * The browser-view wire contract, shared by both halves.\n *\n * One source of truth for the host <-> browser messages and for the shapes the\n * agent tools return. Both halves compile this file (src/core is compiled into\n * the host program and the browser bundle), so a change here is a change to\n * both sides at once and needs no second definition.\n *\n * Transport: one WebSocket per mounted panel, created by the host half through\n * `ctx.webServer.registerUpgrade`. The host pushes events; the panel sends\n * commands. The browser itself is driven over CDP by the host half, so the\n * panel never speaks the devtools protocol.\n *\n * @module @linxin666/dsh-client-ui-browser-view/core/protocol\n */\n\n/** Version of the wire contract; a mismatch rejects the socket instead of guessing. */\nexport const BROWSER_VIEW_API_VERSION = 1\n\n/** Mount path of the panel socket, relative to the GUI origin. */\nexport const BROWSER_VIEW_SOCKET_PATH = '/api/dsh-browser-view/socket'\n\n/** JPEG quality the host asks CDP for; the panel only displays frames. */\nexport const DEFAULT_JPEG_QUALITY = 70\n\n/** Viewport the host pins on every tab it creates, in CSS pixels. */\nexport const DEFAULT_VIEWPORT = { width: 1280, height: 800 } as const\n\n/** How long a tab may live without any session binding before it is reaped. */\nexport const IDLE_TAB_TTL_MS = 10 * 60_000\n\n/** Deepest DOM snapshot walk the host will perform, in nodes. */\nexport const SNAPSHOT_NODE_LIMIT = 4000\n\n/** Ring size for captured console and network entries per tab. */\nexport const EVENT_RING_SIZE = 500\n\n/** One open tab as the panel and the tools see it. */\nexport interface BrowserTabView {\n /** Stable CDP target id, the handle tools accept. */\n id: string\n /** Current top-level URL. */\n url: string\n /** Current document title, empty when the page has none. */\n title: string\n /** Whether the tab is loading right now. */\n loading: boolean\n /** Session that last acted on the tab, when any. */\n sessionId?: string\n /** Whether DSH created this target or adopted an existing real-browser tab. */\n origin?: 'created' | 'adopted'\n}\n\n/** What the header of the panel shows. */\nexport interface BrowserPanelState {\n /** Tabs in creation order. */\n tabs: BrowserTabView[]\n /** Tab the panel is watching, null when none is open. */\n activeTabId: string | null\n /** Whether the host half currently has a live browser process or CDP attachment. */\n running: boolean\n /** Browser source selected for the current configuration; absent in older hosts. */\n mode?: 'isolated' | 'cdp'\n /** Normalized loopback CDP origin when real-browser mode is selected. */\n cdpEndpoint?: string\n /** Last error text the host wants the panel to show instead of a frame. */\n message?: string\n}\n\n/** One line of the panel's \"what is the agent doing\" trace. */\nexport interface BrowserActionTrace {\n /** Tool name that produced the change, without its `browser_` prefix. */\n tool: string\n /** One-line human description, already localized by the host. */\n summary: string\n /** Millisecond timestamp of the action. */\n at: number\n}\n\n/** Host pushes one of these to every attached panel. */\nexport type BrowserViewEvent =\n | { v: 1; kind: 'hello'; state: BrowserPanelState }\n | { v: 1; kind: 'state'; state: BrowserPanelState }\n | {\n v: 1\n kind: 'frame'\n /** Tab the frame belongs to. */\n tabId: string\n /** Monotonic frame counter, so a slow panel can drop intermediate frames. */\n seq: number\n /** Frame size in CSS pixels. */\n width: number\n /** Frame size in CSS pixels. */\n height: number\n /** Base64 JPEG, no data: prefix. */\n data: string\n }\n | { v: 1; kind: 'action'; trace: BrowserActionTrace }\n | { v: 1; kind: 'error'; code: string; message: string }\n\n/** Panel sends one of these to the host. */\nexport type BrowserViewCommand =\n | { v: 1; kind: 'attach'; sessionId?: string }\n | { v: 1; kind: 'select-tab'; tabId: string }\n | { v: 1; kind: 'request-frame' }\n | { v: 1; kind: 'close-tab'; tabId: string }\n\n/** A console entry the host rang in while the tab was open. */\nexport interface BrowserConsoleEntry {\n /** Console level: log, info, warn, error, debug. */\n level: string\n /** Already-stringified arguments. */\n text: string\n /** Millisecond timestamp. */\n at: number\n}\n\n/** A network request the host observed, reduced to what verification needs. */\nexport interface BrowserNetworkEntry {\n /** Request URL. */\n url: string\n /** HTTP method. */\n method: string\n /** Response status, 0 while pending or on a transport failure. */\n status: number\n /** Response mime type when known. */\n mimeType?: string\n /** CDP failure text when the request failed. */\n failure?: string\n /** Millisecond timestamp of the request. */\n at: number\n}\n\n/** One node of the DOM snapshot the tools return. */\nexport interface BrowserSnapshotNode {\n /** Depth-first index, the handle `browser_click` accepts as `ref`. */\n ref: number\n /** Lowercase tag name. */\n tag: string\n /** Element id, when set. */\n id?: string\n /** Element classes, when set. */\n classes?: string[]\n /** Accessible role when Chrome reports one. */\n role?: string\n /** Accessible name when Chrome reports one. */\n name?: string\n /** Visible text for leaf nodes, truncated by the host. */\n text?: string\n /** Bounding box in CSS pixels, window-relative. */\n box?: { x: number; y: number; width: number; height: number }\n /** Depth in the walked tree. */\n depth: number\n}\n\n/** What `browser_snapshot` returns to the model. */\nexport interface BrowserSnapshot {\n /** Tab the snapshot came from. */\n tabId: string\n /** Top-level URL at snapshot time. */\n url: string\n /** Document title. */\n title: string\n /** Walked nodes, bounded by SNAPSHOT_NODE_LIMIT. */\n nodes: BrowserSnapshotNode[]\n /** True when the walk hit the node limit. */\n truncated: boolean\n}\n\n/** Whether a decoded JSON value is a command this version accepts. */\nexport function isBrowserViewCommand(value: unknown): value is BrowserViewCommand {\n if (typeof value !== 'object' || value === null) return false\n const candidate = value as Record<string, unknown>\n if (candidate.v !== BROWSER_VIEW_API_VERSION) return false\n switch (candidate.kind) {\n case 'attach':\n return candidate.sessionId === undefined || typeof candidate.sessionId === 'string'\n case 'select-tab':\n return typeof candidate.tabId === 'string'\n case 'close-tab':\n return typeof candidate.tabId === 'string'\n case 'request-frame':\n return true\n default:\n return false\n }\n}\n","/**\n * Semantic attributes for the browser-view surface (semantic-attrs-v1).\n *\n * The plugin name lives on the root element of each surface so part values stay\n * bare words; a theme anchors on the pair, never on a part name that repeats\n * the plugin. The right-sidebar chip and the shell's tab strip around it are\n * not ours, so only this plugin's own elements are stamped.\n *\n * The body's part names follow the shipped browser tab's structure - a toolbar\n * with an address display, the frame, and the action trace - so a theme that\n * already anchors on that chrome reaches this tab the same way.\n */\n\n/** Root plugin attribute value carried by every top-level browser-view element. */\nexport const BROWSER_VIEW_PLUGIN = 'browser-view'\n\n/** Part names this plugin emits, in surface order. */\nexport const BROWSER_VIEW_PARTS = {\n /** The tab body the sidebar mounts in its content area. */\n panel: 'panel',\n /** Top chrome row: address display, connection state, refresh. */\n toolbar: 'toolbar',\n /** The read-only address display of the streamed page. */\n address: 'address',\n /** The controlled browser's tab chips; drawn only when it holds several. */\n tabs: 'tabs',\n /** The live frame image. */\n frame: 'frame',\n /** Bottom action trace. */\n trace: 'trace',\n /** Connection state marker in the toolbar. */\n status: 'status',\n /** No-frame placeholder. */\n empty: 'empty',\n /** Host-reported failure placeholder. */\n error: 'error',\n /** This plugin's share of the right-sidebar chip. */\n tabTitle: 'tab-title',\n} as const\n","/**\n * Panel-side WebSocket client.\n *\n * The host half owns the CDP connection and pushes state, JPEG frames, tool\n * actions and errors over one socket per mounted panel (see ../core/protocol.ts\n * for the frozen wire contract). This module is the only place the browser half\n * touches the wire: it derives the page or shell-owned socket URL, narrows every\n * incoming message through the protocol's discriminant, drops stale frames,\n * and reconnects with exponential backoff.\n *\n * Nothing here imports the DOM's WebSocket type directly: the constructor is\n * injectable so the tests drive a fake transport instead of a network.\n *\n * @module @linxin666/dsh-client-ui-browser-view/client/socket\n */\nimport {\n BROWSER_VIEW_API_VERSION,\n BROWSER_VIEW_SOCKET_PATH,\n} from '../core/protocol.ts'\nimport type {\n BrowserActionTrace,\n BrowserPanelState,\n BrowserTabView,\n BrowserViewCommand,\n BrowserViewEvent,\n} from '../core/protocol.ts'\n\n/** Connection phase the panel renders in its status line. */\nexport type BrowserViewSocketStatus = 'connecting' | 'open' | 'reconnecting' | 'closed'\n\n/** First reconnect delay, doubled per failed attempt. */\nexport const RECONNECT_BASE_MS = 500\n\n/** Reconnect ceiling; a host that stays down must not spin the tab. */\nexport const RECONNECT_MAX_MS = 15_000\n\n/** One decoded frame, exactly as the panel needs it. */\nexport interface BrowserViewFrame {\n /** Tab the frame belongs to. */\n readonly tabId: string\n /** Host-side monotonic counter for this tab. */\n readonly seq: number\n /** Frame width in CSS pixels. */\n readonly width: number\n /** Frame height in CSS pixels. */\n readonly height: number\n /** Base64 JPEG, no data: prefix. */\n readonly data: string\n}\n\n/** Callbacks the panel installs on a connection. */\nexport interface BrowserViewSocketHandlers {\n /** Connection phase changed. */\n onStatus?(status: BrowserViewSocketStatus): void\n /** Tabs, active tab and running flag were (re)published. */\n onState(state: BrowserPanelState): void\n /** A fresh frame arrived, already filtered for staleness. */\n onFrame(frame: BrowserViewFrame): void\n /** The agent performed one tool action. */\n onAction(trace: BrowserActionTrace): void\n /** The host reported a failure the panel must show instead of a frame. */\n onError(code: string, message: string): void\n}\n\n/** The minimal socket face this client needs; the DOM WebSocket satisfies it. */\nexport interface BrowserViewWebSocketLike {\n send(data: string): void\n close(code?: number, reason?: string): void\n onopen: ((event: unknown) => void) | null\n onmessage: ((event: { data: unknown }) => void) | null\n onclose: ((event: unknown) => void) | null\n onerror: ((event: unknown) => void) | null\n}\n\n/** Constructor shape of the transport; injectable for tests. */\nexport type BrowserViewWebSocketCtor = new (url: string) => BrowserViewWebSocketLike\n\n/** Options for one connection. */\nexport interface BrowserViewSocketOptions {\n /** Transport constructor; defaults to the page's WebSocket. */\n readonly WebSocketImpl?: BrowserViewWebSocketCtor\n /** Origin source for the URL; defaults to `globalThis.location`. */\n readonly location?: { readonly protocol: string; readonly host: string }\n /** Session the panel attaches to, forwarded in the `attach` command. */\n readonly sessionId?: string\n /** Timer seam so backoff can be advanced deterministically in tests. */\n readonly setTimer?: (handler: () => void, ms: number) => unknown\n /** Timer cancellation seam paired with `setTimer`. */\n readonly clearTimer?: (handle: unknown) => void\n}\n\n/** The handle a panel keeps for the lifetime of one mounted connection. */\nexport interface BrowserViewSocket {\n /** Send one command, buffered while the socket is not open. */\n send(command: BrowserViewCommand): void\n /** Stop reconnecting and close the transport. */\n close(): void\n /** Current connection phase. */\n status(): BrowserViewSocketStatus\n}\n\n/** Commands held while the socket is down; the oldest drop first. */\nconst PENDING_COMMAND_LIMIT = 16\n\n/** The network authority of a shell-owned Host, without credentials or a path. */\nfunction hostAuthorityOf(base: string | undefined): { protocol: string; authority: string } | undefined {\n if (base === undefined || base === '') return undefined\n let url: URL\n try {\n url = new URL(base)\n } catch {\n return undefined\n }\n if (url.protocol !== 'http:' && url.protocol !== 'https:') return undefined\n if (url.username !== '' || url.password !== '' || url.host === '') return undefined\n return { protocol: url.protocol, authority: url.host }\n}\n\n/**\n * Derive the socket URL from a web page or its application shell's Host.\n *\n * A web page keeps its own origin even when a transport hook is present. An\n * application-delivered page such as the desktop shell's dsh-app: cannot carry\n * a WebSocket upgrade on that scheme, so it uses the Host authority the shell\n * publishes instead. The shell rewrites that handshake; the Host fence is unchanged.\n * @param location - origin the panel is rendered on.\n * @param streamBaseUrl - official `__DSH_TRANSPORT__.streamBaseUrl`, when published.\n * @returns the absolute ws/wss URL, or null when no safe Host authority is known.\n */\nexport function browserViewSocketUrl(\n location: { readonly protocol: string; readonly host: string },\n streamBaseUrl?: string,\n): string | null {\n const pageProtocol = location.protocol === 'https:'\n ? 'wss:'\n : location.protocol === 'http:'\n ? 'ws:'\n : null\n if (pageProtocol !== null) return `${pageProtocol}//${location.host}${BROWSER_VIEW_SOCKET_PATH}`\n const base = hostAuthorityOf(streamBaseUrl)\n if (base === undefined) return null\n const protocol = base.protocol === 'https:' ? 'wss:' : 'ws:'\n return `${protocol}//${base.authority}${BROWSER_VIEW_SOCKET_PATH}`\n}\n\n/**\n * Backoff for one reconnect attempt.\n * @param attempt - zero-based attempt index.\n * @returns delay in milliseconds, capped at RECONNECT_MAX_MS.\n */\nexport function reconnectDelay(attempt: number): number {\n const exponential = RECONNECT_BASE_MS * 2 ** Math.max(0, Math.floor(attempt))\n return Math.min(exponential, RECONNECT_MAX_MS)\n}\n\n/** Narrow a tab row from the wire. */\nfunction readTab(value: unknown): BrowserTabView | null {\n if (typeof value !== 'object' || value === null) return null\n const candidate = value as Record<string, unknown>\n if (typeof candidate.id !== 'string') return null\n if (typeof candidate.url !== 'string') return null\n if (typeof candidate.title !== 'string') return null\n if (typeof candidate.loading !== 'boolean') return null\n return {\n id: candidate.id,\n url: candidate.url,\n title: candidate.title,\n loading: candidate.loading,\n ...(typeof candidate.sessionId === 'string' ? { sessionId: candidate.sessionId } : {}),\n ...(candidate.origin === 'created' || candidate.origin === 'adopted' ? { origin: candidate.origin } : {}),\n }\n}\n\n/** Narrow the panel state from the wire. */\nfunction readPanelState(value: unknown): BrowserPanelState | null {\n if (typeof value !== 'object' || value === null) return null\n const candidate = value as Record<string, unknown>\n if (!Array.isArray(candidate.tabs)) return null\n if (typeof candidate.running !== 'boolean') return null\n if (candidate.activeTabId !== null && typeof candidate.activeTabId !== 'string') return null\n const tabs: BrowserTabView[] = []\n for (const entry of candidate.tabs) {\n const tab = readTab(entry)\n if (tab === null) return null\n tabs.push(tab)\n }\n return {\n tabs,\n activeTabId: candidate.activeTabId as string | null,\n running: candidate.running,\n ...(candidate.mode === 'isolated' || candidate.mode === 'cdp' ? { mode: candidate.mode } : {}),\n ...(typeof candidate.cdpEndpoint === 'string' ? { cdpEndpoint: candidate.cdpEndpoint } : {}),\n ...(typeof candidate.message === 'string' ? { message: candidate.message } : {}),\n }\n}\n\n/**\n * Narrow one decoded payload into a protocol event.\n *\n * The protocol is a discriminated union over `kind`, so an unknown kind or a\n * wrong field type is a shape this panel cannot render: it is dropped rather\n * than half-applied, which keeps one malformed push from corrupting the view.\n * @param value - parsed JSON value (or a raw frame string).\n * @returns the event, or null when the payload is not one this version reads.\n */\nexport function parseBrowserViewEvent(value: unknown): BrowserViewEvent | null {\n let payload = value\n if (typeof payload === 'string') {\n try {\n payload = JSON.parse(payload)\n } catch {\n return null\n }\n }\n if (typeof payload !== 'object' || payload === null) return null\n const candidate = payload as Record<string, unknown>\n if (candidate.v !== BROWSER_VIEW_API_VERSION) return null\n switch (candidate.kind) {\n case 'hello':\n case 'state': {\n const state = readPanelState(candidate.state)\n if (state === null) return null\n return { v: BROWSER_VIEW_API_VERSION, kind: candidate.kind, state }\n }\n case 'frame': {\n if (typeof candidate.tabId !== 'string') return null\n if (typeof candidate.seq !== 'number') return null\n if (typeof candidate.width !== 'number') return null\n if (typeof candidate.height !== 'number') return null\n if (typeof candidate.data !== 'string') return null\n return {\n v: BROWSER_VIEW_API_VERSION,\n kind: 'frame',\n tabId: candidate.tabId,\n seq: candidate.seq,\n width: candidate.width,\n height: candidate.height,\n data: candidate.data,\n }\n }\n case 'action': {\n const trace = candidate.trace\n if (typeof trace !== 'object' || trace === null) return null\n const row = trace as Record<string, unknown>\n if (typeof row.tool !== 'string' || typeof row.summary !== 'string' || typeof row.at !== 'number') return null\n return {\n v: BROWSER_VIEW_API_VERSION,\n kind: 'action',\n trace: { tool: row.tool, summary: row.summary, at: row.at },\n }\n }\n case 'error': {\n if (typeof candidate.code !== 'string' || typeof candidate.message !== 'string') return null\n return { v: BROWSER_VIEW_API_VERSION, kind: 'error', code: candidate.code, message: candidate.message }\n }\n default:\n return null\n }\n}\n\n/**\n * Open one connection to the host half and keep it alive.\n *\n * Sequencing: every successful open sends `attach` (the host answers with\n * `hello` plus frames), and the per-tab frame counter is cleared because the\n * host restarts its `seq` for a new connection — keeping the old high-water\n * mark would drop the whole fresh stream.\n * @param handlers - panel callbacks.\n * @param options - transport, origin, session and timer seams.\n * @returns the handle the panel closes on unmount.\n */\nexport function connectBrowserViewSocket(\n handlers: BrowserViewSocketHandlers,\n options: BrowserViewSocketOptions = {},\n): BrowserViewSocket {\n const globals = globalThis as {\n WebSocket?: BrowserViewWebSocketCtor\n location?: { protocol: string; host: string }\n __DSH_TRANSPORT__?: { streamBaseUrl?: unknown }\n }\n const WebSocketImpl = options.WebSocketImpl ?? globals.WebSocket\n const location = options.location ?? globals.location\n const setTimer = options.setTimer ?? ((handler, ms) => setTimeout(handler, ms))\n const clearTimer = options.clearTimer ?? ((handle) => { clearTimeout(handle as ReturnType<typeof setTimeout>) })\n const publishedBase = globals.__DSH_TRANSPORT__?.streamBaseUrl\n const streamBaseUrl = typeof publishedBase === 'string' ? publishedBase : undefined\n const url = location === undefined ? null : browserViewSocketUrl(location, streamBaseUrl)\n\n let status: BrowserViewSocketStatus = 'connecting'\n let socket: BrowserViewWebSocketLike | null = null\n let attempt = 0\n let disposed = false\n let timer: unknown = null\n const pending: BrowserViewCommand[] = []\n const lastSeqByTab = new Map<string, number>()\n\n /** Publish a phase change once. */\n const setStatus = (next: BrowserViewSocketStatus): void => {\n if (status === next) return\n status = next\n handlers.onStatus?.(next)\n }\n\n /** Send without buffering (open socket only). */\n const sendNow = (command: BrowserViewCommand): boolean => {\n if (socket === null) return false\n try {\n socket.send(JSON.stringify(command))\n return true\n } catch {\n return false\n }\n }\n\n /** Dispatch one decoded event, dropping frames older than what is on screen. */\n const dispatch = (event: BrowserViewEvent): void => {\n switch (event.kind) {\n case 'hello':\n case 'state':\n handlers.onState(event.state)\n return\n case 'frame': {\n const previous = lastSeqByTab.get(event.tabId)\n if (previous !== undefined && event.seq <= previous) return\n lastSeqByTab.set(event.tabId, event.seq)\n handlers.onFrame({\n tabId: event.tabId,\n seq: event.seq,\n width: event.width,\n height: event.height,\n data: event.data,\n })\n return\n }\n case 'action':\n handlers.onAction(event.trace)\n return\n case 'error':\n handlers.onError(event.code, event.message)\n return\n default:\n return\n }\n }\n\n /** Arm the next reconnect; each failure doubles the wait until the ceiling. */\n const scheduleReconnect = (): void => {\n if (disposed) return\n if (url === null || WebSocketImpl === undefined) {\n setStatus('closed')\n return\n }\n setStatus('reconnecting')\n if (timer !== null) clearTimer(timer)\n const delay = reconnectDelay(attempt)\n attempt += 1\n timer = setTimer(() => {\n timer = null\n connect()\n }, delay)\n }\n\n /** Open one transport and wire it to the handlers. */\n const connect = (): void => {\n if (disposed) return\n if (url === null || WebSocketImpl === undefined) {\n setStatus('closed')\n return\n }\n setStatus(attempt === 0 ? 'connecting' : 'reconnecting')\n let transport: BrowserViewWebSocketLike\n try {\n transport = new WebSocketImpl(url)\n } catch {\n socket = null\n scheduleReconnect()\n return\n }\n socket = transport\n transport.onopen = () => {\n if (disposed) return\n attempt = 0\n lastSeqByTab.clear()\n setStatus('open')\n while (pending.length > 0) {\n const command = pending.shift()\n if (command !== undefined) sendNow(command)\n }\n sendNow({ v: BROWSER_VIEW_API_VERSION, kind: 'attach', ...(options.sessionId === undefined ? {} : { sessionId: options.sessionId }) })\n }\n transport.onmessage = (event) => {\n if (disposed) return\n const parsed = parseBrowserViewEvent(event.data)\n if (parsed !== null) dispatch(parsed)\n }\n transport.onerror = () => {\n // A close event always follows a failed handshake; reconnection is armed there.\n }\n transport.onclose = () => {\n if (socket === transport) socket = null\n if (disposed) return\n scheduleReconnect()\n }\n }\n\n connect()\n\n return {\n send(command: BrowserViewCommand): void {\n if (sendNow(command)) return\n pending.push(command)\n if (pending.length > PENDING_COMMAND_LIMIT) pending.shift()\n },\n close(): void {\n if (disposed) return\n disposed = true\n if (timer !== null) {\n clearTimer(timer)\n timer = null\n }\n const transport = socket\n socket = null\n setStatus('closed')\n if (transport !== null) {\n try {\n transport.close()\n } catch {\n // A transport that already failed may throw on close; nothing left to do.\n }\n }\n },\n status(): BrowserViewSocketStatus {\n return status\n },\n }\n}\n","/**\n * The browser view tab's content, mounted by the right sidebar into its\n * content area under the 'browser-view' tab type.\n *\n * The shell owns the column, the chip, the close control and the switch between\n * tabs; this file owns what is drawn inside one tab and scrolls inside it. It\n * therefore has no title bar of its own and no \"back\" control - a page header\n * in a sidebar tab would repeat the chip right above it - and it fills the\n * height it is given instead of positioning itself against the viewport.\n *\n * The body is laid out like the shipped browser tab's chrome: one 38px toolbar\n * holding the address display, the connection marker and the one control this\n * plugin actually has - refresh the captured frame - then the frame itself,\n * then the action trace. Nothing here claims a capability the host does not\n * expose: there is no forward/back pair, no reload of the page (the host drives\n * navigation, this side only observes it) and no \"open in a new window\",\n * because the page lives in a Chromium process on the host.\n *\n * The refresh control and the state marker are the product's own atoms -\n * IconRefreshOutlineRegular and StateDot from @deepseek-ai/dsh-client-ui-primitives,\n * the same two the shipped browser tab's toolbar uses - so the chrome is drawn\n * from one source rather than redrawn beside it. The package's Vite config\n * inlines @deepseek-ai packages, which is what lets the jsdom body tests load\n * that entry point (it imports its own stylesheets).\n *\n * Frame rendering: an <img> fed a base64 JPEG data URL, not a <canvas>. The host\n * already decoded and re-encoded the frame (CDP gives it JPEG base64), so there\n * are no pixels for this side to compose - a canvas would add a drawImage hop,\n * a context lifecycle and an invalidation race for zero gain, while the image\n * element decodes off the main thread and lets CSS own the aspect-ratio fit.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport {\n IconRefreshOutlineRegular,\n StateDot,\n type StateDotState,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { BrowserActionTrace, BrowserPanelState } from '../core/protocol.ts'\nimport { BROWSER_VIEW_API_VERSION } from '../core/protocol.ts'\nimport type { BrowserViewLiveTitleStore } from './live-title.ts'\nimport { BROWSER_VIEW_PARTS, BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport {\n connectBrowserViewSocket,\n type BrowserViewFrame,\n type BrowserViewSocket,\n type BrowserViewSocketHandlers,\n type BrowserViewSocketStatus,\n} from './socket.ts'\nimport css from './panel.module.css'\n\n/** Page-side socket factory; tests inject a fake transport through it. */\nexport type BrowserViewSocketFactory = (handlers: BrowserViewSocketHandlers) => BrowserViewSocket\n\n/** Business face injected into the tab body. */\nexport interface BrowserViewPanelFace {\n /** Session whose screencast this body shows. */\n readonly sessionId?: string\n /** Channel the chip reads this body's page title from. */\n readonly liveTitle?: BrowserViewLiveTitleStore\n}\n\n/** Panel props: the locale seat, the injected face, and the seams a test may supply. */\nexport type BrowserViewPanelProps = PropsLocale<'browser-view'> & Partial<BrowserViewPanelFace> & {\n /** Socket factory override; defaults to the real same-origin connection. */\n readonly socketFactory?: BrowserViewSocketFactory\n /** Origin override; defaults to the page's own location. */\n readonly location?: { readonly protocol: string; readonly host: string }\n}\n\n/** Trace rows kept on screen; older tool calls scroll out of relevance. */\nconst TRACE_LIMIT = 5\n\n/** State before the host publishes anything. */\nconst EMPTY_STATE: BrowserPanelState = { tabs: [], activeTabId: null, running: false }\n\n/** Join truthy class names (CSS Modules maps are typed as plain records). */\nfunction cx(...names: ReadonlyArray<string | false | null | undefined>): string {\n return names.filter((name): name is string => typeof name === 'string' && name.length > 0).join(' ')\n}\n\n/**\n * Render the browser view tab body.\n * @param props - composed slot props.\n * @returns the tab content.\n */\nexport function BrowserViewPanel({ t, sessionId, liveTitle, socketFactory, location }: BrowserViewPanelProps) {\n const [state, setState] = useState<BrowserPanelState>(EMPTY_STATE)\n const [frame, setFrame] = useState<BrowserViewFrame | null>(null)\n const [traces, setTraces] = useState<ReadonlyArray<BrowserActionTrace>>([])\n const [error, setError] = useState<{ readonly code: string; readonly message: string } | null>(null)\n const [status, setStatus] = useState<BrowserViewSocketStatus>('connecting')\n const socketRef = useRef<BrowserViewSocket | null>(null)\n /** Last active tab seen in a state push; a tab switch invalidates the picture. */\n const lastActiveTabRef = useRef<string | null>(null)\n /** Browser source seen in the last state push; a source switch invalidates it too. */\n const lastSourceRef = useRef<{ mode?: 'isolated' | 'cdp'; cdpEndpoint?: string }>({})\n\n const factory = useMemo<BrowserViewSocketFactory>(\n () => socketFactory ?? ((handlers) => connectBrowserViewSocket(handlers, { location, sessionId })),\n [socketFactory, location, sessionId],\n )\n\n useEffect(() => {\n const instance = factory({\n onStatus: (next) => { setStatus(next) },\n onState: (next) => {\n // Compare outside the state updater: an updater must stay pure. A frame\n // from the old browser source or the previous tab must not outlive it.\n const sourceChanged = lastSourceRef.current.mode !== next.mode\n || lastSourceRef.current.cdpEndpoint !== next.cdpEndpoint\n if (sourceChanged) {\n lastSourceRef.current = { mode: next.mode, cdpEndpoint: next.cdpEndpoint }\n lastActiveTabRef.current = next.activeTabId\n setFrame(null)\n setError(null)\n } else if (lastActiveTabRef.current !== next.activeTabId) {\n lastActiveTabRef.current = next.activeTabId\n setFrame(null)\n }\n setState(next)\n },\n onFrame: (next) => {\n setError(null)\n setFrame(next)\n },\n onAction: (trace) => {\n setTraces((current) => [trace, ...current].slice(0, TRACE_LIMIT))\n },\n onError: (code, message) => { setError({ code, message }) },\n })\n socketRef.current = instance\n return () => {\n socketRef.current = null\n instance.close()\n }\n }, [factory])\n\n const activeTab = state.tabs.find((tab) => tab.id === state.activeTabId) ?? null\n // Loading is per tab on the wire; the connection phase joins it so a page\n // that is still dialing never claims to be live.\n const loading = activeTab?.loading === true || status !== 'open'\n // The wire carries two failure channels: an explicit error push, and the\n // message a state push may use to say \"show this instead of a frame\". Both\n // land on the same block so the tab never shows a stale picture beside a host\n // complaint.\n const hostError = state.message !== undefined && state.message.length > 0\n ? { code: '', message: state.message }\n : null\n const effectiveError = error ?? hostError\n // One narrowed value for the stage: a frame is only paintable when the host\n // reported no error, which keeps the null check off the JSX branch.\n const visibleFrame = effectiveError === null ? frame : null\n const dataUrl = visibleFrame === null ? null : `data:image/jpeg;base64,${visibleFrame.data}`\n // The marker names what the viewer is actually looking at: the socket's phase\n // first (nothing is live before the host answers), then the page's own load\n // state. The same three strings the trace footer used to carry.\n const statusLabel = status !== 'open'\n ? t('panel.status.connecting')\n : loading ? t('panel.status.loading') : t('panel.status.live')\n // Three of the product's five dot states, in the order a viewer meets them:\n // nothing reached yet, a page still loading, a settled live picture.\n const dotState: StateDotState = status !== 'open' ? 'idle' : loading ? 'ongoing' : 'done'\n const modeLabel = state.mode === 'cdp' ? t('panel.mode.real') : t('panel.mode.isolated')\n const pageTitle = activeTab === null || activeTab.title.length === 0 ? undefined : activeTab.title\n const url = activeTab?.url ?? ''\n\n // The chip beside this tab names the page being streamed, and only this body\n // can know that name. Publishing in an effect keeps render pure; the cleanup\n // clears the entry so a closed tab leaves no stale name behind.\n useEffect(() => {\n liveTitle?.set(sessionId, pageTitle)\n return () => { liveTitle?.set(sessionId, undefined) }\n }, [liveTitle, sessionId, pageTitle])\n\n return (\n <div className={css.root} data-dsh-plugin={BROWSER_VIEW_PLUGIN} data-dsh-part={BROWSER_VIEW_PARTS.panel}>\n <div className={css.toolbar} data-dsh-part={BROWSER_VIEW_PARTS.toolbar}>\n <div className={css.addressBox} data-dsh-part={BROWSER_VIEW_PARTS.address}>\n <input\n className={css.address}\n type=\"text\"\n readOnly\n value={url}\n title={url.length > 0 ? url : undefined}\n placeholder={t('panel.url.empty')}\n aria-label={t('panel.address.label')}\n spellCheck={false}\n // Selecting on click is the address bar's own gesture: the whole\n // address is ready to copy without a second control.\n onFocus={(event) => { event.currentTarget.select() }}\n onClick={(event) => { event.currentTarget.select() }}\n />\n </div>\n <span\n className={css.status}\n data-dsh-part={BROWSER_VIEW_PARTS.status}\n aria-live=\"polite\"\n title={state.cdpEndpoint ?? modeLabel}\n >\n <StateDot state={dotState} size={10} />\n <span className={css.statusText}>{statusLabel}</span>\n <span className={css.mode}>{modeLabel}</span>\n {state.mode === 'cdp' && state.cdpEndpoint !== undefined && (\n <span className={css.endpoint}>{state.cdpEndpoint}</span>\n )}\n </span>\n <button\n type=\"button\"\n className={css.tool}\n title={t('panel.toolbar.refresh')}\n aria-label={t('panel.toolbar.refresh')}\n disabled={activeTab === null}\n onClick={() => {\n socketRef.current?.send({ v: BROWSER_VIEW_API_VERSION, kind: 'request-frame' })\n }}\n >\n <IconRefreshOutlineRegular />\n </button>\n </div>\n {state.tabs.length > 1 && (\n <div className={css.tabs} role=\"tablist\" data-dsh-part={BROWSER_VIEW_PARTS.tabs}>\n {state.tabs.map((tab) => (\n <button\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={tab.id === state.activeTabId}\n className={cx(css.tab, tab.id === state.activeTabId && css.tabActive)}\n title={tab.url}\n onClick={() => {\n socketRef.current?.send({ v: BROWSER_VIEW_API_VERSION, kind: 'select-tab', tabId: tab.id })\n }}\n >\n {tab.title.length > 0 ? tab.title : t('panel.tab.untitled')}\n </button>\n ))}\n </div>\n )}\n <div className={css.content}>\n {effectiveError !== null ? (\n <div className={css.error} data-dsh-part={BROWSER_VIEW_PARTS.error} role=\"alert\">\n <span className={css.errorTitle}>{t('panel.error.title')}</span>\n <span className={css.errorBody}>{effectiveError.message}</span>\n {effectiveError.code.length > 0 && <span className={css.errorCode}>{effectiveError.code}</span>}\n </div>\n ) : dataUrl === null || visibleFrame === null ? (\n <div className={css.empty} data-dsh-part={BROWSER_VIEW_PARTS.empty}>\n <span className={css.emptyTitle}>{t('panel.empty.title')}</span>\n <span className={css.emptyHint}>{t('panel.empty.hint')}</span>\n </div>\n ) : (\n <img\n className={css.frame}\n data-dsh-part={BROWSER_VIEW_PARTS.frame}\n src={dataUrl}\n alt={t('panel.frame.alt')}\n width={visibleFrame.width}\n height={visibleFrame.height}\n draggable={false}\n />\n )}\n </div>\n <footer className={css.trace} data-dsh-part={BROWSER_VIEW_PARTS.trace}>\n <div className={css.traceList}>\n {traces.length === 0\n ? <span className={css.traceIdle}>{t('panel.trace.idle')}</span>\n : traces.map((trace, index) => (\n <div key={`${trace.at}-${index}`} className={css.traceRow}>\n <span className={css.traceTool}>{trace.tool}</span>\n <span className={css.traceSummary}>{trace.summary}</span>\n </div>\n ))}\n </div>\n </footer>\n </div>\n )\n}\n","/**\n * The guide capsule's glyph: this plugin's own mark, not a product artwork.\n *\n * The right sidebar's guide lists one capsule per registered tab type and draws\n * the type's `icon` (a `ComponentType<IconProps>`) at 22px, or 26px beside a\n * description. Drawing locally keeps the plugin free of icon-set coupling: the\n * only thing borrowed is the IconProps shape, as a type, and the glyph itself\n * inherits its colour from the capsule through currentColor.\n *\n * It restates the mark the chip already uses - a browser\n * window with the agent's cursor inside - so a user who has seen one recognises\n * the other. It is deliberately not the shipped browser tab's artwork: this tab\n * is a different implementation and does not pass itself off as that one.\n */\nimport type { IconProps } from '@deepseek-ai/dsh-client-ui-primitives'\n\n/**\n * Render the guide glyph.\n * @param props - square edge in px (the guide passes 22 or 26) and a layout class.\n * @returns the window-and-cursor mark.\n */\nexport function BrowserViewGuideGlyph({ size = 16, className }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 16 16\"\n className={className}\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect x=\"1.75\" y=\"2.25\" width=\"12.5\" height=\"11.5\" rx=\"1.75\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <path d=\"M1.75 5.75h12.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <circle cx=\"3.9\" cy=\"4\" r=\"0.7\" fill=\"currentColor\" />\n <path d=\"M7.4 8.15l3.85 1.7-1.6.65-.7 1.65z\" fill=\"currentColor\" />\n </svg>\n )\n}\n","/**\n * The right-sidebar tab type this plugin contributes: its kind, its identity,\n * the navigation parameters it accepts, and the guide capsule that opens it.\n *\n * A tab type is registered in two stages. Stage one is a purely static\n * declaration (ctx.sidebarRightTabs.register) naming the kind, the chip's\n * initial text and the guide entry; stage two is the keyed 'sidebar.right.pane.tab'\n * body and 'sidebar.right.pane.tab.title' registration under this same id, which\n * is what the seat dispatches on. The kind is what openTabIn/openTab name, and\n * it is also the key of the params map below.\n *\n * The `guide` entry is what puts this type on the right sidebar's guide page -\n * the list a user sees when the column has no page in front. It is the one place\n * that opens the tab now that the conversation header carries no entry of its\n * own, and the guide owns the click:\n * it renders one capsule per registered entry and opens the entry's own `kind`\n * (GuideBody: tab.actions.openTab(entry.kind, { replaceTab: true })), so this\n * plugin declares the capsule and never wires a handler of its own. No\n * commandId is declared: the plugin registers no keyboard shortcut, and the\n * guide would draw a key hint the shortcut table cannot honour.\n *\n * The kind is deliberately NOT 'browser': the shipped\n * @deepseek-ai/dsh-client-ui-sidebar-browser registers that kind, and a\n * registration in the extension band takes a kind over, so reusing it would\n * shadow the shipped browser tab out of existence - the one thing this\n * package's AGENTS.md forbids. A distinct kind is what lets both live in the\n * same column.\n */\nimport type { SidebarRightTabDefinition } from '@deepseek-ai/dsh-client-ui-sidebar-right/client'\nimport { BrowserViewGuideGlyph } from './guide-icon.tsx'\nimport type { BrowserViewKey } from './locales.ts'\n\n/** What this plugin's tabs are, and what openTabIn/openTab name. */\nexport const BROWSER_VIEW_TAB_KIND = 'browser-view'\n\n/** This implementation's identity in the tab system; also the keyed slot dispatch key. */\nexport const BROWSER_VIEW_TAB_ID = '@linxin666/dsh-client-ui-browser-view'\n\n/** Identity of this type's capsule on the guide page, stable within the provider. */\nexport const BROWSER_VIEW_GUIDE_ENTRY_ID = 'open'\n\n/**\n * Position of this type's capsule among every registered type's entries. The\n * shipped browser tab sits at 30; this one follows it instead of competing for\n * the same slot, because it is a companion view rather than a replacement.\n */\nexport const BROWSER_VIEW_GUIDE_ENTRY_ORDER = 40\n\n/** Navigation parameters this tab type accepts. */\nexport interface BrowserViewTabParams {\n /** Chrome tab the pane should stream first, when the opener knows one. */\n readonly tabId?: string\n}\n\ndeclare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {\n interface SidebarRightTabParamsMap {\n /** Parameters of a browser-view page. */\n 'browser-view': BrowserViewTabParams\n }\n}\n\n/**\n * Build stage one of the registration.\n * @param t - translate function of this plugin's dictionary.\n * @returns the static tab type the registry keeps.\n */\nexport function browserViewTabDefinition(t: (key: BrowserViewKey) => string): SidebarRightTabDefinition {\n return {\n id: BROWSER_VIEW_TAB_ID,\n kind: BROWSER_VIEW_TAB_KIND,\n // A visited body stays mounted while another chip is in front, so the\n // screencast socket survives a tab switch instead of redialing the host.\n keepMounted: true,\n // A type from outside the product: the honest band, and the default one.\n priority: 'extension',\n title: () => t('tab.title'),\n guide: [{\n id: BROWSER_VIEW_GUIDE_ENTRY_ID,\n order: BROWSER_VIEW_GUIDE_ENTRY_ORDER,\n // Thunked, like the type's own title: a language switch needs no\n // re-registration, and the guide reads the copy again on every use.\n title: () => t('tab.title'),\n description: () => t('guide.description'),\n icon: BrowserViewGuideGlyph,\n }],\n }\n}\n","/**\n * The browser view's chip text.\n *\n * The shell owns the right-sidebar chip: its box, its close and hidden\n * controls, the active highlight and the switch between tabs. This component\n * draws only what sits inside it - the browser mark and the name - which is why\n * it carries no state of its own.\n *\n * The name prefers the page the body is streaming, read from the published\n * channel (live-title.ts), and falls back to this plugin's own name before the\n * first state push: a chip that says \"Checkout\" is more useful than one that\n * says \"Browser view\", but an empty chip is worse than either.\n */\nimport { useCallback, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { BrowserViewLiveTitleStore } from './live-title.ts'\nimport { BROWSER_VIEW_PARTS, BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport css from './panel.module.css'\n\n/** Business face injected into the chip. */\nexport interface BrowserViewTabTitleFace {\n /** Session whose tab this chip names. */\n readonly sessionId?: string\n /** Channel the body publishes the streamed page's title on. */\n readonly liveTitle?: BrowserViewLiveTitleStore\n}\n\n/** Chip props: the locale seat plus the injected face. */\nexport type BrowserViewTabTitleProps = PropsLocale<'browser-view'> & Partial<BrowserViewTabTitleFace>\n\n/**\n * Decorative browser-window mark; inline so the chip carries no icon dependency.\n * @returns the glyph.\n */\nfunction BrowserViewMark() {\n return (\n <svg className={css.tabTitleMark} viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <rect x=\"1.75\" y=\"2.25\" width=\"12.5\" height=\"11.5\" rx=\"1.75\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M1.75 5.75h12.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M7.4 8.15l3.85 1.7-1.6.65-.7 1.65z\" fill=\"currentColor\" />\n </svg>\n )\n}\n\n/**\n * Render the chip contents.\n * @param props - composed slot props.\n * @returns the mark and the tab's name.\n */\nexport function BrowserViewTabTitle({ t, sessionId, liveTitle }: BrowserViewTabTitleProps) {\n const subscribe = useCallback(\n (listener: () => void) => liveTitle?.subscribe(listener) ?? (() => {}),\n [liveTitle],\n )\n const read = useCallback(() => liveTitle?.get(sessionId), [liveTitle, sessionId])\n const pageTitle = useSyncExternalStore(subscribe, read, () => undefined)\n const label = pageTitle !== undefined && pageTitle.length > 0 ? pageTitle : t('tab.title')\n return (\n <span\n className={css.tabTitle}\n data-dsh-plugin={BROWSER_VIEW_PLUGIN}\n data-dsh-part={BROWSER_VIEW_PARTS.tabTitle}\n >\n <BrowserViewMark />\n <span className={css.tabTitleText}>{label}</span>\n </span>\n )\n}\n","import { useEffect, useState } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PluginConfigViewProps } from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport { BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport css from './config.module.css'\n\n/** Configuration-seat keys for standalone and aggregate bundle rows. */\nexport const BROWSER_VIEW_CONFIG_KEYS = [\n '@linxin666/dsh-client-ui-browser-view#ui-browser-view',\n '@linxin666/dsh-client-ui-browser-view#web-ui-browser-view',\n] as const\n\ninterface BrowserConfigValues {\n realBrowserEnabled?: unknown\n cdpEndpoint?: unknown\n idleCloseDays?: unknown\n}\n\n/** The row configuration form backed by the Host's volatile settings namespace. */\nexport function BrowserViewConfig({ t, view, form }: PropsLocale<'browser-view'> & PluginConfigViewProps) {\n const values = form?.state.value as BrowserConfigValues | undefined\n const enabled = values?.realBrowserEnabled === true\n const endpoint = typeof values?.cdpEndpoint === 'string' && values.cdpEndpoint.length > 0\n ? values.cdpEndpoint\n : 'http://127.0.0.1:9222'\n const idleDays = typeof values?.idleCloseDays === 'number' ? values.idleCloseDays : 3\n const [draft, setDraft] = useState(endpoint)\n const [idleDraft, setIdleDraft] = useState(String(idleDays))\n const [pending, setPending] = useState(false)\n const [failed, setFailed] = useState(false)\n useEffect(() => { setDraft(endpoint) }, [endpoint])\n useEffect(() => { setIdleDraft(String(idleDays)) }, [idleDays])\n if (view === 'summary') return t('config.summary')\n if (form === undefined || form.state.status !== 'ready') {\n return <p className={css.hint}>{t('config.unavailable')}</p>\n }\n const disabled = pending || !form.state.writable\n const mutate = async (ops: Parameters<typeof form.mutate>[0]): Promise<void> => {\n setPending(true)\n setFailed(false)\n try {\n const accepted = await form.mutate(ops, form.state.revision)\n if (!accepted) setFailed(true)\n } catch {\n setFailed(true)\n } finally {\n setPending(false)\n }\n }\n const commitEndpoint = async (): Promise<void> => {\n const next = draft.trim()\n if (next === endpoint || next === '') return\n await mutate([{ op: 'set', path: ['cdpEndpoint'], value: next }])\n }\n const commitIdleDays = async (): Promise<void> => {\n const next = Number(idleDraft.trim())\n if (!Number.isInteger(next) || next < 0 || next === idleDays) return\n await mutate([{ op: 'set', path: ['idleCloseDays'], value: next }])\n }\n return (\n <section className={css.root} data-dsh-plugin={BROWSER_VIEW_PLUGIN} aria-busy={pending}>\n <label className={css.switchRow}>\n <input\n type=\"checkbox\"\n role=\"switch\"\n checked={enabled}\n disabled={disabled}\n onChange={(event) => {\n void mutate([{ op: 'set', path: ['realBrowserEnabled'], value: event.currentTarget.checked }])\n }}\n />\n <span>{t('config.realBrowserEnabled')}</span>\n </label>\n <p className={css.hint}>{t('config.realBrowserEnabled.hint')}</p>\n <label className={css.field}>\n <span>{t('config.cdpEndpoint')}</span>\n <input\n type=\"text\"\n value={draft}\n disabled={disabled}\n spellCheck={false}\n onChange={(event) => { setDraft(event.currentTarget.value) }}\n onBlur={() => { void commitEndpoint() }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n />\n </label>\n <p className={css.hint}>{t('config.cdpEndpoint.hint')}</p>\n <label className={css.field}>\n <span>{t('config.idleCloseDays')}</span>\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={idleDraft}\n disabled={disabled}\n spellCheck={false}\n onChange={(event) => { setIdleDraft(event.currentTarget.value) }}\n onBlur={() => { void commitIdleDays() }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n />\n </label>\n <p className={css.hint}>{t('config.idleCloseDays.hint')}</p>\n {failed && <p className={css.error} role=\"alert\">{t('config.failed')}</p>}\n </section>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/RangeBubble.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Coarse adjustment for a bounded number: resting the pointer on the control\n * (or moving focus into it) raises a small bubble holding a slider across the\n * field's whole range, so a large change is one drag instead of many presses\n * or a retyped value. The control itself stays the precise entry.\n *\n * The bubble belongs to the anchor's subtree, so moving from the control onto\n * the bubble never counts as leaving. It opens after a short rest and closes a\n * moment after the pointer and focus have both gone, so crossing the control\n * on the way elsewhere does not flash it. While a drag is in progress the\n * bubble stays put even if the pointer strays off it.\n *\n * Dragging reports each value through `onInput`, so the field shows it live;\n * releasing the thumb, or a key press on it, reports `onCommit` once. The\n * bubble opens on the side of the control that has room inside the nearest\n * scrolling ancestor, so a row near the top of a settings page does not hang\n * its bubble under the page edge.\n */\n\nimport { useEffect, useRef, useState, type ChangeEvent, type CSSProperties, type KeyboardEvent, type ReactNode } from 'react'\nimport css from './settings-card.module.css'\n\n/** Rest on the control before the bubble opens. */\nconst OPEN_DELAY_MS = 220\n/** Grace after pointer and focus have left before the bubble closes. */\nconst CLOSE_DELAY_MS = 200\n/** Room the bubble needs between the control and the scroller's edge. */\nconst BUBBLE_ROOM_PX = 64\n\n/** Props of {@link RangeBubble}. */\nexport interface RangeBubbleProps {\n /** Lowest value the slider reaches. */\n min: number\n /** Highest value the slider reaches. */\n max: number\n /** Slider granularity. */\n step: number\n /** Current value; a value outside the range parks the thumb at the nearer end. */\n value: number\n /** Accessible name of the slider. */\n label: string\n /** Disables the bubble along with the control. */\n disabled?: boolean\n /** Each value while the thumb moves. */\n onInput: (value: number) => void\n /** The value the thumb was released on, once per drag or key press. */\n onCommit: (value: number) => void\n /** The precise control the bubble hangs off. */\n children: ReactNode\n}\n\n/** The nearest ancestor that scrolls vertically, or the viewport's root. */\nfunction scroller(node: HTMLElement): HTMLElement {\n for (let parent = node.parentElement; parent !== null; parent = parent.parentElement) {\n const overflow = getComputedStyle(parent).overflowY\n if (overflow === 'auto' || overflow === 'scroll') return parent\n }\n return node.ownerDocument.documentElement\n}\n\n/**\n * Render the control with its coarse-adjustment bubble.\n * @param props - the range, the value and the two report callbacks.\n * @returns the anchor holding the control and the bubble.\n */\nexport function RangeBubble(props: RangeBubbleProps): ReactNode {\n const { min, max, step, disabled = false } = props\n const [open, setOpen] = useState(false)\n const [side, setSide] = useState<'above' | 'below'>('above')\n const [live, setLive] = useState<number | null>(null)\n const anchorRef = useRef<HTMLDivElement | null>(null)\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const hovered = useRef(false)\n const focused = useRef(false)\n const dragging = useRef(false)\n\n useEffect(() => () => { clearTimeout(timer.current) }, [])\n useEffect(() => {\n if (disabled) {\n clearTimeout(timer.current)\n setOpen(false)\n }\n }, [disabled])\n\n const show = (): void => {\n const anchor = anchorRef.current\n if (anchor !== null) {\n const room = anchor.getBoundingClientRect().top - scroller(anchor).getBoundingClientRect().top\n setSide(room >= BUBBLE_ROOM_PX ? 'above' : 'below')\n }\n setOpen(true)\n }\n const schedule = (): void => {\n clearTimeout(timer.current)\n if (disabled) return\n if (hovered.current || focused.current || dragging.current) {\n if (!open) timer.current = setTimeout(show, focused.current ? 0 : OPEN_DELAY_MS)\n return\n }\n timer.current = setTimeout(() => { setOpen(false) }, CLOSE_DELAY_MS)\n }\n\n const commit = (value: number): void => {\n dragging.current = false\n setLive(null)\n props.onCommit(value)\n schedule()\n }\n const onChange = (event: ChangeEvent<HTMLInputElement>): void => {\n const value = Number(event.target.value)\n setLive(value)\n props.onInput(value)\n }\n const onKeyUp = (event: KeyboardEvent<HTMLInputElement>): void => {\n if (live !== null) commit(live)\n if (event.key === 'Escape') {\n clearTimeout(timer.current)\n setOpen(false)\n }\n }\n const shown = live ?? Math.min(max, Math.max(min, props.value))\n\n return (\n <div\n ref={anchorRef}\n className={css.rangeAnchor}\n onPointerEnter={() => { hovered.current = true; schedule() }}\n onPointerLeave={() => { hovered.current = false; schedule() }}\n onFocus={() => { focused.current = true; schedule() }}\n onBlur={(event) => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n focused.current = false\n if (live !== null) commit(live)\n else schedule()\n }}\n >\n {props.children}\n <div className={css.rangeBubble} data-open={open ? '' : undefined} data-side={side}>\n <input\n type=\"range\"\n className={css.rangeSlider}\n min={min}\n max={max}\n step={step}\n value={shown}\n aria-label={props.label}\n tabIndex={open ? 0 : -1}\n disabled={disabled}\n style={{ '--range-fill': `${((shown - min) / (max - min)) * 100}%` } as CSSProperties}\n onPointerDown={() => { dragging.current = true }}\n onPointerUp={(event) => { commit(Number(event.currentTarget.value)) }}\n onPointerCancel={(event) => { commit(Number(event.currentTarget.value)) }}\n onChange={onChange}\n onKeyUp={onKeyUp}\n />\n <span className={css.rangeEnds} aria-hidden=\"true\">\n <span>{min}</span>\n <span>{max}</span>\n </span>\n </div>\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/SegmentGroup.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * The family's segmented control: a quiet track whose options share one\n * highlight that slides to the pressed option, instead of each option fading\n * its own background out and the next one in. The settings fields' small\n * choices and the Web Extensions TAB strip both render through it, so the two\n * read as one control.\n *\n * The caller builds the option buttons and marks the pressed one with\n * `data-active`; the group measures that button after every render and writes\n * its box as four custom properties, and the stylesheet draws the highlight\n * there (`.segmentGroup[data-pill]::before`). Attribute and first placement\n * land in the same task, so the highlight appears in place and only later\n * changes slide. A ResizeObserver re-measures when the group or an option\n * changes size: a longer locale, a font arriving, a container growing, a\n * strip wrapping onto a second line.\n */\n\nimport { Children, useLayoutEffect, useRef, type HTMLAttributes, type ReactNode } from 'react'\nimport css from './settings-card.module.css'\n\n/** The attribute marking a group whose highlight has been placed. */\nconst PILL_ATTR = 'data-pill'\n/** The pressed option, relative to the group. */\nconst ACTIVE_SELECTOR = ':scope > [data-active]'\nconst PILL_PROPERTIES = ['--segment-pill-x', '--segment-pill-y', '--segment-pill-w', '--segment-pill-h'] as const\n\n/** Props of {@link SegmentGroup}: the track's own attributes and the option buttons. */\nexport interface SegmentGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** The option buttons; the pressed one carries `data-active`. */\n children: ReactNode\n}\n\n/**\n * Write the highlight's box from the pressed option's box, or take the\n * highlight off when nothing is pressed or the group has no layout yet.\n * The two boxes are read in viewport pixels and turned back into the group's\n * own CSS pixels, so a dialog that opens through a scale transform still\n * lands the highlight on its option.\n */\nfunction placePill(group: HTMLElement): void {\n const item = group.querySelector<HTMLElement>(ACTIVE_SELECTOR)\n const box = group.getBoundingClientRect()\n if (item === null || group.offsetWidth === 0 || box.width === 0) {\n group.removeAttribute(PILL_ATTR)\n for (const property of PILL_PROPERTIES) group.style.removeProperty(property)\n return\n }\n const scale = box.width / group.offsetWidth\n const itemBox = item.getBoundingClientRect()\n const values = [\n (itemBox.left - box.left) / scale - group.clientLeft,\n (itemBox.top - box.top) / scale - group.clientTop,\n itemBox.width / scale,\n itemBox.height / scale,\n ]\n values.forEach((value, index) => {\n group.style.setProperty(PILL_PROPERTIES[index], `${Math.round(value * 100) / 100}px`)\n })\n if (!group.hasAttribute(PILL_ATTR)) group.setAttribute(PILL_ATTR, '')\n}\n\n/**\n * Render a segmented track around the caller's option buttons.\n * @param props - the track's attributes (role, accessible name, key handler) and its options.\n * @returns the track.\n */\nexport function SegmentGroup(props: SegmentGroupProps): ReactNode {\n const { children, className, ...rest } = props\n const group = useRef<HTMLDivElement | null>(null)\n const count = Children.count(children)\n\n // Placed before the frame is painted, after every render: a press moves the\n // pressed mark and the highlight follows it in the same frame.\n useLayoutEffect(() => {\n if (group.current !== null) placePill(group.current)\n })\n\n useLayoutEffect(() => {\n const element = group.current\n if (element === null || typeof ResizeObserver === 'undefined') return undefined\n const observer = new ResizeObserver(() => { placePill(element) })\n observer.observe(element)\n for (const item of Array.from(element.children)) observer.observe(item)\n return () => { observer.disconnect() }\n }, [count])\n\n return (\n <div {...rest} ref={group} className={className === undefined ? css.segmentGroup : `${css.segmentGroup} ${className}`}>\n {children}\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/PluginSettingsCard.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family-shared chrome for plugin settings cards: a disclosure header naming\n * the plugin and what its settings govern, the controls inside, and the line\n * that reports a refused write. A pick is written the moment it is made and a\n * typed value after a pause, so the card has no save button and nothing waits\n * on the reader. Renders nothing while the namespace is unavailable — a\n * deployment that does not compose the owning plugin should show no trace of\n * it. Inlined into each consumer's client bundle; mirrors the official\n * ui-plugin-config PluginCard in a self-contained slice.\n *\n * Every field inside the body is one settings row: the label and its hint on\n * the left, the control on the right, a hairline between two rows; a narrow\n * card stacks the control under the text (settings-card.module.css).\n */\n\nimport { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport type { CardShell } from './settings-form.ts'\nimport { RangeBubble } from './RangeBubble.tsx'\nimport { SegmentGroup } from './SegmentGroup.tsx'\nimport css from './settings-card.module.css'\n\n/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */\nexport const CARD_COPY_KEYS = [\n 'settings.collapse',\n 'settings.expand',\n 'settings.notExposed',\n 'settings.readOnly',\n 'settings.saveFailed',\n] as const\n\n/**\n * What a text field inside a card reaches without its plugin wiring it: write\n * the pending draft now (Enter, leaving the field) or put it back (Escape).\n * Picks need neither; they are written the moment they are made.\n */\nconst CardApply = createContext<{ commit(): void, revert(): void } | null>(null)\n\n/** Copy key the card chrome itself reads. */\nexport type CardCopyKey = (typeof CARD_COPY_KEYS)[number]\n\n/** Key domain for the plugin's own copy (inferred per consumer). */\nexport type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey\n\n/** Card chrome shared by every plugin settings card. */\nexport interface PluginSettingsCardProps<TKey extends string = string> {\n /** Locale reader for this card's copy. */\n t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string\n /** Locale key of the plugin's name. */\n titleKey: TKey\n /** Locale key of the line describing what this plugin's settings govern. */\n descriptionKey: TKey\n /** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */\n descriptionNode?: ReactNode\n /**\n * Locale key of the full sentence behind a shortened description: when\n * present, the header's native `title` takes this text while the visible\n * line keeps `descriptionKey`/`descriptionNode`, so a compact card can\n * compress the sentence without keeping a second visible copy of it.\n * Defaults to the description key.\n */\n descriptionTitleKey?: TKey\n /**\n * Optional leading mark identifying the plugin. A card without one keeps the\n * plain official header shape, so the chrome stays a readable sibling of the\n * built-in PluginCard wherever a family plugin lands in the official bundle\n * seat.\n */\n icon?: ReactNode\n /** The card's form state: availability, writability, and how the last write went. */\n state: CardShell\n /** Write every pending draft now: a text field's Enter or blur. */\n onSave: () => void\n /** Drop every pending draft: a text field's Escape. */\n onDiscard: () => void\n /**\n * Id applied to the card's title element, so a header control (an immediate\n * toggle in `headerAction`) can name itself through `aria-labelledby`\n * instead of repeating the title as a string.\n */\n titleId?: string\n /**\n * Render the header only, with no body region. A card whose whole setting is\n * the header control (a switch whose explanation is the description) has no\n * controls to lay out below it, and an empty body would draw a divider line\n * with nothing under it.\n */\n headerOnly?: boolean\n /**\n * Render the controls expanded on arrival (still collapsible). Defaults to\n * true: promoted first-level sections show their settings immediately.\n */\n defaultOpen?: boolean\n /**\n * Render without the collapse affordance: a static header and an always\n * visible body. Used by first-level settings sections whose nav entry\n * already provides the selection.\n */\n alwaysOpen?: boolean\n /**\n * Hide the line under the body that reports a refused write: a card whose\n * body applies its own changes (an embedded external settings section)\n * reports its own failures.\n */\n hideFooter?: boolean\n /**\n * Optional control rendered at the header's trailing edge, before the\n * chevron. A card whose setting is one immediate flip (it\n * applies outside the card's form) puts its ToggleSwitch here, so the control\n * is reachable without opening the card and matches a plugin card's shape.\n */\n headerAction?: ReactNode\n /**\n * Render children even when the settings namespace is not exposed by the\n * host. The 'not exposed' notice still explains the card above them; a card\n * that wants the rows alone hides it through `hideNotExposedNotice`.\n */\n renderChildrenWhenNotExposed?: boolean\n /** Hide the 'not exposed' notice, whichever branch renders the card body. */\n hideNotExposedNotice?: boolean\n /**\n * Compact chrome for a topic card rendered inside another card's body: a\n * smaller title, a tighter header and body inset, and a one-line description\n * whose full text stays on the header's own title. Defaults to the\n * first-level chrome, which is unchanged.\n */\n density?: 'nested'\n /** The plugin's controls. */\n children: ReactNode\n}\n\n/** Length of the body's disclosure motion; it matches `--settings-card-motion` on the card root. */\nconst BODY_MOTION_MS = 180\n\n/**\n * Lifecycle of one card body. `collapsed` is the mounted-but-closed frame the\n * enter leg starts from, `entering` and `closing` are the two moving legs, and\n * `shown` is the settled open body, which releases its clipping box.\n */\ntype BodyPhase = 'hidden' | 'collapsed' | 'entering' | 'shown' | 'closing'\n\n/**\n * Render one plugin settings card.\n * @param props - the plugin's copy keys, its form state, and its controls.\n * @returns the card, or nothing while the namespace is still loading.\n */\nexport function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>) {\n const [open, setOpen] = useState(props.defaultOpen ?? true)\n const { state, alwaysOpen } = props\n const expanded = alwaysOpen === true || open\n const [bodyPhase, setBodyPhase] = useState<BodyPhase>(expanded ? 'shown' : 'hidden')\n const bodyRef = useRef<HTMLDivElement | null>(null)\n // Enter and leave run the same pair: a body that should open is mounted\n // closed for one frame so its transition has a state to leave, and a closing\n // one stays mounted until its leg has run.\n useLayoutEffect(() => {\n if (expanded) {\n if (bodyPhase === 'hidden') setBodyPhase('collapsed')\n else if (bodyPhase === 'collapsed') {\n const node = bodyRef.current\n if (node !== null) void node.offsetHeight\n setBodyPhase('entering')\n } else if (bodyPhase === 'closing') setBodyPhase('entering')\n return\n }\n if (bodyPhase === 'collapsed') setBodyPhase('hidden')\n else if (bodyPhase === 'entering' || bodyPhase === 'shown') setBodyPhase('closing')\n }, [expanded, bodyPhase])\n useEffect(() => {\n if (bodyPhase !== 'entering' && bodyPhase !== 'closing') return\n const timer = setTimeout(() => {\n setBodyPhase(bodyPhase === 'entering' ? 'shown' : 'hidden')\n }, BODY_MOTION_MS)\n return () => { clearTimeout(timer) }\n }, [bodyPhase])\n if (!state.available) return null\n const title = props.t(props.titleKey)\n const description = props.t(props.descriptionKey)\n const descriptionTitle = props.descriptionTitleKey === undefined ? description : props.t(props.descriptionTitleKey)\n const baseClass = expanded ? `${css.cardOpen} ${css.card}` : css.card\n const cardClass = props.density === 'nested' ? `${baseClass} ${css.cardNested}` : baseClass\n /** The body region both legs share; a hidden phase renders nothing at all. */\n const bodyRegion = (content: ReactNode) => bodyPhase === 'hidden'\n ? null\n : (\n <div className={css.disclosure} data-state={bodyPhase} ref={bodyRef}>\n <div className={css.body}>{content}</div>\n </div>\n )\n // With alwaysOpen the nav entry already provides the selection, so the\n // header is a static title row instead of a disclosure button.\n const header = alwaysOpen === true\n ? (\n <div className={css.headerStatic}>\n {props.icon !== undefined ? <span className={css.mark} aria-hidden=\"true\">{props.icon}</span> : null}\n <span className={css.headText}>\n <span className={css.name} id={props.titleId} title={title}>{title}</span>\n <span className={css.description} title={descriptionTitle}>{props.descriptionNode ?? description}</span>\n </span>\n {props.headerAction !== undefined ? <span className={css.headerAction}>{props.headerAction}</span> : null}\n </div>\n )\n : (\n <button\n type=\"button\"\n className={css.header}\n aria-expanded={open}\n aria-label={`${props.t(open ? 'settings.collapse' : 'settings.expand')}: ${title}`}\n onClick={() => { setOpen(!open) }}\n >\n {props.icon !== undefined ? <span className={css.mark} aria-hidden=\"true\">{props.icon}</span> : null}\n <span className={css.headText}>\n <span className={css.name} id={props.titleId} title={title}>{title}</span>\n <span className={css.description} title={descriptionTitle}>{props.descriptionNode ?? description}</span>\n </span>\n {props.headerAction !== undefined ? <span className={css.headerAction}>{props.headerAction}</span> : null}\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.chevron} ${css.chevronOpen}` : css.chevron}\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n )\n // The namespace exists but the Host does not serve it to this client (the\n // official settings allowlist omits third-party namespaces): show a card\n // that explains the gap instead of vanishing, so a missing card never\n // reads as a missing plugin. A card that keeps its rows anyway keeps the\n // same explanation above them, unless it hides the notice outright.\n const notExposedNotice = state.exposed || props.hideNotExposedNotice === true\n ? null\n : <p className={css.notExposed} role=\"status\">{props.t('settings.notExposed')}</p>\n if (!state.exposed && props.renderChildrenWhenNotExposed !== true) {\n return (\n <li className={cardClass}>\n {header}\n {bodyRegion(notExposedNotice)}\n </li>\n )\n }\n // A header-only card has no body region at all: the divider would otherwise\n // sit above an empty box.\n const bodyVisible = props.headerOnly !== true\n return (\n <li className={cardClass}>\n {header}\n {bodyVisible\n ? bodyRegion(\n <>\n {notExposedNotice}\n {!state.writable ? <p className={css.readOnly} role=\"status\">{props.t('settings.readOnly')}</p> : null}\n <CardApply.Provider value={{ commit: props.onSave, revert: props.onDiscard }}>\n {props.children}\n </CardApply.Provider>\n {props.hideFooter !== true && state.failed\n ? (\n <p className={css.failed} role=\"status\">\n {props.t('settings.saveFailed')}{state.failedReason ? ' - ' + state.failedReason : ''}\n </p>\n )\n : null}\n </>,\n )\n : null}\n </li>\n )\n}\n\n/** Props every field control needs regardless of its value type. */\nexport interface FieldProps {\n /** Stable id associating the label with its control. */\n id: string\n /** Visible label. */\n label: string\n /** One-line explanation rendered under the control. */\n hint: string\n /**\n * Full sentence behind the visible hint, exposed as the paragraph's native\n * `title` so a card can shorten the line without losing the text. Omitted:\n * the paragraph carries no title attribute at all.\n */\n hintTitle?: string\n /** Draft text this control renders. */\n text: string\n /** True when the field holds a user-layer entry over the inherited value. */\n overridden: boolean\n /** True when the draft is not a value this field accepts. */\n invalid: boolean\n /** Copy for the overridden badge. */\n overriddenLabel: string\n /** Copy for the reset control. */\n resetLabel: string\n /** Copy shown in place of the hint while the draft is invalid. */\n invalidLabel: string\n /** Disables every control (read-only document, or an unavailable namespace). */\n disabled: boolean\n /** Take new draft text; the card writes it as the field's entry rule says. */\n onEdit: (text: string) => void\n /** Clear the field at once so it re-inherits the composition layer. */\n onReset: () => void\n}\n\n/**\n * A typed value field. Its draft is written after a pause in typing, at once on\n * Enter or when focus leaves, and Escape puts the stored value back. `numeric`\n * only hints the keypad: which drafts a field accepts is decided by its spec.\n * A field given a `range` also offers the coarse slider bubble: dragging fills\n * the draft live and releasing writes it.\n */\nexport function ValueField(props: FieldProps & {\n /** Hints a numeric keypad without narrowing what the control accepts. */\n numeric?: boolean\n /** Placeholder shown while the draft is empty. */\n placeholder?: string\n /** Bounds of a numeric field, for the coarse slider; the spec still judges every draft. */\n range?: { min: number, max: number, step: number }\n}) {\n const apply = useContext(CardApply)\n // Enter and Escape settle the draft themselves and then leave the field, so\n // the blur they cause is that same settlement reaching the field's edge, not\n // a second write. Without this an Escape reported a discard and then a save,\n // which reads to a consumer as a write still waiting to happen.\n const settledByKey = useRef(false)\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (apply === null || (event.key !== 'Enter' && event.key !== 'Escape')) return\n event.preventDefault()\n settledByKey.current = true\n if (event.key === 'Enter') apply.commit()\n else apply.revert()\n event.currentTarget.blur()\n }\n const input = (\n <input\n id={props.id}\n className={props.invalid ? css.inputInvalid : css.input}\n type=\"text\"\n {...props.numeric === true ? { inputMode: 'numeric' as const } : {}}\n {...props.invalid ? { 'aria-invalid': true } : {}}\n value={props.text}\n placeholder={props.placeholder ?? ''}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n onKeyDown={onKeyDown}\n onFocus={() => { settledByKey.current = false }}\n onBlur={() => {\n if (settledByKey.current) {\n settledByKey.current = false\n return\n }\n apply?.commit()\n }}\n />\n )\n const { range } = props\n const typed = Number(props.text)\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {range === undefined\n ? input\n : (\n <RangeBubble\n min={range.min}\n max={range.max}\n step={range.step}\n value={props.text.trim() === '' || Number.isNaN(typed) ? range.min : typed}\n label={`${props.label} ${range.min}–${range.max}`}\n disabled={props.disabled}\n onInput={(value) => { props.onEdit(String(value)) }}\n onCommit={(value) => {\n props.onEdit(String(value))\n apply?.commit()\n }}\n >\n {input}\n </RangeBubble>\n )}\n <p className={props.invalid ? css.invalid : css.hint} title={props.hintTitle}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\nconst NON_SKIN_BODY_MARKERS = new Set(['dshSkinCenter', 'dshSidebarCollapsed'])\n// 检测使用使用皮肤,用了皮肤退回原生select样式,防止样式冲突。默认外观下使用优化后的select样式。\nfunction isSkinActive(): boolean {\n const datasetList = Object.keys(document.body.dataset)\n const isActive = datasetList.some(key => key.startsWith('dsh') && !NON_SKIN_BODY_MARKERS.has(key))\n return isActive\n}\n\ninterface SelectOption {\n value: string\n label: string\n}\n\nconst SELECT_CLOSE_MS = 100\n\n/**\n * The shared dual-mode select control. While an appearance skin is active it\n * renders the legacy native `<select>` untouched, so element-level skin\n * selectors keep working; under the default appearance it renders a\n * self-drawn `role=\"listbox\"` popup whose open/close is transition-animated.\n * Cards reach it through BooleanField/ChoiceField; editors outside a card\n * (the side-card prefs) bind it directly through onEdit.\n * 双模式下拉框:皮肤激活时用原生 select,默认外观用自绘动画弹层。\n */\nexport function SelectField(props: {\n id: string\n options: ReadonlyArray<SelectOption>\n value: string\n disabled: boolean\n invalid: boolean\n onEdit: (text: string) => void\n}) {\n const { id, options, value } = props\n const [open, setOpen] = useState(false)\n const [closing, setClosing] = useState(false)\n const [phase, setPhase] = useState<'initial' | 'open'>('initial')\n const [activeIndex, setActiveIndex] = useState(0)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const wrapRef = useRef<HTMLDivElement | null>(null)\n const popupRef = useRef<HTMLDivElement | null>(null)\n\n const currentIndex = () => {\n const index = options.findIndex(option => option.value === value)\n return index >= 0 ? index : 0\n }\n\n const close = useCallback(() => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n setClosing(true)\n closeTimer.current = setTimeout(() => {\n setClosing(false)\n setOpen(false)\n }, SELECT_CLOSE_MS)\n }, [])\n\n const openPopup = () => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n setActiveIndex(currentIndex())\n setPhase('initial')\n setClosing(false)\n setOpen(true)\n }\n\n const commit = (index: number) => {\n const option = options[index]\n if (option) props.onEdit(option.value)\n close()\n }\n\n const onTriggerClick = () => {\n if (props.disabled) return\n if (open && !closing) close()\n else openPopup()\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (props.disabled) return\n const count = options.length\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'Enter':\n case ' ':\n event.preventDefault()\n if (!open) {\n openPopup()\n } else if (!closing) {\n if (event.key === 'ArrowDown') setActiveIndex(index => (index + 1) % count)\n else if (event.key === 'ArrowUp') setActiveIndex(index => (index - 1 + count) % count)\n else commit(activeIndex)\n }\n break\n case 'Escape':\n if (open) {\n event.preventDefault()\n event.stopPropagation()\n close()\n }\n break\n case 'Tab':\n if (open) close()\n break\n }\n }\n\n useEffect(() => () => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n }, [])\n useLayoutEffect(() => {\n if (open && !closing && phase === 'initial') {\n void popupRef.current?.offsetHeight\n setPhase('open')\n }\n }, [open, closing, phase])\n\n useEffect(() => {\n if (!open) return\n const onPointerDown = (event: PointerEvent) => {\n const target = event.target\n if (target instanceof Node && !wrapRef.current?.contains(target)) close()\n }\n document.addEventListener('pointerdown', onPointerDown)\n return () => document.removeEventListener('pointerdown', onPointerDown)\n }, [open, close])\n\n useEffect(() => {\n if (props.disabled && open) close()\n }, [props.disabled, open, close])\n\n // 使用了皮肤则退回原生select样式防止样式冲突。\n if (isSkinActive()) {\n return (\n <select\n id={id}\n className={css.select}\n value={value}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n {options.map(option => (\n <option key={option.value} value={option.value}>{option.label}</option>\n ))}\n </select>\n )\n }\n\n const label = options.find(option => option.value === value)?.label ?? ''\n const popupClass = closing\n ? `${css.selectPopup} ${css.selectPopupClose}`\n : phase === 'open'\n ? `${css.selectPopup} ${css.selectPopupOpen}`\n : css.selectPopup\n return (\n <div className={css.selectWrap} ref={wrapRef}>\n <button\n type=\"button\"\n id={id}\n className={`${css.select} ${css.selectButton}`}\n disabled={props.disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-activedescendant={open ? `${id}-o${activeIndex}` : undefined}\n aria-invalid={props.invalid || undefined}\n onClick={onTriggerClick}\n onKeyDown={onKeyDown}\n >\n <span className={css.selectLabel}>{label}</span>\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.selectChevron} ${css.selectChevronOpen}` : css.selectChevron}\n aria-hidden=\"true\"\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n {open\n ? (\n <div className={popupClass} role=\"listbox\" ref={popupRef}>\n {options.map((option, index) => (\n <div\n key={option.value}\n id={`${id}-o${index}`}\n role=\"option\"\n aria-selected={option.value === value}\n className={`${css.selectOption}${option.value === value ? ` ${css.selectOptionSelected}` : ''}${index === activeIndex && !closing ? ` ${css.selectOptionActive}` : ''}`}\n onClick={() => { commit(index) }}\n >\n {option.label}\n </div>\n ))}\n </div>\n )\n : null}\n </div>\n )\n}\n\n/**\n * A visible segmented group for a small set of mutually exclusive values.\n * Every option stays on screen, so inherit/on/off and short enum fields take\n * one click without opening a popup. The pressed option carries the group's\n * sliding highlight and `aria-pressed`; the group takes the field label as its\n * accessible name.\n */\nexport function SegmentField(props: {\n id: string\n label: string\n options: ReadonlyArray<SelectOption>\n value: string\n disabled: boolean\n invalid: boolean\n onEdit: (text: string) => void\n}) {\n return (\n <SegmentGroup\n id={props.id}\n role=\"group\"\n aria-label={props.label}\n aria-invalid={props.invalid || undefined}\n >\n {props.options.map((option, index) => {\n const active = option.value === props.value\n return (\n <button\n key={option.value}\n type=\"button\"\n className={css.segment}\n aria-pressed={active}\n disabled={props.disabled}\n data-active={active ? '' : undefined}\n data-segment-index={index}\n onClick={() => {\n if (!active) props.onEdit(option.value)\n }}\n >\n {option.label}\n </button>\n )\n })}\n </SegmentGroup>\n )\n}\n\n/** How a small single-choice field presents its options. */\nexport type FieldPresentation = 'select' | 'segment'\n\n/** A boolean field: 继承 / 开 / 关. */\nexport function BooleanField(props: FieldProps & {\n /** Copy for the inherit option. */\n inheritLabel: string\n /** Copy for the on option. */\n onLabel: string\n /** Copy for the off option. */\n offLabel: string\n /** Defaults to the visible segments: the three answers always fit on one row. */\n presentation?: FieldPresentation\n}) {\n const segmented = props.presentation !== 'select'\n return (\n <div className={css.field}>\n <div className={css.head}>\n {segmented\n ? <span className={css.label}>{props.label}</span>\n : <label className={css.label} htmlFor={props.id}>{props.label}</label>}\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {segmented\n ? (\n <SegmentField\n id={props.id}\n label={props.label}\n options={[\n { value: '', label: props.inheritLabel },\n { value: 'true', label: props.onLabel },\n { value: 'false', label: props.offLabel },\n ]}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )\n : (\n <SelectField\n id={props.id}\n options={[\n { value: '', label: props.inheritLabel },\n { value: 'true', label: props.onLabel },\n { value: 'false', label: props.offLabel },\n ]}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )}\n <p className={css.hint} title={props.hintTitle}>{props.hint}</p>\n </div>\n )\n}\n\n/** An enumerated field, selecting or segmenting its small choice set. */\nexport function ChoiceField(props: FieldProps & {\n /** Copy for the inherit option (draft text is the empty string). */\n inheritLabel: string\n /** Choices rendered in order; `value` is the draft/stored text. */\n choices: ReadonlyArray<{ value: string; label: string }>\n /**\n * Visible segmented options for a short fixed set; defaults to the compact\n * select, which also suits a list whose length follows the deployment.\n */\n presentation?: FieldPresentation\n}) {\n const segmented = props.presentation === 'segment'\n const options = [{ value: '', label: props.inheritLabel }, ...props.choices]\n return (\n <div className={css.field}>\n <div className={css.head}>\n {segmented\n ? <span className={css.label}>{props.label}</span>\n : <label className={css.label} htmlFor={props.id}>{props.label}</label>}\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {segmented\n ? (\n <SegmentField\n id={props.id}\n label={props.label}\n options={options}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )\n : (\n <SelectField\n id={props.id}\n options={options}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )}\n <p className={props.invalid ? css.invalid : css.hint} title={props.hintTitle}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\n/**\n * A boolean toggle drawn as a switch track, for a setting that is only on or\n * off and applies on flip. It is a real button with\n * `role=\"switch\"` and `aria-checked`, so keyboard and assistive activation\n * arrive as a click and the state is announced instead of inferred from a\n * checkbox tick.\n *\n * The thumb bounces across only once the reader has pressed this switch: the\n * press writes the mark that arms the bounce, so a page opening, a TAB\n * switching back or a value arriving from elsewhere draws every thumb at rest.\n */\nexport function ToggleSwitch(props: {\n /** Id of the element naming the switch (the card's title). */\n labelledBy?: string\n /** Accessible name when no element labels it. */\n ariaLabel?: string\n /** Current state. */\n checked: boolean\n /** Disables the switch while a write is in flight or the Host refuses writes. */\n disabled?: boolean\n /** Called with the requested next state. */\n onChange: (next: boolean) => void\n}) {\n const [moved, setMoved] = useState(false)\n return (\n <button\n type=\"button\"\n className={css.toggle}\n role=\"switch\"\n aria-checked={props.checked}\n aria-labelledby={props.labelledBy}\n aria-label={props.labelledBy === undefined ? props.ariaLabel : undefined}\n disabled={props.disabled}\n data-moved={moved ? '' : undefined}\n onClick={() => {\n setMoved(true)\n props.onChange(!props.checked)\n }}\n >\n <span className={css.toggleTrack}><span className={css.toggleThumb} /></span>\n </button>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Form model behind the plugin settings card. Every control applies itself:\n * a pick (a segment, a select option, a reset) writes the moment it is made,\n * and typed text writes once typing pauses or the reader leaves the field.\n * Between the edit and the write the edit is held here as a draft, so what is\n * on screen is exactly what the write will store; a write the Host refuses\n * puts a pick back to the stored value and keeps typed text for correcting.\n * Family-shared slice inlined into each plugin's client bundle.\n */\n\nimport type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store'\n\n/** The write one field's draft text performs when it is applied. */\nexport type FieldWrite =\n | { kind: 'set'; value: unknown }\n | { kind: 'clear' }\n\n/** How one field converts between its stored value and its draft text. */\nexport interface FieldSpec {\n /** Field name inside the namespace section. */\n field: string\n /**\n * How the reader enters a value, which decides when it is written: a `pick`\n * is a whole value at once and applies immediately; `type` is text arriving\n * a keystroke at a time and applies once typing pauses or the field is left.\n */\n entry: 'pick' | 'type'\n /**\n * Whether the Host treats this field as a secret and redacts its value from\n * the read-back (role('secret') in the section schema). Redacted secrets are\n * never compared against the draft on save: the Host strips them from every\n * wire view layer, so the settled snapshot carries nothing to read back. A\n * staged secret set is judged by the mutation settling; the rest of its\n * batch, when one exists, is still judged by read-back, and the atomic\n * mutation lands every write or none.\n */\n secret?: boolean\n /** Render a stored value as draft text; the empty string when the section carries none. */\n format: (value: unknown) => string\n /**\n * The write this draft text performs, or undefined when the text is not a\n * value this field accepts — which holds the draft unwritten rather than\n * discarding it.\n */\n parse: (text: string) => FieldWrite | undefined\n}\n\n/** One field as the card renders it. */\nexport interface FieldState {\n /** Draft text the control renders. */\n text: string\n /** Whether the field leaves (or will leave) a user-layer entry. */\n overridden: boolean\n /** Whether the draft is not a value this field accepts, which holds it unwritten. */\n invalid: boolean\n}\n\n/** Form state every plugin settings card shares. */\nexport interface CardShell {\n /** False while the namespace is still loading; the card renders nothing. */\n available: boolean\n /**\n * Whether the namespace is actually served to this client. False when the\n * Host deployment does not expose it (e.g. the owning plugin's settings\n * domain is not mounted): the card renders an explanation\n * instead of its form, so a missing namespace never looks like a missing\n * plugin.\n */\n exposed: boolean\n /** Whether the Host document accepts writes. */\n writable: boolean\n /** Whether the form holds drafts not yet written (typed text waiting for its pause). */\n dirty: boolean\n /** Whether any draft is invalid, which holds it unwritten. */\n invalid: boolean\n /** Whether a write is crossing the wire. */\n saving: boolean\n /** Whether the last write did not land; cleared by the next edit or write. */\n failed: boolean\n /**\n * The rejection code/message the Host returned for the last failed save,\n * surfaced next to the generic failure text. Undefined while no save has\n * failed (or the failure carried no server reason).\n */\n failedReason?: string\n}\n\n/** The write actions the card's slot entry injects. */\nexport interface CardActions {\n /** Take draft text for one field; a pick writes at once, typed text after a pause. */\n edit: (field: string, text: string) => void\n /** Clear one field at once, so it re-inherits the composition layer. */\n resetField: (field: string) => void\n /** Write every pending draft now (a text field's Enter or blur), then re-seed from what the Host accepted. */\n save: () => void\n /** Drop every pending draft, putting each control back to the stored value (a text field's Escape). */\n discard: () => void\n}\n\n/** How long typed text rests before it is written. */\nexport const TYPE_PAUSE_MS = 600\n\n/** One field's staged edit. */\ninterface StagedEdit {\n /** Draft text the control renders. */\n text: string\n /** True when this edit clears the field whatever text it shows. */\n clear: boolean\n}\n\n/** One staged edit resolved into the write a save performs. */\ninterface PlannedWrite {\n /** Field this entry writes. */\n field: string\n /** The durable write this entry performs, inside the save's one atomic mutation. */\n op: BatchedWrite\n /**\n * Read the settled snapshot back and report whether the Host holds this\n * write's effect. Undefined when the draft is not a value the field\n * accepts: there is nothing to write, and the entry blocks the save.\n */\n judge: (() => boolean) | undefined\n}\n\n/** One durable write inside the save's atomic form mutation. */\nexport interface BatchedWrite {\n /** Field this entry writes. */\n field: string\n /** set stores a value; unset drops the leaf. */\n op: 'set' | 'unset'\n /** Value for op set (absent for unset). */\n value?: unknown\n}\n\n/** Constraints a numeric field's accepted drafts must satisfy, mirroring the host schema. */\nexport interface NumberConstraints {\n /** The accepted value must be a whole number. */\n integer?: boolean\n /** The accepted value must be at least this. */\n min?: number\n}\n\n/** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints stays unwritten. */\nexport function numberField(field: string, constraints: NumberConstraints = {}): FieldSpec {\n const { integer = false, min } = constraints\n return {\n field,\n entry: 'type',\n format: value => typeof value === 'number' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n const parsed = Number(trimmed)\n if (!Number.isFinite(parsed)) return undefined\n if (integer && !Number.isInteger(parsed)) return undefined\n if (min !== undefined && parsed < min) return undefined\n return { kind: 'set', value: parsed }\n },\n }\n}\n\n/**\n * A free-text field. An empty draft clears the field. `entry` is `pick` when\n * the text arrives whole from a picker (a preset or a reasoning level).\n */\nexport function textField(field: string, entry: FieldSpec['entry'] = 'type'): FieldSpec {\n return {\n field,\n entry,\n format: value => typeof value === 'string' ? value : '',\n parse: (text) => {\n const trimmed = text.trim()\n return trimmed === '' ? { kind: 'clear' } : { kind: 'set', value: trimmed }\n },\n }\n}\n\n/**\n * A free-text field the Host treats as a secret and redacts from the read-back\n * (role('secret') in the section schema). The card still edits it like text,\n * but a save never compares the redacted value back: the staged set is judged\n * by the mutation settling (see {@link FieldSpec.secret}).\n */\nexport function secretField(field: string): FieldSpec {\n return { ...textField(field), secret: true }\n}\n\n/** A boolean field, edited through true/false draft text. */\nexport function booleanField(field: string): FieldSpec {\n return {\n field,\n entry: 'pick',\n format: value => typeof value === 'boolean' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n if (trimmed === 'true') return { kind: 'set', value: true }\n if (trimmed === 'false') return { kind: 'set', value: false }\n return undefined\n },\n }\n}\n\n/** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */\nexport function choiceField(field: string, choices: readonly string[]): FieldSpec {\n return {\n field,\n entry: 'pick',\n format: value => typeof value === 'string' && choices.includes(value) ? value : '',\n parse: (text) => {\n if (text === '') return { kind: 'clear' }\n return choices.includes(text) ? { kind: 'set', value: text } : undefined\n },\n }\n}\n\n/**\n * Applies one card's edits to one settings namespace as the reader makes them.\n *\n * The Host is the only authority on whether a value was accepted — its\n * validators own the constraints no schema can express — so the outcome is\n * read back from the section rather than predicted here. A write that did not\n * land puts each pick back to the stored value, the way a switch that could not\n * flip springs back, and keeps typed text so the reader can correct it instead\n * of retyping.\n */\nexport class CardForm<T> {\n private readonly specs: Map<string, FieldSpec>\n private readonly staged = new Map<string, StagedEdit>()\n private readonly listeners = new Set<() => void>()\n /** The form subscription installed in the constructor; released by dispose(). */\n private readonly disposeForm: () => void\n private disposed = false\n /** The pending write of typed text, waiting for typing to pause. */\n private typePause: ReturnType<typeof setTimeout> | undefined\n private saving = false\n /** A save asked for while one was in flight; it runs once the first settles (#1754). */\n private saveQueued = false\n private failed = false\n private failedReason: string | undefined\n\n /** @param scope - the bound configuration form for this card's namespace. */\n constructor(\n private readonly scope: ConfigForm<T>,\n specs: FieldSpec[],\n ) {\n this.specs = new Map(specs.map(spec => [spec.field, spec]))\n this.disposeForm = scope.subscribe(() => { this.publish() })\n }\n\n /**\n * Release the form subscription and every bound store listener. The card\n * must call this on teardown; later calls are no-ops.\n */\n dispose(): void {\n if (this.disposed) return\n this.disposed = true\n clearTimeout(this.typePause)\n this.disposeForm()\n this.listeners.clear()\n }\n\n /** Publish a projection of this form, rebuilt whenever the form or a draft changes. */\n bind<S>(project: () => S): SnapshotStore<S> {\n const store = createSnapshotStore(project())\n this.listeners.add(() => { store.set(project()) })\n return store\n }\n\n /** Read the card-level state: what the Host serves, and what is still waiting to be written. */\n shell(): CardShell {\n const snapshot = this.scope.getSnapshot()\n const plan = this.plan()\n return {\n available: snapshot.status !== 'loading',\n exposed: snapshot.status === 'ready',\n writable: snapshot.writable,\n dirty: plan.length > 0,\n invalid: plan.some(item => item.judge === undefined),\n saving: this.saving,\n failed: this.failed,\n ...this.failedReason === undefined ? {} : { failedReason: this.failedReason },\n }\n }\n\n /** Read one field's state from the effective section and its staged draft. */\n field(field: string): FieldState {\n const spec = this.specOf(field)\n const staged = this.staged.get(field)\n if (staged === undefined) {\n return { text: spec.format(this.sectionValue(field)), overridden: this.stored(field), invalid: false }\n }\n const write = staged.clear ? { kind: 'clear' as const } : spec.parse(staged.text)\n return {\n text: staged.text,\n overridden: write?.kind === 'set',\n invalid: write === undefined,\n }\n }\n\n /** The actions the card's slot registration injects. */\n actions(): CardActions {\n return {\n edit: (field, text) => { this.stage(field, { text, clear: false }) },\n resetField: (field) => {\n this.stage(field, { text: this.specOf(field).format(this.baseValue(field)), clear: true })\n },\n save: () => { this.applyNow() },\n discard: () => {\n clearTimeout(this.typePause)\n if (this.staged.size === 0 && !this.failed) return\n this.staged.clear()\n this.failed = false\n this.failedReason = undefined\n this.publish()\n },\n }\n }\n\n /**\n * Run one write, and re-run it once if another was asked for while this one\n * was still in flight.\n *\n * A write is a Host round trip that also drives the profile reconcile, and\n * the Host runs it inside one exclusive transaction. Answering an edit that\n * arrives mid-flight by returning immediately dropped it with no explanation\n * (#1754). Serializing instead means an edit made while another write is\n * still settling is written against the settled state.\n * @returns settlement after the mutation and the read-back.\n */\n async requestSave(): Promise<void> {\n if (this.saving) {\n this.saveQueued = true\n return\n }\n await this.save()\n if (!this.saveQueued) return\n this.saveQueued = false\n await this.requestSave()\n }\n\n /**\n * Write every valid draft in one atomic form mutation, then re-seed from\n * what the Host accepted. A draft the field does not accept stays on screen,\n * unwritten, without holding the others back.\n *\n * The batch rides one mutate, so cross-field validate hooks (baseURL+model)\n * judge it as a unit: the Host either applies every write or refuses the\n * batch. The form contract answers a refusal or a skipped write with `false`\n * (it recovers with a fresh Host view instead of throwing), so the outcome is\n * judged twice: the answer itself, and then the settled snapshot read back\n * one planned write at a time. One missed write fails the whole batch. A\n * transport that rejects instead (the dsh-web bridge controller on a dead\n * connection) reports through the same failure path with its rejection\n * message. A batch that did not land puts its picks and clears back to the\n * stored value and keeps its typed text, so the reader can correct it.\n * @returns settlement after the mutation and the read-back.\n */\n async save(): Promise<void> {\n const plan = this.plan()\n const valid = plan.filter((item): item is PlannedWrite & { judge: () => boolean } => item.judge !== undefined)\n if (valid.length === 0 || this.saving) return\n // Snapshot the staged entries this write carries, so an edit staged while\n // it is in flight (which replaces the same key) survives: only settle the\n // key when the entry is still the one this write started from.\n const pending = new Map<string, StagedEdit | undefined>()\n for (const item of valid) pending.set(item.field, this.staged.get(item.field))\n this.saving = true\n this.failed = false\n this.failedReason = undefined\n this.publish()\n // One atomic namespace mutation: the form contract takes ordered path\n // operations, so the whole staged batch is validated, persisted, and\n // recovered together — either every write lands or none does.\n const ops: Array<{ op: 'set'; path: string[]; value: string | number | boolean } | { op: 'unset'; path: string[] }> = valid.map(item => item.op.op === 'set'\n ? { op: 'set', path: [item.field], value: (item.op as { value: string | number | boolean }).value }\n : { op: 'unset', path: [item.field] })\n let failedReason: string | undefined\n let accepted = false\n try {\n accepted = await this.scope.mutate(ops)\n } catch (error) {\n failedReason = error instanceof Error ? error.message : String(error)\n }\n // `false` is the contract's refusal/skip answer, and the form still\n // resolves after a refusal (it recovers with a fresh view), so the answer\n // alone is not enough: judge every planned write against the settled\n // snapshot as well. The mutation is atomic, so one missed write fails the\n // whole save and keeps the drafts.\n const landed = accepted && failedReason === undefined && valid.every(item => item.judge())\n for (const [field, before] of pending) {\n if (this.staged.get(field) !== before) continue\n if (landed || before === undefined || before.clear || this.specOf(field).entry === 'pick') this.staged.delete(field)\n }\n this.saving = false\n this.failed = !landed\n // A refused or unlanded batch carries no server reason: the card surfaces\n // its generic failure copy; a rejecting transport (the bridge) adds its\n // message.\n this.failedReason = failedReason\n this.publish()\n }\n\n /**\n * Every staged edit a write would carry. An entry whose draft is not a value\n * its field accepts carries no write: the form is still dirty, and the draft\n * stays on screen rather than being dropped. A staged edit that matches the\n * effective section is not a write at all.\n * @returns the planned writes, in the order the fields were staged.\n */\n private plan(): PlannedWrite[] {\n const plan: PlannedWrite[] = []\n for (const [field, staged] of this.staged) {\n const spec = this.specOf(field)\n if (staged.clear) {\n if (this.stored(field)) plan.push({ field, op: { field, op: 'unset' }, judge: () => this.landedUnset(field) })\n continue\n }\n if (staged.text === spec.format(this.sectionValue(field))) continue\n const write = spec.parse(staged.text)\n if (write === undefined) plan.push({ field, op: { field, op: 'unset' }, judge: undefined })\n else if (write.kind === 'clear') plan.push({ field, op: { field, op: 'unset' }, judge: () => this.landedUnset(field) })\n else plan.push({ field, op: { field, op: 'set', value: write.value }, judge: () => this.landedSet(field, write.value) })\n }\n return plan\n }\n\n /**\n * Read-back judgment for a planned set: the user layer must hold the\n * intended value once the mutation has settled.\n */\n private landedSet(field: string, value: unknown): boolean {\n // A redacted secret never appears in any wire view layer: the Host strips\n // role('secret') fields and reports them through a sidecar the form\n // snapshot does not expose, so there is nothing to compare the draft\n // against. Settling is the only signal the form has; the rest of the\n // batch, when one exists, still carries the atomic verdict by read-back.\n if (this.specOf(field).secret) return true\n return this.userLayer()?.[field] === value\n }\n\n /**\n * Read-back judgment for a planned unset: the field must be gone from the\n * user layer once the mutation has settled.\n */\n private landedUnset(field: string): boolean {\n return !this.stored(field)\n }\n\n /**\n * Take one edit and schedule its write: a pick or a clear is written now,\n * typed text once typing has rested for TYPE_PAUSE_MS.\n */\n private stage(field: string, edit: StagedEdit): void {\n this.staged.set(field, edit)\n this.failed = false\n this.failedReason = undefined\n this.publish()\n if (edit.clear || this.specOf(field).entry === 'pick') {\n this.applyNow()\n return\n }\n clearTimeout(this.typePause)\n this.typePause = setTimeout(() => { this.applyNow() }, TYPE_PAUSE_MS)\n }\n\n /** Write every pending draft now, taking the place of a waiting pause. */\n private applyNow(): void {\n clearTimeout(this.typePause)\n this.typePause = undefined\n if (this.disposed) return\n void this.requestSave()\n }\n\n private specOf(field: string): FieldSpec {\n const spec = this.specs.get(field)\n // Every call site names a field this card declared; a missing one is a\n // wiring mistake that must not degrade into a silently inert control.\n if (spec === undefined) throw new Error(`settings card has no field ${field}`)\n return spec\n }\n\n private snapshotOf(): ConfigFormSnapshot<T> {\n return this.scope.getSnapshot()\n }\n\n private sectionValue(field: string): unknown {\n return (this.snapshotOf().value as Record<string, unknown> | undefined)?.[field]\n }\n\n private baseValue(field: string): unknown {\n return (this.snapshotOf().base as Record<string, unknown> | undefined)?.[field]\n }\n\n private userLayer(): Record<string, unknown> | undefined {\n return this.snapshotOf().user as Record<string, unknown> | undefined\n }\n\n private stored(field: string): boolean {\n const user = this.userLayer()\n return user !== undefined && Object.hasOwn(user, field)\n }\n\n private publish(): void {\n for (const listener of this.listeners) listener()\n }\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-entry-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-entry-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family settings form bound to the profile entry id a Host actually serves.\n *\n * Under the 0.1.7 settings model a form is addressed by PROFILE ENTRY ID, while\n * a family card knows only its own settings namespace. The family binder\n * (`ctx.get('webUiSettings')`, published by dsh-web-settings) resolves one onto\n * the other and is the preferred transport; this module is the fallback for a\n * page that serves no binder — the group plugin is not installed, or its client\n * half has not applied yet (the aggregate mounts its children in order, and a\n * child still waiting on its own injects publishes nothing).\n *\n * The shared describe mirror is the only local evidence of which row id this\n * profile serves, but it answers asynchronously: at plugin activation it usually\n * holds nothing yet. A one-shot guess therefore cannot be right for every\n * deployment, and the form is bound once per session:\n *\n * - binding the bare namespace made every save answer `No configurable plugin\n * entry \"<namespace>\"` on an aggregate install (the namespace is not an entry\n * id there), which the card reported as \"the deployment did not accept these\n * values\";\n * - binding the aggregate row id would break a standalone install, whose row id\n * is the namespace or the package's own `ui-*` row.\n *\n * So the fallback starts on the most likely row and REBINDS the moment the\n * mirror names one of this package's rows. Until the mirror answers, the form\n * reports the binding it holds (usually `loading`), which the card renders as an\n * unavailable form rather than a doomed one.\n */\nimport type { ConfigForm, ConfigFormSnapshot, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client'\n\n/** Options of {@link createServedEntryForm}. */\nexport interface ServedEntryFormOptions<_T> {\n /** The shared configuration forms service (`ctx.configForms`). */\n forms: ConfigForms\n /**\n * Profile entry ids this package's rows carry, most likely first: the\n * aggregate's generated row, the package's own standalone row, then the bare\n * namespace. The first is the fallback while the mirror has no answer; the\n * last is the answer when the mirror serves none of them.\n */\n entryIds: readonly string[]\n}\n\n/** The snapshot a form reports before the Host has answered with this entry. */\nfunction pendingSnapshot<T>(): ConfigFormSnapshot<T> {\n return {\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n }\n}\n\n/**\n * Create a settings form bound to the profile entry id this Host serves, and\n * rebound whenever the shared describe mirror names a different one of this\n * package's rows.\n * @param options - the shared forms service and this package's candidate row ids.\n * @returns a form delegating to the currently resolved entry's own form.\n */\nexport function createServedEntryForm<T>(options: ServedEntryFormOptions<T>): ConfigForm<T> {\n const { forms, entryIds } = options\n const fallbackId = entryIds[0]\n const namespaceId = entryIds[entryIds.length - 1]\n const listeners = new Set<() => void>()\n let boundId: string | undefined\n let bound: ConfigForm<T> | undefined\n let offBound: (() => void) | undefined\n let snapshot: ConfigFormSnapshot<T> = pendingSnapshot<T>()\n\n /** Republish: the delegated snapshot when one is bound, the pending one otherwise. */\n const publish = (): void => {\n if (bound !== undefined) snapshot = bound.getSnapshot()\n for (const listener of [...listeners]) listener()\n }\n\n /**\n * The entry id the mirror currently justifies. An unanswered or empty mirror\n * is not evidence of absence, so it keeps the first candidate; a mirror that\n * answers without any of this package's rows leaves the namespace itself.\n * @returns the entry id to bind.\n */\n const resolve = (): string => {\n let served: readonly string[] | undefined\n try {\n served = forms.describe().getSnapshot().view?.namespaces.map(row => row.ns)\n } catch {\n // A mirror that refuses the read is unanswered too, not absent.\n served = undefined\n }\n if (served === undefined || served.length === 0) return fallbackId\n return entryIds.find(id => served.includes(id)) ?? namespaceId\n }\n\n /** Bind (or rebind) the resolved entry's form; a no-op while it is unchanged. */\n const bind = (): void => {\n const target = resolve()\n if (target === boundId) return\n offBound?.()\n offBound = undefined\n let form: ConfigForm<T>\n try {\n form = forms.get<T>(target)\n } catch {\n // A service that refuses the id stays unbound; the next mirror answer\n // retries rather than pinning a wrong entry for the session.\n boundId = undefined\n return\n }\n boundId = target\n bound = form\n offBound = form.subscribe(() => { publish() })\n publish()\n }\n\n // The mirror subscription lives for the page: the card owns its form for the\n // session, and the ConfigForm contract carries no disposer to hang it on. The\n // callback is cheap (a resolve plus a no-op while the id is unchanged). A\n // mirror without a subscription seat keeps the initial binding.\n try {\n forms.describe().subscribe(() => { bind() })\n } catch {\n // A describe face that refuses the subscription: the initial binding stands.\n }\n bind()\n\n return {\n getSnapshot: () => snapshot,\n subscribe: (listener) => {\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n },\n set: (field, value) => bound?.set(field, value) ?? Promise.resolve(false),\n unset: (field) => bound?.unset(field) ?? Promise.resolve(false),\n mutate: (ops, expectedRevision) => bound?.mutate(ops, expectedRevision) ?? Promise.resolve(false),\n }\n}\n","/**\n * The real-browser CDP settings card for the Web Extensions plugin list.\n * @module @linxin666/dsh-client-ui-browser-view/client/settings-card\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { PluginSettingsCard, BooleanField, ValueField } from './PluginSettingsCard.tsx'\nimport { CardForm, booleanField, numberField, textField, type CardActions, type CardShell, type FieldState } from './settings-form.ts'\nimport { createServedEntryForm } from './settings-entry-form.ts'\nimport { BrowserViewGuideGlyph } from './guide-icon.tsx'\n\n/** Fields shared with the host's real-browser schema. */\nexport interface BrowserViewSettings {\n realBrowserEnabled?: boolean\n cdpEndpoint?: string\n idleCloseDays?: number\n}\n\n/** Card projection bound by the renderer. */\nexport interface BrowserViewSettingsCardState extends CardShell {\n realBrowserEnabled: FieldState\n cdpEndpoint: FieldState\n idleCloseDays: FieldState\n}\n\n/** Registration-side snapshot and write actions. */\nexport interface BrowserViewSettingsCardFace extends CardActions {\n hooks: {\n browserViewSettingsCard: SnapshotStore<BrowserViewSettingsCardState>\n }\n}\n\n/** Bind the existing browser-view namespace, never a second settings document. */\nexport function bindBrowserViewSettingsForm(ctx: ClientContext): ConfigForm<BrowserViewSettings> {\n return createServedEntryForm<BrowserViewSettings>({\n forms: ctx.configForms,\n entryIds: ['web-ui-browser-view', 'ui-browser-view', 'browser-view'],\n })\n\n}\n\n/** Bridge the native volatile form onto the shared staged card form. */\nexport class BrowserViewSettingsCardController {\n private readonly form: CardForm<BrowserViewSettings>\n private readonly store: SnapshotStore<BrowserViewSettingsCardState>\n\n constructor(scope: ConfigForm<BrowserViewSettings>) {\n this.form = new CardForm(scope, [\n booleanField('realBrowserEnabled'),\n textField('cdpEndpoint'),\n numberField('idleCloseDays', { integer: true, min: 0 }),\n ])\n this.store = this.form.bind(() => this.projection())\n }\n\n private projection(): BrowserViewSettingsCardState {\n return {\n ...this.form.shell(),\n realBrowserEnabled: this.form.field('realBrowserEnabled'),\n cdpEndpoint: this.form.field('cdpEndpoint'),\n idleCloseDays: this.form.field('idleCloseDays'),\n }\n }\n\n inject(): BrowserViewSettingsCardFace {\n return { hooks: { browserViewSettingsCard: this.store }, ...this.form.actions() }\n }\n\n dispose(): void {\n this.form.dispose()\n }\n}\n\n/** Props supplied by the Web Extensions plugin-item seat. */\nexport type BrowserViewSettingsCardProps =\n PropsRuntime<'web-ui.plugin.item'>\n & PropsLocale<'browser-view'>\n & InjectFace<BrowserViewSettingsCardFace>\n\n/** Render the real-browser card with the same chrome and field semantics as its siblings. */\nexport function BrowserViewSettingsCard(props: BrowserViewSettingsCardProps) {\n const { t } = props\n const state = props.useBrowserViewSettingsCard(snapshot => snapshot)\n const shared = {\n overriddenLabel: t('settings.overridden'),\n resetLabel: t('settings.reset'),\n invalidLabel: t('settings.invalidValue'),\n disabled: !state.writable,\n }\n return (\n <PluginSettingsCard\n t={t}\n titleKey=\"settings.title\"\n descriptionKey=\"settings.description\"\n icon={<BrowserViewGuideGlyph size={18} />}\n defaultOpen={false}\n state={state}\n onSave={props.save}\n onDiscard={props.discard}\n >\n <BooleanField\n id=\"settings-browser-view-real\"\n label={t('settings.enabled')}\n hint={t('settings.enabledHint')}\n inheritLabel={t('settings.inherit')}\n onLabel={t('settings.on')}\n offLabel={t('settings.off')}\n {...shared}\n {...state.realBrowserEnabled}\n onEdit={(text) => { props.edit('realBrowserEnabled', text) }}\n onReset={() => { props.resetField('realBrowserEnabled') }}\n />\n <ValueField\n id=\"settings-browser-view-endpoint\"\n label={t('settings.cdpEndpoint')}\n hint={t('settings.cdpEndpointHint')}\n placeholder=\"http://127.0.0.1:9222\"\n {...shared}\n {...state.cdpEndpoint}\n onEdit={(text) => { props.edit('cdpEndpoint', text) }}\n onReset={() => { props.resetField('cdpEndpoint') }}\n />\n <ValueField\n id=\"settings-browser-view-idle-days\"\n label={t('settings.idleCloseDays')}\n hint={t('settings.idleCloseDaysHint')}\n placeholder=\"3\"\n numeric\n {...shared}\n {...state.idleCloseDays}\n onEdit={(text) => { props.edit('idleCloseDays', text) }}\n onReset={() => { props.resetField('idleCloseDays') }}\n />\n </PluginSettingsCard>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/plugin-card-seat.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family plugin-card seat.\n *\n * A family plugin contributes its settings card to whichever plugin-card seat\n * the running host actually renders:\n *\n * - `web-ui.plugin.item` — the list seat declared by the dsh-web-settings\n * group section (this family's own first-level \"Web UI plugins\" section);\n * - `plugins.bundle.config` — the official keyed seat of the harness's plugin\n * manager page, keyed by the bundle's package name and rendered on that\n * bundle's page. alpha.2 removed the `settings.plugin.item` keyed seat of the\n * `ui-settings-plugins` tab that this helper used before, so a card keyed by\n * its settings namespace has no seat to land in any more.\n *\n * SEAT SELECTION IS NOT A DECLARATION PROBE. The official plugin surface\n * belongs to the harness bundle and declares its seats before any external\n * plugin's `apply()` runs, so \"is the official seat declared?\" answers yes even\n * in the deployment whose whole point is the family group. Choosing on that\n * probe sends every family card to the official page and leaves the group's own\n * section permanently empty — the family of reports where the section renders\n * its heading and zero cards.\n *\n * The signal that actually distinguishes the two deployments is whether\n * dsh-web-settings is loaded: it is the package that owns the group section and\n * it publishes the `webUiSettings` service during `apply()`, which every\n * family plugin already reads for its settings form. Group loaded -> the family\n * seat; group absent -> the official seat.\n *\n * The decision is re-evaluated on every `slots/changed` because the group may\n * apply after this plugin (the family aggregate orders it first, a profile that\n * installs the group separately need not): the initial contribution goes to the\n * official seat, then moves to the family seat the moment the group's section\n * registers. The entry is disposed before the replacement is registered, so a\n * card is never in two seats at once.\n *\n * The shared tree has no client-SDK dependency, so this module reads its\n * context through the structural shape below; callers pass the plugin's own\n * `ctx`.\n */\n\n/** The family list seat key. */\nexport const FAMILY_PLUGIN_CARD_SEAT = 'web-ui.plugin.item'\n\n/** The official keyed plugin-card seat key (the alpha.2 bundle-configuration seat). */\nexport const OFFICIAL_PLUGIN_CARD_SEAT = 'plugins.bundle.config'\n\n/** The service dsh-web-settings publishes while it is loaded. */\nexport const FAMILY_GROUP_SERVICE = 'webUiSettings'\n\n/** The slot-registry member this helper uses (structurally satisfied by ctx.slots). */\nexport interface PluginCardSlots {\n /** Contribution of one card entry. */\n register(options: never, component: never): unknown\n /** Declaration probe: a target seat may appear after this plugin applies. */\n spec?(key: string): unknown\n}\n\n/** The slice of the client context a card contribution needs. */\nexport interface PluginCardContext {\n slots: PluginCardSlots\n /** Service lookup; absent on a context double that only models the slots. */\n get?(name: string): unknown\n /** Event subscription seat; absent on an event-less test double. */\n on?(event: never, listener: never): unknown\n}\n\n/** Owner share of a family list-seat card (that seat supplies nothing). */\nexport interface SettingsPluginItemOwnerProps {\n /** Marker field: card owner props are intentionally empty. */\n children?: never\n}\n\n/** One family plugin's card contribution. */\nexport interface PluginCardSeat {\n /**\n * Npm package name of the bundle this card configures; the official keyed\n * seat dispatches on it. Every family package ships its own bundle patch, so\n * a standalone install lists that package as the bundle whose page renders\n * this card.\n */\n bundle: string\n /** Family list-seat entry id. */\n id: string\n /** Family list-seat sort order. */\n order?: number\n /** Family list-seat display label; the official keyed seat carries none. */\n label?: () => string\n /** Locale namespace the card renders with. */\n locale: string\n /**\n * Child slots this card declares and renders. Forwarded to whichever seat\n * the host renders; absent for a card that declares none.\n */\n children?: Record<string, unknown>\n /** Business-face factory of the registration. */\n inject?: () => object\n /**\n * The card component. Its props type is the seat's composed shape, which is\n * chosen at runtime, so the helper takes it erased; the registrant keeps its\n * own precise typing at the call site.\n */\n component: unknown\n}\n\n/**\n * Whether the family group (dsh-web-settings) is loaded in this page. The\n * service is the group package's own contract, so the probe cannot be fooled\n * by a harness release that starts declaring the official seat differently.\n */\nexport function familyGroupLoaded(ctx: PluginCardContext): boolean {\n const get = ctx.get\n if (typeof get !== 'function') return false\n try {\n return get.call(ctx, FAMILY_GROUP_SERVICE) !== undefined\n } catch {\n // A context that refuses the lookup: treat the group as absent, which\n // falls back to the official seat the harness declares.\n return false\n }\n}\n\n/** Report a refused registration instead of leaving the user with no card. */\nfunction warnRefusedSeat(seat: string, error: unknown): void {\n try {\n console.warn(`[dsh-web] plugin card registration into \"${seat}\" was refused; the card will not render`, error)\n } catch {\n // Best-effort console write; a failed warning must not break the plugin.\n }\n}\n\n/**\n * Contribute one family plugin card to the seat this host renders, following\n * the group if it loads later. The entry is disposed and re-registered on a\n * seat change, never duplicated.\n * @param ctx - client context (its slot registry decides the seat).\n * @param seat - the card contribution.\n */\nexport function installPluginCard(ctx: PluginCardContext, seat: PluginCardSeat): void {\n const slots = ctx.slots\n const component = seat.component as never\n const inject = seat.inject as never\n\n let dispose: (() => void) | undefined\n let current: string | undefined\n /**\n * Re-entrancy latch. The registry emits a change event synchronously from\n * inside both `register` and the previous entry's disposer, so an unguarded\n * reconcile would re-enter itself mid-move and register the card twice into\n * the seat it is leaving (\"already has an entry for key ...\").\n */\n let reconciling = false\n\n /** Reconcile the contribution with the currently live seat (no-op when unchanged). */\n const reconcile = (): void => {\n if (reconciling) return\n const target = familyGroupLoaded(ctx) ? FAMILY_PLUGIN_CARD_SEAT : OFFICIAL_PLUGIN_CARD_SEAT\n if (current === target) return\n // The group's child seat can be declared after this card applies (the\n // parent mounts its pages through the extension service). Wait for the\n // declaration instead of logging a refused registration on every boot.\n if (typeof slots.spec === 'function' && slots.spec(target) === undefined) return\n reconciling = true\n const previous = dispose\n dispose = undefined\n current = undefined\n previous?.()\n try {\n dispose = slots.register((target === FAMILY_PLUGIN_CARD_SEAT\n ? {\n name: FAMILY_PLUGIN_CARD_SEAT,\n id: seat.id,\n ...(seat.order === undefined ? {} : { order: seat.order }),\n ...(seat.label === undefined ? {} : { label: seat.label }),\n locale: seat.locale,\n ...(seat.children === undefined ? {} : { children: seat.children }),\n ...(seat.inject === undefined ? {} : { inject }),\n }\n : {\n name: OFFICIAL_PLUGIN_CARD_SEAT,\n key: seat.bundle,\n locale: seat.locale,\n ...(seat.children === undefined ? {} : { children: seat.children }),\n ...(seat.inject === undefined ? {} : { inject }),\n }) as never, component) as () => void\n current = target\n } catch (error) {\n warnRefusedSeat(target, error)\n } finally {\n reconciling = false\n }\n }\n\n if (typeof ctx.on === 'function') {\n try {\n ctx.on('slots/changed' as never, (() => { reconcile() }) as never)\n } catch {\n // An event seat that refuses the subscription leaves the initial\n // decision in place; the card still renders in the seat chosen below.\n }\n }\n // The initial decision: the group, when it is already loaded (the aggregate\n // order), otherwise the official seat the harness declares.\n reconcile()\n}\n","/**\n * Browser-half entry for the browser-view plugin - runs inside the dsh web GUI.\n *\n * The browser view is a tab in the official right sidebar, beside the\n * conversation, not a page that takes the whole window. It contributes exactly\n * the seats a tab type needs, and only those:\n * - `sidebarRightTabs.register` (stage one): the static tab type - its id, its\n * kind ('browser-view'), the band it ranks in, the chip's initial text and the\n * guide capsule that opens it from the column's own tab strip.\n * - 'sidebar.right.pane.tab' + 'sidebar.right.pane.tab.title' (stage two, one\n * keyed registration each under the SAME id): the tab's body and its chip\n * contents, which is exactly the shape the shipped terminal tab uses.\n *\n * The session-header shortcut is deliberately gone: the column's tab strip and\n * the guide capsule already open the tab, so a second entry in the conversation\n * header only crowded that row.\n *\n * `main` and 'sidebar.panellist' are deliberately NOT registered any more: the\n * first took the whole center column over, and the second put a row in the\n * shell's global panel list that addressed that column. A right-sidebar tab\n * needs neither.\n *\n * The two slot seats go through `ctx.slots.inject` so the contribution waits for\n * the owning plugin to declare the seat: load order between this plugin and the\n * sidebar plugin therefore does not matter, and a shell that cannot serve a seat\n * simply leaves the surface absent.\n *\n * Export discipline (packages/AGENTS.md): the /client surface carries only what\n * cordis loading needs plus types.\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale) and its\n// LocaleNamespaceMap merge table.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the renderer's ctx.slots merge (the slot registry).\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\n// Type-only: merges the Plugins page's row-configuration seat contract.\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\n// Type-only: pulls the sidebar service's Context merge (ctx.sidebarRightTabs) and\n// the two pane SlotMap declarations it owns.\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client'\nimport { createLiveTitleStore } from './live-title.ts'\nimport { en, zh, type BrowserViewKey } from './locales.ts'\nimport { BrowserViewPanel } from './panel.tsx'\nimport { BROWSER_VIEW_TAB_ID, browserViewTabDefinition } from './tab-type.ts'\nimport { BrowserViewTabTitle } from './tab-title.tsx'\nimport { BROWSER_VIEW_CONFIG_KEYS, BrowserViewConfig } from './config.tsx'\nimport { bindBrowserViewSettingsForm, BrowserViewSettingsCard, BrowserViewSettingsCardController } from './BrowserViewSettingsCard.tsx'\nimport { installPluginCard } from './plugin-card-seat.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Browser-view surface copy. */\n 'browser-view': BrowserViewKey\n }\n\n interface SlotMap {\n /** The Web Extensions plugin card seat. */\n 'web-ui.plugin.item': { kind: 'list'; scope: 'root'; owner: { children?: never } }\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'browser-view'\n\n/** Services required by this plugin. */\nexport const inject = ['slots', 'locale', 'sidebarRightTabs', 'configForms', 'remote']\n\n/**\n * Register the browser-view tab type and its surfaces.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'browser-view: dictionaries')\n\n // The tab type's chip text and the guide capsule's copy are resolved on every\n // read, so the thunk below must translate at call time rather than bake a\n // language in at boot.\n let translate: ((key: BrowserViewKey) => string) | undefined\n try {\n translate = ctx.locale.bind(NS)\n } catch {\n // A locale face that cannot bind leaves the chip on its source-language copy.\n }\n const copy = (key: BrowserViewKey): string => translate?.(key) ?? zh[key]\n\n // Stage one: the static type. Without it an open of this kind throws, so the\n // registration is the seat everything else depends on - the column's tab strip\n // and its guide capsule both read this definition to offer the tab.\n ctx.effect(() => {\n try {\n return ctx.sidebarRightTabs.register(browserViewTabDefinition(copy))\n } catch {\n return () => {}\n }\n }, 'browser-view: tab type')\n\n // The one channel between the tab body and its own chip: the body learns the\n // streamed page's title, the chip shows it.\n const liveTitle = createLiveTitleStore()\n\n // Stage two, body: the tab's content, under the type's own id.\n ctx.slots.inject('sidebar.right.pane.tab', () => {\n try {\n return ctx.slots.register(\n {\n name: 'sidebar.right.pane.tab',\n key: BROWSER_VIEW_TAB_ID,\n locale: NS,\n inject: (sessionId: string) => ({ sessionId, liveTitle }),\n },\n BrowserViewPanel,\n )\n } catch {\n return () => {}\n }\n })\n\n // Stage two, title: the chip's contents, same key, same face.\n ctx.slots.inject('sidebar.right.pane.tab.title', () => {\n try {\n return ctx.slots.register(\n {\n name: 'sidebar.right.pane.tab.title',\n key: BROWSER_VIEW_TAB_ID,\n locale: NS,\n inject: (sessionId: string) => ({ sessionId, liveTitle }),\n },\n BrowserViewTabTitle,\n )\n } catch {\n return () => {}\n }\n })\n\n // The Host schema supplies values; this seat makes them reachable from the\n // bundle row in the Plugins page for both standalone and aggregate mounts.\n ctx.slots.inject('plugins.row.config', () => {\n const disposers: Array<() => void> = []\n for (const key of BROWSER_VIEW_CONFIG_KEYS) {\n try {\n disposers.push(ctx.slots.register({ name: 'plugins.row.config', key, locale: NS }, BrowserViewConfig))\n } catch {\n // A host without the row still keeps the browser-view surfaces.\n }\n }\n return () => { for (const dispose of disposers) dispose() }\n })\n\n // The same volatile form also renders as a card in Web Extensions. The helper\n // migrates it between the family list and the official bundle config seat.\n const settingsCard = new BrowserViewSettingsCardController(bindBrowserViewSettingsForm(ctx))\n installPluginCard(ctx, {\n bundle: '@linxin666/dsh-client-ui-browser-view',\n id: 'browser-view',\n order: 95,\n locale: NS,\n inject: () => settingsCard.inject(),\n component: BrowserViewSettingsCard,\n })\n ctx.effect(() => () => { settingsCard.dispose() }, 'browser-view: settings card')\n}\n\nexport type { BrowserViewPanelFace, BrowserViewPanelProps, BrowserViewSocketFactory } from './panel.tsx'\nexport type { BrowserViewLiveTitleStore } from './live-title.ts'\nexport type { BrowserViewTabParams } from './tab-type.ts'\nexport type { BrowserViewTabTitleFace, BrowserViewTabTitleProps } from './tab-title.tsx'\nexport type { BrowserViewFrame, BrowserViewSocketStatus } from './socket.ts'\nexport type { BrowserViewKey } from './locales.ts'\n"],"mappings":";;;;;;;;;;;;;;;EAwCA,SAAgB,uBAAkD;GAChE,MAAM,yBAAS,IAAI,IAAoB;GACvC,MAAM,4BAAY,IAAI,IAAgB;GACtC,MAAM,eAAqB;IAEzB,KAAK,MAAM,YAAY,CAAC,GAAG,SAAS,GAAG,SAAS;GAClD;GACA,OAAO;IACL,IAAI,WAAmD;KACrD,OAAO,cAAc,KAAA,IAAY,KAAA,IAAY,OAAO,IAAI,SAAS;IACnE;IACA,IAAI,WAA+B,OAAiC;KAClE,IAAI,cAAc,KAAA,GAAW;KAC7B,MAAM,UAAU,OAAO,IAAI,SAAS;KACpC,IAAI,UAAU,KAAA,KAAa,MAAM,WAAW,GAAG;MAC7C,IAAI,YAAY,KAAA,GAAW;MAC3B,OAAO,OAAO,SAAS;MACvB,OAAO;MACP;KACF;KACA,IAAI,YAAY,OAAO;KACvB,OAAO,IAAI,WAAW,KAAK;KAC3B,OAAO;IACT;IACA,UAAU,UAAkC;KAC1C,UAAU,IAA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GAGvC,IAAI,MAAM,OAAO,gCAAgC;IAC/C,IAAI;KACF,OAAO,IAAI,MAAM,SACf;MACE,MAAM;MACN,KAAK;MACL,QAAQ;MACR,SAAS,eAAuB;OAAE;OAAW;MAAU;KACzD,GACA,gBACF;IACF,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;GAGD,IAAI,MAAM,OAAO,sCAAsC;IACrD,IAAI;KACF,OAAO,IAAI,MAAM,SACf;MACE,MAAM;MACN,KAAK;MACL,QAAQ;MACR,SAAS,eAAuB;OAAE;OAAW;MAAU;KACzD,GACA,mBACF;IACF,QAAQ;KACN,aAAa,CAAC;IAChB;GACF,CAAC;GAID,IAAI,MAAM,OAAO,4BAA4B;IAC3C,MAAM,YAA+B,CAAC;IACtC,KAAK,MAAM,OAAO,0BAChB,IAAI;KACF,UAAU,KAAK,IAAI,MAAM,SAAS;MAAE,MAAM;MAAsB;MAAK,QAAQ;KAAG,GAAG,iBAAiB,CAAC;IACvG,QAAQ,CAER;IAEF,aAAa;KAAE,KAAK,MAAM,WAAW,WAAW,QAAQ;IAAE;GAC5D,CAAC;GAID,MAAM,eAAe,IAAI,kCAAkC,4BAA4B,GAAG,CAAC;GAC3F,kBAAkB,KAAK;IACrB,QAAQ;IACR,IAAI;IACJ,OAAO;IACP,QAAQ;IACR,cAAc,aAAa,OAAO;IAClC,WAAW;GACb,CAAC;GACD,IAAI,mBAAmB;IAAE,aAAa,QAAQ;GAAE,GAAG,6BAA6B;EAClF"}
|
|
1
|
+
{"version":3,"file":"client.js","names":["css","StateDot","IconRefreshOutlineRegular","css","css","css","Children","css","css"],"sources":["../../../packages/dsh-browser-view/src/client/live-title.ts","../../../packages/dsh-browser-view/src/client/locales.ts","../../../packages/dsh-browser-view/src/core/protocol.ts","../../../packages/dsh-browser-view/src/client/semantic.ts","../../../packages/dsh-browser-view/src/client/socket.ts","../../../packages/dsh-browser-view/src/client/panel.tsx","../../../packages/dsh-browser-view/src/client/guide-icon.tsx","../../../packages/dsh-browser-view/src/client/tab-type.ts","../../../packages/dsh-browser-view/src/client/tab-title.tsx","../../../packages/dsh-browser-view/src/client/config.tsx","../../../packages/dsh-browser-view/src/client/RangeBubble.tsx","../../../packages/dsh-browser-view/src/client/SegmentGroup.tsx","../../../packages/dsh-browser-view/src/client/PluginSettingsCard.tsx","../../../packages/dsh-browser-view/src/client/settings-form.ts","../../../packages/dsh-browser-view/src/client/settings-entry-form.ts","../../../packages/dsh-browser-view/src/client/BrowserViewSettingsCard.tsx","../../../packages/dsh-browser-view/src/client/plugin-card-seat.ts","../../../packages/dsh-browser-view/src/client/index.ts"],"sourcesContent":["/**\n * The page title the tab body last saw, published for the tab's chip.\n *\n * The chip is drawn by the shell beside a body this plugin owns, so the two\n * cannot exchange props: the body learns the streamed page's title from its\n * socket, and the title component reads it here. A chip that says \"Browser\n * view\" for a session whose page is called \"Checkout\" is the worse of the two\n * labels, so the body publishes and the title prefers what it published.\n *\n * One browser-view tab per session is what the kind declares (no `multiple`),\n * so the session id alone identifies the entry: there is no second tab whose\n * title could overwrite the first one's.\n */\n\n/** Cross-component title channel, keyed by session. */\nexport interface BrowserViewLiveTitleStore {\n /**\n * The last published title for a session.\n * @param sessionId - session key, or undefined when the component has none.\n * @returns the title, or undefined when nothing is published.\n */\n get(sessionId: string | undefined): string | undefined\n /**\n * Publish a session's page title, or clear it with undefined or an empty one.\n * @param sessionId - session key, or undefined to drop the write.\n * @param title - the page title, or undefined when the page has none.\n */\n set(sessionId: string | undefined, title: string | undefined): void\n /**\n * Observe publications.\n * @param listener - synchronous invalidation callback.\n * @returns unsubscribe.\n */\n subscribe(listener: () => void): () => void\n}\n\n/**\n * Create one store for the plugin's lifetime.\n * @returns the channel.\n */\nexport function createLiveTitleStore(): BrowserViewLiveTitleStore {\n const titles = new Map<string, string>()\n const listeners = new Set<() => void>()\n const notify = (): void => {\n // Copy first: a listener may unsubscribe while being notified.\n for (const listener of [...listeners]) listener()\n }\n return {\n get(sessionId: string | undefined): string | undefined {\n return sessionId === undefined ? undefined : titles.get(sessionId)\n },\n set(sessionId: string | undefined, title: string | undefined): void {\n if (sessionId === undefined) return\n const current = titles.get(sessionId)\n if (title === undefined || title.length === 0) {\n if (current === undefined) return\n titles.delete(sessionId)\n notify()\n return\n }\n if (current === title) return\n titles.set(sessionId, title)\n notify()\n },\n subscribe(listener: () => void): () => void {\n listeners.add(listener)\n return () => {\n listeners.delete(listener)\n }\n },\n }\n}\n","/**\n * Locale dictionaries for the browser-view plugin. `zh` is the key-set source\n * of truth; `en` keeps a full key-for-key mirror (packages/AGENTS.md bilingual\n * rules). Registered through ctx.locale.register(NS, { zh, en }); the components\n * read every string through the injected `t` seat, so no copy is hardcoded in\n * JSX.\n *\n * The page-title keys are gone with the page header: a right-sidebar tab is\n * named by the shell's chip, and the chip's text comes from the tab type and\n * the published page title instead ('panel.title' / 'panel.close' had no\n * reader left once the \"back to the conversation\" control was removed).\n *\n * 'panel.tabs.empty' went with the always-drawn tab strip: the controlled\n * browser's chips now appear only when it holds more than one page, so there is\n * no empty strip left to caption.\n */\n\n/** Simplified Chinese dictionary (key-set source of truth). */\nexport const zh = {\n 'tab.title': '浏览器视图',\n 'guide.description': '看 agent 正在操作的网页',\n 'panel.tab.untitled': '未命名页面',\n 'panel.url.empty': '还没有打开页面',\n 'panel.address.label': '页面地址',\n 'panel.toolbar.refresh': '刷新画面',\n 'panel.frame.alt': 'agent 正在操作的页面画面',\n 'panel.empty.title': '还没有画面',\n 'panel.empty.hint': '让 agent 打开一个页面后,这里会实时显示它正在看的网页。',\n 'panel.error.title': '浏览器视图出错',\n 'panel.trace.idle': '暂无工具动作',\n 'panel.status.connecting': '正在连接',\n 'panel.status.loading': '加载中',\n 'panel.status.live': '实时',\n 'panel.mode.isolated': '隔离浏览器',\n 'panel.mode.real': '真实浏览器',\n 'config.summary': '真实浏览器 CDP 连接设置',\n 'config.realBrowserEnabled': '使用真实浏览器(CDP)',\n 'config.realBrowserEnabled.hint': '开启后,所有 DSH 会话都能操作此浏览器中的全部标签页。',\n 'config.cdpEndpoint': 'CDP 地址',\n 'config.cdpEndpoint.hint': '仅支持本机 loopback;Chrome 136+ 默认 profile 不支持远程调试。',\n 'config.idleCloseDays': '闲置关闭(天)',\n 'config.idleCloseDays.hint': 'DSH 自己打开的页面超过这个天数没有工具动作会被自动关闭;接管的真实页面不在此列,0 表示不关闭。',\n 'config.unavailable': '设置暂不可用',\n 'config.failed': '设置保存失败,请重试',\n 'settings.title': '真实浏览器',\n 'settings.description': '使用本机 Chrome / Edge 的登录状态与全部标签页。',\n 'settings.enabled': '启用 CDP 接管',\n 'settings.enabledHint': '开启后,所有 DSH 会话都能读取和操作此浏览器中的全部标签页。',\n 'settings.cdpEndpoint': 'CDP 地址',\n 'settings.cdpEndpointHint': '仅限本机 loopback;Chrome 136+ 默认 profile 不支持远程调试。',\n 'settings.idleCloseDays': '闲置自动关闭(天)',\n 'settings.idleCloseDaysHint': 'DSH 自己打开的页面超过这个天数没有工具动作就自动关闭;接管的真实页面不在此列,0 表示关闭该能力。',\n 'settings.inherit': '继承',\n 'settings.on': '开启',\n 'settings.off': '关闭',\n 'settings.overridden': '已覆盖',\n 'settings.reset': '重置',\n 'settings.invalidValue': '取值无效',\n 'settings.collapse': '收起',\n 'settings.expand': '展开',\n 'settings.notExposed': '此部署未提供该插件设置。',\n 'settings.readOnly': '只读',\n 'settings.saveFailed': '保存失败',\n}\n\n/** The browser-view namespace key union. */\nexport type BrowserViewKey = keyof typeof zh\n\n/** English dictionary, key-for-key complete against zh. */\nexport const en: Record<BrowserViewKey, string> = {\n 'tab.title': 'Browser view',\n 'guide.description': 'Watch the page the agent is driving',\n 'panel.tab.untitled': 'Untitled page',\n 'panel.url.empty': 'No page open yet',\n 'panel.address.label': 'Page address',\n 'panel.toolbar.refresh': 'Refresh the frame',\n 'panel.frame.alt': 'Live view of the page the agent is driving',\n 'panel.empty.title': 'No frames yet',\n 'panel.empty.hint': 'Once the agent opens a page, this tab shows the page it is looking at.',\n 'panel.error.title': 'Browser view error',\n 'panel.trace.idle': 'No tool actions yet',\n 'panel.status.connecting': 'Connecting',\n 'panel.status.loading': 'Loading',\n 'panel.status.live': 'Live',\n 'panel.mode.isolated': 'Isolated browser',\n 'panel.mode.real': 'Real browser',\n 'config.summary': 'Real-browser CDP connection settings',\n 'config.realBrowserEnabled': 'Use a real browser (CDP)',\n 'config.realBrowserEnabled.hint': 'When enabled, every DSH session can operate every tab in this browser.',\n 'config.cdpEndpoint': 'CDP endpoint',\n 'config.cdpEndpoint.hint': 'Loopback only. Chrome 136+ does not allow remote debugging on its default profile.',\n 'config.idleCloseDays': 'Idle close (days)',\n 'config.idleCloseDays.hint': 'Pages DSH opened itself close once no browser tool has touched them for this many days. Adopted real-browser pages are never closed; 0 disables it.',\n 'config.unavailable': 'Settings are unavailable',\n 'config.failed': 'Could not save settings. Try again.',\n 'settings.title': 'Real browser',\n 'settings.description': 'Use the sign-in state and every tab of this machine\\'s Chrome or Edge.',\n 'settings.enabled': 'Enable CDP takeover',\n 'settings.enabledHint': 'When enabled, every DSH session can read and operate every tab in this browser.',\n 'settings.cdpEndpoint': 'CDP endpoint',\n 'settings.cdpEndpointHint': 'Loopback only. Chrome 136+ does not allow remote debugging on its default profile.',\n 'settings.idleCloseDays': 'Auto-close idle pages (days)',\n 'settings.idleCloseDaysHint': 'Pages DSH opened itself close once no browser tool has touched them for this many days. Adopted real-browser pages are never closed; 0 disables it.',\n 'settings.inherit': 'Inherit',\n 'settings.on': 'On',\n 'settings.off': 'Off',\n 'settings.overridden': 'Overridden',\n 'settings.reset': 'Reset',\n 'settings.invalidValue': 'Invalid value',\n 'settings.collapse': 'Collapse',\n 'settings.expand': 'Expand',\n 'settings.notExposed': 'This deployment does not expose the plugin settings.',\n 'settings.readOnly': 'Read-only',\n 'settings.saveFailed': 'Save failed',\n}\n","/**\n * The browser-view wire contract, shared by both halves.\n *\n * One source of truth for the host <-> browser messages and for the shapes the\n * agent tools return. Both halves compile this file (src/core is compiled into\n * the host program and the browser bundle), so a change here is a change to\n * both sides at once and needs no second definition.\n *\n * Transport: one WebSocket per mounted panel, created by the host half through\n * `ctx.webServer.registerUpgrade`. The host pushes events; the panel sends\n * commands. The browser itself is driven over CDP by the host half, so the\n * panel never speaks the devtools protocol.\n *\n * @module @linxin666/dsh-client-ui-browser-view/core/protocol\n */\n\n/** Version of the wire contract; a mismatch rejects the socket instead of guessing. */\nexport const BROWSER_VIEW_API_VERSION = 1\n\n/** Mount path of the panel socket, relative to the GUI origin. */\nexport const BROWSER_VIEW_SOCKET_PATH = '/api/dsh-browser-view/socket'\n\n/** JPEG quality the host asks CDP for; the panel only displays frames. */\nexport const DEFAULT_JPEG_QUALITY = 70\n\n/** Viewport the host pins on every tab it creates, in CSS pixels. */\nexport const DEFAULT_VIEWPORT = { width: 1280, height: 800 } as const\n\n/** How long a tab may live without any session binding before it is reaped. */\nexport const IDLE_TAB_TTL_MS = 10 * 60_000\n\n/** Deepest DOM snapshot walk the host will perform, in nodes. */\nexport const SNAPSHOT_NODE_LIMIT = 4000\n\n/** Ring size for captured console and network entries per tab. */\nexport const EVENT_RING_SIZE = 500\n\n/** One open tab as the panel and the tools see it. */\nexport interface BrowserTabView {\n /** Stable CDP target id, the handle tools accept. */\n id: string\n /** Current top-level URL. */\n url: string\n /** Current document title, empty when the page has none. */\n title: string\n /** Whether the tab is loading right now. */\n loading: boolean\n /** Session that last acted on the tab, when any. */\n sessionId?: string\n /** Whether DSH created this target or adopted an existing real-browser tab. */\n origin?: 'created' | 'adopted'\n}\n\n/** What the header of the panel shows. */\nexport interface BrowserPanelState {\n /** Tabs in creation order. */\n tabs: BrowserTabView[]\n /** Tab the panel is watching, null when none is open. */\n activeTabId: string | null\n /** Whether the host half currently has a live browser process or CDP attachment. */\n running: boolean\n /** Browser source selected for the current configuration; absent in older hosts. */\n mode?: 'isolated' | 'cdp'\n /** Normalized loopback CDP origin when real-browser mode is selected. */\n cdpEndpoint?: string\n /** Last error text the host wants the panel to show instead of a frame. */\n message?: string\n}\n\n/** One line of the panel's \"what is the agent doing\" trace. */\nexport interface BrowserActionTrace {\n /** Tool name that produced the change, without its `browser_` prefix. */\n tool: string\n /** One-line human description, already localized by the host. */\n summary: string\n /** Millisecond timestamp of the action. */\n at: number\n}\n\n/** Host pushes one of these to every attached panel. */\nexport type BrowserViewEvent =\n | { v: 1; kind: 'hello'; state: BrowserPanelState }\n | { v: 1; kind: 'state'; state: BrowserPanelState }\n | {\n v: 1\n kind: 'frame'\n /** Tab the frame belongs to. */\n tabId: string\n /** Monotonic frame counter, so a slow panel can drop intermediate frames. */\n seq: number\n /** Frame size in CSS pixels. */\n width: number\n /** Frame size in CSS pixels. */\n height: number\n /** Base64 JPEG, no data: prefix. */\n data: string\n }\n | { v: 1; kind: 'action'; trace: BrowserActionTrace }\n | { v: 1; kind: 'error'; code: string; message: string }\n\n/** Panel sends one of these to the host. */\nexport type BrowserViewCommand =\n | { v: 1; kind: 'attach'; sessionId?: string }\n | { v: 1; kind: 'select-tab'; tabId: string }\n | { v: 1; kind: 'request-frame' }\n | { v: 1; kind: 'close-tab'; tabId: string }\n\n/** A console entry the host rang in while the tab was open. */\nexport interface BrowserConsoleEntry {\n /** Console level: log, info, warn, error, debug. */\n level: string\n /** Already-stringified arguments. */\n text: string\n /** Millisecond timestamp. */\n at: number\n}\n\n/** A network request the host observed, reduced to what verification needs. */\nexport interface BrowserNetworkEntry {\n /** Request URL. */\n url: string\n /** HTTP method. */\n method: string\n /** Response status, 0 while pending or on a transport failure. */\n status: number\n /** Response mime type when known. */\n mimeType?: string\n /** CDP failure text when the request failed. */\n failure?: string\n /** Millisecond timestamp of the request. */\n at: number\n}\n\n/** One node of the DOM snapshot the tools return. */\nexport interface BrowserSnapshotNode {\n /** Depth-first index, the handle `browser_click` accepts as `ref`. */\n ref: number\n /** Lowercase tag name. */\n tag: string\n /** Element id, when set. */\n id?: string\n /** Element classes, when set. */\n classes?: string[]\n /** Accessible role when Chrome reports one. */\n role?: string\n /** Accessible name when Chrome reports one. */\n name?: string\n /** Visible text for leaf nodes, truncated by the host. */\n text?: string\n /** Bounding box in CSS pixels, window-relative. */\n box?: { x: number; y: number; width: number; height: number }\n /** Depth in the walked tree. */\n depth: number\n}\n\n/** What `browser_snapshot` returns to the model. */\nexport interface BrowserSnapshot {\n /** Tab the snapshot came from. */\n tabId: string\n /** Top-level URL at snapshot time. */\n url: string\n /** Document title. */\n title: string\n /** Walked nodes, bounded by SNAPSHOT_NODE_LIMIT. */\n nodes: BrowserSnapshotNode[]\n /** True when the walk hit the node limit. */\n truncated: boolean\n}\n\n/** Whether a decoded JSON value is a command this version accepts. */\nexport function isBrowserViewCommand(value: unknown): value is BrowserViewCommand {\n if (typeof value !== 'object' || value === null) return false\n const candidate = value as Record<string, unknown>\n if (candidate.v !== BROWSER_VIEW_API_VERSION) return false\n switch (candidate.kind) {\n case 'attach':\n return candidate.sessionId === undefined || typeof candidate.sessionId === 'string'\n case 'select-tab':\n return typeof candidate.tabId === 'string'\n case 'close-tab':\n return typeof candidate.tabId === 'string'\n case 'request-frame':\n return true\n default:\n return false\n }\n}\n","/**\n * Semantic attributes for the browser-view surface (semantic-attrs-v1).\n *\n * The plugin name lives on the root element of each surface so part values stay\n * bare words; a theme anchors on the pair, never on a part name that repeats\n * the plugin. The right-sidebar chip and the shell's tab strip around it are\n * not ours, so only this plugin's own elements are stamped.\n *\n * The body's part names follow the shipped browser tab's structure - a toolbar\n * with an address display, the frame, and the action trace - so a theme that\n * already anchors on that chrome reaches this tab the same way.\n */\n\n/** Root plugin attribute value carried by every top-level browser-view element. */\nexport const BROWSER_VIEW_PLUGIN = 'browser-view'\n\n/** Part names this plugin emits, in surface order. */\nexport const BROWSER_VIEW_PARTS = {\n /** The tab body the sidebar mounts in its content area. */\n panel: 'panel',\n /** Top chrome row: address display, connection state, refresh. */\n toolbar: 'toolbar',\n /** The read-only address display of the streamed page. */\n address: 'address',\n /** The controlled browser's tab chips; drawn only when it holds several. */\n tabs: 'tabs',\n /** The live frame image. */\n frame: 'frame',\n /** Bottom action trace. */\n trace: 'trace',\n /** Connection state marker in the toolbar. */\n status: 'status',\n /** No-frame placeholder. */\n empty: 'empty',\n /** Host-reported failure placeholder. */\n error: 'error',\n /** This plugin's share of the right-sidebar chip. */\n tabTitle: 'tab-title',\n} as const\n","/**\n * Panel-side WebSocket client.\n *\n * The host half owns the CDP connection and pushes state, JPEG frames, tool\n * actions and errors over one socket per mounted panel (see ../core/protocol.ts\n * for the frozen wire contract). This module is the only place the browser half\n * touches the wire: it derives the page or shell-owned socket URL, narrows every\n * incoming message through the protocol's discriminant, drops stale frames,\n * and reconnects with exponential backoff.\n *\n * Nothing here imports the DOM's WebSocket type directly: the constructor is\n * injectable so the tests drive a fake transport instead of a network.\n *\n * @module @linxin666/dsh-client-ui-browser-view/client/socket\n */\nimport {\n BROWSER_VIEW_API_VERSION,\n BROWSER_VIEW_SOCKET_PATH,\n} from '../core/protocol.ts'\nimport type {\n BrowserActionTrace,\n BrowserPanelState,\n BrowserTabView,\n BrowserViewCommand,\n BrowserViewEvent,\n} from '../core/protocol.ts'\n\n/** Connection phase the panel renders in its status line. */\nexport type BrowserViewSocketStatus = 'connecting' | 'open' | 'reconnecting' | 'closed'\n\n/** First reconnect delay, doubled per failed attempt. */\nexport const RECONNECT_BASE_MS = 500\n\n/** Reconnect ceiling; a host that stays down must not spin the tab. */\nexport const RECONNECT_MAX_MS = 15_000\n\n/** One decoded frame, exactly as the panel needs it. */\nexport interface BrowserViewFrame {\n /** Tab the frame belongs to. */\n readonly tabId: string\n /** Host-side monotonic counter for this tab. */\n readonly seq: number\n /** Frame width in CSS pixels. */\n readonly width: number\n /** Frame height in CSS pixels. */\n readonly height: number\n /** Base64 JPEG, no data: prefix. */\n readonly data: string\n}\n\n/** Callbacks the panel installs on a connection. */\nexport interface BrowserViewSocketHandlers {\n /** Connection phase changed. */\n onStatus?(status: BrowserViewSocketStatus): void\n /** Tabs, active tab and running flag were (re)published. */\n onState(state: BrowserPanelState): void\n /** A fresh frame arrived, already filtered for staleness. */\n onFrame(frame: BrowserViewFrame): void\n /** The agent performed one tool action. */\n onAction(trace: BrowserActionTrace): void\n /** The host reported a failure the panel must show instead of a frame. */\n onError(code: string, message: string): void\n}\n\n/** The minimal socket face this client needs; the DOM WebSocket satisfies it. */\nexport interface BrowserViewWebSocketLike {\n send(data: string): void\n close(code?: number, reason?: string): void\n onopen: ((event: unknown) => void) | null\n onmessage: ((event: { data: unknown }) => void) | null\n onclose: ((event: unknown) => void) | null\n onerror: ((event: unknown) => void) | null\n}\n\n/** Constructor shape of the transport; injectable for tests. */\nexport type BrowserViewWebSocketCtor = new (url: string) => BrowserViewWebSocketLike\n\n/** Options for one connection. */\nexport interface BrowserViewSocketOptions {\n /** Transport constructor; defaults to the page's WebSocket. */\n readonly WebSocketImpl?: BrowserViewWebSocketCtor\n /** Origin source for the URL; defaults to `globalThis.location`. */\n readonly location?: { readonly protocol: string; readonly host: string }\n /** Session the panel attaches to, forwarded in the `attach` command. */\n readonly sessionId?: string\n /** Timer seam so backoff can be advanced deterministically in tests. */\n readonly setTimer?: (handler: () => void, ms: number) => unknown\n /** Timer cancellation seam paired with `setTimer`. */\n readonly clearTimer?: (handle: unknown) => void\n}\n\n/** The handle a panel keeps for the lifetime of one mounted connection. */\nexport interface BrowserViewSocket {\n /** Send one command, buffered while the socket is not open. */\n send(command: BrowserViewCommand): void\n /** Stop reconnecting and close the transport. */\n close(): void\n /** Current connection phase. */\n status(): BrowserViewSocketStatus\n}\n\n/** Commands held while the socket is down; the oldest drop first. */\nconst PENDING_COMMAND_LIMIT = 16\n\n/** The network authority of a shell-owned Host, without credentials or a path. */\nfunction hostAuthorityOf(base: string | undefined): { protocol: string; authority: string } | undefined {\n if (base === undefined || base === '') return undefined\n let url: URL\n try {\n url = new URL(base)\n } catch {\n return undefined\n }\n if (url.protocol !== 'http:' && url.protocol !== 'https:') return undefined\n if (url.username !== '' || url.password !== '' || url.host === '') return undefined\n return { protocol: url.protocol, authority: url.host }\n}\n\n/**\n * Derive the socket URL from a web page or its application shell's Host.\n *\n * A web page keeps its own origin even when a transport hook is present. An\n * application-delivered page such as the desktop shell's dsh-app: cannot carry\n * a WebSocket upgrade on that scheme, so it uses the Host authority the shell\n * publishes instead. The shell rewrites that handshake; the Host fence is unchanged.\n * @param location - origin the panel is rendered on.\n * @param streamBaseUrl - official `__DSH_TRANSPORT__.streamBaseUrl`, when published.\n * @returns the absolute ws/wss URL, or null when no safe Host authority is known.\n */\nexport function browserViewSocketUrl(\n location: { readonly protocol: string; readonly host: string },\n streamBaseUrl?: string,\n): string | null {\n const pageProtocol = location.protocol === 'https:'\n ? 'wss:'\n : location.protocol === 'http:'\n ? 'ws:'\n : null\n if (pageProtocol !== null) return `${pageProtocol}//${location.host}${BROWSER_VIEW_SOCKET_PATH}`\n const base = hostAuthorityOf(streamBaseUrl)\n if (base === undefined) return null\n const protocol = base.protocol === 'https:' ? 'wss:' : 'ws:'\n return `${protocol}//${base.authority}${BROWSER_VIEW_SOCKET_PATH}`\n}\n\n/**\n * Backoff for one reconnect attempt.\n * @param attempt - zero-based attempt index.\n * @returns delay in milliseconds, capped at RECONNECT_MAX_MS.\n */\nexport function reconnectDelay(attempt: number): number {\n const exponential = RECONNECT_BASE_MS * 2 ** Math.max(0, Math.floor(attempt))\n return Math.min(exponential, RECONNECT_MAX_MS)\n}\n\n/** Narrow a tab row from the wire. */\nfunction readTab(value: unknown): BrowserTabView | null {\n if (typeof value !== 'object' || value === null) return null\n const candidate = value as Record<string, unknown>\n if (typeof candidate.id !== 'string') return null\n if (typeof candidate.url !== 'string') return null\n if (typeof candidate.title !== 'string') return null\n if (typeof candidate.loading !== 'boolean') return null\n return {\n id: candidate.id,\n url: candidate.url,\n title: candidate.title,\n loading: candidate.loading,\n ...(typeof candidate.sessionId === 'string' ? { sessionId: candidate.sessionId } : {}),\n ...(candidate.origin === 'created' || candidate.origin === 'adopted' ? { origin: candidate.origin } : {}),\n }\n}\n\n/** Narrow the panel state from the wire. */\nfunction readPanelState(value: unknown): BrowserPanelState | null {\n if (typeof value !== 'object' || value === null) return null\n const candidate = value as Record<string, unknown>\n if (!Array.isArray(candidate.tabs)) return null\n if (typeof candidate.running !== 'boolean') return null\n if (candidate.activeTabId !== null && typeof candidate.activeTabId !== 'string') return null\n const tabs: BrowserTabView[] = []\n for (const entry of candidate.tabs) {\n const tab = readTab(entry)\n if (tab === null) return null\n tabs.push(tab)\n }\n return {\n tabs,\n activeTabId: candidate.activeTabId as string | null,\n running: candidate.running,\n ...(candidate.mode === 'isolated' || candidate.mode === 'cdp' ? { mode: candidate.mode } : {}),\n ...(typeof candidate.cdpEndpoint === 'string' ? { cdpEndpoint: candidate.cdpEndpoint } : {}),\n ...(typeof candidate.message === 'string' ? { message: candidate.message } : {}),\n }\n}\n\n/**\n * Narrow one decoded payload into a protocol event.\n *\n * The protocol is a discriminated union over `kind`, so an unknown kind or a\n * wrong field type is a shape this panel cannot render: it is dropped rather\n * than half-applied, which keeps one malformed push from corrupting the view.\n * @param value - parsed JSON value (or a raw frame string).\n * @returns the event, or null when the payload is not one this version reads.\n */\nexport function parseBrowserViewEvent(value: unknown): BrowserViewEvent | null {\n let payload = value\n if (typeof payload === 'string') {\n try {\n payload = JSON.parse(payload)\n } catch {\n return null\n }\n }\n if (typeof payload !== 'object' || payload === null) return null\n const candidate = payload as Record<string, unknown>\n if (candidate.v !== BROWSER_VIEW_API_VERSION) return null\n switch (candidate.kind) {\n case 'hello':\n case 'state': {\n const state = readPanelState(candidate.state)\n if (state === null) return null\n return { v: BROWSER_VIEW_API_VERSION, kind: candidate.kind, state }\n }\n case 'frame': {\n if (typeof candidate.tabId !== 'string') return null\n if (typeof candidate.seq !== 'number') return null\n if (typeof candidate.width !== 'number') return null\n if (typeof candidate.height !== 'number') return null\n if (typeof candidate.data !== 'string') return null\n return {\n v: BROWSER_VIEW_API_VERSION,\n kind: 'frame',\n tabId: candidate.tabId,\n seq: candidate.seq,\n width: candidate.width,\n height: candidate.height,\n data: candidate.data,\n }\n }\n case 'action': {\n const trace = candidate.trace\n if (typeof trace !== 'object' || trace === null) return null\n const row = trace as Record<string, unknown>\n if (typeof row.tool !== 'string' || typeof row.summary !== 'string' || typeof row.at !== 'number') return null\n return {\n v: BROWSER_VIEW_API_VERSION,\n kind: 'action',\n trace: { tool: row.tool, summary: row.summary, at: row.at },\n }\n }\n case 'error': {\n if (typeof candidate.code !== 'string' || typeof candidate.message !== 'string') return null\n return { v: BROWSER_VIEW_API_VERSION, kind: 'error', code: candidate.code, message: candidate.message }\n }\n default:\n return null\n }\n}\n\n/**\n * Open one connection to the host half and keep it alive.\n *\n * Sequencing: every successful open sends `attach` (the host answers with\n * `hello` plus frames), and the per-tab frame counter is cleared because the\n * host restarts its `seq` for a new connection — keeping the old high-water\n * mark would drop the whole fresh stream.\n * @param handlers - panel callbacks.\n * @param options - transport, origin, session and timer seams.\n * @returns the handle the panel closes on unmount.\n */\nexport function connectBrowserViewSocket(\n handlers: BrowserViewSocketHandlers,\n options: BrowserViewSocketOptions = {},\n): BrowserViewSocket {\n const globals = globalThis as {\n WebSocket?: BrowserViewWebSocketCtor\n location?: { protocol: string; host: string }\n __DSH_TRANSPORT__?: { streamBaseUrl?: unknown }\n }\n const WebSocketImpl = options.WebSocketImpl ?? globals.WebSocket\n const location = options.location ?? globals.location\n const setTimer = options.setTimer ?? ((handler, ms) => setTimeout(handler, ms))\n const clearTimer = options.clearTimer ?? ((handle) => { clearTimeout(handle as ReturnType<typeof setTimeout>) })\n const publishedBase = globals.__DSH_TRANSPORT__?.streamBaseUrl\n const streamBaseUrl = typeof publishedBase === 'string' ? publishedBase : undefined\n const url = location === undefined ? null : browserViewSocketUrl(location, streamBaseUrl)\n\n let status: BrowserViewSocketStatus = 'connecting'\n let socket: BrowserViewWebSocketLike | null = null\n let attempt = 0\n let disposed = false\n let timer: unknown = null\n const pending: BrowserViewCommand[] = []\n const lastSeqByTab = new Map<string, number>()\n\n /** Publish a phase change once. */\n const setStatus = (next: BrowserViewSocketStatus): void => {\n if (status === next) return\n status = next\n handlers.onStatus?.(next)\n }\n\n /** Send without buffering (open socket only). */\n const sendNow = (command: BrowserViewCommand): boolean => {\n if (socket === null) return false\n try {\n socket.send(JSON.stringify(command))\n return true\n } catch {\n return false\n }\n }\n\n /** Dispatch one decoded event, dropping frames older than what is on screen. */\n const dispatch = (event: BrowserViewEvent): void => {\n switch (event.kind) {\n case 'hello':\n case 'state':\n handlers.onState(event.state)\n return\n case 'frame': {\n const previous = lastSeqByTab.get(event.tabId)\n if (previous !== undefined && event.seq <= previous) return\n lastSeqByTab.set(event.tabId, event.seq)\n handlers.onFrame({\n tabId: event.tabId,\n seq: event.seq,\n width: event.width,\n height: event.height,\n data: event.data,\n })\n return\n }\n case 'action':\n handlers.onAction(event.trace)\n return\n case 'error':\n handlers.onError(event.code, event.message)\n return\n default:\n return\n }\n }\n\n /** Arm the next reconnect; each failure doubles the wait until the ceiling. */\n const scheduleReconnect = (): void => {\n if (disposed) return\n if (url === null || WebSocketImpl === undefined) {\n setStatus('closed')\n return\n }\n setStatus('reconnecting')\n if (timer !== null) clearTimer(timer)\n const delay = reconnectDelay(attempt)\n attempt += 1\n timer = setTimer(() => {\n timer = null\n connect()\n }, delay)\n }\n\n /** Open one transport and wire it to the handlers. */\n const connect = (): void => {\n if (disposed) return\n if (url === null || WebSocketImpl === undefined) {\n setStatus('closed')\n return\n }\n setStatus(attempt === 0 ? 'connecting' : 'reconnecting')\n let transport: BrowserViewWebSocketLike\n try {\n transport = new WebSocketImpl(url)\n } catch {\n socket = null\n scheduleReconnect()\n return\n }\n socket = transport\n transport.onopen = () => {\n if (disposed) return\n attempt = 0\n lastSeqByTab.clear()\n setStatus('open')\n while (pending.length > 0) {\n const command = pending.shift()\n if (command !== undefined) sendNow(command)\n }\n sendNow({ v: BROWSER_VIEW_API_VERSION, kind: 'attach', ...(options.sessionId === undefined ? {} : { sessionId: options.sessionId }) })\n }\n transport.onmessage = (event) => {\n if (disposed) return\n const parsed = parseBrowserViewEvent(event.data)\n if (parsed !== null) dispatch(parsed)\n }\n transport.onerror = () => {\n // A close event always follows a failed handshake; reconnection is armed there.\n }\n transport.onclose = () => {\n if (socket === transport) socket = null\n if (disposed) return\n scheduleReconnect()\n }\n }\n\n connect()\n\n return {\n send(command: BrowserViewCommand): void {\n if (sendNow(command)) return\n pending.push(command)\n if (pending.length > PENDING_COMMAND_LIMIT) pending.shift()\n },\n close(): void {\n if (disposed) return\n disposed = true\n if (timer !== null) {\n clearTimer(timer)\n timer = null\n }\n const transport = socket\n socket = null\n setStatus('closed')\n if (transport !== null) {\n try {\n transport.close()\n } catch {\n // A transport that already failed may throw on close; nothing left to do.\n }\n }\n },\n status(): BrowserViewSocketStatus {\n return status\n },\n }\n}\n","/**\n * The browser view tab's content, mounted by the right sidebar into its\n * content area under the 'browser-view' tab type.\n *\n * The shell owns the column, the chip, the close control and the switch between\n * tabs; this file owns what is drawn inside one tab and scrolls inside it. It\n * therefore has no title bar of its own and no \"back\" control - a page header\n * in a sidebar tab would repeat the chip right above it - and it fills the\n * height it is given instead of positioning itself against the viewport.\n *\n * The body is laid out like the shipped browser tab's chrome: one 38px toolbar\n * holding the address display, the connection marker and the one control this\n * plugin actually has - refresh the captured frame - then the frame itself,\n * then the action trace. Nothing here claims a capability the host does not\n * expose: there is no forward/back pair, no reload of the page (the host drives\n * navigation, this side only observes it) and no \"open in a new window\",\n * because the page lives in a Chromium process on the host.\n *\n * The refresh control and the state marker are the product's own atoms -\n * IconRefreshOutlineRegular and StateDot from @deepseek-ai/dsh-client-ui-primitives,\n * the same two the shipped browser tab's toolbar uses - so the chrome is drawn\n * from one source rather than redrawn beside it. The package's Vite config\n * inlines @deepseek-ai packages, which is what lets the jsdom body tests load\n * that entry point (it imports its own stylesheets).\n *\n * Frame rendering: an <img> fed a base64 JPEG data URL, not a <canvas>. The host\n * already decoded and re-encoded the frame (CDP gives it JPEG base64), so there\n * are no pixels for this side to compose - a canvas would add a drawImage hop,\n * a context lifecycle and an invalidation race for zero gain, while the image\n * element decodes off the main thread and lets CSS own the aspect-ratio fit.\n */\nimport { useEffect, useMemo, useRef, useState } from 'react'\nimport {\n IconRefreshOutlineRegular,\n StateDot,\n type StateDotState,\n} from '@deepseek-ai/dsh-client-ui-primitives'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { BrowserActionTrace, BrowserPanelState } from '../core/protocol.ts'\nimport { BROWSER_VIEW_API_VERSION } from '../core/protocol.ts'\nimport type { BrowserViewLiveTitleStore } from './live-title.ts'\nimport { BROWSER_VIEW_PARTS, BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport {\n connectBrowserViewSocket,\n type BrowserViewFrame,\n type BrowserViewSocket,\n type BrowserViewSocketHandlers,\n type BrowserViewSocketStatus,\n} from './socket.ts'\nimport css from './panel.module.css'\n\n/** Page-side socket factory; tests inject a fake transport through it. */\nexport type BrowserViewSocketFactory = (handlers: BrowserViewSocketHandlers) => BrowserViewSocket\n\n/** Business face injected into the tab body. */\nexport interface BrowserViewPanelFace {\n /** Session whose screencast this body shows. */\n readonly sessionId?: string\n /** Channel the chip reads this body's page title from. */\n readonly liveTitle?: BrowserViewLiveTitleStore\n}\n\n/** Panel props: the locale seat, the injected face, and the seams a test may supply. */\nexport type BrowserViewPanelProps = PropsLocale<'browser-view'> & Partial<BrowserViewPanelFace> & {\n /** Socket factory override; defaults to the real same-origin connection. */\n readonly socketFactory?: BrowserViewSocketFactory\n /** Origin override; defaults to the page's own location. */\n readonly location?: { readonly protocol: string; readonly host: string }\n}\n\n/** Trace rows kept on screen; older tool calls scroll out of relevance. */\nconst TRACE_LIMIT = 5\n\n/** State before the host publishes anything. */\nconst EMPTY_STATE: BrowserPanelState = { tabs: [], activeTabId: null, running: false }\n\n/** Join truthy class names (CSS Modules maps are typed as plain records). */\nfunction cx(...names: ReadonlyArray<string | false | null | undefined>): string {\n return names.filter((name): name is string => typeof name === 'string' && name.length > 0).join(' ')\n}\n\n/**\n * Render the browser view tab body.\n * @param props - composed slot props.\n * @returns the tab content.\n */\nexport function BrowserViewPanel({ t, sessionId, liveTitle, socketFactory, location }: BrowserViewPanelProps) {\n const [state, setState] = useState<BrowserPanelState>(EMPTY_STATE)\n const [frame, setFrame] = useState<BrowserViewFrame | null>(null)\n const [traces, setTraces] = useState<ReadonlyArray<BrowserActionTrace>>([])\n const [error, setError] = useState<{ readonly code: string; readonly message: string } | null>(null)\n const [status, setStatus] = useState<BrowserViewSocketStatus>('connecting')\n const socketRef = useRef<BrowserViewSocket | null>(null)\n /** Last active tab seen in a state push; a tab switch invalidates the picture. */\n const lastActiveTabRef = useRef<string | null>(null)\n /** Browser source seen in the last state push; a source switch invalidates it too. */\n const lastSourceRef = useRef<{ mode?: 'isolated' | 'cdp'; cdpEndpoint?: string }>({})\n\n const factory = useMemo<BrowserViewSocketFactory>(\n () => socketFactory ?? ((handlers) => connectBrowserViewSocket(handlers, { location, sessionId })),\n [socketFactory, location, sessionId],\n )\n\n useEffect(() => {\n const instance = factory({\n onStatus: (next) => { setStatus(next) },\n onState: (next) => {\n // Compare outside the state updater: an updater must stay pure. A frame\n // from the old browser source or the previous tab must not outlive it.\n const sourceChanged = lastSourceRef.current.mode !== next.mode\n || lastSourceRef.current.cdpEndpoint !== next.cdpEndpoint\n if (sourceChanged) {\n lastSourceRef.current = { mode: next.mode, cdpEndpoint: next.cdpEndpoint }\n lastActiveTabRef.current = next.activeTabId\n setFrame(null)\n setError(null)\n } else if (lastActiveTabRef.current !== next.activeTabId) {\n lastActiveTabRef.current = next.activeTabId\n setFrame(null)\n }\n setState(next)\n },\n onFrame: (next) => {\n setError(null)\n setFrame(next)\n },\n onAction: (trace) => {\n setTraces((current) => [trace, ...current].slice(0, TRACE_LIMIT))\n },\n onError: (code, message) => { setError({ code, message }) },\n })\n socketRef.current = instance\n return () => {\n socketRef.current = null\n instance.close()\n }\n }, [factory])\n\n const activeTab = state.tabs.find((tab) => tab.id === state.activeTabId) ?? null\n // Loading is per tab on the wire; the connection phase joins it so a page\n // that is still dialing never claims to be live.\n const loading = activeTab?.loading === true || status !== 'open'\n // The wire carries two failure channels: an explicit error push, and the\n // message a state push may use to say \"show this instead of a frame\". Both\n // land on the same block so the tab never shows a stale picture beside a host\n // complaint.\n const hostError = state.message !== undefined && state.message.length > 0\n ? { code: '', message: state.message }\n : null\n const effectiveError = error ?? hostError\n // One narrowed value for the stage: a frame is only paintable when the host\n // reported no error, which keeps the null check off the JSX branch.\n const visibleFrame = effectiveError === null ? frame : null\n const dataUrl = visibleFrame === null ? null : `data:image/jpeg;base64,${visibleFrame.data}`\n // The marker names what the viewer is actually looking at: the socket's phase\n // first (nothing is live before the host answers), then the page's own load\n // state. The same three strings the trace footer used to carry.\n const statusLabel = status !== 'open'\n ? t('panel.status.connecting')\n : loading ? t('panel.status.loading') : t('panel.status.live')\n // Three of the product's five dot states, in the order a viewer meets them:\n // nothing reached yet, a page still loading, a settled live picture.\n const dotState: StateDotState = status !== 'open' ? 'idle' : loading ? 'ongoing' : 'done'\n const modeLabel = state.mode === 'cdp' ? t('panel.mode.real') : t('panel.mode.isolated')\n const pageTitle = activeTab === null || activeTab.title.length === 0 ? undefined : activeTab.title\n const url = activeTab?.url ?? ''\n\n // The chip beside this tab names the page being streamed, and only this body\n // can know that name. Publishing in an effect keeps render pure; the cleanup\n // clears the entry so a closed tab leaves no stale name behind.\n useEffect(() => {\n liveTitle?.set(sessionId, pageTitle)\n return () => { liveTitle?.set(sessionId, undefined) }\n }, [liveTitle, sessionId, pageTitle])\n\n return (\n <div className={css.root} data-dsh-plugin={BROWSER_VIEW_PLUGIN} data-dsh-part={BROWSER_VIEW_PARTS.panel}>\n <div className={css.toolbar} data-dsh-part={BROWSER_VIEW_PARTS.toolbar}>\n <div className={css.addressBox} data-dsh-part={BROWSER_VIEW_PARTS.address}>\n <input\n className={css.address}\n type=\"text\"\n readOnly\n value={url}\n title={url.length > 0 ? url : undefined}\n placeholder={t('panel.url.empty')}\n aria-label={t('panel.address.label')}\n spellCheck={false}\n // Selecting on click is the address bar's own gesture: the whole\n // address is ready to copy without a second control.\n onFocus={(event) => { event.currentTarget.select() }}\n onClick={(event) => { event.currentTarget.select() }}\n />\n </div>\n <span\n className={css.status}\n data-dsh-part={BROWSER_VIEW_PARTS.status}\n aria-live=\"polite\"\n title={state.cdpEndpoint ?? modeLabel}\n >\n <StateDot state={dotState} size={10} />\n <span className={css.statusText}>{statusLabel}</span>\n <span className={css.mode}>{modeLabel}</span>\n {state.mode === 'cdp' && state.cdpEndpoint !== undefined && (\n <span className={css.endpoint}>{state.cdpEndpoint}</span>\n )}\n </span>\n <button\n type=\"button\"\n className={css.tool}\n title={t('panel.toolbar.refresh')}\n aria-label={t('panel.toolbar.refresh')}\n disabled={activeTab === null}\n onClick={() => {\n socketRef.current?.send({ v: BROWSER_VIEW_API_VERSION, kind: 'request-frame' })\n }}\n >\n <IconRefreshOutlineRegular />\n </button>\n </div>\n {state.tabs.length > 1 && (\n <div className={css.tabs} role=\"tablist\" data-dsh-part={BROWSER_VIEW_PARTS.tabs}>\n {state.tabs.map((tab) => (\n <button\n key={tab.id}\n type=\"button\"\n role=\"tab\"\n aria-selected={tab.id === state.activeTabId}\n className={cx(css.tab, tab.id === state.activeTabId && css.tabActive)}\n title={tab.url}\n onClick={() => {\n socketRef.current?.send({ v: BROWSER_VIEW_API_VERSION, kind: 'select-tab', tabId: tab.id })\n }}\n >\n {tab.title.length > 0 ? tab.title : t('panel.tab.untitled')}\n </button>\n ))}\n </div>\n )}\n <div className={css.content}>\n {effectiveError !== null ? (\n <div className={css.error} data-dsh-part={BROWSER_VIEW_PARTS.error} role=\"alert\">\n <span className={css.errorTitle}>{t('panel.error.title')}</span>\n <span className={css.errorBody}>{effectiveError.message}</span>\n {effectiveError.code.length > 0 && <span className={css.errorCode}>{effectiveError.code}</span>}\n </div>\n ) : dataUrl === null || visibleFrame === null ? (\n <div className={css.empty} data-dsh-part={BROWSER_VIEW_PARTS.empty}>\n <span className={css.emptyTitle}>{t('panel.empty.title')}</span>\n <span className={css.emptyHint}>{t('panel.empty.hint')}</span>\n </div>\n ) : (\n <img\n className={css.frame}\n data-dsh-part={BROWSER_VIEW_PARTS.frame}\n src={dataUrl}\n alt={t('panel.frame.alt')}\n width={visibleFrame.width}\n height={visibleFrame.height}\n draggable={false}\n />\n )}\n </div>\n <footer className={css.trace} data-dsh-part={BROWSER_VIEW_PARTS.trace}>\n <div className={css.traceList}>\n {traces.length === 0\n ? <span className={css.traceIdle}>{t('panel.trace.idle')}</span>\n : traces.map((trace, index) => (\n <div key={`${trace.at}-${index}`} className={css.traceRow}>\n <span className={css.traceTool}>{trace.tool}</span>\n <span className={css.traceSummary}>{trace.summary}</span>\n </div>\n ))}\n </div>\n </footer>\n </div>\n )\n}\n","/**\n * The guide capsule's glyph: this plugin's own mark, not a product artwork.\n *\n * The right sidebar's guide lists one capsule per registered tab type and draws\n * the type's `icon` (a `ComponentType<IconProps>`) at 22px, or 26px beside a\n * description. Drawing locally keeps the plugin free of icon-set coupling: the\n * only thing borrowed is the IconProps shape, as a type, and the glyph itself\n * inherits its colour from the capsule through currentColor.\n *\n * It restates the mark the chip already uses - a browser\n * window with the agent's cursor inside - so a user who has seen one recognises\n * the other. It is deliberately not the shipped browser tab's artwork: this tab\n * is a different implementation and does not pass itself off as that one.\n */\nimport type { IconProps } from '@deepseek-ai/dsh-client-ui-primitives'\n\n/**\n * Render the guide glyph.\n * @param props - square edge in px (the guide passes 22 or 26) and a layout class.\n * @returns the window-and-cursor mark.\n */\nexport function BrowserViewGuideGlyph({ size = 16, className }: IconProps) {\n return (\n <svg\n width={size}\n height={size}\n viewBox=\"0 0 16 16\"\n className={className}\n aria-hidden=\"true\"\n focusable=\"false\"\n >\n <rect x=\"1.75\" y=\"2.25\" width=\"12.5\" height=\"11.5\" rx=\"1.75\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <path d=\"M1.75 5.75h12.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.2\" />\n <circle cx=\"3.9\" cy=\"4\" r=\"0.7\" fill=\"currentColor\" />\n <path d=\"M7.4 8.15l3.85 1.7-1.6.65-.7 1.65z\" fill=\"currentColor\" />\n </svg>\n )\n}\n","/**\n * The right-sidebar tab type this plugin contributes: its kind, its identity,\n * the navigation parameters it accepts, and the guide capsule that opens it.\n *\n * A tab type is registered in two stages. Stage one is a purely static\n * declaration (ctx.sidebarRightTabs.register) naming the kind, the chip's\n * initial text and the guide entry; stage two is the keyed 'sidebar.right.pane.tab'\n * body and 'sidebar.right.pane.tab.title' registration under this same id, which\n * is what the seat dispatches on. The kind is what openTabIn/openTab name, and\n * it is also the key of the params map below.\n *\n * The `guide` entry is what puts this type on the right sidebar's guide page -\n * the list a user sees when the column has no page in front. It is the one place\n * that opens the tab now that the conversation header carries no entry of its\n * own, and the guide owns the click:\n * it renders one capsule per registered entry and opens the entry's own `kind`\n * (GuideBody: tab.actions.openTab(entry.kind, { replaceTab: true })), so this\n * plugin declares the capsule and never wires a handler of its own. No\n * commandId is declared: the plugin registers no keyboard shortcut, and the\n * guide would draw a key hint the shortcut table cannot honour.\n *\n * The kind is deliberately NOT 'browser': the shipped\n * @deepseek-ai/dsh-client-ui-sidebar-browser registers that kind, and a\n * registration in the extension band takes a kind over, so reusing it would\n * shadow the shipped browser tab out of existence - the one thing this\n * package's AGENTS.md forbids. A distinct kind is what lets both live in the\n * same column.\n */\nimport type { SidebarRightTabDefinition } from '@deepseek-ai/dsh-client-ui-sidebar-right/client'\nimport { BrowserViewGuideGlyph } from './guide-icon.tsx'\nimport type { BrowserViewKey } from './locales.ts'\n\n/** What this plugin's tabs are, and what openTabIn/openTab name. */\nexport const BROWSER_VIEW_TAB_KIND = 'browser-view'\n\n/** This implementation's identity in the tab system; also the keyed slot dispatch key. */\nexport const BROWSER_VIEW_TAB_ID = '@linxin666/dsh-client-ui-browser-view'\n\n/** Identity of this type's capsule on the guide page, stable within the provider. */\nexport const BROWSER_VIEW_GUIDE_ENTRY_ID = 'open'\n\n/**\n * Position of this type's capsule among every registered type's entries. The\n * shipped browser tab sits at 30; this one follows it instead of competing for\n * the same slot, because it is a companion view rather than a replacement.\n */\nexport const BROWSER_VIEW_GUIDE_ENTRY_ORDER = 40\n\n/** Navigation parameters this tab type accepts. */\nexport interface BrowserViewTabParams {\n /** Chrome tab the pane should stream first, when the opener knows one. */\n readonly tabId?: string\n}\n\ndeclare module '@deepseek-ai/dsh-client-ui-sidebar-right/client' {\n interface SidebarRightTabParamsMap {\n /** Parameters of a browser-view page. */\n 'browser-view': BrowserViewTabParams\n }\n}\n\n/**\n * Build stage one of the registration.\n * @param t - translate function of this plugin's dictionary.\n * @returns the static tab type the registry keeps.\n */\nexport function browserViewTabDefinition(t: (key: BrowserViewKey) => string): SidebarRightTabDefinition {\n return {\n id: BROWSER_VIEW_TAB_ID,\n kind: BROWSER_VIEW_TAB_KIND,\n // A visited body stays mounted while another chip is in front, so the\n // screencast socket survives a tab switch instead of redialing the host.\n keepMounted: true,\n // A type from outside the product: the honest band, and the default one.\n priority: 'extension',\n title: () => t('tab.title'),\n guide: [{\n id: BROWSER_VIEW_GUIDE_ENTRY_ID,\n order: BROWSER_VIEW_GUIDE_ENTRY_ORDER,\n // Thunked, like the type's own title: a language switch needs no\n // re-registration, and the guide reads the copy again on every use.\n title: () => t('tab.title'),\n description: () => t('guide.description'),\n icon: BrowserViewGuideGlyph,\n }],\n }\n}\n","/**\n * The browser view's chip text.\n *\n * The shell owns the right-sidebar chip: its box, its close and hidden\n * controls, the active highlight and the switch between tabs. This component\n * draws only what sits inside it - the browser mark and the name - which is why\n * it carries no state of its own.\n *\n * The name prefers the page the body is streaming, read from the published\n * channel (live-title.ts), and falls back to this plugin's own name before the\n * first state push: a chip that says \"Checkout\" is more useful than one that\n * says \"Browser view\", but an empty chip is worse than either.\n */\nimport { useCallback, useSyncExternalStore } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { BrowserViewLiveTitleStore } from './live-title.ts'\nimport { BROWSER_VIEW_PARTS, BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport css from './panel.module.css'\n\n/** Business face injected into the chip. */\nexport interface BrowserViewTabTitleFace {\n /** Session whose tab this chip names. */\n readonly sessionId?: string\n /** Channel the body publishes the streamed page's title on. */\n readonly liveTitle?: BrowserViewLiveTitleStore\n}\n\n/** Chip props: the locale seat plus the injected face. */\nexport type BrowserViewTabTitleProps = PropsLocale<'browser-view'> & Partial<BrowserViewTabTitleFace>\n\n/**\n * Decorative browser-window mark; inline so the chip carries no icon dependency.\n * @returns the glyph.\n */\nfunction BrowserViewMark() {\n return (\n <svg className={css.tabTitleMark} viewBox=\"0 0 16 16\" aria-hidden=\"true\" focusable=\"false\">\n <rect x=\"1.75\" y=\"2.25\" width=\"12.5\" height=\"11.5\" rx=\"1.75\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M1.75 5.75h12.5\" fill=\"none\" stroke=\"currentColor\" strokeWidth=\"1.5\" />\n <path d=\"M7.4 8.15l3.85 1.7-1.6.65-.7 1.65z\" fill=\"currentColor\" />\n </svg>\n )\n}\n\n/**\n * Render the chip contents.\n * @param props - composed slot props.\n * @returns the mark and the tab's name.\n */\nexport function BrowserViewTabTitle({ t, sessionId, liveTitle }: BrowserViewTabTitleProps) {\n const subscribe = useCallback(\n (listener: () => void) => liveTitle?.subscribe(listener) ?? (() => {}),\n [liveTitle],\n )\n const read = useCallback(() => liveTitle?.get(sessionId), [liveTitle, sessionId])\n const pageTitle = useSyncExternalStore(subscribe, read, () => undefined)\n const label = pageTitle !== undefined && pageTitle.length > 0 ? pageTitle : t('tab.title')\n return (\n <span\n className={css.tabTitle}\n data-dsh-plugin={BROWSER_VIEW_PLUGIN}\n data-dsh-part={BROWSER_VIEW_PARTS.tabTitle}\n >\n <BrowserViewMark />\n <span className={css.tabTitleText}>{label}</span>\n </span>\n )\n}\n","import { useEffect, useState } from 'react'\nimport type { PropsLocale } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { PluginConfigViewProps } from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport { BROWSER_VIEW_PLUGIN } from './semantic.ts'\nimport css from './config.module.css'\n\n/** Configuration-seat keys for standalone and aggregate bundle rows. */\nexport const BROWSER_VIEW_CONFIG_KEYS = [\n '@linxin666/dsh-client-ui-browser-view#ui-browser-view',\n '@linxin666/dsh-client-ui-browser-view#web-ui-browser-view',\n] as const\n\ninterface BrowserConfigValues {\n realBrowserEnabled?: unknown\n cdpEndpoint?: unknown\n idleCloseDays?: unknown\n}\n\n/** The row configuration form backed by the Host's volatile settings namespace. */\nexport function BrowserViewConfig({ t, view, form }: PropsLocale<'browser-view'> & PluginConfigViewProps) {\n const values = form?.state.value as BrowserConfigValues | undefined\n const enabled = values?.realBrowserEnabled === true\n const endpoint = typeof values?.cdpEndpoint === 'string' && values.cdpEndpoint.length > 0\n ? values.cdpEndpoint\n : 'http://127.0.0.1:9222'\n const idleDays = typeof values?.idleCloseDays === 'number' ? values.idleCloseDays : 3\n const [draft, setDraft] = useState(endpoint)\n const [idleDraft, setIdleDraft] = useState(String(idleDays))\n const [pending, setPending] = useState(false)\n const [failed, setFailed] = useState(false)\n useEffect(() => { setDraft(endpoint) }, [endpoint])\n useEffect(() => { setIdleDraft(String(idleDays)) }, [idleDays])\n if (view === 'summary') return t('config.summary')\n if (form === undefined || form.state.status !== 'ready') {\n return <p className={css.hint}>{t('config.unavailable')}</p>\n }\n const disabled = pending || !form.state.writable\n const mutate = async (ops: Parameters<typeof form.mutate>[0]): Promise<void> => {\n setPending(true)\n setFailed(false)\n try {\n const accepted = await form.mutate(ops, form.state.revision)\n if (!accepted) setFailed(true)\n } catch {\n setFailed(true)\n } finally {\n setPending(false)\n }\n }\n const commitEndpoint = async (): Promise<void> => {\n const next = draft.trim()\n if (next === endpoint || next === '') return\n await mutate([{ op: 'set', path: ['cdpEndpoint'], value: next }])\n }\n const commitIdleDays = async (): Promise<void> => {\n const next = Number(idleDraft.trim())\n if (!Number.isInteger(next) || next < 0 || next === idleDays) return\n await mutate([{ op: 'set', path: ['idleCloseDays'], value: next }])\n }\n return (\n <section className={css.root} data-dsh-plugin={BROWSER_VIEW_PLUGIN} aria-busy={pending}>\n <label className={css.switchRow}>\n <input\n type=\"checkbox\"\n role=\"switch\"\n checked={enabled}\n disabled={disabled}\n onChange={(event) => {\n void mutate([{ op: 'set', path: ['realBrowserEnabled'], value: event.currentTarget.checked }])\n }}\n />\n <span>{t('config.realBrowserEnabled')}</span>\n </label>\n <p className={css.hint}>{t('config.realBrowserEnabled.hint')}</p>\n <label className={css.field}>\n <span>{t('config.cdpEndpoint')}</span>\n <input\n type=\"text\"\n value={draft}\n disabled={disabled}\n spellCheck={false}\n onChange={(event) => { setDraft(event.currentTarget.value) }}\n onBlur={() => { void commitEndpoint() }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n />\n </label>\n <p className={css.hint}>{t('config.cdpEndpoint.hint')}</p>\n <label className={css.field}>\n <span>{t('config.idleCloseDays')}</span>\n <input\n type=\"text\"\n inputMode=\"numeric\"\n value={idleDraft}\n disabled={disabled}\n spellCheck={false}\n onChange={(event) => { setIdleDraft(event.currentTarget.value) }}\n onBlur={() => { void commitIdleDays() }}\n onKeyDown={(event) => {\n if (event.key === 'Enter') {\n event.preventDefault()\n event.currentTarget.blur()\n }\n }}\n />\n </label>\n <p className={css.hint}>{t('config.idleCloseDays.hint')}</p>\n {failed && <p className={css.error} role=\"alert\">{t('config.failed')}</p>}\n </section>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/RangeBubble.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Coarse adjustment for a bounded number: resting the pointer on the control\n * (or moving focus into it) raises a small bubble holding a slider across the\n * field's whole range, so a large change is one drag instead of many presses\n * or a retyped value. The control itself stays the precise entry.\n *\n * The bubble belongs to the anchor's subtree, so moving from the control onto\n * the bubble never counts as leaving. It opens after a short rest and closes a\n * moment after the pointer and focus have both gone, so crossing the control\n * on the way elsewhere does not flash it. While a drag is in progress the\n * bubble stays put even if the pointer strays off it.\n *\n * Dragging reports each value through `onInput`, so the field shows it live;\n * releasing the thumb, or a key press on it, reports `onCommit` once. The\n * bubble opens on the side of the control that has room inside the nearest\n * scrolling ancestor, so a row near the top of a settings page does not hang\n * its bubble under the page edge.\n */\n\nimport { useEffect, useRef, useState, type ChangeEvent, type CSSProperties, type KeyboardEvent, type ReactNode } from 'react'\nimport css from './settings-card.module.css'\n\n/** Rest on the control before the bubble opens. */\nconst OPEN_DELAY_MS = 220\n/** Grace after pointer and focus have left before the bubble closes. */\nconst CLOSE_DELAY_MS = 200\n/** Room the bubble needs between the control and the scroller's edge. */\nconst BUBBLE_ROOM_PX = 64\n\n/** Props of {@link RangeBubble}. */\nexport interface RangeBubbleProps {\n /** Lowest value the slider reaches. */\n min: number\n /** Highest value the slider reaches. */\n max: number\n /** Slider granularity. */\n step: number\n /** Current value; a value outside the range parks the thumb at the nearer end. */\n value: number\n /** Accessible name of the slider. */\n label: string\n /** Disables the bubble along with the control. */\n disabled?: boolean\n /** Each value while the thumb moves. */\n onInput: (value: number) => void\n /** The value the thumb was released on, once per drag or key press. */\n onCommit: (value: number) => void\n /** The precise control the bubble hangs off. */\n children: ReactNode\n}\n\n/** The nearest ancestor that scrolls vertically, or the viewport's root. */\nfunction scroller(node: HTMLElement): HTMLElement {\n for (let parent = node.parentElement; parent !== null; parent = parent.parentElement) {\n const overflow = getComputedStyle(parent).overflowY\n if (overflow === 'auto' || overflow === 'scroll') return parent\n }\n return node.ownerDocument.documentElement\n}\n\n/**\n * Render the control with its coarse-adjustment bubble.\n * @param props - the range, the value and the two report callbacks.\n * @returns the anchor holding the control and the bubble.\n */\nexport function RangeBubble(props: RangeBubbleProps): ReactNode {\n const { min, max, step, disabled = false } = props\n const [open, setOpen] = useState(false)\n const [side, setSide] = useState<'above' | 'below'>('above')\n const [live, setLive] = useState<number | null>(null)\n const anchorRef = useRef<HTMLDivElement | null>(null)\n const timer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const hovered = useRef(false)\n const focused = useRef(false)\n const dragging = useRef(false)\n\n useEffect(() => () => { clearTimeout(timer.current) }, [])\n useEffect(() => {\n if (disabled) {\n clearTimeout(timer.current)\n setOpen(false)\n }\n }, [disabled])\n\n const show = (): void => {\n const anchor = anchorRef.current\n if (anchor !== null) {\n const room = anchor.getBoundingClientRect().top - scroller(anchor).getBoundingClientRect().top\n setSide(room >= BUBBLE_ROOM_PX ? 'above' : 'below')\n }\n setOpen(true)\n }\n const schedule = (): void => {\n clearTimeout(timer.current)\n if (disabled) return\n if (hovered.current || focused.current || dragging.current) {\n if (!open) timer.current = setTimeout(show, focused.current ? 0 : OPEN_DELAY_MS)\n return\n }\n timer.current = setTimeout(() => { setOpen(false) }, CLOSE_DELAY_MS)\n }\n\n const commit = (value: number): void => {\n dragging.current = false\n setLive(null)\n props.onCommit(value)\n schedule()\n }\n const onChange = (event: ChangeEvent<HTMLInputElement>): void => {\n const value = Number(event.target.value)\n setLive(value)\n props.onInput(value)\n }\n const onKeyUp = (event: KeyboardEvent<HTMLInputElement>): void => {\n if (live !== null) commit(live)\n if (event.key === 'Escape') {\n clearTimeout(timer.current)\n setOpen(false)\n }\n }\n const shown = live ?? Math.min(max, Math.max(min, props.value))\n\n return (\n <div\n ref={anchorRef}\n className={css.rangeAnchor}\n onPointerEnter={() => { hovered.current = true; schedule() }}\n onPointerLeave={() => { hovered.current = false; schedule() }}\n onFocus={() => { focused.current = true; schedule() }}\n onBlur={(event) => {\n if (event.currentTarget.contains(event.relatedTarget as Node | null)) return\n focused.current = false\n if (live !== null) commit(live)\n else schedule()\n }}\n >\n {props.children}\n <div className={css.rangeBubble} data-open={open ? '' : undefined} data-side={side}>\n <input\n type=\"range\"\n className={css.rangeSlider}\n min={min}\n max={max}\n step={step}\n value={shown}\n aria-label={props.label}\n tabIndex={open ? 0 : -1}\n disabled={disabled}\n style={{ '--range-fill': `${((shown - min) / (max - min)) * 100}%` } as CSSProperties}\n onPointerDown={() => { dragging.current = true }}\n onPointerUp={(event) => { commit(Number(event.currentTarget.value)) }}\n onPointerCancel={(event) => { commit(Number(event.currentTarget.value)) }}\n onChange={onChange}\n onKeyUp={onKeyUp}\n />\n <span className={css.rangeEnds} aria-hidden=\"true\">\n <span>{min}</span>\n <span>{max}</span>\n </span>\n </div>\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/SegmentGroup.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * The family's segmented control: a quiet track whose options share one\n * highlight that slides to the pressed option, instead of each option fading\n * its own background out and the next one in. The settings fields' small\n * choices and the Web Extensions TAB strip both render through it, so the two\n * read as one control.\n *\n * The caller builds the option buttons and marks the pressed one with\n * `data-active`; the group measures that button after every render and writes\n * its box as four custom properties, and the stylesheet draws the highlight\n * there (`.segmentGroup[data-pill]::before`). Attribute and first placement\n * land in the same task, so the highlight appears in place and only later\n * changes slide. A ResizeObserver re-measures when the group or an option\n * changes size: a longer locale, a font arriving, a container growing, a\n * strip wrapping onto a second line.\n */\n\nimport { Children, useLayoutEffect, useRef, type HTMLAttributes, type ReactNode } from 'react'\nimport css from './settings-card.module.css'\n\n/** The attribute marking a group whose highlight has been placed. */\nconst PILL_ATTR = 'data-pill'\n/** The pressed option, relative to the group. */\nconst ACTIVE_SELECTOR = ':scope > [data-active]'\nconst PILL_PROPERTIES = ['--segment-pill-x', '--segment-pill-y', '--segment-pill-w', '--segment-pill-h'] as const\n\n/** Props of {@link SegmentGroup}: the track's own attributes and the option buttons. */\nexport interface SegmentGroupProps extends HTMLAttributes<HTMLDivElement> {\n /** The option buttons; the pressed one carries `data-active`. */\n children: ReactNode\n}\n\n/**\n * Write the highlight's box from the pressed option's box, or take the\n * highlight off when nothing is pressed or the group has no layout yet.\n * The two boxes are read in viewport pixels and turned back into the group's\n * own CSS pixels, so a dialog that opens through a scale transform still\n * lands the highlight on its option.\n */\nfunction placePill(group: HTMLElement): void {\n const item = group.querySelector<HTMLElement>(ACTIVE_SELECTOR)\n const box = group.getBoundingClientRect()\n if (item === null || group.offsetWidth === 0 || box.width === 0) {\n group.removeAttribute(PILL_ATTR)\n for (const property of PILL_PROPERTIES) group.style.removeProperty(property)\n return\n }\n const scale = box.width / group.offsetWidth\n const itemBox = item.getBoundingClientRect()\n const values = [\n (itemBox.left - box.left) / scale - group.clientLeft,\n (itemBox.top - box.top) / scale - group.clientTop,\n itemBox.width / scale,\n itemBox.height / scale,\n ]\n values.forEach((value, index) => {\n group.style.setProperty(PILL_PROPERTIES[index], `${Math.round(value * 100) / 100}px`)\n })\n if (!group.hasAttribute(PILL_ATTR)) group.setAttribute(PILL_ATTR, '')\n}\n\n/**\n * Render a segmented track around the caller's option buttons.\n * @param props - the track's attributes (role, accessible name, key handler) and its options.\n * @returns the track.\n */\nexport function SegmentGroup(props: SegmentGroupProps): ReactNode {\n const { children, className, ...rest } = props\n const group = useRef<HTMLDivElement | null>(null)\n const count = Children.count(children)\n\n // Placed before the frame is painted, after every render: a press moves the\n // pressed mark and the highlight follows it in the same frame.\n useLayoutEffect(() => {\n if (group.current !== null) placePill(group.current)\n })\n\n useLayoutEffect(() => {\n const element = group.current\n if (element === null || typeof ResizeObserver === 'undefined') return undefined\n const observer = new ResizeObserver(() => { placePill(element) })\n observer.observe(element)\n for (const item of Array.from(element.children)) observer.observe(item)\n return () => { observer.disconnect() }\n }, [count])\n\n return (\n <div {...rest} ref={group} className={className === undefined ? css.segmentGroup : `${css.segmentGroup} ${className}`}>\n {children}\n </div>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/PluginSettingsCard.tsx. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family-shared chrome for plugin settings cards: a disclosure header naming\n * the plugin and what its settings govern, the controls inside, and the line\n * that reports a refused write. A pick is written the moment it is made and a\n * typed value after a pause, so the card has no save button and nothing waits\n * on the reader. Renders nothing while the namespace is unavailable — a\n * deployment that does not compose the owning plugin should show no trace of\n * it. Inlined into each consumer's client bundle; mirrors the official\n * ui-plugin-config PluginCard in a self-contained slice.\n *\n * Every field inside the body is one settings row: the label and its hint on\n * the left, the control on the right, a hairline between two rows; a narrow\n * card stacks the control under the text (settings-card.module.css).\n */\n\nimport { createContext, useCallback, useContext, useEffect, useLayoutEffect, useRef, useState, type KeyboardEvent, type ReactNode } from 'react'\nimport type { CardShell } from './settings-form.ts'\nimport { RangeBubble } from './RangeBubble.tsx'\nimport { SegmentGroup } from './SegmentGroup.tsx'\nimport css from './settings-card.module.css'\n\n/** Copy keys the card chrome itself reads; every consumer locale carries this shared vocabulary. */\nexport const CARD_COPY_KEYS = [\n 'settings.collapse',\n 'settings.expand',\n 'settings.notExposed',\n 'settings.readOnly',\n 'settings.saveFailed',\n] as const\n\n/**\n * What a text field inside a card reaches without its plugin wiring it: write\n * the pending draft now (Enter, leaving the field) or put it back (Escape).\n * Picks need neither; they are written the moment they are made.\n */\nconst CardApply = createContext<{ commit(): void, revert(): void } | null>(null)\n\n/** Copy key the card chrome itself reads. */\nexport type CardCopyKey = (typeof CARD_COPY_KEYS)[number]\n\n/** Key domain for the plugin's own copy (inferred per consumer). */\nexport type SettingsCardKey<TKey extends string = string> = TKey | CardCopyKey\n\n/** Card chrome shared by every plugin settings card. */\nexport interface PluginSettingsCardProps<TKey extends string = string> {\n /** Locale reader for this card's copy. */\n t: (key: SettingsCardKey<TKey>, params?: Record<string, string | number>) => string\n /** Locale key of the plugin's name. */\n titleKey: TKey\n /** Locale key of the line describing what this plugin's settings govern. */\n descriptionKey: TKey\n /** Optional rich header description rendered instead of the plain t(descriptionKey) text (the plain text stays as the tooltip). */\n descriptionNode?: ReactNode\n /**\n * Locale key of the full sentence behind a shortened description: when\n * present, the header's native `title` takes this text while the visible\n * line keeps `descriptionKey`/`descriptionNode`, so a compact card can\n * compress the sentence without keeping a second visible copy of it.\n * Defaults to the description key.\n */\n descriptionTitleKey?: TKey\n /**\n * Optional leading mark identifying the plugin. A card without one keeps the\n * plain official header shape, so the chrome stays a readable sibling of the\n * built-in PluginCard wherever a family plugin lands in the official bundle\n * seat.\n */\n icon?: ReactNode\n /** The card's form state: availability, writability, and how the last write went. */\n state: CardShell\n /** Write every pending draft now: a text field's Enter or blur. */\n onSave: () => void\n /** Drop every pending draft: a text field's Escape. */\n onDiscard: () => void\n /**\n * Id applied to the card's title element, so a header control (an immediate\n * toggle in `headerAction`) can name itself through `aria-labelledby`\n * instead of repeating the title as a string.\n */\n titleId?: string\n /**\n * Render the header only, with no body region. A card whose whole setting is\n * the header control (a switch whose explanation is the description) has no\n * controls to lay out below it, and an empty body would draw a divider line\n * with nothing under it.\n */\n headerOnly?: boolean\n /**\n * Render the controls expanded on arrival (still collapsible). Defaults to\n * true: promoted first-level sections show their settings immediately.\n */\n defaultOpen?: boolean\n /**\n * Render without the collapse affordance: a static header and an always\n * visible body. Used by first-level settings sections whose nav entry\n * already provides the selection.\n */\n alwaysOpen?: boolean\n /**\n * Hide the line under the body that reports a refused write: a card whose\n * body applies its own changes (an embedded external settings section)\n * reports its own failures.\n */\n hideFooter?: boolean\n /**\n * Optional control rendered at the header's trailing edge, before the\n * chevron. A card whose setting is one immediate flip (it\n * applies outside the card's form) puts its ToggleSwitch here, so the control\n * is reachable without opening the card and matches a plugin card's shape.\n */\n headerAction?: ReactNode\n /**\n * Render children even when the settings namespace is not exposed by the\n * host. The 'not exposed' notice still explains the card above them; a card\n * that wants the rows alone hides it through `hideNotExposedNotice`.\n */\n renderChildrenWhenNotExposed?: boolean\n /** Hide the 'not exposed' notice, whichever branch renders the card body. */\n hideNotExposedNotice?: boolean\n /**\n * Compact chrome for a topic card rendered inside another card's body: a\n * smaller title, a tighter header and body inset, and a one-line description\n * whose full text stays on the header's own title. Defaults to the\n * first-level chrome, which is unchanged.\n */\n density?: 'nested'\n /** The plugin's controls. */\n children: ReactNode\n}\n\n/** Length of the body's disclosure motion; it matches `--settings-card-motion` on the card root. */\nconst BODY_MOTION_MS = 180\n\n/**\n * Lifecycle of one card body. `collapsed` is the mounted-but-closed frame the\n * enter leg starts from, `entering` and `closing` are the two moving legs, and\n * `shown` is the settled open body, which releases its clipping box.\n */\ntype BodyPhase = 'hidden' | 'collapsed' | 'entering' | 'shown' | 'closing'\n\n/**\n * Render one plugin settings card.\n * @param props - the plugin's copy keys, its form state, and its controls.\n * @returns the card, or nothing while the namespace is still loading.\n */\nexport function PluginSettingsCard<TKey extends string = string>(props: PluginSettingsCardProps<TKey>) {\n const [open, setOpen] = useState(props.defaultOpen ?? true)\n const { state, alwaysOpen } = props\n const expanded = alwaysOpen === true || open\n const [bodyPhase, setBodyPhase] = useState<BodyPhase>(expanded ? 'shown' : 'hidden')\n const bodyRef = useRef<HTMLDivElement | null>(null)\n // Enter and leave run the same pair: a body that should open is mounted\n // closed for one frame so its transition has a state to leave, and a closing\n // one stays mounted until its leg has run.\n useLayoutEffect(() => {\n if (expanded) {\n if (bodyPhase === 'hidden') setBodyPhase('collapsed')\n else if (bodyPhase === 'collapsed') {\n const node = bodyRef.current\n if (node !== null) void node.offsetHeight\n setBodyPhase('entering')\n } else if (bodyPhase === 'closing') setBodyPhase('entering')\n return\n }\n if (bodyPhase === 'collapsed') setBodyPhase('hidden')\n else if (bodyPhase === 'entering' || bodyPhase === 'shown') setBodyPhase('closing')\n }, [expanded, bodyPhase])\n useEffect(() => {\n if (bodyPhase !== 'entering' && bodyPhase !== 'closing') return\n const timer = setTimeout(() => {\n setBodyPhase(bodyPhase === 'entering' ? 'shown' : 'hidden')\n }, BODY_MOTION_MS)\n return () => { clearTimeout(timer) }\n }, [bodyPhase])\n if (!state.available) return null\n const title = props.t(props.titleKey)\n const description = props.t(props.descriptionKey)\n const descriptionTitle = props.descriptionTitleKey === undefined ? description : props.t(props.descriptionTitleKey)\n const baseClass = expanded ? `${css.cardOpen} ${css.card}` : css.card\n const cardClass = props.density === 'nested' ? `${baseClass} ${css.cardNested}` : baseClass\n /** The body region both legs share; a hidden phase renders nothing at all. */\n const bodyRegion = (content: ReactNode) => bodyPhase === 'hidden'\n ? null\n : (\n <div className={css.disclosure} data-state={bodyPhase} ref={bodyRef}>\n <div className={css.body}>{content}</div>\n </div>\n )\n // With alwaysOpen the nav entry already provides the selection, so the\n // header is a static title row instead of a disclosure button.\n const header = alwaysOpen === true\n ? (\n <div className={css.headerStatic}>\n {props.icon !== undefined ? <span className={css.mark} aria-hidden=\"true\">{props.icon}</span> : null}\n <span className={css.headText}>\n <span className={css.name} id={props.titleId} title={title}>{title}</span>\n <span className={css.description} title={descriptionTitle}>{props.descriptionNode ?? description}</span>\n </span>\n {props.headerAction !== undefined ? <span className={css.headerAction}>{props.headerAction}</span> : null}\n </div>\n )\n : (\n <button\n type=\"button\"\n className={css.header}\n aria-expanded={open}\n aria-label={`${props.t(open ? 'settings.collapse' : 'settings.expand')}: ${title}`}\n onClick={() => { setOpen(!open) }}\n >\n {props.icon !== undefined ? <span className={css.mark} aria-hidden=\"true\">{props.icon}</span> : null}\n <span className={css.headText}>\n <span className={css.name} id={props.titleId} title={title}>{title}</span>\n <span className={css.description} title={descriptionTitle}>{props.descriptionNode ?? description}</span>\n </span>\n {props.headerAction !== undefined ? <span className={css.headerAction}>{props.headerAction}</span> : null}\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.chevron} ${css.chevronOpen}` : css.chevron}\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n )\n // The namespace exists but the Host does not serve it to this client (the\n // official settings allowlist omits third-party namespaces): show a card\n // that explains the gap instead of vanishing, so a missing card never\n // reads as a missing plugin. A card that keeps its rows anyway keeps the\n // same explanation above them, unless it hides the notice outright.\n const notExposedNotice = state.exposed || props.hideNotExposedNotice === true\n ? null\n : <p className={css.notExposed} role=\"status\">{props.t('settings.notExposed')}</p>\n if (!state.exposed && props.renderChildrenWhenNotExposed !== true) {\n return (\n <li className={cardClass}>\n {header}\n {bodyRegion(notExposedNotice)}\n </li>\n )\n }\n // A header-only card has no body region at all: the divider would otherwise\n // sit above an empty box.\n const bodyVisible = props.headerOnly !== true\n return (\n <li className={cardClass}>\n {header}\n {bodyVisible\n ? bodyRegion(\n <>\n {notExposedNotice}\n {!state.writable ? <p className={css.readOnly} role=\"status\">{props.t('settings.readOnly')}</p> : null}\n <CardApply.Provider value={{ commit: props.onSave, revert: props.onDiscard }}>\n {props.children}\n </CardApply.Provider>\n {props.hideFooter !== true && state.failed\n ? (\n <p className={css.failed} role=\"status\">\n {props.t('settings.saveFailed')}{state.failedReason ? ' - ' + state.failedReason : ''}\n </p>\n )\n : null}\n </>,\n )\n : null}\n </li>\n )\n}\n\n/** Props every field control needs regardless of its value type. */\nexport interface FieldProps {\n /** Stable id associating the label with its control. */\n id: string\n /** Visible label. */\n label: string\n /** One-line explanation rendered under the control. */\n hint: string\n /**\n * Full sentence behind the visible hint, exposed as the paragraph's native\n * `title` so a card can shorten the line without losing the text. Omitted:\n * the paragraph carries no title attribute at all.\n */\n hintTitle?: string\n /** Draft text this control renders. */\n text: string\n /** True when the field holds a user-layer entry over the inherited value. */\n overridden: boolean\n /** True when the draft is not a value this field accepts. */\n invalid: boolean\n /** Copy for the overridden badge. */\n overriddenLabel: string\n /** Copy for the reset control. */\n resetLabel: string\n /** Copy shown in place of the hint while the draft is invalid. */\n invalidLabel: string\n /** Disables every control (read-only document, or an unavailable namespace). */\n disabled: boolean\n /** Take new draft text; the card writes it as the field's entry rule says. */\n onEdit: (text: string) => void\n /** Clear the field at once so it re-inherits the composition layer. */\n onReset: () => void\n}\n\n/**\n * A typed value field. Its draft is written after a pause in typing, at once on\n * Enter or when focus leaves, and Escape puts the stored value back. `numeric`\n * only hints the keypad: which drafts a field accepts is decided by its spec.\n * A field given a `range` also offers the coarse slider bubble: dragging fills\n * the draft live and releasing writes it.\n */\nexport function ValueField(props: FieldProps & {\n /** Hints a numeric keypad without narrowing what the control accepts. */\n numeric?: boolean\n /** Placeholder shown while the draft is empty. */\n placeholder?: string\n /** Bounds of a numeric field, for the coarse slider; the spec still judges every draft. */\n range?: { min: number, max: number, step: number }\n}) {\n const apply = useContext(CardApply)\n // Enter and Escape settle the draft themselves and then leave the field, so\n // the blur they cause is that same settlement reaching the field's edge, not\n // a second write. Without this an Escape reported a discard and then a save,\n // which reads to a consumer as a write still waiting to happen.\n const settledByKey = useRef(false)\n const onKeyDown = (event: KeyboardEvent<HTMLInputElement>) => {\n if (apply === null || (event.key !== 'Enter' && event.key !== 'Escape')) return\n event.preventDefault()\n settledByKey.current = true\n if (event.key === 'Enter') apply.commit()\n else apply.revert()\n event.currentTarget.blur()\n }\n const input = (\n <input\n id={props.id}\n className={props.invalid ? css.inputInvalid : css.input}\n type=\"text\"\n {...props.numeric === true ? { inputMode: 'numeric' as const } : {}}\n {...props.invalid ? { 'aria-invalid': true } : {}}\n value={props.text}\n placeholder={props.placeholder ?? ''}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n onKeyDown={onKeyDown}\n onFocus={() => { settledByKey.current = false }}\n onBlur={() => {\n if (settledByKey.current) {\n settledByKey.current = false\n return\n }\n apply?.commit()\n }}\n />\n )\n const { range } = props\n const typed = Number(props.text)\n return (\n <div className={css.field}>\n <div className={css.head}>\n <label className={css.label} htmlFor={props.id}>{props.label}</label>\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {range === undefined\n ? input\n : (\n <RangeBubble\n min={range.min}\n max={range.max}\n step={range.step}\n value={props.text.trim() === '' || Number.isNaN(typed) ? range.min : typed}\n label={`${props.label} ${range.min}–${range.max}`}\n disabled={props.disabled}\n onInput={(value) => { props.onEdit(String(value)) }}\n onCommit={(value) => {\n props.onEdit(String(value))\n apply?.commit()\n }}\n >\n {input}\n </RangeBubble>\n )}\n <p className={props.invalid ? css.invalid : css.hint} title={props.hintTitle}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\nconst NON_SKIN_BODY_MARKERS = new Set(['dshSkinCenter', 'dshSidebarCollapsed'])\n// 检测使用使用皮肤,用了皮肤退回原生select样式,防止样式冲突。默认外观下使用优化后的select样式。\nfunction isSkinActive(): boolean {\n const datasetList = Object.keys(document.body.dataset)\n const isActive = datasetList.some(key => key.startsWith('dsh') && !NON_SKIN_BODY_MARKERS.has(key))\n return isActive\n}\n\ninterface SelectOption {\n value: string\n label: string\n}\n\nconst SELECT_CLOSE_MS = 100\n\n/**\n * The shared dual-mode select control. While an appearance skin is active it\n * renders the legacy native `<select>` untouched, so element-level skin\n * selectors keep working; under the default appearance it renders a\n * self-drawn `role=\"listbox\"` popup whose open/close is transition-animated.\n * Cards reach it through BooleanField/ChoiceField; editors outside a card\n * (the side-card prefs) bind it directly through onEdit.\n * 双模式下拉框:皮肤激活时用原生 select,默认外观用自绘动画弹层。\n */\nexport function SelectField(props: {\n id: string\n options: ReadonlyArray<SelectOption>\n value: string\n disabled: boolean\n invalid: boolean\n onEdit: (text: string) => void\n}) {\n const { id, options, value } = props\n const [open, setOpen] = useState(false)\n const [closing, setClosing] = useState(false)\n const [phase, setPhase] = useState<'initial' | 'open'>('initial')\n const [activeIndex, setActiveIndex] = useState(0)\n const closeTimer = useRef<ReturnType<typeof setTimeout> | undefined>(undefined)\n const wrapRef = useRef<HTMLDivElement | null>(null)\n const popupRef = useRef<HTMLDivElement | null>(null)\n\n const currentIndex = () => {\n const index = options.findIndex(option => option.value === value)\n return index >= 0 ? index : 0\n }\n\n const close = useCallback(() => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n setClosing(true)\n closeTimer.current = setTimeout(() => {\n setClosing(false)\n setOpen(false)\n }, SELECT_CLOSE_MS)\n }, [])\n\n const openPopup = () => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n setActiveIndex(currentIndex())\n setPhase('initial')\n setClosing(false)\n setOpen(true)\n }\n\n const commit = (index: number) => {\n const option = options[index]\n if (option) props.onEdit(option.value)\n close()\n }\n\n const onTriggerClick = () => {\n if (props.disabled) return\n if (open && !closing) close()\n else openPopup()\n }\n\n const onKeyDown = (event: KeyboardEvent<HTMLButtonElement>) => {\n if (props.disabled) return\n const count = options.length\n switch (event.key) {\n case 'ArrowDown':\n case 'ArrowUp':\n case 'Enter':\n case ' ':\n event.preventDefault()\n if (!open) {\n openPopup()\n } else if (!closing) {\n if (event.key === 'ArrowDown') setActiveIndex(index => (index + 1) % count)\n else if (event.key === 'ArrowUp') setActiveIndex(index => (index - 1 + count) % count)\n else commit(activeIndex)\n }\n break\n case 'Escape':\n if (open) {\n event.preventDefault()\n event.stopPropagation()\n close()\n }\n break\n case 'Tab':\n if (open) close()\n break\n }\n }\n\n useEffect(() => () => {\n if (closeTimer.current !== undefined) clearTimeout(closeTimer.current)\n }, [])\n useLayoutEffect(() => {\n if (open && !closing && phase === 'initial') {\n void popupRef.current?.offsetHeight\n setPhase('open')\n }\n }, [open, closing, phase])\n\n useEffect(() => {\n if (!open) return\n const onPointerDown = (event: PointerEvent) => {\n const target = event.target\n if (target instanceof Node && !wrapRef.current?.contains(target)) close()\n }\n document.addEventListener('pointerdown', onPointerDown)\n return () => document.removeEventListener('pointerdown', onPointerDown)\n }, [open, close])\n\n useEffect(() => {\n if (props.disabled && open) close()\n }, [props.disabled, open, close])\n\n // 使用了皮肤则退回原生select样式防止样式冲突。\n if (isSkinActive()) {\n return (\n <select\n id={id}\n className={css.select}\n value={value}\n disabled={props.disabled}\n onChange={(event) => { props.onEdit(event.target.value) }}\n >\n {options.map(option => (\n <option key={option.value} value={option.value}>{option.label}</option>\n ))}\n </select>\n )\n }\n\n const label = options.find(option => option.value === value)?.label ?? ''\n const popupClass = closing\n ? `${css.selectPopup} ${css.selectPopupClose}`\n : phase === 'open'\n ? `${css.selectPopup} ${css.selectPopupOpen}`\n : css.selectPopup\n return (\n <div className={css.selectWrap} ref={wrapRef}>\n <button\n type=\"button\"\n id={id}\n className={`${css.select} ${css.selectButton}`}\n disabled={props.disabled}\n aria-haspopup=\"listbox\"\n aria-expanded={open}\n aria-activedescendant={open ? `${id}-o${activeIndex}` : undefined}\n aria-invalid={props.invalid || undefined}\n onClick={onTriggerClick}\n onKeyDown={onKeyDown}\n >\n <span className={css.selectLabel}>{label}</span>\n <svg\n width=\"14\"\n height=\"14\"\n viewBox=\"0 0 14 14\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n className={open ? `${css.selectChevron} ${css.selectChevronOpen}` : css.selectChevron}\n aria-hidden=\"true\"\n >\n <path\n d=\"M11.8486 5.5L11.4238 5.92383L8.69727 8.65137C8.44157 8.90706 8.21562 9.13382 8.01172 9.29785C7.79912 9.46883 7.55595 9.61756 7.25 9.66602C7.08435 9.69222 6.91565 9.69222 6.75 9.66602C6.44405 9.61756 6.20088 9.46883 5.98828 9.29785C5.78438 9.13382 5.55843 8.90706 5.30273 8.65137L2.57617 5.92383L2.15137 5.5L3 4.65137L3.42383 5.07617L6.15137 7.80273C6.42595 8.07732 6.59876 8.24849 6.74023 8.3623C6.87291 8.46904 6.92272 8.47813 6.9375 8.48047C6.97895 8.48703 7.02105 8.48703 7.0625 8.48047C7.07728 8.47813 7.12709 8.46904 7.25977 8.3623C7.40124 8.24849 7.57405 8.07732 7.84863 7.80273L10.5762 5.07617L11 4.65137L11.8486 5.5Z\"\n fill=\"currentColor\"\n />\n </svg>\n </button>\n {open\n ? (\n <div className={popupClass} role=\"listbox\" ref={popupRef}>\n {options.map((option, index) => (\n <div\n key={option.value}\n id={`${id}-o${index}`}\n role=\"option\"\n aria-selected={option.value === value}\n className={`${css.selectOption}${option.value === value ? ` ${css.selectOptionSelected}` : ''}${index === activeIndex && !closing ? ` ${css.selectOptionActive}` : ''}`}\n onClick={() => { commit(index) }}\n >\n {option.label}\n </div>\n ))}\n </div>\n )\n : null}\n </div>\n )\n}\n\n/**\n * A visible segmented group for a small set of mutually exclusive values.\n * Every option stays on screen, so inherit/on/off and short enum fields take\n * one click without opening a popup. The pressed option carries the group's\n * sliding highlight and `aria-pressed`; the group takes the field label as its\n * accessible name.\n */\nexport function SegmentField(props: {\n id: string\n label: string\n options: ReadonlyArray<SelectOption>\n value: string\n disabled: boolean\n invalid: boolean\n onEdit: (text: string) => void\n}) {\n return (\n <SegmentGroup\n id={props.id}\n role=\"group\"\n aria-label={props.label}\n aria-invalid={props.invalid || undefined}\n >\n {props.options.map((option, index) => {\n const active = option.value === props.value\n return (\n <button\n key={option.value}\n type=\"button\"\n className={css.segment}\n aria-pressed={active}\n disabled={props.disabled}\n data-active={active ? '' : undefined}\n data-segment-index={index}\n onClick={() => {\n if (!active) props.onEdit(option.value)\n }}\n >\n {option.label}\n </button>\n )\n })}\n </SegmentGroup>\n )\n}\n\n/** How a small single-choice field presents its options. */\nexport type FieldPresentation = 'select' | 'segment'\n\n/** A boolean field: 继承 / 开 / 关. */\nexport function BooleanField(props: FieldProps & {\n /** Copy for the inherit option. */\n inheritLabel: string\n /** Copy for the on option. */\n onLabel: string\n /** Copy for the off option. */\n offLabel: string\n /** Defaults to the visible segments: the three answers always fit on one row. */\n presentation?: FieldPresentation\n}) {\n const segmented = props.presentation !== 'select'\n return (\n <div className={css.field}>\n <div className={css.head}>\n {segmented\n ? <span className={css.label}>{props.label}</span>\n : <label className={css.label} htmlFor={props.id}>{props.label}</label>}\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {segmented\n ? (\n <SegmentField\n id={props.id}\n label={props.label}\n options={[\n { value: '', label: props.inheritLabel },\n { value: 'true', label: props.onLabel },\n { value: 'false', label: props.offLabel },\n ]}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )\n : (\n <SelectField\n id={props.id}\n options={[\n { value: '', label: props.inheritLabel },\n { value: 'true', label: props.onLabel },\n { value: 'false', label: props.offLabel },\n ]}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )}\n <p className={css.hint} title={props.hintTitle}>{props.hint}</p>\n </div>\n )\n}\n\n/** An enumerated field, selecting or segmenting its small choice set. */\nexport function ChoiceField(props: FieldProps & {\n /** Copy for the inherit option (draft text is the empty string). */\n inheritLabel: string\n /** Choices rendered in order; `value` is the draft/stored text. */\n choices: ReadonlyArray<{ value: string; label: string }>\n /**\n * Visible segmented options for a short fixed set; defaults to the compact\n * select, which also suits a list whose length follows the deployment.\n */\n presentation?: FieldPresentation\n}) {\n const segmented = props.presentation === 'segment'\n const options = [{ value: '', label: props.inheritLabel }, ...props.choices]\n return (\n <div className={css.field}>\n <div className={css.head}>\n {segmented\n ? <span className={css.label}>{props.label}</span>\n : <label className={css.label} htmlFor={props.id}>{props.label}</label>}\n {props.overridden\n ? (\n <span className={css.badges}>\n <span className={css.badge}>{props.overriddenLabel}</span>\n <button\n type=\"button\"\n className={css.reset}\n disabled={props.disabled}\n onClick={props.onReset}\n >\n {props.resetLabel}\n </button>\n </span>\n )\n : null}\n </div>\n {segmented\n ? (\n <SegmentField\n id={props.id}\n label={props.label}\n options={options}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )\n : (\n <SelectField\n id={props.id}\n options={options}\n value={props.text}\n disabled={props.disabled}\n invalid={props.invalid}\n onEdit={props.onEdit}\n />\n )}\n <p className={props.invalid ? css.invalid : css.hint} title={props.hintTitle}>\n {props.invalid ? props.invalidLabel : props.hint}\n </p>\n </div>\n )\n}\n\n/**\n * A boolean toggle drawn as a switch track, for a setting that is only on or\n * off and applies on flip. It is a real button with\n * `role=\"switch\"` and `aria-checked`, so keyboard and assistive activation\n * arrive as a click and the state is announced instead of inferred from a\n * checkbox tick.\n *\n * The thumb bounces across only once the reader has pressed this switch: the\n * press writes the mark that arms the bounce, so a page opening, a TAB\n * switching back or a value arriving from elsewhere draws every thumb at rest.\n */\nexport function ToggleSwitch(props: {\n /** Id of the element naming the switch (the card's title). */\n labelledBy?: string\n /** Accessible name when no element labels it. */\n ariaLabel?: string\n /** Current state. */\n checked: boolean\n /** Disables the switch while a write is in flight or the Host refuses writes. */\n disabled?: boolean\n /** Called with the requested next state. */\n onChange: (next: boolean) => void\n}) {\n const [moved, setMoved] = useState(false)\n return (\n <button\n type=\"button\"\n className={css.toggle}\n role=\"switch\"\n aria-checked={props.checked}\n aria-labelledby={props.labelledBy}\n aria-label={props.labelledBy === undefined ? props.ariaLabel : undefined}\n disabled={props.disabled}\n data-moved={moved ? '' : undefined}\n onClick={() => {\n setMoved(true)\n props.onChange(!props.checked)\n }}\n >\n <span className={css.toggleTrack}><span className={css.toggleThumb} /></span>\n </button>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Form model behind the plugin settings card. Every control applies itself:\n * a pick (a segment, a select option, a reset) writes the moment it is made,\n * and typed text writes once typing pauses or the reader leaves the field.\n * Between the edit and the write the edit is held here as a draft, so what is\n * on screen is exactly what the write will store; a write the Host refuses\n * puts a pick back to the stored value and keeps typed text for correcting.\n * Family-shared slice inlined into each plugin's client bundle.\n */\n\nimport type { ConfigForm, ConfigFormSnapshot } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { createSnapshotStore } from '@deepseek-ai/dsh-client-store'\n\n/** The write one field's draft text performs when it is applied. */\nexport type FieldWrite =\n | { kind: 'set'; value: unknown }\n | { kind: 'clear' }\n\n/** How one field converts between its stored value and its draft text. */\nexport interface FieldSpec {\n /** Field name inside the namespace section. */\n field: string\n /**\n * How the reader enters a value, which decides when it is written: a `pick`\n * is a whole value at once and applies immediately; `type` is text arriving\n * a keystroke at a time and applies once typing pauses or the field is left.\n */\n entry: 'pick' | 'type'\n /**\n * Whether the Host treats this field as a secret and redacts its value from\n * the read-back (role('secret') in the section schema). Redacted secrets are\n * never compared against the draft on save: the Host strips them from every\n * wire view layer, so the settled snapshot carries nothing to read back. A\n * staged secret set is judged by the mutation settling; the rest of its\n * batch, when one exists, is still judged by read-back, and the atomic\n * mutation lands every write or none.\n */\n secret?: boolean\n /** Render a stored value as draft text; the empty string when the section carries none. */\n format: (value: unknown) => string\n /**\n * The write this draft text performs, or undefined when the text is not a\n * value this field accepts — which holds the draft unwritten rather than\n * discarding it.\n */\n parse: (text: string) => FieldWrite | undefined\n}\n\n/** One field as the card renders it. */\nexport interface FieldState {\n /** Draft text the control renders. */\n text: string\n /** Whether the field leaves (or will leave) a user-layer entry. */\n overridden: boolean\n /** Whether the draft is not a value this field accepts, which holds it unwritten. */\n invalid: boolean\n}\n\n/** Form state every plugin settings card shares. */\nexport interface CardShell {\n /** False while the namespace is still loading; the card renders nothing. */\n available: boolean\n /**\n * Whether the namespace is actually served to this client. False when the\n * Host deployment does not expose it (e.g. the owning plugin's settings\n * domain is not mounted): the card renders an explanation\n * instead of its form, so a missing namespace never looks like a missing\n * plugin.\n */\n exposed: boolean\n /** Whether the Host document accepts writes. */\n writable: boolean\n /** Whether the form holds drafts not yet written (typed text waiting for its pause). */\n dirty: boolean\n /** Whether any draft is invalid, which holds it unwritten. */\n invalid: boolean\n /** Whether a write is crossing the wire. */\n saving: boolean\n /** Whether the last write did not land; cleared by the next edit or write. */\n failed: boolean\n /**\n * The rejection code/message the Host returned for the last failed save,\n * surfaced next to the generic failure text. Undefined while no save has\n * failed (or the failure carried no server reason).\n */\n failedReason?: string\n}\n\n/** The write actions the card's slot entry injects. */\nexport interface CardActions {\n /** Take draft text for one field; a pick writes at once, typed text after a pause. */\n edit: (field: string, text: string) => void\n /** Clear one field at once, so it re-inherits the composition layer. */\n resetField: (field: string) => void\n /** Write every pending draft now (a text field's Enter or blur), then re-seed from what the Host accepted. */\n save: () => void\n /** Drop every pending draft, putting each control back to the stored value (a text field's Escape). */\n discard: () => void\n}\n\n/** How long typed text rests before it is written. */\nexport const TYPE_PAUSE_MS = 600\n\n/** One field's staged edit. */\ninterface StagedEdit {\n /** Draft text the control renders. */\n text: string\n /** True when this edit clears the field whatever text it shows. */\n clear: boolean\n}\n\n/** One staged edit resolved into the write a save performs. */\ninterface PlannedWrite {\n /** Field this entry writes. */\n field: string\n /** The durable write this entry performs, inside the save's one atomic mutation. */\n op: BatchedWrite\n /**\n * Read the settled snapshot back and report whether the Host holds this\n * write's effect. Undefined when the draft is not a value the field\n * accepts: there is nothing to write, and the entry blocks the save.\n */\n judge: (() => boolean) | undefined\n}\n\n/** One durable write inside the save's atomic form mutation. */\nexport interface BatchedWrite {\n /** Field this entry writes. */\n field: string\n /** set stores a value; unset drops the leaf. */\n op: 'set' | 'unset'\n /** Value for op set (absent for unset). */\n value?: unknown\n}\n\n/** Constraints a numeric field's accepted drafts must satisfy, mirroring the host schema. */\nexport interface NumberConstraints {\n /** The accepted value must be a whole number. */\n integer?: boolean\n /** The accepted value must be at least this. */\n min?: number\n /** The accepted value must be at most this. */\n max?: number\n}\n\n/** A whole- or decimal-number field. An empty draft clears the field; any other draft that is not a finite number within the constraints stays unwritten. */\nexport function numberField(field: string, constraints: NumberConstraints = {}): FieldSpec {\n const { integer = false, min, max } = constraints\n return {\n field,\n entry: 'type',\n format: value => typeof value === 'number' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n const parsed = Number(trimmed)\n if (!Number.isFinite(parsed)) return undefined\n if (integer && !Number.isInteger(parsed)) return undefined\n if (min !== undefined && parsed < min) return undefined\n if (max !== undefined && parsed > max) return undefined\n return { kind: 'set', value: parsed }\n },\n }\n}\n\n/**\n * A free-text field. An empty draft clears the field. `entry` is `pick` when\n * the text arrives whole from a picker (a preset or a reasoning level).\n */\nexport function textField(field: string, entry: FieldSpec['entry'] = 'type'): FieldSpec {\n return {\n field,\n entry,\n format: value => typeof value === 'string' ? value : '',\n parse: (text) => {\n const trimmed = text.trim()\n return trimmed === '' ? { kind: 'clear' } : { kind: 'set', value: trimmed }\n },\n }\n}\n\n/**\n * A free-text field the Host treats as a secret and redacts from the read-back\n * (role('secret') in the section schema). The card still edits it like text,\n * but a save never compares the redacted value back: the staged set is judged\n * by the mutation settling (see {@link FieldSpec.secret}).\n */\nexport function secretField(field: string): FieldSpec {\n return { ...textField(field), secret: true }\n}\n\n/** A boolean field, edited through true/false draft text. */\nexport function booleanField(field: string): FieldSpec {\n return {\n field,\n entry: 'pick',\n format: value => typeof value === 'boolean' ? String(value) : '',\n parse: (text) => {\n const trimmed = text.trim()\n if (trimmed === '') return { kind: 'clear' }\n if (trimmed === 'true') return { kind: 'set', value: true }\n if (trimmed === 'false') return { kind: 'set', value: false }\n return undefined\n },\n }\n}\n\n/** An enumerated string field; only the listed choices are accepted. An empty draft clears the field. */\nexport function choiceField(field: string, choices: readonly string[]): FieldSpec {\n return {\n field,\n entry: 'pick',\n format: value => typeof value === 'string' && choices.includes(value) ? value : '',\n parse: (text) => {\n if (text === '') return { kind: 'clear' }\n return choices.includes(text) ? { kind: 'set', value: text } : undefined\n },\n }\n}\n\n/**\n * Applies one card's edits to one settings namespace as the reader makes them.\n *\n * The Host is the only authority on whether a value was accepted — its\n * validators own the constraints no schema can express — so the outcome is\n * read back from the section rather than predicted here. A write that did not\n * land puts each pick back to the stored value, the way a switch that could not\n * flip springs back, and keeps typed text so the reader can correct it instead\n * of retyping.\n */\nexport class CardForm<T> {\n private readonly specs: Map<string, FieldSpec>\n private readonly staged = new Map<string, StagedEdit>()\n private readonly listeners = new Set<() => void>()\n /** The form subscription installed in the constructor; released by dispose(). */\n private readonly disposeForm: () => void\n private disposed = false\n /** The pending write of typed text, waiting for typing to pause. */\n private typePause: ReturnType<typeof setTimeout> | undefined\n private saving = false\n /** A save asked for while one was in flight; it runs once the first settles (#1754). */\n private saveQueued = false\n private failed = false\n private failedReason: string | undefined\n\n /** @param scope - the bound configuration form for this card's namespace. */\n constructor(\n private readonly scope: ConfigForm<T>,\n specs: FieldSpec[],\n ) {\n this.specs = new Map(specs.map(spec => [spec.field, spec]))\n this.disposeForm = scope.subscribe(() => { this.publish() })\n }\n\n /**\n * Release the form subscription and every bound store listener. The card\n * must call this on teardown; later calls are no-ops.\n */\n dispose(): void {\n if (this.disposed) return\n this.disposed = true\n clearTimeout(this.typePause)\n this.disposeForm()\n this.listeners.clear()\n }\n\n /** Publish a projection of this form, rebuilt whenever the form or a draft changes. */\n bind<S>(project: () => S): SnapshotStore<S> {\n const store = createSnapshotStore(project())\n this.listeners.add(() => { store.set(project()) })\n return store\n }\n\n /** Read the card-level state: what the Host serves, and what is still waiting to be written. */\n shell(): CardShell {\n const snapshot = this.scope.getSnapshot()\n const plan = this.plan()\n return {\n available: snapshot.status !== 'loading',\n exposed: snapshot.status === 'ready',\n writable: snapshot.writable,\n dirty: plan.length > 0,\n invalid: plan.some(item => item.judge === undefined),\n saving: this.saving,\n failed: this.failed,\n ...this.failedReason === undefined ? {} : { failedReason: this.failedReason },\n }\n }\n\n /** Read one field's state from the effective section and its staged draft. */\n field(field: string): FieldState {\n const spec = this.specOf(field)\n const staged = this.staged.get(field)\n if (staged === undefined) {\n return { text: spec.format(this.sectionValue(field)), overridden: this.stored(field), invalid: false }\n }\n const write = staged.clear ? { kind: 'clear' as const } : spec.parse(staged.text)\n return {\n text: staged.text,\n overridden: write?.kind === 'set',\n invalid: write === undefined,\n }\n }\n\n /** The actions the card's slot registration injects. */\n actions(): CardActions {\n return {\n edit: (field, text) => { this.stage(field, { text, clear: false }) },\n resetField: (field) => {\n this.stage(field, { text: this.specOf(field).format(this.baseValue(field)), clear: true })\n },\n save: () => { this.applyNow() },\n discard: () => {\n clearTimeout(this.typePause)\n if (this.staged.size === 0 && !this.failed) return\n this.staged.clear()\n this.failed = false\n this.failedReason = undefined\n this.publish()\n },\n }\n }\n\n /**\n * Run one write, and re-run it once if another was asked for while this one\n * was still in flight.\n *\n * A write is a Host round trip that also drives the profile reconcile, and\n * the Host runs it inside one exclusive transaction. Answering an edit that\n * arrives mid-flight by returning immediately dropped it with no explanation\n * (#1754). Serializing instead means an edit made while another write is\n * still settling is written against the settled state.\n * @returns settlement after the mutation and the read-back.\n */\n async requestSave(): Promise<void> {\n if (this.saving) {\n this.saveQueued = true\n return\n }\n await this.save()\n if (!this.saveQueued) return\n this.saveQueued = false\n await this.requestSave()\n }\n\n /**\n * Write every valid draft in one atomic form mutation, then re-seed from\n * what the Host accepted. A draft the field does not accept stays on screen,\n * unwritten, without holding the others back.\n *\n * The batch rides one mutate, so cross-field validate hooks (baseURL+model)\n * judge it as a unit: the Host either applies every write or refuses the\n * batch. The form contract answers a refusal or a skipped write with `false`\n * (it recovers with a fresh Host view instead of throwing), so the outcome is\n * judged twice: the answer itself, and then the settled snapshot read back\n * one planned write at a time. One missed write fails the whole batch. A\n * transport that rejects instead (the dsh-web bridge controller on a dead\n * connection) reports through the same failure path with its rejection\n * message. A batch that did not land puts its picks and clears back to the\n * stored value and keeps its typed text, so the reader can correct it.\n * @returns settlement after the mutation and the read-back.\n */\n async save(): Promise<void> {\n const plan = this.plan()\n const valid = plan.filter((item): item is PlannedWrite & { judge: () => boolean } => item.judge !== undefined)\n if (valid.length === 0 || this.saving) return\n // Snapshot the staged entries this write carries, so an edit staged while\n // it is in flight (which replaces the same key) survives: only settle the\n // key when the entry is still the one this write started from.\n const pending = new Map<string, StagedEdit | undefined>()\n for (const item of valid) pending.set(item.field, this.staged.get(item.field))\n this.saving = true\n this.failed = false\n this.failedReason = undefined\n this.publish()\n // One atomic namespace mutation: the form contract takes ordered path\n // operations, so the whole staged batch is validated, persisted, and\n // recovered together — either every write lands or none does.\n const ops: Array<{ op: 'set'; path: string[]; value: string | number | boolean } | { op: 'unset'; path: string[] }> = valid.map(item => item.op.op === 'set'\n ? { op: 'set', path: [item.field], value: (item.op as { value: string | number | boolean }).value }\n : { op: 'unset', path: [item.field] })\n let failedReason: string | undefined\n let accepted = false\n try {\n accepted = await this.scope.mutate(ops)\n } catch (error) {\n failedReason = error instanceof Error ? error.message : String(error)\n }\n // `false` is the contract's refusal/skip answer, and the form still\n // resolves after a refusal (it recovers with a fresh view), so the answer\n // alone is not enough: judge every planned write against the settled\n // snapshot as well. The mutation is atomic, so one missed write fails the\n // whole save and keeps the drafts.\n const landed = accepted && failedReason === undefined && valid.every(item => item.judge())\n for (const [field, before] of pending) {\n if (this.staged.get(field) !== before) continue\n if (landed || before === undefined || before.clear || this.specOf(field).entry === 'pick') this.staged.delete(field)\n }\n this.saving = false\n this.failed = !landed\n // A refused or unlanded batch carries no server reason: the card surfaces\n // its generic failure copy; a rejecting transport (the bridge) adds its\n // message.\n this.failedReason = failedReason\n this.publish()\n }\n\n /**\n * Every staged edit a write would carry. An entry whose draft is not a value\n * its field accepts carries no write: the form is still dirty, and the draft\n * stays on screen rather than being dropped. A staged edit that matches the\n * effective section is not a write at all.\n * @returns the planned writes, in the order the fields were staged.\n */\n private plan(): PlannedWrite[] {\n const plan: PlannedWrite[] = []\n for (const [field, staged] of this.staged) {\n const spec = this.specOf(field)\n if (staged.clear) {\n if (this.stored(field)) plan.push({ field, op: { field, op: 'unset' }, judge: () => this.landedUnset(field) })\n continue\n }\n if (staged.text === spec.format(this.sectionValue(field))) continue\n const write = spec.parse(staged.text)\n if (write === undefined) plan.push({ field, op: { field, op: 'unset' }, judge: undefined })\n else if (write.kind === 'clear') plan.push({ field, op: { field, op: 'unset' }, judge: () => this.landedUnset(field) })\n else plan.push({ field, op: { field, op: 'set', value: write.value }, judge: () => this.landedSet(field, write.value) })\n }\n return plan\n }\n\n /**\n * Read-back judgment for a planned set: the user layer must hold the\n * intended value once the mutation has settled.\n */\n private landedSet(field: string, value: unknown): boolean {\n // A redacted secret never appears in any wire view layer: the Host strips\n // role('secret') fields and reports them through a sidecar the form\n // snapshot does not expose, so there is nothing to compare the draft\n // against. Settling is the only signal the form has; the rest of the\n // batch, when one exists, still carries the atomic verdict by read-back.\n if (this.specOf(field).secret) return true\n return jsonValuesEqual(this.userLayer()?.[field], value)\n }\n\n /**\n * Read-back judgment for a planned unset: the field must be gone from the\n * user layer once the mutation has settled.\n */\n private landedUnset(field: string): boolean {\n return !this.stored(field)\n }\n\n /**\n * Take one edit and schedule its write: a pick or a clear is written now,\n * typed text once typing has rested for TYPE_PAUSE_MS.\n */\n private stage(field: string, edit: StagedEdit): void {\n this.staged.set(field, edit)\n this.failed = false\n this.failedReason = undefined\n this.publish()\n if (edit.clear || this.specOf(field).entry === 'pick') {\n this.applyNow()\n return\n }\n clearTimeout(this.typePause)\n this.typePause = setTimeout(() => { this.applyNow() }, TYPE_PAUSE_MS)\n }\n\n /** Write every pending draft now, taking the place of a waiting pause. */\n private applyNow(): void {\n clearTimeout(this.typePause)\n this.typePause = undefined\n if (this.disposed) return\n void this.requestSave()\n }\n\n private specOf(field: string): FieldSpec {\n const spec = this.specs.get(field)\n // Every call site names a field this card declared; a missing one is a\n // wiring mistake that must not degrade into a silently inert control.\n if (spec === undefined) throw new Error(`settings card has no field ${field}`)\n return spec\n }\n\n private snapshotOf(): ConfigFormSnapshot<T> {\n return this.scope.getSnapshot()\n }\n\n private sectionValue(field: string): unknown {\n return (this.snapshotOf().value as Record<string, unknown> | undefined)?.[field]\n }\n\n private baseValue(field: string): unknown {\n return (this.snapshotOf().base as Record<string, unknown> | undefined)?.[field]\n }\n\n private userLayer(): Record<string, unknown> | undefined {\n return this.snapshotOf().user as Record<string, unknown> | undefined\n }\n\n private stored(field: string): boolean {\n const user = this.userLayer()\n return user !== undefined && Object.hasOwn(user, field)\n }\n\n private publish(): void {\n for (const listener of this.listeners) listener()\n }\n}\n\n/** Structural equality for JSON settings values (primitives, arrays, plain objects). */\nfunction jsonValuesEqual(left: unknown, right: unknown): boolean {\n if (Object.is(left, right)) return true\n if (typeof left !== 'object' || left === null || typeof right !== 'object' || right === null) return false\n if (Array.isArray(left) || Array.isArray(right)) {\n if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false\n return left.every((item, index) => jsonValuesEqual(item, right[index]))\n }\n const a = left as Record<string, unknown>\n const b = right as Record<string, unknown>\n const keysA = Object.keys(a).filter(key => a[key] !== undefined)\n const keysB = Object.keys(b).filter(key => b[key] !== undefined)\n if (keysA.length !== keysB.length) return false\n return keysA.every(key => Object.hasOwn(b, key) && jsonValuesEqual(a[key], b[key]))\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-entry-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n// Generated by scripts/sync-shared.mjs from shared/client/settings/settings-entry-form.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family settings form bound to the profile entry id a Host actually serves.\n *\n * Under the 0.1.7 settings model a form is addressed by PROFILE ENTRY ID, while\n * a family card knows only its own settings namespace. The family binder\n * (`ctx.get('webUiSettings')`, published by dsh-web-settings) resolves one onto\n * the other and is the preferred transport; this module is the fallback for a\n * page that serves no binder — the group plugin is not installed, or its client\n * half has not applied yet (the aggregate mounts its children in order, and a\n * child still waiting on its own injects publishes nothing).\n *\n * The shared describe mirror is the only local evidence of which row id this\n * profile serves, but it answers asynchronously: at plugin activation it usually\n * holds nothing yet. A one-shot guess therefore cannot be right for every\n * deployment, and the form is bound once per session:\n *\n * - binding the bare namespace made every save answer `No configurable plugin\n * entry \"<namespace>\"` on an aggregate install (the namespace is not an entry\n * id there), which the card reported as \"the deployment did not accept these\n * values\";\n * - binding the aggregate row id would break a standalone install, whose row id\n * is the namespace or the package's own `ui-*` row.\n *\n * So the fallback starts on the most likely row and REBINDS the moment the\n * mirror names one of this package's rows. Until the mirror answers, the form\n * reports the binding it holds (usually `loading`), which the card renders as an\n * unavailable form rather than a doomed one.\n */\nimport type { ConfigForm, ConfigFormSnapshot, ConfigForms } from '@deepseek-ai/dsh-client-ui-settings/client'\n\n/** Options of {@link createServedEntryForm}. */\nexport interface ServedEntryFormOptions<_T> {\n /** The shared configuration forms service (`ctx.configForms`). */\n forms: ConfigForms\n /**\n * Profile entry ids this package's rows carry, most likely first: the\n * aggregate's generated row, the package's own standalone row, then the bare\n * namespace. The first is the fallback while the mirror has no answer; the\n * last is the answer when the mirror serves none of them.\n */\n entryIds: readonly string[]\n}\n\n/** The snapshot a form reports before the Host has answered with this entry. */\nfunction pendingSnapshot<T>(): ConfigFormSnapshot<T> {\n return {\n status: 'loading',\n value: undefined,\n base: undefined,\n user: undefined,\n revision: undefined,\n writable: false,\n }\n}\n\n/**\n * Create a settings form bound to the profile entry id this Host serves, and\n * rebound whenever the shared describe mirror names a different one of this\n * package's rows.\n * @param options - the shared forms service and this package's candidate row ids.\n * @returns a form delegating to the currently resolved entry's own form.\n */\nexport function createServedEntryForm<T>(options: ServedEntryFormOptions<T>): ConfigForm<T> {\n const { forms, entryIds } = options\n const fallbackId = entryIds[0]\n const namespaceId = entryIds[entryIds.length - 1]\n const listeners = new Set<() => void>()\n let boundId: string | undefined\n let bound: ConfigForm<T> | undefined\n let offBound: (() => void) | undefined\n let snapshot: ConfigFormSnapshot<T> = pendingSnapshot<T>()\n\n /** Republish: the delegated snapshot when one is bound, the pending one otherwise. */\n const publish = (): void => {\n if (bound !== undefined) snapshot = bound.getSnapshot()\n for (const listener of [...listeners]) listener()\n }\n\n /**\n * The entry id the mirror currently justifies. An unanswered or empty mirror\n * is not evidence of absence, so it keeps the first candidate; a mirror that\n * answers without any of this package's rows leaves the namespace itself.\n * @returns the entry id to bind.\n */\n const resolve = (): string => {\n let served: readonly string[] | undefined\n try {\n served = forms.describe().getSnapshot().view?.namespaces.map(row => row.ns)\n } catch {\n // A mirror that refuses the read is unanswered too, not absent.\n served = undefined\n }\n if (served === undefined || served.length === 0) return fallbackId\n return entryIds.find(id => served.includes(id)) ?? namespaceId\n }\n\n /** Bind (or rebind) the resolved entry's form; a no-op while it is unchanged. */\n const bind = (): void => {\n const target = resolve()\n if (target === boundId) return\n offBound?.()\n offBound = undefined\n let form: ConfigForm<T>\n try {\n form = forms.get<T>(target)\n } catch {\n // A service that refuses the id stays unbound; the next mirror answer\n // retries rather than pinning a wrong entry for the session.\n boundId = undefined\n return\n }\n boundId = target\n bound = form\n offBound = form.subscribe(() => { publish() })\n publish()\n }\n\n // The mirror subscription lives for the page: the card owns its form for the\n // session, and the ConfigForm contract carries no disposer to hang it on. The\n // callback is cheap (a resolve plus a no-op while the id is unchanged). A\n // mirror without a subscription seat keeps the initial binding.\n try {\n forms.describe().subscribe(() => { bind() })\n } catch {\n // A describe face that refuses the subscription: the initial binding stands.\n }\n bind()\n\n return {\n getSnapshot: () => snapshot,\n subscribe: (listener) => {\n listeners.add(listener)\n return () => { listeners.delete(listener) }\n },\n set: (field, value) => bound?.set(field, value) ?? Promise.resolve(false),\n unset: (field) => bound?.unset(field) ?? Promise.resolve(false),\n mutate: (ops, expectedRevision) => bound?.mutate(ops, expectedRevision) ?? Promise.resolve(false),\n }\n}\n","/**\n * The real-browser CDP settings card for the Web Extensions plugin list.\n * @module @linxin666/dsh-client-ui-browser-view/client/settings-card\n */\n\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\nimport type { InjectFace, PropsLocale, PropsRuntime } from '@deepseek-ai/dsh-client-ui-slots'\nimport type { ConfigForm } from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type { SnapshotStore } from '@deepseek-ai/dsh-client-store'\nimport { PluginSettingsCard, BooleanField, ValueField } from './PluginSettingsCard.tsx'\nimport { CardForm, booleanField, numberField, textField, type CardActions, type CardShell, type FieldState } from './settings-form.ts'\nimport { createServedEntryForm } from './settings-entry-form.ts'\nimport { BrowserViewGuideGlyph } from './guide-icon.tsx'\n\n/** Fields shared with the host's real-browser schema. */\nexport interface BrowserViewSettings {\n realBrowserEnabled?: boolean\n cdpEndpoint?: string\n idleCloseDays?: number\n}\n\n/** Card projection bound by the renderer. */\nexport interface BrowserViewSettingsCardState extends CardShell {\n realBrowserEnabled: FieldState\n cdpEndpoint: FieldState\n idleCloseDays: FieldState\n}\n\n/** Registration-side snapshot and write actions. */\nexport interface BrowserViewSettingsCardFace extends CardActions {\n hooks: {\n browserViewSettingsCard: SnapshotStore<BrowserViewSettingsCardState>\n }\n}\n\n/** Bind the existing browser-view namespace, never a second settings document. */\nexport function bindBrowserViewSettingsForm(ctx: ClientContext): ConfigForm<BrowserViewSettings> {\n return createServedEntryForm<BrowserViewSettings>({\n forms: ctx.configForms,\n entryIds: ['web-ui-browser-view', 'ui-browser-view', 'browser-view'],\n })\n\n}\n\n/** Bridge the native volatile form onto the shared staged card form. */\nexport class BrowserViewSettingsCardController {\n private readonly form: CardForm<BrowserViewSettings>\n private readonly store: SnapshotStore<BrowserViewSettingsCardState>\n\n constructor(scope: ConfigForm<BrowserViewSettings>) {\n this.form = new CardForm(scope, [\n booleanField('realBrowserEnabled'),\n textField('cdpEndpoint'),\n numberField('idleCloseDays', { integer: true, min: 0 }),\n ])\n this.store = this.form.bind(() => this.projection())\n }\n\n private projection(): BrowserViewSettingsCardState {\n return {\n ...this.form.shell(),\n realBrowserEnabled: this.form.field('realBrowserEnabled'),\n cdpEndpoint: this.form.field('cdpEndpoint'),\n idleCloseDays: this.form.field('idleCloseDays'),\n }\n }\n\n inject(): BrowserViewSettingsCardFace {\n return { hooks: { browserViewSettingsCard: this.store }, ...this.form.actions() }\n }\n\n dispose(): void {\n this.form.dispose()\n }\n}\n\n/** Props supplied by the Web Extensions plugin-item seat. */\nexport type BrowserViewSettingsCardProps =\n PropsRuntime<'web-ui.plugin.item'>\n & PropsLocale<'browser-view'>\n & InjectFace<BrowserViewSettingsCardFace>\n\n/** Render the real-browser card with the same chrome and field semantics as its siblings. */\nexport function BrowserViewSettingsCard(props: BrowserViewSettingsCardProps) {\n const { t } = props\n const state = props.useBrowserViewSettingsCard(snapshot => snapshot)\n const shared = {\n overriddenLabel: t('settings.overridden'),\n resetLabel: t('settings.reset'),\n invalidLabel: t('settings.invalidValue'),\n disabled: !state.writable,\n }\n return (\n <PluginSettingsCard\n t={t}\n titleKey=\"settings.title\"\n descriptionKey=\"settings.description\"\n icon={<BrowserViewGuideGlyph size={18} />}\n defaultOpen={false}\n state={state}\n onSave={props.save}\n onDiscard={props.discard}\n >\n <BooleanField\n id=\"settings-browser-view-real\"\n label={t('settings.enabled')}\n hint={t('settings.enabledHint')}\n inheritLabel={t('settings.inherit')}\n onLabel={t('settings.on')}\n offLabel={t('settings.off')}\n {...shared}\n {...state.realBrowserEnabled}\n onEdit={(text) => { props.edit('realBrowserEnabled', text) }}\n onReset={() => { props.resetField('realBrowserEnabled') }}\n />\n <ValueField\n id=\"settings-browser-view-endpoint\"\n label={t('settings.cdpEndpoint')}\n hint={t('settings.cdpEndpointHint')}\n placeholder=\"http://127.0.0.1:9222\"\n {...shared}\n {...state.cdpEndpoint}\n onEdit={(text) => { props.edit('cdpEndpoint', text) }}\n onReset={() => { props.resetField('cdpEndpoint') }}\n />\n <ValueField\n id=\"settings-browser-view-idle-days\"\n label={t('settings.idleCloseDays')}\n hint={t('settings.idleCloseDaysHint')}\n placeholder=\"3\"\n numeric\n {...shared}\n {...state.idleCloseDays}\n onEdit={(text) => { props.edit('idleCloseDays', text) }}\n onReset={() => { props.resetField('idleCloseDays') }}\n />\n </PluginSettingsCard>\n )\n}\n","// Generated by scripts/sync-shared.mjs from shared/client/settings/plugin-card-seat.ts. Do not edit this copy; edit the shared source and run \"node scripts/sync-shared.mjs\".\n/**\n * Family plugin-card seat.\n *\n * A family plugin contributes its settings card to whichever plugin-card seat\n * the running host actually renders:\n *\n * - `web-ui.plugin.item` — the list seat declared by the dsh-web-settings\n * group section (this family's own first-level \"Web UI plugins\" section);\n * - `plugins.bundle.config` — the official keyed seat of the harness's plugin\n * manager page, keyed by the bundle's package name and rendered on that\n * bundle's page. alpha.2 removed the `settings.plugin.item` keyed seat of the\n * `ui-settings-plugins` tab that this helper used before, so a card keyed by\n * its settings namespace has no seat to land in any more.\n *\n * SEAT SELECTION IS NOT A DECLARATION PROBE. The official plugin surface\n * belongs to the harness bundle and declares its seats before any external\n * plugin's `apply()` runs, so \"is the official seat declared?\" answers yes even\n * in the deployment whose whole point is the family group. Choosing on that\n * probe sends every family card to the official page and leaves the group's own\n * section permanently empty — the family of reports where the section renders\n * its heading and zero cards.\n *\n * The signal that actually distinguishes the two deployments is whether\n * dsh-web-settings is loaded: it is the package that owns the group section and\n * it publishes the `webUiSettings` service during `apply()`, which every\n * family plugin already reads for its settings form. Group loaded -> the family\n * seat; group absent -> the official seat.\n *\n * The decision is re-evaluated on every `slots/changed` because the group may\n * apply after this plugin (the family aggregate orders it first, a profile that\n * installs the group separately need not): the initial contribution goes to the\n * official seat, then moves to the family seat the moment the group's section\n * registers. The entry is disposed before the replacement is registered, so a\n * card is never in two seats at once.\n *\n * The shared tree has no client-SDK dependency, so this module reads its\n * context through the structural shape below; callers pass the plugin's own\n * `ctx`.\n */\n\n/** The family list seat key. */\nexport const FAMILY_PLUGIN_CARD_SEAT = 'web-ui.plugin.item'\n\n/** The official keyed plugin-card seat key (the alpha.2 bundle-configuration seat). */\nexport const OFFICIAL_PLUGIN_CARD_SEAT = 'plugins.bundle.config'\n\n/** The service dsh-web-settings publishes while it is loaded. */\nexport const FAMILY_GROUP_SERVICE = 'webUiSettings'\n\n/** The slot-registry member this helper uses (structurally satisfied by ctx.slots). */\nexport interface PluginCardSlots {\n /** Contribution of one card entry. */\n register(options: never, component: never): unknown\n /** Declaration probe: a target seat may appear after this plugin applies. */\n spec?(key: string): unknown\n}\n\n/** The slice of the client context a card contribution needs. */\nexport interface PluginCardContext {\n slots: PluginCardSlots\n /** Service lookup; absent on a context double that only models the slots. */\n get?(name: string): unknown\n /** Event subscription seat; absent on an event-less test double. */\n on?(event: never, listener: never): unknown\n}\n\n/** Owner share of a family list-seat card (that seat supplies nothing). */\nexport interface SettingsPluginItemOwnerProps {\n /** Marker field: card owner props are intentionally empty. */\n children?: never\n}\n\n/** One family plugin's card contribution. */\nexport interface PluginCardSeat {\n /**\n * Npm package name of the bundle this card configures; the official keyed\n * seat dispatches on it. Every family package ships its own bundle patch, so\n * a standalone install lists that package as the bundle whose page renders\n * this card.\n */\n bundle: string\n /** Family list-seat entry id. */\n id: string\n /** Family list-seat sort order. */\n order?: number\n /** Family list-seat display label; the official keyed seat carries none. */\n label?: () => string\n /** Locale namespace the card renders with. */\n locale: string\n /**\n * Child slots this card declares and renders. Forwarded to whichever seat\n * the host renders; absent for a card that declares none.\n */\n children?: Record<string, unknown>\n /** Business-face factory of the registration. */\n inject?: () => object\n /**\n * The card component. Its props type is the seat's composed shape, which is\n * chosen at runtime, so the helper takes it erased; the registrant keeps its\n * own precise typing at the call site.\n */\n component: unknown\n}\n\n/**\n * Whether the family group (dsh-web-settings) is loaded in this page. The\n * service is the group package's own contract, so the probe cannot be fooled\n * by a harness release that starts declaring the official seat differently.\n */\nexport function familyGroupLoaded(ctx: PluginCardContext): boolean {\n const get = ctx.get\n if (typeof get !== 'function') return false\n try {\n return get.call(ctx, FAMILY_GROUP_SERVICE) !== undefined\n } catch {\n // A context that refuses the lookup: treat the group as absent, which\n // falls back to the official seat the harness declares.\n return false\n }\n}\n\n/** Report a refused registration instead of leaving the user with no card. */\nfunction warnRefusedSeat(seat: string, error: unknown): void {\n try {\n console.warn(`[dsh-web] plugin card registration into \"${seat}\" was refused; the card will not render`, error)\n } catch {\n // Best-effort console write; a failed warning must not break the plugin.\n }\n}\n\n/**\n * Contribute one family plugin card to the seat this host renders, following\n * the group if it loads later. The entry is disposed and re-registered on a\n * seat change, never duplicated.\n * @param ctx - client context (its slot registry decides the seat).\n * @param seat - the card contribution.\n */\nexport function installPluginCard(ctx: PluginCardContext, seat: PluginCardSeat): void {\n const slots = ctx.slots\n const component = seat.component as never\n const inject = seat.inject as never\n\n let dispose: (() => void) | undefined\n let current: string | undefined\n /**\n * Re-entrancy latch. The registry emits a change event synchronously from\n * inside both `register` and the previous entry's disposer, so an unguarded\n * reconcile would re-enter itself mid-move and register the card twice into\n * the seat it is leaving (\"already has an entry for key ...\").\n */\n let reconciling = false\n\n /** Reconcile the contribution with the currently live seat (no-op when unchanged). */\n const reconcile = (): void => {\n if (reconciling) return\n const target = familyGroupLoaded(ctx) ? FAMILY_PLUGIN_CARD_SEAT : OFFICIAL_PLUGIN_CARD_SEAT\n if (current === target) return\n // The group's child seat can be declared after this card applies (the\n // parent mounts its pages through the extension service). Wait for the\n // declaration instead of logging a refused registration on every boot.\n if (typeof slots.spec === 'function' && slots.spec(target) === undefined) return\n reconciling = true\n const previous = dispose\n dispose = undefined\n current = undefined\n previous?.()\n try {\n dispose = slots.register((target === FAMILY_PLUGIN_CARD_SEAT\n ? {\n name: FAMILY_PLUGIN_CARD_SEAT,\n id: seat.id,\n ...(seat.order === undefined ? {} : { order: seat.order }),\n ...(seat.label === undefined ? {} : { label: seat.label }),\n locale: seat.locale,\n ...(seat.children === undefined ? {} : { children: seat.children }),\n ...(seat.inject === undefined ? {} : { inject }),\n }\n : {\n name: OFFICIAL_PLUGIN_CARD_SEAT,\n key: seat.bundle,\n locale: seat.locale,\n ...(seat.children === undefined ? {} : { children: seat.children }),\n ...(seat.inject === undefined ? {} : { inject }),\n }) as never, component) as () => void\n current = target\n } catch (error) {\n warnRefusedSeat(target, error)\n } finally {\n reconciling = false\n }\n }\n\n if (typeof ctx.on === 'function') {\n try {\n ctx.on('slots/changed' as never, (() => { reconcile() }) as never)\n } catch {\n // An event seat that refuses the subscription leaves the initial\n // decision in place; the card still renders in the seat chosen below.\n }\n }\n // The initial decision: the group, when it is already loaded (the aggregate\n // order), otherwise the official seat the harness declares.\n reconcile()\n}\n","/**\n * Browser-half entry for the browser-view plugin - runs inside the dsh web GUI.\n *\n * The browser view is a tab in the official right sidebar, beside the\n * conversation, not a page that takes the whole window. It contributes exactly\n * the seats a tab type needs, and only those:\n * - `sidebarRightTabs.register` (stage one): the static tab type - its id, its\n * kind ('browser-view'), the band it ranks in, the chip's initial text and the\n * guide capsule that opens it from the column's own tab strip.\n * - 'sidebar.right.pane.tab' + 'sidebar.right.pane.tab.title' (stage two, one\n * keyed registration each under the SAME id): the tab's body and its chip\n * contents, which is exactly the shape the shipped terminal tab uses.\n *\n * The session-header shortcut is deliberately gone: the column's tab strip and\n * the guide capsule already open the tab, so a second entry in the conversation\n * header only crowded that row.\n *\n * `main` and 'sidebar.panellist' are deliberately NOT registered any more: the\n * first took the whole center column over, and the second put a row in the\n * shell's global panel list that addressed that column. A right-sidebar tab\n * needs neither.\n *\n * The two slot seats go through `ctx.slots.inject` so the contribution waits for\n * the owning plugin to declare the seat: load order between this plugin and the\n * sidebar plugin therefore does not matter, and a shell that cannot serve a seat\n * simply leaves the surface absent.\n *\n * Export discipline (packages/AGENTS.md): the /client surface carries only what\n * cordis loading needs plus types.\n */\nimport type { Context as ClientContext } from '@deepseek-ai/cordis'\n// Type-only: pulls the locale plugin's Context merge (ctx.locale) and its\n// LocaleNamespaceMap merge table.\nimport type {} from '@deepseek-ai/dsh-client-locale/client'\n// Type-only: pulls the renderer's ctx.slots merge (the slot registry).\nimport type {} from '@deepseek-ai/dsh-client-ui-renderer/client'\n// Type-only: merges the Plugins page's row-configuration seat contract.\nimport type {} from '@deepseek-ai/dsh-client-ui-plugin-manager/client'\nimport type {} from '@deepseek-ai/dsh-client-ui-settings/client'\nimport type {} from '@deepseek-ai/dsh-api-remotes/client'\n// Type-only: pulls the sidebar service's Context merge (ctx.sidebarRightTabs) and\n// the two pane SlotMap declarations it owns.\nimport type {} from '@deepseek-ai/dsh-client-ui-sidebar-right/client'\nimport { createLiveTitleStore } from './live-title.ts'\nimport { en, zh, type BrowserViewKey } from './locales.ts'\nimport { BrowserViewPanel } from './panel.tsx'\nimport { BROWSER_VIEW_TAB_ID, browserViewTabDefinition } from './tab-type.ts'\nimport { BrowserViewTabTitle } from './tab-title.tsx'\nimport { BROWSER_VIEW_CONFIG_KEYS, BrowserViewConfig } from './config.tsx'\nimport { bindBrowserViewSettingsForm, BrowserViewSettingsCard, BrowserViewSettingsCardController } from './BrowserViewSettingsCard.tsx'\nimport { installPluginCard } from './plugin-card-seat.ts'\n\ndeclare module '@deepseek-ai/dsh-client-ui-slots' {\n interface LocaleNamespaceMap {\n /** Browser-view surface copy. */\n 'browser-view': BrowserViewKey\n }\n\n interface SlotMap {\n /** The Web Extensions plugin card seat. */\n 'web-ui.plugin.item': { kind: 'list'; scope: 'root'; owner: { children?: never } }\n }\n}\n\n/** Dictionary namespace owned by this plugin. */\nconst NS = 'browser-view'\n\n/** Services required by this plugin. */\nexport const inject = ['slots', 'locale', 'sidebarRightTabs', 'configForms', 'remote']\n\n/**\n * Register the browser-view tab type and its surfaces.\n * @param ctx - client root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => {\n try {\n return ctx.locale.register(NS, { zh, en })\n } catch {\n return () => {}\n }\n }, 'browser-view: dictionaries')\n\n // The tab type's chip text and the guide capsule's copy are resolved on every\n // read, so the thunk below must translate at call time rather than bake a\n // language in at boot.\n let translate: ((key: BrowserViewKey) => string) | undefined\n try {\n translate = ctx.locale.bind(NS)\n } catch {\n // A locale face that cannot bind leaves the chip on its source-language copy.\n }\n const copy = (key: BrowserViewKey): string => translate?.(key) ?? zh[key]\n\n // Stage one: the static type. Without it an open of this kind throws, so the\n // registration is the seat everything else depends on - the column's tab strip\n // and its guide capsule both read this definition to offer the tab.\n ctx.effect(() => {\n try {\n return ctx.sidebarRightTabs.register(browserViewTabDefinition(copy))\n } catch {\n return () => {}\n }\n }, 'browser-view: tab type')\n\n // The one channel between the tab body and its own chip: the body learns the\n // streamed page's title, the chip shows it.\n const liveTitle = createLiveTitleStore()\n\n // Stage two, body: the tab's content, under the type's own id.\n ctx.slots.inject('sidebar.right.pane.tab', () => {\n try {\n return ctx.slots.register(\n {\n name: 'sidebar.right.pane.tab',\n key: BROWSER_VIEW_TAB_ID,\n locale: NS,\n inject: (sessionId: string) => ({ sessionId, liveTitle }),\n },\n BrowserViewPanel,\n )\n } catch {\n return () => {}\n }\n })\n\n // Stage two, title: the chip's contents, same key, same face.\n ctx.slots.inject('sidebar.right.pane.tab.title', () => {\n try {\n return ctx.slots.register(\n {\n name: 'sidebar.right.pane.tab.title',\n key: BROWSER_VIEW_TAB_ID,\n locale: NS,\n inject: (sessionId: string) => ({ sessionId, liveTitle }),\n },\n BrowserViewTabTitle,\n )\n } catch {\n return () => {}\n }\n })\n\n // The Host schema supplies values; this seat makes them reachable from the\n // bundle row in the Plugins page for both standalone and aggregate mounts.\n ctx.slots.inject('plugins.row.config', () => {\n const disposers: Array<() => void> = []\n for (const key of BROWSER_VIEW_CONFIG_KEYS) {\n try {\n disposers.push(ctx.slots.register({ name: 'plugins.row.config', key, locale: NS }, BrowserViewConfig))\n } catch {\n // A host without the row still keeps the browser-view surfaces.\n }\n }\n return () => { for (const dispose of disposers) dispose() }\n })\n\n // The same volatile form also renders as a card in Web Extensions. The helper\n // migrates it between the family list and the official bundle config seat.\n const settingsCard = new BrowserViewSettingsCardController(bindBrowserViewSettingsForm(ctx))\n installPluginCard(ctx, {\n bundle: '@linxin666/dsh-client-ui-browser-view',\n id: 'browser-view',\n order: 95,\n locale: NS,\n inject: () => settingsCard.inject(),\n component: BrowserViewSettingsCard,\n })\n ctx.effect(() => () => { settingsCard.dispose() }, 'browser-view: settings card')\n}\n\nexport type { BrowserViewPanelFace, BrowserViewPanelProps, BrowserViewSocketFactory } from './panel.tsx'\nexport type { BrowserViewLiveTitleStore } from './live-title.ts'\nexport type { BrowserViewTabParams } from './tab-type.ts'\nexport type { BrowserViewTabTitleFace, BrowserViewTabTitleProps } from './tab-title.tsx'\nexport type { BrowserViewFrame, BrowserViewSocketStatus } from './socket.ts'\nexport type { BrowserViewKey } from './locales.ts'\n"],"mappings":";;;;;;;;;;;;;;;EAwCA,SAAgB,uBAAkD;GAChE,MAAM,yBAAS,IAAI,IAAoB;GACvC,MAAM,4BAAY,IAAI,IAAgB;GACtC,MAAM,eAAqB;IAEzB,KAAK,MAAM,YAAY,CAAC,GAAG,SAAS,GAAG,SAAS;GAClD;GACA,OAAO;IACL,IAAI,WAAmD;KACrD,OAAO,cAAc,KAAA,IAAY,KAAA,IAAY,OAAO,IAAI,SAAS;IACnE;IACA,IAAI,WAA+B,OAAiC;KAClE,IAAI,cAAc,KAAA,GAAW;KAC7B,MAAM,UAAU,OAAO,IAAI,SAAS;KACpC,IAAI,UAAU,KAAA,KAAa,MAAM,WAAW,GAAG;MAC7C,IAAI,YAAY,KAAA,GAAW;MAC3B,OAAO,OAAO,SAAS;MACvB,OAAO;MACP;KACF;KACA,IAAI,YAAY,OAAO;KACvB,OAAO,IAAI,WAAW,KAAK;KAC3B,OAAO;IACT;IACA,UAAU,UAAkC;KAC1C,UAAU,IAAI,QAAQ;KACtB,aAAa;MACX,UAAU,OAAO,QAAQ;KAC3B;IACF;GACF;EACF;;;;;;;;;;;;;;;;;;;;ECrDA,MAAa,KAAK;GAChB,aAAa;GACb,qBAAqB;GACrB,sBAAsB;GACtB,mBAAmB;GACnB,uBAA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