@firstpick/pi-package-webui 0.6.9 → 0.7.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 +7 -2
- package/bin/pi-webui.mjs +407 -31
- package/index.ts +7 -91
- package/package.json +8 -7
- package/public/app.js +1140 -100
- 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 +54 -1
- package/public/styles.css +290 -20
- 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 +46 -0
- package/tests/guided-git-aur-review.test.mjs +183 -0
- package/tests/http-endpoints-harness.test.mjs +118 -1
- package/tests/mobile-static.test.mjs +123 -12
- 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
|
@@ -143,6 +143,7 @@ Optional Natural Conversation server-side voice fallback variables:
|
|
|
143
143
|
|
|
144
144
|
- Pathless `pi-webui` startup: the server opens first, then the browser prompts for the first terminal CWD.
|
|
145
145
|
- Multi-tab Pi sessions with isolated processes, working directories, prompt drafts, activity state, per-tab settings, and a workspace dashboard for common actions.
|
|
146
|
+
- Tracked subagent output can open in the existing non-blocking overlay/widget or in a dedicated **Subagent** terminal tab, selected from the Subagents side-panel section and saved in the browser. Subagent tabs are view-only, reuse the bounded live transcript at the normal full terminal width, show the pulsing **Agent is running:** card with current child activity, and close without stopping or interrupting the child run; use the parent terminal for interaction.
|
|
146
147
|
- Unified command palette (`Ctrl/Cmd+K`) for commands, tabs, models, sessions, settings, app controls, and frequent Web UI actions.
|
|
147
148
|
- Automatic tab naming from the first prompt, with `--name <name>` still available for an explicit initial tab name.
|
|
148
149
|
- Streaming chat transcript with Markdown, copy buttons for fenced code blocks, rendered Mermaid diagrams from fenced `mermaid`/`mmd` code blocks, thinking output, tool/bash cards, queue and compaction events, edit-and-retry from user prompts, transcript search, copy buttons, and guarded abort controls that require holding Esc or the Abort button for 3 seconds.
|
|
@@ -158,7 +159,7 @@ Optional Natural Conversation server-side voice fallback variables:
|
|
|
158
159
|
- Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded.
|
|
159
160
|
- 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.
|
|
160
161
|
- 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.
|
|
161
|
-
- 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.
|
|
162
|
+
- 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.
|
|
162
163
|
- 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.
|
|
163
164
|
- 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.
|
|
164
165
|
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, which can ask Pi to create or update a LEARNING.
|
|
@@ -338,6 +339,7 @@ Useful browser endpoints exposed by the local server include:
|
|
|
338
339
|
- `POST /api/action-feedback?tab=<tabId>` for feedback on final assistant output and action cards.
|
|
339
340
|
- `GET /api/optional-features` for optional companion package install/update status.
|
|
340
341
|
- `POST /api/optional-feature-install` for installing or updating known optional companion packages from the side panel.
|
|
342
|
+
- `GET /api/git-workflow/staged-content?tab=<tabId>` for the read-only bounded staged-content hash used by Guided Git approval binding.
|
|
341
343
|
- `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.
|
|
342
344
|
- `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.
|
|
343
345
|
|
|
@@ -353,7 +355,9 @@ Run `../dev/scripts/sync-pi-package-symlinks.sh` first when developing companion
|
|
|
353
355
|
|
|
354
356
|
## Optional companion packages
|
|
355
357
|
|
|
356
|
-
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.
|
|
358
|
+
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.
|
|
359
|
+
|
|
360
|
+
`@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.
|
|
357
361
|
|
|
358
362
|
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.
|
|
359
363
|
|
|
@@ -366,6 +370,7 @@ Optional companions:
|
|
|
366
370
|
- `@firstpick/pi-prompts-git-pr` — guided Git commit/push workflow.
|
|
367
371
|
- `@firstpick/pi-extension-release-npm` — NPM publish menu and release widgets.
|
|
368
372
|
- `@firstpick/pi-extension-release-aur` — AUR publish menu and release widgets.
|
|
373
|
+
- `@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.
|
|
369
374
|
- `@firstpick/pi-extension-workflows` — `/workflow` runtime with non-blocking Web UI subprocess-output widgets.
|
|
370
375
|
- `@firstpick/pi-extension-safety-guard` — configurable guardrails for dangerous bash commands and protected file edits, with native `/safety-guard-setup` controls.
|
|
371
376
|
- `@firstpick/pi-extension-setup-skills` — TUI `/skills` setup command alongside WebUI-native skill toggles.
|