mirror of
https://github.com/shumaiOne/shumai.git
synced 2026-11-22 21:17:42 +00:00
refactor(agent): replace any-typed Tool alias with ToolDefinition from pi-coding-agent
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user