dsh-provider-proxy 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/client.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
- "sources": ["../src/client.css", "../src/client.ts"],
4
- "sourcesContent": ["\nvar __dshMap = {\"root\":\"6d45ff27_root\",\"lead\":\"57c30143_lead\",\"empty\":\"b6600f2d_empty\",\"card\":\"0ba90fef_card\",\"cardActive\":\"923630a9_cardActive\",\"cardHead\":\"5af7e7c3_cardHead\",\"cardTitles\":\"8448919c_cardTitles\",\"name\":\"0b023e00_name\",\"id\":\"ffa6a1c5_id\",\"pillOn\":\"85972c09_pillOn\",\"pillLive\":\"d3644cdc_pillLive\",\"pillOff\":\"592bd7b2_pillOff\",\"toggle\":\"9efc135e_toggle\",\"field\":\"93a03683_field\",\"label\":\"0bd1d3ec_label\",\"hint\":\"52d56786_hint\",\"input\":\"f6748c5e_input\",\"testButton\":\"eb3b08bd_testButton\",\"diag\":\"4d4b11ef_diag\",\"diagSummary\":\"2e565ce0_diagSummary\",\"diagList\":\"fb9c7553_diagList\"};\nvar __dshStyles = (globalThis.__dshPluginStyles || (globalThis.__dshPluginStyles = new Set()));\nif (!__dshStyles.has(\"dsh-provider-proxy/client.css\")) {\n __dshStyles.add(\"dsh-provider-proxy/client.css\");\n var __dshStyle = document.createElement('style');\n __dshStyle.setAttribute('data-plugin-css', \"dsh-provider-proxy/client.css\");\n __dshStyle.textContent = \"/* dsh-provider-proxy \u2014 provider proxy settings page.\\n Tokens only: no literal colours, matching the shared --dsw-* system. */\\n\\n.6d45ff27_root {\\n display: flex;\\n flex-direction: column;\\n gap: 12px;\\n max-width: 640px;\\n}\\n\\n.57c30143_lead {\\n margin: 0 0 4px;\\n font-size: 12px;\\n line-height: 1.6;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.b6600f2d_empty {\\n margin: 0;\\n padding: 16px;\\n border: 1px dashed var(--dsw-alias-border-l1);\\n border-radius: 8px;\\n font-size: 12px;\\n text-align: center;\\n color: var(--dsw-alias-state-idle-primary);\\n}\\n\\n/* ---- provider card ---- */\\n\\n.0ba90fef_card,\\n.923630a9_cardActive {\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n padding: 12px 14px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 10px;\\n background: var(--dsw-alias-bg-layer-1);\\n}\\n\\n.923630a9_cardActive {\\n border-color: var(--dsw-alias-state-success-primary);\\n background: var(--dsw-alias-bg-layer-2);\\n}\\n\\n.5af7e7c3_cardHead {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n gap: 12px;\\n}\\n\\n.8448919c_cardTitles {\\n display: flex;\\n align-items: baseline;\\n gap: 8px;\\n min-width: 0;\\n}\\n\\n.0b023e00_name {\\n overflow: hidden;\\n font-size: 13px;\\n font-weight: 600;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n color: var(--dsw-alias-label-primary);\\n}\\n\\n.ffa6a1c5_id {\\n flex: none;\\n padding: 1px 6px;\\n border-radius: 4px;\\n background: var(--dsw-alias-bg-layer-2);\\n font-family: ui-monospace, monospace;\\n font-size: 11px;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n/* ---- status pill ---- */\\n\\n.85972c09_pillOn,\\n.d3644cdc_pillLive,\\n.592bd7b2_pillOff {\\n flex: none;\\n padding: 2px 8px;\\n border-radius: 999px;\\n font-size: 11px;\\n font-weight: 500;\\n white-space: nowrap;\\n}\\n\\n.85972c09_pillOn {\\n background: var(--dsw-alias-state-success-primary);\\n color: var(--dsw-alias-bg-base);\\n}\\n\\n.d3644cdc_pillLive {\\n border: 1px solid var(--dsw-alias-border-l2);\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.592bd7b2_pillOff {\\n color: var(--dsw-alias-state-idle-primary);\\n}\\n\\n/* ---- toggle ---- */\\n\\n.9efc135e_toggle {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n padding-top: 2px;\\n font-size: 12px;\\n color: var(--dsw-alias-label-primary);\\n cursor: pointer;\\n}\\n\\n.9efc135e_toggle input {\\n accent-color: var(--dsw-alias-brand-primary);\\n cursor: pointer;\\n}\\n\\n/* ---- fields ---- */\\n\\n.93a03683_field {\\n display: grid;\\n grid-template-columns: 96px 1fr;\\n align-items: center;\\n gap: 10px;\\n font-size: 12px;\\n}\\n\\n.0bd1d3ec_label {\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.52d56786_hint {\\n grid-column: 2;\\n margin-top: -2px;\\n font-size: 11px;\\n color: var(--dsw-alias-state-warn-primary);\\n}\\n\\n.f6748c5e_input {\\n box-sizing: border-box;\\n width: 100%;\\n min-width: 0;\\n padding: 5px 8px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 6px;\\n outline: none;\\n background: var(--dsw-alias-bg-layer-1);\\n color: var(--dsw-alias-label-primary);\\n font: inherit;\\n font-size: 12px;\\n transition: border-color 120ms ease, background 120ms ease;\\n}\\n\\n/* The base look of every input is INLINE too, so these three state rules only\\n ever take effect as author-important declarations \u2014 same reason as the\\n self-check button above. `cursor` has no inline base and needs none, and the\\n hover border uses `l3` because `l1`\u2192`l2` is a 4%\u219210% black step nobody can\\n see. */\\n\\n.f6748c5e_input:hover:not(:disabled) {\\n border-color: var(--dsw-alias-border-l3) !important;\\n}\\n\\n.f6748c5e_input:focus {\\n border-color: var(--dsw-alias-brand-primary) !important;\\n}\\n\\n.f6748c5e_input:disabled {\\n color: var(--dsw-alias-state-idle-primary) !important;\\n background: var(--dsw-alias-bg-layer-2) !important;\\n cursor: not-allowed;\\n}\\n\\n/* ---- self-check ---- */\\n\\n/* The hover state is the one thing an inline style cannot express, which is why\\n this element carries a class at all. Layout stays inline.\\n\\n Two traps, both hit before this comment existed:\\n - `!important` is load-bearing: the base border and background are INLINE, and\\n the cascade sorts a style attribute after every author rule, so a plain\\n declaration here would ship, match, and still lose.\\n - the TOKENS must be visible ones. `bg-layer-1/2/3` all resolve to\\n `neutral-bluish-00` in the light theme, so a layer swap is a no-op there, and\\n `border-l1`\u2192`l2` is 4%\u219210% black on a 1px line. The app's own hovers use\\n `interactive-bg-hover`; using it here is what makes the feedback exist. */\\n.eb3b08bd_testButton {\\n transition: border-color 120ms ease, background 120ms ease;\\n}\\n\\n.eb3b08bd_testButton:hover:not(:disabled) {\\n border-color: var(--dsw-alias-border-l3) !important;\\n background: var(--dsw-alias-interactive-bg-hover) !important;\\n}\\n\\n/* ---- diagnostics ---- */\\n\\n.4d4b11ef_diag {\\n margin-top: 2px;\\n padding: 8px 10px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 8px;\\n font-size: 11px;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.2e565ce0_diagSummary {\\n cursor: pointer;\\n color: var(--dsw-alias-state-warn-primary);\\n}\\n\\n.fb9c7553_diagList {\\n margin: 6px 0 0;\\n padding-left: 18px;\\n font-family: ui-monospace, monospace;\\n word-break: break-all;\\n}\\n\";\n document.head.appendChild(__dshStyle);\n}\nmodule.exports = __dshMap;\nmodule.exports.default = __dshMap;\nmodule.exports.__esModule = true;\n", "/**\r\n * dsh-provider-proxy \u2014 browser half.\r\n *\r\n * Contributes ONE settings page (a `settings.section` list entry) that lists\r\n * every known provider with its proxy switch, type, host, port and username.\r\n *\r\n * This replaces an earlier attempt to render into each provider card on the\r\n * Models page (`settings.models.provider-card`). That seat is keyed and\r\n * dispatched per provider namespace, and a third-party registration never\r\n * matched it on this build: no error, no request, simply no output. A\r\n * `settings.section` entry is a plain list contribution with an `id`, which is\r\n * the shape the shipped `dsh-llm-retry-settings` plugin uses successfully in\r\n * this same desktop profile.\r\n *\r\n * The whole bundle runs inside the client module system's lazy-CJS factory:\r\n * executing the script only REGISTERS the factory, and every side effect\r\n * (including the CSS injection) happens at materialization.\r\n */\r\n\r\n// The CSS-Modules build turns this sheet into a hashed class map AND injects it\r\n// at materialization. The binding is what the component reads; importing it for\r\n// side effects only would leave `styles` undefined at render time.\r\nimport styles from './client.css'\r\n\r\ntype Protocol = 'http' | 'https' | 'socks5'\r\n\r\ntype RouteValue = {\r\n enabled: boolean\r\n protocol: Protocol\r\n host: string\r\n port: number\r\n username: string\r\n password: string\r\n onlyHosts: string\r\n bypassHosts: string\r\n}\r\n\r\n/** The provider rows we know about, and which of them are actually live. */\r\ntype ProviderRow = { id: string; name: string; live: boolean }\r\n\r\n/**\r\n * React, resolved from the client module table.\r\n *\r\n * React is NOT a Cordis service and is not reachable from `ctx` \u2014 reading it\r\n * there produced a silently null component. The module table is the only route:\r\n * the build leaves `react` external, so this compiles to a `require(\"react\")`\r\n * inside the factory closure, answered from the shell-seeded baseline.\r\n *\r\n * Resolved lazily on first render so merely REGISTERING the bundle \u2014 which is\r\n * all a script evaluation does \u2014 never materializes React.\r\n */\r\nlet ReactCache: unknown\r\n\r\nfunction react(): any {\r\n if (ReactCache === undefined) {\r\n ReactCache = ((): unknown => {\r\n try {\r\n return require('react')\r\n } catch {\r\n return (globalThis as Record<string, unknown>).React\r\n }\r\n })()\r\n }\r\n return ReactCache\r\n}\r\n\r\nconst PROTOCOLS: Protocol[] = ['http', 'https', 'socks5']\r\n\r\n/** Our own settings namespace; the profile entry id created by the bundle patch. */\r\nconst NAMESPACE = 'provider-proxy'\r\n\r\n/**\r\n * Cordis services this half needs.\r\n *\r\n * ONLY `slots` is declared. That is the complete set this release actually\r\n * offers on a client fiber: `layout, locale, sessions, slots, theme, timer,\r\n * uiWorkspace, workspaces`.\r\n *\r\n * A declared service that never arrives leaves the fiber PENDING forever, and\r\n * that is NOT a client-only failure \u2014 it is reported as\r\n * web boot: 1 entry did not activate\r\n * dsh-provider-proxy: pending (waiting for service: settingsScope)\r\n * which fails the whole Desktop boot. `settingsScope` and `configForms` were\r\n * both guessed and both are absent here, so neither may be declared.\r\n *\r\n * Settings are therefore reached through `ctx.get(name)` \u2014 the framework's own\r\n * non-throwing lookup \u2014 and the page degrades to read-only when it is absent.\r\n */\r\nconst PLUGINS = ['slots']\r\n\r\nexport const inject = PLUGINS\r\n\r\nexport function apply(ctx: any): void {\r\n // The settings shell declares `settings.section` on its own fiber, so\r\n // `slots.inject` waits for that declaration and the contribution is removed\r\n // when the panel is torn down.\r\n ctx.slots.inject('settings.section', () =>\r\n ctx.slots.register(\r\n {\r\n name: 'settings.section',\r\n id: NAMESPACE,\r\n order: 20,\r\n label: () => (localeOf(ctx) === 'zh' ? 'Provider \u4EE3\u7406' : 'Provider \u4EE3\u7406'),\r\n },\r\n () => renderPage(ctx),\r\n ),\r\n )\r\n}\r\n\r\n/**\r\n * Pick the dictionary.\r\n *\r\n * Chinese is the default, not English: this plugin is written for a\r\n * Chinese-speaking operator, and a page that renders in the wrong language is\r\n * worse than one that never matches the shell's locale.\r\n *\r\n * `ctx.locale` is not injected \u2014 declaring a service that this release does not\r\n * provide left the fiber PENDING and failed the whole Desktop boot \u2014 so the\r\n * locale is probed with the non-throwing `ctx.get`, then the browser's own\r\n * language, and only then English.\r\n */\r\nfunction localeOf(ctx: any): string {\r\n try {\r\n const service = optionalService(ctx, 'locale')\r\n const snapshot = service?.getSnapshot?.() ?? service?.getLocale?.()\r\n const id = typeof snapshot?.locale === 'string' ? snapshot.locale : undefined\r\n if (id !== undefined) return id.toLowerCase().startsWith('zh') ? 'zh' : 'en'\r\n } catch {\r\n // fall through to the browser language\r\n }\r\n const browser = globalThis.navigator?.language\r\n if (typeof browser === 'string' && browser.toLowerCase().startsWith('zh')) return 'zh'\r\n return browser === undefined ? 'zh' : 'en'\r\n}\r\n\r\n/**\r\n * Look a service up WITHOUT declaring it in `inject`.\r\n *\r\n * `ctx.get(name)` is the framework's own optional lookup: it returns undefined\r\n * instead of throwing, and \u2014 unlike a declared service \u2014 it cannot leave the\r\n * fiber PENDING. That is what makes an optional integration safe here: this\r\n * release has no settings service at all, so the page simply shows its fields\r\n * and reports that saving is unavailable.\r\n */\r\nfunction optionalService(ctx: any, ...names: string[]): any {\r\n for (const name of names) {\r\n try {\r\n const found = typeof ctx?.get === 'function' ? ctx.get(name) : undefined\r\n if (found !== undefined && found !== null) return found\r\n } catch {\r\n // try the next spelling\r\n }\r\n }\r\n return undefined\r\n}\r\n\r\n/** The settings form for this plugin's namespace, when one exists. */\r\nfunction formOf(ctx: any): any {\r\n const forms = optionalService(ctx, 'configForms', 'settingsScope')\r\n if (forms === undefined) return undefined\r\n try {\r\n if (typeof forms.get === 'function') return forms.get(NAMESPACE)\r\n // A settingsScope-style service is already bound to one namespace.\r\n if (typeof forms.getSnapshot === 'function' || typeof forms.bind === 'function') return forms\r\n } catch {\r\n return undefined\r\n }\r\n return undefined\r\n}\r\n\r\nfunction readConfig(ctx: any): { value: any; revision: number } {\r\n const form = formOf(ctx)\r\n if (form === undefined) return { value: {}, revision: 0 }\r\n try {\r\n const snapshot = form.getSnapshot?.()\r\n return {\r\n value: snapshot?.value ?? snapshot?.user ?? {},\r\n revision: snapshot?.revision ?? 0,\r\n }\r\n } catch {\r\n return { value: {}, revision: 0 }\r\n }\r\n}\r\n\r\nasync function writeConfig(ctx: any, ops: readonly unknown[]): Promise<void> {\r\n const form = formOf(ctx)\r\n if (typeof form?.mutate !== 'function') {\r\n throw new Error('dsh-provider-proxy: settings transport unavailable')\r\n }\r\n await form.mutate(ops as any[], readConfig(ctx).revision)\r\n}\r\n\r\n/**\r\n * The provider rows, read from the Host.\r\n *\r\n * This release exposes no client-facing LLM service, so the page cannot ask for\r\n * the directory itself. The Host serves it at this same-origin endpoint, where\r\n * `ctx.llm.listProviders()` / `listConfigurableProviders()` actually live. The\r\n * list is therefore automatic \u2014 the user never types a route id.\r\n *\r\n * Only ACTIVE routes are shown. A provider this deployment merely *offers* \u2014\r\n * declared but not registered, so nothing would ever be sent through it \u2014 is\r\n * not the user's business on this page, and listing it only invites them to\r\n * configure a proxy for a route that cannot be selected. A provider that is\r\n * already configured is kept regardless, so a saved setting never silently\r\n * disappears from view.\r\n */\r\nfunction knownProviders(configured: Record<string, RouteValue>, published: ProviderRow[]): ProviderRow[] {\r\n const rows = new Map<string, ProviderRow>()\r\n for (const row of published) {\r\n if (row.live) rows.set(row.id, row)\r\n }\r\n for (const [id, route] of Object.entries(configured)) {\r\n if (rows.has(id)) continue\r\n rows.set(id, { id, name: id, live: route?.enabled === true })\r\n }\r\n return [...rows.values()].sort(byName)\r\n}\r\n\r\n/**\r\n * Where the Host publishes the live provider catalogue.\r\n */\r\nconst CATALOG_PATH = '/dsh-provider-proxy/providers'\r\n\r\n/** Where the Host runs a per-provider connection self-check. */\r\nconst TEST_PATH = '/dsh-provider-proxy/test'\r\n\r\n/**\r\n * Latency bands for the self-check result, in milliseconds.\r\n *\r\n * The colour is decoration, never information: the numeric value is always\r\n * printed, so an unknown theme token (which resolves to `unset`) costs colour,\r\n * never the reading. The `var(..., fallback)` form keeps the colours visible even\r\n * if the theme renames the token.\r\n */\r\nconst LATENCY_FAST_MS = 500\r\nconst LATENCY_SLOW_MS = 1500\r\n\r\nfunction latencyColor(ms: unknown): string {\r\n if (typeof ms !== 'number' || !Number.isFinite(ms)) return 'var(--dsw-alias-label-secondary)'\r\n if (ms <= LATENCY_FAST_MS) return 'var(--dsw-alias-state-success-primary, #2ea043)'\r\n if (ms <= LATENCY_SLOW_MS) return 'var(--dsw-alias-state-warn-primary, #d29922)'\r\n return 'var(--dsw-alias-state-error-primary, #f85149)'\r\n}\r\n\r\n/** Normalize the Host's self-check payload into the shape the card renders. */\r\nfunction testResultFrom(body: any, strings: Record<string, string>): Record<string, unknown> {\r\n const ok = body?.ok === true\r\n return {\r\n pending: false,\r\n ok,\r\n ms: typeof body?.ms === 'number' && Number.isFinite(body.ms) ? body.ms : undefined,\r\n ip: typeof body?.exitIp === 'string' && body.exitIp.length > 0 ? body.exitIp : undefined,\r\n error: ok\r\n ? undefined\r\n : typeof body?.error === 'string' && body.error.length > 0\r\n ? body.error\r\n : strings.testFailed,\r\n }\r\n}\r\n\r\n/**\r\n * The setter the lazy catalogue initializer resolves through.\r\n *\r\n * It is republished after every render, so the newest one always wins, and a\r\n * promise that settles after an unmount writes to a harmless no-op.\r\n */\r\nlet catalogueSetter: ((catalog: Catalog) => void) | undefined = () => {}\r\n\r\n/** What the Host endpoint publishes: provider rows, hit counts, rejected routes. */\r\ntype Catalog = {\r\n rows: ProviderRow[]\r\n hits: Record<string, number>\r\n problems: Record<string, string>\r\n}\r\n\r\n/** Read the Host's provider catalogue. Same-origin, so no token is needed. */\r\nasync function fetchCatalog(): Promise<Catalog> {\r\n const response = await globalThis.fetch(CATALOG_PATH, { headers: { accept: 'application/json' } })\r\n if (!response.ok) throw new Error(`Host answered ${response.status}`)\r\n const body = await response.json()\r\n const list = Array.isArray(body?.providers) ? body.providers : []\r\n const rows = list\r\n .filter((row: any) => typeof row?.id === 'string' && row.id.length > 0)\r\n .map((row: any) => ({\r\n id: row.id,\r\n name: typeof row.name === 'string' && row.name.length > 0 ? row.name : row.id,\r\n live: row.live === true,\r\n }))\r\n // The Host counts requests it routed through each provider's proxy. Anything\r\n // malformed is dropped rather than rendered, so a bad payload cannot put a\r\n // non-numeric string on the page.\r\n const hits: Record<string, number> = {}\r\n const published = body?.hits\r\n if (published !== null && typeof published === 'object') {\r\n for (const [id, count] of Object.entries(published)) {\r\n if (typeof count === 'number' && Number.isFinite(count)) hits[id] = count\r\n }\r\n }\r\n // A route the Host REFUSED (a bad port, half-filled credentials) is absent from\r\n // the provider list entirely, so this map is the only place that says why it is\r\n // missing. The Host already stripped the log prefix from it.\r\n const problems: Record<string, string> = {}\r\n const rejected = body?.problems\r\n if (rejected !== null && typeof rejected === 'object') {\r\n for (const [id, message] of Object.entries(rejected)) {\r\n if (typeof message === 'string' && message.length > 0) problems[id] = message\r\n }\r\n }\r\n return { rows, hits, problems }\r\n}\r\n\r\nconst byName = (a: ProviderRow, b: ProviderRow): number => a.name.localeCompare(b.name)\r\n\r\nfunction view(route: Partial<RouteValue> | undefined): RouteValue {\r\n return {\r\n enabled: route?.enabled === true,\r\n protocol: PROTOCOLS.includes(route?.protocol as Protocol) ? (route!.protocol as Protocol) : 'http',\r\n host: route?.host ?? '',\r\n port: route?.port ?? 0,\r\n username: route?.username ?? '',\r\n password: route?.password ?? '',\r\n onlyHosts: route?.onlyHosts ?? '',\r\n bypassHosts: route?.bypassHosts ?? '',\r\n }\r\n}\r\n\r\n/** The provider directory, cached module-side. See renderPage. */\r\nlet directoryCache: ProviderRow[] | undefined\r\n\r\n/**\r\n * Everything the page learned about its own wiring, rendered verbatim.\r\n *\r\n * The browser side of a plugin has no other diagnostic channel \u2014 the Host log\r\n * never sees it \u2014 so a silent failure had to be diagnosed by inference. This\r\n * panel is what proved that `remote.settings` and `remote.llm` do not exist in\r\n * this release, and that the catalogue had to come from the Host endpoint.\r\n *\r\n * Cleared at the start of every render so the panel shows the CURRENT state\r\n * rather than an ever-growing log of the session.\r\n */\r\nlet diagnostics: string[] = []\r\n\r\nfunction note(message: string): void {\r\n if (!diagnostics.includes(message)) diagnostics.push(message)\r\n}\r\n\r\n/**\r\n * Layout constants, applied as INLINE styles.\r\n *\r\n * The page is rendered into the settings panel, and the CSS-Modules pipeline\r\n * that feeds the stylesheet has broken twice in ways that were invisible from\r\n * the source: the class map failed to bind at all, and a shared class prefix\r\n * silently merged two rules. Both left the page readable but laid out as one\r\n * unstyled block.\r\n *\r\n * Structure is therefore expressed as inline styles, which cannot be lost by\r\n * the bundle, and the stylesheet is kept for the purely decorative parts. A\r\n * theme token that is not defined simply resolves to `unset`, so an unknown\r\n * token costs colour, never layout.\r\n */\r\nconst S = {\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n maxWidth: '720px',\r\n },\r\n card: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n padding: '14px 16px',\r\n marginBottom: '12px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '10px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n },\r\n cardActive: {\r\n borderColor: 'var(--dsw-alias-state-success-primary)',\r\n background: 'var(--dsw-alias-bg-layer-2)',\r\n },\r\n head: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '12px',\r\n },\r\n titles: { display: 'flex', alignItems: 'baseline', gap: '8px', minWidth: '0' },\r\n name: {\r\n fontSize: '14px',\r\n fontWeight: '600',\r\n color: 'var(--dsw-alias-label-primary)',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n },\r\n id: {\r\n flex: 'none',\r\n padding: '1px 6px',\r\n borderRadius: '4px',\r\n background: 'var(--dsw-alias-bg-layer-2)',\r\n fontFamily: 'ui-monospace, monospace',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n hits: {\r\n flex: 'none',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n whiteSpace: 'nowrap',\r\n },\r\n testRow: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '10px',\r\n flexWrap: 'wrap',\r\n },\r\n testButton: {\r\n padding: '5px 12px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n },\r\n testResult: {\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n wordBreak: 'break-all',\r\n },\r\n /**\r\n * A failed check is the answer, not decoration: it takes the error colour and\r\n * a heavier weight, unlike the latency band colour which only tints a number\r\n * that is printed anyway.\r\n */\r\n testFailure: {\r\n color: 'var(--dsw-alias-state-error-primary, #f85149)',\r\n fontWeight: '500',\r\n },\r\n /** A rejected route is a failure of the settings, not a warning about them. */\r\n diagProblem: {\r\n color: 'var(--dsw-alias-state-error-primary, #f85149)',\r\n },\r\n advanced: {\r\n marginTop: '4px',\r\n fontSize: '12px',\r\n },\r\n advancedSummary: {\r\n cursor: 'pointer',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n pill: {\r\n flex: 'none',\r\n padding: '2px 10px',\r\n borderRadius: '999px',\r\n fontSize: '11px',\r\n fontWeight: '500',\r\n whiteSpace: 'nowrap',\r\n },\r\n pillOn: {\r\n background: 'var(--dsw-alias-state-success-primary)',\r\n color: 'var(--dsw-alias-bg-base)',\r\n },\r\n pillLive: {\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n pillOff: { color: 'var(--dsw-alias-state-idle-primary)' },\r\n toggle: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n fontSize: '12px',\r\n color: 'var(--dsw-alias-label-primary)',\r\n },\r\n field: {\r\n display: 'grid',\r\n gridTemplateColumns: '88px 1fr',\r\n alignItems: 'center',\r\n gap: '10px',\r\n fontSize: '12px',\r\n },\r\n label: { color: 'var(--dsw-alias-label-secondary)' },\r\n input: {\r\n boxSizing: 'border-box',\r\n width: '100%',\r\n minWidth: '0',\r\n padding: '6px 8px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '6px',\r\n outline: 'none',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n },\r\n} as const\r\n\r\nfunction renderPage(ctx: any): unknown {\r\n const React = react()\r\n if (React === undefined || typeof React.createElement !== 'function') return null\r\n\r\n const h = React.createElement\r\n const t = stringsFor(ctx)\r\n diagnostics = []\r\n\r\n // `useState` is only reached after the React check, so the early return above\r\n // cannot desync the hooks order.\r\n let snapshot: { value: any; revision: number }\r\n try {\r\n snapshot = readConfig(ctx)\r\n } catch {\r\n snapshot = { value: {}, revision: 0 }\r\n }\r\n const configured = (snapshot.value?.providers ?? {}) as Record<string, RouteValue>\r\n note(\r\n formOf(ctx) === undefined\r\n ? '\u8BBE\u7F6E\uFF1A\u672A\u627E\u5230 configForms \u670D\u52A1\uFF0C\u53EA\u80FD\u663E\u793A\u3001\u65E0\u6CD5\u4FDD\u5B58'\r\n : `\u8BBE\u7F6E\uFF1A\u6B63\u5E38\uFF08\u4FEE\u8BA2\u53F7 ${snapshot.revision}\uFF0C${Object.keys(configured).length} \u4E2A provider\uFF09`,\r\n )\r\n\r\n // The provider catalogue comes from the Host over a same-origin endpoint, so\r\n // it arrives asynchronously. The initial state is a LAZY initializer, so the\r\n // fetch starts from `useState(() => \u2026)` instead of by calling a setter during\r\n // render: a render must have no side effects, and doing so also shifted the\r\n // hook order between passes.\r\n const [state, setState] = (React.useState ?? ((fn: any) => [fn(), () => {}]))(() => {\r\n void fetchCatalog()\r\n .then(catalog => catalogueSetter?.(catalog))\r\n .catch((error: any) => {\r\n note(`provider \u5217\u8868\u83B7\u53D6\u5931\u8D25\uFF1A${error?.message ?? error}`)\r\n catalogueSetter?.({ rows: [], hits: {}, problems: {} })\r\n })\r\n return {\r\n rows: undefined as ProviderRow[] | undefined,\r\n hits: {} as Record<string, number>,\r\n problems: {} as Record<string, string>,\r\n pending: true,\r\n }\r\n })\r\n // The setter is published right after the hook so the initializer's promise\r\n // can reach it. It is re-published on every render, so the latest wins.\r\n catalogueSetter = catalog =>\r\n setState({ rows: catalog.rows, hits: catalog.hits, problems: catalog.problems, pending: false })\r\n\r\n const published = state.rows ?? []\r\n const hits = state.hits ?? {}\r\n // Rendered straight from state rather than through `note()`: `diagnostics` is\r\n // cleared at the start of every render, so a note written when the catalog\r\n // arrives would not survive to the next pass.\r\n const problems = state.problems ?? {}\r\n const problemLines = Object.entries(problems).map(([id, message]) =>\r\n h('li', { key: `p:${id}`, style: S.diagProblem }, `${id}\uFF1A${message}`),\r\n )\r\n const problemCount = problemLines.length\r\n note(\r\n `provider \u5217\u8868\uFF1A\u6765\u81EA Host \u5171 ${published.length} \u4E2A\uFF08${published.map((r: ProviderRow) => r.id).join('\u3001') || '\u65E0'}\uFF09`,\r\n )\r\n // Local draft, layered over the stored config.\r\n //\r\n // Without it a checkbox does not change until the panel remounts: the value\r\n // is read from the settings store, which only updates when the page is\r\n // rebuilt. The draft makes the control respond immediately, then reconciles\r\n // with the store so a refused write is visible rather than silently lost.\r\n const [draft, setDraft] = (React.useState ?? ((v: any) => [v, () => {}]))({})\r\n const edit = (id: string, field: string, value: unknown) =>\r\n setDraft((current: any) => ({ ...current, [id]: { ...current[id], [field]: value } }))\r\n\r\n // Self-check outcomes keyed by provider id: `{ pending: true }` while the Host\r\n // is testing, then the normalized result the card renders.\r\n const [tests, setTests] = (React.useState ?? ((v: any) => [v, () => {}]))({})\r\n\r\n /**\r\n * Run the Host's self-check for one provider.\r\n *\r\n * The check is not routed traffic, so it never changes the hit count; the count\r\n * on the card is read at mount and stays put until the page reloads.\r\n */\r\n const runTest = (id: string): void => {\r\n setTests((current: any) => ({ ...current, [id]: { pending: true } }))\r\n void (async () => {\r\n try {\r\n const response = await globalThis.fetch(TEST_PATH, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/json', accept: 'application/json' },\r\n body: JSON.stringify({ provider: id }),\r\n })\r\n const body = await response.json()\r\n setTests((current: any) => ({ ...current, [id]: testResultFrom(body, t) }))\r\n } catch (error: any) {\r\n setTests((current: any) => ({\r\n ...current,\r\n [id]: { pending: false, ok: false, error: String(error?.message ?? error) },\r\n }))\r\n }\r\n })()\r\n }\r\n\r\n const rows = knownProviders({ ...configured, ...draft }, published)\r\n\r\n /**\r\n * Persist one field. The control is already showing the new value, so this\r\n * only has to succeed quietly; a refusal is reported in the diagnostics.\r\n */\r\n const save = (id: string, field: string, value: unknown) => {\r\n void writeConfig(ctx, [{ op: 'set', path: ['providers', id, field], value }])\r\n .then(() => {\r\n note(`\u5DF2\u4FDD\u5B58 ${id}.${field} = ${JSON.stringify(value)}`)\r\n })\r\n .catch((error: any) => {\r\n note(`\u4FDD\u5B58\u5931\u8D25 ${id}.${field}\uFF1A${error?.message ?? error}`)\r\n // Drop the optimistic value so the stored state shows through again.\r\n setDraft((current: any) => {\r\n const next = { ...current }\r\n delete next[id]\r\n return next\r\n })\r\n })\r\n }\r\n\r\n /** One control: update the draft instantly, persist in the background. */\r\n const bind = (id: string, field: string) => (value: unknown) => {\r\n edit(id, field, value)\r\n save(id, field, value)\r\n }\r\n\r\n const field = (label: string, control: unknown, hint?: string): unknown =>\r\n h(\r\n 'label',\r\n { className: styles.field, style: S.field, key: label },\r\n h('span', { className: styles.label, style: S.label }, label),\r\n control,\r\n hint === undefined\r\n ? null\r\n : h(\r\n 'span',\r\n { className: styles.hint, style: { gridColumn: '2', fontSize: '11px' } },\r\n hint,\r\n ),\r\n )\r\n\r\n // ALWAYS an array: a single element is not iterable, and spreading one threw\r\n // \"Spread syntax requires ...iterable[Symbol.iterator]\" on an empty list.\r\n const body: unknown[] = rows.length === 0\r\n ? [\r\n h(\r\n 'p',\r\n {\r\n className: styles.empty,\r\n key: 'empty',\r\n style: {\r\n margin: '0',\r\n padding: '16px',\r\n border: '1px dashed var(--dsw-alias-border-l1)',\r\n borderRadius: '8px',\r\n fontSize: '12px',\r\n textAlign: 'center',\r\n color: 'var(--dsw-alias-state-idle-primary)',\r\n },\r\n },\r\n t.empty,\r\n ),\r\n ]\r\n : rows.map(row => {\r\n // The MERGED value, so a just-typed value shows immediately.\r\n const route = view({ ...configured[row.id], ...draft[row.id] })\r\n const disabled = !route.enabled\r\n const result = tests[row.id]\r\n return h(\r\n 'section',\r\n {\r\n className: route.enabled ? styles.cardActive : styles.card,\r\n style: route.enabled ? { ...S.card, ...S.cardActive } : S.card,\r\n key: row.id,\r\n },\r\n h(\r\n 'header',\r\n { className: styles.cardHead, style: S.head },\r\n h(\r\n 'div',\r\n { className: styles.cardTitles, style: S.titles },\r\n h('span', { className: styles.name, style: S.name }, row.name),\r\n h('span', { className: styles.id, style: S.id }, row.id),\r\n // A disabled route can never have hits, so \"0\" there would only add\r\n // noise; the count shows once the route is on (or has counted).\r\n route.enabled || (hits[row.id] ?? 0) > 0\r\n ? h(\r\n 'span',\r\n { style: S.hits },\r\n `${t.hitCountPrefix}${hits[row.id] ?? 0}${t.hitCountSuffix}`,\r\n )\r\n : null,\r\n ),\r\n h(\r\n 'span',\r\n {\r\n className: route.enabled ? styles.pillOn : row.live ? styles.pillLive : styles.pillOff,\r\n style: {\r\n ...S.pill,\r\n ...(route.enabled ? S.pillOn : row.live ? S.pillLive : S.pillOff),\r\n },\r\n },\r\n route.enabled ? t.on : row.live ? t.live : t.off,\r\n ),\r\n ),\r\n h(\r\n 'label',\r\n { className: styles.toggle, style: S.toggle },\r\n h('input', {\r\n type: 'checkbox',\r\n checked: route.enabled,\r\n onChange: (event: any) => bind(row.id, 'enabled')(event.target.checked === true),\r\n }),\r\n h('span', null, t.useProxy),\r\n ),\r\n field(\r\n t.protocol,\r\n h(\r\n 'select',\r\n {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n value: route.protocol,\r\n onChange: (event: any) => bind(row.id, 'protocol')(event.target.value),\r\n },\r\n ...PROTOCOLS.map(protocol =>\r\n h('option', { key: protocol, value: protocol }, protocol.toUpperCase()),\r\n ),\r\n ),\r\n route.protocol === 'socks5' ? t.socks5Hint : undefined,\r\n ),\r\n field(\r\n t.host,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n placeholder: '127.0.0.1',\r\n value: route.host,\r\n onChange: (event: any) => bind(row.id, 'host')(event.target.value),\r\n }),\r\n t.hostHint,\r\n ),\r\n field(\r\n t.port,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n type: 'number',\r\n min: 1,\r\n max: 65535,\r\n placeholder: '7890',\r\n value: route.port === 0 ? '' : String(route.port),\r\n onChange: (event: any) => {\r\n const parsed = Number.parseInt(event.target.value, 10)\r\n bind(row.id, 'port')(Number.isNaN(parsed) ? 0 : parsed)\r\n },\r\n }),\r\n ),\r\n field(\r\n t.username,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n autocomplete: 'off',\r\n value: route.username,\r\n onChange: (event: any) => bind(row.id, 'username')(event.target.value),\r\n }),\r\n ),\r\n // Every transport accepts a password now: SOCKS5 hands it to\r\n // Socks5ProxyAgent as an option, HTTP/HTTPS embed it in the proxy URL\r\n // userinfo (undici turns that into Proxy-Authorization). It is stored on\r\n // the route, so it lands in the settings file with the rest of the\r\n // config; the diagnostics only ever surface a credential-free origin.\r\n field(\r\n t.password,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n type: 'password',\r\n autocomplete: 'off',\r\n value: route.password,\r\n onChange: (event: any) => bind(row.id, 'password')(event.target.value),\r\n }),\r\n route.protocol === 'socks5' ? t.passwordHint : t.passwordHintProxy,\r\n ),\r\n // The self-check only makes sense for a route that is ON; a disabled\r\n // route is not in the Host's table, so there is nothing to test.\r\n route.enabled\r\n ? h(\r\n 'div',\r\n { style: S.testRow, key: `${row.id}:test` },\r\n h(\r\n 'button',\r\n {\r\n className: styles.testButton,\r\n style: S.testButton,\r\n type: 'button',\r\n disabled: result?.pending === true,\r\n onClick: () => runTest(row.id),\r\n },\r\n result?.pending === true ? t.testRunning : t.testButton,\r\n ),\r\n result?.pending === false\r\n ? h(\r\n 'span',\r\n { style: S.testResult },\r\n result.ok === true\r\n ? [\r\n // Only the latency carries the band colour; the exit IP\r\n // stays in the secondary label colour.\r\n h(\r\n 'span',\r\n { key: 'lat', style: { color: latencyColor(result.ms) } },\r\n `\u2713 ${typeof result.ms === 'number' ? result.ms : '\u2014'} ms`,\r\n ),\r\n result.ip === undefined ? null : ` \u00B7 ${t.exitIpLabel}${result.ip}`,\r\n ]\r\n : h('span', { key: 'err', style: S.testFailure }, `\u2717 ${result.error}`),\r\n )\r\n : null,\r\n )\r\n : null,\r\n // Target-host rules, collapsed so the common case stays one short card.\r\n h(\r\n 'details',\r\n { style: S.advanced, key: `${row.id}:rules` },\r\n h('summary', { style: S.advancedSummary }, t.advanced),\r\n field(\r\n t.onlyHosts,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n placeholder: 'api.example.com',\r\n value: route.onlyHosts,\r\n onChange: (event: any) => bind(row.id, 'onlyHosts')(event.target.value),\r\n }),\r\n t.onlyHostsHint,\r\n ),\r\n field(\r\n t.bypassHosts,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n disabled,\r\n placeholder: 'localhost',\r\n value: route.bypassHosts,\r\n onChange: (event: any) => bind(row.id, 'bypassHosts')(event.target.value),\r\n }),\r\n t.bypassHostsHint,\r\n ),\r\n ),\r\n )\r\n })\r\n\r\n return h(\r\n 'div',\r\n { className: styles.root, style: S.root },\r\n h('p', { className: styles.lead, style: { margin: '0 0 4px', fontSize: '12px', lineHeight: '1.6', color: 'var(--dsw-alias-label-secondary)' } }, t.lead),\r\n ...body,\r\n h(\r\n 'details',\r\n {\r\n className: styles.diag,\r\n key: 'diag',\r\n style: {\r\n marginTop: '4px',\r\n padding: '8px 10px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '8px',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n },\r\n // The count is the only visible signal while the panel is collapsed: a\r\n // rejected route is not a page that refuses to render, it is one that\r\n // quietly does nothing.\r\n h(\r\n 'summary',\r\n { className: styles.diagSummary },\r\n problemCount === 0 ? t.diagnostics : `${t.diagnostics} (${problemCount})`,\r\n ),\r\n h(\r\n 'ul',\r\n { className: styles.diagList, style: { margin: '6px 0 0', paddingLeft: '18px' } },\r\n ...(problemCount === 0 && diagnostics.length === 0\r\n ? [h('li', { key: 'none' }, t.diagPending)]\r\n : [\r\n ...problemLines,\r\n ...diagnostics.map((line, index) => h('li', { key: `d${index}` }, line)),\r\n ]),\r\n ),\r\n ),\r\n )\r\n}\r\n\r\nconst EN = {\r\n lead: 'Route selected model providers through your own forward proxy. Other providers stay direct.',\r\n empty: 'No providers found yet.',\r\n useProxy: 'Use a proxy for this provider',\r\n protocol: 'Type',\r\n host: 'IP / host',\r\n port: 'Port',\r\n username: 'Username',\r\n password: 'Password',\r\n hostHint: 'Host or IP only, without scheme or path.',\r\n passwordHint: 'Sent to the SOCKS5 proxy for authentication; stored with this setting.',\r\n passwordHintProxy: 'Sent to the proxy as an authentication password; stored with this setting.',\r\n hitCountPrefix: '',\r\n hitCountSuffix: ' proxied',\r\n testButton: 'Test',\r\n testRunning: 'Testing\u2026',\r\n testFailed: 'Test failed',\r\n exitIpLabel: 'exit IP ',\r\n advanced: 'Advanced: target host rules',\r\n onlyHosts: 'Proxy only',\r\n onlyHostsHint: 'Comma/space separated; when set, only requests to these hosts are proxied (suffix match, * for all).',\r\n bypassHosts: 'Bypass',\r\n bypassHostsHint: 'Comma/space separated; requests to these hosts go direct, taking priority.',\r\n socks5Hint: 'SOCKS5 tunnels the connection; the proxy resolves the target host name.',\r\n on: 'proxied',\r\n live: 'active',\r\n off: 'direct',\r\n diagnostics: 'Connection diagnostics',\r\n diagPending: '(collecting\u2026)',\r\n}\r\n\r\nconst ZH = {\r\n lead: '\u8BA9\u6307\u5B9A\u7684 provider \u8D70\u4F60\u81EA\u5DF1\u7684\u6B63\u5411\u4EE3\u7406\uFF0C\u5176\u5B83 provider \u4FDD\u6301\u76F4\u8FDE\u3002',\r\n empty: '\u6CA1\u6709\u68C0\u6D4B\u5230\u4EFB\u4F55 provider\u3002',\r\n useProxy: '\u4E3A\u8BE5 provider \u542F\u7528\u4EE3\u7406',\r\n protocol: '\u7C7B\u578B',\r\n host: 'IP / \u4E3B\u673A',\r\n port: '\u7AEF\u53E3',\r\n username: '\u7528\u6237\u540D',\r\n password: '\u5BC6\u7801',\r\n hostHint: '\u53EA\u586B\u4E3B\u673A\u540D\u6216 IP\uFF0C\u4E0D\u8981\u5E26\u534F\u8BAE\u524D\u7F00\u6216\u8DEF\u5F84\u3002',\r\n passwordHint: '\u4EC5\u4F5C\u4E3A SOCKS5 \u8BA4\u8BC1\u53E3\u4EE4\u53D1\u9001\u7ED9\u4EE3\u7406\uFF1B\u968F\u8BE5\u8BBE\u7F6E\u4E00\u8D77\u4FDD\u5B58\u3002',\r\n passwordHintProxy: '\u4F5C\u4E3A\u4EE3\u7406\u8BA4\u8BC1\u53E3\u4EE4\u53D1\u9001\u7ED9\u4EE3\u7406\uFF1B\u968F\u8BE5\u8BBE\u7F6E\u4E00\u8D77\u4FDD\u5B58\u3002',\r\n hitCountPrefix: '\u5DF2\u4EE3\u7406 ',\r\n hitCountSuffix: ' \u6B21',\r\n testButton: '\u6D4B\u8BD5',\r\n testRunning: '\u6D4B\u8BD5\u4E2D\u2026',\r\n testFailed: '\u6D4B\u8BD5\u5931\u8D25',\r\n exitIpLabel: '\u51FA\u53E3 IP ',\r\n advanced: '\u9AD8\u7EA7\uFF1A\u76EE\u6807\u57DF\u540D\u89C4\u5219',\r\n onlyHosts: '\u4EC5\u8D70\u4EE3\u7406',\r\n onlyHostsHint: '\u9017\u53F7\u6216\u7A7A\u683C\u5206\u9694\uFF1B\u975E\u7A7A\u65F6\u53EA\u6709\u5339\u914D\u8FD9\u4E9B\u4E3B\u673A\u7684\u8BF7\u6C42\u8D70\u4EE3\u7406\uFF08\u540E\u7F00\u5339\u914D\uFF0C* \u8868\u793A\u5168\u90E8\uFF09\u3002',\r\n bypassHosts: '\u76F4\u8FDE',\r\n bypassHostsHint: '\u9017\u53F7\u6216\u7A7A\u683C\u5206\u9694\uFF1B\u5339\u914D\u8FD9\u4E9B\u4E3B\u673A\u7684\u8BF7\u6C42\u76F4\u8FDE\uFF0C\u4F18\u5148\u4E8E\u4E0A\u4E00\u9879\u3002',\r\n socks5Hint: 'SOCKS5 \u4F1A\u5EFA\u7ACB\u96A7\u9053\uFF0C\u76EE\u6807\u57DF\u540D\u7531\u4EE3\u7406\u7AEF\u89E3\u6790\u3002',\r\n on: '\u8D70\u4EE3\u7406',\r\n live: '\u542F\u7528\u4E2D',\r\n off: '\u76F4\u8FDE',\r\n diagnostics: '\u8FDE\u63A5\u8BCA\u65AD',\r\n diagPending: '\uFF08\u6B63\u5728\u6536\u96C6\u2026\uFF09',\r\n}\r\n\r\n/**\r\n * Pick the dictionary for this render.\r\n *\r\n * The shell's own locale dictionary wins when it carries a translated entry, so\r\n * the page follows the application language instead of second-guessing it.\r\n * Chinese is the fallback because that is the operator's language.\r\n */\r\nfunction stringsFor(ctx: any): Record<string, string> {\r\n const language = localeOf(ctx)\r\n const bundled = language === 'zh' ? ZH : EN\r\n const translated = ((): Record<string, string> | undefined => {\r\n try {\r\n const service = optionalService(ctx, 'locale')\r\n const bound = service?.bind?.('dshProviderProxy')\r\n const value = typeof bound === 'function' ? bound('title') : undefined\r\n if (typeof value === 'string' && value.length > 0) return { title: value } as never\r\n } catch {\r\n // no locale dictionary available\r\n }\r\n return undefined\r\n })()\r\n return { ...bundled, ...(translated ?? {}) }\r\n}\r\n\r\n/**\r\n * The client module system's resolver.\r\n *\r\n * The loader calls `factory(require)` and that parameter shadows Node's\r\n * `require` inside the emitted CJS, so this describes the module-table\r\n * resolver, not Node's.\r\n */\r\ndeclare function require(specifier: string): unknown\r\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,4BAAAA,SAAA;AAAA;AACA,QAAI,WAAW,EAAC,QAAO,iBAAgB,QAAO,iBAAgB,SAAQ,kBAAiB,QAAO,iBAAgB,cAAa,uBAAsB,YAAW,qBAAoB,cAAa,uBAAsB,QAAO,iBAAgB,MAAK,eAAc,UAAS,mBAAkB,YAAW,qBAAoB,WAAU,oBAAmB,UAAS,mBAAkB,SAAQ,kBAAiB,SAAQ,kBAAiB,QAAO,iBAAgB,SAAQ,kBAAiB,cAAa,uBAAsB,QAAO,iBAAgB,eAAc,wBAAuB,YAAW,oBAAmB;AAC9kB,QAAI,cAAe,WAAW,sBAAsB,WAAW,oBAAoB,oBAAI,IAAI;AAC3F,QAAI,CAAC,YAAY,IAAI,+BAA+B,GAAG;AACrD,kBAAY,IAA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AACf;AASA,SAAS,WAAW,KAAkC;AACpD,QAAM,WAAW,SAAS,GAAG;AAC7B,QAAM,UAAU,aAAa,OAAO,KAAK;AACzC,QAAM,cAAc,MAA0C;AAC5D,QAAI;AACF,YAAM,UAAU,gBAAgB,KAAK,QAAQ;AAC7C,YAAM,QAAQ,SAAS,OAAO,kBAAkB;AAChD,YAAM,QAAQ,OAAO,UAAU,aAAa,MAAM,OAAO,IAAI;AAC7D,UAAI,OAAO,UAAU,YAAY,MAAM,SAAS,EAAG,QAAO,EAAE,OAAO,MAAM;AAAA,IAC3E,QAAQ;AAAA,IAER;AACA,WAAO;AAAA,EACT,GAAG;AACH,SAAO,EAAE,GAAG,SAAS,GAAI,cAAc,CAAC,EAAG;AAC7C;",
6
- "names": ["module", "field", "body", "styles"]
3
+ "sources": ["../src/client.css", "../src/client.ts", "../src/proxy-address.ts"],
4
+ "sourcesContent": ["\nvar __dshMap = {\"root\":\"7a51762d_root\",\"lead\":\"c71659b2_lead\",\"empty\":\"c42c4abe_empty\",\"card\":\"53acf569_card\",\"cardActive\":\"bd4546f8_cardActive\",\"defaultCard\":\"1103ba6e_defaultCard\",\"defaultLead\":\"0b907dc6_defaultLead\",\"cardHead\":\"d06dccdb_cardHead\",\"cardTitles\":\"ff20149f_cardTitles\",\"name\":\"4e36a10e_name\",\"id\":\"79208064_id\",\"pillOn\":\"3e0969fd_pillOn\",\"pillLive\":\"895a1b6e_pillLive\",\"pillOff\":\"f5c4d227_pillOff\",\"toggle\":\"94e6424f_toggle\",\"field\":\"5dfb5268_field\",\"label\":\"2e13439d_label\",\"hint\":\"cdd952c6_hint\",\"input\":\"31dd2d99_input\",\"testButton\":\"028bc91c_testButton\",\"diag\":\"5d114b0b_diag\",\"diagSummary\":\"27518b39_diagSummary\",\"diagList\":\"b3005b62_diagList\"};\nvar __dshStyles = (globalThis.__dshPluginStyles || (globalThis.__dshPluginStyles = new Set()));\nif (!__dshStyles.has(\"dsh-provider-proxy/client.css\")) {\n __dshStyles.add(\"dsh-provider-proxy/client.css\");\n var __dshStyle = document.createElement('style');\n __dshStyle.setAttribute('data-plugin-css', \"dsh-provider-proxy/client.css\");\n __dshStyle.textContent = \"/* dsh-provider-proxy \u2014 provider proxy settings page.\\n Tokens only: no literal colours, matching the shared --dsw-* system. */\\n\\n.7a51762d_root {\\n display: flex;\\n flex-direction: column;\\n gap: 12px;\\n max-width: 640px;\\n}\\n\\n.c71659b2_lead {\\n margin: 0 0 4px;\\n font-size: 12px;\\n line-height: 1.6;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.c42c4abe_empty {\\n margin: 0;\\n padding: 16px;\\n border: 1px dashed var(--dsw-alias-border-l1);\\n border-radius: 8px;\\n font-size: 12px;\\n text-align: center;\\n color: var(--dsw-alias-state-idle-primary);\\n}\\n\\n/* ---- provider card ---- */\\n\\n.53acf569_card,\\n.bd4546f8_cardActive {\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n padding: 12px 14px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 10px;\\n background: var(--dsw-alias-bg-layer-1);\\n}\\n\\n.bd4546f8_cardActive {\\n border-color: var(--dsw-alias-state-success-primary);\\n background: var(--dsw-alias-bg-layer-2);\\n}\\n\\n/* ---- shared default endpoint ---- */\\n\\n/* A distinct outer layer, so it reads as \\\"one setting for the page\\\" rather than\\n as one more provider card. */\\n.1103ba6e_defaultCard {\\n display: flex;\\n flex-direction: column;\\n gap: 10px;\\n padding: 14px 16px;\\n border: 1px solid var(--dsw-alias-border-l2);\\n border-radius: 10px;\\n background: var(--dsw-alias-bg-layer-2);\\n}\\n\\n.0b907dc6_defaultLead {\\n margin: -2px 0 0;\\n font-size: 11px;\\n line-height: 1.5;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.d06dccdb_cardHead {\\n display: flex;\\n align-items: center;\\n justify-content: space-between;\\n gap: 12px;\\n}\\n\\n.ff20149f_cardTitles {\\n display: flex;\\n align-items: baseline;\\n gap: 8px;\\n min-width: 0;\\n}\\n\\n.4e36a10e_name {\\n overflow: hidden;\\n font-size: 13px;\\n font-weight: 600;\\n white-space: nowrap;\\n text-overflow: ellipsis;\\n color: var(--dsw-alias-label-primary);\\n}\\n\\n.79208064_id {\\n flex: none;\\n padding: 1px 6px;\\n border-radius: 4px;\\n background: var(--dsw-alias-bg-layer-2);\\n font-family: ui-monospace, monospace;\\n font-size: 11px;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n/* ---- status pill ---- */\\n\\n.3e0969fd_pillOn,\\n.895a1b6e_pillLive,\\n.f5c4d227_pillOff {\\n flex: none;\\n padding: 2px 8px;\\n border-radius: 999px;\\n font-size: 11px;\\n font-weight: 500;\\n white-space: nowrap;\\n}\\n\\n.3e0969fd_pillOn {\\n background: var(--dsw-alias-state-success-primary);\\n color: var(--dsw-alias-bg-base);\\n}\\n\\n.895a1b6e_pillLive {\\n border: 1px solid var(--dsw-alias-border-l2);\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.f5c4d227_pillOff {\\n color: var(--dsw-alias-state-idle-primary);\\n}\\n\\n/* ---- toggle ---- */\\n\\n.94e6424f_toggle {\\n display: flex;\\n align-items: center;\\n gap: 8px;\\n padding-top: 2px;\\n font-size: 12px;\\n color: var(--dsw-alias-label-primary);\\n cursor: pointer;\\n}\\n\\n.94e6424f_toggle input {\\n accent-color: var(--dsw-alias-brand-primary);\\n cursor: pointer;\\n}\\n\\n/* ---- fields ---- */\\n\\n.5dfb5268_field {\\n display: grid;\\n grid-template-columns: 96px 1fr;\\n align-items: center;\\n gap: 10px;\\n font-size: 12px;\\n}\\n\\n.2e13439d_label {\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.cdd952c6_hint {\\n grid-column: 2;\\n margin-top: -2px;\\n font-size: 11px;\\n color: var(--dsw-alias-state-warn-primary);\\n}\\n\\n.31dd2d99_input {\\n box-sizing: border-box;\\n width: 100%;\\n min-width: 0;\\n padding: 5px 8px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 6px;\\n outline: none;\\n background: var(--dsw-alias-bg-layer-1);\\n color: var(--dsw-alias-label-primary);\\n font: inherit;\\n font-size: 12px;\\n transition: border-color 120ms ease, background 120ms ease;\\n}\\n\\n/* The base look of every input is INLINE too, so these three state rules only\\n ever take effect as author-important declarations \u2014 same reason as the\\n self-check button above. `cursor` has no inline base and needs none, and the\\n hover border uses `l3` because `l1`\u2192`l2` is a 4%\u219210% black step nobody can\\n see. */\\n\\n.31dd2d99_input:hover:not(:disabled) {\\n border-color: var(--dsw-alias-border-l3) !important;\\n}\\n\\n.31dd2d99_input:focus {\\n border-color: var(--dsw-alias-brand-primary) !important;\\n}\\n\\n.31dd2d99_input:disabled {\\n color: var(--dsw-alias-state-idle-primary) !important;\\n background: var(--dsw-alias-bg-layer-2) !important;\\n cursor: not-allowed;\\n}\\n\\n/* ---- self-check ---- */\\n\\n/* The hover state is the one thing an inline style cannot express, which is why\\n this element carries a class at all. Layout stays inline.\\n\\n Two traps, both hit before this comment existed:\\n - `!important` is load-bearing: the base border and background are INLINE, and\\n the cascade sorts a style attribute after every author rule, so a plain\\n declaration here would ship, match, and still lose.\\n - the TOKENS must be visible ones. `bg-layer-1/2/3` all resolve to\\n `neutral-bluish-00` in the light theme, so a layer swap is a no-op there, and\\n `border-l1`\u2192`l2` is 4%\u219210% black on a 1px line. The app's own hovers use\\n `interactive-bg-hover`; using it here is what makes the feedback exist. */\\n.028bc91c_testButton {\\n transition: border-color 120ms ease, background 120ms ease;\\n}\\n\\n.028bc91c_testButton:hover:not(:disabled) {\\n border-color: var(--dsw-alias-border-l3) !important;\\n background: var(--dsw-alias-interactive-bg-hover) !important;\\n}\\n\\n/* ---- diagnostics ---- */\\n\\n.5d114b0b_diag {\\n margin-top: 2px;\\n padding: 8px 10px;\\n border: 1px solid var(--dsw-alias-border-l1);\\n border-radius: 8px;\\n font-size: 11px;\\n color: var(--dsw-alias-label-secondary);\\n}\\n\\n.27518b39_diagSummary {\\n cursor: pointer;\\n color: var(--dsw-alias-state-warn-primary);\\n}\\n\\n.b3005b62_diagList {\\n margin: 6px 0 0;\\n padding-left: 18px;\\n font-family: ui-monospace, monospace;\\n word-break: break-all;\\n}\\n\";\n document.head.appendChild(__dshStyle);\n}\nmodule.exports = __dshMap;\nmodule.exports.default = __dshMap;\nmodule.exports.__esModule = true;\n", "/**\r\n * dsh-provider-proxy \u2014 browser half.\r\n *\r\n * Contributes ONE settings page (a `settings.section` list entry) that lists\r\n * every known provider with its proxy switch, type, host, port and username.\r\n *\r\n * This replaces an earlier attempt to render into each provider card on the\r\n * Models page (`settings.models.provider-card`). That seat is keyed and\r\n * dispatched per provider namespace, and a third-party registration never\r\n * matched it on this build: no error, no request, simply no output. A\r\n * `settings.section` entry is a plain list contribution with an `id`, which is\r\n * the shape the shipped `dsh-llm-retry-settings` plugin uses successfully in\r\n * this same desktop profile.\r\n *\r\n * The whole bundle runs inside the client module system's lazy-CJS factory:\r\n * executing the script only REGISTERS the factory, and every side effect\r\n * (including the CSS injection) happens at materialization.\r\n */\r\n\r\n// The CSS-Modules build turns this sheet into a hashed class map AND injects it\r\n// at materialization. The binding is what the component reads; importing it for\r\n// side effects only would leave `styles` undefined at render time.\r\nimport styles from './client.css'\r\nimport { defaultProxyProblem } from './proxy-address.js'\r\n\r\ntype Protocol = 'http' | 'https' | 'socks5'\r\n\r\ntype RouteValue = {\r\n enabled: boolean\r\n useDefault: boolean\r\n protocol: Protocol\r\n host: string\r\n port: number\r\n username: string\r\n password: string\r\n onlyHosts: string\r\n bypassHosts: string\r\n testTarget: string\r\n}\r\n\r\n/** The provider rows we know about, and which of them are actually live. */\r\ntype ProviderRow = { id: string; name: string; live: boolean }\r\n\r\n/**\r\n * React, resolved from the client module table.\r\n *\r\n * React is NOT a Cordis service and is not reachable from `ctx` \u2014 reading it\r\n * there produced a silently null component. The module table is the only route:\r\n * the build leaves `react` external, so this compiles to a `require(\"react\")`\r\n * inside the factory closure, answered from the shell-seeded baseline.\r\n *\r\n * Resolved lazily on first render so merely REGISTERING the bundle \u2014 which is\r\n * all a script evaluation does \u2014 never materializes React.\r\n */\r\nlet ReactCache: unknown\r\n\r\nfunction react(): any {\r\n if (ReactCache === undefined) {\r\n ReactCache = ((): unknown => {\r\n try {\r\n return require('react')\r\n } catch {\r\n return (globalThis as Record<string, unknown>).React\r\n }\r\n })()\r\n }\r\n return ReactCache\r\n}\r\n\r\nconst PROTOCOLS: Protocol[] = ['http', 'https', 'socks5']\r\n\r\n/** Our own settings namespace; the profile entry id created by the bundle patch. */\r\nconst NAMESPACE = 'provider-proxy'\r\n\r\n/**\r\n * Cordis services this half needs.\r\n *\r\n * ONLY `slots` is declared. That is the complete set this release actually\r\n * offers on a client fiber: `layout, locale, sessions, slots, theme, timer,\r\n * uiWorkspace, workspaces`.\r\n *\r\n * A declared service that never arrives leaves the fiber PENDING forever, and\r\n * that is NOT a client-only failure \u2014 it is reported as\r\n * web boot: 1 entry did not activate\r\n * dsh-provider-proxy: pending (waiting for service: settingsScope)\r\n * which fails the whole Desktop boot. `settingsScope` and `configForms` were\r\n * both guessed and both are absent here, so neither may be declared.\r\n *\r\n * Settings are therefore reached through `ctx.get(name)` \u2014 the framework's own\r\n * non-throwing lookup \u2014 and the page degrades to read-only when it is absent.\r\n */\r\nconst PLUGINS = ['slots']\r\n\r\nexport const inject = PLUGINS\r\n\r\nexport function apply(ctx: any): void {\r\n // The settings shell declares `settings.section` on its own fiber, so\r\n // `slots.inject` waits for that declaration and the contribution is removed\r\n // when the panel is torn down.\r\n ctx.slots.inject('settings.section', () =>\r\n ctx.slots.register(\r\n {\r\n name: 'settings.section',\r\n id: NAMESPACE,\r\n order: 20,\r\n label: () => 'Provider \u4EE3\u7406',\r\n },\r\n () => renderPage(ctx),\r\n ),\r\n )\r\n}\r\n\r\n/**\r\n * Pick the dictionary.\r\n *\r\n * Chinese is the default, not English: this plugin is written for a\r\n * Chinese-speaking operator, and a page that renders in the wrong language is\r\n * worse than one that never matches the shell's locale.\r\n *\r\n * `ctx.locale` is not injected \u2014 declaring a service that this release does not\r\n * provide left the fiber PENDING and failed the whole Desktop boot \u2014 so the\r\n * locale is probed with the non-throwing `ctx.get`, then the browser's own\r\n * language, and only then English.\r\n */\r\nfunction localeOf(ctx: any): string {\r\n try {\r\n const service = optionalService(ctx, 'locale')\r\n const snapshot = service?.getSnapshot?.() ?? service?.getLocale?.()\r\n const id = typeof snapshot?.locale === 'string' ? snapshot.locale : undefined\r\n if (id !== undefined) return id.toLowerCase().startsWith('zh') ? 'zh' : 'en'\r\n } catch {\r\n // fall through to the browser language\r\n }\r\n const browser = globalThis.navigator?.language\r\n if (typeof browser === 'string' && browser.toLowerCase().startsWith('zh')) return 'zh'\r\n return browser === undefined ? 'zh' : 'en'\r\n}\r\n\r\n/**\r\n * Look a service up WITHOUT declaring it in `inject`.\r\n *\r\n * `ctx.get(name)` is the framework's own optional lookup: it returns undefined\r\n * instead of throwing, and \u2014 unlike a declared service \u2014 it cannot leave the\r\n * fiber PENDING. That is what makes an optional integration safe here: this\r\n * release has no settings service at all, so the page simply shows its fields\r\n * and reports that saving is unavailable.\r\n */\r\nfunction optionalService(ctx: any, ...names: string[]): any {\r\n for (const name of names) {\r\n try {\r\n const found = typeof ctx?.get === 'function' ? ctx.get(name) : undefined\r\n if (found !== undefined && found !== null) return found\r\n } catch {\r\n // try the next spelling\r\n }\r\n }\r\n return undefined\r\n}\r\n\r\n/** The settings form for this plugin's namespace, when one exists. */\r\nfunction formOf(ctx: any): any {\r\n const forms = optionalService(ctx, 'configForms', 'settingsScope')\r\n if (forms === undefined) return undefined\r\n try {\r\n if (typeof forms.get === 'function') return forms.get(NAMESPACE)\r\n // A settingsScope-style service is already bound to one namespace.\r\n if (typeof forms.getSnapshot === 'function' || typeof forms.bind === 'function') return forms\r\n } catch {\r\n return undefined\r\n }\r\n return undefined\r\n}\r\n\r\nfunction readConfig(ctx: any): { value: any; revision: number } {\r\n const form = formOf(ctx)\r\n if (form === undefined) return { value: {}, revision: 0 }\r\n try {\r\n const snapshot = form.getSnapshot?.()\r\n return {\r\n value: snapshot?.value ?? snapshot?.user ?? {},\r\n revision: snapshot?.revision ?? 0,\r\n }\r\n } catch {\r\n return { value: {}, revision: 0 }\r\n }\r\n}\r\n\r\nasync function writeConfig(ctx: any, ops: readonly unknown[]): Promise<void> {\r\n const form = formOf(ctx)\r\n if (typeof form?.mutate !== 'function') {\r\n throw new Error('dsh-provider-proxy: settings transport unavailable')\r\n }\r\n await form.mutate(ops as any[], readConfig(ctx).revision)\r\n}\r\n\r\n/**\r\n * The provider rows, read from the Host.\r\n *\r\n * This release exposes no client-facing LLM service, so the page cannot ask for\r\n * the directory itself. The Host serves it at this same-origin endpoint, where\r\n * `ctx.llm.listProviders()` / `listConfigurableProviders()` actually live. The\r\n * list is therefore automatic \u2014 the user never types a route id.\r\n *\r\n * Only ACTIVE routes are shown. A provider this deployment merely *offers* \u2014\r\n * declared but not registered, so nothing would ever be sent through it \u2014 is\r\n * not the user's business on this page, and listing it only invites them to\r\n * configure a proxy for a route that cannot be selected. A provider that is\r\n * already configured is kept regardless, so a saved setting never silently\r\n * disappears from view.\r\n */\r\nfunction knownProviders(configured: Record<string, RouteValue>, published: ProviderRow[]): ProviderRow[] {\r\n const rows = new Map<string, ProviderRow>()\r\n for (const row of published) {\r\n if (row.live) rows.set(row.id, row)\r\n }\r\n for (const [id, route] of Object.entries(configured)) {\r\n if (rows.has(id)) continue\r\n rows.set(id, { id, name: id, live: route?.enabled === true })\r\n }\r\n return [...rows.values()].sort(byName)\r\n}\r\n\r\n/**\r\n * Where the Host publishes the live provider catalogue.\r\n */\r\nconst CATALOG_PATH = '/dsh-provider-proxy/providers'\r\n\r\n/** Where the Host runs a per-provider connection self-check. */\r\nconst TEST_PATH = '/dsh-provider-proxy/test'\r\n\r\n/**\r\n * Latency bands for the self-check result, in milliseconds.\r\n *\r\n * The colour is decoration, never information: the numeric value is always\r\n * printed, so an unknown theme token (which resolves to `unset`) costs colour,\r\n * never the reading. The `var(..., fallback)` form keeps the colours visible even\r\n * if the theme renames the token.\r\n */\r\nconst LATENCY_FAST_MS = 500\r\nconst LATENCY_SLOW_MS = 1500\r\n\r\nfunction latencyColor(ms: unknown): string {\r\n if (typeof ms !== 'number' || !Number.isFinite(ms)) return 'var(--dsw-alias-label-secondary)'\r\n if (ms <= LATENCY_FAST_MS) return 'var(--dsw-alias-state-success-primary, #2ea043)'\r\n if (ms <= LATENCY_SLOW_MS) return 'var(--dsw-alias-state-warn-primary, #d29922)'\r\n return 'var(--dsw-alias-state-error-primary, #f85149)'\r\n}\r\n\r\n/** Normalize the Host's self-check payload into the shape the card renders. */\r\nfunction testResultFrom(body: any, strings: Record<string, string>): Record<string, unknown> {\r\n const ok = body?.ok === true\r\n return {\r\n pending: false,\r\n ok,\r\n ms: typeof body?.ms === 'number' && Number.isFinite(body.ms) ? body.ms : undefined,\r\n ip: typeof body?.exitIp === 'string' && body.exitIp.length > 0 ? body.exitIp : undefined,\r\n // The Host probes a target the way routing would: a loopback/private upstream\r\n // (or a bypassHosts match) is reached DIRECT, not through the proxy. The card\r\n // says so, so a green check is not read as \"the proxy works\".\r\n direct: body?.viaProxy === false,\r\n error: ok\r\n ? undefined\r\n : typeof body?.error === 'string' && body.error.length > 0\r\n ? body.error\r\n : strings.testFailed,\r\n }\r\n}\r\n\r\n/**\r\n * The setter the lazy catalogue initializer resolves through.\r\n *\r\n * It is republished after every render, so the newest one always wins, and a\r\n * promise that settles after an unmount writes to a harmless no-op.\r\n */\r\nlet catalogueSetter: ((catalog: Catalog) => void) | undefined = () => {}\r\n\r\n/** How one provider's last proxied request ended, as the Host recorded it. */\r\ntype LastUse = {\r\n /** When the most recent proxied request BEGAN. */\r\n startedAt?: number\r\n /** When the last request that FINISHED ended; paired with `ok`/`code`. */\r\n at?: number\r\n ok?: boolean\r\n code?: string\r\n}\r\n\r\n/** What the Host endpoint publishes: provider rows, hit counts, rejected routes. */\r\ntype Catalog = {\r\n rows: ProviderRow[]\r\n hits: Record<string, number>\r\n problems: Record<string, string>\r\n lastUse: Record<string, LastUse>\r\n}\r\n\r\n/**\r\n * A coarse \"how long ago\", for the last-use line.\r\n *\r\n * Deliberately coarse: the page only re-reads the catalogue every 10 s, so a\r\n * second-precision string would look stale on its own and mean nothing.\r\n */\r\nfunction relativeTime(at: number, t: Record<string, string>): string {\r\n const seconds = Math.max(0, Math.round((Date.now() - at) / 1000))\r\n if (seconds < 60) return t.justNow\r\n const minutes = Math.floor(seconds / 60)\r\n if (minutes < 60) return `${minutes}${t.minutesAgo}`\r\n const hours = Math.floor(minutes / 60)\r\n if (hours < 24) return `${hours}${t.hoursAgo}`\r\n return `${Math.floor(hours / 24)}${t.daysAgo}`\r\n}\r\n\r\n/** Read the Host's provider catalogue. Same-origin, so no token is needed. */\r\nasync function fetchCatalog(): Promise<Catalog> {\r\n const response = await globalThis.fetch(CATALOG_PATH, { headers: { accept: 'application/json' } })\r\n if (!response.ok) throw new Error(`Host answered ${response.status}`)\r\n const body = await response.json()\r\n const list = Array.isArray(body?.providers) ? body.providers : []\r\n const rows = list\r\n .filter((row: any) => typeof row?.id === 'string' && row.id.length > 0)\r\n .map((row: any) => ({\r\n id: row.id,\r\n name: typeof row.name === 'string' && row.name.length > 0 ? row.name : row.id,\r\n live: row.live === true,\r\n }))\r\n // The Host counts requests it routed through each provider's proxy. Anything\r\n // malformed is dropped rather than rendered, so a bad payload cannot put a\r\n // non-numeric string on the page.\r\n const hits: Record<string, number> = {}\r\n const published = body?.hits\r\n if (published !== null && typeof published === 'object') {\r\n for (const [id, count] of Object.entries(published)) {\r\n if (typeof count === 'number' && Number.isFinite(count)) hits[id] = count\r\n }\r\n }\r\n // A route the Host REFUSED (a bad port, half-filled credentials) is absent from\r\n // the provider list entirely, so this map is the only place that says why it is\r\n // missing. The Host already stripped the log prefix from it.\r\n const problems: Record<string, string> = {}\r\n const rejected = body?.problems\r\n if (rejected !== null && typeof rejected === 'object') {\r\n for (const [id, message] of Object.entries(rejected)) {\r\n if (typeof message === 'string' && message.length > 0) problems[id] = message\r\n }\r\n }\r\n // The last-use record: when each provider's most recent proxied request\r\n // began, and \u2014 separately \u2014 how the last request that FINISHED ended. Anything\r\n // malformed is dropped rather than rendered, so a bad payload cannot put a\r\n // non-numeric timestamp on the page. An entry carrying only `startedAt` is\r\n // kept: it is a request still in flight, and the page says when it was started.\r\n const lastUse: Record<string, LastUse> = {}\r\n const publishedLastUse = body?.lastUse\r\n if (publishedLastUse !== null && typeof publishedLastUse === 'object') {\r\n for (const [id, raw] of Object.entries(publishedLastUse)) {\r\n const entry = raw as LastUse | undefined\r\n if (entry === null || typeof entry !== 'object') continue\r\n const at = typeof entry.at === 'number' && Number.isFinite(entry.at) ? entry.at : undefined\r\n const startedAt =\r\n typeof entry.startedAt === 'number' && Number.isFinite(entry.startedAt)\r\n ? entry.startedAt\r\n : undefined\r\n if (at === undefined && startedAt === undefined) continue\r\n lastUse[id] = {\r\n ...(startedAt === undefined ? {} : { startedAt }),\r\n ...(at === undefined ? {} : { at }),\r\n ...(typeof entry.ok === 'boolean' ? { ok: entry.ok } : {}),\r\n ...(typeof entry.code === 'string' && entry.code.length > 0 ? { code: entry.code } : {}),\r\n }\r\n }\r\n }\r\n return { rows, hits, problems, lastUse }\r\n}\r\n\r\n/**\r\n * Catalogue polling while the page is open.\r\n *\r\n * The catalogue (published rows, hit counts, rejected routes) is fetched once at\r\n * mount and would otherwise stay a snapshot for the page's lifetime: the hit\r\n * counter never moves, and a route the Host starts or stops refusing stays\r\n * invisible. One shared interval re-fetches it every CATALOG_REFRESH_MS.\r\n *\r\n * `touchCatalogPolling` runs on every render. Writing the module-level timestamp\r\n * there is deliberately not treated as a render side effect: it is idempotent,\r\n * re-enters nothing (unlike a setState during render), and it is the only signal\r\n * that the page is still alive. A page that stops rendering \u2014 a closed panel \u2014\r\n * goes stale, and the next tick cancels the interval instead of fetching for\r\n * nobody. A failed poll is swallowed: the page keeps its last data, and the\r\n * mount-time fetch already reports a broken endpoint in the diagnostics.\r\n */\r\nconst CATALOG_REFRESH_MS = 10_000\r\nlet catalogPoll: ReturnType<typeof setInterval> | undefined\r\nlet catalogTouchedAt = 0\r\n\r\nfunction touchCatalogPolling(): void {\r\n catalogTouchedAt = Date.now()\r\n if (catalogPoll !== undefined) return\r\n catalogPoll = setInterval(() => {\r\n if (Date.now() - catalogTouchedAt > CATALOG_REFRESH_MS * 2 + 1_000) {\r\n clearInterval(catalogPoll)\r\n catalogPoll = undefined\r\n return\r\n }\r\n void fetchCatalog()\r\n .then(catalog => catalogueSetter?.(catalog))\r\n .catch(() => undefined)\r\n }, CATALOG_REFRESH_MS)\r\n}\r\n\r\nconst byName = (a: ProviderRow, b: ProviderRow): number => a.name.localeCompare(b.name)\r\n\r\n/**\r\n * Rule entries that can never match anything.\r\n *\r\n * The Host's matcher compares a lower-cased target HOSTNAME against entries\r\n * (suffix match, `*` for all) \u2014 so an entry carrying a scheme (`https://\u2026`) or\r\n * a path (`example.com/v1`) never matches, and the rule silently does the\r\n * opposite of what the user typed: a malformed `onlyHosts` entry makes\r\n * fail-closed send traffic DIRECT while the user believes it is proxied. The\r\n * Host cannot warn about this \u2014 refusing the whole route over a rule typo\r\n * would break proxying that still works \u2014 so the page flags the value exactly\r\n * where it is typed, from the merged view (draft included).\r\n */\r\nfunction deadRuleEntries(raw: string): string[] {\r\n return raw\r\n .split(/[,\\s]+/)\r\n .map(entry => entry.trim())\r\n .filter(entry => /^[a-z][a-z0-9+.-]*:\\/\\//i.test(entry) || entry.includes('/'))\r\n}\r\n\r\nfunction view(route: Partial<RouteValue> | undefined): RouteValue {\r\n return {\r\n enabled: route?.enabled === true,\r\n useDefault: route?.useDefault === true,\r\n protocol: PROTOCOLS.includes(route?.protocol as Protocol) ? (route!.protocol as Protocol) : 'http',\r\n host: route?.host ?? '',\r\n port: route?.port ?? 0,\r\n username: route?.username ?? '',\r\n password: route?.password ?? '',\r\n onlyHosts: route?.onlyHosts ?? '',\r\n bypassHosts: route?.bypassHosts ?? '',\r\n testTarget: route?.testTarget ?? '',\r\n }\r\n}\r\n\r\n/** Drop the brackets WHATWG URL keeps on an IPv6 literal host. */\r\nfunction unbracket(hostname: string): string {\r\n return hostname.startsWith('[') && hostname.endsWith(']') ? hostname.slice(1, -1) : hostname\r\n}\r\n\r\n/**\r\n * Split a pasted full proxy URL into route fields, or `undefined` when the text\r\n * is not one.\r\n *\r\n * `socks5` is a NON-special scheme, so WHATWG URL still parses its userinfo and\r\n * port (verified), but three quirks are handled here:\r\n * - the userinfo is NOT percent-decoded by the parser, so it is decoded here;\r\n * - an IPv6 literal comes back bracketed, and the host field wants it bare;\r\n * - a DEFAULT port is normalized away by the parser, so a missing port stays 0\r\n * (\"not configured\") instead of being invented.\r\n */\r\nfunction splitProxyUrl(text: string): Partial<RouteValue> | undefined {\r\n const trimmed = text.trim()\r\n if (!/^[a-z][a-z0-9+.-]*:\\/\\//i.test(trimmed)) return undefined\r\n let url: URL\r\n try {\r\n url = new URL(trimmed)\r\n } catch {\r\n return undefined\r\n }\r\n const scheme = url.protocol.slice(0, -1).toLowerCase()\r\n // `socks://` is a common spelling this plugin does not accept on its own;\r\n // normalizing it here means a pasted alias still lands on the supported\r\n // transport instead of being rejected later.\r\n const protocol = scheme === 'socks' ? 'socks5' : scheme\r\n if (!PROTOCOLS.includes(protocol as Protocol)) return undefined\r\n if (url.hostname.length === 0) return undefined\r\n const decode = (value: string): string => {\r\n try {\r\n return decodeURIComponent(value)\r\n } catch {\r\n return value\r\n }\r\n }\r\n const parsedPort = url.port.length > 0 ? Number.parseInt(url.port, 10) : 0\r\n return {\r\n protocol: protocol as Protocol,\r\n host: unbracket(url.hostname),\r\n port: Number.isNaN(parsedPort) ? 0 : parsedPort,\r\n username: decode(url.username),\r\n password: decode(url.password),\r\n }\r\n}\r\n\r\n/**\r\n * Pending writes, one debounced timer per provider+field.\r\n *\r\n * Every keystroke of an input fires `bind`, and the Host rebuilds its whole\r\n * proxy table on each settings write (`loader/volatile-update` \u2192 `rebuild()`).\r\n * Writing per keystroke therefore churns a dispatcher generation per character \u2014\r\n * and, worse, a half-typed credential (\"username without a password\") hits the\r\n * Host guards between keystrokes, so the route is refused for an instant and a\r\n * misleading problem is recorded. Only the LAST value of a burst needs to reach\r\n * the Host; the draft already gives the control its instant feedback.\r\n *\r\n * Module-level, so the timers survive a re-render (each pass rebuilds `save`)\r\n * and a page unmount: a write that was already promised still lands.\r\n */\r\nconst WRITE_DELAY_MS = 300\r\nconst pendingWrites = new Map<string, { timer: ReturnType<typeof setTimeout> }>()\r\n\r\n/** The provider directory, cached module-side. See renderPage. */\r\nlet directoryCache: ProviderRow[] | undefined\r\n\r\n/**\r\n * Everything the page learned about its own wiring, rendered verbatim.\r\n *\r\n * The browser side of a plugin has no other diagnostic channel \u2014 the Host log\r\n * never sees it \u2014 so a silent failure had to be diagnosed by inference. This\r\n * panel is what proved that `remote.settings` and `remote.llm` do not exist in\r\n * this release, and that the catalogue had to come from the Host endpoint.\r\n *\r\n * Cleared at the start of every render so the panel shows the CURRENT state\r\n * rather than an ever-growing log of the session.\r\n */\r\nlet diagnostics: string[] = []\r\n\r\nfunction note(message: string): void {\r\n if (!diagnostics.includes(message)) diagnostics.push(message)\r\n}\r\n\r\n/**\r\n * Layout constants, applied as INLINE styles.\r\n *\r\n * The page is rendered into the settings panel, and the CSS-Modules pipeline\r\n * that feeds the stylesheet has broken twice in ways that were invisible from\r\n * the source: the class map failed to bind at all, and a shared class prefix\r\n * silently merged two rules. Both left the page readable but laid out as one\r\n * unstyled block.\r\n *\r\n * Structure is therefore expressed as inline styles, which cannot be lost by\r\n * the bundle, and the stylesheet is kept for the purely decorative parts. A\r\n * theme token that is not defined simply resolves to `unset`, so an unknown\r\n * token costs colour, never layout.\r\n */\r\nconst S = {\r\n root: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n maxWidth: '720px',\r\n },\r\n card: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '12px',\r\n padding: '14px 16px',\r\n marginBottom: '12px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '10px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n },\r\n cardActive: {\r\n borderColor: 'var(--dsw-alias-state-success-primary)',\r\n background: 'var(--dsw-alias-bg-layer-2)',\r\n },\r\n head: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n justifyContent: 'space-between',\r\n gap: '12px',\r\n },\r\n titles: { display: 'flex', alignItems: 'baseline', gap: '8px', minWidth: '0' },\r\n name: {\r\n fontSize: '14px',\r\n fontWeight: '600',\r\n color: 'var(--dsw-alias-label-primary)',\r\n overflow: 'hidden',\r\n textOverflow: 'ellipsis',\r\n whiteSpace: 'nowrap',\r\n },\r\n id: {\r\n flex: 'none',\r\n padding: '1px 6px',\r\n borderRadius: '4px',\r\n background: 'var(--dsw-alias-bg-layer-2)',\r\n fontFamily: 'ui-monospace, monospace',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n hits: {\r\n flex: 'none',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n whiteSpace: 'nowrap',\r\n },\r\n testRow: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '10px',\r\n flexWrap: 'wrap',\r\n },\r\n testButton: {\r\n padding: '5px 12px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '6px',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n cursor: 'pointer',\r\n },\r\n testResult: {\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n wordBreak: 'break-all',\r\n },\r\n /**\r\n * A failed check is the answer, not decoration: it takes the error colour and\r\n * a heavier weight, unlike the latency band colour which only tints a number\r\n * that is printed anyway.\r\n */\r\n testFailure: {\r\n color: 'var(--dsw-alias-state-error-primary, #f85149)',\r\n fontWeight: '500',\r\n },\r\n /** A rejected route is a failure of the settings, not a warning about them. */\r\n diagProblem: {\r\n color: 'var(--dsw-alias-state-error-primary, #f85149)',\r\n },\r\n advanced: {\r\n marginTop: '4px',\r\n fontSize: '12px',\r\n },\r\n advancedSummary: {\r\n cursor: 'pointer',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n pill: {\r\n flex: 'none',\r\n padding: '2px 10px',\r\n borderRadius: '999px',\r\n fontSize: '11px',\r\n fontWeight: '500',\r\n whiteSpace: 'nowrap',\r\n },\r\n pillOn: {\r\n background: 'var(--dsw-alias-state-success-primary)',\r\n color: 'var(--dsw-alias-bg-base)',\r\n },\r\n pillLive: {\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n pillOff: { color: 'var(--dsw-alias-state-idle-primary)' },\r\n /**\r\n * The shared default endpoint sits on its own layer so it reads as global\r\n * rather than as one more provider card \u2014 the mistake it exists to prevent is\r\n * a user typing the same address into every card.\r\n */\r\n defaultCard: {\r\n display: 'flex',\r\n flexDirection: 'column',\r\n gap: '10px',\r\n padding: '14px 16px',\r\n border: '1px solid var(--dsw-alias-border-l2)',\r\n borderRadius: '10px',\r\n background: 'var(--dsw-alias-bg-layer-2)',\r\n },\r\n defaultLead: {\r\n margin: '-2px 0 0',\r\n fontSize: '11px',\r\n lineHeight: '1.5',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n inheritNote: {\r\n margin: '0',\r\n fontSize: '11px',\r\n lineHeight: '1.5',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n /** The default is not configured: an answer, so it takes the error colour. */\r\n inheritWarning: {\r\n margin: '0',\r\n fontSize: '11px',\r\n lineHeight: '1.5',\r\n fontWeight: '500',\r\n color: 'var(--dsw-alias-state-error-primary, #f85149)',\r\n },\r\n toggle: {\r\n display: 'flex',\r\n alignItems: 'center',\r\n gap: '8px',\r\n fontSize: '12px',\r\n color: 'var(--dsw-alias-label-primary)',\r\n },\r\n field: {\r\n display: 'grid',\r\n gridTemplateColumns: '88px 1fr',\r\n alignItems: 'center',\r\n gap: '10px',\r\n fontSize: '12px',\r\n },\r\n label: { color: 'var(--dsw-alias-label-secondary)' },\r\n input: {\r\n boxSizing: 'border-box',\r\n width: '100%',\r\n minWidth: '0',\r\n padding: '6px 8px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '6px',\r\n outline: 'none',\r\n background: 'var(--dsw-alias-bg-layer-1)',\r\n color: 'var(--dsw-alias-label-primary)',\r\n font: 'inherit',\r\n fontSize: '12px',\r\n },\r\n} as const\r\n\r\nfunction renderPage(ctx: any): unknown {\r\n const React = react()\r\n if (React === undefined || typeof React.createElement !== 'function') return null\r\n\r\n const h = React.createElement\r\n const t = stringsFor(ctx)\r\n diagnostics = []\r\n\r\n // `useState` is only reached after the React check, so the early return above\r\n // cannot desync the hooks order.\r\n let snapshot: { value: any; revision: number }\r\n try {\r\n snapshot = readConfig(ctx)\r\n } catch {\r\n snapshot = { value: {}, revision: 0 }\r\n }\r\n const configured = (snapshot.value?.providers ?? {}) as Record<string, RouteValue>\r\n note(\r\n formOf(ctx) === undefined\r\n ? '\u8BBE\u7F6E\uFF1A\u672A\u627E\u5230 configForms \u670D\u52A1\uFF0C\u53EA\u80FD\u663E\u793A\u3001\u65E0\u6CD5\u4FDD\u5B58'\r\n : `\u8BBE\u7F6E\uFF1A\u6B63\u5E38\uFF08\u4FEE\u8BA2\u53F7 ${snapshot.revision}\uFF0C${Object.keys(configured).length} \u4E2A provider\uFF09`,\r\n )\r\n\r\n // The provider catalogue comes from the Host over a same-origin endpoint, so\r\n // it arrives asynchronously. The initial state is a LAZY initializer, so the\r\n // fetch starts from `useState(() => \u2026)` instead of by calling a setter during\r\n // render: a render must have no side effects, and doing so also shifted the\r\n // hook order between passes.\r\n const [state, setState] = (React.useState ?? ((fn: any) => [fn(), () => {}]))(() => {\r\n void fetchCatalog()\r\n .then(catalog => catalogueSetter?.(catalog))\r\n .catch((error: any) => {\r\n note(`provider \u5217\u8868\u83B7\u53D6\u5931\u8D25\uFF1A${error?.message ?? error}`)\r\n catalogueSetter?.({ rows: [], hits: {}, problems: {}, lastUse: {} })\r\n })\r\n return {\r\n rows: undefined as ProviderRow[] | undefined,\r\n hits: {} as Record<string, number>,\r\n problems: {} as Record<string, string>,\r\n lastUse: {} as Record<string, LastUse>,\r\n pending: true,\r\n }\r\n })\r\n // The setter is published right after the hook so the initializer's promise\r\n // can reach it. It is re-published on every render, so the latest wins.\r\n catalogueSetter = catalog =>\r\n setState({\r\n rows: catalog.rows,\r\n hits: catalog.hits,\r\n problems: catalog.problems,\r\n lastUse: catalog.lastUse,\r\n pending: false,\r\n })\r\n // Keeps the catalogue (rows, hit counts, rejected routes) current while the\r\n // page is open; see the function's own notes for the staleness handling.\r\n touchCatalogPolling()\r\n\r\n const published = state.rows ?? []\r\n const hits = state.hits ?? {}\r\n const lastUse = state.lastUse ?? {}\r\n\r\n /**\r\n * The one-line last-use summary for a card, or `undefined` when the route has\r\n * never carried a request. `hits` says the route HAS been used; this says\r\n * whether it still works \u2014 the question a silently stalled proxy raises.\r\n *\r\n * A success or failure uses `at`, the time the last request FINISHED \u2014 the\r\n * time its outcome belongs to. A request that has only STARTED uses\r\n * `startedAt`, so a still-in-flight call cannot make the page claim an outcome\r\n * it does not have yet.\r\n */\r\n const lastUseText = (id: string): string | undefined => {\r\n const use = lastUse[id]\r\n if (use === undefined) return undefined\r\n if (use.ok === true) return `${t.recentOk}${relativeTime(use.at ?? use.startedAt ?? Date.now(), t)}`\r\n if (use.ok === false) return `${t.recentFail}${use.code ?? 'ERROR'}`\r\n return `${t.recentStarted}${relativeTime(use.startedAt ?? use.at ?? Date.now(), t)}`\r\n }\r\n // Rendered straight from state rather than through `note()`: `diagnostics` is\r\n // cleared at the start of every render, so a note written when the catalog\r\n // arrives would not survive to the next pass.\r\n const problems = state.problems ?? {}\r\n const problemLines = Object.entries(problems).map(([id, message]) =>\r\n h('li', { key: `p:${id}`, style: S.diagProblem }, `${id}\uFF1A${message}`),\r\n )\r\n const problemCount = problemLines.length\r\n note(\r\n `provider \u5217\u8868\uFF1A\u6765\u81EA Host \u5171 ${published.length} \u4E2A\uFF08${published.map((r: ProviderRow) => r.id).join('\u3001') || '\u65E0'}\uFF09`,\r\n )\r\n // Local draft, layered over the stored config.\r\n //\r\n // Without it a checkbox does not change until the panel remounts: the value\r\n // is read from the settings store, which only updates when the page is\r\n // rebuilt. The draft makes the control respond immediately, then reconciles\r\n // with the store so a refused write is visible rather than silently lost.\r\n const [draft, setDraft] = (React.useState ?? ((v: any) => [v, () => {}]))({})\r\n const edit = (id: string, field: string, value: unknown) =>\r\n setDraft((current: any) => ({ ...current, [id]: { ...current[id], [field]: value } }))\r\n\r\n /**\r\n * The shared default endpoint gets its own draft for the same reason a card\r\n * does: its controls must show an edit before the debounced write lands.\r\n *\r\n * It is deliberately NOT stored under a sentinel key inside `draft`:\r\n * `knownProviders` unions the stored config with the draft to build the card\r\n * list, so such a key would surface as a phantom provider with no name.\r\n */\r\n const [defaultDraft, setDefaultDraft] = (React.useState ?? ((v: any) => [v, () => {}]))({})\r\n const editDefault = (field: string, value: unknown) =>\r\n setDefaultDraft((current: any) => ({ ...current, [field]: value }))\r\n\r\n // Self-check outcomes keyed by provider id: `{ pending: true }` while the Host\r\n // is testing, then the normalized result the card renders.\r\n const [tests, setTests] = (React.useState ?? ((v: any) => [v, () => {}]))({})\r\n\r\n /**\r\n * The list filter. Purely a view concern: it hides cards, it never touches a\r\n * saved setting, so a page with no filter one day still shows every route.\r\n */\r\n const [filter, setFilter] = (React.useState ?? ((v: any) => [v, () => {}]))('')\r\n\r\n /**\r\n * Run the Host's self-check for one provider.\r\n *\r\n * The check is not routed traffic, so it never changes the hit count; the count\r\n * on the card is read at mount and stays put until the page reloads.\r\n */\r\n const runTest = (id: string): void => {\r\n setTests((current: any) => ({ ...current, [id]: { pending: true } }))\r\n void (async () => {\r\n try {\r\n const response = await globalThis.fetch(TEST_PATH, {\r\n method: 'POST',\r\n headers: { 'content-type': 'application/json', accept: 'application/json' },\r\n body: JSON.stringify({ provider: id }),\r\n })\r\n const body = await response.json()\r\n setTests((current: any) => ({ ...current, [id]: testResultFrom(body, t) }))\r\n } catch (error: any) {\r\n setTests((current: any) => ({\r\n ...current,\r\n [id]: { pending: false, ok: false, error: String(error?.message ?? error) },\r\n }))\r\n }\r\n })()\r\n }\r\n\r\n const rows = knownProviders({ ...configured, ...draft }, published)\r\n\r\n /**\r\n * Persist one field, debounced per `key`: a burst of edits to the same control\r\n * collapses into ONE write carrying the last value. The control already shows\r\n * the new value via the draft, so this only has to succeed quietly; a refusal\r\n * is reported in the diagnostics and undone by `onRefused`.\r\n */\r\n const save = (\r\n key: string,\r\n path: unknown[],\r\n label: string,\r\n value: unknown,\r\n onRefused: () => void,\r\n ) => {\r\n const pending = pendingWrites.get(key)\r\n if (pending !== undefined) clearTimeout(pending.timer)\r\n const timer = setTimeout(() => {\r\n pendingWrites.delete(key)\r\n void writeConfig(ctx, [{ op: 'set', path, value }])\r\n .then(() => {\r\n note(`\u5DF2\u4FDD\u5B58 ${label} = ${JSON.stringify(value)}`)\r\n })\r\n .catch((error: any) => {\r\n note(`\u4FDD\u5B58\u5931\u8D25 ${label}\uFF1A${error?.message ?? error}`)\r\n onRefused()\r\n })\r\n }, WRITE_DELAY_MS)\r\n pendingWrites.set(key, { timer })\r\n }\r\n\r\n /**\r\n * Undo ONE refused field in a card's draft.\r\n *\r\n * Only that field is dropped. Other fields of the same provider may hold edits\r\n * that are still pending or already accepted \u2014 dropping the whole draft entry\r\n * would throw away values the Host never objected to. An entry left empty by\r\n * the removal is dropped entirely, so it cannot keep a phantom row alive.\r\n */\r\n const rollbackRouteField = (id: string, field: string): void => {\r\n setDraft((current: any) => {\r\n const entry = current[id]\r\n if (entry === undefined || entry[field] === undefined) return current\r\n const nextEntry = { ...entry }\r\n delete nextEntry[field]\r\n const next = { ...current }\r\n if (Object.keys(nextEntry).length === 0) delete next[id]\r\n else next[id] = nextEntry\r\n return next\r\n })\r\n }\r\n\r\n /** One card control: update the draft instantly, persist in the background. */\r\n const bind = (id: string, field: string) => (value: unknown) => {\r\n edit(id, field, value)\r\n save(`${id}\\u0000${field}`, ['providers', id, field], `${id}.${field}`, value, () =>\r\n rollbackRouteField(id, field),\r\n )\r\n }\r\n\r\n /** One default-block control: same contract, addressed at `defaultProxy`. */\r\n const bindDefault = (field: string) => (value: unknown) => {\r\n editDefault(field, value)\r\n save(`\\u0000default\\u0000${field}`, ['defaultProxy', field], `defaultProxy.${field}`, value, () => {\r\n // Same rule as a card field: drop only this field, and only if the draft\r\n // still holds it, so an already-accepted sibling edit is never discarded.\r\n setDefaultDraft((current: any) => {\r\n if (current[field] === undefined) return current\r\n const next = { ...current }\r\n delete next[field]\r\n return next\r\n })\r\n })\r\n }\r\n\r\n /**\r\n * One debounced write carrying SEVERAL edits at once.\r\n *\r\n * Used for a pasted proxy URL: five separate writes would each rebuild the\r\n * Host's whole proxy table, and a half-applied paste (credentials without the\r\n * host, say) would hit the credential guards mid-burst \u2014 the same trap the\r\n * per-field debounce exists to avoid.\r\n */\r\n const saveMany = (key: string, ops: unknown[], label: string, onRefused: () => void) => {\r\n const pending = pendingWrites.get(key)\r\n if (pending !== undefined) clearTimeout(pending.timer)\r\n const timer = setTimeout(() => {\r\n pendingWrites.delete(key)\r\n void writeConfig(ctx, ops)\r\n .then(() => {\r\n note(`\u5DF2\u4FDD\u5B58 ${label}`)\r\n })\r\n .catch((error: any) => {\r\n note(`\u4FDD\u5B58\u5931\u8D25 ${label}\uFF1A${error?.message ?? error}`)\r\n onRefused()\r\n })\r\n }, WRITE_DELAY_MS)\r\n pendingWrites.set(key, { timer })\r\n }\r\n\r\n /** Undo one set of pasted fields in a card's draft. */\r\n const rollbackRouteFields = (id: string, fields: readonly string[]): void => {\r\n setDraft((current: any) => {\r\n const entry = current[id]\r\n if (entry === undefined) return current\r\n const nextEntry = { ...entry }\r\n for (const field of fields) delete nextEntry[field]\r\n const next = { ...current }\r\n if (Object.keys(nextEntry).length === 0) delete next[id]\r\n else next[id] = nextEntry\r\n return next\r\n })\r\n }\r\n\r\n /** Apply a parsed proxy URL to one card: one draft update, one write. */\r\n const applyCardUrl = (id: string, parts: Record<string, unknown>): void => {\r\n setDraft((current: any) => ({ ...current, [id]: { ...current[id], ...parts } }))\r\n const fields = Object.keys(parts)\r\n saveMany(\r\n `${id}\\u0000*paste`,\r\n fields.map(field => ({ op: 'set', path: ['providers', id, field], value: parts[field] })),\r\n `${id}.*\uFF08\u7C98\u8D34\u4EE3\u7406 URL\uFF09`,\r\n () => rollbackRouteFields(id, fields),\r\n )\r\n }\r\n\r\n /** Apply a parsed proxy URL to the shared default endpoint. */\r\n const applyDefaultUrl = (parts: Record<string, unknown>): void => {\r\n setDefaultDraft((current: any) => ({ ...current, ...parts }))\r\n const fields = Object.keys(parts)\r\n saveMany(\r\n '\\u0000default\\u0000*paste',\r\n fields.map(field => ({ op: 'set', path: ['defaultProxy', field], value: parts[field] })),\r\n '\u9ED8\u8BA4\u4EE3\u7406\uFF08\u7C98\u8D34\u4EE3\u7406 URL\uFF09',\r\n () => {\r\n setDefaultDraft((current: any) => {\r\n const next = { ...current }\r\n for (const field of fields) delete next[field]\r\n return next\r\n })\r\n },\r\n )\r\n }\r\n\r\n /**\r\n * Promote a card's own endpoint to the shared default.\r\n *\r\n * The reduced form of \"copy this card to another\": once the endpoint lives in\r\n * the default block, every other card opts in with one switch, so a\r\n * multi-select picker would be a second way to do the same thing.\r\n */\r\n const promoteToDefault = (id: string): void => {\r\n const route = view({ ...configured[id], ...draft[id] })\r\n applyDefaultUrl({\r\n protocol: route.protocol,\r\n host: route.host.trim(),\r\n port: route.port,\r\n username: route.username,\r\n password: route.password,\r\n })\r\n }\r\n\r\n /** Point every card at the default endpoint, in one write. */\r\n const applyDefaultToAll = (): void => {\r\n const ids = rows.map(row => row.id)\r\n if (ids.length === 0) return\r\n setDraft((current: any) => {\r\n const next = { ...current }\r\n for (const id of ids) next[id] = { ...next[id], useDefault: true }\r\n return next\r\n })\r\n saveMany(\r\n '\\u0000default\\u0000applyAll',\r\n ids.map(id => ({ op: 'set', path: ['providers', id, 'useDefault'], value: true })),\r\n '\u6240\u6709 provider \u7684 useDefault',\r\n () =>\r\n setDraft((current: any) => {\r\n const next = { ...current }\r\n for (const id of ids) {\r\n const entry = next[id]\r\n if (entry === undefined || entry.useDefault === undefined) continue\r\n const nextEntry = { ...entry }\r\n delete nextEntry.useDefault\r\n if (Object.keys(nextEntry).length === 0) delete next[id]\r\n else next[id] = nextEntry\r\n }\r\n return next\r\n }),\r\n )\r\n }\r\n\r\n /**\r\n * A paste handler for any proxy-address field.\r\n *\r\n * Only a RECOGNISED proxy URL is intercepted; anything else falls through to\r\n * the browser so a pasted bare host still lands in the field normally.\r\n */\r\n const onProxyUrlPaste =\r\n (apply: (parts: Record<string, unknown>) => void) =>\r\n (event: any): void => {\r\n const text = event?.clipboardData?.getData?.('text')\r\n if (typeof text !== 'string') return\r\n const parts = splitProxyUrl(text)\r\n if (parts === undefined) return\r\n event.preventDefault?.()\r\n apply(parts)\r\n }\r\n\r\n const field = (label: string, control: unknown, hint?: string, hintError?: boolean): unknown =>\r\n h(\r\n 'label',\r\n { className: styles.field, style: S.field, key: label },\r\n h('span', { className: styles.label, style: S.label }, label),\r\n control,\r\n hint === undefined\r\n ? null\r\n : h(\r\n 'span',\r\n {\r\n className: styles.hint,\r\n style: {\r\n gridColumn: '2',\r\n fontSize: '11px',\r\n // A warning that a value can never work is an answer, not\r\n // decoration \u2014 same rule as the failed self-check text.\r\n ...(hintError === true\r\n ? { color: 'var(--dsw-alias-state-error-primary, #f85149)' }\r\n : {}),\r\n },\r\n },\r\n hint,\r\n ),\r\n )\r\n\r\n /**\r\n * The shared endpoint block, always rendered.\r\n *\r\n * It is the only place the address can be entered, so hiding it until some\r\n * card opts in would leave no way to configure it in the first place.\r\n */\r\n const storedDefault = (snapshot.value?.defaultProxy ?? {}) as Partial<RouteValue>\r\n const defaultView = view({ ...storedDefault, ...defaultDraft })\r\n // The SAME predicate the Host applies, imported rather than re-written: a\r\n // browser copy that only checked \"host non-empty and port in range\" called\r\n // `https://1.2.3.4` usable and enabled the bulk button, while the Host refused\r\n // every route pointed at it.\r\n //\r\n // The REASON is kept as well as the verdict: the block refuses for several\r\n // reasons (no host, a scheme-carrying host, a bad port, a half-filled\r\n // credential), and a card that said \"missing host or port\" for all of them sent\r\n // the user to the one field that was already correct.\r\n const defaultWhy = defaultProxyProblem(defaultView)\r\n const defaultUsable = defaultWhy === undefined\r\n const defaultOrigin = `${defaultView.protocol}://${defaultView.host}:${defaultView.port}`\r\n const defaultBlock = h(\r\n 'div',\r\n { className: styles.defaultCard, style: S.defaultCard, key: 'default-proxy' },\r\n h(\r\n 'header',\r\n { className: styles.cardHead, style: S.head },\r\n h(\r\n 'div',\r\n { className: styles.cardTitles, style: S.titles },\r\n h('span', { className: styles.name, style: S.name }, t.defaultTitle),\r\n ),\r\n h(\r\n 'span',\r\n {\r\n className: defaultUsable ? styles.pillOn : styles.pillOff,\r\n style: { ...S.pill, ...(defaultUsable ? S.pillOn : S.pillOff) },\r\n },\r\n defaultUsable ? t.on : t.off,\r\n ),\r\n ),\r\n h('p', { className: styles.defaultLead, style: S.defaultLead }, t.defaultLead),\r\n field(\r\n t.protocol,\r\n h(\r\n 'select',\r\n {\r\n className: styles.input,\r\n style: S.input,\r\n value: defaultView.protocol,\r\n onChange: (event: any) => bindDefault('protocol')(event.target.value),\r\n },\r\n ...PROTOCOLS.map(protocol =>\r\n h('option', { key: protocol, value: protocol }, protocol.toUpperCase()),\r\n ),\r\n ),\r\n ),\r\n field(\r\n t.host,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: '127.0.0.1',\r\n value: defaultView.host,\r\n onChange: (event: any) => bindDefault('host')(event.target.value),\r\n // Same convenience as the cards: a full URL fills the whole block.\r\n onPaste: onProxyUrlPaste(applyDefaultUrl),\r\n }),\r\n t.hostHint,\r\n ),\r\n field(\r\n t.port,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n type: 'number',\r\n min: 1,\r\n max: 65535,\r\n placeholder: '7890',\r\n value: defaultView.port === 0 ? '' : String(defaultView.port),\r\n onChange: (event: any) => {\r\n const parsed = Number.parseInt(event.target.value, 10)\r\n bindDefault('port')(Number.isNaN(parsed) ? 0 : parsed)\r\n },\r\n }),\r\n ),\r\n field(\r\n t.username,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n autocomplete: 'off',\r\n value: defaultView.username,\r\n onChange: (event: any) => bindDefault('username')(event.target.value),\r\n }),\r\n ),\r\n field(\r\n t.password,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n type: 'password',\r\n autocomplete: 'off',\r\n value: defaultView.password,\r\n onChange: (event: any) => bindDefault('password')(event.target.value),\r\n }),\r\n t.passwordHintProxy,\r\n ),\r\n // Bulk opt-in, in ONE write: a per-card walk would rebuild the table N times.\r\n // Disabled while the default is unusable, because pointing every card at an\r\n // empty endpoint would just refuse them all.\r\n h(\r\n 'div',\r\n { style: S.testRow, key: 'default:apply' },\r\n h(\r\n 'button',\r\n {\r\n className: styles.testButton,\r\n style: S.testButton,\r\n type: 'button',\r\n disabled: !defaultUsable || rows.length === 0,\r\n onClick: applyDefaultToAll,\r\n },\r\n t.applyDefaultAll,\r\n ),\r\n ),\r\n )\r\n\r\n const query = filter.trim().toLowerCase()\r\n const shown =\r\n query.length === 0\r\n ? rows\r\n : rows.filter(row => `${row.id} ${row.name}`.toLowerCase().includes(query))\r\n const filterRow =\r\n rows.length === 0\r\n ? null\r\n : field(\r\n t.filterLabel,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: t.filterPlaceholder,\r\n value: filter,\r\n onChange: (event: any) => setFilter(event.target.value),\r\n }),\r\n )\r\n\r\n // ALWAYS an array: a single element is not iterable, and spreading one threw\r\n // \"Spread syntax requires ...iterable[Symbol.iterator]\" on an empty list.\r\n const body: unknown[] = shown.length === 0\r\n ? [\r\n h(\r\n 'p',\r\n {\r\n className: styles.empty,\r\n key: 'empty',\r\n style: {\r\n margin: '0',\r\n padding: '16px',\r\n border: '1px dashed var(--dsw-alias-border-l1)',\r\n borderRadius: '8px',\r\n fontSize: '12px',\r\n textAlign: 'center',\r\n color: 'var(--dsw-alias-state-idle-primary)',\r\n },\r\n },\r\n query.length > 0 ? t.noMatch : t.empty,\r\n ),\r\n ]\r\n : shown.map(row => {\r\n // The MERGED value, so a just-typed value shows immediately.\r\n const route = view({ ...configured[row.id], ...draft[row.id] })\r\n // The endpoint controls are editable whether or not the route is on: the\r\n // point of the self-check below is to verify a setting BEFORE switching\r\n // it on, which is impossible if the fields can only be typed into while\r\n // traffic is already flowing through them. `enabled` gates routing only.\r\n // The line exists only once a route has actually carried a request, so an\r\n // ENABLED route with no record yet says so \u2014 otherwise a missing line is\r\n // indistinguishable from the feature not existing. A disabled route stays\r\n // silent: it cannot have a record, and saying so on every off card is noise.\r\n const lastText = lastUseText(row.id) ?? (route.enabled ? t.noRecord : undefined)\r\n const result = tests[row.id]\r\n // Rule entries that can never match: flagged under the input instead of\r\n // failing silently \u2014 a dead `onlyHosts` entry means fail-closed sends\r\n // the traffic DIRECT while the user believes it is proxied.\r\n const onlyDead = deadRuleEntries(route.onlyHosts)\r\n const bypassDead = deadRuleEntries(route.bypassHosts)\r\n const useDefault = route.useDefault === true\r\n // Whether this card has an endpoint worth checking: an inheriting card\r\n // depends on the shared default being configured, an own-endpoint card on\r\n // its host and port being complete. Mirrors the Host's own build gate.\r\n const endpointStored = route.useDefault\r\n ? defaultUsable\r\n : route.host.trim().length > 0 &&\r\n Number.isInteger(route.port) &&\r\n route.port >= 1 &&\r\n route.port <= 65535\r\n const showTest = route.enabled || endpointStored\r\n // Built once and either rendered (this route carries its own address) or\r\n // replaced by a one-line note (it inherits the shared default), so a card\r\n // can never show an input that does not apply to it.\r\n const endpointFields = [\r\n field(\r\n t.protocol,\r\n h(\r\n 'select',\r\n {\r\n className: styles.input,\r\n style: S.input,\r\n value: route.protocol,\r\n onChange: (event: any) => bind(row.id, 'protocol')(event.target.value),\r\n },\r\n ...PROTOCOLS.map(protocol =>\r\n h('option', { key: protocol, value: protocol }, protocol.toUpperCase()),\r\n ),\r\n ),\r\n route.protocol === 'socks5' ? t.socks5Hint : undefined,\r\n ),\r\n field(\r\n t.host,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: '127.0.0.1',\r\n value: route.host,\r\n onChange: (event: any) => bind(row.id, 'host')(event.target.value),\r\n // A pasted full proxy URL fills every transport field at once.\r\n onPaste: onProxyUrlPaste(parts => applyCardUrl(row.id, parts)),\r\n }),\r\n t.hostHint,\r\n ),\r\n field(\r\n t.port,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n type: 'number',\r\n min: 1,\r\n max: 65535,\r\n placeholder: '7890',\r\n value: route.port === 0 ? '' : String(route.port),\r\n onChange: (event: any) => {\r\n const parsed = Number.parseInt(event.target.value, 10)\r\n bind(row.id, 'port')(Number.isNaN(parsed) ? 0 : parsed)\r\n },\r\n }),\r\n ),\r\n field(\r\n t.username,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n autocomplete: 'off',\r\n value: route.username,\r\n onChange: (event: any) => bind(row.id, 'username')(event.target.value),\r\n }),\r\n ),\r\n // Every transport accepts a password: SOCKS5 hands it to\r\n // Socks5ProxyAgent as an option, HTTP/HTTPS embed it in the proxy URL\r\n // userinfo (undici turns that into Proxy-Authorization). It is stored on\r\n // the route, so it lands in the settings file with the rest of the\r\n // config; the diagnostics only ever surface a credential-free origin.\r\n field(\r\n t.password,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n type: 'password',\r\n autocomplete: 'off',\r\n value: route.password,\r\n onChange: (event: any) => bind(row.id, 'password')(event.target.value),\r\n }),\r\n route.protocol === 'socks5' ? t.passwordHint : t.passwordHintProxy,\r\n ),\r\n ]\r\n return h(\r\n 'section',\r\n {\r\n className: route.enabled ? styles.cardActive : styles.card,\r\n style: route.enabled ? { ...S.card, ...S.cardActive } : S.card,\r\n key: row.id,\r\n },\r\n h(\r\n 'header',\r\n { className: styles.cardHead, style: S.head },\r\n h(\r\n 'div',\r\n { className: styles.cardTitles, style: S.titles },\r\n h('span', { className: styles.name, style: S.name }, row.name),\r\n h('span', { className: styles.id, style: S.id }, row.id),\r\n // A disabled route can never have hits, so \"0\" there would only add\r\n // noise; the count shows once the route is on (or has counted).\r\n route.enabled || (hits[row.id] ?? 0) > 0\r\n ? h(\r\n 'span',\r\n { style: S.hits },\r\n `${t.hitCountPrefix}${hits[row.id] ?? 0}${t.hitCountSuffix}`,\r\n )\r\n : null,\r\n // The last-use line. A failure takes the error colour, same rule as\r\n // a failed self-check: it is an answer, not decoration.\r\n lastText === undefined\r\n ? null\r\n : h(\r\n 'span',\r\n {\r\n style: {\r\n ...S.hits,\r\n ...(lastUse[row.id]?.ok === false ? S.inheritWarning : {}),\r\n },\r\n },\r\n lastText,\r\n ),\r\n ),\r\n h(\r\n 'span',\r\n {\r\n className: route.enabled ? styles.pillOn : row.live ? styles.pillLive : styles.pillOff,\r\n style: {\r\n ...S.pill,\r\n ...(route.enabled ? S.pillOn : row.live ? S.pillLive : S.pillOff),\r\n },\r\n },\r\n route.enabled ? t.on : row.live ? t.live : t.off,\r\n ),\r\n ),\r\n h(\r\n 'label',\r\n { className: styles.toggle, style: S.toggle },\r\n h('input', {\r\n type: 'checkbox',\r\n checked: route.enabled,\r\n onChange: (event: any) => bind(row.id, 'enabled')(event.target.checked === true),\r\n }),\r\n h('span', null, t.useProxy),\r\n ),\r\n // Opting into the shared endpoint. The card then shows the address it\r\n // will actually use \u2014 or, when the default is not configured, why the\r\n // route is refused \u2014 instead of a set of empty inputs the user never\r\n // filled and cannot interpret.\r\n h(\r\n 'label',\r\n { className: styles.toggle, style: S.toggle, key: `${row.id}:usedefault` },\r\n h('input', {\r\n type: 'checkbox',\r\n checked: useDefault,\r\n onChange: (event: any) => bind(row.id, 'useDefault')(event.target.checked === true),\r\n }),\r\n h('span', null, t.useDefault),\r\n ),\r\n ...(useDefault\r\n ? [\r\n h(\r\n 'p',\r\n {\r\n key: `${row.id}:inherit`,\r\n style: defaultUsable ? S.inheritNote : S.inheritWarning,\r\n },\r\n defaultUsable ? `${t.inheritingDefault}${defaultOrigin}` : `${t.defaultMissing}${defaultWhy}`,\r\n ),\r\n ]\r\n : endpointFields),\r\n // The self-check is offered whenever there is something to check: an\r\n // enabled route (the Host's table carries it, and a rejected one still\r\n // reports WHY), or a disabled one whose endpoint is already complete \u2014\r\n // the Host builds that one for the check alone. A disabled route with\r\n // no endpoint has nothing to test and would only answer \"not enabled\".\r\n showTest\r\n ? h(\r\n 'div',\r\n { style: S.testRow, key: `${row.id}:test` },\r\n // A check on a route that is still off is a trial run, and it says\r\n // so \u2014 otherwise the result reads as though the route were live.\r\n route.enabled ? null : h('span', { style: S.testResult }, t.testDisabledNote),\r\n h(\r\n 'button',\r\n {\r\n className: styles.testButton,\r\n style: S.testButton,\r\n type: 'button',\r\n disabled: result?.pending === true,\r\n onClick: () => runTest(row.id),\r\n },\r\n result?.pending === true ? t.testRunning : t.testButton,\r\n ),\r\n result?.pending === false\r\n ? h(\r\n 'span',\r\n { style: S.testResult },\r\n result.ok === true\r\n ? [\r\n // Only the latency carries the band colour; the exit IP\r\n // stays in the secondary label colour.\r\n h(\r\n 'span',\r\n { key: 'lat', style: { color: latencyColor(result.ms) } },\r\n `\u2713 ${typeof result.ms === 'number' ? result.ms : '\u2014'} ms`,\r\n ),\r\n result.ip === undefined ? null : ` \u00B7 ${t.exitIpLabel}${result.ip}`,\r\n result.direct === true ? ` \u00B7 ${t.directLabel}` : null,\r\n ]\r\n : h('span', { key: 'err', style: S.testFailure }, `\u2717 ${result.error}`),\r\n )\r\n : null,\r\n // Promote this card's endpoint to the shared default. Offered only\r\n // when the card carries its OWN endpoint: an inheriting card would\r\n // just be copying the default onto itself.\r\n endpointStored && !useDefault\r\n ? h(\r\n 'button',\r\n {\r\n className: styles.testButton,\r\n style: S.testButton,\r\n type: 'button',\r\n onClick: () => promoteToDefault(row.id),\r\n },\r\n t.setAsDefault,\r\n )\r\n : null,\r\n )\r\n : null,\r\n // Target-host rules, collapsed so the common case stays one short card.\r\n h(\r\n 'details',\r\n { style: S.advanced, key: `${row.id}:rules` },\r\n h('summary', { style: S.advancedSummary }, t.advanced),\r\n field(\r\n t.onlyHosts,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: 'api.example.com',\r\n value: route.onlyHosts,\r\n onChange: (event: any) => bind(row.id, 'onlyHosts')(event.target.value),\r\n }),\r\n onlyDead.length === 0 ? t.onlyHostsHint : `${t.ruleDeadHint}${onlyDead.join('\u3001')}`,\r\n onlyDead.length > 0,\r\n ),\r\n field(\r\n t.bypassHosts,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: 'localhost',\r\n value: route.bypassHosts,\r\n onChange: (event: any) => bind(row.id, 'bypassHosts')(event.target.value),\r\n }),\r\n bypassDead.length === 0 ? t.bypassHostsHint : `${t.ruleDeadHint}${bypassDead.join('\u3001')}`,\r\n bypassDead.length > 0,\r\n ),\r\n // The self-check target: empty uses the top-level testUrl, set makes\r\n // this card's Test request this URL \u2014 a real upstream proves the whole\r\n // path, not just the proxy hop.\r\n field(\r\n t.testTarget,\r\n h('input', {\r\n className: styles.input,\r\n style: S.input,\r\n placeholder: 'https://api.example.com',\r\n value: route.testTarget,\r\n onChange: (event: any) => bind(row.id, 'testTarget')(event.target.value),\r\n }),\r\n t.testTargetHint,\r\n ),\r\n ),\r\n )\r\n })\r\n\r\n return h(\r\n 'div',\r\n { className: styles.root, style: S.root },\r\n h('p', { className: styles.lead, style: { margin: '0 0 4px', fontSize: '12px', lineHeight: '1.6', color: 'var(--dsw-alias-label-secondary)' } }, t.lead),\r\n defaultBlock,\r\n filterRow,\r\n ...body,\r\n h(\r\n 'details',\r\n {\r\n className: styles.diag,\r\n key: 'diag',\r\n style: {\r\n marginTop: '4px',\r\n padding: '8px 10px',\r\n border: '1px solid var(--dsw-alias-border-l1)',\r\n borderRadius: '8px',\r\n fontSize: '11px',\r\n color: 'var(--dsw-alias-label-secondary)',\r\n },\r\n },\r\n // The count is the only visible signal while the panel is collapsed: a\r\n // rejected route is not a page that refuses to render, it is one that\r\n // quietly does nothing.\r\n h(\r\n 'summary',\r\n { className: styles.diagSummary },\r\n problemCount === 0 ? t.diagnostics : `${t.diagnostics} (${problemCount})`,\r\n ),\r\n h(\r\n 'ul',\r\n { className: styles.diagList, style: { margin: '6px 0 0', paddingLeft: '18px' } },\r\n ...(problemCount === 0 && diagnostics.length === 0\r\n ? [h('li', { key: 'none' }, t.diagPending)]\r\n : [\r\n ...problemLines,\r\n ...diagnostics.map((line, index) => h('li', { key: `d${index}` }, line)),\r\n ]),\r\n ),\r\n ),\r\n )\r\n}\r\n\r\nconst EN = {\r\n lead: 'Route selected model providers through your own forward proxy. Other providers stay direct. Requests to loopback or private addresses (localhost, 127.x, private ranges) always go direct \u2014 a forward proxy cannot reach your own machine.',\r\n empty: 'No providers found yet.',\r\n useProxy: 'Use a proxy for this provider',\r\n useDefault: 'Use the default proxy',\r\n defaultTitle: 'Default proxy',\r\n defaultLead: 'One endpoint, reused by every provider that turns on \"Use the default proxy\".',\r\n inheritingDefault: 'Using the default proxy: ',\r\n defaultMissing: 'The default proxy cannot be used, so this provider is not proxied: ',\r\n filterLabel: 'Filter',\r\n filterPlaceholder: 'Filter by name or id\u2026',\r\n noMatch: 'No provider matches the filter.',\r\n setAsDefault: 'Set as the default proxy',\r\n applyDefaultAll: 'Use the default proxy for all providers',\r\n protocol: 'Type',\r\n host: 'IP / host',\r\n port: 'Port',\r\n username: 'Username',\r\n password: 'Password',\r\n hostHint: 'Host or IP only, without scheme or path. A full proxy URL (socks5://user:pass@host:1080) can be pasted instead \u2014 it is split into the fields.',\r\n passwordHint: 'Sent to the SOCKS5 proxy for authentication; stored with this setting.',\r\n passwordHintProxy: 'Sent to the proxy as an authentication password; stored with this setting.',\r\n hitCountPrefix: '',\r\n hitCountSuffix: ' proxied',\r\n recentOk: 'last ok ',\r\n recentFail: 'last failure ',\r\n recentStarted: 'last call ',\r\n noRecord: 'no proxied request yet',\r\n justNow: 'just now',\r\n minutesAgo: ' min ago',\r\n hoursAgo: ' h ago',\r\n daysAgo: ' d ago',\r\n testButton: 'Test',\r\n testRunning: 'Testing\u2026',\r\n testDisabledNote: 'Not enabled \u2014 test only: ',\r\n testFailed: 'Test failed',\r\n exitIpLabel: 'exit IP ',\r\n directLabel: 'direct (not through the proxy)',\r\n advanced: 'Advanced: target host rules',\r\n onlyHosts: 'Proxy only',\r\n onlyHostsHint: 'Comma/space separated; when set, only requests to these hosts are proxied (suffix match, * for all).',\r\n bypassHosts: 'Bypass',\r\n bypassHostsHint: 'Comma/space separated; requests to these hosts go direct, taking priority.',\r\n ruleDeadHint: 'These entries never match \u2014 rules take host names only, without scheme or path: ',\r\n testTarget: 'Self-check target',\r\n testTargetHint: 'Empty uses the top-level testUrl; when set, this card\\'s Test requests this URL instead \u2014 point it at a real upstream to verify the end-to-end path.',\r\n socks5Hint: 'SOCKS5 tunnels the connection; the proxy resolves the target host name.',\r\n on: 'proxied',\r\n live: 'active',\r\n off: 'direct',\r\n diagnostics: 'Connection diagnostics',\r\n diagPending: '(collecting\u2026)',\r\n}\r\n\r\nconst ZH = {\r\n lead: '\u8BA9\u6307\u5B9A\u7684 provider \u8D70\u4F60\u81EA\u5DF1\u7684\u6B63\u5411\u4EE3\u7406\uFF0C\u5176\u5B83 provider \u4FDD\u6301\u76F4\u8FDE\u3002\u6307\u5411\u672C\u673A\u6216\u5185\u7F51\u5730\u5740\uFF08localhost\u3001127.x\u3001\u79C1\u6709\u7F51\u6BB5\uFF09\u7684\u8BF7\u6C42\u59CB\u7EC8\u76F4\u8FDE\u2014\u2014\u6B63\u5411\u4EE3\u7406\u591F\u4E0D\u5230\u4F60\u81EA\u5DF1\u7684\u673A\u5668\u3002',\r\n empty: '\u6CA1\u6709\u68C0\u6D4B\u5230\u4EFB\u4F55 provider\u3002',\r\n useProxy: '\u4E3A\u8BE5 provider \u542F\u7528\u4EE3\u7406',\r\n useDefault: '\u4F7F\u7528\u9ED8\u8BA4\u4EE3\u7406',\r\n defaultTitle: '\u9ED8\u8BA4\u4EE3\u7406',\r\n defaultLead: '\u4E3A\u52FE\u9009\u300C\u4F7F\u7528\u9ED8\u8BA4\u4EE3\u7406\u300D\u7684 provider \u590D\u7528\u7684\u7AEF\u70B9\uFF0C\u53EA\u586B\u4E00\u6B21\u3002',\r\n inheritingDefault: '\u4F7F\u7528\u9ED8\u8BA4\u4EE3\u7406\uFF1A',\r\n defaultMissing: '\u9876\u5C42\u9ED8\u8BA4\u4EE3\u7406\u4E0D\u53EF\u7528\uFF0C\u8BE5 provider \u4E0D\u4F1A\u8D70\u4EE3\u7406\uFF1A',\r\n filterLabel: '\u8FC7\u6EE4',\r\n filterPlaceholder: '\u6309\u540D\u79F0\u6216 id \u8FC7\u6EE4\u2026',\r\n noMatch: '\u6CA1\u6709\u5339\u914D\u7684 provider\u3002',\r\n setAsDefault: '\u8BBE\u4E3A\u9ED8\u8BA4\u4EE3\u7406',\r\n applyDefaultAll: '\u6240\u6709 provider \u4F7F\u7528\u9ED8\u8BA4\u4EE3\u7406',\r\n protocol: '\u7C7B\u578B',\r\n host: 'IP / \u4E3B\u673A',\r\n port: '\u7AEF\u53E3',\r\n username: '\u7528\u6237\u540D',\r\n password: '\u5BC6\u7801',\r\n hostHint: '\u53EA\u586B\u4E3B\u673A\u540D\u6216 IP\uFF0C\u4E0D\u8981\u5E26\u534F\u8BAE\u524D\u7F00\u6216\u8DEF\u5F84\uFF1B\u4E5F\u53EF\u4EE5\u76F4\u63A5\u7C98\u8D34\u5B8C\u6574\u4EE3\u7406 URL\uFF08\u5982 socks5://user:pass@host:1080\uFF09\uFF0C\u4F1A\u81EA\u52A8\u62C6\u5206\u5230\u5404\u5B57\u6BB5\u3002',\r\n passwordHint: '\u4EC5\u4F5C\u4E3A SOCKS5 \u8BA4\u8BC1\u53E3\u4EE4\u53D1\u9001\u7ED9\u4EE3\u7406\uFF1B\u968F\u8BE5\u8BBE\u7F6E\u4E00\u8D77\u4FDD\u5B58\u3002',\r\n passwordHintProxy: '\u4F5C\u4E3A\u4EE3\u7406\u8BA4\u8BC1\u53E3\u4EE4\u53D1\u9001\u7ED9\u4EE3\u7406\uFF1B\u968F\u8BE5\u8BBE\u7F6E\u4E00\u8D77\u4FDD\u5B58\u3002',\r\n hitCountPrefix: '\u5DF2\u4EE3\u7406 ',\r\n hitCountSuffix: ' \u6B21',\r\n recentOk: '\u6700\u8FD1\u6210\u529F ',\r\n recentFail: '\u6700\u8FD1\u5931\u8D25 ',\r\n recentStarted: '\u6700\u8FD1\u8C03\u7528 ',\r\n noRecord: '\u5C1A\u65E0\u4EE3\u7406\u8BB0\u5F55',\r\n justNow: '\u521A\u521A',\r\n minutesAgo: ' \u5206\u949F\u524D',\r\n hoursAgo: ' \u5C0F\u65F6\u524D',\r\n daysAgo: ' \u5929\u524D',\r\n testButton: '\u6D4B\u8BD5',\r\n testRunning: '\u6D4B\u8BD5\u4E2D\u2026',\r\n testDisabledNote: '\u672A\u542F\u7528\uFF0C\u4EC5\u6D4B\u8BD5\uFF1A',\r\n testFailed: '\u6D4B\u8BD5\u5931\u8D25',\r\n exitIpLabel: '\u51FA\u53E3 IP ',\r\n directLabel: '\u76F4\u8FDE\uFF08\u672A\u7ECF\u8FC7\u4EE3\u7406\uFF09',\r\n advanced: '\u9AD8\u7EA7\uFF1A\u76EE\u6807\u57DF\u540D\u89C4\u5219',\r\n onlyHosts: '\u4EC5\u8D70\u4EE3\u7406',\r\n onlyHostsHint: '\u9017\u53F7\u6216\u7A7A\u683C\u5206\u9694\uFF1B\u975E\u7A7A\u65F6\u53EA\u6709\u5339\u914D\u8FD9\u4E9B\u4E3B\u673A\u7684\u8BF7\u6C42\u8D70\u4EE3\u7406\uFF08\u540E\u7F00\u5339\u914D\uFF0C* \u8868\u793A\u5168\u90E8\uFF09\u3002',\r\n bypassHosts: '\u76F4\u8FDE',\r\n bypassHostsHint: '\u9017\u53F7\u6216\u7A7A\u683C\u5206\u9694\uFF1B\u5339\u914D\u8FD9\u4E9B\u4E3B\u673A\u7684\u8BF7\u6C42\u76F4\u8FDE\uFF0C\u4F18\u5148\u4E8E\u4E0A\u4E00\u9879\u3002',\r\n ruleDeadHint: '\u4EE5\u4E0B\u6761\u76EE\u6C38\u8FDC\u5339\u914D\u4E0D\u4E0A\u2014\u2014\u89C4\u5219\u53EA\u8BA4\u4E3B\u673A\u540D\uFF0C\u4E0D\u8981\u5E26\u534F\u8BAE\u524D\u7F00\u6216\u8DEF\u5F84\uFF1A',\r\n testTarget: '\u81EA\u68C0\u76EE\u6807',\r\n testTargetHint: '\u7559\u7A7A\u7528\u9876\u5C42 testUrl\uFF1B\u586B\u5199\u540E\u8BE5\u5361\u7247\u7684\u300C\u6D4B\u8BD5\u300D\u6539\u4E3A\u8BF7\u6C42\u8FD9\u4E2A\u5730\u5740\uFF0C\u53EF\u62FF\u771F\u5B9E\u4E0A\u6E38\u9A8C\u8BC1\u7AEF\u5230\u7AEF\u8DEF\u5F84\u3002',\r\n socks5Hint: 'SOCKS5 \u4F1A\u5EFA\u7ACB\u96A7\u9053\uFF0C\u76EE\u6807\u57DF\u540D\u7531\u4EE3\u7406\u7AEF\u89E3\u6790\u3002',\r\n on: '\u8D70\u4EE3\u7406',\r\n live: '\u542F\u7528\u4E2D',\r\n off: '\u76F4\u8FDE',\r\n diagnostics: '\u8FDE\u63A5\u8BCA\u65AD',\r\n diagPending: '\uFF08\u6B63\u5728\u6536\u96C6\u2026\uFF09',\r\n}\r\n\r\n/**\r\n * Pick the dictionary for this render.\r\n *\r\n * The shell's own locale dictionary wins when it carries a translated entry, so\r\n * the page follows the application language instead of second-guessing it.\r\n * Chinese is the fallback because that is the operator's language.\r\n */\r\nfunction stringsFor(ctx: any): Record<string, string> {\r\n const language = localeOf(ctx)\r\n const bundled = language === 'zh' ? ZH : EN\r\n const translated = ((): Record<string, string> | undefined => {\r\n try {\r\n const service = optionalService(ctx, 'locale')\r\n const bound = service?.bind?.('dshProviderProxy')\r\n const value = typeof bound === 'function' ? bound('title') : undefined\r\n if (typeof value === 'string' && value.length > 0) return { title: value } as never\r\n } catch {\r\n // no locale dictionary available\r\n }\r\n return undefined\r\n })()\r\n return { ...bundled, ...(translated ?? {}) }\r\n}\r\n\r\n/**\r\n * The client module system's resolver.\r\n *\r\n * The loader calls `factory(require)` and that parameter shadows Node's\r\n * `require` inside the emitted CJS, so this describes the module-table\r\n * resolver, not Node's.\r\n */\r\ndeclare function require(specifier: string): unknown\r\n", "/**\n * The proxy-endpoint usability predicate, in ONE place.\n *\n * This lives in its own module \u2014 free of Node and schemastery imports \u2014 so the\n * BROWSER half can import the very same rule the Host applies. It exists because\n * the browser used to keep its own weaker copy that checked only \"host non-empty\n * and port in range\": against `https://1.2.3.4` that copy lit the default block\n * green and enabled the bulk \"use the default\" button, while the Host refused\n * every route that pointed at it (a host carrying a scheme or path is rejected by\n * `normalizeRoute`). One predicate, imported by both halves, cannot disagree\n * with itself.\n */\nexport interface ProxyEndpoint {\n /**\n * Proxy host or IP, without scheme, port, or path.\n *\n * Optional because the browser calls this with whatever the settings document\n * currently holds, which mid-edit is not yet a complete endpoint.\n */\n host?: string\n /** Proxy port. 0 means \"not configured\". */\n port?: number\n /**\n * Credential parts, if the endpoint carries any. A HALF-filled pair is a\n * problem, the same way it is on the route itself \u2014 see below.\n */\n username?: string\n password?: string\n}\n\n/**\n * Why this endpoint cannot carry a request, or `undefined` when it can.\n *\n * The host and port checks mirror `normalizeRoute` exactly, so the browser's\n * verdict and the Host's are the same verdict. The credential pairing check\n * mirrors the guards in `buildRouteEntry`, which is what makes this predicate a\n * truthful preview of whether a route that opts into the default will actually be\n * built: without it, a default carrying `alice` and no password lit the block\n * green and enabled the bulk button, and every card it pointed at was then\n * refused by the credential guard with `entries.size === 0`.\n *\n * Tolerates a partial object (`{}`, `host: undefined`) rather than throwing: the\n * browser calls this with whatever the settings document currently holds, which\n * during a half-typed edit is not yet a complete endpoint.\n */\nexport function defaultProxyProblem(endpoint: ProxyEndpoint): string | undefined {\n const host = (endpoint.host ?? '').trim()\n if (host.length === 0) return '\u672A\u586B\u5199\u4EE3\u7406\u5730\u5740'\n if (/^[a-z][a-z0-9+.-]*:\\/\\//i.test(host) || host.includes('/')) {\n return '\u4EE3\u7406\u5730\u5740\u53EA\u586B\u4E3B\u673A\u540D\u6216 IP\uFF0C\u4E0D\u8981\u5E26\u534F\u8BAE\u524D\u7F00\u6216\u8DEF\u5F84'\n }\n // `?? 0` rather than a throw: an absent port is \"not configured\", which is the\n // same thing 0 already means everywhere else in this plugin.\n const port = endpoint.port ?? 0\n if (!Number.isInteger(port) || port < 1 || port > 65535) {\n return '\u4EE3\u7406\u7AEF\u53E3\u65E0\u6548\uFF08\u9700\u4E3A 1-65535 \u7684\u6574\u6570\uFF09'\n }\n // \"Both or neither\", exactly as `buildRouteEntry` enforces per transport. The\n // wording stays transport-neutral here because the default block carries a\n // protocol the user may still change; the route-level guards spell out the\n // protocol-specific reason once it is pinned.\n const hasUser = (endpoint.username ?? '').length > 0\n const hasPassword = (endpoint.password ?? '').length > 0\n if (hasUser !== hasPassword) {\n return hasUser\n ? '\u914D\u7F6E\u4E86\u4EE3\u7406\u7528\u6237\u540D\u4F46\u6CA1\u6709\u5BC6\u7801\uFF1B\u8BF7\u8865\u5168\u5BC6\u7801\u6216\u6E05\u7A7A\u7528\u6237\u540D'\n : '\u914D\u7F6E\u4E86\u4EE3\u7406\u5BC6\u7801\u4F46\u6CA1\u6709\u7528\u6237\u540D\uFF1B\u8BF7\u8865\u5168\u7528\u6237\u540D\u6216\u6E05\u7A7A\u5BC6\u7801'\n }\n return undefined\n}\n"],
5
+ "mappings": ";;;;;;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