/**
 * Kernel Context — public types.
 *
 * The CompiledContextRequest / CompiledContextPack pair is the kernel's
 * contract boundary for turning "here is a task and some files" into
 * "here is what to read, what to skip, and what it will cost in tokens".
 *
 * Consumers (CLI, MCP handlers, orchestrator) depend on these types.
 * They do NOT depend on the backend engine that actually produces the plan.
 */
export type SelectedFileMode = 'full' | 'partial' | 'outline' | 'skip';
export interface CompiledContextRequest {
    /** Caller-owned run identifier. Used only for telemetry/debug correlation. */
    runId: string;
    /** Host calling the kernel (e.g. "cli", "mcp", "orchestrator"). */
    host: string;
    /** Model slug the caller intends to run against. Informational for now. */
    model: string;
    /** Short human-readable task description — drives relevance scoring. */
    task: string;
    /** Optional raw user query. Preserved for future heuristics; unused in PR 1. */
    userQuery?: string;
    /** Absolute or repo-relative file paths to consider. */
    files: string[];
    /** Optional per-file relevance boosts. Path → additive score in [0, 1]. */
    fileBoosts?: Record<string, number>;
    /** Tokens the caller wants reserved for model output. PR 1: informational only. */
    reservedOutputTokens?: number;
    /** Tokens consumed by the system prompt. PR 1: informational only. */
    systemMarginTokens?: number;
    /** Tokens consumed by tool schemas. PR 1: informational only. */
    toolMarginTokens?: number;
    /** Free-form metadata the caller wants echoed back via debugMeta. */
    metadata?: Record<string, unknown>;
}
export interface SelectedFileEntry {
    path: string;
    mode: SelectedFileMode;
    estimatedTokens?: number;
}
export interface OmittedFileEntry {
    path: string;
    reason: string;
}
export interface CompiledContextTokenPlan {
    estimatedInputTokens: number;
    estimatedOutputTokens?: number;
    compressionRatio?: number;
    savings?: number;
    sessionBudget?: number;
}
export interface CompiledContextDebugMeta {
    backend: 'TokenSupremacyEngine';
    notes?: string[];
    /**
     * Raw engine output. Internal-use only.
     * Callers must not depend on the shape — it exists so legacy formatters
     * can still pretty-print the plan during the PR 1 wrapper phase.
     */
    raw?: Record<string, unknown>;
}
export interface CompiledContextPack {
    selectedFiles: SelectedFileEntry[];
    tokenPlan: CompiledContextTokenPlan;
    compressedSummary?: string;
    omittedFiles: OmittedFileEntry[];
    warnings: string[];
    debugMeta: CompiledContextDebugMeta;
}
