@leo-alvarenga/pi-zen-frame 0.11.0 → 0.12.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 (2) hide show
  1. package/README.md +88 -80
  2. package/package.json +2 -1
package/README.md CHANGED
@@ -1,63 +1,75 @@
1
- # pi-zen-frame
1
+ # @leo-alvarenga/pi-zen-frame
2
2
 
3
- A [pi-coding-agent](https://github.com/earendil-works/pi) extension that gives the TUI editor a simple yet polished look and feel.
4
-
5
- - **Frame** — a box (`╭ ╮ ╰ ╯ │ ─`) with live status segments embedded in the top/bottom border.
6
- - **Header** — an optional Claude-welcome-style top box: logo (left, 40%) + model/provider and cwd/git info (right, 60%, split in two halves).
7
- - **Working messages** — randomized messages in pi's built-in working loader, swapped on a configurable interval (on by default).
8
- - **Theme native** — every color is a pi `ThemeColor`, so it follows your active pi theme.
3
+ A [`pi-coding-agent`](https://github.com/earendil-works/pi) extension that gives the TUI editor a clean, minimalist layout with customizable status indicators and frames.
9
4
 
10
5
  ![Preview](./docs/preview.png)
11
6
 
12
- ## Install
7
+ ## Features
8
+
9
+ - **Clean Frame**: Clean editor frame with segments placed above and below it to easily see relevant info
10
+ - **Header Box**: Optional Claude-style welcome panel displaying a logo, model/provider info, current working directory, and Git status
11
+ - **Working Messages**: Randomized loading status messages during response generation, updated on a configurable timer
12
+ - **Native Theme Support**: Uses pi `ThemeColor` tokens to automatically align with your active theme
13
+
14
+ ---
15
+
16
+ ## Installation
17
+
18
+ Run the following command:
19
+
20
+ ```bash
21
+ pi install @leo-alvarenga/pi-zen-frame
22
+ ```
13
23
 
14
- It's distributed as a pi package. Add it to `settings.json` → `packages`, e.g. install from
15
- a local checkout or registry:
24
+ Or add `pi-zen-frame` to your pi packages list in `~/.pi/agent/settings.json`:
16
25
 
17
26
  ```jsonc
18
- // ~/.pi/agent/settings.json
19
27
  {
20
- "packages": ["npm:@leo-alvarenga/pi-zen-frame", "path/to/pi-zen-frame"],
28
+ "packages": ["npm:@leo-alvarenga/pi-zen-frame"],
21
29
  }
22
30
  ```
23
31
 
24
- Restart pi (or `/reload`).
32
+ Then, restart pi or run `/reload` in the console.
25
33
 
26
- ## Config
34
+ ---
27
35
 
28
- zen editor reads `~/.pi/agent/pi-zen-frame.json`. All keys are optional; defaults are shown.
36
+ ## Configuration
37
+
38
+ Configuration is loaded from `~/.pi/agent/pi-zen-frame.json`. All properties are optional.
29
39
 
30
40
  ```jsonc
31
41
  {
32
- // Accent used by segments/frame when a more specific color isn't set.
42
+ // Fallback accent color for frame border and active segments
33
43
  "accentColor": "accent",
34
44
 
35
- // Master mute: every segment except agent-mode renders muted.
36
- // Toggle at runtime with /zen_mode or the piZenFrame.zenMode keybinding.
45
+ // Master mute: renders all segments in muted tones except agent-mode
37
46
  "zenMode": true,
38
47
 
39
48
  "header": {
40
49
  "enable": true,
41
- "logo": [" ", "██████████", "███ ███ ", "██████ ", ...],
42
- "heading": "Zen Pi",
43
- "subheading": "A pi-coding-agent powered terminal editor",
50
+ "logo": ["█████████ ", "███ ███ ", "██████ ", "███ ███"],
51
+ "heading": "Welcome back!",
52
+ "subheading": "Ready for your next session? Terminal warm, context clean, tools ready to execute",
44
53
  "logoColor": "text",
45
- "accentColor": "customMessageLabel"
54
+ "accentColor": "customMessageLabel",
46
55
  },
47
56
 
48
57
  "frame": {
49
58
  "enable": true,
50
- // Below this terminal width the box is skipped (plain editor).
59
+
60
+ // Minimum terminal width required to render the border frame
51
61
  "minWidth": 20,
52
62
 
53
- // Blank lines inside the box (padding) / outside it (margin).
63
+ // Padding inside the frame
54
64
  "paddingTop": 1,
55
65
  "paddingBottom": 1,
56
66
  "paddingX": 1,
67
+
68
+ // Outer margin around the frame
57
69
  "marginTop": 0,
58
70
  "marginBottom": 0,
59
71
 
60
- // Border segments on/off.
72
+ // Toggle individual status segments
61
73
  "showCwd": true,
62
74
  "showModel": true,
63
75
  "showContext": true,
@@ -65,84 +77,80 @@ zen editor reads `~/.pi/agent/pi-zen-frame.json`. All keys are optional; default
65
77
  "showSpinner": false,
66
78
  "showAgentMode": true,
67
79
 
68
- // Defaults to accentColor, then "border"; Can also be set to "agentMode" to match the current agent's color
80
+ // Color options: "border", "accentColor", or "agentMode"
69
81
  "borderColor": "border",
70
82
 
71
- // Glyph shown before the editor content. Default "❯".
83
+ // Input prompt prefix glyph and color settings
72
84
  "prefix": "❯",
73
-
74
- // Prefix color source: "agentMode" (current agent), "frameBorder" (frame
75
- // border color), or any ThemeColor. Default: text color.
76
- "prefixColor": "muted",
77
-
78
- // Override the Nerd-Font glyphs (folder, model, context, thinking,
79
- // gitDirty, gitBranch).
80
- "icons": {},
81
-
82
- // Per-segment fg overrides (any subset; supersede the built-in colors,
83
- // e.g. the ctx traffic-light). Keys: model, thinking, context, cwd,
84
- // agentMode. agentMode only applies when zenMode is off and no agent
85
- // color is set.
86
- "colors": { "model": "accent", "cwd": "accent" }
85
+ "prefixColor": "muted", // Options: "agentMode", "frameBorder", or any ThemeColor
86
+
87
+ // Override default Nerd-Font glyphs
88
+ "icons": {
89
+ // Keys: folder, model, context, thinking, gitDirty, gitBranch
90
+ },
91
+
92
+ // Per-segment foreground color overrides (supersedes default theme colors)
93
+ "colors": {
94
+ "model": "accent",
95
+ "cwd": "accent",
96
+ },
87
97
  },
88
98
 
89
- // Randomized messages shown in pi's built-in working loader (the
90
- // "Working..." line while streaming). A new random message is picked
91
- // every `intervalMs`; no repeats until the pool is exhausted. Default on.
99
+ // Randomized status messages shown while streaming responses
92
100
  "workingMessage": {
93
101
  "enable": true,
94
102
  "intervalMs": 3000,
95
- "messages": ["Exploring the seas", "Tinkering with strange objects", "..."]
96
- }
97
- }
98
- ```
99
-
100
- ## Commands & keybindings
101
-
102
- - `/zen_mode` — toggle zen mode (all segments muted except agent-mode).
103
- - Toggle keybinding: `piZenFrame.zenMode`, default `ctrl+shift+z`. Rebind or
104
- disable it in `~/.pi/agent/keybindings.json`:
105
-
106
- ```jsonc
107
- // ~/.pi/agent/keybindings.json
108
- {
109
- "piZenFrame.zenMode": "ctrl+shift+z", // or [] to disable; /zen_mode still works
103
+ "messages": [
104
+ "Exploring the seas",
105
+ "Tinkering with strange objects",
106
+ "Analyzing patterns",
107
+ ],
108
+ },
110
109
  }
111
110
  ```
112
111
 
113
- After editing `keybindings.json`, run `/reload` to apply.
112
+ ---
114
113
 
115
- ## The frame
114
+ ## Structure & Status Segments
116
115
 
117
- The editor's content is boxed with rounded corner glyphs and two live status rails painted into the top and bottom borders.
116
+ The editor window features status indicators embedded along the frame borders:
118
117
 
119
- ### Top border (left)
118
+ | Location | Segment | Description |
119
+ | ---------------- | -------------- | --------------------------------------------------------------------- |
120
+ | **Top Left** | **model** | Active model name and provider |
121
+ | | **reasoning** | Current reasoning effort level, tinted with pi thinking tokens |
122
+ | | **spinner** | Active phase indicator (`thinking`, `outputting`, `toolcall`, `exec`) |
123
+ | **Top Right** | **ctx** | Context usage percentage and token counts with color alerts |
124
+ | **Bottom Left** | **agent mode** | Active agent indicator pill from `pi-agent-manager` |
125
+ | **Bottom Right** | **cwd** | Shortened path, active Git branch, and uncommitted file counts |
120
126
 
121
- - **model** — active model name + provider, accented.
122
- - **reasoning** — current thinking level, tinted with pi's own thinking token (`thinkingLow` … `thinkingXhigh`).
123
- - **spinner** — streaming phase (`thinking` / `outputting` / `toolcall` / `exec`), replaces the left slot while active.
127
+ ---
124
128
 
125
- ### Top border (right)
129
+ ## Commands & Keybindings
126
130
 
127
- - **ctx** — context window usage: percentage + `used/window` tokens. Color winds traffic light (green → warning at ≥50% → red at ≥80%).
131
+ - **Toggle Command**: `/zen_mode` — Toggles Zen mode on and off.
132
+ - **Default Keybinding**: `ctrl+shift+z`
128
133
 
129
- ### Bottom border (left)
134
+ To rebind or disable the hotkey, update `~/.pi/agent/keybindings.json`:
130
135
 
131
- - **agent mode** — current pi-agent-manager agent as a colored pill (optional, no hard dependency).
132
-
133
- ### Bottom border (right)
136
+ ```jsonc
137
+ {
138
+ "piZenFrame.zenMode": "ctrl+shift+z", // Set to [] to disable the shortcut
139
+ }
140
+ ```
134
141
 
135
- - **cwd** — working directory (shortened) + git branch and dirty file count.
142
+ Run `/reload` after modifying your keybindings.
136
143
 
137
- All of these are colored with pi `ThemeColor`s, so they follow kanagawa, dark, etc.
144
+ ---
138
145
 
139
- ## Source layout
146
+ ## Directory Layout
140
147
 
141
148
  ```
142
149
  extensions/
143
- index.ts entry: config, events, editor install
144
- config/ types, constants, settings loading/normalization
145
- components/ header, frame, segments, registry (one file per segment)
146
- editor/ FrameEditor (frame + spinner rendering)
147
- utils/ agent-mode, git, path, string helpers
150
+ ├── index.ts # Extension entry point: config initialization and events
151
+ ├── config/ # Types, defaults, and settings normalization
152
+ ├── components/ # Header, frame border, and status segment modules
153
+ ├── editor/ # FrameEditor component for layout rendering
154
+ └── utils/ # Helpers for Git status, paths, and agent modes
155
+
148
156
  ```
package/package.json CHANGED
@@ -2,13 +2,14 @@
2
2
  "name": "@leo-alvarenga/pi-zen-frame",
3
3
  "description": "A pi-coding-agent extension that gives the TUI editor a simple yet polished look and feel",
4
4
  "author": "Leonardo A. Alvarenga",
5
- "version": "0.11.0",
5
+ "version": "0.12.0",
6
6
  "license": "MIT",
7
7
  "repository": "github.com/leo-alvarenga/pi-mono",
8
8
  "publishConfig": {
9
9
  "access": "public"
10
10
  },
11
11
  "keywords": [
12
+ "pi-extension",
12
13
  "pi-package",
13
14
  "pi"
14
15
  ],