@xzzpig/pi-starline 0.1.0 → 0.1.1
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 +29 -25
- package/extensions/starline/index.ts +12 -0
- package/extensions/starline/mouse/index.ts +9 -1
- package/package.json +58 -59
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Starline
|
|
2
2
|
|
|
3
|
-
A Starship-inspired statusline
|
|
3
|
+
A Starship-inspired statusline, Opencode-style editor chrome, and fullscreen mouse control for [Pi](https://pi.dev).
|
|
4
4
|
|
|
5
5
|
> Starline is a fork of [pi-zentui](https://github.com/lmilojevicc/pi-zentui) by Luka, renamed and released on its own. It has diverged well past upstream and adds a pill footer style, a colour palette with `$ref` expansion, `model`/`thinking` footer segments, a git host icon, per-segment display options, configurable editor cursor styles, and mouse selection and copying.
|
|
6
6
|
|
|
@@ -10,10 +10,12 @@ A Starship-inspired statusline and Opencode-style TUI for [Pi](https://pi.dev).
|
|
|
10
10
|
|
|
11
11
|
## What is this?
|
|
12
12
|
|
|
13
|
-
Starline
|
|
13
|
+
Starline makes Pi's fullscreen mode feel like a finished terminal app — three
|
|
14
|
+
pieces of one product, not a theme:
|
|
14
15
|
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
16
|
+
- **See the state** — a Starship-inspired statusline and pill footer: current directory, git branch and status, runtime/version detection, context usage and token counts in a compact, icon-rich format
|
|
17
|
+
- **Type comfortably** — Opencode-style editor chrome: a clean bordered input box with accent rail and copy-friendly mode, model and provider inside the frame, paste collapse, and a `ctrl+g` hint pointing at your `$EDITOR` when a draft outgrows the box
|
|
18
|
+
- **Drive with the mouse** — fullscreen mouse control: select and copy anywhere, click a tool box to expand just it, click to move the caret, wheel to scroll the draft — [see Mouse](#mouse-fullscreen-control)
|
|
17
19
|
|
|
18
20
|
## Features
|
|
19
21
|
|
|
@@ -37,7 +39,26 @@ Starline brings two popular aesthetics to Pi:
|
|
|
37
39
|
- Configurable model, provider, and thinking-level indicator colors
|
|
38
40
|
- Prompt-box-style user messages matching the Starline input chrome
|
|
39
41
|
- Copy-friendly mode hides editor and previous-message rail glyphs so terminal selection copies less chrome
|
|
40
|
-
|
|
42
|
+
|
|
43
|
+
### Mouse (fullscreen control)
|
|
44
|
+
|
|
45
|
+
The second half of the product: the statusline tells you where you are, the
|
|
46
|
+
mouse lets you act on what you see. Starline drives Pi 0.84's own renderer
|
|
47
|
+
(`tuiMode: "fullscreen"`) by patching its methods directly — the extension API
|
|
48
|
+
stops at high-level hooks, and pending-copy, click-to-expand and clean-copy all
|
|
49
|
+
need to reach into the renderer itself. That is also why they live in Starline:
|
|
50
|
+
they sit on the same prototype patches the footer and editor already use, and
|
|
51
|
+
Pi keeps its core deliberately minimal — behaviours belong in extensions.
|
|
52
|
+
|
|
53
|
+
- **Select and copy anywhere.** Drag to select in the transcript or the input box; double-click a word (paths and kebab-case stay whole), triple-click a line. Releasing copies — or hold the selection for `ctrl+c` with `mouse.copyOnSelect: false`, the behaviour [Pi #7720](https://github.com/earendil-works/pi/issues/7720) asks for upstream.
|
|
54
|
+
- **Clean copies.** Transcript selections drop Starline's rails, rule rows and pi-toolbox frame borders before they reach the clipboard; editor selections copy the draft's text, not the painted rows.
|
|
55
|
+
- **Selection hint.** A pending selection shows exactly how many characters `ctrl+c` will copy, and a selection inside the editor names your editor — `ctrl+g to edit in nvim`.
|
|
56
|
+
- **Click to expand one tool box.** A click on a box's hint row expands just that box (MCP boxes included), and the `(ctrl+o to collapse)` anchor row closes it again.
|
|
57
|
+
- **Click to move the caret** in the input box; **backspace/delete remove a selected range**; the **wheel scrolls the draft** over the input box, and a draft taller than the box keeps the `ctrl+g` external-editor hint on screen.
|
|
58
|
+
|
|
59
|
+
0.2.x's `fixedEditor` config block was renamed to `mouse` (migrated
|
|
60
|
+
automatically, see [the changelog](CHANGELOG.md)); the fixed editor itself is
|
|
61
|
+
gone, superseded by Pi's fullscreen mode.
|
|
41
62
|
|
|
42
63
|
### Git Status Icons
|
|
43
64
|
|
|
@@ -130,6 +151,9 @@ Detects Starship Nerd Font runtime/language modules, uses the Starship Nerd Font
|
|
|
130
151
|
|
|
131
152
|
## Install
|
|
132
153
|
|
|
154
|
+
Starline drives Pi 0.84's alternate-screen renderer, so it needs **Pi ≥ 0.84.0**.
|
|
155
|
+
If you are on a distribution that bundles an older Pi, upgrade it or wait for it to catch up.
|
|
156
|
+
|
|
133
157
|
```bash
|
|
134
158
|
# From npm (local fork @xzzpig/pi-starline)
|
|
135
159
|
pi install npm:@xzzpig/pi-starline
|
|
@@ -158,26 +182,6 @@ Settings live in `~/.pi/agent/starline.json`. The file is optional — anything
|
|
|
158
182
|
|
|
159
183
|
**[Full configuration reference →](https://github.com/Andy8647/pi-starline/blob/main/docs/configuration.md)** — every option with its default: the pill footer, the colour palette and its `$name` references, footer format templates, per-segment display options, icon overrides, and editor styling.
|
|
160
184
|
|
|
161
|
-
## Mouse
|
|
162
|
-
|
|
163
|
-
Starline reads and drives Pi 0.84's own renderer, so mouse handling works in
|
|
164
|
-
both TUI modes — use Pi's fullscreen mode (`tuiMode: "fullscreen"`) for the
|
|
165
|
-
sticky editor and footer.
|
|
166
|
-
|
|
167
|
-
- **Select and copy anywhere.** Drag to select in the transcript or the input
|
|
168
|
-
box; double-click a word (paths and kebab-case stay whole), triple-click a
|
|
169
|
-
line. Releasing copies — or hold the selection for `ctrl+c` with
|
|
170
|
-
`mouse.copyOnSelect: false`. Transcript copies drop Starline's rails, rule
|
|
171
|
-
rows and pi-toolbox frame borders.
|
|
172
|
-
- **Click a tool box's hint row to expand just that box**, and collapse it via
|
|
173
|
-
the `(ctrl+o to collapse)` anchor row (pi-toolbox 0.2.2+).
|
|
174
|
-
- **Click to move the caret** in the input box; **backspace/delete remove a
|
|
175
|
-
selected range**; the **wheel scrolls the draft** over the input box.
|
|
176
|
-
|
|
177
|
-
0.2.x's `fixedEditor` config block was renamed to `mouse` (migrated
|
|
178
|
-
automatically, see [the changelog](CHANGELOG.md)); the fixed editor itself is
|
|
179
|
-
gone, superseded by Pi's fullscreen mode.
|
|
180
|
-
|
|
181
185
|
## Requirements
|
|
182
186
|
|
|
183
187
|
- [Pi](https://pi.dev) coding agent 0.80.3 or newer
|
|
@@ -255,6 +255,18 @@ export default function (pi: ExtensionAPI) {
|
|
|
255
255
|
const installMousePatches = () => {
|
|
256
256
|
uninstallMouse();
|
|
257
257
|
if (!getCurrentConfig().mouse.enabled) return;
|
|
258
|
+
// `TuiAltScreen` only ships with pi-tui >= 0.84.0 (the peer range below
|
|
259
|
+
// already says so). This guard is for environments that bypass peer
|
|
260
|
+
// resolution: fail with a readable hint instead of a TypeError on
|
|
261
|
+
// `TuiAltScreen.prototype`.
|
|
262
|
+
if (!TuiAltScreen) {
|
|
263
|
+
console.warn(
|
|
264
|
+
"starline: mouse support needs @earendil-works/pi-tui >= 0.84.0 (" +
|
|
265
|
+
"TuiAltScreen is not exported by the installed pi-tui). Upgrade Pi, " +
|
|
266
|
+
"or wait for your distribution to bundle a newer one.",
|
|
267
|
+
);
|
|
268
|
+
return;
|
|
269
|
+
}
|
|
258
270
|
// Repaints are not wired from here: each patch asks its own receiver —
|
|
259
271
|
// the live renderer it is running inside — to render. Handing it the
|
|
260
272
|
// extension's `refresh` instead tied the pending hint to the footer's
|
|
@@ -171,7 +171,7 @@ type MouseCapablePrototype = {
|
|
|
171
171
|
row: number,
|
|
172
172
|
selection: SelectionBounds,
|
|
173
173
|
): SelectionColumns;
|
|
174
|
-
copySelectionToClipboard(this: unknown): void
|
|
174
|
+
copySelectionToClipboard(this: unknown): Promise<void>;
|
|
175
175
|
handleViewportInput(this: unknown, data: string): { consume: boolean } | undefined;
|
|
176
176
|
flash(this: unknown, message: string, durationMs?: number): void;
|
|
177
177
|
getWordSelection(this: unknown, point: SelectionPoint): SelectionBounds | undefined;
|
|
@@ -334,6 +334,14 @@ function selectionText(receiver: MouseCapablePrototype, bounds: SelectionBounds)
|
|
|
334
334
|
* `receiver` here is Pi's own instance (the wrapper runs inside Pi's own
|
|
335
335
|
* method call, not through the extension-facing Proxy), so a plain
|
|
336
336
|
* assignment is safe.
|
|
337
|
+
*
|
|
338
|
+
* 0.84.2 (#8110) boundary: Pi's copy is now async, and when the host injects
|
|
339
|
+
* a clipboard (`copySelection` — coding-agent does since 0.84.2), the flash
|
|
340
|
+
* lands after `await`, outside this synchronous shadow. `copyNotice: false`
|
|
341
|
+
* therefore still suppresses the toast on the OSC 52 fallback path (no host
|
|
342
|
+
* clipboard) but not on the host-clipboard path. The ctrl+c caller must stay
|
|
343
|
+
* synchronous — it returns `{ consume: true }` to Pi's `handleInput` — so
|
|
344
|
+
* awaiting Pi's copy here is not an option.
|
|
337
345
|
*/
|
|
338
346
|
function copyWithNotice(receiver: MouseCapablePrototype, showNotice: boolean): void {
|
|
339
347
|
if (showNotice) {
|
package/package.json
CHANGED
|
@@ -1,60 +1,59 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
2
|
+
"name": "@xzzpig/pi-starline",
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"description": "A Starship-inspired statusline and Opencode-style TUI for Pi.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/Andy8647/pi-starline.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/Andy8647/pi-starline#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Andy8647/pi-starline/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"pi-package",
|
|
17
|
+
"pi-extension",
|
|
18
|
+
"pi-theme",
|
|
19
|
+
"starship",
|
|
20
|
+
"tui"
|
|
21
|
+
],
|
|
22
|
+
"files": [
|
|
23
|
+
"extensions"
|
|
24
|
+
],
|
|
25
|
+
"peerDependencies": {
|
|
26
|
+
"@earendil-works/pi-ai": ">=0.84.0",
|
|
27
|
+
"@earendil-works/pi-coding-agent": ">=0.84.0",
|
|
28
|
+
"@earendil-works/pi-tui": ">=0.84.0"
|
|
29
|
+
},
|
|
30
|
+
"pi": {
|
|
31
|
+
"extensions": [
|
|
32
|
+
"./extensions"
|
|
33
|
+
],
|
|
34
|
+
"image": "https://raw.githubusercontent.com/Andy8647/pi-starline/main/assets/starline.png"
|
|
35
|
+
},
|
|
36
|
+
"publishConfig": {
|
|
37
|
+
"access": "public"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"@biomejs/biome": "^2.5.0",
|
|
41
|
+
"@earendil-works/pi-ai": "^0.84.2",
|
|
42
|
+
"@earendil-works/pi-coding-agent": "^0.84.2",
|
|
43
|
+
"@earendil-works/pi-tui": "^0.84.2",
|
|
44
|
+
"@types/node": "^26.0.0",
|
|
45
|
+
"typescript": "^7.0.2",
|
|
46
|
+
"vitest": "^4.1.8"
|
|
47
|
+
},
|
|
48
|
+
"scripts": {
|
|
49
|
+
"lint": "biome check .",
|
|
50
|
+
"typecheck": "tsc --noEmit",
|
|
51
|
+
"test": "vitest run",
|
|
52
|
+
"pi:dev": "${PI_BIN:-/opt/homebrew/bin/pi} --no-extensions -e ./extensions/starline/index.ts",
|
|
53
|
+
"pi:install-local": "${PI_BIN:-/opt/homebrew/bin/pi} install ./ -l",
|
|
54
|
+
"fmt": "biome format --write .",
|
|
55
|
+
"fmt:check": "biome format --check .",
|
|
56
|
+
"verify": "npm run lint && npm run typecheck && npm run test",
|
|
57
|
+
"pack:check": "npm pack --dry-run"
|
|
58
|
+
}
|
|
59
|
+
}
|