@firstpick/pi-package-webui 0.6.8 → 0.6.9

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.
@@ -22,10 +22,10 @@ function lanAddress() {
22
22
  return undefined;
23
23
  }
24
24
 
25
- async function request(host, pathname, { method = "GET", body, timeoutMs = 5_000 } = {}) {
25
+ async function request(host, pathname, { method = "GET", body, headers = {}, timeoutMs = 5_000 } = {}) {
26
26
  const response = await fetch(`http://${host}:${port}${pathname}`, {
27
27
  method,
28
- headers: body === undefined ? undefined : { "Content-Type": "application/json" },
28
+ headers: body === undefined ? headers : { "Content-Type": "application/json", ...headers },
29
29
  body: body === undefined ? undefined : JSON.stringify(body),
30
30
  signal: AbortSignal.timeout(timeoutMs),
31
31
  });
@@ -35,7 +35,7 @@ async function request(host, pathname, { method = "GET", body, timeoutMs = 5_000
35
35
  } catch {
36
36
  payload = undefined;
37
37
  }
38
- return { status: response.status, body: payload };
38
+ return { status: response.status, body: payload, headers: response.headers };
39
39
  }
40
40
 
41
41
  async function waitForSseEvent(tabId, predicate, trigger) {
@@ -114,6 +114,7 @@ const harnessSideEffectsRoot = await mkdtemp(path.join(tmpdir(), "pi-webui-http-
114
114
  const settingsFile = path.join(harnessSideEffectsRoot, "webui-settings.json");
115
115
  const openCommandLog = path.join(harnessSideEffectsRoot, "open-default.log");
116
116
  const fakePiCommandLog = path.join(harnessSideEffectsRoot, "fake-pi-commands.jsonl");
117
+ const recoveryEndpointToken = "test-recovery-token-6e1cc61d22d44c8dbf3c";
117
118
  const openCommandScript = path.join(harnessSideEffectsRoot, "fake-open-default.mjs");
118
119
  const fakeOpenBinDir = path.join(harnessSideEffectsRoot, "bin");
119
120
  const artifactRoot = path.join(harnessSideEffectsRoot, "artifacts"), artifactDir = path.join(artifactRoot, "fixture-document-artifact"), artifactManifest = path.join(artifactDir, "manifest.json"), artifactDownload = path.join(artifactDir, "document.docx"), artifactPage = path.join(artifactDir, "page-1.png"), artifactExpiresAt = new Date(Date.now() + 60 * 60 * 1000).toISOString();
@@ -146,6 +147,17 @@ const voiceProvider = createServer(async (req, res) => {
146
147
  res.end(Buffer.from("fake mp3 bytes"));
147
148
  return;
148
149
  }
150
+ if (req.url?.startsWith("/pi-releases/")) {
151
+ const tagName = decodeURIComponent(req.url.slice("/pi-releases/".length));
152
+ res.writeHead(200, { "content-type": "application/json" });
153
+ res.end(JSON.stringify({
154
+ tag_name: tagName,
155
+ name: `Pi ${tagName} test release`,
156
+ body: "## Highlights\n\n- Release notes from the test GitHub endpoint.",
157
+ published_at: "2026-07-16T12:00:00Z",
158
+ }));
159
+ return;
160
+ }
149
161
  res.writeHead(404, { "content-type": "application/json" });
150
162
  res.end(JSON.stringify({ error: "not found" }));
151
163
  });
@@ -170,8 +182,10 @@ const child = spawn(process.execPath, [serverScript, "--cwd", cwd, "--host", "0.
170
182
  FAKE_PI_ARTIFACT_DOWNLOAD: artifactDownload,
171
183
  FAKE_PI_LOG_FILE: fakePiCommandLog,
172
184
  FAKE_PI_VOICE_SCRIPTS: "1",
185
+ PI_WEBUI_RECOVERY_TOKEN: recoveryEndpointToken,
173
186
  PI_VOICE_STT_URL: `http://127.0.0.1:${voiceProviderPort}/stt`,
174
187
  PI_VOICE_TTS_URL: `http://127.0.0.1:${voiceProviderPort}/tts`,
188
+ PI_WEBUI_PI_RELEASES_API_BASE_URL: `http://127.0.0.1:${voiceProviderPort}/pi-releases`,
175
189
  },
176
190
  });
177
191
  let serverOutput = "";
@@ -198,6 +212,19 @@ try {
198
212
  assert.equal(health?.status, 200, `server should become healthy, output:\n${serverOutput}`);
199
213
  assert.equal(health.body.ok, true);
200
214
  assert.equal(health.body.piRunning, true, "fake pi RPC process should be attached and running");
215
+ assert.match(health.body.piVersion, /^\d+\.\d+\.\d+/, "health metadata should expose the installed Pi version");
216
+
217
+ const releaseNotes = await request("127.0.0.1", "/api/pi-release-notes");
218
+ assert.equal(releaseNotes.status, 200, `Pi release notes should load through the server: ${releaseNotes.body?.error || ""}`);
219
+ assert.equal(releaseNotes.body?.data?.version, health.body.piVersion);
220
+ assert.equal(releaseNotes.body?.data?.tagName, `v${health.body.piVersion}`);
221
+ assert.equal(releaseNotes.body?.data?.title, `Pi v${health.body.piVersion} test release`);
222
+ assert.match(releaseNotes.body?.data?.body || "", /Release notes from the test GitHub endpoint/);
223
+ assert.equal(releaseNotes.body?.data?.url, `https://github.com/earendil-works/pi/releases/tag/v${health.body.piVersion}`);
224
+ assert.equal(releaseNotes.headers.get("cache-control"), "private, no-store", "browser caches should not retain notes across Pi upgrades");
225
+ const cachedReleaseNotes = await request("127.0.0.1", "/api/pi-release-notes");
226
+ assert.equal(cachedReleaseNotes.body?.data?.tagName, `v${health.body.piVersion}`);
227
+ assert.equal(voiceProviderRequests.filter((item) => item.url === `/pi-releases/v${health.body.piVersion}`).length, 1, "the server should fetch each installed Pi release only once");
201
228
 
202
229
  // Static assets: brotli/gzip compression plus ETag revalidation (P0-2).
203
230
  const brotliResponse = await fetch(`http://127.0.0.1:${port}/app.js`, {
@@ -1695,6 +1722,68 @@ try {
1695
1722
  console.log("http-endpoints-harness: no LAN address detected; skipping remote-client checks");
1696
1723
  }
1697
1724
 
1725
+ const recoveryTabsBefore = await request("127.0.0.1", "/api/tabs");
1726
+ const sourceTabId = recoveryTabsBefore.body?.data?.tabs?.[0]?.id;
1727
+ assert.ok(sourceTabId, "recovery endpoint test needs an active source tab");
1728
+ const recoveryBody = {
1729
+ prompt: "Inspect the Anthropic compatibility patch and run status/plan only.",
1730
+ cwd,
1731
+ model: { provider: "fake", id: "fake-model" },
1732
+ mode: "plan-only",
1733
+ };
1734
+ const unauthenticatedRecovery = await request("127.0.0.1", "/api/recovery/plan", { method: "POST", body: recoveryBody });
1735
+ assert.equal(unauthenticatedRecovery.status, 401, "recovery endpoint must reject missing bearer credentials");
1736
+ const wrongCredentialRecovery = await request("127.0.0.1", "/api/recovery/plan", {
1737
+ method: "POST",
1738
+ headers: { authorization: "Bearer wrong-recovery-token" },
1739
+ body: recoveryBody,
1740
+ });
1741
+ assert.equal(wrongCredentialRecovery.status, 401, "recovery endpoint must reject an incorrect bearer credential");
1742
+ const invalidModeRecovery = await request("127.0.0.1", "/api/recovery/plan", {
1743
+ method: "POST",
1744
+ headers: { authorization: `Bearer ${recoveryEndpointToken}` },
1745
+ body: { ...recoveryBody, mode: "apply" },
1746
+ });
1747
+ assert.equal(invalidModeRecovery.status, 400, "recovery endpoint must accept plan-only mode exclusively");
1748
+ if (lan) {
1749
+ const remoteRecovery = await request(lan, "/api/recovery/plan", {
1750
+ method: "POST",
1751
+ headers: { authorization: `Bearer ${recoveryEndpointToken}` },
1752
+ body: recoveryBody,
1753
+ });
1754
+ assert.equal(remoteRecovery.status, 403, "even a credentialed LAN client must not open recovery plans");
1755
+ }
1756
+ const rejectedRecovery = await request("127.0.0.1", "/api/recovery/plan", {
1757
+ method: "POST",
1758
+ headers: { authorization: `Bearer ${recoveryEndpointToken}` },
1759
+ body: { ...recoveryBody, model: { provider: "fake", id: "missing-model" } },
1760
+ });
1761
+ assert.equal(rejectedRecovery.status, 409, "an unavailable recovery model should be rejected");
1762
+ const recoveryTabsAfterRejection = await request("127.0.0.1", "/api/tabs");
1763
+ assert.equal(recoveryTabsAfterRejection.body?.data?.tabs?.length, recoveryTabsBefore.body?.data?.tabs?.length, "failed recovery initialization must discard its temporary tab");
1764
+ const recoveryOpened = await waitForSseEvent(
1765
+ sourceTabId,
1766
+ (event) => event.type === "webui_recovery_opened",
1767
+ () => request("127.0.0.1", "/api/recovery/plan", {
1768
+ method: "POST",
1769
+ headers: { authorization: `Bearer ${recoveryEndpointToken}` },
1770
+ body: recoveryBody,
1771
+ }),
1772
+ );
1773
+ assert.equal(recoveryOpened.triggerResult.status, 201, `recovery endpoint should create a tab: ${recoveryOpened.triggerResult.body?.error || ""}`);
1774
+ assert.equal(recoveryOpened.triggerResult.body?.requestId, recoveryOpened.event.recoveryTabId);
1775
+ assert.equal(recoveryOpened.event.model?.provider, "fake");
1776
+ const recoveryTabs = await request("127.0.0.1", "/api/tabs");
1777
+ const recoveryTab = recoveryTabs.body?.data?.tabs?.find((tab) => tab.id === recoveryOpened.event.recoveryTabId);
1778
+ assert.equal(recoveryTab?.title, "Anthropic compatibility recovery");
1779
+ assert.equal(recoveryTab?.cwd, cwd);
1780
+ assert.equal(recoveryTab?.activity?.isWorking, true);
1781
+ const recoveryCommands = (await readFile(fakePiCommandLog, "utf8")).trim().split(/\r?\n/).filter(Boolean).map((line) => JSON.parse(line));
1782
+ assert.ok(recoveryCommands.some((entry) => entry.direction === "startup" && entry.recoveryUrl === `http://127.0.0.1:${port}/api/recovery/plan` && entry.recoveryTokenConfigured), "Pi RPC children should receive the internal recovery URL and a credential");
1783
+ const recoveryModelIndex = recoveryCommands.findIndex((entry) => entry.direction === "command" && entry.type === "set_model" && entry.provider === "fake" && entry.modelId === "fake-model");
1784
+ const recoveryPromptIndex = recoveryCommands.findIndex((entry) => entry.direction === "command" && entry.type === "prompt" && entry.message === recoveryBody.prompt);
1785
+ assert.ok(recoveryModelIndex >= 0 && recoveryPromptIndex > recoveryModelIndex, "recovery should select the requested model before sending the plan-only prompt");
1786
+
1698
1787
  const localClose = await request("127.0.0.1", "/api/network/close", { method: "POST" });
1699
1788
  assert.equal(localClose.status, 202, "network close from localhost should be accepted");
1700
1789
 
@@ -29,17 +29,17 @@ const codexAuth = await readFile(join(root, "lib", "codex-usage-auth.mjs"), "utf
29
29
  const nativeExportPayload = await readFile(join(root, "lib", "native-export-payload.mjs"), "utf8");
30
30
  const companionDependencies = {
31
31
  "@firstpick/pi-extension-bang-command-autocomplete": "^0.2.1",
32
- "@firstpick/pi-extension-btw": "^0.1.2",
32
+ "@firstpick/pi-extension-btw": "^0.1.3",
33
33
  "@firstpick/pi-extension-fish-user-bash": "^0.2.1",
34
- "@firstpick/pi-extension-git-footer-status": "^0.3.8",
34
+ "@firstpick/pi-extension-git-footer-status": "^0.4.0",
35
35
  "@firstpick/pi-extension-release-aur": "^0.1.7",
36
- "@firstpick/pi-extension-release-npm": "^0.4.0",
37
- "@firstpick/pi-extension-safety-guard": "^0.2.3",
36
+ "@firstpick/pi-extension-release-npm": "^0.4.1",
37
+ "@firstpick/pi-extension-safety-guard": "^0.2.5",
38
38
  "@firstpick/pi-extension-setup-skills": "^0.1.8",
39
39
  "@firstpick/pi-extension-stats": "^0.2.8",
40
- "@firstpick/pi-extension-todo-progress": "^0.2.7",
40
+ "@firstpick/pi-extension-todo-progress": "^0.2.8",
41
41
  "@firstpick/pi-extension-tools": "^0.1.6",
42
- "@firstpick/pi-extension-workflows": "^0.1.2",
42
+ "@firstpick/pi-extension-workflows": "^0.1.3",
43
43
  "@firstpick/pi-package-remote-webui": "^0.1.5",
44
44
  "@firstpick/pi-prompts-git-pr": "^0.1.3",
45
45
  "@firstpick/pi-themes-bundle": "^0.1.4",
@@ -59,9 +59,16 @@ assert.match(html, /id="newTabChooseDirectoryButton" class="terminal-new-tab-men
59
59
  assert.match(html, /id="newTabWorktreeButton" class="terminal-new-tab-menu-item composer-publish-menu-item"[\s\S]*<span>Branch Worktree…<\/span>/, "new-tab menu should offer branch worktree tabs");
60
60
  assert.match(html, /id="closeAllTabsButton"[\s\S]*?>Close all Tabs<\/button>/, "tab header should expose a top-right close-all tabs action");
61
61
  assert.match(html, /id="sidePanelBackdrop"/, "mobile side panel needs an overlay/backdrop close target");
62
- assert.match(html, /<strong class="side-panel-title">[\s\S]*Control Deck[\s\S]*id="webuiVersionBadge"[\s\S]*id="webuiDevBadge"/, "Control Deck title should expose Web UI version and dev badges");
62
+ assert.match(html, /<div class="side-panel-heading">[\s\S]*<strong class="side-panel-title">Control Deck<\/strong>[\s\S]*<div class="side-panel-version-row"[\s\S]*<button id="piVersionButton"[\s\S]*aria-controls="piReleaseNotesDialog"[\s\S]*<button id="webuiVersionButton"[\s\S]*aria-controls="confirmationDialog"[\s\S]*id="webuiDevBadge"/, "Control Deck header should keep its title separate from an aligned version and build row");
63
+ assert.match(html, /<dialog id="piReleaseNotesDialog"[\s\S]*id="piReleaseNotesTitle"[\s\S]*id="piReleaseNotesStatus"[\s\S]*id="piReleaseNotesBody"[\s\S]*id="piReleaseNotesGithubLink"/, "Pi release notes should use a dedicated accessible dialog");
64
+ assert.doesNotMatch(html, /Safer option|confirmationAlternative/, "shared confirmation dialogs should not render a safer-option row");
65
+ assert.doesNotMatch(app, /confirmationAlternative|\balternative:\s*options\.alternative/, "confirmation logic should not populate a removed safer-option row");
63
66
  assert.doesNotMatch(html, /id="sessionLine"/, "Control Deck title should not show verbose session status metadata");
64
67
  assert.match(html, /id="themeSelect"/, "side panel should expose a theme selector");
68
+ assert.match(html, /class="controls-intro"[\s\S]*aria-labelledby="sessionControlsTitle"[\s\S]*aria-labelledby="interfaceControlsTitle"[\s\S]*id="networkControlField"[\s\S]*aria-labelledby="serverControlsTitle"/, "Controls should explain scope and group session, interface, remote-access, and server settings in task order");
69
+ assert.match(html, /id="sessionControlsTitle">Active session<[\s\S]*class="control-scope-badge">This tab<[\s\S]*id="interfaceControlsTitle">Interface<[\s\S]*class="control-scope-badge">This browser</, "Controls groups should state whether settings affect the active tab or this browser");
70
+ assert.match(html, /class="control-action-row">[\s\S]*id="modelSelect"[\s\S]*id="setModelButton"[^>]*>Apply<\/button>[\s\S]*id="thinkingSelect"[\s\S]*id="setThinkingButton"[^>]*>Apply<\/button>/, "model and thinking controls should keep their apply actions beside the selection");
71
+ assert.match(css, /\.control-group-header[\s\S]*\.control-scope-badge[\s\S]*\.control-action-row/, "Controls should visually separate group headers, scope badges, and compact action rows");
65
72
  assert.match(html, /<label for="themeSelect"[^>]*id="themeControlLabel"[^>]*>Theme<\/label>/, "theme selector should be labeled in side-panel controls");
66
73
  assert.match(html, /id="themeSearchInput"[\s\S]*id="themeSelect"[\s\S]*id="themeSearchResults"/, "side-panel theme selector should expose searchable theme results");
67
74
  assert.match(html, /id="backgroundInput"[^>]*type="file"[^>]*accept="image\/png,image\/jpeg,image\/webp,image\/gif"/, "side panel should expose an image picker for custom backgrounds");
@@ -90,13 +97,13 @@ assert.match(html, /id="pathPickerCreateButton"[^>]*>Create directory<\/button>/
90
97
  assert.match(html, /id="pathPickerSearchInput"[^>]*type="search"[^>]*placeholder="Search current directory…"/, "cwd picker should expose a current-directory search box");
91
98
  assert.match(html, /id="pathPickerClearSearchButton"[^>]*hidden[^>]*>Clear<\/button>/, "cwd picker should expose a clear-search action");
92
99
  assert.match(app, /function fileTreeGitStatusForEntry\(entry = \{\}\) \{\s+return fileTreeState\.gitStatusByPath\.get\(normalizeFileTreePath\(entry\.path \|\| ""\)\) \|\| null;\s+\}/, "file tree rendering should use the refreshed Git-status snapshot instead of stale status embedded in cached entries");
93
- assert.match(app, /alternative: activeAgentTabs\.length[\s\S]*?count === 1[\s\S]*?"Cancel and keep this tab open\."[\s\S]*?confirmLabel: activeAgentTabs\.length \? "Close and stop work" : count === 1 \? "Close tab" : "Close tabs"/, "single-tab confirmation should use singular, non-contradictory close wording");
100
+ assert.match(app, /confirmLabel: activeAgentTabs\.length \? "Close and stop work" : count === 1 \? "Close tab" : "Close tabs"/, "single-tab confirmation should use singular close wording");
94
101
  assert.match(html, /id="optionalFeaturesBox"/, "side panel should expose optional feature status and controls");
95
102
  assert.match(html, /class="optional-features-description[\s\S]*href="https:\/\/github\.com\/Firstp1ck\/npm-packages\/issues\/new"[\s\S]*open a GitHub issue/, "optional features should link users to GitHub issues for additional feature requests");
96
103
  assert.doesNotMatch(html, /id="btwOverlayDialog"/, "/btw should not use a blocking modal overlay");
97
104
  assert.match(html, /id="codexUsageBox"/, "side panel should expose Codex subscription usage status");
98
105
  assert.match(html, /data-side-panel-section="codex-usage"/, "Codex usage should live in a collapsible side-panel section");
99
- assert.match(html, /data-side-panel-section="subagents"[\s\S]*class="side-panel-section-label">Subagents<\/span>[\s\S]*id="subagentCountBadge"[\s\S]*id="subagentsBox"/, "side panel should expose grouped running subagents with a live count");
106
+ assert.match(html, /data-side-panel-section="subagents"[\s\S]*class="side-panel-section-label">Subagents<\/span>[\s\S]*id="subagentCountBadge"[\s\S]*class="subagents-help"[\s\S]*<code>subagent<\/code>[\s\S]*foreground or async mode[\s\S]*id="subagentsBox"/, "side panel should explain how to launch tracked subagents and expose grouped running agents with a live count");
100
107
  assert.doesNotMatch(html, /id="subagentOverlayDialog"/, "subagent output should not use a blocking modal dialog");
101
108
  assert.match(html, /data-side-panel-section="session"[\s\S]*data-side-panel-section="subagents"[\s\S]*data-side-panel-section="queue"/, "Subagents should appear between Session and Queue in the side panel");
102
109
  assert.match(html, /data-side-panel-section="queue"[\s\S]*id="createPromptListButton"[\s\S]*>Create prompt list<\/button>/, "Queue section should expose prompt-list creation");
@@ -184,7 +191,10 @@ assert.ok(
184
191
  );
185
192
  assert.match(html, /id="optionsConversationModeButton"[^>]*data-command="\/talk"[^>]*hidden[\s\S]*?<span>Start Conversation<\/span>/, "Options menu should include the feature-gated Natural Conversation toggle");
186
193
  assert.match(html, /id="conversationModeChip" class="composer-conversation-mode-chip"[\s\S]*hidden>Voice: off<\/button>/, "composer should expose a hidden-until-active conversation status chip");
187
- assert.match(html, /id="workflowModeButton"[\s\S]*class="composer-workflow-mode-button"[\s\S]*aria-pressed="false"[\s\S]*hidden[\s\S]*<span>Workflow<\/span>/, "composer actions should expose a capability-gated Workflow Mode toggle");
194
+ const workflowModeButtonHtml = html.match(/<button\s+id="workflowModeButton"[\s\S]*?<\/button>/)?.[0] || "";
195
+ assert.match(workflowModeButtonHtml, /class="composer-workflow-mode-button"[\s\S]*aria-pressed="false"[\s\S]*hidden[\s\S]*<span>Workflow<\/span>/, "composer actions should expose a capability-gated Workflow Mode toggle");
196
+ assert.match(workflowModeButtonHtml, /data-tooltip="Workflow Mode:/, "Workflow Mode should retain its styled tooltip");
197
+ assert.doesNotMatch(workflowModeButtonHtml, /\stitle=/, "Workflow Mode should not also expose a browser-native tooltip");
188
198
  assert.match(html, /id="workflowModeChip" class="composer-workflow-mode-chip"[\s\S]*hidden>Workflow: on<\/button>/, "composer should expose a hidden-until-active Workflow Mode chip");
189
199
  assert.match(html, /id="conversationModeEndButton" class="composer-conversation-end-button"[\s\S]*hidden>End conversation<\/button>/, "composer should expose a persistent End conversation button while active");
190
200
  assert.match(html, /id="conversationVoiceMenu" class="composer-publish-menu composer-conversation-voice-menu" hidden>[\s\S]*id="conversationVoiceButton"[\s\S]*id="conversationVoiceMenuPanel" class="composer-publish-menu-panel[\s\S]*id="conversationModeEndButton"/, "composer should expose the conversation voice menu (publish-menu pattern) next to the End conversation button");
@@ -317,13 +327,18 @@ assert.match(css, /\.session-overview \{[\s\S]*?grid-template-columns:/, "sessio
317
327
  assert.match(css, /\.session-detail-value\.truncate[\s\S]*?text-overflow:\s*ellipsis/, "long session values should not overwhelm the side panel");
318
328
  assert.match(css, /\.server-restart-panel \{[\s\S]*?z-index:\s*62/, "server restart overlay should render above the offline shell");
319
329
  assert.match(css, /@keyframes server-restart-spin/, "server restart overlay should show a loading spinner");
320
- assert.match(css, /\.webui-version-badge,\n\.webui-dev-badge \{[\s\S]*?border-radius:\s*999px/, "Web UI version and dev indicators should render as compact title badges");
330
+ assert.match(css, /\.side-panel-version-row \{[\s\S]*?display:\s*flex[\s\S]*?align-items:\s*center[\s\S]*?flex-wrap:\s*wrap/, "Control Deck versions and build status should use a dedicated responsive row");
331
+ assert.match(css, /\.pi-version-button,\n\.webui-version-button,\n\.webui-dev-badge \{[\s\S]*?border-radius:\s*999px/, "Pi and Web UI version buttons plus the dev indicator should render as compact title controls");
332
+ assert.match(css, /\.webui-version-button:hover,[\s\S]*?\.webui-version-button:focus-visible/, "Web UI version button should expose visible hover and keyboard focus states");
333
+ assert.match(css, /\.pi-version-button:hover,[\s\S]*?\.pi-version-button:focus-visible/, "Pi version button should expose visible hover and keyboard focus states");
334
+ assert.match(css, /\.extension-dialog\.pi-release-notes-dialog \{[\s\S]*?\.pi-release-notes-body \{[\s\S]*?overflow:\s*auto/, "Pi release notes popup should keep long notes scrollable");
321
335
  assert.match(css, /\.webui-dev-badge \{[\s\S]*?color:\s*var\(--ctp-yellow\)/, "Web UI dev indicator should have distinct warning styling");
322
336
  assert.match(css, /\.side-panel-section\.collapsed \.side-panel-section-content,\n\.side-panel-section-content\[hidden\] \{\n\s+display:\s*none;/, "collapsed side panel section content should be hidden");
323
337
  assert.match(css, /\.side-panel-section:not\(\.collapsed\) \.side-panel-section-chevron/, "expanded side panel sections should rotate the chevron");
338
+ assert.match(css, /\.subagents-help \{[\s\S]*border-left:[\s\S]*font-size:\s*0\.7rem;[\s\S]*\.subagents-help code/, "subagent invocation guidance should render as a compact informational callout");
324
339
  assert.match(css, /\.subagents-box\.has-items[\s\S]*\.subagent-tab-group[\s\S]*\.subagent-agent-row/, "running subagents should render as grouped terminal/session cards");
325
340
  assert.match(css, /\.subagent-agent-row:hover,[\s\S]*\.subagent-agent-row:focus-visible/, "subagent rows should expose clickable hover and keyboard focus states");
326
- assert.match(css, /\.subagent-overlay-widget[\s\S]*\.subagent-overlay-terminal[\s\S]*\.subagent-overlay-close-action/, "subagent output should reuse the non-blocking App Runner widget visual language");
341
+ assert.match(css, /\.subagent-overlay-widget[\s\S]*\.subagent-overlay-transcript[\s\S]*\.subagent-overlay-message[\s\S]*\.subagent-overlay-close-action/, "subagent output should combine the non-blocking widget shell with the main transcript message styling");
327
342
  assert.match(css, /\.subagent-output-waiting-dot[\s\S]*@keyframes subagent-output-waiting-pulse/, "subagent output should animate one transient ellipsis while waiting");
328
343
  assert.doesNotMatch(css, /\.extension-dialog\.subagent-overlay-dialog/, "subagent output should not retain blocking dialog styles");
329
344
  assert.match(css, /@keyframes subagent-running-pulse/, "running subagents should expose a live activity indicator");
@@ -364,8 +379,10 @@ assert.match(css, /\.action-feedback-controls:hover,[\s\S]*?\.action-feedback-co
364
379
  assert.match(css, /\.action-feedback-controls:not\(:hover\):not\(:focus-within\) \.action-feedback-button/, "hidden action reactions should not expose button hit targets until the hover area is reached");
365
380
  assert.match(css, /\.action-feedback-button\.feedback-question\.active/, "question-mark reaction should have selected styling");
366
381
  assert.match(css, /\.composer-row button\[data-tooltip\]::after/, "composer button tooltips should be shared across Git, Steer, and Follow-up buttons");
382
+ assert.match(css, /\.composer-row \.composer-workflow-mode-button\[data-tooltip\]::after \{\n\s+max-width:\s*min\(18rem, calc\(100vw - 2rem\)\);/, "Workflow Mode tooltip should stay narrow enough to remain inside the outer chat frame");
367
383
  assert.match(css, /\.composer-row \.composer-git-button\[data-tooltip\]::after \{[\s\S]*?left:\s*0;[\s\S]*?right:\s*auto;/, "Git workflow tooltip should open rightward so it is not clipped off the left edge");
368
384
  assert.match(css, /\.composer-row button\[data-tooltip\]\.tooltip-open::after/, "composer button tooltips should be triggerable from JS for empty mobile taps");
385
+ assert.match(css, /\.composer-row button\[data-tooltip\]:hover,[\s\S]*?\.composer-input-row button\[data-tooltip\]\.tooltip-open \{\n\s+z-index:\s*40;/, "active composer tooltip triggers should stack above context tags and adjacent controls");
369
386
  assert.match(css, /\.footer-floating-tooltip \{[\s\S]*?position:\s*fixed;[\s\S]*?z-index:\s*1000/, "git footer extension boxes should use one viewport-positioned styled tooltip");
370
387
  assert.match(css, /\.footer-floating-tooltip \{[\s\S]*?overflow-wrap:\s*anywhere;[\s\S]*?white-space:\s*pre-wrap;/, "git footer tooltips should wrap long paths instead of clipping them");
371
388
  assert.doesNotMatch(css, /\.statusbar-git-footer \.footer-(?:metric|meta)\[data-tooltip\]::after/, "git footer chips should not also render a second pseudo-element tooltip");
@@ -385,10 +402,16 @@ assert.match(css, /body\.composer-actions-open \.composer-actions-panel \{ displ
385
402
  assert.match(css, /\.terminal-tabs-toggle-button \{ display: none; \}/, "terminal tab toggle should be hidden outside mobile CSS");
386
403
  assert.match(css, /@media \(max-width: 720px\) \{[\s\S]*?\.terminal-command-palette-button,\n\s+\.terminal-dashboard-button \{[\s\S]*?display:\s*inline-grid;/, "mobile header should keep the command palette button visible beside the dashboard button");
387
404
  assert.match(css, /\.command-palette-close-button \{[\s\S]*?min-width:\s*44px;[\s\S]*?min-height:\s*44px/, "command palette close button should meet touch-target sizing by default");
388
- assert.match(css, /@media \(max-width: 720px\) \{[\s\S]*?\.command-palette-dialog \{[\s\S]*?width:\s*min\(100vw - 0\.5rem, 42rem\)[\s\S]*?\.command-palette-list \{[\s\S]*?scrollbar-gutter:\s*auto;[\s\S]*?\.command-palette-item \{[\s\S]*?grid-template-columns:\s*minmax\(3\.4rem, 0\.26fr\) minmax\(0, 1fr\);[\s\S]*?min-height:\s*2\.72rem;/, "mobile command palette results should use compact two-column cards instead of tall one-column cards");
405
+ assert.match(css, /@media \(max-width: 720px\) \{[\s\S]*?\.command-palette-dialog \{[\s\S]*?width:\s*min\(100vw - 0\.5rem, 42rem\)[\s\S]*?\.command-palette-list \{[\s\S]*?align-content:\s*start;[\s\S]*?grid-auto-rows:\s*max-content;[\s\S]*?scrollbar-gutter:\s*auto;[\s\S]*?\.command-palette-item \{[\s\S]*?grid-template-columns:\s*minmax\(3\.4rem, 0\.26fr\) minmax\(0, 1fr\);[\s\S]*?min-height:\s*2\.72rem;/, "mobile command palette results should keep text-height rows and use compact two-column cards");
389
406
  assert.match(css, /@media \(max-width: 720px\) \{[\s\S]*?\.command-palette-item-kind \{[\s\S]*?font-size:\s*var\(--text-xs\);[\s\S]*?\.command-palette-item-label \{ font-size:\s*0\.82rem; \}[\s\S]*?\.command-palette-item-description \{ font-size:\s*var\(--text-xs\); \}/, "mobile command palette result text should respect the typography floor");
390
407
  assert.match(css, /body\.terminal-tabs-left \.chat-panel \{[\s\S]*?grid-template-columns:\s*clamp\(13rem, 18vw, 19rem\) minmax\(0, 1fr\)/, "terminal tabs left layout should split the chat panel into a sidebar and transcript area");
391
408
  assert.match(css, /body\.terminal-tabs-left \.terminal-tabs-shell \{[\s\S]*?grid-column:\s*1;[\s\S]*?grid-row:\s*1 \/ -1;[\s\S]*?flex-direction:\s*column/, "terminal tabs left layout should turn the top tab strip into a vertical sidebar");
409
+ assert.match(html, /class="terminal-sidebar-actions"[^>]*aria-label="Tab and workspace actions"[\s\S]*id="splitTabButton"[\s\S]*>Split<\/span>[\s\S]*id="commandPaletteButton"[\s\S]*>Commands<\/span>[\s\S]*id="workspaceDashboardToggleButton"[\s\S]*>Overview<\/span>/, "tab, command, and workspace actions should share one labeled sidebar toolbar");
410
+ assert.match(css, /body\.terminal-tabs-left \.terminal-sidebar-actions \{[\s\S]*?display:\s*grid;[\s\S]*?grid-template-columns:\s*repeat\(3, minmax\(0, 1fr\)\);[\s\S]*?body\.terminal-tabs-left \.terminal-sidebar-actions > button \{[\s\S]*?min-height:\s*3\.55rem;/, "left-sidebar actions should render as an equal-width three-button toolbar with readable touch targets");
411
+ assert.match(css, /@media \(min-width: 721px\) \{[\s\S]*?body\.terminal-tabs-left \.terminal-sidebar-actions \{[\s\S]*?z-index:\s*130;[\s\S]*?overflow:\s*visible;[\s\S]*?terminal-command-palette-button\[data-tooltip\]::after,[\s\S]*?terminal-dashboard-button\[data-tooltip\]::after \{[\s\S]*?bottom:\s*calc\(100% \+ 0\.62rem\);[\s\S]*?z-index:\s*220;[\s\S]*?width:\s*calc\(300% \+ 0\.84rem\);/, "left-sidebar command and overview tooltips should render above the full toolbar without clipping");
412
+ assert.match(css, /terminal-command-palette-button\[data-tooltip\]::after \{\s+left:\s*calc\(-100% - 0\.42rem\);[\s\S]*?terminal-dashboard-button\[data-tooltip\]::after \{\s+left:\s*calc\(-200% - 0\.84rem\);/, "left-sidebar tooltips should align to the toolbar edges from their individual buttons");
413
+ assert.match(css, /terminal-split-button\[aria-pressed="true"\] \.terminal-sidebar-action-label-split[\s\S]*?display:\s*none;[\s\S]*?terminal-split-button\[aria-pressed="true"\] \.terminal-sidebar-action-label-unsplit[\s\S]*?display:\s*block;/, "split toolbar label should change to Unsplit with the pressed state");
414
+ assert.match(css, /body\.terminal-tabs-left \.terminal-close-all-button \{[\s\S]*?margin-top:\s*0;[\s\S]*?justify-content:\s*center;[\s\S]*?text-align:\s*center;/, "left-sidebar close-all action should remain a separate centered destructive row");
392
415
  assert.match(css, /body\.terminal-tabs-left \.terminal-tabs \{[\s\S]*?flex-direction:\s*column/, "terminal tabs left layout should stack tabs vertically");
393
416
  assert.match(css, /body\.terminal-tabs-left \.terminal-tab-group-menu \{[\s\S]*?inset:\s*0 auto auto 100%;[\s\S]*?padding-left:\s*var\(--terminal-left-dropdown-bridge\)/, "left-sidebar grouped tab menus should include a hover bridge so they do not vanish between button and dropdown");
394
417
  assert.match(css, /body\.terminal-tabs-left \.terminal-new-tab-menu \.composer-publish-menu-panel \{[\s\S]*?inset:\s*0 auto auto 100%;[\s\S]*?padding-left:\s*var\(--terminal-left-dropdown-bridge\)/, "left-sidebar new-tab dropdown should include a hover bridge so it does not vanish between button and dropdown");
@@ -553,10 +576,16 @@ assert.match(server, /await saveRemoteAuthPreference\(false\)/, "disabling Remot
553
576
  assert.match(server, /function pinFromHash\(\)[\s\S]*new URLSearchParams\(String\(window\.location\.hash \|\| ""\)\.replace\(\/\^#\/, ""\)\)/, "remote auth page should read QR-provided PINs from the URL fragment");
554
577
  assert.match(server, /window\.history\.replaceState\(null, "", window\.location\.pathname \+ \(window\.location\.search \|\| ""\)\)/, "remote auth page should scrub fragment PINs from the address bar before authenticating");
555
578
  assert.match(app, /remoteWebuiCommand\(open \? "close" : "open"/, "network open\/close button should dispatch through the Remote WebUI package command");
556
- assert.match(app, /webuiVersionBadge: \$\("#webuiVersionBadge"\)/, "frontend should bind the Control Deck version badge");
579
+ assert.match(app, /piVersionButton: \$\("#piVersionButton"\)/, "frontend should bind the Control Deck Pi version button");
580
+ assert.match(app, /webuiVersionButton: \$\("#webuiVersionButton"\)/, "frontend should bind the Control Deck Web UI version button");
557
581
  assert.match(app, /webuiDevBadge: \$\("#webuiDevBadge"\)/, "frontend should bind the Control Deck dev badge");
558
- assert.match(app, /function refreshWebuiVersion\(\)[\s\S]*api\("\/api\/health", \{ scoped: false \}\)[\s\S]*setWebuiVersion\(health\.webuiVersion\)[\s\S]*setWebuiDevServer\(isWebuiDevMetadata\(health\)\)/, "frontend should load Web UI version and dev mode from health metadata");
559
- assert.match(app, /case "webui_connected":[\s\S]*setWebuiVersion\(event\.version\)[\s\S]*setWebuiDevServer\(isWebuiDevMetadata\(event\)\)/, "frontend should refresh Web UI version and dev mode from reconnect events");
582
+ assert.match(app, /function openPiReleaseNotes\(\)[\s\S]*api\("\/api\/pi-release-notes", \{ scoped: false \}\)[\s\S]*renderMarkdown\(elements\.piReleaseNotesBody/, "Pi version button should load and render release notes in the popup");
583
+ assert.match(app, /const PI_WEBUI_NPM_URL = "https:\/\/www\.npmjs\.com\/package\/@firstpick\/pi-package-webui"/, "Web UI version button should target the package's public npm page");
584
+ assert.match(app, /async function confirmOpenWebuiNpmPage\(\)[\s\S]*appConfirm\([\s\S]*confirmLabel: "Open npm"[\s\S]*openWebuiNpmPageInNewTab\(\)/, "Web UI version button should ask before opening npm in a new tab");
585
+ assert.match(app, /function refreshWebuiVersion\(\)[\s\S]*api\("\/api\/health", \{ scoped: false \}\)[\s\S]*setWebuiVersion\(health\.webuiVersion\)[\s\S]*setPiVersion\(health\.piVersion\)[\s\S]*setWebuiDevServer\(isWebuiDevMetadata\(health\)\)/, "frontend should load Pi version, Web UI version, and dev mode from health metadata");
586
+ assert.match(app, /case "webui_connected":[\s\S]*setWebuiVersion\(event\.version\)[\s\S]*setPiVersion\(event\.piVersion\)[\s\S]*setWebuiDevServer\(isWebuiDevMetadata\(event\)\)/, "frontend should refresh Pi version, Web UI version, and dev mode from reconnect events");
587
+ assert.match(server, /url\.pathname === "\/api\/pi-release-notes"[\s\S]*installedPiReleaseNotes\(\)/, "server should expose the installed Pi release notes endpoint");
588
+ assert.match(server, /PI_RELEASES_PAGE_BASE_URL = "https:\/\/github\.com\/earendil-works\/pi\/releases\/tag"/, "release-note links should target the official Pi GitHub release page");
560
589
  assert.match(server, /const webuiDevServer = isTruthyEnv\(process\.env\.PI_WEBUI_DEV\) \|\| isSourceCheckout\(packageRoot\)/, "server should derive dev mode from PI_WEBUI_DEV or a source checkout");
561
590
  assert.match(server, /webuiDev: webuiDevServer,[\s\S]*webuiMode: webuiDevServer \? "dev" : "production"/, "server status should expose Web UI dev mode");
562
591
  assert.match(server, /type: "webui_connected",[\s\S]*webuiDev: webuiDevServer,[\s\S]*webuiMode: webuiDevServer \? "dev" : "production"/, "SSE connect event should expose Web UI dev mode");
@@ -679,7 +708,9 @@ assert.match(app, /function renderWidgets\(\)[\s\S]*renderAppRunnerWidget\(\)[\s
679
708
  assert.doesNotMatch(app, /subagentOverlayDialog\.showModal|elements\.subagentOverlayDialog/, "subagent output should not open or depend on a modal dialog");
680
709
  assert.match(app, /api\(`\/api\/subagents\/output\?\$\{query\}`, \{ scoped: false \}\)/, "subagent overlay should fetch selected live output from the owning tab");
681
710
  assert.match(app, /SUBAGENT_OVERLAY_REFRESH_MS = 1000/, "subagent overlay should poll selected live output at a fast cadence");
682
- assert.match(app, /function appendSubagentOutputWaitingIndicator\(parent\)[\s\S]*subagent-output-waiting-dot[\s\S]*if \(running && agent\.currentTool\) appendSubagentOutputWaitingIndicator\(terminal\)/, "subagent widget should render one replaceable waiting animation instead of transcript spam");
711
+ assert.match(app, /function createMessageBubble\(message,[\s\S]*renderContent\(body, message\.content, \{ markdown: message\.role === "assistant" \}\)[\s\S]*function appendMessage\(message, options = \{\}\)[\s\S]*createMessageBubble\(message, options\)/, "main transcript output should use the reusable message bubble renderer");
712
+ assert.match(app, /function renderSubagentOverlayWidget\(\)[\s\S]*createMessageBubble\(\{[\s\S]*role: "assistant"[\s\S]*content: shownText[\s\S]*\}, \{ streaming: running, transient: true \}\)[\s\S]*subagent-overlay-message/, "subagent output should use the same assistant Markdown message renderer as the main transcript");
713
+ assert.match(app, /function appendSubagentOutputWaitingIndicator\(parent\)[\s\S]*message runIndicator run-indicator-message streaming subagent-output-waiting[\s\S]*subagent-output-waiting-dot[\s\S]*if \(running && agent\.currentTool\) appendSubagentOutputWaitingIndicator\(output\)/, "subagent widget should render one main-transcript-style waiting indicator instead of transcript spam");
683
714
  assert.match(app, /api\("\/api\/subagents", \{ scoped: false \}\)/, "frontend should refresh the cross-tab subagent overview");
684
715
  assert.match(app, /SUBAGENTS_ACTIVE_REFRESH_MS = 1500/, "running subagents should receive a fast live refresh cadence");
685
716
  assert.match(server, /url\.pathname === "\/api\/subagents" && req\.method === "GET"[\s\S]*webuiSubagentsData\(\)/, "server should expose a cross-tab running-subagent endpoint");
@@ -695,6 +726,9 @@ assert.match(app, /api\(`\/api\/codex-usage\$\{suffix\}`, \{ scoped: false \}\)/
695
726
  assert.match(app, /restoreSidePanelSectionState\(\);\nbindSidePanelSectionToggles\(\);/, "side panel section state should restore before toggles are bound");
696
727
  assert.match(app, /OPTIONAL_FEATURES_STORAGE_KEY/, "optional feature disable toggles should persist in browser storage");
697
728
  assert.match(app, /GIT_FOOTER_WEBUI_STATUS_KEY = "git-footer-webui"/, "git footer Web UI data should be received as an extension-owned status payload");
729
+ assert.match(html, /gitFooterVisibilityApplyButton[^>]*>Save globally</, "git footer visibility should state that applied choices persist globally");
730
+ assert.match(app, /Changes are saved globally and reused by every Pi session\./, "git footer visibility dialog should explain its global persistence scope");
731
+ assert.match(app, /Saved.*global WebUI footer visibility change/, "git footer visibility apply feedback should confirm global persistence");
698
732
  assert.match(app, /function parseGitFooterWebuiPayloadRaw\(raw\)[\s\S]*GIT_FOOTER_WEBUI_PAYLOAD_TYPE[\s\S]*GIT_FOOTER_WEBUI_PAYLOAD_VERSION/, "Web UI footer should parse the structured payload emitted by git-footer-status");
699
733
  assert.match(app, /function normalizeFooterPayloadChangedFile\(value\)[\s\S]*FOOTER_CHANGED_FILE_KINDS\.has\(value\.kind\)[\s\S]*oldPath/, "git footer payload parsing should preserve changed-file details for changes popovers");
700
734
  assert.match(app, /const files = value\.files\.map\(normalizeFooterPayloadChangedFile\)\.filter\(Boolean\)\.slice\(0, 80\);[\s\S]*chip\.files = files;/, "git footer payload chips should retain bounded changed-file lists");
@@ -864,6 +898,7 @@ assert.match(app, /OPTIONAL_COMMAND_FEATURES = new Map\(\[[\s\S]*\["bang-refresh
864
898
  assert.match(app, /function updateOptionalFeatureAvailability\(\)[\s\S]*hasAvailableCommand\("bang-status"\) \|\| hasAvailableCommand\("bang-refresh"\)[\s\S]*hasAvailableCommand\("user-bash-shell"\)[\s\S]*hasAvailableCommand\("git-staged-msg"\)[\s\S]*hasAvailableCommand\("release-npm"\)[\s\S]*hasAvailableCommand\("release-aur"\)[\s\S]*hasAvailableCommand\("safety-guard"\)[\s\S]*hasLoadedRpcCommand\("skills"\)[\s\S]*hasAvailableCommand\("todo-progress-status"\)[\s\S]*hasLoadedRpcCommand\("tools"\)[\s\S]*hasAvailableCommand\("remote"\)[\s\S]*NATURAL_CONVERSATION_COMMAND_NAMES\.some\(\(name\) => hasAvailableCommand\(name\)\)/, "optional feature detection should call RPC-visible commands directly and distinguish native resource selectors from TUI companions");
865
899
  assert.match(app, /hasRemoteWebuiCommand = isOptionalFeatureEnabled\("remoteWebui"\) && hasAvailableCommand\("remote"\)[\s\S]*optionsRemoteButton\.hidden = !hasRemoteWebuiCommand[\s\S]*syncRemoteWebuiControlVisibility\(hasRemoteWebuiCommand\)/, "Options menu should track /remote availability and delegate network card visibility");
866
900
  assert.match(app, /function syncRemoteWebuiControlVisibility[\s\S]*networkControlField\.hidden = !hasRemoteWebuiCommand/, "Remote WebUI network card should render whenever the optional feature and /remote command are enabled");
901
+ assert.match(app, /querySelector\("#remoteAccessControlsTitle"\)[\s\S]*heading\.textContent = payload\?\.title \|\| "Remote access"/, "Remote WebUI payload titles should update the group heading without replacing the nested PIN-auth label");
867
902
  assert.match(app, /if \(featureId === "remoteWebui"\) syncRemoteWebuiControlVisibility\(false\)/, "Disabling Remote WebUI should immediately hide browser network controls before broader rerendering");
868
903
  assert.match(app, /window\.addEventListener\("storage"[\s\S]*OPTIONAL_FEATURES_STORAGE_KEY[\s\S]*reconcileDisabledOptionalFeaturesFromStorage/, "Optional feature disables should live-sync across open Web UI pages");
869
904
  assert.match(app, /if \(key === "pi-remote-webui"\) return "remoteWebui"/, "optional feature handling should recognize Remote WebUI widget events without rendering them as overlays");
@@ -1299,6 +1334,7 @@ assert.match(app, /function syncActiveTabActivityFromState\(state = currentState
1299
1334
  assert.match(app, /event\.command === "get_state" && event\.tabId === activeTabId[\s\S]*?syncActiveTabActivityFromState\(currentState\)/, "get_state response events should update stale active-tab activity");
1300
1335
  assert.match(app, /function applyResponseTab\(response\)/, "frontend should merge tab metadata returned by prompt responses");
1301
1336
  assert.match(app, /case "webui_tab_renamed":/, "frontend should update tab labels from backend rename events");
1337
+ assert.match(app, /case "webui_recovery_opened":[\s\S]*?refreshTabs\(\)[\s\S]*?switchTab\(event\.recoveryTabId\)/, "recovery events should refresh tabs and activate the new recovery session");
1302
1338
  assert.match(app, /terminalTabsToggleButton\.addEventListener\("click"/, "terminal tabs trigger should be wired in JS");
1303
1339
  assert.match(app, /composerActionsButton\.addEventListener\("click"/, "composer actions trigger should be wired in JS");
1304
1340
  assert.match(app, /function setMobileFooterExpanded\(/, "mobile footer should preserve expansion state for compatibility");