feat: add TUI session orchestrator

Add a first-class active-session orchestrator for the Ink TUI:

- list, activate, close, and launch live process-local TUI sessions
- hydrate committed and in-flight output when switching sessions
- dispatch a new prompt session from the +new row with session-scoped model picks
- expose a clickable live-session count in the status chrome
- preserve stable row order while initially focusing the current session
- support mouse hit-testing for floating orchestrator overlays
- add backend and frontend regression coverage for the lifecycle and UI helpers
This commit is contained in:
Nick 2026-05-17 21:51:33 +00:00 committed by Teknium
parent 2fc77c53f0
commit 0a83247e9f
29 changed files with 2048 additions and 105 deletions

View file

@ -18,6 +18,16 @@ describe('createSlashHandler', () => {
expect(getOverlayState().picker).toBe(true)
})
it('opens the live session switcher locally even when the current session is busy', () => {
patchUiState({ busy: true, sid: 'sid-abc' })
const ctx = buildCtx()
expect(createSlashHandler(ctx)('/sessions')).toBe(true)
expect(getOverlayState().sessions).toBe(true)
expect(ctx.session.guardBusySessionSwitch).not.toHaveBeenCalled()
expect(ctx.gateway.gw.request).not.toHaveBeenCalled()
})
it('handles /redraw locally without slash worker fallback', () => {
const ctx = buildCtx()
@ -779,6 +789,7 @@ const buildSession = () => ({
die: vi.fn(),
dieWithCode: vi.fn(),
guardBusySessionSwitch: vi.fn(() => false),
newLiveSession: vi.fn(),
newSession: vi.fn(),
resetVisibleHistory: vi.fn(),
resumeById: vi.fn(),
@ -796,7 +807,8 @@ const buildTranscript = () => ({
const buildVoice = () => ({
setVoiceEnabled: vi.fn(),
setVoiceRecordKey: vi.fn()
setVoiceRecordKey: vi.fn(),
setVoiceTts: vi.fn()
})
interface Ctx {