import type { RequestContext } from '../middleware/auth';
export interface KnowledgeScope {
    tenantId?: string;
    workspaceId?: string;
    userId?: string;
    sourceRunId?: string;
    runId?: string;
}
export interface ResolvedKnowledgeScope {
    tenantId: string;
    workspaceId: string;
    userId?: string;
    sourceRunId?: string;
}
export interface ScopedKnowledgeRecord<T> {
    externalId: string;
    rowScope: string;
    record: T;
    sourceRunId?: string;
    createdAt: number;
    updatedAt: number;
}
interface ListOptions {
    rowScope?: string;
    rowScopePrefix?: string;
    includeSystem?: boolean;
}
interface UpsertOptions {
    createdAt?: number;
    updatedAt?: number;
    sourceRunId?: string;
    embeddingRef?: string;
}
export declare function enterpriseKnowledgeStoreEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function enterpriseKnowledgeDbWritesEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function legacyKnowledgeFilesystemWritesEnabled(env?: NodeJS.ProcessEnv): boolean;
export declare function knowledgeScopeFromRequestContext(context: RequestContext): KnowledgeScope;
export declare function resolveKnowledgeScope(scope?: KnowledgeScope): ResolvedKnowledgeScope;
export declare function scopedKnowledgeRowId(kind: string, externalId: string, scope: Pick<ResolvedKnowledgeScope, 'tenantId' | 'workspaceId'>): string;
export declare function upsertScopedKnowledgeRecord<T>(kind: string, externalId: string, rowScope: string, record: T, scopeInput?: KnowledgeScope, opts?: UpsertOptions): void;
export declare function getScopedKnowledgeRecord<T>(kind: string, externalId: string, scopeInput?: KnowledgeScope): ScopedKnowledgeRecord<T> | undefined;
export declare function removeScopedKnowledgeRecord(kind: string, externalId: string, scopeInput?: KnowledgeScope): boolean;
export declare function listScopedKnowledgeRecords<T>(kind: string, scopeInput?: KnowledgeScope, opts?: ListOptions): ScopedKnowledgeRecord<T>[];
export {};
//# sourceMappingURL=scopedKnowledgeStore.d.ts.map