From e87ca5bb2331f6fce3ea0207fab1d0834ca4d258 Mon Sep 17 00:00:00 2001 From: yiling Date: Wed, 20 May 2026 14:30:58 +0800 Subject: [PATCH] refactor(agent): replace any-typed Tool alias with ToolDefinition from pi-coding-agent --- src/agent/executor.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/agent/executor.ts b/src/agent/executor.ts index 05f0735e..d1629f11 100644 --- a/src/agent/executor.ts +++ b/src/agent/executor.ts @@ -10,6 +10,7 @@ import { SessionManager, SettingsManager, defineTool, + type ToolDefinition, } from '@mariozechner/pi-coding-agent' import { Type, type TSchema } from '@sinclair/typebox' import * as fs from 'fs' @@ -21,9 +22,6 @@ import { createSandboxedBashTool } from './tools/sandboxed-bash' import { Usage } from '@/services/ai/provider/provider' import { SandboxManager } from '@anthropic-ai/sandbox-runtime' -// eslint-disable-next-line @typescript-eslint/no-explicit-any -export type Tool = any - export interface AutofillField { id: string config: PrismaJson.FieldConfig @@ -72,7 +70,7 @@ export class AgentExecutor { agentsInstruction: string, sessionId?: string, userId?: string, - tools: Tool[] = [], + tools: ToolDefinition[] = [], ): Promise<{ text: string; usage: Usage; sessionId: string }> { const t = await this.getTeam(teamId) if (!t) throw new Error('failed to get team')