export type DisplayServer = 'darwin' | 'win32' | 'x11' | 'wayland' | 'unknown'; export declare function assertDisplayServer(value: DisplayServer): void; export interface ComputerUseCapabilities { readonly displayServer: DisplayServer; readonly screenshot: boolean; readonly mouse: boolean; readonly keyboard: boolean; readonly cursorPosition: boolean; readonly clipboard: boolean; /** Exact action subset when known. Refines the broad flags; absent retains their legacy interpretation. */ readonly supportedActions?: readonly ComputerUseAction['type'][]; /** Supported click buttons; absent leaves button admission to the host. */ readonly mouseClickButtons?: readonly MouseButton[]; /** Supported drag buttons; absent leaves button admission to the host. */ readonly mouseDragButtons?: readonly MouseButton[]; /** * Why every flag above is false, when a host loaded but the desktop did * not answer — a WSL process with PowerShell and no interactive Windows * session, an ssh session with no display. Present, the tool stays * mounted and says this in its description and in every refusal, so the * model reads the reason once and does not try again. */ readonly unavailableReason?: string; } export interface DisplayGeometry { readonly width: number; readonly height: number; readonly scaleFactor: number; } export interface ScreenshotResult { readonly data: Buffer; readonly mimeType: 'image/png'; readonly width: number; readonly height: number; } export interface Point { readonly x: number; readonly y: number; } export type MouseButton = 'left' | 'right' | 'middle'; export type ScrollDirection = 'up' | 'down' | 'left' | 'right'; export type ComputerUseAction = { readonly type: 'screenshot'; } | { readonly type: 'cursor_position'; } | { readonly type: 'mouse_move'; readonly to: Point; } | { readonly type: 'mouse_click'; readonly at: Point; readonly button: MouseButton; } | { readonly type: 'mouse_drag'; readonly from: Point; readonly to: Point; readonly button: MouseButton; } | { readonly type: 'scroll'; readonly at: Point; readonly direction: ScrollDirection; readonly amount: number; } | { readonly type: 'type_text'; readonly text: string; } | { readonly type: 'key'; readonly keys: string; }; export declare function assertComputerUseActionType(type: ComputerUseAction['type']): void; export type ComputerUseResult = { readonly type: 'screenshot'; readonly result: ScreenshotResult; } | { readonly type: 'cursor_position'; readonly point: Point; } | { readonly type: 'ok'; }; /** * A state-changing desktop action started, but its subprocess did not report * a clean completion. The desktop may already have changed, so treating this * as an ordinary failure and automatically replaying the action is unsafe. * * Host packages throw an error carrying this shape. The SDK recognises it * structurally so separately installed host and SDK versions do not need to * share an error constructor identity. */ export interface ComputerUseOutcomeUnknown { readonly code: 'computer_use_outcome_unknown'; readonly action: ComputerUseAction['type']; readonly outcome: 'unknown'; readonly retrySafety: 'unsafe'; readonly timedOut: boolean; readonly exitCode: number; readonly message: string; } export interface ComputerUseHost { readonly id: string; readonly capabilities: ComputerUseCapabilities; getDisplayGeometry(): Promise; execute(action: ComputerUseAction): Promise; initialize?(): Promise; dispose?(): Promise; } //# sourceMappingURL=index.d.ts.map