import type { ToolDefinition } from "@earendil-works/pi-coding-agent"; import type { RuntimeAgentRunRequest, RuntimeAgentRunResult, RuntimeAgentRunner, RuntimeTool } from "./runtime/agent-runner.js"; import { RuntimeAgentProviderError } from "./runtime/agent-runner.js"; import { WorkflowError, type AgentTransport, type AgentTransportContext, type LiveSessionHandoff, type PreparedAgentSession, type WorkflowAgentSession } from "./types.js"; type PiRuntimeAgentRunnerCallbacks = { readonly onSession?: (session: WorkflowAgentSession, handoff: LiveSessionHandoff, prepared: Readonly) => void | Promise; readonly onSessionReady?: () => void | Promise; readonly onBeforeComplete?: () => void | Promise; readonly onComplete?: (result: RuntimeAgentRunResult, session: WorkflowAgentSession) => void | Promise; readonly onFailure?: (error: WorkflowError, session: WorkflowAgentSession) => void | Promise; readonly onSystemPrompt?: (entry: { readonly sessionId: string; readonly turn: number; readonly prompt: string; }) => void | Promise; }; export interface PiRuntimeAgentRunnerOptions { readonly transport: AgentTransport; readonly prepared: Readonly; readonly context: Readonly; readonly handoff: LiveSessionHandoff; readonly callbacks?: PiRuntimeAgentRunnerCallbacks; } type PiToolContext = Parameters[4]; export declare function runtimeToolFromPiDefinition(definition: ToolDefinition, context: PiToolContext): RuntimeTool; export declare function isRuntimeAgentProviderError(error: unknown): error is RuntimeAgentProviderError; export declare function normalizePiRuntimeError(error: unknown, signal: AbortSignal, setupFailed?: boolean): WorkflowError; export declare class PiRuntimeAgentRunner implements RuntimeAgentRunner { #private; readonly id = "pi"; readonly capabilities: { customTools: boolean; structuredResults: boolean; steering: boolean; handoff: boolean; usage: "complete"; }; constructor(options: PiRuntimeAgentRunnerOptions); run(request: Readonly): Promise; } export declare function createPiRuntimeAgentRunner(options: PiRuntimeAgentRunnerOptions): RuntimeAgentRunner; export type { PiRuntimeAgentRunnerCallbacks };