@firstpick/pi-package-webui 0.1.8 → 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/README.md +27 -24
- package/WEBUI_TUI_NATIVE_PARITY.json +666 -0
- package/bin/pi-webui.mjs +686 -29
- package/package.json +6 -3
- package/public/app.js +1007 -94
- package/public/index.html +36 -18
- package/public/styles.css +286 -82
- package/start-webui.ps1 +323 -0
- package/start-webui.sh +461 -0
- package/tests/mobile-static.test.mjs +126 -12
- package/tests/native-parity.test.mjs +148 -0
package/README.md
CHANGED
|
@@ -57,6 +57,12 @@ For direct development from this package directory:
|
|
|
57
57
|
node bin/pi-webui.mjs --cwd /path/to/project
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
Or use the helper script in dev mode. `--dev` bypasses any `pi-webui` on `PATH` and runs this checkout's `bin/pi-webui.mjs`:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
./start-webui.sh --dev --cwd /path/to/project
|
|
64
|
+
```
|
|
65
|
+
|
|
60
66
|
After a global npm install:
|
|
61
67
|
|
|
62
68
|
```bash
|
|
@@ -66,30 +72,22 @@ pi-webui --cwd /path/to/project
|
|
|
66
72
|
|
|
67
73
|
## Features
|
|
68
74
|
|
|
69
|
-
-
|
|
70
|
-
-
|
|
71
|
-
-
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
75
|
-
-
|
|
76
|
-
-
|
|
77
|
-
-
|
|
78
|
-
-
|
|
79
|
-
-
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
-
|
|
85
|
-
- Hover-expand Publish workflow menu beside Git workflow, currently offering NPM Release and AUR Release
|
|
86
|
-
- Basic rendering for user, assistant, tool result, bash execution, and thinking messages
|
|
87
|
-
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, with queued post-run submission that asks Pi to create/update a LEARNING
|
|
88
|
-
- Basic extension UI bridge for `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`, `select`, `confirm`, `input`, and `editor`
|
|
89
|
-
- Specialized `/release-npm` and `/release-aur` widget rendering with scrollable live logs plus toggle/abort actions
|
|
90
|
-
- Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded
|
|
91
|
-
- PWA metadata, icons, and service worker for install-to-home-screen support when served from a secure context
|
|
92
|
-
- Static frontend: no bundler, no frontend install step
|
|
75
|
+
- Local browser chat over Pi RPC with isolated terminal tabs; each tab has its own `pi --mode rpc` subprocess, event stream, session state, prompt draft, cwd, and activity indicator.
|
|
76
|
+
- Automatic tab naming from the first prompt on default-named tabs, plus `/name <title>` to manually sync the Pi session and browser tab name.
|
|
77
|
+
- Live transcript with streamed assistant text/thinking, Markdown output, active-run status, tool/bash cards, queue/compaction events, jump-to-latest, sticky last-prompt navigation, and abort by button, Esc, or long press.
|
|
78
|
+
- Prompt composer for prompts, steer/follow-up, busy-session behavior, model/thinking controls, manual compact/new session, uploads by button/drag/drop/paste, slash-command autocomplete, and `@` file/path references with live suggestions.
|
|
79
|
+
- Browser-native selector dialogs for `/model`, `/settings`, `/theme`, `/fork`, `/clone`, `/resume`, `/tree`, and `/scoped-models`; `/login`/`/logout` show non-secret guidance instead of accepting credentials in the browser.
|
|
80
|
+
- Native TUI parity tracking through `WEBUI_TUI_NATIVE_PARITY.json`, used as the source of truth for native command discovery and exposed at `GET /api/native-parity`.
|
|
81
|
+
- Initial `/export` parity: `/export` creates an HTML browser download through a short-lived opaque token, while explicit new `.html`/`.jsonl` paths write server-side from localhost only.
|
|
82
|
+
- Initial `!` / `!!` bash parity: leading `!cmd` runs queued RPC bash and includes output in the next LLM context; `!!cmd` runs with `excludeFromContext`; the active bash can be aborted from the Web UI.
|
|
83
|
+
- Initial native shortcut parity for Ctrl/Cmd+L model selector, Ctrl/Cmd+P and Shift+Ctrl/Cmd+P model cycling, Shift+Tab thinking cycling, Ctrl/Cmd+T thinking visibility, Ctrl/Cmd+O tool/bash expansion, Alt+Enter follow-up, degraded Alt+Up queue restore, and Ctrl/Cmd+C prompt clear when no text is selected.
|
|
84
|
+
- Session/workspace helpers for per-tab cwd changes, a clickable footer cwd picker with server-persisted fast picks, fork/clone/resume/tree navigation, and restart-safe restoration of currently open tabs.
|
|
85
|
+
- Collapsible side-panel control deck for model/thinking/settings, optional features, Codex usage, session/queue/commands/events, local-network exposure, browser notifications, and Web UI themes/custom backgrounds.
|
|
86
|
+
- Pi-style footer with token/cache/context/cost/speed telemetry, estimated Pi-context tokens, cwd/git/runtime/model/thinking metadata, and a scoped-model picker.
|
|
87
|
+
- Optional companion management with capability-based enabled/disabled/install-needed status, localhost-only warned installs, Side-panel theme picker backed by optional `@firstpick/pi-themes-bundle` themes when loaded, guided Git commit/push workflow, NPM/AUR Publish menu, todo-progress rendering, and richer git/status/stats widgets.
|
|
88
|
+
- Extension UI bridge for `notify`, `setStatus`, `setWidget`, `setTitle`, `set_editor_text`, `select`, `confirm`, `input`, and `editor`, with browser notifications when a tab needs an extension UI response and an optional side-panel toggle for agent-done notifications.
|
|
89
|
+
- Feedback reactions (`👍`, `👎`, `?`) on final assistant output plus tool/bash action cards, with queued post-run submission that asks Pi to create/update a LEARNING.
|
|
90
|
+
- Mobile/PWA support: installable app shell, service worker/icons, backend-offline recovery panel, touch-friendly composer/tabs/footer, and a static frontend with no bundler or frontend install step.
|
|
93
91
|
|
|
94
92
|
## Mobile/PWA notes
|
|
95
93
|
|
|
@@ -206,12 +204,16 @@ The local server exposes:
|
|
|
206
204
|
- `GET /api/path-fast-picks` and `POST /api/path-fast-picks` for cwd picker fast picks persisted across browser tabs, Pi terminal tabs, and Web UI server restarts
|
|
207
205
|
- `POST /api/attachments` for browser-selected, pasted, or dropped files; files are stored under the OS temp directory and referenced in the prompt, while supported images can also be sent inline via RPC `images`
|
|
208
206
|
- `GET /api/themes` for optional theme data from `@firstpick/pi-themes-bundle` when available
|
|
207
|
+
- `GET /api/native-parity` for the machine-readable native TUI parity matrix that drives native command discovery
|
|
208
|
+
- `GET /api/native-download/<token>` for short-lived opaque native command artifacts such as browser `/export` downloads
|
|
209
209
|
- `GET /api/fork-messages`, `POST /api/fork`, `POST /api/clone`, `GET /api/sessions`, `POST /api/switch-session`, `GET /api/session-tree`, and `POST /api/tree-navigate` for browser-native native slash selectors
|
|
210
210
|
- localhost-only `POST /api/optional-feature-install` for explicit, warned installation of whitelisted optional feature packages
|
|
211
211
|
- `GET /api/network` and localhost-only `POST /api/network/open` for local-network exposure status/control
|
|
212
212
|
- `GET /api/webui-status?detailed=1` for slash-command status reporting
|
|
213
213
|
- `POST /api/shutdown` for localhost-only graceful restarts from `/webui-start`; restart captures detailed open-tab status first so currently open tabs can be restored with their session files
|
|
214
214
|
- HTTP endpoints for prompt/session/model/thinking/compact/git actions; tab-scoped calls use `?tab=<tabId>`
|
|
215
|
+
- `POST /api/bash?tab=<tabId>` and `POST /api/abort-bash?tab=<tabId>` for leading `!` / `!!` user bash parity with server-side one-active-per-tab FIFO queuing
|
|
216
|
+
- `POST /api/model-cycle?tab=<tabId>` and `POST /api/thinking-cycle?tab=<tabId>` for native shortcut model/thinking cycling
|
|
215
217
|
- `POST /api/action-feedback?tab=<tabId>` to turn queued action/final-output reactions into a Pi prompt that creates/updates a LEARNING after the run is idle
|
|
216
218
|
- `/api/events?tab=<tabId>` as a per-tab Server-Sent Events stream for Pi RPC events
|
|
217
219
|
- `/api/extension-ui-response?tab=<tabId>` for browser responses to extension UI prompts
|
|
@@ -225,3 +227,4 @@ Pi stdout is read as JSONL and split only on `\n`, matching Pi RPC framing.
|
|
|
225
227
|
- `--host 0.0.0.0` also makes the UI reachable from the network and is unsafe unless the network is trusted.
|
|
226
228
|
- The UI is intended as a local companion, not a hardened multi-user web service.
|
|
227
229
|
- Browser actions can trigger Pi tools, shell commands, file edits, and git operations according to the spawned Pi session's permissions.
|
|
230
|
+
- If the Web UI is exposed to a LAN, any connected browser client can use `!` / `!!` bash and the `/api/bash` endpoint to run shell commands as the Web UI process user.
|