import type { RegistryEntry, TaskSessionHistoryEntry } from "./types.js"; export interface TaskSessionRegistryEntry { task_id: string; updated_at: string; } /** * Reporter for a registry file that had to be quarantined. Wired to the Pi * event bus by the extension; losing the registry means orphaned panes and * processes, which an operator has to know about to clean up. */ export type RegistryQuarantineReporter = (info: { file: string; quarantinePath: string; reason: string; }) => void; export declare function setRegistryQuarantineReporter(reporter: RegistryQuarantineReporter): void; /** The lock guarding a registry file. Must match `task-state.ts`. */ export declare function registryLockPath(file: string): string; export declare function normalizeConversationId(value: unknown): string | undefined; export declare function readTaskSessionsRegistry(piDir: string): Record; export declare function writeTaskSessionsRegistry(piDir: string, registry: Record): void; export declare function migrateRegistryEntry(entry: Record | RegistryEntry): RegistryEntry; export declare function readRegistry(piDir: string): RegistryEntry[]; export declare function writeRegistry(piDir: string, entries: RegistryEntry[]): void; export declare function readTaskSessionHistory(piDir: string): TaskSessionHistoryEntry[]; /** * Merge one entry into the history. * * The read and the write are one locked operation. Interleaved as separate * steps, two concurrent upserts each read the same array and the second write * erased the first entry — the update was lost with no error anywhere. */ export declare function upsertTaskSessionHistory(piDir: string, entry: TaskSessionHistoryEntry): void; export declare function findTaskSessionHistory(piDir: string, taskId: string): TaskSessionHistoryEntry | undefined; export declare function findJsonlSessionByName(piDir: string, idOrSessionName: string, agentType?: string): TaskSessionHistoryEntry | null;