Commit e880dde
committed
feat(ai): Phase 6 AI CLI Builder — streaming components, chat UI, and provider hooks (v1.2.0)
Tier 1 - Core primitives:
- StreamingText: controlled text prop, AsyncIterable stream, blinking cursor, typing animation
- Markdown: streaming prop + cursor; partial code fence recovery
- DiffView: LCS diff, unified/split/inline modes, line numbers, hunk headers
Tier 2 - Chat UI (termui/components/ai):
- ChatMessage + ChatThread: role-based colours, animated typing indicator, autoScroll
- ToolCall: pending/running/success/error icons, live elapsed timer, collapsible result
- ThinkingBlock: collapsible chain-of-thought, token count, streaming indicator
- ToolApproval: risk-level border, y/n/a keybindings, countdown auto-deny
Tier 3 - Integration layer:
- TokenUsage + ContextMeter: compact cost display, warn/critical thresholds
- ModelSelector: provider grouping, context size, built on Select
- FileChange: M/A/D file list, keyboard nav, inline DiffView expansion
- useChat + useCompletion (termui/ai): Anthropic/OpenAI/Ollama/custom providers,
tokenUsage populated from each provider native usage events
Tier 4 - Ecosystem:
- createConversationStore (termui/conversation-store): JSONL/JSON persistence
Bug fixes:
- useChat: replaced setMessages-capture pattern with messagesRef for correct history on all turns
- tokenUsage: wired setTokenUsage callback into all three provider streams
- DiffView inline mode: implemented proper InlineView distinct from unified
- TS2307 on optional peer SDKs: variable-specifier dynamic imports bypass tsc static resolution
- tsconfig.json: added missing paths for @termui/components/ai and new adapter subpaths1 parent 5ad5679 commit e880dde
28 files changed
Lines changed: 2194 additions & 5 deletions
File tree
- packages
- adapters
- ai
- conversation-store
- components
- src
- ai
- data
- typography
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
6 | 50 | | |
7 | 51 | | |
8 | 52 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
151 | 151 | | |
152 | 152 | | |
153 | 153 | | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
154 | 166 | | |
155 | 167 | | |
156 | 168 | | |
| |||
0 commit comments