@agimon-ai/po-remote 0.0.0-alpha.170
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/LICENSE +149 -0
- package/README.md +28 -0
- package/dist/apiContracts.cjs +17 -0
- package/dist/apiContracts.cjs.map +1 -0
- package/dist/apiContracts.d.mts +53 -0
- package/dist/apiContracts.d.mts.map +1 -0
- package/dist/apiContracts.mjs +13 -0
- package/dist/apiContracts.mjs.map +1 -0
- package/dist/extensions/server.cjs +30 -0
- package/dist/extensions/server.cjs.map +1 -0
- package/dist/extensions/server.d.mts +5 -0
- package/dist/extensions/server.d.mts.map +1 -0
- package/dist/extensions/server.mjs +25 -0
- package/dist/extensions/server.mjs.map +1 -0
- package/dist/extensions/web.mjs +1464 -0
- package/dist/extensions/web.mjs.map +1 -0
- package/dist/index.cjs +6190 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.mts +553 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +6159 -0
- package/dist/index.mjs.map +1 -0
- package/dist/po-runtime-identity.json +1 -0
- package/llms.txt +13 -0
- package/package.json +158 -0
- package/src/prompts/help-how-to-remote/SKILL.md +23 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"web.mjs","names":["UNREACHABLE","JSON_HEADERS","isRecord","set","fillPairingApproval","fillRemote","fillRemoteAccess","settingRemote","lifecycleStart"],"sources":["../../src/types/remoteAccess.ts","../../src/extensions/(frontend)/_lib/remoteApi.ts","../../src/extensions/(frontend)/_lib/remoteAccessStore.ts","../../src/extensions/(frontend)/_components/PairingApprovalDialog.tsx","../../src/extensions/(frontend)/fill/PairingApproval.overlay.web.tsx","../../src/extensions/(frontend)/fill/_components/RemoteRailStatus.tsx","../../src/extensions/(frontend)/fill/Remote.rail-status.web.tsx","../../src/types/devProxy.ts","../../src/extensions/(frontend)/_lib/devProxyApi.ts","../../src/extensions/(frontend)/_lib/devProxyStore.ts","../../src/extensions/(frontend)/_lib/uiState.ts","../../src/extensions/(frontend)/_components/DevProxyTargets.tsx","../../src/extensions/(frontend)/_components/PairedDeviceList.tsx","../../src/extensions/(frontend)/_components/TrustedDeviceList.tsx","../../src/extensions/(frontend)/_components/RemoteAccessOptions.tsx","../../src/extensions/(frontend)/_components/RemoteAccessPairing.tsx","../../src/extensions/(frontend)/_components/RemoteAccessDialog.tsx","../../src/extensions/(frontend)/fill/RemoteAccess.overlay.web.tsx","../../src/extensions/(frontend)/lifecycle/start.web.ts","../../src/extensions/(frontend)/_lib/remoteSummary.ts","../../src/extensions/(frontend)/setting/_components/TunnelSettings.tsx","../../src/extensions/(frontend)/setting/_components/RemoteControlSettings.tsx","../../src/extensions/(frontend)/setting/remote.panel.web.tsx","../../generated/web.ts"],"sourcesContent":["/**\n * Wire vocabulary for remote access, shared by the hub routes and the cockpit.\n *\n * Remote access binds a second loopback listener that a tunnel points at, and\n * everything arriving there must prove it holds a paired session. The\n * discriminator is the listening socket, not a header: a tunnel connects from\n * 127.0.0.1 like every local client, and there is no header a remote caller\n * cannot forge.\n */\n\n/** REST surface for the remote-access control plane; local callers only, except turn-off and revoke. */\nexport const REMOTE_API_ROUTE = '/api/remote';\n/** Direct endpoint that establishes one scoped end-to-end channel. */\nexport const REMOTE_CHANNEL_ROUTE = `${REMOTE_API_ROUTE}/channel`;\n/** The only authenticated HTTP gateway exposed on the tunnel listener. */\nexport const REMOTE_HTTP_ROUTE = `${REMOTE_API_ROUTE}/request`;\n/** Device-bound, sealed routes for ephemeral live Web Push registration. */\n/** Trusted native devices; `DELETE ${TRUSTED_DEVICES_ROUTE}/:id` revokes one. Mirrors po-core's constant. */\nexport const TRUSTED_DEVICES_ROUTE = `${REMOTE_API_ROUTE}/trusted-devices`;\nexport const REMOTE_PUSH_ROUTE = `${REMOTE_API_ROUTE}/push`;\nexport const REMOTE_PUSH_KEY_ROUTE = `${REMOTE_PUSH_ROUTE}/key`;\nexport const PROTOCOL_SOCKET_ROUTE = '/api/ws';\n/** The pairing page a scanned QR opens. Unauthenticated on the tunnel listener. */\nexport const PAIRING_PAGE_ROUTE = '/pair';\n/**\n * The phone app's form of the same QR: its `po` scheme wrapping the encoded HTTPS pairing URL, so a\n * phone camera opens Po instead of the browser. The app unwraps it and checks the inner URL as usual.\n */\nexport const NATIVE_PAIRING_LINK_PREFIX = 'po://pair?link=';\n/** Where the pairing page posts the scanned code. Unauthenticated on the tunnel listener. */\nexport const PAIRING_CLAIM_ROUTE = '/api/remote/pair';\n/** Polled until the host approves or denies. Unauthenticated on the tunnel listener. */\nexport const PAIRING_STATUS_ROUTE = '/api/remote/pair/status';\n/** Query parameter naming the pairing request; a path parameter would force a wildcard into the allowlist. */\nexport const PAIRING_STATUS_QUERY = 'request';\n/** URL-fragment fields authenticated by seeing the host's physical QR. */\nexport const BUNDLE_SIGNING_KEY_PARAM = 's';\nexport const BUNDLE_MINIMUM_REVISION_PARAM = 'r';\n\n/**\n * Session cookie base name. Rendered `__Host-po_device` by hono's `host`\n * prefix, which refuses the cookie unless it is Secure, Path=/, and\n * Domain-less, so a sibling subdomain can neither read nor overwrite it.\n */\nexport const DEVICE_COOKIE = 'po_device';\n\n/**\n * Passkey ceremonies exposed directly on the pairing surface.\n *\n * Sign-in is unauthenticated because it creates a session. Registration requires\n * the paired device cookie issued after host approval, but remains direct so the\n * self-contained pairing page can offer enrolment before loading the cockpit.\n */\nexport const PASSKEY_AUTH_BEGIN_ROUTE = '/api/remote/passkeys/authenticate/begin';\nexport const PASSKEY_AUTH_FINISH_ROUTE = '/api/remote/passkeys/authenticate/finish';\nexport const PASSKEY_REGISTER_BEGIN_ROUTE = '/api/remote/passkeys/register/begin';\nexport const PASSKEY_REGISTER_FINISH_ROUTE = '/api/remote/passkeys/register/finish';\n\n/** Header carrying a step-up assertion for an action that needs more than a live session. */\nexport const STEP_UP_HEADER = 'x-po-assertion';\n\n/** The vite dev server port; the origin allowlist and vite.config.ts share this. */\nexport const WEB_DEV_SERVER_PORT = 7534;\n\n/** How long a scanned pairing code stays claimable. */\nexport const PAIRING_CODE_TTL_MS = 120_000;\n/** How long the host has to approve or deny a claimed request. */\nexport const PAIRING_REQUEST_TTL_MS = 180_000;\n/** Cookie lifetime when session expiry is switched off; a session cookie can outlive the laptop. */\nexport const COOKIE_CEILING_SECONDS = 30 * 24 * 60 * 60;\n\nexport type TunnelKind = 'quick' | 'named';\nexport type RemoteChannelScope = 'session' | 'protocol' | 'http';\n\n/**\n * How the tunnel is established.\n *\n * `named` carries a hostname rather than discovering one, which is why it is\n * the mode that supports passkeys, a service worker, and durable pairing: all\n * three are bound to the origin, and a quick tunnel's hostname rotates on every\n * start. The token is referenced by path, never stored inline, because it is a\n * Cloudflare account credential and an inlined one ends up in a bug report.\n */\nexport type TunnelConfig =\n | { kind: 'quick' }\n | { kind: 'named'; hostname: string; name?: string; tokenFile?: string; configFile?: string };\n\n/** Nullable numbers are not used: a disabled toggle keeps its value so flipping it back restores it. */\nexport interface RemoteAccessSettings {\n /** Close the tunnel on a timer. */\n autoCloseEnabled: boolean;\n autoCloseMinutes: number;\n /** Expire paired sessions on idle and on total age. */\n sessionExpiryEnabled: boolean;\n idleMinutes: number;\n absoluteHours: number;\n tunnel: TunnelConfig;\n}\n\nexport interface BundlePairingTrust {\n publicKey: string;\n fingerprint: string;\n revision: number;\n}\n\nexport type RemoteAccessStatus = 'off' | 'starting' | 'on' | 'failed';\n\nexport interface PairedDeviceView {\n id: string;\n label: string;\n userAgent: string;\n /** ISO 8601. */\n createdAt: string;\n /** ISO 8601. */\n lastSeenAt: string;\n /** True for the device making the request, so the UI can say \"this device\". */\n self: boolean;\n}\n\nexport type TrustedDevicePlatform = 'ios' | 'android';\n\n/** What local and remote callers see of a trusted native device: no keys. Mirrors po-core's view. */\nexport interface TrustedDeviceView {\n id: string;\n label: string;\n platform: TrustedDevicePlatform;\n /** ISO 8601. */\n createdAt: string;\n /** ISO 8601. */\n lastSeenAt: string;\n /** True when the calling session signed in with this device's key. */\n self: boolean;\n}\n\nexport interface PairingRequestView {\n id: string;\n userAgent: string;\n /**\n * The address Cloudflare's edge reported. Display only: any local process can\n * reach the tunnel listener directly and set this header to anything, so it\n * never gates a decision. The UI labels it \"reported by the edge\".\n */\n edgeIp: string;\n /** ISO 8601. */\n createdAt: string;\n /** ISO 8601. */\n expiresAt: string;\n}\n\nexport interface RemoteAccessStateView {\n status: RemoteAccessStatus;\n /** Present once the tunnel reports its hostname. */\n publicUrl?: string;\n /** ISO 8601, present while the tunnel is up. */\n startedAt?: string;\n /** ISO 8601, absent when auto-close is switched off. */\n closesAt?: string;\n /** Why the tunnel failed, once it has. */\n error?: string;\n devices: PairedDeviceView[];\n /** Populated for local callers only; a paired phone must not see approval prompts. */\n pending: PairingRequestView[];\n /** Shown to local and remote callers, so a paired device can revoke a lost one. */\n trustedDevices: TrustedDeviceView[];\n settings: RemoteAccessSettings;\n}\n\nexport type PairingStatus = 'pending' | 'approved' | 'denied' | 'expired' | 'consumed';\n\nexport type TunnelFailure = 'not_installed' | 'spawn_failed' | 'timeout' | 'self_test_failed' | 'exited';\n\nexport interface TunnelStartInput {\n /** The loopback port the tunnel should publish. */\n port: number;\n config: TunnelConfig;\n /** Arms the exact public origin before the launcher probes through it. */\n acceptOrigin?: (origin: string) => void;\n /** Cancels startup and asks the launcher to stop any process it has spawned. */\n signal?: AbortSignal;\n}\n\nexport type TunnelStartResult =\n | { ok: true; publicOrigin: string; stop: () => Promise<void> }\n | { ok: false; failure: TunnelFailure; message: string };\n\n/**\n * Starting a tunnel, as a port rather than a concrete process.\n *\n * Declared here so a test can inject a fake without pulling in the cloudflared\n * adapter, and so `WebServerOptions` can name the seam without reaching across\n * a layer to do it.\n */\nexport type TunnelLauncher = (input: TunnelStartInput) => Promise<TunnelStartResult>;\n\n/** Hub frame announcing remote-access state; sent to local and remote pages. */\nexport const REMOTE_STATE_TYPE = 'remote_state';\n/** Hub frame announcing a device waiting for approval; sent to local pages only. */\nexport const REMOTE_PAIRING_REQUEST_TYPE = 'remote_pairing_request';\n","import { browserTransport, fetchWithStepUp } from '@agimon-ai/po-web-security/browser';\n\nimport {\n REMOTE_API_ROUTE,\n TRUSTED_DEVICES_ROUTE,\n type RemoteAccessSettings,\n type RemoteAccessStateView,\n} from '../../../types/remoteAccess';\n\nexport type StateResult = { state: RemoteAccessStateView } | { error: string };\nexport type PairingResult =\n | {\n code: string;\n manualCode: string;\n pairUrl: string;\n expiresAt: string;\n publicKey: string;\n fingerprint: string;\n revision: number;\n }\n | { error: string };\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\n/**\n * One shape for every remote-access call, mirroring `authApi.ts`: a network\n * failure, a non-2xx answer, and a 2xx body missing what was asked for all come\n * back as `{ error }`, so the dialog has one branch to render.\n */\nasync function request<T>(\n input: string,\n init: RequestInit | undefined,\n pick: (body: Record<string, unknown>) => T | undefined,\n send: (input: string, init?: RequestInit) => Promise<Response> = (target, options) =>\n browserTransport.fetch(target, options),\n): Promise<T | { error: string }> {\n let response: Response;\n try {\n response = await send(input, init);\n } catch {\n return { error: UNREACHABLE };\n }\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n body = undefined;\n }\n if (response.ok && isRecord(body)) {\n const picked = pick(body);\n if (picked !== undefined) return picked;\n }\n if (isRecord(body) && typeof body.error === 'string') return { error: body.error };\n return { error: `The hub answered ${String(response.status)}.` };\n}\n\nfunction pickState(body: Record<string, unknown>): { state: RemoteAccessStateView } | undefined {\n return isRecord(body.state) ? { state: body.state as unknown as RemoteAccessStateView } : undefined;\n}\n\nexport async function fetchRemoteState(): Promise<StateResult> {\n return await request(REMOTE_API_ROUTE, undefined, pickState);\n}\n\nexport async function enableRemoteAccess(): Promise<StateResult> {\n return await request(`${REMOTE_API_ROUTE}/enable`, { method: 'POST' }, pickState);\n}\n\nexport async function disableRemoteAccess(): Promise<StateResult> {\n return await request(`${REMOTE_API_ROUTE}/disable`, { method: 'POST' }, pickState);\n}\n\n/** Mints the code the QR encodes. Each call retires the previous one. */\nexport async function mintPairingCode(): Promise<PairingResult> {\n return await request(`${REMOTE_API_ROUTE}/codes`, { method: 'POST' }, (body) =>\n typeof body.pairUrl === 'string' &&\n typeof body.code === 'string' &&\n typeof body.manualCode === 'string' &&\n typeof body.expiresAt === 'string' &&\n typeof body.publicKey === 'string' &&\n typeof body.fingerprint === 'string' &&\n typeof body.revision === 'number'\n ? {\n code: body.code,\n manualCode: body.manualCode,\n pairUrl: body.pairUrl,\n expiresAt: body.expiresAt,\n publicKey: body.publicKey,\n fingerprint: body.fingerprint,\n revision: body.revision,\n }\n : undefined,\n );\n}\n\nexport async function approvePairing(requestId: string): Promise<StateResult> {\n return await request(\n `${REMOTE_API_ROUTE}/pairing/${encodeURIComponent(requestId)}/approve`,\n { method: 'POST' },\n pickState,\n );\n}\n\nexport async function denyPairing(requestId: string): Promise<StateResult> {\n return await request(\n `${REMOTE_API_ROUTE}/pairing/${encodeURIComponent(requestId)}/deny`,\n { method: 'POST' },\n pickState,\n );\n}\n\nexport async function revokeDevice(id: string): Promise<StateResult> {\n return await request(`${REMOTE_API_ROUTE}/devices/${encodeURIComponent(id)}`, { method: 'DELETE' }, pickState);\n}\n\n/**\n * Removes a trusted native device and every live session it holds. A remote caller answers a step-up\n * first; a quick-tunnel browser cannot, so the hub refuses it with a message this returns as `error`.\n */\nexport async function revokeTrustedDevice(id: string): Promise<StateResult> {\n return await request(\n `${TRUSTED_DEVICES_ROUTE}/${encodeURIComponent(id)}`,\n { method: 'DELETE' },\n pickState,\n (target, options) => fetchWithStepUp(target, options),\n );\n}\n\nexport async function saveRemoteSettings(\n patch: Partial<RemoteAccessSettings>,\n): Promise<{ settings: RemoteAccessSettings } | { error: string }> {\n return await request(\n `${REMOTE_API_ROUTE}/settings`,\n { method: 'PUT', headers: JSON_HEADERS, body: JSON.stringify(patch) },\n (body) => (isRecord(body.settings) ? { settings: body.settings as unknown as RemoteAccessSettings } : undefined),\n );\n}\n","import { browserTransport, passkeysAvailable, registerPasskey } from '@agimon-ai/po-web-security/browser';\nimport { Store } from '@tanstack/store';\n\nimport type { RemoteAccessSettings, RemoteAccessStateView } from '../../../types/remoteAccess';\nimport {\n approvePairing,\n denyPairing,\n disableRemoteAccess,\n enableRemoteAccess,\n fetchRemoteState,\n mintPairingCode,\n revokeDevice,\n revokeTrustedDevice,\n saveRemoteSettings,\n} from './remoteApi';\n\n/** Which panel of the dialog is showing. Options first, then the code to scan. */\nexport type RemoteStep = 'closed' | 'options' | 'pairing';\n/** What the code pairs: a phone browser, or the Po app through its app link. */\nexport type PairTarget = 'web' | 'native';\n\nexport interface PasskeySupportView {\n supported: boolean;\n reason?: string;\n count: number;\n}\n\nexport interface RemoteAccessState {\n step: RemoteStep;\n /** Undefined until the passkey surface has been asked about. */\n passkeys?: PasskeySupportView;\n /** Undefined until the first load answers. */\n view?: RemoteAccessStateView;\n /** The URL the QR encodes; present only while a code is live. */\n pairUrl?: string;\n /** Short code accepted by the same pairing claim for manual entry. */\n pairCode?: string;\n /** Signing-key fingerprint the user compares during manual pairing. */\n pairFingerprint?: string;\n pairRevision?: number;\n pairExpiresAt?: string;\n /** Undefined until the person picks one; the code shows the browser link meanwhile. */\n pairTarget?: PairTarget;\n busy: boolean;\n error?: string;\n}\n\nexport const remoteAccessStore = new Store<RemoteAccessState>({ step: 'closed', busy: false });\nconst pendingSettings = new Set<Partial<RemoteAccessSettings>>();\n\nfunction set(patch: Partial<RemoteAccessState>): void {\n const view = patch.view;\n if (view !== undefined && pendingSettings.size > 0)\n patch = {\n ...patch,\n view: {\n ...view,\n settings: [...pendingSettings].reduce<RemoteAccessSettings>(\n (settings, draft) => ({ ...settings, ...draft }),\n view.settings,\n ),\n },\n };\n remoteAccessStore.setState((state) => ({ ...state, ...patch }));\n}\n\n/** Clears the previous error before an action, so a stale one never outlives its cause. */\nfunction begin(): void {\n set({ busy: true, error: undefined });\n}\n\nfunction settle(outcome: { state: RemoteAccessStateView } | { error: string }): boolean {\n if ('error' in outcome) {\n set({ busy: false, error: outcome.error });\n return false;\n }\n set({ busy: false, view: outcome.state });\n return true;\n}\n\nexport function openRemoteDialog(): void {\n set({ step: 'options', error: undefined });\n void refreshRemoteState();\n}\n\nexport function closeRemoteDialog(): void {\n // The code is left to expire on its own rather than cancelled here: closing\n // the dialog while a phone is mid-scan should not strand it.\n set({ step: 'closed', error: undefined });\n}\n\nexport function showRemoteOptions(): void {\n set({ step: 'options', error: undefined });\n}\n\n/** Whether this tunnel and this browser can carry a passkey at all. */\nexport async function refreshPasskeys(): Promise<void> {\n try {\n const response = await browserTransport.fetch('/api/remote/passkeys', { credentials: 'same-origin' });\n if (!response.ok) return;\n const body = (await response.json()) as {\n support: { supported: boolean; reason?: string };\n credentials: unknown[];\n };\n set({\n passkeys: {\n supported: body.support.supported && passkeysAvailable(),\n ...(body.support.reason === undefined ? {} : { reason: body.support.reason }),\n count: body.credentials.length,\n },\n });\n } catch (error) {\n // The hub is unreachable; the state refresh reports that to the person already.\n console.warn('Passkey support could not be read', error);\n }\n}\n\nexport async function addPasskey(): Promise<void> {\n begin();\n const outcome = await registerPasskey();\n set({ busy: false, ...(outcome.ok ? {} : { error: outcome.error }) });\n await refreshPasskeys();\n}\n\nexport async function refreshRemoteState(): Promise<void> {\n const outcome = await fetchRemoteState();\n if ('error' in outcome) {\n set({ error: outcome.error });\n return;\n }\n // An unchanged answer keeps the same view, so redundant refreshes do not re-render consumers.\n if (pendingSettings.size === 0 && JSON.stringify(remoteAccessStore.state.view) === JSON.stringify(outcome.state))\n return;\n set({ view: outcome.state });\n}\n\n/** Turns the tunnel on and moves straight to the code, which is what the user came for. */\nexport async function turnRemoteAccessOn(): Promise<void> {\n begin();\n const outcome = await enableRemoteAccess();\n if (!settle(outcome)) return;\n await Promise.all([newPairingCode(), refreshPasskeys()]);\n set({ step: 'pairing' });\n}\n\nexport async function turnRemoteAccessOff(): Promise<void> {\n begin();\n if (!settle(await disableRemoteAccess())) return;\n set({\n step: 'options',\n pairUrl: undefined,\n pairCode: undefined,\n pairFingerprint: undefined,\n pairRevision: undefined,\n pairExpiresAt: undefined,\n });\n}\n\nexport async function newPairingCode(): Promise<void> {\n const minted = await mintPairingCode();\n if ('error' in minted) {\n set({\n error: minted.error,\n pairUrl: undefined,\n pairCode: undefined,\n pairFingerprint: undefined,\n pairRevision: undefined,\n });\n return;\n }\n set({\n step: 'pairing',\n pairUrl: minted.pairUrl,\n pairCode: minted.manualCode,\n pairFingerprint: minted.fingerprint,\n pairRevision: minted.revision,\n pairExpiresAt: minted.expiresAt,\n });\n}\n\n/**\n * Switches the code between the browser link and the Po app link. Choosing the app asks the host\n * for its native build, which it defers until a phone needs it, so it is ready by the time the\n * app connects.\n */\nexport function choosePairTarget(target: PairTarget): void {\n set({ pairTarget: target });\n if (target !== 'native') return;\n void browserTransport\n .fetch('/api/compositions?client=native', { credentials: 'same-origin' })\n .catch((error: unknown) => console.warn('The Po app build could not be requested', error));\n}\n\nexport async function approveDevice(requestId: string): Promise<void> {\n settle(await approvePairing(requestId));\n}\n\nexport async function denyDevice(requestId: string): Promise<void> {\n settle(await denyPairing(requestId));\n}\n\nexport async function revokePairedDevice(id: string): Promise<void> {\n begin();\n settle(await revokeDevice(id));\n}\n\nexport async function revokeTrustedNativeDevice(id: string): Promise<void> {\n begin();\n settle(await revokeTrustedDevice(id));\n}\n\nconst settingsWrites: { last: Promise<unknown> } = { last: Promise.resolve() };\n\nexport async function updateRemoteSettings(patch: Partial<RemoteAccessSettings>): Promise<boolean> {\n // Keep autosave edits responsive, but serialize writes across app replacements.\n const draft = { ...patch };\n pendingSettings.add(draft);\n const view = remoteAccessStore.state.view;\n if (view !== undefined) set({ view: { ...view, settings: { ...view.settings, ...draft } }, error: undefined });\n const write = () => saveRemoteSettings(draft);\n const pending = settingsWrites.last.then(write, write);\n settingsWrites.last = pending;\n const outcome = await pending;\n pendingSettings.delete(draft);\n if ('error' in outcome) {\n set({ error: outcome.error });\n if (settingsWrites.last === pending) void refreshRemoteState();\n return false;\n }\n const current = remoteAccessStore.state.view;\n if (current !== undefined && settingsWrites.last === pending)\n set({ view: { ...current, settings: outcome.settings }, error: undefined });\n return true;\n}\n","import {\n Button,\n Dialog,\n DialogBody,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport { approveDevice, denyDevice, remoteAccessStore } from '../_lib/remoteAccessStore';\n\n/**\n * The second factor, and the reason a photographed QR is not enough.\n *\n * Only ever rendered on the host: the hub sends pairing frames to local pages\n * alone, so a paired phone cannot approve the next device and make its own\n * access permanent.\n */\nexport function PairingApprovalDialog() {\n const state = useStore(remoteAccessStore);\n const request = state.view?.pending?.[0];\n if (request === undefined) return null;\n\n return (\n <Dialog open>\n <DialogContent data-testid=\"pairing-approval\" className=\"max-w-md\">\n <DialogHeader className=\"flex-col items-start\">\n <DialogTitle>Pair this device?</DialogTitle>\n <DialogDescription>\n Something scanned your code. Approve it only if it is the device in your hand.\n </DialogDescription>\n </DialogHeader>\n <DialogBody className=\"flex flex-col gap-2\">\n <p data-testid=\"pairing-approval-agent\" className=\"break-words text-base text-po-text\">\n {request.userAgent}\n </p>\n {/* Labelled as reported rather than stated as fact: anything that can\n reach the tunnel listener can set this header to whatever it likes,\n so it is a clue for the human and never a security decision. */}\n <p className=\"text-sm text-po-dim\">Address reported by the edge: {request.edgeIp}</p>\n <p className=\"text-sm text-po-dim\">\n Approving grants the same access you have here, including running shell commands.\n </p>\n </DialogBody>\n <DialogFooter className=\"px-3 pb-3 sm:px-4 sm:pb-4\">\n <Button variant=\"outline\" data-testid=\"pairing-deny\" onClick={() => void denyDevice(request.id)}>\n Deny\n </Button>\n <Button variant=\"primary\" data-testid=\"pairing-approve\" onClick={() => void approveDevice(request.id)}>\n Approve\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n","import { defineFill } from '@agimon-ai/po-core/web';\n\nimport { PairingApprovalDialog } from '../_components/PairingApprovalDialog';\n\n/** The host-side approval for a device that scanned the code; renders nothing while none waits. */\nexport default defineFill({ component: PairingApprovalDialog });\n","import {\n AlertIcon,\n Button,\n Dot,\n ShieldIcon,\n Tooltip,\n TooltipContent,\n TooltipTrigger,\n} from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useLayoutEffect, useRef, useState } from 'react';\n\nimport { openRemoteDialog, remoteAccessStore, turnRemoteAccessOff } from '../../_lib/remoteAccessStore';\n\n/**\n * Remote access at the foot of the cockpit rail: the button that opens the dialog, and the banner that says\n * the tunnel is starting, on, or failed.\n *\n * A template places the rail-status slot once per spot, inside an element whose `data-rail-status` names the\n * template and the spot (`elegant-action`, `advanced-banner`, ...). Each spot draws only its own markup, so a\n * template that puts the button in its header and the banner in its footer keeps both where they were. The\n * spot is read before paint; a spot this fill does not know draws nothing.\n */\nexport function RemoteRailStatus() {\n const marker = useRef<HTMLSpanElement>(null);\n const [spot, setSpot] = useState<string | null>();\n useLayoutEffect(() => {\n setSpot(marker.current?.closest('[data-rail-status]')?.getAttribute('data-rail-status') ?? null);\n }, []);\n const view = useStore(remoteAccessStore, (state) => state.view);\n const status = view?.status ?? 'off';\n const deviceCount = view?.devices.length ?? 0;\n const host = view?.publicUrl === undefined ? undefined : new URL(view.publicUrl).host;\n const live = status === 'on' || status === 'starting';\n const devices = `${String(deviceCount)} device${deviceCount === 1 ? '' : 's'}`;\n const failure = `Remote access failed: ${view?.error ?? 'the tunnel stopped'}`;\n const banner = status === 'off' ? null : status === 'failed' ? 'red' : 'yellow';\n const remoteDetail = status === 'on' ? `Remote access on, ${devices} paired` : undefined;\n\n if (spot === undefined) return <span ref={marker} hidden />;\n return (\n <>\n {banner === null || spot !== 'elegant-banner' ? null : (\n <div\n data-testid=\"remote-banner\"\n className={`flex items-center gap-2 border-t border-po-border-soft px-4 py-2 text-sm ${\n banner === 'red' ? 'bg-po-tint-red text-po-red' : 'bg-po-tint-yellow text-po-yellow'\n }`}\n >\n <Dot tone={banner} />\n <span className=\"min-w-0 flex-1 truncate\">\n {status === 'failed'\n ? failure\n : `Remote access ${status === 'starting' ? 'starting' : 'on'}${host === undefined ? '' : ` · ${host}`} · ${devices}`}\n </span>\n <Button variant=\"ghost\" size=\"xs\" data-testid=\"remote-banner-open\" onClick={openRemoteDialog}>\n Manage\n </Button>\n <Button variant=\"ghost\" size=\"xs\" data-testid=\"remote-banner-off\" onClick={() => void turnRemoteAccessOff()}>\n Turn off\n </Button>\n </div>\n )}\n {banner === null || spot !== 'advanced-banner' ? null : (\n <div\n data-testid=\"remote-banner\"\n className={`flex flex-col gap-1.5 border-t border-po-border-soft px-4 py-2 text-sm ${\n banner === 'red' ? 'bg-po-tint-red text-po-red' : 'bg-po-tint-yellow text-po-yellow'\n }`}\n >\n <output className=\"flex min-w-0 items-center gap-2\">\n <Dot tone={banner} />\n <span className=\"truncate\">\n {status === 'failed'\n ? failure\n : `Remote access is ${status === 'starting' ? 'starting' : 'on'}${host === undefined ? '' : ` · ${host}`} · ${devices} paired`}\n </span>\n </output>\n <span className=\"flex items-center justify-end gap-1\">\n <Button variant=\"ghost\" size=\"sm\" data-testid=\"remote-banner-open\" onClick={openRemoteDialog}>\n Manage\n </Button>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n data-testid=\"remote-banner-off\"\n onClick={() => void turnRemoteAccessOff()}\n >\n Turn off\n </Button>\n </span>\n </div>\n )}\n {spot !== 'elegant-action' ? null : (\n <Button\n variant=\"ghost\"\n size=\"md\"\n data-testid=\"remote-access-open\"\n aria-label={`Remote access is ${status}`}\n onClick={openRemoteDialog}\n className={`h-9 w-full justify-start gap-3 rounded-lg border-0 px-2.5 text-base font-medium outline-none hover:bg-po-panel/50 focus-visible:ring-2 focus-visible:ring-po-green/50 ${\n status === 'failed' ? 'text-po-red' : 'text-po-text'\n }`}\n >\n {status === 'failed' ? (\n <AlertIcon aria-hidden className=\"size-4\" />\n ) : (\n <ShieldIcon aria-hidden className=\"size-4 text-po-dim\" />\n )}\n <span className=\"flex-1 text-left\">Remote access</span>\n {live ? (\n <span className=\"flex items-center gap-1.5 text-sm font-normal text-po-dim\">\n <Dot tone=\"yellow\" pulse data-testid=\"remote-access-live\" />\n {status === 'starting' ? 'Starting' : devices}\n </span>\n ) : (\n <span className=\"text-sm font-normal text-po-faint\">{status === 'failed' ? 'Failed' : 'Off'}</span>\n )}\n </Button>\n )}\n {spot !== 'advanced-action' ? null : (\n <Button\n variant={status === 'failed' ? 'danger-outline' : 'outline'}\n size=\"md\"\n data-testid=\"remote-access-open\"\n title={remoteDetail ?? 'Remote access'}\n aria-label={remoteDetail ?? `Remote access is ${status}`}\n onClick={openRemoteDialog}\n className={`gap-1.5 rounded-md ${status === 'failed' ? '' : 'bg-po-panel'}`}\n >\n {live ? <Dot tone=\"yellow\" pulse data-testid=\"remote-access-live\" /> : <ShieldIcon className=\"size-4\" />}\n Remote access\n </Button>\n )}\n {spot !== 'desktop-action' ? null : (\n <Tooltip>\n <TooltipTrigger asChild>\n <button\n type=\"button\"\n aria-label={status === 'on' ? 'Remote access is on' : 'Remote access'}\n data-testid=\"desktop-remote\"\n onClick={openRemoteDialog}\n className={`relative grid size-10 shrink-0 place-items-center rounded-xl focus-visible:ring-2 focus-visible:ring-po-green focus-visible:outline-none ${\n status === 'on' ? 'bg-po-panel text-po-hi shadow-sm' : 'text-po-dim hover:bg-po-panel/70'\n }`}\n >\n {/* Live access in caution yellow, as the other templates' live dot; failure in red. */}\n <ShieldIcon\n aria-hidden\n className={`size-4 ${status === 'failed' ? 'text-po-red' : live ? 'text-po-yellow' : ''}`}\n />\n </button>\n </TooltipTrigger>\n <TooltipContent side=\"top\" sideOffset={8}>\n {status === 'on' ? 'Remote access is on' : 'Remote access'}\n </TooltipContent>\n </Tooltip>\n )}\n </>\n );\n}\n","import { defineFill } from '@agimon-ai/po-core/web';\n\nimport { RemoteRailStatus } from './_components/RemoteRailStatus';\n\nexport default defineFill({ component: RemoteRailStatus });\n","/**\n * Wire vocabulary for the dev-site reverse proxy, shared by the hub routes,\n * the cockpit, and the service worker.\n *\n * The cockpit proxies a developer's local HTTP server under a path prefix on\n * its own origin, the way nginx or Caddy would. That choice buys one thing\n * worth more than everything it costs: the request is already authenticated.\n * A paired device sends `__Host-po_device` on every same-origin path, so\n * the proxy needs no second hostname, no grant token, and no pairing ceremony\n * of its own.\n *\n * It also means the proxied application shares an origin with the cockpit, and\n * a sub-path deployment requires the application to know its base path. Both\n * are documented in docs/security.md rather than worked around here.\n *\n * This module holds constants and shapes only. `src/pwa` may import\n * `src/types` and nothing else from the server tree, and the service worker\n * needs the prefix, so the prefix has to live here.\n */\n\n/**\n * Control plane for listing and registering targets; registration is local-only. It lives under\n * the Remote Control API, which is how both the host and a paired device reach the hub's proxy.\n */\nexport const DEV_PROXY_API_ROUTE = '/api/remote/dev-proxy';\nexport const DEV_PROXY_TARGETS_ROUTE = `${DEV_PROXY_API_ROUTE}/targets`;\n\n/**\n * The path every proxied request lives under.\n *\n * Both slashes matter. The leading one anchors it at the root so no other\n * route can be shadowed, and the trailing one makes `startsWith` exact: a\n * request for `/devproxyevil` must not match, and without the trailing slash\n * it would.\n */\nexport const DEV_PROXY_PREFIX = '/devproxy/';\n\n/**\n * A registered upstream.\n *\n * `name` rather than a generated id because it appears in the developer's own\n * build configuration as `base: '/devproxy/<name>/'`. A uuid would change\n * nothing functionally and would make that line unreadable and unmemorable.\n */\nexport interface DevProxyTarget {\n name: string;\n port: number;\n createdAt: number;\n}\n\nexport interface DevProxyStateView {\n targets: readonly DevProxyTarget[];\n /** False on the tunnel listener, where registering a new target is refused. */\n canRegister: boolean;\n}\n","import { browserTransport } from '@agimon-ai/po-web-security/browser';\n\nimport { DEV_PROXY_TARGETS_ROUTE, type DevProxyStateView, type DevProxyTarget } from '../../../types/devProxy';\n\n/**\n * The dev proxy control plane, seen from the browser.\n *\n * Every call goes through the sealed session for the same reason the rest of\n * the cockpit does: on a tunnel, an unsealed `/api/` request is refused. The\n * proxied dev site itself is the deliberate exception, and it never comes\n * through here, because the browser fetches those bytes on its own.\n */\n\nconst UNREACHABLE = 'The cockpit hub is unreachable.';\nconst JSON_HEADERS = { 'Content-Type': 'application/json' };\nconst NO_CONTENT = 204;\n\nexport type TargetsResult = { state: DevProxyStateView } | { error: string };\nexport type TargetResult = { target: DevProxyTarget } | { error: string };\n\nfunction isRecord(value: unknown): value is Record<string, unknown> {\n return typeof value === 'object' && value !== null && !Array.isArray(value);\n}\n\nasync function readError(response: Response): Promise<string> {\n try {\n const body: unknown = await response.json();\n if (isRecord(body) && typeof body.error === 'string') return body.error;\n } catch {\n // A body that is not JSON tells us nothing the status has not already.\n }\n return `The hub answered ${String(response.status)}.`;\n}\n\nexport async function fetchDevProxyTargets(): Promise<TargetsResult> {\n let response: Response;\n try {\n response = await browserTransport.fetch(DEV_PROXY_TARGETS_ROUTE);\n } catch {\n return { error: UNREACHABLE };\n }\n if (!response.ok) return { error: await readError(response) };\n const body: unknown = await response.json().catch(() => undefined);\n if (!isRecord(body) || !Array.isArray(body.targets)) return { error: 'The hub sent no dev proxy targets.' };\n return {\n state: { targets: body.targets as DevProxyTarget[], canRegister: body.canRegister === true },\n };\n}\n\nexport async function addDevProxyTarget(name: string, port: number): Promise<TargetResult> {\n let response: Response;\n try {\n response = await browserTransport.fetch(DEV_PROXY_TARGETS_ROUTE, {\n method: 'POST',\n headers: JSON_HEADERS,\n body: JSON.stringify({ name, port }),\n });\n } catch {\n return { error: UNREACHABLE };\n }\n if (!response.ok) return { error: await readError(response) };\n const body: unknown = await response.json().catch(() => undefined);\n if (!isRecord(body) || !isRecord(body.target)) return { error: 'The hub did not confirm the target.' };\n return { target: body.target as unknown as DevProxyTarget };\n}\n\nexport async function removeDevProxyTarget(name: string): Promise<{ ok: true } | { error: string }> {\n let response: Response;\n try {\n response = await browserTransport.fetch(`${DEV_PROXY_TARGETS_ROUTE}/${encodeURIComponent(name)}`, {\n method: 'DELETE',\n });\n } catch {\n return { error: UNREACHABLE };\n }\n if (response.status !== NO_CONTENT && !response.ok) return { error: await readError(response) };\n return { ok: true };\n}\n","import { Store } from '@tanstack/store';\n\nimport type { DevProxyTarget } from '../../../types/devProxy';\nimport { addDevProxyTarget, fetchDevProxyTargets, removeDevProxyTarget } from './devProxyApi';\n\n/**\n * Registered dev proxy targets, as the remote dialog shows them.\n *\n * `canRegister` comes from the hub rather than being guessed here: adding a\n * target is refused anywhere but the loopback listener, and a phone that\n * rendered an enabled form would only be offering a button that fails.\n */\n\nexport interface DevProxyState {\n targets: readonly DevProxyTarget[];\n /** False on a remote device, where registering is refused by the hub. */\n canRegister: boolean;\n busy: boolean;\n error?: string;\n}\n\nexport const devProxyStore = new Store<DevProxyState>({ targets: [], canRegister: false, busy: false });\n\nfunction set(patch: Partial<DevProxyState>): void {\n devProxyStore.setState((state) => ({ ...state, ...patch }));\n}\n\nexport async function refreshDevProxyTargets(): Promise<void> {\n const outcome = await fetchDevProxyTargets();\n if ('error' in outcome) {\n set({ error: outcome.error });\n return;\n }\n set({ targets: outcome.state.targets, canRegister: outcome.state.canRegister, error: undefined });\n}\n\nexport async function createDevProxyTarget(name: string, port: number): Promise<boolean> {\n if (devProxyStore.state.busy) return false;\n set({ busy: true, error: undefined });\n const outcome = await addDevProxyTarget(name, port);\n if ('error' in outcome) {\n set({ busy: false, error: outcome.error });\n return false;\n }\n await refreshDevProxyTargets();\n set({ busy: false });\n return true;\n}\n\nexport async function deleteDevProxyTarget(name: string): Promise<void> {\n if (devProxyStore.state.busy) return;\n set({ busy: true, error: undefined });\n const outcome = await removeDevProxyTarget(name);\n if ('error' in outcome) {\n set({ busy: false, error: outcome.error });\n return;\n }\n await refreshDevProxyTargets();\n set({ busy: false });\n}\n\n/** Test seam. */\nexport function resetDevProxyStore(): void {\n devProxyStore.setState(() => ({ targets: [], canRegister: false, busy: false }));\n}\n","import { useStore } from '@tanstack/react-store';\nimport { Store } from '@tanstack/store';\nimport { useCallback, type Dispatch, type SetStateAction } from 'react';\n\n/**\n * Form drafts that outlive a remount, such as a template switch, the way the\n * dashboard's own keyed state does. Web plugins may not import the dashboard.\n */\nconst states = new Map<string, unknown>();\n\n/** Memory only. Keys include the form and its resource, never the selected template. */\nexport function uiStateFor<T>(key: string, initial: T | (() => T)): Store<T> {\n let store = states.get(key) as Store<T> | undefined;\n if (store === undefined) {\n store = new Store(typeof initial === 'function' ? (initial as () => T)() : initial);\n states.set(key, store);\n }\n return store;\n}\n\n/** The store is also exposed for synchronous admission checks in event handlers. */\nexport function useUiState<T>(key: string, initial: T | (() => T)): [T, Dispatch<SetStateAction<T>>, Store<T>] {\n const store = uiStateFor(key, initial);\n const value = useStore(store);\n const set = useCallback<Dispatch<SetStateAction<T>>>(\n (next) => {\n store.setState((previous) => (typeof next === 'function' ? (next as (value: T) => T)(previous) : next));\n },\n [store],\n );\n return [value, set, store];\n}\n\n/** Test seam. Existing subscribers must be unmounted before resetting. */\nexport function resetUiState(): void {\n states.clear();\n}\n","import { Button, Input, SectionLabel } from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useEffect } from 'react';\n\nimport { DEV_PROXY_PREFIX } from '../../../types/devProxy';\nimport {\n createDevProxyTarget,\n deleteDevProxyTarget,\n devProxyStore,\n refreshDevProxyTargets,\n} from '../_lib/devProxyStore';\nimport { useUiState } from '../_lib/uiState';\n\n/**\n * Local dev servers reachable through the cockpit's own address.\n *\n * The `base` line is shown rather than described. A sub-path proxy needs the\n * application to know its base path, exactly as it would behind nginx, and a\n * developer who has to work that out from prose will conclude the feature is\n * broken when their assets 404.\n *\n * Adding a target is host-only, so on a phone the form is replaced by the\n * reason rather than rendered as a button that would be refused.\n */\nexport function DevProxyTargets() {\n const state = useStore(devProxyStore);\n const [name, setName] = useUiState('dev-proxy/name', '');\n const [port, setPort] = useUiState('dev-proxy/port', '');\n\n useEffect(() => {\n void refreshDevProxyTargets();\n }, []);\n\n const submit = async (): Promise<void> => {\n if (await createDevProxyTarget(name.trim(), Number(port))) {\n setName((current) => (current === name ? '' : current));\n setPort((current) => (current === port ? '' : current));\n }\n };\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n <SectionLabel>dev sites</SectionLabel>\n <span className=\"text-sm text-po-dim\">Reach a local dev server from a paired device, on this same address.</span>\n\n {state.targets.map((target) => (\n <div\n key={target.name}\n data-testid={`dev-proxy-target-${target.name}`}\n className=\"flex items-center justify-between gap-3 rounded border border-po-border px-2.5 py-1.5\"\n >\n <span className=\"flex min-w-0 flex-col\">\n <a\n // The proxy serves paired devices through the tunnel. At the host, the dev server\n // already answers on its own port under the same base path.\n href={\n state.canRegister\n ? `http://localhost:${String(target.port)}${DEV_PROXY_PREFIX}${target.name}/`\n : `${DEV_PROXY_PREFIX}${target.name}/`\n }\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"truncate text-sm text-po-hi underline\"\n data-testid={`dev-proxy-open-${target.name}`}\n >\n {DEV_PROXY_PREFIX}\n {target.name}/\n </a>\n <span className=\"truncate text-sm text-po-dim\">\n port {target.port} · set base: '{DEV_PROXY_PREFIX}\n {target.name}/' in the dev server\n </span>\n </span>\n {state.canRegister ? (\n <Button\n variant=\"ghost\"\n size=\"sm\"\n data-testid={`dev-proxy-remove-${target.name}`}\n onClick={() => void deleteDevProxyTarget(target.name)}\n >\n Remove\n </Button>\n ) : null}\n </div>\n ))}\n\n {state.canRegister ? (\n <div className=\"flex items-center gap-2\">\n <Input\n aria-label=\"dev site name\"\n data-testid=\"dev-proxy-name\"\n placeholder=\"storefront\"\n className=\"min-w-0 flex-1\"\n value={name}\n onChange={(event) => setName(event.target.value)}\n />\n <Input\n aria-label=\"dev site port\"\n data-testid=\"dev-proxy-port\"\n type=\"number\"\n min={1}\n max={65_535}\n placeholder=\"3000\"\n className=\"w-24\"\n value={port}\n onChange={(event) => setPort(event.target.value)}\n />\n <Button\n variant=\"outline\"\n size=\"sm\"\n data-testid=\"dev-proxy-add\"\n disabled={state.busy || name.trim() === '' || port === ''}\n onClick={() => void submit()}\n >\n Add\n </Button>\n </div>\n ) : (\n <span className=\"text-sm text-po-dim\">\n Add a dev site on the host. A paired device can open the ones already listed, but not name new ones.\n </span>\n )}\n\n {state.error === undefined ? null : (\n <span data-testid=\"dev-proxy-error\" className=\"text-sm text-po-yellow\">\n {state.error}\n </span>\n )}\n </div>\n );\n}\n","import { Button, SectionLabel } from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport { remoteAccessStore, revokePairedDevice } from '../_lib/remoteAccessStore';\n\n/** Every device currently holding a session, with the one way to take it back. */\nexport function PairedDeviceList() {\n const state = useStore(remoteAccessStore);\n const devices = state.view?.devices ?? [];\n if (devices.length === 0) return null;\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\">\n <SectionLabel>paired devices</SectionLabel>\n {devices.map((device) => (\n <div\n key={device.id}\n data-testid={`remote-device-${device.id}`}\n className=\"flex items-center justify-between gap-3 rounded border border-po-border px-2.5 py-1.5\"\n >\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"truncate text-base font-semibold text-po-hi\">\n {device.label}\n {device.self ? ' \\u00b7 this device' : ''}\n </span>\n <span className=\"truncate text-sm text-po-dim\">{device.userAgent}</span>\n </span>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n data-testid={`remote-revoke-${device.id}`}\n onClick={() => void revokePairedDevice(device.id)}\n >\n Revoke\n </Button>\n </div>\n ))}\n </div>\n );\n}\n","import { Button, SectionLabel } from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport type { TrustedDevicePlatform, TrustedDeviceView } from '../../../types/remoteAccess';\nimport { remoteAccessStore, revokeTrustedNativeDevice } from '../_lib/remoteAccessStore';\n\nconst PLATFORM_LABEL: Record<TrustedDevicePlatform, string> = { ios: 'iOS', android: 'Android' };\n\nexport interface TrustedDeviceListViewProps {\n devices: TrustedDeviceView[];\n busy?: boolean;\n onRevoke: (id: string) => void;\n}\n\n/** Native devices that sign back in with their own key, each with the one way to take that back. */\nexport function TrustedDeviceListView({ devices, busy = false, onRevoke }: TrustedDeviceListViewProps) {\n if (devices.length === 0) return null;\n\n return (\n <div className=\"flex w-full flex-col gap-1.5\" data-testid=\"remote-trusted-devices\">\n <SectionLabel>trusted phones</SectionLabel>\n <p className=\"text-sm text-po-dim\">\n A trusted phone signs back in on its own. Revoking one signs it out now, and it pairs again by QR.\n </p>\n {devices.map((device) => (\n <div\n key={device.id}\n data-testid={`remote-trusted-device-${device.id}`}\n className=\"flex items-center justify-between gap-3 rounded border border-po-border px-2.5 py-1.5\"\n >\n <span className=\"flex min-w-0 flex-col\">\n <span className=\"truncate text-base font-semibold text-po-hi\">\n {device.label}\n {device.self ? ' \\u00b7 this device' : ''}\n </span>\n <span className=\"truncate text-sm text-po-dim\">\n {PLATFORM_LABEL[device.platform]} {'\\u00b7'} trusted since {device.createdAt.slice(0, 10)}\n </span>\n </span>\n <Button\n variant=\"ghost\"\n size=\"sm\"\n disabled={busy}\n data-testid={`remote-trusted-revoke-${device.id}`}\n onClick={() => onRevoke(device.id)}\n >\n Revoke\n </Button>\n </div>\n ))}\n </div>\n );\n}\n\n/** Reads the hub's trusted devices; revoking from a remote caller asks for a step-up first. */\nexport function TrustedDeviceList() {\n const state = useStore(remoteAccessStore);\n return (\n <TrustedDeviceListView\n devices={state.view?.trustedDevices ?? []}\n busy={state.busy}\n onRevoke={(id) => void revokeTrustedNativeDevice(id)}\n />\n );\n}\n","import { Input, Spinner, Switch } from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport { remoteAccessStore, updateRemoteSettings } from '../_lib/remoteAccessStore';\nimport { DevProxyTargets } from './DevProxyTargets';\nimport { PairedDeviceList } from './PairedDeviceList';\nimport { TrustedDeviceList } from './TrustedDeviceList';\n\nconst MAX_MINUTES = 1440;\nconst MAX_HOURS = 720;\n\n/**\n * The bounds on remote access, asked before it is switched on.\n *\n * These sit in front of the decision rather than behind a gear elsewhere,\n * because they are the difference between a tunnel that closes itself and one\n * that is still open next week.\n */\nexport function RemoteAccessOptions() {\n const state = useStore(remoteAccessStore);\n const settings = state.view?.settings;\n if (settings === undefined) return <Spinner />;\n\n return (\n <div className=\"flex flex-col gap-4\">\n <label htmlFor=\"remote-autoclose-switch\" className=\"flex items-start justify-between gap-4\">\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"text-base font-medium text-po-text\">Close the tunnel automatically</span>\n <span className=\"text-sm text-po-dim\">So a tunnel you forgot about does not stay open for weeks.</span>\n </span>\n <Switch\n id=\"remote-autoclose-switch\"\n data-testid=\"remote-autoclose-switch\"\n checked={settings.autoCloseEnabled}\n onCheckedChange={(checked) => void updateRemoteSettings({ autoCloseEnabled: checked })}\n />\n </label>\n {settings.autoCloseEnabled ? (\n <label htmlFor=\"remote-autoclose-minutes\" className=\"flex items-center justify-between gap-4 pl-4\">\n <span className=\"text-base font-medium text-po-text\">After this many minutes</span>\n <Input\n id=\"remote-autoclose-minutes\"\n data-testid=\"remote-autoclose-minutes\"\n type=\"number\"\n min={1}\n max={MAX_MINUTES}\n className=\"w-24\"\n value={settings.autoCloseMinutes}\n onChange={(event) => void updateRemoteSettings({ autoCloseMinutes: Number(event.target.value) })}\n />\n </label>\n ) : null}\n\n <label htmlFor=\"remote-expiry-switch\" className=\"flex items-start justify-between gap-4\">\n <span className=\"flex flex-col gap-0.5\">\n <span className=\"text-base font-medium text-po-text\">Expire paired sessions</span>\n <span className=\"text-sm text-po-dim\">\n A device that goes quiet, or has simply been paired a long time, has to pair again.\n </span>\n </span>\n <Switch\n id=\"remote-expiry-switch\"\n data-testid=\"remote-expiry-switch\"\n checked={settings.sessionExpiryEnabled}\n onCheckedChange={(checked) => void updateRemoteSettings({ sessionExpiryEnabled: checked })}\n />\n </label>\n {settings.sessionExpiryEnabled ? (\n <div className=\"flex items-center justify-between gap-4 pl-4\">\n <label htmlFor=\"remote-idle-minutes\" className=\"flex items-center gap-2 text-base font-medium text-po-text\">\n Idle minutes\n <Input\n id=\"remote-idle-minutes\"\n data-testid=\"remote-idle-minutes\"\n type=\"number\"\n min={1}\n max={MAX_MINUTES}\n className=\"w-20\"\n value={settings.idleMinutes}\n onChange={(event) => void updateRemoteSettings({ idleMinutes: Number(event.target.value) })}\n />\n </label>\n <label htmlFor=\"remote-absolute-hours\" className=\"flex items-center gap-2 text-base font-medium text-po-text\">\n Total hours\n <Input\n id=\"remote-absolute-hours\"\n data-testid=\"remote-absolute-hours\"\n type=\"number\"\n min={1}\n max={MAX_HOURS}\n className=\"w-20\"\n value={settings.absoluteHours}\n onChange={(event) => void updateRemoteSettings({ absoluteHours: Number(event.target.value) })}\n />\n </label>\n </div>\n ) : null}\n\n <p className=\"text-sm text-po-dim\">\n Switching remote access off always revokes every paired device. Requires <code>cloudflared</code> on PATH.\n </p>\n\n <PairedDeviceList />\n <TrustedDeviceList />\n <DevProxyTargets />\n </div>\n );\n}\n","import { Button, QrCode, SectionLabel, Spinner, Tabs, TabsList, TabsTrigger } from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport { NATIVE_PAIRING_LINK_PREFIX } from '../../../types/remoteAccess';\nimport {\n addPasskey,\n choosePairTarget,\n newPairingCode,\n type PairTarget,\n remoteAccessStore,\n} from '../_lib/remoteAccessStore';\nimport { PairedDeviceList } from './PairedDeviceList';\n\n/** The QR credential, a short manual code, and the direct address. */\nexport function RemoteAccessPairing() {\n const state = useStore(remoteAccessStore);\n if (state.pairUrl === undefined || state.pairCode === undefined || state.pairFingerprint === undefined)\n return <Spinner />;\n const target = state.pairTarget ?? 'web';\n // The app link wraps the same credential, so one code serves either; only its opener differs.\n const qrValue =\n target === 'native' ? `${NATIVE_PAIRING_LINK_PREFIX}${encodeURIComponent(state.pairUrl)}` : state.pairUrl;\n\n return (\n <div className=\"flex flex-col items-center gap-4\">\n <Tabs value={target} onValueChange={(value) => choosePairTarget(value as PairTarget)}>\n <TabsList aria-label=\"Pair with\">\n <TabsTrigger value=\"web\" data-testid=\"remote-pair-target-web\">\n Browser\n </TabsTrigger>\n <TabsTrigger value=\"native\" data-testid=\"remote-pair-target-native\">\n Po app\n </TabsTrigger>\n </TabsList>\n </Tabs>\n <p className=\"text-center text-sm text-po-dim\">\n {target === 'native'\n ? 'Scan with the phone camera to open the Po app. Scanning from inside Po? Use the Browser code, or paste the address below.'\n : 'Scan with the phone camera to open Po in the phone browser.'}\n </p>\n {/* A light plate under the code: scanners want dark modules on a bright\n field, which is the one thing a dark theme cannot supply. */}\n <div className=\"rounded-lg bg-po-hi p-3 text-po-deep\">\n <QrCode value={qrValue} size={288} label=\"Scan to pair this device\" />\n </div>\n {target === 'web' ? (\n <div className=\"flex w-full flex-col gap-1\">\n <SectionLabel>or enter this pairing code</SectionLabel>\n <code\n data-testid=\"remote-pair-code\"\n className=\"rounded bg-po-deep p-2 text-center font-mono text-lg tracking-widest text-po-text\"\n >\n {state.pairCode}\n </code>\n </div>\n ) : null}\n <div className=\"flex w-full flex-col gap-1\">\n <SectionLabel>signing-key fingerprint</SectionLabel>\n <code\n data-testid=\"remote-signing-fingerprint\"\n className=\"break-all rounded bg-po-deep p-2 text-center font-mono text-sm text-po-text\"\n >\n {state.pairFingerprint.match(/.{1,8}/gu)?.join(' ') ?? state.pairFingerprint}\n </code>\n <p className=\"text-sm text-po-dim\">\n {target === 'web' ? 'Compare this on the phone when entering the manual code. ' : ''}\n Bundle revision {String(state.pairRevision)}.\n </p>\n </div>\n <div className=\"flex w-full flex-col gap-1\">\n <SectionLabel>{target === 'native' ? 'or paste this address in the app' : 'or open this address'}</SectionLabel>\n <code data-testid=\"remote-pair-url\" className=\"break-all rounded bg-po-deep p-2 text-sm text-po-dim\">\n {state.pairUrl}\n </code>\n </div>\n <Button variant=\"ghost\" size=\"sm\" data-testid=\"remote-new-code\" onClick={() => void newPairingCode()}>\n Show a new code\n </Button>\n\n {/* Enrolling a passkey turns every later visit into one Face ID instead\n of another scan, and it is what puts a second factor in front of the\n two actions that escalate past driving the agent. */}\n {state.passkeys?.supported === true ? (\n <div className=\"flex w-full flex-col gap-1.5 border-t border-po-border pt-3\">\n <SectionLabel>passkeys</SectionLabel>\n <p className=\"text-sm text-po-dim\">\n {state.passkeys.count === 0\n ? 'Add one on the device you just paired and it will not need the code again.'\n : `${String(state.passkeys.count)} registered. A paired device signs in with a gesture instead of a code.`}\n </p>\n <Button variant=\"outline\" size=\"sm\" data-testid=\"remote-add-passkey\" onClick={() => void addPasskey()}>\n Add a passkey for this device\n </Button>\n </div>\n ) : state.passkeys?.reason === undefined ? null : (\n <p data-testid=\"remote-passkey-unavailable\" className=\"w-full text-sm text-po-dim\">\n {state.passkeys.reason}\n </p>\n )}\n\n <PairedDeviceList />\n </div>\n );\n}\n","import {\n Button,\n Dialog,\n DialogBody,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n Spinner,\n} from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\n\nimport {\n closeRemoteDialog,\n newPairingCode,\n remoteAccessStore,\n showRemoteOptions,\n turnRemoteAccessOff,\n turnRemoteAccessOn,\n} from '../_lib/remoteAccessStore';\nimport { RemoteAccessOptions } from './RemoteAccessOptions';\nimport { RemoteAccessPairing } from './RemoteAccessPairing';\n\n/**\n * Two panels rather than one.\n *\n * Turning this on puts a shell on this machine within reach of the internet, so\n * the settings that bound it come first and the code to scan comes second, once\n * those are answered.\n */\nexport function RemoteAccessDialog() {\n const state = useStore(remoteAccessStore);\n const view = state.view;\n const pairing = state.step === 'pairing';\n const starting = state.busy || view?.status === 'starting';\n\n // The approval prompt is the only action that matters while a device waits.\n // Two modal roots compete for focus and backdrop ordering when both stay open.\n if (view?.pending?.length) return null;\n\n return (\n <Dialog open={state.step !== 'closed'} onOpenChange={(next) => (next ? undefined : closeRemoteDialog())}>\n <DialogContent width=\"lg\" data-testid=\"remote-access-dialog\" aria-describedby={undefined}>\n <DialogHeader>\n <DialogTitle>{pairing ? 'Pair a device' : 'Remote access'}</DialogTitle>\n <DialogDescription>\n {pairing\n ? 'Scan this with the device you want to use. You will be asked to approve it here.'\n : 'Reach this cockpit from your phone over a public tunnel.'}\n </DialogDescription>\n </DialogHeader>\n\n <DialogBody className=\"flex flex-col gap-5\">\n {/* Said before the switch, not after: a paired device can do\n everything the person at this keyboard can do. */}\n <p className=\"text-sm leading-relaxed text-po-dim\">\n A paired device can prompt the agent, approve its tool calls, and run shell commands as you. Pair only\n devices you hold, and only when you mean to.\n </p>\n\n {pairing ? <RemoteAccessPairing /> : <RemoteAccessOptions />}\n\n {state.error === undefined ? null : (\n <p data-testid=\"remote-access-error\" className=\"text-sm text-po-red\">\n {state.error}\n </p>\n )}\n </DialogBody>\n\n <DialogFooter className=\"px-3 pb-3 sm:px-4 sm:pb-4\">\n {view?.status === 'on' ? (\n <>\n <Button\n variant=\"danger-outline\"\n data-testid=\"remote-access-off\"\n disabled={state.busy}\n onClick={() => void turnRemoteAccessOff()}\n >\n Turn off\n </Button>\n {pairing ? (\n <Button variant=\"ghost\" data-testid=\"remote-access-back\" onClick={showRemoteOptions}>\n Options\n </Button>\n ) : (\n <Button\n variant=\"primary\"\n data-testid=\"remote-access-pair\"\n disabled={state.busy}\n onClick={() => void newPairingCode()}\n >\n Pair a device\n </Button>\n )}\n </>\n ) : (\n <Button\n variant=\"primary\"\n data-testid=\"remote-access-on\"\n disabled={starting}\n onClick={() => void turnRemoteAccessOn()}\n >\n {starting ? <Spinner /> : null}\n Turn on and show the code\n </Button>\n )}\n </DialogFooter>\n </DialogContent>\n </Dialog>\n );\n}\n","import { defineFill } from '@agimon-ai/po-core/web';\n\nimport { RemoteAccessDialog } from '../_components/RemoteAccessDialog';\n\n/** Opened from the rail's remote access button; renders nothing while closed. */\nexport default defineFill({ component: RemoteAccessDialog });\n","import { defineWebLifecycle, hostRevisionTopic, subscribeHubRevision } from '@agimon-ai/po-core/web';\n\nimport { refreshRemoteState } from '../_lib/remoteAccessStore';\n\n/** Subscribe before the first read, so a pairing request or tunnel change between the two is not missed. */\nexport default defineWebLifecycle(() => {\n const stop = subscribeHubRevision(hostRevisionTopic('remote'), () => {\n void refreshRemoteState();\n });\n void refreshRemoteState();\n return stop;\n});\n","import { REMOTE_API_ROUTE, type RemoteAccessStateView } from '../../../types/remoteAccess';\n\n/** The one-line state a settings list shows beside Remote control, such as \"On · po.example.com\". */\nexport function remoteSummaryText(remote: RemoteAccessStateView): string {\n if (remote.status === 'on') return remote.publicUrl ? `On · ${remote.publicUrl.replace(/^https?:\\/\\//u, '')}` : 'On';\n if (remote.status === 'starting') return 'Starting';\n if (remote.status === 'failed') return remote.error ? `Failed · ${remote.error}` : 'Failed';\n return 'Off';\n}\n\n/** Reads the state through the host's transport; any failure shows no summary rather than a wrong one. */\nexport async function readRemoteSummary(\n request: (input: string, init?: RequestInit) => Promise<Response>,\n): Promise<string | undefined> {\n const response = await request(REMOTE_API_ROUTE);\n if (!response.ok) return undefined;\n const body = (await response.json()) as { state?: RemoteAccessStateView };\n return body.state === undefined ? undefined : remoteSummaryText(body.state);\n}\n","import {\n Button,\n CheckIcon,\n Input,\n RadioGroup,\n RadioGroupCard,\n SettingsActions,\n SettingsCard,\n SettingsField,\n SettingsNote,\n SettingsSection,\n SettingsSectionDescription,\n SettingsSectionHeader,\n SettingsSectionTitle,\n} from '@agimon-ai/po-web-components';\n\nimport type { TunnelConfig } from '../../../../types/remoteAccess';\nimport { updateRemoteSettings } from '../../_lib/remoteAccessStore';\nimport { useUiState } from '../../_lib/uiState';\n\nconst PUBLIC_HOSTNAME =\n /^(?=.{1,253}$)(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/iu;\n\nfunction namedTunnel(tunnel: TunnelConfig): Extract<TunnelConfig, { kind: 'named' }> {\n return tunnel.kind === 'named' ? tunnel : { kind: 'named', hostname: '' };\n}\n\nfunction optional(value: string): string | undefined {\n const trimmed = value.trim();\n return trimmed === '' ? undefined : trimmed;\n}\n\nconst TUNNEL_KINDS = [\n { kind: 'quick', label: 'Quick tunnel', detail: 'No account needed. The address changes each time.' },\n { kind: 'named', label: 'Named tunnel', detail: 'Your own domain, and the address stays put.' },\n] as const;\n\n/** Selects a rotating quick tunnel or the stable named tunnel needed for a custom domain and passkeys. */\nexport function TunnelSettings({ tunnel }: { tunnel: TunnelConfig }) {\n const [draft, setDraft] = useUiState<TunnelConfig>('tunnel/draft', tunnel);\n\n // Refreshes must not replace an unsaved draft, including after an app remount.\n const [lastTunnel, setLastTunnel] = useUiState('tunnel/source', tunnel);\n const [busy, setBusy, busyState] = useUiState('tunnel/saving', false);\n if (lastTunnel !== tunnel && JSON.stringify(draft) === JSON.stringify(lastTunnel)) {\n setLastTunnel(tunnel);\n setDraft(tunnel);\n }\n\n const hostname = draft.kind === 'named' ? draft.hostname.trim() : '';\n const invalidHostname = draft.kind === 'named' && !PUBLIC_HOSTNAME.test(hostname);\n const changed = JSON.stringify(draft) !== JSON.stringify(tunnel);\n\n function updateNamed(patch: Partial<Extract<TunnelConfig, { kind: 'named' }>>): void {\n setDraft((current) => ({ ...namedTunnel(current), ...patch }));\n }\n\n async function save(): Promise<void> {\n if (busyState.state) return;\n setBusy(true);\n const named = namedTunnel(draft);\n const tokenFile = optional(named.tokenFile ?? '');\n const name = optional(named.name ?? '');\n const configFile = optional(named.configFile ?? '');\n const next: TunnelConfig =\n draft.kind === 'quick'\n ? draft\n : {\n kind: 'named',\n hostname,\n ...(tokenFile === undefined ? {} : { tokenFile }),\n ...(name === undefined ? {} : { name }),\n ...(configFile === undefined ? {} : { configFile }),\n };\n try {\n if (await updateRemoteSettings({ tunnel: next })) {\n setLastTunnel(next);\n setDraft((current) => (current === draft ? next : current));\n }\n } finally {\n setBusy(false);\n }\n }\n\n return (\n <SettingsSection data-testid=\"remote-tunnel-settings\">\n <SettingsSectionHeader>\n <SettingsSectionTitle>Tunnel</SettingsSectionTitle>\n <SettingsSectionDescription>\n How your other devices reach Po. A named tunnel gives you a stable address, which passkeys need.\n </SettingsSectionDescription>\n </SettingsSectionHeader>\n\n <RadioGroup\n value={draft.kind}\n onValueChange={(kind) => setDraft(kind === 'named' ? namedTunnel(draft) : { kind: 'quick' })}\n className=\"grid grid-cols-1 gap-3 min-[480px]:grid-cols-2\"\n aria-label=\"Tunnel type\"\n >\n {TUNNEL_KINDS.map((option) => (\n <RadioGroupCard\n key={option.kind}\n value={option.kind}\n data-testid={`remote-tunnel-${option.kind}`}\n className=\"flex items-start gap-2 rounded-lg p-4\"\n >\n <span className=\"flex min-w-0 flex-1 flex-col gap-1\">\n <span className=\"text-base font-semibold text-po-hi\">{option.label}</span>\n <span className=\"text-sm leading-relaxed text-po-dim\">{option.detail}</span>\n </span>\n {draft.kind === option.kind ? <CheckIcon className=\"size-4 shrink-0 text-po-green\" /> : null}\n </RadioGroupCard>\n ))}\n </RadioGroup>\n\n {draft.kind === 'named' ? (\n <SettingsCard>\n <SettingsField\n id=\"remote-tunnel-hostname\"\n label=\"Hostname\"\n description={\n invalidHostname ? (\n <span className=\"text-po-red\">Enter the hostname only, without https://, a port or a path.</span>\n ) : (\n 'The domain your devices will open.'\n )\n }\n >\n <Input\n id=\"remote-tunnel-hostname\"\n data-testid=\"remote-tunnel-hostname\"\n value={draft.hostname}\n placeholder=\"po.example.com\"\n aria-invalid={invalidHostname}\n spellCheck={false}\n onChange={(event) => updateNamed({ hostname: event.target.value })}\n className=\"font-mono text-sm\"\n />\n </SettingsField>\n <SettingsField\n id=\"remote-tunnel-token-file\"\n label=\"Token file\"\n description=\"A local file holding your Cloudflare connector token. Po reads the file and never stores the token itself.\"\n >\n <Input\n id=\"remote-tunnel-token-file\"\n data-testid=\"remote-tunnel-token-file\"\n value={draft.tokenFile ?? ''}\n placeholder=\"~/.cloudflared/po.token\"\n spellCheck={false}\n onChange={(event) => updateNamed({ tokenFile: event.target.value })}\n className=\"font-mono text-sm\"\n />\n </SettingsField>\n <details className=\"group\">\n <summary className=\"cursor-pointer px-5 py-3 text-sm text-po-dim hover:text-po-hi\">\n Tunnel you manage with cloudflared\n </summary>\n <div className=\"flex flex-col divide-y divide-po-border-soft border-t border-po-border-soft\">\n <SettingsField id=\"remote-tunnel-name\" label=\"Tunnel name\">\n <Input\n id=\"remote-tunnel-name\"\n data-testid=\"remote-tunnel-name\"\n value={draft.name ?? ''}\n placeholder=\"po\"\n spellCheck={false}\n onChange={(event) => updateNamed({ name: event.target.value })}\n className=\"font-mono text-sm\"\n />\n </SettingsField>\n <SettingsField id=\"remote-tunnel-config-file\" label=\"Config file\">\n <Input\n id=\"remote-tunnel-config-file\"\n data-testid=\"remote-tunnel-config-file\"\n value={draft.configFile ?? ''}\n placeholder=\"~/.cloudflared/config.yml\"\n spellCheck={false}\n onChange={(event) => updateNamed({ configFile: event.target.value })}\n className=\"font-mono text-sm\"\n />\n </SettingsField>\n </div>\n </details>\n </SettingsCard>\n ) : null}\n\n <SettingsActions>\n <Button\n variant={changed && !invalidHostname ? 'primary' : 'outline'}\n size=\"sm\"\n data-testid=\"remote-tunnel-save\"\n loading={busy}\n disabled={busy || !changed || invalidHostname}\n onClick={() => void save()}\n >\n Save tunnel\n </Button>\n <SettingsNote>\n Takes effect the next time remote access starts. Install <code className=\"font-mono\">cloudflared</code> on\n this machine first.\n </SettingsNote>\n </SettingsActions>\n </SettingsSection>\n );\n}\n","import {\n Button,\n SettingsCard,\n SettingsDescription,\n SettingsRow,\n SettingsRowDescription,\n SettingsRowText,\n SettingsRowTitle,\n Skeleton,\n} from '@agimon-ai/po-web-components';\nimport { useStore } from '@tanstack/react-store';\nimport { useEffect } from 'react';\n\nimport { refreshRemoteState, remoteAccessStore } from '../../_lib/remoteAccessStore';\nimport { TunnelSettings } from './TunnelSettings';\n\n/**\n * Persistent tunnel configuration, separate from the dialog that starts and pairs a remote session. The host\n * frames the page with its label and detail, so this draws only the body.\n */\nexport function RemoteControlSettings() {\n const state = useStore(remoteAccessStore);\n\n useEffect(() => {\n void refreshRemoteState();\n }, []);\n\n return (\n <div data-testid=\"remote-control-settings\" className=\"flex flex-col gap-8\">\n <SettingsDescription>\n You turn access on and pair devices from the remote access dialog; this page holds what stays the same between\n visits.\n </SettingsDescription>\n\n {state.view === undefined && state.error ? (\n <SettingsCard>\n <SettingsRow title={state.error}>\n <SettingsRowText role=\"alert\">\n <SettingsRowTitle>Po couldn't read your remote settings just now</SettingsRowTitle>\n <SettingsRowDescription>Nothing has changed. Remote access is as you left it.</SettingsRowDescription>\n </SettingsRowText>\n <Button variant=\"outline\" size=\"sm\" onClick={() => void refreshRemoteState()}>\n Try again\n </Button>\n </SettingsRow>\n </SettingsCard>\n ) : state.view === undefined ? (\n <SettingsCard role=\"status\" aria-busy className=\"gap-4 p-5\">\n <span className=\"sr-only\">Reading remote settings</span>\n <Skeleton className=\"h-4 w-48\" />\n <Skeleton className=\"h-4 w-72\" />\n </SettingsCard>\n ) : (\n <TunnelSettings tunnel={state.view.settings.tunnel} />\n )}\n </div>\n );\n}\n","import { defineSettingsPanel } from '@agimon-ai/po-core/web';\n\nimport { readRemoteSummary } from '../_lib/remoteSummary';\nimport { RemoteControlSettings } from './_components/RemoteControlSettings';\n\n/** Remote control configures Po itself, so it lists with the host's own pages. */\nexport default defineSettingsPanel({\n label: 'Remote control',\n detail: 'Reach this Po from your phone or another computer',\n menuGroup: 'general',\n component: RemoteControlSettings,\n summary: readRemoteSummary,\n});\n","// Generated by @agimon-ai/po-build. Do not edit by hand.\nimport { defineWebPlugin, type WebPluginContributions } from '@agimon-ai/po-core/web';\n\nimport fillPairingApproval from '../src/extensions/(frontend)/fill/PairingApproval.overlay.web';\nimport fillRemote from '../src/extensions/(frontend)/fill/Remote.rail-status.web';\nimport fillRemoteAccess from '../src/extensions/(frontend)/fill/RemoteAccess.overlay.web';\nimport lifecycleStart from '../src/extensions/(frontend)/lifecycle/start.web';\nimport settingRemote from '../src/extensions/(frontend)/setting/remote.panel.web';\n\nconst via = <T>(identity: Record<string, unknown>, value: unknown): T =>\n (value === undefined ? undefined : { ...identity, ...(value as object) }) as T;\n\nexport const webPlugin = defineWebPlugin({\n id: 'remote',\n packageName: '@agimon-ai/po-remote',\n host: {\n get fills(): WebPluginContributions['fills'] { return [via({ slot: 'overlay', id: 'pairing-approval' }, fillPairingApproval), via({ slot: 'rail-status', id: 'remote' }, fillRemote), via({ slot: 'overlay', id: 'remote-access' }, fillRemoteAccess)]; },\n get settingsPanels(): WebPluginContributions['settingsPanels'] { return [via({ id: 'remote' }, settingRemote)]; },\n get start(): WebPluginContributions['start'] { return lifecycleStart; },\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;AAWA,MAAa,mBAAmB;;;AAOhC,MAAa,wBAAwB,GAAG,iBAAiB;;;;;AAUzD,MAAa,6BAA6B;;;ACN1C,MAAMA,gBAAc;AACpB,MAAMC,iBAAe,EAAE,gBAAgB,mBAAmB;AAE1D,SAASC,WAAS,OAAkD;CAClE,OAAO,OAAO,UAAU,YAAY,UAAU,QAAQ,CAAC,MAAM,QAAQ,KAAK;AAC5E;;;;;;AAOA,eAAe,QACb,OACA,MACA,MACA,QAAkE,QAAQ,YACxE,iBAAiB,MAAM,QAAQ,OAAO,GACR;CAChC,IAAI;CACJ,IAAI;EACF,WAAW,MAAM,KAAK,OAAO,IAAI;CACnC,QAAQ;EACN,OAAO,EAAE,OAAOF,cAAY;CAC9B;CACA,IAAI;CACJ,IAAI;EACF,OAAO,MAAM,SAAS,KAAK;CAC7B,QAAQ;EACN,OAAO,KAAA;CACT;CACA,IAAI,SAAS,MAAME,WAAS,IAAI,GAAG;EACjC,MAAM,SAAS,KAAK,IAAI;EACxB,IAAI,WAAW,KAAA,GAAW,OAAO;CACnC;CACA,IAAIA,WAAS,IAAI,KAAK,OAAO,KAAK,UAAU,UAAU,OAAO,EAAE,OAAO,KAAK,MAAM;CACjF,OAAO,EAAE,OAAO,oBAAoB,OAAO,SAAS,MAAM,EAAE,GAAG;AACjE;AAEA,SAAS,UAA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