feat: companion 狀態列與 info 輸出對齊設計稿

- 狀態列的 PAD 條改為最強的兩種情緒(不含精力)
- info 短版只列名字、關係、前 3 強情緒、適應度與待辦
- info --all 補上 12 格情緒與關係長條、人格 18 參數三層值、世界與時間感,基本資訊移到這裡
- 版本號改為 0.0.4

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
root
2026-10-14 10:03:31 +00:00
co-authored by Claude Sonnet 5.5
parent b99bf4e539
commit 13d3678032
10 changed files with 74 additions and 39 deletions
@@ -1,6 +1,6 @@
import { clamp, MOOD_EVENTS } from './mood'
import type { MoodEvent } from './mood'
import { bar } from './seg'
import { bar, width } from './seg'
import type { Pad } from './types'
const HOUR = 3_600_000
@@ -172,9 +172,8 @@ export function dominant(e: Emotions): { dim: Dim; label: string; kaomoji: strin
return { dim, label: poles ? poles[e[dim] >= 0.5 ? 1 : 0] : DIM_INFO[dim].name, kaomoji: DIM_INFO[dim].kaomoji }
}
/** /status 的情緒量表:▰▱ 依維度上色 */
export function gauge(d: Dim, e: Emotions): string {
const poles = POLES[d]
const name = poles ? `${DIM_INFO[d].name}(${poles[e[d] >= 0.5 ? 1 : 0]})` : DIM_INFO[d].name
return `${name} \x1b[${DIM_INFO[d].ansi}m${bar(e[d] * 100)}\x1b[0m ${Math.round(e[d] * 100)}`
/** info --all 的情緒量表:▰▱ 依維度上色,名稱補齊到同寬 */
export function gauge(d: Dim, e: Emotions, cells = 12): string {
const name = DIM_INFO[d].name
return `${name}${' '.repeat(Math.max(0, 6 - width(name)))}\x1b[${DIM_INFO[d].ansi}m${bar(e[d] * 100, cells)}\x1b[0m ${String(Math.round(e[d] * 100)).padStart(3)}`
}