@firstpick/pi-package-webui 0.9.1 → 0.9.2

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.
Files changed (70) hide show
  1. package/README.md +21 -5
  2. package/bin/pi-webui-launcher.mjs +23 -12
  3. package/bin/pi-webui.mjs +479 -60
  4. package/lib/agent-run-adapters.mjs +500 -0
  5. package/lib/agent-run-protocol.mjs +262 -0
  6. package/lib/agent-run-registry.mjs +339 -0
  7. package/lib/git-workflow-preferences.mjs +11 -4
  8. package/lib/trust-boundaries.mjs +2 -0
  9. package/lib/ui-layout-settings.mjs +172 -28
  10. package/lib/update/package-layout.mjs +50 -0
  11. package/lib/update/plan.mjs +11 -0
  12. package/package.json +1 -1
  13. package/public/app.js +1261 -314
  14. package/public/index.html +113 -68
  15. package/public/service-worker.js +1 -1
  16. package/public/styles.css +371 -93
  17. package/tests/agent-run-adapters.test.mjs +217 -0
  18. package/tests/agent-run-launcher.test.mjs +41 -0
  19. package/tests/agent-run-protocol.test.mjs +82 -0
  20. package/tests/agent-run-registry.test.mjs +102 -0
  21. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  22. package/tests/browser/control-deck-side-panels.spec.mjs +354 -0
  23. package/tests/browser/controls-layout.spec.mjs +122 -0
  24. package/tests/browser/file-tree-git-ignored.spec.mjs +113 -0
  25. package/tests/browser/interaction-continuity.spec.mjs +127 -0
  26. package/tests/browser/mobile-foundation.spec.mjs +26 -0
  27. package/tests/browser/model-search-focus.spec.mjs +96 -0
  28. package/tests/browser/optimistic-prompt.spec.mjs +22 -0
  29. package/tests/browser/persistent-ui-layout.spec.mjs +224 -66
  30. package/tests/browser/subagent-observability.spec.mjs +87 -0
  31. package/tests/codex-fast-mode-static.test.mjs +2 -2
  32. package/tests/component-update-api-static.test.mjs +2 -1
  33. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  34. package/tests/control-deck-component-updates-static.test.mjs +2 -0
  35. package/tests/control-deck-side-panels-static.test.mjs +68 -0
  36. package/tests/controls-layout-static.test.mjs +22 -0
  37. package/tests/fast-mode-client-static.test.mjs +1 -1
  38. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  39. package/tests/file-tree-git-ignored-static.test.mjs +152 -0
  40. package/tests/file-tree-search-layout-static.test.mjs +2 -1
  41. package/tests/fixtures/fake-pi.mjs +43 -7
  42. package/tests/git-workflow-preferences.test.mjs +55 -6
  43. package/tests/http-endpoints-harness.test.mjs +173 -14
  44. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  45. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  46. package/tests/mobile-foundation-static.test.mjs +3 -3
  47. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  48. package/tests/mobile-static.test.mjs +13 -3
  49. package/tests/open-issue-wizard-static.test.mjs +2 -2
  50. package/tests/persistent-ui-layout-static.test.mjs +13 -13
  51. package/tests/questionnaire-dialog.test.mjs +3 -3
  52. package/tests/remote-auth-settings-harness.test.mjs +1 -1
  53. package/tests/session-sampling-ui-static.test.mjs +3 -3
  54. package/tests/side-panel-context-menu-static.test.mjs +1 -1
  55. package/tests/side-panel-resize-static.test.mjs +26 -16
  56. package/tests/side-panel-section-height-removal-static.test.mjs +4 -4
  57. package/tests/side-panel-section-reorder-static.test.mjs +16 -70
  58. package/tests/subagent-gate-visibility.test.mjs +2 -1
  59. package/tests/subagent-launch-slots.test.mjs +1 -1
  60. package/tests/subagent-observability-static.test.mjs +32 -0
  61. package/tests/subagent-reliability-integration.test.mjs +161 -0
  62. package/tests/subagents-helper.test.mjs +344 -4
  63. package/tests/terminal-tabs-resize-static.test.mjs +35 -0
  64. package/tests/theme-customizer-static.test.mjs +1 -1
  65. package/tests/ui-layout-settings.test.mjs +104 -32
  66. package/tests/update-api-harness.test.mjs +24 -10
  67. package/tests/update-package-layout.test.mjs +38 -0
  68. package/tests/update-plan.test.mjs +11 -1
  69. package/tests/webui-settings-locking.test.mjs +33 -3
  70. package/webui-rpc-helper.mjs +417 -28
package/README.md CHANGED
@@ -18,13 +18,13 @@ Pi Web UI keeps the normal Pi agent experience while giving you more room to man
18
18
  | Area | Highlights |
19
19
  | --- | --- |
20
20
  | **Sessions and workspaces** | Run several isolated Pi sessions, resume prior work, switch projects, preserve per-tab drafts, and create branch worktrees. |
21
- | **Live agent work** | Follow streaming Markdown, thinking, tool output, queues, todo progress, subagents, and context usage without leaving the browser. |
21
+ | **Live agent work** | Follow streaming Markdown, thinking, tool output, queues, todo progress, and managed or registered Pi agent runs without leaving the browser. |
22
22
  | **Models and controls** | Change models and thinking effort, manage scoped models, configure tools and skills, and use the command palette. |
23
- | **Files and prompts** | Upload or paste files and images, edit text attachments, use slash-command suggestions, and reference project paths with `@`. |
23
+ | **Files and prompts** | Upload or paste files and images, edit text attachments, use slash-command suggestions, browse project files, and reference project paths with `@`. |
24
24
  | **Git workflows** | Inspect changes, switch branches, review diffs, stage work, generate commit messages, push, and prepare pull requests through guided steps. |
25
25
  | **Project utilities** | Launch detected app runners, manage working directories, search files and transcripts, and customize themes. |
26
26
  | **Companion features** | Add stats, remote access, voice, `/btw`, richer Git status, themes, release tools, and other supported Pi packages. |
27
- | **Desktop and mobile** | Use a full desktop workspace or a compact phone layout with touch-friendly navigation and controls. |
27
+ | **Desktop and mobile** | Use a full desktop workspace with resizable left and right side panels, or a compact phone layout with touch-friendly navigation and controls. |
28
28
 
29
29
  ## Quick start
30
30
 
@@ -61,7 +61,12 @@ Check the server at any time with:
61
61
  2. Confirm the working directory in the footer or choose another project.
62
62
  3. Select a model and thinking effort.
63
63
  4. Enter a prompt, attach context if needed, and follow the live response.
64
- 5. Open the side panel for sessions, Git, app runners, themes, updates, and optional features.
64
+ 5. Open the Control Deck for sessions, Git, app runners, themes, updates, and optional features. Under **Controls → Interface**, choose **Top bar** or **Sidebar** for terminal tabs, then choose **Right**, **Left**, or **Both** for the Control Deck. In **Sidebar**, **Both** is unavailable; choosing **Right** or **Left** swaps the Control Deck and terminal/tabs rails across the chat.
65
+ 6. On desktop, drag the workspace-facing edge of any visible Control Deck—or the terminal/tabs rail in **Sidebar**—to choose a comfortable width. In **Both**, resize the left and right Control Decks independently; widths return on your next visit.
66
+
67
+ Open **Subagents** to follow agent runs launched by managed extensions or registered SDK, RPC, JSON, print, interactive, tmux, workflow, schedule, gate, and custom integrations. Runs linked to an open WebUI terminal stay in that terminal’s group; other registered runs appear under **External agents**. Each row shows its launch source and lifecycle, and only offers output or controls that its owner supports.
68
+
69
+ Independent Pi processes do not appear automatically. Start them through `pi-webui agent run`, attach a persisted session with `pi-webui agent attach`, or use a cooperating registration adapter. See [TECHNICAL.md](TECHNICAL.md#subagent-observability) for supported commands and limitations.
65
70
 
66
71
  Useful shortcuts:
67
72
 
@@ -70,6 +75,7 @@ Useful shortcuts:
70
75
  - `Ctrl/Cmd+F` searches the active file, transcript, or subagent output and highlights every match.
71
76
  - `Alt+Enter` queues the composer as a follow-up.
72
77
  - Hold `Esc` to abort active work.
78
+ - In the Control Deck, use `Alt+Up` / `Alt+Down` to reorder a section. In **Both**, use `Alt+Left` / `Alt+Right` to move it between sides.
73
79
 
74
80
  ## Feature gallery
75
81
 
@@ -91,7 +97,7 @@ See the active project, model, context, Git state, queue, sessions, and common a
91
97
 
92
98
  **Optional feature needed:** None — the control panel is included in Pi Web UI core. Companion-specific sections require their corresponding packages.
93
99
 
94
- Manage the current session, workspace, model, theme, notifications, updates, usage, and optional packages.
100
+ Manage the current session, workspace, model, theme, notifications, updates, usage, and optional packages. The **Controls** section keeps each setting on one compact name/value row; point to or focus a setting name for plain-language help.
95
101
 
96
102
  #### Working-directory picker
97
103
 
@@ -101,6 +107,12 @@ Manage the current session, workspace, model, theme, notifications, updates, usa
101
107
 
102
108
  Browse, search, save, or create project directories and open them in the active Pi tab.
103
109
 
110
+ #### Files panel
111
+
112
+ **Optional feature needed:** None — the Files panel is included in Pi Web UI core.
113
+
114
+ Browse and search the files of the active project, open them in the viewer, and use the row menu for file actions. In a Git repository, files and folders that Git ignores stay listed and fully usable, but appear greyed out so generated output such as `node_modules` or build folders is easy to tell apart. Point at a greyed row to see the “Ignored by Git” hint in its tooltip.
115
+
104
116
  #### Queue manager
105
117
 
106
118
  ![Pi Web UI queue panel with prompt-list controls and queued-message status](https://raw.githubusercontent.com/Firstp1ck/pi-coding-agent-forge/main/pi-package-webui/images/Webui_Queues_v0.4.8.png)
@@ -251,6 +263,10 @@ Use the optional Remote Web UI package when you need trusted-LAN access and PIN
251
263
 
252
264
  ## Technical details
253
265
 
266
+ Core updates use a persisted exact-target plan bound to a plan digest. The server verifies package ownership before mutation, supports npm-hoisted bundled Pi installs, and refuses plans with no accepted targets without entering the restart flow.
267
+
268
+ > **Before downgrading:** stop the Web UI and back up `~/.pi/webui/settings.json`. Older releases do not understand the two-sided Control Deck layout and can overwrite it. Re-upgrade before restoring the backup.
269
+
254
270
  See [TECHNICAL.md](TECHNICAL.md) for complete commands, configuration, update and rollback behavior, session continuity, security, compatibility, mobile behavior, and troubleshooting.
255
271
 
256
272
  Contributor-only architecture, API, and testing information lives in [DEVELOPMENT.md](DEVELOPMENT.md).
@@ -8,15 +8,26 @@ import { readRuntimePointer } from "../lib/update/supervisor.mjs";
8
8
  const bootstrapRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
9
9
  const bootstrapServer = path.join(bootstrapRoot, "bin", "pi-webui.mjs");
10
10
  const agentDir = process.env.PI_CODING_AGENT_DIR || path.join(homedir(), ".pi", "agent");
11
- const pointer = await readRuntimePointer(agentDir, "current");
12
- const serverEntry = pointer?.serverEntry || bootstrapServer;
13
- const child = spawn(process.execPath, [serverEntry, ...process.argv.slice(2)], {
14
- cwd: process.cwd(), env: process.env, stdio: "inherit", windowsHide: true,
15
- });
16
- child.once("error", (error) => { console.error(`Pi Web UI launcher failed: ${error.message || error}`); process.exitCode = 1; });
17
- child.once("exit", (code, signal) => {
18
- if (signal) {
19
- try { process.kill(process.pid, signal); } catch { process.exitCode = 1; }
20
- } else process.exitCode = code ?? 1;
21
- });
22
- for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => { try { child.kill(signal); } catch {} });
11
+
12
+ if (process.argv[2] === "agent") {
13
+ try {
14
+ const { runAgentCli } = await import("../lib/agent-run-adapters.mjs");
15
+ process.exitCode = await runAgentCli(process.argv.slice(3), { agentDir });
16
+ } catch (error) {
17
+ console.error(`Pi Web UI agent command failed: ${error?.message || error}`);
18
+ process.exitCode = 1;
19
+ }
20
+ } else {
21
+ const pointer = await readRuntimePointer(agentDir, "current");
22
+ const serverEntry = pointer?.serverEntry || bootstrapServer;
23
+ const child = spawn(process.execPath, [serverEntry, ...process.argv.slice(2)], {
24
+ cwd: process.cwd(), env: process.env, stdio: "inherit", windowsHide: true,
25
+ });
26
+ child.once("error", (error) => { console.error(`Pi Web UI launcher failed: ${error.message || error}`); process.exitCode = 1; });
27
+ child.once("exit", (code, signal) => {
28
+ if (signal) {
29
+ try { process.kill(process.pid, signal); } catch { process.exitCode = 1; }
30
+ } else process.exitCode = code ?? 1;
31
+ });
32
+ for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => { try { child.kill(signal); } catch {} });
33
+ }