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:
imfozilbek
2025-11-29 23:08:38 +05:00
parent 7f6180df37
commit 130a8c4f24
62 changed files with 4629 additions and 6 deletions

View File

@@ -0,0 +1,32 @@
import { describe, it, expect } from "vitest"
import {
createSuccessResult,
createErrorResult,
} from "../../../../src/domain/value-objects/ToolResult.js"
describe("ToolResult", () => {
describe("createSuccessResult", () => {
it("should create success result", () => {
const data = { lines: ["line1", "line2"] }
const result = createSuccessResult("call-1", data, 50)
expect(result.callId).toBe("call-1")
expect(result.success).toBe(true)
expect(result.data).toEqual(data)
expect(result.executionTimeMs).toBe(50)
expect(result.error).toBeUndefined()
})
})
describe("createErrorResult", () => {
it("should create error result", () => {
const result = createErrorResult("call-2", "File not found", 10)
expect(result.callId).toBe("call-2")
expect(result.success).toBe(false)
expect(result.error).toBe("File not found")
expect(result.executionTimeMs).toBe(10)
expect(result.data).toBeUndefined()
})
})
})