mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
- 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
52 lines
1.1 KiB
TypeScript
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[]
|
|
}
|
|
}[]
|
|
}
|