/**
 * JavaScript REPL Runtime
 *
 * Persistent sandboxed JS execution environment using Node.js `vm` module.
 * Variables persist across calls. No access to require(), process, fs, etc.
 *
 * Registered as a tool for the agent to execute JavaScript expressions
 * and inspect results during coding sessions.
 */
import type { ToolResult } from '../types/index.js';
import type { ITool, ToolSchema, IToolMetadata } from './registry/types.js';
export interface JSReplResult {
    result: string;
    error?: string;
}
export declare class JSRepl {
    private context;
    private readonly timeoutMs;
    constructor(timeoutMs?: number);
    /**
     * Execute JavaScript code in the sandboxed context.
     * Variables persist across calls.
     */
    execute(code: string): JSReplResult;
    /**
     * Reset the execution context, clearing all variables.
     */
    reset(): void;
    /**
     * Get all user-defined variables in the context.
     */
    getVariables(): Record<string, unknown>;
    /**
     * Create a sandboxed VM context with safe globals only.
     */
    private createSandboxedContext;
    /**
     * Format a value for display.
     */
    private formatResult;
}
export declare class JSReplTool implements ITool {
    readonly name = "js_repl";
    readonly description = "Execute JavaScript code in a persistent sandboxed REPL. Variables persist across calls. No filesystem or network access.";
    private repl;
    constructor();
    execute(input: Record<string, unknown>): Promise<ToolResult>;
    getSchema(): ToolSchema;
    getMetadata(): IToolMetadata;
    validate(input: unknown): {
        valid: boolean;
        errors?: string[];
    };
    dispose(): void;
}
export declare const JS_REPL_TOOL: {
    type: "function";
    function: {
        name: string;
        description: string;
        parameters: {
            type: string;
            properties: {
                action: {
                    type: string;
                    enum: string[];
                    description: string;
                };
                code: {
                    type: string;
                    description: string;
                };
            };
        };
    };
};
export declare function getJSRepl(): JSRepl;
export declare function resetJSRepl(): void;
