@firstpick/pi-package-webui 0.3.9 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -11
- package/bin/pi-webui.mjs +841 -39
- package/package.json +11 -22
- package/public/app.js +2629 -193
- package/public/index.html +78 -4
- package/public/service-worker.js +1 -1
- package/public/styles.css +931 -4
- package/tests/fixtures/fake-pi.mjs +10 -1
- package/tests/http-endpoints-harness.test.mjs +140 -2
- package/tests/mobile-static.test.mjs +96 -31
package/README.md
CHANGED
|
@@ -120,17 +120,19 @@ Environment variables:
|
|
|
120
120
|
## Main features
|
|
121
121
|
|
|
122
122
|
- Pathless `pi-webui` startup: the server opens first, then the browser prompts for the first terminal CWD.
|
|
123
|
-
- Multi-tab Pi sessions with isolated processes, working directories, prompt drafts, and
|
|
123
|
+
- Multi-tab Pi sessions with isolated processes, working directories, prompt drafts, activity state, and a workspace dashboard for common actions.
|
|
124
|
+
- Unified command palette (`Ctrl/Cmd+K`) for commands, tabs, models, sessions, settings, and frequent Web UI actions.
|
|
124
125
|
- Automatic tab naming from the first prompt, with `--name <name>` still available for an explicit initial tab name.
|
|
125
|
-
- Streaming chat transcript with Markdown, thinking output, tool/bash cards, queue and compaction events, and abort controls.
|
|
126
|
+
- Streaming chat transcript with Markdown, thinking output, tool/bash cards, queue and compaction events, edit-and-retry from user prompts, and abort controls.
|
|
126
127
|
- Prompt composer with uploads, drag/drop/paste, inline image support, slash-command autocomplete, and `@` file/path references with live suggestions.
|
|
127
128
|
- Browser dialogs for common Pi selectors such as `/model`, `/settings`, `/theme`, `/fork`, `/clone`, `/resume`, `/tree`, `/scoped-models`, `/tools`, and `/skills`.
|
|
128
129
|
- Model, thinking, session, workspace, theme, optional-feature, Codex usage, network, update/restart, event, and notification controls in the side panel.
|
|
130
|
+
- Persistent context-window meter with manual compact and auto-compaction controls near the composer.
|
|
129
131
|
- Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded.
|
|
130
132
|
- Per-tab cwd changes, a clickable footer cwd picker, saved path fast picks, server-persisted fast picks, and restart-safe restoration of open tabs.
|
|
131
133
|
- Detected app runner dropdown for the active tab cwd, including Cargo, Bun, npm/npx/pnpm, Python/uv, Go/Golang, Zig, C/C++, Docker Compose, root/dev/scripts shell scripts, and other common project runners with live output pinned at the top of the terminal. Projects can add browseable custom runners in `.pi-webui-runners.json` with a command (default `./`) plus a relative path to the file to run.
|
|
132
134
|
- Browser support for Pi extension UI prompts, widgets, status updates, browser notifications when a tab needs an extension UI response and an optional side-panel toggle for agent-done notifications.
|
|
133
|
-
- Localhost-only Pi update checks with a top-right update notification and a confirmed **Update & restart** action that runs `pi update
|
|
135
|
+
- Localhost-only Pi/Web UI update checks with a top-right update notification and a confirmed **Update & restart** action that runs `pi update` plus all detected local/global Web UI and Pi package-manager updates, then restarts the Web UI server.
|
|
134
136
|
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, which can ask Pi to create or update a LEARNING.
|
|
135
137
|
- Mobile-friendly layout and PWA install support where the browser allows it.
|
|
136
138
|
|
|
@@ -138,8 +140,9 @@ Useful browser endpoints exposed by the local server include:
|
|
|
138
140
|
|
|
139
141
|
- `GET /api/path-suggestions?tab=<tabId>&query=<path>` for `@` file/path references with live suggestions.
|
|
140
142
|
- `POST /api/action-feedback?tab=<tabId>` for feedback on final assistant output and action cards.
|
|
141
|
-
- `
|
|
142
|
-
- `
|
|
143
|
+
- `GET /api/optional-features` for optional companion package install/update status.
|
|
144
|
+
- `POST /api/optional-feature-install` for installing or updating known optional companion packages from the side panel.
|
|
145
|
+
- `GET /api/update-status` and localhost-only `POST /api/update` for checking Pi/Web UI updates and running `pi update` plus all detected local/global Web UI and Pi package-manager updates followed by a Web UI server restart.
|
|
143
146
|
|
|
144
147
|
For local development, run the checkout helper directly, for example:
|
|
145
148
|
|
|
@@ -147,11 +150,13 @@ For local development, run the checkout helper directly, for example:
|
|
|
147
150
|
./start-webui.sh --dev --cwd /path/to/project
|
|
148
151
|
```
|
|
149
152
|
|
|
153
|
+
Run `../dev/scripts/sync-pi-package-symlinks.sh` first when developing companion packages from this workspace. The Web UI manifest loads companions through `node_modules/` paths, and the sync script links those paths to the top-level dev packages so only one copy is loaded.
|
|
154
|
+
|
|
150
155
|
## Optional companion packages
|
|
151
156
|
|
|
152
|
-
A normal Pi/npm install includes the optional companion packages unless optional dependencies are disabled. Startup checks loaded Pi capabilities directly through RPC-visible commands and live widget events, then the side panel shows each optional feature as enabled, disabled, or install-needed. Installing a
|
|
157
|
+
A normal Pi/npm install includes the optional companion packages unless optional dependencies are disabled. Each Web UI tab curates Pi resources from the Web UI package that started the server, while preserving unrelated user/project resources. Companion packages installed as global/npm-prefix siblings of the started Web UI package are reused when the Web UI package does not have its own nested optional dependency copy, avoiding duplicate loads while keeping global `pi-webui` launches working. Startup checks loaded Pi capabilities directly through RPC-visible commands and live widget events, then the side panel shows each optional feature as enabled, disabled, installed-but-not-loaded, update-available, or install-needed. Installing or updating a feature is an explicit, warned action with running/failure feedback in the row and activity log; it is localhost-only, limited to known packages, and requires reloading the active Pi tab after installation.
|
|
153
158
|
|
|
154
|
-
When the standalone global `pi-webui` launcher is used, optional companion installs
|
|
159
|
+
When the standalone global `pi-webui` launcher is used, optional companion installs target the npm prefix containing the Web UI package when that prefix is safe, otherwise the Pi agent npm root if it contains Web UI. Override the target explicitly with `PI_WEBUI_OPTIONAL_FEATURE_INSTALL_ROOT=/path/to/package-root` when needed.
|
|
155
160
|
|
|
156
161
|
Optional companions:
|
|
157
162
|
|
|
@@ -173,12 +178,12 @@ The Git workflow button runs local git commands in the active Pi working directo
|
|
|
173
178
|
1. `git add .`
|
|
174
179
|
2. Send `/git-staged-msg` to Pi
|
|
175
180
|
3. Read the generated commit message files from `dev/COMMIT/`
|
|
176
|
-
4. Commit with the selected message
|
|
181
|
+
4. Commit with the selected generated message, or type a manual message in the Message stage and use **Commit input**
|
|
177
182
|
5. Run `git push`
|
|
178
183
|
|
|
179
|
-
After the message is generated, **Create PR** asks Pi to generate `dev/COMMIT/staged-branch-name.txt`, lets you confirm or edit the `type/feature-name` branch, then switches with `git switch -c` before committing. In PR mode, choose **Commit short** or **Commit
|
|
184
|
+
After the message is generated, **Create PR** asks Pi to generate `dev/COMMIT/staged-branch-name.txt`, lets you confirm or edit the `type/feature-name` branch, then switches with `git switch -c` before committing. In PR mode, choose **Commit short**, **Commit long**, or type a message and use **Commit input**, then **Push and Create PR** pushes the branch, sends `/pr`, shows the generated `dev/PR/<branch>.md` description for editing/confirmation, and creates the pull request with `gh pr create`. Use **Manual branch** to skip agent branch-name generation and type the branch directly.
|
|
180
185
|
|
|
181
|
-
Use the workflow process buttons to jump directly to **Stage**, **Message**, **Commit**, or **Push** when earlier work was already completed manually. Selecting **Commit** loads the current generated files from `dev/COMMIT/` before enabling the commit choices. A yellow dot means that process was selected or is available but its action has not completed in this workflow; green means the process action completed.
|
|
186
|
+
Use the workflow process buttons to jump directly to **Stage**, **Message**, **Commit**, or **Push** when earlier work was already completed manually. Selecting **Message** lets you either run `/git-staged-msg` or type a commit message and use **Commit input** directly. Selecting **Commit** loads the current generated files from `dev/COMMIT/` before enabling the commit choices. A yellow dot means that process was selected or is available but its action has not completed in this workflow; green means the process action completed.
|
|
182
187
|
|
|
183
188
|
This requires `/git-staged-msg` and `/pr` from `@firstpick/pi-prompts-git-pr`; branch-name generation uses `/git-branch-name` when available and otherwise sends an equivalent inline prompt. Creating the PR also requires an authenticated GitHub CLI (`gh`). Review the generated commit message, branch name, and PR description before committing, pushing, or creating a PR.
|
|
184
189
|
|
|
@@ -194,7 +199,7 @@ This requires `/git-staged-msg` and `/pr` from `@firstpick/pi-prompts-git-pr`; b
|
|
|
194
199
|
- The side-panel **Open to network** button rebinds the server to `0.0.0.0`, shows LAN URLs when available, and toggles to "Close for network".
|
|
195
200
|
- `--host 0.0.0.0` also exposes the Web UI to the local network.
|
|
196
201
|
- Any connected browser client can control Pi and run Web UI bash actions as the Web UI process user.
|
|
197
|
-
- The Web UI update endpoint is restricted to localhost, because it runs
|
|
202
|
+
- The Web UI update endpoint is restricted to localhost, because it runs package update commands and restarts the server.
|
|
198
203
|
- Treat Pi Web UI as a local companion, not a hardened multi-user web service.
|
|
199
204
|
|
|
200
205
|
## Troubleshooting
|