import { T as ToolRegistry, a as ToolScopeMismatchError } from './registry-CowKS4Hh.js';
import { j as AnthropicToolUseBlock, l as ToolDispatchContext, i as AnthropicToolResultBlock, c as AnthropicMessagesClient, b as AnthropicMessage, e as AnthropicResponse, A as AgentMemoryWriter, a as AnthropicContentBlock, d as AnthropicMessagesCreateArgs, f as AnthropicStopReason, g as AnthropicTextBlock, h as AnthropicToolDefinition, T as ToolCredentialScope, k as ToolDefinition, m as ToolInvocationErrorArgs, n as ToolInvocationStartArgs, o as ToolInvocationSuccessArgs, p as ToolLogger } from './types-DjPlsx0H.js';

declare function dispatchToolUse(registry: ToolRegistry, toolUseBlock: AnthropicToolUseBlock, ctx: ToolDispatchContext): Promise<AnthropicToolResultBlock>;

interface RunWithToolsArgs {
    client: AnthropicMessagesClient;
    model: string;
    system?: string;
    /** Max output tokens per turn. Defaults to 4096. */
    maxTokens?: number;
    /** Initial message history — at minimum one user message. */
    messages: AnthropicMessage[];
    registry: ToolRegistry;
    ctx: ToolDispatchContext;
    /** Cap on tool-use loop iterations. Defaults to 10. */
    maxIterations?: number;
}
interface RunWithToolsResult {
    /** Full message history after the loop, including all assistant + tool_result turns. */
    messages: AnthropicMessage[];
    /** The final assistant response from Claude (the one that stopped the loop). */
    finalResponse: AnthropicResponse;
    /** How many round trips to the Anthropic API were made. */
    iterations: number;
    /** True if the loop terminated because it hit `maxIterations`. */
    stoppedAtMaxIterations: boolean;
}
declare function runWithTools(args: RunWithToolsArgs): Promise<RunWithToolsResult>;

declare const index_AgentMemoryWriter: typeof AgentMemoryWriter;
declare const index_AnthropicContentBlock: typeof AnthropicContentBlock;
declare const index_AnthropicMessage: typeof AnthropicMessage;
declare const index_AnthropicMessagesClient: typeof AnthropicMessagesClient;
declare const index_AnthropicMessagesCreateArgs: typeof AnthropicMessagesCreateArgs;
declare const index_AnthropicResponse: typeof AnthropicResponse;
declare const index_AnthropicStopReason: typeof AnthropicStopReason;
declare const index_AnthropicTextBlock: typeof AnthropicTextBlock;
declare const index_AnthropicToolDefinition: typeof AnthropicToolDefinition;
declare const index_AnthropicToolResultBlock: typeof AnthropicToolResultBlock;
declare const index_AnthropicToolUseBlock: typeof AnthropicToolUseBlock;
type index_RunWithToolsArgs = RunWithToolsArgs;
type index_RunWithToolsResult = RunWithToolsResult;
declare const index_ToolCredentialScope: typeof ToolCredentialScope;
declare const index_ToolDefinition: typeof ToolDefinition;
declare const index_ToolDispatchContext: typeof ToolDispatchContext;
declare const index_ToolInvocationErrorArgs: typeof ToolInvocationErrorArgs;
declare const index_ToolInvocationStartArgs: typeof ToolInvocationStartArgs;
declare const index_ToolInvocationSuccessArgs: typeof ToolInvocationSuccessArgs;
declare const index_ToolLogger: typeof ToolLogger;
declare const index_ToolRegistry: typeof ToolRegistry;
declare const index_ToolScopeMismatchError: typeof ToolScopeMismatchError;
declare const index_dispatchToolUse: typeof dispatchToolUse;
declare const index_runWithTools: typeof runWithTools;
declare namespace index {
  export { index_AgentMemoryWriter as AgentMemoryWriter, index_AnthropicContentBlock as AnthropicContentBlock, index_AnthropicMessage as AnthropicMessage, index_AnthropicMessagesClient as AnthropicMessagesClient, index_AnthropicMessagesCreateArgs as AnthropicMessagesCreateArgs, index_AnthropicResponse as AnthropicResponse, index_AnthropicStopReason as AnthropicStopReason, index_AnthropicTextBlock as AnthropicTextBlock, index_AnthropicToolDefinition as AnthropicToolDefinition, index_AnthropicToolResultBlock as AnthropicToolResultBlock, index_AnthropicToolUseBlock as AnthropicToolUseBlock, type index_RunWithToolsArgs as RunWithToolsArgs, type index_RunWithToolsResult as RunWithToolsResult, index_ToolCredentialScope as ToolCredentialScope, index_ToolDefinition as ToolDefinition, index_ToolDispatchContext as ToolDispatchContext, index_ToolInvocationErrorArgs as ToolInvocationErrorArgs, index_ToolInvocationStartArgs as ToolInvocationStartArgs, index_ToolInvocationSuccessArgs as ToolInvocationSuccessArgs, index_ToolLogger as ToolLogger, index_ToolRegistry as ToolRegistry, index_ToolScopeMismatchError as ToolScopeMismatchError, index_dispatchToolUse as dispatchToolUse, index_runWithTools as runWithTools };
}

export { type RunWithToolsArgs as R, type RunWithToolsResult as a, dispatchToolUse as d, index as i, runWithTools as r };
