pi-magi-theme 0.1.2 → 0.1.4

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.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # pi-magi-theme
2
2
 
3
- A three-mind council theme + extension for [pi](https://pi.dev): a detailed Tree of Life in the header, the three MAGI in a fixed side panel, live llama-swap telemetry, and `/magi`, a council of three models that votes on your engineering questions.
3
+ A three-mind council theme + extension for [pi](https://pi.dev): a detailed Tree of Life in the header, the three MAGI in a fixed side panel, live llama-swap telemetry, and `/magi`, a council of three models that votes on your engineering questions and reviews your pending changes.
4
4
 
5
5
  All artwork is original. The symbolism (the three Magi, the Tree of Life, the golem, the seven seals) is public domain.
6
6
 
@@ -32,7 +32,17 @@ Clone the repo and point pi at it instead (edits in the repo are live on the nex
32
32
  "themes": ["/path/to/pi-magi-theme/themes"]
33
33
  ```
34
34
 
35
- Commands: `/magi <question>`, `/magi config`, `/magi-ui [on|off|panel]`.
35
+ ## Commands
36
+
37
+ | Command | What it does |
38
+ |---------|--------------|
39
+ | `/magi <question>` | the council answers a question (recent conversation as context) |
40
+ | `/magi review [focus]` | the council reviews your pending changes (`git diff HEAD` plus untracked file names) before you commit |
41
+ | `/magi config` | pick a model for each MAGI |
42
+ | `/magi-ui compact` | toggle the compact side panel (basic info and animations only); remembered across sessions |
43
+ | `/magi-ui status` | llama-swap report from its last 100 requests: speed, tokens, cache hits, MTP draft acceptance, durations, errors per model |
44
+ | `/magi-ui config` | set the electricity price per kWh and the currency (EUR or USD) for the COST row |
45
+ | `/magi-ui panel` · `on` · `off` | hide/show the side panel, enable/disable the whole chrome |
36
46
 
37
47
  ## Lore ↔ function
38
48
 
@@ -44,13 +54,19 @@ Every symbol stands for something real the agent is doing.
44
54
  | light descending Tiferet → Malkuth | manifestation | the model is **streaming the answer** (with live tok/s) | footer |
45
55
  | light ascending Malkuth → Keter | ascent | the model is **being loaded into VRAM** | footer |
46
56
  | Malkuth at rest | the kingdom | **idle**, with the last run duration | footer |
47
- | MELCHIOR · BALTHASAR · CASPAR | the three Magi | light up while **thinking**, give the **verdict** when answering, boot on model load; `/magi` council | panel |
48
- | the golem, EMET ("truth") | a clay servant that acts | a **tool is running** | panel + footer |
57
+ | MELCHIOR · BALTHASAR · CASPAR flickering | the three Magi at work | what the agent **is doing** (thinking, responding, loading, compacting); below them, the **last real `/magi` verdict** | panel |
58
+ | the golem, EMET ("truth") | a clay servant that acts | a **tool is running**, with the file or command it works on | panel + footer |
49
59
  | the golem, MET ("death") | the aleph is erased | a **tool failed** | panel + footer |
50
60
  | SYNC | the golem's obedience | **tool success rate** | panel + footer |
51
61
  | CHESED ✓ / GEBURAH ✗ | mercy / severity | **successful / failed tools** | panel + footer |
52
62
  | the seven seals | the end of an age | **context window usage**, one seal per seventh | panel |
63
+ | the sixth seal blinking | the last warning | context **close to compaction**: compact now instead of mid-task | panel + footer |
53
64
  | breaking the seals → seventh seal opened | apocalypse and renewal | **context compaction** running → done | panel + footer |
65
+ | Malkuth asleep | the kingdom sleeps | llama-swap **unloaded the model**; typing wakes it | panel + footer |
66
+
67
+ The window title is `π - Magi - <working directory>`. After a run longer than 30 seconds it becomes `✓ π - Magi - …` until you touch the keyboard, so you notice from another window that the agent finished.
68
+
69
+ In fullscreen mode the side panel always reaches the bottom of the terminal.
54
70
 
55
71
  ## The seventh seal: smart compaction
56
72
 
@@ -60,7 +76,7 @@ The theme does not compact anything itself: it shows who does. For better compac
60
76
  pi install npm:pi-smart-compact
61
77
  ```
62
78
 
63
- It extracts files, errors, decisions and open loops locally (no LLM calls), then synthesizes and verifies the summary. Point its `summaryModel` at a local model to keep compaction free. When it is installed, the seals name it while they break (`✶ BREAKING THE SEALS · smart-compact · 4s`) and the seventh seal reports who actually produced the summary: `smart-compact`, or `pi native` if it fell back to pi's own compactor.
79
+ It extracts files, errors, decisions and open loops locally (no LLM calls), then synthesizes and verifies the summary. Point its `summaryModel` at a local model to keep compaction free. When it is installed, the sixth seal suggests `/smart-compact`, the seals name it while they break (`✶ BREAKING THE SEALS · smart-compact · 4s`) and the seventh seal reports who actually produced the summary: `smart-compact`, or `pi native` if it fell back to pi's own compactor.
64
80
 
65
81
  ## The council
66
82
 
@@ -68,22 +84,34 @@ It extracts files, errors, decisions and open loops locally (no LLM calls), then
68
84
 
69
85
  | Unit | Nature | Looks at |
70
86
  |------|--------|----------|
71
- | MELCHIOR | PRAGMATIST | simplest working solution, effort vs value, reuse, YAGNI |
72
- | BALTHASAR | GUARDIAN | failure modes, security, operability, maintainability |
73
- | CASPAR | VISIONARY | reframing the problem, alternatives, DX, evolution |
87
+ | MELCHIOR | PRAGMATIST | what solves the problem, the simplest path, effort vs value, what already exists (in software: reuse, YAGNI, shipping) |
88
+ | BALTHASAR | GUARDIAN | what can go wrong and for whom, reversibility, hidden costs (in software: failure modes, security, operability) |
89
+ | CASPAR | VISIONARY | whether the question is framed right, alternatives, people's experience, long-term direction (in software: design, DX, evolution) |
74
90
 
75
- Each MAGI also gets the recent conversation as context. Full opinions are added to the chat (not sent to the agent).
91
+ Each nature is a lens, not a specialty, so the council answers any question, not only software ones. Every MAGI first answers the question, then judges it through its lens, naming concrete tools, numbers and scenarios from your question instead of generic advice. Votes: **APPROVE** = go ahead or clear recommendation; **CONDITIONAL** = only if the named conditions hold, or when information is missing (it says what it needs); **REJECT** = a concrete problem, with what to do instead. A MAGI never rejects because a topic is outside its nature. Answers come back in the language of your question.
76
92
 
77
- `/magi config` picks a model per unit and saves `~/.pi/agent/magi.json` (unset = current session model). Optional per-unit thinking:
93
+ `/magi <question>` gives the MAGI the recent conversation as context; `/magi review` gives them the pending diff (truncated at 24k characters). Full opinions are added to the chat (not sent to the agent), and the last verdict stays under the MAGI in the side panel.
94
+
95
+ ## Configuration
96
+
97
+ `~/.pi/agent/magi.json` (written by `/magi config`, `/magi-ui compact` and `/magi-ui config`, editable by hand):
78
98
 
79
99
  ```json
80
- { "MELCHIOR": { "model": "llama-swap/Qwen3.8 27B Q4_K_M - Thinking", "thinking": "low" } }
100
+ {
101
+ "MELCHIOR": { "model": "llama-swap/Qwen3.8 27B Q4_K_M - Thinking", "thinking": "low" },
102
+ "ui": { "compact": false, "kwhPrice": 0.30, "currency": "EUR" }
103
+ }
81
104
  ```
82
105
 
106
+ - per MAGI: `model` (unset = current session model) and optional `thinking` level;
107
+ - `ui.compact`: start with the compact side panel;
108
+ - `ui.kwhPrice` and `ui.currency` (`EUR` or `USD`): the COST row multiplies the GPU energy used in the session by this price.
109
+
83
110
  ## llama-swap
84
111
 
85
112
  When the session model uses the `llama-swap` provider, the side panel:
86
113
 
87
114
  - loads the model into VRAM on startup and on model change (`GET /upstream/<model>/health`), with a MAGI boot animation;
88
- - shows VRAM, GPU load/temperature/power and RAM from `/metrics`;
89
- - shows server-measured tok/s, prompt tok/s and KV cache hits from `/api/metrics/activity`.
115
+ - notices when llama-swap unloads the model (`/running`), shows it asleep and reloads it as soon as you type;
116
+ - shows VRAM, GPU load/temperature/power, RAM and the GPU energy used in the session from `/metrics` (every 3s while working, every 30s when idle);
117
+ - shows server-measured tok/s, prompt tok/s and KV cache hits of the last request (`/api/metrics/activity?limit=1`).