feat(ipuaro): add session management (v0.10.0)

- Add ISessionStorage interface and RedisSessionStorage implementation
- Add ContextManager for token budget and compression
- Add StartSession, HandleMessage, UndoChange use cases
- Update CHANGELOG and TODO documentation
- 88 new tests (1174 total), 97.73% coverage
This commit is contained in:
imfozilbek
2025-12-01 12:27:22 +05:00
parent 56643d903f
commit 0f2ed5b301
22 changed files with 2798 additions and 261 deletions

View File

@@ -69,9 +69,7 @@ function createMockGit(options: {
if (options.error) {
mockGit.diffSummary.mockRejectedValue(options.error)
} else {
mockGit.diffSummary.mockResolvedValue(
options.diffSummary ?? createMockDiffSummary(),
)
mockGit.diffSummary.mockResolvedValue(options.diffSummary ?? createMockDiffSummary())
mockGit.diff.mockResolvedValue(options.diff ?? "")
}
@@ -224,9 +222,7 @@ describe("GitDiffTool", () => {
it("should handle binary files", async () => {
const mockGit = createMockGit({
diffSummary: createMockDiffSummary({
files: [
{ file: "image.png", insertions: 0, deletions: 0, binary: true },
],
files: [{ file: "image.png", insertions: 0, deletions: 0, binary: true }],
}),
})
const toolWithMock = new GitDiffTool(() => mockGit)
@@ -293,11 +289,7 @@ describe("GitDiffTool", () => {
)
expect(result.success).toBe(true)
expect(mockGit.diffSummary).toHaveBeenCalledWith([
"--cached",
"--",
"src/index.ts",
])
expect(mockGit.diffSummary).toHaveBeenCalledWith(["--cached", "--", "src/index.ts"])
})
it("should return null pathFilter when not provided", async () => {