import type { AgentSession } from "./agent-session.js"; import { type SessionSettleHost } from "./session-settle.js"; /** Probes the owner of the session supplies. Both are re-read whenever work could start. */ export interface IdleMaintenanceOptions { /** True while the owner does not want autonomous work (a draft being composed, the view left, startup unfinished). */ isBlocked?: () => boolean; /** True while the owner has decided to start a turn it has not yet admitted (for example a scheduled goal continuation). */ scheduledTurn?: () => boolean; /** Receives each nonblank recap reply, after it has been journaled to the history database. */ onRecap?: (recap: string) => void; } /** The session surface idle maintenance reads and drives. */ export type IdleMaintenanceSession = SessionSettleHost & Pick; export declare class IdleMaintenance { #private; constructor(session: IdleMaintenanceSession, options: IdleMaintenanceOptions); /** * The owner's inputs may have changed (a setting, the blocker, a scheduled turn that went away): drop * work that is no longer wanted and re-arm whatever the current stretch still owes, with a fresh delay. */ refresh(): void; /** * Supersede the current stretch: nothing captured before this call may arm, record or announce * afterwards. Called on new activity, maintenance, at the start of every session transition and on disposal. */ invalidate(): void; dispose(): void; }