feat(tui): add agent interaction workflows

This commit is contained in:
Xubin Ren
2026-08-17 20:56:10 +08:00
parent e77eed76c9
commit 4391bbf4da
28 changed files with 1275 additions and 87 deletions
+15
View File
@@ -0,0 +1,15 @@
import { expect, test } from "bun:test"
import { branchPoints } from "./branch-menu"
test("branch points preserve absolute user indices from paginated history", () => {
expect(branchPoints([
{ role: "user", content: "question" },
{ role: "assistant", content: " first\nreply ", forkIndex: 11 },
{ role: "activity", content: "read_file" },
{ role: "assistant", content: "second", forkIndex: 12 },
])).toEqual([
{ beforeUserIndex: 11, preview: "first reply" },
{ beforeUserIndex: 12, preview: "second" },
])
})