/**
 * Interpreter - AST Execution Engine
 *
 * Main interpreter class that executes bash AST nodes.
 * Delegates to specialized modules for:
 * - Word expansion (expansion.ts)
 * - Arithmetic evaluation (arithmetic.ts)
 * - Conditional evaluation (conditionals.ts)
 * - Built-in commands (builtins.ts)
 * - Redirections (redirections.ts)
 */
import { AgenticHealer } from "../agentic/agentic-healer.js";
import type { PipelineNode, ScriptNode, StatementNode } from "../ast/types.js";
import type { IFileSystem } from "../fs/interface.js";
import type { ExecutionLimits } from "../limits.js";
import { SemanticEngine } from "../lsp/semantic-engine.js";
import type { SecureFetch } from "../network/index.js";
import type { SharedStateBus } from "../services/SharedStateBus.js";
import type { CommandRegistry, ExecResult, FeatureCoverageWriter, OutputSink, TraceCallback } from "../types.js";
import type { DebuggerBridge } from "./debugger/debugger.js";
import type { InterpreterState } from "./types.js";
export type { InterpreterContext, InterpreterState } from "./types.js";
export interface InterpreterOptions {
    fs: IFileSystem;
    commands: CommandRegistry;
    limits: Required<ExecutionLimits>;
    exec: (script: string, options?: {
        env?: Record<string, string>;
        cwd?: string;
        replaceEnv?: boolean;
        signal?: AbortSignal;
        args?: string[];
    }) => Promise<ExecResult>;
    fetch?: SecureFetch;
    sleep?: (ms: number) => Promise<void>;
    trace?: TraceCallback;
    coverage?: FeatureCoverageWriter;
    requireDefenseContext?: boolean;
    jsBootstrapCode?: string;
    onCommandNotFound?: (command: string, args: string[]) => Promise<ExecResult | null>;
    /** Returns list of all registered command names */
    getRegisteredCommands?: () => string[];
    /** If true, enables agentic behavior for the shell */
    agentic?: boolean;
    /** Optional debugger implementation */
    debugger?: DebuggerBridge;
    /** Optional semantic engine implementation */
    semanticEngine?: SemanticEngine;
    /** Optional agentic healer implementation */
    agenticHealer?: AgenticHealer;
    /** Optional shared state bus implementation */
    sharedBus?: SharedStateBus;
    /** Reference to the parent Bash instance */
    bash?: any;
    /**
     * Optional opt-in sink for incremental (true) streaming of stdout/stderr.
     * When undefined, execution is byte-identical to the buffered path.
     */
    sink?: OutputSink;
}
/**
 * Shell Interpreter
 *
 * Implements the core bash execution logic by traversing the AST.
 */
export declare class Interpreter {
    private ctx;
    private estimatedMemoryBytes;
    private statementsSinceMemoryCheck;
    private cachedExportedEnv;
    constructor(options: InterpreterOptions, state: InterpreterState);
    /**
     * Fail closed if defense is expected but async context is missing.
     */
    private assertDefenseContext;
    /**
     * Build environment record containing only exported variables.
     * In bash, only exported variables are passed to child processes.
     * This includes both permanently exported variables (via export/declare -x)
     * and temporarily exported variables (prefix assignments like FOO=bar cmd).
     *
     * 2.6 — Incremental Exported Env: returns a cached record when the exported
     * variable set has not changed since the last call, avoiding a full rebuild
     * on every external command execution.
     */
    private buildExportedEnv;
    executeScript(node: ScriptNode): Promise<ExecResult>;
    /**
     * Execute a user script file found in PATH.
     */
    private executeUserScript;
    executeStatement(node: StatementNode): Promise<ExecResult>;
    executePipeline(node: PipelineNode): Promise<ExecResult>;
    private executeCommand;
    /**
     * Estimate memory usage of the current interpreter state.
     */
    private estimateMemoryUsage;
    private executeSimpleCommand;
    private executeSimpleCommandInner;
    private runCommand;
    private aliasExpansionStack;
    private expandAlias;
    findCommandInPath(commandName: string): Promise<string[]>;
    private executeSubshell;
    private executeGroup;
    private executeArithmeticCommand;
    private executeConditionalCommand;
}
