import { type ActorCompletionReason, type ActorPersonaRef, type ActorStatus, type ActorTrace } from "./actor-contract.js"; export type PiStopReason = "stop" | "toolUse" | "length" | "error" | "aborted"; export type PiAgentEvent = { type: "agent_start"; } | { type: "agent_end"; } | { type: "turn_start"; } | { type: "turn_end"; } | { type: "message_start"; role?: string; } | { type: "message_update"; textDelta?: string; thinkingDelta?: string; } | { type: "message_end"; text?: string; thinking?: string; } | { type: "tool_execution_start"; toolCallId: string; toolName: string; } | { type: "tool_execution_end"; toolCallId: string; toolName?: string; isError?: boolean; } | { type: "queue_update"; summary?: string; } | { type: "compaction_start"; } | { type: "compaction_end"; } | { type: "auto_retry_start"; } | { type: "auto_retry_end"; } | { type: "notice"; method?: string; message?: string; }; export interface PiSessionStats { tokens?: { input?: number; output?: number; total?: number; cacheRead?: number; cacheWrite?: number; }; cost?: number; } export interface PiSessionResult { events: PiAgentEvent[]; sessionId?: string; model?: string; providerVersion?: string; startedAt: string; completedAt: string; durationMs: number; status: ActorStatus; reason: string; stats?: PiSessionStats; } export declare function piStopReasonToStatus(stop: PiStopReason): ActorStatus; export declare function piStatusToCompletionReason(status: ActorStatus): ActorCompletionReason; /** * Map a pi-agent-core session into the provider-neutral ActorTrace. Pure and * side-effect-free; mirrors codexResultToActorTrace. The persona reference is * supplied by the harness. Used by the actorRegistry to prove the contract is * provider-neutral ahead of the live SDK shim. */ export declare function piSessionToActorTrace(session: PiSessionResult, persona: ActorPersonaRef): ActorTrace;