@aeondave/pi-theme-1337 0.0.0-stage → 0.6.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 (62) hide show
  1. package/CHANGELOG.md +263 -0
  2. package/LICENSE +21 -0
  3. package/README.md +166 -2
  4. package/assets/banner.png +0 -0
  5. package/assets/palettes.gif +0 -0
  6. package/docs/architecture.md +172 -0
  7. package/docs/configuration.md +103 -0
  8. package/docs/palette-design.md +51 -0
  9. package/docs/theme-motion.md +88 -0
  10. package/package.json +68 -4
  11. package/src/avatar.ts +174 -0
  12. package/src/background.ts +82 -0
  13. package/src/config.ts +400 -0
  14. package/src/diff-spans.ts +77 -0
  15. package/src/draft.ts +10 -0
  16. package/src/editor.ts +545 -0
  17. package/src/format.ts +464 -0
  18. package/src/frame.ts +380 -0
  19. package/src/git-status-cache.ts +198 -0
  20. package/src/git-status-reader.ts +28 -0
  21. package/src/git-status.ts +72 -0
  22. package/src/header-controller.ts +58 -0
  23. package/src/header.ts +151 -0
  24. package/src/index.ts +1264 -0
  25. package/src/quota.ts +581 -0
  26. package/src/redraw-guard.ts +79 -0
  27. package/src/run-summary.ts +623 -0
  28. package/src/spinner.ts +72 -0
  29. package/src/status-style.ts +26 -0
  30. package/src/terminal-title.ts +67 -0
  31. package/src/tool-activity.ts +216 -0
  32. package/src/tool-adapter.ts +491 -0
  33. package/src/tool-groups.ts +192 -0
  34. package/src/tool-lexicon.ts +200 -0
  35. package/src/tool-view.ts +788 -0
  36. package/src/width.ts +246 -0
  37. package/themes/1337-amber.json +94 -0
  38. package/themes/1337-amber.pi1337 +3 -0
  39. package/themes/1337-cosmos.json +94 -0
  40. package/themes/1337-cosmos.pi1337 +3 -0
  41. package/themes/1337-cyber.json +94 -0
  42. package/themes/1337-cyber.pi1337 +3 -0
  43. package/themes/1337-cyberpunk-2077-edgerunner.json +94 -0
  44. package/themes/1337-cyberpunk-2077-edgerunner.pi1337 +7 -0
  45. package/themes/1337-cyberpunk-2077.json +94 -0
  46. package/themes/1337-cyberpunk-2077.pi1337 +7 -0
  47. package/themes/1337-fallout.json +94 -0
  48. package/themes/1337-fallout.pi1337 +4 -0
  49. package/themes/1337-ice.json +94 -0
  50. package/themes/1337-ice.pi1337 +3 -0
  51. package/themes/1337-magma.json +94 -0
  52. package/themes/1337-magma.pi1337 +1 -0
  53. package/themes/1337-neon.json +94 -0
  54. package/themes/1337-neon.pi1337 +3 -0
  55. package/themes/1337-poison.json +94 -0
  56. package/themes/1337-poison.pi1337 +3 -0
  57. package/themes/1337-skynet-dark.json +94 -0
  58. package/themes/1337-skynet-dark.pi1337 +4 -0
  59. package/themes/1337-skynet.json +94 -0
  60. package/themes/1337-skynet.pi1337 +4 -0
  61. package/themes/1337.json +95 -0
  62. package/themes/1337.pi1337 +3 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,263 @@
1
+ # Changelog
2
+
3
+ ## [0.6.0] - 2026-11-29
4
+
5
+ - Refresh the framed prompt and its draft estimate when Pi completes a unique Tab suggestion asynchronously. Restore mouse positioning after resizing through the bare editor layout.
6
+ - Brighten the shared Skynet spinner for readability on both HUD palettes.
7
+ - Preserve a footer installed after 1337 when toggling the redesign or yielding the editor to another extension.
8
+ - Add a segmented status row with palette-colored text and thin chevrons on the terminal background. The `classic` setting keeps the dotted row.
9
+ - Add a compact palette-aware startup header and cached read-only Git change counters.
10
+ - Add an opt-in approximate long-draft token label using Pi's estimator and expanded pasted text.
11
+ - Pin both Pi development packages to 1.7.0.
12
+
13
+ ## [0.5.1] - 2026-11-18
14
+
15
+ - Publish to npm as `@aeondave/pi-theme-1337`: install with
16
+ `pi install npm:@aeondave/pi-theme-1337`. The Git source keeps working.
17
+ - Replace the banner with real Pi sessions in three palettes above a strip of all thirteen, and add
18
+ an animation that shows one session in every palette. The README opens with install and a short
19
+ summary; the full feature list is one click away.
20
+ - `npm run test:parity` measures against the installed development `pi-tui` by default instead of
21
+ needing a `../pi` checkout, which failed outright when that checkout had no dependencies.
22
+ - Run typecheck, tests, the parity sweep and the dependency audit in CI on Linux, macOS and
23
+ Windows, with Dependabot keeping the two Pi development packages aligned.
24
+
25
+ ## [0.5.0] - 2026-11-17
26
+
27
+ - Add Cosmos (`1337-cosmos`, alias `cosmos`): starlit mauve text and pastel
28
+ syntax on indigo-black with a star-gold accent and a twinkling-star spinner,
29
+ bringing the collection to thirteen palettes. Its colors come from
30
+ pi-starline's Catppuccin Mocha swatches.
31
+ - Name a long-running tool in the status row: once a call has run for half a
32
+ second, `Running npm test…` takes the workspace segment's place (` +2` when
33
+ other calls run beside it) and leaves when the call ends. After three seconds
34
+ it also carries the elapsed time (`Running npm test… 14s`). The right group
35
+ never moves for it, and fast calls never flash.
36
+ `PI_1337_ACTIVITY=off` (config `activity:false`) hides it.
37
+ - Fold settled exploration: three or more consecutive `read`/`grep`/`find`/`ls`
38
+ rows become one tally row (`● Read 3 files, searched 2 patterns (ctrl+o to
39
+ expand)`) as soon as the third one settles; the tally stays in place and counts
40
+ up while the run goes on. It counts distinct files and patterns, not calls.
41
+ Click the tally to bring
42
+ that run back, or press the expand key to show every row. Failed calls,
43
+ results with images, `bash`, `edit`, `write` and custom tools always keep
44
+ their own rows, and a thinking row ends a run, so only rows that were truly
45
+ adjacent fold. `PI_1337_GROUPS=off` (config `groups:false`) keeps one row per
46
+ call.
47
+ - Quieter tool rows: the title leads while the duration and expand hint recede;
48
+ durations read `4.2s` and are omitted under one second; running output drops
49
+ its `Running:` prefix; short errors lose the lone hint line; write previews
50
+ read `Wrote N lines` with the same number gutter as edits.
51
+ - Running and failed commands preview their newest lines instead of their
52
+ first ones, so a long test run visibly progresses and a failure shows the
53
+ error and exit status; earlier output is announced above them. `npm run`
54
+ output no longer spends a preview row on its leading blank line.
55
+ - Tool rows cost what Pi's own rows cost: the row shell and its clipped lines
56
+ are reused across frames. A 500-row session rendered a frame in 17 ms with the
57
+ theme on and 89 ms with it toggled off; both are now about 1 ms.
58
+ - Keep Pi's theme when it is light: every bundled palette is dark, so the
59
+ package now applies only the framed editor, status row and tool rows there.
60
+ `PI_1337_THEME=<palette>` (or `on`) still forces a palette.
61
+ - Replace unpaired UTF-16 surrogates in labels and tool output with `U+FFFD`
62
+ before measuring: they measured zero columns but painted one, so a row could
63
+ run past the terminal edge.
64
+ - Qualify development dependencies and test fixtures against Pi 1.5.2, and drop
65
+ the root `undici` override: 1.5.2 already depends on 8.12.3, which the
66
+ override would have downgraded.
67
+ - Quiet tool rows say what they found: `· 6 matches`, `· no matches`,
68
+ `· 12 entries`, `· 40 lines`. Read rows show their line range, multi-line
69
+ bash commands show their first line, and a folded run names its files when
70
+ they fit (`Read width.ts, frame.ts · searched 2 patterns`).
71
+ - Move the model identity into the top border, top-right: `provider/model ·
72
+ level`, with a reasoning model's thinking level in the palette's thinking
73
+ color, narrowing to `model · level` and then `model`. The bottom border stays
74
+ plain.
75
+ - Rebuild the status row as two groups: where you are on the left, the
76
+ session's state on the right (`[▰▱▱▱▱] 136.9k/1M · 13% · ~$48.89 +$1.24 ·
77
+ persona`). Decorations go first (the run's spend, then the window, then the
78
+ gauge, which no longer needs a 90-column row), then path detail, then cost
79
+ and tokens; the
80
+ context percentage stays to the end. It reads the same without pi-persona.
81
+ - Show the context window as a denominator (`/200k`, `/1M`) and the current
82
+ run's spend (`+$1.24`), kept after the run settles until the next one.
83
+ - Cost fixes: `0.9996` reads `~$1.00`, a tiny positive total reads `~<$0.001`,
84
+ and a background agent's spend that lands while Pi is idle now updates the
85
+ row. The total itself was verified against Pi's own footer sum.
86
+ - Remove the agent count from the status row: it counted agents only, also
87
+ queued ones, and repeated pi-persona's own widget.
88
+ - Add an end-of-run summary row: duration, files edited with exact +/− lines,
89
+ files written, commands and failures, and the run's estimated cost. Expanded,
90
+ it lists each file. It is stored once as a custom session entry that never
91
+ reaches the model. `PI_1337_SUMMARY=off` (config `summary:false`) turns it off.
92
+ - Show what Pi is doing in the terminal title (a named call, working, waiting
93
+ for you, done, failed) and return to Pi's own title at rest, on toggle-off
94
+ and on exit. `PI_1337_TITLE=off` (config `title:false`) leaves it alone.
95
+ - Draw other extensions' tool rows in the flat frame: a tool with its own
96
+ `renderCall` and `renderResult` now shows one status dot before its call
97
+ lines and its result under `└`, with no background box. The lines are the
98
+ renderer's own — never rewritten, wrapped or sanitized; one too wide is
99
+ clipped — and its hooks still run once per update with Pi's own row state.
100
+ `/theme-1337` off returns existing rows to Pi's box. Renderers that declare
101
+ `renderShell: "self"` or define only one of the two hooks, results with
102
+ images and image-protocol output stay in Pi's box, and these rows never
103
+ fold. So does a row whose renderer returned a line that is not a string
104
+ (`[undefined, "x"]`): Pi's box paints it as Pi always did.
105
+ - Show a running command's timeout as stock Pi does: `● $ npm test (timeout
106
+ 30s)` while the command is pending or running, as one dim rung that is the
107
+ first to go on a narrow row and leaves with the final result. Only a
108
+ finite, positive number of seconds Pi's shell would accept is printed.
109
+ - An empty third-party row (no line in either slot) takes no line, with the
110
+ redesign on or off. Off, that is one blank row less than stock Pi, which
111
+ prints a separator above its empty box; rows with blank lines or one empty
112
+ slot match Pi exactly.
113
+ - Show a run clock in the status row: when no tool is named and the run has
114
+ lasted three seconds, `Working… 45s` takes the workspace segment's place. It
115
+ counts from the run's start across retries and follow-ups, hides during
116
+ prompts and compaction, moves nothing on the right and adds no timer.
117
+ `PI_1337_ACTIVITY=off` hides it with the tool label.
118
+ - Say when background work is still running: if pi-persona reports agents,
119
+ monitors, timers or scripts when a run settles, the summary row reads
120
+ `● Turn ended in 9.0s · 7 tool calls · ~$0.08 · waiting on 3 agents, 1
121
+ monitor` with a muted dot instead of `Done`, narrowing to `waiting on 4
122
+ background tasks`, and the terminal title reads `◌ Waiting on 3 agents — …`
123
+ until the work ends, then `✓ Done`. Nothing about it enters the status row.
124
+ - Show where a run's time went on the expanded summary row: `model 1m 32s ·
125
+ tools 42s · 48 tok/s`. `tools` is the run's time not spent waiting on the
126
+ model, so it includes retry back-off, compaction and prompts. The line is
127
+ shown whole or not at all: on a row too narrow for `model 1m 32s` it takes
128
+ no line. Summary rows written earlier are unchanged.
129
+ - Show thinking time on the same line, as part of the model time: `model 1m
130
+ 32s (40s thinking) · tools 42s · 48 tok/s`. It is measured from the stream's
131
+ own thinking events, shown from one second up, and goes after the rate and
132
+ before the tools time when the row narrows.
133
+ - Fix the status row clipping the branch to a stub (`…/proj · m…`,
134
+ `/…/src/pi-1337 · fe…`). The left group now gives up whole details: the
135
+ session name, then the branch, then the path down to its last folder. A
136
+ branch is shown whole or not at all; a long session name may shorten, to no
137
+ fewer than nine characters and `…`. The activity label likewise shortens to
138
+ no fewer than seven characters and `…`, and below that the workspace stays.
139
+ - Keep context and cost current inside a turn: when a tool call starts, the
140
+ row shows the tokens and spend of the response that launched it instead of
141
+ the figures from before it.
142
+ - Follow `!!` in the editor: the prompt marker stays `$` and turns dim, as Pi
143
+ paints a command whose output is kept out of the model's context.
144
+ - Share the editor slot with other extensions: `/theme-1337` off restores an
145
+ editor another extension had installed before this one, and leaves in place
146
+ one installed after it. It used to reset the slot to Pi's own editor either
147
+ way. When another extension installs its editor over the frame while the
148
+ redesign is on, Pi's footer and working row come back, so the workspace,
149
+ model, context, cost and spinner stay visible; the frame returns at the next
150
+ `/theme-1337` or session start.
151
+ - Show subscription quota in the status row, between the cost and the
152
+ persona: `5h 43% · wk 12%` (percent used of the five-hour and weekly
153
+ windows), `wk 85%` when one window is known, `limit` once the usage limit is
154
+ reached. The percentage warns above 70% and turns to the error color above
155
+ 90%; above 70% it stays while the row narrows, and a calm one is a
156
+ decoration that goes after the gauge. It is read only from what the
157
+ provider sends with a response — no request is made for it — so it appears
158
+ after the first response and shows nothing for providers that report
159
+ nothing. Seen on live accounts: Anthropic's subscription headers (weekly
160
+ window) and OpenAI's usage-limit error on a ChatGPT login. Implemented from
161
+ the published Codex client format, not yet seen live: the Codex headers and
162
+ stream event, and Anthropic's five-hour window. `PI_1337_QUOTA=off` (config
163
+ `quota:false`) turns it off.
164
+ - Fix a crash when expanding a built-in tool row whose arguments cannot be
165
+ serialized (a BigInt or a circular value): the row now shows `[unavailable
166
+ arguments]`.
167
+ - A summary row's failure count names what failed once the total is dropped
168
+ (`1 command failed`, `2 calls failed`); a row with no commands reads
169
+ `wrote 2 files · 1 call failed`.
170
+ - Add `PI_1337_MAX_WIDTH` (config `maxWidth`): the framed box's width cap,
171
+ default 100, `0` or `full` for none.
172
+ - Fix workspace labels directly under home (`~/src/project`, not
173
+ `~/…/src/project`) and reword the toggle notice to `pi-theme-1337 on/off`.
174
+ - Ship `CHANGELOG.md` in the package so Pi can show update notes.
175
+ - Add `npm run preview`, which renders a sample session and the framed editor in
176
+ any bundled palette without launching Pi.
177
+
178
+ ## [0.4.2] - 2026-11-12
179
+
180
+ - Rename the package to `pi-theme-1337` and the command to `/theme-1337`;
181
+ remove the old `/pi-1337` command.
182
+
183
+ ## [0.4.1] - 2026-11-12
184
+
185
+ - Qualify development dependencies and test fixtures against Pi 1.5.1.
186
+ - Describe the full variety of palettes in the README.
187
+ - Emphasize separate changed spans in recorded edit diffs while preserving common
188
+ text between edits, Unicode graphemes, semantic colors and narrow-width layout.
189
+ - Pair replacements within contiguous change groups after line-number shifts;
190
+ keep uneven, clipped or over-budget groups as full-line colored previews.
191
+
192
+ ## [0.4.0] - 2026-10-25
193
+
194
+ ### Themes
195
+
196
+ - Add Cyberpunk 2077: dominant neon yellow on black with azure accents.
197
+ - Add Cyberpunk 2077 Edgerunner: burgundy-black surfaces, reddish text,
198
+ yellow titles, and cyan accents.
199
+ - Add Magma and Skynet Dark, bringing the collection to twelve palettes.
200
+ - Rename Split to Poison. Update an explicit `split` / `1337-split` setting to
201
+ `poison` / `1337-poison`.
202
+ - Refine the default palette toward 1985 green phosphor with amber accents;
203
+ distinguish Poison's emerald and orchid, and strengthen Cyber and Neon.
204
+ - Rework Skynet around Terminator 2's warm-white diagnostic HUD and crimson
205
+ accents; Skynet Dark keeps the red-on-near-black direction.
206
+
207
+ ### Fixes
208
+
209
+ - Preserve a bundled palette chosen through `/settings` across `/reload`, even
210
+ when `config.json` contains an older startup theme. An explicit
211
+ `PI_1337_THEME` palette still takes precedence.
212
+
213
+ ### Documentation
214
+
215
+ - Refresh the README with a palette banner, faster setup, and a concise theme
216
+ catalog; move configuration and architecture details into dedicated docs.
217
+ - Document palette references, contrast measurements, and motion profiles.
218
+
219
+ ### Development
220
+
221
+ - Override Pi 1.4.0's Undici dependency to patched 8.12.2 in the repository's
222
+ development install. Pi package pins stay matched at 1.4.0; this does not
223
+ update the user's installed Pi host.
224
+
225
+ ## [0.3.0] - 2026-10-23
226
+
227
+ - Target Pi 1.4.0 with compact tool views, expandable output, and theme-aware
228
+ diff previews that preserve execution and custom renderers.
229
+ - Add distinct status-row color roles, a space-aware context gauge, and
230
+ API-equivalent cost estimates.
231
+ - Refresh eight palettes and add validated per-theme text spinner profiles,
232
+ including Skynet's two-row crimson pyramid.
233
+ - Remove bundled PNG avatars while retaining optional user-configured avatars.
234
+ - Improve renderer caching, toggle restoration, and HTML-export state handling.
235
+
236
+ ## [0.2.0] - 2026-10-20
237
+
238
+ - Update to Pi 1.3 and improve narrow status rows, activity settlement,
239
+ compaction recovery, usage accounting, and mouse-cache behavior.
240
+ - Correct avatar fallback geometry and raise unchanged diff-text contrast.
241
+ - Keep RPC, JSON, and print modes free of presentation side effects.
242
+
243
+ ## [0.1.2] - 2026-10-02
244
+
245
+ - Update to Pi 1.0, correct autocomplete and mouse positioning, and improve
246
+ Kitty avatar centering.
247
+ - Move theme options into `.pi1337` sidecars and add optional config-file
248
+ settings with environment overrides.
249
+
250
+ ## [0.1.1] - 2026-09-16
251
+
252
+ ### Performance
253
+
254
+ - Cache unchanged editor layout during spinner-only redraws while preserving
255
+ invalidation for input, text, padding, resize, autocomplete, and mouse input.
256
+ - Coalesce out-of-band stderr repair redraws into a bounded 16 ms frame window,
257
+ including asynchronous write bursts.
258
+
259
+ ### Documentation and tests
260
+
261
+ - Document the editor cache and redraw guard behavior.
262
+ - Add regression coverage for editor layout reuse, coordinate translation, and
263
+ asynchronous redraw coalescing.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 pi-1337 contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,167 @@
1
- # Temporary Holding Version
1
+ <p align="center">
2
+ <img src="assets/banner.png" alt="pi-theme-1337: the same Pi session in the phosphor, neon and cyberpunk palettes, above a strip of all thirteen palettes">
3
+ </p>
2
4
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
5
+ <h3 align="center">Thirteen dark palettes and a framed terminal editor for Pi.</h3>
6
+
7
+ <p align="center">
8
+ CRT, cyberpunk, synthwave and HUD-inspired palettes, with an extension that moves the editor<br>
9
+ and the session status you actually read into one centered frame.
10
+ </p>
11
+
12
+ <p align="center">
13
+ <a href="#install">Install</a> ·
14
+ <a href="#what-it-adds">What it adds</a> ·
15
+ <a href="#palettes">Palettes</a> ·
16
+ <a href="#use">Use</a>
17
+ </p>
18
+
19
+ ![One Pi session shown in each of the thirteen palettes in turn: phosphor, amber, ice, cyber, cyberpunk, edgerunner, neon, cosmos, poison, magma, fallout, skynet and skynet-dark.](assets/palettes.gif)
20
+
21
+ <sub>Banner and animation are real Pi sessions running this package, each on its palette's own
22
+ background (`PI_1337_BG=on`); the model's replies are scripted.</sub>
23
+
24
+ ## Install
25
+
26
+ ```bash
27
+ pi install npm:@aeondave/pi-theme-1337
28
+ ```
29
+
30
+ Then pick a palette in `/settings`. To install from Git instead, use
31
+ `pi install git:github.com/AeonDave/pi-theme-1337`; from a local clone, `pi install .` in the
32
+ repository directory.
33
+
34
+ Requires Pi and Node.js 22.19 or later.
35
+
36
+ ## What it adds
37
+
38
+ - **A framed editor.** The top border shows the model and thinking level. The status row shows the
39
+ workspace, branch, context use, cost and subscription quota. Next to the branch, `+1 › ~2 › ?1`
40
+ means one staged entry, two modified entries and one untracked entry.
41
+ - **A status row that tells you what is running.** A long tool call is named in place
42
+ (`Running npm test… 14s`) without moving the rest of the row.
43
+ - **A compact transcript.** One row per tool call, exploration runs folded into a tally, edit
44
+ previews with the changed spans emphasised, and errors visible while collapsed.
45
+ - **An end-of-run summary** (`● Done in 2m 14s · edited 3 files +42 −7 · 6 commands, 1 failed`) and
46
+ a terminal title that shows the run state.
47
+ - **Thirteen palettes**, selectable in `/settings` and kept across restarts.
48
+ - **Reversible.** `/theme-1337` turns the redesign off and gives Pi's own chrome back.
49
+
50
+ The extension changes presentation only: Pi's editor behavior, tool execution and prompts stay as
51
+ they are, and other extensions' tool renderers keep their content.
52
+
53
+ <details>
54
+ <summary>Every detail</summary>
55
+
56
+ - A segmented status row with palette-colored text and thin chevrons on the terminal background. Set `PI_1337_STATUS_STYLE=classic` for the dotted style.
57
+ - A compact startup header with the active palette and workspace, plus `/settings` and `/theme-1337` hints. `PI_1337_HEADER=off` keeps Pi's header.
58
+ - Cached Git change counts beside the branch: staged, modified, untracked and conflicted. They refresh after potentially mutating tools, at settlement and on branch changes; `PI_1337_GIT_STATUS=off` disables Git probes.
59
+ - An optional approximate draft-size label for long prompts: `PI_1337_DRAFT_TOKENS=on`. It includes expanded pasted text and stays separate from the session's context usage.
60
+ - A centered, rounded editor with a prompt marker and activity spinner, the model and thinking level in its top border (`openai/gpt-6.1-sol · xhigh`), and a status row: workspace, branch and session on the left; context usage against its window, estimated cost, the current run's spend and the persona on the right (`[▰▱▱▱▱] 136.9k/1M · 13% · ~$48.89 +$1.24 · 💻 Dev`).
61
+ - A status row that names a long-running tool (`Running npm test…`) in the workspace segment's place, without reflowing the rest of the row. When no tool is named, a run that has lasted three seconds shows its clock there instead: `Working… 45s`.
62
+ - A row that narrows by meaning: decorations go first, then path detail, and the context percentage stays visible to the end. The left group gives up whole details — the session name, then the branch, then the path down to its last folder — so a branch is shown whole or not at all, never as `fe…`.
63
+ - Subscription quota in the status row, between the cost and the persona, when the provider reports it: `5h 43% · wk 12%` (percent used of the five-hour and weekly windows), `wk 85%` for one window, or `limit` once the usage limit is reached. It turns to the warning color above 70% and the error color above 90%, and a figure above 70% stays visible while the rest of the row narrows. It comes only from what the provider already sends with each response — the package makes no request of its own — so it appears after the first response and shows nothing for providers that report nothing. Seen on live accounts: Anthropic's subscription headers (the weekly window) and OpenAI's usage-limit error on a ChatGPT login. Read from the published Codex client format but not yet seen live: the Codex headers and stream event, and Anthropic's five-hour window. `PI_1337_QUOTA=off` turns it off.
64
+ - A prompt marker that follows Pi's bash mode: `$` for `!command`, and a dim `$` for `!!command`, whose output stays out of the model's context.
65
+ - An end-of-run summary row in the transcript: `● Done in 2m 14s · edited 3 files +42 −7 · wrote 1 file · 6 commands, 1 failed · ~$1.24`. Expand tools (ctrl+o) to list each file and see where the time went (`model 1m 32s (40s thinking) · tools 42s · 48 tok/s`; thinking is part of the model time, and `tools` is everything that was not waiting on the model). A run that is retried or continued counts as one run. When pi-persona still has background work running, the row reads `● Turn ended in 9.0s · 7 tool calls · ~$0.08 · waiting on 3 agents, 1 timer` instead of `Done`. It is stored as a custom session entry that never reaches the model; changes made by shell commands are not counted.
66
+ - A terminal title that shows the run state (`● Running npm test… — repo`, `? Waiting for you`, `✓ Done`) and Pi's own title at rest. After a clean run it reads `◌ Waiting on 3 agents` until pi-persona's background work ends.
67
+ - Thirteen Pi themes that you can choose in `/settings`; Pi keeps the selected bundled theme across restarts. All thirteen are dark: when Pi is on a light theme the package keeps it and applies only the framed editor, status row and tool rows. Set `PI_1337_THEME=<palette>` (or `on` for the default green) to force a palette anyway.
68
+ - Compact tool transcript rows and theme-aware edit previews, with errors visible while collapsed. Quiet rows end with what they found (`· 6 matches`, `· no matches`, `· 40 lines`) and running or failed commands show their newest lines. A running command also names the timeout it was given (`● $ npm test (timeout 30s)`). Runs of settled reads and searches fold into one tally row — `● Read width.ts, frame.ts · searched 2 patterns`, or `● Read 12 files` when the names do not fit — until you click it or press the expand key.
69
+ - Rows from other extensions' tool renderers in the same flat frame: one status dot before the call, the result under `└`, no background box. Their lines are the renderer's own, unchanged; `/theme-1337` off returns them to Pi's box.
70
+ - A reversible `/theme-1337` toggle and a clean-buffer copy shortcut (`alt+c` by default). Toggling off restores the previous editor while 1337 owns the frame. If another extension replaces the frame, its editor and any footer it installs keep their places. Pi's working indicator returns.
71
+
72
+ </details>
73
+
74
+ The extension changes presentation only. It leaves Pi's editor behavior, tool execution and prompts in place, and third-party custom tool renderers keep their content: only the frame around their lines changes.
75
+ When pi-persona is installed, the frame shows its persona and includes its child agents' spend in the cost, and the summary row and terminal title say when its background work is still running; the two packages work independently, and the frame is complete without it.
76
+
77
+ Edit previews use Pi's recorded diff, with separate changed spans emphasized inside
78
+ paired replacement lines. Collapsed previews show up to 16 rows; expand for the full
79
+ diff. Uneven change groups and large lines keep line colors without span emphasis.
80
+ Write previews show submitted file content.
81
+
82
+ Folding covers three or more consecutive `read`, `grep`, `find`, and `ls` rows
83
+ with nothing painted between them. Failed calls, results with image attachments,
84
+ `bash`, `edit`, `write`, and custom tools always keep their own rows. Both the
85
+ fold and the status label are fed by Pi's tool and message events alone — no
86
+ execution, schema, or prompt changes — and `PI_1337_GROUPS` / `PI_1337_ACTIVITY`
87
+ turn them off.
88
+
89
+ ## Palettes
90
+
91
+ | Theme | Character |
92
+ | --- | --- |
93
+ | `1337` | Yellow-green phosphor with amber UI accents. |
94
+ | `1337-amber` | Bright amber CRT with cream-gold accents. |
95
+ | `1337-ice` | Cool cyan-blue phosphor. |
96
+ | `1337-cyber` | Indigo surfaces, periwinkle text, and electric cyan. |
97
+ | `1337-cyberpunk-2077` | Neon yellow and cyan-blue on black. |
98
+ | `1337-cyberpunk-2077-edgerunner` | Muted red, yellow titles, and cyan on burgundy-black. |
99
+ | `1337-neon` | Synthwave violet, hot pink, and cyan. |
100
+ | `1337-cosmos` | Starlit mauve and pastel syntax on indigo-black, with a star-gold accent. |
101
+ | `1337-poison` | Emerald green with orchid and cyan accents. |
102
+ | `1337-magma` | Molten coral-orange with crisp cyan accents. |
103
+ | `1337-fallout` | Yellow-lime Pip-Boy phosphor. |
104
+ | `1337-skynet` | Warm-white HUD with red accents on tinted black. |
105
+ | `1337-skynet-dark` | Red-on-near-black Skynet palette. |
106
+
107
+ All palettes share Pi's 51-token theme contract. See [palette design](docs/palette-design.md) for color references and contrast rules.
108
+
109
+ ## Use
110
+
111
+ - Choose `1337` or any `1337-*` palette in `/settings`. The choice persists across restarts and `/reload`.
112
+ - Run `/theme-1337` to turn the editor redesign off or on.
113
+ - Press `alt+c` to copy the editor's logical text without frame characters or added row breaks.
114
+
115
+ `PI_1337_THEME` can explicitly pin a palette, for example `PI_1337_THEME=cyber`. Use `PI_1337_THEME=off` to keep Pi's current theme while using the framed editor.
116
+
117
+ To use the thirteen palettes with another editor or footer, start Pi with `PI_1337_DISABLE=1` and choose a palette in `/settings`. The theme files load independently of the 1337 extension.
118
+
119
+ ## Essential settings
120
+
121
+ Settings can go in `~/.pi/agent/1337-theme/config.json`; `PI_CODING_AGENT_DIR` changes Pi's agent directory. Environment variables override matching file settings.
122
+
123
+ ```json
124
+ {
125
+ "copyKey": "alt+c",
126
+ "polish": true
127
+ }
128
+ ```
129
+
130
+ | Variable | Purpose |
131
+ | --- | --- |
132
+ | `PI_1337_THEME` | Select or pin a palette; `off` keeps the current Pi theme. |
133
+ | `PI_1337_COPY_KEY` | Change the clean-copy key; set it empty to disable the shortcut. |
134
+ | `PI_1337_MAX_WIDTH` | Widest framed editor box in columns (default 100); `0` or `full` removes the cap. |
135
+ | `PI_1337_SUMMARY=off` | Write no end-of-run summary rows and hide existing ones. |
136
+ | `PI_1337_TITLE=off` | Leave the terminal title alone. |
137
+ | `PI_1337_QUOTA=off` | Show no subscription quota in the status row and read no response headers for it. |
138
+ | `PI_1337_POLISH=off` | Keep Pi's standard tool transcript renderers. |
139
+ | `PI_1337_ACTIVITY=off` | Stop naming long-running tools in the status row. |
140
+ | `PI_1337_GROUPS=off` | Keep one transcript row per tool call (no folding). |
141
+ | `PI_1337_BG` | Control optional terminal background tint (`on`, `off`, or a hex color). |
142
+ | `PI_1337_DISABLE` | Disable the extension. |
143
+
144
+ See [configuration](docs/configuration.md) for precedence, all options, theme sidecars, and optional avatars.
145
+
146
+ ## Related docs
147
+
148
+ - [Theme motion profiles](docs/theme-motion.md)
149
+ - [Architecture and rendering](docs/architecture.md)
150
+
151
+ ## Development
152
+
153
+ ```bash
154
+ npm install --ignore-scripts
155
+ npm run typecheck
156
+ npm test
157
+ npm run test:parity
158
+ npm run preview
159
+ ```
160
+
161
+ `npm run preview` renders a sample session (tool rows, a folded run, a failure, a diff and the framed editor) in a bundled palette, using the package's real renderers in truecolor. Name palettes as arguments or pass `--all`; `--width N` sets the width and `--plain` strips color for diffing. It never changes your terminal. Bold spans need a real terminal: when piping, run it as `FORCE_COLOR=3 npm run preview`.
162
+
163
+ Development packages are pinned to Pi 1.7.0; wildcard peer dependencies do not promise compatibility with older hosts. The parity sweep measures against the installed development `pi-tui`; set `PI_TUI` to another `pi-tui/dist/index.js` to check the bundle you run.
164
+
165
+ ## License
166
+
167
+ MIT
Binary file
Binary file
@@ -0,0 +1,172 @@
1
+ # Architecture
2
+
3
+ pi-1337 is a Pi package with two parts: thirteen color-only theme files and an extension that presents Pi's editor and tool transcript in a phosphor-style interface. The theme files remain valid Pi palettes; extension-only settings live in adjacent `.pi1337` sidecars.
4
+
5
+ ## Boundaries
6
+
7
+ ```text
8
+ Pi theme JSON ───────────────> Pi theme system
9
+ Pi extension API ─> index.ts ─> editor.ts ─> frame.ts
10
+ └──> tool renderers
11
+ ```
12
+
13
+ `index.ts` owns Pi events, UI changes, and configuration reads. `editor.ts` and the tool adapters connect host components to the presentation code. Pure modules format or lay out data without owning Pi UI state.
14
+
15
+ | Area | Responsibility |
16
+ | --- | --- |
17
+ | `themes/*.json` | Color tokens for each palette. |
18
+ | `src/index.ts` | Extension lifecycle, commands, theme switching, config, and spinner lifecycle. |
19
+ | `src/editor.ts` | Custom editor wrapper that preserves Pi's editing and input behavior. |
20
+ | `src/frame.ts` | Pure frame construction, status layout, and narrow-width degradation. |
21
+ | `src/status-style.ts`, `src/draft.ts` | Pure status styling and approximate draft-label helpers. |
22
+ | `src/header.ts`, `src/header-controller.ts` | Pure compact header layout and public header-slot lifecycle. |
23
+ | `src/git-status.ts` | Pure porcelain parser; never exposes filenames. |
24
+ | `src/git-status-cache.ts`, `src/git-status-reader.ts` | Event-driven cache with stale-result guards, and bounded/cancellable Pi execution. |
25
+ | `src/format.ts` | Pure sanitizers and label, context, cost and run-delta formatting. |
26
+ | `src/tool-activity.ts` | Pure status-row label naming a long-running tool call, and the run clock. |
27
+ | `src/run-summary.ts` | Pure per-run collector and the end-of-run transcript row. |
28
+ | `src/terminal-title.ts` | Pure terminal-title text for each run state. |
29
+ | `src/width.ts` | Shared width measurement seam used by render modules. |
30
+ | `src/tool-view.ts`, `src/tool-adapter.ts` | Compact presentation for tool calls, results, and diffs. |
31
+ | `src/tool-lexicon.ts` | The one vocabulary for built-in tools: row title, status verb, tally clause. |
32
+ | `src/tool-groups.ts` | Pure registry folding runs of settled exploration rows into one tally row. |
33
+ | `src/diff-spans.ts` | Bounded comparison of sanitized replacement bodies. |
34
+ | `src/avatar.ts`, `src/background.ts`, `src/spinner.ts` | Pure parsing/layout and value helpers for optional presentation settings. |
35
+ | `src/redraw-guard.ts` | Pass-through stderr observation and coalesced redraw repair while active. |
36
+
37
+ ## Editor rendering
38
+
39
+ The editor wrapper asks Pi's base editor to render at the space available inside the frame. A pure formatter removes the host's top and bottom rules, adds the rounded outline and side gutters, then centers the result. The prompt marker and spinner occupy reserved gutters; a status row appears inside the bottom edge when autocomplete is closed.
40
+
41
+ The wrapper leaves editing, cursor handling, autocomplete, history, and keybindings to Pi. It uses Pi TUI's exported width functions so the measured frame matches the renderer that paints it. A dependency-free width fallback supports pure module tests.
42
+
43
+ Status values are captured from Pi and extension status sources outside the render path, then formatted into the editor frame. The model identity sits in the top border's right end (`provider/model · level`, narrowing to `model · level` and then `model`). The status row has two groups — where you are on the left, the session's state on the right — and gives up space by meaning: the run's spend, the window denominator, the second quota window, the gauge and a calm quota first, then path detail and the session name, then cost, token count, persona and a quota above 70% (or `limit`), with the context percentage last. The left group gives up whole details, in the order session name, branch, path down to `…/basename`: a branch is an identifier and is shown whole or not at all, while a session name, being free text, may shorten to no fewer than ten columns (nine characters and `…`) before it goes. The activity label that borrows these cells shortens to no fewer than eight columns; with fewer, the workspace keeps its place. Context usage and cost are refreshed on agent, turn and session events, and once more when the first top-level tool call of a response starts: Pi has appended that response to the session by then, so a long call shows current figures. The prompt marker reads the buffer as Pi does: `!` makes it a `bashMode`-colored `$`, `!!` a `dim` one, because that command's output is kept out of the model's context.
44
+
45
+ ## Subscription quota
46
+
47
+ Between the cost and the persona the status row shows the current provider's subscription quota, as percent used: `5h 43% · wk 12%`, `wk 85%` when one window is known, or `limit` once the usage limit is reached. The pure module `src/quota.ts` builds it from three things Pi already hands extensions; the extension makes no request, reads no credential and starts no timer for it.
48
+
49
+ | Source (Pi event) | What is read | Status |
50
+ | --- | --- | --- |
51
+ | Response headers (`after_provider_response`), `anthropic-messages` | `anthropic-ratelimit-unified-{5h,7d}-utilization` (a fraction) and `-reset` (epoch seconds) | Observed on a live subscription; those responses carried the weekly window only. |
52
+ | Assistant message that ended in an error (`message_end`) | `errorMessage` containing the phrase `usage limit` | Observed on OpenAI's ChatGPT login, where it is the only signal: the response is a 200 with no quota headers. |
53
+ | Response headers, `openai-responses` and `openai-codex-responses` | `x-codex-{primary,secondary}-used-percent` (a percent), `-window-minutes`, `-reset-at`, `-reset-after-seconds` | Implemented from the official client's format; not yet seen live. |
54
+ | Raw stream event (`provider_stream_event`), `openai-codex-responses` | `codex.rate_limits` → `rate_limits.primary` / `.secondary` (`used_percent`, `window_minutes`, `reset_at`, `reset_after_seconds`) | Implemented from the shape Pi's own Codex stream test replays; not yet seen live. |
55
+
56
+ Other apis are not read, so providers that report nothing (z.ai, OpenRouter and other `openai-completions` routes) show nothing. The family is chosen by the model's api and only that family's exact header names count. Values must be strict numbers; nothing from a header, an event or an error message is printed — labels come from a canonical duration, and a declared length such as 299 or 10079 minutes snaps to the whole hour or day it lies within 5% of.
57
+
58
+ State is kept per provider, so switching model away and back keeps the figures. A response usually carries a subset of the windows, so each window is kept on its own with the time it was last seen: it leaves when its reset passes or, without a believable reset, thirty minutes after it was last seen. A figure older than thirty minutes is drawn dim while it is calm. Two successful responses in a row with no quota header drop everything known about that provider (the account or its auth changed). `limit` stays until that provider's next assistant message that is an answer; another error or an interrupted attempt leaves it. A response is credited to the model its turn started with, so switching model while a request is in flight does not move one account's figures onto another.
59
+
60
+ The view is rebuilt on events — a response, a message's end, a model or session change, a run or turn boundary — and cached; rendering only reads the cache, so an expired window disappears at the next event rather than on a timer. A quota above 70% (or `limit`) is content and stays while the row narrows, yielding only to the context percentage; a calm one is a decoration that goes after the gauge. Nothing about quota enters the summary row or the terminal title. Not known from any of these sources: the plan, the absolute limit, model-scoped or overage windows, and when a `limit` will lift. `PI_1337_QUOTA=off` turns the feature off.
61
+
62
+ ## Tool views
63
+
64
+ The extension registers renderers for compact tool headers, output previews, and edit diffs. This changes transcript presentation only; it does not alter tool schemas, arguments, prompts, execution, or results. Original host renderers return when the redesign is disabled. `PI_1337_POLISH=off` keeps the host's tool views while retaining the framed editor.
65
+
66
+ Third-party renderers keep their content. A non-built-in tool that defines both `renderCall` and `renderResult` and does not declare `renderShell: "self"` is drawn in a flat shell while the redesign is active: one status dot, then the renderer's call lines; its result lines under `└`; no background fill and no box pad rows. The renderer gets the row width minus the side padding and the two-column lead. Its lines are never rewritten, wrapped or sanitized; a line that is too wide is clipped, and only the blank rows a slot opens or closes with are dropped. The row has one lane, so the hooks run once per host update with the host's own `context.state` and their own `lastComponent`, and a toggle never forks or resets that state. Toggled off, the same components sit in the host's box. A row whose slots render no line at all takes none in either state (active, that includes slots of nothing but blank lines); toggled off this is one blank row short of the host, whose default shell still prints its separator above an empty box — a self-framed row is given that separator only together with a line of its own, so the single row cannot be reproduced. A descriptor with `renderShell: "self"` or with only one of the two hooks is returned unchanged; a result with image content keeps the host box while it is current, and a row that emitted an image-protocol line keeps it for good. So does a row whose renderer returned a line that is not a string: the host's box paints it as the text it coerces to, and the adapter never throws where the host does not. These rows never fold. The flat shell memoizes the composed row per slot, so a repeat frame measures nothing; the child components still render every frame.
67
+
68
+ A `bash` row that is still running shows the timeout the model chose, as stock Pi does: ` (timeout 30s)` after the title, one dim rung that is the first to yield and is gone with the final result. Only a finite, positive number of seconds within the host shell's ceiling is shown, spelled by the renderer; any other value prints nothing.
69
+
70
+ Edit previews use only recorded result diffs; write previews show submitted content.
71
+ `diff-spans.ts` compares words and punctuation with a longest common subsequence,
72
+ then refines each changed span's edges at grapheme boundaries. Common text between
73
+ separate edits keeps its normal weight. Equal-sized, contiguous removed/added groups
74
+ pair by position, since old/new line numbers diverge after insertions. Context and
75
+ omitted-hunk markers end a group; uneven and incomplete preview groups/bodies keep
76
+ full-line semantic colors without intra-line emphasis.
77
+
78
+ Comparison is capped at 8,192 UTF-16 units per body, 256 tokens per side and 65,536
79
+ matrix cells (~128 KiB). Over-budget pairs retain line colors. Unified rows preserve
80
+ space for code at narrow widths; bold spans survive wrapping and clipping without
81
+ styling the renderer's truncation marker. Rendering uses the current host's ruler,
82
+ the active theme's semantic colors, and the existing expansion and toggle contracts.
83
+
84
+ ## Activity label and folding
85
+
86
+ Both features are fed only by Pi's documented events — no host prototypes are
87
+ touched — and both take their words from `tool-lexicon.ts`, so a tool reads the
88
+ same way on its row (`Read src/width.ts`), in the status row (`Reading
89
+ width.ts…`) and in a tally (`Read 3 files`).
90
+
91
+ `tool-activity.ts` tracks top-level `tool_execution_start`/`end` calls (nested
92
+ `parentToolCallId` calls never render as rows). Once the oldest running call has
93
+ lasted half a second, the editor names it in the workspace segment's place, with
94
+ ` +N` for calls running beside it. The frame lays the row out from its normal
95
+ two groups first and repaints only the left group's cells; the right group never
96
+ moves. No timer is added: the spinner's repaint
97
+ reveals the label, and fast calls end before it would appear.
98
+
99
+ The same module holds the run clock. When no call is named and the run has
100
+ lasted three seconds, the slot reads `Working… 45s`, counted from the run's
101
+ first `agent_start` after a settle; retries, mid-run compaction and drained
102
+ follow-ups do not restart it. It is shown whole, without its time, or not at
103
+ all, and it is hidden during a blocking prompt, during compaction, after
104
+ `agent_settled` and for a run that began while the redesign was toggled off.
105
+ It uses the label's overlay and the spinner's repaint, so the right group does
106
+ not move and no timer is added.
107
+
108
+ ## Run summary and terminal title
109
+
110
+ `run-summary.ts` collects one run from live events and `index.ts` appends the
111
+ result once, at `agent_settled`, as a custom session entry. Four fields are
112
+ optional, so earlier entries render unchanged and a malformed one is ignored
113
+ on its own. `waiting` is a snapshot of pi-persona's `persona-background`
114
+ status as counts; with it a clean run reads `● Turn ended in 9.0s · … ·
115
+ waiting on 3 agents, 1 monitor` with a muted dot, and the clause narrows to one
116
+ count (`waiting on 4 background tasks`) and outlasts the cost and the work
117
+ detail. `modelMs` sums `turn_start` → the turn's assistant `message_end`, and
118
+ `outputTokens` sums `usage.output`, absent if any assistant message lacked it.
119
+ `thinkingMs` sums `thinking_start` → `thinking_end` from the assistant stream
120
+ (`message_update`), closing a block the stream left open at that message's
121
+ `message_end`; it is stored only from one second up and never above `modelMs`.
122
+ The expanded row shows them as `model 1m 32s (40s thinking) · tools 42s · 48
123
+ tok/s`; thinking is part of the model time, so it stands in parentheses, and
124
+ `tools` is the run's duration minus model time, so it also holds retry
125
+ back-off, compaction and prompt waits. The line narrows by dropping the rate,
126
+ then the parenthesis, then the tools time, and on a row too narrow for
127
+ `model 1m 32s` it is left empty rather than cut.
128
+
129
+ The status is parsed strictly (`parseBackgroundStatus` in `format.ts`:
130
+ `kind=count` pairs in the order `agents monitors timers scripts`, counts
131
+ 1–9999); anything else means no background work, and only the parsed numbers
132
+ are displayed. After a clean run the terminal title reads `◌ Waiting on 3
133
+ agents — …` while the status parses and `✓ Done — …` once it clears. The
134
+ footer render compares the raw status string and the title is written from a
135
+ microtask. Background work never enters the status row.
136
+
137
+ `tool-groups.ts` keeps runs of consecutive `read`/`grep`/`find`/`ls` calls. A run
138
+ closes when anything else paints a row: another tool, a user or custom message,
139
+ assistant text, an error line, or a thinking row. A run with at least three
140
+ settled, successful, image-free calls folds, open or closed: the last one renders
141
+ a tally row and the others render nothing, so the tally stays in place and counts
142
+ up as later calls settle into it. A call still running keeps its own row.
143
+ Failed calls and calls with images keep their rows, and the tally counts distinct
144
+ files and patterns. Rows painted without any extension event (`notify()`, host
145
+ notices) cannot end a run. A click on the tally, or on any row of a run, expands
146
+ that run; the host's expand key renders everything. Folding is presentation of
147
+ the transcript itself — `notify()`, status indicators, widgets, and every other
148
+ Pi channel stay untouched, and HTML export still shows every call.
149
+
150
+ ## Lifecycle and host behavior
151
+
152
+ `/theme-1337` and shutdown restore the presentation changes made by the extension, including the editor, footer, spinner visibility, theme when still owned by the extension, optional widget, and any terminal tint. The editor slot is shared with other extensions, so it is touched only while `getEditorComponent()` still returns this extension's factory: toggling off then reinstalls the factory that held the slot before (falling back to Pi's own editor if that factory throws), while shutdown only empties it and never builds another extension's editor. An editor installed after this one is left in place. A host without `getEditorComponent` gets the earlier behaviour, an unconditional reset.
153
+
154
+ While the frame is active, an empty footer captures the live branch and extension statuses. Its render hook checks editor ownership. Pi calls the footer's public `dispose()` when another extension replaces it. Disposal also schedules an ownership check, so an extension can install its editor and footer in the same turn. If the editor changed, 1337 stops its spinner and Git probes, shows Pi's working indicator and restores Pi's footer only if its own footer is still mounted. A later custom footer stays in place. Pi exposes no getter for a custom footer that was already installed when 1337 took the slot.
155
+
156
+ When only the footer changes, the mounted 1337 editor observes palette switches and schedules the same post-render refresh for the tint and spinner. When the editor changes later too, the next activity transition checks ownership again. Tool rows, the theme, the terminal title and summary rows stay active when another editor takes over. The next `/theme-1337` enable or session start installs the frame again. These UI changes run in Pi's interactive TUI.
157
+
158
+ Pi owns notices, dialogs, widgets, retry indicators, compaction indicators, and other status channels. The extension keeps these host channels intact and does not replace them with a footer status row.
159
+
160
+ ## Development dependencies
161
+
162
+ The two Pi development packages are pinned to the installed 1.7.0 release.
163
+ Host packages remain wildcard peers for package loading; this does not promise
164
+ support for older Pi releases. Keep the development pair and lockfile aligned.
165
+
166
+ ## Inspirations
167
+
168
+ The segmented status row, compact welcome header and Git counters were informed by [pi-powerline-footer](https://github.com/nicobailon/pi-powerline-footer). The optional draft-size indicator was informed by [pi-input-revamp](https://github.com/ItsNerisma/pi-input-revamp). Both features use Pi's public API and the active palette.
169
+
170
+ The compact transcript's visual direction was informed by [pi-polish](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-polish) and [pi-context-bar](https://github.com/Pringled/pi-extensions/tree/main/packages/pi-context-bar). pi-1337 is an independent implementation adapted to its palettes and framed editor.
171
+
172
+ The `1337-cosmos` palette takes its colors from [pi-starline](https://github.com/Andy8647/pi-starline) (MIT), whose cover art and pill bar use the [Catppuccin](https://github.com/catppuccin/palette) Mocha swatches (MIT). The role mapping, the derived steps and the spinner are original, and no pi-starline or Catppuccin code is bundled.