import { SqliteConnection } from "./connection.js"; import { AgentRegistryEntry, SessionAuditEntry, SessionMetadata, SessionStoreExt, SessionWorkflowRun } from "@graphorin/core/contracts"; import { HandoffRecord, SessionScope } from "@graphorin/core"; //#region src/session-store.d.ts /** * Default `SessionStore` implementation. Owns: * - `sessions` rows. * - `agents_registry` rows. * - `session_handoffs` rows. * - `session_workflow_runs` mapping. * - `session_audit` lifecycle rows. * * Per `DEC-147`, the actual `session_messages` rows live in * `@graphorin/store-sqlite`'s `MemoryStore` (single source of truth). * * @stable */ declare class SqliteSessionStore implements SessionStoreExt { #private; constructor(conn: SqliteConnection); createSession(metadata: SessionMetadata): Promise; getSession(sessionId: string): Promise; listSessions(scope: Pick): Promise>; updateSession(sessionId: string, patch: Partial): Promise; closeSession(sessionId: string, closedAt: string): Promise; registerAgent(entry: AgentRegistryEntry): Promise; retireAgent(agentId: string, retiredAt: string): Promise; deleteAgent(agentId: string): Promise; resolveAgent(agentId: string): Promise; listAgents(): Promise>; appendHandoff(sessionId: string, record: HandoffRecord): Promise; listHandoffs(sessionId: string): Promise>; attachWorkflowRun(run: SessionWorkflowRun): Promise; updateWorkflowRunStatus(sessionId: string, workflowId: string, threadId: string, status: SessionWorkflowRun['status']): Promise; listWorkflowRuns(sessionId: string): Promise>; appendAuditEntry(entry: SessionAuditEntry): Promise; listAuditEntries(sessionId: string, opts?: { readonly limit?: number; }): Promise>; pruneAuditEntries(beforeEpochMs: number): Promise; /** Hard-delete a session + its handoffs / workflow runs / audit rows. */ deleteSession(sessionId: string): Promise; /** Retention sweep - delete every session matching the policy. */ pruneSessions(opts: { readonly beforeEpochMs?: number; readonly closedOnly?: boolean; }): Promise; } /** * One entry of the session-content purge registry: which table holds * session-scoped rows, which column scopes them, and which sidecars * (FTS shadow, per-embedder vec0 tables, FK-referencing tables, * memory-history value scrub) must go with them. * * @stable */ interface SessionScopedPurge { /** Base table holding the session-scoped rows. */ readonly table: string; /** Column carrying the session id. */ readonly sessionColumn: 'scope_session_id' | 'session_id'; /** FTS5 shadow table joined by rowid, when the table has one. */ readonly fts?: string; /** Per-embedder vec0 sidecar family (name prefix + id column). */ readonly vec?: { readonly prefix: string; readonly idColumn: string; }; /** Tables referencing the base rows - cleared BEFORE the base rows. */ readonly refs?: ReadonlyArray<{ readonly table: string; readonly column: string; }>; /** * Scrub `memory_history` values for the deleted rows. * `valueMatch` additionally clears history rows whose * values equal the deleted row's text (the SUPERSEDE shape). */ readonly history?: { readonly kind: string; readonly textColumn: string; readonly valueMatch: boolean; }; } /** * Declarative registry of every session-scoped CONTENT surface the * session hard-delete cascade purges. The gate test in * `tests/erasure-cascade.test.ts` diffs this list (plus * {@link SESSION_TABLE_EXEMPTIONS}) against the live schema: a new * table with a session column fails the suite until its author decides * how erasure covers it. * * @stable */ declare const SESSION_SCOPED_PURGES: ReadonlyArray; /** * Session-column-bearing tables intentionally NOT in * {@link SESSION_SCOPED_PURGES}, each with the reason erasure is still * complete. Consumed by the completeness gate test. * * @stable */ declare const SESSION_TABLE_EXEMPTIONS: Readonly>; //#endregion export { SESSION_SCOPED_PURGES, SESSION_TABLE_EXEMPTIONS, SessionScopedPurge, SqliteSessionStore }; //# sourceMappingURL=session-store.d.ts.map