/** * RTVM Interpreter * * Deterministic bytecode interpreter for rule evaluation (Enhancement #3). */ import { type BytecodeProgram } from './bytecode.js'; /** * Execution context providing field values */ export interface ExecutionContext { /** Get field value by path (e.g., "loan.amount") */ getField(path: string): unknown; /** Optional: Get current timestamp (for deterministic testing) */ getNow?: () => number; } /** * Execution result */ export interface ExecutionResult { /** Final boolean result */ result: boolean; /** Execution metrics */ metrics: { instructionsExecuted: number; maxStackDepth: number; executionTimeMs: number; }; /** Any errors encountered */ error?: string; } /** * Execution options */ export interface ExecutionOptions { /** Maximum instructions to execute (safety limit) */ maxInstructions?: number; /** Enable debug tracing */ debug?: boolean; } /** * RTVM Interpreter */ export declare class RTVMInterpreter { private program; private context; private options; private stack; private locals; private pc; private instructionCount; private maxStackDepth; constructor(program: BytecodeProgram, context: ExecutionContext, options?: ExecutionOptions); /** * Execute the program */ execute(): ExecutionResult; /** * Execute a single instruction */ private executeInstruction; /** * Execute built-in function */ private executeBuiltin; private push; private pop; private peek; private getConstantValue; private getConstantString; private resolveConstant; private equals; } /** * Execute a bytecode program */ export declare function executeProgram(program: BytecodeProgram, context: ExecutionContext, options?: ExecutionOptions): ExecutionResult; /** * Create an execution context from an event payload */ export declare function createContextFromPayload(payload: Record): ExecutionContext; //# sourceMappingURL=interpreter.d.ts.map