/**
 * Backfill historical VisionClaw runtime logs into the transcript-memory
 * database.
 *
 * IMPORTANT — terminology:
 *  - "Log files" = VisionClaw runtime logs stored at
 *    `~/.visionclaw/profiles/<profile>/logs/YYYY-MM-DD.jsonl(.gz)`.
 *    Format: `{timestamp, level, category, message, data}`.
 *  - "Transcript files" = Claude Agent SDK model transcripts stored at
 *    `~/.claude/projects/<slug>/<sessionId>.jsonl`.
 *    Format: `{type:"user"|"assistant", message:{...}}`.
 *
 * This module operates on **log files** (not Claude transcripts).
 *
 * Reads JSONL (and JSONL.gz) log files from the configured logs directory,
 * segments them into wake cycles (wake → next wake / end-of-file boundaries),
 * matching the existing data-processing segmenter, then generates
 * summaries + embeddings via Gemini, and inserts them into the same SQLite
 * DB used by the live transcript indexer.
 *
 * Usage:
 *   visionclaw backfill-memory [--dry-run] [--since YYYY-MM-DD] [--concurrency N]
 */
import type { VisionClawConfig } from "../../config/types.js";
export declare function runBackfillMemory(args: string[]): Promise<void>;
/**
 * Cancel any in-progress auto-backfill. Safe to call multiple times or when
 * no backfill is running.
 */
export declare function cancelAutoBackfill(): void;
/**
 * Check whether auto-backfill should run and execute it if needed.
 * Called from the agent loop on startup (fire-and-forget).
 *
 * Conditions for auto-backfill:
 *  1. No marker file exists (hasn't been done before)
 *  2. The transcript-memory DB has no entries (empty/new)
 *  3. Historical log files exist in the logs directory
 *
 * Robustness:
 *  - Respects an AbortSignal so the agent can stop it on shutdown.
 *  - Idempotent: already-indexed cycles are skipped via `wakeCycleExists()`.
 *  - Crash-safe: the marker file is only written after all cycles are
 *    processed. On restart the backfill resumes, skipping existing records.
 *  - Concurrent writes: live `indexWakeCycle()` can run in parallel. SQLite
 *    WAL mode + in-process synchronous driver ensures serialized writes.
 *  - DB closed during backfill: all DB operations are wrapped in try/catch
 *    so a closed-DB error does not crash the process.
 *
 * The backfill runs with a longer delay between API calls (500ms)
 * to avoid competing with the agent's own Gemini usage.
 */
export declare function maybeAutoBackfill(config: VisionClawConfig): Promise<void>;
//# sourceMappingURL=transcript-backfill.d.ts.map