import type { DB } from '../../data/db/index.js'; import type { Manifold } from '../../core/pipework.js'; import type { TraceContext } from '../../trace/entry/trace-context.js'; /** A transaction bound to a specific context nonce and tenant — defense-in-depth against ALS context swaps. */ export interface BoundTransaction { readonly drizzle: DB; readonly nonce: string; readonly tenant: string | null; } /** The AsyncLocalStorage context — carries requestId, auth, tenant, active transactions, and a nonce for integrity checks. */ export interface Flow { readonly instance: Manifold; readonly requestId: string; readonly _nonce: string; readonly auth: TAuth | null; readonly tenant: string | null; /** The acting principal's user id — propagated as `pipework.user_id` for user-level RLS. */ readonly user: string | null; /** The as-of instant access is evaluated against — propagated as `pipework.asof` for temporal RLS. Null = current. */ readonly asOf: string | null; readonly metadata: RequestMetadata | null; readonly jobType: string | null; readonly transactions: Map; /** The trace opened at this entry, or `null` when the entry ran untraced. */ readonly trace: TraceContext | null; } /** HTTP request metadata stored in a Flow — method, path, trace ID, session ID. */ export interface RequestMetadata { readonly method: string; readonly path: string; readonly startedAt: number; readonly traceId: string; readonly sessionId: string | null; } //# sourceMappingURL=types.d.ts.map