import { LucideIcon } from 'lucide-react'; type EditorState = 'idle' | 'checking' | 'installing' | 'starting' | 'ready' | 'error'; export interface BrowserEditorLauncherOptions { /** * Agent ID — F4 Wave B replaced the direct browser fetch (which relied * on `agentApiKey` headers) with svc-mediated `agentCodeServer*` * mutations. The agent's tunnel URL is still used for the iframe `src`, * but every control-plane call now routes through the gateway. */ agentId: string | null; /** Agent tunnel URL (e.g. "https://xxx.trycloudflare.com") */ tunnelUrl: string | null; /** * Canonical CLI profile name on the remote agent. Maps to the * `/api/profiles//code-server/...` URL prefix. */ profile: string; /** Directory to open as workspace root. Defaults to agent home if not set. */ workspacePath?: string; /** How to open — new browser tab or call back with URL for iframe embedding */ mode?: 'newtab' | 'iframe'; /** Called with the ready URL when mode is 'iframe' */ onIframeUrl?: (url: string) => void; } export interface OpenInBrowserEditorButtonProps extends BrowserEditorLauncherOptions { /** Additional CSS class names */ className?: string; } export interface BrowserEditorLauncher { /** Probe → start → mint → open. MUST be called inside a user gesture * (click / menu select) so the pre-opened tab survives popup blockers. */ launch: () => Promise; state: EditorState; errorMsg: string | null; dismissError: () => void; label: string; Icon: LucideIcon; isSpinning: boolean; isDisabled: boolean; } /** * State machine + control-plane flow for opening the browser-hosted * code-server. Extracted from the button so menu items (Radix * DropdownMenuItem) can trigger the identical flow with full keyboard * support while the standalone button keeps its inline presentation. */ export declare function useBrowserEditorLauncher({ agentId, tunnelUrl, profile, workspacePath, mode, onIframeUrl, }: BrowserEditorLauncherOptions): BrowserEditorLauncher; export declare function OpenInBrowserEditorButton({ agentId, tunnelUrl, profile, workspacePath, mode, onIframeUrl, className, }: OpenInBrowserEditorButtonProps): import('react').JSX.Element; export {};