@adminide-stack/yantra-mobile 12.0.173 → 12.0.174-alpha.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/compute.js +54 -1
- package/lib/compute.js.map +1 -1
- package/lib/features/apps/AppsCatalog.js +10 -0
- package/lib/features/apps/AppsCatalog.js.map +1 -1
- package/lib/features/apps/mobileAppCatalog.js +6 -1
- package/lib/features/apps/mobileAppCatalog.js.map +1 -1
- package/lib/features/apps/nativeAppHandoff.js +4 -1
- package/lib/features/apps/nativeAppHandoff.js.map +1 -1
- package/lib/features/apps/nativeSurfaceTwin.js +2 -1
- package/lib/features/apps/nativeSurfaceTwin.js.map +1 -1
- package/lib/features/channels/ChannelIcon.js +13 -3
- package/lib/features/channels/ChannelIcon.js.map +1 -1
- package/lib/features/channels/ConnectAppsSheet.js +5 -5
- package/lib/features/channels/ConnectAppsSheet.js.map +1 -1
- package/lib/features/channels/HomeImessage.js +5 -3
- package/lib/features/channels/HomeImessage.js.map +1 -1
- package/lib/features/channels/channelLinks.js +13 -1
- package/lib/features/channels/channelLinks.js.map +1 -1
- package/lib/features/computer/ComputerAgentChatPane.js +45 -0
- package/lib/features/computer/ComputerAgentChatPane.js.map +1 -0
- package/lib/features/computer/ComputerDesktop.js +164 -0
- package/lib/features/computer/ComputerDesktop.js.map +1 -0
- package/lib/features/computer/ComputerExperience.js +79 -0
- package/lib/features/computer/ComputerExperience.js.map +1 -0
- package/lib/features/computer/ComputerHandoff.js +142 -0
- package/lib/features/computer/ComputerHandoff.js.map +1 -0
- package/lib/features/computer/FilesPane.js +179 -0
- package/lib/features/computer/FilesPane.js.map +1 -0
- package/lib/features/computer/LivePage.js +1093 -0
- package/lib/features/computer/LivePage.js.map +1 -0
- package/lib/features/computer/TerminalPane.js +139 -0
- package/lib/features/computer/TerminalPane.js.map +1 -0
- package/lib/features/computer/computerApi.js +819 -0
- package/lib/features/computer/computerApi.js.map +1 -0
- package/lib/features/computer/computerChat.js +42 -0
- package/lib/features/computer/computerChat.js.map +1 -0
- package/lib/features/computer/computerControls.js +227 -0
- package/lib/features/computer/computerControls.js.map +1 -0
- package/lib/features/computer/computerStyles.js +384 -0
- package/lib/features/computer/computerStyles.js.map +1 -0
- package/lib/features/computer/computerTheme.js +133 -0
- package/lib/features/computer/computerTheme.js.map +1 -0
- package/lib/features/computer/handoff.js +73 -0
- package/lib/features/computer/handoff.js.map +1 -0
- package/lib/features/computer/inputLane.js +171 -0
- package/lib/features/computer/inputLane.js.map +1 -0
- package/lib/features/computer/inputPump.js +77 -0
- package/lib/features/computer/inputPump.js.map +1 -0
- package/lib/features/computer/inputSocket.js +148 -0
- package/lib/features/computer/inputSocket.js.map +1 -0
- package/lib/features/computer/keyboardBridge.js +176 -0
- package/lib/features/computer/keyboardBridge.js.map +1 -0
- package/lib/features/computer/pageCoordinates.js +19 -0
- package/lib/features/computer/pageCoordinates.js.map +1 -0
- package/lib/features/computer/pageZoom.js +12 -0
- package/lib/features/computer/pageZoom.js.map +1 -0
- package/lib/features/computer/pictureGeometry.js +68 -0
- package/lib/features/computer/pictureGeometry.js.map +1 -0
- package/lib/features/computer/tabsState.js +7 -0
- package/lib/features/computer/tabsState.js.map +1 -0
- package/lib/features/computer/useComputerHooks.js +146 -0
- package/lib/features/computer/useComputerHooks.js.map +1 -0
- package/lib/features/links/openInApp.js +10 -1
- package/lib/features/links/openInApp.js.map +1 -1
- package/lib/features/webbuilder/WebBuilderExperience.js +180 -44
- package/lib/features/webbuilder/WebBuilderExperience.js.map +1 -1
- package/lib/features/webbuilder/buildFragments.js +16 -3
- package/lib/features/webbuilder/buildFragments.js.map +1 -1
- package/lib/features/webbuilder/codezenHandoff.js +29 -1
- package/lib/features/webbuilder/codezenHandoff.js.map +1 -1
- package/lib/features/webbuilder/components/CodeView.js +69 -23
- package/lib/features/webbuilder/components/CodeView.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewFrame.js +62 -2
- package/lib/features/webbuilder/components/PreviewFrame.js.map +1 -1
- package/lib/features/webbuilder/components/PreviewScreen.js +37 -2
- package/lib/features/webbuilder/components/PreviewScreen.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectChat.js +2 -1
- package/lib/features/webbuilder/components/ProjectChat.js.map +1 -1
- package/lib/features/webbuilder/components/ProjectSheets.js +147 -57
- package/lib/features/webbuilder/components/ProjectSheets.js.map +1 -1
- package/lib/features/webbuilder/components/PublishSheet.js +106 -2
- package/lib/features/webbuilder/components/PublishSheet.js.map +1 -1
- package/lib/features/webbuilder/components/ReferenceModeChoice.js +105 -0
- package/lib/features/webbuilder/components/ReferenceModeChoice.js.map +1 -0
- package/lib/features/webbuilder/components/RetentionBanner.js +17 -6
- package/lib/features/webbuilder/components/RetentionBanner.js.map +1 -1
- package/lib/features/webbuilder/components/SiteUploadSheet.js +327 -0
- package/lib/features/webbuilder/components/SiteUploadSheet.js.map +1 -0
- package/lib/features/webbuilder/components/StreamStallNote.js +38 -0
- package/lib/features/webbuilder/components/StreamStallNote.js.map +1 -0
- package/lib/features/webbuilder/components/StudioHome.js +18 -8
- package/lib/features/webbuilder/components/StudioHome.js.map +1 -1
- package/lib/features/webbuilder/previewRoutes.js +30 -1
- package/lib/features/webbuilder/previewRoutes.js.map +1 -1
- package/lib/features/webbuilder/studioCatalog.js +9 -2
- package/lib/features/webbuilder/studioCatalog.js.map +1 -1
- package/lib/features/webbuilder/web/chat/referenceMode.js +11 -0
- package/lib/features/webbuilder/web/chat/referenceMode.js.map +1 -0
- package/lib/features/webbuilder/web/chat/siteCopy.js +5 -2
- package/lib/features/webbuilder/web/chat/siteCopy.js.map +1 -1
- package/lib/features/webbuilder/web/chat/streamStall.js +6 -0
- package/lib/features/webbuilder/web/chat/streamStall.js.map +1 -0
- package/lib/features/webbuilder/web/code/savedCode.js +7 -0
- package/lib/features/webbuilder/web/code/savedCode.js.map +1 -0
- package/lib/features/webbuilder/web/design/directions.js.map +1 -1
- package/lib/features/webbuilder/web/history/versions.js.map +1 -1
- package/lib/features/webbuilder/web/import/websiteImport.js +27 -0
- package/lib/features/webbuilder/web/import/websiteImport.js.map +1 -0
- package/lib/features/webbuilder/web/preview/setupPhase.js +31 -0
- package/lib/features/webbuilder/web/preview/setupPhase.js.map +1 -0
- package/lib/features/webbuilder/web/publish/siteInsights.js +23 -1
- package/lib/features/webbuilder/web/publish/siteInsights.js.map +1 -1
- package/lib/features/webbuilder/web/upload/sitePhotos.js +102 -0
- package/lib/features/webbuilder/web/upload/sitePhotos.js.map +1 -0
- package/lib/routes.json +54 -0
- package/lib/screens/ComputerNative/index.js +124 -0
- package/lib/screens/ComputerNative/index.js.map +1 -0
- package/lib/screens/ComputerNative/useComputerHostChat.js +83 -0
- package/lib/screens/ComputerNative/useComputerHostChat.js.map +1 -0
- package/lib/screens/Home/components/homeCatalog.js +2 -1
- package/lib/screens/Home/components/homeCatalog.js.map +1 -1
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js +6 -2
- package/lib/screens/WebBuilder/nativeWebBuilderRedirect.js.map +1 -1
- package/lib/screens/WebBuilderNative/index.js +15 -3
- package/lib/screens/WebBuilderNative/index.js.map +1 -1
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js +18 -3
- package/lib/screens/WebBuilderNative/useWebBuilderHost.js.map +1 -1
- package/lib/screens/WebBuilderNative/webbuilderTransport.js +16 -7
- package/lib/screens/WebBuilderNative/webbuilderTransport.js.map +1 -1
- package/package.json +4 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computerApi.js","sources":["../../../src/features/computer/computerApi.ts"],"sourcesContent":["/* eslint-disable no-continue, no-nested-ternary, @typescript-eslint/no-use-before-define -- kept line for line with the web Computer surface's computer.ts */\n/**\n * The workspace, as the native Computer talks to it.\n *\n * Native port of the web Computer surface's `computer.ts`\n * (yantra-surface/packages/computer/src/computer.ts, 0.13.0) - the same\n * connector verbs, the same tab / live-session / \"page that is gone\" rules,\n * kept line for line so a fix on one side reads across to the other.\n *\n * Every call is one yantra-computer connector action over the executor the\n * screen lends (`provideExec`): the agent's direct exec lane with the token the\n * chat's own session hands the agent (useComputerAction), so the Computer\n * driven here is the one the agent is parked on. The web's surface-kit lane\n * (gateway, then direct agent with the browser's JWT) does not exist on the\n * phone; without a lent executor a call fails rather than running as nobody.\n */\n\nconst CONNECTOR = 'yantra-computer';\n\n/** surface-kit's `extractMediaUrl`: a media link out of a result, tolerating a `.data` envelope. */\nconst MEDIA_ARRAY_KEYS = ['artifacts', 'samples', 'outputs', 'files', 'results'];\n\nexport function extractMediaUrl(result: Record<string, unknown>, keys: string[]): string | null {\n const obj = (result.data ?? result) as Record<string, unknown>;\n const pick = (src: Record<string, unknown> | undefined): string | null => {\n if (!src) return null;\n for (const k of keys) {\n const v = src[k];\n if (typeof v === 'string' && v) return v;\n if (Array.isArray(v) && typeof v[0] === 'string' && v[0]) return v[0];\n }\n return null;\n };\n const direct = pick(obj);\n if (direct) return direct;\n for (const arrKey of MEDIA_ARRAY_KEYS) {\n const arr = obj[arrKey] as Array<Record<string, unknown>> | undefined;\n if (Array.isArray(arr) && arr.length > 0) {\n const fromArr = pick(arr[0]);\n if (fromArr) return fromArr;\n }\n }\n return null;\n}\n\n/** What a call says when no screen has lent an executor yet. */\nexport const NO_EXEC_MESSAGE = 'Yantra is not connected yet. Try again in a moment.';\n\nexport interface WorkspaceRef {\n userId?: string;\n workspaceId: string;\n /** false = never provisioned. Not the same as provisioned-and-asleep. */\n exists: boolean;\n state: string | null;\n lastActiveAt?: string | null;\n}\n\nexport interface Frame {\n src: string | null;\n title: string | null;\n pageUrl: string | null;\n error?: string | null;\n /** The tab the frame is of, when known. */\n tab?: string | null;\n}\n\nexport interface ExecResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n durationMs: number;\n error?: string;\n}\n\n/**\n * The shell's connector executor, when this surface is hosted.\n *\n * Standalone there is none and the kit's own lane (gateway → direct agent with\n * the browser's JWT) carries everything. Hosted, the shell injects one that\n * knows the app's session - and, importantly, recovers from a gateway 401 by\n * re-running on the direct lane. Calling the kit lane from inside the shell\n * instead would authenticate as nobody: the agent enforces a per-user HOME and\n * answers `401 authenticated user required`.\n */\nexport type HostExec = (\n connector: string,\n action: string,\n params: Record<string, unknown>,\n options?: { timeoutMs?: number },\n) => Promise<unknown>;\n\nlet hostExec: HostExec | null = null;\n\nexport function configureExec(exec?: HostExec | null): void {\n hostExec = exec ?? null;\n}\n\n/**\n * Executors lent by mounted pages, newest last.\n *\n * The desktop and the live screen are two exposes of one remote and share this\n * module, so a single `configureExec` slot would let whichever unmounts first\n * take the lane away from the other (the chat's live dock closing while the\n * full Computer is open would leave the desktop calling as nobody). Each mount\n * lends its executor and takes back only its own.\n */\nconst lentExecs: HostExec[] = [];\n\nexport function provideExec(exec: HostExec): () => void {\n lentExecs.push(exec);\n return () => {\n const at = lentExecs.lastIndexOf(exec);\n if (at >= 0) lentExecs.splice(at, 1);\n };\n}\n\n/** The shell's executor answers in an envelope; the connector's own result is inside it. */\nfunction unwrapHostResult(result: unknown): Record<string, unknown> {\n if (result && typeof result === 'object') {\n const envelope = result as { success?: boolean; successful?: boolean; data?: unknown; error?: unknown };\n if (envelope.success === false || envelope.successful === false) {\n throw new Error(String(envelope.error ?? 'the connector action failed'));\n }\n if ('data' in envelope && envelope.data && typeof envelope.data === 'object') {\n return envelope.data as Record<string, unknown>;\n }\n }\n return (result ?? {}) as Record<string, unknown>;\n}\n\nconst run = async <T = Record<string, unknown>>(\n action: string,\n params: Record<string, unknown>,\n timeoutMs?: number,\n): Promise<T & Record<string, unknown>> => {\n const exec = lentExecs[lentExecs.length - 1] ?? hostExec;\n if (!exec) throw new Error(NO_EXEC_MESSAGE);\n return unwrapHostResult(await exec(CONNECTOR, action, params, { timeoutMs })) as T & Record<string, unknown>;\n};\n\n/** Which workspace belongs to this user, WITHOUT creating one. */\nexport async function resolveWorkspace(userId: string): Promise<WorkspaceRef> {\n const r = await run<WorkspaceRef>('YANTRA_COMPUTER_RESOLVE', { userId }, 60_000);\n return {\n workspaceId: String(r.workspaceId ?? ''),\n exists: r.exists === true,\n state: (r.state as string) ?? null,\n lastActiveAt: (r.lastActiveAt as string) ?? null,\n };\n}\n\n/** Idempotent: the id is derived from the user, so this never mints a second. */\nexport async function createWorkspace(userId: string): Promise<WorkspaceRef> {\n const r = await run<{ workspaceId?: string; sandboxId?: string; state?: string }>(\n 'YANTRA_COMPUTER_CREATE',\n { userId },\n 180_000,\n );\n const workspaceId = String(r.workspaceId ?? r.sandboxId ?? '');\n if (!workspaceId) throw new Error('the connector returned no workspace id');\n return { workspaceId, exists: true, state: r.state ?? 'running' };\n}\n\n// ── tabs ────────────────────────────────────────────────────────────────────\n// One Chrome on the workspace, several pages in it. The person sees each page\n// as a browser WINDOW on the desktop and as a tile in the chat's live dock; the\n// agent drives two sites at once by naming the page it means. A tab id is the\n// DevTools target id - opaque here, only ever handed back to the connector.\n//\n// Every call below takes an optional `tab`. Without one it is exactly today's\n// call (the ACTIVE page, popups followed), and the parameter is left OUT of the\n// params rather than sent empty: a connector that predates tabs then sees the\n// same request it always did.\n\nexport interface BrowserTab {\n id: string;\n title: string;\n url: string;\n /** The page a verb without a tab lands on: the one last focused or opened in front. */\n active: boolean;\n}\n\n/**\n * `supported: false` = this Computer has one window right now: the connector\n * has no TABS, or it answered from a fallback (`windows: false` - a container\n * still on an image without windows, a provider without them).\n */\nexport interface TabList {\n supported: boolean;\n tabs: BrowserTab[];\n}\n\n/** What opening, closing or focusing a tab on a Computer without TABS says. */\nexport const ONE_WINDOW_MESSAGE = 'This Computer has one window. Update the Computer to open more.';\n\n/**\n * The failure a registry gives for an action it does not have: the cdecli agent\n * says \"action 'X' not found in connector 'y'\", the connector runtime says\n * \"Unknown action: X\". Narrower than the INPUT/LIVE checks on purpose - a tab\n * verb can also answer \"not found\" about a TAB (one the agent just closed), and\n * that is the page's news, not proof the action is missing.\n */\nfunction isMissingAction(error: unknown, action: string): boolean {\n const message = error instanceof Error ? error.message : String(error);\n if (/unknown action/i.test(message)) return true;\n if (/not found in (?:connector|registry)/i.test(message)) return true;\n return message.includes(action) && /not found/i.test(message);\n}\n\n/** Like INPUT and LIVE: found out once, remembered for the session. */\nlet tabsAction: 'unknown' | 'present' | 'missing' = 'unknown';\n\n/** Whether this Computer has windows: `null` until the first TABS call has answered. */\nexport function tabsSupported(): boolean | null {\n return tabsAction === 'unknown' ? null : tabsAction === 'present';\n}\n\nconst TABS_ACTION = 'YANTRA_COMPUTER_TABS';\n\n// ── one window, for now ─────────────────────────────────────────────────────\n// A connector that HAS tabs can still be in front of a Computer that cannot\n// do them: a container still on an image from before windows (the Worker\n// answers anything naming a tab with 409 `tabs_unsupported`, `needsRestart`),\n// a provider without them. The connector says so with `windows: false` on its\n// TABS answer, and a live stream or gesture naming a tab can find it out\n// mid-session. Either way the workspace is ONE window until a tab list says\n// otherwise: no tab on any page verb, no tab on any live URL - so an older\n// container keeps its live picture instead of a blank or refused stream.\n// Per workspace and not remembered for the session: the next restart puts the\n// container on the new image, and the next tab list (polled every few seconds)\n// is what notices.\n\nconst windowless = new Set<string>();\nconst windowsListeners = new Set<(workspaceId: string, available: boolean) => void>();\n\n/** Whether this workspace can show a window per tab right now (false after `windows: false` or a refusal). */\nexport function windowsAvailable(workspaceId: string): boolean {\n return !windowless.has(workspaceId);\n}\n\n/** Told when a workspace drops to one window, or gets its windows back. */\nexport function subscribeWindows(listener: (workspaceId: string, available: boolean) => void): () => void {\n windowsListeners.add(listener);\n return () => {\n windowsListeners.delete(listener);\n };\n}\n\nfunction setWindowsAvailable(workspaceId: string, available: boolean): void {\n if (available === !windowless.has(workspaceId)) return;\n if (available) windowless.delete(workspaceId);\n else windowless.add(workspaceId);\n for (const listener of [...windowsListeners]) listener(workspaceId, available);\n}\n\n/** A live stream or gesture naming a tab was refused: one window for this workspace until the tab list says otherwise. */\nexport function dropToOneWindow(workspaceId: string): void {\n if (windowless.has(workspaceId)) return;\n console.warn('[computer] this Computer cannot show windows yet (it needs a restart); showing one window');\n setWindowsAvailable(workspaceId, false);\n}\n\n/** The Worker's answer to a request naming a tab on a container that predates windows. */\nfunction isTabsRefusal(body: unknown): boolean {\n if (!body || typeof body !== 'object') return false;\n const b = body as { code?: unknown; needsRestart?: unknown };\n return b.code === 'tabs_unsupported' || b.needsRestart === true;\n}\n\n/** The same refusal, as it reaches the surface through the connector: an error message. */\nfunction isTabsRefusalError(error: unknown): boolean {\n const message = error instanceof Error ? error.message : String(error);\n return /tabs_unsupported|needs_?restart|has one window/i.test(message);\n}\n\n// ── a page that is gone ─────────────────────────────────────────────────────\n// Pages close without the desktop asking: an OAuth popup closes itself once\n// the sign-in is done, a site closes a window it opened, the browser\n// restarts. The tab list says so on its next answer - if that answer comes.\n// Every request naming the page says it first: the Worker's live routes\n// answer 410, its input socket closes 4410, and a page verb through the\n// connector (which drops the status) comes back `{ ok: false, error }` with\n// the browser's own sentence, \"no tab <id> - it was closed or the browser\n// restarted; open tabs: ...\". Whichever says it first, the page is off every\n// list at once (useBrowserTabs) and every screen showing it is told, so its\n// window goes - and nobody is ever shown that sentence or the ids in it.\n\n/** What a screen still showing a page that closed says, for the moment before it goes. */\nexport const TAB_GONE_MESSAGE = 'This window closed';\n\n/** A request named a page that is not open any more. Never shown to a person as an error. */\nexport class TabGoneError extends Error {\n readonly workspaceId: string;\n\n readonly tab: string;\n\n constructor(workspaceId: string, tab: string) {\n super(TAB_GONE_MESSAGE);\n this.name = 'TabGoneError';\n this.workspaceId = workspaceId;\n this.tab = tab;\n }\n}\n\n/**\n * How long a page reported gone stays off every list. A tab id is the\n * browser's target id and is never reused, so this only has to outlast a list\n * that was read before the news (one in flight, a Worker a moment behind) -\n * and is short so that a page wrongly reported gone would come back.\n */\nexport const TAB_GONE_MEMORY_MS = 30_000;\n\n/** Per workspace: the pages reported gone, and when. */\nconst goneTabs = new Map<string, Map<string, number>>();\nconst goneListeners = new Set<(workspaceId: string, tab: string) => void>();\n\n/** Told once for each page reported gone. */\nexport function subscribeTabsGone(listener: (workspaceId: string, tab: string) => void): () => void {\n goneListeners.add(listener);\n return () => {\n goneListeners.delete(listener);\n };\n}\n\n/** Whether `tab` was reported gone recently enough to be kept off a list. */\nexport function isTabGone(workspaceId: string, tab: string, now = Date.now()): boolean {\n const at = goneTabs.get(workspaceId)?.get(tab);\n return at !== undefined && now - at < TAB_GONE_MEMORY_MS;\n}\n\n/** The page `tab` is not open: off every list now, and every screen showing it told (once). */\nexport function markTabGone(workspaceId: string, tab: string): void {\n if (!workspaceId || !tab) return;\n const now = Date.now();\n const news = !isTabGone(workspaceId, tab, now);\n let byTab = goneTabs.get(workspaceId);\n if (!byTab) {\n byTab = new Map();\n goneTabs.set(workspaceId, byTab);\n }\n for (const [id, at] of byTab) if (now - at >= TAB_GONE_MEMORY_MS) byTab.delete(id);\n byTab.set(tab, now);\n if (!news) return;\n for (const listener of [...goneListeners]) listener(workspaceId, tab);\n}\n\n/** A tab list without the pages just reported gone. */\nexport function withoutGoneTabs(workspaceId: string, tabs: BrowserTab[]): BrowserTab[] {\n if (!goneTabs.get(workspaceId)?.size) return tabs;\n const now = Date.now();\n return tabs.filter((tab) => !isTabGone(workspaceId, tab.id, now));\n}\n\n/** Characters a tab id is made of (browser-ctl's TAB_ID), to tell `T1` from `T12` in a sentence. */\nconst TAB_ID_CHAR = /[A-Za-z0-9._-]/;\n\n/**\n * Whether `text` is the browser saying that `tab` - this tab, not another -\n * is not open: \"no tab <id> ...\", in browser-ctl's and the screencast's words.\n * Read only where nothing structured reaches this surface (the connector lane\n * passes on the sentence, not the status), and only for the tab that was asked\n * about, so a page that is open is never taken for gone.\n */\nexport function saysTabGone(text: string, tab: string): boolean {\n if (!text || !tab) return false;\n const said = `no tab ${tab}`;\n for (let at = text.indexOf(said); at >= 0; at = text.indexOf(said, at + 1)) {\n const before = at > 0 ? text.charAt(at - 1) : '';\n const after = text.charAt(at + said.length);\n if (!TAB_ID_CHAR.test(before) && !TAB_ID_CHAR.test(after)) return true;\n }\n return false;\n}\n\n/** A Worker answer (`{ ok: false, error, tab? }`) saying the page `tab` is not open. */\nexport function isTabGoneAnswer(answer: unknown, tab: string): boolean {\n if (!answer || typeof answer !== 'object') return false;\n const a = answer as { ok?: unknown; error?: unknown };\n return a.ok === false && typeof a.error === 'string' && saysTabGone(a.error, tab);\n}\n\n/** A failure saying the page `tab` is not open: our own TabGoneError, or the browser's sentence inside a connector error. */\nexport function isTabGoneError(error: unknown, tab: string): boolean {\n if (error instanceof TabGoneError) return error.tab === tab;\n return saysTabGone(error instanceof Error ? error.message : String(error ?? ''), tab);\n}\n\n/** Mark the page gone and hand back the error a caller throws instead of the browser's sentence. */\nfunction tabGoneNow(workspaceId: string, tab: string): TabGoneError {\n markTabGone(workspaceId, tab);\n return new TabGoneError(workspaceId, tab);\n}\n\n/** The tab a page verb may name: none on a workspace that is one window right now. */\nfunction pageTab(workspaceId: string, tab?: string | null): string | undefined {\n return tab && !windowless.has(workspaceId) ? tab : undefined;\n}\n\n/** The params of a page verb, with the tab only when there is one. */\nfunction onTab(params: Record<string, unknown>, tab?: string | null): Record<string, unknown> {\n return tab ? { ...params, tab } : params;\n}\n\n/**\n * Run a page verb on a tab. A refusal (the container predates windows) drops\n * the workspace to one window; a read-only verb then asks again of the active\n * page, while a verb that changes something does not - it was meant for a\n * page that is no longer on screen, and doing it to another would be worse\n * than not doing it.\n *\n * A tab that is not open any more (closed by the site, or the browser\n * restarted) is a TabGoneError, whichever way the connector said it - thrown,\n * or answered `{ ok: false }` - and every list drops the page at once. Never\n * re-aimed at the active page, read-only or not: that would put another\n * page's picture in this page's window.\n */\nasync function onPage(\n workspaceId: string,\n action: string,\n params: Record<string, unknown>,\n tab: string | undefined,\n timeoutMs: number,\n { readOnly = false }: { readOnly?: boolean } = {},\n): Promise<Record<string, unknown>> {\n const named = pageTab(workspaceId, tab);\n let r: Record<string, unknown>;\n try {\n r = await run(action, onTab(params, named), timeoutMs);\n } catch (error) {\n if (named && isTabGoneError(error, named)) throw tabGoneNow(workspaceId, named);\n if (!named || !isTabsRefusalError(error)) throw error;\n dropToOneWindow(workspaceId);\n if (!readOnly) throw error;\n return run(action, params, timeoutMs);\n }\n if (named && isTabGoneAnswer(r, named)) throw tabGoneNow(workspaceId, named);\n return r;\n}\n\nfunction readTab(value: unknown): BrowserTab | null {\n if (!value || typeof value !== 'object') return null;\n const t = value as Record<string, unknown>;\n const id = typeof t.id === 'string' ? t.id.trim() : '';\n if (!id) return null;\n return {\n id,\n title: typeof t.title === 'string' ? t.title : '',\n url: typeof t.url === 'string' ? t.url : '',\n active: t.active === true,\n };\n}\n\n/** The tab list out of a TABS (or tab-carrying) result; duplicates and id-less rows dropped. */\nexport function readTabs(r: Record<string, unknown>): BrowserTab[] {\n if (!Array.isArray(r.tabs)) return [];\n const seen = new Set<string>();\n const tabs: BrowserTab[] = [];\n for (const row of r.tabs) {\n const tab = readTab(row);\n if (!tab || seen.has(tab.id)) continue;\n seen.add(tab.id);\n tabs.push(tab);\n }\n return tabs;\n}\n\n/** The active tab first, the rest in the browser's order - the order a row of tiles reads in. */\nexport function orderTabs(tabs: BrowserTab[]): BrowserTab[] {\n const active = tabs.filter((tab) => tab.active);\n return [...active, ...tabs.filter((tab) => !tab.active)];\n}\n\n/** `amazon.in` for `https://www.amazon.in/gp/cart`; '' for a page that is no site (about:blank, a bad URL). */\nexport function siteOf(url: string): string {\n // Parsed by hand: React Native's URL has no `hostname` without the polyfill.\n const match = /^https?:\\/\\/(?:[^@/?#]*@)?([^:/?#]+)/i.exec((url ?? '').trim());\n return match ? match[1].toLowerCase().replace(/^www\\./i, '') : '';\n}\n\nasync function tabsCall(workspaceId: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n const r = await run(TABS_ACTION, { workspaceId, ...params }, 60_000);\n if (r.ok === false) throw new Error(String(r.error ?? 'the browser could not do that'));\n return r;\n}\n\n/**\n * The pages open on the Computer. A connector without TABS answers\n * `{ supported: false }` - once: the first \"no such action\" is a registry\n * fact for this session, and the desktop polls this every few seconds.\n *\n * `windows: false` on the answer is the same thing for now (see \"one window,\n * for now\" above), and only for now: every list decides it afresh, which is\n * how a restarted container gets its windows back.\n */\nexport async function listTabs(workspaceId: string): Promise<TabList> {\n if (tabsAction === 'missing') return { supported: false, tabs: [] };\n try {\n const r = await tabsCall(workspaceId, { op: 'list' });\n tabsAction = 'present';\n if (r.windows === false) {\n setWindowsAvailable(workspaceId, false);\n return { supported: false, tabs: [] };\n }\n setWindowsAvailable(workspaceId, true);\n // A page some request just found closed is not drawn again from a list read a moment before.\n return { supported: true, tabs: withoutGoneTabs(workspaceId, readTabs(r)) };\n } catch (error) {\n if (tabsAction !== 'present' && isMissingAction(error, TABS_ACTION)) {\n tabsAction = 'missing';\n console.warn('[computer] YANTRA_COMPUTER_TABS unavailable, showing one browser window', error);\n return { supported: false, tabs: [] };\n }\n throw error;\n }\n}\n\n/** The tab verbs that change something: refused up front on a Computer known to have one window. */\nasync function changeTabs(workspaceId: string, params: Record<string, unknown>): Promise<Record<string, unknown>> {\n if (tabsAction === 'missing' || windowless.has(workspaceId)) throw new Error(ONE_WINDOW_MESSAGE);\n try {\n const r = await tabsCall(workspaceId, params);\n tabsAction = 'present';\n if (r.windows === false) {\n setWindowsAvailable(workspaceId, false);\n throw new Error(ONE_WINDOW_MESSAGE);\n }\n return r;\n } catch (error) {\n if (tabsAction !== 'present' && isMissingAction(error, TABS_ACTION)) {\n tabsAction = 'missing';\n throw new Error(ONE_WINDOW_MESSAGE);\n }\n throw error;\n }\n}\n\n/**\n * Open a page in a new tab. In front (it becomes the active tab, as a window a\n * person opens should) unless `background`. A blank one is what \"New window\"\n * opens; the person types where to go.\n */\nexport async function openTab(workspaceId: string, url = 'about:blank', background = false): Promise<BrowserTab> {\n const r = await changeTabs(workspaceId, { op: 'open', url, ...(background ? { background: true } : {}) });\n const tab = readTab(r.tab) ?? readTabs(r).find((row) => row.url === url) ?? null;\n if (!tab) throw new Error('the browser opened no window');\n return tab;\n}\n\n/** Close a tab; the tabs left. Closing the last one leaves a blank page, never an empty browser. */\nexport async function closeTab(workspaceId: string, tab: string): Promise<BrowserTab[]> {\n return withoutGoneTabs(\n workspaceId,\n readTabs(await changeTabs(workspaceId, { op: 'close', tab: addressable(tab) })),\n );\n}\n\n/** Bring a tab to the front: it becomes the one a verb without a tab drives. A tab that closed is a TabGoneError. */\nexport async function focusTab(workspaceId: string, tab: string): Promise<void> {\n try {\n await changeTabs(workspaceId, { op: 'focus', tab: addressable(tab) });\n } catch (error) {\n if (isTabGoneError(error, tab)) throw tabGoneNow(workspaceId, tab);\n throw error;\n }\n}\n\n/**\n * A tab id that may go on the wire. The one page of a Computer in one-window\n * mode is reported with an EMPTY id (it has none a request could name), and a\n * close or focus of it is a caller's mistake, not \"the active tab\".\n */\nfunction addressable(tab: string): string {\n if (!tab) throw new Error('that page has no tab id to close or focus');\n return tab;\n}\n\n/**\n * A live URL addressing one tab: `?tab=` or `&tab=`, replacing a `tab` already\n * there (the connector may have addressed it itself), the fragment kept. The\n * rest of the query is left byte for byte - re-serializing it through\n * URLSearchParams would re-encode the viewer token. A URL that cannot carry a\n * query to a route (data:, blob:) is no Worker route and is returned as is;\n * the input socket (wss:) is one, and is addressed the same way.\n */\nexport function withTab(url: string, tab?: string | null): string {\n if (!tab || !/^(?:https?|wss?):\\/\\//i.test(url)) return url;\n const hashAt = url.indexOf('#');\n const hash = hashAt >= 0 ? url.slice(hashAt) : '';\n const beforeHash = hashAt >= 0 ? url.slice(0, hashAt) : url;\n const queryAt = beforeHash.indexOf('?');\n const path = queryAt >= 0 ? beforeHash.slice(0, queryAt) : beforeHash;\n const kept =\n queryAt >= 0\n ? beforeHash\n .slice(queryAt + 1)\n .split('&')\n .filter((part) => part && !/^tab(?:=|$)/.test(part))\n : [];\n return `${path}?${[...kept, `tab=${encodeURIComponent(tab)}`].join('&')}${hash}`;\n}\n\nexport async function navigate(workspaceId: string, url: string, tab?: string): Promise<void> {\n await onPage(workspaceId, 'YANTRA_COMPUTER_BROWSE', { workspaceId, url }, tab, 90_000);\n}\n\n/** The CDP driver the container ships; the fallback lane calls it directly. */\nconst BROWSER_CTL = '/opt/yantra/browser-ctl.mjs';\n\n/** `--tab <id>` for the driver, quoted for the shell; nothing without a tab. */\nfunction tabFlag(tab?: string): string {\n return tab ? ` --tab '${tab.replace(/'/g, `'\\\\''`)}'` : '';\n}\n\n/**\n * Run an expression in the page.\n *\n * ACT is the connector's own verb and the one to prefer - but a deployment can\n * be pinned to an older yantra-computer that never shipped it, and a missing\n * ACTION is a registry problem, not a page problem. So a not-found falls\n * through to the driver script the container already has (which is what ACT\n * calls anyway). Any other failure belongs to the page and propagates.\n */\nasync function evalInPage(workspaceId: string, expression: string, tab?: string): Promise<void> {\n try {\n await onPage(workspaceId, 'YANTRA_COMPUTER_ACT', { workspaceId, op: 'eval', expression }, tab, 30_000);\n return;\n } catch (error) {\n if (isTabsRefusalError(error) || !/not found|unknown action/i.test(String(error))) throw error;\n }\n await run(\n 'YANTRA_COMPUTER_EXEC',\n {\n workspaceId,\n cmd: `node ${BROWSER_CTL} eval ${JSON.stringify(expression)}${tabFlag(pageTab(workspaceId, tab))}`,\n timeoutSec: 30,\n },\n 60_000,\n );\n}\n\nexport function goBack(workspaceId: string, tab?: string): Promise<void> {\n return evalInPage(workspaceId, \"history.back(); 'ok'\", tab);\n}\n\nexport function goForward(workspaceId: string, tab?: string): Promise<void> {\n return evalInPage(workspaceId, \"history.forward(); 'ok'\", tab);\n}\n\n/** CDP's names for the buttons, which is what the dispatcher forwards verbatim. */\nexport type MouseButton = 'left' | 'middle' | 'right';\n\n/**\n * One human gesture, in the page's own pixel space.\n *\n * `click` is press and release in one; `holdMs` keeps the button down that\n * long first, for a widget that wants to be held (a slow lane cannot send the\n * release separately in time). `mousedown` / `mouseup` / `mousemove` are the\n * real thing, for the live lane where the release arrives when the person lets\n * go.\n */\nexport type InputEvent =\n | { type: 'click'; x: number; y: number; button?: MouseButton; holdMs?: number }\n | { type: 'mousedown'; x: number; y: number; button?: MouseButton }\n | { type: 'mouseup'; x: number; y: number; button?: MouseButton }\n | { type: 'mousemove'; x: number; y: number; button?: MouseButton }\n | { type: 'type'; text: string }\n | { type: 'key'; key: string }\n | { type: 'scroll'; x: number; y: number; deltaY: number };\n\n/**\n * Whether this deployment's connector has INPUT. Remembered for the session:\n * the first call finds out, and a surface that fell back once does not pay for\n * a failing round-trip on every keystroke afterwards.\n */\nlet inputAction: 'unknown' | 'present' | 'missing' = 'unknown';\n\n/**\n * Send real input to the workspace's browser - the route a PERSON uses to reach\n * into the page (solving a CAPTCHA, finishing a login the agent should not see).\n *\n * These are CDP events, not synthetic DOM ones, so the page cannot tell them\n * from a hand on the keyboard. The base64 hop in the fallback lane keeps quotes,\n * newlines and unicode in typed text from being re-interpreted by the shell.\n */\nexport async function sendInput(workspaceId: string, events: InputEvent[], tab?: string): Promise<void> {\n if (!events.length) return;\n\n if (inputAction !== 'missing') {\n try {\n await onPage(workspaceId, 'YANTRA_COMPUTER_INPUT', { workspaceId, events }, tab, 60_000);\n inputAction = 'present';\n return;\n } catch (error) {\n // A container that cannot address the tab, or a tab that closed, is not an INPUT that is missing.\n if (isTabsRefusalError(error) || error instanceof TabGoneError) throw error;\n // Once INPUT has answered, a failure is the page's and must be seen.\n if (inputAction === 'present') throw error;\n inputAction = 'missing';\n console.warn('[computer] YANTRA_COMPUTER_INPUT unavailable, using the in-workspace dispatcher', error);\n }\n }\n\n const payload = base64(JSON.stringify(events));\n const named = pageTab(workspaceId, tab);\n const result = await exec(\n workspaceId,\n `node ${BROWSER_CTL} input \"$(printf %s '${payload}' | base64 -d)\"${tabFlag(named)}`,\n 90,\n 120_000,\n );\n if (result.exitCode !== 0) {\n let message = (result.stderr || result.stdout || '').trim();\n try {\n const parsed = JSON.parse(result.stdout ?? '{}') as { error?: string };\n if (parsed.error) message = parsed.error;\n } catch {\n // Not JSON; the raw stream is the best message there is.\n }\n if (named && saysTabGone(message, named)) throw tabGoneNow(workspaceId, named);\n throw new Error(message || `input failed (exit ${result.exitCode})`);\n }\n}\n\n/** UTF-8 safe base64 - btoa alone throws on anything outside latin-1. */\nfunction base64(value: string): string {\n const bytes = new TextEncoder().encode(value);\n let binary = '';\n for (const byte of bytes) binary += String.fromCharCode(byte);\n return btoa(binary);\n}\n\n// ── live session ────────────────────────────────────────────────────────────\n// Taking control through the exec lane costs a container exec per gesture and\n// a screenshot per frame. A live session is the Worker's own front door for a\n// person: an MJPEG stream an <img> plays natively, and an input route the\n// browser POSTs to directly with a viewer token that opens nothing else. Both\n// are optional - an older connector has no LIVE action and the surface keeps\n// working the slow way.\n\n/** What the Worker hands a viewer. Only the stream is guaranteed; a provider with its own viewer sends no input route. */\nexport interface LiveSession {\n workspaceId: string;\n token: string;\n expiresAt: string;\n streamUrl: string;\n inputUrl?: string;\n /**\n * The input SOCKET (wss://.../browser/input/socket): one ordered\n * connection a person's gestures go down as they happen, with no round\n * trip per event. Newer Workers only; an older one sends none and input\n * keeps the POST route.\n */\n inputSocketUrl?: string;\n screenshotUrl?: string;\n /** The browser's status, read with the viewer token in a header (see {@link browserStatus}). */\n statusUrl?: string;\n viewport?: { width: number; height: number };\n mode: 'cloudflare' | 'kernel' | string;\n /** The tab every URL above addresses; absent = the active tab, popups followed. */\n tab?: string;\n}\n\n/** A session is renewed this long before the token runs out, so a hold never spans the expiry. */\nconst LIVE_RENEW_MARGIN_MS = 60_000;\n/** A payload without an expiry is treated as short-lived rather than eternal. */\nconst LIVE_DEFAULT_TTL_MS = 10 * 60_000;\n\n/** Like INPUT: found out once, remembered for the session. */\nlet liveAction: 'unknown' | 'present' | 'missing' = 'unknown';\nconst liveSessions = new Map<string, LiveSession>();\n/** One open per workspace at a time: the stream and the first gesture both ask on the same tick. */\nconst liveOpening = new Map<string, Promise<LiveSession | null>>();\n/** Sessions whose input route could not be reached (CORS, network); gestures on them go the slow way without retrying the fetch. */\nconst liveInputUnreachable = new WeakSet<LiveSession>();\n/**\n * Per-tab sessions, derived from the workspace's one minted session. The\n * viewer token opens the workspace's live routes, and a route addresses a tab\n * by the `tab` the client appends - so a row of three tiles, or a switch from\n * one window to the next, costs no LIVE call of its own. Derived per minted\n * session, so a renewal hands every tab fresh URLs, and the same tab of the\n * same session is always the same object (a caller compares sessions by\n * identity to tell a renewal from a repeat).\n */\nconst tabSessions = new WeakMap<LiveSession, Map<string, LiveSession>>();\nconst mintedOf = new WeakMap<LiveSession, LiveSession>();\n\nfunction sessionForTab(minted: LiveSession, tab: string): LiveSession {\n let byTab = tabSessions.get(minted);\n if (!byTab) {\n byTab = new Map();\n tabSessions.set(minted, byTab);\n }\n const known = byTab.get(tab);\n if (known) return known;\n const session: LiveSession = {\n ...minted,\n tab,\n streamUrl: withTab(minted.streamUrl, tab),\n inputUrl: minted.inputUrl ? withTab(minted.inputUrl, tab) : undefined,\n inputSocketUrl: minted.inputSocketUrl ? withTab(minted.inputSocketUrl, tab) : undefined,\n screenshotUrl: minted.screenshotUrl ? withTab(minted.screenshotUrl, tab) : undefined,\n statusUrl: minted.statusUrl ? withTab(minted.statusUrl, tab) : undefined,\n };\n byTab.set(tab, session);\n mintedOf.set(session, minted);\n return session;\n}\n\nfunction liveFresh(session: LiveSession): boolean {\n const expiresAt = Date.parse(session.expiresAt);\n return Number.isFinite(expiresAt) && expiresAt - LIVE_RENEW_MARGIN_MS > Date.now();\n}\n\n/** Whether `openLive` will be asked to renew this session soon: the caller times its own refresh from this. */\nexport function liveRenewAt(session: LiveSession): number {\n const expiresAt = Date.parse(session.expiresAt);\n return Number.isFinite(expiresAt) ? expiresAt - LIVE_RENEW_MARGIN_MS : Date.now() + LIVE_DEFAULT_TTL_MS;\n}\n\nfunction toLiveSession(workspaceId: string, r: Record<string, unknown>): LiveSession | null {\n if (r.ok === false) throw new Error(String(r.error ?? 'the live session could not be opened'));\n // Without a stream there is nothing to show live. A provider that only has\n // its own viewer page (kernel's liveViewUrl) is not a frame source for an\n // <img>, so the surface keeps polling and driving as it does today.\n const streamUrl = typeof r.streamUrl === 'string' && r.streamUrl ? r.streamUrl : null;\n if (!streamUrl) return null;\n const viewport = r.viewport as { width?: unknown; height?: unknown } | undefined;\n const width = Number(viewport?.width);\n const height = Number(viewport?.height);\n return {\n workspaceId: String(r.workspaceId ?? workspaceId),\n token: String(r.token ?? ''),\n expiresAt:\n typeof r.expiresAt === 'string' && r.expiresAt\n ? r.expiresAt\n : new Date(Date.now() + LIVE_DEFAULT_TTL_MS).toISOString(),\n streamUrl,\n inputUrl: typeof r.inputUrl === 'string' && r.inputUrl ? r.inputUrl : undefined,\n inputSocketUrl:\n typeof r.inputSocketUrl === 'string' && /^wss?:\\/\\//i.test(r.inputSocketUrl) ? r.inputSocketUrl : undefined,\n screenshotUrl: typeof r.screenshotUrl === 'string' && r.screenshotUrl ? r.screenshotUrl : undefined,\n statusUrl: typeof r.statusUrl === 'string' && r.statusUrl ? r.statusUrl : undefined,\n viewport: width > 0 && height > 0 ? { width, height } : undefined,\n mode: typeof r.mode === 'string' && r.mode ? r.mode : String(r.provider ?? 'cloudflare'),\n };\n}\n\n/**\n * Open (or reuse) the live session for a workspace, addressing `tab` when one\n * is named (see {@link sessionForTab}). `null` means there is none to be had:\n * the connector predates LIVE, or the provider has no stream. The first answer\n * of \"no such action\" is final for this session - it is a registry fact, not a\n * transient, and the surface must not pay for it again on every take-control.\n */\nexport async function openLive(workspaceId: string, tab?: string): Promise<LiveSession | null> {\n const minted = await mintLive(workspaceId);\n // One window right now: the active page's stream, never a URL naming a tab.\n const named = pageTab(workspaceId, tab);\n return minted && named ? sessionForTab(minted, named) : minted;\n}\n\n/**\n * Why a tab's live stream stopped:\n * - `refused`: the container cannot address tabs (409 `tabs_unsupported` /\n * `needsRestart`) - the Computer is one window for now;\n * - `gone`: the page is not open any more (410, or the browser's \"no tab\n * <id>\" in the answer) - already marked gone here, so its window goes;\n * - `broken`: anything else, the stream simply failed.\n * An <img> says only that it failed, so the tab's status route - which the\n * Worker answers the same way, and at once - is asked instead (the stream\n * itself, aborted at its headers, where there is no status route).\n */\nexport async function liveTabEnd(session: LiveSession): Promise<'refused' | 'gone' | 'broken'> {\n const { tab } = session;\n if (!tab) return 'broken';\n const viaStatus = !!session.statusUrl;\n // Never the MJPEG stream on a phone: React Native's fetch settles only when\n // the body ends, and a stream's never does. The still-frame route answers\n // a closed or refused tab the same way, at once.\n const asked = session.statusUrl ?? session.screenshotUrl;\n if (!asked) return 'broken';\n const controller = typeof AbortController === 'undefined' ? null : new AbortController();\n try {\n const response = await fetch(asked, {\n headers: { 'x-computer-viewer': session.token },\n ...(controller ? { signal: controller.signal } : {}),\n });\n if (response.status === 410) {\n markTabGone(session.workspaceId, tab);\n return 'gone';\n }\n // A still frame that answered 200 is a picture, not an answer to read: the page is there.\n if (response.ok && !viaStatus) return 'broken';\n const body = await response.json().catch(() => null);\n if (response.status === 409) return isTabsRefusal(body) ? 'refused' : 'broken';\n // An older Worker: its stream answers a closed tab 404, its status route 200, each with the browser's sentence.\n if (isTabGoneAnswer(body, tab)) {\n markTabGone(session.workspaceId, tab);\n return 'gone';\n }\n return 'broken';\n } catch {\n // Unreachable is not a refusal: the caller treats the stream as broken, as before.\n return 'broken';\n } finally {\n controller?.abort();\n }\n}\n\n/** Whether a tab's live stream stopped because the container cannot address tabs (see {@link liveTabEnd}). */\nexport async function liveTabRefused(session: LiveSession): Promise<boolean> {\n return (await liveTabEnd(session)) === 'refused';\n}\n\nasync function mintLive(workspaceId: string): Promise<LiveSession | null> {\n if (liveAction === 'missing') return null;\n const cached = liveSessions.get(workspaceId);\n if (cached && liveFresh(cached)) return cached;\n const pending = liveOpening.get(workspaceId);\n if (pending) return pending;\n\n const opening = (async () => {\n try {\n const r = await run('YANTRA_COMPUTER_LIVE', { workspaceId }, 60_000);\n liveAction = 'present';\n const session = toLiveSession(workspaceId, r);\n if (session) liveSessions.set(workspaceId, session);\n else liveSessions.delete(workspaceId);\n return session;\n } catch (error) {\n if (liveAction !== 'present' && /not found|unknown action/i.test(String(error))) {\n liveAction = 'missing';\n console.warn(\n '[computer] YANTRA_COMPUTER_LIVE unavailable, taking control through the exec lane',\n error,\n );\n return null;\n }\n throw error;\n } finally {\n liveOpening.delete(workspaceId);\n }\n })();\n liveOpening.set(workspaceId, opening);\n return opening;\n}\n\n/**\n * Forget a session the stream or the input route proved dead; the next\n * `openLive` mints a fresh one. With `only`, forget it just if it is still the\n * cached one - a gesture that lost the race against a renewal must not throw\n * away the fresh session the renewal just cached. A tab's session stands for\n * the minted one it came from: a token that is stale is stale for every tab.\n */\nexport function dropLive(workspaceId: string, only?: LiveSession | null): void {\n const minted = only ? (mintedOf.get(only) ?? only) : null;\n if (minted && liveSessions.get(workspaceId) !== minted) return;\n liveSessions.delete(workspaceId);\n}\n\n/**\n * Whether gestures on this session go over its own input route. False once\n * the route proved unreachable (CORS, a network hole): the session still\n * streams, but every gesture is a container exec again, and the UI has to\n * behave accordingly - no move flood, press and release as one click.\n */\nexport function liveInputIsFast(session: LiveSession | null | undefined): boolean {\n if (!session?.inputUrl || liveInputUnreachable.has(session)) return false;\n const minted = mintedOf.get(session);\n return !minted || !liveInputUnreachable.has(minted);\n}\n\nasync function postLiveInput(session: LiveSession, inputUrl: string, events: InputEvent[]): Promise<Response> {\n return fetch(inputUrl, {\n method: 'POST',\n headers: { 'content-type': 'application/json', 'x-computer-viewer': session.token },\n body: JSON.stringify({ events }),\n });\n}\n\n/**\n * Send input over the live session's own route - one HTTP hop to the Worker\n * instead of a container exec, which is what makes press-and-hold and pointer\n * movement affordable. A session without an input route (a provider with its\n * own viewer) keeps going through `sendInput`.\n *\n * A 401/403 means the token is stale: drop it, open once more, retry once. Any\n * other failure of the route is the page's, or the Worker's, and is shown.\n * A fetch that cannot even reach the route (an origin the Worker does not\n * allow, a network hole) is not the page's fault: the gesture still goes the\n * slow way, and that session stops trying the route.\n */\nexport async function sendLiveInput(\n session: LiveSession,\n events: InputEvent[],\n /** The route's answer when it sent one (a newer Worker adds the page's editable fields to it). */\n onAnswer?: (answer: Record<string, unknown>) => void,\n): Promise<LiveSession> {\n if (!events.length) return session;\n if (!liveInputIsFast(session)) {\n await sendInput(session.workspaceId, events, session.tab);\n return session;\n }\n\n let response: Response;\n let used = session;\n try {\n response = await postLiveInput(session, session.inputUrl as string, events);\n } catch (error) {\n // Unreachable is the route's doing, not the tab's: every tab of this token is told.\n liveInputUnreachable.add(session);\n const minted = mintedOf.get(session);\n if (minted) liveInputUnreachable.add(minted);\n console.warn('[computer] the live input route is unreachable, using the exec lane', error);\n await sendInput(session.workspaceId, events, session.tab);\n return session;\n }\n\n if (response.status === 401 || response.status === 403) {\n // Stale token. Forget THIS session (not one a parallel renewal just\n // cached), open once more, and hand the caller the session that\n // answered so its next gesture does not repeat the round trip.\n dropLive(session.workspaceId, session);\n const renewed = await openLive(session.workspaceId, session.tab);\n if (!renewed?.inputUrl) {\n await sendInput(session.workspaceId, events, session.tab);\n return renewed ?? session;\n }\n used = renewed;\n response = await postLiveInput(renewed, renewed.inputUrl, events);\n }\n if (response.status === 410 && used.tab) {\n // The page closed: nothing to re-aim the gesture at, and nothing to show but that.\n await response.body?.cancel().catch(() => undefined);\n throw tabGoneNow(used.workspaceId, used.tab);\n }\n if (response.status === 409 && used.tab) {\n const body = (await response.text().catch(() => '')).trim();\n let parsed: unknown = null;\n try {\n parsed = JSON.parse(body);\n } catch {\n // Not the Worker's JSON: an ordinary failure, below.\n }\n if (isTabsRefusal(parsed)) {\n // The container cannot address the tab. The gesture is dropped,\n // not re-aimed: it was meant for a page that is about to leave the\n // screen. What the person sees next is the one window, live.\n dropToOneWindow(used.workspaceId);\n return (await openLive(used.workspaceId)) ?? used;\n }\n throw new Error(body || `live input failed (${response.status})`);\n }\n if (!response.ok) {\n const body = (await response.text().catch(() => '')).trim();\n throw new Error(body || `live input failed (${response.status})`);\n }\n if ((onAnswer || used.tab) && response.status !== 204) {\n const answer = (await response.json().catch(() => null)) as Record<string, unknown> | null;\n // An older Worker answers a closed tab's input 200 `{ ok: false }` with the browser's sentence.\n if (used.tab && isTabGoneAnswer(answer, used.tab)) throw tabGoneNow(used.workspaceId, used.tab);\n if (onAnswer && answer && typeof answer === 'object') onAnswer(answer);\n }\n return used;\n}\n\n// ── bot checks ──────────────────────────────────────────────────────────────\n// The browser reports a bot check it can see (a reCAPTCHA box, a press-and-hold,\n// an interstitial) as `challenge` on its status: null when there is none, and\n// `solved` once the person has passed it. The handoff reads it to tell \"handed\n// back\" from \"still waiting on you\". A browser that predates the field says\n// nothing either way, and that is not the same as \"no check\".\n\nexport interface BrowserChallenge {\n kind: string;\n provider: string;\n solved: boolean;\n hint?: string;\n}\n\nexport interface BrowserStatus {\n /** false when the browser does not report checks at all (an older worker). */\n known: boolean;\n challenge: BrowserChallenge | null;\n}\n\nfunction readBrowserStatus(r: Record<string, unknown>): BrowserStatus {\n if (!('challenge' in r)) return { known: false, challenge: null };\n const c = r.challenge as Record<string, unknown> | null | undefined;\n if (!c || typeof c !== 'object') return { known: true, challenge: null };\n return {\n known: true,\n challenge: {\n kind: String(c.kind ?? 'captcha'),\n provider: String(c.provider ?? 'unknown'),\n solved: c.solved === true,\n ...(typeof c.hint === 'string' && c.hint ? { hint: c.hint } : {}),\n },\n };\n}\n\n/** Nothing stands in the agent's way: no check on the page, or the one there is passed. */\nexport function challengeCleared(status: BrowserStatus): boolean {\n return !status.challenge || status.challenge.solved;\n}\n\n/**\n * The browser's status, cheapest lane first: the live session's own status\n * route (one hop, the viewer token in a header so it never sits in a URL),\n * then the connector's BROWSE status for a session that has none or failed.\n */\nexport async function browserStatus(\n workspaceId: string,\n session?: LiveSession | null,\n tab: string | undefined = session?.tab,\n): Promise<BrowserStatus> {\n if (session?.statusUrl && session.token && liveFresh(session)) {\n let answer: Record<string, unknown> | null = null;\n try {\n const response = await fetch(session.statusUrl, { headers: { 'x-computer-viewer': session.token } });\n if (response.status === 410 && session.tab) {\n markTabGone(workspaceId, session.tab);\n } else if (response.ok) {\n answer = (await response.json()) as Record<string, unknown>;\n } else if (\n response.status === 409 &&\n session.tab &&\n isTabsRefusal(await response.json().catch(() => null))\n ) {\n dropToOneWindow(workspaceId);\n }\n } catch {\n // Unreachable from here (a network hole, an origin the Worker does not allow): ask the connector.\n }\n if (session.tab && (isTabGone(workspaceId, session.tab) || isTabGoneAnswer(answer, session.tab))) {\n throw tabGoneNow(workspaceId, session.tab);\n }\n if (answer) return readBrowserStatus(answer);\n }\n return readBrowserStatus(\n await onPage(workspaceId, 'YANTRA_COMPUTER_BROWSE', { workspaceId, action: 'status' }, tab, 30_000, {\n readOnly: true,\n }),\n );\n}\n\n// ── the page's fields ───────────────────────────────────────────────────────\n// The live page is a picture; tapping it can never raise a phone's keyboard,\n// and a phone raises one only for an input focused inside the tap itself. So\n// the Worker reports where the page's editable fields are (page pixels of the\n// tab's viewport) on its status and on every input answer, and the surface\n// decides on the tap, with no round trip, whether the tap is into a field.\n// Geometry and kind only: never a value, never its length.\n\nexport type EditableKind =\n | 'text'\n | 'email'\n | 'password'\n | 'number'\n | 'tel'\n | 'url'\n | 'search'\n | 'otp'\n | 'textarea'\n | 'contenteditable'\n /** A cross-origin frame (a captcha): where it is, nothing about what is inside. */\n | 'frame';\n\nconst EDITABLE_KINDS: ReadonlySet<string> = new Set([\n 'text',\n 'email',\n 'password',\n 'number',\n 'tel',\n 'url',\n 'search',\n 'otp',\n 'textarea',\n 'contenteditable',\n 'frame',\n]);\n\n/** The Worker's cap; a longer list is cut, not trusted. */\nexport const MAX_EDITABLES = 50;\n\nexport interface Editable {\n x: number;\n y: number;\n w: number;\n h: number;\n kind: EditableKind;\n autocomplete?: string;\n inputmode?: string;\n focused?: boolean;\n maxLength?: number;\n}\n\nexport interface PageFields {\n editables: Editable[];\n /** The field the page has focus in, when it says. */\n focused: Editable | null;\n}\n\nfunction shortWord(value: unknown): string | undefined {\n return typeof value === 'string' && value.length <= 64 ? value.trim() || undefined : undefined;\n}\n\nfunction readEditable(value: unknown): Editable | null {\n if (!value || typeof value !== 'object') return null;\n const row = value as Record<string, unknown>;\n const [x, y, w, h] = [row.x, row.y, row.w, row.h].map(Number);\n if (![x, y, w, h].every(Number.isFinite) || w <= 0 || h <= 0) return null;\n const kind = typeof row.kind === 'string' && EDITABLE_KINDS.has(row.kind) ? (row.kind as EditableKind) : null;\n if (!kind) return null;\n const maxLength = Number(row.maxLength);\n // Only what the contract names is kept: anything else on the row (a value\n // a buggy Worker let through) never enters the surface's state.\n return {\n x,\n y,\n w,\n h,\n kind,\n ...(shortWord(row.autocomplete) ? { autocomplete: shortWord(row.autocomplete) } : {}),\n ...(shortWord(row.inputmode) ? { inputmode: shortWord(row.inputmode) } : {}),\n ...(row.focused === true ? { focused: true } : {}),\n ...(Number.isInteger(maxLength) && maxLength > 0 ? { maxLength } : {}),\n };\n}\n\n/** The page's fields out of a status or an input answer; null when it says nothing about them (an older Worker). */\nexport function readPageFields(r: Record<string, unknown>): PageFields | null {\n if (!Array.isArray(r.editables)) return null;\n const editables = (r.editables as unknown[])\n .slice(0, MAX_EDITABLES)\n .map(readEditable)\n .filter((row): row is Editable => row !== null);\n const named =\n typeof r.focusedEditable === 'number'\n ? editables[r.focusedEditable]\n : r.focusedEditable && typeof r.focusedEditable === 'object'\n ? readEditable(r.focusedEditable)\n : null;\n return { editables, focused: named ?? editables.find((row) => row.focused) ?? null };\n}\n\n// ── a live frame, for a phone ───────────────────────────────────────────────\n// The web plays the session's MJPEG stream in an <img>; React Native's Image\n// cannot. The phone asks the Worker's still-frame route instead, one frame\n// after another. The route answers JSON - `{ ok, format, dataBase64, title,\n// url, tab }` (checked against yantra-computer-pro, 2026-11-09) - not an\n// image, so it is read with fetch and drawn as a data URI. An image answer is\n// taken as is, should a Worker ever send one. The frame is the page's own\n// pixels (1280x800 = the viewport the status reports), unlike the\n// connector's SCREENSHOT, which arrives scaled down.\n\n/** One live frame: the picture, and the page it is of. */\nexport interface LiveFrame {\n /** A data URI, or the route's own URL when it answered with an image. */\n src: string;\n /** Send these with `src` when it is the route's URL. */\n headers?: Record<string, string>;\n title: string | null;\n pageUrl: string | null;\n}\n\n/** Ask the still-frame route for one frame. A closed tab is a TabGoneError; a container without windows drops to one. */\nexport async function liveFrame(session: LiveSession, stamp: number): Promise<LiveFrame> {\n if (!session.screenshotUrl) throw new Error('this live session has no still-frame route');\n const base = session.screenshotUrl;\n const url = `${base}${base.includes('?') ? '&' : '?'}_f=${stamp}`;\n const headers = { 'x-computer-viewer': session.token };\n const response = await fetch(url, { headers });\n const { tab } = session;\n if (response.status === 410 && tab) throw tabGoneNow(session.workspaceId, tab);\n if (response.status === 409 && tab && isTabsRefusal(await response.json().catch(() => null))) {\n dropToOneWindow(session.workspaceId);\n throw new Error(ONE_WINDOW_MESSAGE);\n }\n if (!response.ok) throw new Error(`the live frame failed (${response.status})`);\n const type = response.headers.get('content-type') ?? '';\n if (/^image\\//i.test(type)) return { src: url, headers, title: null, pageUrl: null };\n const answer = (await response.json()) as Record<string, unknown>;\n if (tab && isTabGoneAnswer(answer, tab)) throw tabGoneNow(session.workspaceId, tab);\n const data = typeof answer.dataBase64 === 'string' ? answer.dataBase64 : '';\n if (answer.ok === false || !data) throw new Error(String(answer.error ?? 'the live frame had no picture'));\n const format =\n typeof answer.format === 'string' && /^(jpeg|jpg|png|webp)$/i.test(answer.format) ? answer.format : 'jpeg';\n return {\n src: `data:image/${format.toLowerCase() === 'jpg' ? 'jpeg' : format.toLowerCase()};base64,${data}`,\n title: typeof answer.title === 'string' ? answer.title : null,\n pageUrl: typeof answer.url === 'string' ? answer.url : null,\n };\n}\n\n/** The fields on the tab's page right now, over the live status route; null when it cannot say. */\nexport async function livePageFields(session: LiveSession | null | undefined): Promise<PageFields | null> {\n if (!session?.statusUrl || !session.token || !liveFresh(session)) return null;\n try {\n const response = await fetch(session.statusUrl, { headers: { 'x-computer-viewer': session.token } });\n if (response.status === 410 && session.tab) markTabGone(session.workspaceId, session.tab);\n if (!response.ok) return null;\n const answer = (await response.json()) as Record<string, unknown>;\n if (session.tab && isTabGoneAnswer(answer, session.tab)) {\n markTabGone(session.workspaceId, session.tab);\n return null;\n }\n return readPageFields(answer);\n } catch {\n return null;\n }\n}\n\n// ── the page on screen ───────────────────────────────────────────────────────\n// A Computer in one-window mode has no tab list to name its page, but the host\n// still labels its pill with it (\"Working on amazon.in\"). The browser's status\n// names it: `targets` with, on a Worker that knows windows, the `active` id -\n// and on one from before windows, the newest page first, which is the one\n// every verb acts on. Read over the live session's status route (one hop, the\n// viewer token in a header), else asked of the connector.\n\n/** The page a one-window Computer is showing. */\nexport interface ActivePage {\n title: string;\n url: string;\n}\n\nfunction pageOf(value: unknown): ActivePage | null {\n if (!value || typeof value !== 'object') return null;\n const row = value as Record<string, unknown>;\n const url = typeof row.url === 'string' ? row.url : typeof row.pageUrl === 'string' ? row.pageUrl : '';\n const title = typeof row.title === 'string' ? row.title : '';\n return url || title ? { title, url } : null;\n}\n\n/** The page on screen, out of a browser status (either Worker's shape, or a provider's own `url`/`title`). */\nexport function readActivePage(status: Record<string, unknown>): ActivePage | null {\n if (Array.isArray(status.tabs)) {\n const active = (status.tabs as unknown[]).find(\n (row) => !!row && typeof row === 'object' && (row as { active?: unknown }).active === true,\n );\n const page = pageOf(active);\n if (page) return page;\n }\n if (Array.isArray(status.targets) && status.targets.length) {\n const targets = status.targets as unknown[];\n const named =\n typeof status.active === 'string'\n ? targets.find(\n (row) => !!row && typeof row === 'object' && (row as { id?: unknown }).id === status.active,\n )\n : undefined;\n return pageOf(named ?? targets[0]);\n }\n return pageOf(status);\n}\n\n/**\n * The page a one-window Computer is showing, and which lane said so: `live`\n * (the session's status route - cheap enough to ask every few seconds) or\n * `connector` (an exec in the container - asked less often). `page` is null\n * when the browser names none (not started yet).\n */\nexport async function activePage(\n workspaceId: string,\n session?: LiveSession | null,\n): Promise<{ page: ActivePage | null; via: 'live' | 'connector' }> {\n // The ACTIVE page: a tab's session would ask about its own tab, and in\n // one-window mode a URL naming a tab is one the Worker refuses.\n const minted = session ? (mintedOf.get(session) ?? session) : null;\n if (minted?.statusUrl && minted.token && liveFresh(minted)) {\n try {\n const response = await fetch(minted.statusUrl, { headers: { 'x-computer-viewer': minted.token } });\n if (response.ok) {\n return { page: readActivePage((await response.json()) as Record<string, unknown>), via: 'live' };\n }\n } catch {\n // Unreachable from here: ask the connector.\n }\n }\n const r = await run('YANTRA_COMPUTER_BROWSE', { workspaceId, action: 'status' }, 30_000);\n return { page: readActivePage(r), via: 'connector' };\n}\n\n/**\n * A frame arrives one of two ways and both are normal: inline when the result\n * came back whole, or as a signed link when the agent's objectstore lifted the\n * base64 out of a large result. The page's own address is `pageUrl` - `url` on\n * a screenshot result is the MEDIA link, not the page.\n */\nexport async function screenshot(workspaceId: string, tab?: string): Promise<Frame> {\n const r = await onPage(\n workspaceId,\n 'YANTRA_COMPUTER_SCREENSHOT',\n { workspaceId, format: 'jpeg', quality: 70 },\n tab,\n 120_000,\n { readOnly: true },\n );\n const inline = typeof r.dataBase64 === 'string' && r.dataBase64 ? String(r.dataBase64) : null;\n return {\n src: inline ? `data:image/jpeg;base64,${inline}` : extractMediaUrl(r, ['url', 'mediaUrl']),\n title: (r.title as string) ?? null,\n pageUrl: (r.pageUrl as string) ?? null,\n error: (r.error as string) ?? null,\n // Which page it is of, when the connector says: the one asked for, or the active one.\n tab: typeof r.tab === 'string' && r.tab ? r.tab : (pageTab(workspaceId, tab) ?? null),\n };\n}\n\nexport async function exec(\n workspaceId: string,\n cmd: string,\n timeoutSec = 120,\n timeoutMs = 180_000,\n): Promise<ExecResult> {\n const r = await run('YANTRA_COMPUTER_EXEC', { workspaceId, cmd, timeoutSec }, timeoutMs);\n return {\n exitCode: Number(r.exitCode ?? -1),\n stdout: String(r.stdout ?? ''),\n stderr: String(r.stderr ?? ''),\n durationMs: Number(r.durationMs ?? 0),\n error: (r.error as string) ?? undefined,\n };\n}\n\nexport async function readFile(workspaceId: string, path: string): Promise<string> {\n const r = await run('YANTRA_COMPUTER_READ_FILE', { workspaceId, path }, 90_000);\n const b64 = String(r.contentBase64 ?? '');\n if (!b64) return '';\n let bytes: string;\n try {\n bytes = atob(b64);\n } catch {\n return '(binary file)';\n }\n // atob gives one character per byte; a UTF-8 file reads right only once decoded.\n try {\n return decodeURIComponent(\n Array.from(bytes, (c) => `%${c.charCodeAt(0).toString(16).padStart(2, '0')}`).join(''),\n );\n } catch {\n return bytes;\n }\n}\n"],"names":["exec"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiBA,MAAM,SAAY,GAAA,iBAAA;AAGlB,MAAM,mBAAmB,CAAC,WAAA,EAAa,SAAW,EAAA,SAAA,EAAW,SAAS,SAAS,CAAA;AAC/D,SAAA,eAAA,CAAgB,QAAiC,IAA+B,EAAA;AArBhG,EAAA,IAAA,EAAA;AAsBE,EAAM,MAAA,GAAA,GAAA,CAAO,EAAO,GAAA,MAAA,CAAA,IAAA,KAAP,IAAe,GAAA,EAAA,GAAA,MAAA;AAC5B,EAAM,MAAA,IAAA,GAAO,CAAC,GAA4D,KAAA;AACxE,IAAI,IAAA,CAAC,KAAY,OAAA,IAAA;AACjB,IAAA,KAAA,MAAW,KAAK,IAAM,EAAA;AACpB,MAAM,MAAA,CAAA,GAAI,IAAI,CAAC,CAAA;AACf,MAAA,IAAI,OAAO,CAAA,KAAM,QAAY,IAAA,CAAA,EAAU,OAAA,CAAA;AACvC,MAAA,IAAI,KAAM,CAAA,OAAA,CAAQ,CAAC,CAAA,IAAK,OAAO,CAAE,CAAA,CAAC,CAAM,KAAA,QAAA,IAAY,CAAE,CAAA,CAAC,CAAG,EAAA,OAAO,EAAE,CAAC,CAAA;AAAA;AAEtE,IAAO,OAAA,IAAA;AAAA,GACT;AACA,EAAM,MAAA,MAAA,GAAS,KAAK,GAAG,CAAA;AACvB,EAAA,IAAI,QAAe,OAAA,MAAA;AACnB,EAAA,KAAA,MAAW,UAAU,gBAAkB,EAAA;AACrC,IAAM,MAAA,GAAA,GAAM,IAAI,MAAM,CAAA;AACtB,IAAA,IAAI,MAAM,OAAQ,CAAA,GAAG,CAAK,IAAA,GAAA,CAAI,SAAS,CAAG,EAAA;AACxC,MAAA,MAAM,OAAU,GAA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,CAAO,EAAE,GAAA,CAAA,CAAA,KAAA,KAAF,IAAqB,GAAA,EAAA,GAAA;AAAA,GAC9B;AACF;AACsB,eAAA,QAAA,CAAS,aAAqB,IAA+B,EAAA;AA97CnF,EAAA,IAAA,EAAA;AA+7CE,EAAM,MAAA,CAAA,GAAI,MAAM,GAAA,CAAI,2BAA6B,EAAA;AAAA,IAC/C,WAAA;AAAA,IACA;AAAA,KACC,GAAM,CAAA;AACT,EAAA,MAAM,GAAM,GAAA,MAAA,CAAA,CAAO,EAAE,GAAA,CAAA,CAAA,aAAA,KAAF,YAAmB,EAAE,CAAA;AACxC,EAAI,IAAA,CAAC,KAAY,OAAA,EAAA;AACjB,EAAI,IAAA,KAAA;AACJ,EAAI,IAAA;AACF,IAAA,KAAA,GAAQ,KAAK,GAAG,CAAA;AAAA,GACV,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,eAAA;AAAA;AAGT,EAAI,IAAA;AACF,IAAO,OAAA,kBAAA,CAAmB,MAAM,IAAK,CAAA,KAAA,EAAO,OAAK,CAAI,CAAA,EAAA,CAAA,CAAE,WAAW,CAAC,CAAA,CAAE,SAAS,EAAE,CAAA,CAAE,SAAS,CAAG,EAAA,GAAG,CAAC,CAAE,CAAA,CAAA,CAAE,IAAK,CAAA,EAAE,CAAC,CAAA;AAAA,GACxG,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,KAAA;AAAA;AAEX"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const COMPUTER_SUGGESTIONS = [{
|
|
2
|
+
id: "read-page",
|
|
3
|
+
label: "Read a page",
|
|
4
|
+
prompt: "Open example.com and tell me what the page says."
|
|
5
|
+
}, {
|
|
6
|
+
id: "check-login",
|
|
7
|
+
label: "Check a login",
|
|
8
|
+
prompt: "Open the site I logged into and tell me whether I am still signed in."
|
|
9
|
+
}, {
|
|
10
|
+
id: "on-screen",
|
|
11
|
+
label: "What's on screen",
|
|
12
|
+
prompt: "Read the current page and list what I can click or type into."
|
|
13
|
+
}];
|
|
14
|
+
const COMPUTER_EMPTY_TITLE = "Ask, and the computer does it";
|
|
15
|
+
const COMPUTER_EMPTY_BODY = "The agent drives this Computer - the same browser, terminal and files you see here.";
|
|
16
|
+
const COMPUTER_PLACEHOLDER = "Ask the computer to do something\u2026";
|
|
17
|
+
function computerContext(workspaceId) {
|
|
18
|
+
return workspaceId ? `(Use the yantra-computer connector against workspaceId ${workspaceId}. When you need the user to choose or confirm something - a value, which option, whether to proceed - ask with AskUserQuestion so it renders as a choice, rather than in prose.)` : "(No computer has been started yet. Use the yantra-computer connector, resolving or creating this user's workspace first. When you need the user to choose or confirm something, ask with AskUserQuestion.)";
|
|
19
|
+
}
|
|
20
|
+
function composeComputerTurn(text, workspaceId) {
|
|
21
|
+
return `${text}
|
|
22
|
+
|
|
23
|
+
${computerContext(workspaceId)}`;
|
|
24
|
+
}
|
|
25
|
+
const ACTIVE_CONNECTORS_PREFIX_RE = /^\s*\[Active connectors:[^\]]*\]\s*/i;
|
|
26
|
+
const COMPUTER_CONTEXT_SUFFIX_RE = /\s*\((?:Use the yantra-computer connector|No computer has been started)[\s\S]*\)\s*$/;
|
|
27
|
+
function stripComputerInstrumentation(content) {
|
|
28
|
+
return content.replace(ACTIVE_CONNECTORS_PREFIX_RE, "").replace(COMPUTER_CONTEXT_SUFFIX_RE, "").trim();
|
|
29
|
+
}
|
|
30
|
+
function tokenSubject(token) {
|
|
31
|
+
var _a;
|
|
32
|
+
try {
|
|
33
|
+
const payload = token == null ? void 0 : token.split(".")[1];
|
|
34
|
+
if (!payload) return "";
|
|
35
|
+
const padded = payload.replace(/-/g, "+").replace(/_/g, "/");
|
|
36
|
+
const claims = JSON.parse(atob(padded + "=".repeat((4 - padded.length % 4) % 4)));
|
|
37
|
+
const sub = String((_a = claims.sub) != null ? _a : "").trim();
|
|
38
|
+
return sub === "default" ? "" : sub;
|
|
39
|
+
} catch (e) {
|
|
40
|
+
return "";
|
|
41
|
+
}
|
|
42
|
+
}export{COMPUTER_EMPTY_BODY,COMPUTER_EMPTY_TITLE,COMPUTER_PLACEHOLDER,COMPUTER_SUGGESTIONS,composeComputerTurn,computerContext,stripComputerInstrumentation,tokenSubject};//# sourceMappingURL=computerChat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computerChat.js","sources":["../../../src/features/computer/computerChat.ts"],"sourcesContent":["/**\n * What the Computer's agent pane SAYS - native twin of the web surface's\n * `chat/ComputerChatPane.tsx` copy and steering. The pane itself is the shared\n * NativeAgentChat over the host's gateway chat (useComputerHostChat).\n *\n * Every turn is told WHICH computer it works on. The workspace id is the whole\n * address of the machine - without it the agent resolves or creates one on its\n * own and can land on a different computer than the page the person watches.\n *\n * Pure: no React Native imports.\n */\nimport type { AgentChatSuggestion } from '../agent-chat';\n\n/** Skills a dispatched computer turn runs with on the web (the registry's `computer` routing). */\nexport const COMPUTER_SKILLS = ['yantra-computer', 'yantra-skills/cdecli-connector-skill'] as const;\n\nexport const COMPUTER_SUGGESTIONS: AgentChatSuggestion[] = [\n { id: 'read-page', label: 'Read a page', prompt: 'Open example.com and tell me what the page says.' },\n {\n id: 'check-login',\n label: 'Check a login',\n prompt: 'Open the site I logged into and tell me whether I am still signed in.',\n },\n {\n id: 'on-screen',\n label: \"What's on screen\",\n prompt: 'Read the current page and list what I can click or type into.',\n },\n];\n\nexport const COMPUTER_EMPTY_TITLE = 'Ask, and the computer does it';\nexport const COMPUTER_EMPTY_BODY =\n 'The agent drives this Computer - the same browser, terminal and files you see here.';\nexport const COMPUTER_PLACEHOLDER = 'Ask the computer to do something…';\n\n/** The steering a turn carries for the agent: which machine, and to ask with AskUserQuestion. */\nexport function computerContext(workspaceId: string): string {\n return workspaceId\n ? `(Use the yantra-computer connector against workspaceId ${workspaceId}. When you need the user to choose or confirm something - a value, which option, whether to proceed - ask with AskUserQuestion so it renders as a choice, rather than in prose.)`\n : \"(No computer has been started yet. Use the yantra-computer connector, resolving or creating this user's workspace first. When you need the user to choose or confirm something, ask with AskUserQuestion.)\";\n}\n\n/** A turn as it goes to the agent: the person's words, then the steering. */\nexport function composeComputerTurn(text: string, workspaceId: string): string {\n return `${text}\\n\\n${computerContext(workspaceId)}`;\n}\n\nconst ACTIVE_CONNECTORS_PREFIX_RE = /^\\s*\\[Active connectors:[^\\]]*\\]\\s*/i;\nconst COMPUTER_CONTEXT_SUFFIX_RE =\n /\\s*\\((?:Use the yantra-computer connector|No computer has been started)[\\s\\S]*\\)\\s*$/;\n\n/** The person's own words: the routing prefix and the steering peeled off what the transcript shows. */\nexport function stripComputerInstrumentation(content: string): string {\n return content.replace(ACTIVE_CONNECTORS_PREFIX_RE, '').replace(COMPUTER_CONTEXT_SUFFIX_RE, '').trim();\n}\n\n/** Turn a tool call into the one line worth showing while it runs. */\nexport function describeToolCall(name: string): string {\n switch (/YANTRA_COMPUTER_([A-Z_]+)/.exec(name)?.[1]) {\n case 'CREATE':\n return 'Starting the computer…';\n case 'BROWSE':\n return 'Opening a page…';\n case 'READ_PAGE':\n return 'Reading the page…';\n case 'ACT':\n return 'Clicking and typing…';\n case 'INPUT':\n return 'Using the browser…';\n case 'SCREENSHOT':\n return 'Looking at the screen…';\n case 'EXEC':\n return 'Running a command…';\n case 'READ_FILE':\n case 'WRITE_FILE':\n return 'Working with files…';\n default:\n return `Working${name ? ` - ${name.split('/').pop()?.replace(/_/g, ' ').toLowerCase()}` : ''}…`;\n }\n}\n\n/** The account a token belongs to: its `sub`. The Computer is derived from it (the web's identity.ts). */\nexport function tokenSubject(token: string | null | undefined): string {\n try {\n const payload = token?.split('.')[1];\n if (!payload) return '';\n const padded = payload.replace(/-/g, '+').replace(/_/g, '/');\n const claims = JSON.parse(atob(padded + '='.repeat((4 - (padded.length % 4)) % 4))) as { sub?: unknown };\n const sub = String(claims.sub ?? '').trim();\n // 'default' is a placeholder identity a per-user agent rejects outright.\n return sub === 'default' ? '' : sub;\n } catch {\n return '';\n }\n}\n"],"names":[],"mappings":"AAeO,M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,MAAM,GAAG,CAAA;AAC3D,IAAA,MAAM,MAAS,GAAA,IAAA,CAAK,KAAM,CAAA,IAAA,CAAK,MAAS,GAAA,GAAA,CAAI,MAAQ,CAAA,CAAA,CAAA,GAAI,MAAO,CAAA,MAAA,GAAS,CAAK,IAAA,CAAC,CAAC,CAAC,CAAA;AAGhF,IAAA,MAAM,MAAM,MAAO,CAAA,CAAA,EAAA,GAAA,MAAA,CAAO,QAAP,IAAc,GAAA,EAAA,GAAA,EAAE,EAAE,IAAK,EAAA;AAE1C,IAAO,OAAA,GAAA,KAAQ,YAAY,EAAK,GAAA,GAAA;AAAA,GAC1B,CAAA,OAAA,CAAA,EAAA;AACN,IAAO,OAAA,EAAA;AAAA;AAEX"}
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {View,Pressable,Text,ActivityIndicator}from'react-native';import {MaterialCommunityIcons}from'@expo/vector-icons';import {makeComputerStyles}from'./computerStyles.js';import {useComputerColors,useThemedStyles}from'./computerTheme.js';import {zoomLabel,ZOOM_STEPS}from'./pageZoom.js';var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
const PHASE_LABEL = {
|
|
18
|
+
ready: "Running",
|
|
19
|
+
starting: "Starting",
|
|
20
|
+
error: "Unreachable",
|
|
21
|
+
resolving: "Checking",
|
|
22
|
+
absent: "Checking"
|
|
23
|
+
};
|
|
24
|
+
function phaseDot(phase, C) {
|
|
25
|
+
if (phase === "ready") return C.live;
|
|
26
|
+
if (phase === "error") return C.danger;
|
|
27
|
+
return C.waiting;
|
|
28
|
+
}
|
|
29
|
+
const WAITING_TEXT = {
|
|
30
|
+
absent: "Your Computer is not running right now. Ask your assistant to try again.",
|
|
31
|
+
error: "Can't reach your Computer right now. This is the connection, not the machine."
|
|
32
|
+
};
|
|
33
|
+
function controlLine(controlling, ready = true) {
|
|
34
|
+
if (!ready) return "Waiting for the browser";
|
|
35
|
+
return controlling ? "You have control" : "Watching - your assistant has control";
|
|
36
|
+
}
|
|
37
|
+
function BigButton({
|
|
38
|
+
kind,
|
|
39
|
+
label,
|
|
40
|
+
onPress,
|
|
41
|
+
icon,
|
|
42
|
+
busy = false,
|
|
43
|
+
disabled = false,
|
|
44
|
+
pressed: held,
|
|
45
|
+
flex = false
|
|
46
|
+
}) {
|
|
47
|
+
const C = useComputerColors();
|
|
48
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
49
|
+
const primary = kind === "primary";
|
|
50
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress, disabled, accessibilityRole: "button", accessibilityState: __spreadValues({
|
|
51
|
+
disabled,
|
|
52
|
+
busy
|
|
53
|
+
}, held !== void 0 ? {
|
|
54
|
+
selected: held
|
|
55
|
+
} : {}), style: ({
|
|
56
|
+
pressed
|
|
57
|
+
}) => [styles.bigButton, flex && styles.fill, primary ? styles.bigPrimary : styles.bigSecondary, pressed && (primary ? styles.bigPrimaryPressed : styles.bigSecondaryPressed), disabled && primary && styles.bigDisabled], children: [
|
|
58
|
+
busy ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: primary ? C.accentInk : C.inkSoft }) : null,
|
|
59
|
+
!busy && icon ? /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 18, color: primary ? C.accentInk : C.inkSoft }) : null,
|
|
60
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.bigText, {
|
|
61
|
+
color: primary ? C.accentInk : C.inkSoft
|
|
62
|
+
}], children: label })
|
|
63
|
+
] });
|
|
64
|
+
}
|
|
65
|
+
const LANE_LABEL = {
|
|
66
|
+
live: "Live",
|
|
67
|
+
snapshots: "Snapshots",
|
|
68
|
+
connecting: "Connecting"
|
|
69
|
+
};
|
|
70
|
+
function LiveBadge({
|
|
71
|
+
ready,
|
|
72
|
+
lane
|
|
73
|
+
}) {
|
|
74
|
+
const C = useComputerColors();
|
|
75
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
76
|
+
const shown = ready ? lane : "connecting";
|
|
77
|
+
const on = shown === "live";
|
|
78
|
+
let dot = C.waiting;
|
|
79
|
+
if (on) dot = C.live;
|
|
80
|
+
else if (shown === "snapshots") dot = C.muted;
|
|
81
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.badge, {
|
|
82
|
+
backgroundColor: on ? C.liveSoft : C.fillStrong
|
|
83
|
+
}], accessibilityHint: shown === "snapshots" ? "The picture updates every few seconds" : void 0, children: [
|
|
84
|
+
/* @__PURE__ */ jsx(View, { style: [styles.dot, {
|
|
85
|
+
backgroundColor: dot
|
|
86
|
+
}] }),
|
|
87
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.badgeText, {
|
|
88
|
+
color: on ? C.liveInk : C.muted
|
|
89
|
+
}], children: LANE_LABEL[shown] })
|
|
90
|
+
] });
|
|
91
|
+
}
|
|
92
|
+
function PhaseBadge({
|
|
93
|
+
phase
|
|
94
|
+
}) {
|
|
95
|
+
const C = useComputerColors();
|
|
96
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
97
|
+
const label = PHASE_LABEL[phase];
|
|
98
|
+
const dot = phaseDot(phase, C);
|
|
99
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.badge, {
|
|
100
|
+
backgroundColor: C.fillStrong
|
|
101
|
+
}], children: [
|
|
102
|
+
/* @__PURE__ */ jsx(View, { style: [styles.dot, {
|
|
103
|
+
backgroundColor: dot
|
|
104
|
+
}] }),
|
|
105
|
+
/* @__PURE__ */ jsx(Text, { style: [styles.badgeText, {
|
|
106
|
+
color: C.muted
|
|
107
|
+
}], children: label })
|
|
108
|
+
] });
|
|
109
|
+
}
|
|
110
|
+
function Header({
|
|
111
|
+
onExit,
|
|
112
|
+
badge,
|
|
113
|
+
onOpenAgent
|
|
114
|
+
}) {
|
|
115
|
+
const C = useComputerColors();
|
|
116
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
117
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.header, children: [
|
|
118
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: onExit, accessibilityRole: "button", accessibilityLabel: "Back", hitSlop: 8, style: styles.headerButton, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "chevron-left", size: 26, color: C.inkSoft }) }),
|
|
119
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "monitor", size: 17, color: C.muted }),
|
|
120
|
+
/* @__PURE__ */ jsx(Text, { style: styles.headerTitle, accessibilityRole: "header", children: "Your Computer" }),
|
|
121
|
+
/* @__PURE__ */ jsx(View, { style: styles.headerSpacer }),
|
|
122
|
+
badge,
|
|
123
|
+
onOpenAgent ? /* @__PURE__ */ jsxs(Pressable, { onPress: onOpenAgent, accessibilityRole: "button", accessibilityLabel: "Ask the computer", style: ({
|
|
124
|
+
pressed
|
|
125
|
+
}) => [styles.agentChip, pressed && styles.agentChipPressed], children: [
|
|
126
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "creation", size: 15, color: C.accentInk }),
|
|
127
|
+
/* @__PURE__ */ jsx(Text, { style: styles.agentChipText, children: "Ask" })
|
|
128
|
+
] }) : null
|
|
129
|
+
] });
|
|
130
|
+
}
|
|
131
|
+
function Splash({
|
|
132
|
+
phase,
|
|
133
|
+
problem,
|
|
134
|
+
hasUser,
|
|
135
|
+
onStart,
|
|
136
|
+
onRetry
|
|
137
|
+
}) {
|
|
138
|
+
const C = useComputerColors();
|
|
139
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
140
|
+
let content;
|
|
141
|
+
if (!hasUser || phase === "resolving" || phase === "starting") {
|
|
142
|
+
let waiting = "Looking for your computer\u2026";
|
|
143
|
+
if (!hasUser) waiting = "Waiting for your account\u2026";
|
|
144
|
+
else if (phase === "starting") waiting = "Setting it up. Your files are ready; the machine boots on the first command.";
|
|
145
|
+
content = /* @__PURE__ */ jsxs(View, { style: styles.row, children: [
|
|
146
|
+
/* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: C.muted }),
|
|
147
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashMuted, children: waiting })
|
|
148
|
+
] });
|
|
149
|
+
} else if (phase === "error") {
|
|
150
|
+
content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
151
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashTitle, children: "Can't reach your computer" }),
|
|
152
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashBody, children: "Your files are safe. This is the connection, not the machine." }),
|
|
153
|
+
/* @__PURE__ */ jsx(View, { style: styles.splashAction, children: /* @__PURE__ */ jsx(BigButton, { kind: "secondary", label: "Try again", onPress: onRetry }) })
|
|
154
|
+
] });
|
|
155
|
+
} else {
|
|
156
|
+
content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
157
|
+
/* @__PURE__ */ jsx(View, { style: styles.splashIcon, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "monitor", size: 28, color: C.accent }) }),
|
|
158
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashTitle, children: "A computer of your own" }),
|
|
159
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashBody, children: "A browser, a shell and a filesystem that keep working after you close this screen." }),
|
|
160
|
+
/* @__PURE__ */ jsx(View, { style: styles.splashAction, children: /* @__PURE__ */ jsx(BigButton, { kind: "primary", label: "Start your computer", onPress: onStart }) })
|
|
161
|
+
] });
|
|
162
|
+
}
|
|
163
|
+
return /* @__PURE__ */ jsx(View, { style: styles.splash, children: /* @__PURE__ */ jsxs(View, { style: styles.splashCard, children: [
|
|
164
|
+
content,
|
|
165
|
+
problem ? /* @__PURE__ */ jsx(Text, { style: styles.splashProblem, children: problem }) : null
|
|
166
|
+
] }) });
|
|
167
|
+
}
|
|
168
|
+
function Waiting({
|
|
169
|
+
phase,
|
|
170
|
+
problem
|
|
171
|
+
}) {
|
|
172
|
+
var _a;
|
|
173
|
+
const C = useComputerColors();
|
|
174
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
175
|
+
const text = (_a = WAITING_TEXT[phase]) != null ? _a : "Opening your Computer\u2026";
|
|
176
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.waiting, children: [
|
|
177
|
+
phase === "resolving" || phase === "starting" ? /* @__PURE__ */ jsx(ActivityIndicator, { size: "small", color: C.muted }) : null,
|
|
178
|
+
/* @__PURE__ */ jsx(Text, { style: styles.splashMuted, children: text }),
|
|
179
|
+
problem ? /* @__PURE__ */ jsx(Text, { style: styles.splashProblem, children: problem }) : null
|
|
180
|
+
] });
|
|
181
|
+
}
|
|
182
|
+
function Banner({
|
|
183
|
+
tone,
|
|
184
|
+
icon,
|
|
185
|
+
children
|
|
186
|
+
}) {
|
|
187
|
+
const C = useComputerColors();
|
|
188
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
189
|
+
const done = tone === "done";
|
|
190
|
+
return /* @__PURE__ */ jsxs(View, { style: [styles.banner, {
|
|
191
|
+
borderColor: done ? C.doneBorder : C.accentBorder,
|
|
192
|
+
backgroundColor: done ? C.doneSoft : C.accentSoft
|
|
193
|
+
}], children: [
|
|
194
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: icon, size: 19, color: done ? C.live : C.accent, style: styles.bannerIcon }),
|
|
195
|
+
/* @__PURE__ */ jsx(View, { style: styles.fill, children })
|
|
196
|
+
] });
|
|
197
|
+
}
|
|
198
|
+
function KeyboardButton({
|
|
199
|
+
up,
|
|
200
|
+
onOpen
|
|
201
|
+
}) {
|
|
202
|
+
const C = useComputerColors();
|
|
203
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
204
|
+
return /* @__PURE__ */ jsxs(Pressable, { onPress: onOpen, accessibilityRole: "button", accessibilityLabel: "Keyboard", accessibilityState: {
|
|
205
|
+
expanded: up
|
|
206
|
+
}, style: ({
|
|
207
|
+
pressed
|
|
208
|
+
}) => [styles.smallButton, pressed && styles.smallButtonPressed], children: [
|
|
209
|
+
/* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "keyboard-outline", size: 17, color: C.inkSoft }),
|
|
210
|
+
/* @__PURE__ */ jsx(Text, { style: styles.smallButtonText, children: "Keyboard" })
|
|
211
|
+
] });
|
|
212
|
+
}
|
|
213
|
+
function ZoomControl({
|
|
214
|
+
step,
|
|
215
|
+
disabled,
|
|
216
|
+
onChange
|
|
217
|
+
}) {
|
|
218
|
+
const C = useComputerColors();
|
|
219
|
+
const styles = useThemedStyles(makeComputerStyles);
|
|
220
|
+
const atMin = disabled || step === 0;
|
|
221
|
+
const atMax = disabled || step === ZOOM_STEPS.length - 1;
|
|
222
|
+
return /* @__PURE__ */ jsxs(View, { style: styles.zoom, children: [
|
|
223
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => onChange(step - 1), disabled: atMin, accessibilityRole: "button", accessibilityLabel: "Zoom out", style: styles.zoomButton, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "minus", size: 17, color: atMin ? C.disabled : C.inkSoft }) }),
|
|
224
|
+
/* @__PURE__ */ jsx(Text, { style: styles.zoomLabel, accessibilityLiveRegion: "polite", children: zoomLabel(ZOOM_STEPS[step]) }),
|
|
225
|
+
/* @__PURE__ */ jsx(Pressable, { onPress: () => onChange(step + 1), disabled: atMax, accessibilityRole: "button", accessibilityLabel: "Zoom in", style: styles.zoomButton, children: /* @__PURE__ */ jsx(MaterialCommunityIcons, { name: "plus", size: 17, color: atMax ? C.disabled : C.inkSoft }) })
|
|
226
|
+
] });
|
|
227
|
+
}export{Banner,BigButton,Header,KeyboardButton,LiveBadge,PhaseBadge,Splash,Waiting,ZoomControl,controlLine};//# sourceMappingURL=computerControls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"computerControls.js","sources":["../../../src/features/computer/computerControls.tsx"],"sourcesContent":["/**\n * The Computer's controls - the pieces the web surface's PhoneView and\n * HandoffView share (LiveBadge, ZoomControl, KeyboardButton, the big buttons),\n * plus the header, the splash and the banners, drawn natively.\n */\nimport React, { type ReactNode } from 'react';\nimport { ActivityIndicator, Pressable, Text, View } from 'react-native';\nimport { MaterialCommunityIcons } from '@expo/vector-icons';\n\nimport { makeComputerStyles } from './computerStyles';\nimport { useComputerColors, useThemedStyles, type ComputerColors } from './computerTheme';\nimport type { PictureLane } from './LivePage';\nimport { ZOOM_STEPS, zoomLabel } from './pageZoom';\n\nexport type Phase = 'resolving' | 'absent' | 'starting' | 'ready' | 'error';\n\n/** The menu bar's word for the machine (the web's MenuBar). */\nconst PHASE_LABEL: Record<Phase, string> = {\n ready: 'Running',\n starting: 'Starting',\n error: 'Unreachable',\n resolving: 'Checking',\n absent: 'Checking',\n};\nfunction phaseDot(phase: Phase, C: ComputerColors): string {\n if (phase === 'ready') return C.live;\n if (phase === 'error') return C.danger;\n return C.waiting;\n}\n\n/** What a handoff shows while the browser is not there yet. */\nconst WAITING_TEXT: Partial<Record<Phase, string>> = {\n absent: 'Your Computer is not running right now. Ask your assistant to try again.',\n error: \"Can't reach your Computer right now. This is the connection, not the machine.\",\n};\n\n/** The line under the page: who has the browser. */\nexport function controlLine(controlling: boolean, ready = true): string {\n if (!ready) return 'Waiting for the browser';\n return controlling ? 'You have control' : 'Watching - your assistant has control';\n}\n\nexport function BigButton({\n kind,\n label,\n onPress,\n icon,\n busy = false,\n disabled = false,\n pressed: held,\n flex = false,\n}: {\n kind: 'primary' | 'secondary';\n label: string;\n onPress: () => void;\n icon?: React.ComponentProps<typeof MaterialCommunityIcons>['name'];\n busy?: boolean;\n disabled?: boolean;\n /** A toggle's state, for assistive tech. */\n pressed?: boolean;\n flex?: boolean;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const primary = kind === 'primary';\n return (\n <Pressable\n onPress={onPress}\n disabled={disabled}\n accessibilityRole=\"button\"\n accessibilityState={{ disabled, busy, ...(held !== undefined ? { selected: held } : {}) }}\n style={({ pressed }) => [\n styles.bigButton,\n flex && styles.fill,\n primary ? styles.bigPrimary : styles.bigSecondary,\n pressed && (primary ? styles.bigPrimaryPressed : styles.bigSecondaryPressed),\n disabled && primary && styles.bigDisabled,\n ]}\n >\n {busy ? <ActivityIndicator size=\"small\" color={primary ? C.accentInk : C.inkSoft} /> : null}\n {!busy && icon ? (\n <MaterialCommunityIcons name={icon} size={18} color={primary ? C.accentInk : C.inkSoft} />\n ) : null}\n <Text style={[styles.bigText, { color: primary ? C.accentInk : C.inkSoft }]}>{label}</Text>\n </Pressable>\n );\n}\n\nconst LANE_LABEL: Record<PictureLane, string> = { live: 'Live', snapshots: 'Snapshots', connecting: 'Connecting' };\n\n/**\n * Where the picture is coming from. The web says only Live or Connecting; on a\n * phone the picture can be up on the connector's snapshots with no live\n * session, and \"Connecting\" next to a page plainly showing read as stuck.\n */\nexport function LiveBadge({ ready, lane }: { ready: boolean; lane: PictureLane }) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const shown = ready ? lane : 'connecting';\n const on = shown === 'live';\n let dot: string = C.waiting;\n if (on) dot = C.live;\n else if (shown === 'snapshots') dot = C.muted;\n return (\n <View\n style={[styles.badge, { backgroundColor: on ? C.liveSoft : C.fillStrong }]}\n accessibilityHint={shown === 'snapshots' ? 'The picture updates every few seconds' : undefined}\n >\n <View style={[styles.dot, { backgroundColor: dot }]} />\n <Text style={[styles.badgeText, { color: on ? C.liveInk : C.muted }]}>{LANE_LABEL[shown]}</Text>\n </View>\n );\n}\n\nexport function PhaseBadge({ phase }: { phase: Phase }) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const label = PHASE_LABEL[phase];\n const dot = phaseDot(phase, C);\n return (\n <View style={[styles.badge, { backgroundColor: C.fillStrong }]}>\n <View style={[styles.dot, { backgroundColor: dot }]} />\n <Text style={[styles.badgeText, { color: C.muted }]}>{label}</Text>\n </View>\n );\n}\n\nexport function Header({\n onExit,\n badge,\n onOpenAgent,\n}: {\n onExit: () => void;\n badge: ReactNode;\n onOpenAgent?: () => void;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n return (\n <View style={styles.header}>\n <Pressable\n onPress={onExit}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Back\"\n hitSlop={8}\n style={styles.headerButton}\n >\n <MaterialCommunityIcons name=\"chevron-left\" size={26} color={C.inkSoft} />\n </Pressable>\n <MaterialCommunityIcons name=\"monitor\" size={17} color={C.muted} />\n <Text style={styles.headerTitle} accessibilityRole=\"header\">\n Your Computer\n </Text>\n <View style={styles.headerSpacer} />\n {badge}\n {onOpenAgent ? (\n <Pressable\n onPress={onOpenAgent}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Ask the computer\"\n style={({ pressed }) => [styles.agentChip, pressed && styles.agentChipPressed]}\n >\n <MaterialCommunityIcons name=\"creation\" size={15} color={C.accentInk} />\n <Text style={styles.agentChipText}>Ask</Text>\n </Pressable>\n ) : null}\n </View>\n );\n}\n\nexport function Splash({\n phase,\n problem,\n hasUser,\n onStart,\n onRetry,\n}: {\n phase: Phase;\n problem: string | null;\n hasUser: boolean;\n onStart: () => void;\n onRetry: () => void;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n let content: ReactNode;\n if (!hasUser || phase === 'resolving' || phase === 'starting') {\n let waiting = 'Looking for your computer…';\n if (!hasUser) waiting = 'Waiting for your account…';\n else if (phase === 'starting')\n waiting = 'Setting it up. Your files are ready; the machine boots on the first command.';\n content = (\n <View style={styles.row}>\n <ActivityIndicator size=\"small\" color={C.muted} />\n <Text style={styles.splashMuted}>{waiting}</Text>\n </View>\n );\n } else if (phase === 'error') {\n content = (\n <>\n <Text style={styles.splashTitle}>Can't reach your computer</Text>\n <Text style={styles.splashBody}>Your files are safe. This is the connection, not the machine.</Text>\n <View style={styles.splashAction}>\n <BigButton kind=\"secondary\" label=\"Try again\" onPress={onRetry} />\n </View>\n </>\n );\n } else {\n content = (\n <>\n <View style={styles.splashIcon}>\n <MaterialCommunityIcons name=\"monitor\" size={28} color={C.accent} />\n </View>\n <Text style={styles.splashTitle}>A computer of your own</Text>\n <Text style={styles.splashBody}>\n A browser, a shell and a filesystem that keep working after you close this screen.\n </Text>\n <View style={styles.splashAction}>\n <BigButton kind=\"primary\" label=\"Start your computer\" onPress={onStart} />\n </View>\n </>\n );\n }\n return (\n <View style={styles.splash}>\n <View style={styles.splashCard}>\n {content}\n {problem ? <Text style={styles.splashProblem}>{problem}</Text> : null}\n </View>\n </View>\n );\n}\n\nexport function Waiting({ phase, problem }: { phase: Phase; problem: string | null }) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const text = WAITING_TEXT[phase] ?? 'Opening your Computer…';\n return (\n <View style={styles.waiting}>\n {phase === 'resolving' || phase === 'starting' ? <ActivityIndicator size=\"small\" color={C.muted} /> : null}\n <Text style={styles.splashMuted}>{text}</Text>\n {problem ? <Text style={styles.splashProblem}>{problem}</Text> : null}\n </View>\n );\n}\n\nexport function Banner({\n tone,\n icon,\n children,\n}: {\n tone: 'ask' | 'done';\n icon: React.ComponentProps<typeof MaterialCommunityIcons>['name'];\n children: ReactNode;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const done = tone === 'done';\n return (\n <View\n style={[\n styles.banner,\n {\n borderColor: done ? C.doneBorder : C.accentBorder,\n backgroundColor: done ? C.doneSoft : C.accentSoft,\n },\n ]}\n >\n <MaterialCommunityIcons name={icon} size={19} color={done ? C.live : C.accent} style={styles.bannerIcon} />\n <View style={styles.fill}>{children}</View>\n </View>\n );\n}\n\n/** Raises the phone's keyboard for a field the page does not report (inside a captcha's frame, a canvas). */\nexport function KeyboardButton({ up, onOpen }: { up: boolean; onOpen: () => void }) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n return (\n <Pressable\n onPress={onOpen}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Keyboard\"\n accessibilityState={{ expanded: up }}\n style={({ pressed }) => [styles.smallButton, pressed && styles.smallButtonPressed]}\n >\n <MaterialCommunityIcons name=\"keyboard-outline\" size={17} color={C.inkSoft} />\n <Text style={styles.smallButtonText}>Keyboard</Text>\n </Pressable>\n );\n}\n\nexport function ZoomControl({\n step,\n disabled,\n onChange,\n}: {\n step: number;\n disabled: boolean;\n onChange: (step: number) => void;\n}) {\n const C = useComputerColors();\n const styles = useThemedStyles(makeComputerStyles);\n const atMin = disabled || step === 0;\n const atMax = disabled || step === ZOOM_STEPS.length - 1;\n return (\n <View style={styles.zoom}>\n <Pressable\n onPress={() => onChange(step - 1)}\n disabled={atMin}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Zoom out\"\n style={styles.zoomButton}\n >\n <MaterialCommunityIcons name=\"minus\" size={17} color={atMin ? C.disabled : C.inkSoft} />\n </Pressable>\n <Text style={styles.zoomLabel} accessibilityLiveRegion=\"polite\">\n {zoomLabel(ZOOM_STEPS[step])}\n </Text>\n <Pressable\n onPress={() => onChange(step + 1)}\n disabled={atMax}\n accessibilityRole=\"button\"\n accessibilityLabel=\"Zoom in\"\n style={styles.zoomButton}\n >\n <MaterialCommunityIcons name=\"plus\" size={17} color={atMax ? C.disabled : C.inkSoft} />\n </Pressable>\n </View>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,MAAM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