mini: move frontend into tui package (#37754)

This commit is contained in:
Simon Klee
2026-07-19 14:12:22 +02:00
committed by GitHub
parent 3f5ad8441f
commit c50554d907
80 changed files with 2364 additions and 1487 deletions
+56
View File
@@ -0,0 +1,56 @@
import { describe, expect, test } from "bun:test"
import { writeSessionOutput } from "../../src/mini/stream"
import type { FooterApi, FooterEvent, StreamCommit } from "../../src/mini/types"
function footer() {
const events: FooterEvent[] = []
const commits: StreamCommit[] = []
const api: FooterApi = {
isClosed: false,
onPrompt: () => () => {},
onQueuedRemove: () => () => {},
onClose: () => () => {},
event: (next) => {
events.push(next)
},
append: (next) => {
commits.push(next)
},
idle: () => Promise.resolve(),
close: () => {},
destroy: () => {},
}
return { api, events, commits }
}
describe("run stream bridge", () => {
test("defaults status patches to running phase", () => {
const out = footer()
writeSessionOutput(
{
footer: out.api,
},
{
commits: [],
footer: {
patch: {
status: "assistant responding",
},
},
},
)
expect(out.events).toEqual([
{
type: "stream.patch",
patch: {
phase: "running",
status: "assistant responding",
},
},
])
})
})