@lune_99/pi-dock 0.0.0-stage → 0.2.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 ADDED
@@ -0,0 +1,117 @@
1
+ # Changelog
2
+
3
+ ## [Unreleased]
4
+
5
+ ## [0.2.0] - 2026-11-28
6
+
7
+ ### Added
8
+
9
+ - **Response token speed beside the model.** A `tok/s` segment shows the latest measured response's output tokens divided by Pi's measured response duration, dimmed after completion. Only positive, finite measurements are used; no live rate is estimated. Narrow terminals hide the entire segment before truncating the model, without changing the statistics row.
10
+
11
+ ### Changed
12
+
13
+ - **The info row keeps every statistic in place.** Each statistic keeps its own columns whether or
14
+ not it has data, so bars and labels no longer move when tokens, cache or cost first arrive, and
15
+ the divider before the dock row's model follows the info row's bars. Cache writes have their own
16
+ slot on the far left, so providers that never report them leave only blank space there. All
17
+ statistics now need 120 columns instead of 117.
18
+ - **The info row keeps the cache hit rate the longest.** Tokens and cost now give way before
19
+ `CH`, so a shrinking row keeps the hit rate beside context use and `(auto)` once cost is gone.
20
+ The drop order is cache writes, cache reads, tokens, cost, hit rate and `(auto)`; the hit-rate
21
+ slot survives down to 80 columns instead of 104, and cost down to 90 instead of 79.
22
+ - **The speed segment uses the thinking level's bullet.** `model • max • 48.2 tok/s` replaces the
23
+ mixed `·` and `•` separators in the model segment.
24
+ - **Clearer Dock selection.** The focus arrow sits beside the selected module, with a
25
+ background that preserves plugin status colors. Modules keep their original spacing, content
26
+ width and shortcut behavior.
27
+ - **The directory gives way before statistics.** A narrowing info row first shortens the
28
+ working directory to its project folder (`…/project`) and keeps the git branch, then drops
29
+ whole statistic slots; the session name and the project folder go before the branch. The row
30
+ reserves at most 40 columns for the folder and branch, so at 97 columns it keeps cache reads,
31
+ hit rate, tokens and cost instead of only context use and `(auto)`.
32
+ - **Core 0.2 dependency.** Require `@lune_99/pi-lune-extensions-core@^0.2.1`. The earlier
33
+ `^0.1.0` range excluded Core 0.2, so an installation kept Core 0.1.0 beside the newer Core
34
+ that other Lune packages load.
35
+
36
+ ### Fixed
37
+
38
+ - **Right-aligned, persistent response speed.** The model and speed reach the dock's right edge without moving the statistics grid, with single spaces between thinking level, speed and unit. Hide the speed segment until a reliable measurement exists, then retain the last value through new responses, missing measurements and cancellation.
39
+
40
+ ## [0.1.0] - 2026-10-16
41
+
42
+ ### Added
43
+
44
+ - **Persistent Dock settings.** `/dock` controls on/off, base/detail/full density, plugin visibility
45
+ and numeric order. Changes apply immediately, restore independent plugin status bars when off,
46
+ and persist across Pi restarts.
47
+
48
+ - **Unified one-line Lune dock.** Shell Inspector and Ask Question share one below-editor
49
+ row with plugin-owned presentations, keyboard selection and direct panel opening.
50
+ Closing a panel restores dock focus, and disabling the host restores each independent dock.
51
+ - **Shared scoped Dock protocol.** Contributors share a registry across installed Core copies,
52
+ with explicit registration and host ownership lifetimes for session changes and reloads.
53
+ - **Plugin-owned single-line presentations.** Base/detail/full Components provide increasing
54
+ horizontal information density. Plugins own content, markers and theme styling.
55
+ - **Focus marks and key hints.** Focus marks the selected item with `❯` and draws
56
+ `←→ select · enter open · esc back` on the rule under the cells, shortened as the terminal
57
+ narrows, while Home and End jump to the first and last module. Selecting an item never moves
58
+ its neighbors.
59
+ - **A steady scrolling window.** A row too wide for its terminal keeps its window and moves it
60
+ only when the selection would leave it, counting the items outside each edge (`‹2` before,
61
+ `3›` after). The window lives on the controller, so it survives Pi recreating the widget component.
62
+ - **Model, directory and usage rows.** The dock shows `(provider) model • thinking` beside the
63
+ cells and the working directory, git branch and token, cache, cost and context statistics
64
+ beneath them, all read through Pi's extension API. Each statistic has a fixed-width slot, so
65
+ changing numbers never shift their neighbours, and a slot or counter with no data yet is not
66
+ drawn. Narrow terminals drop whole slots by terminal width alone, then shorten the directory
67
+ from the left.
68
+ - **Selectable dock styles.** `ruled`, `boxed`, `compact`, `minimal` and `classic` frame the same
69
+ rows differently, and switches hide the model, directory or usage. The panel previews the
70
+ candidate style, focused, before it is saved.
71
+ - **Settings through Pi Lune Core.** Dock settings are a typed Core namespace (`lune-dock`) with
72
+ global and project scopes, and `/dock` opens its section of Core's settings panel.
73
+ - **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.
74
+
75
+ ### Fixed
76
+
77
+ - **Running shells use a yellow marker.** Shell Inspector owns its running, completed and
78
+ failed presentation colors.
79
+ - **Returning to the editor with Up does not recall history.** The dock consumes Up after
80
+ restoring editor focus, so the same key cannot also select the previous submitted input.
81
+ - **Releasing a key no longer abandons dock Focus.** A terminal key-release event is ignored
82
+ instead of falling through to the editor handoff branch, which treated it as typing.
83
+
84
+ ### Changed
85
+
86
+ - **Context use reads `used/window · share`.** The cell shows the tokens in use over the window, then
87
+ the share (`209k/272k · 76.8%`), instead of the share over the window. It is 7 columns wider, so
88
+ narrow terminals now drop the cache, hit-rate, token and cost slots a little earlier.
89
+
90
+ - **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.
91
+
92
+ - **BREAKING: settings moved to Pi Lune Core.** The `contributions` map and
93
+ `lune-extensions-settings/lune-dock-settings.json` are replaced by `hidden` and `order` in
94
+ `<agentDir>/lune-settings/lune-dock.json`. The old file is not imported: the Dock has never
95
+ been released. The package now needs `@lune_99/pi-lune-core`, `typebox` and
96
+ `@earendil-works/pi-coding-agent` / `pi-tui` 1.0.4 or newer.
97
+
98
+ - **The dock replaces Pi's built-in footer.** It carries the footer's model, directory and usage
99
+ information itself, and extension statuses set with `ctx.ui.setStatus()` follow on their own row.
100
+ The `classic` style or turning the dock off keeps or restores Pi's footer. Pi allows one custom
101
+ footer, so another extension installing its own replaces the dock's.
102
+
103
+ - **Dock protocol from Core.** The host uses `@lune_99/pi-lune-core/dock` and
104
+ `/dock/host` for shared contribution registration and host ownership.
105
+
106
+ - **BREAKING: Lune Protocol v1 Draft 3.** `LuneDockSnapshot` contains required base and optional
107
+ detail/full Components, each rendering exactly one line. Providers expose getSnapshot,
108
+ subscribe and activate; full remains separate from plugin interaction. Remove DockItem,
109
+ status/color/count fields and plugin ordering. Migrate the host and both plugins together;
110
+ the lifecycle adapter now accepts getSnapshot(ctx) and activate(ctx).
111
+ - **Snapshot lifecycle.** Complete updates atomically replace all levels, hidden providers keep
112
+ publishing, and invalidation reaches every current Component. Settings persist placement only;
113
+ presentation snapshots remain ephemeral.
114
+ - **Cells are separated by a dim vertical bar.** Contributions in one row are joined with ` │ `
115
+ instead of blank padding, so module boundaries stay readable in a wide row.
116
+ - **Document dock rendering rules.** Explain how the 12-column estimate limits visible
117
+ 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
- # Temporary Holding Version
1
+ # Lune Dock
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ [![npm version](https://img.shields.io/npm/v/@lune_99/pi-dock.svg)](https://www.npmjs.com/package/@lune_99/pi-dock) [![npm downloads](https://img.shields.io/npm/dw/@lune_99/pi-dock.svg)](https://www.npmjs.com/package/@lune_99/pi-dock) [![license](https://img.shields.io/npm/l/@lune_99/pi-dock.svg)](LICENSE)
4
+
5
+ ![Lune Dock preview](docs/dock-overview.png)
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, thinking level and response token speed sit right-aligned beside the modules. Speed stays hidden until a reliable measurement exists, then keeps the last measured value after completion or cancellation. It is highlighted during generation and dim afterward. The next row carries the working directory, branch, tokens, cache, cost and context use.
32
+ - **Holds the numbers steady.** Usage statistics sit on a fixed grid, so new or changing values never move a bar or a label. The divider before the right-aligned model follows the same grid.
33
+ - **Fits the space you have.** Narrow terminals hide the whole speed segment before shortening the model, and shorten the directory to its project folder before they drop whole statistic slots. The git branch stays. 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
+ ![Lune Dock styles](docs/dock-styles.png)
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="18.00" y="71.40" width="8.43" height="19.4" fill="#213b49"/><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="210.75" lengthAdjust="spacingAndGlyphs"> </text><text x="633.39" y="85.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="658.68" y="85.37" fill="#dee0e1" textLength="33.72" lengthAdjust="spacingAndGlyphs"> </text><text x="692.40" y="85.37" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="793.56" y="85.37" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="920.01" y="85.37" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text><text x="970.59" y="85.37" fill="#7e888e" textLength="109.59" lengthAdjust="spacingAndGlyphs"> • 48.2 tok/s</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="210.75" lengthAdjust="spacingAndGlyphs"> </text><text x="473.22" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="498.51" y="124.17" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">R187k</text><text x="540.66" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="565.95" y="124.17" fill="#9da5a9" textLength="67.44" lengthAdjust="spacingAndGlyphs">CH 98.9%</text><text x="633.39" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="658.68" y="124.17" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">↑28k</text><text x="692.40" y="124.17" fill="#dee0e1" textLength="16.86" lengthAdjust="spacingAndGlyphs"> </text><text x="709.26" y="124.17" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">↓5.6k</text><text x="751.41" y="124.17" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="124.17" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="827.28" y="124.17" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </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="18.00" y="90.80" width="8.43" height="19.4" fill="#213b49"/><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="210.75" lengthAdjust="spacingAndGlyphs"> </text><text x="633.39" y="104.77" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="658.68" y="104.77" fill="#dee0e1" textLength="33.72" lengthAdjust="spacingAndGlyphs"> </text><text x="692.40" y="104.77" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="793.56" y="104.77" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="920.01" y="104.77" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text><text x="970.59" y="104.77" fill="#7e888e" textLength="109.59" lengthAdjust="spacingAndGlyphs"> • 48.2 tok/s</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="210.75" lengthAdjust="spacingAndGlyphs"> </text><text x="473.22" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="498.51" y="143.57" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">R187k</text><text x="540.66" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="565.95" y="143.57" fill="#9da5a9" textLength="67.44" lengthAdjust="spacingAndGlyphs">CH 98.9%</text><text x="633.39" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="658.68" y="143.57" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">↑28k</text><text x="692.40" y="143.57" fill="#dee0e1" textLength="16.86" lengthAdjust="spacingAndGlyphs"> </text><text x="709.26" y="143.57" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">↓5.6k</text><text x="751.41" y="143.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="143.57" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="827.28" y="143.57" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </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="26.43" y="226.60" width="8.43" height="19.4" fill="#213b49"/><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="185.46" lengthAdjust="spacingAndGlyphs"> </text><text x="616.53" y="240.57" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="641.82" y="240.57" fill="#dee0e1" textLength="33.72" lengthAdjust="spacingAndGlyphs"> </text><text x="675.54" y="240.57" fill="#a798d7" textLength="101.16" lengthAdjust="spacingAndGlyphs">(anthropic) </text><text x="776.70" y="240.57" fill="#dee0e1" textLength="126.45" lengthAdjust="spacingAndGlyphs">claude-opus-5-5</text><text x="903.15" y="240.57" fill="#7e888e" textLength="50.58" lengthAdjust="spacingAndGlyphs"> • max</text><text x="953.73" y="240.57" fill="#7e888e" textLength="109.59" lengthAdjust="spacingAndGlyphs"> • 48.2 tok/s</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="185.46" lengthAdjust="spacingAndGlyphs"> </text><text x="456.36" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="481.65" y="279.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">R187k</text><text x="523.80" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="549.09" y="279.37" fill="#9da5a9" textLength="67.44" lengthAdjust="spacingAndGlyphs">CH 98.9%</text><text x="616.53" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="641.82" y="279.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">↑28k</text><text x="675.54" y="279.37" fill="#dee0e1" textLength="16.86" lengthAdjust="spacingAndGlyphs"> </text><text x="692.40" y="279.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">↓5.6k</text><text x="734.55" y="279.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="759.84" y="279.37" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="810.42" y="279.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </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="18.00" y="343.00" width="8.43" height="19.4" fill="#213b49"/><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="210.75" lengthAdjust="spacingAndGlyphs"> </text><text x="473.22" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="498.51" y="376.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">R187k</text><text x="540.66" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="565.95" y="376.37" fill="#9da5a9" textLength="67.44" lengthAdjust="spacingAndGlyphs">CH 98.9%</text><text x="633.39" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="658.68" y="376.37" fill="#9da5a9" textLength="33.72" lengthAdjust="spacingAndGlyphs">↑28k</text><text x="692.40" y="376.37" fill="#dee0e1" textLength="16.86" lengthAdjust="spacingAndGlyphs"> </text><text x="709.26" y="376.37" fill="#9da5a9" textLength="42.15" lengthAdjust="spacingAndGlyphs">↓5.6k</text><text x="751.41" y="376.37" fill="#7e888e" textLength="25.29" lengthAdjust="spacingAndGlyphs"> │ </text><text x="776.70" y="376.37" fill="#9da5a9" textLength="50.58" lengthAdjust="spacingAndGlyphs">$0.008</text><text x="827.28" y="376.37" fill="#dee0e1" textLength="8.43" lengthAdjust="spacingAndGlyphs"> </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="18.00" y="420.60" width="8.43" height="19.4" fill="#213b49"/><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="18.00" y="478.80" width="8.43" height="19.4" fill="#213b49"/><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,219 @@
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 │ ○ Ask │ (anthropic) claude-opus-5-5 • max
12
+ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
13
+  …/local-extensions/pi-recap  (main) │ R187k │ CH 98.9% │ ↑28k ↓5.6k │ $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 • 48.2 tok/s` |
22
+ | Info | Working directory, git branch, session name | Cache `W`rite, cache `R`ead, `CH` cache hit, tokens `↑in ↓out`, 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
+ The statistics sit on a fixed grid against the right edge. Every statistic owns a slot of fixed
26
+ width and keeps it whether or not it has data, so no bar or label ever moves while a session runs.
27
+ Text starts one column after its bar, with the label attached to its number; a growing number uses
28
+ only the padding behind it. A slot with no data yet stays blank: a fresh session shows only context
29
+ use and `(auto)`, and the others fill their own columns once Pi reports tokens, cache or cost.
30
+ Slots that often stay blank, such as cache writes for providers that do not report them, sit on
31
+ the left, so their blank columns join the gap after the directory.
32
+
33
+ The model and speed are flush right. The divider before them continues one of the info row's bars,
34
+ with any spare padding between the divider and model, never after the speed. It takes the rightmost
35
+ bar that leaves room within half the row, dropping the provider and then the speed before giving up
36
+ divider alignment.
37
+
38
+ The speed segment follows the thinking level (or model name for models without thinking) with single
39
+ spaces and the same `•` bullet, as in `model • max • 48.2 tok/s`. Without a reliable measurement the
40
+ entire segment stays hidden, including its separator and unit. Once measured, the latest speed stays
41
+ visible through subsequent generation and after completion or cancellation, until a new valid
42
+ measurement replaces it. It is highlighted while an assistant response is generating and dimmed when
43
+ finished.
44
+
45
+ Speed is the provider-reported output tokens divided by Pi's measured response duration, including
46
+ the wait for the first token, not a pure decoding benchmark. Both output tokens and duration must be
47
+ positive and finite. Pi does not provide a reliable cross-provider live token count; partial usage,
48
+ text length, stream chunks, tool usage and tool execution time are not used. A response without valid
49
+ measurements does not erase the previous value or invent a zero. The measurement resets on detachment,
50
+ reload, session replacement or tree navigation, and is hidden for a different model. Narrow terminals
51
+ drop the entire speed segment before truncating the model; no part of its number or unit is clipped.
52
+ The model visibility switch also controls speed, and `classic` leaves Pi's footer unchanged.
53
+
54
+ Which slots are reserved depends on the terminal width, the project folder and the branch, never on
55
+ the numbers. The row keeps room only for the project folder and branch (at most 40 columns, or the
56
+ branch alone when it is longer). The statistics take the rest, so a narrowing terminal first
57
+ shortens the directory from the left, down to `…/project`. Then it drops cache writes, cache
58
+ reads, tokens, cost, hit rate and `(auto)` in that order, and always keeps context use. The
59
+ directory is fitted against the full reservation, so it does not move as numbers arrive. The
60
+ session name goes before the project folder, and the branch goes last. Below 40 columns the model
61
+ is hidden so the cells keep the whole row.
62
+ Provider shows only when more than one is available, and `(auto)` reflects the compaction setting
63
+ read when the session starts.
64
+
65
+ Every cell composes exactly one physical row. Plugins own their complete text, markers and theme
66
+ styling. Dock selects a level, allocates horizontal width, separates cells with a dim bar and
67
+ highlights the selected contribution. Focus places `❯` directly beside the selected module using
68
+ existing space, so module spacing and content widths stay the same. The highlight preserves plugin
69
+ status colors. In `ruled` and `boxed`, key hints ride the rule under the cells. With no contributions
70
+ the model and info rows still render.
71
+
72
+ Pi allows one custom footer: if another extension installs its own after the dock, that footer
73
+ replaces the dock's; choose the `classic` style or turn the dock off to avoid the clash. The
74
+ folder and branch icons are Nerd Font glyphs.
75
+
76
+ ## Styles
77
+
78
+ Choose a style in `/dock`; the panel previews it, focused, before you commit.
79
+
80
+ | Style | Rows | Notes |
81
+ | ----------------- | ------------------------------------------------- | --------------------------------------------------- |
82
+ | `ruled` (default) | Rule, dock + model, rule, directory + usage, rule | Key hints ride the rule under the cells |
83
+ | `boxed` | The same rows in a rounded box | Key hints ride the box's middle rule |
84
+ | `compact` | Dock + model, directory + usage | No frame; key hints replace the model while focused |
85
+ | `minimal` | Cells + model + context use | One row, plus extension statuses when present |
86
+ | `classic` | Cells only | Leaves Pi's own footer in place |
87
+
88
+ ```text
89
+ ╭──────────────────────────────────────────────────────────╮
90
+ │ ○ Shell │ ○ Ask │ model • max │ boxed
91
+ ├──────────────────────────────────────────────────────────┤
92
+ │ ~/proj (main) │ ↑28k ↓5.6k │ 27k/1.0M · 2.7% │
93
+ ╰──────────────────────────────────────────────────────────╯
94
+
95
+ ○ Shell │ ○ Ask │ model • max compact
96
+ ~/proj (main) │ ↑28k ↓5.6k │ 27k/1.0M · 2.7%
97
+ ```
98
+
99
+ Every style except `classic` takes over Pi's footer. Three switches trim what those styles
100
+ show: model, directory (with branch) and usage. `minimal` ignores the directory and keeps only
101
+ context use from the usage counters.
102
+
103
+ ## Installation
104
+
105
+ Lune Dock and its contributor extensions use the Dock protocol from
106
+ `@lune_99/pi-lune-extensions-core/dock`; Core also supplies the shared settings infrastructure.
107
+
108
+ ```sh
109
+ pi install npm:@lune_99/pi-dock
110
+ ```
111
+
112
+ Reload extensions in an existing Pi session with `/reload`, or start a new session.
113
+ The host is optional: removing it from Pi's active packages restores each contributor's
114
+ independent dock.
115
+
116
+ ## Settings
117
+
118
+ Run `/dock` to open the **Dock** section.
119
+ Enter or Space cycles a value, Ctrl+G switches between the global and project scope,
120
+ and Ctrl+R removes the selected override. Changes apply immediately, including turning Dock
121
+ off, which removes the block and its keyboard listener and restores Pi's footer and each plugin's
122
+ independent status bar; plugin panels and commands stay usable.
123
+
124
+ | Setting | Values | Default |
125
+ | ----------------------------------------- | --------------------------------------------------------- | ------------------ |
126
+ | `enabled` | on / off | on |
127
+ | `style` | `ruled`, `boxed`, `compact`, `minimal`, `classic` | `ruled` |
128
+ | `displayMode` | `base`, `detail`, `full` | `detail` |
129
+ | `showModel`, `showWorkspace`, `showUsage` | on / off | on |
130
+ | `hidden` | plugin ids left out of the dock | none |
131
+ | `order` | plugin id → position, smaller first (missing counts as 0) | registration order |
132
+
133
+ Values live in `~/.pi/agent/lune-settings/pi-dock.json` (`PI_CODING_AGENT_DIR` moves the agent
134
+ directory; project overrides are in `<project>/.pi/lune-settings/pi-dock.json`), and only
135
+ overrides are stored. Core writes the file owner-only. A project value beats a global one, which
136
+ beats the default, and untrusted projects are ignored. Invalid files and failed writes report
137
+ errors instead of silently resetting settings.
138
+
139
+ ```json
140
+ {
141
+ "style": "boxed",
142
+ "hidden": ["ask-question"],
143
+ "order": { "shell-inspector": 10 }
144
+ }
145
+ ```
146
+
147
+ ## Keyboard interaction
148
+
149
+ | Context | Key | Result |
150
+ | ------------------------------------------------- | ---------------------------------------- | ---------------------------------------------------------- |
151
+ | Main editor, empty and no autocomplete or overlay | Down | Focus the dock |
152
+ | Main editor, no autocomplete or overlay | Super+Down | Focus without clearing the text |
153
+ | Dock | Left / Right | Select previous / next module, wrapping at the ends |
154
+ | Dock | Home / End | Select the first / last module |
155
+ | Dock | Enter | Open the selected module directly |
156
+ | Dock | Up / Esc | Return to the editor without forwarding the navigation key |
157
+ | Dock | Typing, paste or an application shortcut | Return to the editor and deliver the input |
158
+
159
+ `Super` is Command on macOS. Delivery depends on the terminal's keyboard protocol and its
160
+ own shortcuts. Terminal key-release events are ignored, so releasing a key never hands focus
161
+ back to the editor. Ordinary Down always leaves non-empty editor text and other panels alone.
162
+ Custom main editors should extend Pi's `CustomEditor`, as recommended by Pi's editor contract.
163
+
164
+ Closing a panel opened from the dock returns to dock focus. If that module disappears,
165
+ selection moves to its nearest remaining neighbor; if all modules disappear, the editor
166
+ gets focus. A session shutdown, reload or tree jump invalidates pending focus restoration.
167
+
168
+ ## Plugin presentations
169
+
170
+ Shell Inspector supplies base identity, a detail summary of running/completed/failed jobs, and
171
+ a full summary with the latest command and elapsed time. Unseen failures remain red; running
172
+ work uses yellow and completed history uses green. Opening and closing the inspector
173
+ acknowledges failures present at open, while later failures remain unseen. Only-failed history
174
+ stays red. This is plugin-owned, ephemeral view state.
175
+
176
+ Ask Question supplies base identity, pending request count in detail (requests, rather than
177
+ individual questions), and the next request's subject in full. Enter opens the existing
178
+ `/question` panel, including draft persistence on Esc. Both plugins remain registered when idle,
179
+ showing only their status marker and name at every display level. Visibility is controlled by
180
+ Dock settings and never by plugin state.
181
+
182
+ The Dock protocol in Core (`@lune_99/pi-lune-extensions-core/dock`, protocol version 1) exposes `LuneDockSnapshot` and
183
+ `LuneDockProvider`: `getSnapshot()`, `subscribe(listener)` and `activate()`. Every supplied
184
+ Component renders exactly one line. Optional level resolution is deterministic: detail uses
185
+ detail or base; full uses full, detail or base. There are no status/count/color fields.
186
+ Snapshot updates atomically replace all levels and snapshots are never persisted.
187
+
188
+ Narrow terminals allocate bounded widths and keep a scrolling window around selection with
189
+ neutral counts of contributions outside each edge. Left/Right reaches every visible plugin.
190
+ This version uses manual display mode and per-Component clipping; automatic fit-based level
191
+ selection remains a future Dock implementation choice.
192
+
193
+ ## Lifecycle and failures
194
+
195
+ The shared registry lives behind `Symbol.for("nouvelle-lune.lune-protocol.v1")` and is scoped by the
196
+ stable `ctx.ui` object for a Pi runner. Multiple installed protocol copies share that registry;
197
+ separate UI contexts do not share contributions. The contributor adapter owns registration and host-presence handling. Plugins call
198
+ `attach(ctx)` after restoring business state, `detach({ retired: true })` before replacing a
199
+ session, `refresh()` on state changes, and `detach()` at shutdown. Host infrastructure uses
200
+ the separate `/host` library entry point. Duplicate contribution IDs or active hosts throw.
201
+
202
+ The host announces presence only after its widget and input listener are installed.
203
+ Contributors then clear their own keyed widget; normal detachment restores standalone display.
204
+ Contributor updates are coalesced in one microtask, and output-only shell changes do not redraw
205
+ the compact row. Invalid single-line output throws a protocol contract error; opening and lifecycle errors
206
+ are reported visibly and never trigger a silent switch to standalone mode. Failed initialization releases the ownership it could not finish.
207
+
208
+ ## Validation
209
+
210
+ ```sh
211
+ npm run typecheck
212
+ npm test
213
+ npm run tui:demo
214
+ ```
215
+
216
+ The demo uses local fixtures and the real Pi TUI, with no paid model call. Automated tests
217
+ cover protocol lifecycle, rendering, keyboard ownership, focus restoration, contributor status,
218
+ and coexistence with the existing independent docks. A visual demo is an observation, not
219
+ a substitute for those tests.