@bismawy/pi-arnative 0.16.0 → 0.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +25 -16
  2. package/extensions/index.ts +41 -0
  3. package/lib/active-clock.ts +91 -0
  4. package/lib/ansi.ts +40 -78
  5. package/lib/box.ts +49 -68
  6. package/lib/chatbox.ts +371 -0
  7. package/lib/color.ts +3 -31
  8. package/lib/compat.ts +0 -60
  9. package/lib/edit-diff.ts +199 -0
  10. package/{extensions → lib/features}/arnative.ts +96 -423
  11. package/{extensions/autocompact.ts → lib/features/auto-compact.ts} +30 -325
  12. package/{extensions → lib/features}/budget.ts +17 -242
  13. package/lib/features/footer.ts +2232 -0
  14. package/{extensions/section-headers.ts → lib/features/headers.ts} +38 -49
  15. package/{extensions → lib/features}/model-heal.ts +5 -28
  16. package/lib/features/progress-group.ts +1557 -0
  17. package/{extensions → lib/features}/render-cache.ts +130 -158
  18. package/{extensions → lib/features}/timestamps.ts +132 -131
  19. package/{extensions → lib/features}/todos.ts +44 -158
  20. package/lib/features/tools.ts +1202 -0
  21. package/lib/features/ui-render-tweaks.ts +606 -0
  22. package/lib/features/usage.ts +786 -0
  23. package/lib/format.ts +22 -4
  24. package/lib/git-status.ts +164 -0
  25. package/lib/list-picker.ts +1 -127
  26. package/lib/model-heal.ts +70 -162
  27. package/lib/patch.ts +0 -63
  28. package/lib/preset-store.ts +17 -133
  29. package/lib/provider-store.ts +573 -0
  30. package/lib/provider.ts +52 -851
  31. package/lib/runtime.ts +209 -0
  32. package/lib/shortcuts.ts +8 -58
  33. package/lib/spinner.ts +88 -162
  34. package/lib/status-widget.ts +4 -30
  35. package/lib/todos.ts +20 -143
  36. package/lib/usage-pricing.ts +143 -0
  37. package/lib/usage-store.ts +44 -378
  38. package/package.json +5 -6
  39. package/CHANGELOG.md +0 -678
  40. package/extensions/animations.ts +0 -242
  41. package/extensions/footer.ts +0 -2580
  42. package/extensions/tools.ts +0 -2231
  43. package/extensions/ui-render-tweaks.ts +0 -1005
  44. package/extensions/usage-export.ts +0 -283
  45. package/extensions/usage.ts +0 -1406
  46. package/lib/check.ts +0 -21
  47. package/themes/gen-themes.mjs +0 -715
package/CHANGELOG.md DELETED
@@ -1,678 +0,0 @@
1
- # Changelog
2
-
3
- ## [Unreleased]
4
-
5
- ## [0.16.0] - 2026-11-20
6
-
7
- ### Added
8
- - **Automatic `contextWindow` and `maxTokens` fallback in `/providers`.** When a provider's `/models` response omits context limits, `/providers` now resolves missing limits from pi's local `modelRegistry` first (matching exact, bare, and variant-stripped model IDs) and then from OpenRouter's public model catalog (`https://openrouter.ai/api/v1/models`). `parseMeta` also reads camelCase limit keys, Gemini `inputTokenLimit`/`outputTokenLimit`, and nested `top_provider`, `limit`/`limits`, and `capabilities.limits` objects (`lib/compat.ts`, `lib/provider.ts`).
9
-
10
- ### Changed
11
- - **Automatic cleanup of old completed task lists in `todos/`.** On `session_start`, session todo files older than 30 days whose tasks are all completed or empty are pruned automatically (`extensions/todos.ts`).
12
-
13
- ### Fixed
14
- - **Budget total estimate no longer double-counts today's spend.** The Budget modal summed `estimatedToday + estimatedMonth`, even though the rolling 30-day window already includes today (`extensions/budget.ts`).
15
- - **`/usage` Project view omits empty sessions after a reset or range filter.** Files with zero effective messages are no longer counted into `summary.projects` (`lib/usage-store.ts`).
16
- - **`mergeMeta` keeps `maxTokens` intact when an anomalous `contextWindow` is rejected.** Output caps now clamp against the accepted `out.contextWindow` instead of the rejected candidate (`lib/compat.ts`).
17
- - **Closing `/providers` → Thinking aborts any in-flight effort probe, and atomic file writes share Windows lock fallback.** Leaving the Thinking picker cancels pending probe requests via `AbortController`, and all seven atomic-write paths now share `writeAtomicSync` with Windows `EPERM`/`EBUSY`/`EXDEV` fallback and temp-file cleanup (`lib/provider.ts`, `lib/preset-store.ts`, `lib/usage-store.ts`, `lib/model-heal.ts`, `extensions/todos.ts`, `extensions/usage-export.ts`).
18
-
19
- ## [0.15.0] - 2026-11-19
20
-
21
- ### Changed
22
- - **Side-by-side `edit` diff view (`Before │ After`) with intra-line highlights and `/arnative` toggle.** Expanded `edit` tool boxes render removed and added lines in two aligned columns at terminal inner widths >= 50 columns (with a `─┼─` header separator, stripped `+`/`-` prefixes, and `inverse` highlighting on changed tokens), falling back to unified diff on narrower terminals. Added `/arnative` → **Appearance** → **Diffs** (`Split` default / `Unified`) with live preview saved to `config.json` (`editDiff`) (`extensions/tools.ts`, `extensions/arnative.ts`, `lib/preset-store.ts`).
23
-
24
- ## [0.14.0] - 2026-11-19
25
-
26
- ### Added
27
- - **In-app Payload limit setting in `/arnative`.** Choose `Off`, `1 MB` (default), `4 MB`, `8 MB`, `16 MB`, `32 MB`, or `Custom` (1 to 1024 MB) under `/arnative` → **Payload limit**. Choices save to `config.json` (`payloadLimit`) and apply immediately to active sessions, footer pressure labels, and compaction input caps without restarting Pi; `PI_ARNATIVE_BYTE_WALL_MB` remains supported as a shell override (`extensions/arnative.ts`, `extensions/autocompact.ts`, `lib/preset-store.ts`).
28
-
29
- ### Fixed
30
- - **Box backgrounds are visible again on dark and 256-color terminals.** The user chat panel, system-message box, tool cards, selection and search highlight all sat at L≈19%, which resolves to `#001817` on the base theme: 1.14:1 against a black terminal, close enough to invisible that the chat bubble looked like it had no background at all. Every box now uses a measured lightness (`userMessageBg` L 32%, tool and system cards L 30%, selection L 36%), and box chroma has a floor so the tint survives quantization. On `TERM=xterm-256color` without `COLORTERM`, pi draws colors through `rgbToAnsi256`, which mapped the old backgrounds onto 6x6x6 cube black (index 16) for 13 of 14 themes; all 98 box tokens now quantize to a real color. Two themes' `primary` (`crimson`, `gruvbox`) and the thinking ramp's dimmest step were lifted to keep their contrast floors against the brighter canvas (`themes/gen-themes.mjs`, all `themes/*.json`, `lib/color.ts`, `extensions/ui-render-tweaks.ts`).
31
-
32
- ## [0.13.1] - 2026-11-18
33
-
34
- ### Changed
35
- - **Organize `/arnative` into four top-level categories.** The root `/arnative` picker now lists `Appearance`, `Performance`, `Models`, and `Spend` with summaries of their contents, opening each category's submenu on `Enter` with `←` stepping back up (`extensions/arnative.ts`).
36
-
37
- ## [0.13.0] - 2026-11-18
38
-
39
- ### Added
40
- - **The byte-shed ceiling follows the proxy wall.** `SHED_TRIGGER_BYTES` was a fixed 900 KB, so a 1M-token model shed at roughly 12% of its window and lost context the token budget could still hold. `PI_ARNATIVE_BYTE_WALL_MB` now scales the trigger, target, and compaction ceilings (default `1`, unchanged behaviour). Set it to the wall your proxy accepts, for example `16` after raising nginx to `client_max_body_size 16m`. The footer label follows: `0.74MB/900KB` below 1 MB, `0.74MB/14.06MB` at a 16 MB wall (`extensions/autocompact.ts`, `extensions/footer.ts`).
41
- - **`/arnative` pickers wrap at the top and bottom rows.** Navigation used to clamp, so a held arrow key stuck at the first or last row. The cursor now wraps like `/jev-eye`: up from the top lands on the last row, down from the last row lands on the top. Every submenu shares `ListPicker`, so one change covers them all (`lib/list-picker.ts`).
42
- - **Render cache (`/arnative` → Render cache: `On`/`Off`, default `On`): reuse rendered transcript lines for idle frames.** Container-level render caching attaches to the `chatContainer` instance and patches `rebuildChatFromMessages`; known, settled transcript frames are served from a cached snapshot after checking child state (prior synthetic render-only benchmark: idle 15.23 ms → 0.77 ms per frame, streaming 10.46 ms → 6.43 ms), and the cache clears on `session_start`, `model_select`, and `session_compact` (`extensions/render-cache.ts`, `scripts/bench-render-cache.mjs`, `test/render-cache.test.ts`).
43
- - **Auto-compact `Smart` now scales with Render cache.** With `Render cache: On`, windows ≥192k compact at **90%** of `contextWindow` (1M → ~943k tokens); with `Render cache: Off`, Smart keeps the conservative tiers (1M→20% · 512k→40% · 256k→80%); windows <192k still defer to pi core. The picker note in `/arnative` reflects the active state (`extensions/autocompact.ts`, `smartPercent`, `extensions/arnative.ts`).
44
- - **Remote 1 MB byte protection is now silent and decoupled from `ctx.compact()`.** For `remote/*`, `remote-magpie/*`, and models that saw HTTP 413, payloads approaching ~900 KB are trimmed in-memory (with hysteresis down to ~760 KB; 820→680 KB after a 413) by dropping older images → older thinking blocks (keeping the latest turn intact) → bulky old tool outputs → old `toolCall` args → head turns. The transcript, UI, and `render-cache` stay untouched, and byte pressure alone never triggers session compaction anymore: only token thresholds do (`extensions/autocompact.ts`).
45
- - **Footer payload pressure for byte-limited models (`󰆓 x.xxMB/900KB` on the left row).** The cell renders beside the extension statuses, split by the row `|` separator, so the right metrics (speed, cache, tokens, cost) keep their slots. The byte count comes from the autocompact snapshot (messages plus measured overhead) for `remote/*`, `remote-magpie/*`, and models that saw HTTP 413. The denominator is the shed trigger (900KB), not the 1MB proxy wall: at 758KB the old `/1MB` label read 74% while the trim wall was already at 84%. Plain models never see the cell (`extensions/footer.ts`, `extensions/autocompact.ts`, `test/wire-bytes.test.ts`, `test/wire-bytes-left.test.ts`).
46
-
47
- ### Fixed
48
- - Custom message renderers, unknown transcript components, and extension subclasses bypass the render cache. Nested content changes now appear without parent invalidation, while known Pi siblings remain cached and mouse hitbox heights stay current (`extensions/render-cache.ts`, `test/render-cache.test.ts`).
49
- - Measure byte-limited message arrays as serialized JSON UTF-8, including Unicode, JSON escapes, and array separators. This replaces inaccurate structural sizing and object-identity caches, so oversized Unicode payloads trigger the byte guard on their first request (`extensions/autocompact.ts`, `test/wire-bytes.test.ts`).
50
- - **`model-heal.ts` crash: `ReferenceError: DEBOUNCE_MS is not defined` exited pi.** The widget→notify refactor removed the `DEBOUNCE_MS` constant but left its use in the `models.json` `FSWatcher` debounce; a heal pass writing `models.json` crashed pi via uncaught exception. The constant is restored, the watcher now handles async `error` events (deleting the watched directory makes `fs.watch` emit an `EPERM` that no try/catch can intercept), and two regression tests drive the real extension in a child process so removing either the constant or the handler fails the suite (`extensions/model-heal.ts`, `test/model-heal-watcher.test.ts`, `test/fixtures/watcher-child.mjs`).
51
- - **`renderCache` key order is pinned in `config.json`.** `KEY_ORDER` in `lib/preset-store.ts` now includes `renderCache` after `modelHeal`, so partial configs keep a stable order (`test/profile.test.ts`).
52
-
53
- ### Changed
54
- - **Documented Render cache, Smart tiers, and `PI_ARNATIVE_BYTE_WALL_MB` in `README.md`.** Added the `Render cache` toggle (`On` by default), updated `Smart` auto-compact tiers (`90%` for `>= 192k` with Render cache `On`, conservative tiers with `Off`), summarized fixed-budget trade-offs and byte-wall scaling, and updated the `/arnative` shortcut and architecture tables (`README.md`).
55
- - **The footer hourly rate renders `dim`.** `$19.98 (~$7.06/h)` painted both values the same, so the cost read as one number. The rate suffix now takes `dim` while the amount keeps `soft`; an active budget cap still paints the whole cell one alert colour (`extensions/footer.ts`, `test/footer-rate.test.ts`).
56
- - Byte measurement is skipped for models without a byte wall. Byte-limited sessions use exact serialized JSON UTF-8 measurements; Pi clones the message array before each `context` event, so per-object caches do not stay warm across requests (`extensions/autocompact.ts`).
57
- - **Render-cache width LRU holds 3 widths.** A 3-way width toggle (font-size steps, tmux pane alternation) thrashed the 2-slot LRU at ~710 us/render; 3 slots keep it warm at ~35 us/render (`extensions/render-cache.ts`, `test/render-cache.test.ts`).
58
- - **Arnative notices now render as transcript notifies instead of the widget slot above the editor.** The old `setWidget` notice covered the prompt; `announce()` now emits a `notify` line that stays visible in scrollback without blocking anything (`lib/status-widget.ts`).
59
- - **Tool box scroll indicators hold-to-repeat.** Holding left-click on a boxed tool's `↑ N more` / `↓ N more` border indicator auto-scrolls (250 ms delay, then every 90 ms) until release or the boundary (`extensions/tools.ts`).
60
-
61
- ## [0.12.0] - 2026-11-14
62
-
63
- - Fix Todos auto-hide cancellation when a body click opens a finished task list.
64
- - Fix Todos collapsing when clicking a `↑ 1 more` / `↓ 1 more` counter row that disappears after scrolling (`extensions/todos.ts`, `test/todos-widget.test.ts`).
65
-
66
- ### Added
67
- - **Auto-scroll when holding left-click on Todos `↑ N more` / `↓ N more` counter rows.** Holding a counter row past 250 ms repeats the scroll every 90 ms until mouse release or the list boundary, while a quick click still scrolls one row (`extensions/todos.ts`, `test/todos-widget.test.ts`).
68
-
69
- - **Expanded `[show]` tool boxes now cap their viewport height with clickable `↑ N more` / `↓ N more` border scroll indicators in `primary`, and single-clicking anywhere on a boxed tool toggles expand/collapse.** Expanding a large tool output no longer fills the entire terminal (`6-12` body lines scaled to terminal height); clicking `↑ N more` or `↓ N more` on the top or bottom border scrolls up or down, and single-clicking text or borders on the box toggles `[show]`/`[hide]` on synthesized `click` (`clickCount === 1`) so drag and double-click text selection keep working (`extensions/tools.ts`).
70
-
71
- ### Added
72
- - **Chatbox preset menu (`/arnative chatbox`) with `Box` (`Arnative` default vs `Pi (system)`), `[i] Icon` cycling (`❯`, `>`, `›`, `▸`, `→`, `\uf44f`, `\udb82\udf79`, `\uf51b`, `\udb80\udf7d`, `\uf120`, `\uf489`, `\udb80\udd7a`), and `[D] Dialog` status placement (`Left`, `Center`, `Right`, `Inside`, `Outside`).** `Arnative` renders the rounded input box with the selected prompt icon (`primary` while actively typing, `dim` after 3s idle, with 2 trailing spaces on Nerd Font PUA glyphs so wide icons never crowd the text) and clickable `↑ N more` / `↓ N more` scroll indicators painted in `primary`, trims Pi's leading `Spacer(1)` in `widgetContainerAbove` so chatbox/notices/widgets sit without an extra blank row above them, and renders all five status dialog positions relative to the chatbox (`Left`/`Center`/`Right` on the top border, `Inside` on line 1 right corner, `Outside` left-aligned above the editor with breathing space above/below and inline notices beside it). Choices persist in `config.json` as `chatboxPreset`, `chatboxPrompt`, and `chatboxDialog` (`lib/preset-store.ts`, `lib/list-picker.ts`, `extensions/footer.ts`, `extensions/arnative.ts`, `test/profile.test.ts`).
73
- - **Custom collapsed Thinking label (`\uec21 Thinking...`) when running `pi-arnative`.** Replaces Pi default label with `\uec21` in `dim`, `Thinking...` in `dim` italic, and loops `.` → `..` → `...` while that thinking run is actively streaming. Once the run ends the label states what happened instead of claiming to think: `\uec21 Thought for 3s` (`3s` under a minute, `1m 23s` above), still `dim` italic, with one duration kept per run so a later run after a tool call times itself (`extensions/ui-render-tweaks.ts`, `formatThinkingElapsed`, `ThinkingLabelComponent`, `patchThinkingInAssistantMessage`; `extensions/timestamps.ts` keeps the timestamp off both labels; pinned in the ui-render-tweaks self-check and `test/patch-reload.test.ts`).
74
-
75
- ### Fixed
76
- - **Model heal caches synced channels and probed efforts locally instead of re-running on fixed timers or external catalog refreshes.** Per-model `compat` flags now land in `modelOverrides` so external writers that replace `models[]` (such as Magpie) leave healed flags intact. Automatic `healMeta` and `healEffort` runs keep successful results cached in `model-heal.json` until a new model ID, changed endpoint, or changed effort map appears (failed checks still retry after 1h, and `/model-heal` still forces all passes). Effort cache lookup also matches model IDs case-insensitively and stops re-probing legacy identity entries (`lib/model-heal.ts`, `healFlags`, `healMeta`, `healEffort`, `findEffort`, `metaFresh`; pinned in `test/model-heal-cache.test.ts`).
77
- - **The providers nested under a project are dim, like every other row under a group.** In `/usage` → **Project**, an expanded project listed its providers in the plain text color while the Provider and Prices views already dimmed their children, so a folder's contents read as another group heading. The child rows now take `dim`; the project row keeps `text` and the expand arrow keeps the accent (`extensions/usage.ts`, the `resting` paint in `render`).
78
-
79
- ### Changed
80
- - **Budget screen labels (`Today`, `30d`, `Total`) now use `dim` while the spend values beside them stay in the default `text` color.** Added `[R] Reset` in `/arnative` -> Budget to reset `budgetDay`, `budgetMonth`, and `budgetEnforce` back to `off` (`extensions/budget.ts`, `resetBudget`, `BudgetModalComponent`).
81
-
82
- ## [0.11.1] - 2026-11-13
83
-
84
- ### Fixed
85
- - **A reselect keeps the thinking levels a probe paid for.** Selecting or re-probing a provider's models reserialized every `auto` model through `mergeLevels`, which carried only its level, so `wireModels` dropped the stored `thinkingLevelMap` and the model went back to offering every level. `mergeLevels` now carries the probed map with the level, and the reselect path is pinned in the provider self-check (`lib/provider.ts`, `mergeLevels`).
86
-
87
- ## [0.11.0] - 2026-11-13
88
-
89
- ### Added
90
- - **Spend is exported as a Prometheus textfile.** On `turn_end` — at most one write per 60 s, and only when the rendered text differs from the last one written, so an idle session never touches the file — the usage summary is rendered as a Prometheus exposition and atomically written (temp file + rename, Windows `EPERM` in-place fallback) to `~/.pi/agent/arnative/usage.prom`: `arnative_cost_billed_total` (billed only, never estimates), `arnative_cost_estimated_total`, `arnative_cost_today` / `arnative_cost_30d` (the day buckets), `arnative_tokens_total{provider,model,kind}`, `arnative_sessions_total` and `arnative_usage_last_change_timestamp_seconds`, each with `# HELP`/`# TYPE`. No network, no credentials: point a textfile collector at the folder (`node_exporter --collector.textfile.directory=~/.pi/agent/arnative`) and the gauges land in Grafana next to the infra metrics; `PI_ARNATIVE_EXPORT=0` disables the export. A failed write is swallowed, never thrown into the session (`extensions/usage-export.ts`, `renderProm`, `exportProm`, `writePromFile`; pinned in the usage-export self-check and in `test/usage-export.test.ts`).
91
- - **Warn-only budget guardrail on the next turn.** `/arnative` → **Budget** sets a day and/or a 30-day cap on billed spend (read from the usage cache's day buckets, `totals.today` / `last30d`: the footer band through the 5s memo, the gate through a forced scan so it never decides on a stale total) and an enforce switch that ships **off**. The footer cost cell turns amber at 80% of a cap and red at 100%. The gate is `pi.on("input")`: over a cap with enforce on, the next turn is stopped before any token is bought (`{ action: "handled" }` plus an error notify); with enforce off it notifies once per session and lets the turn through. It never blocks a `source === "extension"` input, never blocks when the spend is unknown (no day buckets), and the whole handler fails open — any error returns `continue`. Only billed spend can cross a cap — a cap computed from a catalog estimate would enforce $0 on an unpriced model — while an estimate still counts towards the 80% warning, so a provider that reports no billed total is not silently ignored (`UsageDayWindow.estimated`). New `config.json` keys `budgetDay` / `budgetMonth` (amount strings, `""` = unset) and `budgetEnforce` (`"on"`/`"off"`), read through the new `loadNumber` and recorded in the startup profile (`extensions/budget.ts`, `budgetState`, `spendNow`, `budgetLevelNow`, `openBudget`, the `input` gate; `lib/preset-store.ts`, `loadNumber`, `KEY_ORDER`; `extensions/arnative.ts`, the Budget row; `extensions/footer.ts`, `costCell`/`getUsage` band painting; pinned in the budget, preset-store, footer and arnative self-checks and in `test/budget.test.ts`, `test/profile.test.ts`).
92
- - **The Budget screen shows the spend it guards.** `/arnative` → **Budget** now opens a dashboard: one line per window, `Today · $0.42 of $1.00 ███░░ 42% · OK`, with `30d` under it on the same column grid, so a cap is read next to the bar it fills. A dim `Total · $0.07 est.` line states the estimate the caps ignore. The bars fill from billed plus estimated spend, while the level keeps the guardrail rule (only billed spend can reach a cap, an estimate still counts towards the 80% warning), and the three rows below, `Day cap`, `30d cap` and `Enforce`, keep their notes and stay the only way to set a cap (`extensions/budget.ts`, `BudgetModalComponent`, `budgetWindows`; pinned in the budget self-check).
93
- - **The footer cost cell also shows the burn rate, and the cache cell colours its recent hit rate.** With the cost cell on (`/arnative` → Footers → `[c]`), the cell appends `$/h` — cost divided by *active* hours of the footer clock (idle pauses excluded, not wall-clock), so the cost per active hour is visible without opening `/usage`: `$0.42 ($1.80/h)`, opened by the footer `·` divider so the dollar icon reads as its own group next to the token cells. The rate is hidden below five minutes of active time (dividing a two-minute clock prints nonsense), when the session has no cost, and below 80 terminal columns, and it carries the `~` whenever estimated cost feeds it, like the estimated part of the cell. Separately, the cache cell's colour now follows a recent window — the last 10 assistant messages, the session's first two always skipped because turn 1 is a cold cache — while the `pi …%` text stays session-wide: ≥70% keeps the soft tier, 40–70% turns amber (`warning` slot, accent when the theme has none), below 40% turns red (`error`). It is a passive colour only, never a notification, and no config key was added (`extensions/footer.ts`, `costCell`, `getUsage`, `cacheHitBand`, `CACHE_WINDOW_MSGS`, `RATE_MIN_ACTIVE_MS`, `RATE_MIN_WIDTH`; pinned in the footer self-check and in `test/footer-rate.test.ts`).
94
- - **The footer counts subagent and nested-tool spend, and `/usage` stops counting it twice.** pi attaches a tool execution's own usage to the tool result (`ToolResultMessage.usage`), not to any assistant message, so the footer's `↑↓` cells and cost cell under-reported a fan-out workflow. `getUsage`/`lastUsageOf` now sum tool-result usage too, attributed to a synthetic `tool` provider with the tool name as the model (`tool · subagent`) — never to the parent's provider/model. The `/usage` scan deliberately does **not** read it: pi-subagents writes each child run as `<project>/<parent id>/<run id>/run-N/session.jsonl` *inside* the sessions tree, and the run's transcript under `<project>/subagent-artifacts/`, so the recursive scan was already counting every child's assistant messages — and counting both the child file and the parent's tool result billed the same tokens twice. `scanSessionFiles` now reads the parent session files plus each child run's `session.jsonl`, and never a `subagent-artifacts/` transcript — which also removes the pre-existing double count of those transcripts from every `/usage` total. The usage cache is now v9: an item written by the build that also stored tool-result rows is re-parsed once, so those rows cannot be counted a second time next to the child's own file. `piCacheHit()`'s denominator (`input + cacheRead`) includes child tokens on purpose: the `↑` cell is total spend, so the hit rate is measured against the same total (`lib/usage-store.ts`, `scanSessionFiles`, `childSessionFiles`, `SUBAGENT_ARTIFACTS_DIR`, `TOOL_PROVIDER`; `extensions/footer.ts`, `getUsage`, `lastUsageOf`, `attributionOf`; pinned in the usage-store and footer self-checks and in `test/usage-store.test.ts`).
95
- - **`/usage` can group by project and answer "what did I spend today".** The usage cache is now v7: each session file's rollup also keeps day buckets (keyed `YYYY-MM-DD` in **UTC**, so the cache does not depend on the machine's timezone) and the session's `cwd` (read from the file's first line on a whole-file parse, kept from the cache on a tail parse, so a grown file never re-reads its head; a file with no cwd counts under `unknown`). A pre-v6 cache entry is re-parsed once from its file and re-saved in the new shape. The summary gains `projects` (one row per cwd, same fields as a provider row, with the providers seen in that project) and `totals.today`/`last7d`/`last30d` from the day buckets. In the dashboard, `v` cycles the view Provider → Project → Provider on the same column grid, and a dim `today $x · 7d $y · 30d $z` line sits under the Total band when the cache holds buckets; the legend advertises `[v] View` only where it is handled (`lib/usage-store.ts`, `collectUsageSummary`, `foldInto`, `encodeDiskItem`/`decodeDiskItem`; `extensions/usage.ts`, `UsageModalComponent`, `cycleView`; `lib/shortcuts.ts`, `legendUsage`; pinned in the usage-store and usage self-checks and in `test/usage-store.test.ts`).
96
- - **The footer can show what the session cost, off by default.** `/arnative` → **Footers** → `[c]` adds a cost cell to the metrics row: the sum of pi's per-message `cost.total` over the branch, so it follows the live stream the way the token cells do (same 2s scan cache, same in-place delta on a streaming tick). A session where no provider reported a billed total is prefixed `~`, because `cost.total` is then the catalog estimate — the same promise `/usage` makes; a session with no cost at all shows no cell rather than `-`. The switch is a command, not a preview: the legend states its state and `Esc`/`←` leave it on, only the preset preview reverts. Stored as `footerCost` (`"on"`/`"off"`, absent reads as off) and recorded in the profile at `session_start` (`extensions/footer.ts`, `activeFooterCost`, `setFooterCost`, `costCell`; `lib/preset-store.ts`, `FOOTER_COST_KEY`; `extensions/arnative.ts`, `footersPickerText`; pinned in the footer and arnative self-checks and in `test/profile.test.ts`).
97
-
98
- - **A change notice sits above the editor.** After a menu commits a change (theme, header, footer, animation, auto-compact, model heal, budget row, provider save/delete/rename/key) one line above the chat input states what changed and clears itself after six seconds. It uses the `aboveEditor` widget slot under the key `arnative-notice`, so a later change replaces the line instead of stacking, and a headless session is left alone (`lib/status-widget.ts`, `announce`; `extensions/arnative.ts`, the pickers' `done` hooks; `extensions/budget.ts`, `change`; `lib/provider.ts`, the provider writes).
99
-
100
- ### Fixed
101
- - **A cache item is never trusted while it is missing something.** A v4 rollup and a pre-v8 row are now stamped below the current version, so the scan re-parses their file once instead of trusting sums that carry no day buckets and no billed split; an item whose `r` is empty (a session with no assistant message) is a current item, not an old one, so it is no longer re-read on every start. A corrupt timestamp on one line is dropped instead of throwing `RangeError` out of the whole scan, which used to take `/usage` and the Model tab down with it. The Prometheus export forces its scan (the 5s memo could otherwise export the turn *before* the one that just ended, then hold that number for the 60s throttle), also exports `kind="cache_write"`, and flushes on `session_shutdown` (`lib/usage-store.ts`, `decodeDiskItem`, `entryOfLine`, `tsOf`, `windowOf`; `extensions/usage-export.ts`, `exportProm`; `extensions/footer.ts`, the cache band only colours pi's own rate, never a cache-stats plugin's).
102
- - **Cost numbers no longer blend billed and estimated, and cache writes are priced.** `models.json` rates now carry `cacheWrite` (pi's own catalog prices it, `Usage.cost.cacheWrite`), so every `~` estimate counts cache writes, and the price table is memoized on `models.json`'s stat — one `statSync` per call instead of a `readFileSync` on every footer frame. The usage cache is now v8: its rows also store `cacheWrite` and the billed split of `cost`, and a pre-v8 entry is re-parsed once from its file. `cost` everywhere (the `/usage` rows, the Total band, the day windows) is the provider-billed total only; catalog totals and price-table reconstructions live in `estimatedCost` and are always shown with a `~`. The footer cost cell renders `$0.42`, `~$0.42` or `$0.30 + ~$0.12` — one billed message no longer strips the `~` from a sum that still contains estimates — and `/usage` names both sources under the Total band (`$0.30 billed + ~$0.12 estimated (models.json)`). `v` in `/usage` now also cycles to a Prices view: every provider+model in `models.json` with its `$/1M` in / out / cache-read / cache-write rates, sorted by input rate, with a used model that has neither a rate nor a reported cost marked `unpriced` (a built-in model reports its own cost, so it is priced even though `models.json` has no entry for it) (`lib/usage-store.ts`, `loadPriceTable`, `estimateCost`, `entryOfLine`, `providerStatsOf`, `decodeDiskItem`/`encodeDiskItem`; `extensions/footer.ts`, `costCell`, `getUsage`; `extensions/usage.ts`, `UsageModalComponent` Prices view; pinned in the usage-store, footer and usage self-checks and in `test/usage-store.test.ts`).
103
- - Footer usage caching now separates session managers and branch leaves. Switching equal-length branches shows their own totals while streaming updates retain the cached prefix.
104
- - Effort probes use the declared Responses or Chat Completions protocol, including its reasoning payload and token-limit fields. Responses-only providers can now report accepted thinking levels.
105
- - Effort probes stop pending requests, remaining levels, and retry waits on cancellation. Model heal enforces its probe deadline without recording cancellation or budget exhaustion as model failures.
106
- - Preset saves now compare against the current disk value and preserve invalid profiles. Unsaved choices emit a warning.
107
- - Usage Reset now clears model/provider statistics without moving session files or removing them from `/resume`. A persistent baseline excludes earlier messages, counts new messages in existing sessions, and supports Undo while the dashboard remains open. Existing `usage-trash` files stay untouched.
108
-
109
- ### Fixed
110
- - **Usage stops showing `unknown` for projects it can read.** A cache written before the cwd field existed still carried the current version number, so the scan trusted it and every old session landed under `unknown`. The cache is now v10, an item counts as current only when it carries the cwd marker, and a re-parse that starts at the reset baseline reads the file's first line for the cwd instead of skipping it (`lib/usage-store.ts`, `CACHE_VERSION`, `headCwd`, `encodeDiskItem`; pinned in the usage-store self-check and in `test/usage-store.test.ts`).
111
-
112
- ### Changed
113
- - **Enter says Select, each footer names one exit, and Budget changes on Space.** The shared menu legend read `[Enter] Open` while the pickers read `Select`; it now says `Select` everywhere. The Footers legend drops the duplicate `[←] Back` and renames `[Esc] Revert` to `[Esc] Back`, because both keys already ran the same `back()`. The Budget screen moves its change action to Space (`[↑↓] Move [Space] Change [Esc] Back`) and Enter no longer changes a row; it stops calling Esc `Close` when it returns to `/arnative`. The Thinking list spells its number keys as `[0-6] Set level`, the provider delete prompt uses the arnative box instead of pi's stock confirm, and the Usage description names the active view, with its legend reading `[Space/Click] Show/Hide` and `[v] Next: <view>` stating where the key leads (`lib/shortcuts.ts`, `LEGEND_ROOT`/`LEGEND_MOVE`; `extensions/arnative.ts`, `footersPickerText`; `extensions/budget.ts`, `BUDGET_PICKER_TEXT`; `lib/provider.ts`, `THINKING_LEGEND`, `deleteProviderFlow`; `extensions/usage.ts`, the dashboard description; pinned in the list-picker, shortcuts, arnative, budget and usage self-checks).
114
- - **The Usage dashboard drops two summary lines and groups the price table.** The Total row now shows the catalog estimate (`~$2.93`) when no provider reported a billed total, instead of a bare `-`. The `today · 7d · 30d` line and the separate estimate line under it are gone, and the detail line writes `$2.93 est.` without a second `~`. In the Prices view, models sit under their provider like the Provider view, the group row stays blank, and the rate columns gained a space. Rows follow the menu palette: a group row (provider or project) uses the plain text color, model and price rows are dim, the expand arrow is accent, and the selected row takes the soft accent. Project and Prices keep that same two-level shape: one group row, then its indented rows (`softOf` derives it from the theme accent, so a theme without the `accentSoft` token still renders; `extensions/usage.ts`, `UsageModalComponent`, `buildFlatRows`, the row and Total renderers; pinned in the usage self-check).
115
-
116
- ## [0.10.1] - 2026-11-11
117
-
118
- ### Fixed
119
- - Manual Model heal shows a start notice and live progress for flags, catalogs, and thinking probes. Final results now include partial failures.
120
- - Manual Model heal now cancels on session reload or replacement. Model refresh captures the current model before awaiting and uses the bound extension API.
121
- - Model heal now respects the one-hour cooldown after a failed effort probe. Reordering thinking map keys no longer triggers another probe.
122
- - Failed model catalogs now wait one hour before an automatic retry. Successful catalogs keep their six-hour TTL; forced heals and endpoint changes bypass the cooldown.
123
-
124
- ## [0.10.0] - 2026-11-08
125
-
126
- ### Added
127
- - **Shortcut to open settings:** Press `Alt+a` (Windows/WSL) or `Ctrl+Alt+a` (macOS/Linux) to immediately open the `/arnative` settings menu (`lib/shortcuts.ts`, `extensions/arnative.ts`).
128
- - **Five new themes:** Added `arnative-magical` (lavender & rose pink), `arnative-lemonade` (sage, peach & lime), `arnative-blossom` (rose & petal pink), `arnative-garden` (earth gold, olive moss & terracotta), and `arnative-earthy` (warm tan, sage moss & clay brown) (`themes/gen-themes.mjs`, `themes/*.json`).
129
- - **Harmonized chat & system boxes:** User chat bubbles (`userMessageBg`) and system notification boxes like `[compaction]` (`customMessageBg` / `customMessageLabel`) now derive directly from each theme's `primary` hue for consistent theme accenting across Cyberpunk, Crimson, Matrix, Gruvbox, Neutral, Nord, Zinc, Dracula, and new themes. User chat backgrounds are deepened to a stealth dark tier (L: 19%) across all themes for softer reading contrast.
130
- - **Custom theme auto-sync in dev loop:** `npm run overlay` now mirrors updated theme JSON files directly into `~/.pi/agent/themes/` (`scripts/overlay.mjs`).
131
-
132
- ### Added
133
- - **Four palettes: `arnative-zinc`, `arnative-nord`, `arnative-dracula`, `arnative-gruvbox`.** Zinc follows the sage-and-steel palette (`#e0e2db`, `#d2d4c8`, `#b8bdb5`, `#889696`, `#5f7470`): deep teal is the focus, soft linen the headings, cool steel the links and code, dust grey the footer labels. Nord, Dracula and Gruvbox follow their published palettes: polar-night canvas with frost-blue focus and aurora-purple labels, night canvas with purple focus, pink headings and model name, and orange labels, warm canvas with orange focus and aqua labels. Each palette declares a second hue at least 25° from its accent, so no screen reads as one colour, and the generator now rejects two themes that share an accent or footer colour (`themes/gen-themes.mjs`, `assertDistinctThemes`; `themes/*.json`). The README theme list names the real files again (`README.md`).
134
-
135
- ### Fixed
136
- - **Providers: a pinned thinking level no longer locks the model to that one level.** The wizard stored a level by mapping it to itself and every other level to `null`. pi reads `null` as unsupported, so `/thinking`, the thinking cycle key and turning thinking off all stayed on the pinned level (most visibly `xhigh`). A pinned level is now a ceiling: every effort up to it maps to itself, the levels above it are `null`, and `off` stays available. Model heal rewrites the old single-pin map in models.json to the ceiling shape, so an affected model recovers after `/reload` without deleting the provider (`lib/provider.ts` `levelToWire` and `wireToLevel`, `lib/model-heal.ts`, `test/thinking-levels.test.ts`).
137
- - **Providers: a probed model offers only the thinking levels its channel really runs.** The `p` probe and model heal mapped a rejected effort to the nearest accepted one, so DeepSeek V4.1 Flash on River listed `medium` in `/thinking`, sent `high` for it, and a chosen `medium` never reached the wire as itself. The probe now writes an exact map: each accepted effort maps to itself and each rejected one is `null`, so pi lists only what the endpoint accepts (low, high and max on River) and never sends a level it drops; `off` stays pi's call. A probe replaces a pinned level instead of remapping around it. Model heal re-probes a map an older probe wrote rather than taking its remaps for the user's, while a map shaped by hand stays untouched. `wireToLevel` reads a map with gaps as a probed map, not a `max` ceiling, and `loadProviderEntry` keeps the stored map of an `auto` model, so a later save in the wizard no longer wipes what the probe learned. After a level is saved, the session's active model is reloaded through a registry refresh, so the new levels apply without a restart (`lib/compat.ts` `buildEffortMap`, `lib/model-heal.ts` `healEffort`, `lib/provider.ts`, `extensions/arnative.ts`, `extensions/model-heal.ts`).
138
- - Model heal: a thinking level the relay rejects is removed from that model. When a turn fails with an error that names the reasoning effort, model heal sets that one level to null in the model's thinkingLevelMap, reloads the model and moves the session to the nearest level pi still offers, so the next request goes through and /thinking stops listing the level. The other levels stay, and off is never removed. A plain 400 that does not name the effort (context too long, a bad tool schema) leaves the map alone and only re-probes. The map stays probe-owned, so a later rejection can drop another level (lib/model-heal.ts markRejectedLevel, extensions/model-heal.ts isEffortRejection).
139
-
140
- ### Changed
141
- - **Providers → Thinking states what each model accepts, not a level to use.** The screen cycled every model through off, auto and seven pinned levels, and a pin threw away the probed map, so a model pinned at high still listed `minimal` and `medium` that its relay rejects. Space now switches a model between off and auto, p probes the levels it accepts, and keys 1 to 6 toggle minimal, low, medium, high, xhigh and max by hand for a relay that answers a probe but ignores the effort. Each row shows the levels `/thinking` will list. The level to use is picked per session in `/thinking`. A pin from an older version, or an id suffix such as `-high`, opens as the level list it allowed, and the bulk keys no longer clear a probed map. Headless input takes `id:off`, `id:auto` or `id:low+high+max` (`lib/provider.ts` `thinkingFlow`, `offeredLevels`; `test/thinking-levels.test.ts`).
142
- - Providers → Thinking: key 0 turns on all six levels for the model under the cursor, and a filter line under the description (dim "type to filter models…", as in pi-vision-watcher) narrows the models by name with a fuzzy match (the letters in order, spaces ignored, so river flash finds river/deepseek-ai/DeepSeek-V4.1-Flash-1017). / turns typing on and off: while it is on every key is text, and / or Enter turns it off and keeps the filter, so Space, 0 to 6, p (probe), a (all auto) and r (all off) act on the matching models. Esc clears the filter before it closes the screen. The footer reads [/] Filter [Space] Off/auto [0-6] Levels [p] Probe [a/r] All auto/off [Enter] Save [Esc] Back (lib/provider.ts thinkingFlow, lib/list-picker.ts search hook).
143
- - The Models and Probe models screens in /providers take the same filter. A relay catalog runs to dozens of ids, so `/` now turns on a filter line that narrows the list by name (fuzzy, spaces ignored); while typing every key is text, and `/` or Enter keeps the narrowed list so Space still checks rows. The picked count stays whole (`3/75 picked`) because the filter hides rows, it does not unpick them (`lib/provider.ts` `pickModels`, `lib/list-picker.ts` search hook).
144
- - Usage: the window bar is framed by two rules, and every rule on the dashboard takes the disabled tier (`borderMuted`) instead of `dim`, so the chrome recedes behind the numbers. The table rule above Total keeps its table width and only changes colour.
145
- - **Reset the Usage history without losing it.** `R` in the dashboard asks first, on the footer row, and states what it is about to move: `Delete 326 sessions (283 MB)? moves to the trash [y] Yes [Esc] Cancel`. Confirming moves Pi's session files into `arnative/usage-trash/<stamp>/` with their folder structure, so the numbers start from the current session and `/resume` forgets the old ones until `U` puts them back. The session pi is writing to is never touched. A pending question owns every key, so a stray arrow answers no. (`lib/usage-store.ts` `resetUsageHistory`/`restoreUsageHistory`/`usageHistorySize`; `extensions/usage.ts` `runConfirm`; `lib/shortcuts.ts` `RESET_USAGE`/`UNDO_USAGE`.)
146
- - **Usage counts cache reads in the Tokens column.** The headline only summed prompt input and completion output, so the same week that Magpie's own dashboard reports as 253M read as 7.6M here and the 233M cached tokens were visible only after selecting a row. Tokens now sums all three, which is what a vendor dashboard reports (242M for the same week, the rest being requests Magpie counts that pi never saw finish), and the detail line still splits `↑in · ↓out · cache` (`lib/usage-store.ts` `totalTokens`; pinned in `extensions/usage.ts`).
147
- - A folded box is short again, whatever the payload. A single-line JSON reply (a fetch of one page) counted as one row, so it got no `[show]` and its summary wrapped into a full screen. Rows are now measured as they are painted, and the summary is clipped to one row (`extensions/tools.ts` `drawnRows`, `oneRow`).
148
- - **Every theme is two-toned, and six now carry three hues.** The footer, the selected row in Models/Providers and every detail line draw on the label tier, which is `borderAccent`. Six themes pointed that token back at `accentBorder`, so its hue was the accent's own and the whole UI read as one colour no matter what `primary` and `secondary` declared. Arnative now pairs cyan with violet, emerald with gold, sun with indigo, violet with cyan, matrix with ice-cyan and zinc with faint sky, with headings and links taking a third tone where the palette has room. `themes/gen-themes.mjs` gained `assertDualTone`: a theme whose label tier sits closer than 25° to the accent, carries under 0.02 chroma, or falls below 3:1 contrast on the page background is refused at generation time.
149
- - **Two themes join the family from Coolors palettes.** Ocean pairs a periwinkle-steel focus with foggy-teal labels (Coolors "Midnight Navy": 0d1b2a-778da9), and Fiesta is a warm coral focus with amber headings and navy labels (Coolors "Fiesta": f95738-f4d35e-0d3b66). Both pass the same dual-tone guard as the rest, and the picker lists them simply because they ship with the package; no extension code changed (`themes/gen-themes.mjs`).
150
- - **Two pink-red themes from coolors trending palettes.** Blossom pairs a hot-fuchsia focus with royal-blue labels and purple headings (trending magenta ramp: f72585-7209b7-4361ee), and Crimson is a vivid-red focus with navy labels and cream headings (trending red: c1121f-fdf0d5-003049). Both pass the dual-tone guard; no extension code changed (`themes/gen-themes.mjs`).
151
- - Blossom and Crimson now draw the footer model name in their accent tone (pink and red), so the right side of the status bar carries the theme's focus color; headings keep their own hue on a literal instead of aliasing the model tone.
152
- - Correction: the footer paints the model name with the `mdHeading` token, not `vars.primary` directly (extensions/footer.ts `colorOr("mdHeading", acc)`), so the earlier Blossom/Crimson fix missed the carrier. `mdHeading` now references the pink/red `primary` var, so the model name (and headings) visibly carry the accent tone.
153
-
154
-
155
- - **Arnative is rebuilt on the teal-and-amber palette the user picked** (#16697a #489fb5 #82c0cc #ede7e3 #ffa62b): the focus moves from cyan/violet to the teal family, the label tier becomes amber, headings become warm white, links and inline code take the pale teal, and message panels gain a deep-teal tint. The generator stays the single source of truth and the dual-tone guard still passes (`themes/gen-themes.mjs`).
156
- - **Arnative is rebuilt on a cyan-and-gold palette, all roles referencing vars.** Strong-cyan accent (#02cecb), bright-gold primary (#fed811), school-bus-yellow secondary (#fdc100), a new icy-aqua `tone` var (#b4ffff) for links/code, and a deep-teal message panel (#06837f, deepened to keep contrast floors; the decorative `mdHr` is now exempt from the text floor). `mdHeading`/`mdLink`/`mdCode` reference `primary`/`tone` instead of literals, matching the sun pattern. The generator gained an optional per-theme `tone` var (themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
157
- - Arnative's footer label tier now follows the accent (`borderAccent: accentBorder`, so `secondarySoft` resolves to soft cyan), and markdown links join headings on `primary` (bright gold); inline code keeps the icy-aqua `tone`. The dual-tone guard allows a zero hue gap for arnative because the gold signature lives on headings/links (`themes/gen-themes.mjs`).
158
- - The footer label tier (`secondarySoft`) is softened with a stronger chroma scale (0.35 vs 0.18), so arnative's cyan labels read as a tinted second tone instead of grey; the runtime self-check mirrors the same scale (themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
159
- - Saturation of the label tier raised again: chroma scale 0.35 → 0.6 (aritynative secondarySoft ≈ 0.047 chroma), so footer labels read as a vivid cyan tint (themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
160
- - Root cause fixed: the runtime label painter (`softSecondaryOf`) had its own fixed 0.18 chroma scale, so the earlier generator-only scale bumps never reached the screen. The scale is now a single shared constant — 0.5 — in lib/ansi.ts, gen-themes.mjs and the self-checks, so footer labels (and all soft tiers) render at the declared saturation (themes/gen-themes.mjs, lib/ansi.ts, extensions/ui-render-tweaks.ts, test/footer-minimal.test.ts).
161
- - The theme family is trimmed to two: `arnative` and `arnative-cyberpunk`; the other thirteen variants are removed. Cyberpunk is rebuilt in arnative's var-based format — labels follow the accent (`borderAccent: accentBorder`), headings and links take `primary`, code takes a new electric-purple `tone` var, bullets take the accent — while keeping its own neon pink/lime/cyan palette (themes/gen-themes.mjs, extensions/arnative.ts, test/todo-box.test.ts).
162
- - Cyberpunk swaps its purple tone for orange: code/links now take `vars.tone` (orange, `oklch(82% 0.18 45)`) and the footer model name/headings take a new `vars.headingTone` (purple, `oklch(78% 0.20 300)`) — both var-backed, no role literals (themes/gen-themes.mjs).
163
- - Cyberpunk links now join headings on `vars.headingTone` (purple); code keeps the orange `vars.tone`, and labels stay pink-soft (themes/gen-themes.mjs).
164
- - Cyberpunk chat background drops its literal override: `vars.surfaceMsg` now falls back to the generator-default neutral (deep purple tint `oklch(24% 0.01 275)`), so the panel stays in the theme without hand-picked colors (themes/gen-themes.mjs).
165
- - Cyberpunk chat panel now reuses the `headingTone` var: the generator darkens a named var to the canvas level (L=base, chroma×0.35 capped at 0.06, same hue), so `surfaceMsg` = `oklch(24% 0.06 300)` — a visible deep purple instead of near-black (themes/gen-themes.mjs).
166
- - The accent soft tier is tuned down: `accentSoft` chroma scale 0.5 → 0.35 (runtime `SOFT_CHROMA_SCALE_ACCENT`, generator and self-check mirror), so soft accents read quieter while footer labels (`secondarySoft`) keep 0.5 (lib/ansi.ts, themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
167
- - `accentSoft` is now lighter and paler: lightness 0.82 → 0.86 and chroma scale 0.35 → 0.25 (`SOFT_L_ACCENT`/`SOFT_CHROMA_SCALE_ACCENT`), so it reads as a pale tint, clearly distinct from the accent; footer labels keep 0.5 at 0.82 (lib/ansi.ts, themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
168
- - `accentSoft` now approaches white: lightness 0.86 → 0.94, chroma scale 0.25 → 0.15, so it reads as a near-white tint (lib/ansi.ts, themes/gen-themes.mjs, extensions/ui-render-tweaks.ts).
169
- - All soft tiers (`secondarySoft` and `accentSoft`) now sit at lightness 0.94 and chroma scale 0.15, so footer labels and soft text render near-white with only a delicate hue whisper across both themes (themes/gen-themes.mjs, lib/ansi.ts, extensions/ui-render-tweaks.ts, test/footer-minimal.test.ts).
170
- - `borderAccent` in both themes now points directly to `accentSoft` (L 0.90, chroma scale 0.25): footer labels and status lines take the soft accent tint directly, rendering as bright, readable pastel tints of the accent hue (pink in cyberpunk, cyan in arnative) without intermediate layers (themes/gen-themes.mjs, lib/ansi.ts, extensions/ui-render-tweaks.ts, test/footer-minimal.test.ts).
171
- - Increased the saturation of footer labels slightly: `accentSoft` chroma scale 0.25 → 0.35 at L 0.90, so the pastel accent tint (pink, cyan, green, red, blush) reads more visibly while remaining light and high-contrast (themes/gen-themes.mjs, lib/ansi.ts, extensions/ui-render-tweaks.ts, test/footer-minimal.test.ts).
172
-
173
- - Added `arnative-neutral` based on the user's palette: powder-blush warm accent (`#e0afa0`), parchment cream headings & model name (`#f4f3ee`), warm silver links/code (`#bcb8b1`, tone), grey-olive secondary (`#8a817c`), and deep taupe panels (`#463f3a`). Footer labels take soft blush-white pastel via `accentSoft` (themes/gen-themes.mjs, themes/arnative-neutral.json).
174
-
175
- - Added `arnative-matrix` based on the user's palette: medium-jungle green accent (`#09a129`), phosphor spring-green headings & model name (`#27fb6b`), phosphor mint links/code (`#60ddc0`, tone), and jet-black teal panels (`#0a2e36`). Footer labels take soft matrix pastel green via `accentSoft` (themes/gen-themes.mjs, themes/arnative-matrix.json).
176
-
177
- - Added `arnative-crimson` based on the user's palette: brick-red accent (`#c1121f`), molten-lava secondary (`#780000`), warm papaya-whip cream headings (`#fdf0d5`), steel-blue links/code (`#669bbc`), and deep-space-blue panels (`#003049`). Footer labels take soft brick-red pastel via `accentSoft` (themes/gen-themes.mjs, themes/arnative-crimson.json).
178
-
179
-
180
-
181
-
182
-
183
-
184
-
185
-
186
-
187
-
188
-
189
-
190
-
191
-
192
-
193
-
194
-
195
-
196
-
197
-
198
- - **Every tool box can be folded again.** A box whose rows came from another extension (pi-web-access' `search`, `fetch`, `get_content`) was drawn from their template alone, so it had no title row: no `✓ name`, no runtime, and no `[show]`/`[hide]`, which left `ctrl+o` as the only way in. Those boxes now draw the title row like the rest, and the label appears only when their renderer really answers `expanded` (`extensions/tools.ts` `rightAlign`, `theirsAt`).
199
- - **Usage gains a window bar and a five-row viewport.** The dashboard only ever showed one number: everything this machine has ever spent. It now opens on `All · Today · 7 day · 30 day · 3 month`, with the active window accented on its own line above the table, and the numbers below follow it. `[Tab]` walks the bar, `[Shift+Tab]` walks it back, and a click on a tab picks it. Day buckets are stored beside the all-time totals, so a window costs a sum instead of a rescan; a cache written before buckets existed is re-parsed once, and only when a window is actually asked for. The table shows five rows at a time with `↓ 2 more` / `↑ 6 more` above and below, and `5/14` on the bar states how many rows there are. Switching the window resets the cursor to the first row, because a provider that carried three months can be absent from today (`extensions/usage.ts`, `lib/usage-store.ts` `UsageRange`/`dayKey`/`rangeStart`; `lib/shortcuts.ts` `[Tab] Range`).
200
- - **`[Esc]` steps out one level, on every screen.** Esc used to close `/arnative` from any depth, so leaving a Themes preview cost the whole menu, and only `←` went back. Esc now means Back wherever a parent screen exists: Themes, Headers, Footers, Animations, Model heal, Providers, the provider actions, the usage dashboard and the input fields all return to the screen that opened them, and a live preview is dropped on the way out. At the root menu Esc still closes. `←` keeps working as an alias but no footer advertises it, so each footer names one exit instead of two: `[↑↓] Preview [Enter] Select [Esc] Back`. A filter field spends its first Esc on ending typing, so the same key never leaves a screen the operator was still editing (`lib/list-picker.ts` `leave`, `lib/shortcuts.ts` legends, `extensions/usage.ts`).
201
- - Model heal: its status row leads with its own mark, U+F06DE, in place of the shared one, and counts in plain words (1 change, 3 changes) instead of change(s). Any widget row that opens with a Nerd Font glyph keeps that glyph as its mark (lib/status-widget.ts, extensions/model-heal.ts).
202
-
203
- ## [0.9.1] - 2026-11-02
204
-
205
- ### Added
206
- - **Providers → Edit changes the endpoint, the id or the key, one field per row.** Opening a provider now leads with `Edit`, and its menu shows what is stored beside each row: the base URL, the provider id, the key masked to its last four characters. A base URL is saved as typed (only a bare host gains its `http://`), so an edit lands what the user wrote instead of re-deriving `/v1` the way the add flow does, and the notify points at `Probe models` for the list that may have moved with it. A rename moves the models.json key and the auth.json credential together — the provider keeps its place in the list, a `name` that only repeated the old id follows it, the id is checked against the same `[A-Za-z0-9_-]` rule as create, and an id already taken is refused; if models.json cannot be written the credential is put back, so a failed rename never orphans the key. A new key lands in auth.json, the store pi reads before an inline `models.json` key, and the literal inline copy is dropped so the secret lives in one place, while an env-var or shell reference (`$VAR`, `!cmd`) is configuration and stays untouched; an emptied field keeps what is stored rather than blanking an endpoint or a credential. The three write paths share one row picker and one field patch with the action menu, which also gained the `Edit` row (`lib/provider.ts`, `withProviderFields`, `renameProvider`, `renameAuth`, `saveProviderKey`, `inlineKey`, `keyHint`; pinned in the module self-check).
207
-
208
- ## [0.9.0] - 2026-10-31
209
-
210
- ### Added
211
- - **Task list: `todo` tool, boxed widget and `/todos`.** Replaces `@juicesharp/rpiv-todo`, so uninstall that package first (both register the `todo` tool). The widget collapses to one boxed row naming the task in progress; clicking its hint in fullscreen mode, or `alt+o` in any mode, expands it to five rows around the active task, with `↑ n more` / `↓ n more` for the rest (the window grows with the terminal: five rows at 24 lines, up to nine past 28, three on a short screen), `✓` / `◉` / `◌` status glyphs and the in-progress note in dim, with the subject carrying the state too: the running task in soft accent, queued dim, a finished one plain. The frame follows the session thinking level, like every other arnative box, the tool box title names the status the call left behind (`todo · completed`, `· created`, `· list`) while the task name stays on the line below, and a list whose tasks are all done folds to `All tasks finished` and then takes the widget away after 30 seconds, so nothing parks there for good while `/todos` still shows the full list; opening the box during the wait keeps it on screen, a reopened task cancels the wait, a new task brings it back, and `PI_ARNATIVE_TODO_HIDE_MS` sets the wait. The heading icon and `✓` are accent, the count beside the icon is soft accent, `◉` borrows the footer's model-name colour (`mdHeading`, accent when a theme omits it), `◌` is dim. Click a counter row, or press `alt+j` / `alt+k`, to scroll the five-row window one task at a time; the window parks at either end and returns to the active task after a mutation. The box never exceeds pi's 10-line widget budget, and the expand hint survives a narrow terminal by cutting the task name instead. The list is per session in `<agent>/arnative/todos/<session id>.json`, written via a temp file with an in-place fallback on Windows when rename is refused; `/todos` lists every task in the arnative screen chrome, in progress first (`lib/todos.ts`, `extensions/todos.ts`, `test/todos.test.ts`).
212
-
213
- ### Changed
214
- - **The Extensions tab lists packages the way `pi list` does.** The tab was built from pi's loaded-module listing, so a package arrived as eleven file names (`arnative.ts`, `footer.ts`, `usage.ts`) and never as the package itself. Rows now come from the packages in the global and project settings, one per package with the `npm:` prefix dropped, followed by the loose extension files that belong to no package (`hark.ts`, `omnirush`). The rows wrap sideways as one comma list, so the box keeps its height, the modules of a local-path package fold into that package's row (`D:/Pi/pi-arnative`), and the count matches `pi list` (`extensions/section-headers.ts`, `installedPackages`, `extensionTabItems`; `test/section-headers.test.ts`).
215
- - **`config.json` lists every preset, including the ones left at their default.** A choice was written only once it differed from the default, so the header had no entry at all: the picker writes on move, and opening it on `Arnative (Full)` then pressing Enter wrote nothing, while a fresh install read a nearly empty file. `recordProfile()` now runs at `session_start` and records header, footer, spinner, gradient, auto-compact and model-heal through `ensureChoices`, which writes only the keys that differ and leaves a present-but-unreadable config untouched. `AUTO_COMPACT_KEY` is exported so every key has one source (`lib/preset-store.ts`, `extensions/arnative.ts`, `extensions/autocompact.ts`); `test/profile.test.ts` covers the default-value case, the byte-identical second run and the corrupt-file guard. Every write also emits one key order (header first, then the rest of the menu, `layoutVersion` before the newer keys), so reading or hand-editing the file no longer depends on which session saved last.
216
-
217
- ### Fixed
218
- - **The expand hint is the whole click target, so box text stays copyable.** pi toggles a tool box on the click it synthesizes from a press and a release at the same cell, so a one-cell drift made the hint look inert, and the gap strip left the top border a dead row. The hint's cells are measured on every render and a left press there toggles at once; the release and the click that follow are swallowed, and only the click clears the flag, or the box toggled back. Any other cell is left to pi, so a drag over the output still selects and copies it. The label is matched on the title rows only, so text that happens to read `[show]` inside the output never becomes a button. The task widget works the same way: only `[click to expand]` / `[click to collapse]` and the counter rows take a press, which also made it drift-proof and left the task names selectable (`extensions/tools.ts`, `extensions/todos.ts`, `lib/box.ts`, `textSpans`).
219
- - **The new Extensions rows keep the installed version.** Rebuilding the tab from `settings.json` dropped the `@version` that the old rows carried, because a configured source is often written without one (`npm:@bismawy/pi-agentrouter`). The version is now read from the package's own `package.json` under `<agent>/npm/node_modules`, the same file `pi list` resolves, and a source that already pins a version (`npm:pi-mcp-adapter@2.36.0`) keeps exactly that text (`extensions/section-headers.ts`, `npmRow`; `test/section-headers.test.ts`).
220
- - **Both hints sit on the title row, next to the runtime.** The expand label shared a row with the summary, and it vanished when the box opened, so a box you had just expanded showed no way back. The box now says whether it is open with a word, `[show]` folded and `[hide]` open, at the right end of the title row in every box (the ordinary tools, the MCP and third-party path, and codemode), after the runtime and a dot: `195ms · [show]`. A box with nothing hidden shows no label at all, and the `ctrl+o` binding still toggles. Each is a click target, so a press with up to a cell of drift toggles the box and the summary line keeps its own width (`extensions/tools.ts`, `titleRow`, `HINT_EXPAND`, `HINT_COLLAPSE`).
221
- - **Every box shows how long its call took.** The runtime came only from this module's own wall clock, so a box whose content comes from a third-party renderer (MCP, `find`/`grep` from pi-fff, pi-web-access) never had one, and a restored session had none because the map starts empty. pi's `durationMs` is read first and the recorded wall clock stays as the fallback, so the right end of the title row carries the figure again (`extensions/tools.ts`, `durationOf`).
222
- - **A preset change reaches disk on Windows while pi is running.** The save wrote a temp file and renamed it over `config.json`. Windows refuses that replace with `EPERM` while another process holds the file open, which a running pi session does, so the picker looked saved and the value was gone after a restart. Three stale `config.json.<pid>.tmp` files on a real machine held the choices that never landed, including a header preset. The save now falls back to an in-place write on `EPERM`/`EBUSY`/`EXDEV` and removes its temp file (`lib/preset-store.ts`; the fallback is pinned in the self-check through a `rename` seam).
223
-
224
- ## [0.8.2] - 2026-10-28
225
-
226
- ### Changed
227
- - **Test output uses the arnative glyphs.** Those marks come from Node, not from this repo: the built-in `spec` reporter paints `U+2714 U+2716 U+2139 U+26F3` and a direct `node --test` has no hook to restyle it. `scripts/reporter.mjs` replaces the reporter instead, emitting `U+2713` pass, `U+2717` fail, `U+1F6C8` summary and `U+2691` file-level failure, with the assertion message and stack kept. `npm test` passes `--test-reporter=./scripts/reporter.mjs`; `NODE_OPTIONS=--test-reporter=./scripts/reporter.mjs node --test` applies it to every run. A failing run still exits non-zero (verified with a temporary failing test).
228
-
229
- ### Fixed
230
- - **`/reload` applies every patch now, in all five patched files.** `footer.ts` (2-line footer), `timestamps.ts` (bubble clock), `section-headers.ts` (loaded-resources tabs) and `ui-render-tweaks.ts` (reload box, selection colors, accent pill, select rows, package box, status widget, compaction line) sat behind `globalThis` guards, so only the first load's closures were ever installed and a UI fix needed a full pi restart. `lib/patch.ts` holds the one implementation: pi's method is recorded on the prototype under a symbol, every installed patch is marked, and each module reinstalls on load. `test/patch-reload.test.ts` imports all five modules twice and fails if a slot keeps the old patch (proven by temporarily restoring the guard: 2/5 fail).
231
- - **No double box after `/reload`.** The reinstall captured the previous arnative patch as "the original", so the new patch wrapped its box around the old one (`✓ memory_write` inside a box inside a box, two `✓` on one row). Only an unmarked method is now taken as the original, and the self-check re-imports the module and asserts one box per call (`extensions/tools.ts`).
232
- - **`/reload` now applies renderer changes.** Both `ToolExecutionComponent` prototype patches (gap strip, box/boxed-renderer routing) sat behind a `globalThis` guard. That flag survives extension reload, so only the first load's closures were ever installed and a UI fix needed a full pi restart. The originals now live on the prototype under a symbol and the patches reinstall on every module load; the self-check re-imports the module once to pin it (`extensions/tools.ts`).
233
- - **MCP calls keep the arnative box.** pi-mcp-adapter ≥ 2.3x defaults to `toolResultRendering: "compact"`, and that mode declares `renderShell: "self"` while painting flat text (`mcp call x @ y`, no border). The generic boxing predicate read `self` as "this tool draws its own box", so every MCP call and result fell back to that flat line. The MCP names now stay boxed whatever shell they declare, and the `mcp`/`mcp__<server>` call box names the invoked tool (`✓ mcp cloudflare_execute @ cloudflare`) instead of reusing the adapter's flat line. Verified through `ToolExecutionComponent` in the self-check (`extensions/tools.ts`).
234
-
235
- ## [0.8.1] - 2026-10-26
236
-
237
- ### Changed
238
- - **`/providers` is its own command.** The provider screen was reachable only as `/arnative providers`; it now also answers to `/providers`, through the same handler, so the two cannot drift. Both are registered in `registerCommands` and the self-check pins the set (`extensions/arnative.ts`).
239
- - **Status rows above the chat column now use the arnative mark and the theme's `dim` token.** pi renders a `setWidget` string array as unstyled `Text`, so every status line (model heal, the provider probe, other extensions' `setWidget` calls) landed in the default foreground. A render patch turns those arrays into a component factory that receives the live theme: the `\ueb1b` mark leads the block with one space, rows align under it, and a row another extension already painted keeps its own colour (an error row stays red). `lib/status-widget.ts`.
240
-
241
- ### Fixed
242
- - **The Extensions tab lists packages, not every module inside them.** The header used to print one row per loaded entry point (`@bismawy/pi-arnative@0.8.0:footer.ts`, `:model-heal.ts`, …), so a twelve-module package filled the box on its own. The `:subpath` is dropped and each package appears once with its version, so the count matches what `pi list` shows. Local single-file extensions (`hark.ts`) are unchanged (`extensions/section-headers.ts`, `extractItemsFromBody`).
243
-
244
- ## [0.8.0] - 2026-10-26
245
-
246
- ### Added
247
- - **Model heal keeps `models.json` correct with no command (adopted from pi-auto-compat).** On `session_start`, `model_select`, a change to `models.json` (debounced watcher) and an assistant error that names a rejected parameter, three passes run on the rules the provider wizard already uses: flags (missing compat flags and a default `thinkingLevelMap`, offline), meta (`contextWindow`/`maxTokens` from each channel's `GET /models`, 6 h TTL, unit anomalies rejected, caps clamped to the window) and effort (the `reasoning_effort` levels a relay accepts, remapped to the nearest accepted one, 24 h TTL). Each pass is one read-modify-write that writes only real differences: an explicit value (even `false`) is never overwritten, a hand-edited network value stays manual, a user-shaped map is never probed, a corrupt file is reported and never rewritten, and the first write keeps a backup. Channel-wide flags land at provider level; extension-owned providers are fixed through `modelOverrides`. `/arnative` → **Model heal** picks `Full` (default), `Flags` (offline only) or `Off`; `/model-heal` forces every pass now, and `/auto-compat` stays as an alias once pi-auto-compat is uninstalled. While pi-auto-compat is still installed, pi-arnative defers to it and says so once, so two healers never write the same file. State lives in `<agent>/arnative/model-heal.json` (`lib/model-heal.ts`, `extensions/model-heal.ts`).
248
- - **Auto-compact keeps long sessions light.** `/arnative` → **Auto-compact** picks **Smart** (a tier table by context window: ≥768k→20%, ≥384k→40%, ≥192k→80%, below 192k→pi core; every tier lands the trigger near the same ~200k-token transcript ceiling) or a **manual token budget** (`100k` to `400k`, one absolute number for any window). When a run settles with the context at or above the threshold, pi's own compaction fires through `ctx.compact()`, using the same machinery and summary as `/compact`, never mid-run. Small windows defer entirely: a 128k model keeps pi's near-full `reserveTokens` compaction untouched. The saved choice is marked with a green ✓ at the end of its picker row. Guards: no re-trigger while a compaction runs, a growth-margin wait (5% of the threshold) after an attempt that freed too little or failed (usage oscillating at the threshold cannot re-summarize every turn), and a full reset on session start (`extensions/autocompact.ts`).
249
- - **The push gate hook now ships with the repo.** `.githooks/pre-push` is the pre-push gate the README describes (it used to live only in a machine-local setup): it rejects a branch push whose tip tree does not match the `.git/arnative-preview` stamp that `npm run preview` writes, so a fix cannot reach GitHub without a live preview. Tags and branch deletions pass; activate per clone with `git config core.hooksPath .githooks`.
250
- - **Providers now write the limits and compat flags the endpoint implies.** The wizard already read the `/models` answer to list ids and threw the rest away; the same answer now also supplies each model's `contextWindow`/`maxTokens` (kept through later edits that never mention them) and a `compat` block the rules imply (developer-role off for reasoning models on a third-party OpenAI-compatible channel, session-affinity headers, Anthropic cache control on Claude-style relays, deepseek thinking format, adaptive thinking on Opus/Sonnet ≥ 4.6 and Fable ≥ 5), while any value already in `models.json` still wins (`lib/compat.ts`, `suggestCompat`; `lib/provider.ts`, `wireModels`).
251
- - **Thinking screen: `p` asks the channel which effort levels it accepts.** A 7-request probe per model sends `none`…`max`, records what answers, and stores the result as that model's `thinkingLevelMap`: a rejected level is remapped to the nearest accepted one, so `/think` offers only real levels instead of discovering them one 400 at a time. The result is the map itself, so it stays until the level is changed by hand; a channel that answers nothing writes nothing (`lib/compat.ts`, `probeEffort`/`buildEffortMap`; `lib/provider.ts`, `thinkingFlow`). The screen also gains two bulk keys: `[A]` sets every model to `auto` and `[R]` sets every model to `off`, in memory only, so Esc still discards and Enter saves.
252
-
253
- ### Changed
254
- - **Thinking now starts at `auto` for every model.** The provider wizard's id heuristic used to fall back to `off`, so a relay catalog with no effort suffix in its ids saved every model as chat and the Thinking screen showed almost nothing to do. The fallback is now `auto` (`reasoning: true`, no `thinkingLevelMap`), so `/think` passes the level straight to the endpoint for all of them; an explicit `-high`/`-xhigh`/`-max`/`-medium`/`-low`/`-minimal` suffix still pins that level, and Space in the Thinking screen still sets a model to `off` by hand (`lib/provider.ts`, `detectLevel`).
255
-
256
- ### Fixed
257
- - **The preview gate launches pi again on Windows.** `scripts/preview.mjs` spawned `pi` directly, which Node cannot do on Windows because the npm launcher is a sh script (ENOENT) or a `.cmd` (needs a shell), so `npm run preview` crashed before pi ever opened and no push could ever be stamped. It now resolves the real entry (`where pi` → the global npm dir → `dist/bundle/cli.js`) and runs it with Node directly, args unquoted and intact; POSIX behavior is unchanged (`pi` still spawns directly when that works).
258
- - **Large-session render cost: the per-frame patches are bounded now.** Both render patches scaled with the whole transcript on every frame, which made long sessions (a 1M-context model past ~20%) feel heavy in the terminal. The reload-box scan ran inside every `Container.render` (measured at 0.76 ms against pi's own 0.59 ms layout pass at 12.6k lines) and now refuses containers larger than 64 lines before scanning, because the reload box is a fixed ~9-line container (`extensions/ui-render-tweaks.ts`, `shouldHideReloadBox`). The user-bubble bg repair rebuilt every styled line on every frame and is now memoized per source line (pi's Markdown cache returns the same string references frame after frame), reset on a theme change and capped at 8192 entries (`extensions/timestamps.ts`, `repairBubbleBg`).
259
-
260
- ## [0.7.0] - 2026-10-24
261
-
262
- ### Added
263
- - **Providers: a custom endpoint from three inputs.** `/arnative` → **Providers** asks for the endpoint URL, API key, and name, then probes the endpoint once (Ollama `/api/tags`, Gemini `/v1beta/models`, OpenAI/Anthropic `/models` lists), lists the models it answered with, and saves on Space-picked selection: the key into `auth.json` (the file `/login` writes), the declaration into `models.json`. `[a]` switches the API flavor when a relay answers in an ambiguous shape; no answer falls back to manual ids. Opening `/model` picks up the saved provider (`extensions/provider.ts`).
264
- - **Provider actions: edit and delete on Enter.** Enter on a stored provider opens an action menu (Select models, Probe models, which re-reads the endpoint while vanished models stay listed, Thinking, Delete). Every action writes through to `models.json` immediately (delete also removes the `auth.json` key); sibling provider fields like `compat` survive every edit.
265
- - **Reasoning auto-detection.** Model ids decide the thinking flag on save: a `thinking`/`reasoner` token, an effort suffix (`-high`/`-medium`/`-low`), or an o1/o3/o4/r1-style generation marks reasoning models (`ag/claude-opus-4-6-thinking` and `ag/gemini-4-argon-high` on, `wally/glm-5.3-flash` off). The Thinking screen lists the flags with the detected values and Space overrides them.
266
- - **Thinking levels on pi's full scale.** The Thinking screen no longer toggles a boolean: Space cycles each model through `off → auto → minimal → low → medium → high → xhigh → max`, detected from the id (an explicit `-high`/`-xhigh`/`-max`… suffix pins that level; a `thinking`/`reasoner`/o1/r1 token means `auto`). Levels write pi's own wire shape (`reasoning: true` plus a `thinkingLevelMap` that pins exactly the supported level), so `/think` offers the model's real levels and clamps to them (`xhigh`/`max` only appear when mapped, exactly as pi's schema defines).
267
- - **Scrolling model lists.** The shared picker gains a 10-row viewport: long relay catalogs scroll a window centered on the cursor, with `↑ N more` / `↓ N more` rows announcing what is hidden, so the box keeps one height (`lib/list-picker.ts`).
268
- - **Picked count in the models legend.** The models picker footer reads `34/44 picked · [↑↓] Move …` with the count in the accent color, next to the keys it describes (`lib/box.ts` renders a pre-styled legend verbatim).
269
- - **Back where it belongs.** `←` works in submenus only: the provider list steps back to the `/arnative` menu, the provider actions step back to the list, and every settings screen keeps its `[←] Back` legend. The root menu hides the key entirely (`back: false`): it has nothing behind it, so Esc and `q` stay the only closes and its legend reads `[↑↓] Move [Enter] Open [Esc] Close`. Fill screens (model pick, thinking levels) hide it too, so a stray `←` cannot throw away a half-picked list.
270
- - **The provider list reflects its own edits.** After adding, editing or deleting a provider, the Providers screen re-reads `models.json` instead of showing the copy it opened with, so a new provider appears immediately with no `/arnative` round-trip.
271
- - **Wizard prompts in the arnative box.** Every text field the provider wizard asks for (endpoint, key, name, manual ids, headless fallbacks) renders as an arnative screen: rounded thinking-colored border, `Provider - Arnative⠙` title, the field as the description, a `> ` prompt with the pi-tui editor underneath (arrows, word motions, paste, undo all work), a dim example while empty, and the `[Enter] Save [Esc] Cancel` legend, replacing pi's full-width native input dialog (`lib/list-picker.ts`, `InputPicker`).
272
- - **Probe status above the chat input.** While the wizard probes an endpoint (add flow and the Probe models action), a one-line dim `probing endpoint…` appears directly above the chat input (pi's `setWidget` aboveEditor slot) and disappears the moment the probe settles, instead of occupying a status row in the bottom footer (`lib/provider.ts`, `probingStatus`).
273
- - **All pi-arnative files in one folder, cache 55% smaller.** Everything the package writes now lives under `~/.pi/agent/arnative/` (`config.json` for preset choices and `usage-cache.json` for the `/usage` scan cache) instead of three flat `arnative-*.json` files in `~/.pi/agent/`; existing files are migrated in automatically on first read. The cache gained a compact disk shape: keys are session-dir-relative paths, rollups store one row per provider+model (provider rows are derived on load), and one-letter field names (90 KB shrank to 40 KB on a real machine with identical answers). The legacy `arnative-prices.json` is deleted from the disk on first load (nothing has read it since pricing moved into `cost` fields in pi's `models.json`, which the provider wizard fills in), and a flat file a downgrade recreated beside the folder copy is removed the same way; `config.json` stamps a `layoutVersion` so the next layout change has one hook to migrate from. Preset choices and the cache are never deleted, only moved (`lib/preset-store.ts`, `lib/usage-store.ts`).
274
- - **Footer diff stat now tracks edits as they land.** The git refresh ran only at session and turn start, so a session that edits or commits inside a turn (the normal pattern when each step is committed) kept showing the pre-turn snapshot, often clean, and the `+X -Y` working-tree diff never appeared. The footer now re-reads git state whenever a tool call finishes (edit, write, or a commit through bash); concurrent refreshes still coalesce into at most two `git` runs per burst (`extensions/footer.ts`).
275
-
276
- ### Changed
277
- - **`/arnative` → Themes lists this package's themes only.** The picker shows the `arnative` family (`arnative` and its variants) and nothing else: pi's own `system`/`dark`/`light` and a theme of your own (e.g. `omarchy-system`) stay in `/settings` → Theme, which keeps the full list. Esc still reverts to whatever theme was active when the picker opened, arnative or not, and the empty-list message now points at a reinstall instead of the themes folder (`extensions/arnative.ts`).
278
-
279
- ### Fixed
280
- - **Esc cancels the add-provider flow at every prompt.** The flow asked for endpoint, API key and provider name, but only Esc at the first prompt aborted: Esc at the key prompt continued keyless (and could save a provider with a dummy key that never authenticates), Esc at the name prompt silently accepted the suggested name. Both prompts now honor the `[Esc] Cancel` their legend promises: Enter on an empty key field still means keyless, and an empty name still accepts the suggestion (`lib/provider.ts`).
281
- - **Provider config writes are atomic.** `writeJson` wrote `models.json` and `auth.json` with a direct `writeFileSync`, so a crash or power loss mid-write could truncate them: a truncated `auth.json` breaks the stored credentials of every provider, and the wizard then refuses to save until the file is repaired by hand. It now writes a temp file and renames it over the target, the same pattern `preset-store.ts` and `usage-store.ts` already use, and the self-check proves an interrupted save leaves the previous config intact (`lib/provider.ts`).
282
-
283
- ## [0.6.2] - 2026-10-20
284
-
285
- ### Fixed
286
- - **The usage cache no longer loses another session's rollup.** `saveDiskCache` wrote its whole in-memory map, so of two pi sessions sharing one agent dir the later writer dropped the entries the other had cached for its own files. It now re-reads the disk cache before the rename and keeps the keys this session does not have, only while their session file still exists, so a prune done by this scan stays pruned (`lib/usage-store.ts`).
287
-
288
- ### Added
289
- - **The footer cache cell falls back to pi's own usage.** `pi-cache-optimizer` only reports providers it has an adapter for; a provider it does not recognize (a custom one such as `hark.ts`) publishes no `pi-cache-stats` status and the cell stayed empty. It now shows `pi X%`, computed as `cacheRead / (input + cacheRead)` from the usage pi already records on the branch; the optimizer's own string still wins when present (`extensions/footer.ts`).
290
-
291
- ## [0.6.1] - 2026-10-19
292
-
293
- ### Fixed
294
- - **A preset choice survives a second pi session.** `saveChoice` merged into a memo read once per process and wrote the whole file back, so a session that had already loaded the file dropped the keys another session had written: two concurrent saves left only the last one. Every save now re-reads the file, merges its one key, and replaces the file atomically (temp file + `rename`). The self-check writes the file behind the module and asserts the other key survives (`lib/preset-store.ts`).
295
- - **The usage cache is replaced atomically.** `saveDiskCache` wrote in place, so a second pi session could read a truncated JSON, discard the cache and rescan every session file. It now writes a temp file and renames it, and `Object.fromEntries` replaces the manual copy loop (`lib/usage-store.ts`).
296
-
297
- ### Changed
298
- - **`ROW_DIVIDER` has one definition.** The divider between a picker row label and its note was declared twice, once in the picker and once in the animations module. It now lives in `lib/format.ts` beside `markedLabels`, and both modules import it (`lib/format.ts`, `extensions/arnative.ts`, `extensions/animations.ts`).
299
-
300
- ## [0.6.0] - 2026-10-17
301
-
302
- ### Fixed
303
- - **A model id no longer reports another route's tokens.** The match rule also accepted a stored name the target merely *ends* with (`target.endsWith("/" + name)`), so a first run under `river/deepseek-ai/DeepSeek-V4.1-Flash` showed wally+yarz's `deepseek-v4.1-flash` history (29.5M in / 3.2M out / 360.5M cache reads) as its own. Matching is now exact after `canonicalModel` (trimmed, case-folded, `:route` tag dropped), so the header's Model tab and `/usage` state the tokens of the id they name. Measured on the operator's own history: River reports 148.5k in / 26.5k out / 1.6M cache reads, and the old totals stay reachable under `deepseek-v4.1-flash` (`lib/usage-store.ts`).
304
- - Self-check pinning per-id totals: a bare id does not absorb a longer id that ends with it, a path id counts its own provider only, case does not split one model's history, and a `:free` tag still folds into the model it tags. Proved negative: restoring the suffix rule fails `npm test` (`extensions/usage.ts`).
305
- - **The `[g]` sweep no longer strobes.** One cycle now takes 20s (`GRADIENT_CYCLE_MS`) instead of 4s. The frame interval is fixed per preset, so a fast cycle forces a huge colour jump between frames: measured worst-case step was 64.9 RGB units at 200ms and 26.2 at 80ms, which the eye reads as flashing rather than a sweep. 20s brings that to 13.2 and 5.7; the self-check pins those ceilings so a later speed-up cannot silently reintroduce the strobe (`lib/spinner.ts`).
306
-
307
- ### Added
308
- - **The Animations picker previews the live frame, and lists presets in a stable order.** The selected row's note now ends in the preset's *current* frame: the picker repaints every 80ms and reads the frame from the clock (`previewFrameAt`), so a dropped repaint costs one frame and can never desynchronise the animation. The glyph is padded to the widest frame of that preset, so the row does not shift as it moves. Rows are `Pi (system)`, `Arnative`, then the rest alphabetically: the escape hatch and the package's own spinner are the two a user reaches for and must not move when a preset is added. The self-check pins the order, name uniqueness, and the clock arithmetic; the picker was rendered at 80/100/120 columns with 0 width mismatches (`lib/spinner.ts`, `extensions/animations.ts`, `extensions/arnative.ts`).
309
- - **`Dot Spine` preset.** A dot body growing outward from a two-cell core (`⠂⠐` → `⠺ ⠂⠐ ⠗` → `⠺ ⠪ ⠂⠐ ⠕ ⠗` at 200ms, one cell added at each end per frame). All three frames are 10 columns so the label never shifts, and the self-check pins the frames plus two properties the animation depends on: the core `⠂⠐` stays in columns 4 to 5 in every frame, and the dot count grows `2,4,6`. Named off the `Braille *` prefix so it does not read as a third variant of `Braille Column`/`Braille Level`; the note still says braille, which is what the glyphs are (`lib/spinner.ts`).
310
- - **`Bagua Trigram` preset.** Three I Ching trigrams (`☶` U+2636, mountain → `☵` U+2635, water → `☳` U+2633, thunder) at 200ms. Like `Yin Yang Lines`, none of the three exists in the terminal face (JetBrainsMono Nerd Font) but all three are served by the same fallback face at the same 1.50 cells, so the row keeps its place. Three of the eight trigrams are used, not all eight: a spinner is a short loop. Frames are pinned by codepoint in the operator's order, and the self-check asserts all three are distinct (`lib/spinner.ts`).
311
- - **`Yin Yang Lines` preset.** The four I Ching digrams (`⚌` U+268C, both lines whole → `⚎` U+268E, lower line broken → `⚍` U+268D, break moves up → `⚏` U+268F, both broken) at 200ms, so a single broken yin line travels through the pair. All four glyphs are absent from the terminal face (JetBrainsMono Nerd Font) but every one is served by the same fallback face at the same 1.50 cells, which is the property that matters: a constant width means no sideways shift, unlike a set that mixes native and fallback glyphs. Frames are pinned by codepoint in the operator's order, and the self-check asserts all four are distinct (`lib/spinner.ts`).
312
- - **`Pacman` preset.** Pacman eating his way across the row, one cell per frame (`ᗧ + − ×` → `~ ᗧ − ×` → `~ ~ ᗧ ×` → `~ ~ ~ ᗧ` at 200ms), with the eaten pellets left as a ghost trail. `ᗧ` is U+15E7 (Canadian Syllabics `ye`), the glyph the pacman CLI spinners use because it reads as an open mouth facing right. The self-check pins the exact frames and asserts the mouth sits in column `2 × frameIndex`, which is the animation's whole point (`lib/spinner.ts`).
313
- - **The package now has its own spinner and ships it as the default: `Arnative`.** A spark (`✧` / `✦`) and a Braille cell trading places around the centre (`✧⠙` → `✧⣠` → `⣄✧` → `⠋✦` at 200ms), painted with the theme accent (or the brand sweep under `[g]`). `DEFAULT_SPINNER_PRESET` moved from `Diamond Glow` to `Arnative`, so a fresh install shows it without opening a menu; an existing install keeps whatever it already stored. Two frames carry a trailing space; it is load-bearing, because both cells are one column wide and dropping it would shift the label sideways on every second frame. The self-check pins the exact frames by codepoint, asserts every frame of a multi-glyph preset has one length, and pins the default (`lib/spinner.ts`).
314
- - **The `arnative` theme is applied on a fresh install.** `session_start` checks pi's own theme setting and calls `ctx.ui.setTheme("arnative")` only when no setting exists and the theme actually loaded. A theme you chose is never overridden, and because `setTheme` writes the setting, the check is a no-op on every later session (`extensions/arnative.ts`).
315
- - **`Arrow Orbit` preset.** A four-arrow ring turning clockwise one position per frame (`▴▸▾◂` → `▸▾◂▴` → `▾◂▴▸` → `◂▴▸▾` at 200ms), one full turn per 0.8s, the same rate as `Diamond Glow`. Frames are pinned by codepoint in the self-check (U+25B4, U+25B8, U+25BE, U+25C2) so a font fallback cannot swap a glyph unnoticed (`lib/spinner.ts`).
316
- - **`[g]` in `/arnative` → Animations paints accent presets with the Google brand sweep.** The switch sits on the Animations screen only, states its current mode in the legend (`[g] Gradient on`), saves as `spinnerGradient` in `arnative-config.json`, and repaints the live spinner the moment it is pressed. Esc and `←` undo it together with a previewed preset, so leaving the screen restores what it opened with. `Gemini` already sweeps and `Claudeon` carries its own mark colour, so the override leaves both untouched (`lib/spinner.ts`, `extensions/animations.ts`, `extensions/arnative.ts`).
317
-
318
- ### Changed
319
- - **`UsageModalComponent.hintText` is gone: the render path calls `legendUsage(width)` directly.** A private one-line method that returned another function added a name with no behaviour, so the call site now states what it wants (`extensions/usage.ts`).
320
- - **`Claudeon`: the `Claude` preset, renamed and restyled (inspired by Claude).** The preset was called `Claude` and reused Claude Code's own dingbats; it is now `Claudeon`, a mark of this package's own that reads as the Claude-style pulse without borrowing Claude's name for a glyph set Claude does not use. The attribution lives in the row's note (`inspired by Claude — pulsing marks, 120ms`) rather than only in the code, and the paint mode and colour constant follow (`claude` → `claudeon`, `CLAUDE_RGB` → `CLAUDEON_RGB`); the grey-orange mark colour is kept, because that colour is what makes the pulse read as the Claude-style spinner. The preset had not shipped yet, so no stored config can reference the old name (`lib/spinner.ts`, `extensions/animations.ts`).
321
- - **`Claudeon`'s frames are native-only, so the row cannot walk sideways.** The old set (`· ✢ U+2733 * ✶ ✻ ✽`) mixed font-fallback widths: `✢` `✻` `✽` are absent from most monospace faces, so the terminal served them from a fallback font; measured in the terminal face (JetBrainsMono Nerd Font), `✢`/`✤`/`✻`/`✽`/`❋` advance **1.48** cells and `U+2733` **2.29**, against a **1.00** native cell, so the label shifted on every tick that used one and `U+2733` sheared the row. The set is now `· * ⋆ ✶` (U+00B7, U+002A, U+22C6, U+2736), four marks that every monospace face checked (JetBrainsMono Nerd Font, Consolas, Cascadia, Lucida, Courier) reports at exactly 1.00, giving an 8-frame there-and-back loop (`· * ⋆ ✶ ✶ ⋆ * ·`, the peak held for two frames as elsewhere in the package) at 120ms, so the displacement is 0.00 cells. There is no fifth mark to add: a scan of all 86 installed families found none covering the Dingbats block at ~1 em (`lib/spinner.ts`).
322
-
323
- ## [0.5.3] - 2026-10-14
324
-
325
- ### Fixed
326
- - A new session showed the previous session's token counts. The footer's 2s `getUsage` cache is keyed on branch length, and the module is not re-imported by `/new`, so a fresh session whose branch happened to reach the same length read the cached sums instead of its own. The cache is now cleared in the non-reload `session_start` branch (`extensions/footer.ts`).
327
- - **The cell was invisible: the footer still matched the value on `jev-eye`.** The value became `Eye: ● ON (Clef Flash)`, which contains no `jev-eye` anywhere, so `value.includes("jev-eye")` went false and the whole cell fell through to the generic path (no icon, no dim backend suffix, just grey text). The router now recognises the cell by the label its value carries (`isJevEyeStatus`, `^\s*Eye\s*:`), and the self-check pins that rule from both sides: every mode's real value is recognised, `Jev: ● ON` and `MCP: 2 servers enabled` are not, and the value is asserted to contain no internal key name. Proved negative: reverting the rule to the substring test makes both `node extensions/footer.ts` and pi-jev-eye's `render-check` fail.
328
- - **One space after the glyph, not two.** The two spaces existed because the previous glyph's ink overran its cell (`\uedcf`); with `\uf21b` in place they read as a gap in ` Eye: ● ON (Clef Flash)`. Pinned in pi-jev-eye's render check as one space, with an explicit assert that the glyph is not followed by two.
329
-
330
- ### Changed
331
- - **The cell glyph is U+F21B (`fa-user_secret`), chosen by the operator.** U+EDCF (`fa-user_shield`) was the previous one; both exist in JetBrainsMono Nerd Font, and the codepoint is pinned by number in pi-jev-eye's render check because a Nerd glyph that renders blank on another platform is the bug the ponytail cell had (`\uef51` -> `\uef04`).
332
- - **The pi-jev-eye status cell renders `Eye: ● ON (Backend)`, parsed from the value instead of hardcoded.** The format is `Eye: ● ON (Clef Flash)` when a Clef model answers and `Eye: ● ON (Jev)` when TypeSafe or OpenRouter does. `jevEyeStatusLine()` reads the label before the first colon and the backend from the trailing parentheses, so nothing about the cell is a literal in this repo, and an older pi-jev-eye value with no suffix gains no guessed one.
333
- - **The backend suffix takes `dim`, while `Eye:` and the state keep their tiers.** A backend painted like the label would bury `Eye: ● ON`, which is the case this cell exists for; the spaced `Clef Flash` (not a nested `clef (flash)`) reads as one label on a single line.
334
- - **The status line moved out of the render closure**, next to `ponytailStatusLine`, so the self-check in `node extensions/footer.ts` drives the exact path the footer uses instead of a copy of it.
335
- - Dropped two unused imports (`CustomMessageComponent`, `isPointerOrFocusInput`) and corrected three stale statements: the usage estimate comment named `prices.json` where the code reads `models.json`, the footer header listed two of the three footer presets, and the README's local-test snippet ran one extension where `npm run dev` runs all eight (`extensions/ui-render-tweaks.ts`, `lib/usage-store.ts`, `extensions/footer.ts`, `test/footer-minimal.test.ts`, `README.md`).
336
-
337
- ### Added
338
- - Self-check for the pi-jev-eye cell: both requested forms (`Eye: ● ON (Clef Flash)`, `Eye: ● ON (Jev)`), the tierless `(Clef)`, an upstream `(Clef Omni)`, `OFF` taking the dim bullet, `REVIEW` keeping its warning bullet, and a suffix-less value drawing no parenthesis.
339
-
340
- ## [0.5.2] - 2026-10-13
341
-
342
- ### Fixed
343
- - Restored the footer's two-tone labels. `0.5.1` moved the label colour onto `softOf(accent)`, which softens the *accent* hue, so cwd/branch/clock/status text inherited the accent (pink) instead of the border-accent (blue) tier and the footer collapsed into a single hue (`extensions/footer.ts`).
344
- - Added `vars.secondarySoft` to all 11 themes, softened from the same value the `borderAccent` token resolves to (L 0.82, chroma × 0.18, hue kept), and `softSecondaryOf` in `lib/ansi.ts` to derive the identical value at runtime: `vars` names are not addressable via `fg()`, and Pi 1.2 rejects custom `colors` keys, so the declared and derived values must be produced by one recipe.
345
- - Routed the header's model/thinking/token text, tool bodies, list rows and the usage dashboard onto the label tier. Icons, marks and the logo's second tone stay on the accent tier, so each line keeps its two tones (`extensions/section-headers.ts`, `extensions/tools.ts`, `extensions/usage.ts`, `extensions/arnative.ts`, `extensions/ui-render-tweaks.ts`).
346
-
347
- ### Added
348
- - `soften()` is now shared by the generator and the runtime, and `extensions/ui-render-tweaks.ts` asserts every declared `*Soft` var equals its derived value, so a drifting or rogue soft colour fails `npm test` instead of shipping (`themes/gen-themes.mjs`, `lib/ansi.ts`).
349
- - Behavioral test pinning the two-tone rule: labels take the border-accent hue, icons keep the accent hue (`test/footer-minimal.test.ts`).
350
-
351
- ### Notes
352
- - Label colour is deliberately softer than the pre-0.5.1 `#05dee7`. `SOFT_CHROMA_SCALE` in `lib/ansi.ts` is the single knob: `0.18` gives `#b2c9ca` on cyberpunk, `0.30` gives `#b2dadc`, `0.50` gives `#9adfe3`. Changing it regenerates all 11 themes and the guard forces them to stay in sync.
353
-
354
- ## [0.5.1] - 2026-10-13
355
-
356
- ### Fixed
357
- - Restored all 11 arnative themes on Pi 1.2.0, which validates the `colors` object with `additionalProperties: false` and rejected the whole theme ("must not have additional properties" followed by "Theme not found", `lib/ansi.ts`, `themes/gen-themes.mjs`, `themes/*.json`, `extensions/ui-render-tweaks.ts`). Arnative's own colors (`accentSoft`, `primary`, `secondary`, `primarySoft`, `secondarySoft`) moved from `colors` to `vars`.
358
- - Kept the two-tone soft tier instead of collapsing it to grey: `softOf` replaces `accentSoftOf` and derives the soft accent from the resolved `accent` color when `fg("accentSoft")` throws, so the header logo, tab labels, model line, footer labels, tool titles and the usage dashboard keep their tint (`lib/ansi.ts`).
359
- - Updated `$schema` in every theme and the generator from the raw GitHub `theme-schema.json` path to the published `https://pi.dev/schemas/theme.schema.json` (`themes/gen-themes.mjs`, `themes/*.json`).
360
- - Replaced the footer's raw `fg("accentSoft")` probe with the shared painter and mapped `primary`/`secondary` onto the official tokens they carry (`mdHeading`, `borderAccent`), since Pi 1.2 rejects custom `colors` keys (`extensions/footer.ts`).
361
- - Mapped the usage dashboard's name/value/arrow colors off `accentSoft` onto the shared soft painter and plain `dim`/`text`, keeping provider rows distinguishable (`extensions/usage.ts`).
362
- - Added a self-check that fails when a theme puts a non-schema key in `colors`, so a rogue token breaks `npm test` instead of the user's startup (`extensions/ui-render-tweaks.ts`).
363
-
364
- ### Notes
365
- - `0.5.0` is intentionally skipped on the npm registry. It was tagged and merged, but never published, and its themes are the ones Pi 1.2.0 rejects. `0.5.1` carries everything from v0.5.0 plus this fix. The tag stays in the history; install from npm and you get `0.5.1`.
366
-
367
- ## [0.5.0] - 2026-10-13
368
-
369
- ### Added
370
- - Extended theme token hierarchy in `vars` with `primary`, `primarySoft`, `secondary`, and `secondarySoft` across all 11 themes (`themes/gen-themes.mjs`), ensuring unique hex mappings and full perceptual OKLCH color space discipline.
371
- - Tri-color multi-palette overhauls for expressive themes (`arnative-cyberpunk`, `arnative-synthwave`, `arnative-dracula`, `arnative-gruvbox`, and `arnative-nord`), mapping `mdHeading` to `primary` and `borderAccent`/`mdCode` to `secondary`.
372
- - Footer multi-color pairing (`extensions/footer.ts`): paired saturated `accent` icons with readable `secondarySoft` labels and highlighted the model name with `primary`.
373
-
374
- ### Changed
375
- - Increased message bubble background lightness (`surfaceMsg` / `userMessageBg`) on `arnative-cyberpunk`, `arnative-matrix`, and `arnative-synthwave` to 24% (`oklch(24% 0.035 ...)`) to ensure container boundaries remain clearly defined against pitch-black terminal canvases.
376
-
377
- ### Fixed
378
- - Fixed parenthetical suffix per-row dimming in `/arnative` → **Animations** so `(system)` on `Pi (system)` renders softly in `dim` even when descriptive frame notes are present (`extensions/arnative.ts`).
379
- - Fixed inline image preview layout spacing by dropping the redundant spacer gap between the tool execution box and the image payload (`extensions/tools.ts`).
380
-
381
- ## [0.4.0] - 2026-10-12
382
-
383
- ### Added
384
- - `/arnative` → **Animations** picker and working-spinner presets (`lib/spinner.ts`, `extensions/animations.ts`): Diamond Glow (default), Diamond Pulse, Circle Pulse, Circle Wave, Shade Wave, Braille Column, Braille Level, Kanji Count, Suzhou Tally, Pi (system), Gemini (Google brand gradient), and Claude (pulsing mark loop).
385
- - Automatic token cost estimation for unpriced models via pi's `models.json` declared rates (`lib/usage-store.ts`, `extensions/usage.ts`).
386
- - Usage dashboard integration into `/arnative` → **Usage** alongside standalone `/usage` command (`extensions/arnative.ts`, `extensions/usage.ts`).
387
-
388
- ### Changed
389
- - Active session clock tracks duration while active and freezes after inactivity (`IDLE_PAUSE_MS`), ignoring non-keystroke inputs (`extensions/footer.ts`, `test/footer-minimal.test.ts`).
390
- - Working spinner frames clear `renderIndicatorVerbatim` to apply theme `accent` color while preserving `accentSoft` for labels (`extensions/footer.ts`, `extensions/animations.ts`).
391
- - Unified screen chrome and title format via `renderScreen` and `screenTitle` in `lib/box.ts`, with adaptive thinking-level border colors across all `/arnative` screens (`lib/box.ts`, `lib/ansi.ts`, `extensions/arnative.ts`, `extensions/usage.ts`).
392
- - Back key `←` (`matchesBack`) standard across `/arnative` submenus and usage dashboard, stepping back without losing selection context (`lib/shortcuts.ts`, `extensions/arnative.ts`, `extensions/usage.ts`).
393
- - Compact usage dashboard layout: removed `↑In`/`↓Out`/`Cache` columns from main table (moved to selected row detail line) and added mouse click toggle for provider rows (`extensions/usage.ts`).
394
- - Aligned list picker layout to standard `Label · note` format, removing redundant `●` indicator column (`extensions/arnative.ts`).
395
- - Header brand updated to `Arnative⠙ vX.Y.Z` using shared `BRAND` constant (`extensions/section-headers.ts`).
396
-
397
- ### Fixed
398
- - Fixed spinner preset selection in `/arnative` → **Animations** by sharing active UI and theme references across extension module instances via `globalThis` (`extensions/animations.ts`).
399
- - Fixed missing `animations.ts` in `scripts/preview.mjs` extension launch list (`scripts/preview.mjs`).
400
- - Fixed box row truncation in `boxRow` to prevent right wall clipping on lines narrower than content (`lib/box.ts`).
401
- - Fixed `boxRow` zero-column overflow when width is below 4 columns (`lib/box.ts`).
402
- - Avoided repeated synchronous disk reads during usage summary collection by passing memoized price table (`lib/usage-store.ts`).
403
- - Cleaned up active clock state initialization on fresh sessions (`extensions/footer.ts`).
404
- - Bounded tool duration cache (`TIMINGS`) to 200 entries with FIFO eviction and cleared on session boundaries to prevent memory growth (`extensions/tools.ts`).
405
- - Added short-circuit in `repairBubbleBg` to avoid string split/join allocations on lines without ANSI reset sequences (`extensions/timestamps.ts`).
406
- - Added fast substring check in `shouldHideReloadBox` to bypass `stripAnsi` and array mapping across general containers (`extensions/ui-render-tweaks.ts`).
407
-
408
- ## [0.3.10] - 2026-10-11
409
-
410
- ### Fixed
411
- - The ponytail icon rendered as a blank cell on Windows. The status drew `U+EF51` (`fa-circle_radiation`), a codepoint the Windows JetBrainsMono Nerd Font build lists in its cmap but rasterizes with no outline, so the footer left an empty gap before `ponytail:`. It now draws `U+EF04` (`fa-horse`), which renders on both platforms. The cell also spends one space after the icon instead of two, matching `MCP:`. A self-check pins the codepoint, so an edit back to an invisible glyph fails `npm test` instead of shipping silently (`extensions/footer.ts`).
412
-
413
- ## [0.3.9] - 2026-10-08
414
-
415
- ### Fixed
416
- - The README told you to press `ctrl+e` to expand a tool box. The key actually follows pi's `app.tools.expand` binding, whose default is `ctrl+o` (`lib/format.ts`, `extensions/tools.ts`). Docs only: no behaviour changed in this release.
417
-
418
- ### Changed
419
- - The README now states the footer facts it never listed: all three presets (`Arnative (Full)`, `Pi (system)`, `Arnative (Minimal)`), the Minimal preset's click behaviour and `ctrl+alt+m`, the session clock surviving `/resume`, and the working-tree diff beside it (`README.md`).
420
-
421
- ## [0.3.8] - 2026-10-08
422
-
423
- ### Added
424
- - New footer preset **Arnative (Minimal)**, selectable in `/arnative` → Footers. It shows a single head row (cwd, clock, diff, git, model) with a dim `▲` at the end of each side. Each head's own text is the click target (anywhere on the cwd/git string toggles the left side for extension statuses, and anywhere on the model string toggles the right side for speed/cache/token), while the blank gap between them is inert, so a stray click on empty space cannot expand anything. Opened sides show `▼` and their rows; the two sides open independently. Ctrl+alt+M (alt+M on Windows/WSL) toggles both, so it also works in `tuiMode: "regular"` where the terminal owns the mouse. Zone columns are measured from the row this module places itself rather than mirrored from `pairRow`, because the ellipsis on a truncated head shifts every column after it (`extensions/footer.ts`, `lib/shortcuts.ts`).
425
- - The footer shows the working tree's diff next to the session clock only while there is one: `\uf4d2 +500 -100`, with the same green/red the diff body uses (`toolDiffAdded`/`toolDiffRemoved`). It comes from `git diff HEAD --numstat` in the existing `refreshGit` pass (one extra spawn, nothing new on the per-frame path) and is hidden when the tree is clean or git cannot answer (not a repo, no binary), with no fake `+0 -0` and no dangling icon. A repo with an unborn `HEAD` (no commit yet) falls back to diffing against the empty tree, so a staged first commit still counts. Note the count is the whole uncommitted change, not just this session's edits: it includes anything done before or outside the session. Untracked files are not part of a diff and stay counted by the `~N` worktree segment (`extensions/footer.ts`).
426
-
427
- ### Fixed
428
- - The footer's session clock no longer restarts when you switch sessions with `/resume`. The reset came from `session_start`, which set the start to `Date.now()` for every reason but `"reload"`. It now reads the session header's `timestamp` (the moment the session was created) for `"resume"`/`"startup"`, so the duration reflects the session's real age; `"new"`/`"fork"` write a fresh header and still start at zero. A missing or unparsable header falls back to now (`extensions/footer.ts`).
429
- - Every third-party tool that ships its own `renderCall`/`renderResult` now renders in the arnative box, not just the ones on a hardcoded name list. The predicate was an allowlist (`ls`, `powershell`, `ffgrep`, `fffind`, `find`, `grep`, `BOXED_TOOLS`, MCP), so any other extension's tool (present or future) fell through to pi's `contentBox`: a padded background block with no border. It is now shape-based: boxed unless the tool declares `renderShell: "self"` (arnative's own boxes) or is in `NOT_BOXED` (`extensions/tools.ts`).
430
- - The inter-box gap is now stripped for the generic box path too. The gap-strip patch keyed on a name list (`OWN_BOX`), so a tool boxed by the widened predicate but not registered through `minimal()`/`BOXED_TOOLS` kept the leading `Spacer` and floated a blank row above its box (`extensions/tools.ts`).
431
-
432
- ## [0.3.7] - 2026-10-05
433
-
434
- ### Fixed
435
- - The `powershell` and `ls` tools now render in the arnative box like every other call. pi draws a tool that ships its own `renderCall`/`renderResult` but sets no `renderShell` through its own `contentBox` (a background block with no border). Both tools match that shape (their definitions spread the renderer functions onto the tool object), so they now go through `minimal()` like `bash`/`grep`/`read`. `powershell` is Windows-only: `getPowerShellConfig()` throws elsewhere, and re-registering it would activate a tool the builtin deliberately leaves off (`extensions/tools.ts`).
436
- - pi-fff's default-mode tools `ffgrep` and `fffind` are boxed too. The box path only recognized the override names `find`/`grep`, which pi-fff uses when it replaces pi's builtins, so a session running it in default mode showed those calls as bare blocks (`extensions/tools.ts`).
437
- - pi's `[Extension issues]` diagnostic now draws in the arnative box, stripped to two content rows: the title (warning glyph + section name, brackets dropped, `[ctrl+o to expand]` hint) over the extension's source path. pi's extra diagnostic lines are dropped, as the expand hint stands in for them (`extensions/section-headers.ts`).
438
- - The package-update box title lost the double space after its glyph (`extensions/ui-render-tweaks.ts`).
439
-
440
- ### Changed
441
- - The `section-headers.ts` self-check moved out of the extension into `test/section-headers.test.ts` and runs under `node --test`, so `npm test` lists it as a test instead of a script that prints `OK`. This is a pilot for the other modules; the remaining in-file self-checks follow the same layout once proven (`extensions/section-headers.ts`, `test/section-headers.test.ts`, `package.json`).
442
-
443
- ## [0.3.6] - 2026-10-05
444
-
445
- ### Fixed
446
- - Fixed a startup crash: `Cannot read properties of null (reading 'fg')`. pi's `[Extension issues]` diagnostic box passed a null theme into the box renderer, which dereferenced it and killed the process with `uncaughtException`. It only surfaced on machines where an extension reported a problem (a conflicting shortcut, a failed `session_start`, …), because that is when the diagnostic is drawn. The renderer now draws an uncolored box for the first frame instead of throwing (`lib/box.ts`).
447
- - The active theme now lives in a single `globalThis` slot. `/reload` re-imports extension modules, so two copies can coexist, and only one of them receives `session_start`. The copy that owns the `loadedResourcesContainer` patch used to keep a permanently-null theme; it now paints with the live theme (`lib/ansi.ts`, `extensions/section-headers.ts`, `extensions/ui-render-tweaks.ts`).
448
- - Removed the `activeThemeProxy ?? Theme` fallback in the package-update box: `Theme` is a class, not an instance, so the fallback would itself have thrown `th.fg is not a function`. The box component now tolerates a null theme (`extensions/ui-render-tweaks.ts`).
449
-
450
- ## [0.3.5] - 2026-10-04
451
-
452
- ### Fixed
453
- - Git info in the footer now works on a fresh machine: the branch is read straight from `.git/HEAD` (the trick pi's own footer uses), so it shows without a `git` install and on a repo git refuses to touch (its dubious-ownership guard). Tag, dirty count and ahead/behind still need the `git` binary; when it cannot answer, those parts are left out instead of a fabricated `-`/`clean` (`extensions/footer.ts`).
454
- - `run()` no longer swallows a failed `git` call into `""`. "git said nothing" and "git could not run" used to be indistinguishable, which is what made four different states (not a repo, no `git` on PATH, a detached HEAD, and a foreign-owned repo) all show as no git info at all.
455
- - The header's `Context`/`Skills`/`Extensions` counts show `—` instead of a misleading `0` under `"quietStartup": true` (or `"header"`), which hides the resource listing the counts are read from. The empty-tab placeholder now says the counts are not tracked, and the state resets on `session_start` so `/new` cannot show stale counts (`extensions/section-headers.ts`).
456
- - The header and footer preset chosen in `/arnative` now survives a restart. The choice was only kept on `globalThis`, so every new pi process fell back to the default Arnative (Full) header and footer. It is now written to `arnative-config.json` in the agent dir and read back at startup (`lib/preset-store.ts`, `extensions/section-headers.ts`, `extensions/footer.ts`).
457
- - The reload-box patch no longer blanks a whole chat: it only drops a container that holds nothing but the box itself (border rows, blank spacers and the message copy). Any other container whose content merely mentioned "Reloading keybindings" (`read`/`grep` results or this repo's own source) was rendered as zero lines (`extensions/ui-render-tweaks.ts`).
458
- - Row-1 git info works from a subfolder of a repo: `.git` is looked up by walking up the directory tree like git itself does, so the branch no longer vanishes when the session runs in `extensions/` or `src/` (`extensions/footer.ts`).
459
- - A tool result whose text merely starts with `Error` is no longer painted as a failed call (red `x`); only `ctx.isError`/`result.isError` decide. Reading a file that opens with "Error handling…" used to show an error box (`extensions/tools.ts`).
460
- - The stale git state is cleared when the working directory leaves a repo, so a `/reload` cannot re-show the previous directory's branch (`extensions/footer.ts`).
461
- - The `usage.ts` self-check builds a fixture session directory (and its own cache) instead of reading the real `~/.pi/agent/sessions`. A machine without `gemini-3.8-flash` in its history failed `npm test` (`extensions/usage.ts`, `lib/usage-store.ts`).
462
- - `isMain()` compares canonical file URLs, so a checkout path containing a space or another character that `import.meta.url` percent-encodes no longer makes a self-check exit 0 without running (`lib/check.ts`).
463
-
464
- ### Changed
465
- - An active session that grows is no longer walked in full on every usage refresh. The cache keeps a per-file rollup (providers and provider+model totals) plus the byte offset of the last complete line, so a refresh reads only the appended tail and folds it in. On a 2.3MB / 11,000-message session, a refresh after one new record went from ~76ms (full re-parse **and** re-aggregation of every cached entry) to ~12ms, flat as the chat grows; the cache file went from megabytes to ~0.4KB. A half-written trailing record is retried instead of counted or dropped (`lib/usage-store.ts`).
466
- - The usage cache format is version 4 (per-file rollup, was raw entries in v3); an older cache is rebuilt once.
467
- - `npm test` also runs `lib/color.ts`; `prepublishOnly` runs the full test suite before the pre-publish preflight, so a publish cannot ship a red build (`package.json`).
468
- - `release-check.mjs` verifies the tag points at `HEAD`, and `post-publish` also checks the `latest` dist-tag and the tarball URL are live, not just that the version exists (`scripts/release-check.mjs`).
469
- - The open-PR check falls back to the public GitHub API when `gh` is unavailable, instead of failing the whole preflight (`scripts/release-check.mjs`).
470
- - `.gitattributes` pins every text file to LF in the repository, so a Windows checkout stops reintroducing CRLF into diffs.
471
-
472
- ### Removed
473
- - `ASCII_LOGO_LINES` (computed at module load, never read) and the unused `Dim` export (`extensions/section-headers.ts`, `lib/box.ts`).
474
-
475
- ## [0.3.4] - 2026-10-04
476
-
477
- ### Added
478
- - `scripts/release-check.mjs`, a read-only release preflight with one stage per step of the release (`pre-tag`, `pre-publish`, `post-publish`): it verifies a clean tree on `main` in sync with `origin/main`, no open pull requests, the `CHANGELOG.md` entry, whether the tag exists **and is pushed**, and whether the registry already serves the version. It never writes, tags, pushes or publishes.
479
- - `npm run release:check` (the `pre-tag` stage) and a `prepublishOnly` hook wired to the `pre-publish` stage. A missing or unpushed tag now aborts `npm publish` with `npm error code 1`, so a forgotten `git tag` can no longer ship a release.
480
-
481
- ### Changed
482
- - README documents the release stages and their exit codes (`0` pass, `1` check failed, `2` bad usage).
483
-
484
- ## [0.3.3] - 2026-10-04
485
-
486
- ### Changed
487
- - `codemode` now renders in the arnative box like every other tool call: side borders, green background (`toolSuccessBg`), and the script's first line prefixed with the `󱞩` summary glyph. While the tool runs the box shows the shared spinner; the `\uf489` glyph appears with the result (`extensions/tools.ts`).
488
- - Collapsed `codemode` is now two rows, the same footprint as `bash`/`grep`/`read`: title + the script's first line. Nested calls and output wait behind the standard `[ctrl+o to expand]` hint. A failing run still shows its output.
489
- - pi's `Script completed / Wall time / Output:` header no longer shows in the box.
490
- - Shared duration wording (`2ms` under a second, `1.4s` above) and one error glyph (`x`) across every tool; a failing `codemode` run shows its whole output and never a `[ctrl+o to expand]` hint.
491
- - The file tools (`bash`, `read`, `write`, `grep`, `find`, `edit`) now show `[ctrl+o to expand]` when their collapsed summary hides more than it shows, so a two-line `extra +1 / -1` box no longer looks complete while its diff sits behind it. Expanded and genuinely single-line results get no hint (`extensions/tools.ts`).
492
- - The `chrome_devtools_*` tools (from `@narumitw/pi-chrome-devtools`) now render in the same box instead of their bare "Chrome DevTools: …" lines. Their own `renderCall`/`renderResult` are bypassed: the call box uses the Chrome glyph and the result box the usual summary + `[ctrl+o to expand]` (`extensions/tools.ts`).
493
-
494
- ## [0.3.2] - 2026-10-04
495
-
496
- ### Changed
497
- - Source cleanup only: the generator's 11 `accent` seeds, the color self-check and one test fixture no longer hold raw hex. Each seed is now the OKLCH value of the same colour (`#00d7ff` → `oklch(81.1% 0.1455 217.709375)`), produced by `hexToOklch`, so the theme output is **byte-identical**; `themes/*.json` are untouched. `lib/color.ts` also keeps its hex, deliberately: those literals are the test vectors for the hex parser, not styling (`themes/gen-themes.mjs`, `lib/color.ts`, `extensions/ui-render-tweaks.ts`).
498
- - `themes/gen-themes.mjs` dropped its private `parseOklch` (percent-only regex) for the shared one in `lib/color.ts`, which also accepts a fractional `L`, so a seed can no longer parse as `NaN`.
499
- - No user-visible change; this release exists to bring the npm tarball in line with `main` after #8.
500
-
501
- ## [0.3.1] - 2026-10-04
502
-
503
- ### Changed
504
- - `/arnative headers` and `/arnative footers` picker rows are reordered built-in first (`Pi (system)`, `Arnative (Full)`) and the parenthetical suffix now renders in the theme's `dim` token, so the preset name carries the row and the qualifier reads as a footnote (`extensions/arnative.ts`).
505
- - Preset ids renamed: `Pi` → `Pi (system)`. `Arnative (Full)` is still the default and the header/footer slot logic is unchanged.
506
- - Picker subtitles no longer repeat the preset names (`Selection applies live — custom header or built-in.`).
507
- - README shows only `assets/pi-arnative.webp` as the hero image; the full-width `assets/banner.webp` stays reserved for the pi.dev package page via `pi.image`.
508
- - `package.json` `description` now leads with the README tagline ("Refined aesthetics. Cohesive tools. Built for Pi.") followed by the capability summary, per the `/arnative-pi` manifest standard, since pi.dev/packages renders this field verbatim as the package card description.
509
-
510
- ## [0.3.0] - 2026-10-03
511
-
512
- ### Fixed
513
- - `package.json` `files` now ships `LICENSE`; README hero banner uses the standard full-width `assets/banner.webp`.
514
- - Unit-boundary display bugs in the usage numbers (`lib/usage-store.ts` `formatTokens`, `extensions/usage.ts` `formatCost`): a value that rounds up to the next unit printed `"1000k"` / `"$1000.00"` instead of `"1M"` / `"$1.0k"`; every unit now promotes through `fmtUnit()` (also strips a `.0` tail below 10k, so `9,999` is `"10k"` not `"10.0k"`).
515
- - `getModelAllTimeUsage()` without a model id matched **every** model, so the header's Model tab showed the grand total under "No Model"; it now matches nothing (zeros).
516
- - The usage disk cache never dropped session files deleted from disk, so `~/.pi/agent/arnative-usage-cache.json` only ever grew; `collectUsageSummary()` now prunes missing files while scanning.
517
- - A git refresh arriving while one was in flight was dropped (early return in `refreshGit()`), so the footer's git state stayed stale until the next trigger; it is now queued (last requested cwd wins) and re-run after the in-flight one (`extensions/footer.ts`).
518
- - `USER_TIMESTAMPS_MAP` grew for the whole process lifetime (it survives `/reload`); `session_start` now clears it first and refills it from the branch right after, so it is bounded by the current session (`extensions/timestamps.ts`).
519
- - The footer's token usage could show numbers up to 2s stale while a reply streamed: the cache only refreshed when the branch length changed, but a stream tick mutates the last message in place. The delta of that message is now applied on top of the cached sums (O(1) per frame, always fresh, still no O(N) rescan, `getUsage()` in `extensions/footer.ts`).
520
-
521
- ### Changed (breaking: theme contents)
522
- - All 12 `themes/*.json` are now generated from `themes/gen-themes.mjs` and store **OKLCH** values (`oklch(L% C H)`) instead of hand-written hex. `vars` was renamed to a role-based scheme (`text`→`fg`, `gray`→`fgMuted`, `dimGray`→`fgDim`, `darkGray`→`fgFaint`, `cyan`→`accentBorder`, `softCyan`→`accentSoft`, `blue`→`border`, `green/red/yellow`→`success/error/warning`, `searchBg`→`surfaceSearch`, `selectedBg`→`surfaceSelected`, `userMsgBg`→`surfaceMsg`, `toolPendingBg`→`surfaceRaised`, `toolSuccessBg`→`surfaceToolOk`, `toolErrorBg`→`surfaceToolErr`, `customMsgBg`→`surfaceCustom`); the custom `colors.tint` token was renamed to `colors.accentSoft`. Any theme copied from the old 0.2.x files must be updated by hand, as there is no compatibility shim.
523
- - Colour sets are now derived from a shared ramp, so every theme has consistent lightness/saturation per type and no two `vars` resolve to the same value (the old base had `accent` = `cyan`, `syntaxOperator` = `syntaxPunctuation` = `text`, and variants that copied 12+ identical hex values).
524
- - `lib/color.ts` (new) holds the OKLCH↔sRGB math, WCAG contrast and `toHex`, shared by the generator and the theme self-check.
525
-
526
- ### Changed
527
- - The header's `Themes` tab is gone: pi 1.0 no longer emits a startup `[Themes]` section (only Context, Skills, Prompts, Extensions), so the tab could only ever read `Themes [0]`. The theme list stays reachable through `/settings` → Theme and `/arnative themes` (`extensions/section-headers.ts`).
528
- - Select menus (`ctx.ui.select`, e.g. `/arnative` and `/jev-eye`): the selected row no longer turns fully accent; only the `→` marker and `·` separators keep accent, while the selected text uses `accentSoft` (fallback accent on themes without the token). Live-preview theme picker follows the same rule (`extensions/ui-render-tweaks.ts`, `extensions/arnative.ts`).
529
- - `accentSoftOf` (accentSoft token with accent fallback) moved to `lib/ansi.ts`, shared by `tools.ts`, `usage.ts` and the new select-row patch; the theme picker no longer crashes when a built-in theme without `accentSoft` is previewed.
530
- - Theme self-check (`extensions/ui-render-tweaks.ts`) now accepts hex **or** validated OKLCH, converts through `lib/color.ts` before building pi's `Theme` (the bundled 0.87.1 parser only understands hex), asserts every `vars` value is unique per theme, and asserts the thinking ramp rises monotonically.
531
-
532
- ### Added
533
- - `/arnative footers` picks the footer preset with the same live-preview picker as headers: `Arnative (Full)` (default, the 3-row grid footer) or `Pi` (pi's built-in footer, stock line count). Moving the selection swaps the footer on the spot, Enter keeps it, Esc restores the preset the picker opened with. The boxed editor is registered once per session and stays arnative in both presets, since pi's `setEditorComponent()` calls `disposeActiveSelector()`, which would close the picker mid-preview (`extensions/footer.ts`, `extensions/arnative.ts`).
534
- - `/arnative headers` picks the header preset: `Arnative (Full)` (default, this extension's header) or `Pi` (pi's built-in header). It uses the same live-preview picker as themes: moving the selection swaps the header on the spot via `ctx.ui.setHeader()`, Enter keeps it, Esc restores the preset the picker opened with. The choice lasts for the process (a new pi launch starts at `Arnative (Full)` again) (`extensions/section-headers.ts`, `extensions/arnative.ts`).
535
- - `/arnative <menu>` settings command, shaped like `/jev-eye`: no argument opens the menu picker with autocomplete; first menu `themes` is a live-preview picker over the `/settings` → Theme list (moving the selection applies the theme instantly via `ctx.ui.setTheme()`, Enter keeps it, Esc reverts to the theme opened with, `extensions/arnative.ts`). The picker component (`ListPicker`) is shared by the themes, headers and footers menus, and the three identical picker-label helpers were consolidated into `markedLabels()` in `lib/format.ts`.
536
-
537
- ### Changed
538
- - Header layout reworked (`extensions/section-headers.ts`): the left column is the pi block mark with `pi vX` directly under it (10 columns wide). The info column starts with `Arnative vY · Welcome back, <User>` (username's first letter capitalized via `capitalize()`), then the tab box and the tab data, with no blank lines so no row is left half empty. The box is 7 lines.
539
- - The mark is the pi logo's grid rendered at terminal aspect (8 columns x 4 lines) instead of the 6-line "Pi" wordmark, and keeps the old wordmark's two-tone: P (the salmon/blue structure, columns 0-2) in the theme accent, i (the yellow bar, column 3) in the theme tint.
540
- - The column divider joins the frame with `┬`/`┴` (`render()`, `border()`), so the left/right split runs the full height with no gap at the top or bottom border.
541
- - The tab box lost its ` Menu ` label, and its tab dividers now join its own borders with `┬`/`┴` (`tabRule()`, `tabSeps`), so each divider is full height instead of a lone `│` on the middle row.
542
-
543
- ## [0.2.12] - 2026-10-02
544
-
545
- ### Changed
546
- - The footer is a fixed 3-row grid: row 1 pairs the cwd line with the model, rows 2-3 pair the extension status (mcp first) with the metrics (tok/s · cache · token), where each side wraps inside its half of the terminal, the right cells stay right-aligned, and a row where both sides ran out is dropped. Replaces the adaptive 2→3 reflow; no click toggle (`extensions/footer.ts`, `layoutFooterGrid()` + `pairRow()`).
547
-
548
- ## [0.2.11] - 2026-10-01
549
-
550
- ### Changed
551
- - The footer status area now reflows: 2 lines stay the default while everything fits, but on a narrow terminal the statuses and the metrics (tok/s, cache, context) move onto a 3rd line instead of being truncated. `extensions/footer.ts` `layoutStatusLines()` (`rows` = line budget of the whole footer, `maxRows` caps the growth); self-check covers the wide/narrow/cap cases.
552
-
553
- ## [0.2.10] - 2026-10-01
554
-
555
- ### Added
556
- - The working loader now shows elapsed turn time next to the label (`⠴ Working (50s)`, `⠴ Executing (1m 5s)`). One `setInterval(1s)` per turn (`extensions/footer.ts`), cleared on `turn_end`/`session_shutdown`; the suffix only appears from 1s (no `(0s)` flicker) and the timer keeps counting across tool switches inside a turn. With parallel tools the label follows the last started tool and only falls back to `Working` when every `toolCallId` has ended.
557
-
558
- ### Fixed
559
- - Tool image previews (e.g. `read` on a PNG) no longer break the layout. pi renders a preview as an extra child below the tool box, padded with `result.rows - 1` blank rows, and the gap-stripping patch deleted exactly those rows, so the terminal painted the image over the rows underneath (chat text, editor, footer). Only the leading Spacer is dropped now; from the image sequence on, every line is kept.
560
-
561
- ## [0.2.9] - 2026-09-30
562
-
563
- ### Fixed
564
- - The startup `[Context]`, `[Skills]`, `[Extensions]` and `[Themes]` lists stacked under the header again on pi ≥ 0.99: pi replaced `ExpandableText`'s `getCollapsedText`/`getExpandedText` fields with a `build` callback plus a `state` object, so the section detector matched nothing and the tabs stayed at `[0]`. Both shapes are read now (`sectionBodyOf`), and the same applies to the `[Extension issues]` box, which read the stale `child.text` snapshot instead of the theme-aware `build()` output.
565
- - Fixed NPM version badge in `README.md` to reference `@bismawy/pi-arnative` instead of placeholder `react`.
566
-
567
- ---
568
-
569
- ## [0.2.8] - 2026-09-28
570
-
571
- ### Fixed
572
- - Custom `ctrl+alt+<letter>` shortcuts (`t` next tab, `n` new session, `r` reload) never fired on Windows: Windows Terminal ≥ 1.24 aliases every `Ctrl+Alt` combo to AltGr ([microsoft/terminal#20052](https://github.com/microsoft/terminal/pull/20052)), so the legacy `ESC` + control-byte encoding is never emitted. All of them now also accept `alt+<letter>` on Windows **and WSL** (same input translation), matching pi's own convention (`alt+v`, `alt+p`). Linux keeps `ctrl+alt`, macOS keeps `ctrl+option` (plain Option composes characters there).
573
- - Shortcut ids, platform variants and cheatsheet labels now come from one place (`lib/shortcuts.ts`) instead of being spelled out per extension; the label is derived from the key id that is actually registered, so a cheatsheet can no longer advertise a key the platform never binds.
574
- - README: platform notes for Windows/WSL, macOS, Linux desktops and multiplexers, including `PI_TUI_ESC_TIMEOUT` for the intermittent “Escape + stray letter” glitch (`ESC`-prefixed shortcuts flushed by pi's ~10 ms lone-ESC timer).
575
- - Reload state for the chat clock now lives on a `globalThis` symbol instead of module locals: `/reload` re-imports the module while the prototype patches stay on the class, so the surviving render closure and the new `session_start` handler read the same map and theme. The old shape captured `ctx` in the module, which pi rejects after reload/session replacement, and that throw surfaced as an uncaughtException during a render pass.
576
-
577
- ---
578
-
579
- ## [0.2.7] - 2026-09-28
580
-
581
- ### Fixed
582
- - README screenshot used raw HTML `<img>`, which pi.dev's markdown sanitizer strips; now plain markdown image syntax, so it renders on GitHub, npm and pi.dev alike (supersedes 0.2.6, whose README image was invisible on pi.dev).
583
-
584
- ---
585
-
586
- ## [0.2.6] - 2026-09-28
587
-
588
- ### Added
589
- - Package banner and README screenshot (`assets/banner.webp` as the pi.dev gallery preview via `pi.image`, `assets/pi-arnative.webp` under the README badges).
590
-
591
- ---
592
-
593
- ## [0.2.5] - 2026-09-28
594
-
595
- ### Fixed
596
- - `timestamps.ts`: missing `themeOf` import crashed `session_start` with "themeOf is not defined" on `/reload` and session resume (0.2.4 regression).
597
-
598
- ---
599
-
600
- ## [0.2.4] - 2026-09-28
601
-
602
- ### Added
603
- - `lib/check.ts` and `lib/format.ts`: shared self-check helpers (`assert`, `isMain`) and shared display formatting (model names, capitalize, expand-hint key), so footer, header tabs and tool boxes agree by construction.
604
-
605
- ### Fixed
606
- - A crashing third-party tool renderer (e.g. pi-web-access `get_content` with missing args) no longer exits pi: every external renderer call is wrapped in a safe fallback, matching pi's own `updateDisplay` semantics.
607
- - Restored / `--continue` sessions now show the real send time on user messages (timestamps prefilled from session history). A message with no recorded time shows no clock instead of a fake "now".
608
- - The spinner animates at the documented 500 ms cadence (was 150 ms); footer status stripping no longer carries a broken ANSI-regex leftover.
609
- - The usage log prefilter no longer silently undercounts if the JSONL key order/shape changes.
610
-
611
- ### Changed
612
- - Self-check boilerplate, ANSI stripping and model-name formatting were deduplicated into `lib/`; dead compatibility exports removed. Behavior unchanged, `npm test` green.
613
-
614
- ---
615
-
616
- ## [0.2.3] - 2026-09-27
617
-
618
- ### Added
619
- - `Shortcut` header tab (rightmost, after `Themes`) holding the key cheatsheet: `Esc`, `Ctrl+c/d`, `/`, `!`, `Ctrl+o`, `Ctrl+alt+t`, `Ctrl+alt+n`, `Ctrl+alt+r`. Tab order is now `Directory → Model → Context → Skills → Extensions → Themes → Shortcut`.
620
-
621
- ### Changed
622
- - The header no longer spends a line on the shortcut legend. Line 1 greets the device username (`Welcome back, <user>`), line 2 shows `pi vX.Y.Z · Arnative vX.Y.Z` (names in the theme accent, versions dim). The tab box labels itself on its top border (`╭─ Menu ───╮`) instead of spending a text line. The Arnative version is read from the package.json of the running build, so an outdated npm install can no longer claim to be the executing code.
623
- - The `Shortcut` tab is dropped first on narrow terminals (~<146 columns), like every rightmost tab.
624
-
625
- ---
626
-
627
- ## [0.2.2] - 2026-09-27
628
-
629
- ### Added
630
- - `ctrl+alt+r` reload legend in the header shortcut line (`[Ctrl+alt+r] Reload`), shown from 142 columns on.
631
-
632
- ### Changed
633
- - `Directory` is now the first header tab (and the default tab on open), so the working directory shows immediately. Tab order: `Directory → Model → Context → Skills → Extensions → Themes`.
634
- - The `Directory` tab label is just `Directory`; the full path moved to the tab content line, shown on click.
635
- - Model tab label uses brackets: `Model [Deepseek V4.1 Flash]` instead of `Model: Deepseek V4.1 Flash`.
636
-
637
- ### Fixed
638
- - Click hit-areas for header tabs were off by 2 columns (tab box border + leading space were not counted), so the leftmost tab looked dead on its last 2 columns.
639
-
640
- ---
641
-
642
- ## [0.2.1] - 2026-09-27
643
-
644
- ### Fixed
645
- - Fixed `ctrl+alt+r` reload shortcut by publishing missing extension logic to NPM registry.
646
- - Hoisted reload shortcut key id to typed `Key.ctrlAlt("r")` with encoding assertions for both legacy ESC (`\x1b\x12`) and Kitty CSI-u (`\x1b[114;7u`).
647
-
648
- ### Added
649
- - Added `npm run dev` script for conflict-free local live TUI testing.
650
-
651
- ---
652
-
653
- ## [0.2.0] - 2026-09-27
654
-
655
- ### Added
656
- - Interactive header box with clickable resource tabs (`Model`, `Directory`, `Context`, `Skills`, `Extensions`, `Themes`).
657
- - Full working directory view under the `Directory` tab (wrapped at path segments, never truncated).
658
- - Keyboard shortcut `ctrl+alt+t` to cycle through header tabs.
659
- - Keyboard shortcut `ctrl+alt+r` for instant runtime reload (`/reload`).
660
- - Full `/usage` interactive dashboard modal with session/all-time token metrics and estimated costs.
661
- - 10 expressive palette variants generated from base Arnative (`sun`, `zinc`, `violet`, `emerald`, `matrix`, `cyberpunk`, `synthwave`, `gruvbox`, `nord`, `dracula`).
662
- - Visual rounded boxes with animated status spinners for built-in and MCP tool executions.
663
- - Transcript timestamp clock and message bubble background repair.
664
-
665
- ### Changed
666
- - Shortened footer working directory display to tail segments.
667
- - Compacted compaction and status notices into single-line dimmed highlights.
668
- - Unified theme token contrast check across all variants via automated test suite.
669
-
670
- ---
671
-
672
- ## [0.1.0] - 2026-09-24
673
-
674
- ### Added
675
- - Initial release of `@bismawy/pi-arnative`.
676
- - Warm-neutral base Arnative theme with cyan accents.
677
- - Fixed 2-line status footer with real-time streaming speed (tok/s), Git branch/tag status, and token metrics.
678
- - Boxed editor input with dim ` > ` prompt.