import { type ModelRuntime } from "@earendil-works/pi-coding-agent"; import type { ActionUID, ChartEvent } from "@surprisal/hyperchart/internal/core/types"; import type { AgentEffect, RejectedEffect } from "@surprisal/hyperchart/internal/core/machine"; import type { AgentExecutor, EmitCompletion, SessionPlan } from "@surprisal/hyperchart/runtime"; import type { SchemaRegistryLike as SchemaRegistry } from "@surprisal/hyperchart/internal/core/schema_registry"; import { buildSessionPlan, shouldRecoverRestoredFinish, validateDeclaredReadPaths } from "@surprisal/hyperchart/runtime"; export { buildSessionPlan, shouldRecoverRestoredFinish, validateDeclaredReadPaths }; export type { SessionPlan }; export type PiSessionOverridesContext = Readonly<{ branchId: string; actionUid: ActionUID; agentName: string; declaredRole?: string; declaredToolset?: string; }>; export type PiSessionOverrides = Readonly<{ /** Concrete model reference for this invocation. */ model?: string; /** Concrete allowlist for this invocation; replaces the declared toolset. */ tools?: string[]; /** Invocation-scoped context appended to the agent definition's system prompt. */ appendSystemPrompt?: string; }>; export type PiExecutorOptions = { /** Branch-isolated workspace used as the agent cwd. */ workDir: string; /** Repository/project directory that owns the run. */ projectDir?: string; agentDir?: string; definitionDirs?: string[]; sessionsDir: string; branchId: string; modelRuntime: ModelRuntime; defaultModel?: string; modelRoles?: Record; toolsets?: Record; /** Resolve mutable host configuration immediately before a Pi session starts. */ resolveSessionOverrides?: (context: PiSessionOverridesContext) => Promise; maxFinishRetries?: number; schemaRegistry?: SchemaRegistry; }; export declare class PiAgentExecutor implements AgentExecutor { private readonly options; private readonly live; private readonly runs; private readonly cancellations; private readonly cleanupTasks; private readonly generations; private readonly cleanupFailures; private readonly agentDir; private readonly definitionDirs; private readonly maxFinishRetries; private disposed; private disposal; constructor(options: PiExecutorOptions); start(effect: AgentEffect, emit: EmitCompletion): void; reject(effect: RejectedEffect, emit: EmitCompletion): void; steer(actionKey: string, invokeSeqId: number, message: string): Promise; cancel(actionUid: ActionUID): Promise; dispose(): Promise; private disposeTrackedWork; private launch; private run; private createSession; private promptAndAccept; private acceptanceLoop; private attachProgress; private updateProgress; private markProgressFailed; private isStopped; private handleRunFailure; private trackCleanup; private disposeSession; private cleanupSession; private safeEmit; } export declare function findCapturedFinish(messages: readonly unknown[], effect: AgentEffect, registry?: SchemaRegistry): Promise; export declare function lastAssistantError(messages: readonly unknown[]): string | undefined; //# sourceMappingURL=pi_agent_executor.d.ts.map