import { ObjectiveStateOutcome } from './objective-state.js';

interface CausalTrajectoryRecord {
    schemaVersion: 1;
    trajectoryId: string;
    recordedAt: string;
    sessionKey: string;
    goal: string;
    actionSummary: string;
    observationSummary: string;
    outcomeKind: ObjectiveStateOutcome;
    outcomeSummary: string;
    followUpSummary?: string;
    objectiveStateSnapshotRefs?: string[];
    entityRefs?: string[];
    tags?: string[];
    metadata?: Record<string, string>;
}
interface CausalTrajectoryStoreStatus {
    enabled: boolean;
    rootDir: string;
    trajectoriesDir: string;
    trajectories: {
        total: number;
        valid: number;
        invalid: number;
        byOutcome: Partial<Record<ObjectiveStateOutcome, number>>;
        latestTrajectoryId?: string;
        latestRecordedAt?: string;
        latestSessionKey?: string;
    };
    latestTrajectory?: CausalTrajectoryRecord;
    invalidTrajectories: Array<{
        path: string;
        error: string;
    }>;
}
interface CausalTrajectorySearchResult {
    record: CausalTrajectoryRecord;
    score: number;
    matchedFields: string[];
}
declare function resolveCausalTrajectoryStoreDir(memoryDir: string, overrideDir?: string): string;
declare function validateCausalTrajectoryRecord(raw: unknown): CausalTrajectoryRecord;
declare function recordCausalTrajectory(options: {
    memoryDir: string;
    causalTrajectoryStoreDir?: string;
    actionGraphRecallEnabled?: boolean;
    cmcEnabled?: boolean;
    cmcStitchLookbackDays?: number;
    cmcStitchMinScore?: number;
    cmcStitchMaxEdgesPerTrajectory?: number;
    record: CausalTrajectoryRecord;
}): Promise<string>;
declare function readCausalTrajectoryRecords(options: {
    memoryDir: string;
    causalTrajectoryStoreDir?: string;
}): Promise<{
    files: string[];
    trajectories: CausalTrajectoryRecord[];
    invalidTrajectories: Array<{
        path: string;
        error: string;
    }>;
}>;
/** Keep trajectories whose recordedAt is within the last `lookbackDays` (issue #519 miner). */
declare function filterTrajectoriesByLookbackDays(trajectories: CausalTrajectoryRecord[], lookbackDays: number, nowMs?: number): CausalTrajectoryRecord[];
declare function getCausalTrajectoryStoreStatus(options: {
    memoryDir: string;
    causalTrajectoryStoreDir?: string;
    enabled: boolean;
}): Promise<CausalTrajectoryStoreStatus>;
declare function searchCausalTrajectories(options: {
    memoryDir: string;
    causalTrajectoryStoreDir?: string;
    query: string;
    maxResults: number;
    sessionKey?: string;
}): Promise<CausalTrajectorySearchResult[]>;

export { type CausalTrajectoryRecord, type CausalTrajectorySearchResult, type CausalTrajectoryStoreStatus, filterTrajectoriesByLookbackDays, getCausalTrajectoryStoreStatus, readCausalTrajectoryRecords, recordCausalTrajectory, resolveCausalTrajectoryStoreDir, searchCausalTrajectories, validateCausalTrajectoryRecord };
