export interface ExecutionContext {
    toolName: string;
    args: Record<string, unknown>;
    adapterName: string;
    projectHash?: string;
    currentTask?: string;
    startTimeMs: number;
    meta: Record<string, unknown>;
}
export interface ToolResult {
    content: Array<{
        type: string;
        text: string;
    }>;
}
export interface NexusMiddleware {
    name: string;
    priority: number;
    before?(ctx: ExecutionContext): Promise<void> | void;
    after?(ctx: ExecutionContext, result: ToolResult): Promise<void> | void;
    onError?(ctx: ExecutionContext, error: unknown): Promise<void> | void;
}
/** Enforces token budget limits before execution */
export declare const TokenBudgetMiddleware: NexusMiddleware;
/** Tracks feature usage and timing via telemetry */
export declare const TelemetryMiddleware: NexusMiddleware;
/** Auto-injects project memories and scopes stored memories */
export declare const MemoryMiddleware: NexusMiddleware;
/** Mindkit safety check before file modifications */
export declare const GuardrailsMiddleware: NexusMiddleware;
/** Estimates and logs cost per operation */
export declare const CostMiddleware: NexusMiddleware;
/** Create a pipeline with all built-in middleware pre-registered */
export declare function createDefaultPipeline(): MiddlewarePipeline;
export declare class MiddlewarePipeline {
    private chain;
    /** Override for tests — set before calling execute(). */
    deadlineMs: number;
    register(middleware: NexusMiddleware): void;
    execute(ctx: ExecutionContext, handler: () => Promise<ToolResult>): Promise<ToolResult>;
    private _run;
}
