@aeondave/pi-theme-1337 0.5.1 → 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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
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
+
3
13
  ## [0.5.1] - 2026-11-18
4
14
 
5
15
  - Publish to npm as `@aeondave/pi-theme-1337`: install with
package/README.md CHANGED
@@ -35,8 +35,9 @@ Requires Pi and Node.js 22.19 or later.
35
35
 
36
36
  ## What it adds
37
37
 
38
- - **A framed editor.** A centered, rounded box with the model and thinking level in its top border
39
- and one status row: workspace, branch, context use, cost and subscription quota.
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.
40
41
  - **A status row that tells you what is running.** A long tool call is named in place
41
42
  (`Running npm test… 14s`) without moving the rest of the row.
42
43
  - **A compact transcript.** One row per tool call, exploration runs folded into a tally, edit
@@ -52,6 +53,10 @@ they are, and other extensions' tool renderers keep their content.
52
53
  <details>
53
54
  <summary>Every detail</summary>
54
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.
55
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`).
56
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`.
57
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…`.
@@ -62,7 +67,7 @@ they are, and other extensions' tool renderers keep their content.
62
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.
63
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.
64
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.
65
- - A reversible `/theme-1337` toggle and a clean-buffer copy shortcut (`alt+c` by default). Toggling off gives the editor back to an extension that had installed its own before, and leaves alone one installed since. If another extension installs its editor over the frame while the redesign is on, Pi's own footer and working row come back until the next `/theme-1337` or session start, so the workspace, model, context, cost and spinner never go missing.
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.
66
71
 
67
72
  </details>
68
73
 
@@ -109,6 +114,8 @@ All palettes share Pi's 51-token theme contract. See [palette design](docs/palet
109
114
 
110
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.
111
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
+
112
119
  ## Essential settings
113
120
 
114
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.
@@ -153,7 +160,7 @@ npm run preview
153
160
 
154
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`.
155
162
 
156
- Development packages are pinned to Pi 1.5.2; 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.
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.
157
164
 
158
165
  ## License
159
166
 
@@ -18,6 +18,10 @@ Pi extension API ─> index.ts ─> editor.ts ─> frame.ts
18
18
  | `src/index.ts` | Extension lifecycle, commands, theme switching, config, and spinner lifecycle. |
19
19
  | `src/editor.ts` | Custom editor wrapper that preserves Pi's editing and input behavior. |
20
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. |
21
25
  | `src/format.ts` | Pure sanitizers and label, context, cost and run-delta formatting. |
22
26
  | `src/tool-activity.ts` | Pure status-row label naming a long-running tool call, and the run clock. |
23
27
  | `src/run-summary.ts` | Pure per-run collector and the end-of-run transcript row. |
@@ -147,21 +151,22 @@ Pi channel stay untouched, and HTML export still shows every call.
147
151
 
148
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.
149
153
 
150
- While the redesign is on, an editor installed over this extension's frame would leave the user with nothing: the frame is the only place the workspace, model, context, cost and spinner are shown, and the footer is empty and Pi's working row hidden. No event announces it, so the empty footer's render compares `getEditorComponent()` with this extension's factory on each UI pass and, from a microtask after that render, hands the chrome back: Pi's footer returns, its working row shows again and this extension's spinner timer stops. Tool rows, the theme, the terminal title and summary rows carry on. The frame is not taken back by itself; the next `/theme-1337` or session start installs it again. The extension only applies UI changes in Pi's interactive TUI mode; RPC, JSON, and print modes do not acquire the redesign or animation timer.
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.
151
157
 
152
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.
153
159
 
154
160
  ## Development dependencies
155
161
 
156
- The two Pi development packages are pinned to 1.5.2, the latest published
157
- release. That release already depends on `undici` 8.12.3, which includes the
158
- fixes for the reported
159
- [Undici advisories](https://github.com/nodejs/undici/releases/tag/v8.12.2), so
160
- the root override that earlier pins needed is gone. Check the host's own pin
161
- again when updating the matched Pi development packages.
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.
162
165
 
163
166
  ## Inspirations
164
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
+
165
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.
166
171
 
167
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.
@@ -29,6 +29,10 @@ Missing or invalid files fall back to defaults. Unknown keys and values with the
29
29
  | `PI_1337_SUMMARY` | `summary` | on | Appends one summary row when a run that used tools, was interrupted or failed settles; `off` writes none and hides existing ones. The row is a custom session entry: it never reaches the model and stays in the session file. Read when the extension loads. |
30
30
  | `PI_1337_TITLE` | `title` | on | Shows the run state in the terminal title (`● Running npm test… — repo`) and restores Pi's own title at rest; `off` never touches the title. Read when the extension loads. |
31
31
  | `PI_1337_QUOTA` | `quota` | on | Shows the subscription quota the current provider reports in the status row: `5h 43% · wk 12%`, `wk 85%`, or `limit`. `off` registers no response or stream handler and leaves the row as it is. Read when the extension loads. |
32
+ | `PI_1337_STATUS_STYLE` | `statusStyle` | segmented | Palette-colored text and thin chevrons. Choose `classic` for the dotted row. |
33
+ | `PI_1337_HEADER` | `header` | on | Compact startup header with palette, workspace and command hints. `off` leaves the header alone. |
34
+ | `PI_1337_GIT_STATUS` | `gitStatus` | on | Cached Git change counters beside the branch. `off` starts no Git process. |
35
+ | `PI_1337_DRAFT_TOKENS` | `draftTokens` | off | Approximate size of long text drafts, using Pi's estimator and expanded pasted text; shown only when idle. |
32
36
  | `PI_1337_THINKING_LABEL` | `thinkingLabel` | `∴ thinking` | Set the collapsed thinking label. |
33
37
  | `PI_1337_BG` | `background` | theme | Set `on`/`auto` to use the palette background, `off` to leave the terminal unchanged, or a hex color such as `#101820`. |
34
38
  | `PI_1337_STATE_DIR` | — | `<agent-dir>/1337-theme` | Set the directory containing `config.json`. |
@@ -39,6 +43,18 @@ All thirteen palettes are available in `/settings`, and Pi persists that selecti
39
43
 
40
44
  Aliases include `green`, `amber`, `ice`, `cyber`/`blue`, `cyberpunk-2077`, `cyberpunk-2077-edgerunner`, `neon`, `cosmos`, `poison`, `magma`, `fallout`, `skynet`, and `skynet-dark`. Full names such as `1337-cyberpunk-2077` also work.
41
45
 
46
+ ## Status presentation
47
+
48
+ The segmented style draws the path in the palette's accent color and the branch in its success color. Thin Unicode chevrons separate the labels on the terminal background. Both styles retain the same two groups and width priorities. The model stays in the top border, and the context percentage remains the last session metric to yield.
49
+
50
+ Git badges count staged (`+2`), modified (`~1`), untracked (`?1`) and conflicted (`!1`) entries. Clean repositories show no badge; unavailable, failed or incomplete probes show no claim about cleanliness. Untracked directories count as one entry, as in `git status --untracked-files=normal`. The read-only probe runs through Pi's public executor with optional Git locks disabled, a 1.5-second timeout and a 1 MiB output cap. Results are cached for one second during tool activity; activation, branch changes and run settlement force refreshes. Edits made externally while Pi is idle appear at the next such event; there is no polling timer. Counters yield before branch and session details on narrow screens.
51
+
52
+ With `draftTokens: true`, a draft of at least 256 estimated tokens shows a whole approximate label such as `~1.2k tok` in the idle left slot when it fits. This is Pi's conservative character-based estimate, not the model's tokenizer. Paste placeholders are expanded before estimating. It never changes the session context figure and disappears while Pi is working or waiting for a prompt response.
53
+
54
+ The header follows live palette changes and uses the editor's width cap and margins. Toggling the redesign off restores Pi's header if ours still owns the slot; a header installed later by another extension is left alone. Pi exposes no getter for a previously installed custom header, so an earlier extension's header cannot be restored automatically. Disable our header when another extension should own it.
55
+
56
+ These settings are read when the extension loads; use `/reload` after changing them.
57
+
42
58
  ## Activity label and tool grouping
43
59
 
44
60
  While Pi works, a tool call that has been running for half a second is named in the status row, in the workspace segment's place: `Running npm test…`, `Reading stats.py…`, after three seconds with the elapsed time (`Running npm test… 14s`), and with ` +2` when other calls run beside it. The right group (usage, cost, persona) never moves for it, fast calls never flash, and the workspace returns when the call ends. The label comes only from Pi's tool events and adds no timer. When no tool is named and the run has lasted three seconds, the same place shows the run clock, `Working… 45s`; it counts from the run's start, and is hidden during prompts and compaction and for a run that began while the redesign was toggled off. `PI_1337_ACTIVITY=off` (config `activity: false`) hides both.
@@ -28,8 +28,8 @@ Both Skynet profiles activate one triangle at a time:
28
28
  △ △ ▲ △ △ ▲
29
29
  ```
30
30
 
31
- Both Skynet profiles use the crimson `#d51f2a` pyramid; all other profiles
32
- retain their palette's semantic accent. Cyberpunk 2077 uses a cyan-blue accent
31
+ Both Skynet profiles use the crimson `#ff5f6b` pyramid. All other profiles
32
+ use their palette's semantic accent. Cyberpunk 2077 uses a cyan-blue accent
33
33
  (`#52c9ff`), and Edgerunner uses a cyan accent (`#00e6e6`). The explicit color
34
34
  override belongs only to the Skynet sidecars, not either theme palette.
35
35
 
@@ -42,7 +42,7 @@ For `my-theme.json`, put the profile in `my-theme.pi1337`:
42
42
  "spinner": {
43
43
  "frames": [[" ▲ ", "△ △"], [" △ ", "▲ △"], [" △ ", "△ ▲"]],
44
44
  "intervalMs": 180,
45
- "color": "#d51f2a"
45
+ "color": "#ff5f6b"
46
46
  }
47
47
  }
48
48
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aeondave/pi-theme-1337",
3
- "version": "0.5.1",
3
+ "version": "0.6.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Thirteen vivid themes for Pi with a framed editor, compact tool views, theme-aware diffs, and configurable text spinners.",
@@ -46,11 +46,11 @@
46
46
  "@earendil-works/pi-tui": "*"
47
47
  },
48
48
  "devDependencies": {
49
- "@earendil-works/pi-coding-agent": "1.5.2",
50
- "@earendil-works/pi-tui": "1.5.2",
49
+ "@earendil-works/pi-coding-agent": "1.7.0",
50
+ "@earendil-works/pi-tui": "1.7.0",
51
51
  "@types/node": "^22.0.0",
52
- "tsx": "^4.23.12",
53
- "typescript": "^5.6.0"
52
+ "tsx": "^4.23.15",
53
+ "typescript": "^7.0.2"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=22.19.0"
@@ -59,7 +59,7 @@
59
59
  "access": "public"
60
60
  },
61
61
  "pi": {
62
- "image": "https://raw.githubusercontent.com/AeonDave/pi-theme-1337/v0.5.1/assets/banner.png",
62
+ "image": "https://raw.githubusercontent.com/AeonDave/pi-theme-1337/v0.6.0/assets/banner.png",
63
63
  "extensions": [
64
64
  "./src/index.ts"
65
65
  ],