@firstpick/pi-package-webui 0.6.8 → 0.7.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/README.md +7 -2
- package/bin/pi-webui.mjs +577 -37
- package/index.ts +7 -91
- package/lib/trust-boundaries.mjs +1 -0
- package/package.json +10 -9
- package/public/app.js +869 -118
- package/public/aur-review-payload.mjs +108 -0
- package/public/guided-git-command-state.mjs +34 -0
- package/public/guided-git-review-state.mjs +137 -0
- package/public/index.html +178 -97
- package/public/service-worker.js +1 -1
- package/public/styles.css +454 -24
- package/tests/aur-review-payload.test.mjs +57 -0
- package/tests/aur-review-widget-static.test.mjs +38 -0
- package/tests/compaction-resume-harness.test.mjs +55 -3
- package/tests/compaction-static.test.mjs +3 -3
- package/tests/fixtures/compacting-pi.mjs +10 -5
- package/tests/fixtures/fake-pi.mjs +63 -1
- package/tests/guided-git-aur-review.test.mjs +183 -0
- package/tests/http-endpoints-harness.test.mjs +184 -3
- package/tests/mobile-static.test.mjs +110 -21
- package/tests/staged-content-hash-contract.test.mjs +174 -0
- package/tests/subagents-helper.test.mjs +83 -4
- package/tests/transport-hardening-harness.test.mjs +157 -0
- package/webui-rpc-helper.mjs +108 -25
package/README.md
CHANGED
|
@@ -122,6 +122,7 @@ Environment variables:
|
|
|
122
122
|
- `PI_WEBUI_HOST` and `PI_WEBUI_PORT` set the default bind address.
|
|
123
123
|
- `PI_WEBUI_PI_BIN=/path/to/pi` selects the Pi executable when `--pi` is not passed.
|
|
124
124
|
- `PI_WEBUI_REMOTE_AUTH=1` starts with Remote PIN authentication enabled.
|
|
125
|
+
- Pi Web UI automatically injects a loopback `PI_WEBUI_RECOVERY_URL` and a bearer `PI_WEBUI_RECOVERY_TOKEN` into spawned Pi RPC processes. The authenticated endpoint can only create a separate plan-only recovery tab; keep any manually supplied token private.
|
|
125
126
|
- `PI_WEBUI_SETTINGS_FILE=/path/to/settings.json` overrides persisted Web UI settings such as Remote PIN auth, guided Git preferences, and global Tools/Skills defaults.
|
|
126
127
|
- `PI_WEBUI_OPTIONAL_FEATURE_INSTALL_ROOT=/path/to/package-root` overrides the npm prefix used for optional companion installs.
|
|
127
128
|
- `PI_WEBUI_FAST_PICKS_FILE=/path/to/paths.json` overrides saved cwd fast-pick storage.
|
|
@@ -157,7 +158,7 @@ Optional Natural Conversation server-side voice fallback variables:
|
|
|
157
158
|
- Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded.
|
|
158
159
|
- Per-tab cwd changes, a clickable footer cwd picker, directory creation/search in the picker, saved path fast picks, server-persisted fast picks, and restart-safe restoration of open tabs.
|
|
159
160
|
- 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. Running app runners expose line-oriented stdin in the widget for interactive scripts. Projects can add browseable custom runners in `.pi-webui-runners.json` with a command (default `./`) plus a relative path to the file to run.
|
|
160
|
-
- Guided Git workflow for existing repos and new repos with persistent model/reasoning preferences, review-first staging, generated or typed commit messages, explicit push/PR confirmation, and optional PR worktrees.
|
|
161
|
+
- Guided Git workflow for existing repos and new repos with persistent model/reasoning preferences, review-first staging, an optional manual staged repository-review gate from `aur-review`, generated or typed commit messages, explicit push/PR confirmation, and optional PR worktrees. When the review extension is loaded/enabled, both `git add .` and accepting the current staged set send `/aur-review start --scope staged --origin guided-git` to the same tab. Only its matching approval advances to message generation. The browser and server recheck the approved domain-separated staged-content hash before message generation, commit, and PR-worktree transfer; drift, missing hashes, or hash-check errors return to Stage and require a new review. A decline returns to staging and rejects an unchanged declined staged hash until corrected content is restaged. Guided Git never stages, commits, or pushes remediation automatically. The extension remains the decision authority; direct API callers are not granted an approval by this browser workflow.
|
|
161
162
|
- Browser support for Pi extension UI prompts, widgets, status updates, `/btw` side-question output widgets with optional context transfer/live steering, browser notifications when a tab needs an extension UI response, and an optional side-panel toggle for agent-done notifications.
|
|
162
163
|
- Localhost-only Pi/Web UI update checks with a top-right update notification and confirmed restart actions: **Update Pi & restart** runs `pi update --self` for Pi-only updates, while **Update Pi + Packages & Restart** first checks the selected Pi executable's `pi update --help`. It uses `pi update --all` when advertised, otherwise falls back to `pi update --self` followed by `pi update --extensions`, then updates detected Web UI/Optional Feature package roots for configured, local agent, project, global npm, and global Bun installs.
|
|
163
164
|
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, which can ask Pi to create or update a LEARNING.
|
|
@@ -337,6 +338,7 @@ Useful browser endpoints exposed by the local server include:
|
|
|
337
338
|
- `POST /api/action-feedback?tab=<tabId>` for feedback on final assistant output and action cards.
|
|
338
339
|
- `GET /api/optional-features` for optional companion package install/update status.
|
|
339
340
|
- `POST /api/optional-feature-install` for installing or updating known optional companion packages from the side panel.
|
|
341
|
+
- `GET /api/git-workflow/staged-content?tab=<tabId>` for the read-only bounded staged-content hash used by Guided Git approval binding.
|
|
340
342
|
- `GET /api/update-status`, localhost-only `POST /api/restart`, and localhost-only `POST /api/update` for checking Pi/Web UI updates and restarting the Web UI. `POST /api/update?all=1` probes the selected Pi executable for `pi update --all`, uses the split `pi update --self` plus `pi update --extensions` fallback when unavailable, and then updates detected Web UI/Optional Feature package roots for configured, local agent, project, global npm, and global Bun installs.
|
|
341
343
|
- `GET /api/network`, localhost-only `POST /api/network/open`, localhost-only `POST /api/network/close`, `GET /api/remote-auth`, `POST /api/remote-auth`, and localhost-only `POST /api/remote-auth/settings` for trusted-LAN exposure and optional 4-digit PIN authentication when serving non-local browser clients.
|
|
342
344
|
|
|
@@ -352,7 +354,9 @@ Run `../dev/scripts/sync-pi-package-symlinks.sh` first when developing companion
|
|
|
352
354
|
|
|
353
355
|
## Optional companion packages
|
|
354
356
|
|
|
355
|
-
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.
|
|
357
|
+
A normal Pi/npm install includes the published 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.
|
|
358
|
+
|
|
359
|
+
`@firstpick/pi-extension-aur-review` is intentionally not bundled with this WebUI release until it is published. From this workspace, install it locally with `pi install /home/firstpick/npm-packages/pi-extension-aur-review`, then reload the affected Pi/WebUI tab. `pi install npm:@firstpick/pi-extension-aur-review` becomes valid only after that package is published to npm.
|
|
356
360
|
|
|
357
361
|
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.
|
|
358
362
|
|
|
@@ -365,6 +369,7 @@ Optional companions:
|
|
|
365
369
|
- `@firstpick/pi-prompts-git-pr` — guided Git commit/push workflow.
|
|
366
370
|
- `@firstpick/pi-extension-release-npm` — NPM publish menu and release widgets.
|
|
367
371
|
- `@firstpick/pi-extension-release-aur` — AUR publish menu and release widgets.
|
|
372
|
+
- `@firstpick/pi-extension-aur-review` — Deterministic manual repository/Git review with working-tree standalone snapshots, staged Guided Git snapshots, and a specialized browser card. Install from `/home/firstpick/npm-packages/pi-extension-aur-review` locally for now; npm installation is valid only after publication.
|
|
368
373
|
- `@firstpick/pi-extension-workflows` — `/workflow` runtime with non-blocking Web UI subprocess-output widgets.
|
|
369
374
|
- `@firstpick/pi-extension-safety-guard` — configurable guardrails for dangerous bash commands and protected file edits, with native `/safety-guard-setup` controls.
|
|
370
375
|
- `@firstpick/pi-extension-setup-skills` — TUI `/skills` setup command alongside WebUI-native skill toggles.
|