diff options
Diffstat (limited to 'packages/cli/src/core')
| -rw-r--r-- | packages/cli/src/core/gemini-client.ts | 14 | ||||
| -rw-r--r-- | packages/cli/src/core/gemini-stream.ts | 4 | ||||
| -rw-r--r-- | packages/cli/src/core/history-updater.ts | 2 |
3 files changed, 10 insertions, 10 deletions
diff --git a/packages/cli/src/core/gemini-client.ts b/packages/cli/src/core/gemini-client.ts index 0b79a2ad..21cc7188 100644 --- a/packages/cli/src/core/gemini-client.ts +++ b/packages/cli/src/core/gemini-client.ts @@ -25,9 +25,9 @@ import { GeminiEventType, GeminiStream } from './gemini-stream.js'; type ToolExecutionOutcome = { callId: string; name: string; - args: Record<string, any>; + args: Record<string, never>; result?: ToolResult; - error?: any; + error?: Error; confirmationDetails?: ToolCallConfirmationDetails; }; @@ -126,7 +126,7 @@ ${folderStructure} let pendingToolCalls: Array<{ callId: string; name: string; - args: Record<string, any>; + args: Record<string, never>; }> = []; let yieldedTextInTurn = false; const chunksForDebug = []; @@ -148,7 +148,7 @@ ${folderStructure} call.id ?? `${call.name}-${Date.now()}-${Math.random().toString(16).slice(2)}`; const name = call.name || 'undefined_tool_name'; - const args = (call.args || {}) as Record<string, any>; + const args = (call.args || {}) as Record<string, never>; pendingToolCalls.push({ callId, name, args }); const evtValue: ToolCallEvent = { @@ -281,7 +281,7 @@ ${folderStructure} (executedTool: ToolExecutionOutcome): Part => { const { name, result, error } = executedTool; const output = { output: result?.llmContent }; - let toolOutcomePayload: any; + let toolOutcomePayload: Record<string, unknown>; if (error) { const errorMessage = error?.message || String(error); @@ -445,11 +445,11 @@ Respond *only* in JSON format according to the following schema. Do not include async generateJson( contents: Content[], schema: SchemaUnion, - ): Promise<any> { + ): Promise<Record<string, unknown>> { const model = getModel(); try { const result = await this.ai.models.generateContent({ - model: model, + model, config: { ...this.defaultHyperParameters, systemInstruction: CoreSystemPrompt, diff --git a/packages/cli/src/core/gemini-stream.ts b/packages/cli/src/core/gemini-stream.ts index 314a829d..70361f10 100644 --- a/packages/cli/src/core/gemini-stream.ts +++ b/packages/cli/src/core/gemini-stream.ts @@ -154,14 +154,14 @@ export const processGeminiStream = async ({ if (signal.aborted) { throw new Error('Request cancelled by user'); } - } catch (error: any) { + } catch (error: unknown) { if (renderTimeoutId) { // Ensure render loop stops on error clearTimeout(renderTimeoutId); renderTimeoutId = null; } // Delegate history update for error message - addErrorMessageToHistory(error, setHistory, getNextMessageId); + addErrorMessageToHistory(error as (Error | DOMException), setHistory, getNextMessageId); } finally { isStreamComplete = true; // Signal stream end for render loop completion if (renderTimeoutId) { diff --git a/packages/cli/src/core/history-updater.ts b/packages/cli/src/core/history-updater.ts index a97c99a1..465b7d49 100644 --- a/packages/cli/src/core/history-updater.ts +++ b/packages/cli/src/core/history-updater.ts @@ -178,7 +178,7 @@ export const handleToolCallChunk = ( * it to the last non-user message or creating a new entry. */ export const addErrorMessageToHistory = ( - error: any, + error: DOMException | Error, setHistory: React.Dispatch<React.SetStateAction<HistoryItem[]>>, getNextMessageId: () => number, ): void => { |
