fix(ai-judge): truncate advice widget with visible-width awareness

- delegate widget line truncation to pi-tui truncateToWidth so ANSI
  styling and double-width CJK reasons count visible cells only
- replace the code-point clamp that crashed the TUI when a Chinese
  reason rendered wider than the terminal
- add @earendil-works/pi-tui peer and dev dependencies
- cover CJK reasons at several terminal widths in tests
This commit is contained in:
2026-09-18 00:02:17 +08:00
parent 962d90dec8
commit 80108d3a7c
4 changed files with 50 additions and 15 deletions
@@ -31,11 +31,13 @@
"peerDependencies": {
"@earendil-works/pi-ai": "*",
"@earendil-works/pi-coding-agent": "*",
"@earendil-works/pi-tui": "*",
"@gotgenes/pi-permission-system": ">=32.0.0"
},
"devDependencies": {
"@earendil-works/pi-ai": "^0.85.1",
"@earendil-works/pi-coding-agent": "^0.85.1",
"@earendil-works/pi-tui": "^0.85.1",
"@gotgenes/pi-permission-system": "^32.0.2",
"@types/node": "^26.5.1",
"@vitest/coverage-istanbul": "5.0.1",