import type { SeedBackgroundNotification, SeedBackgroundTask } from "../background-state/index.js";
import type { SeedAgentMessageEnvelope } from "../message-bus/index.js";
import type { SeedEvent, SeedRun, SeedTask } from "../run-state/index.js";
import type { SeedSubplan } from "../subplan/index.js";
import type { SeedTeamMeeting, SeedTeamRuntime, SeedTeamTask, SeedTeamTaskConflict } from "../team-mode/index.js";
import type { SeedAgentThread } from "../agent-thread/index.js";
export type SeedContinuationReason = "chat_message_context" | "session_compacting" | "seed_resume" | "lab_meeting_resume" | "background_terminal" | "background_checkpoint" | "command_aborted" | "professor_handoff" | "manual";
export type SeedContinuationDecision = {
    source: "professor_handoff" | "blocked_task" | "blocked_team_task" | "failed_background";
    summary: string;
    reason?: string;
    related_id?: string;
    created_at?: string;
};
export type SeedContinuationNextAction = {
    action_id: string;
    priority: number;
    category: "professor_decision" | "review_background" | "checkpoint_background" | "unblock_task" | "review_task" | "continue_task" | "read_team_inbox" | "claim_team_task" | "continue_team_task" | "review_budget";
    summary: string;
    related_id?: string;
    reason?: string;
};
export type SeedContinuationSnapshot = {
    version: 1;
    run_id: string;
    generated_at: string;
    reason: SeedContinuationReason;
    session_id?: string;
    run: Pick<SeedRun, "run_id" | "status" | "run_mode" | "professor_goal" | "active_agent" | "root_session_id" | "final_artifacts">;
    tasks: {
        open: SeedTask[];
        blocked: SeedTask[];
        review: SeedTask[];
        completed_count: number;
    };
    team: {
        runtime?: SeedTeamRuntime;
        unread_by_member: Record<string, number>;
        active_meetings: SeedTeamMeeting[];
        open_tasks: SeedTeamTask[];
        blocked_tasks: SeedTeamTask[];
        conflicts: SeedTeamTaskConflict[];
    };
    subplans: {
        open: SeedSubplan[];
        blocking_final: SeedSubplan[];
        accepted_count: number;
        rework_count: number;
    };
    agent_threads: {
        active: SeedAgentThread[];
        blocked: SeedAgentThread[];
        helper_counts_by_thread: Record<string, {
            running: number;
            completed: number;
            failed: number;
        }>;
    };
    message_bus: {
        queued_count: number;
        failed_count: number;
        blocked_deliveries: SeedAgentMessageEnvelope[];
    };
    backgrounds: {
        active: SeedBackgroundTask[];
        stale: SeedBackgroundTask[];
        notifications: SeedBackgroundNotification[];
        terminal_unnotified: SeedBackgroundTask[];
        recent_terminal: SeedBackgroundTask[];
    };
    budget: {
        status: "ok" | "warning" | "blocked";
        warnings: string[];
        blocking_reason?: string;
        model_calls: string;
        child_sessions: string;
        context_injected_chars: number;
        context_duplicate_bundle_refs: number;
    };
    professor_memory_refs: string[];
    pending_decisions: SeedContinuationDecision[];
    next_actions: SeedContinuationNextAction[];
    evidence_refs: string[];
    recent_events: SeedEvent[];
};
export type SeedContinuationWriteResult = {
    snapshot: SeedContinuationSnapshot;
    markdown: string;
    markdown_path: string;
    json_path: string;
};
