import type { RuntimeRoute, ToolVersion } from "../types";
export type AgentPhase = "init" | "planning" | "executing" | "validating" | "healing" | "complete" | "failed";
export interface AgentStep {
    id: string;
    description: string;
    toolName: string;
    toolParams: Record<string, unknown>;
    status: "pending" | "running" | "success" | "failed" | "skipped";
    result?: string;
    error?: string;
}
export interface AgentHistoryEntry {
    timestamp: string;
    role: "thought" | "action" | "observation" | "error" | "system";
    content: string;
    toolName?: string;
    toolParams?: Record<string, unknown>;
}
export interface AgentError {
    timestamp: string;
    stepId?: string;
    message: string;
    stderr?: string;
    category?: string;
}
export interface AgentReflection {
    timestamp: string;
    iterationIndex: number;
    thought: string;
    decision: "retry" | "re-plan" | "escalate" | "abort";
    reason: string;
}
export interface AgentState {
    sessionId: string;
    userGoal: string;
    currentPhase: AgentPhase;
    environment: {
        os: "windows" | "linux" | "darwin";
        route: RuntimeRoute;
        toolchain: ToolVersion[];
    };
    executionPlan: AgentStep[];
    currentStepIndex: number;
    history: AgentHistoryEntry[];
    errors: AgentError[];
    reflections: AgentReflection[];
    iterationCount: number;
    maxIterations: number;
    startedAt: string;
    completedAt?: string;
}
export declare function createInitialState(userGoal: string, maxIterations?: number): AgentState;
export declare function setPhase(state: AgentState, phase: AgentPhase): AgentState;
export declare function setEnvironment(state: AgentState, env: AgentState["environment"]): AgentState;
export declare function setPlan(state: AgentState, plan: AgentStep[]): AgentState;
export declare function advanceStep(state: AgentState): AgentState;
export declare function updateStepStatus(state: AgentState, stepId: string, status: AgentStep["status"], result?: string, error?: string): AgentState;
export declare function appendHistory(state: AgentState, entry: Omit<AgentHistoryEntry, "timestamp">): AgentState;
export declare function appendError(state: AgentState, error: Omit<AgentError, "timestamp">): AgentState;
export declare function appendReflection(state: AgentState, reflection: Omit<AgentReflection, "timestamp">): AgentState;
export declare function incrementIteration(state: AgentState): AgentState;
export declare function markComplete(state: AgentState): AgentState;
export declare function markFailed(state: AgentState, reason: string): AgentState;
//# sourceMappingURL=state.d.ts.map