@lune_99/pi-dock 0.0.0-stage → 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.
- package/CHANGELOG.md +80 -0
- package/LICENSE +21 -0
- package/README.md +83 -2
- package/docs/dock-overview.png +0 -0
- package/docs/dock-overview.svg +12 -0
- package/docs/dock-styles.png +0 -0
- package/docs/dock-styles.svg +30 -0
- package/docs/reference.md +188 -0
- package/package.json +63 -5
- package/src/dock-controller.ts +428 -0
- package/src/dock-footer.ts +212 -0
- package/src/dock-panel.ts +164 -0
- package/src/dock-renderer.ts +104 -0
- package/src/dock-settings.ts +32 -0
- package/src/dock-status.ts +421 -0
- package/src/index.ts +46 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [Unreleased]
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **Persistent Dock settings.** `/dock` controls on/off, base/detail/full density, plugin visibility
|
|
8
|
+
and numeric order. Changes apply immediately, restore independent plugin status bars when off,
|
|
9
|
+
and persist across Pi restarts.
|
|
10
|
+
|
|
11
|
+
- **Unified one-line Lune dock.** Shell Inspector and Ask Question share one below-editor
|
|
12
|
+
row with plugin-owned presentations, keyboard selection and direct panel opening.
|
|
13
|
+
Closing a panel restores dock focus, and disabling the host restores each independent dock.
|
|
14
|
+
- **Shared scoped Dock protocol.** Contributors share a registry across installed Core copies,
|
|
15
|
+
with explicit registration and host ownership lifetimes for session changes and reloads.
|
|
16
|
+
- **Plugin-owned single-line presentations.** Base/detail/full Components provide increasing
|
|
17
|
+
horizontal information density. Plugins own content, markers and theme styling.
|
|
18
|
+
- **Focus marks and key hints.** Focus marks the selected item with `❯` and draws
|
|
19
|
+
`←→ select · enter open · esc back` on the rule under the cells, shortened as the terminal
|
|
20
|
+
narrows, while Home and End jump to the first and last module. Selecting an item never moves
|
|
21
|
+
its neighbors.
|
|
22
|
+
- **A steady scrolling window.** A row too wide for its terminal keeps its window and moves it
|
|
23
|
+
only when the selection would leave it, counting the items outside each edge (`‹2` before,
|
|
24
|
+
`3›` after). The window lives on the controller, so it survives Pi recreating the widget component.
|
|
25
|
+
- **Model, directory and usage rows.** The dock shows `(provider) model • thinking` beside the
|
|
26
|
+
cells and the working directory, git branch and token, cache, cost and context statistics
|
|
27
|
+
beneath them, all read through Pi's extension API. Each statistic has a fixed-width slot, so
|
|
28
|
+
changing numbers never shift their neighbours, and a slot or counter with no data yet is not
|
|
29
|
+
drawn. Narrow terminals drop whole slots by terminal width alone, then shorten the directory
|
|
30
|
+
from the left.
|
|
31
|
+
- **Selectable dock styles.** `ruled`, `boxed`, `compact`, `minimal` and `classic` frame the same
|
|
32
|
+
rows differently, and switches hide the model, directory or usage. The panel previews the
|
|
33
|
+
candidate style, focused, before it is saved.
|
|
34
|
+
- **Settings through Pi Lune Core.** Dock settings are a typed Core namespace (`lune-dock`) with
|
|
35
|
+
global and project scopes, and `/dock` opens its section of Core's settings panel.
|
|
36
|
+
- **Visual README.** Introduce the extension with feature highlights, npm installation steps and previews rendered from its real TUI components. Regenerate the SVG and PNG assets with `npm run docs:images`; Dock previews use Claude Opus 5.5 as their fixed model example.
|
|
37
|
+
|
|
38
|
+
### Fixed
|
|
39
|
+
|
|
40
|
+
- **Running shells use a yellow marker.** Shell Inspector owns its running, completed and
|
|
41
|
+
failed presentation colors.
|
|
42
|
+
- **Returning to the editor with Up does not recall history.** The dock consumes Up after
|
|
43
|
+
restoring editor focus, so the same key cannot also select the previous submitted input.
|
|
44
|
+
- **Releasing a key no longer abandons dock Focus.** A terminal key-release event is ignored
|
|
45
|
+
instead of falling through to the editor handoff branch, which treated it as typing.
|
|
46
|
+
|
|
47
|
+
### Changed
|
|
48
|
+
|
|
49
|
+
- **Context use reads `used/window · share`.** The cell shows the tokens in use over the window, then
|
|
50
|
+
the share (`209k/272k · 76.8%`), instead of the share over the window. It is 7 columns wider, so
|
|
51
|
+
narrow terminals now drop the cache, hit-rate, token and cost slots a little earlier.
|
|
52
|
+
|
|
53
|
+
- **Published Core dependency.** Require `@lune_99/pi-lune-core@^0.1.0` from npm instead of a sibling checkout. Core remains a mandatory runtime dependency for shared infrastructure and settings.
|
|
54
|
+
|
|
55
|
+
- **BREAKING: settings moved to Pi Lune Core.** The `contributions` map and
|
|
56
|
+
`lune-extensions-settings/lune-dock-settings.json` are replaced by `hidden` and `order` in
|
|
57
|
+
`<agentDir>/lune-settings/lune-dock.json`. The old file is not imported: the Dock has never
|
|
58
|
+
been released. The package now needs `@lune_99/pi-lune-core`, `typebox` and
|
|
59
|
+
`@earendil-works/pi-coding-agent` / `pi-tui` 1.0.4 or newer.
|
|
60
|
+
|
|
61
|
+
- **The dock replaces Pi's built-in footer.** It carries the footer's model, directory and usage
|
|
62
|
+
information itself, and extension statuses set with `ctx.ui.setStatus()` follow on their own row.
|
|
63
|
+
The `classic` style or turning the dock off keeps or restores Pi's footer. Pi allows one custom
|
|
64
|
+
footer, so another extension installing its own replaces the dock's.
|
|
65
|
+
|
|
66
|
+
- **Dock protocol from Core.** The host uses `@lune_99/pi-lune-core/dock` and
|
|
67
|
+
`/dock/host` for shared contribution registration and host ownership.
|
|
68
|
+
|
|
69
|
+
- **BREAKING: Lune Protocol v1 Draft 3.** `LuneDockSnapshot` contains required base and optional
|
|
70
|
+
detail/full Components, each rendering exactly one line. Providers expose getSnapshot,
|
|
71
|
+
subscribe and activate; full remains separate from plugin interaction. Remove DockItem,
|
|
72
|
+
status/color/count fields and plugin ordering. Migrate the host and both plugins together;
|
|
73
|
+
the lifecycle adapter now accepts getSnapshot(ctx) and activate(ctx).
|
|
74
|
+
- **Snapshot lifecycle.** Complete updates atomically replace all levels, hidden providers keep
|
|
75
|
+
publishing, and invalidation reaches every current Component. Settings persist placement only;
|
|
76
|
+
presentation snapshots remain ephemeral.
|
|
77
|
+
- **Cells are separated by a dim vertical bar.** Contributions in one row are joined with ` │ `
|
|
78
|
+
instead of blank padding, so module boundaries stay readable in a wide row.
|
|
79
|
+
- **Document dock rendering rules.** Explain how the 12-column estimate limits visible
|
|
80
|
+
cells and how scrolling keeps the selected item in view.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nouvelle-Lune
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,84 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Lune Dock
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/@lune_99/pi-dock) [](https://www.npmjs.com/package/@lune_99/pi-dock) [](LICENSE)
|
|
4
|
+
|
|
5
|
+

|
|
6
|
+
|
|
7
|
+
**A keyboard-operated dock for [Pi](https://pi.dev), with Lune tools and session statistics in one place.**
|
|
8
|
+
|
|
9
|
+
Lune Dock brings running shells, pending questions and session usage below the editor. Select a module and press Enter to open its panel, then return to the dock when you close it. Your model, working directory and context use stay alongside the tools.
|
|
10
|
+
|
|
11
|
+
## Quick start
|
|
12
|
+
|
|
13
|
+
Install from npm:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
pi install npm:@lune_99/pi-dock
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then start Pi normally:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pi
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Dock starts enabled with the `ruled` style. Lune Shell Inspector and Lune Ask Question add their modules when installed.
|
|
26
|
+
|
|
27
|
+
## What it does
|
|
28
|
+
|
|
29
|
+
- **Brings Lune's signals together.** Shell Inspector shows job activity; Ask Question shows pending requests. Each module opens its existing panel directly.
|
|
30
|
+
- **Gets you there from the keyboard.** Press Down in an empty editor, choose a module with Left/Right, and press Enter. Closing the panel returns focus to the dock.
|
|
31
|
+
- **Keeps the session in view.** The model and thinking level sit beside the modules. The next row carries the working directory, branch, tokens, cache, cost and context use.
|
|
32
|
+
- **Holds the numbers steady.** Usage counters occupy fixed-width slots, so changing values do not shuffle neighboring statistics.
|
|
33
|
+
- **Fits the space you have.** Narrow terminals shorten the directory and drop whole statistic slots. A crowded module row scrolls around your selection.
|
|
34
|
+
- **Lets you choose the density.** Pick a style, adjust module detail, hide modules or change their order. Settings apply immediately and persist across sessions.
|
|
35
|
+
|
|
36
|
+
## Dock styles
|
|
37
|
+
|
|
38
|
+

|
|
39
|
+
|
|
40
|
+
| Style | |
|
|
41
|
+
| --- | --- |
|
|
42
|
+
| `ruled` · default | Rules around the module/model row and directory/usage row |
|
|
43
|
+
| `boxed` | The same information in a rounded frame |
|
|
44
|
+
| `compact` | Two rows with no frame |
|
|
45
|
+
| `minimal` | One row with modules, model and context use |
|
|
46
|
+
| `classic` | Modules only, with Pi's existing footer |
|
|
47
|
+
|
|
48
|
+
Run `/dock` to preview and choose a style. Every style except `classic` replaces Pi's built-in footer; choose `classic` when another extension uses that footer. Folder and branch icons use Nerd Font glyphs.
|
|
49
|
+
|
|
50
|
+
## Keyboard controls
|
|
51
|
+
|
|
52
|
+
| Where | Key | Action |
|
|
53
|
+
| --- | --- | --- |
|
|
54
|
+
| Empty editor | `↓` | Focus Dock |
|
|
55
|
+
| Editor | `Super+↓` | Focus Dock while preserving your text |
|
|
56
|
+
| Dock | `←` / `→` | Select a module |
|
|
57
|
+
| Dock | `Home` / `End` | Jump to the first / last module |
|
|
58
|
+
| Dock | `Enter` | Open its panel |
|
|
59
|
+
| Dock | `↑` / `Esc` | Return to the editor |
|
|
60
|
+
| Dock | Type or paste | Return to the editor and deliver the input |
|
|
61
|
+
|
|
62
|
+
`Super` is Command on macOS. Editor shortcuts leave autocomplete and other open panels alone; ordinary Down also leaves non-empty editor text alone.
|
|
63
|
+
|
|
64
|
+
## Dock settings
|
|
65
|
+
|
|
66
|
+
`/dock` controls the style, module detail, model/workspace/usage rows, hidden modules and module order. `Ctrl+G` switches global/project scope; `Ctrl+R` removes the selected override.
|
|
67
|
+
|
|
68
|
+
Turning Dock off restores Pi's footer and each contributor's independent status bar. Their commands and panels stay available.
|
|
69
|
+
|
|
70
|
+
See the [reference guide](docs/reference.md) for settings details and extension integration.
|
|
71
|
+
|
|
72
|
+
## Development
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
npm install
|
|
76
|
+
npm test
|
|
77
|
+
npm run typecheck
|
|
78
|
+
npm run tui:demo
|
|
79
|
+
npm run docs:images # regenerate docs/*.svg + docs/*.png (needs rsvg-convert)
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
## License
|
|
83
|
+
|
|
84
|
+
MIT
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1098.18" height="167" viewBox="0 0 1098.18 167" font-family="Menlo, FiraCode Nerd Font Mono, monospace" font-size="14" xml:space="preserve" role="img" aria-label="pi — select a module, press Enter, get back to work">
|
|
2
|
+
<title>pi — select a module, press Enter, get back to work</title>
|
|
3
|
+
<rect width="1098.18" height="167" rx="10" fill="#181a1b"/>
|
|
4
|
+
<rect width="1098.18" height="34" rx="10" fill="#768186" opacity="0.25"/>
|
|
5
|
+
<circle cx="24" cy="17" r="5" fill="#ff5f57"/><circle cx="42" cy="17" r="5" fill="#febc2e"/><circle cx="60" cy="17" r="5" fill="#28c840"/>
|
|
6
|
+
<text x="80" y="22" fill="#9da5a9" font-size="13">pi — select a module, press Enter, get back to work</text>
|
|
7
|
+
<text x="18.00" y="65.97" fill="#768186" textLength="1062.18" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text>
|
|
8
|
+
<rect x="26.43" y="71.40" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="85.37" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="26.43" y="85.37" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="186.60" y="85.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="211.89" y="85.37" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="422.64" y="85.37" fill="#dee0e1" textLength="354.06" lengthAdjust="spacingAndGlyphs"> </text><text x="776.70" y="85.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="801.99" y="85.37" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="903.15" y="85.37" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="1029.60" y="85.37" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text>
|
|
9
|
+
<text x="18.00" y="104.77" fill="#768186" textLength="758.70" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────</text><text x="776.70" y="104.77" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="785.13" y="104.77" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text><text x="1063.32" y="104.77" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="1071.75" y="104.77" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">─</text>
|
|
10
|
+
<text x="18.00" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="26.43" y="124.17" fill="#9da5a9" textLength="151.74" lengthAdjust="spacingAndGlyphs"> ~/projects/lune</text><text x="178.17" y="124.17" fill="#a798d7" textLength="84.30" lengthAdjust="spacingAndGlyphs"> (main)</text><text x="262.47" y="124.17" fill="#dee0e1" textLength="219.18" lengthAdjust="spacingAndGlyphs"> </text><text x="481.65" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="506.94" y="124.17" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↑</text><text x="515.37" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="523.80" y="124.17" fill="#9da5a9" textLength="25.29" lengthAdjust="spacingAndGlyphs">28k</text><text x="549.09" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="557.52" y="124.17" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↓</text><text x="565.95" y="124.17" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">5.6k</text><text x="599.67" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="624.96" y="124.17" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">R</text><text x="633.39" y="124.17" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">187k</text><text x="667.11" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="692.40" y="124.17" fill="#9da5a9" textLength="16.86" lengthAdjust="spacingAndGlyphs">CH</text><text x="709.26" y="124.17" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">98.9%</text><text x="751.41" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="785.13" y="124.17" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="835.71" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="861.00" y="124.17" fill="#9da5a9" textLength="143.31" lengthAdjust="spacingAndGlyphs"> 27k/1.0M · 2.7%</text><text x="1004.31" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="1029.60" y="124.17" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs">(auto)</text>
|
|
11
|
+
<text x="18.00" y="143.57" fill="#768186" textLength="1062.18" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text>
|
|
12
|
+
</svg>
|
|
Binary file
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="1098.18" height="516.2" viewBox="0 0 1098.18 516.2" font-family="Menlo, FiraCode Nerd Font Mono, monospace" font-size="14" xml:space="preserve" role="img" aria-label="pi — five styles, the same tools at your fingertips">
|
|
2
|
+
<title>pi — five styles, the same tools at your fingertips</title>
|
|
3
|
+
<rect width="1098.18" height="516.2" rx="10" fill="#181a1b"/>
|
|
4
|
+
<rect width="1098.18" height="34" rx="10" fill="#768186" opacity="0.25"/>
|
|
5
|
+
<circle cx="24" cy="17" r="5" fill="#ff5f57"/><circle cx="42" cy="17" r="5" fill="#febc2e"/><circle cx="60" cy="17" r="5" fill="#28c840"/>
|
|
6
|
+
<text x="80" y="22" fill="#9da5a9" font-size="13">pi — five styles, the same tools at your fingertips</text>
|
|
7
|
+
<text x="18.00" y="65.97" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs"> ruled</text>
|
|
8
|
+
<text x="18.00" y="85.37" fill="#768186" textLength="1062.18" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text>
|
|
9
|
+
<rect x="26.43" y="90.80" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="104.77" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="26.43" y="104.77" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="186.60" y="104.77" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="211.89" y="104.77" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="422.64" y="104.77" fill="#dee0e1" textLength="354.06" lengthAdjust="spacingAndGlyphs"> </text><text x="776.70" y="104.77" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="801.99" y="104.77" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="903.15" y="104.77" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="1029.60" y="104.77" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text>
|
|
10
|
+
<text x="18.00" y="124.17" fill="#768186" textLength="758.70" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────</text><text x="776.70" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="785.13" y="124.17" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text><text x="1063.32" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="1071.75" y="124.17" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">─</text>
|
|
11
|
+
<text x="18.00" y="143.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="26.43" y="143.57" fill="#9da5a9" textLength="151.74" lengthAdjust="spacingAndGlyphs"> ~/projects/lune</text><text x="178.17" y="143.57" fill="#a798d7" textLength="84.30" lengthAdjust="spacingAndGlyphs"> (main)</text><text x="262.47" y="143.57" fill="#dee0e1" textLength="219.18" lengthAdjust="spacingAndGlyphs"> </text><text x="481.65" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="506.94" y="143.57" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↑</text><text x="515.37" y="143.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="523.80" y="143.57" fill="#9da5a9" textLength="25.29" lengthAdjust="spacingAndGlyphs">28k</text><text x="549.09" y="143.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="557.52" y="143.57" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↓</text><text x="565.95" y="143.57" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">5.6k</text><text x="599.67" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="624.96" y="143.57" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">R</text><text x="633.39" y="143.57" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">187k</text><text x="667.11" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="692.40" y="143.57" fill="#9da5a9" textLength="16.86" lengthAdjust="spacingAndGlyphs">CH</text><text x="709.26" y="143.57" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">98.9%</text><text x="751.41" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="143.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="785.13" y="143.57" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="835.71" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="861.00" y="143.57" fill="#9da5a9" textLength="143.31" lengthAdjust="spacingAndGlyphs"> 27k/1.0M · 2.7%</text><text x="1004.31" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="1029.60" y="143.57" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs">(auto)</text>
|
|
12
|
+
<text x="18.00" y="162.97" fill="#768186" textLength="1062.18" lengthAdjust="spacingAndGlyphs">──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text>
|
|
13
|
+
|
|
14
|
+
<text x="18.00" y="201.77" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs"> boxed</text>
|
|
15
|
+
<text x="18.00" y="221.17" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">╭</text><text x="26.43" y="221.17" fill="#768186" textLength="1045.32" lengthAdjust="spacingAndGlyphs">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text><text x="1071.75" y="221.17" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">╮</text>
|
|
16
|
+
<rect x="34.86" y="226.60" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="240.57" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">│</text><text x="26.43" y="240.57" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="34.86" y="240.57" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="195.03" y="240.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="220.32" y="240.57" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="431.07" y="240.57" fill="#dee0e1" textLength="328.77" lengthAdjust="spacingAndGlyphs"> </text><text x="759.84" y="240.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="785.13" y="240.57" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="886.29" y="240.57" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="1012.74" y="240.57" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text><text x="1063.32" y="240.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="1071.75" y="240.57" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">│</text>
|
|
17
|
+
<text x="18.00" y="259.97" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">├</text><text x="26.43" y="259.97" fill="#768186" textLength="741.84" lengthAdjust="spacingAndGlyphs">────────────────────────────────────────────────────────────────────────────────────────</text><text x="768.27" y="259.97" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="776.70" y="259.97" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text><text x="1054.89" y="259.97" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="1063.32" y="259.97" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">─</text><text x="1071.75" y="259.97" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">┤</text>
|
|
18
|
+
<text x="18.00" y="279.37" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">│</text><text x="26.43" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="34.86" y="279.37" fill="#9da5a9" textLength="151.74" lengthAdjust="spacingAndGlyphs"> ~/projects/lune</text><text x="186.60" y="279.37" fill="#a798d7" textLength="84.30" lengthAdjust="spacingAndGlyphs"> (main)</text><text x="270.90" y="279.37" fill="#dee0e1" textLength="193.89" lengthAdjust="spacingAndGlyphs"> </text><text x="464.79" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="490.08" y="279.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↑</text><text x="498.51" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="506.94" y="279.37" fill="#9da5a9" textLength="25.29" lengthAdjust="spacingAndGlyphs">28k</text><text x="532.23" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="540.66" y="279.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↓</text><text x="549.09" y="279.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">5.6k</text><text x="582.81" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="608.10" y="279.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">R</text><text x="616.53" y="279.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">187k</text><text x="650.25" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="675.54" y="279.37" fill="#9da5a9" textLength="16.86" lengthAdjust="spacingAndGlyphs">CH</text><text x="692.40" y="279.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">98.9%</text><text x="734.55" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="759.84" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="768.27" y="279.37" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="818.85" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="844.14" y="279.37" fill="#9da5a9" textLength="143.31" lengthAdjust="spacingAndGlyphs"> 27k/1.0M · 2.7%</text><text x="987.45" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="1012.74" y="279.37" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs">(auto)</text><text x="1063.32" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="1071.75" y="279.37" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">│</text>
|
|
19
|
+
<text x="18.00" y="298.77" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">╰</text><text x="26.43" y="298.77" fill="#768186" textLength="1045.32" lengthAdjust="spacingAndGlyphs">────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────</text><text x="1071.75" y="298.77" fill="#768186" textLength="8.43" lengthAdjust="spacingAndGlyphs">╯</text>
|
|
20
|
+
|
|
21
|
+
<text x="18.00" y="337.57" fill="#a798d7" textLength="67.44" lengthAdjust="spacingAndGlyphs"> compact</text>
|
|
22
|
+
<rect x="26.43" y="343.00" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="356.97" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="26.43" y="356.97" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="186.60" y="356.97" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="211.89" y="356.97" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="422.64" y="356.97" fill="#dee0e1" textLength="354.06" lengthAdjust="spacingAndGlyphs"> </text><text x="776.70" y="356.97" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="801.99" y="356.97" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text>
|
|
23
|
+
<text x="18.00" y="376.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="26.43" y="376.37" fill="#9da5a9" textLength="151.74" lengthAdjust="spacingAndGlyphs"> ~/projects/lune</text><text x="178.17" y="376.37" fill="#a798d7" textLength="84.30" lengthAdjust="spacingAndGlyphs"> (main)</text><text x="262.47" y="376.37" fill="#dee0e1" textLength="219.18" lengthAdjust="spacingAndGlyphs"> </text><text x="481.65" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="506.94" y="376.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↑</text><text x="515.37" y="376.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="523.80" y="376.37" fill="#9da5a9" textLength="25.29" lengthAdjust="spacingAndGlyphs">28k</text><text x="549.09" y="376.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="557.52" y="376.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">↓</text><text x="565.95" y="376.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">5.6k</text><text x="599.67" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="624.96" y="376.37" fill="#9da5a9" textLength="8.43" lengthAdjust="spacingAndGlyphs">R</text><text x="633.39" y="376.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">187k</text><text x="667.11" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="692.40" y="376.37" fill="#9da5a9" textLength="16.86" lengthAdjust="spacingAndGlyphs">CH</text><text x="709.26" y="376.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">98.9%</text><text x="751.41" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="376.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </text><text x="785.13" y="376.37" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="835.71" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="861.00" y="376.37" fill="#9da5a9" textLength="143.31" lengthAdjust="spacingAndGlyphs"> 27k/1.0M · 2.7%</text><text x="1004.31" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="1029.60" y="376.37" fill="#a798d7" textLength="50.58" lengthAdjust="spacingAndGlyphs">(auto)</text>
|
|
24
|
+
|
|
25
|
+
<text x="18.00" y="415.17" fill="#a798d7" textLength="67.44" lengthAdjust="spacingAndGlyphs"> minimal</text>
|
|
26
|
+
<rect x="26.43" y="420.60" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="434.57" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="26.43" y="434.57" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="186.60" y="434.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="211.89" y="434.57" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="422.64" y="434.57" fill="#dee0e1" textLength="354.06" lengthAdjust="spacingAndGlyphs"> </text><text x="776.70" y="434.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="801.99" y="434.57" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text>
|
|
27
|
+
|
|
28
|
+
<text x="18.00" y="473.37" fill="#a798d7" textLength="67.44" lengthAdjust="spacingAndGlyphs"> classic</text>
|
|
29
|
+
<rect x="26.43" y="478.80" width="160.17" height="19.4" fill="#213b49"/><text x="18.00" y="492.77" fill="#a798d7" textLength="8.43" lengthAdjust="spacingAndGlyphs">❯</text><text x="26.43" y="492.77" fill="#dee0e1" textLength="160.17" lengthAdjust="spacingAndGlyphs">○ Shell · 2 running</text><text x="186.60" y="492.77" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="211.89" y="492.77" fill="#dee0e1" textLength="210.75" lengthAdjust="spacingAndGlyphs">○ Ask · 1 pending request</text><text x="422.64" y="492.77" fill="#dee0e1" textLength="379.35" lengthAdjust="spacingAndGlyphs"> </text><text x="801.99" y="492.77" fill="#7e888e" textLength="278.19" lengthAdjust="spacingAndGlyphs">←→ select · enter open · esc back</text>
|
|
30
|
+
</svg>
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
[Back to the README](../README.md)
|
|
2
|
+
|
|
3
|
+
# Lune Dock
|
|
4
|
+
|
|
5
|
+
A compact, keyboard-operated status block below the Pi editor. It shows the model, working
|
|
6
|
+
directory and usage statistics, and holds one cell per Lune Pi extension. Select a cell with the
|
|
7
|
+
keyboard and press Enter to open its existing interface directly; there is no action menu.
|
|
8
|
+
|
|
9
|
+
```text
|
|
10
|
+
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
11
|
+
○ Shell · idle │ ○ Ask · idle │ (anthropic) claude-opus-5-5 • max
|
|
12
|
+
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
13
|
+
…/local-extensions/pi-recap (main) │ ↑ 28k ↓5.6k │ R187k │ CH98.9% │ $0.008 │ 27k/1.0M · 2.7% │ (auto)
|
|
14
|
+
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
The dock **replaces Pi's built-in footer**, so every statistic it showed stays visible:
|
|
18
|
+
|
|
19
|
+
| Row | Left | Right |
|
|
20
|
+
| --- | --- | --- |
|
|
21
|
+
| Dock | Module cells, one per contributing extension | `(provider) model • thinking level` |
|
|
22
|
+
| Info | Working directory, git branch, session name | Tokens `↑in ↓out`, cache `R`ead / `W`rite, `CH` cache hit, cost, context use (`used/window · share`), `(auto)` |
|
|
23
|
+
|
|
24
|
+
Statuses set by other extensions through `ctx.ui.setStatus()` follow on a row of their own.
|
|
25
|
+
Every statistic owns a slot of fixed width, right-aligned, so a changing number never moves the
|
|
26
|
+
ones beside it. A slot with no data yet is not drawn: a fresh session shows only context use and
|
|
27
|
+
`(auto)`, and the others appear once Pi reports tokens, cache or cost. A new slot never moves the
|
|
28
|
+
ones to its right or the right edge; only slots to its left make way.
|
|
29
|
+
|
|
30
|
+
Which slots are reserved depends on the terminal width alone: a narrow terminal drops cache, hit
|
|
31
|
+
rate, tokens, cost and `(auto)` in that order, always keeps context use, and gives the rest to the
|
|
32
|
+
working directory, which is shortened from the left against the full reservation so it does not
|
|
33
|
+
move either. Below 40 columns the model is hidden so the cells keep the whole row. Provider shows
|
|
34
|
+
only when more than one is available, and `(auto)` reflects the compaction setting read when the
|
|
35
|
+
session starts.
|
|
36
|
+
|
|
37
|
+
Every cell composes exactly one physical row. Plugins own their complete text, markers and theme
|
|
38
|
+
styling. Dock selects a level, allocates horizontal width, separates cells with a dim bar and
|
|
39
|
+
highlights the selected contribution. Focus adds `❯` and puts the key hints on the rule under the
|
|
40
|
+
cells, so they never change a cell's width allocation. With no contributions the model and info
|
|
41
|
+
rows still render.
|
|
42
|
+
|
|
43
|
+
Pi allows one custom footer: if another extension installs its own after the dock, that footer
|
|
44
|
+
replaces the dock's; choose the `classic` style or turn the dock off to avoid the clash. The
|
|
45
|
+
folder and branch icons are Nerd Font glyphs.
|
|
46
|
+
|
|
47
|
+
## Styles
|
|
48
|
+
|
|
49
|
+
Choose a style in `/dock`; the panel previews it, focused, before you commit.
|
|
50
|
+
|
|
51
|
+
| Style | Rows | Notes |
|
|
52
|
+
| --- | --- | --- |
|
|
53
|
+
| `ruled` (default) | Rule, dock + model, rule, directory + usage, rule | Key hints ride the rule under the cells |
|
|
54
|
+
| `boxed` | The same rows in a rounded box | Key hints ride the box's middle rule |
|
|
55
|
+
| `compact` | Dock + model, directory + usage | No frame; key hints replace the model while focused |
|
|
56
|
+
| `minimal` | Cells + model + context use | One row, plus extension statuses when present |
|
|
57
|
+
| `classic` | Cells only | Leaves Pi's own footer in place |
|
|
58
|
+
|
|
59
|
+
```text
|
|
60
|
+
╭──────────────────────────────────────────────────────────╮
|
|
61
|
+
│ ○ Shell · idle │ ○ Ask · idle │ model • max │ boxed
|
|
62
|
+
├──────────────────────────────────────────────────────────┤
|
|
63
|
+
│ ~/proj (main) │ ↑28k ↓5.6k │ 27k/1.0M · 2.7% │
|
|
64
|
+
╰──────────────────────────────────────────────────────────╯
|
|
65
|
+
|
|
66
|
+
○ Shell · idle │ ○ Ask · idle │ model • max compact
|
|
67
|
+
~/proj (main) │ ↑28k ↓5.6k │ 27k/1.0M · 2.7%
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
Every style except `classic` takes over Pi's footer. Three switches trim what those styles
|
|
71
|
+
show: model, directory (with branch) and usage. `minimal` ignores the directory and keeps only
|
|
72
|
+
context use from the usage counters.
|
|
73
|
+
|
|
74
|
+
## Installation
|
|
75
|
+
|
|
76
|
+
Lune Dock and its contributor extensions use the Dock protocol from
|
|
77
|
+
`@lune_99/pi-lune-extensions-core/dock`; Core also supplies the shared settings infrastructure.
|
|
78
|
+
```sh
|
|
79
|
+
pi install npm:@lune_99/pi-dock
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
Reload extensions in an existing Pi session with `/reload`, or start a new session.
|
|
83
|
+
The host is optional: removing it from Pi's active packages restores each contributor's
|
|
84
|
+
independent dock.
|
|
85
|
+
|
|
86
|
+
## Settings
|
|
87
|
+
|
|
88
|
+
Run `/dock` to open the **Dock** section.
|
|
89
|
+
Enter or Space cycles a value, Ctrl+G switches between the global and project scope,
|
|
90
|
+
and Ctrl+R removes the selected override. Changes apply immediately, including turning Dock
|
|
91
|
+
off, which removes the block and its keyboard listener and restores Pi's footer and each plugin's
|
|
92
|
+
independent status bar; plugin panels and commands stay usable.
|
|
93
|
+
|
|
94
|
+
| Setting | Values | Default |
|
|
95
|
+
| --- | --- | --- |
|
|
96
|
+
| `enabled` | on / off | on |
|
|
97
|
+
| `style` | `ruled`, `boxed`, `compact`, `minimal`, `classic` | `ruled` |
|
|
98
|
+
| `displayMode` | `base`, `detail`, `full` | `detail` |
|
|
99
|
+
| `showModel`, `showWorkspace`, `showUsage` | on / off | on |
|
|
100
|
+
| `hidden` | plugin ids left out of the dock | none |
|
|
101
|
+
| `order` | plugin id → position, smaller first (missing counts as 0) | registration order |
|
|
102
|
+
|
|
103
|
+
Values live in `~/.pi/agent/lune-settings/pi-dock.json` (`PI_CODING_AGENT_DIR` moves the agent
|
|
104
|
+
directory; project overrides are in `<project>/.pi/lune-settings/pi-dock.json`), and only
|
|
105
|
+
overrides are stored. Core writes the file owner-only. A project value beats a global one, which
|
|
106
|
+
beats the default, and untrusted projects are ignored. Invalid files and failed writes report
|
|
107
|
+
errors instead of silently resetting settings.
|
|
108
|
+
|
|
109
|
+
```json
|
|
110
|
+
{
|
|
111
|
+
"style": "boxed",
|
|
112
|
+
"hidden": ["ask-question"],
|
|
113
|
+
"order": { "shell-inspector": 10 }
|
|
114
|
+
}
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Keyboard interaction
|
|
118
|
+
|
|
119
|
+
| Context | Key | Result |
|
|
120
|
+
| --- | --- | --- |
|
|
121
|
+
| Main editor, empty and no autocomplete or overlay | Down | Focus the dock |
|
|
122
|
+
| Main editor, no autocomplete or overlay | Super+Down | Focus without clearing the text |
|
|
123
|
+
| Dock | Left / Right | Select previous / next module, wrapping at the ends |
|
|
124
|
+
| Dock | Home / End | Select the first / last module |
|
|
125
|
+
| Dock | Enter | Open the selected module directly |
|
|
126
|
+
| Dock | Up / Esc | Return to the editor without forwarding the navigation key |
|
|
127
|
+
| Dock | Typing, paste or an application shortcut | Return to the editor and deliver the input |
|
|
128
|
+
|
|
129
|
+
`Super` is Command on macOS. Delivery depends on the terminal's keyboard protocol and its
|
|
130
|
+
own shortcuts. Terminal key-release events are ignored, so releasing a key never hands focus
|
|
131
|
+
back to the editor. Ordinary Down always leaves non-empty editor text and other panels alone.
|
|
132
|
+
Custom main editors should extend Pi's `CustomEditor`, as recommended by Pi's editor contract.
|
|
133
|
+
|
|
134
|
+
Closing a panel opened from the dock returns to dock focus. If that module disappears,
|
|
135
|
+
selection moves to its nearest remaining neighbor; if all modules disappear, the editor
|
|
136
|
+
gets focus. A session shutdown, reload or tree jump invalidates pending focus restoration.
|
|
137
|
+
|
|
138
|
+
## Plugin presentations
|
|
139
|
+
|
|
140
|
+
Shell Inspector supplies base identity, a detail summary of running/completed/failed jobs, and
|
|
141
|
+
a full summary with the latest command and elapsed time. Unseen failures remain red; running
|
|
142
|
+
work uses yellow and completed history uses green. Opening and closing the inspector
|
|
143
|
+
acknowledges failures present at open, while later failures remain unseen. Only-failed history
|
|
144
|
+
stays red. This is plugin-owned, ephemeral view state.
|
|
145
|
+
|
|
146
|
+
Ask Question supplies base identity, pending request count in detail (requests, rather than
|
|
147
|
+
individual questions), and the next request's subject in full. Enter opens the existing
|
|
148
|
+
`/question` panel, including draft persistence on Esc. Both plugins remain registered when idle,
|
|
149
|
+
with an idle base. Visibility is controlled by Dock settings and never by plugin state.
|
|
150
|
+
|
|
151
|
+
The Dock protocol in Core (`@lune_99/pi-lune-extensions-core/dock`, protocol version 1) exposes `LuneDockSnapshot` and
|
|
152
|
+
`LuneDockProvider`: `getSnapshot()`, `subscribe(listener)` and `activate()`. Every supplied
|
|
153
|
+
Component renders exactly one line. Optional level resolution is deterministic: detail uses
|
|
154
|
+
detail or base; full uses full, detail or base. There are no status/count/color fields.
|
|
155
|
+
Snapshot updates atomically replace all levels and snapshots are never persisted.
|
|
156
|
+
|
|
157
|
+
Narrow terminals allocate bounded widths and keep a scrolling window around selection with
|
|
158
|
+
neutral counts of contributions outside each edge. Left/Right reaches every visible plugin.
|
|
159
|
+
This version uses manual display mode and per-Component clipping; automatic fit-based level
|
|
160
|
+
selection remains a future Dock implementation choice.
|
|
161
|
+
|
|
162
|
+
## Lifecycle and failures
|
|
163
|
+
|
|
164
|
+
The shared registry lives behind `Symbol.for("nouvelle-lune.lune-protocol.v1")` and is scoped by the
|
|
165
|
+
stable `ctx.ui` object for a Pi runner. Multiple installed protocol copies share that registry;
|
|
166
|
+
separate UI contexts do not share contributions. The contributor adapter owns registration and host-presence handling. Plugins call
|
|
167
|
+
`attach(ctx)` after restoring business state, `detach({ retired: true })` before replacing a
|
|
168
|
+
session, `refresh()` on state changes, and `detach()` at shutdown. Host infrastructure uses
|
|
169
|
+
the separate `/host` library entry point. Duplicate contribution IDs or active hosts throw.
|
|
170
|
+
|
|
171
|
+
The host announces presence only after its widget and input listener are installed.
|
|
172
|
+
Contributors then clear their own keyed widget; normal detachment restores standalone display.
|
|
173
|
+
Contributor updates are coalesced in one microtask, and output-only shell changes do not redraw
|
|
174
|
+
the compact row. Invalid single-line output throws a protocol contract error; opening and lifecycle errors
|
|
175
|
+
are reported visibly and never trigger a silent switch to standalone mode. Failed initialization releases the ownership it could not finish.
|
|
176
|
+
|
|
177
|
+
## Validation
|
|
178
|
+
|
|
179
|
+
```sh
|
|
180
|
+
npm run typecheck
|
|
181
|
+
npm test
|
|
182
|
+
npm run tui:demo
|
|
183
|
+
```
|
|
184
|
+
|
|
185
|
+
The demo uses local fixtures and the real Pi TUI, with no paid model call. Automated tests
|
|
186
|
+
cover protocol lifecycle, rendering, keyboard ownership, focus restoration, contributor status,
|
|
187
|
+
and coexistence with the existing independent docks. A visual demo is an observation, not
|
|
188
|
+
a substitute for those tests.
|
package/package.json
CHANGED
|
@@ -1,6 +1,64 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@lune_99/pi-dock",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A compact keyboard-operated dock for Lune Pi extensions",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"files": [
|
|
7
|
+
"src",
|
|
8
|
+
"docs",
|
|
9
|
+
"README.md",
|
|
10
|
+
"CHANGELOG.md",
|
|
11
|
+
"LICENSE"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public"
|
|
15
|
+
},
|
|
16
|
+
"pi": {
|
|
17
|
+
"extensions": [
|
|
18
|
+
"./src/index.ts"
|
|
19
|
+
],
|
|
20
|
+
"image": "./docs/dock-overview.png"
|
|
21
|
+
},
|
|
22
|
+
"scripts": {
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"test": "node --experimental-strip-types --test 'test/**/*.test.ts'",
|
|
25
|
+
"tui:demo": "node --experimental-strip-types test/tui/launch.ts",
|
|
26
|
+
"docs:images": "node --experimental-strip-types tools/make-doc-images.mjs"
|
|
27
|
+
},
|
|
28
|
+
"dependencies": {
|
|
29
|
+
"@lune_99/pi-lune-extensions-core": "^0.1.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"@earendil-works/pi-coding-agent": ">=1.0.4",
|
|
33
|
+
"@earendil-works/pi-tui": ">=1.0.4",
|
|
34
|
+
"typebox": ">=1.3.27"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@earendil-works/pi-coding-agent": "1.3.0",
|
|
38
|
+
"@earendil-works/pi-tui": "1.3.0",
|
|
39
|
+
"@types/node": "^22.20.2",
|
|
40
|
+
"typebox": "1.3.27",
|
|
41
|
+
"typescript": "5.9.3"
|
|
42
|
+
},
|
|
43
|
+
"engines": {
|
|
44
|
+
"node": ">=22.19.0"
|
|
45
|
+
},
|
|
46
|
+
"author": "Nouvelle-Lune",
|
|
47
|
+
"license": "MIT",
|
|
48
|
+
"keywords": [
|
|
49
|
+
"pi-package",
|
|
50
|
+
"pi",
|
|
51
|
+
"dock",
|
|
52
|
+
"lune",
|
|
53
|
+
"tui"
|
|
54
|
+
],
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "git+https://github.com/Nouvelle-Lune/lune-pi.git",
|
|
58
|
+
"directory": "packages/pi-dock"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://github.com/Nouvelle-Lune/lune-pi/tree/main/packages/pi-dock#readme",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/Nouvelle-Lune/lune-pi/issues"
|
|
63
|
+
}
|
|
64
|
+
}
|