import { z } from 'zod'; import { ComputerAppSchema, ComputerWindowSchema } from '@xopcai/computer-control-contract'; import type { EndpointToolRuntime } from '../endpoint-tools/runtime.js'; import type { Config } from '../config/schema.js'; import { type ComputerServiceLimits } from './model-policy.js'; import { computerFlowMetadata, type ComputerFlowRepository } from './flows.js'; import { type ComputerNativeTiming, type ComputerSessionReport } from './diagnostics.js'; import { ComputerDiagnosticSchema } from './errors.js'; import { type ComputerScreenshotRegion } from './screenshot-region.js'; import { type ComputerVerification } from './task-state.js'; declare const Reply: z.ZodObject<{ status: z.ZodEnum<{ ready: "ready"; paused: "paused"; running: "running"; stopped: "stopped"; pending_authorization: "pending_authorization"; pending_action: "pending_action"; }>; sessionId: z.ZodString; brokerEpoch: z.ZodString; generation: z.ZodNumber; grantId: z.ZodOptional; observation: z.ZodOptional; capturedAt: z.ZodNumber; imageWidth: z.ZodNumber; imageHeight: z.ZodNumber; summary: z.ZodString; focusedEditableRef: z.ZodOptional; stateDigest: z.ZodString; }, z.core.$strict>>; nativeMs: z.ZodOptional; sdkCallMs: z.ZodNumber; resultValidationMs: z.ZodNumber; renderGraceMs: z.ZodNumber; unattributedMs: z.ZodNumber; sdkCalls: z.ZodNumber; completed: z.ZodBoolean; }, z.core.$strict>>; precheckSamples: z.ZodOptional; }, z.core.$strict>>; transportTiming: z.ZodOptional; commandWallMs: z.ZodNumber; }, z.core.$strict>>; errorCode: z.ZodOptional; diagnostic: z.ZodOptional; diagnosticId: z.ZodUUID; validationReason: z.ZodOptional>; validation: z.ZodOptional; stage: z.ZodEnum<{ plan: "plan"; schema: "schema"; converted_action: "converted_action"; typing_target: "typing_target"; keyboard: "keyboard"; }>; issues: z.ZodArray, z.ZodNumber]>>; code: z.ZodEnum<{ custom: "custom"; invalid_type: "invalid_type"; unrecognized_keys: "unrecognized_keys"; invalid_union: "invalid_union"; invalid_value: "invalid_value"; invalid_format: "invalid_format"; too_big: "too_big"; too_small: "too_small"; not_multiple_of: "not_multiple_of"; missing_point: "missing_point"; outside_frame: "outside_frame"; editable_target_missing: "editable_target_missing"; editable_target_ambiguous: "editable_target_ambiguous"; invalid_context: "invalid_context"; unsupported_key: "unsupported_key"; plan_not_grounded: "plan_not_grounded"; }>; action: z.ZodEnum<{ type: "type"; key: "key"; unknown: "unknown"; answer: "answer"; wait: "wait"; batch: "batch"; terminate: "terminate"; activate: "activate"; showMenu: "showMenu"; click: "click"; drag: "drag"; setValue: "setValue"; typeText: "typeText"; pressKeys: "pressKeys"; scroll: "scroll"; activateSequence: "activateSequence"; finished: "finished"; button_plan: "button_plan"; activate_sequence: "activate_sequence"; show_menu: "show_menu"; set_value: "set_value"; left_click: "left_click"; right_click: "right_click"; double_click: "double_click"; hscroll: "hscroll"; interact: "interact"; takeover: "takeover"; }>; }, z.core.$strict>>; }, z.core.$strict>>; stability: z.ZodOptional; samples: z.ZodNumber; action: z.ZodOptional>; changes: z.ZodArray>; changedElementIndices: z.ZodArray; }, z.core.$strict>>; httpStatus: z.ZodOptional; requestId: z.ZodOptional; serviceErrorCode: z.ZodOptional>; }, z.core.$strict>>; apps: z.ZodOptional>>; windows: z.ZodOptional>>; receipt: z.ZodOptional; steps: z.ZodOptional; }, z.core.$strict>>>; dispatch: z.ZodEnum<{ unknown: "unknown"; completed: "completed"; started: "started"; notStarted: "notStarted"; }>; outcome: z.ZodEnum<{ unknown: "unknown"; applied: "applied"; notApplied: "notApplied"; }>; verification: z.ZodEnum<{ none: "none"; artifact: "artifact"; semantic: "semantic"; visual: "visual"; }>; errorCode: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strict>; export declare const ComputerUseInputSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ op: z.ZodLiteral<"discover">; query: z.ZodString; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"open">; appRef: z.ZodString; windowRef: z.ZodOptional; mode: z.ZodEnum<{ observe: "observe"; control: "control"; }>; prepare: z.ZodBoolean; planner: z.ZodOptional>; inspect: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"observe">; question: z.ZodOptional; expect: z.ZodOptional; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"field">; label: z.ZodString; value: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"selected">; label: z.ZodString; }, z.core.$strict>], "kind">>; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"step">; goal: z.ZodString; expect: z.ZodOptional; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"field">; label: z.ZodString; value: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"selected">; label: z.ZodString; }, z.core.$strict>], "kind">>; flowId: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"exec">; code: z.ZodString; maxActions: z.ZodOptional; timeoutMs: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"run">; goal: z.ZodString; expect: z.ZodDiscriminatedUnion<[z.ZodObject<{ kind: z.ZodLiteral<"text">; text: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"field">; label: z.ZodString; value: z.ZodString; }, z.core.$strict>, z.ZodObject<{ kind: z.ZodLiteral<"selected">; label: z.ZodString; }, z.core.$strict>], "kind">; maxActions: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"close">; saveFlowAs: z.ZodOptional; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"flows">; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"forget_flow">; flowId: z.ZodUUID; }, z.core.$strict>, z.ZodObject<{ op: z.ZodLiteral<"report">; }, z.core.$strict>], "op">; export type ComputerUseInput = z.infer; export interface ComputerPublicResult { status: string; sessionId: string; output?: string; scriptError?: string; scriptErrorMessage?: string; imageRef?: string; pending?: boolean; summary?: string; imageKind?: 'before_after' | 'region'; imageRegion?: ComputerScreenshotRegion; receipts?: Array['receipt']>>; receipt?: z.infer['receipt']; claimedSuccess?: boolean; verified?: boolean; verification?: ComputerVerification; budget?: { actionsRemaining: number; modelRequestsRemaining: number; rescuesRemaining: number; expiresAt: number; serviceLimits?: ComputerServiceLimits; }; handoff?: { recentActions: Array<{ goal: string; action: string; dispatch: string; outcome: string; verification?: ComputerVerification; }>; }; observation?: { id: string; width: number; height: number; }; errorCode?: string; diagnostic?: z.infer; nextAction?: string; apps?: z.infer[]; windows?: z.infer[]; reportId?: string; report?: ComputerSessionReport; flows?: ReturnType[]; savedFlow?: ReturnType; run?: { actionsExecuted: number; modelRequests: number; observationsReused: number; stabilityObservations: number; elapsedMs: number; phaseMs: ComputerSessionReport['phaseMs']; nativeMs: ComputerNativeTiming; stopReason: 'condition_satisfied' | 'condition_present' | 'action_limit' | 'time_limit' | 'handoff'; }; } export declare class ComputerRuntime { private readonly endpoints; private readonly getConfig; private readonly getTurnEndpoint?; private readonly flowStore; private readonly sessions; private readonly operations; private readonly reports; private readonly openingReports; constructor(endpoints: EndpointToolRuntime, getConfig: () => Config, getTurnEndpoint?: ((owner: string) => string | undefined) | undefined, flowStore?: ComputerFlowRepository); execute(owner: string, input: ComputerUseInput, signal?: AbortSignal, execution?: { toolCallId: string; }): Promise; private flowScope; private executeProgram; private executeGoal; private executeInput; private isUndispatchedChange; private reserveRescue; private dispatchAction; private budget; private present; private resolveEndpoint; private assertTarget; private requiresGatewayCapability; private send; private forget; close(owner: string): Promise; private verifiedRemoteStop; getReport(owner: string): ComputerSessionReport | undefined; private retainReport; private pruneReports; shutdown(): Promise; } export {};