@firstpick/pi-package-webui 0.7.0 → 0.7.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.
- package/README.md +3 -0
- package/bin/pi-webui.mjs +243 -1
- package/index.ts +4 -0
- package/lib/subagent-gate.mjs +618 -0
- package/package.json +10 -9
- package/public/app.js +1250 -81
- package/public/index.html +72 -1
- package/public/styles.css +586 -18
- package/tests/fixtures/fake-pi.mjs +21 -4
- package/tests/git-panel-render-stability-static.test.mjs +43 -0
- package/tests/http-endpoints-harness.test.mjs +77 -1
- package/tests/mobile-static.test.mjs +119 -12
- package/tests/subagent-gate.test.mjs +300 -0
- package/tests/subagents-helper.test.mjs +34 -3
- package/webui-rpc-helper.mjs +165 -11
package/public/index.html
CHANGED
|
@@ -83,6 +83,26 @@
|
|
|
83
83
|
</header>
|
|
84
84
|
<section id="workspaceDashboard" class="workspace-dashboard" aria-label="Workspace dashboard"></section>
|
|
85
85
|
<div id="widgetArea" class="widget-area"></div>
|
|
86
|
+
<section id="subagentTerminalView" class="subagent-terminal-view" aria-labelledby="subagentTerminalTitle" hidden>
|
|
87
|
+
<header class="subagent-terminal-header">
|
|
88
|
+
<div class="subagent-terminal-heading">
|
|
89
|
+
<span class="subagent-terminal-kicker">Subagent · view only</span>
|
|
90
|
+
<strong id="subagentTerminalTitle">Subagent</strong>
|
|
91
|
+
<span id="subagentTerminalMeta" class="subagent-terminal-meta muted"></span>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="subagent-terminal-actions">
|
|
94
|
+
<button id="subagentTerminalCopyButton" type="button">Copy output</button>
|
|
95
|
+
<button id="subagentTerminalRefreshButton" type="button">Refresh</button>
|
|
96
|
+
</div>
|
|
97
|
+
</header>
|
|
98
|
+
<div id="subagentTerminalTranscript" class="subagent-terminal-transcript" role="log" aria-live="polite"></div>
|
|
99
|
+
<p id="subagentTerminalStatus" class="subagent-terminal-status muted" aria-live="off"></p>
|
|
100
|
+
<div class="subagent-terminal-composer" aria-label="Subagent input unavailable">
|
|
101
|
+
<textarea id="subagentTerminalInput" rows="1" placeholder="View only — send messages from the parent terminal" aria-describedby="subagentTerminalInputHint" disabled></textarea>
|
|
102
|
+
<button type="button" disabled>View only</button>
|
|
103
|
+
<small id="subagentTerminalInputHint">This tab mirrors the child session. Use its parent terminal to interact with the run.</small>
|
|
104
|
+
</div>
|
|
105
|
+
</section>
|
|
86
106
|
<div id="chatSearchBar" class="chat-search-bar" role="search" hidden>
|
|
87
107
|
<input id="chatSearchInput" class="chat-search-input" type="search" placeholder="Search transcript…" autocomplete="off" spellcheck="false" aria-label="Search transcript" />
|
|
88
108
|
<span id="chatSearchCount" class="chat-search-count muted" aria-live="polite"></span>
|
|
@@ -600,6 +620,26 @@
|
|
|
600
620
|
</div>
|
|
601
621
|
</div>
|
|
602
622
|
</section>
|
|
623
|
+
<section class="side-panel-section collapsed" data-side-panel-section="git">
|
|
624
|
+
<h2>
|
|
625
|
+
<button id="sidePanelSectionToggleGit" class="side-panel-section-toggle" type="button" aria-expanded="false" aria-controls="sidePanelSectionGit" aria-label="Expand Git section" title="Expand Git section" data-side-panel-section-toggle="git">
|
|
626
|
+
<span class="side-panel-section-label">Git</span>
|
|
627
|
+
<span class="side-panel-section-trailing">
|
|
628
|
+
<span id="gitPanelCountBadge" class="side-panel-section-badge" hidden>0</span>
|
|
629
|
+
<span class="side-panel-section-chevron" aria-hidden="true">›</span>
|
|
630
|
+
</span>
|
|
631
|
+
</button>
|
|
632
|
+
</h2>
|
|
633
|
+
<div id="sidePanelSectionGit" class="side-panel-section-content" hidden>
|
|
634
|
+
<div class="git-side-panel">
|
|
635
|
+
<div class="git-side-panel-intro">
|
|
636
|
+
<p>Expand a repository to view local changes and history. Right-click rows for actions.</p>
|
|
637
|
+
</div>
|
|
638
|
+
<p id="gitPanelStatus" class="git-side-panel-status muted" role="status" aria-live="polite"></p>
|
|
639
|
+
<div id="gitPanelGroups" class="git-side-panel-groups" aria-label="Git repositories"></div>
|
|
640
|
+
</div>
|
|
641
|
+
</div>
|
|
642
|
+
</section>
|
|
603
643
|
<section class="side-panel-section collapsed" data-side-panel-section="optional-features">
|
|
604
644
|
<h2>
|
|
605
645
|
<button id="sidePanelSectionToggleOptionalFeatures" class="side-panel-section-toggle" type="button" aria-expanded="false" aria-controls="sidePanelSectionOptionalFeatures" aria-label="Expand Optional features section" title="Expand Optional features section" data-side-panel-section-toggle="optional-features">
|
|
@@ -666,7 +706,15 @@
|
|
|
666
706
|
</button>
|
|
667
707
|
</h2>
|
|
668
708
|
<div id="sidePanelSectionSubagents" class="side-panel-section-content" hidden>
|
|
669
|
-
<p class="subagents-help"><strong>How to use:</strong> Ask Pi to call
|
|
709
|
+
<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>
|
|
710
|
+
<div class="subagent-open-mode-field">
|
|
711
|
+
<label for="subagentOpenModeSelect">Open subagents in</label>
|
|
712
|
+
<select id="subagentOpenModeSelect" aria-describedby="subagentOpenModeStatus">
|
|
713
|
+
<option value="overlay">Overlay</option>
|
|
714
|
+
<option value="tab">Tab / terminal</option>
|
|
715
|
+
</select>
|
|
716
|
+
<span id="subagentOpenModeStatus" class="muted">Overlay · saved in this browser</span>
|
|
717
|
+
</div>
|
|
670
718
|
<p id="subagentsStatus" class="subagents-status muted" role="status" aria-live="polite">Checking running subagents…</p>
|
|
671
719
|
<div id="subagentsBox" class="subagents-box muted">Checking running subagents…</div>
|
|
672
720
|
</div>
|
|
@@ -726,6 +774,7 @@
|
|
|
726
774
|
<button type="button" role="menuitem" data-file-menu-action="move">Move/Rename…</button>
|
|
727
775
|
<button type="button" role="menuitem" class="danger" data-file-menu-action="delete">Delete…</button>
|
|
728
776
|
</div>
|
|
777
|
+
<div id="gitPanelContextMenu" class="file-context-menu git-side-panel-context-menu" role="menu" aria-label="Git actions" hidden></div>
|
|
729
778
|
|
|
730
779
|
<aside id="undoToast" class="undo-toast" aria-live="polite" aria-atomic="true" hidden>
|
|
731
780
|
<span id="undoToastMessage" class="undo-toast-message"></span>
|
|
@@ -768,6 +817,28 @@
|
|
|
768
817
|
</form>
|
|
769
818
|
</dialog>
|
|
770
819
|
|
|
820
|
+
<dialog id="gitWorktreeBaseDialog" class="extension-dialog git-worktree-base-dialog">
|
|
821
|
+
<form method="dialog">
|
|
822
|
+
<h2>Choose branch starting point</h2>
|
|
823
|
+
<p>Create <code id="gitWorktreeBaseBranch"></code> from:</p>
|
|
824
|
+
<fieldset class="git-worktree-base-options">
|
|
825
|
+
<legend class="sr-only">Branch starting point</legend>
|
|
826
|
+
<label class="git-worktree-base-option" for="gitWorktreeBaseOriginMain">
|
|
827
|
+
<input id="gitWorktreeBaseOriginMain" type="radio" name="gitWorktreeBase" value="origin/main" checked />
|
|
828
|
+
<span><strong>origin/main</strong><small>Default. Start from the remote-tracking main branch.</small></span>
|
|
829
|
+
</label>
|
|
830
|
+
<label class="git-worktree-base-option" for="gitWorktreeBaseCurrentHead">
|
|
831
|
+
<input id="gitWorktreeBaseCurrentHead" type="radio" name="gitWorktreeBase" value="HEAD" />
|
|
832
|
+
<span><strong>Current workspace HEAD</strong><small>Start from the commit currently checked out in this Pi tab. Uncommitted files are not part of the branch base.</small></span>
|
|
833
|
+
</label>
|
|
834
|
+
</fieldset>
|
|
835
|
+
<menu>
|
|
836
|
+
<button id="gitWorktreeBaseCancelButton" type="button">Cancel</button>
|
|
837
|
+
<button id="gitWorktreeBaseCreateButton" class="primary" type="button">Create worktree</button>
|
|
838
|
+
</menu>
|
|
839
|
+
</form>
|
|
840
|
+
</dialog>
|
|
841
|
+
|
|
771
842
|
<dialog id="extensionDialog" class="extension-dialog">
|
|
772
843
|
<form id="dialogForm" method="dialog">
|
|
773
844
|
<h2 id="dialogTitle">Pi request</h2>
|