@@ -53,10 +53,42 @@
5353
5454 ## Phase 4 — UI
5555
56-- [ ] `ui.ts` — cel-tui layout (log + input + status bar), state management, message rendering
57-- [ ] `index.ts` — entry point, provider discovery, startup sequence, command routing
58-- [ ] Commands — `/model`, `/session`, `/new`, `/fork`, `/undo`, `/reasoning`, `/verbose`, `/login`, `/logout`, `/help`, `/effort`
59-- [ ] Input handling — `/skill:name` parsing, image path detection, Tab file autocomplete
56+### 4a — Input parsing (TDD, no UI)
57+
58+- [ ] `input.ts` — pure logic for parsing user input:
59+ - `/command` detection and routing (extract command name + args)
60+ - `/skill:name rest of message` → skill body + user text
61+ - Image path detection (entire input is an existing image path with valid extension)
62+- [ ] `input.test.ts` — tests for all parsing cases
63+
64+### 4b — App shell (running app, no commands)
65+
66+- [ ] `index.ts` — entry point: provider discovery (env + OAuth), register built-in API providers, model selection, startup sequence
67+- [ ] `ui.ts` — cel-tui layout: conversation log (scrollable, stick-to-bottom), input area (TextInput, submit/newline), status bar (2 lines: cwd+git, model+usage), animated divider
68+- [ ] Wire agent loop: submit → build context → stream → render events → tool results → loop
69+- [ ] Message rendering: user (bg color), assistant (streamed Markdown), tool calls (shell: bordered output, edit: path + unified diff), errors
70+- [ ] Interrupt: Escape during streaming aborts via AbortSignal
71+
72+### 4c — Commands
73+
74+- [ ] `/model` — interactive model selector (Select component, available providers/models)
75+- [ ] `/session` — session manager (list, resume, delete)
76+- [ ] `/new` — new session, reset counters
77+- [ ] `/fork` — fork current session
78+- [ ] `/undo` — remove last turn
79+- [ ] `/reasoning` — toggle thinking display
80+- [ ] `/verbose` — toggle full output (disable truncation)
81+- [ ] `/login` / `/logout` — OAuth flows via pi-ai
82+- [ ] `/effort` — effort level selector
83+- [ ] `/help` — list commands, AGENTS.md files, skills, plugins
84+- [ ] `/` + Tab — command autocomplete in input
85+
86+### 4d — Polish
87+
88+- [ ] Tab file path autocomplete in input
89+- [ ] `/skill:name` input handling (strip prefix, prepend skill body)
90+- [ ] Image embedding (entire input is image path → embed as ImageContent)
91+- [ ] Conditional `readImage` tool registration (only for vision-capable models, re-evaluated on `/model`)
6092
6193 ## Future ideas