/** * Agentic/tool orchestration — thin wrapper around {@link ConcreteExecutor}. * * Previously contained a full iterative tool-call loop against the removed * ProviderBackend layer. Now delegates entirely to * {@link ConcreteExecutor.run}, which already implements sequential tool-call * orchestration, multi-turn replay, and iteration limits. * * The public `executeToolLoop` signature is preserved for backwards * compatibility with `api.ts`. All fields not consumed by the new executor * path are accepted but ignored (marked with inline comments). * * Key invariants preserved: * - Tool calls are sequential, never parallel (enforced by ConcreteExecutor) * - `maxToolIterations` upper bound is forwarded as `maxIterations` * - `toolExecutor` callback is wrapped into the `toolHandler` shape * - `streamFinal` path is unsupported in the new executor (stream=false for * tool loops per the api.ts guard); always returns a full LLMCallResponse * * @task T9299 (W5b — migrate tool-loop to ConcreteExecutor event stream) * @epic T9261 T-LLM-CRED-CENTRALIZATION */ import type { AttemptPlan, AttemptRef } from './runtime.js'; import type { IterationCallback, LLMCallResponse, StreamingResponseWithMetadata, VerbosityType } from './types.js'; import type { ModelConfig } from './types-config.js'; export declare const MIN_TOOL_ITERATIONS = 1; export declare const MAX_TOOL_ITERATIONS = 100; type ToolExecutorFn = (name: string, input: Record) => Promise; /** @internal */ export interface ToolLoopParams { prompt: string; maxTokens: number; messages: Array> | null; tools: Array>; toolChoice: string | Record | null | undefined; toolExecutor: ToolExecutorFn; maxToolIterations: number; responseModel: (new (...args: unknown[]) => unknown) | null | undefined; jsonMode: boolean; temperature: number | null | undefined; stopSeqs: string[] | null | undefined; verbosity: VerbosityType; enableRetry: boolean; retryAttempts: number; maxInputTokens: number | null | undefined; getAttemptPlan: () => AttemptPlan; attemptRef: AttemptRef; beforeRetryCallback: (err: Error, attemptNumber: number) => void; streamFinal?: boolean; iterationCallback?: IterationCallback | null; /** ModelConfig forwarded from api.ts for session construction. */ modelConfig: ModelConfig; } /** * Run the iterative tool calling loop for agentic LLM interactions. * * Delegates to {@link ConcreteExecutor.run} which already owns sequential * tool-call orchestration. The legacy `params` shape is accepted verbatim; * fields that ConcreteExecutor does not need are silently ignored. */ export declare function executeToolLoop(params: ToolLoopParams): Promise | StreamingResponseWithMetadata>; export {}; //# sourceMappingURL=tool-loop.d.ts.map