mirror of
https://github.com/samiyev/puaros.git
synced 2025-12-27 23:06:54 +05:00
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
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"
|
||||
import { createToolCall } from "../../../../src/domain/value-objects/ToolCall.js"
|
||||
|
||||
describe("ToolCall", () => {
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers()
|
||||
vi.setSystemTime(new Date("2025-01-01T00:00:00Z"))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers()
|
||||
})
|
||||
|
||||
describe("createToolCall", () => {
|
||||
it("should create tool call with all fields", () => {
|
||||
const params = { path: "test.ts", line: 10 }
|
||||
const call = createToolCall("call-1", "get_lines", params)
|
||||
|
||||
expect(call.id).toBe("call-1")
|
||||
expect(call.name).toBe("get_lines")
|
||||
expect(call.params).toEqual(params)
|
||||
expect(call.timestamp).toBe(Date.now())
|
||||
})
|
||||
|
||||
it("should handle empty params", () => {
|
||||
const call = createToolCall("call-2", "git_status", {})
|
||||
|
||||
expect(call.params).toEqual({})
|
||||
})
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user