import { ActionContext, Policy, PolicyDecision, PolicyDisplay, PolicyScope } from "./policy-types.mjs"; //#region extensions/crypto/src/services/policy-evaluator.d.ts /** * Evaluate all active policies for a user against a proposed action. * Returns the most restrictive decision across all matching policies. */ declare function evaluatePolicies(ctx: ActionContext): PolicyDecision; /** * Record a tool execution against all matching active policies. * Called AFTER successful execution (not on block/confirm). */ declare function recordToolExecution(ctx: ActionContext): void; /** * Shared helper to extract userId from tool execution context. * Used by both the enforcement gate (index.ts) and the policy_manage tool. * Ensures consistent fallback chain everywhere. */ declare function extractPolicyUserId(ctx?: any): string; /** * Best-effort extraction of ActionContext from tool args. * Different tools encode amounts, tokens, addresses differently. * Returns what we can determine; undefined fields are left out. */ declare function extractActionContext(toolName: string, args: Record, userId: string): ActionContext; /** * Build a full display object for user verification. * Shows both the original NL and the exact structured interpretation. */ declare function buildPolicyDisplay(policy: Policy, userId: string): PolicyDisplay; /** * Render a PolicyDisplay as a formatted text block for chat output. * Both the user's original words and the structured interpretation * are shown so there's no room for misunderstanding. */ declare function renderPolicyDisplay(display: PolicyDisplay): string; declare class PolicyConfirmationStore { private nonces; /** Generate a nonce for a confirm decision. */ create(userId: string, toolName: string): string; /** Validate and consume a nonce. Returns true if valid. */ consume(nonce: string, userId: string, toolName: string): boolean; /** Prune expired entries and enforce max size. */ private prune; /** Clear all nonces (for testing). */ reset(): void; } declare function getPolicyConfirmationStore(): PolicyConfirmationStore; declare function resetPolicyConfirmationStore(): void; /** Expand category names into tool lists for scope rendering. */ declare function expandScope(scope: PolicyScope): string[]; //#endregion export { buildPolicyDisplay, evaluatePolicies, expandScope, extractActionContext, extractPolicyUserId, getPolicyConfirmationStore, recordToolExecution, renderPolicyDisplay, resetPolicyConfirmationStore }; //# sourceMappingURL=policy-evaluator.d.mts.map