import type { Database } from "../../../shared/sqlite";
export interface DreamScheduleConfig {
    /** Time range string like "02:00-06:00" */
    schedule: string;
}
/** Parse "HH:MM-HH:MM" into start/end minutes since midnight. */
export declare function parseScheduleWindow(schedule: string): {
    startMinutes: number;
    endMinutes: number;
} | null;
/** Check if the current time is inside the schedule window. Handles overnight windows (e.g. 23:00-05:00). */
export declare function isInScheduleWindow(schedule: string, now?: Date): boolean;
/** Find projects that have memory updates or pending smart notes since their per-project last dream time. */
export declare function findProjectsNeedingDream(db: Database): string[];
/**
 * Check schedule and enqueue eligible projects.
 * Called periodically from the hook layer (debounced to once per hour).
 * Returns the number of projects enqueued.
 *
 * @param ownProjectIdentity - When provided, restricts enqueue to this project.
 *   Each running OpenCode/Pi process registers exactly one project, so it
 *   must only enqueue work for THAT project — otherwise a process running for
 *   project A would enqueue dream entries for projects B, C, D... that this
 *   host can't actually drain (it has the wrong client + the wrong
 *   subagent-runner directory). Without the filter, a Pi process running for
 *   `opencode-anthropic-auth` ends up trying to spawn `pi --print` for
 *   `opencode-xtra` (a project Pi was never opened in), failing every cycle.
 *
 *   When undefined, the legacy "enqueue everything that needs a dream"
 *   behavior is preserved for tests and any future single-host caller.
 */
export declare function checkScheduleAndEnqueue(db: Database, schedule: string, ownProjectIdentity?: string): number;
//# sourceMappingURL=scheduler.d.ts.map