interface TunnelClientConfig { apiUrl: string; token: string; tunnelId?: string; cacheTtlMs?: number; } declare class TunnelClientError extends Error { readonly code: number; readonly requestId?: string | undefined; readonly isPermissionRequest: boolean; constructor(code: number, message: string, requestId?: string | undefined, isPermissionRequest?: boolean); } declare class TunnelClient { private apiUrl; private token; private explicitTunnelId; private cachedTunnelId; private cacheTimestamp; private cacheTtlMs; readonly fs: FsNamespace; readonly shell: ShellNamespace; readonly desktop: DesktopNamespace; constructor(config: TunnelClientConfig); rpc(method: string, params?: Record): Promise; rpcWithPermissionFlow(method: string, params?: Record): Promise; getConnections(): Promise>>; resolveTunnelId(): Promise; } declare class FsNamespace { private client; constructor(client: TunnelClient); read(path: string, encoding?: string): Promise<{ content: string; size: number; path: string; }>; write(path: string, content: string, encoding?: string): Promise<{ path: string; size: number; }>; list(path: string, recursive?: boolean): Promise<{ entries: Array<{ name: string; path: string; isDirectory: boolean; isFile: boolean; }>; count: number; }>; stat(path: string): Promise>; delete(path: string): Promise>; } declare class ShellNamespace { private client; constructor(client: TunnelClient); exec(command: string, args?: string[], options?: { cwd?: string; timeout?: number; }): Promise<{ exitCode: number | null; signal: string | null; stdout: string; stderr: string; stdoutTruncated: boolean; stderrTruncated: boolean; }>; } declare class DesktopNamespace { private client; constructor(client: TunnelClient); screenshot(params?: { region?: { x: number; y: number; width: number; height: number; }; windowId?: number; }): Promise<{ image: string; width: number; height: number; format?: string; }>; click(params: { x: number; y: number; button?: string; clicks?: number; modifiers?: string[]; }): Promise; type(text: string, delay?: number): Promise; key(keys: string[]): Promise; mouseMove(x: number, y: number): Promise; mouseDrag(fromX: number, fromY: number, toX: number, toY: number, button?: string): Promise; mouseScroll(x: number, y: number, deltaX?: number, deltaY?: number): Promise; windowList(): Promise<{ windows: Array<{ id: number; app: string; title: string; bounds: { x: number; y: number; width: number; height: number; }; minimized: boolean; }>; }>; windowFocus(windowId: number): Promise; appLaunch(app: string): Promise; appQuit(app: string): Promise; clipboardRead(): Promise<{ text: string; }>; clipboardWrite(text: string): Promise; screenInfo(): Promise<{ width: number; height: number; scaleFactor: number; }>; cursorImage(radius?: number): Promise<{ image: string; width: number; height: number; format?: string; }>; axTree(params?: { pid?: number; maxDepth?: number; roles?: string[]; }): Promise<{ root: AXElement; elementCount: number; }>; axAction(elementId: string, action: string, pid?: number): Promise>; axSetValue(elementId: string, value: string, pid?: number): Promise>; axFocus(elementId: string, pid?: number): Promise>; axSearch(query: string, params?: { role?: string; pid?: number; maxResults?: number; }): Promise<{ elements: AXElement[]; }>; } interface AXElement { id: string; role: string; title: string; value: string; description: string; bounds: { x: number; y: number; width: number; height: number; }; children: AXElement[]; actions: string[]; enabled: boolean; focused: boolean; } interface TunnelToolParameter { type: string; description: string; required?: boolean; items?: { type: string; }; enum?: string[]; } interface TunnelToolDefinition { name: string; description: string; parameters: Record; execute: (args: Record) => Promise; } declare function createTunnelTools(client: TunnelClient): TunnelToolDefinition[]; export { type AXElement, TunnelClient, type TunnelClientConfig, TunnelClientError, type TunnelToolDefinition, type TunnelToolParameter, createTunnelTools };