export interface RuleCondition { tools?: string[]; toolPatterns?: string[]; paramPatterns?: Record; requireFields?: string[]; forbidPatterns?: string[]; maxCallsPerMinute?: number; maxNumericFields?: Record; requirePriorTools?: string[]; requiresContextWarning?: boolean; requiresPreviousFailure?: boolean; } export interface Rule { id: string; name: string; gate: 1 | 2 | 3 | 4; level: "constitutional" | "project" | "session"; condition: RuleCondition; action: "deny" | "warn" | "allow"; message: string; enabled: boolean; createdAt?: number; updatedAt?: number; } export type Decision = "allow" | "deny" | "warn"; export interface MCPContext { toolName: string; args: Record; sessionId?: string; tokenPayload?: { sub: string; project: string; iat: number; exp: number; scope: string[]; }; priorTools?: string[]; contextWarning?: string; previousFailure?: { toolName: string; message: string; timestamp: number; }; } export interface EnforceResult { allowed: boolean; rule?: Rule; message?: string; warning?: string; } export interface AuditEntry { seq: number; ts: number; tool: string; argsHash: string; decision: Decision; ruleId: string | null; sessionId: string; prevHash: string; signature: string; } export interface Receipt { tool: string; ts: number; exp: number; queryHash: string; hmac: string; } export type DomainActionAttemptStatus = "succeeded" | "failed" | "timeout" | "unavailable"; export interface DomainActionAttempt { id: string; tool: string; status: DomainActionAttemptStatus; attemptedAt: number; toolUseId?: string; reason?: string; } export interface DomainActionDegradation { missedTool: string; failedAttemptCount: number; reason: string; authorizedByContextReceipt: string; authorizedAt: number; } export interface ContextReceipt { projectRoot: string; sessionId: string; executionId: string; contextHash: string; issuedAt: number; expiresAt: number; /** Code files selected by the canonical task envelope. */ selectedFiles?: string[]; /** Memory evidence selected by the canonical task envelope. */ memoryIds?: string[]; /** Tool name of the envelope's canonical next action. */ canonicalNextAction?: string; /** Complete receipt-bound action contract emitted by ContextEngine. */ canonicalAction?: import("./task-context-envelope.js").CanonicalAction; /** Durable outcomes for attempts to execute the canonical action. */ actionAttempts?: DomainActionAttempt[]; /** Timestamp at which the required action completed successfully. */ actionSatisfiedAt?: number; /** Evidence-bound authorization for a direct degraded fallback. */ actionDegradation?: DomainActionDegradation; /** Canonical request identity used across retrieval and adoption telemetry. */ requestId?: string; } //# sourceMappingURL=enforcer.d.ts.map