@firstpick/pi-package-webui 0.9.1 → 0.9.3

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 (107) hide show
  1. package/README.md +31 -9
  2. package/bin/pi-webui-launcher.mjs +23 -12
  3. package/bin/pi-webui.mjs +729 -93
  4. package/index.ts +266 -1
  5. package/lib/agent-run-adapters.mjs +500 -0
  6. package/lib/agent-run-protocol.mjs +262 -0
  7. package/lib/agent-run-registry.mjs +339 -0
  8. package/lib/git-workflow-preferences.mjs +18 -28
  9. package/lib/intercom-conversations.mjs +491 -0
  10. package/lib/intercom-transcript-filter.mjs +99 -0
  11. package/lib/resource-selection.mjs +140 -0
  12. package/lib/trust-boundaries.mjs +2 -0
  13. package/lib/ui-layout-settings.mjs +172 -28
  14. package/lib/update/package-layout.mjs +50 -0
  15. package/lib/update/plan.mjs +11 -0
  16. package/package.json +2 -2
  17. package/public/app.js +2276 -419
  18. package/public/index.html +142 -72
  19. package/public/service-worker.js +2 -1
  20. package/public/stream-output-controller.mjs +15 -0
  21. package/public/styles.css +764 -92
  22. package/public/syntax-highlight.mjs +622 -0
  23. package/tests/agent-run-adapters.test.mjs +217 -0
  24. package/tests/agent-run-launcher.test.mjs +41 -0
  25. package/tests/agent-run-protocol.test.mjs +82 -0
  26. package/tests/agent-run-registry.test.mjs +102 -0
  27. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  28. package/tests/browser/control-deck-side-panels.spec.mjs +354 -0
  29. package/tests/browser/controls-layout.spec.mjs +122 -0
  30. package/tests/browser/file-tree-git-ignored.spec.mjs +113 -0
  31. package/tests/browser/interaction-continuity.spec.mjs +161 -0
  32. package/tests/browser/intercom-conversation-viewer.spec.mjs +355 -0
  33. package/tests/browser/mobile-foundation.spec.mjs +26 -0
  34. package/tests/browser/model-search-focus.spec.mjs +96 -0
  35. package/tests/browser/optimistic-prompt.spec.mjs +22 -0
  36. package/tests/browser/persistent-ui-layout.spec.mjs +285 -66
  37. package/tests/browser/resource-profiles.spec.mjs +200 -0
  38. package/tests/browser/subagent-observability.spec.mjs +116 -0
  39. package/tests/codex-fast-mode-static.test.mjs +7 -6
  40. package/tests/common-options-submenus-interaction-static.test.mjs +2 -0
  41. package/tests/common-options-submenus-markup-static.test.mjs +1 -0
  42. package/tests/component-update-api-static.test.mjs +2 -1
  43. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  44. package/tests/composer-skill-tag-layout.test.mjs +32 -2
  45. package/tests/control-deck-component-updates-static.test.mjs +6 -0
  46. package/tests/control-deck-side-panels-static.test.mjs +68 -0
  47. package/tests/controls-layout-static.test.mjs +22 -0
  48. package/tests/fast-mode-client-static.test.mjs +2 -2
  49. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  50. package/tests/feature-system-prompt-optional-feature-static.test.mjs +5 -5
  51. package/tests/file-tree-git-ignored-static.test.mjs +152 -0
  52. package/tests/file-tree-search-layout-static.test.mjs +2 -1
  53. package/tests/file-viewer-image-static.test.mjs +69 -0
  54. package/tests/fixtures/fake-pi.mjs +147 -12
  55. package/tests/foreground-transcript-catch-up-static.test.mjs +1 -1
  56. package/tests/git-panel-file-preview-static.test.mjs +5 -5
  57. package/tests/git-panel-live-updates-static.test.mjs +3 -3
  58. package/tests/git-workflow-preferences.test.mjs +55 -6
  59. package/tests/http-endpoints-harness.test.mjs +295 -14
  60. package/tests/intercom-conversation-viewer-static.test.mjs +105 -0
  61. package/tests/intercom-conversations-http.test.mjs +252 -0
  62. package/tests/intercom-conversations.test.mjs +374 -0
  63. package/tests/intercom-main-transcript-suppression-static.test.mjs +52 -0
  64. package/tests/intercom-tag-layout-static.test.mjs +46 -0
  65. package/tests/intercom-transcript-filter.test.mjs +98 -0
  66. package/tests/main-output-loading-static.test.mjs +59 -0
  67. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  68. package/tests/mobile-compact-layout.test.mjs +2 -3
  69. package/tests/mobile-continuity-tablet-static.test.mjs +6 -6
  70. package/tests/mobile-foundation-static.test.mjs +3 -3
  71. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  72. package/tests/mobile-static.test.mjs +76 -42
  73. package/tests/native-parity.test.mjs +8 -7
  74. package/tests/open-issue-wizard-static.test.mjs +2 -2
  75. package/tests/optional-feature-migration-frontend.test.mjs +5 -5
  76. package/tests/optional-feature-resource-setup-static.test.mjs +29 -0
  77. package/tests/persistent-ui-layout-static.test.mjs +13 -13
  78. package/tests/questionnaire-dialog.test.mjs +3 -3
  79. package/tests/remote-auth-settings-harness.test.mjs +1 -1
  80. package/tests/resource-defaults-helper.test.mjs +60 -6
  81. package/tests/resource-selection.test.mjs +114 -0
  82. package/tests/resource-tui-extension.test.mjs +23 -0
  83. package/tests/session-sampling-ui-static.test.mjs +3 -3
  84. package/tests/side-panel-context-menu-static.test.mjs +1 -1
  85. package/tests/side-panel-resize-static.test.mjs +26 -16
  86. package/tests/side-panel-section-height-removal-static.test.mjs +4 -4
  87. package/tests/side-panel-section-reorder-static.test.mjs +16 -70
  88. package/tests/stream-output-controller.test.mjs +8 -0
  89. package/tests/stream-output-isolation-static.test.mjs +2 -2
  90. package/tests/streaming-ui-coupling.test.mjs +5 -0
  91. package/tests/subagent-gate-visibility.test.mjs +2 -1
  92. package/tests/subagent-launch-slots.test.mjs +1 -1
  93. package/tests/subagent-observability-static.test.mjs +32 -0
  94. package/tests/subagent-reliability-integration.test.mjs +183 -0
  95. package/tests/subagent-workflow-section-static.test.mjs +67 -0
  96. package/tests/subagents-helper.test.mjs +548 -5
  97. package/tests/syntax-highlight.test.mjs +235 -0
  98. package/tests/syntax-highlighting-static.test.mjs +84 -0
  99. package/tests/terminal-tabs-resize-static.test.mjs +35 -0
  100. package/tests/theme-customizer-static.test.mjs +5 -5
  101. package/tests/thinking-format-parser.test.mjs +64 -0
  102. package/tests/ui-layout-settings.test.mjs +104 -32
  103. package/tests/update-api-harness.test.mjs +24 -10
  104. package/tests/update-package-layout.test.mjs +38 -0
  105. package/tests/update-plan.test.mjs +11 -1
  106. package/tests/webui-settings-locking.test.mjs +33 -3
  107. package/webui-rpc-helper.mjs +700 -89
package/public/index.html CHANGED
@@ -12,7 +12,7 @@
12
12
  <link rel="manifest" href="/manifest.webmanifest" />
13
13
  <link rel="icon" type="image/svg+xml" href="/favicon.svg" />
14
14
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" />
15
- <link rel="stylesheet" href="/styles.css?v=107" />
15
+ <link rel="stylesheet" href="/styles.css?v=123" />
16
16
  <script>
17
17
  // Public-only issue-bot runtime configuration. Keep disabled unless the gateway,
18
18
  // Turnstile site key, exact CORS origin, and private-report destination are approved.
@@ -82,7 +82,11 @@
82
82
  </div>
83
83
  </section>
84
84
 
85
- <button id="sidePanelExpandButton" class="side-panel-expand-button" type="button" aria-controls="sidePanel" aria-expanded="false" aria-label="Expand side panel" title="Expand side panel">
85
+ <button id="sidePanelLeftExpandButton" class="side-panel-expand-button side-panel-expand-button-left" type="button" aria-controls="sidePanelLeft" aria-expanded="false" aria-label="Expand left Control Deck" title="Expand left Control Deck">
86
+ <span class="side-panel-button-icon" aria-hidden="true"><span></span><span></span><span></span></span>
87
+ <span class="side-panel-button-chevron" aria-hidden="true">›</span>
88
+ </button>
89
+ <button id="sidePanelExpandButton" class="side-panel-expand-button side-panel-expand-button-right" type="button" aria-controls="sidePanel" aria-expanded="false" aria-label="Expand right Control Deck" title="Expand right Control Deck">
86
90
  <span class="side-panel-button-icon" aria-hidden="true">
87
91
  <span></span><span></span><span></span>
88
92
  </span>
@@ -106,8 +110,8 @@
106
110
  <section id="serverRestartPanel" class="server-restart-panel" aria-live="assertive" hidden>
107
111
  <div class="server-restart-card" role="status">
108
112
  <div class="server-restart-spinner" aria-hidden="true"></div>
109
- <span class="server-restart-kicker">Restarting</span>
110
- <h1>Restarting Pi Web UI server</h1>
113
+ <span id="serverRestartKicker" class="server-restart-kicker">Restarting</span>
114
+ <h1 id="serverRestartTitle">Restarting Pi Web UI server</h1>
111
115
  <p id="serverRestartMessage">Waiting for the server to come back…</p>
112
116
  </div>
113
117
  </section>
@@ -193,8 +197,19 @@
193
197
  </dialog>
194
198
 
195
199
  <main class="layout">
200
+ <aside id="sidePanelLeft" class="side-panel side-panel-left" aria-label="Left Control Deck" data-control-deck-shell="left" hidden>
201
+ <div id="sidePanelLeftResizeHandle" class="side-panel-resize-handle side-panel-resize-handle-left" role="separator" aria-orientation="vertical" aria-label="Resize left Control Deck width" tabindex="0" title="Drag to resize left Control Deck"></div>
202
+ <div class="side-panel-header">
203
+ <div class="side-panel-heading"><div class="side-panel-brand-row"><span class="side-panel-kicker">Pi Web UI</span></div><strong class="side-panel-title">Left Control Deck</strong><div data-control-deck-version-slot="left"></div></div>
204
+ <div class="side-panel-header-actions"><span data-control-deck-edit-slot="left"></span><button id="toggleSidePanelLeftButton" class="side-panel-toggle-button" type="button" aria-controls="sidePanelLeft" aria-expanded="true" aria-label="Collapse left Control Deck" title="Collapse left Control Deck"><span class="side-panel-button-icon" aria-hidden="true"><span></span><span></span><span></span></span><span class="side-panel-button-chevron" aria-hidden="true">‹</span></button></div>
205
+ </div>
206
+ <div id="sidePanelBodyLeft" class="side-panel-body" data-control-deck-body="left"><div class="side-panel-empty-drop-target" data-control-deck-drop-target="left">Drop sections here for the left Control Deck</div></div>
207
+ <div class="control-deck-shared-footer-slot" data-control-deck-footer-slot="left"></div>
208
+ </aside>
209
+ <div class="workspace-column">
196
210
  <section class="chat-panel">
197
211
  <header class="terminal-tabs-shell" aria-label="Terminal navigation">
212
+ <div id="terminalTabsResizeHandle" class="terminal-tabs-resize-handle" role="separator" aria-orientation="vertical" aria-label="Resize terminal sidebar width" tabindex="0" title="Drag to resize terminal sidebar" hidden></div>
198
213
  <button id="terminalTabsToggleButton" class="terminal-tabs-toggle-button" type="button" aria-controls="terminalTabsDrawerContent" aria-expanded="false">Tabs</button>
199
214
  <div id="terminalTabsDrawerContent" class="terminal-tabs-drawer-content" role="region" aria-label="Terminal navigation">
200
215
  <div id="tabBar" class="terminal-tabs" role="tablist" aria-label="Pi terminal tabs">
@@ -281,7 +296,11 @@
281
296
  <button id="chatSearchNextButton" class="chat-search-button" type="button" aria-label="Next match" title="Next match (Enter)">↓</button>
282
297
  <button id="chatSearchCloseButton" class="chat-search-button" type="button" aria-label="Close search" title="Close (Escape)">✕</button>
283
298
  </div>
284
- <div id="chat" class="chat" aria-live="polite">
299
+ <div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>
300
+ <span class="main-output-loading-spinner" aria-hidden="true"></span>
301
+ <span>Loading agent output…</span>
302
+ </div>
303
+ <div id="chat" class="chat" aria-live="polite" aria-busy="false">
285
304
  <button id="stickyUserPromptButton" class="sticky-user-prompt-button" type="button" aria-controls="chat" hidden></button>
286
305
  </div>
287
306
  <div id="runIndicatorHost" class="run-indicator-host"></div>
@@ -345,6 +364,7 @@
345
364
  aria-live="polite"
346
365
  >Follow-up</button>
347
366
  <div id="sessionSkillTags" class="composer-skill-tags" aria-live="polite" hidden></div>
367
+ <div id="intercomConversationTags" class="composer-intercom-tags" role="group" aria-label="Agent conversations" aria-live="polite" hidden></div>
348
368
  <button id="featureCategoryTag" class="composer-feature-category-tag" type="button" aria-haspopup="dialog" aria-controls="featureDecisionDialog" aria-live="polite" aria-atomic="true" disabled hidden></button>
349
369
  <button id="conversationModeChip" class="composer-conversation-mode-chip" type="button" aria-live="polite" hidden>Voice: off</button>
350
370
  <button id="workflowModeChip" class="composer-workflow-mode-chip" type="button" aria-live="polite" aria-pressed="true" hidden>Workflow: on</button>
@@ -657,7 +677,7 @@
657
677
  <button id="fileViewerCloseButton" type="button" aria-label="Close file viewer">Close</button>
658
678
  </div>
659
679
  </header>
660
- <p id="fileViewerHelp" class="file-viewer-help muted">Files opened from Git start in Changes mode. Markdown files can also be viewed as Preview or Source. Select text in Source or Preview, add a one-line comment, then Send to include the selection and surrounding context in this Pi session.</p>
680
+ <p id="fileViewerHelp" class="file-viewer-help muted">Files opened from Git start in Changes mode. Markdown files can also be viewed as Preview or Source, while supported images open as read-only previews. Select text in Source or Markdown Preview, add a one-line comment, then Send to include the selection and surrounding context in this Pi session.</p>
661
681
  <div id="fileSelectionBar" class="file-selection-bar" hidden>
662
682
  <span id="fileSelectionSummary" class="file-selection-summary">No selection</span>
663
683
  <input id="fileSelectionCommentInput" class="file-selection-comment" type="text" placeholder="Comment for Pi about this selection…" autocomplete="off" />
@@ -681,14 +701,19 @@
681
701
  <pre id="fileViewerSearchOverlay" class="file-viewer-search-overlay" aria-hidden="true" hidden></pre>
682
702
  <textarea id="fileViewerEditor" class="file-viewer-editor" wrap="soft" spellcheck="false" aria-label="File contents"></textarea>
683
703
  <div id="fileViewerPreview" class="file-viewer-preview markdown-body" tabindex="0" hidden></div>
704
+ <div id="fileViewerImage" class="file-viewer-image" tabindex="0" role="group" aria-label="Image preview" hidden>
705
+ <img id="fileViewerImageElement" alt="" />
706
+ </div>
684
707
  <div id="fileViewerChanges" class="file-viewer-changes" tabindex="0" aria-label="Git changes for this file" hidden></div>
685
708
  </div>
686
709
  <p id="fileViewerStatus" class="file-viewer-status muted" role="status" aria-live="polite"></p>
687
710
  </section>
688
711
 
712
+ </div>
689
713
  <button id="sidePanelBackdrop" class="side-panel-backdrop" type="button" aria-label="Close side panel" hidden></button>
690
- <aside id="sidePanel" class="side-panel" role="dialog" aria-label="Control Deck">
691
- <div id="sidePanelResizeHandle" class="side-panel-resize-handle" role="separator" aria-orientation="vertical" aria-label="Resize Control Deck width" tabindex="0" title="Drag to resize Control Deck"></div>
714
+ <div id="controlDeckMovementAnnouncer" class="sr-only" role="status" aria-live="polite" aria-atomic="true"></div>
715
+ <aside id="sidePanel" class="side-panel side-panel-right" aria-label="Right Control Deck" data-control-deck-shell="right">
716
+ <div id="sidePanelResizeHandle" class="side-panel-resize-handle side-panel-resize-handle-right" role="separator" aria-orientation="vertical" aria-label="Resize right Control Deck width" tabindex="0" title="Drag to resize right Control Deck"></div>
692
717
  <div class="side-panel-header">
693
718
  <div class="side-panel-heading">
694
719
  <div class="side-panel-brand-row">
@@ -716,7 +741,8 @@
716
741
  </button>
717
742
  </div>
718
743
  </div>
719
- <div class="side-panel-body">
744
+ <div id="sidePanelBodyRight" class="side-panel-body" data-control-deck-body="right">
745
+ <div class="side-panel-empty-drop-target" data-control-deck-drop-target="right">Drop sections here for the right Control Deck</div>
720
746
  <section class="side-panel-section collapsed" data-side-panel-section="controls">
721
747
  <h2>
722
748
  <button id="sidePanelSectionToggleControls" class="side-panel-section-toggle" type="button" aria-expanded="false" aria-controls="sidePanelSectionControls" aria-label="Expand Controls section" title="Expand Controls section" data-side-panel-section-toggle="controls">
@@ -726,35 +752,32 @@
726
752
  </h2>
727
753
  <div id="sidePanelSectionControls" class="side-panel-section-content" hidden>
728
754
  <div class="side-panel-controls">
729
- <p class="controls-intro">Settings apply to this tab, this browser, or the server.</p>
755
+ <p class="controls-intro">Settings apply to this tab, this browser, or the server. Point to or focus a setting name for help.</p>
730
756
 
731
757
  <section class="control-group" aria-labelledby="sessionControlsTitle">
732
758
  <div class="control-group-header">
733
759
  <div class="control-group-heading">
734
760
  <h3 id="sessionControlsTitle">Active session</h3>
735
- <p>Model, effort, and transcript.</p>
736
761
  </div>
737
762
  <span class="control-scope-badge">This tab</span>
738
763
  </div>
739
764
 
740
- <div class="control-field">
741
- <div class="control-field-header">
742
- <label id="modelControlLabel" for="modelSelect" title="Open or close model search" tabindex="0">Model</label>
743
- <span class="control-field-context">Provider and model</span>
744
- </div>
745
- <input id="modelSearchInput" class="model-search-input" type="search" placeholder="Search models…" autocomplete="off" spellcheck="false" hidden />
765
+ <div class="control-row">
766
+ <span class="control-row-label" data-tooltip="Which AI model this tab uses for new messages. Click Model to search every available model, pick one, then press Apply." aria-label="Model. Which AI model this tab uses for new messages. Click Model to search every available model, pick one, then press Apply." role="button" tabindex="0">
767
+ <label id="modelControlLabel" for="modelSelect">Model</label>
768
+ </span>
746
769
  <div class="control-action-row">
747
770
  <select id="modelSelect" title="Model"></select>
748
771
  <button id="setModelButton" class="control-apply-button" type="button" aria-label="Apply selected model">Apply</button>
749
772
  </div>
750
- <div id="modelSearchResults" class="model-search-results" role="listbox" aria-label="Model search results" hidden></div>
773
+ <input id="modelSearchInput" class="model-search-input control-row-full" type="search" placeholder="Search models…" autocomplete="off" spellcheck="false" hidden />
774
+ <div id="modelSearchResults" class="model-search-results control-row-full" role="listbox" aria-label="Model search results" hidden></div>
751
775
  </div>
752
776
 
753
- <div class="control-field">
754
- <div class="control-field-header">
777
+ <div class="control-row">
778
+ <span class="control-row-label" data-tooltip="How much hidden reasoning the model may use before answering. Higher levels help with hard problems but respond slower; off answers immediately. Press Apply to activate." aria-label="Thinking effort. How much hidden reasoning the model may use before answering. Higher levels help with hard problems but respond slower; off answers immediately. Press Apply to activate." role="button" tabindex="0">
755
779
  <label for="thinkingSelect">Thinking effort</label>
756
- <span class="control-field-context">Speed and depth</span>
757
- </div>
780
+ </span>
758
781
  <div class="control-action-row">
759
782
  <select id="thinkingSelect" title="Thinking effort">
760
783
  <option value="off">off</option>
@@ -769,12 +792,13 @@
769
792
  </div>
770
793
  </div>
771
794
 
772
- <div class="control-field thinking-visibility-control-field">
773
- <span class="control-label">Transcript</span>
795
+ <div class="control-row thinking-visibility-control-field">
796
+ <span class="control-row-label" data-tooltip="Show or hide the model’s reasoning in the transcript. Answers stay visible either way. Shortcut: Ctrl+T." aria-label="Thinking output. Show or hide the model’s reasoning in the transcript. Answers stay visible either way. Shortcut: Ctrl+T." role="button" tabindex="0">
797
+ <label for="thinkingVisibilityToggle">Thinking output</label>
798
+ </span>
774
799
  <label class="toggle-control" for="thinkingVisibilityToggle">
775
- <input id="thinkingVisibilityToggle" type="checkbox" checked />
800
+ <input id="thinkingVisibilityToggle" type="checkbox" checked aria-label="Show thinking output" />
776
801
  <span>
777
- <span class="toggle-control-label">Show thinking output</span>
778
802
  <span id="thinkingVisibilityStatus" class="toggle-control-hint">Visible</span>
779
803
  </span>
780
804
  </label>
@@ -785,52 +809,73 @@
785
809
  <div class="control-group-header">
786
810
  <div class="control-group-heading">
787
811
  <h3 id="interfaceControlsTitle">Interface</h3>
788
- <p>Layout, theme, and alerts.</p>
789
812
  </div>
790
813
  <span class="control-scope-badge">This browser</span>
791
814
  </div>
792
815
 
793
- <div class="control-field terminal-tabs-layout-control-field">
794
- <label for="terminalTabsLayoutSelect">Tab placement</label>
816
+ <div class="control-row terminal-tabs-layout-control-field">
817
+ <span class="control-row-label" data-tooltip="Where your open terminal tabs are listed: in a bar above the chat or in a Sidebar on the right." aria-label="Tab placement. Where your open terminal tabs are listed: in a bar above the chat or in a Sidebar on the right." role="button" tabindex="0">
818
+ <label for="terminalTabsLayoutSelect">Tab placement</label>
819
+ </span>
795
820
  <select id="terminalTabsLayoutSelect" title="Terminal tabs layout" aria-describedby="terminalTabsLayoutStatus">
796
821
  <option value="top">Top bar</option>
797
- <option value="left">Left sidebar</option>
822
+ <option value="left">Sidebar</option>
798
823
  </select>
799
- <div id="terminalTabsLayoutStatus" class="terminal-tabs-layout-status toggle-control-hint">Top bar · saved in this browser</div>
824
+ <div id="terminalTabsLayoutStatus" class="terminal-tabs-layout-status toggle-control-hint control-row-full">Top bar · saved in this browser</div>
800
825
  </div>
801
826
 
802
- <div class="control-field theme-control-field">
803
- <div class="control-field-header">
804
- <label for="themeSelect" id="themeControlLabel" title="Open or close theme search" tabindex="0">Theme</label>
805
- <span class="control-field-context">Colour scheme</span>
806
- </div>
827
+ <div class="control-row control-deck-placement-control-field">
828
+ <span class="control-row-label" data-tooltip="Choose which desktop side hosts the Control Deck. With Sidebar tabs, Right and Left swap the Control Deck and terminal/tabs rails." aria-label="Control Deck placement. Choose which desktop side hosts the Control Deck." role="button" tabindex="0">
829
+ <label for="controlDeckPlacementSelect">Control Deck placement</label>
830
+ </span>
831
+ <select id="controlDeckPlacementSelect" title="Control Deck placement" aria-describedby="controlDeckPlacementStatus">
832
+ <option value="right">Right</option>
833
+ <option value="left">Left</option>
834
+ <option value="both">Both</option>
835
+ </select>
836
+ <div id="controlDeckPlacementStatus" class="control-deck-placement-status toggle-control-hint control-row-full">Right · saved in WebUI layout</div>
837
+ </div>
838
+
839
+ <div class="control-row">
840
+ <span class="control-row-label" data-tooltip="Choose light or dark colours, or Auto to follow your system setting." aria-label="Theme mode. Choose light or dark colours, or Auto to follow your system setting." role="button" tabindex="0">Theme mode</span>
807
841
  <div id="themeSchemeToggle" class="theme-scheme-toggle" role="group" aria-label="Theme mode">
808
842
  <button type="button" data-scheme-mode="light" aria-pressed="false" title="Always use your light theme">Light</button>
809
843
  <button type="button" data-scheme-mode="dark" aria-pressed="false" title="Always use your dark theme">Dark</button>
810
844
  <button type="button" data-scheme-mode="auto" aria-pressed="false" title="Follow your system light/dark setting">Auto</button>
811
845
  </div>
812
- <input id="themeSearchInput" class="model-search-input theme-search-input" type="search" placeholder="Search themes…" autocomplete="off" spellcheck="false" hidden />
813
- <select id="themeSelect" title="Theme"></select>
814
- <button id="themeCustomizeButton" class="theme-customize-button" type="button" aria-haspopup="dialog" aria-controls="themeCustomizerDialog">Customize…</button>
815
- <div id="themeSearchResults" class="model-search-results theme-search-results" role="listbox" aria-label="Theme search results" hidden></div>
816
846
  </div>
817
847
 
818
- <div class="control-field background-control-field">
819
- <label for="backgroundInput">Custom background</label>
848
+ <div class="control-row theme-control-field">
849
+ <span class="control-row-label" data-tooltip="The colour theme for this browser. Click Theme to search installed themes; Customize… lets you adjust colours or create your own." aria-label="Theme. The colour theme for this browser. Click Theme to search installed themes; Customize lets you adjust colours or create your own." role="button" tabindex="0">
850
+ <label for="themeSelect" id="themeControlLabel">Theme</label>
851
+ </span>
852
+ <div class="control-action-row">
853
+ <select id="themeSelect" title="Theme"></select>
854
+ <button id="themeCustomizeButton" class="theme-customize-button" type="button" aria-haspopup="dialog" aria-controls="themeCustomizerDialog">Customize…</button>
855
+ </div>
856
+ <input id="themeSearchInput" class="model-search-input theme-search-input control-row-full" type="search" placeholder="Search themes…" autocomplete="off" spellcheck="false" hidden />
857
+ <div id="themeSearchResults" class="model-search-results theme-search-results control-row-full" role="listbox" aria-label="Theme search results" hidden></div>
858
+ </div>
859
+
860
+ <div class="control-row background-control-field">
861
+ <span class="control-row-label" data-tooltip="Show your own image behind the interface. PNG, JPEG, WebP, or GIF; press × to return to the theme default." aria-label="Background. Show your own image behind the interface. PNG, JPEG, WebP, or GIF; press remove to return to the theme default." role="button" tabindex="0">
862
+ <label for="backgroundInput">Background</label>
863
+ </span>
820
864
  <input id="backgroundInput" class="background-input" type="file" accept="image/png,image/jpeg,image/webp,image/gif" />
821
- <div class="background-control-row">
865
+ <div class="control-action-row background-control-row">
822
866
  <button id="backgroundChooseButton" type="button">Choose image</button>
823
867
  <button id="backgroundClearButton" class="background-clear-button" type="button" aria-label="Remove custom background" title="Remove custom background" hidden>×</button>
824
868
  </div>
825
- <div id="backgroundStatus" class="background-status muted">Theme default</div>
869
+ <div id="backgroundStatus" class="background-status muted control-row-full">Theme default</div>
826
870
  </div>
827
871
 
828
- <div class="control-field notification-control-field">
829
- <span class="control-label">Notifications</span>
872
+ <div class="control-row notification-control-field">
873
+ <span class="control-row-label" data-tooltip="Show a browser notification when the agent finishes while you are away from this tab. Your browser asks for permission first." aria-label="Notifications. Show a browser notification when the agent finishes while you are away from this tab. Your browser asks for permission first." role="button" tabindex="0">
874
+ <label for="agentDoneNotificationsToggle">Notifications</label>
875
+ </span>
830
876
  <label class="toggle-control" for="agentDoneNotificationsToggle">
831
- <input id="agentDoneNotificationsToggle" type="checkbox" />
877
+ <input id="agentDoneNotificationsToggle" type="checkbox" aria-label="Agent done notifications" />
832
878
  <span>
833
- <span class="toggle-control-label">Agent done notifications</span>
834
879
  <span id="agentDoneNotificationsStatus" class="toggle-control-hint">Off</span>
835
880
  </span>
836
881
  </label>
@@ -841,15 +886,13 @@
841
886
  <div class="control-group-header">
842
887
  <div class="control-group-heading">
843
888
  <h3 id="outputProcessingControlsTitle">Output processing</h3>
844
- <p>Default rendering for new Web UI connections.</p>
845
889
  </div>
846
890
  <span class="control-scope-badge">Server</span>
847
891
  </div>
848
- <div class="control-field">
849
- <div class="control-field-header">
892
+ <div class="control-row">
893
+ <span class="control-row-label" data-tooltip="Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed. Experimental and faster on slow devices." aria-label="Compact mode, experimental. Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed. Faster on slow devices." role="button" tabindex="0">
850
894
  <label for="fastOutputModeSelect">Compact mode (Experimental)</label>
851
- <span class="control-field-context">Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed</span>
852
- </div>
895
+ </span>
853
896
  <div class="control-action-row">
854
897
  <select id="fastOutputModeSelect" title="Output processing mode" aria-describedby="fastOutputModeStatus">
855
898
  <option value="normal">Normal</option>
@@ -857,7 +900,7 @@
857
900
  </select>
858
901
  <button id="setFastOutputModeButton" class="control-apply-button" type="button" aria-label="Apply selected output processing mode" disabled>Apply</button>
859
902
  </div>
860
- <div id="fastOutputModeStatus" class="toggle-control-hint" role="status" aria-live="polite">Loading server default…</div>
903
+ <div id="fastOutputModeStatus" class="toggle-control-hint control-row-full" role="status" aria-live="polite">Loading server default…</div>
861
904
  </div>
862
905
  </section>
863
906
 
@@ -865,21 +908,30 @@
865
908
  <div class="control-group-header">
866
909
  <div class="control-group-heading">
867
910
  <h3 id="remoteAccessControlsTitle">Remote access</h3>
868
- <p>LAN access and PIN protection.</p>
869
911
  </div>
870
912
  <span class="control-scope-badge warning">Network</span>
871
913
  </div>
872
- <div id="networkStatus" class="network-status closed">Local only</div>
873
- <label class="toggle-control remote-auth-toggle" for="remoteAuthToggle" hidden>
874
- <input id="remoteAuthToggle" type="checkbox" />
875
- <span>
876
- <span class="toggle-control-label">Remote PIN auth</span>
877
- <span id="remoteAuthStatus" class="toggle-control-hint">Off</span>
914
+ <div class="control-row network-status-control-row">
915
+ <span class="control-row-label" data-tooltip="Shows whether this Web UI is available only on this computer or also to trusted devices on your local network." aria-label="Connection. Shows whether this Web UI is available only on this computer or also to trusted devices on your local network." role="button" tabindex="0">Connection</span>
916
+ <div id="networkStatus" class="network-status closed">Local only</div>
917
+ </div>
918
+ <div class="control-row remote-auth-control-row" hidden>
919
+ <span class="control-row-label" data-tooltip="Require a PIN before another device can open this Web UI. Keep the PIN private and use remote access only on a trusted network." aria-label="PIN protection. Require a PIN before another device can open this Web UI. Keep the PIN private and use remote access only on a trusted network." role="button" tabindex="0">
920
+ <label for="remoteAuthToggle">PIN protection</label>
878
921
  </span>
879
- </label>
880
- <div class="network-action-row">
881
- <button id="openNetworkButton" type="button">Open for remote access</button>
882
- <button id="showRemoteQrButton" type="button" hidden>Open QR-Code</button>
922
+ <label class="toggle-control remote-auth-toggle" for="remoteAuthToggle">
923
+ <input id="remoteAuthToggle" type="checkbox" />
924
+ <span>
925
+ <span id="remoteAuthStatus" class="toggle-control-hint">Off</span>
926
+ </span>
927
+ </label>
928
+ </div>
929
+ <div class="control-row network-actions-control-row">
930
+ <span class="control-row-label" data-tooltip="Open or close access for trusted devices on your local network. When open, use the QR code to connect another device." aria-label="Network access. Open or close access for trusted devices on your local network. When open, use the QR code to connect another device." role="button" tabindex="0">Network access</span>
931
+ <div class="network-action-row">
932
+ <button id="openNetworkButton" type="button">Open for remote access</button>
933
+ <button id="showRemoteQrButton" type="button" hidden>Open QR-Code</button>
934
+ </div>
883
935
  </div>
884
936
  </section>
885
937
 
@@ -887,12 +939,13 @@
887
939
  <div class="control-group-header">
888
940
  <div class="control-group-heading">
889
941
  <h3 id="serverControlsTitle">Server</h3>
890
- <p>Maintenance actions affect every open tab.</p>
891
942
  </div>
892
943
  <span class="control-scope-badge danger">System</span>
893
944
  </div>
894
- <div class="control-field server-control-field">
895
- <label for="serverActionSelect">Choose an action</label>
945
+ <div class="control-row server-control-field">
946
+ <span class="control-row-label" data-tooltip="Pick a maintenance action and press Run: restart the server, apply staged updates, or stop it completely." aria-label="Server action. Pick a maintenance action and press Run: restart the server, apply staged updates, or stop it completely." role="button" tabindex="0">
947
+ <label for="serverActionSelect">Action</label>
948
+ </span>
896
949
  <div class="server-action-row">
897
950
  <select id="serverActionSelect" title="Server action" aria-label="Server action">
898
951
  <option value="" selected>Choose action…</option>
@@ -903,7 +956,7 @@
903
956
  </select>
904
957
  <button id="runServerActionButton" type="button" disabled>Run</button>
905
958
  </div>
906
- <div id="serverActionStatus" class="server-action-status muted" role="status" aria-live="polite"></div>
959
+ <div id="serverActionStatus" class="server-action-status muted control-row-full" role="status" aria-live="polite"></div>
907
960
  </div>
908
961
  </section>
909
962
  </div>
@@ -1053,7 +1106,7 @@
1053
1106
  </button>
1054
1107
  </h2>
1055
1108
  <div id="sidePanelSectionSubagents" class="side-panel-section-content" hidden>
1056
- <p class="subagents-help"><strong>How to use:</strong> Ask Pi to call <code>subagent</code> for ordinary delegation or <code>subagent_gate</code> when failed calls need bounded retries or a success quorum. Active children and retained gate attempts appear here.</p>
1109
+ <p class="subagents-help"><strong>How it works:</strong> Managed and registered Pi agent runs appear here. Runs linked to an open terminal stay with that terminal; other registered SDK, process, or attached sessions appear under <strong>External agents</strong>.</p>
1057
1110
  <details id="subagentLaunchSlots" class="subagent-launch-slots">
1058
1111
  <summary class="subagent-launch-slots-summary">
1059
1112
  <span class="subagent-launch-slots-summary-heading">
@@ -1152,7 +1205,7 @@
1152
1205
  </div>
1153
1206
  </section>
1154
1207
  </div>
1155
- <footer class="side-panel-footer">
1208
+ <footer class="side-panel-footer" data-control-deck-shared-footer>
1156
1209
  <button id="openIssueButton" class="open-issue-button" type="button" aria-haspopup="dialog" aria-controls="issueWizardDialog">Open Issue</button>
1157
1210
  </footer>
1158
1211
  </aside>
@@ -1444,6 +1497,23 @@
1444
1497
  </form>
1445
1498
  </dialog>
1446
1499
 
1500
+ <dialog id="intercomConversationDialog" class="extension-dialog intercom-conversation-dialog" aria-labelledby="intercomConversationTitle" aria-describedby="intercomConversationParticipants intercomConversationStatus">
1501
+ <form method="dialog">
1502
+ <header class="intercom-conversation-header">
1503
+ <div>
1504
+ <span class="intercom-conversation-kicker">Agent conversation · view only</span>
1505
+ <h2 id="intercomConversationTitle">Agent conversation</h2>
1506
+ <p id="intercomConversationParticipants" class="intercom-conversation-participants muted"></p>
1507
+ </div>
1508
+ </header>
1509
+ <p id="intercomConversationStatus" class="intercom-conversation-status muted" role="status" aria-live="polite" aria-atomic="true"></p>
1510
+ <div id="intercomConversationTranscript" class="intercom-conversation-transcript" role="log" aria-live="polite" aria-relevant="additions text"></div>
1511
+ <menu>
1512
+ <button id="intercomConversationCloseButton" type="submit" value="close">Close</button>
1513
+ </menu>
1514
+ </form>
1515
+ </dialog>
1516
+
1447
1517
  <dialog id="featureDecisionDialog" class="extension-dialog feature-decision-dialog" aria-labelledby="featureDecisionDialogTitle">
1448
1518
  <form method="dialog">
1449
1519
  <h2 id="featureDecisionDialogTitle">Classifier output</h2>
@@ -1749,7 +1819,7 @@
1749
1819
  </form>
1750
1820
  </dialog>
1751
1821
 
1752
- <script id="webuiBootLoader" data-app-src="/app.js?v=121">
1822
+ <script id="webuiBootLoader" data-app-src="/app.js?v=146">
1753
1823
  (() => {
1754
1824
  "use strict";
1755
1825
 
@@ -1,4 +1,4 @@
1
- const CACHE_NAME = "pi-webui-pwa-v84";
1
+ const CACHE_NAME = "pi-webui-pwa-v108";
2
2
  const APP_SHELL = [
3
3
  "/",
4
4
  "/index.html",
@@ -16,6 +16,7 @@ const APP_SHELL = [
16
16
  "/theme-contract.mjs",
17
17
  "/sampling-parameter-controls.mjs",
18
18
  "/transcript-renderer.mjs",
19
+ "/syntax-highlight.mjs",
19
20
  "/subagent-launch-slot-state.mjs",
20
21
  "/subagent-gate-visibility.mjs",
21
22
  "/workflow-status-stack.mjs",
@@ -18,6 +18,21 @@ export const DEFAULT_STREAM_PENDING_BYTE_LIMIT = 256 * 1024;
18
18
 
19
19
  export const TRANSCRIPT_STREAM_MESSAGE_UPDATE_TYPES = Object.freeze(Object.keys(MESSAGE_UPDATE_KINDS));
20
20
 
21
+ /**
22
+ * Keep the longer value when a final snapshot is only a prefix of the text
23
+ * already streamed. Divergent snapshots still win so provider corrections or
24
+ * redactions remain authoritative.
25
+ */
26
+ export function reconcileTranscriptThinkingSnapshot(accumulated, snapshot) {
27
+ const previous = typeof accumulated === "string" ? accumulated : "";
28
+ const next = typeof snapshot === "string" ? snapshot : "";
29
+ if (!previous) return next;
30
+ if (!next) return previous;
31
+ if (next.startsWith(previous)) return next;
32
+ if (previous.startsWith(next)) return previous;
33
+ return next;
34
+ }
35
+
21
36
  export function classifyTranscriptStreamEvent(event) {
22
37
  if (event?.type === "tool_execution_update") {
23
38
  return Object.freeze({ kind: "tool-execution", subtype: "tool_execution_update", recognized: true, barrier: false });