feat(ipuaro): implement Redis storage module (v0.2.0)

- Add RedisClient with connection management and AOF config
- Add RedisStorage implementing full IStorage interface
- Add Redis key schema for project and session data
- Add generateProjectName() utility
- Add 68 unit tests for Redis module (159 total)
- Update ESLint: no-unnecessary-type-parameters as warn
This commit is contained in:
imfozilbek
2025-11-30 00:22:49 +05:00
parent fd8e97af0e
commit 225480c806
19 changed files with 1226 additions and 62 deletions

View File

@@ -1,8 +1,5 @@
import { describe, it, expect, vi, beforeEach, afterEach } from "vitest"
import {
createUndoEntry,
canUndo,
} from "../../../../src/domain/value-objects/UndoEntry.js"
import { createUndoEntry, canUndo } from "../../../../src/domain/value-objects/UndoEntry.js"
describe("UndoEntry", () => {
beforeEach(() => {
@@ -21,7 +18,7 @@ describe("UndoEntry", () => {
"test.ts",
["old line"],
["new line"],
"Edit line 1"
"Edit line 1",
)
expect(entry.id).toBe("undo-1")
@@ -34,14 +31,7 @@ describe("UndoEntry", () => {
})
it("should create undo entry with toolCallId", () => {
const entry = createUndoEntry(
"undo-2",
"test.ts",
[],
[],
"Create file",
"tool-123"
)
const entry = createUndoEntry("undo-2", "test.ts", [], [], "Create file", "tool-123")
expect(entry.toolCallId).toBe("tool-123")
})
@@ -49,37 +39,19 @@ describe("UndoEntry", () => {
describe("canUndo", () => {
it("should return true when current content matches newContent", () => {
const entry = createUndoEntry(
"undo-1",
"test.ts",
["old"],
["new"],
"Edit"
)
const entry = createUndoEntry("undo-1", "test.ts", ["old"], ["new"], "Edit")
expect(canUndo(entry, ["new"])).toBe(true)
})
it("should return false when content differs", () => {
const entry = createUndoEntry(
"undo-1",
"test.ts",
["old"],
["new"],
"Edit"
)
const entry = createUndoEntry("undo-1", "test.ts", ["old"], ["new"], "Edit")
expect(canUndo(entry, ["modified"])).toBe(false)
})
it("should return false when length differs", () => {
const entry = createUndoEntry(
"undo-1",
"test.ts",
["old"],
["new"],
"Edit"
)
const entry = createUndoEntry("undo-1", "test.ts", ["old"], ["new"], "Edit")
expect(canUndo(entry, ["new", "extra"])).toBe(false)
})