/** * Drive activation and auto-consolidation logic extracted from wait-tool.ts. * * Contains: * - runAutoConsolidation(): 3 strategies (idle, episode-count, time-based) * - checkDriveActivation(): 3-phase autonomous drive (phase 1/2/3) */ import { type initMemoryDb } from "../../data/memory/index.js"; import type { ToolResult } from "../../lib/types.js"; interface DriveContext { state: { lastOperatorMessageAt: number; lastConsolidationAt: number; lastDriveAttemptAt: number; drivePhase2Fired: boolean; sessionStartedAt: number; }; effectiveThreadId: number | undefined; getMemoryDb: () => ReturnType; /** OpenAI API key from config (used for embedding backfill). */ apiKey: string | undefined; config: { DMN_ACTIVATION_HOURS: number; }; /** Pre-computed memory refresh text (may be empty). */ memoryRefresh: string; /** Pre-computed schedule hint text (may be empty). */ scheduleHint: string; } /** * Checks the consolidation strategies (episode-count, idle, time-based) and * fires runIntelligentConsolidation + backfillEmbeddings as fire-and-forget * when one applies. Episode-count is prioritised so a large backlog is not * starved by the idle strategy sharing the cooldown — see * selectConsolidationStrategy for the full ordering rationale. */ export declare function runAutoConsolidation(ctx: DriveContext): void; /** * Checks and handles the 3-phase autonomous drive logic. * * - Phase 3: If `drivePhase2Fired` → return PHASE3_APPROVAL_PROMPT * - Phase 1+2: If idle > threshold and cooldown elapsed → formatDrivePrompt() * → if activated, set drivePhase2Fired=true, return drive prompt * * Returns a ToolResult if drive activated, or null if nothing to do. */ export declare function checkDriveActivation(ctx: DriveContext): ToolResult | null; export {}; //# sourceMappingURL=drive-handler.d.ts.map