/**
 * WorkflowTrajectory — records a structured trajectory for each workflow run.
 *
 * Writes trajectory JSON files directly to `.trajectories/active/` in a format
 * compatible with `trail show`. No external CLI or package dependency required.
 *
 * Design principles:
 *   1. One trajectory per workflow run
 *   2. Chapters map to workflow phases, not individual steps
 *   3. Non-blocking — trajectory recording never fails the workflow
 *   4. Opt-in but default-on
 */
import type { TrajectoryConfig, WorkflowStep } from './types.js';
interface StepParticipants {
    role?: string;
    owner?: string;
    specialist?: string;
    reviewer?: string;
}
export interface StepOutcome {
    name: string;
    agent: string;
    status: 'completed' | 'failed' | 'skipped';
    attempts: number;
    output?: string;
    error?: string;
    verificationPassed?: boolean;
    /** Sentinel value the step was verifying for, if any. */
    verificationValue?: string;
    /** Whether this was a non-interactive (subprocess) step. */
    nonInteractive?: boolean;
    /** Duration in ms. */
    durationMs?: number;
}
export declare class WorkflowTrajectory {
    private trajectory;
    private currentChapterId;
    private readonly enabled;
    private readonly reflectOnBarriers;
    private readonly reflectOnConverge;
    private readonly autoDecisions;
    private readonly dataDir;
    private readonly runId;
    private startTime;
    private swarmPattern;
    constructor(config: TrajectoryConfig | false | undefined, runId: string, cwd: string);
    /** Start the trajectory (called at run:started). */
    start(workflowName: string, stepCount: number, trackInfo?: string, description?: string, pattern?: string): Promise<void>;
    /** Begin a new parallel track chapter. */
    beginTrack(trackName: string): Promise<void>;
    /** Begin a convergence chapter (after barrier/parallel completion). */
    beginConvergence(label: string): Promise<void>;
    /** Begin the retrospective chapter. */
    private openRetrospective;
    /** Record step started — captures intent, not just assignment. */
    stepStarted(step: WorkflowStep, agent: string, participants?: StepParticipants): Promise<void>;
    registerAgent(name: string, role: string): Promise<void>;
    stepSupervisionAssigned(step: WorkflowStep, supervised: {
        owner: {
            name: string;
        };
        specialist: {
            name: string;
        };
        reviewer?: {
            name: string;
        };
    }): Promise<void>;
    ownerMonitoringEvent(stepName: string, owner: string, detail: string, raw?: Record<string, unknown>): Promise<void>;
    reviewCompleted(stepName: string, reviewerName: string, decision: 'approved' | 'rejected', reason?: string): Promise<void>;
    /** Record step completed — captures what was accomplished. */
    stepCompleted(step: WorkflowStep, output: string, attempt: number): Promise<void>;
    /** Record step failed — categorizes root cause for actionable diagnosis. */
    stepFailed(step: WorkflowStep, error: string, attempt: number, maxRetries: number, outcome?: Partial<StepOutcome>): Promise<void>;
    /** Record step skipped — note the cascade impact. */
    stepSkipped(step: WorkflowStep, reason: string): Promise<void>;
    /** Record step retrying. */
    stepRetrying(step: WorkflowStep, attempt: number, maxRetries: number): Promise<void>;
    /** Record a reflection at a convergence point. */
    reflect(synthesis: string, confidence: number, focalPoints?: string[]): Promise<void>;
    /** Synthesize and reflect after a set of steps complete (barrier or parallel convergence). */
    synthesizeAndReflect(label: string, outcomes: StepOutcome[], unblocks?: string[]): Promise<void>;
    /** Record an orchestrator decision. */
    decide(question: string, chosen: string, reasoning: string): Promise<void>;
    /** Complete the trajectory with a summary. */
    complete(summary: string, confidence: number, meta?: {
        learnings?: string[];
        challenges?: string[];
    }): Promise<void>;
    /** Abandon the trajectory. */
    abandon(reason: string, meta?: {
        summary?: string;
        confidence?: number;
        learnings?: string[];
        challenges?: string[];
    }): Promise<void>;
    isEnabled(): boolean;
    shouldReflectOnConverge(): boolean;
    shouldReflectOnBarriers(): boolean;
    getTrajectoryId(): string | null;
    buildSynthesis(label: string, outcomes: StepOutcome[], unblocks?: string[]): string;
    computeConfidence(outcomes: StepOutcome[]): number;
    buildRunSummary(outcomes: StepOutcome[]): string;
    extractLearnings(outcomes: StepOutcome[]): string[];
    extractChallenges(outcomes: StepOutcome[]): string[];
    private openChapter;
    private closeCurrentChapter;
    private addEvent;
    private flush;
    private moveToCompleted;
}
export {};
//# sourceMappingURL=trajectory.d.ts.map