import type { SExpr } from '../SExpr';
import { EvalContext } from './Environment';
import type { ILispSecurityContext } from '../../core/security/LispSecurityContext';
/**
 * Remote call handler interface
 * Implemented by MatrixActor wrapper for network calls
 */
export interface IRemoteCallHandler {
    call(mount: string, command: string, params: unknown): Promise<unknown>;
    isLocal(mount: string): boolean;
    localCall(mount: string, command: string, params: unknown): Promise<unknown>;
}
/**
 * Interpreter configuration options
 */
export interface IInterpreterOptions {
    /** Handler for remote component calls */
    remoteHandler?: IRemoteCallHandler;
    /** Maximum call depth to prevent infinite recursion */
    maxCallDepth?: number;
    /**
     * Security context for evaluation.
     *
     * Controls which primitives and operations are allowed.
     * When undefined, all operations are permitted (development mode).
     *
     * See: Vision/18-VIRTUAL-LISP-MACHINE.md Section "Security Enforcement"
     */
    securityContext?: ILispSecurityContext;
}
/**
 * LISP Interpreter - Core evaluation engine
 *
 * This class contains the pure evaluation logic extracted from LispEval.
 * It can be used standalone for local evaluation or wrapped by a
 * MatrixActor for distributed evaluation.
 *
 * Security enforcement (Vision 18 & 27):
 * - When securityContext is provided, all primitive operations are checked
 * - `call`, `emit`, `spawn` operations are validated against allowed targets
 * - Resource limits (depth, time) are enforced during evaluation
 */
export declare class Interpreter {
    private _context;
    private _remoteHandler?;
    private _maxCallDepth;
    private _callDepth;
    /**
     * Security context for this interpreter instance.
     *
     * When set, primitive operations are checked against the allowlist/blocklist,
     * and call targets are validated before execution.
     */
    private _securityContext?;
    /** Evaluation start time for timeout enforcement */
    private _evalStartTime;
    constructor(options?: IInterpreterOptions);
    /**
     * Set the security context for this interpreter.
     *
     * @param context - Security context to use for subsequent evaluations
     */
    setSecurityContext(context: ILispSecurityContext | undefined): void;
    /**
     * Get the current security context.
     */
    get securityContext(): ILispSecurityContext | undefined;
    /**
     * Get the evaluation context
     */
    get context(): EvalContext;
    /**
     * Evaluate an S-expression
     *
     * Security enforcement:
     * - Depth limit from securityContext.maxEvalDepth (if set)
     * - Timeout from securityContext.maxExecutionMs (if set)
     */
    evaluate(expr: SExpr): Promise<unknown>;
    /**
     * Core evaluation logic - recursively evaluates S-expressions
     *
     * Security enforcement (Vision 18 & 27):
     * - Timeout check at start of each evaluation
     * - Primitive allowlist/blocklist check for operations
     */
    private _evaluate;
    /**
     * Normalize introspect result or user-provided object to IComponentSchema format
     */
    private _normalizeToIComponentSchema;
    private _evalAdd;
    private _evalSub;
    private _evalMul;
    private _evalDiv;
    private _evalIf;
    private _evalCond;
    private _evalCase;
    private _evalLet;
    private _evalLetStar;
    private _evalRange;
    /**
     * Apply a lambda (closure) to arguments
     */
    private _applyLambda;
    /**
     * Process quasiquote - handle unquote and unquote-splicing
     */
    private _processQuasiquote;
    /**
     * Expand a macro - substitute arguments into body
     */
    private _expandMacro;
    /**
     * Substitute variables in an expression (for macro expansion)
     */
    private _substituteInExpr;
}
//# sourceMappingURL=Interpreter.d.ts.map