import type Database from 'better-sqlite3';
import type { RequestContext } from '../middleware/auth';
type SqliteBindValue = string | number | bigint | Buffer | null;
export interface EnterpriseRepositoryScope {
    tenantId: string;
    workspaceId: string;
    userId?: string;
}
export type EnterpriseWorkspaceScopedTable = 'trace_assets' | 'trace_processor_leases' | 'analysis_sessions' | 'analysis_runs' | 'conversation_turns' | 'agent_events' | 'analysis_result_snapshots' | 'runtime_snapshots' | 'report_artifacts' | 'memory_entries' | 'skill_registry_entries';
export declare const ENTERPRISE_WORKSPACE_SCOPED_TABLES: readonly EnterpriseWorkspaceScopedTable[];
export type EnterpriseQueryCriteria = Record<string, SqliteBindValue | undefined>;
export type EnterpriseUpdateValues = Record<string, SqliteBindValue | undefined>;
export interface ScopedWhereClause {
    sql: string;
    params: Record<string, SqliteBindValue>;
}
export interface ListOptions {
    orderBy?: string;
    direction?: 'ASC' | 'DESC';
    limit?: number;
}
export declare function repositoryScopeFromRequestContext(context: RequestContext): EnterpriseRepositoryScope;
export declare function buildWorkspaceScopedWhere(scope: EnterpriseRepositoryScope, criteria?: EnterpriseQueryCriteria): ScopedWhereClause;
export declare class EnterpriseWorkspaceRepository<Row extends Record<string, unknown>> {
    private readonly db;
    private readonly table;
    constructor(db: Database.Database, table: EnterpriseWorkspaceScopedTable);
    getById(scope: EnterpriseRepositoryScope, id: string): Row | null;
    list(scope: EnterpriseRepositoryScope, criteria?: EnterpriseQueryCriteria, options?: ListOptions): Row[];
    updateById(scope: EnterpriseRepositoryScope, id: string, values: EnterpriseUpdateValues): number;
    upsertById(scope: EnterpriseRepositoryScope, id: string, values: EnterpriseUpdateValues): number;
    deleteById(scope: EnterpriseRepositoryScope, id: string): number;
}
export declare function createEnterpriseWorkspaceRepository<Row extends Record<string, unknown>>(db: Database.Database, table: EnterpriseWorkspaceScopedTable): EnterpriseWorkspaceRepository<Row>;
export {};
//# sourceMappingURL=enterpriseRepository.d.ts.map