/**
 * Temporal Memory Tree (TiMem-inspired, v8.2)
 *
 * Builds a hierarchy of summarised memory nodes:
 *   hour-HH.md → day.md → week-YYYY-WW.md → persona.md
 *
 * Stored under `<baseDir>/tmt/`.
 * All writes are fail-open: errors are caught and logged, never thrown.
 */
declare const TMT_DIR = "tmt";
type TmtLevel = "hour" | "day" | "week" | "persona";
interface TmtNodeFrontmatter {
    level: TmtLevel;
    periodStart: string;
    periodEnd: string;
    memoryCount: number;
    sourceIds: string[];
    builtAt: string;
}
interface TmtConfig {
    temporalMemoryTreeEnabled: boolean;
    tmtHourlyMinMemories: number;
    tmtSummaryMaxTokens: number;
}
interface MemoryEntry {
    path: string;
    id: string;
    created: string;
    content: string;
}
declare function capTmtSummaryInputs(inputs: string[], level: TmtLevel): string[];
declare function tmtDir(baseDir: string): string;
declare function hourNodePath(baseDir: string, date: string, hour: string): string;
declare function dayNodePath(baseDir: string, date: string): string;
declare function weekNodePath(baseDir: string, weekKey: string): string;
declare function personaNodePath(baseDir: string): string;
declare function serialiseTmtNode(fm: TmtNodeFrontmatter, summary: string): string;
declare function parseIsoDate(iso: string): string;
declare function parseIsoHour(iso: string): string;
declare function isoWeekKey(date: Date): string;
type SummarizeFn = (memories: string[], level: TmtLevel) => Promise<string>;
declare class TmtBuilder {
    private readonly baseDir;
    private readonly cfg;
    constructor(baseDir: string, cfg: TmtConfig);
    /**
     * Called after each consolidation pass.
     * Groups memories by hour, builds any missing hour nodes,
     * then rolls up to day → week → persona if needed.
     * All errors are caught and logged; never throws.
     */
    maybeRebuildNodes(memories: MemoryEntry[], summarize: SummarizeFn): Promise<void>;
    private buildHourNodes;
    private buildDayNodes;
    /**
     * Build or update week-level nodes from the day nodes already on disk.
     * Groups memories by ISO week; for each week that has a day node but no
     * (or stale) week node, reads day node summaries and builds a week node.
     * Fail-open: errors per week are caught and skipped.
     */
    private buildWeekNodes;
    /**
     * Build or update the persona node from the most recent week-level summaries.
     * Reads up to 4 recent week nodes and synthesizes a persona-level narrative.
     * Fail-open: skips silently if no week nodes exist or summarize fails.
     */
    private buildPersonaNode;
    /**
     * Return the summary text of the most relevant TMT node for a given prompt.
     * Preference: day node for today > most recent day node.
     * Returns null if no nodes exist or feature is disabled.
     */
    getMostRelevantNode(): Promise<{
        level: TmtLevel;
        summary: string;
    } | null>;
}

export { type MemoryEntry, type SummarizeFn, TMT_DIR, TmtBuilder, type TmtConfig, type TmtLevel, type TmtNodeFrontmatter, capTmtSummaryInputs, dayNodePath, hourNodePath, isoWeekKey, parseIsoDate, parseIsoHour, personaNodePath, serialiseTmtNode, tmtDir, weekNodePath };
