/**
 * ContextCapsule — bounded per-node context for agent runtimes.
 *
 * OMK memory = canonical (graph-state.json, .omk/runs/).
 * Kimi memory = disposable (isolated HOME per node).
 */
import type { DagNode } from "../orchestration/dag.js";
export interface FileSlice {
    readonly path: string;
    readonly startLine: number;
    readonly endLine: number;
    readonly content: string;
}
export type MemoryFactKind = "project_constraint" | "architecture_decision" | "file_responsibility" | "api_contract" | "failure_pattern" | "successful_fix" | "user_preference" | "provider_behavior";
export interface MemoryFact {
    readonly id?: string;
    readonly kind: MemoryFactKind;
    readonly subject: string;
    readonly predicate: string;
    readonly object: string;
    readonly confidence: number;
    readonly sourceRunId?: string;
    readonly sourceNodeId?: string;
    readonly createdAt?: string;
    readonly expiresAt?: string;
    /** Backward compat: derived from subject+predicate if not set */
    readonly key: string;
    /** Backward compat: derived from object if not set */
    readonly value: string;
    /** Backward compat: derived from kind if not set */
    readonly category: string;
}
export interface AttemptDigest {
    readonly attempt: number;
    readonly provider: string;
    readonly status: "done" | "failed";
    readonly durationMs?: number;
    readonly failureSummary?: string;
}
export interface EvidenceSpec {
    readonly gate: string;
    readonly ref?: string;
    readonly required: boolean;
}
export interface ContextBudget {
    readonly maxInputTokens: number;
    readonly reservedOutputTokens: number;
    readonly maxFileTokens: number;
    readonly maxToolResultTokens: number;
    readonly maxMemoryFacts: number;
    readonly compression: "none" | "lossless-ish" | "summary" | "aggressive";
}
export declare const DEFAULT_CONTEXT_BUDGET: ContextBudget;
export declare const CONTEXT_BUDGET_PRESETS: Record<string, ContextBudget>;
export interface ContextCapsule {
    readonly runId: string;
    readonly nodeId: string;
    readonly goal: string;
    readonly system: string;
    readonly task: string;
    readonly dependencySummaries: readonly string[];
    readonly relevantFiles: readonly FileSlice[];
    readonly graphMemory: readonly MemoryFact[];
    readonly priorAttempts: readonly AttemptDigest[];
    readonly evidenceRequirements: readonly EvidenceSpec[];
    readonly budget: ContextBudget;
    readonly node: DagNode;
}
export declare function estimateCapsuleTokens(capsule: ContextCapsule): number;
export interface CapsuleTokenBreakdown {
    readonly system: number;
    readonly task: number;
    readonly goal: number;
    readonly dependencies: number;
    readonly files: number;
    readonly memory: number;
    readonly evidence: number;
    readonly priorAttempts: number;
    readonly total: number;
}
export declare function breakdownCapsuleTokens(capsule: ContextCapsule): CapsuleTokenBreakdown;
