import type { MonoAgentAppConfigInput } from "./app-config.js"; import { type ConversationStatePurgePlan } from "./conversation-state-roots.js"; export interface PurgeSessionsResult { /** The resolved sessions root, or undefined when sessions are in-memory only. */ readonly root?: string; /** True when an on-disk sessions store existed and was removed. */ readonly removed: boolean; /** Count of removed `*.jsonl` session files (best-effort; 0 when none/unknown). */ readonly files: number; } export interface PurgeConversationHistoryResult { /** The durable conversation-history root beside the configured artifact directory. */ readonly root: string; /** True when an on-disk history store existed and was removed. */ readonly removed: boolean; readonly messageHistory: { /** Count of removed top-level `*.history.json` conversation records. */ readonly files: number; readonly bytes: number; }; readonly toolHistory: { /** Content-sidecar files plus the owner database in `.locks`. */ readonly files: number; readonly bytes: number; /** False means counts could not be read and are deliberately not reported as zero. */ readonly countsKnown: boolean; readonly calls?: number; readonly records?: number; readonly tombstones?: number; }; } export interface PurgeAcpSessionAuthorizationsResult { /** The durable ACP session-authorization root beside conversation history. */ readonly root: string; /** True when an on-disk authorization store existed and was removed. */ readonly removed: boolean; /** Count of removed `*.json` authorization records. */ readonly files: number; } export interface PurgeConversationStateResult { readonly sessions: PurgeSessionsResult; readonly history: PurgeConversationHistoryResult; readonly acpSessions: PurgeAcpSessionAuthorizationsResult; } export interface PurgeConversationStateOptions { /** @internal Deterministic race-test seam after every preflight validation and before any traversal. */ readonly hooks?: { readonly afterValidation?: (plan: ConversationStatePurgePlan) => void | Promise; /** Simulate process death after the manifest is durable but before the root rename. */ readonly afterManifestPublished?: (path: string) => void | Promise; /** Simulate process death after the durable manifest and quarantine rename. */ readonly afterRootQuarantined?: (path: string) => void | Promise; /** Simulate process death after quarantine deletion but before manifest removal. */ readonly afterQuarantineRemoved?: (path: string) => void | Promise; /** Race seam immediately before the final quarantine identity proof. */ readonly beforeQuarantineRemoval?: (path: string) => void | Promise; }; } /** * Remove the durable pi-session store so the next start begins with fresh sessions * instead of resuming persisted transcripts. A no-op (`removed: false`) when no * on-disk store is configured (in-memory sessions) or the directory does not exist. * * The runtime recreates the directory on the next session, and the agent's durable * memory lives elsewhere (`memory.path`), so this drops only resumable conversation * transcripts — not the knowledge base. Stop the worker before calling this so it is * not writing sessions while they are deleted. */ export declare function purgeSessions(input: MonoAgentAppConfigInput): Promise; /** * Remove the configured responder's canonical active-conversation history. * This root is separate from both run artifacts and `memory.path`; callers must * stop the worker first so no history transaction is active during deletion. */ export declare function purgeConversationHistory(input: MonoAgentAppConfigInput): Promise; /** Revoke every durable ACP session id associated with the configured responder. */ export declare function purgeAcpSessionAuthorizations(input: MonoAgentAppConfigInput): Promise; /** Clear every persisted conversation-continuity store while preserving memory and run artifacts. */ export declare function purgeConversationState(input: MonoAgentAppConfigInput, options?: PurgeConversationStateOptions): Promise; /** Stable model-private registry root used by the sandbox recovery guard. */ export declare function clearSessionsRegistryRoot(cwd: string): string; /** Generic, path-free model boundary: any pending or unsafe recovery state blocks execution. */ export declare function assertClearSessionsRecoveryResolved(cwd: string): Promise; //# sourceMappingURL=sessions.d.ts.map