@@ -68,13 +68,13 @@ export interface LoopContext {
6868 * Implementations should never throw — instead return a result with
6969 * `success: false` and a populated `error` field.
7070 */
71- executeTool : ( toolCall : ToolCallRequest ) => Promise < ToolCallResult > ;
71+ executeTool : ( toolCall : LoopToolCallRequest ) => Promise < LoopToolCallResult > ;
7272
7373 /**
7474 * Feed tool results back into the conversation so the next `generateStream`
7575 * call has access to them. Typically appends tool messages to the message list.
7676 */
77- addToolResults : ( results : ToolCallResult [ ] ) => void ;
77+ addToolResults : ( results : LoopToolCallResult [ ] ) => void ;
7878}
7979
8080// ---------------------------------------------------------------------------
@@ -84,7 +84,7 @@ export interface LoopContext {
8484/**
8585 * A single tool invocation requested by the LLM.
8686 */
87- export interface ToolCallRequest {
87+ export interface LoopToolCallRequest {
8888 /** Unique identifier for this tool call within a response (matches the tool result). */
8989 id : string ;
9090
@@ -96,10 +96,10 @@ export interface ToolCallRequest {
9696}
9797
9898/**
99- * The outcome of executing a {@link ToolCallRequest }.
99+ * The outcome of executing a {@link LoopToolCallRequest }.
100100 */
101- export interface ToolCallResult {
102- /** Matches the originating {@link ToolCallRequest .id}. */
101+ export interface LoopToolCallResult {
102+ /** Matches the originating {@link LoopToolCallRequest .id}. */
103103 id : string ;
104104
105105 /** Name of the tool that was called. */
@@ -134,7 +134,7 @@ export interface LoopChunk {
134134 content ?: string ;
135135
136136 /** Present when `type === 'tool_call_request'`. */
137- toolCalls ?: ToolCallRequest [ ] ;
137+ toolCalls ?: LoopToolCallRequest [ ] ;
138138}
139139
140140/**
@@ -149,7 +149,7 @@ export interface LoopOutput {
149149 * All tool calls requested in this iteration. An empty array signals that
150150 * the LLM is done and the loop should terminate.
151151 */
152- toolCalls : ToolCallRequest [ ] ;
152+ toolCalls : LoopToolCallRequest [ ] ;
153153
154154 /**
155155 * The LLM finish reason (e.g. `'stop'`, `'tool_calls'`, `'length'`).
@@ -168,8 +168,8 @@ export interface LoopOutput {
168168 */
169169export type LoopEvent =
170170 | { type : 'text_delta' ; content : string }
171- | { type : 'tool_call_request' ; toolCalls : ToolCallRequest [ ] }
172- | { type : 'tool_result' ; toolName : string ; result : ToolCallResult }
171+ | { type : 'tool_call_request' ; toolCalls : LoopToolCallRequest [ ] }
172+ | { type : 'tool_result' ; toolName : string ; result : LoopToolCallResult }
173173 | { type : 'tool_error' ; toolName : string ; error : string }
174174 | { type : 'max_iterations_reached' ; iteration : number }
175175 | { type : 'loop_complete' ; totalIterations : number } ;
@@ -249,7 +249,7 @@ export class LoopController {
249249 // Act phase: execute tool calls (parallel or sequential).
250250 // ------------------------------------------------------------------
251251 const toolCalls = gmiOutput . toolCalls ;
252- let results : ToolCallResult [ ] ;
252+ let results : LoopToolCallResult [ ] ;
253253
254254 if ( config . parallelTools ) {
255255 // Dispatch all tool calls simultaneously; collect all outcomes even
@@ -261,7 +261,7 @@ export class LoopController {
261261 results = settled . map ( ( s , i ) => {
262262 if ( s . status === 'fulfilled' ) return s . value ;
263263
264- // Convert a rejected promise into a failed ToolCallResult so
264+ // Convert a rejected promise into a failed LoopToolCallResult so
265265 // downstream handling is uniform.
266266 return {
267267 id : toolCalls [ i ] . id ,
0 commit comments