@firstpick/pi-package-webui 0.8.2 → 0.8.4
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 +76 -19
- package/bin/pi-webui.mjs +864 -140
- package/lib/WEBUI_TUI_NATIVE_PARITY.json +26 -0
- package/lib/git-workflow-preferences.mjs +246 -19
- package/lib/optional-feature-catalog.mjs +29 -0
- package/lib/optional-feature-migration.mjs +410 -0
- package/lib/session-summary-core.mjs +320 -0
- package/lib/session-summary-preferences.mjs +267 -0
- package/lib/thinking-stream-recovery.mjs +156 -0
- package/lib/ui-layout-settings.mjs +254 -0
- package/package.json +5 -40
- package/public/app.js +2898 -92
- package/public/index.html +77 -14
- package/public/service-worker.js +1 -1
- package/public/styles.css +669 -2
- package/session-summary.ts +403 -0
- package/tests/aur-review-widget-static.test.mjs +3 -2
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/composer-action-grid-reorder.spec.mjs +303 -0
- package/tests/browser/feature-decision-output-popup.spec.mjs +156 -0
- package/tests/browser/interaction-continuity.spec.mjs +29 -0
- package/tests/browser/persistent-ui-layout.spec.mjs +744 -0
- package/tests/browser/session-summary.spec.mjs +271 -0
- package/tests/codex-fast-mode-static.test.mjs +10 -9
- package/tests/composer-action-grid-reorder-static.test.mjs +63 -0
- package/tests/fast-mode-client-static.test.mjs +2 -2
- package/tests/feature-decision-output-popup-static.test.mjs +172 -0
- package/tests/fixtures/fake-pi.mjs +51 -1
- package/tests/git-workflow-preferences.test.mjs +4 -2
- package/tests/http-endpoints-harness.test.mjs +507 -4
- package/tests/interaction-state-stability-static.test.mjs +3 -0
- package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
- package/tests/mobile-foundation-static.test.mjs +3 -3
- package/tests/mobile-phone-experience-static.test.mjs +1 -1
- package/tests/mobile-static.test.mjs +118 -103
- package/tests/native-parity-harness.test.mjs +9 -1
- package/tests/native-parity.test.mjs +23 -1
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-migration-frontend.test.mjs +72 -0
- package/tests/optional-feature-migration.test.mjs +142 -0
- package/tests/persistent-ui-layout-static.test.mjs +267 -0
- package/tests/questionnaire-dialog.test.mjs +511 -0
- package/tests/queue-edit-reorder-static.test.mjs +1 -0
- package/tests/remote-auth-settings-harness.test.mjs +1 -1
- package/tests/session-summary-core.test.mjs +491 -0
- package/tests/session-summary-preferences.test.mjs +103 -0
- package/tests/side-panel-resize-static.test.mjs +1 -0
- package/tests/side-panel-section-reorder-static.test.mjs +3 -3
- package/tests/subagent-launch-slots.test.mjs +1 -1
- package/tests/thinking-stream-recovery.test.mjs +88 -0
- package/tests/ui-layout-settings.test.mjs +92 -0
- package/tests/webui-settings-locking.test.mjs +159 -0
|
@@ -24,13 +24,17 @@ const [pkgRaw, html, css, app, server, extension, readme, startScript, manifestR
|
|
|
24
24
|
]);
|
|
25
25
|
const pkg = JSON.parse(pkgRaw);
|
|
26
26
|
const manifest = JSON.parse(manifestRaw);
|
|
27
|
-
const lock = JSON.parse(await readFile(join(root, "package-lock.json"), "utf8"));
|
|
28
27
|
const helper = await readFile(join(root, "webui-rpc-helper.mjs"), "utf8");
|
|
29
28
|
const codexAuth = await readFile(join(root, "lib", "codex-usage-auth.mjs"), "utf8");
|
|
29
|
+
const optionalFeatureCatalog = await readFile(join(root, "lib", "optional-feature-catalog.mjs"), "utf8");
|
|
30
30
|
|
|
31
31
|
function appFunctionSource(name, nextName) {
|
|
32
32
|
const start = app.indexOf(`function ${name}(`);
|
|
33
|
-
const
|
|
33
|
+
const nextStarts = [
|
|
34
|
+
app.indexOf(`\nfunction ${nextName}(`, start),
|
|
35
|
+
app.indexOf(`\nasync function ${nextName}(`, start),
|
|
36
|
+
].filter((index) => index > start);
|
|
37
|
+
const end = nextStarts.length ? Math.min(...nextStarts) : -1;
|
|
34
38
|
assert.ok(start >= 0 && end > start, `${name} should remain a standalone frontend helper`);
|
|
35
39
|
return app.slice(start, end);
|
|
36
40
|
}
|
|
@@ -97,9 +101,22 @@ assert.match(html, /id="terminalTabsLayoutSelect"[\s\S]*<option value="left">Lef
|
|
|
97
101
|
assert.match(html, /id="terminalTabsLayoutStatus"/, "terminal-tabs layout selector should expose status text");
|
|
98
102
|
assert.match(html, /id="nativeCommandDialog"/, "native slash selector UI should have a dedicated dialog");
|
|
99
103
|
assert.match(html, /id="optionsWorkflowSetupButton"[^>]*data-command="\/workflow-setup"[^>]*hidden[\s\S]*Workflow Permission Setup/, "Common Pi options should expose catalog-gated Workflow Permission Setup");
|
|
104
|
+
assert.match(html, /id="optionsSummarySetupButton"[^>]*data-command="\/summary-setup"[^>]*hidden[\s\S]*Session Summary Setup/, "Common Pi options should expose catalog-gated Session Summary Setup");
|
|
105
|
+
assert.match(html, /id="summaryHeaderButton"[^>]*aria-label="Open session summary"[^>]*hidden[\s\S]*id="summaryActionButton"[^>]*data-composer-action-id="summary"[^>]*hidden/, "catalog-gated summary actions should exist in both the terminal header and mobile composer sheet");
|
|
106
|
+
assert.match(html, /id="sessionSummaryOverlay"[^>]*role="dialog"[^>]*aria-modal="false"[^>]*aria-labelledby="sessionSummaryOverlayTitle"[^>]*hidden[\s\S]*id="sessionSummaryOverlayBody"[\s\S]*id="sessionSummaryOverlayCopyButton"[\s\S]*id="sessionSummaryOverlayRefreshButton"/, "session summary should use a labelled non-modal Markdown overlay with copy and refresh actions");
|
|
107
|
+
assert.doesNotMatch(html, /<dialog[^>]*id="sessionSummaryOverlay"/, "session summary overlay must remain non-blocking rather than modal");
|
|
100
108
|
assert.match(html, /id="optionsSafetyGuardSetupButton"[\s\S]*data-command="\/safety-guard-setup"[\s\S]*Safety Guard Setup/, "Common Pi options should expose native Safety Guard Setup");
|
|
101
109
|
assert.match(html, /id="optionsGitWorkflowSetupButton"[\s\S]*data-command="\/git-workflow-setup"[\s\S]*Guided Git Setup/, "Common Pi options should expose native Guided Git Setup");
|
|
102
|
-
assert.match(app, /const NATIVE_SELECTOR_COMMANDS = new Set\(\[[^\]]*"workflow-setup"[^\]]*\]\)/, "exact /workflow-setup should be
|
|
110
|
+
assert.match(app, /const NATIVE_SELECTOR_COMMANDS = new Set\(\[[^\]]*"summary"[^\]]*"summary-setup"[^\]]*"workflow-setup"[^\]]*\]\)/, "exact /summary, /summary-setup, and /workflow-setup should be browser-native selector commands");
|
|
111
|
+
assert.match(app, /function renderSessionSummaryControls\(\)[\s\S]*hasAvailableCommand\("summary", \{ tabId: activeTabId \}\)[\s\S]*hasAvailableCommand\("summary-setup", \{ tabId: activeTabId \}\)[\s\S]*button\.hidden = !available/, "summary controls should be active-tab command-catalog gated");
|
|
112
|
+
assert.match(app, /function normalizeSessionSummaryClientState\(value, previous = null, \{ resetProjection = false \} = \{\}\)[\s\S]*sessionChanged[\s\S]*resetProjection \|\| sessionChanged \? null : previous[\s\S]*inherited\?\.summaryMarkdown/, "frontend should preserve failure Markdown but clear it for session changes and explicit branch-state projections");
|
|
113
|
+
assert.match(app, /function handleSessionSummaryEvent\(event\)[\s\S]*resetProjection: event\?\.kind === "state"/, "active-branch state events should reset the cached overlay projection");
|
|
114
|
+
assert.match(app, /function renderSessionSummaryOverlay\(\)[\s\S]*renderMarkdown\(elements\.sessionSummaryOverlayBody, state\.summaryMarkdown\)/, "summary overlay should use the sanitized Markdown renderer");
|
|
115
|
+
assert.match(app, /previous successful summary is preserved/, "summary overlay should explain failure preservation");
|
|
116
|
+
assert.match(app, /async function openNativeSessionSummarySetupDialog[\s\S]*Inject latest summary into main-agent context[\s\S]*nativeSettingsNote\("Privacy scope"[\s\S]*nativeSettingsNote\("Cost and provider behavior"/, "browser-native summary setup should expose the approved context, privacy, and cost controls");
|
|
117
|
+
assert.match(app, /addNativeCommandAction\("Save and generate"[\s\S]*confirmed: true[\s\S]*requestSessionSummaryGeneration/, "browser-native summary setup should confirm, persist, and immediately request the first generation");
|
|
118
|
+
assert.match(app, /sessionSummaryOverlayCopyButton[\s\S]*copyText\(state\.summaryMarkdown\)/, "summary copy should use the raw validated Markdown source");
|
|
119
|
+
assert.match(css, /\.session-summary-overlay \{[\s\S]*position: fixed[\s\S]*\.session-summary-overlay\[hidden\][\s\S]*@media \(max-width: 720px\)[\s\S]*\.session-summary-overlay/, "summary overlay should be visibly non-modal and responsive on mobile");
|
|
103
120
|
assert.match(app, /function normalizedWorkflowPolicyList\(value\)[\s\S]*new Set[\s\S]*\.filter\(Boolean\)\)\]\.sort\(\)/, "workflow policy list fields should trim, deduplicate, and sort for the canonical preview");
|
|
104
121
|
assert.match(app, /function parseWorkflowPolicyVerificationCommands\(value\)[\s\S]*JSON\.parse\(line\)[\s\S]*non-empty JSON string argv array[\s\S]*commands\.push\(command\)/, "workflow verification should accept one ordered JSON argv array per nonblank line");
|
|
105
122
|
assert.match(app, /async function openNativeWorkflowSetupDialog\(\)[\s\S]*api\("\/api\/workflow-policy", \{ scoped: false \}\)[\s\S]*nativeSettingToggle\("Allow write"[\s\S]*nativeSettingToggle\("Allow shell"[\s\S]*nativeSettingToggle\("Allow network"[\s\S]*Exact normalized JSON preview/, "workflow setup should load the localhost policy API and render accessible permission controls plus an exact normalized preview");
|
|
@@ -107,7 +124,7 @@ assert.match(app, /Authorization ceiling[\s\S]*not blanket authority[\s\S]*Shell
|
|
|
107
124
|
assert.match(app, /nativeSettingsDirty = workflowPolicyDraftSignature\(controls\) !== initialDraftSignature/, "workflow setup edits should participate in native dialog discard protection");
|
|
108
125
|
assert.match(app, /addNativeCommandAction\("Reset to all deny"[\s\S]*applyDeniedWorkflowPolicyControls\(controls\)[\s\S]*controls\.write\.input\.focus\(\)/, "workflow setup should expose an explicit reset-to-all-deny action");
|
|
109
126
|
assert.match(app, /title: "Save reviewed workflow permission ceiling\?"[\s\S]*Exact normalized JSON:[\s\S]*if \(!reviewed\) return;[\s\S]*api\("\/api\/workflow-policy", \{[\s\S]*body: \{ policy: policyToSave, expectedRevision: data\.revision \?\? null \}[\s\S]*No agent turn was started/, "workflow setup should require explicit normalized review before revision-protected save and report transient no-turn success");
|
|
110
|
-
assert.match(app,
|
|
127
|
+
assert.match(app, /\(name === "workflow-setup" \|\| name === "summary" \|\| name === "summary-setup"\) && !hasLoadedRpcCommand\(name\)[\s\S]*case "summary":[\s\S]*await openSessionSummaryForTab[\s\S]*case "workflow-setup":[\s\S]*await openNativeWorkflowSetupDialog\(\)/, "native summary and setup routing should require the active Pi tab's loaded extension command catalog");
|
|
111
128
|
assert.match(app, /function normalizeWorkflowPolicySuggestions\(value\)[\s\S]*if \(!value \|\| typeof value !== "object" \|\| Array\.isArray\(value\)\) return empty;[\s\S]*if \(!Array\.isArray\(group\) \|\| group\.some[\s\S]*return \[\];[\s\S]*shellAllowlist: normalizeStringGroup\(value\.shellAllowlist\)[\s\S]*networkAllowlist: normalizeStringGroup\(value\.networkAllowlist\)[\s\S]*verificationCommands: normalizeVerificationGroup\(value\.verificationCommands\)/, "workflow suggestions should defensively normalize each server-provided catalog group and render no fallback for malformed groups");
|
|
112
129
|
assert.match(app, /const suggestions = normalizeWorkflowPolicySuggestions\(data\.suggestions\)[\s\S]*suggestionLabel: "Shell executable suggestions"[\s\S]*suggestionLabel: "Network host suggestions"[\s\S]*suggestionLabel: "Verification command suggestions"/, "all three workflow policy textareas should consume only GET-provided suggestions in labelled groups");
|
|
113
130
|
const appendWorkflowPolicySuggestionSource = appFunctionSource("appendWorkflowPolicySuggestion", "workflowPolicySuggestionGroup");
|
|
@@ -175,7 +192,7 @@ assert.match(html, /id="codexUsageBox"/, "side panel should expose Codex subscri
|
|
|
175
192
|
assert.match(html, /data-side-panel-section="codex-usage"/, "Codex usage should live in a collapsible side-panel section");
|
|
176
193
|
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]*<code>subagent_gate<\/code>[\s\S]*bounded retries or a success quorum[\s\S]*id="subagentsBox"/, "side panel should explain ordinary delegation and retry-gate workflows with a live count");
|
|
177
194
|
assert.match(html, /id="subagentOpenModeSelect"[\s\S]*<option value="overlay">Overlay<\/option>[\s\S]*<option value="tab">Tab \/ terminal<\/option>[\s\S]*id="subagentOpenModeStatus"/, "Subagents should offer a browser-persisted overlay or terminal-tab opening choice");
|
|
178
|
-
assert.match(html, /class="subagents-status-row"[\s\S]*id="subagentsStatus"[\s\S]*id="subagentsClearFinishedButton"[^>]*disabled[^>]*>Clear finished<\/button>/, "Subagents should expose
|
|
195
|
+
assert.match(html, /class="subagents-status-row"[\s\S]*id="subagentsAutoClearButton"[^>]*aria-pressed="false"[^>]*>Auto-Clear<\/button>[\s\S]*id="subagentsStatus"[\s\S]*id="subagentsClearFinishedButton"[^>]*disabled[^>]*>Clear finished<\/button>/, "Subagents should expose selectable auto-clear and manual clear controls beside its live status");
|
|
179
196
|
const subagentCancelDialogHtml = html.match(/<dialog id="subagentCancelDialog"[\s\S]*?<\/dialog>/)?.[0] || "";
|
|
180
197
|
assert.match(subagentCancelDialogHtml, /id="subagentCancelDialogTitle">Cancel subagent<[\s\S]*id="subagentCancelDialogSubtitle"/, "subagent cancellation should use a titled dialog with dynamic target context");
|
|
181
198
|
assert.match(subagentCancelDialogHtml, /<select id="subagentCancelReason">[\s\S]*<option value="" selected>No reason<\/option>[\s\S]*Wrong model\/provider\/thinking effort[\s\S]*Wrong agent or task[\s\S]*Taking too long[\s\S]*Wrong approach or direction[\s\S]*Output no longer needed[\s\S]*Started by mistake[\s\S]*<option value="Other">Other<\/option>/, "subagent cancellation should offer every approved optional reason");
|
|
@@ -285,7 +302,7 @@ assert.ok(html.includes('id="commandSuggest"') && html.indexOf('id="commandSugge
|
|
|
285
302
|
assert.match(html, /id="busyPromptBehaviorTag"[\s\S]*class="composer-busy-mode-tag"[\s\S]*aria-controls="busyPromptBehaviorMenu"/, "composer should expose a clickable busy prompt behavior tag on the input frame");
|
|
286
303
|
assert.doesNotMatch(html, /Busy send:/i, "busy prompt behavior tag should show only the current mode label");
|
|
287
304
|
assert.match(html, /id="sessionSkillTags" class="composer-skill-tags"[\s\S]*hidden/, "composer should expose a hidden-until-used skill tag strip beside the busy mode tag");
|
|
288
|
-
assert.match(html,
|
|
305
|
+
assert.match(html, /<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>/, "composer should expose a hidden-until-used accessible feature category button");
|
|
289
306
|
assert.match(html, /id="skillEditorDialog"[\s\S]*id="skillEditorText"[\s\S]*id="skillEditorSaveButton"/, "skill tags should have an in-Web UI SKILL.md editing dialog");
|
|
290
307
|
assert.match(html, /id="busyPromptBehaviorMenu"[\s\S]*data-busy-prompt-behavior="followUp"[\s\S]*data-busy-prompt-behavior="steer"/, "busy prompt behavior dropdown should expose follow-up and steer choices");
|
|
291
308
|
assert.match(app, /const LONG_INPUT_ATTACHMENT_LINE_THRESHOLD = 20/, "long composer text should use a 20-line threshold before becoming an attachment");
|
|
@@ -340,7 +357,7 @@ assert.match(workflowModeButtonHtml, /data-tooltip="Workflow Mode:/, "Workflow M
|
|
|
340
357
|
assert.doesNotMatch(workflowModeButtonHtml, /\stitle=/, "Workflow Mode should not also expose a browser-native tooltip");
|
|
341
358
|
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");
|
|
342
359
|
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");
|
|
343
|
-
assert.match(html, /id="conversationVoiceMenu" class="composer-publish-menu composer-conversation-voice-menu"
|
|
360
|
+
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");
|
|
344
361
|
assert.match(app, /conversationVoiceMenuPanel: \$\("#conversationVoiceMenuPanel"\)/, "frontend should register the conversation voice menu panel");
|
|
345
362
|
assert.match(app, /\/api\/conversation-voices/, "frontend should load the Piper voice list from the server");
|
|
346
363
|
assert.match(app, /\/api\/conversation-voice"/, "frontend should switch voices through the conversation-voice endpoint");
|
|
@@ -453,12 +470,15 @@ assert.match(html, /id="followUpQueueTrigger"[^>]*aria-controls="followUpQueueOv
|
|
|
453
470
|
assert.match(css, /\.follow-up-queue-overlay \{[\s\S]*bottom:\s*calc\(100% \+ 0\.42rem\)[\s\S]*var\(--visual-viewport-height, 100dvh\)[\s\S]*body\.mobile-keyboard-open \.follow-up-queue-trigger:not\(\[hidden\]\) \{ display: inline-flex; \}/, "mobile queue overlay should float above the composer, fit the visual viewport, and keep its trigger usable with the keyboard open");
|
|
454
471
|
assert.doesNotMatch(app, /nextQueuedFollowUpPrompt|sticky-user-follow-up-prompt|Next follow-up prompt:/, "the mobile sticky prompt control should not duplicate a queued follow-up preview");
|
|
455
472
|
assert.match(css, /\.message\.extension,[\s\S]*?\.message\.native/, "extension and native command output should have visible transcript styling");
|
|
456
|
-
assert.match(app, /const FEATURE_CATEGORY_STATUS_KEY = "feature-category";[\s\S]*const featureCategoryByTab = new Map\(\)/, "feature category
|
|
473
|
+
assert.match(app, /const FEATURE_DECISION_OUTPUT_STATUS_KEY = "feature-decision-output";\s+const FEATURE_CATEGORY_STATUS_KEY = "feature-category";[\s\S]*const featureCategoryByTab = new Map\(\);\s+const featureDecisionOutputByTab = new Map\(\)/, "feature category and exact decision output should use separate transport keys and per-tab maps");
|
|
457
474
|
assert.match(app, /function normalizeFeatureCategory\(value\) \{\s+return value === "lightweight-feature" \|\| value === "complex-feature" \? value : "";/, "feature category normalization should accept only the two approved exact labels");
|
|
458
|
-
assert.match(app, /function
|
|
459
|
-
assert.match(app, /function
|
|
460
|
-
assert.match(app, /
|
|
461
|
-
assert.match(app, /function
|
|
475
|
+
assert.match(app, /function normalizeFeatureDecisionKind\(value\) \{\s+return value === "feature_lightweight" \|\| value === "feature_complex" \? value : "";/, "feature decision kind normalization should accept only the two approved exact labels");
|
|
476
|
+
assert.match(app, /function parseFeatureDecisionPayload\(value\) \{[\s\S]*value\.length > FEATURE_DECISION_PAYLOAD_MAX_CHARS\) return null;[\s\S]*const legacyKind = normalizeFeatureDecisionKind\(value\);[\s\S]*JSON\.parse\(value\)[\s\S]*return kind && reason \? \{ kind, reason \} : null;/, "the decision payload parser should bound size, accept the legacy exact label, and otherwise fail closed on the structured payload");
|
|
477
|
+
assert.match(app, /function formatFeatureDecisionText\(decision\) \{[\s\S]*`Decision: \$\{featureDecisionKindLabel\(decision\.kind\)\} \(\$\{decision\.kind\}\)\\nReason: \$\{reason\}`/, "the popup should render a readable decision and reason instead of only the machine label");
|
|
478
|
+
assert.match(app, /function renderFeatureCategoryTag\(tabId = activeTabId\) \{[\s\S]*featureCategoryByTab\.get\(tabId\)[\s\S]*featureDecisionOutputForTab\(tabId\)[\s\S]*tag\.hidden = !category;\s+tag\.disabled = !output;\s+tag\.textContent = category/, "feature category rendering should preserve category text while enabling the active-tab popup only for matching exact output");
|
|
479
|
+
assert.match(app, /function handleFeatureCategoryStatus\(statusText, tabId = activeTabId\) \{[\s\S]*featureCategoryByTab\.set\(tabId, category\)[\s\S]*clearFeatureDecisionStateForTab\(tabId\)[\s\S]*tabId === activeTabId/, "feature category status should update only the addressed tab and defensively clear exact output when category clears");
|
|
480
|
+
assert.match(app, /case "setStatus": \{[\s\S]*statusKey === FEATURE_DECISION_OUTPUT_STATUS_KEY[\s\S]*handleFeatureDecisionOutputStatus\(request\.statusText, request\.tabId \|\| activeTabId\);[\s\S]*statusKey === FEATURE_CATEGORY_STATUS_KEY[\s\S]*handleFeatureCategoryStatus\(request\.statusText, request\.tabId \|\| activeTabId\);[\s\S]*statusEntries\.set\(statusKey, request\.statusText\)/, "feature output and category statuses should be consumed before generic footer status storage");
|
|
481
|
+
assert.match(app, /function setActiveTabId\(tabId, \{ remember = false \} = \{\}\) \{[\s\S]*closeFeatureDecisionDialog\(\{ restoreFocus: false \}\)[\s\S]*renderFeatureCategoryTag\(nextTabId\)[\s\S]*function syncTabMetadata\(nextTabs = \[\]\) \{[\s\S]*clearFeatureDecisionStateForTab\(tabId\)/, "tab activation and cleanup should close stale popup content, render only active-tab state, and remove closed-tab state");
|
|
462
482
|
assert.match(app, /function remoteWebuiQrSvg\(qrLines = \[\]\)[\s\S]*?viewBox[\s\S]*?shape-rendering[\s\S]*?crispEdges/, "remote WebUI QR popup should render terminal QR output as square SVG modules");
|
|
463
483
|
assert.match(app, /function showRemoteWebuiQrLoadingPopup\(message = "Opening Remote WebUI QR…"\)[\s\S]*?remote-qr-loading[\s\S]*?showModal\(\)/, "remote WebUI QR popup should show a loading state while QR generation is pending");
|
|
464
484
|
assert.match(app, /function handleRemoteWebuiStatus\(statusText\)[\s\S]*?opening remote webui[\s\S]*?refreshing remote qr[\s\S]*?enabling remote pin auth[\s\S]*?showRemoteWebuiQrLoadingPopup/, "remote WebUI status updates should open the QR loading popup before widget lines arrive");
|
|
@@ -602,7 +622,7 @@ assert.match(css, /body\.terminal-tabs-left \.chat-panel \{[\s\S]*?grid-template
|
|
|
602
622
|
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");
|
|
603
623
|
assert.match(html, /class="terminal-sidebar-actions"[^>]*aria-label="Tab and workspace actions"[\s\S]*id="splitTabButton"[^>]*aria-label="Split the active terminal to the right"[\s\S]*id="workspaceSaveButton"[^>]*aria-label="Save workspace"[\s\S]*id="commandPaletteButton"[^>]*aria-label="Open command palette"[\s\S]*id="workspaceDashboardToggleButton"[^>]*aria-label="Show workspace overview"/, "tab, save, command, and workspace actions should share one accessibly labelled sidebar toolbar");
|
|
604
624
|
assert.doesNotMatch(html, /terminal-sidebar-action-label/, "left-sidebar action buttons should be icon-only without redundant visible labels");
|
|
605
|
-
assert.match(css, /body\.terminal-tabs-left \.terminal-sidebar-actions \{[\s\S]*?display:\s*grid;[\s\S]*?grid-template-columns:\s*repeat\(
|
|
625
|
+
assert.match(css, /body\.terminal-tabs-left \.terminal-sidebar-actions \{[\s\S]*?display:\s*grid;[\s\S]*?grid-template-columns:\s*repeat\(5, minmax\(0, 1fr\)\);[\s\S]*?body\.terminal-tabs-left \.terminal-sidebar-actions > button \{[\s\S]*?place-items:\s*center;[\s\S]*?min-height:\s*2\.75rem;[\s\S]*?padding:\s*0\.42rem;/, "left-sidebar actions should render as compact equal-width icon buttons with 44px targets");
|
|
606
626
|
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-workspace-save-button\[data-tooltip\]::after,[\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\(400% \+ 1\.26rem\);/, "left-sidebar save, command, and overview tooltips should render above the full toolbar without clipping");
|
|
607
627
|
assert.match(css, /terminal-workspace-save-button\[data-tooltip\]::after \{\s+left:\s*calc\(-100% - 0\.42rem\);[\s\S]*?terminal-command-palette-button\[data-tooltip\]::after \{\s+left:\s*calc\(-200% - 0\.84rem\);[\s\S]*?terminal-dashboard-button\[data-tooltip\]::after \{\s+left:\s*calc\(-300% - 1\.26rem\);/, "left-sidebar tooltips should align to the toolbar edges from their individual buttons");
|
|
608
628
|
assert.match(app, /elements\.splitTabButton\.setAttribute\("aria-pressed", canShowSplit \? "true" : "false"\);[\s\S]*?applyStyledTooltip\(elements\.splitTabButton, label, \{ ariaLabel: label \}\);/, "icon-only split action should expose its Split or Close state through accessibility text and the tooltip");
|
|
@@ -812,9 +832,10 @@ assert.match(server, /if \(webuiDevServer\) env\.PI_WEBUI_DEV = "1";/, "server r
|
|
|
812
832
|
assert.match(server, /async function piUpdateCommandSupportsAll\(command\)[\s\S]*runCommand\(command\.command, command\.args \|\| \[\][\s\S]*piUpdateHelpSupportsAll/, "server should check the selected Pi executable's update help");
|
|
813
833
|
assert.match(server, /const supportsAll = all && await piUpdateCommandSupportsAll\(await resolveCommand\(\["update", "--help"\]\)\)[\s\S]*piUpdateCommandSteps\(\{ all, supportsAll \}\)/, "server should prefer --all only when the capability check succeeds");
|
|
814
834
|
assert.match(server, /async function resolveUpdateTasks\(\{ all = false \} = \{\}\)[\s\S]*const piTasks = await resolvePiUpdateCommands\(\{ all \}\)[\s\S]*if \(!all\) return uniqueUpdateTasks\(piTasks\)[\s\S]*currentWebuiPackageUpdateTask\(npmRuntime\)[\s\S]*agentPackageRootUpdateTask\(npmRuntime\)[\s\S]*projectPackageRootUpdateTasks\(npmRuntime\)[\s\S]*npmGlobalPackageRootUpdateTask\(npmRuntime\)[\s\S]*bunGlobalPackageRootUpdateTask\(\)/, "server all-update should run the selected Pi plan plus detected local/global Pi package root tasks with install-aware npm resolution");
|
|
815
|
-
assert.match(server, /const
|
|
835
|
+
assert.match(server, /const OPTIONAL_FEATURE_PACKAGE_NAMES = new Set\(OPTIONAL_FEATURE_PACKAGES\.values\(\)\)[\s\S]*const UPDATE_PACKAGE_NAMES = \[\.\.\.CORE_UPDATE_PACKAGE_NAMES\]\.sort\(\)/, "direct package-root updates should target core packages while retaining the Optional Feature exclusion set");
|
|
836
|
+
assert.match(server, /function isWebuiOrPiPackageName\(packageName\)[\s\S]*OPTIONAL_FEATURE_PACKAGE_NAMES\.has\(name\)\) return false/, "direct npm and Bun update discovery should leave Optional Features under Pi management");
|
|
816
837
|
assert.match(app, /const commandText = all \? '"pi update --all" when supported, otherwise "pi update --self" followed by "pi update --extensions"' : '"pi update --self"'/, "frontend update confirmation should describe capability selection and fallback");
|
|
817
|
-
assert.match(app, /Optional Features, and detected Pi package roots/, "frontend all-update confirmation should
|
|
838
|
+
assert.match(app, /configured packages including Optional Features, and detected core Pi\/Web UI package roots/, "frontend all-update confirmation should distinguish Pi-managed Optional Features from direct core-root updates");
|
|
818
839
|
assert.match(app, /api\(all \? "\/api\/update\?all=1" : "\/api\/update"/, "frontend all update should call the explicit all-mode endpoint");
|
|
819
840
|
assert.match(html, /<option value="update-all">Update Pi \+ Packages & Restart<\/option>/, "side panel should expose package-inclusive updates as a separate server action");
|
|
820
841
|
assert.match(readme, /first checks the selected Pi executable's `pi update --help`[\s\S]*uses `pi update --all` when advertised[\s\S]*otherwise falls back/, "README should document the checked preferred and fallback update modes");
|
|
@@ -832,7 +853,7 @@ assert.match(app, /function setOptionsMenuOpen\(open\)[\s\S]*scheduleMobileDropd
|
|
|
832
853
|
assert.match(app, /function focusPromptInput\(\{ defer = false \} = \{\}\)/, "frontend should focus the prompt composer programmatically after tab/app startup");
|
|
833
854
|
assert.match(app, /async function switchTab\(tabId\)[\s\S]*?restoreActiveDraft\(\);\n\s+focusPromptInput\(\{ defer: true \}\);/, "switching to a newly opened tab should focus the prompt input immediately");
|
|
834
855
|
assert.match(app, /async function initializeTabs\(\)[\s\S]*?restoreActiveDraft\(\);[\s\S]*if \(!loadedTabs\.length\)[\s\S]*focusPromptInput\(\{ defer: true \}\);/, "starting the Web UI should prompt for cwd when needed and focus active tabs");
|
|
835
|
-
assert.match(app, /resizePromptInput\(\);\nrestoreSidePanelWidthPreference\(\);\nrestoreFileViewerWidthPreference\(\);\nfocusPromptInput\(\{ defer: true \}\);\nrestoreStoredSkillUsage\(\);\nrestoreBusyPromptBehaviorSetting\(\);\nupdateComposerModeButtons\(\);/, "startup should restore resizable panel preferences, request prompt focus, and restore skill tags before waiting for tab state refreshes");
|
|
856
|
+
assert.match(app, /resizePromptInput\(\);\nrestoreDurableUiLayoutPendingJournal\(\);\nrestoreSidePanelWidthPreference\(\);\nrestoreFileViewerWidthPreference\(\);\nfocusPromptInput\(\{ defer: true \}\);\nrestoreStoredSkillUsage\(\);\nrestoreBusyPromptBehaviorSetting\(\);\nupdateComposerModeButtons\(\);/, "startup should restore resizable panel preferences, request prompt focus, and restore skill tags before waiting for tab state refreshes");
|
|
836
857
|
assert.match(app, /elements\.promptInput\.addEventListener\("focus", \(\) => \{\n\s+syncMobileChatToBottomForInput\(\);/, "focusing mobile input should scroll output to bottom");
|
|
837
858
|
assert.match(app, /navigator\.serviceWorker\.register\("\/service-worker\.js"\)/, "PWA service worker should be registered by the app");
|
|
838
859
|
assert.match(app, /function serverStartCommandText\(\)[\s\S]*return `pi-webui\$\{currentPortArg\(\)\}`/, "PWA/offline shell should build a pathless pi-webui recovery command");
|
|
@@ -888,8 +909,10 @@ assert.match(app, /const node = make\("details", "widget todo-widget"\)/, "todo-
|
|
|
888
909
|
assert.match(app, /Optional feature detection intentionally checks loaded Pi capabilities/, "optional Web UI features should be detected through loaded capabilities, not package folders");
|
|
889
910
|
assert.match(app, /function resetOptionalFeatureAvailability\(\)/, "optional feature state should reset across active-tab and reload boundaries");
|
|
890
911
|
assert.match(app, /function renderOptionalFeaturePanel\(\)/, "side panel should render optional feature installed/enabled state");
|
|
891
|
-
assert.match(app, /const OPTIONAL_FEATURE_SECTIONS = \[[\s\S]*label: "Composer & commands"[\s\S]*label: "Workflows & releases"[\s\S]*label: "Safety & access"[\s\S]*label: "UI widgets & native parity"[\s\S]*label: "Conversation"/, "optional features should be grouped into five type subsections");
|
|
912
|
+
assert.match(app, /const OPTIONAL_FEATURE_SECTIONS = \[[\s\S]*label: "Composer & commands"[\s\S]*label: "Workflows & releases"[\s\S]*label: "Safety & access"[\s\S]*label: "UI widgets & native parity"[\s\S]*featureIds: \[[^\]]*"questionnaire"[\s\S]*label: "Conversation"/, "optional features should be grouped into five type subsections with questionnaires under native parity");
|
|
892
913
|
assert.match(app, /function renderOptionalFeatureSection\(section, features\)[\s\S]*optional-feature-section[\s\S]*optional-feature-section-title[\s\S]*optional-feature-section-list/, "optional feature panel should render subsection headers and lists");
|
|
914
|
+
assert.match(app, /async function refreshQuestionnaireFeatureAvailability[\s\S]*\/api\/tools\?scope=session[\s\S]*tool\?\.name === "questionnaire"/, "questionnaire availability should be detected from the active Pi tab's loaded tool capability");
|
|
915
|
+
assert.match(app, /detected && feature\.manageWith === "tools"[\s\S]*action\.textContent = "Tools…"[\s\S]*openNativeToolsSelector/, "loaded questionnaire access should be managed through the native Tools selector instead of a cosmetic WebUI disable toggle");
|
|
893
916
|
assert.match(app, /function setSidePanelSectionCollapsed\(record, collapsed/, "side panel sections should have explicit collapse/expand behavior");
|
|
894
917
|
assert.match(
|
|
895
918
|
app,
|
|
@@ -948,9 +971,12 @@ assert.match(app, /subagentTerminalCancelButton[\s\S]*openSubagentCancelDialog\(
|
|
|
948
971
|
assert.match(app, /function openSubagentCancelDialog\(tab, run, agent = null\)[\s\S]*agentCount[\s\S]*The entire run will be stopped[\s\S]*subagentCancelDialog\.showModal\(\)[\s\S]*async function submitSubagentCancel\(\)[\s\S]*api\("\/api\/subagents\/cancel", \{[\s\S]*method: "POST",[\s\S]*scoped: false,[\s\S]*tab: selection\.tabId,[\s\S]*runId: selection\.runId/, "the shared cancel dialog should honestly describe and submit whole-run cancellation with optional reason/note data");
|
|
949
972
|
assert.doesNotMatch(app, /body: \{\n\s+tab: selection\.tabId,\n\s+runId: selection\.runId,\n\s+\.\.\.\(selection\.agentId/, "the frontend must not imply unsupported per-agent cancellation in its request contract");
|
|
950
973
|
assert.match(app, /async function dismissSubagentRun\(tab, run\)[\s\S]*api\("\/api\/subagents\/dismiss", \{[\s\S]*method: "POST",[\s\S]*scoped: false,[\s\S]*body: \{ tab: tab\.tabId, runId: run\.id \}/, "finished-run dismiss controls should call the owning tab endpoint");
|
|
951
|
-
assert.match(app, /function finishedSubagentRunSelections\(data = latestSubagents\)[\s\S]*ungatedSubagentRuns\(tab\)[\s\S]*run\.status !== "running" && run\.source !== "workflow"[\s\S]*async function clearFinishedSubagentRuns\(\)[\s\S]*for \(const selection of selections\)[\s\S]*api\("\/api\/subagents\/dismiss", \{[\s\S]*body: \{ tab: selection\.tabId, runId: selection\.runId \}[\s\S]*subagentsClearFinishedButton\.disabled = subagentsLoading \|\| subagentsClearingFinished \|\| finishedRuns\.length === 0/, "clear-finished should dismiss visible terminal ordinary runs while preserving retry-gated, active, and workflow runs");
|
|
974
|
+
assert.match(app, /function finishedSubagentRunSelections\(data = latestSubagents\)[\s\S]*ungatedSubagentRuns\(tab\)[\s\S]*run\.status !== "running" && run\.source !== "workflow"[\s\S]*async function clearFinishedSubagentRuns\(\{ automatic = false \} = \{\}\)[\s\S]*for \(const selection of selections\)[\s\S]*api\("\/api\/subagents\/dismiss", \{[\s\S]*body: \{ tab: selection\.tabId, runId: selection\.runId \}[\s\S]*subagentsClearFinishedButton\.disabled = subagentsLoading \|\| subagentsClearingFinished \|\| finishedRuns\.length === 0/, "clear-finished should dismiss visible terminal ordinary runs while preserving retry-gated, active, and workflow runs");
|
|
975
|
+
assert.match(app, /subagentsAutoClearButton\?\.addEventListener\("click", \(\) => \{[\s\S]*setSubagentAutoClearEnabled\(!subagentAutoClearEnabled, \{ announce: true \}\)/, "the Auto-Clear button should toggle the selected browser preference");
|
|
976
|
+
assert.match(app, /SUBAGENT_AUTO_CLEAR_STORAGE_KEY = "pi-webui-subagent-auto-clear"[\s\S]*function readStoredSubagentAutoClearEnabled\(\)[\s\S]*localStorage\.getItem\(SUBAGENT_AUTO_CLEAR_STORAGE_KEY\) === "1"[\s\S]*function setSubagentAutoClearEnabled[\s\S]*clearFinishedSubagentRuns\(\{ automatic: true \}\)[\s\S]*restoreSubagentAutoClearSetting\(\)/, "Auto-Clear should persist per browser and immediately clear already-finished ordinary runs when selected");
|
|
977
|
+
assert.match(app, /async function refreshSubagents\(\)[\s\S]*refreshed = true[\s\S]*refreshed && subagentAutoClearEnabled && finishedSubagentRunSelections\(\)\.length[\s\S]*await clearFinishedSubagentRuns\(\{ automatic: true \}\)/, "successful overview refreshes should await guarded auto-clear when terminal runs appear");
|
|
952
978
|
assert.match(app, /subagentsClearFinishedButton\?\.addEventListener\("click", \(\) => \{[\s\S]*clearFinishedSubagentRuns\(\)/, "the clear-finished button should invoke the guarded bulk dismissal action");
|
|
953
|
-
assert.match(css, /\.subagents-status-row \{[\s\S]*display: flex;[\s\S]*\.subagents-clear-finished-button \{[\s\S]*min-height: 2rem
|
|
979
|
+
assert.match(css, /\.subagents-status-row \{[\s\S]*display: flex;[\s\S]*\.subagents-auto-clear-button,[\s\S]*\.subagents-clear-finished-button \{[\s\S]*min-height: 2rem;[\s\S]*\.subagents-auto-clear-button\[aria-pressed="true"\]/, "the clear controls should share a compact row with a visible Auto-Clear selected state");
|
|
954
980
|
const clearFinishedSourceStart = app.indexOf("function finishedSubagentRunSelections(");
|
|
955
981
|
const clearFinishedSourceEnd = app.indexOf("\nfunction subagentOverlayTranscriptMessages(", clearFinishedSourceStart);
|
|
956
982
|
assert.ok(clearFinishedSourceStart >= 0 && clearFinishedSourceEnd > clearFinishedSourceStart, "clear-finished helpers should remain independently testable");
|
|
@@ -988,6 +1014,9 @@ assert.deepEqual(JSON.parse(JSON.stringify(clearFinishedCalls)), [
|
|
|
988
1014
|
assert.equal(clearFinishedRefreshes, 1, "clear-finished should refresh the overview once after all dismissals");
|
|
989
1015
|
assert.equal(clearFinishedContext.subagentsClearingFinished, false, "clear-finished should always release its in-flight guard");
|
|
990
1016
|
assert.deepEqual(clearFinishedEvents, [{ message: "cleared 3 finished subagent runs", level: "info" }]);
|
|
1017
|
+
clearFinishedContext.latestSubagents = { tabs: [{ tabId: "tab-c", runs: [{ id: "done-c", status: "done", source: "async" }] }] };
|
|
1018
|
+
await clearFinishedContext.runClearFinishedSubagentRuns({ automatic: true });
|
|
1019
|
+
assert.deepEqual(clearFinishedEvents.at(-1), { message: "auto-cleared 1 finished subagent run", level: "info" }, "automatic clearing should identify its action without changing terminal-run selection semantics");
|
|
991
1020
|
assert.match(app, /function materializeRetainedSubagentTerminalViews\(\)[\s\S]*restoreKey = `\$\{tab\.tabId\}\\u0000\$\{tab\.sessionFile[\s\S]*ungatedSubagentRuns\(tab\)[\s\S]*run\?\.status === "running"[\s\S]*ensureSubagentTerminalView/, "terminal mode should materialize only ungated restored retained agent views once per parent session identity without touching overlay mode");
|
|
992
1021
|
assert.match(app, /from "\.\/subagent-launch-slot-state\.mjs"[\s\S]*function renderSubagentLaunchSlots\(\)[\s\S]*function loadSubagentLaunchSlotConfig\([\s\S]*\/api\/subagents\/config/, "launch-slot configuration should have its own browser state and API loader");
|
|
993
1022
|
assert.match(app, /function subagentLaunchSlotThinkingForModel\(model\)[\s\S]*modelThinkingLevels/, "launch-slot thinking choices should come from the selected model metadata");
|
|
@@ -1315,11 +1344,21 @@ assert.match(app, /\["skills", "tuiSkillsCommand"\][\s\S]*\["tools", "tuiToolsCo
|
|
|
1315
1344
|
assert.match(app, /function setNativeCommandMenuOpen\(open\)/, "frontend should track the skills/tools command menu open state separately from Publish");
|
|
1316
1345
|
assert.match(app, /nativeSkillsButton\.hidden = !isOptionalFeatureEnabled\("tuiSkillsCommand"\)[\s\S]*nativeToolsButton\.hidden = !isOptionalFeatureEnabled\("tuiToolsCommand"\)/, "skills/tools menu items should be hidden by their optional feature toggles");
|
|
1317
1346
|
assert.match(app, /function renderCommands\(\)/, "side-panel commands should be re-renderable from current optional feature state");
|
|
1318
|
-
|
|
1347
|
+
const installOptionalFeatureSource = appFunctionSource("installOptionalFeature", "installOptionalFeatureBatch");
|
|
1348
|
+
const installOptionalFeatureBatchSource = appFunctionSource("installOptionalFeatureBatch", "runPublishWorkflow");
|
|
1349
|
+
assert.match(installOptionalFeatureSource, /featureId, \{ update = false \} = \{\}/, "optional features should expose per-row install and update actions");
|
|
1319
1350
|
assert.match(app, /api\("\/api\/optional-features"/, "optional feature panel should fetch package install/update status from the backend");
|
|
1320
|
-
assert.match(app, /
|
|
1321
|
-
assert.match(app, /
|
|
1322
|
-
assert.match(app, /
|
|
1351
|
+
assert.match(app, /function optionalFeatureNeedsInstall\(feature\)[\s\S]*status\.ready !== true[\s\S]*status\.resourceConflict !== true/, "bulk selection should exclude ready top-level resources and duplicate registration conflicts");
|
|
1352
|
+
assert.match(app, /packageStatus\?\.updateAvailable[\s\S]*action\.textContent = "Update…"/, "optional feature package drift should retain the per-row update action");
|
|
1353
|
+
assert.match(app, /function optionalFeatureManualInstallCommand\(feature\)[\s\S]*`pi install npm:\$\{feature\.packageName\}`/, "optional feature fallback commands should use the exact unpinned Pi npm source");
|
|
1354
|
+
assert.match(app, /function copyOptionalFeatureInstallCommand\(featureId\)[\s\S]*state\?\.command \|\| optionalFeatureManualInstallCommand\(feature\)/, "missing and unregistered rows should expose a copyable Pi fallback command before an install attempt");
|
|
1355
|
+
assert.match(installOptionalFeatureSource, /optionalFeatureManualInstallCommand\(feature\)[\s\S]*selected Pi CLI[\s\S]*api\("\/api\/optional-feature-install"/, "per-row install/update should describe and call the Pi-backed endpoint");
|
|
1356
|
+
assert.doesNotMatch(installOptionalFeatureSource, /npm install|Web UI package install root|npm command/i, "per-row optional feature copy should not claim that Web UI invokes npm directly");
|
|
1357
|
+
assert.match(app, /renderOptionalFeatureBatchToolbar\(\)[\s\S]*"Install all"[\s\S]*installOptionalFeatureBatch\(OPTIONAL_FEATURES/, "optional feature panel should expose Install all");
|
|
1358
|
+
assert.match(app, /function renderOptionalFeatureSection\(section, features\)[\s\S]*"Install missing"[\s\S]*installOptionalFeatureBatch\(features/, "each optional feature section should expose Install missing");
|
|
1359
|
+
assert.match(installOptionalFeatureBatchSource, /optionalFeatureBatchCandidates\(features\)[\s\S]*await appConfirmText\([\s\S]*api\("\/api\/optional-feature-install-batch"[\s\S]*for \(const feature of candidates\)[\s\S]*result\?\.ok === true[\s\S]*optionalFeatureInstallFailureFromBatchResult/, "bulk install should confirm once, call one backend batch, and settle every requested row independently");
|
|
1360
|
+
assert.match(installOptionalFeatureBatchSource, /Batch finished:[\s\S]*succeeded[\s\S]*failed|optional feature batch finished:[\s\S]*succeeded[\s\S]*failed/, "bulk install should expose bounded aggregate success/failure counts");
|
|
1361
|
+
assert.equal((installOptionalFeatureBatchSource.match(/confirmLabel: "Reload tab"/g) || []).length, 1, "bulk install should issue exactly one post-batch reload prompt");
|
|
1323
1362
|
assert.match(app, /id: "btwCommand"[\s\S]*?@firstpick\/pi-extension-btw/, "optional features should include the /btw companion");
|
|
1324
1363
|
assert.match(app, /BTW_OUTPUT_WIDGET_KEY = "btw:output"[\s\S]*function renderBtwOutputWidget/, "Web UI should render structured /btw output widgets");
|
|
1325
1364
|
assert.match(app, /if \(key\.startsWith\("btw:"\)\) return "btwCommand"/, "extension widget routing should associate /btw widgets with the optional feature");
|
|
@@ -1327,6 +1366,7 @@ assert.match(app, /id: "safetyGuard"[\s\S]*?@firstpick\/pi-extension-safety-guar
|
|
|
1327
1366
|
assert.match(app, /id: "tuiSkillsCommand"[\s\S]*?@firstpick\/pi-extension-setup-skills/, "optional features should include the TUI skills command companion");
|
|
1328
1367
|
assert.match(app, /id: "tuiToolsCommand"[\s\S]*?@firstpick\/pi-extension-tools/, "optional features should include the TUI tools command companion");
|
|
1329
1368
|
assert.match(app, /id: "remoteWebui"[\s\S]*?@firstpick\/pi-package-remote-webui/, "optional features should include the Remote WebUI companion");
|
|
1369
|
+
assert.match(app, /id: "questionnaire"[\s\S]*?@firstpick\/pi-package-questionnaire[\s\S]*?capabilityLabel: "questionnaire tool in \/tools"[\s\S]*?manageWith: "tools"/, "optional features should include the native questionnaire package and delegate access control to Tools");
|
|
1330
1370
|
assert.match(app, /id: "naturalConversation"[\s\S]*?@firstpick\/pi-package-natural-conversation[\s\S]*?capabilityLabel: "\/talk, \/voice, or \/conversation"/, "optional features should include the capability-detected Natural Conversation shell");
|
|
1331
1371
|
assert.match(app, /NATURAL_CONVERSATION_COMMAND_NAMES = \["talk", "voice", "conversation"\]/, "frontend should detect Natural Conversation only from RPC-visible command aliases");
|
|
1332
1372
|
assert.match(app, /const conversationModeByTab = new Map\(\)/, "frontend should track Natural Conversation state per terminal tab");
|
|
@@ -1390,7 +1430,7 @@ const workflowTokenRenderSource = appFunctionSource("appendWorkflowScriptTokens"
|
|
|
1390
1430
|
const workflowPreviewSource = appFunctionSource("renderWorkflowScriptPreview", "showNextDialog");
|
|
1391
1431
|
const workflowDialogSource = appFunctionSource("showNextDialog", "handleInactiveTabEvent");
|
|
1392
1432
|
assert.match(workflowPreviewRequestSource, /request\?\.method === "editor"[\s\S]*title\.startsWith\("Raw workflow script"\)[\s\S]*inspection only;\\s\*edits are ignored/, "workflow inspector specialization should require the editor method, raw-script title, and inspection-only wording");
|
|
1393
|
-
assert.match(workflowDialogSource, /else if \(isWorkflowScriptPreview\) \{\s*renderWorkflowScriptPreview\(request\);\s*\} else if \(request\.method === "editor"\) \{\s*const textarea = make\("textarea", "dialog-editor"\);[\s\S]*textarea\.value = request\.prefill \|\| ""/, "workflow previews should specialize before the unchanged generic editor textarea fallback");
|
|
1433
|
+
assert.match(workflowDialogSource, /else if \(isWorkflowScriptPreview\) \{\s*renderWorkflowScriptPreview\(request, respondToDialog\);\s*\} else if \(request\.method === "editor"\) \{\s*const textarea = make\("textarea", "dialog-editor"\);[\s\S]*textarea\.value = request\.prefill \|\| ""/, "workflow previews should specialize before the unchanged generic editor textarea fallback and share its one-shot responder");
|
|
1394
1434
|
assert.doesNotMatch(workflowPreviewSource, /\btextarea\b/, "workflow previews should not create an editable textarea");
|
|
1395
1435
|
assert.match(workflowTokenRenderSource, /document\.createTextNode\(line\.slice\(start, match\.index\)\)[\s\S]*make\("span", `workflow-script-token/, "workflow syntax tokens should be built from DOM text nodes and spans");
|
|
1396
1436
|
assert.doesNotMatch(workflowTokenRenderSource, /innerHTML|insertAdjacentHTML/, "workflow syntax token rendering should not inject source through HTML APIs");
|
|
@@ -1640,7 +1680,8 @@ assert.doesNotMatch(app, /runIndicatorTimestamp/, "active agent indicator should
|
|
|
1640
1680
|
assert.match(app, /runIndicatorBubble = make\("article", "message runIndicator run-indicator-message streaming"\)/, "active agent indicator should use a dedicated streaming transcript card");
|
|
1641
1681
|
assert.match(app, /function standaloneLiveTranscriptBubbles\(\)[\s\S]*?streamThinkingBubble[\s\S]*?streamToolCallBubble[\s\S]*?streamBubble[\s\S]*?compactThinkingBubble[\s\S]*?compactTextBubble/, "transcript reconciliation should identify standalone live-tail bubbles that must stay mounted");
|
|
1642
1682
|
assert.match(app, /function resetChatOutput\(\)[\s\S]*?liveBubbles = standaloneLiveTranscriptBubbles\(\)[\s\S]*?preservedNodes[\s\S]*?child === runIndicatorBubble \|\| liveBubbles\.has\(child\)[\s\S]*?transcriptRenderer\.replaceChildren\(elements\.chat, \.\.\.preservedNodes\)/, "transcript resets should reconcile through the coordinator while preserving live output and the run indicator");
|
|
1643
|
-
assert.match(app, /function appendChatMessageBubble\(bubble\
|
|
1683
|
+
assert.match(app, /function appendChatMessageBubble\(bubble, \{ liveTail = false \} = \{\}\)[\s\S]*?child === runIndicatorBubble \|\| \(!liveTail && liveBubbles\.has\(child\)\)[\s\S]*?insertBefore\(bubble, tailAnchor\)/, "reconciled history should insert before the stable live transcript tail while new live output stays chronological");
|
|
1684
|
+
assert.match(app, /appendChatMessageBubble\(created\.bubble, \{ liveTail: streaming \|\| message\?\.live === true \}\)/, "streaming thinking, assistant text, and live tools should append after earlier live output");
|
|
1644
1685
|
assert.match(app, /setChatScrollTopInstant\(Math\.min\(previousScrollTop, elements\.chat\.scrollHeight\)\)/, "paused-reader scroll restoration should bypass smooth scrolling to avoid a down-then-back animation");
|
|
1645
1686
|
assert.match(app, /function ensureRunIndicatorBubble\(\)[\s\S]*?!runIndicatorBubble \|\| !runIndicatorText \|\| !runIndicatorMeta[\s\S]*?elements\.chat\.lastElementChild !== runIndicatorBubble/, "active agent indicator should reuse the existing bubble across transcript re-renders instead of recreating it");
|
|
1646
1687
|
assert.match(app, /const headline = runIndicatorHeadline\(\);\n\s+if \(runIndicatorText\.textContent !== headline\) runIndicatorText\.textContent = headline;/, "active agent indicator should avoid redundant headline DOM writes that can flicker");
|
|
@@ -1797,7 +1838,7 @@ assert.match(app, /async function sendPrompt\(kind = "prompt", explicitMessage,
|
|
|
1797
1838
|
assert.match(app, /const rawMessage = usesPromptInput \? elements\.promptInput\.value : explicitMessage/, "direct prompt sends should not read the input textarea");
|
|
1798
1839
|
assert.match(app, /function clearPromptInputForRouting\(\{ usesPromptInput,[\s\S]*?if \(!usesPromptInput\) return;/, "direct prompt sends should preserve the input textarea draft");
|
|
1799
1840
|
assert.match(app, /make\("button", "command-item"\)[\s\S]*?sendPrompt\("prompt", `\/\$\{command\.name\}`\)/, "side-panel command clicks should send the slash command directly");
|
|
1800
|
-
assert.match(app, /const NATIVE_SELECTOR_COMMANDS = new Set\(\["model", "settings", "workflow-setup", "safety-guard-setup", "git-workflow-setup", "theme", "fork", "clone", "name", "resume", "tree", "login", "logout", "scoped-models", "tools", "skills"\]\)/, "frontend should route native slash commands, including workflow permission, safety, and Guided Git setup, into selector UIs");
|
|
1841
|
+
assert.match(app, /const NATIVE_SELECTOR_COMMANDS = new Set\(\["model", "settings", "summary", "summary-setup", "workflow-setup", "safety-guard-setup", "git-workflow-setup", "theme", "fork", "clone", "name", "resume", "tree", "login", "logout", "scoped-models", "tools", "skills"\]\)/, "frontend should route native slash commands, including session summary, workflow permission, safety, and Guided Git setup, into selector UIs");
|
|
1801
1842
|
assert.match(app, /async function handleNativeSlashSelectorCommand\(message/, "frontend should intercept exact native slash commands before prompt forwarding");
|
|
1802
1843
|
assert.match(app, /kind === "prompt" && attachments\.length === 0 && await handleNativeSlashSelectorCommand/, "prompt sending should open native selector dialogs before marking a run active");
|
|
1803
1844
|
assert.match(app, /function openNativeModelSelector\(\)[\s\S]*?nativeCommandApi\("\/api\/models"\)/, "native /model selector should load models through the active tab API");
|
|
@@ -1882,7 +1923,7 @@ assert.match(app, /let activeTabGeneration = 0/, "frontend should version active
|
|
|
1882
1923
|
assert.match(app, /function isCurrentTabContext\(context\)/, "frontend should identify stale active-tab refresh contexts");
|
|
1883
1924
|
assert.match(app, /function connectEvents\(tabContext = activeTabContext\(\), \{ requestedMode = "auto", fallbackAttempted = false \} = \{\}\)[\s\S]*?eventSource !== source/, "frontend should ignore stale SSE messages from old active tabs");
|
|
1884
1925
|
assert.match(app, /let foregroundReconcileTimer = null/, "frontend should debounce foreground resume reconciliation");
|
|
1885
|
-
assert.match(app, /case "webui_connected":[\s\S]*?
|
|
1926
|
+
assert.match(app, /case "webui_connected":[\s\S]*?clearFeatureDecisionStateForTab\(connectedTabId, \{ render: true \}\)[\s\S]*?scheduleForegroundReconcile\("event stream reconnect", 0\)/, "SSE reconnect should close stale popup content and clear cached category/output before authoritative status replay");
|
|
1886
1927
|
assert.match(app, /async function reconcileForegroundState\(reason = "resume"\)[\s\S]*?refreshTabs\(\)[\s\S]*?ensureActiveEventStream\(tabContext\)[\s\S]*?refreshAll\(tabContext\)/, "foreground reconciliation should refresh tabs plus active transcript after mobile backgrounding");
|
|
1887
1928
|
assert.match(app, /document\.addEventListener\("visibilitychange"[\s\S]*?scheduleForegroundReconcile\("visibility resume", 0\)/, "returning to a hidden mobile tab should force a server snapshot refresh");
|
|
1888
1929
|
assert.match(app, /window\.addEventListener\("pageshow", \(\) => scheduleForegroundReconcile\("page show", 0\)\)/, "BFCache or PWA page resume should force a server snapshot refresh");
|
|
@@ -1963,10 +2004,10 @@ assert.ok(mochaBackground.length > 8000, "Catppuccin Mocha background image shou
|
|
|
1963
2004
|
|
|
1964
2005
|
assert.match(server, /resolveCodexUsageAuth/, "server should use the lock-safe Codex OAuth compatibility adapter");
|
|
1965
2006
|
assert.match(server, /DefaultPackageManager/, "server should use Pi's package resolver when controlling Web UI tab extension loading");
|
|
1966
|
-
assert.match(server, /
|
|
1967
|
-
assert.match(server, /const args = \["--mode", "rpc", "--no-extensions", "--no-skills", "--no-prompt-templates", "--no-themes"\]/, "Web UI tabs should disable implicit resource loading before adding
|
|
1968
|
-
assert.match(server, /normalPiResourcePathsForTab[\s\S]*
|
|
1969
|
-
assert.match(server, /startedWebuiResourcePaths\(resourceType\)/, "Web UI tabs should load
|
|
2007
|
+
assert.match(server, /WEBUI_RESOURCE_EXCLUDED_PACKAGES = new Set\(\[WEBUI_PACKAGE\]\)/, "server should exclude only the Web UI package itself from normal Pi resource loading");
|
|
2008
|
+
assert.match(server, /const args = \["--mode", "rpc", "--no-extensions", "--no-skills", "--no-prompt-templates", "--no-themes"\]/, "Web UI tabs should disable implicit resource loading before adding resolved resource paths");
|
|
2009
|
+
assert.match(server, /normalPiResourcePathsForTab[\s\S]*WEBUI_RESOURCE_EXCLUDED_PACKAGES\.has\(packageName\)[\s\S]*continue/, "Web UI tab resource resolution should retain separately configured optional packages and prevent only self-loading duplication");
|
|
2010
|
+
assert.match(server, /startedWebuiResourcePaths\(resourceType\)/, "Web UI tabs should load Web UI-owned resources from the started package");
|
|
1970
2011
|
assert.match(server, /resolveInstalledPackageSubpath\(nodeModulesRef\.packageName, nodeModulesRef\.subpath\)/, "Web UI should prefer workspace/global/package-root installed packages for node_modules manifest entries");
|
|
1971
2012
|
assert.match(codexAuth, /CODEX_TOKEN_REFRESH_SKEW_MS = 5 \* 60 \* 1000/, "Codex OAuth credentials should refresh five minutes before expiry");
|
|
1972
2013
|
assert.match(server, /catch \{[\s\S]*OpenAI Codex OAuth token refresh failed/, "Codex auth failures should be redacted before reaching clients");
|
|
@@ -2000,7 +2041,7 @@ assert.match(server, /scopedEvent = \{ \.\.\.scopedEvent,[\s\S]*?pendingExtensio
|
|
|
2000
2041
|
assert.match(server, /function replayExtensionStatuses\(tab, client\)[\s\S]*method: "setStatus"/, "server should replay latest extension statuses on SSE reconnect");
|
|
2001
2042
|
assert.match(server, /function replayExtensionWidgets\(tab, client\)[\s\S]*method: "setWidget"/, "server should replay latest extension widgets on SSE reconnect");
|
|
2002
2043
|
assert.match(server, /function replayPendingExtensionUiRequests\(tab, client\)/, "server should be able to replay missed extension UI requests on SSE reconnect");
|
|
2003
|
-
assert.match(server, /replayExtensionStatuses\(tab, client\);\n\s+replayExtensionWidgets\(tab, client\)
|
|
2044
|
+
assert.match(server, /replayExtensionStatuses\(tab, client\);\n\s+replayExtensionWidgets\(tab, client\);[\s\S]*?webui_session_summary[\s\S]*?replayPendingExtensionUiRequests\(tab, client\)/, "SSE connections should replay extension statuses, widgets, and the tab-scoped summary before pending blockers");
|
|
2004
2045
|
assert.match(server, /pendingExtensionUiRequests: pendingExtensionUiRequestSummaries\(tab\)/, "detailed Web UI status should expose pending extension UI blockers");
|
|
2005
2046
|
assert.match(server, /resolvePendingExtensionUiRequest\(tab, payload\.id\)/, "extension UI responses should clear the pending blocker cache");
|
|
2006
2047
|
assert.match(server, /type: "webui_extension_ui_resolved"[\s\S]*?pendingExtensionUiRequestCount/, "extension UI responses should notify clients that a blocker resolved");
|
|
@@ -2095,14 +2136,15 @@ assert.match(server, /type: "set_steering_mode"/, "server should expose steering
|
|
|
2095
2136
|
assert.match(server, /type: "set_follow_up_mode"/, "server should expose follow-up queue-mode changes for native /settings");
|
|
2096
2137
|
assert.match(server, /type: "set_auto_compaction"/, "server should expose auto-compaction changes for native /settings");
|
|
2097
2138
|
assert.match(server, /@firstpick\/pi-themes-bundle/, "server should discover themes from the optional theme package");
|
|
2098
|
-
assert.match(server, /const OPTIONAL_FEATURE_PACKAGES = new Map/, "server should
|
|
2099
|
-
assert.match(
|
|
2100
|
-
assert.match(
|
|
2101
|
-
assert.match(
|
|
2102
|
-
assert.match(
|
|
2103
|
-
assert.match(
|
|
2104
|
-
assert.match(
|
|
2105
|
-
assert.match(
|
|
2139
|
+
assert.match(server, /const OPTIONAL_FEATURE_PACKAGES = new Map\(OPTIONAL_FEATURE_CATALOG/, "server should derive install allowlisting from the optional feature catalog");
|
|
2140
|
+
assert.match(optionalFeatureCatalog, /\["bangCommandAutocomplete", "@firstpick\/pi-extension-bang-command-autocomplete"/, "catalog should allow installing the bang autocomplete optional feature");
|
|
2141
|
+
assert.match(optionalFeatureCatalog, /\["fishUserBash", "@firstpick\/pi-extension-fish-user-bash"/, "catalog should allow installing the fish user-bash optional feature");
|
|
2142
|
+
assert.match(optionalFeatureCatalog, /\["btwCommand", "@firstpick\/pi-extension-btw"/, "catalog should allow installing the /btw optional feature");
|
|
2143
|
+
assert.match(optionalFeatureCatalog, /\["safetyGuard", "@firstpick\/pi-extension-safety-guard"/, "catalog should allow installing the safety guard optional feature");
|
|
2144
|
+
assert.match(optionalFeatureCatalog, /\["tuiSkillsCommand", "@firstpick\/pi-extension-setup-skills"/, "catalog should allow installing the TUI skills optional feature");
|
|
2145
|
+
assert.match(optionalFeatureCatalog, /\["tuiToolsCommand", "@firstpick\/pi-extension-tools"/, "catalog should allow installing the TUI tools optional feature");
|
|
2146
|
+
assert.match(optionalFeatureCatalog, /\["questionnaire", "@firstpick\/pi-package-questionnaire"/, "catalog should allow explicitly installing the native questionnaire optional feature");
|
|
2147
|
+
assert.match(optionalFeatureCatalog, /\["naturalConversation", "@firstpick\/pi-package-natural-conversation"/, "catalog should know the standalone Natural Conversation package for status and install guidance");
|
|
2106
2148
|
assert.match(server, /const NATURAL_CONVERSATION_COMMAND_NAMES = \["talk", "voice", "conversation"\]/, "server should detect Natural Conversation from RPC-visible command aliases");
|
|
2107
2149
|
assert.match(server, /function naturalConversationFeatureData\(tab[\s\S]*getCommandData\(tab, \{ annotateSkills: false \}\)[\s\S]*available[\s\S]*mode/, "server should expose a capability-based Natural Conversation feature snapshot");
|
|
2108
2150
|
assert.match(server, /url\.pathname === "\/api\/features\/natural-conversation" && req\.method === "GET"[\s\S]*naturalConversationFeatureData\(tab\)/, "server should expose Natural Conversation feature metadata");
|
|
@@ -2112,18 +2154,18 @@ assert.match(server, /PI_VOICE_STT_URL[\s\S]*PI_VOICE_TTS_URL[\s\S]*GROQ_API_KEY
|
|
|
2112
2154
|
assert.match(server, /function requireRemoteMicConsentForStt\(req, body = \{\}\)[\s\S]*remoteMicStreamingConsentAccepted/, "server STT fallback should require explicit remote microphone streaming consent for remote clients");
|
|
2113
2155
|
assert.match(server, /function ensureNaturalConversationPromptSafety\(tab, command\)[\s\S]*setThinkingLevelForTab\(tab, "off"/, "server should force thinking off before WebUI prompts while conversation mode is active");
|
|
2114
2156
|
assert.match(server, /function enforceNaturalConversationCommandAllowed\(tab, command\)[\s\S]*thinking is forced off[\s\S]*slash commands are blocked from the Web UI shell/, "server should block unsafe direct RPC\/WebUI commands while conversation mode is active");
|
|
2115
|
-
assert.match(server, /function
|
|
2116
|
-
assert.match(server, /function
|
|
2117
|
-
assert.match(server, /
|
|
2118
|
-
assert.match(server, /function
|
|
2119
|
-
assert.match(server, /
|
|
2120
|
-
assert.match(server, /
|
|
2121
|
-
assert.match(server, /resolveInstalledPackageSubpath\(nodeModulesRef\.packageName, nodeModulesRef\.subpath\)/, "started Web UI resource resolution should fall back to globally installed sibling optional packages");
|
|
2122
|
-
assert.match(server, /if \(webuiDevServer\) return installRoot/, "source-checkout Web UI launches should still use the checkout root for optional feature installs");
|
|
2123
|
-
assert.match(server, /Could not determine a safe optional feature install root/, "optional feature installs should fail closed when no safe package root can be found");
|
|
2157
|
+
assert.match(server, /async function topLevelOptionalFeatureResourceIndex\(cwd = options\.cwd\)[\s\S]*metadata\?\.origin === "package"[\s\S]*packageNameForResourcePath/, "server should detect enabled top-level resources by owning package");
|
|
2158
|
+
assert.match(server, /function optionalFeaturePackageStatus\(featureId, cwd = options\.cwd, topLevelResourceIndex\)[\s\S]*installed[\s\S]*configured[\s\S]*locallyConfigured[\s\S]*resourceConflict[\s\S]*ready/, "server should report package registration, top-level availability, conflicts, and readiness separately");
|
|
2159
|
+
assert.match(server, /if \(beforeStatus\.locallyConfigured\)[\s\S]*load it twice[\s\S]*local-resource-conflict/, "server should block npm registration when a top-level resource already owns the optional feature");
|
|
2160
|
+
assert.match(server, /function installOptionalFeaturePackage\(featureId, cwd = options\.cwd\)[\s\S]*const source = `npm:\$\{packageName\}`[\s\S]*resolvePiCommand\(\["install", source\]\)/, "server should install and update optional features through the selected Pi CLI");
|
|
2161
|
+
assert.match(server, /function configuredAgentNpmRoot\(\)/, "status discovery should consider Pi's agent npm root for legacy or hoisted packages");
|
|
2162
|
+
assert.match(server, /resolveInstalledPackageSubpath\(nodeModulesRef\.packageName, nodeModulesRef\.subpath\)/, "started Web UI resource resolution should support configured package resources");
|
|
2124
2163
|
assert.match(server, /url\.pathname === "\/api\/optional-features" && req\.method === "GET"/, "server should expose optional feature package status endpoint");
|
|
2125
|
-
assert.match(server, /url\.pathname === "\/api\/optional-feature-install" && req\.method === "POST"/, "server should
|
|
2126
|
-
assert.match(server, /
|
|
2164
|
+
assert.match(server, /url\.pathname === "\/api\/optional-feature-install" && req\.method === "POST"/, "server should preserve the optional feature single-install endpoint");
|
|
2165
|
+
assert.match(server, /url\.pathname === "\/api\/optional-feature-install-batch" && req\.method === "POST"[\s\S]*installOptionalFeaturePackages\(body\.featureIds, tab\.cwd\)/, "server should expose the sequential optional feature batch endpoint");
|
|
2166
|
+
assert.match(server, /function validateOptionalFeatureBatch\(featureIds\)[\s\S]*OPTIONAL_FEATURE_CATALOG\.length[\s\S]*seen\.has\(value\)/, "server batch validation should remain allowlisted, bounded, and deduplicated");
|
|
2167
|
+
assert.match(server, /async function installOptionalFeaturePackages\(featureIds, cwd = options\.cwd\)[\s\S]*for \(const featureId of requestedFeatureIds\)[\s\S]*catch \(error\)[\s\S]*succeeded[\s\S]*failed/, "server batch execution should be sequential and continue after per-feature failures");
|
|
2168
|
+
assert.match(server, /requireLocalhostRoute\(req, url\.pathname\)|requireLocalhost\(req, "Installing optional Web UI features is only allowed from localhost"\)/, "optional feature install endpoints should enforce localhost trust policy");
|
|
2127
2169
|
assert.match(server, /url\.pathname === "\/api\/skill-file" && req\.method === "GET"[\s\S]*?getSkillFileData/, "server should expose GET /api/skill-file for editable skill content");
|
|
2128
2170
|
assert.match(server, /url\.pathname === "\/api\/skill-file" && req\.method === "POST"[\s\S]*?requireLocalhostRoute\(req, url\.pathname\)[\s\S]*?saveSkillFileData/, "server should expose localhost-only POST /api/skill-file for saving skill content");
|
|
2129
2171
|
assert.match(server, /function resolveEditableSkillFile\(tab, request = \{\}\)[\s\S]*?path\.basename\(skill\.filePath\) !== "SKILL\.md"/, "skill file API should validate that edits target resolved SKILL.md resources");
|
|
@@ -2152,20 +2194,23 @@ assert.match(readme, /optional `@firstpick\/pi-extension-fish-user-bash` compani
|
|
|
2152
2194
|
assert.match(readme, /GET \/api\/path-suggestions\?tab=<tabId>&query=<path>/, "README should document the path-suggestions endpoint");
|
|
2153
2195
|
assert.match(readme, /GET \/api\/optional-features/, "README should document optional feature status endpoint");
|
|
2154
2196
|
assert.match(readme, /POST \/api\/optional-feature-install/, "README should document optional feature install endpoint");
|
|
2197
|
+
assert.match(readme, /POST \/api\/optional-feature-install-batch[\s\S]*bounded allowlisted[\s\S]*sequentially/, "README should document the bounded sequential batch endpoint");
|
|
2198
|
+
assert.match(readme, /\*\*Install all\*\*[\s\S]*\*\*Install missing\*\*[\s\S]*missing\/unregistered[\s\S]*one confirmation[\s\S]*continues after failures/, "README should document bulk control scope and partial-failure behavior");
|
|
2199
|
+
assert.match(readme, /pi install npm:@firstpick\/pi-extension-stats[\s\S]*Re-running the same `pi install npm:<package>` command is the supported update path/, "README should document separate manual Pi package installation and updates");
|
|
2155
2200
|
assert.match(readme, /server-persisted fast picks/, "README should describe server-persisted fast picks");
|
|
2156
2201
|
assert.match(readme, /`\/btw` side-question output widgets with optional context transfer\/live steering, browser notifications when a tab needs an extension UI response, and an optional side-panel toggle for agent-done notifications/, "README should describe /btw, blocked-tab, and agent-done notifications");
|
|
2157
2202
|
assert.match(readme, /blocked-tab browser notifications, and optional agent-done notifications require browser service-worker\/notification support/, "README should document notification requirements");
|
|
2158
2203
|
assert.match(readme, /Side-panel theme picker backed by optional `@firstpick\/pi-themes-bundle` themes when loaded/, "README should describe optional theme selection");
|
|
2159
2204
|
assert.match(readme, /## Optional companion packages/, "README should document optional Web UI companion packages");
|
|
2160
|
-
assert.match(readme, /
|
|
2161
|
-
assert.match(readme, /
|
|
2162
|
-
assert.match(readme, /
|
|
2163
|
-
assert.match(readme, /checks loaded Pi capabilities directly through RPC-visible commands and live widget events/, "README should document capability-based startup checks");
|
|
2164
|
-
assert.match(readme, /side panel
|
|
2165
|
-
assert.match(readme, /
|
|
2205
|
+
assert.match(readme, /Web UI tabs load enabled resources resolved from normal Pi settings/, "README should document Pi-settings-based optional feature loading");
|
|
2206
|
+
assert.match(readme, /legacy\/hoisted package files without either a Pi settings entry or an enabled top-level resource remain installable/i, "README should document migration handling for physically present but unregistered packages");
|
|
2207
|
+
assert.match(readme, /excluding the Web UI package itself from re-loading/, "README should document Web UI self-loading duplicate prevention");
|
|
2208
|
+
assert.match(readme, /checks loaded Pi capabilities directly through RPC-visible commands, tools, themes, and live widget events/, "README should document capability-based startup checks");
|
|
2209
|
+
assert.match(readme, /side panel separately reports physical installation and Pi registration/, "README should document distinct installed and registered optional feature status");
|
|
2210
|
+
assert.match(readme, /per-row \*\*Install\*\* or \*\*Update\*\* action[\s\S]*batch has one confirmation[\s\S]*bounded diagnostics/, "README should document per-row and bulk warning/result behavior");
|
|
2166
2211
|
assert.match(readme, /Natural Conversation Mode shell[\s\S]*\/talk[\s\S]*read-only/, "README should document the optional Natural Conversation WebUI shell");
|
|
2167
2212
|
assert.match(readme, /\.\/dev\/scripts\/start-webui\.sh --dev --cwd \/path\/to\/project/, "README should document the dev helper launcher");
|
|
2168
|
-
assert.match(readme, /
|
|
2213
|
+
assert.match(readme, /register that package with Pi from its absolute local path[\s\S]*resolved from Pi settings rather than the Web UI manifest/, "README should document local companion registration through Pi settings");
|
|
2169
2214
|
assert.match(startScript, /--dev\)/, "start-webui.sh should accept a --dev flag");
|
|
2170
2215
|
assert.match(startScript, /local_pi_webui_bin\(\)/, "start-webui.sh should resolve this checkout's local server entrypoint");
|
|
2171
2216
|
assert.match(startScript, /candidate="\$\(package_root\)\/bin\/pi-webui\.mjs"/, "start-webui.sh should resolve the package-root bin from dev/scripts");
|
|
@@ -2177,58 +2222,28 @@ assert.match(pkg.scripts?.test || "", /node tests\/run-all\.mjs/, "package test
|
|
|
2177
2222
|
assert.ok(!pkg.files?.includes("start-webui.sh"), "npm package should not list the moved Bash dev helper at the package root");
|
|
2178
2223
|
assert.ok(!pkg.files?.includes("start-webui.ps1"), "npm package should not list the moved PowerShell dev helper at the package root");
|
|
2179
2224
|
assert.ok(!pkg.files?.some((entry) => entry === "dev/scripts" || entry.startsWith("dev/scripts/")), "npm package should not publish development helper scripts");
|
|
2180
|
-
for (const
|
|
2181
|
-
assert.equal(pkg.optionalDependencies?.[name],
|
|
2182
|
-
assert.equal(pkg.dependencies?.[name], undefined, `webui package should not require
|
|
2183
|
-
assert.equal(lock.packages?.[""]?.optionalDependencies?.[name], range, `package-lock root should optionally depend on ${name}`);
|
|
2184
|
-
assert.equal(lock.packages?.[""]?.dependencies?.[name], undefined, `package-lock root should not promote optional companion ${name} to a required dependency`);
|
|
2185
|
-
assert.ok(lock.packages?.[`node_modules/${name}`], `package-lock should include resolved optional companion ${name}`);
|
|
2225
|
+
for (const name of Object.keys(companionDependencies)) {
|
|
2226
|
+
assert.equal(pkg.optionalDependencies?.[name], undefined, `webui package should not optionally install companion ${name}`);
|
|
2227
|
+
assert.equal(pkg.dependencies?.[name], undefined, `webui package should not require companion ${name}`);
|
|
2186
2228
|
}
|
|
2187
|
-
|
|
2188
|
-
|
|
2189
|
-
|
|
2190
|
-
|
|
2191
|
-
assert.ok(!pkg.pi?.extensions?.some((entry) => String(entry).includes("pi-extension-aur-review")), "webui Pi manifest should not bundle the unpublished aur-review path");
|
|
2192
|
-
assert.ok(!pkg.pi?.extensions?.some((entry) => String(entry).includes("pi-package-natural-conversation")), "webui Pi manifest should not load Natural Conversation directly; /talk must come from the standalone package");
|
|
2193
|
-
assert.ok(pkg.pi?.extensions?.includes("./index.ts"), "webui Pi manifest should load its own extension");
|
|
2194
|
-
for (const extensionPath of [
|
|
2195
|
-
"node_modules/@firstpick/pi-extension-bang-command-autocomplete/index.ts",
|
|
2196
|
-
"node_modules/@firstpick/pi-extension-fish-user-bash/index.ts",
|
|
2197
|
-
"node_modules/@firstpick/pi-extension-git-footer-status/index.ts",
|
|
2198
|
-
"node_modules/@firstpick/pi-extension-release-aur/index.ts",
|
|
2199
|
-
"node_modules/@firstpick/pi-extension-release-npm/index.ts",
|
|
2200
|
-
"node_modules/@firstpick/pi-extension-safety-guard/index.ts",
|
|
2201
|
-
"node_modules/@firstpick/pi-extension-setup-skills/index.ts",
|
|
2202
|
-
"node_modules/@firstpick/pi-extension-stats/index.ts",
|
|
2203
|
-
"node_modules/@firstpick/pi-extension-todo-progress/index.ts",
|
|
2204
|
-
"node_modules/@firstpick/pi-extension-tools/index.ts",
|
|
2205
|
-
]) {
|
|
2206
|
-
assert.ok(pkg.pi?.extensions?.includes(extensionPath), `webui Pi manifest should load ${extensionPath} when present`);
|
|
2207
|
-
}
|
|
2208
|
-
for (const siblingExtensionPath of [
|
|
2209
|
-
"../pi-extension-bang-command-autocomplete/index.ts",
|
|
2210
|
-
"../pi-extension-fish-user-bash/index.ts",
|
|
2211
|
-
"../pi-extension-git-footer-status/index.ts",
|
|
2212
|
-
"../pi-extension-release-aur/index.ts",
|
|
2213
|
-
"../pi-extension-release-npm/index.ts",
|
|
2214
|
-
"../pi-extension-safety-guard/index.ts",
|
|
2215
|
-
"../pi-extension-setup-skills/index.ts",
|
|
2216
|
-
"../pi-extension-stats/index.ts",
|
|
2217
|
-
"../pi-extension-todo-progress/index.ts",
|
|
2218
|
-
"../pi-extension-tools/index.ts",
|
|
2229
|
+
for (const name of [
|
|
2230
|
+
"@firstpick/pi-package-natural-conversation",
|
|
2231
|
+
"@firstpick/pi-package-questionnaire",
|
|
2232
|
+
"@firstpick/pi-extension-aur-review",
|
|
2219
2233
|
]) {
|
|
2220
|
-
assert.
|
|
2234
|
+
assert.equal(pkg.optionalDependencies?.[name], undefined, `webui package should keep ${name} as a separate Pi package`);
|
|
2235
|
+
assert.equal(pkg.dependencies?.[name], undefined, `webui package should not require separate Pi package ${name}`);
|
|
2221
2236
|
}
|
|
2237
|
+
assert.deepEqual(pkg.optionalDependencies, { "node-pty": "^1.1.0" }, "node-pty should be the sole optional Web UI runtime dependency");
|
|
2238
|
+
assert.equal(pkg.bundledDependencies, undefined, "webui optional companion packages should not be bundled into the tarball");
|
|
2239
|
+
assert.deepEqual(pkg.pi?.extensions, ["./index.ts", "./session-summary.ts"], "webui Pi manifest should load its core and focused session-summary extensions");
|
|
2240
|
+
assert.equal(pkg.pi?.skills, undefined, "webui Pi manifest should not own companion skills");
|
|
2241
|
+
assert.equal(pkg.pi?.prompts, undefined, "webui Pi manifest should not own companion prompts");
|
|
2242
|
+
assert.equal(pkg.pi?.themes, undefined, "webui Pi manifest should not own companion themes");
|
|
2222
2243
|
assert.match(helper, /function installRpcUserBashSupport\(\)/, "Web UI RPC helper should patch RPC bash execution for user_bash events");
|
|
2223
2244
|
assert.match(helper, /runner\?\.hasHandlers\?\.\("user_bash"\)[\s\S]*runner\.emitUserBash/, "Web UI RPC helper should emit user_bash before default bash execution");
|
|
2224
2245
|
assert.match(helper, /eventResult\?\.operations[\s\S]*original\.call\(this, command, onChunk, nextOptions\)/, "Web UI RPC helper should pass extension-provided bash operations to Pi execution");
|
|
2225
2246
|
assert.match(helper, /eventResult\?\.result[\s\S]*recordBashResult/, "Web UI RPC helper should preserve extension-provided bash results in session history");
|
|
2226
|
-
assert.ok(pkg.pi?.skills?.includes("node_modules/@firstpick/pi-extension-release-aur/skills"), "webui Pi manifest should load release-aur nested skills when present");
|
|
2227
|
-
assert.ok(!pkg.pi?.skills?.includes("../pi-extension-release-aur/skills"), "webui Pi manifest should avoid duplicate release-aur sibling skills");
|
|
2228
|
-
assert.ok(pkg.pi?.prompts?.includes("node_modules/@firstpick/pi-prompts-git-pr/prompts"), "webui Pi manifest should load guided-git nested prompts when present");
|
|
2229
|
-
assert.ok(!pkg.pi?.prompts?.includes("../pi-package-prompts-git-pr/prompts"), "webui Pi manifest should avoid duplicate guided-git sibling prompts");
|
|
2230
|
-
assert.ok(pkg.pi?.themes?.includes("node_modules/@firstpick/pi-themes-bundle/themes"), "webui Pi manifest should load nested bundled themes when present");
|
|
2231
|
-
assert.ok(!pkg.pi?.themes?.includes("../pi-package-themes-bundle/themes"), "webui Pi manifest should avoid duplicate sibling bundled themes");
|
|
2232
2247
|
assert.ok(pkg.scripts?.check?.includes("node --check public/app.js"), "check script should syntax-check app.js");
|
|
2233
2248
|
assert.ok(pkg.scripts?.check?.includes("node tests/run-all.mjs"), "check script should run the shared test runner");
|
|
2234
2249
|
|
|
@@ -46,6 +46,8 @@ assert.throws(() => requireLocalhostRoute(remoteReq, "/api/component-update"), (
|
|
|
46
46
|
assert.doesNotThrow(() => requireLocalhostRoute(localReq, "/api/update"));
|
|
47
47
|
assert.doesNotThrow(() => requireLocalhostRoute(localReq, "/api/component-update"));
|
|
48
48
|
assert.ok(LOCALHOST_ONLY_POST_ROUTES.has("/api/workflow-policy"), "workflow policy mutation must stay in the canonical localhost route registry");
|
|
49
|
+
assert.equal(LOCALHOST_ONLY_POST_ROUTES.has("/api/session-summary/preferences"), false, "authenticated remote clients are allowed to save summary setup after confirmation");
|
|
50
|
+
assert.equal(LOCALHOST_ONLY_POST_ROUTES.has("/api/session-summary/generate"), false, "authenticated remote clients are allowed to trigger summary generation");
|
|
49
51
|
|
|
50
52
|
for (const pathname of LOCALHOST_ONLY_POST_ROUTES.keys()) {
|
|
51
53
|
assert.match(pathname, /^\/api\//, `${pathname} should be an API route`);
|
|
@@ -57,6 +59,12 @@ for (const guard of parity.guardTaxonomy) {
|
|
|
57
59
|
|
|
58
60
|
const exportGuards = guardsForNativeCommand("export", parity);
|
|
59
61
|
assert.ok(exportGuards.includes("localhost"), "export should declare localhost guard in parity matrix");
|
|
62
|
+
for (const command of ["summary", "summary-setup"]) {
|
|
63
|
+
const guards = guardsForNativeCommand(command, parity);
|
|
64
|
+
assert.deepEqual(guards, ["confirmation"], `/${command} should require disclosure confirmation but remain available to authenticated remote clients`);
|
|
65
|
+
assert.equal(evaluateDispatchTrustGuards(guards, { isLocal: false, confirmed: false, networkOpen: true }).allowed, true, `/${command} transport dispatch should not add a localhost-only block`);
|
|
66
|
+
assert.equal(evaluateTrustGuards(guards, { isLocal: false, confirmed: false, networkOpen: true }).allowed, false, `/${command} full evaluation should require confirmation`);
|
|
67
|
+
}
|
|
60
68
|
|
|
61
69
|
const exportDispatchLocal = evaluateDispatchTrustGuards(exportGuards, { isLocal: true, confirmed: false });
|
|
62
70
|
const exportDispatchRemote = evaluateDispatchTrustGuards(exportGuards, { isLocal: false, confirmed: false, networkOpen: true });
|
|
@@ -132,7 +140,7 @@ for (const target of ["state", "tabs", "commands", "themes", "workspace"]) {
|
|
|
132
140
|
}
|
|
133
141
|
|
|
134
142
|
const slashCommands = nativeSlashCommandEntries(parity);
|
|
135
|
-
assert.equal(slashCommands.length,
|
|
143
|
+
assert.equal(slashCommands.length, 29);
|
|
136
144
|
assert.equal(slashCommands[0].name, "settings");
|
|
137
145
|
assert.equal(slashCommands.at(-1).name, "quit");
|
|
138
146
|
|