import type { ReplicaMessage } from './replica.js'; import type { AccessPolicy, AuditEntry, CommandCatalog, CommandEnvelope, Domain, DomainModule, PolicyInput, Stop } from './types.js'; export interface StateRiskRule { readonly name: string; readonly score: number; readonly commands?: readonly string[]; readonly when?: (input: PolicyInput) => boolean | Promise; readonly reason?: string; } export interface StateRiskReport { readonly score: number; readonly level: 'low' | 'medium' | 'high' | 'critical'; readonly reasons: readonly string[]; readonly requiresApproval: boolean; } export interface StateGuard { assess(input: PolicyInput): Promise; policy(base?: AccessPolicy): AccessPolicy; module(sink?: (report: StateRiskReport, envelope: CommandEnvelope) => void): DomainModule; } export declare function forgeStateGuard(rules: readonly StateRiskRule[], options?: { readonly approvalScore?: number; readonly denyScore?: number; }): StateGuard; export interface CommandSlaRule { readonly command?: string; readonly maxDurationMs?: number; readonly maxPatchCount?: number; readonly requireActor?: boolean; readonly allowedActors?: readonly string[]; readonly allowedTags?: Readonly>; } export interface SlaViolation { readonly command: string; readonly commandId: string; readonly reason: string; readonly entry: AuditEntry; } export declare function commandSlaModule(rules: readonly CommandSlaRule[], onViolation: (violation: SlaViolation) => void): DomainModule; export interface MutationProfile { readonly command: string; readonly runs: number; readonly rejected: number; readonly totalDurationMs: number; readonly maxDurationMs: number; readonly totalPatches: number; readonly maxPatchCount: number; } export interface MutationProfiler { readonly module: DomainModule; report(): readonly MutationProfile[]; reset(): void; } export declare function forgeMutationProfiler(): MutationProfiler; export interface AuditQuery { readonly command?: string | RegExp; readonly actor?: string; readonly status?: AuditEntry['status']; readonly tag?: readonly [string, string]; readonly sinceRevision?: number; readonly minDurationMs?: number; readonly minPatchCount?: number; } export declare function queryAudit(entries: readonly AuditEntry[], query: AuditQuery): readonly AuditEntry[]; export interface PolicyReplayResult { readonly entry: AuditEntry; readonly allowed: boolean; } export declare function replayPolicy(entries: readonly AuditEntry[], policy: AccessPolicy, state: Readonly, payloads?: Readonly>): Promise; export interface TenantHub> { get(tenantId: string): Domain; has(tenantId: string): boolean; list(): readonly string[]; dispose(tenantId: string): boolean; disposeAll(): void; } export declare function forgeTenantHub>(factory: (tenantId: string) => Domain): TenantHub; export interface RedactionProfile { readonly name: string; readonly hiddenTags?: readonly string[]; readonly replacement?: string; } export declare function forgeRedactionProfiles(profiles: readonly RedactionProfile[]): { apply(entry: AuditEntry, name: string): AuditEntry; names: () => string[]; }; export interface DomainDependencyGraph { addDomain(name: string): void; link(from: string, to: string, reason?: string): void; affectedBy(name: string): readonly string[]; edges(): readonly { readonly from: string; readonly to: string; readonly reason?: string; }[]; } export declare function forgeDomainGraph(): DomainDependencyGraph; export interface ReadinessInput { readonly policies?: boolean; readonly invariants?: boolean; readonly audit?: boolean; readonly persistence?: boolean; readonly checksums?: boolean; readonly actorTags?: boolean; readonly rollback?: boolean; readonly tests?: boolean; readonly inspector?: boolean; readonly schema?: boolean; } export interface ReadinessScore { readonly score: number; readonly grade: 'experimental' | 'team-ready' | 'enterprise-ready' | 'regulated-ready'; readonly missing: readonly string[]; } export declare function scoreEnterpriseReadiness(input: ReadinessInput): ReadinessScore; export declare const replicaConflictStrategies: { applyPatches(local: Readonly, incoming: ReplicaMessage): State; serverAuthoritative(_local: Readonly, incoming: ReplicaMessage & { readonly state?: State; }): State; lastWriteWins(local: Readonly, incoming: ReplicaMessage & { readonly state?: State; }): State; }; export declare function stateTimeline(entries: readonly AuditEntry[]): { byActor: (actor: string) => readonly AuditEntry[]; byCommand: (command: string | RegExp) => readonly AuditEntry[]; rejected: () => readonly AuditEntry[]; slow: (minDurationMs: number) => readonly AuditEntry[]; patchHeavy: (minPatchCount: number) => readonly AuditEntry[]; }; export declare function bindDomainGraph>(graph: DomainDependencyGraph, domain: Domain, dependencies: readonly string[]): Stop; //# sourceMappingURL=enterprise.d.ts.map