pi-side 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -13
- package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/README.md +13 -13
- package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/package.json +8 -5
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/README.md +81 -27
- package/node_modules/@luan.sh/pi-libtui/native-revision +1 -0
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/package.json +8 -5
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/color/preview.ts +1 -1
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/native-binary.ts +8 -8
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/panels.ts +2 -2
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/color-preview.test.ts +1 -1
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/editor-chrome.test.ts +2 -2
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/native-binary.test.ts +1 -1
- package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/public-surface.test.ts +11 -11
- package/package.json +12 -9
- package/src/extension.ts +2 -2
- package/src/manager.ts +2 -2
- package/src/process-registry.ts +1 -1
- package/src/session.ts +1 -1
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/LICENSE +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/src/index.ts +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/src/keybindings.ts +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/src/protocol/actions.ts +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/src/sdk.ts +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/test/registry.test.ts +0 -0
- /package/node_modules/{pi-libactions → @luan.sh/pi-libactions}/tsconfig.json +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/LICENSE +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/activity-presentation.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/appearance.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/background-surface.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/color/palette.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/color/resolver.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/color/theme.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/component-stack.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/content/markdown-code.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/content/terminal-text.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/content/text.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/action-panel.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/dialog-button-bar.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/multi-select.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/picker-panel.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/screen-icon-actions.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/searchable-select.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/select-box.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/selectable-list.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/selection-action-bar.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/semantic-input.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/controls/tab.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/cursor.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/editor-pills.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/glyphs.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/pointer-interaction.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/powerline-pill.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/status.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/decoration/transient-pill.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/index.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/model.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/parse.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/pierre-syntax.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/render.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/structured.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/diff/view.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor/chrome.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor/composition.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor/layout.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor/presentation.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor/protocol.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/editor.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/extension.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/folding.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/cursor-bridge.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/editor-bridge.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/extension-host.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/mouse-bridge.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/mouse-dispatch.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/mouse-input.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/mouse-targets.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/pi-layout-adapter.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/pi-native-selection.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/split-pane-bridge.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/host/transcript-bridge.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/index.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/line-layout.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/motion.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/mouse/events.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/mouse/fullscreen-layout.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/mouse/registry.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/mouse.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/anchored.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/detail-card.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/dialog.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/floating.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/framed-editor.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/fullscreen.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/hover-tooltip.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/overlay/modal-mount.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/render-cache.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/render-epoch.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/request-animation.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/scrollbar.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/selection.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/split-pane.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/status-presentation.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/stream.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/syntax.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/bridge-client.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/embedding.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/output.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/projection.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/pty-host.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal/pty-pane.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/terminal-colors.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/action.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/activity.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/call-preview.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/disclosure-action.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/expanded-region-viewport.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/index.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/output.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/transcript.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/src/tool/view-region.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/appearance.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/bounded-stream.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/bridge-client.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/component-stack.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/components.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/content-text.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/cursor-bridge.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/cursor.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/editor-layout.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/editor-registry.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/editor-theme.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/editor-token-pill.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/floating-overlay.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/folding.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/harmonious-theme.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/interaction.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/key-icons.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/markdown-code.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/modal-overlay-mount.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/motion.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/mouse/bridge.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/mouse/extension.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/mouse/registry.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/mouse/screen-decoration.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/palette.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/panels.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/pointer-components.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/progress.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/pty-host.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/pty-pane.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/render-cache.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/render-epoch.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/request-animation.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/screen-icon-actions.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/select-box.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/select-pointer.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/selectable-list.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/selection/registry.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/selection-action-bar.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/split-pane-bridge.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/split-pane.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/status-presentation.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/syntax.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/terminal-colors.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/terminal-embedding.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/terminal-projection.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/theme-colors.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/tool-output.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/tool-transcript.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/test/unified-diff.test.ts +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/themes/harmonious.json +0 -0
- /package/node_modules/{pi-libtui → @luan.sh/pi-libtui}/tsconfig.json +0 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# pi-side
|
|
1
|
+
# @luan.sh/pi-side [<img src="https://pi.luan.sh/icons/pi.svg" width="14" alt="Pi gallery">](https://pi.dev/packages/@luan.sh/pi-side) [<img src="https://pi.luan.sh/icons/npm.svg" width="14" alt="npm">](https://www.npmjs.com/package/@luan.sh/pi-side)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@luan.sh/pi-side` opens independent, interactive Pi sessions next to the
|
|
4
4
|
one you are working in. Each side chat is a real child `pi` process running in
|
|
5
5
|
a PTY. It starts with a copy of the parent session's model-visible history,
|
|
6
6
|
followed by a hidden boundary message that tells the model the inherited
|
|
@@ -14,27 +14,27 @@ It is a Pi extension, not a model-facing tool. It registers one command
|
|
|
14
14
|
|
|
15
15
|
Independent side conversation beside the main Pi session.
|
|
16
16
|
|
|
17
|
-

|
|
18
18
|
|
|
19
|
-
[Watch the demo](https://
|
|
19
|
+
[Watch the demo](https://pi.luan.sh/media/previews/pi-side-21f6936fdecf.mp4).
|
|
20
20
|
|
|
21
21
|
## Install
|
|
22
22
|
|
|
23
23
|
```sh
|
|
24
|
-
pi install npm
|
|
24
|
+
pi install npm:@luan.sh/pi-side
|
|
25
25
|
```
|
|
26
26
|
|
|
27
27
|
The package requires Pi's interactive TUI. In print or non-UI mode the `/side`
|
|
28
28
|
command reports that side chat is unavailable.
|
|
29
29
|
|
|
30
|
-
Optional companion: `pi install npm
|
|
30
|
+
Optional companion: `pi install npm:@luan.sh/pi-panels` hosts each side
|
|
31
31
|
chat as a tab in a side panel; without it, side chats open in a fullscreen
|
|
32
32
|
overlay instead (see below).
|
|
33
33
|
|
|
34
|
-
### Native binary: `
|
|
34
|
+
### Native binary: `terminal-bridge`
|
|
35
35
|
|
|
36
|
-
Side chats are driven by the native `
|
|
37
|
-
toolchain (https://rustup.rs). The `
|
|
36
|
+
Side chats are driven by the native `terminal-bridge` binary. Requires a Rust
|
|
37
|
+
toolchain (https://rustup.rs). The `terminal-bridge` binary builds itself on
|
|
38
38
|
first use under Pi's agent directory (`native/terminal-bridge/<version>/`).
|
|
39
39
|
Set `PI_TERMINAL_BRIDGE_BINARY` to use a prebuilt binary.
|
|
40
40
|
|
|
@@ -59,7 +59,7 @@ two surfaces are distinguishable. The environment variable
|
|
|
59
59
|
Child sessions are stored in `side-chats/<uuid>/` under the parent's session
|
|
60
60
|
directory, together with the generated theme file
|
|
61
61
|
`side-chat-<uuid>.json`. When the parent runs without a session file
|
|
62
|
-
(`--no-session`), they go under
|
|
62
|
+
(`--no-session`), they go under `@luan.sh/pi-side/<parent-session-id>/` in the OS
|
|
63
63
|
temporary directory instead.
|
|
64
64
|
|
|
65
65
|
### Inherited history
|
|
@@ -73,7 +73,7 @@ off-limits, and that it must not modify files or state unless the user
|
|
|
73
73
|
explicitly asks after the boundary. The child session records the parent
|
|
74
74
|
session file as its parent.
|
|
75
75
|
|
|
76
|
-
### With and without
|
|
76
|
+
### With and without `@luan.sh/pi-panels`
|
|
77
77
|
|
|
78
78
|
The package registers a side-panel provider. When a side-panel host is
|
|
79
79
|
present, each chat appears as a tab labelled `Side N` with a `` icon, and the
|
|
@@ -115,7 +115,7 @@ value is a key ID string or an array of them:
|
|
|
115
115
|
Key IDs are a base key optionally preceded by `ctrl`, `shift`, `alt`, or
|
|
116
116
|
`super`, joined with `+`. The file is read on load, so reload extensions after
|
|
117
117
|
editing. Bindings only take effect when a shortcut host is installed
|
|
118
|
-
(`pi install npm
|
|
118
|
+
(`pi install npm:@luan.sh/pi-xsettings` provides one). `/side` works without
|
|
119
119
|
any binding.
|
|
120
120
|
|
|
121
121
|
## Layout
|
|
@@ -134,4 +134,3 @@ any binding.
|
|
|
134
134
|
Source: https://github.com/luan/agents, directory
|
|
135
135
|
harnesses/pi/agent/packages/pi-side. Run `bun run typecheck` and
|
|
136
136
|
`bun test test` in that directory.
|
|
137
|
-
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
# pi-libactions
|
|
1
|
+
# @luan.sh/pi-libactions [<img src="https://pi.luan.sh/icons/pi.svg" width="14" alt="Pi gallery">](https://pi.dev/packages/@luan.sh/pi-libactions) [<img src="https://pi.luan.sh/icons/npm.svg" width="14" alt="npm">](https://www.npmjs.com/package/@luan.sh/pi-libactions)
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@luan.sh/pi-libactions` is a UI-free action registry and keybinding loader
|
|
4
4
|
for Pi extensions. It is a library, not a Pi extension: importing it registers
|
|
5
5
|
no commands, shortcuts, tools, or UI, and it is not installed with `pi install`
|
|
6
6
|
on its own. It reaches users as a dependency of the extensions that use it.
|
|
7
7
|
|
|
8
8
|
The registry lets an extension publish a named action without knowing which
|
|
9
|
-
host will expose it. A shortcut host (currently
|
|
9
|
+
host will expose it. A shortcut host (currently `@luan.sh/pi-xsettings`) reads
|
|
10
10
|
the user's `keybindings.json` and binds each configured key to the matching
|
|
11
|
-
action. Modal features such as
|
|
11
|
+
action. Modal features such as `@luan.sh/pi-copy-mode` read the same snapshot
|
|
12
12
|
without registering their keys as global editor shortcuts.
|
|
13
13
|
|
|
14
14
|
## Preview
|
|
15
15
|
|
|
16
16
|
Actions registered by Side Panel and Side Chat, bound by Xsettings, and listed in Pi's `/hotkeys`. The library itself registers no UI.
|
|
17
17
|
|
|
18
|
-

|
|
19
19
|
|
|
20
|
-
[Watch the demo](https://
|
|
20
|
+
[Watch the demo](https://pi.luan.sh/media/previews/pi-libactions-c0f46f189045.mp4).
|
|
21
21
|
|
|
22
22
|
## For users: `keybindings.json`
|
|
23
23
|
|
|
@@ -67,7 +67,7 @@ Rules the loader applies:
|
|
|
67
67
|
|
|
68
68
|
Which action IDs exist depends on the extensions you have installed; each
|
|
69
69
|
extension's README lists its IDs. Bindings only take effect when a shortcut
|
|
70
|
-
host is installed: `pi install npm
|
|
70
|
+
host is installed: `pi install npm:@luan.sh/pi-xsettings` provides one that
|
|
71
71
|
calls `pi.registerShortcut()` for every configured key. Without a host, the
|
|
72
72
|
registry still works but nothing binds global keys.
|
|
73
73
|
|
|
@@ -81,16 +81,16 @@ ships inside your published package:
|
|
|
81
81
|
```json
|
|
82
82
|
{
|
|
83
83
|
"dependencies": {
|
|
84
|
-
"pi-libactions": "^0.1.0"
|
|
84
|
+
"@luan.sh/pi-libactions": "^0.1.0"
|
|
85
85
|
},
|
|
86
|
-
"bundledDependencies": ["pi-libactions"]
|
|
86
|
+
"bundledDependencies": ["@luan.sh/pi-libactions"]
|
|
87
87
|
}
|
|
88
88
|
```
|
|
89
89
|
|
|
90
90
|
Then import the public SDK:
|
|
91
91
|
|
|
92
92
|
```ts
|
|
93
|
-
import { registerAction } from "pi-libactions/sdk";
|
|
93
|
+
import { registerAction } from "@luan.sh/pi-libactions/sdk";
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
The package has no runtime dependencies; `@earendil-works/pi-coding-agent` and
|
|
@@ -121,7 +121,7 @@ Use a stable, namespaced ID (for example `myext.panel.open`). Register during
|
|
|
121
121
|
extension setup and keep the disposer for reload and shutdown:
|
|
122
122
|
|
|
123
123
|
```ts
|
|
124
|
-
import { registerAction } from "pi-libactions/sdk";
|
|
124
|
+
import { registerAction } from "@luan.sh/pi-libactions/sdk";
|
|
125
125
|
|
|
126
126
|
const unregister = registerAction({
|
|
127
127
|
id: "example.open",
|
|
@@ -140,7 +140,7 @@ unregister();
|
|
|
140
140
|
registry uses the full API:
|
|
141
141
|
|
|
142
142
|
```ts
|
|
143
|
-
import { ensureActionsRegistry } from "pi-libactions/sdk";
|
|
143
|
+
import { ensureActionsRegistry } from "@luan.sh/pi-libactions/sdk";
|
|
144
144
|
|
|
145
145
|
const actions = ensureActionsRegistry();
|
|
146
146
|
const stopListening = actions.onRegister((action) => {
|
|
@@ -170,7 +170,7 @@ Behaviour, as implemented in `src/protocol/actions.ts`:
|
|
|
170
170
|
### Reading keybindings from an extension
|
|
171
171
|
|
|
172
172
|
```ts
|
|
173
|
-
import { loadActionKeybindings, isActionKeyId } from "pi-libactions/sdk";
|
|
173
|
+
import { loadActionKeybindings, isActionKeyId } from "@luan.sh/pi-libactions/sdk";
|
|
174
174
|
|
|
175
175
|
const bindings = loadActionKeybindings(); // defaults to <agent dir>/keybindings.json
|
|
176
176
|
const keys = bindings["example.open"] ?? []; // readonly KeyId[], frozen
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "pi-libactions",
|
|
3
|
-
"version": "0.3.
|
|
2
|
+
"name": "@luan.sh/pi-libactions",
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,8 +18,8 @@
|
|
|
18
18
|
},
|
|
19
19
|
"pi": {
|
|
20
20
|
"extensions": [],
|
|
21
|
-
"image": "https://
|
|
22
|
-
"video": "https://
|
|
21
|
+
"image": "https://pi.luan.sh/media/previews/pi-libactions-bbaab600e262.png",
|
|
22
|
+
"video": "https://pi.luan.sh/media/previews/pi-libactions-c0f46f189045.mp4"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {},
|
|
25
25
|
"peerDependencies": {
|
|
@@ -36,5 +36,8 @@
|
|
|
36
36
|
"typecheck": "tsc --build",
|
|
37
37
|
"test": "bun test --only-failures test"
|
|
38
38
|
},
|
|
39
|
-
"bundledDependencies": []
|
|
39
|
+
"bundledDependencies": [],
|
|
40
|
+
"publishAliases": [
|
|
41
|
+
"pi-libactions"
|
|
42
|
+
]
|
|
40
43
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
# pi-libtui
|
|
1
|
+
# @luan.sh/pi-libtui [<img src="https://pi.luan.sh/icons/pi.svg" width="14" alt="Pi gallery">](https://pi.dev/packages/@luan.sh/pi-libtui) [<img src="https://pi.luan.sh/icons/npm.svg" width="14" alt="npm">](https://www.npmjs.com/package/@luan.sh/pi-libtui)
|
|
2
2
|
|
|
3
3
|
Shared terminal UI for Pi extensions: layouts, split panes, dialogs, pickers,
|
|
4
4
|
selection actions, semantic colors, icons, cursors, syntax highlighting,
|
|
5
5
|
animated tool surfaces, streamed output, diffs, terminal projection, and the
|
|
6
6
|
protocols those pieces need. The primary audience is extension authors.
|
|
7
7
|
|
|
8
|
-
The package has two surfaces. `import "pi-libtui"` is a
|
|
8
|
+
The package has two surfaces. `import "@luan.sh/pi-libtui"` is a
|
|
9
9
|
side-effect-free library: it does not start Pi, probe the terminal, register a
|
|
10
10
|
tool, or install UI. `src/extension.ts` is a Pi extension (listed in the
|
|
11
11
|
package's `pi.extensions`) that installs the generic mouse, cursor, and
|
|
@@ -18,24 +18,24 @@ registers no model-facing tools, keybindings, or feature-specific UI.
|
|
|
18
18
|
|
|
19
19
|
The native palette diagnostic and shared picker components in Xsettings.
|
|
20
20
|
|
|
21
|
-

|
|
22
22
|
|
|
23
|
-
[Watch the demo](https://
|
|
23
|
+
[Watch the demo](https://pi.luan.sh/media/previews/pi-libtui-e7ff85f140d3.mp4).
|
|
24
24
|
|
|
25
25
|
## Install
|
|
26
26
|
|
|
27
27
|
```sh
|
|
28
|
-
pi install npm
|
|
28
|
+
pi install npm:@luan.sh/pi-libtui
|
|
29
29
|
```
|
|
30
30
|
|
|
31
31
|
This loads the host extension and the `harmonious` theme on its own. Feature
|
|
32
|
-
packages normally bundle their own copy instead: add
|
|
32
|
+
packages normally bundle their own copy instead: add `@luan.sh/pi-libtui` to
|
|
33
33
|
both `dependencies` and `bundledDependencies` in `package.json`, and list
|
|
34
34
|
`"./node_modules/pi-libtui/src/extension.ts"` in the package's
|
|
35
35
|
`pi.extensions` so the mouse/cursor bridge is active. The host claims itself
|
|
36
36
|
once per process, so several installed copies do not conflict.
|
|
37
37
|
|
|
38
|
-
Optional companion: `pi install npm
|
|
38
|
+
Optional companion: `pi install npm:@luan.sh/pi-xsettings` adds the `/xsettings`
|
|
39
39
|
UI that publishes the appearance settings below; without it the compiled
|
|
40
40
|
defaults apply.
|
|
41
41
|
|
|
@@ -47,6 +47,59 @@ neither a generated 256-color palette nor an ANSI base-16 palette, the host
|
|
|
47
47
|
switches to Pi's built-in theme for the detected light or dark scheme (dark if
|
|
48
48
|
the measurement fails).
|
|
49
49
|
|
|
50
|
+
## Components
|
|
51
|
+
|
|
52
|
+
Captures of the shared components inside the extensions that use them. The
|
|
53
|
+
images are served from the documentation site.
|
|
54
|
+
|
|
55
|
+
`ActionPanel` with a `DialogButtonBar` footer in a `DialogOverlay`: the
|
|
56
|
+
pi-copy-mode reaction picker.
|
|
57
|
+
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
`MultiSelect` with ordered checkboxes, a filter `SemanticInput`, and a
|
|
61
|
+
`DialogButtonBar`: the pi-xsettings segment editor.
|
|
62
|
+
|
|
63
|
+

|
|
64
|
+
|
|
65
|
+
`mountSplitPane` with side-panel tabs from `registerSidePanelProvider`:
|
|
66
|
+
pi-panels hosting a pi-side conversation.
|
|
67
|
+
|
|
68
|
+

|
|
69
|
+
|
|
70
|
+
`UnifiedDiffView` from `pi-libtui/diff`: the pi-fileops `apply_patch` result.
|
|
71
|
+
|
|
72
|
+

|
|
73
|
+
|
|
74
|
+
`PtyPane` over `TerminalProjection` from `pi-libtui/terminal`: the
|
|
75
|
+
pi-exec-command Process Hub attached to a running server.
|
|
76
|
+
|
|
77
|
+

|
|
78
|
+
|
|
79
|
+
`renderDetailCard` as an anchored overlay: a pi-copy-mode annotation.
|
|
80
|
+
|
|
81
|
+

|
|
82
|
+
|
|
83
|
+
`ToolActivity` and `ToolTranscript` from `pi-libtui/tool`: pi-tool-search
|
|
84
|
+
and pi-exec-command rows collapsed into an `Explored` group.
|
|
85
|
+
|
|
86
|
+

|
|
87
|
+
|
|
88
|
+
`ProgressBar`, `renderPill`, and `renderEditorTokenPills`: the
|
|
89
|
+
pi-custom-editor status row and file tokens.
|
|
90
|
+
|
|
91
|
+

|
|
92
|
+
|
|
93
|
+
`TransientPill`: the pi-tuicr confirmation after a review comment is added.
|
|
94
|
+
|
|
95
|
+

|
|
96
|
+
|
|
97
|
+
Components without a capture in a shipped extension: `PickerPanel`
|
|
98
|
+
(pi-prompt-storage), `SearchableSelect` and `SelectBox` (pi-xsettings
|
|
99
|
+
editors), `SelectionActionBar` (pi-copy-mode), `FramedEditorOverlay`,
|
|
100
|
+
`mountHoverTooltip`, `FloatingOverlay`, `ActivityIndicator` styles, and
|
|
101
|
+
`applyScrollbar`. Add them here when a gallery recording shows them in use.
|
|
102
|
+
|
|
50
103
|
## Public modules
|
|
51
104
|
|
|
52
105
|
Every entry point is a side-effect-free import. "Host required" means the
|
|
@@ -54,15 +107,15 @@ Pi-native behaviour also needs the extension loaded.
|
|
|
54
107
|
|
|
55
108
|
| Import path | Principal exports / capability | Host required |
|
|
56
109
|
| --- | --- | --- |
|
|
57
|
-
|
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
|
61
|
-
|
|
|
62
|
-
|
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
|
110
|
+
| `@luan.sh/pi-libtui` | Layouts, split panes, side-panel protocol, dialogs, pickers, inputs, selection actions, semantic colors, icons, cursors, `PtyProcess`, `PtyPane`, `applyScrollbar`, `PointerInteractionController`, `RenderedLinesCache`, `SyntaxText`, motion/progress, appearance (`getTuiAppearance`, `configureTuiAppearance`, `subscribeTuiAppearance`), `ensureNativeBinary` | Rendering no; panes, PTYs, and bridges yes |
|
|
111
|
+
| `@luan.sh/pi-libtui/diff` | `createUnifiedDiffModel`, `parseUnifiedDiff`, `renderUnifiedDiff`, `UnifiedDiffView`, bounded diff models/viewports | No |
|
|
112
|
+
| `@luan.sh/pi-libtui/editor` | `ensureEditorRegistry`, `dispatchEditorPaste`, `dispatchEditorRender`, `SemanticEditor`, `semanticEditorTheme`, editor registry contracts | Only to connect the registry to Pi's editor |
|
|
113
|
+
| `@luan.sh/pi-libtui/folding` | `ensureFoldingRegistry`, `foldTargetAt`, `clearFoldingCurrent`, fold-target contracts | Only for copy-mode keyboard integration |
|
|
114
|
+
| `@luan.sh/pi-libtui/mouse` | `ensureMouseRegistry`, `registerModalPointerShield`, viewport handlers, pointer contracts, `getFullscreenLayoutCapability`, `publishFullscreenLayoutCapability`, `resolveFullscreenLayout` | Yes for terminal pointer events and layout geometry |
|
|
115
|
+
| `@luan.sh/pi-libtui/selection` | `ensureSelectionRegistry`, native selection geometry, completion events, action contracts | Yes for Pi-native selection events |
|
|
116
|
+
| `@luan.sh/pi-libtui/stream` | `BoundedStreamBuffer`, bounded UTF-8/ANSI-safe stream snapshots | No |
|
|
117
|
+
| `@luan.sh/pi-libtui/terminal` | `TerminalProjection`, incremental `TerminalOutput` for bounded PTY/ANSI projection | No |
|
|
118
|
+
| `@luan.sh/pi-libtui/tool` | `ToolAction`, `LiveToolAction`, `ToolDisclosureAction`, `ToolActivity`, `ToolOutput`, `ToolTranscript`, `ToolViewRegion`, tool-call preview helpers | No for rendering |
|
|
66
119
|
|
|
67
120
|
The `ensure*Registry` functions create or reuse a process-global capability
|
|
68
121
|
keyed by `Symbol.for`, so feature packages and the host share one instance.
|
|
@@ -74,16 +127,16 @@ guarded Pi 0.84–0.85 adapter; unsupported hosts keep their native transcript.
|
|
|
74
127
|
|
|
75
128
|
## Native binaries
|
|
76
129
|
|
|
77
|
-
Feature packages shell out to Rust binaries such as `
|
|
130
|
+
Feature packages shell out to Rust binaries such as `terminal-bridge` (the
|
|
78
131
|
exported `TERMINAL_BRIDGE` descriptor). Requires a Rust toolchain
|
|
79
|
-
(https://rustup.rs). The `
|
|
80
|
-
under Pi's agent directory (`native/terminal-bridge
|
|
81
|
-
`<
|
|
132
|
+
(https://rustup.rs). The `terminal-bridge` binary builds itself on first use
|
|
133
|
+
under Pi's agent directory (`native/terminal-bridge/<revision>/`), where
|
|
134
|
+
`<revision>` is the source commit recorded in the packaged `native-revision` file. Set `PI_TERMINAL_BRIDGE_BINARY` to use
|
|
82
135
|
a prebuilt binary; it must point at an executable file.
|
|
83
136
|
|
|
84
137
|
`ensureNativeBinary(binary, hooks?)` resolves in this order: the descriptor's
|
|
85
|
-
env override, then `<agentDir>/native/<crate>/
|
|
86
|
-
it on first use when absent. Builds are keyed by crate and
|
|
138
|
+
env override, then `<agentDir>/native/<crate>/<revision>/bin/<name>`, building
|
|
139
|
+
it on first use when absent. Builds are keyed by crate and source commit, so every
|
|
87
140
|
installed copy shares them, and concurrent requests within one process share
|
|
88
141
|
one build. Pass `onBuild` to show the delay in the UI. The extension host keeps
|
|
89
142
|
the shared PTY host alive across an extension reload; a session switch or quit
|
|
@@ -125,8 +178,8 @@ shape is absent.
|
|
|
125
178
|
|
|
126
179
|
This package has no settings store of its own. It exposes an appearance
|
|
127
180
|
registry with compiled defaults (`DEFAULT_TUI_APPEARANCE`) that a settings host
|
|
128
|
-
such as
|
|
129
|
-
with pi-xsettings installed they are edited live via `/xsettings`. Keys and
|
|
181
|
+
such as `@luan.sh/pi-xsettings` overrides through `configureTuiAppearance()`;
|
|
182
|
+
with @luan.sh/pi-xsettings installed they are edited live via `/xsettings`. Keys and
|
|
130
183
|
defaults:
|
|
131
184
|
|
|
132
185
|
| Key | Default | Values |
|
|
@@ -188,7 +241,7 @@ through `src/color/resolver.ts`. Feature code uses only the root color API:
|
|
|
188
241
|
## Troubleshooting
|
|
189
242
|
|
|
190
243
|
- A feature renders but clicks do nothing: the host extension is not loaded.
|
|
191
|
-
Install
|
|
244
|
+
Install `@luan.sh/pi-libtui` as a Pi package or list its `src/extension.ts`
|
|
192
245
|
in the feature package's `pi.extensions`.
|
|
193
246
|
- Nerd Font or Powerline glyphs are missing: set the icon pack to `unicode` and
|
|
194
247
|
disable Powerline in `/xsettings`. Those are also the compiled defaults.
|
|
@@ -201,5 +254,6 @@ Source: https://github.com/luan/agents, directory
|
|
|
201
254
|
harnesses/pi/agent/packages/pi-libtui. Run `bun run typecheck` and
|
|
202
255
|
`bun test test` in that directory. When running from that checkout,
|
|
203
256
|
`ensureNativeBinary` also looks for `target/{release,debug}/<name>` in the Cargo
|
|
204
|
-
workspace and reports an unbuilt checkout instead of building
|
|
205
|
-
|
|
257
|
+
workspace and reports an unbuilt checkout instead of building. `just pi-pack`
|
|
258
|
+
records the checkout commit in every bundled `@luan.sh/pi-libtui/native-revision` file,
|
|
259
|
+
so native builds do not depend on npm versions or repository-wide release tags.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
eace67b49e52950cb408c08f290f1ca9c409d68a
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name": "pi-libtui",
|
|
3
|
-
"version": "0.3.
|
|
2
|
+
"name": "@luan.sh/pi-libtui",
|
|
3
|
+
"version": "0.3.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"themes": [
|
|
31
31
|
"./themes"
|
|
32
32
|
],
|
|
33
|
-
"image": "https://
|
|
34
|
-
"video": "https://
|
|
33
|
+
"image": "https://pi.luan.sh/media/previews/pi-libtui-1820a03ca387.png",
|
|
34
|
+
"video": "https://pi.luan.sh/media/previews/pi-libtui-e7ff85f140d3.mp4"
|
|
35
35
|
},
|
|
36
36
|
"peerDependencies": {
|
|
37
37
|
"@earendil-works/pi-coding-agent": "*",
|
|
@@ -51,5 +51,8 @@
|
|
|
51
51
|
"typecheck": "tsc --build",
|
|
52
52
|
"test": "bun test --only-failures --timeout 15000 test"
|
|
53
53
|
},
|
|
54
|
-
"bundledDependencies": []
|
|
54
|
+
"bundledDependencies": [],
|
|
55
|
+
"publishAliases": [
|
|
56
|
+
"pi-libtui"
|
|
57
|
+
]
|
|
55
58
|
}
|
|
@@ -13,7 +13,7 @@ const HUE_EDGES: readonly ChannelMask[] = [
|
|
|
13
13
|
[true, false, true],
|
|
14
14
|
];
|
|
15
15
|
|
|
16
|
-
/** Width of the
|
|
16
|
+
/** Width of the color256 terminal preview, including its base16 legend. */
|
|
17
17
|
export const COLOR256_PREVIEW_WIDTH = 69;
|
|
18
18
|
|
|
19
19
|
/**
|
|
@@ -35,7 +35,7 @@ export type NativeBinaryLocation =
|
|
|
35
35
|
|
|
36
36
|
export const TERMINAL_BRIDGE: NativeBinary = {
|
|
37
37
|
crate: "terminal-bridge",
|
|
38
|
-
binaryName: "
|
|
38
|
+
binaryName: "terminal-bridge",
|
|
39
39
|
env: "PI_TERMINAL_BRIDGE_BINARY",
|
|
40
40
|
};
|
|
41
41
|
|
|
@@ -81,7 +81,8 @@ export interface EnsureNativeBinaryHooks {
|
|
|
81
81
|
* revision under Pi's agent directory and shared by every installed pi-libtui copy.
|
|
82
82
|
*/
|
|
83
83
|
export async function ensureNativeBinary(binary: NativeBinary, hooks: EnsureNativeBinaryHooks = {}): Promise<string> {
|
|
84
|
-
const
|
|
84
|
+
const options = processOptions();
|
|
85
|
+
const location = locateNativeBinary(binary, options);
|
|
85
86
|
if (location.kind === "found") return location.path;
|
|
86
87
|
if (location.kind === "unbuilt-checkout") {
|
|
87
88
|
throw new Error(
|
|
@@ -92,7 +93,7 @@ export async function ensureNativeBinary(binary: NativeBinary, hooks: EnsureNati
|
|
|
92
93
|
const existing = builds.get(location.path);
|
|
93
94
|
if (existing) return existing;
|
|
94
95
|
hooks.onBuild?.(`Building ${binary.binaryName} (first use); this takes a minute.`);
|
|
95
|
-
const build = runCargo(nativeBuildArguments(binary,
|
|
96
|
+
const build = runCargo(nativeBuildArguments(binary, options.rev, location.installRoot), location.installRoot)
|
|
96
97
|
.then(() => {
|
|
97
98
|
if (!isExecutable(location.path)) throw new Error(`cargo install did not produce ${location.path}`);
|
|
98
99
|
return location.path;
|
|
@@ -106,12 +107,11 @@ export function terminalBridgeBinaryPath(): Promise<string> {
|
|
|
106
107
|
return ensureNativeBinary(TERMINAL_BRIDGE);
|
|
107
108
|
}
|
|
108
109
|
|
|
109
|
-
/**
|
|
110
|
+
/** The pack step records the exact source commit independently of npm versions. */
|
|
110
111
|
export function nativeRevision(): string {
|
|
111
|
-
const
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return `v${manifest.version}`;
|
|
112
|
+
const revision = readFileSync(new URL("../native-revision", import.meta.url), "utf8").trim();
|
|
113
|
+
if (!/^[a-f0-9]{40}$/.test(revision)) throw new Error("Invalid native source revision; reinstall the package.");
|
|
114
|
+
return revision;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
117
|
function processOptions(): NativeBinaryOptions {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
2
2
|
import type { Component, Focusable } from "@earendil-works/pi-tui";
|
|
3
|
-
import type { SplitPaneHost, TuiIconName } from "pi-libtui";
|
|
4
|
-
import type { TuiMouseEvent } from "pi-libtui/mouse";
|
|
3
|
+
import type { SplitPaneHost, TuiIconName } from "@luan.sh/pi-libtui";
|
|
4
|
+
import type { TuiMouseEvent } from "@luan.sh/pi-libtui/mouse";
|
|
5
5
|
|
|
6
6
|
export const SIDE_PANEL_REGISTRY_KEY = Symbol.for("pi-panels/registry/v1");
|
|
7
7
|
export const SIDE_PANEL_PROTOCOL = "pi-panels/registry/v1" as const;
|
|
@@ -3,7 +3,7 @@ import { visibleWidth } from "@earendil-works/pi-tui";
|
|
|
3
3
|
import { COLOR256_PREVIEW_WIDTH, renderColor256Preview } from "../src/color/preview.ts";
|
|
4
4
|
|
|
5
5
|
describe("color256 preview", () => {
|
|
6
|
-
test("matches the
|
|
6
|
+
test("matches the terminal grid dimensions and labels", () => {
|
|
7
7
|
const lines = renderColor256Preview("harmonious");
|
|
8
8
|
expect(lines).toHaveLength(20);
|
|
9
9
|
expect(lines.every((line) => visibleWidth(line) === COLOR256_PREVIEW_WIDTH)).toBe(true);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
import type { Theme } from "@earendil-works/pi-coding-agent";
|
|
3
3
|
import { stripTerminalSequences, visibleWidth } from "@earendil-works/pi-tui";
|
|
4
|
-
import { tuiTheme } from "pi-libtui";
|
|
4
|
+
import { tuiTheme } from "@luan.sh/pi-libtui";
|
|
5
5
|
import {
|
|
6
6
|
type EditorCompositionStyle,
|
|
7
7
|
renderEditorComposition,
|
|
8
8
|
renderEditorCompositionPreview,
|
|
9
9
|
renderEditorCompositionStatus,
|
|
10
|
-
} from "pi-libtui/editor";
|
|
10
|
+
} from "@luan.sh/pi-libtui/editor";
|
|
11
11
|
|
|
12
12
|
const theme = {
|
|
13
13
|
name: "editor-chrome-test",
|
|
@@ -10,7 +10,7 @@ const options = (executables: readonly string[], environment: Record<string, str
|
|
|
10
10
|
rev: "v1.2.3",
|
|
11
11
|
isExecutable: (path: string) => executables.includes(path),
|
|
12
12
|
});
|
|
13
|
-
const managed = join("/agent/native", "terminal-bridge", "v1.2.3", "bin", "
|
|
13
|
+
const managed = join("/agent/native", "terminal-bridge", "v1.2.3", "bin", "terminal-bridge");
|
|
14
14
|
|
|
15
15
|
test("env override wins and must be executable", () => {
|
|
16
16
|
expect(locateNativeBinary(TERMINAL_BRIDGE, options(["/x/bridge"], { [ENV]: "/x/bridge" }))).toEqual({
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
2
|
|
|
3
3
|
const PUBLIC_ENTRYPOINTS = [
|
|
4
|
-
"pi-libtui",
|
|
5
|
-
"pi-libtui/diff",
|
|
6
|
-
"pi-libtui/editor",
|
|
7
|
-
"pi-libtui/folding",
|
|
8
|
-
"pi-libtui/mouse",
|
|
9
|
-
"pi-libtui/selection",
|
|
10
|
-
"pi-libtui/stream",
|
|
11
|
-
"pi-libtui/terminal",
|
|
12
|
-
"pi-libtui/tool",
|
|
4
|
+
"@luan.sh/pi-libtui",
|
|
5
|
+
"@luan.sh/pi-libtui/diff",
|
|
6
|
+
"@luan.sh/pi-libtui/editor",
|
|
7
|
+
"@luan.sh/pi-libtui/folding",
|
|
8
|
+
"@luan.sh/pi-libtui/mouse",
|
|
9
|
+
"@luan.sh/pi-libtui/selection",
|
|
10
|
+
"@luan.sh/pi-libtui/stream",
|
|
11
|
+
"@luan.sh/pi-libtui/terminal",
|
|
12
|
+
"@luan.sh/pi-libtui/tool",
|
|
13
13
|
] as const;
|
|
14
14
|
|
|
15
15
|
const CAPABILITY_KEYS = [
|
|
@@ -30,7 +30,7 @@ describe("public module boundaries", () => {
|
|
|
30
30
|
}
|
|
31
31
|
const after = CAPABILITY_KEYS.map((key) => Object.hasOwn(globalThis, key));
|
|
32
32
|
expect(after).toEqual(before);
|
|
33
|
-
const mouse = await import("pi-libtui/mouse");
|
|
33
|
+
const mouse = await import("@luan.sh/pi-libtui/mouse");
|
|
34
34
|
expect(Object.keys(mouse).sort()).toEqual([
|
|
35
35
|
"FULLSCREEN_LAYOUT_CAPABILITY_KEY",
|
|
36
36
|
"FULLSCREEN_LAYOUT_PROTOCOL",
|
|
@@ -44,7 +44,7 @@ describe("public module boundaries", () => {
|
|
|
44
44
|
"registerModalPointerShield",
|
|
45
45
|
"resolveFullscreenLayout",
|
|
46
46
|
]);
|
|
47
|
-
const editor = await import("pi-libtui/editor");
|
|
47
|
+
const editor = await import("@luan.sh/pi-libtui/editor");
|
|
48
48
|
expect(Object.keys(editor).sort()).toEqual([
|
|
49
49
|
"EDITOR_PROTOCOL",
|
|
50
50
|
"EDITOR_REGISTRY_KEY",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-side",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,18 +18,18 @@
|
|
|
18
18
|
"pi": {
|
|
19
19
|
"extensions": [
|
|
20
20
|
"./src/extension.ts",
|
|
21
|
-
"./node_modules/pi-libtui/src/extension.ts"
|
|
21
|
+
"./node_modules/@luan.sh/pi-libtui/src/extension.ts"
|
|
22
22
|
],
|
|
23
|
-
"image": "https://
|
|
24
|
-
"video": "https://
|
|
23
|
+
"image": "https://pi.luan.sh/media/previews/pi-side-8c1a712df319.png",
|
|
24
|
+
"video": "https://pi.luan.sh/media/previews/pi-side-21f6936fdecf.mp4"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
|
-
"pi-libactions": "file:../pi-libactions",
|
|
28
|
-
"pi-libtui": "file:../pi-libtui"
|
|
27
|
+
"@luan.sh/pi-libactions": "file:../pi-libactions",
|
|
28
|
+
"@luan.sh/pi-libtui": "file:../pi-libtui"
|
|
29
29
|
},
|
|
30
30
|
"bundledDependencies": [
|
|
31
|
-
"pi-libactions",
|
|
32
|
-
"pi-libtui"
|
|
31
|
+
"@luan.sh/pi-libactions",
|
|
32
|
+
"@luan.sh/pi-libtui"
|
|
33
33
|
],
|
|
34
34
|
"peerDependencies": {
|
|
35
35
|
"@earendil-works/pi-agent-core": "*",
|
|
@@ -46,5 +46,8 @@
|
|
|
46
46
|
"scripts": {
|
|
47
47
|
"typecheck": "tsc --build",
|
|
48
48
|
"test": "bun test --only-failures test"
|
|
49
|
-
}
|
|
49
|
+
},
|
|
50
|
+
"publishAliases": [
|
|
51
|
+
"pi-side"
|
|
52
|
+
]
|
|
50
53
|
}
|
package/src/extension.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { randomUUID } from "node:crypto";
|
|
2
2
|
import type { ExtensionAPI, ExtensionCommandContext, ExtensionContext } from "@earendil-works/pi-coding-agent";
|
|
3
|
-
import { registerAction } from "pi-libactions/sdk";
|
|
4
|
-
import { ensureSidePanelRegistry, registerSidePanelProvider } from "pi-libtui";
|
|
3
|
+
import { registerAction } from "@luan.sh/pi-libactions/sdk";
|
|
4
|
+
import { ensureSidePanelRegistry, registerSidePanelProvider } from "@luan.sh/pi-libtui";
|
|
5
5
|
import { SideChatManager } from "./manager.ts";
|
|
6
6
|
import { claimSideChatProcesses } from "./process-registry.ts";
|
|
7
7
|
import { createSideChatRuntime, writeSideChatSession } from "./session.ts";
|
package/src/manager.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ExtensionAPI, ExtensionContext, Theme } from "@earendil-works/pi-coding-agent";
|
|
2
|
-
import type { SplitPaneHost } from "pi-libtui";
|
|
2
|
+
import type { SplitPaneHost } from "@luan.sh/pi-libtui";
|
|
3
3
|
import {
|
|
4
4
|
FullscreenOverlay,
|
|
5
5
|
fullscreenOverlayOptions,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
PtyProcess,
|
|
8
8
|
type SidePanelSession,
|
|
9
9
|
type SidePanelTab,
|
|
10
|
-
} from "pi-libtui";
|
|
10
|
+
} from "@luan.sh/pi-libtui";
|
|
11
11
|
import {
|
|
12
12
|
createSideChatCommand,
|
|
13
13
|
prepareSideChatSession,
|
package/src/process-registry.ts
CHANGED
package/src/session.ts
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
SessionManager,
|
|
9
9
|
sessionEntryToContextMessages,
|
|
10
10
|
} from "@earendil-works/pi-coding-agent";
|
|
11
|
-
import { createTuiThemeVariation } from "pi-libtui";
|
|
11
|
+
import { createTuiThemeVariation } from "@luan.sh/pi-libtui";
|
|
12
12
|
import type { SideChatStateTab } from "./state.ts";
|
|
13
13
|
|
|
14
14
|
export const SIDE_CONVERSATION_BOUNDARY = `Side conversation boundary.
|