import { z } from 'zod'; import { type ComputerAction, type ComputerObservation, type ComputerReceipt } from '@xopcai/computer-control-contract'; import type { ComputerVerification } from './task-state.js'; export declare const ComputerFailurePhaseSchema: z.ZodEnum<{ open: "open"; dispatch: "dispatch"; model: "model"; executor: "executor"; observe: "observe"; release: "release"; frame_upload: "frame_upload"; oracle: "oracle"; }>; export type ComputerFailurePhase = z.infer; export declare const ComputerFailureCategorySchema: z.ZodEnum<{ permission: "permission"; target: "target"; unknown: "unknown"; cancelled: "cancelled"; model: "model"; observation: "observation"; transport: "transport"; native: "native"; budget: "budget"; no_progress: "no_progress"; harness: "harness"; }>; export declare const ComputerFailureSchema: z.ZodObject<{ category: z.ZodEnum<{ permission: "permission"; target: "target"; unknown: "unknown"; cancelled: "cancelled"; model: "model"; observation: "observation"; transport: "transport"; native: "native"; budget: "budget"; no_progress: "no_progress"; harness: "harness"; }>; phase: z.ZodEnum<{ open: "open"; dispatch: "dispatch"; model: "model"; executor: "executor"; observe: "observe"; release: "release"; frame_upload: "frame_upload"; oracle: "oracle"; }>; errorCode: z.ZodString; dispatch: z.ZodEnum<{ unknown: "unknown"; completed: "completed"; started: "started"; notStarted: "notStarted"; }>; diagnosticId: z.ZodOptional; httpStatus: z.ZodOptional; requestId: z.ZodOptional; 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>>; serviceErrorCode: z.ZodOptional>; }, z.core.$strict>; export type ComputerFailure = z.infer; /** Unknown exception prose and arbitrary code-like strings never become report data. */ export declare function classifyComputerFailure(error: unknown, phase: ComputerFailurePhase, dispatch?: ComputerFailure['dispatch'], aborted?: boolean): ComputerFailure; export declare const ComputerNativeTimingSchema: z.ZodObject<{ precheckMs: z.ZodNumber; inputMs: z.ZodNumber; postObserveMs: z.ZodNumber; inputDetail: 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>; export type ComputerNativeTiming = z.infer; export declare const ComputerSessionReportSchema: z.ZodObject<{ version: z.ZodLiteral<1>; reportId: z.ZodUUID; sessionId: z.ZodOptional; status: z.ZodEnum<{ active: "active"; released: "released"; release_unconfirmed: "release_unconfirmed"; }>; startedAt: z.ZodNumber; durationMs: z.ZodNumber; counters: z.ZodObject<{ observations: z.ZodNumber; predictionAttempts: z.ZodNumber; modelRequests: z.ZodNumber; proposedInputs: z.ZodNumber; completedInputs: z.ZodNumber; unknownDispatches: z.ZodNumber; unchangedInputs: z.ZodNumber; observationChanges: z.ZodNumber; rescueAttempts: z.ZodNumber; rescueExhaustions: z.ZodNumber; takeovers: z.ZodNumber; successClaims: z.ZodNumber; verifiedConditions: z.ZodNumber; }, z.core.$strict>; phaseMs: z.ZodObject<{ open: z.ZodNumber; observe: z.ZodNumber; model: z.ZodNumber; dispatch: z.ZodNumber; release: z.ZodNumber; }, z.core.$strict>; failure: z.ZodOptional; phase: z.ZodEnum<{ open: "open"; dispatch: "dispatch"; model: "model"; executor: "executor"; observe: "observe"; release: "release"; frame_upload: "frame_upload"; oracle: "oracle"; }>; errorCode: z.ZodString; dispatch: z.ZodEnum<{ unknown: "unknown"; completed: "completed"; started: "started"; notStarted: "notStarted"; }>; diagnosticId: z.ZodOptional; httpStatus: z.ZodOptional; requestId: z.ZodOptional; 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>>; serviceErrorCode: z.ZodOptional>; }, z.core.$strict>>; timings: 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>>; kind: z.ZodOptional>; transport: z.ZodOptional; commandWallMs: z.ZodNumber; }, z.core.$strict>>; endpointRoundTripMs: z.ZodNumber; }, z.core.$strict>>>; timingsTruncated: z.ZodOptional; recentActions: z.ZodArray; dispatch: z.ZodEnum<{ unknown: "unknown"; completed: "completed"; started: "started"; notStarted: "notStarted"; }>; outcome: z.ZodEnum<{ unknown: "unknown"; applied: "applied"; notApplied: "notApplied"; }>; unchanged: z.ZodBoolean; condition: z.ZodOptional>; }, z.core.$strict>>; }, z.core.$strict>; export type ComputerSessionReport = z.infer; /** A bounded metadata-only companion to task history; it never retains action arguments or pixels. */ export declare class ComputerSessionDiagnostics { private readonly now; private readonly durationNow; private readonly data; private readonly receipts; private pending?; private endedAt?; phase: ComputerFailurePhase; constructor(now?: () => number, durationNow?: () => number); bind(sessionId: string): void; count(key: keyof ComputerSessionReport['counters']): void; timing(value: NonNullable[number]): void; measure(phase: keyof ComputerSessionReport['phaseMs'], fn: () => Promise): Promise; propose(id: string, kind: ComputerAction['kind'], inputCount?: number): void; discard(): void; record(receipt: ComputerReceipt, before?: ComputerObservation, after?: ComputerObservation, verification?: ComputerVerification): void; verify(verification?: ComputerVerification): void; fail(error: unknown, phase?: "open" | "dispatch" | "model" | "executor" | "observe" | "release" | "frame_upload" | "oracle", dispatch?: ComputerFailure['dispatch'], aborted?: boolean): void; finish(released: boolean): void; snapshot(): ComputerSessionReport; }