/** * SQLite-backed implementations of `ElicitationStore` and `GrantStore`. * * These hold OAuth state that currently goes through `MemoryElicitationStore` * and `MemoryGrantStore` in `oauth.ts` — elicitation requests (short-lived, * waiting for a user to complete the upstream OAuth flow) and photon grants * (long-lived, encrypted refresh tokens for upstream APIs like Stripe/GitHub). * * Without persistent storage, every daemon restart forces users to re-auth * against every upstream provider because the grants live in memory only. * Moving grants to SQLite fixes that; elicitations benefit because pending * approvals survive a crash of the daemon during the redirect window. * * Runtime-agnostic via `src/shared/sqlite-runtime.ts`: * - Under Bun: uses built-in `bun:sqlite` * - Under Node: falls back to `better-sqlite3` */ import type { ElicitationRequest, PhotonGrant } from '../types/index.js'; import type { ElicitationStore, GrantStore } from './oauth.js'; import { type SqliteDatabase } from '../../shared/sqlite-runtime.js'; export declare function openOauthDatabase(path: string): Promise; export declare class SqliteElicitationStore implements ElicitationStore { private insert; private select; private updateStmt; private remove; private sweepStmt; constructor(db: SqliteDatabase); create(data: Omit): Promise; get(id: string): Promise; update(id: string, data: Partial): Promise; delete(id: string): Promise; cleanup(): Promise; } export declare class SqliteGrantStore implements GrantStore { private insert; private selectByKey; private selectByUser; private updateStmt; private remove; constructor(db: SqliteDatabase); find(tenantId: string, photonId: string, provider: string, userId?: string): Promise; create(data: Omit): Promise; update(id: string, data: Partial): Promise; delete(id: string): Promise; findByUser(tenantId: string, userId: string): Promise; } //# sourceMappingURL=oauth-sqlite-stores.d.ts.map