@xzzpig/pi-starline 0.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.
Files changed (45) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +223 -0
  3. package/extensions/starline/config.ts +1317 -0
  4. package/extensions/starline/editor-cursor.ts +55 -0
  5. package/extensions/starline/editor-factory-marker.ts +49 -0
  6. package/extensions/starline/editor-metadata-format.ts +259 -0
  7. package/extensions/starline/extension-status.ts +88 -0
  8. package/extensions/starline/footer-format.ts +279 -0
  9. package/extensions/starline/footer.ts +744 -0
  10. package/extensions/starline/format.ts +473 -0
  11. package/extensions/starline/git.ts +467 -0
  12. package/extensions/starline/icons.ts +294 -0
  13. package/extensions/starline/index.ts +651 -0
  14. package/extensions/starline/live-context.ts +75 -0
  15. package/extensions/starline/mouse/capabilities.ts +207 -0
  16. package/extensions/starline/mouse/component-tree.ts +230 -0
  17. package/extensions/starline/mouse/editor-caret.ts +498 -0
  18. package/extensions/starline/mouse/editor-hit-test.ts +133 -0
  19. package/extensions/starline/mouse/editor-mouse.ts +142 -0
  20. package/extensions/starline/mouse/editor-scroll.ts +119 -0
  21. package/extensions/starline/mouse/editor-text-cursor.ts +209 -0
  22. package/extensions/starline/mouse/editor-text-edit.ts +90 -0
  23. package/extensions/starline/mouse/hint.ts +14 -0
  24. package/extensions/starline/mouse/hit-test.ts +144 -0
  25. package/extensions/starline/mouse/index.ts +1119 -0
  26. package/extensions/starline/mouse/selection-state.ts +68 -0
  27. package/extensions/starline/mouse/tool-box.ts +290 -0
  28. package/extensions/starline/mouse/transcript-copy.ts +166 -0
  29. package/extensions/starline/mouse/word-select.ts +145 -0
  30. package/extensions/starline/package-version.ts +650 -0
  31. package/extensions/starline/paste-collapse.ts +312 -0
  32. package/extensions/starline/pill-config.ts +122 -0
  33. package/extensions/starline/pill.ts +295 -0
  34. package/extensions/starline/project-refresh.ts +104 -0
  35. package/extensions/starline/project-state.ts +66 -0
  36. package/extensions/starline/prototype-patch-registry.ts +136 -0
  37. package/extensions/starline/runtime.ts +841 -0
  38. package/extensions/starline/selector-border.ts +77 -0
  39. package/extensions/starline/session-lifecycle.ts +60 -0
  40. package/extensions/starline/settings-command.ts +925 -0
  41. package/extensions/starline/state.ts +65 -0
  42. package/extensions/starline/style.ts +528 -0
  43. package/extensions/starline/ui.ts +611 -0
  44. package/extensions/starline/user-message.ts +267 -0
  45. package/package.json +60 -0
package/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025-2026 Luka
4
+ Copyright (c) 2026 Andy
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in all
14
+ copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,223 @@
1
+ # Starline
2
+
3
+ A Starship-inspired statusline and Opencode-style TUI for [Pi](https://pi.dev).
4
+
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
+
7
+ ## Screenshots
8
+
9
+ ![Starline](https://raw.githubusercontent.com/Andy8647/pi-starline/main/assets/starline.png)
10
+
11
+ ## What is this?
12
+
13
+ Starline brings two popular aesthetics to Pi:
14
+
15
+ - **[Starship](https://starship.rs/) footer** — shows your current directory, git branch, git status indicators, and runtime/version detection in a compact, icon-rich format
16
+ - **[Opencode](https://github.com/opencode-ai/opencode) editor** — clean bordered input box with accent rail, copy-friendly mode, and model/provider display inside the editor frame
17
+
18
+ ## Features
19
+
20
+ ### Footer (Starship-inspired)
21
+
22
+ - `dirname` — current directory (`basename` by default; optional `full` path with directory depth via `pathDisplay`)
23
+ - `on branch` — git branch with icon
24
+ - `[!?↑]` — git status indicators (modified, untracked, ahead/behind, stashed, etc.)
25
+ - `via v5.5.0` — runtime detection with version and Starship-style Nerd Font runtime/language modules
26
+ - Optional segments (off by default): session name, `user@host`, current time, OS icon, session duration, and the **project package version** (e.g. `package.json` → `0.6.0`) — distinct from the runtime segment, which shows the installed toolchain
27
+ - Right side shows context usage, token counts, and cost
28
+ - Built-in footer segments can be shown or hidden individually from `/starline`
29
+ - Fully custom Starship-style layout via a `footerFormat` template string — see [Footer Format Template](https://github.com/Andy8647/pi-starline/blob/main/docs/configuration.md#footer-format-template)
30
+ - Third-party Pi extension statuses from `ctx.ui.setStatus()` can be shown on the left,
31
+ middle, or right side, or hidden per status key from `/starline`
32
+
33
+ ### Editor (Opencode-inspired)
34
+
35
+ - Bordered input box with configurable accent rail and border colors
36
+ - Model name and provider displayed inside the editor frame
37
+ - Configurable model, provider, and thinking-level indicator colors
38
+ - Prompt-box-style user messages matching the Starline input chrome
39
+ - Copy-friendly mode hides editor and previous-message rail glyphs so terminal selection copies less chrome
40
+ - **Fixed editor** (experimental, opt-in): Pin the editor and footer at the bottom of the terminal while the transcript scrolls above
41
+
42
+ ### Git Status Icons
43
+
44
+ <details>
45
+ <summary>The indicators and what they mean</summary>
46
+
47
+ | Icon | Meaning |
48
+ | ---- | ---------- |
49
+ | `!` | Modified |
50
+ | `?` | Untracked |
51
+ | `+` | Staged |
52
+ | `✘` | Deleted |
53
+ | `»` | Renamed |
54
+ | `=` | Conflicted |
55
+ | `$` | Stashed |
56
+ | `↑` | Ahead |
57
+ | `↓` | Behind |
58
+ | `⇕` | Diverged |
59
+
60
+ </details>
61
+
62
+ ### Runtime Detection
63
+
64
+ Detects Starship Nerd Font runtime/language modules, uses the Starship Nerd Font symbols, and keeps Starship-style defaults such as `bold green` for Node.js. By default Starline maps those styles through your active Pi theme; switch the Starship/footer color source to `terminal` in `/starline` if you want your terminal colorscheme to supply the exact ANSI colors.
65
+
66
+ <details>
67
+ <summary>All 57 detected runtimes and how they are recognised</summary>
68
+
69
+ | Runtime/language | Detection examples |
70
+ | ---------------- | ------------------------------------------------------------- |
71
+ | Buf | `buf.yaml`, `buf.gen.yaml`, `buf.work.yaml` |
72
+ | Bun | `bun.lock`, `bun.lockb` |
73
+ | C | `.c`, `.h` files |
74
+ | C++ | `.cpp`, `.cc`, `.cxx`, `.hpp` files |
75
+ | CMake | `CMakeLists.txt`, `CMakeCache.txt` |
76
+ | COBOL | `.cbl`, `.cob` files |
77
+ | Conda | `CONDA_DEFAULT_ENV` environment |
78
+ | Crystal | `.cr` files, `shard.yml` |
79
+ | Dart | `.dart` files, `pubspec.yaml`, `.dart_tool/` |
80
+ | Deno | `deno.json`, `deno.jsonc`, `deno.lock` |
81
+ | .NET | `.csproj`, `.fsproj`, `global.json`, `Directory.Build.*` |
82
+ | Elixir | `mix.exs` |
83
+ | Elm | `.elm` files, `elm.json`, `elm-stuff/` |
84
+ | Erlang | `rebar.config`, `erlang.mk` |
85
+ | Fennel | `.fnl` files |
86
+ | Fortran | `.f`, `.f90`, `.f95`, `.f03`, `.f08`, `.f18`, `fpm.toml` |
87
+ | Gleam | `.gleam` files, `gleam.toml` |
88
+ | Go | `go.mod` |
89
+ | Gradle | `build.gradle`, `build.gradle.kts`, `gradle/` |
90
+ | Guix shell | `GUIX_ENVIRONMENT` environment |
91
+ | Haskell | `.hs`, `.cabal`, `stack.yaml`, `cabal.project` |
92
+ | Haxe | `.hx`, `.hxml`, `haxelib.json`, `.haxerc` |
93
+ | Helm | `helmfile.yaml`, `Chart.yaml` |
94
+ | Java | `.java-version` |
95
+ | Julia | `.jl` files, `Project.toml`, `Manifest.toml` |
96
+ | Kotlin | `.kt`, `.kts` files |
97
+ | Lua | `.lua` files, `stylua.toml`, `.luarc.json`, `lua/` dir |
98
+ | Maven | `pom.xml` |
99
+ | Meson | `MESON_DEVENV=1` and `MESON_PROJECT_NAME` environment |
100
+ | Mojo | `.mojo` files |
101
+ | Nim | `.nim`, `.nims`, `.nimble`, `nim.cfg` |
102
+ | Nix shell | `IN_NIX_SHELL=pure` or `IN_NIX_SHELL=impure` environment |
103
+ | Node.js | `package.json`, `.nvmrc`, `.node-version` |
104
+ | OCaml | `.opam`, `.ml`, `.mli`, `dune`, `_opam/`, `esy.lock/` |
105
+ | Odin | `.odin` files |
106
+ | OPA/Rego | `.rego` files |
107
+ | Perl | `.pl`, `.pm`, `Makefile.PL`, `cpanfile`, `META.*` |
108
+ | PHP | `composer.json` |
109
+ | Pixi | `pixi.toml`, `pixi.lock`, `PIXI_ENVIRONMENT_NAME` environment |
110
+ | Pulumi | `Pulumi.yaml`, `Pulumi.yml` |
111
+ | PureScript | `.purs` files, `spago.dhall`, `spago.yaml`, `spago.lock` |
112
+ | Python | `pyproject.toml`, `requirements.txt`, `setup.py`, `Pipfile` |
113
+ | R | `.R`, `.Rmd`, `.Rproj`, `DESCRIPTION`, `.Rproj.user/` |
114
+ | Raku | `.raku`, `.rakumod`, `.p6`, `.pm6`, `META6.json` |
115
+ | Red | `.red`, `.reds` files |
116
+ | Ruby | `Gemfile`, `.ruby-version` |
117
+ | Rust | `Cargo.toml` |
118
+ | Scala | `.scala`, `.sbt`, `build.sbt`, `.metals/` |
119
+ | Solidity | `.sol` files |
120
+ | Spack | `SPACK_ENV` environment |
121
+ | Swift | `.swift` files, `Package.swift` |
122
+ | Terraform | `.tf`, `.tfplan`, `.tfstate`, `.terraform/` |
123
+ | Typst | `.typ` files, `template.typ` |
124
+ | Vagrant | `Vagrantfile` |
125
+ | V | `.v` files, `v.mod`, `vpkg.json` |
126
+ | Xmake | `xmake.lua` |
127
+ | Zig | `.zig` files, `build.zig` |
128
+
129
+ </details>
130
+
131
+ ## Install
132
+
133
+ ```bash
134
+ # From npm (local fork @xzzpig/pi-starline)
135
+ pi install npm:@xzzpig/pi-starline
136
+
137
+ # From upstream git
138
+ pi install git:github.com/Andy8647/pi-starline
139
+ ```
140
+
141
+ Coming from pi-zentui? Run `mv ~/.pi/agent/zentui.json ~/.pi/agent/starline.json` to carry your config over — Starline does not read the old file automatically. Inside it, rename any `colorMode: "zentui"` value to `colorMode: "themed"`.
142
+
143
+ What changed in each version, and what you need to do about it: **[Changelog](https://github.com/Andy8647/pi-starline/blob/main/CHANGELOG.md)**.
144
+
145
+ ## Config
146
+
147
+ Settings live in `~/.pi/agent/starline.json`. The file is optional — anything missing falls back to a default, and unknown keys are ignored at runtime.
148
+
149
+ ```json
150
+ {
151
+ "footerStyle": "pill",
152
+ "colors": { "gitBranch": "bold purple" },
153
+ "mouse": { "copyOnSelect": false }
154
+ }
155
+ ```
156
+
157
+ `/starline` opens an interactive menu for the settings worth changing day to day: colour sources, feature toggles, which built-in segments show, and where third-party extension statuses go. `Tab` and `Shift+Tab` move between its five sections.
158
+
159
+ **[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
+
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
+ ## Requirements
182
+
183
+ - [Pi](https://pi.dev) coding agent 0.80.3 or newer
184
+ - A [Nerd Font](https://www.nerdfonts.com/) for icons (or set `icons.mode` to `"ascii"`)
185
+
186
+ ## Development
187
+
188
+ ```bash
189
+ npm install
190
+ npm run verify
191
+ npm run fmt
192
+ npm run pack:check
193
+ ```
194
+
195
+ ### Test in Pi
196
+
197
+ The project keeps Pi core packages as peer dependencies for runtime and dev dependencies for
198
+ typechecking. To avoid accidentally running the local `node_modules/.bin/pi` shim, the dev scripts use
199
+ the globally installed Pi binary by default:
200
+
201
+ ```bash
202
+ npm run pi:dev
203
+ npm run pi:install-local
204
+ ```
205
+
206
+ Override the binary if your Pi install is somewhere else:
207
+
208
+ ```bash
209
+ PI_BIN=/path/to/pi npm run pi:dev
210
+ ```
211
+
212
+ ## Credits
213
+
214
+ Forked from [pi-zentui](https://github.com/lmilojevicc/pi-zentui) by Luka, whose work is the foundation of this project.
215
+
216
+ Inspired by:
217
+
218
+ - [Starship](https://starship.rs/) — the minimal, blazing-fast, and infinitely customizable prompt
219
+ - [Opencode](https://github.com/opencode-ai/opencode) — terminal-based AI coding assistant
220
+
221
+ ## License
222
+
223
+ MIT