import { z } from "zod"; import type { DirectMethod, DirectToolArguments, JsonObject, JsonValue } from "./tools.ts"; declare const elicitationRequestSchema: z.ZodObject<{ mode: z.ZodOptional; message: z.ZodOptional; requestedSchema: z.ZodOptional; url: z.ZodOptional; elicitationId: z.ZodOptional; _meta: z.ZodOptional; }, z.core.$catchall>; export type DirectBrokerElicitationRequest = z.infer; export interface DirectBrokerElicitationResponse { action: "accept" | "decline" | "cancel"; content?: JsonValue; _meta?: JsonValue; } export interface DirectBrokerResult { content: JsonObject[]; structuredContent?: JsonValue; isError: boolean; brokerVersion: string; clientBuild: string; elicitationRequests: number; modelTurnsStarted: 0; ephemeralThread: true; brokerCleanupVerified: boolean; } export interface DirectBrokerOptions { timeoutMs?: number; signal?: AbortSignal; onElicitation?: (request: DirectBrokerElicitationRequest) => DirectBrokerElicitationResponse | Promise; supportsOpenAiFormElicitation?: boolean; /** Test-only executable override. Production callers never set this. */ appServerCommand?: string; /** Test-only argument override. */ appServerArgs?: string[]; /** Test-only signature bypass. */ skipSignatureVerification?: boolean; /** Test-only process-enumerator override. */ processEnumeratorCommand?: string; onSpawn?: (pid: number) => void; } export declare class DirectBrokerCallError extends Error { readonly cleanupVerified: boolean; readonly directCalls: number; readonly modelTurnsStarted: number; readonly ephemeralThread: boolean; readonly elicitationRequests: number; readonly brokerVersion: string; readonly clientBuild: string; constructor(message: string, cleanupVerified: boolean, cause?: unknown, evidence?: { directCalls?: number; modelTurnsStarted?: number; ephemeralThread?: boolean; elicitationRequests?: number; brokerVersion?: string; clientBuild?: string; }); } interface CommandResult { status: number | null; stdout?: string; stderr?: string; } type RunSync = (command: string, args: string[]) => CommandResult; export interface OfficialComputerUseClient { clientPath: string; appPath: string; layout: "installed-component" | "legacy-plugin-bundle"; } interface ResolveOfficialComputerUseClientOptions { /** Test-only OS-account home override. Production never reads HOME or CODEX_HOME. */ userHome?: string; /** Test-only legacy root override. */ legacyPluginRoot?: string; runSync?: RunSync; } /** Resolve only the two reviewed official layouts, preferring ChatGPT's current installed-component contract. */ export declare function resolveOfficialComputerUseClient(options?: ResolveOfficialComputerUseClientOptions): OfficialComputerUseClient; export declare function verifyOfficialDirectBroker(options?: ResolveOfficialComputerUseClientOptions): { brokerVersion: string; clientBuild: string; client: OfficialComputerUseClient; }; export declare function buildDirectAppServerArgs(mcpCwd?: string, clientPath?: string): string[]; export interface OfficialDirectToolSession { call(method: DirectMethod, args: DirectToolArguments, options?: Pick): Promise; close(): Promise; } export declare function createOfficialDirectToolSession(options?: DirectBrokerOptions): Promise; export declare function callOfficialDirectTool(method: DirectMethod, args: DirectToolArguments, options?: DirectBrokerOptions): Promise; export {};