import type { MinionConfig } from "../../config/config.js";
import type { ToolLoopDetectionConfig } from "../../config/types.tools.js";
import { isPlainObject } from "../../utils.js";
import type { ApprovalContext } from "../bootstrap/approval-gate.js";
import type { AnyAgentTool } from "../tools/common.js";
export type HookContext = {
    agentId?: string;
    sessionKey?: string;
    loopDetection?: ToolLoopDetectionConfig;
    /** Config for autonomy enforcement checks on exec/shell tools. */
    config?: MinionConfig;
    /** Optional context for the human-in-the-loop approval gate (Sprint E.1). */
    approvalContext?: ApprovalContext;
};
type HookOutcome = {
    blocked: true;
    reason: string;
} | {
    blocked: false;
    params: unknown;
};
/**
 * Detect tool calls that appear to be truncated from a cut-off LLM stream.
 *
 * Two signals are checked:
 * 1. The raw tool name is empty/blank — the stream stopped before emitting a name.
 * 2. The raw params value is a non-empty string that is not valid JSON — the stream
 *    delivered a partial JSON fragment that the SDK forwarded without completing it.
 *
 * Returns a human-readable reason string when truncation is detected, `null` otherwise.
 */
export declare function detectTruncatedToolCall(rawName: string, params: unknown): string | null;
export declare function runBeforeToolCallHook(args: {
    toolName: string;
    params: unknown;
    toolCallId?: string;
    ctx?: HookContext;
}): Promise<HookOutcome>;
export declare function wrapToolWithBeforeToolCallHook(tool: AnyAgentTool, ctx?: HookContext): AnyAgentTool;
export declare function isToolWrappedWithBeforeToolCallHook(tool: AnyAgentTool): boolean;
export declare function consumeAdjustedParamsForToolCall(toolCallId: string): unknown;
export declare const __testing: {
    BEFORE_TOOL_CALL_WRAPPED: symbol;
    adjustedParamsByToolCallId: Map<string, unknown>;
    runBeforeToolCallHook: typeof runBeforeToolCallHook;
    isPlainObject: typeof isPlainObject;
    detectTruncatedToolCall: typeof detectTruncatedToolCall;
};
export {};
