@firstpick/pi-package-webui 0.7.8 → 0.8.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.
Files changed (41) hide show
  1. package/README.md +10 -4
  2. package/bin/pi-webui.mjs +696 -69
  3. package/lib/git-workflow-preferences.mjs +16 -0
  4. package/lib/git-worktrees.mjs +43 -4
  5. package/lib/queue-mutation.mjs +109 -0
  6. package/lib/scoped-models.mjs +19 -0
  7. package/lib/webui-workspaces.mjs +265 -0
  8. package/package.json +4 -2
  9. package/public/app.js +2074 -188
  10. package/public/index.html +105 -4
  11. package/public/service-worker.js +1 -1
  12. package/public/styles.css +618 -73
  13. package/public/voice-conversation.mjs +1 -1
  14. package/tests/boot-failure-diagnostics.test.mjs +2 -2
  15. package/tests/codex-fast-mode-static.test.mjs +56 -0
  16. package/tests/compaction-mutation-contract.test.mjs +166 -0
  17. package/tests/compaction-resume-harness.test.mjs +113 -2
  18. package/tests/compaction-static.test.mjs +5 -0
  19. package/tests/composer-skill-tag-layout.test.mjs +70 -0
  20. package/tests/cwd-footer-reliability-static.test.mjs +5 -0
  21. package/tests/fast-mode-client-static.test.mjs +8 -8
  22. package/tests/file-selection-overlay-static.test.mjs +21 -0
  23. package/tests/file-viewer-search-static.test.mjs +65 -0
  24. package/tests/fixtures/fake-pi.mjs +216 -43
  25. package/tests/git-panel-file-preview-static.test.mjs +20 -5
  26. package/tests/git-workflow-preferences.test.mjs +8 -0
  27. package/tests/guided-git-publication-backend-static.test.mjs +40 -0
  28. package/tests/http-endpoints-harness.test.mjs +422 -2
  29. package/tests/mobile-static.test.mjs +111 -42
  30. package/tests/native-parity.test.mjs +1 -1
  31. package/tests/open-issue-wizard-static.test.mjs +1 -1
  32. package/tests/queue-edit-reorder-static.test.mjs +101 -0
  33. package/tests/queue-mutation-contract.test.mjs +143 -0
  34. package/tests/scoped-models.test.mjs +42 -0
  35. package/tests/side-panel-resize-static.test.mjs +8 -1
  36. package/tests/subagents-helper.test.mjs +216 -3
  37. package/tests/terminal-tab-workspace-static.test.mjs +4 -2
  38. package/tests/webui-workspaces-harness.test.mjs +223 -0
  39. package/tests/webui-workspaces.test.mjs +106 -0
  40. package/tests/workspace-save-load-static.test.mjs +69 -0
  41. package/webui-rpc-helper.mjs +300 -41
package/public/index.html CHANGED
@@ -142,6 +142,7 @@
142
142
  </div>
143
143
  <div class="terminal-sidebar-actions" aria-label="Tab and workspace actions">
144
144
  <button id="splitTabButton" class="terminal-split-button" type="button" aria-label="Split the active terminal to the right" aria-pressed="false"><svg class="terminal-split-icon terminal-split-icon-split" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M12 5v14M15 12h4m0 0-2-2m2 2-2 2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg><svg class="terminal-split-icon terminal-split-icon-unsplit" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="4" y="5" width="16" height="14" rx="2" fill="none" stroke="currentColor" stroke-width="2"/><path d="M12 5v14M19 12h-4m0 0 2-2m-2 2 2 2" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg><span class="terminal-sidebar-action-label terminal-sidebar-action-label-split">Split</span><span class="terminal-sidebar-action-label terminal-sidebar-action-label-unsplit">Unsplit</span></button>
145
+ <button id="workspaceSaveButton" class="terminal-workspace-save-button" type="button" aria-label="Save workspace" data-tooltip="Save workspace:&#10;• Captures all open tabs, sessions, order, custom groups, and the active tab.&#10;• Available when at least one tab is open."><svg class="terminal-workspace-save-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 4h11l3 3v13H5z" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/><path d="M8 4v6h7V4M8 19v-5h8v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linejoin="round"/></svg><span class="terminal-sidebar-action-label">Save workspace</span></button>
145
146
  <button id="commandPaletteButton" class="terminal-command-palette-button" type="button" aria-label="Open command palette" data-tooltip="Command palette:&#10;• Search and run actions, slash commands, models, and tabs.&#10;• Shortcut: Ctrl/Cmd+K."><svg class="composer-icon command-palette-launcher-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M5 7.5h14" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 12h9" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M5 16.5h5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"/><path d="M17 14.5 19.5 17 17 19.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg><span class="terminal-sidebar-action-label">Commands</span></button>
146
147
  <button id="workspaceDashboardToggleButton" class="terminal-dashboard-button" type="button" aria-controls="workspaceDashboard" aria-expanded="false" aria-label="Show workspace overview" data-tooltip="Workspace overview:&#10;• Shows current tab, cwd, model, context, session, and queue.&#10;• Opens common workspace/session actions from one place."><svg class="composer-icon workspace-overview-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M4 11.4 12 4l8 7.4" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M6.5 10.5V20h11v-9.5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/><path d="M10 20v-5h4v5" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg><span class="terminal-sidebar-action-label">Overview</span></button>
147
148
  </div>
@@ -158,6 +159,7 @@
158
159
  <span id="subagentTerminalMeta" class="subagent-terminal-meta muted"></span>
159
160
  </div>
160
161
  <div class="subagent-terminal-actions">
162
+ <button id="subagentTerminalCancelButton" class="danger" type="button" hidden>Cancel…</button>
161
163
  <button id="subagentTerminalCopyButton" type="button">Copy output</button>
162
164
  <button id="subagentTerminalRefreshButton" type="button">Refresh</button>
163
165
  </div>
@@ -250,6 +252,9 @@
250
252
  </button>
251
253
  </div>
252
254
  <textarea id="promptInput" rows="1" enterkeyhint="enter" placeholder="Ask Pi…" role="combobox" aria-autocomplete="list" aria-controls="commandSuggest" aria-expanded="false" autofocus></textarea>
255
+ <button id="followUpQueueTrigger" class="follow-up-queue-trigger" type="button" aria-controls="followUpQueueOverlay" aria-expanded="false" hidden>
256
+ <span>Queue</span><span id="followUpQueueTriggerCount" class="follow-up-queue-trigger-count">0</span>
257
+ </button>
253
258
  <button
254
259
  id="attachButton"
255
260
  class="composer-icon-button composer-attach-button"
@@ -260,6 +265,14 @@
260
265
  ><svg class="composer-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.82-2.82l8.48-8.49" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>
261
266
  <input id="attachmentInput" class="attachment-input" type="file" multiple accept="image/*,video/*,audio/*,text/*,application/pdf,application/msword,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.ms-powerpoint,application/vnd.openxmlformats-officedocument.presentationml.presentation,application/json,application/xml,.md,.markdown,.csv,.ts,.tsx,.js,.jsx,.mjs,.cjs,.py,.rs,.go,.java,.c,.cpp,.h,.hpp,.sh,.bash,.zsh,.fish,.yaml,.yml,.toml,.ini,.log" />
262
267
  </div>
268
+ <section id="followUpQueueOverlay" class="follow-up-queue-overlay" aria-label="Queued follow-ups" hidden>
269
+ <header class="follow-up-queue-overlay-header">
270
+ <div><strong>Queued follow-ups</strong><span id="followUpQueueOverlayCount" class="follow-up-queue-overlay-count">0</span></div>
271
+ <button id="followUpQueueCloseButton" class="follow-up-queue-close-button" type="button" aria-label="Close queued follow-ups">×</button>
272
+ </header>
273
+ <div id="followUpQueueRows" class="follow-up-queue-rows"></div>
274
+ <p id="followUpQueueStatus" class="follow-up-queue-status" role="status" aria-live="polite" aria-atomic="true"></p>
275
+ </section>
263
276
  <div id="attachmentTray" class="attachment-tray" aria-live="polite" hidden></div>
264
277
  <div class="composer-row">
265
278
  <button id="composerActionsButton" class="composer-actions-button" type="button" aria-controls="composerActionsPanel" aria-expanded="false" title="Open session, workflow, and follow-up actions">Actions</button>
@@ -476,6 +489,13 @@
476
489
  <input id="fileSelectionCommentInput" class="file-selection-comment" type="text" placeholder="Comment for Pi about this selection…" autocomplete="off" />
477
490
  <button id="fileSelectionSendButton" class="primary" type="button">Send</button>
478
491
  </div>
492
+ <div id="fileViewerSearchBar" class="file-viewer-search-bar" role="search" hidden>
493
+ <input id="fileViewerSearchInput" class="file-viewer-search-input" type="search" placeholder="Search this file…" autocomplete="off" spellcheck="false" aria-label="Search this file" aria-controls="fileViewerEditor" />
494
+ <span id="fileViewerSearchCount" class="file-viewer-search-count muted" aria-live="polite"></span>
495
+ <button id="fileViewerSearchPrevButton" class="file-viewer-search-button" type="button" aria-label="Previous match" title="Previous match (Shift+Enter)">↑</button>
496
+ <button id="fileViewerSearchNextButton" class="file-viewer-search-button" type="button" aria-label="Next match" title="Next match (Enter)">↓</button>
497
+ <button id="fileViewerSearchCloseButton" class="file-viewer-search-button" type="button" aria-label="Close file search" title="Close (Escape)">✕</button>
498
+ </div>
479
499
  <div class="file-viewer-mode-row">
480
500
  <div class="file-viewer-mode-toggle" role="group" aria-label="File view mode">
481
501
  <button id="fileViewerChangesModeButton" type="button" aria-pressed="false" hidden>Changes</button>
@@ -644,13 +664,13 @@
644
664
  </div>
645
665
  <div class="control-field">
646
666
  <div class="control-field-header">
647
- <label for="fastOutputModeSelect">Fast mode (Experimental)</label>
648
- <span class="control-field-context">Markdown final output; live thinking expanded; stored thinking grouped and collapsed</span>
667
+ <label for="fastOutputModeSelect">Compact mode (Experimental)</label>
668
+ <span class="control-field-context">Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed</span>
649
669
  </div>
650
670
  <div class="control-action-row">
651
671
  <select id="fastOutputModeSelect" title="Output processing mode" aria-describedby="fastOutputModeStatus">
652
672
  <option value="normal">Normal</option>
653
- <option value="compact-v1">Fast</option>
673
+ <option value="compact-v1">Compact</option>
654
674
  </select>
655
675
  <button id="setFastOutputModeButton" class="control-apply-button" type="button" aria-label="Apply selected output processing mode" disabled>Apply</button>
656
676
  </div>
@@ -775,6 +795,20 @@
775
795
  </button>
776
796
  </h2>
777
797
  <div id="sidePanelSectionCodexUsage" class="side-panel-section-content" hidden>
798
+ <div class="control-field codex-fast-mode-control" aria-labelledby="codexFastModeLabel">
799
+ <div class="control-field-header">
800
+ <label id="codexFastModeLabel" for="codexFastModeSelect">Fast mode</label>
801
+ <span class="control-field-context">Subscription-backed Codex requests · This tab</span>
802
+ </div>
803
+ <div class="control-action-row">
804
+ <select id="codexFastModeSelect" title="Codex subscription request tier" aria-describedby="codexFastModeStatus" disabled>
805
+ <option value="normal">Normal</option>
806
+ <option value="fast">Fast</option>
807
+ </select>
808
+ <button id="setCodexFastModeButton" class="control-apply-button" type="button" aria-label="Apply selected Codex Fast mode" disabled>Apply</button>
809
+ </div>
810
+ <div id="codexFastModeStatus" class="toggle-control-hint" role="status" aria-live="polite">Checking Codex Fast mode…</div>
811
+ </div>
778
812
  <div class="codex-usage-actions">
779
813
  <button id="refreshCodexUsageButton" type="button">Refresh usage</button>
780
814
  </div>
@@ -1009,6 +1043,46 @@
1009
1043
  </form>
1010
1044
  </dialog>
1011
1045
 
1046
+ <dialog id="workspaceLoadDialog" class="extension-dialog workspace-load-dialog" aria-labelledby="workspaceLoadDialogTitle" aria-describedby="workspaceLoadDialogDescription">
1047
+ <form method="dialog">
1048
+ <header class="workspace-load-dialog-header">
1049
+ <div>
1050
+ <span class="workspace-load-dialog-kicker">Saved workspaces</span>
1051
+ <h2 id="workspaceLoadDialogTitle">Load workspace</h2>
1052
+ </div>
1053
+ <button id="workspaceLoadDialogCloseButton" type="button" aria-label="Close saved workspace picker">Close</button>
1054
+ </header>
1055
+ <p id="workspaceLoadDialogDescription" class="muted">Choose a saved tab constellation to restore.</p>
1056
+ <p id="workspaceLoadDialogStatus" class="workspace-load-dialog-status muted" role="status" aria-live="polite"></p>
1057
+ <div id="workspaceLoadDialogList" class="workspace-load-dialog-list" aria-label="Saved workspaces"></div>
1058
+ </form>
1059
+ </dialog>
1060
+
1061
+ <dialog id="workspaceReplaceDialog" class="extension-dialog workspace-replace-dialog" aria-labelledby="workspaceReplaceDialogTitle" aria-describedby="workspaceReplaceDialogDescription">
1062
+ <form method="dialog">
1063
+ <span class="workspace-replace-dialog-kicker">Replace open tabs</span>
1064
+ <h2 id="workspaceReplaceDialogTitle">Load saved workspace</h2>
1065
+ <p id="workspaceReplaceDialogDescription">Loading <strong id="workspaceReplaceTargetName"></strong> will terminate the current Pi processes. Choose whether to save the open tabs first.</p>
1066
+ <section class="workspace-replace-current-tabs" aria-labelledby="workspaceReplaceCurrentTabsTitle">
1067
+ <div class="workspace-replace-current-tabs-heading">
1068
+ <strong id="workspaceReplaceCurrentTabsTitle">Current tabs</strong>
1069
+ <span id="workspaceReplaceCurrentTabsCount" class="muted"></span>
1070
+ </div>
1071
+ <ul id="workspaceReplaceCurrentTabsList" class="workspace-replace-current-tabs-list"></ul>
1072
+ </section>
1073
+ <label class="workspace-replace-save-name" for="workspaceReplaceSaveName">
1074
+ <span>Save current workspace as</span>
1075
+ <input id="workspaceReplaceSaveName" class="dialog-input" type="text" maxlength="160" autocomplete="off" />
1076
+ </label>
1077
+ <p id="workspaceReplaceDialogStatus" class="workspace-replace-dialog-status muted" role="status" aria-live="polite">Cancel leaves every current tab unchanged.</p>
1078
+ <menu>
1079
+ <button id="workspaceReplaceCancelButton" type="button">Cancel</button>
1080
+ <button id="workspaceReplaceDiscardButton" class="danger" type="button">Load without saving</button>
1081
+ <button id="workspaceReplaceSaveButton" class="primary" type="button">Save &amp; load</button>
1082
+ </menu>
1083
+ </form>
1084
+ </dialog>
1085
+
1012
1086
  <dialog id="gitWorktreeBaseDialog" class="extension-dialog git-worktree-base-dialog">
1013
1087
  <form method="dialog">
1014
1088
  <h2>Choose branch starting point</h2>
@@ -1282,7 +1356,34 @@
1282
1356
  </form>
1283
1357
  </dialog>
1284
1358
 
1285
- <script id="webuiBootLoader" data-app-src="/app.js?v=92">
1359
+ <dialog id="subagentCancelDialog" class="extension-dialog subagent-cancel-dialog" aria-labelledby="subagentCancelDialogTitle" aria-describedby="subagentCancelDialogSubtitle">
1360
+ <form method="dialog">
1361
+ <h2 id="subagentCancelDialogTitle">Cancel subagent</h2>
1362
+ <p id="subagentCancelDialogSubtitle" class="muted">Cancel this entire subagent run? Every agent in the run will be stopped and the parent agent will be notified.</p>
1363
+ <label class="subagent-cancel-field" for="subagentCancelReason">Reason <span class="muted">(optional)</span>
1364
+ <select id="subagentCancelReason">
1365
+ <option value="" selected>No reason</option>
1366
+ <option value="Wrong model/provider/thinking effort">Wrong model/provider/thinking effort</option>
1367
+ <option value="Wrong agent or task">Wrong agent or task</option>
1368
+ <option value="Taking too long">Taking too long</option>
1369
+ <option value="Wrong approach or direction">Wrong approach or direction</option>
1370
+ <option value="Output no longer needed">Output no longer needed</option>
1371
+ <option value="Started by mistake">Started by mistake</option>
1372
+ <option value="Other">Other</option>
1373
+ </select>
1374
+ </label>
1375
+ <label class="subagent-cancel-field" for="subagentCancelNote">Note <span class="muted">(optional)</span>
1376
+ <textarea id="subagentCancelNote" class="dialog-editor subagent-cancel-note" spellcheck="true" placeholder="Optional note for the parent agent"></textarea>
1377
+ </label>
1378
+ <p id="subagentCancelStatus" class="subagent-cancel-status muted" role="status" aria-live="polite" hidden></p>
1379
+ <menu>
1380
+ <button id="subagentCancelKeepRunningButton" type="button">Keep running</button>
1381
+ <button id="subagentCancelSubmitButton" class="danger" type="submit">Cancel subagent</button>
1382
+ </menu>
1383
+ </form>
1384
+ </dialog>
1385
+
1386
+ <script id="webuiBootLoader" data-app-src="/app.js?v=94">
1286
1387
  (() => {
1287
1388
  "use strict";
1288
1389
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v48";
1
+ const CACHE_NAME = "pi-webui-pwa-v50";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",