import { z } from 'zod'; import { type ComputerProfile } from '@xopcai/computer-control-contract'; import type { ComputerHistoryEntry, ComputerExpectation } from './task-state.js'; import { ComputerDiagnosticSchema } from './errors.js'; export declare const ComputerProposalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"action">; action: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"click">; point: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strict>; button: z.ZodEnum<{ left: "left"; right: "right"; }>; count: z.ZodUnion, z.ZodLiteral<2>]>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"drag">; from: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strict>; to: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strict>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"setValue">; ref: z.ZodString; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"typeText">; text: z.ZodString; point: z.ZodOptional>; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"pressKeys">; keys: z.ZodArray; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"scroll">; point: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strict>; deltaX: z.ZodNumber; deltaY: z.ZodNumber; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"wait">; durationMs: z.ZodNumber; }, z.core.$strict>], "kind">; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"finished">; claimedSuccess: z.ZodBoolean; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"answer">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"takeover">; reason: z.ZodString; }, z.core.$strict>], "kind">; export type ComputerProposal = z.infer; export declare const GUI_PLUS_SYSTEM_PROMPT: string; export declare const GUI_PLUS_OBSERVATION_PROMPT: string; export declare function parseGuiPlusProposal(content: string, width: number, height: number): ComputerProposal; type ValidationReason = NonNullable['validationReason']>; export interface ComputerModelConnection { modelId: string; baseUrl: string; apiKey: string; profile: ComputerProfile; deploymentRevision?: string; maxOutputTokens?: number; headers?: Record; } export interface ComputerPredictionInput { goal: string; image: Uint8Array; mimeType: 'image/png' | 'image/jpeg'; width: number; height: number; summary: string; stateDigest?: string; formatCorrection?: boolean; validationReason?: ValidationReason; correctionReply?: string; readOnly?: boolean; history?: readonly ComputerHistoryEntry[]; expectation?: ComputerExpectation; } export interface ComputerStepAdapter { readonly supportsFormatRetry?: boolean; predict(input: ComputerPredictionInput, signal?: AbortSignal): Promise; reset?(): void; } /** One format-only re-prediction is safe before any input has been proposed or dispatched. */ export declare function predictComputerStep(adapter: ComputerStepAdapter, input: ComputerPredictionInput, reserveAttempt: () => void, signal?: AbortSignal): Promise; export declare function readComputerJson(response: Response, maxBytes: number): Promise; /** A frozen single-recipient connection; never retries, redirects or changes billing sources. */ export declare class ChatCompletionsComputerAdapter implements ComputerStepAdapter { private readonly fetchImpl; private readonly connection; constructor(connection: ComputerModelConnection, fetchImpl?: typeof fetch); predict(input: ComputerPredictionInput, signal?: AbortSignal): Promise; } /** Native Responses Computer tool adapter. Execution remains exclusively in the local broker. */ export declare class OpenAIResponsesComputerAdapter implements ComputerStepAdapter { private readonly fetchImpl; readonly supportsFormatRetry = false; private readonly connection; private responseId?; private callId?; private queued; private awaitingAction?; private batchGoal?; constructor(connection: ComputerModelConnection, fetchImpl?: typeof fetch); predict(input: ComputerPredictionInput, signal?: AbortSignal): Promise; private observe; private nextQueued; private mapActions; reset(): void; private resetTurn; } export declare function createComputerModelAdapter(connection: ComputerModelConnection, fetchImpl?: typeof fetch): ComputerStepAdapter; export {};