Files
puaros/packages/ipuaro/src/application/interfaces/IToolRegistry.ts
imfozilbek 130a8c4f24 feat(ipuaro): implement v0.1.0 foundation
- Project setup with tsup, vitest, ESM support
- Domain entities: Session, Project
- Value objects: FileData, FileAST, FileMeta, ChatMessage, ToolCall, ToolResult, UndoEntry
- Service interfaces: IStorage, ILLMClient, ITool, IIndexer, IToolRegistry
- Shared: Config (zod), IpuaroError, utils (hash, tokens), Result type
- CLI with placeholder commands (start, init, index)
- 91 unit tests with 100% coverage
- Fix package scope @puaros -> @samiyev in CLAUDE.md
2025-11-29 23:08:38 +05:00

52 lines
1.1 KiB
TypeScript

import type { ITool, ToolContext } from "../../domain/services/ITool.js"
import type { ToolResult } from "../../domain/value-objects/ToolResult.js"
/**
* Tool registry interface.
* Manages registration and execution of tools.
*/
export interface IToolRegistry {
/**
* Register a tool.
*/
register(tool: ITool): void
/**
* Get tool by name.
*/
get(name: string): ITool | undefined
/**
* Get all registered tools.
*/
getAll(): ITool[]
/**
* Get tools by category.
*/
getByCategory(category: ITool["category"]): ITool[]
/**
* Check if tool exists.
*/
has(name: string): boolean
/**
* Execute tool by name.
*/
execute(name: string, params: Record<string, unknown>, ctx: ToolContext): Promise<ToolResult>
/**
* Get tool definitions for LLM.
*/
getToolDefinitions(): {
name: string
description: string
parameters: {
type: "object"
properties: Record<string, { type: string; description: string }>
required: string[]
}
}[]
}