mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-28 07:16:53 +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
43 lines
843 B
TypeScript
43 lines
843 B
TypeScript
/**
|
|
* Represents the result of a tool execution.
|
|
*/
|
|
|
|
export interface ToolResult {
|
|
/** Tool call ID this result belongs to */
|
|
callId: string
|
|
/** Whether execution was successful */
|
|
success: boolean
|
|
/** Result data (varies by tool) */
|
|
data?: unknown
|
|
/** Error message if failed */
|
|
error?: string
|
|
/** Execution time in milliseconds */
|
|
executionTimeMs: number
|
|
}
|
|
|
|
export function createSuccessResult(
|
|
callId: string,
|
|
data: unknown,
|
|
executionTimeMs: number,
|
|
): ToolResult {
|
|
return {
|
|
callId,
|
|
success: true,
|
|
data,
|
|
executionTimeMs,
|
|
}
|
|
}
|
|
|
|
export function createErrorResult(
|
|
callId: string,
|
|
error: string,
|
|
executionTimeMs: number,
|
|
): ToolResult {
|
|
return {
|
|
callId,
|
|
success: false,
|
|
error,
|
|
executionTimeMs,
|
|
}
|
|
}
|