import type Database from 'better-sqlite3';
import type { RequestContext } from '../middleware/auth';
import type { EnterpriseRepositoryScope } from './enterpriseRepository';
export type EnterpriseQuotaDecisionCode = 'OK' | 'TRACE_SIZE_QUOTA_EXCEEDED' | 'WORKSPACE_TRACE_STORAGE_QUOTA_EXCEEDED' | 'CONCURRENT_RUN_QUOTA_EXCEEDED' | 'MONTHLY_RUN_QUOTA_EXCEEDED';
export type EnterpriseQuotaDecisionStatus = 'allowed' | 'pending' | 'quota_exceeded';
export interface WorkspaceQuotaPolicy {
    maxTraceBytes?: number;
    maxWorkspaceTraceBytes?: number;
    maxConcurrentRuns?: number;
    monthlyRunLimit?: number;
}
export interface WorkspaceRetentionPolicy {
    defaultRetentionDays?: number;
    traceRetentionDays?: number;
    reportRetentionDays?: number;
}
export interface WorkspaceEnterprisePolicies {
    quotaPolicy: WorkspaceQuotaPolicy;
    retentionPolicy: WorkspaceRetentionPolicy;
}
export interface EnterpriseQuotaDecision {
    allowed: boolean;
    code: EnterpriseQuotaDecisionCode;
    status: EnterpriseQuotaDecisionStatus;
    httpStatus: number;
    message: string;
    details: Record<string, number | string | boolean>;
}
export declare function readWorkspaceEnterprisePolicies(db: Database.Database, scope: EnterpriseRepositoryScope): WorkspaceEnterprisePolicies;
export declare function resolveEnterpriseRetentionExpiresAt(db: Database.Database, scope: EnterpriseRepositoryScope, artifactType: 'trace' | 'report', createdAt: number): number | null;
export declare function evaluateTraceUploadQuota(context: RequestContext, sizeBytes: number, options?: {
    now?: number;
}): EnterpriseQuotaDecision;
export declare function evaluateAnalysisRunQuota(context: RequestContext, options?: {
    now?: number;
}): EnterpriseQuotaDecision;
//# sourceMappingURL=enterpriseQuotaPolicyService.d.ts.map