| refactor(ink): extract vendored renderer to @esengine/ink + tui polish (#1847)
Stage 1 of #1829: ship the renderer as a separate private package
instead of vendoring at src/ink/. Picks up the tui-polish work that
landed alongside it (visuals, pulse animations, ghosting fix).
## Renderer extraction
- src/ink/ removed; renderer lives in esengine/reasonix-ink (private)
- package.json: ink dep points at @esengine/ink (file: tarball for
local dev; swap to npm: alias post-publish); react-reconciler and
yoga-layout added as direct deps so they hoist to a single top-level
instance (single React dispatcher, single reconciler instance);
17 transitive runtime deps and 3 @types removed
- tsconfig: ink path-map removed
- vitest.config: ink alias removed
- tests/helpers/ink-stdio.ts: text() uses strip-ansi + restores
CSI N C cursor-forward back to literal spaces
- tests/helpers/ink-test.ts (new): replaces ink-testing-library;
lastFrame() joins all chunks instead of returning only the most
recent write() — required because the diff-based renderer emits
multi-chunk frames per commit
- 15 test files migrated; 13 obsolete UI snapshot tests removed
(5 files)
## Visual alignment
- UserCard: single full-row backgroundColor=MESSAGE_BG.user fill
- ApprovalCard: round border with borderLeft/borderRight=false
- PromptInput: round border (top + bottom only) + borderText with
plan / history / mode / model
- ReasoningCard: italic + dim header; collapsed state appends
(ctrl-o to expand) hint
- theme/tokens: new MESSAGE_BG section (user/bash/selected) for all
5 themes
- CardHeader: glyph prop accepts string | ReactElement
## Pulse animation system
- Pulse primitive: generic frame cycler with DIAMOND/SQUARE/
TRIANGLE/CIRCLE/HEX presets aligned to existing brand glyphs
- Wired into 7 cards + 4 LiveRows components
- ThinkingRow + OngoingToolRow: live elapsed time + output token
count + t/s rate
- ticker.tsx: useTick / useSlowTick switched from
useAnimationTimer (keepAlive=false) to useAnimationFrame
(keepAlive=true) so the shared clock actually starts
## Bug fixes
- PromptInput: removed systemCursorSync — the out-of-band CSI CUP
write desynced the renderer's screen model under sync-output mode,
causing residual glyphs starting at the 3rd typed character
- Wizard: TextInput now sourced from ink (drop-in TextInput exposed
by the package); ink-text-input dep removed
## Tests
279 files, 3722 passed, 11 skipped, 0 failed.
Refs #1829 (Stage 1).
Co-authored-by: reasonix <reasonix@deepseek.com> | 3 天前 |