pi-magi-theme 0.1.3 → 0.2.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.
- package/README.md +48 -13
- package/extensions/magi/index.ts +1320 -405
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# pi-magi-theme
|
|
2
2
|
|
|
3
|
-
A three-mind council theme + extension for [pi](https://pi.dev): a
|
|
3
|
+
A three-mind council theme + extension for [pi](https://pi.dev): a MAGI SYSTEM header, the three MAGI as their control screen 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
|
+
Fan-art theme inspired by Neon Genesis Evangelion: the MAGI and their screen belong to their creators, all rights reserved to khara, Inc. This project is not affiliated with them. The rest of the symbolism (the Tree of Life, the golem, the seven seals) is public domain.
|
|
6
6
|
|
|
7
|
-

|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
@@ -32,7 +32,18 @@ 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
|
|
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 mecha` | MECHA SELECT: pick the llama-swap model to activate, each shown as a mecha head lit by its real state |
|
|
43
|
+
| `/magi-ui compact` | toggle the compact side panel (basic info and animations only); remembered across sessions |
|
|
44
|
+
| `/magi-ui status` | llama-swap report from its last 100 requests: speed, tokens, cache hits, MTP draft acceptance, durations, errors per model |
|
|
45
|
+
| `/magi-ui config` | set the electricity price per kWh and the currency (EUR or USD) for the COST row |
|
|
46
|
+
| `/magi-ui panel` · `on` · `off` | hide/show the side panel, enable/disable the whole chrome |
|
|
36
47
|
|
|
37
48
|
## Lore ↔ function
|
|
38
49
|
|
|
@@ -44,13 +55,22 @@ Every symbol stands for something real the agent is doing.
|
|
|
44
55
|
| light descending Tiferet → Malkuth | manifestation | the model is **streaming the answer** (with live tok/s) | footer |
|
|
45
56
|
| light ascending Malkuth → Keter | ascent | the model is **being loaded into VRAM** | footer |
|
|
46
57
|
| Malkuth at rest | the kingdom | **idle**, with the last run duration | footer |
|
|
47
|
-
| MELCHIOR · BALTHASAR · CASPAR | the three Magi |
|
|
48
|
-
|
|
|
58
|
+
| MELCHIOR · BALTHASAR · CASPAR flickering | the three Magi at work | what the agent **is doing** (thinking, responding, compacting); below them, the **last real `/magi` verdict** | panel |
|
|
59
|
+
| red spreading through BALTHASAR, MELCHIOR, CASPAR | an angel hacking the MAGI | the model is **being loaded into VRAM**, at the pace of its last load; CASPAR's last corner blinks once everything else has fallen | panel |
|
|
60
|
+
| blue taking the MAGI back from that corner | the attack repelled | the model is **loaded** | panel |
|
|
61
|
+
| MECHA-I · II · III · LEGION | units waiting for a pilot | the **llama-swap models**: dormant, waking while loading, eyes lit in VRAM | MECHA SELECT |
|
|
62
|
+
| the golem, EMET ("truth") | a clay servant that acts | a **tool is running**, with the file or command it works on | panel + footer |
|
|
49
63
|
| the golem, MET ("death") | the aleph is erased | a **tool failed** | panel + footer |
|
|
50
64
|
| SYNC | the golem's obedience | **tool success rate** | panel + footer |
|
|
51
65
|
| CHESED ✓ / GEBURAH ✗ | mercy / severity | **successful / failed tools** | panel + footer |
|
|
52
66
|
| the seven seals | the end of an age | **context window usage**, one seal per seventh | panel |
|
|
67
|
+
| the sixth seal blinking | the last warning | context **close to compaction**: compact now instead of mid-task | panel + footer |
|
|
53
68
|
| breaking the seals → seventh seal opened | apocalypse and renewal | **context compaction** running → done | panel + footer |
|
|
69
|
+
| Malkuth asleep | the kingdom sleeps | llama-swap **unloaded the model**; typing wakes it | panel + footer |
|
|
70
|
+
|
|
71
|
+
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.
|
|
72
|
+
|
|
73
|
+
In fullscreen mode the side panel always reaches the bottom of the terminal.
|
|
54
74
|
|
|
55
75
|
## The seventh seal: smart compaction
|
|
56
76
|
|
|
@@ -60,7 +80,7 @@ The theme does not compact anything itself: it shows who does. For better compac
|
|
|
60
80
|
pi install npm:pi-smart-compact
|
|
61
81
|
```
|
|
62
82
|
|
|
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.
|
|
83
|
+
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
84
|
|
|
65
85
|
## The council
|
|
66
86
|
|
|
@@ -74,18 +94,33 @@ It extracts files, errors, decisions and open loops locally (no LLM calls), then
|
|
|
74
94
|
|
|
75
95
|
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
96
|
|
|
77
|
-
|
|
97
|
+
`/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.
|
|
78
98
|
|
|
79
|
-
|
|
99
|
+
## Configuration
|
|
100
|
+
|
|
101
|
+
`~/.pi/agent/magi.json` (written by `/magi config`, `/magi-ui compact` and `/magi-ui config`, editable by hand):
|
|
80
102
|
|
|
81
103
|
```json
|
|
82
|
-
{
|
|
104
|
+
{
|
|
105
|
+
"MELCHIOR": { "model": "llama-swap/Qwen3.8 27B Q4_K_M - Thinking", "thinking": "low" },
|
|
106
|
+
"ui": { "compact": false, "kwhPrice": 0.30, "currency": "EUR" },
|
|
107
|
+
"loads": { "qwen3.8-27b": 41200 }
|
|
108
|
+
}
|
|
83
109
|
```
|
|
84
110
|
|
|
111
|
+
- per MAGI: `model` (unset = current session model) and optional `thinking` level;
|
|
112
|
+
- `ui.compact`: start with the compact side panel;
|
|
113
|
+
- `ui.kwhPrice` and `ui.currency` (`EUR` or `USD`): the COST row multiplies the GPU energy used in the session by this price;
|
|
114
|
+
- `loads`: written by the theme, how long each llama-swap model took to load last time (paces the angel attack; 60s when unknown).
|
|
115
|
+
|
|
85
116
|
## llama-swap
|
|
86
117
|
|
|
87
118
|
When the session model uses the `llama-swap` provider, the side panel:
|
|
88
119
|
|
|
89
|
-
- loads
|
|
90
|
-
-
|
|
91
|
-
-
|
|
120
|
+
- loads nothing at startup: a new session opens MECHA SELECT, a resumed one shows whether its model is already in VRAM;
|
|
121
|
+
- loads the model into VRAM when you pick it, change it with `/model` or type (`GET /upstream/<model>/health`), with the angel attack animation;
|
|
122
|
+
- prewarms a new session: pi's real system prompt and tools are processed as soon as the model is ready, so the first answer doesn't wait for them;
|
|
123
|
+
- follows the context live in the seven seals while the model works (`/upstream/<model>/slots`);
|
|
124
|
+
- notices when llama-swap unloads the model (`/running`), shows it asleep and reloads it as soon as you type;
|
|
125
|
+
- 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);
|
|
126
|
+
- shows server-measured tok/s, prompt tok/s and KV cache hits of the last request (`/api/metrics/activity?limit=1`).
|