/** * memory-delete — soft-delete a single graph node by elementId. * * Adds the `:Trashed` label, snapshots unique-key properties, and writes * provenance (`trashedAt`, `trashedBy`, `trashReason`). Relationships are * preserved. The node disappears from `memory-search` and any read filtered * via `notTrashed`. Hard removal happens later via `memory-empty-trash` after * the grace period. * * For `KnowledgeDocument` and `ConversationArchive` (Task 397), the trash cascades to linked `Section` and `Chunk` * children so the entire document hierarchy disappears together; restore * walks the same edges to bring it back. * * For `Conversation`, the cascade to attached `(m:Message)-[:PART_OF]->(c)` * messages lives inside `trashNode` itself — `memory-delete` just * calls through and reports the message count. * * Filter-token contract: when the caller passes `filterToken`, * the token is verified (HMAC, TTL) and the server re-runs the same canonical * predicate that produced the token to confirm the target elementId still * matches. A mismatch throws with `outcome=rejected` — no `force=true` path, * no "trust me I already computed this" escape hatch. Tokens are minted by * `memory-find-candidates`; a stale or forged token never deletes anything. * * GDPR cascade deletion (`contact-erase`) bypasses this primitive and * hard-deletes per Article 17. Use that tool, not `force=true` here — there * is no `force` here. */ export interface MemoryDeleteParams { accountId: string; elementId: string; reason?: string; /** * Opaque token from `memory-find-candidates`. Required when the delete * originates from a bulk-selector flow; the server re-runs the selection * predicate on this elementId before trashing. Omit for single-node UI * deletes (the `/graph` side-panel path, which goes through the Hono * `graph-delete` route directly against `trashNode`, never via this tool). */ filterToken?: string; /** * Task 443 — set to `"system"` only by the installer reset path that * legitimately needs to remove the per-account root `:LocalBusiness` * before re-seeding. The MCP tool handler never forwards this, so any * agent-originated call is treated as non-system and refused for * `:LocalBusiness` targets. */ origin?: "system"; } export interface MemoryDeleteResult { elementId: string; labels: string[]; trashedAt: string; alreadyTrashed: boolean; cascade: { sections: number; chunks: number; }; } export declare class FilterTokenError extends Error { readonly reason: "malformed" | "bad-signature" | "expired" | "mismatch"; constructor(message: string, reason: "malformed" | "bad-signature" | "expired" | "mismatch"); } export declare function memoryDelete(params: MemoryDeleteParams): Promise; //# sourceMappingURL=memory-delete.d.ts.map