import type { AgentTool, AgentToolContext, AgentToolResult, AgentToolUpdateCallback } from "@gajae-code/agent-core"; import * as z from "zod/v4"; export { isComputerCallable, isComputerEnabled, isComputerLoadablePlatform, isComputerSupportedPlatform, setComputerArchForTests, setComputerPlatformForTests, } from "./computer-policy"; import type { ToolSession } from "./index"; import type { OutputMeta } from "./output-meta"; export declare const singleComputerSchema: z.ZodDiscriminatedUnion; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"screenshot">; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"drag">; x: z.ZodNumber; y: z.ZodNumber; to_x: z.ZodNumber; to_y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"wait">; ms: z.ZodNumber; }, z.core.$strict>], "action">; export declare const computerSchema: z.ZodUnion; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"screenshot">; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"drag">; x: z.ZodNumber; y: z.ZodNumber; to_x: z.ZodNumber; to_y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"wait">; ms: z.ZodNumber; }, z.core.$strict>], "action">, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"batch">; actions: z.ZodArray; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"screenshot">; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"drag">; x: z.ZodNumber; y: z.ZodNumber; to_x: z.ZodNumber; to_y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"wait">; ms: z.ZodNumber; }, z.core.$strict>], "action">>; }, z.core.$strict>]>; export type SingleComputerParams = z.infer; export type ComputerParams = z.infer; export type ComputerActionName = ComputerParams["action"]; export interface ComputerScreenshotDetails { widthPx: number; heightPx: number; scaleX?: number; scaleY?: number; originX?: number; originY?: number; displayEpoch?: number; captureId?: number; pngBytes?: number; path?: string; } export interface ComputerToolDetails { action: ComputerActionName; status: "success" | "disabled" | "error"; code?: string; message?: string; x?: number; y?: number; toX?: number; toY?: number; scrollX?: number; scrollY?: number; button?: string; keys?: string[]; ms?: number; screenshot?: ComputerScreenshotDetails; primaryError?: { code: string; message: string; }; supervisor?: string; steps?: ComputerToolDetails[]; meta?: OutputMeta; } type NativeBatchAction = { action: "screenshot" | "click" | "double_click" | "move" | "drag" | "scroll" | "type" | "keypress" | "wait"; x?: number; y?: number; toX?: number; toY?: number; scrollX?: number; scrollY?: number; button?: string; text?: string; keys?: string[]; ms?: number; timeoutMs?: number; timeoutGroup?: number; }; type NativeBatchStepResult = { index: number; action: string; screenshot?: NativeScreenshot; }; type NativeBatchResult = { results: NativeBatchStepResult[]; failureCode?: string; failureIndex?: number; failureMessage?: string; primaryFailureCode?: string; primaryFailureMessage?: string; }; type NativeController = { executeBatch?: (expectedEpoch: number | undefined, actions: NativeBatchAction[], timeoutMs?: number, signal?: AbortSignal) => Promise | NativeBatchResult; screenshot?: () => Promise | NativeScreenshot; click?: (expectedEpoch: number | undefined, x: number, y: number, button?: string) => void; doubleClick?: (expectedEpoch: number | undefined, x: number, y: number, button?: string) => void; move?: (expectedEpoch: number | undefined, x: number, y: number) => void; drag?: (expectedEpoch: number | undefined, x: number, y: number, toX: number, toY: number, button?: string) => void; scroll?: (expectedEpoch: number | undefined, x: number, y: number, scrollX: number, scrollY: number) => void; type?: (expectedEpoch: number | undefined, text: string) => void; keypress?: (expectedEpoch: number | undefined, keys: string[]) => void; wait?: (expectedEpoch: number | undefined, ms: number) => void; }; type NativeScreenshot = { png?: Uint8Array | Buffer | ArrayBuffer | string; widthPx?: number; heightPx?: number; scaleX?: number; scaleY?: number; originX?: number; originY?: number; displayEpoch?: number; captureId?: number; }; export type ComputerControllerFactory = () => NativeController; export declare const COMPUTER_DISABLED_CODE = "COMPUTER_DISABLED"; export declare function setComputerControllerFactoryForTests(factory: ComputerControllerFactory | undefined): void; export declare class ComputerTool implements AgentTool { #private; private readonly session; readonly name = "computer"; readonly label = "Computer"; readonly loadMode = "discoverable"; readonly summary = "Control the macOS desktop (Apple Silicon) with screenshot, pointer, keyboard, scroll, and wait actions; available by default on supported hosts and supervisor-gated"; readonly parameters: z.ZodUnion; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"screenshot">; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"drag">; x: z.ZodNumber; y: z.ZodNumber; to_x: z.ZodNumber; to_y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"wait">; ms: z.ZodNumber; }, z.core.$strict>], "action">, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"batch">; actions: z.ZodArray; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"screenshot">; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"double_click">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"move">; x: z.ZodNumber; y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"drag">; x: z.ZodNumber; y: z.ZodNumber; to_x: z.ZodNumber; to_y: z.ZodNumber; button: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"scroll">; x: z.ZodNumber; y: z.ZodNumber; scroll_x: z.ZodNumber; scroll_y: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"type">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"keypress">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ timeout: z.ZodOptional; include_screenshot: z.ZodOptional; action: z.ZodLiteral<"wait">; ms: z.ZodNumber; }, z.core.$strict>], "action">>; }, z.core.$strict>]>; readonly strict = true; constructor(session: ToolSession); static createIf(session: ToolSession): ComputerTool | null; get description(): string; execute(_toolCallId: string, params: ComputerParams, signal?: AbortSignal, _onUpdate?: AgentToolUpdateCallback, _ctx?: AgentToolContext): Promise>; }