import { type EmptyTrashResult } from "../../../../../lib/graph-trash/dist/index.js"; /** * memory-empty-trash — hard-delete trashed nodes whose `trashedAt` is older * than the grace period. * * Per-label cleanup runs in the `onEmpty` callback before the `DETACH DELETE`: * - `:KnowledgeDocument` → removes the on-disk attachment directory * (snapshotted `attachmentId` from `_trashedKeys`). * `:ConversationArchive` (Task 397) carries no attachmentId, so it * bypasses the disk-cleanup branch — graph DETACH DELETE is sufficient. * - `:AdminConversation` → purges every attached JSONL via * `purgeAdminConversationJsonls`. Required because the graph-page * cascade is forward-only — `:Trashed :AdminConversation` rows * produced by manual Cypher / future bulk-delete / legacy traffic * still have JSONLs on disk that the Sidebar will surface as ghost rows. * * When the AdminConversation purge can't proceed (no manager port, * sessionId missing from `_trashedKeys`, manager 409/5xx), the * callback throws and the `emptyTrash` primitive skips the `DETACH DELETE` * this run; the candidate becomes eligible again on the next sweep. * * Defaults: `graceDays=30`, `dryRun=false`, no label filter. `dryRun=true` * lists candidates without mutating; the absence of `[trash:emptied]` lines * after a `dryRun=true` `[trash:empty-run]` is the correct-behaviour signal. */ export interface MemoryEmptyTrashParams { accountId: string; graceDays?: number; dryRun?: boolean; labels?: string[]; /** Loopback manager base URL — `http://127.0.0.1:${CLAUDE_SESSION_MANAGER_PORT}`. * Defaults from env at call time. When neither this nor the env var is set, * `:AdminConversation` candidates throw and skip; other labels proceed. */ managerBase?: string; /** Test hook — defaults to global `fetch`. */ fetchImpl?: typeof fetch; /** * Task 443 — set to `"system"` only by the installer reset path that * legitimately needs to hard-delete the per-account root * `:LocalBusiness`. The MCP tool handler never forwards this, so any * agent-originated sweep leaves trashed `:LocalBusiness` rows untouched. */ origin?: "system"; } export interface MemoryEmptyTrashResult extends EmptyTrashResult { attachmentDirsRemoved: number; adminConversationsPurged: number; } export declare function memoryEmptyTrash(params: MemoryEmptyTrashParams): Promise; //# sourceMappingURL=memory-empty-trash.d.ts.map