import { Type, type Static } from "typebox"; /** * JSON Schemas for the file protocol between Fabric and a worker process * (custom worker runners). Paths come from the launch context `files`. * Readers ignore unknown fields, so writers may add their own. */ export declare const FABRIC_WORKER_PROTOCOL_VERSION: 1; /** `statusFile`: the worker atomically replaces this record (write temp, rename). */ export declare const AgentRunRecordSchema: Type.TObject<{ id: Type.TString; name: Type.TString; task: Type.TString; status: Type.TUnion<[Type.TLiteral<"queued">, Type.TLiteral<"running">, Type.TLiteral<"completed">, Type.TLiteral<"failed">, Type.TLiteral<"stopped">, Type.TLiteral<"timed_out">]>; runner: Type.TString; transport: Type.TString; cwd: Type.TString; startedAt: Type.TNumber; updatedAt: Type.TNumber; finishedAt: Type.TOptional; turns: Type.TInteger; toolCalls: Type.TInteger; /** Latest assistant text; the final answer once completed. */ text: Type.TString; /** Structured result when the run had a schema. */ value: Type.TOptional; error: Type.TOptional; usage: Type.TObject<{ input: Type.TNumber; output: Type.TNumber; cacheRead: Type.TNumber; cacheWrite: Type.TNumber; cost: Type.TNumber; }>; model: Type.TOptional; thinking: Type.TOptional; currentTool: Type.TOptional; runnerSessionId: Type.TOptional; /** Set while a routed dialog waits for an answer. */ blockedOn: Type.TOptional; }>>; /** Hosted runs only. */ hosted: Type.TOptional>; sleeping: Type.TOptional>; outcome: Type.TOptional>; retryable: Type.TOptional; }>; export type AgentRunRecordWire = Static; /** `lifecycleFile`: one JSON object per line, appended. */ export declare const LifecycleLineSchema: Type.TUnion<[Type.TObject<{ version: Type.TLiteral<1>; event: Type.TLiteral<"tokens.usage">; occurredAt: Type.TNumber; /** Per-event increase, never a running total. */ data: Type.TObject<{ runId: Type.TString; name: Type.TString; runner: Type.TString; depth: Type.TInteger; actorId: Type.TOptional; actorName: Type.TOptional; cumulativeTokens: Type.TNumber; input: Type.TNumber; output: Type.TNumber; cacheRead: Type.TNumber; cacheWrite: Type.TNumber; cost: Type.TNumber; }>; }>, Type.TObject<{ version: Type.TLiteral<1>; event: Type.TLiteral<"question">; occurredAt: Type.TNumber; /** Answered by a `ui_response` steer command with the same requestId. */ data: Type.TObject<{ requestId: Type.TString; method: Type.TUnion<[Type.TLiteral<"select">, Type.TLiteral<"confirm">, Type.TLiteral<"input">, Type.TLiteral<"editor">]>; title: Type.TString; message: Type.TOptional; options: Type.TOptional>; placeholder: Type.TOptional; prefill: Type.TOptional; timeout: Type.TInteger; /** The run holds this question with no deadline; `timeout` is then nominal. */ hold: Type.TOptional>; }>; }>, Type.TObject<{ version: Type.TLiteral<1>; event: Type.TUnion<[Type.TLiteral<"pi.input">, Type.TLiteral<"pi.agent_start">, Type.TLiteral<"pi.agent_end">, Type.TLiteral<"pi.turn_end">, Type.TLiteral<"pi.agent_settled">, Type.TLiteral<"pi.tool_error">, Type.TLiteral<"pi.session_compact">]>; occurredAt: Type.TNumber; data: Type.TOptional; }>]>; export type LifecycleLine = Static; /** `logFile`: transcript events, one per line; other lines are ignored by the reader. */ export declare const TranscriptEventSchema: Type.TUnion<[Type.TObject<{ type: Type.TLiteral<"message_end">; message: Type.TObject<{ role: Type.TUnion<[Type.TLiteral<"user">, Type.TLiteral<"assistant">]>; content: Type.TUnion<[Type.TString, Type.TArray; text: Type.TString; }>>]>; }>; }>, Type.TObject<{ type: Type.TLiteral<"tool_execution_start">; toolCallId: Type.TOptional; toolName: Type.TString; args: Type.TOptional; }>, Type.TObject<{ type: Type.TLiteral<"tool_execution_end">; toolCallId: Type.TOptional; toolName: Type.TString; result: Type.TOptional; isError: Type.TOptional; }>, Type.TObject<{ type: Type.TLiteral<"extension_error">; error: Type.TString; }>]>; export type TranscriptEvent = Static; /** `steerFile`: Fabric appends one command per line; the worker tails it. */ export declare const SteerCommandSchema: Type.TUnion<[Type.TObject<{ type: Type.TLiteral<"steer">; id: Type.TString; ts: Type.TNumber; message: Type.TString; data: Type.TOptional; }>, Type.TObject<{ type: Type.TLiteral<"follow_up">; id: Type.TString; ts: Type.TNumber; message: Type.TString; data: Type.TOptional; }>, Type.TObject<{ type: Type.TLiteral<"set_steering_mode">; id: Type.TString; ts: Type.TNumber; mode: Type.TUnion<[Type.TLiteral<"all">, Type.TLiteral<"one-at-a-time">]>; }>, Type.TObject<{ type: Type.TLiteral<"set_follow_up_mode">; id: Type.TString; ts: Type.TNumber; mode: Type.TUnion<[Type.TLiteral<"all">, Type.TLiteral<"one-at-a-time">]>; }>, Type.TObject<{ type: Type.TLiteral<"compact">; id: Type.TString; ts: Type.TNumber; instructions: Type.TOptional; }>, Type.TObject<{ type: Type.TLiteral<"ui_response">; id: Type.TString; ts: Type.TNumber; requestId: Type.TString; value: Type.TOptional; confirmed: Type.TOptional; cancelled: Type.TOptional>; }>, Type.TObject<{ type: Type.TLiteral<"ui_decision">; id: Type.TString; ts: Type.TNumber; requestId: Type.TString; decisionId: Type.TString; }>]>; export type SteerCommand = Static; //# sourceMappingURL=runner-protocol.d.ts.map