import type { Database } from "bun:sqlite";
import { type TaskFile } from "../db/task-files.js";
import type { Plan, Project, TaskComment } from "../types/index.js";
export type AgentContextPackFormat = "json" | "markdown" | "compact-json" | "compact-markdown";
export type AgentContextPackProfile = "codex" | "claude" | "takumi" | "generic";
export type AgentContextPackSection = "project" | "plan" | "acceptance_criteria" | "dependencies" | "comments" | "relevant_files" | "traceability" | "runs";
export interface CreateAgentContextPackInput {
    task_id: string;
    agent_id?: string;
    profile?: AgentContextPackProfile;
    run_id?: string;
    comment_limit?: number;
    file_limit?: number;
    verification_limit?: number;
    run_limit?: number;
    dependency_limit?: number;
    plan_task_limit?: number;
    max_text_chars?: number;
    summary_char_limit?: number;
    stale_after_hours?: number;
    token_budget?: number;
    include_sections?: string[];
    exclude_sections?: string[];
    compact?: boolean;
    now?: string | Date;
}
export interface AgentContextPackTask {
    id: string;
    short_id: string | null;
    title: string;
    description: string | null;
    status: string;
    priority: string;
    assigned_to: string | null;
    agent_id: string | null;
    project_id: string | null;
    plan_id: string | null;
    task_list_id: string | null;
    tags: string[];
    due_at: string | null;
    estimated_minutes: number | null;
    updated_at: string;
    metadata_keys: string[];
}
export interface AgentContextPackRelatedTask {
    id: string;
    short_id: string | null;
    title: string;
    status: string;
    priority: string;
}
export interface AgentContextPack {
    schema_version: 1;
    profile: AgentContextPackProfile;
    as_of: string;
    agent_id: string | null;
    task: AgentContextPackTask;
    project: Pick<Project, "id" | "name" | "path" | "description"> | null;
    plan: (Pick<Plan, "id" | "name" | "description" | "status" | "agent_id"> & {
        tasks: AgentContextPackRelatedTask[];
        omitted_tasks: number;
    }) | null;
    acceptance_criteria: string[];
    dependencies: {
        upstream: AgentContextPackRelatedTask[];
        downstream: AgentContextPackRelatedTask[];
        omitted_upstream: number;
        omitted_downstream: number;
    };
    comments: {
        recent: Array<Pick<TaskComment, "agent_id" | "type" | "progress_pct" | "created_at"> & {
            content: string;
        }>;
        omitted: number;
    };
    relevant_files: Array<Pick<TaskFile, "path" | "status" | "agent_id" | "note" | "updated_at"> & {
        sources: string[];
    }>;
    traceability: {
        commits: Array<{
            sha: string;
            message: string | null;
            files_changed: string[] | null;
            committed_at: string | null;
        }>;
        git_refs: Array<{
            ref_type: string;
            name: string;
            url: string | null;
            provider: string | null;
        }>;
        verifications: Array<{
            command: string;
            status: string;
            output_summary: string | null;
            artifact_path: string | null;
            run_at: string;
        }>;
        omitted_verifications: number;
    };
    runs: {
        items: Array<{
            id: string;
            title: string | null;
            status: string;
            summary: string | null;
            agent_id: string | null;
            started_at: string;
            completed_at: string | null;
            events: Array<{
                event_type: string;
                message: string | null;
                created_at: string;
            }>;
            commands: Array<{
                command: string;
                status: string;
                output_summary: string | null;
                artifact_path: string | null;
            }>;
            files: Array<{
                path: string;
                status: string;
                note: string | null;
            }>;
            artifacts: Array<{
                path: string;
                artifact_type: string | null;
                description: string | null;
                sha256: string | null;
            }>;
        }>;
        omitted: number;
    };
    prompt_bundle: {
        target: AgentContextPackProfile;
        instructions: string[];
        suggested_prompt: string;
    };
    context_budget: {
        estimation: "chars_div_4";
        token_budget: number | null;
        original_estimated_tokens: number;
        estimated_tokens: number;
        compact: boolean;
        included_sections: AgentContextPackSection[];
        excluded_sections: AgentContextPackSection[];
        omitted_sections: AgentContextPackSection[];
        summaries: Array<{
            section: AgentContextPackSection;
            reason: string;
            text: string;
            estimated_tokens_saved: number;
        }>;
    };
    limits: Required<Pick<CreateAgentContextPackInput, "comment_limit" | "file_limit" | "verification_limit" | "run_limit" | "dependency_limit" | "plan_task_limit" | "max_text_chars" | "summary_char_limit" | "stale_after_hours">>;
    warnings: string[];
}
export declare function createAgentContextPack(input: CreateAgentContextPackInput, db?: Database): AgentContextPack;
export declare function renderAgentContextPackMarkdown(pack: AgentContextPack): string;
export declare function renderAgentContextPackCompactMarkdown(pack: AgentContextPack): string;
export declare function renderAgentContextPack(pack: AgentContextPack, format: AgentContextPackFormat, compact?: boolean): string;
//# sourceMappingURL=context-packs.d.ts.map