import { type Database } from "./database.js"; /** * Credential-free `tool.auth_needed` facts recorded by one scheduled run's own * turn (`session_turns.scheduled_task_run_id`). Later human follow-ups in the * same session, goal continuations, and other runs of a reusable session are * not the run's turn and are never attributed to it. */ export type ScheduledTaskRunAuthNeededEvent = { runId: string; payload: unknown; occurredAt: string; }; /** Per turn bound: enough to name every failing connector, never a full replay. */ export declare const SCHEDULED_TASK_RUN_AUTH_NEEDED_EVENTS_PER_TURN = 32; /** * The scheduled-run turn's current, non-duplicate `tool.auth_needed` events. * Uses the unique run->turn index and the (workspace, turn, type) event index. */ export declare function listScheduledTaskRunAuthNeededEvents(db: Database, workspaceId: string, runIds: readonly string[]): Promise; export type ScheduledTaskAccessAttentionEvent = ScheduledTaskRunAuthNeededEvent & { taskId: string; taskName: string; /** The task's current execution digest (its frozen head). */ taskExecutionDigest: string; firedAt: string; }; /** * `tool.auth_needed` events of each active agent task's latest run that has a * turn, for the tasks this subject owns (and, when `includeOwnerless`, tasks * without an owner). A newer run whose turn recorded no such event clears the * task, because only the newest run with a turn is considered. */ export declare function listScheduledTaskAccessAttentionEvents(db: Database, workspaceId: string, input: { subjectId: string; includeOwnerless: boolean; taskLimit: number; }): Promise;