@0xkahi/pi-qol 1.0.5 → 1.1.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 +35 -5
- package/assets/config.schema.json +18 -3
- package/package.json +5 -5
- package/src/constants.ts +1 -0
- package/src/extensions/context-view/capture.ts +311 -83
- package/src/extensions/context-view/codemap.md +111 -48
- package/src/extensions/context-view/context-view-controller.ts +65 -27
- package/src/extensions/context-view/index.ts +22 -6
- package/src/extensions/context-view/measure.ts +713 -78
- package/src/extensions/context-view/model.ts +132 -14
- package/src/extensions/context-view/probe-token.ts +28 -0
- package/src/extensions/context-view/prompt-additions.ts +174 -0
- package/src/extensions/context-view/prompt-blocks.ts +204 -0
- package/src/extensions/context-view/settings.ts +43 -0
- package/src/extensions/context-view/text.ts +48 -0
- package/src/extensions/context-view/transcript.ts +62 -0
- package/src/extensions/context-view/ui/codemap.md +28 -13
- package/src/extensions/context-view/ui/context-view-dialog.ts +6 -1
- package/src/extensions/context-view/ui/injections-model.ts +13 -28
- package/src/extensions/context-view/ui/injections-view.ts +82 -21
- package/src/extensions/context-view/ui/json-preview.ts +41 -0
- package/src/extensions/context-view/ui/markers.ts +96 -0
- package/src/extensions/context-view/ui/section-preview.ts +188 -10
- package/src/extensions/context-view/ui/usage-block-layer.ts +9 -4
- package/src/extensions/context-view/ui/usage-view.ts +70 -17
- package/src/extensions/context-view/ui/wheel-preview-layer.ts +104 -0
- package/src/extensions/context-view/ui/wheel.ts +66 -0
- package/src/extensions/context-view/usage.ts +64 -26
- package/src/extensions/custom-footer/agent-display-state.ts +60 -0
- package/src/extensions/custom-footer/footer-component.ts +22 -0
- package/src/extensions/custom-footer/index.ts +17 -1
- package/src/extensions/custom-footer/types.ts +3 -1
- package/src/schemas/custom-footer-config.schema.ts +11 -0
package/README.md
CHANGED
|
@@ -54,8 +54,9 @@ shows the current directory as an icon plus basename, supports hex color overrid
|
|
|
54
54
|
can hide token/cache clusters, and adds an OAuth subscription-usage progress bar
|
|
55
55
|
for supported providers (Anthropic and OpenAI Codex).
|
|
56
56
|
|
|
57
|
-
- **Directory line** —
|
|
58
|
-
session name.
|
|
57
|
+
- **Directory line** — optional inverse-styled agent badge followed by the
|
|
58
|
+
directory icon + basename, with optional git branch and session name. The badge
|
|
59
|
+
is disabled by default.
|
|
59
60
|
- **Stats line** — cumulative input/output tokens, cache read/write/hit cluster,
|
|
60
61
|
session cost (or `(sub)` when on a subscription), context-window usage, and the
|
|
61
62
|
right-aligned model name (with provider prefix when multiple providers are
|
|
@@ -117,12 +118,15 @@ them (project overrides global):
|
|
|
117
118
|
"enabled": true,
|
|
118
119
|
"colors": {
|
|
119
120
|
"directory": "#A78BFA",
|
|
120
|
-
"modelName": "#60A5FA"
|
|
121
|
+
"modelName": "#60A5FA",
|
|
122
|
+
"agentName": "#FBBF24"
|
|
121
123
|
},
|
|
122
124
|
"display": {
|
|
123
125
|
"tokens": true,
|
|
124
|
-
"cache": true
|
|
125
|
-
|
|
126
|
+
"cache": true,
|
|
127
|
+
"agentName": true
|
|
128
|
+
},
|
|
129
|
+
"defaultAgentName": "DEFAULT"
|
|
126
130
|
}
|
|
127
131
|
}
|
|
128
132
|
```
|
|
@@ -188,8 +192,11 @@ Context View is a fork of Dmitry Makarov's [pi-context-view](https://github.com/
|
|
|
188
192
|
| `enabled` | `boolean` | `false` | Replace pi's built-in interactive footer. |
|
|
189
193
|
| `display.tokens` | `boolean` | `true` | Show cumulative input/output token counts. |
|
|
190
194
|
| `display.cache` | `boolean` | `true` | Show the custom cache read/write/hit cluster. |
|
|
195
|
+
| `display.agentName` | `boolean` | `false` | Prefix the first line with a padded bold inverse agent badge. |
|
|
196
|
+
| `defaultAgentName` | `string` | `DEFAULT` | Agent name restored at the start of each session. |
|
|
191
197
|
| `colors.directory` | `hex` | — | Color the directory icon and basename. |
|
|
192
198
|
| `colors.modelName` | `hex` | — | Color the right-aligned model name. |
|
|
199
|
+
| `colors.agentName` | `hex` | — | Agent badge foreground color before inversion. |
|
|
193
200
|
| `colors.anthropicUsage` | `hex` | `#D97706` | Color the Claude subscription usage segment (bar + percentage). |
|
|
194
201
|
| `colors.codexUsage` | `hex` | `#10B981` | Color the Codex subscription usage segment (bar + percentage). |
|
|
195
202
|
| `icons.directory` | `string` | nerd font | Glyph shown before the directory basename. |
|
|
@@ -198,6 +205,29 @@ Context View is a fork of Dmitry Makarov's [pi-context-view](https://github.com/
|
|
|
198
205
|
| `icons.cacheWrite` | `string` | nerd font | Glyph for cache-write tokens. |
|
|
199
206
|
| `icons.refresh` | `string` | nerd font | Glyph shown before the subscription reset time. |
|
|
200
207
|
|
|
208
|
+
When enabled, the badge has no brackets, uses bold and inverse styling, and adds
|
|
209
|
+
one styled padding space on each side of the name. One normal, unstyled space
|
|
210
|
+
separates the trailing badge padding from the directory. Names are trimmed and
|
|
211
|
+
sanitized. Names wider than ten terminal columns are rendered as their first ten
|
|
212
|
+
visible columns plus `...`; badge padding does not count toward that limit, and
|
|
213
|
+
wide Unicode characters are never split. Badge color precedence is a valid event
|
|
214
|
+
color,
|
|
215
|
+
`colors.agentName`, then pi's `accent` theme color. Event-selected names and
|
|
216
|
+
colors are session-scoped: every `session_start` restores `defaultAgentName` and
|
|
217
|
+
clears the event color.
|
|
218
|
+
|
|
219
|
+
Other extensions can update the current identity through pi's event bus:
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
pi.events.emit('pi.qol.event:set-agent-name', {
|
|
223
|
+
agentName: 'Reviewer',
|
|
224
|
+
color: '#FFFFFF', // optional; must be #RRGGBB
|
|
225
|
+
});
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
Invalid or empty names are ignored. A missing or invalid event color clears any
|
|
229
|
+
previous event color and uses the normal fallback precedence.
|
|
230
|
+
|
|
201
231
|
Project config shallow-merges each top-level section over global config. Arrays
|
|
202
232
|
replace lower-precedence arrays, so project `model_select.favourite` or
|
|
203
233
|
`model_select.groups` replaces the corresponding global array. Nested objects are
|
|
@@ -168,8 +168,10 @@
|
|
|
168
168
|
},
|
|
169
169
|
"display": {
|
|
170
170
|
"tokens": true,
|
|
171
|
-
"cache": true
|
|
172
|
-
|
|
171
|
+
"cache": true,
|
|
172
|
+
"agentName": false
|
|
173
|
+
},
|
|
174
|
+
"defaultAgentName": "DEFAULT"
|
|
173
175
|
},
|
|
174
176
|
"type": "object",
|
|
175
177
|
"properties": {
|
|
@@ -192,6 +194,10 @@
|
|
|
192
194
|
"type": "string",
|
|
193
195
|
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
194
196
|
},
|
|
197
|
+
"agentName": {
|
|
198
|
+
"type": "string",
|
|
199
|
+
"pattern": "^#[0-9a-fA-F]{6}$"
|
|
200
|
+
},
|
|
195
201
|
"anthropicUsage": {
|
|
196
202
|
"default": "#D97706",
|
|
197
203
|
"type": "string",
|
|
@@ -239,7 +245,8 @@
|
|
|
239
245
|
"display": {
|
|
240
246
|
"default": {
|
|
241
247
|
"tokens": true,
|
|
242
|
-
"cache": true
|
|
248
|
+
"cache": true,
|
|
249
|
+
"agentName": false
|
|
243
250
|
},
|
|
244
251
|
"type": "object",
|
|
245
252
|
"properties": {
|
|
@@ -250,8 +257,16 @@
|
|
|
250
257
|
"cache": {
|
|
251
258
|
"default": true,
|
|
252
259
|
"type": "boolean"
|
|
260
|
+
},
|
|
261
|
+
"agentName": {
|
|
262
|
+
"default": false,
|
|
263
|
+
"type": "boolean"
|
|
253
264
|
}
|
|
254
265
|
}
|
|
266
|
+
},
|
|
267
|
+
"defaultAgentName": {
|
|
268
|
+
"default": "DEFAULT",
|
|
269
|
+
"type": "string"
|
|
255
270
|
}
|
|
256
271
|
}
|
|
257
272
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@0xkahi/pi-qol",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "quality of life pi extensions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@earendil-works/pi-tui": "*"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@earendil-works/pi-ai": "^0.84.3",
|
|
47
|
-
"@earendil-works/pi-coding-agent": "^0.84.3",
|
|
48
|
-
"@earendil-works/pi-tui": "^0.84.3",
|
|
49
46
|
"@biomejs/biome": "^2.4.15",
|
|
50
47
|
"@changesets/cli": "^2.31.0",
|
|
51
|
-
"@
|
|
48
|
+
"@earendil-works/pi-ai": "^0.86.1",
|
|
49
|
+
"@earendil-works/pi-coding-agent": "^0.86.1",
|
|
50
|
+
"@earendil-works/pi-tui": "^0.86.1",
|
|
52
51
|
"@types/bun": "latest",
|
|
52
|
+
"@types/node": "^24.0.0",
|
|
53
53
|
"bun-types": "latest",
|
|
54
54
|
"typescript": "^5"
|
|
55
55
|
},
|