@bismawy/pi-arnative 0.9.1 → 0.10.1

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/CHANGELOG.md +87 -0
  2. package/README.md +3 -3
  3. package/extensions/animations.ts +1 -1
  4. package/extensions/arnative.ts +23 -11
  5. package/extensions/autocompact.ts +0 -0
  6. package/extensions/footer.ts +0 -0
  7. package/extensions/model-heal.ts +93 -18
  8. package/extensions/section-headers.ts +0 -0
  9. package/extensions/timestamps.ts +0 -0
  10. package/extensions/todos.ts +43 -15
  11. package/extensions/tools.ts +128 -11
  12. package/extensions/ui-render-tweaks.ts +5 -5
  13. package/extensions/usage.ts +309 -19
  14. package/lib/ansi.ts +22 -12
  15. package/lib/box.ts +1 -1
  16. package/lib/check.ts +0 -0
  17. package/lib/compat.ts +13 -64
  18. package/lib/format.ts +0 -0
  19. package/lib/list-picker.ts +117 -22
  20. package/lib/model-heal.ts +78 -13
  21. package/lib/patch.ts +0 -0
  22. package/lib/preset-store.ts +0 -0
  23. package/lib/provider.ts +153 -66
  24. package/lib/shortcuts.ts +36 -20
  25. package/lib/spinner.ts +0 -0
  26. package/lib/status-widget.ts +14 -0
  27. package/lib/todos.ts +0 -0
  28. package/lib/usage-store.ts +227 -24
  29. package/package.json +1 -1
  30. package/themes/arnative-blossom.json +89 -0
  31. package/themes/arnative-crimson.json +89 -0
  32. package/themes/arnative-cyberpunk.json +28 -28
  33. package/themes/arnative-dracula.json +40 -39
  34. package/themes/arnative-earthy.json +89 -0
  35. package/themes/arnative-garden.json +89 -0
  36. package/themes/arnative-gruvbox.json +40 -39
  37. package/themes/arnative-lemonade.json +89 -0
  38. package/themes/{arnative-synthwave.json → arnative-magical.json} +32 -31
  39. package/themes/arnative-matrix.json +37 -36
  40. package/themes/arnative-neutral.json +89 -0
  41. package/themes/arnative-nord.json +43 -42
  42. package/themes/arnative-zinc.json +43 -42
  43. package/themes/arnative.json +32 -31
  44. package/themes/gen-themes.mjs +376 -129
  45. package/themes/arnative-emerald.json +0 -88
  46. package/themes/arnative-sun.json +0 -88
  47. package/themes/arnative-violet.json +0 -88
package/CHANGELOG.md CHANGED
@@ -1,7 +1,94 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.10.1] - 2026-11-11
4
+
5
+ ### Fixed
6
+ - Manual Model heal shows a start notice and live progress for flags, catalogs, and thinking probes. Final results now include partial failures.
7
+ - Manual Model heal now cancels on session reload or replacement. Model refresh captures the current model before awaiting and uses the bound extension API.
8
+ - Model heal now respects the one-hour cooldown after a failed effort probe. Reordering thinking map keys no longer triggers another probe.
9
+ - 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.
10
+
3
11
  ## [Unreleased]
4
12
 
13
+ ## [0.10.0] - 2026-11-08
14
+
15
+ ### Added
16
+ - **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`).
17
+ - **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`).
18
+ - **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.
19
+ - **Custom theme auto-sync in dev loop:** `npm run overlay` now mirrors updated theme JSON files directly into `~/.pi/agent/themes/` (`scripts/overlay.mjs`).
20
+
21
+ ### Added
22
+ - **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`).
23
+
24
+ ### Fixed
25
+ - **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`).
26
+ - **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`).
27
+ - 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).
28
+
29
+ ### Changed
30
+ - **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`).
31
+ - 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).
32
+ - 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).
33
+ - 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.
34
+ - **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`.)
35
+ - **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`).
36
+ - 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`).
37
+ - **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.
38
+ - **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`).
39
+ - **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`).
40
+ - 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.
41
+ - 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.
42
+
43
+
44
+ - **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`).
45
+ - **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).
46
+ - 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`).
47
+ - 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).
48
+ - 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).
49
+ - 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).
50
+ - 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).
51
+ - 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).
52
+ - Cyberpunk links now join headings on `vars.headingTone` (purple); code keeps the orange `vars.tone`, and labels stay pink-soft (themes/gen-themes.mjs).
53
+ - 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).
54
+ - 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).
55
+ - 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).
56
+ - `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).
57
+ - `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).
58
+ - 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).
59
+ - `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).
60
+ - 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).
61
+
62
+ - 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).
63
+
64
+ - 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).
65
+
66
+ - 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).
67
+
68
+
69
+
70
+
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+
85
+
86
+
87
+ - **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`).
88
+ - **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`).
89
+ - **`[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`).
90
+ - 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).
91
+
5
92
  ## [0.9.1] - 2026-11-02
6
93
 
7
94
  ### Added
package/README.md CHANGED
@@ -12,7 +12,7 @@ Refined aesthetics. Cohesive tools. Built for Pi.
12
12
 
13
13
  pi-arnative replaces pi’s default terminal chrome with a unified visual interface.
14
14
 
15
- - Warm Themes: Contrast-checked OKLCH color palettes generated without drift (`arnative` plus 10 variants).
15
+ - Warm Themes: Contrast-checked OKLCH color palettes generated without drift (`arnative` plus eight variants).
16
16
  - Tabbed Header: Compact box menu showing Directory, Model, Context, Skills, Extensions, and Shortcuts.
17
17
  - Rounded Tool Boxes: Status, spinner, runtime duration, and clickable `[show]` / `[hide]` output toggles.
18
18
  - Task List: `todo` tool, `/todos` view, and a boxed widget above the editor that auto-hides 30s after all tasks finish.
@@ -32,7 +32,7 @@ Saved to `~/.pi/agent/arnative/config.json` via `/arnative`:
32
32
  - **Headers & Footers:** `Arnative (Full)` (default), `Arnative (Minimal)` (footer only; click head text or press `ctrl+alt+m` to toggle), or `Pi (system)`.
33
33
  - **Animations:** 18 presets (`Arnative` default, `Pi (system)`, and alphabetical variants). Press `[g]` in the picker to toggle the Google gradient sweep.
34
34
  - **Auto-compact:** Off by default. **Smart** tiers trigger near ~200k tokens (`≥768k→20%`, `≥384k→40%`, `≥192k→80%`, `<192k→pi core`), or pick a fixed budget (`100k` to `400k`).
35
- - **Model heal:** **Full** (default: offline compat flags, `GET /models` limits with 6h TTL, reasoning effort probe with 24h TTL), **Flags** (offline only), or **Off**. Hand-edited fields are never overwritten.
35
+ - **Model heal:** **Full** (default: offline compat flags, `GET /models` limits with a 6h TTL, reasoning effort probe with a 24h TTL, and a failed fetch of either retried after 1h), **Flags** (offline only), or **Off**. Hand-edited fields are never overwritten. `/model-heal` forces every pass, warns that thinking probes can use paid tokens, and shows the stage it is in.
36
36
  - **Task list (`todo`):** Stored per session in `~/.pi/agent/arnative/todos/<session-id>.json` (uninstall `@juicesharp/rpiv-todo` first to avoid tool name conflict). Click `[click to expand]` / `[click to collapse]` or press `ctrl+alt+o` (`alt+o`) to toggle; click `↑`/`↓` counters or press `ctrl+alt+j`/`k` (`alt+j`/`k`) to scroll. Auto-hides 30s after completion (set `PI_ARNATIVE_TODO_HIDE_MS` to override, `0` for immediate hide; expanding pauses the timer).
37
37
 
38
38
  </details>
@@ -122,7 +122,7 @@ Bind `app.session.new` in `~/.pi/agent/keybindings.json`:
122
122
  <details>
123
123
  <summary><b>Theme Variants & Development</b></summary>
124
124
 
125
- **Themes (`themes/gen-themes.mjs` + `lib/color.ts`):** `arnative` · `sun` · `zinc` · `violet` · `emerald` · `matrix` · `cyberpunk` · `synthwave` · `gruvbox` · `nord` · `dracula`
125
+ **Themes (`themes/gen-themes.mjs` + `lib/color.ts`):** `arnative` · `arnative-cyberpunk` · `arnative-crimson` · `arnative-matrix` · `arnative-neutral` · `arnative-zinc` · `arnative-nord` · `arnative-dracula` · `arnative-gruvbox`
126
126
 
127
127
  ```bash
128
128
  npm test # Run self-checks and unit tests
@@ -127,7 +127,7 @@ export function animationsPickerText(): { title: string; description: string; le
127
127
  return {
128
128
  title: "Animations - Arnative\u2819",
129
129
  description: "The working spinner — applies on the next tool call.",
130
- legend: `[↑↓] Preview [g] Gradient ${activeSpinnerGradient() ? "on" : "off"} [Enter] Select [Esc] Close`,
130
+ legend: `[↑↓] Preview [g] Gradient ${activeSpinnerGradient() ? "on" : "off"} [Enter] Select [Esc] Back`,
131
131
  };
132
132
  }
133
133
 
@@ -5,6 +5,7 @@
5
5
  * Screens share one chrome and one title shape ({@link renderScreen}); a box border takes
6
6
  * the session's thinking slot (`lib/ansi.ts`), so it belongs to the active model.
7
7
  */
8
+ import { bindSetModel } from "../lib/provider.ts";
8
9
  import type { ExtensionAPI, ExtensionCommandContext } from "@earendil-works/pi-coding-agent";
9
10
  import { visibleWidth, type AutocompleteItem } from "@earendil-works/pi-tui";
10
11
  import { stripAnsi } from "../lib/ansi.ts";
@@ -32,11 +33,12 @@ import {
32
33
  setAutoCompact,
33
34
  type AutoCompactChoice,
34
35
  } from "./autocompact.ts";
35
- import { healNow } from "./model-heal.ts";
36
+ import { cancelManualHeal, healNow } from "./model-heal.ts";
36
37
  import { MODEL_HEAL_CHOICES, MODEL_HEAL_KEY, activeModelHeal, setModelHeal, type ModelHealChoice } from "../lib/model-heal.ts";
37
38
  import { LIST_LEGEND_LIVE, LIST_LEGEND_MOVE, LIST_LEGEND_ROOT, ListPicker, nameRows, rowText, type ListPickerText, type ListRow } from "../lib/list-picker.ts";
38
39
  import { openProviders } from "../lib/provider.ts";
39
40
  import { openUsage } from "./usage.ts";
41
+ import { SHORTCUT_OPEN_ARNATIVE } from "../lib/shortcuts.ts";
40
42
 
41
43
  export interface ArnativeMenu {
42
44
  value: string;
@@ -560,7 +562,15 @@ export default function (pi: ExtensionAPI) {
560
562
  if (!shouldApplyDefaultTheme(pi.getSettings()?.theme, ctx.ui.getAllThemes())) return;
561
563
  ctx.ui.setTheme(DEFAULT_THEME);
562
564
  });
565
+ bindSetModel((model) => pi.setModel(model as never));
566
+ pi.on("session_shutdown", () => cancelManualHeal());
563
567
  registerCommands(pi);
568
+ for (const key of SHORTCUT_OPEN_ARNATIVE.keys) {
569
+ pi.registerShortcut(key, {
570
+ description: "Open Arnative settings menu",
571
+ handler: (ctx) => arnativeHandler("", ctx as never),
572
+ });
573
+ }
564
574
  }
565
575
 
566
576
  // Self-check: `node extensions/arnative.ts`
@@ -624,7 +634,7 @@ if (isMain(import.meta.url)) {
624
634
  // The /arnative picker lists the package's family only; everything else (system, dark,
625
635
  // light, a theme of the user's own) stays in /settings → Theme.
626
636
  assert(isArnativeThemeName("arnative"), "the default theme is family");
627
- assert(isArnativeThemeName("arnative-sun"), "a variant is family");
637
+ assert(isArnativeThemeName("arnative-cyberpunk"), "a variant is family");
628
638
  for (const outsider of ["system", "dark", "light", "omarchy-system", "arnativeX", ""])
629
639
  assert(!isArnativeThemeName(outsider), `${JSON.stringify(outsider)} is not family`);
630
640
 
@@ -637,11 +647,11 @@ if (isMain(import.meta.url)) {
637
647
 
638
648
  // Live-preview picker (shared by Themes and Headers): move = preview, Enter = keep, Esc = revert.
639
649
  const fakeTheme = { fg: (_c: string, t: string) => t, bold: (t: string) => t };
640
- const pickerText: ListPickerText = { title: screenTitle("Themes"), description: "sub", legend: "[Esc] Revert" };
650
+ const pickerText: ListPickerText = { title: screenTitle("Themes"), description: "sub", legend: "[Esc] Back" };
641
651
  const previews: string[] = [];
642
652
  let reverted = 0;
643
653
  let done = 0;
644
- const picker = new ListPicker(fakeTheme, nameRows(["arnative", "arnative-nord"]), "arnative", {
654
+ const picker = new ListPicker(fakeTheme, nameRows(["arnative", "arnative-cyberpunk"]), "arnative", {
645
655
  preview: (n) => previews.push(n),
646
656
  revert: () => reverted++,
647
657
  done: () => done++,
@@ -654,8 +664,8 @@ if (isMain(import.meta.url)) {
654
664
  assert(lines.some((l) => l.includes("→ arnative")), "the cursor marks the live value");
655
665
  assert(!lines.some((l) => l.includes("●")), "no redundant ● column next to the → cursor");
656
666
  picker.handleInput("\x1b[B"); // down
657
- assert(previews.length === 1 && previews[0] === "arnative-nord", "move previews immediately");
658
- assert(picker.render(50).some((l) => l.includes("→ arnative-nord")), "the cursor follows the preview");
667
+ assert(previews.length === 1 && previews[0] === "arnative-cyberpunk", "move previews immediately");
668
+ assert(picker.render(50).some((l) => l.includes("→ arnative-cyberpunk")), "the cursor follows the preview");
659
669
  picker.handleInput("\r"); // enter
660
670
  assert(done === 1 && reverted === 0, "Enter keeps (no revert)");
661
671
  picker.handleInput("\x1b[B");
@@ -665,8 +675,8 @@ if (isMain(import.meta.url)) {
665
675
  // `←` reports upward instead of closing on a screen with a parent, reverting the live
666
676
  // preview first; the root menu has nothing behind it and omits the key.
667
677
  assert(LIST_LEGEND_ROOT === "[↑↓] Move [Enter] Open [Esc] Close", "the root menu legend omits ←");
668
- assert(LIST_LEGEND_MOVE === "[↑↓] Move [Enter] Open [←] Back [Esc] Close", "submenu legend advertises ← Back");
669
- assert(LIST_LEGEND_LIVE === "[↑↓] Preview [Enter] Select [←] Back [Esc] Revert", "live legend pinned");
678
+ assert(LIST_LEGEND_MOVE === "[↑↓] Move [Enter] Open [Esc] Back", "submenu legend advertises Esc Back");
679
+ assert(LIST_LEGEND_LIVE === "[↑↓] Preview [Enter] Select [Esc] Back", "live legend advertises Esc Back");
670
680
  let backs = 0;
671
681
  let backReverts = 0;
672
682
  const childPicker = new ListPicker(fakeTheme, nameRows(["a", "b"]), "a", {
@@ -677,8 +687,9 @@ if (isMain(import.meta.url)) {
677
687
  requestRender: () => {},
678
688
  }, pickerText);
679
689
  childPicker.handleInput("\x1b[D"); // ←
680
- assert(backs === 1 && backReverts === 0, "← reports back to the parent and leaves the revert to it");
681
- // The root menu has no parent, so ← must still leave the screen — never a dead key.
690
+ childPicker.handleInput("\x1b"); // Esc
691
+ assert(backs === 2 && backReverts === 0, "Esc and ← both report back; the parent owns the revert");
692
+ // The root menu has no parent, so the same keys must still leave the screen.
682
693
  let rootCancels = 0;
683
694
  const rootPicker = new ListPicker(fakeTheme, nameRows(["a"]), undefined, {
684
695
  preview: () => {},
@@ -688,7 +699,8 @@ if (isMain(import.meta.url)) {
688
699
  requestRender: () => {},
689
700
  }, pickerText, false);
690
701
  rootPicker.handleInput("\x1b[D");
691
- assert(rootCancels === 1, "← closes the root menu, which has no parent");
702
+ rootPicker.handleInput("\x1b"); // Esc
703
+ assert(rootCancels === 2, "Esc and ← close the root menu, which has no parent");
692
704
 
693
705
  // The main menu reuses the picker with preview/revert as no-ops: moving changes no
694
706
  // setting, only Enter opens a row. `reverted` proves it.
File without changes
File without changes
@@ -9,13 +9,17 @@
9
9
  * only, Off = nothing. While pi-auto-compat is installed this module defers to it and says so
10
10
  * once, so two healers never write models.json at the same time.
11
11
  */
12
+ import { bindSetModel, reloadCurrentModel } from "../lib/provider.ts";
12
13
  import type { ExtensionAPI, ExtensionContext } from "@earendil-works/pi-coding-agent";
13
14
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
14
15
  import { type FSWatcher, watch } from "node:fs";
15
16
  import { join } from "node:path";
16
17
  import { assert, isMain } from "../lib/check.ts";
17
18
  import { REJECTION_RE } from "../lib/compat.ts";
18
- import { activeModelHeal, autoCompatInstalled, healEffort, healFlags, healMeta, type HealDeps, type HealResult, type ModelHealChoice, type RtModel } from "../lib/model-heal.ts";
19
+ import { activeModelHeal, autoCompatInstalled, healEffort, healFlags, healMeta, markRejectedLevel, type HealDeps, type HealResult, type ModelHealChoice, type RtModel } from "../lib/model-heal.ts";
20
+
21
+ // Nerd Font md-shield-sync (U+F06DE), written as a code point so the source stays ASCII.
22
+ const HEAL_ICON = String.fromCodePoint(0xf06de);
19
23
 
20
24
  interface RegistryLike {
21
25
  getAll?: () => unknown[];
@@ -59,6 +63,12 @@ export function isRejectedParam(message: AssistantMessage | undefined): boolean
59
63
  return REJECTION_RE.test(message.errorMessage ?? "");
60
64
  }
61
65
 
66
+ /** A rejection that names the effort itself, so dropping the level is the fix. A plain
67
+ * 400 (context too long, bad tool schema) leaves the map alone and only re-probes. */
68
+ export function isEffortRejection(message: AssistantMessage | undefined): boolean {
69
+ return isRejectedParam(message) && /reasoning.?effort|thinking|effort/i.test(message!.errorMessage ?? "");
70
+ }
71
+
62
72
  /** Whether a pass may run: Off runs nothing, Flags runs only the offline flags pass, Full runs
63
73
  * everything, and an installed pi-auto-compat owns models.json in every mode. */
64
74
  export function healAllowed(need: "Flags" | "Full", mode: ModelHealChoice, autoCompat: boolean): boolean {
@@ -70,6 +80,7 @@ export function healAllowed(need: "Flags" | "Full", mode: ModelHealChoice, autoC
70
80
  export const deferNotice = (mode: ModelHealChoice, autoCompat: boolean): boolean => mode !== "Off" && autoCompat;
71
81
 
72
82
  export default function registerModelHeal(pi: ExtensionAPI): void {
83
+ bindSetModel((model) => pi.setModel(model as never));
73
84
  let watcher: FSWatcher | undefined;
74
85
  let timer: ReturnType<typeof setTimeout> | undefined;
75
86
  let widgetTimer: ReturnType<typeof setTimeout> | undefined;
@@ -81,7 +92,7 @@ export default function registerModelHeal(pi: ExtensionAPI): void {
81
92
  let ui: ExtensionContext["ui"] | undefined;
82
93
  try {
83
94
  ui = ctx.ui;
84
- ui?.setWidget?.("model-heal", lines.map((line) => "model-heal: " + line));
95
+ ui?.setWidget?.("model-heal", lines.map((line) => HEAL_ICON + " model-heal: " + line));
85
96
  } catch {
86
97
  return;
87
98
  }
@@ -100,11 +111,12 @@ export default function registerModelHeal(pi: ExtensionAPI): void {
100
111
  if (!result.changed) return;
101
112
  let refreshed = true;
102
113
  try {
103
- await registryOf(ctx)?.refresh?.({ allowNetwork: false });
114
+ refreshed = await reloadCurrentModel(ctx as never, (m) => pi.setModel(m as never));
104
115
  } catch {
105
116
  refreshed = false;
106
117
  }
107
- notify(ctx, [label + " (" + result.detail.length + " change(s))" + (refreshed ? "" : " - run /reload to load it")]);
118
+ const count = result.detail.length;
119
+ notify(ctx, [label + " (" + count + (count === 1 ? " change)" : " changes)") + (refreshed ? "" : " - run /reload to load it")]);
108
120
  }
109
121
 
110
122
  const enabled = (need: "Flags" | "Full"): boolean => healAllowed(need, activeModelHeal(), autoCompatInstalled());
@@ -183,6 +195,20 @@ export default function registerModelHeal(pi: ExtensionAPI): void {
183
195
  const deps = depsFor(ctx);
184
196
  const target = deps.models().find((m) => m.provider.toLowerCase() === message!.provider!.toLowerCase() && m.id === message!.model);
185
197
  if (!target) return;
198
+ const level = pi.getThinkingLevel();
199
+ if (isEffortRejection(message) && level !== "off") {
200
+ const marked = markRejectedLevel(deps, target, level);
201
+ if (marked.changed) {
202
+ void reloadCurrentModel(ctx as never, (m) => pi.setModel(m as never))
203
+ .then((loaded) => {
204
+ // pi clamps to the nearest level the map still offers.
205
+ if (loaded) pi.setThinkingLevel(level);
206
+ notify(ctx, [target.id + " rejected thinking " + level + "; removed it" + (loaded ? ", now " + pi.getThinkingLevel() : " - run /reload to load it")]);
207
+ })
208
+ .catch(() => undefined);
209
+ return;
210
+ }
211
+ }
186
212
  void healEffort(deps, true, [target]).then((r) => apply(ctx, "thinking levels re-probed", r)).catch(() => undefined);
187
213
  } catch {
188
214
  // stale ctx
@@ -190,6 +216,7 @@ export default function registerModelHeal(pi: ExtensionAPI): void {
190
216
  });
191
217
 
192
218
  pi.on("session_shutdown", () => {
219
+ cancelManualHeal();
193
220
  stopWatcher();
194
221
  if (widgetTimer) clearTimeout(widgetTimer);
195
222
  widgetTimer = undefined;
@@ -198,27 +225,73 @@ export default function registerModelHeal(pi: ExtensionAPI): void {
198
225
  registerCommands(pi, (_args, ctx) => healNow(ctx));
199
226
  }
200
227
 
228
+ let manualHeal: { controller: AbortController; ui: ExtensionContext["ui"] } | undefined;
229
+
230
+ /** Both the command extension and the settings extension cancel their own imported runner. */
231
+ export function cancelManualHeal(): void {
232
+ const run = manualHeal;
233
+ manualHeal = undefined;
234
+ if (!run) return;
235
+ run.controller.abort();
236
+ run.ui.setWidget("model-heal-progress", undefined);
237
+ }
238
+
201
239
  /** Every pass now, ignoring TTLs: the /model-heal command and the /arnative Run now row. */
202
240
  export async function healNow(ctx: ExtensionContext): Promise<void> {
241
+ const ui = ctx.ui;
203
242
  if (autoCompatInstalled()) {
204
- ctx.ui.notify("[arnative] pi-auto-compat is installed and heals models.json. Run /auto-compat, or uninstall it to use model heal.", "warning");
243
+ ui.notify("[arnative] pi-auto-compat is installed and heals models.json. Run /auto-compat, or uninstall it to use model heal.", "warning");
205
244
  return;
206
245
  }
207
- const deps = depsFor(ctx);
208
- const flags = healFlags(deps, undefined, ctx.model as RtModel | undefined);
209
- const meta = await healMeta(deps, true);
210
- const effort = await healEffort(deps, true);
211
- const detail = [...flags.detail, ...meta.detail, ...effort.detail];
212
- const errors = [...flags.errors, ...meta.errors, ...effort.errors];
213
- if (detail.length > 0) {
214
- await registryOf(ctx)?.refresh?.({ allowNetwork: false }).catch(() => undefined);
215
- ctx.ui.notify("[arnative] Model heal fixed:\n - " + detail.join("\n - "), "info");
246
+ if (manualHeal) {
247
+ ui.notify("[arnative] Model heal is already running.", "warning");
216
248
  return;
217
249
  }
218
- ctx.ui.notify(
219
- errors.length ? "[arnative] Model heal: nothing to fix; " + errors.length + " endpoint(s) unreachable: " + errors.join("; ") : "[arnative] Model heal: nothing to fix.",
220
- errors.length ? "warning" : "info",
221
- );
250
+ const registry = ctx.modelRegistry;
251
+ const current = ctx.model as RtModel | undefined;
252
+ const controller = new AbortController();
253
+ manualHeal = { controller, ui };
254
+ try {
255
+ ui.notify("[arnative] Model heal started (forced). Thinking probes can use paid tokens.", "info");
256
+ ui.setWidget("model-heal-progress", [HEAL_ICON + " model-heal: [1/3] Offline compat flags"]);
257
+ const deps: HealDeps = {
258
+ ...depsFor({ modelRegistry: registry }),
259
+ signal: controller.signal,
260
+ fetchImpl: (input, init) => {
261
+ controller.signal.throwIfAborted();
262
+ return fetch(input, { ...init, signal: AbortSignal.any([controller.signal, ...(init?.signal ? [init.signal] : [])]) });
263
+ },
264
+ };
265
+ const flags = healFlags(deps, undefined, current);
266
+ ui.setWidget("model-heal-progress", [HEAL_ICON + " model-heal: [2/3] Fetching /models catalogs"]);
267
+ const meta = await healMeta(deps, true);
268
+ controller.signal.throwIfAborted();
269
+ ui.setWidget("model-heal-progress", [HEAL_ICON + " model-heal: [3/3] Probing thinking levels (may use paid tokens)"]);
270
+ const effort = await healEffort(deps, true);
271
+ controller.signal.throwIfAborted();
272
+ const detail = [...flags.detail, ...meta.detail, ...effort.detail];
273
+ const errors = [...flags.errors, ...meta.errors, ...effort.errors];
274
+ if (detail.length > 0) {
275
+ ui.setWidget("model-heal-progress", [HEAL_ICON + " model-heal: Refreshing current model"]);
276
+ const loaded = await reloadCurrentModel({ modelRegistry: registry, model: current }, undefined, controller.signal);
277
+ controller.signal.throwIfAborted();
278
+ ui.notify("[arnative] Model heal fixed:\n - " + detail.join("\n - ")
279
+ + (errors.length ? "\nWarnings:\n - " + errors.join("\n - ") : "")
280
+ + (loaded ? "" : "\nRun /reload to load these changes."), errors.length || !loaded ? "warning" : "info");
281
+ return;
282
+ }
283
+ ui.notify(
284
+ errors.length ? "[arnative] Model heal: nothing to fix; " + errors.length + " issue(s): " + errors.join("; ") : "[arnative] Model heal: nothing to fix.",
285
+ errors.length ? "warning" : "info",
286
+ );
287
+ } catch (error) {
288
+ if (!controller.signal.aborted || error !== controller.signal.reason) throw error;
289
+ } finally {
290
+ if (manualHeal?.controller === controller) {
291
+ manualHeal = undefined;
292
+ ui.setWidget("model-heal-progress", undefined);
293
+ }
294
+ }
222
295
  }
223
296
 
224
297
  function registerCommands(pi: ExtensionAPI, runNow: (args: string, ctx: ExtensionContext) => Promise<void>): void {
@@ -233,6 +306,8 @@ if (isMain(import.meta.url)) {
233
306
  assert(!isRejectedParam({ role: "assistant", provider: "r", model: "m", errorMessage: "401 unauthorized" }), "an auth failure costs no probe");
234
307
  assert(!isRejectedParam({ role: "user", provider: "r", model: "m", errorMessage: "bad request" }), "only assistant messages count");
235
308
  assert(!isRejectedParam(undefined), "no message, no probe");
309
+ assert(isEffortRejection({ role: "assistant", provider: "r", model: "m", errorMessage: "400 invalid reasoning_effort: medium" }), "an effort rejection drops the level");
310
+ assert(!isEffortRejection({ role: "assistant", provider: "r", model: "m", errorMessage: "400 bad request: context too long" }), "a plain 400 keeps the map");
236
311
  assert(healAllowed("Flags", "Full", false) && healAllowed("Full", "Full", false), "Full runs every pass");
237
312
  assert(healAllowed("Flags", "Flags", false) && !healAllowed("Full", "Flags", false), "Flags runs only the offline pass");
238
313
  assert(!healAllowed("Flags", "Off", false) && !healAllowed("Full", "Off", false), "Off runs nothing");
File without changes
File without changes
@@ -10,7 +10,6 @@ import { mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node
10
10
  import { dirname, join } from "node:path";
11
11
  import { getAgentDir } from "@earendil-works/pi-coding-agent";
12
12
  import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext } from "@earendil-works/pi-coding-agent";
13
- import { StringEnum, Type } from "@earendil-works/pi-ai";
14
13
  import type { TuiMouseEvent } from "@earendil-works/pi-tui";
15
14
  import { assert, isMain } from "../lib/check.ts";
16
15
  import { inSpans, screenTitle, type TextSpan, textSpans } from "../lib/box.ts";
@@ -115,21 +114,50 @@ function saveState(ctx: ExtensionContext): void {
115
114
  }
116
115
  }
117
116
 
118
- const PARAMS = Type.Object({
119
- action: StringEnum(["create", "update", "delete", "clear", "list"], {
120
- description: "create adds tasks, update changes one, delete removes one, clear empties the list, list reads it back",
121
- }),
122
- id: Type.Optional(Type.Number({ description: "Task id: required by update and delete, ignored by the other actions" })),
123
- subject: Type.Optional(Type.String({ description: "Task title: the new task on create, the new title on update" })),
124
- status: Type.Optional(StringEnum([...LIST_STATUSES], { description: "New status of the task named by id" })),
125
- note: Type.Optional(Type.String({ description: "One short line about what is happening now; shown while the task is in progress" })),
126
- activeForm: Type.Optional(Type.String({ description: "Alias for note, kept for existing sessions" })),
127
- tasks: Type.Optional(
128
- Type.Array(Type.Object({ subject: Type.String(), note: Type.Optional(Type.String()) }), {
117
+ const PARAMS = {
118
+ type: "object",
119
+ required: ["action"],
120
+ properties: {
121
+ action: {
122
+ type: "string",
123
+ enum: ["create", "update", "delete", "clear", "list"],
124
+ description: "create adds tasks, update changes one, delete removes one, clear empties the list, list reads it back",
125
+ },
126
+ id: {
127
+ type: "number",
128
+ description: "Task id: required by update and delete, ignored by the other actions",
129
+ },
130
+ subject: {
131
+ type: "string",
132
+ description: "Task title: the new task on create, the new title on update",
133
+ },
134
+ status: {
135
+ type: "string",
136
+ enum: [...LIST_STATUSES],
137
+ description: "New status of the task named by id",
138
+ },
139
+ note: {
140
+ type: "string",
141
+ description: "One short line about what is happening now; shown while the task is in progress",
142
+ },
143
+ activeForm: {
144
+ type: "string",
145
+ description: "Alias for note, kept for existing sessions",
146
+ },
147
+ tasks: {
148
+ type: "array",
129
149
  description: "Several tasks to add at once",
130
- }),
131
- ),
132
- });
150
+ items: {
151
+ type: "object",
152
+ required: ["subject"],
153
+ properties: {
154
+ subject: { type: "string" },
155
+ note: { type: "string" },
156
+ },
157
+ },
158
+ },
159
+ },
160
+ } as never;
133
161
 
134
162
  const SUMMARY = (state: TaskState): string => {
135
163
  const { done, total, doing, queued } = countTodos(state);