@firstpick/pi-package-webui 0.9.2 → 0.9.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 +14 -8
- package/bin/pi-webui.mjs +256 -39
- package/index.ts +266 -1
- package/lib/git-workflow-preferences.mjs +8 -25
- package/lib/intercom-conversations.mjs +491 -0
- package/lib/intercom-transcript-filter.mjs +99 -0
- package/lib/resource-selection.mjs +140 -0
- package/package.json +2 -2
- package/public/app.js +1061 -119
- package/public/index.html +31 -6
- package/public/service-worker.js +2 -1
- package/public/stream-output-controller.mjs +15 -0
- package/public/styles.css +426 -1
- package/public/syntax-highlight.mjs +622 -0
- package/tests/boot-failure-diagnostics.test.mjs +3 -3
- package/tests/browser/interaction-continuity.spec.mjs +34 -0
- package/tests/browser/intercom-conversation-viewer.spec.mjs +357 -0
- package/tests/browser/persistent-ui-layout.spec.mjs +61 -0
- package/tests/browser/resource-profiles.spec.mjs +200 -0
- package/tests/browser/subagent-observability.spec.mjs +29 -0
- package/tests/codex-fast-mode-static.test.mjs +7 -6
- package/tests/common-options-submenus-interaction-static.test.mjs +2 -0
- package/tests/common-options-submenus-markup-static.test.mjs +1 -0
- package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
- package/tests/composer-skill-tag-layout.test.mjs +32 -2
- package/tests/control-deck-component-updates-static.test.mjs +4 -0
- package/tests/controls-layout-static.test.mjs +3 -3
- package/tests/fast-mode-client-static.test.mjs +2 -2
- package/tests/feature-decision-output-popup-static.test.mjs +2 -2
- package/tests/feature-system-prompt-optional-feature-static.test.mjs +5 -5
- package/tests/file-viewer-image-static.test.mjs +69 -0
- package/tests/fixtures/fake-pi.mjs +105 -6
- package/tests/foreground-transcript-catch-up-static.test.mjs +1 -1
- package/tests/git-panel-file-preview-static.test.mjs +5 -5
- package/tests/git-panel-live-updates-static.test.mjs +3 -3
- package/tests/git-workflow-preferences.test.mjs +4 -4
- package/tests/http-endpoints-harness.test.mjs +124 -2
- package/tests/intercom-conversation-viewer-static.test.mjs +106 -0
- package/tests/intercom-conversations-http.test.mjs +252 -0
- package/tests/intercom-conversations.test.mjs +374 -0
- package/tests/intercom-main-transcript-suppression-static.test.mjs +52 -0
- package/tests/intercom-tag-layout-static.test.mjs +46 -0
- package/tests/intercom-transcript-filter.test.mjs +98 -0
- package/tests/main-output-loading-static.test.mjs +59 -0
- package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
- package/tests/mobile-compact-layout.test.mjs +2 -3
- package/tests/mobile-continuity-tablet-static.test.mjs +6 -6
- 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 +66 -42
- package/tests/native-parity.test.mjs +8 -7
- package/tests/open-issue-wizard-static.test.mjs +1 -1
- package/tests/optional-feature-migration-frontend.test.mjs +5 -5
- package/tests/optional-feature-resource-setup-static.test.mjs +29 -0
- package/tests/persistent-ui-layout-static.test.mjs +3 -3
- package/tests/questionnaire-dialog.test.mjs +3 -3
- package/tests/remote-auth-settings-harness.test.mjs +1 -1
- package/tests/resource-defaults-helper.test.mjs +60 -6
- package/tests/resource-selection.test.mjs +114 -0
- package/tests/resource-tui-extension.test.mjs +23 -0
- package/tests/session-sampling-ui-static.test.mjs +3 -3
- package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
- package/tests/stream-output-controller.test.mjs +8 -0
- package/tests/stream-output-isolation-static.test.mjs +2 -2
- package/tests/streaming-ui-coupling.test.mjs +5 -0
- package/tests/subagent-gate-visibility.test.mjs +1 -1
- package/tests/subagent-launch-slots.test.mjs +1 -1
- package/tests/subagent-observability-static.test.mjs +5 -3
- package/tests/subagent-reliability-integration.test.mjs +23 -1
- package/tests/subagent-workflow-section-static.test.mjs +67 -0
- package/tests/subagents-helper.test.mjs +313 -1
- package/tests/syntax-highlight.test.mjs +235 -0
- package/tests/syntax-highlighting-static.test.mjs +84 -0
- package/tests/terminal-cwd-grouping-static.test.mjs +22 -0
- package/tests/theme-customizer-static.test.mjs +5 -5
- package/tests/thinking-format-parser.test.mjs +64 -0
- package/tests/webui-settings-locking.test.mjs +1 -1
- package/webui-rpc-helper.mjs +417 -74
|
@@ -16,9 +16,9 @@ assert.match(app, /import \{ installMiddleButtonDragScroll \} from "\.\/middle-b
|
|
|
16
16
|
assert.match(app, /installMiddleButtonDragScroll\(\{[\s\S]*onDirection: \(\{ target, offsetY \}\)[\s\S]*noteChatUserScrollIntent\(\{ type: "middle-drag", deltaY: offsetY \}\)/, "chat auto-scroll direction should feed the existing follow/pause intent state");
|
|
17
17
|
assert.match(app, /event\?\.type === "middle-drag"\) return event\.deltaY > 0;/, "moving below the press point should be recognized as intent to read later chat output");
|
|
18
18
|
assert.match(css, /body\.middle-button-auto-scrolling,[\s\S]*cursor: all-scroll !important;[\s\S]*user-select: none !important;/, "active automatic scrolling should expose a directional-scroll affordance and suppress accidental selection");
|
|
19
|
-
assert.match(html, /styles\.css\?v=
|
|
20
|
-
assert.match(html, /app\.js\?v=
|
|
21
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
19
|
+
assert.match(html, /styles\.css\?v=126/, "changed drag-scroll styles should advance the stylesheet revision");
|
|
20
|
+
assert.match(html, /app\.js\?v=148/, "changed drag-scroll wiring should advance the app revision");
|
|
21
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112";[\s\S]*"\/middle-button-drag-scroll\.mjs"/, "offline PWA installs should refresh and cache the new controller module");
|
|
22
22
|
assert.match(JSON.parse(packageJson).scripts.check, /node --check public\/middle-button-drag-scroll\.mjs/, "the package check should parse the startup-critical controller module");
|
|
23
23
|
|
|
24
24
|
console.log("middle-button-drag-scroll-static.test.mjs passed");
|
|
@@ -4,11 +4,10 @@ import { dirname, join } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
-
const [html, css, app,
|
|
7
|
+
const [html, css, app, technical] = await Promise.all([
|
|
8
8
|
readFile(join(root, "public", "index.html"), "utf8"),
|
|
9
9
|
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
10
10
|
readFile(join(root, "public", "app.js"), "utf8"),
|
|
11
|
-
readFile(join(root, "README.md"), "utf8"),
|
|
12
11
|
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
13
12
|
]);
|
|
14
13
|
|
|
@@ -54,7 +53,7 @@ assert.match(app, /function isSidePanelSectionReorderingEnabled\(\) \{\n\s+retur
|
|
|
54
53
|
assert.match(css, /\.side-panel-edit-button \{\n\s+display:\s*none;[\s\S]*?\.side-panel-section-toggle\[data-side-panel-section-toggle\] \{\n\s+cursor:\s*pointer;\n\s+touch-action:\s*manipulation;[\s\S]*?\.side-panel\.section-edit-mode \.side-panel-section-toggle\[data-side-panel-section-toggle\] \{[\s\S]*?cursor:\s*grab;[\s\S]*?touch-action:\s*none;[\s\S]*?@media \(max-width: 720px\), \(max-device-width: 720px\), \(pointer: coarse\) and \(hover: none\) \{[\s\S]*?\.side-panel-edit-button \{ display:\s*inline-flex;/, "desktop should hide Edit while mobile restores it and switches section headers to drag capture in Edit mode");
|
|
55
54
|
assert.match(css, /body\.mobile-composer-disclosure\.mobile-keyboard-open \.composer-row \{[\s\S]*?repeat\(4,[\s\S]*?body\.mobile-composer-disclosure\.mobile-keyboard-open \.composer-actions-button,[\s\S]*?display:\s*none !important/, "keyboard-open mode should retain primary controls and suppress secondary chrome");
|
|
56
55
|
|
|
57
|
-
assert.match(
|
|
56
|
+
assert.match(technical, /On a phone, tap the current terminal name to open full-screen terminal navigation[\s\S]*Grouped terminals use their title as a dropdown[\s\S]*Tap \*\*More\*\*[\s\S]*Git footer \*\*Details\*\* opens full-screen[\s\S]*Hover-only tooltips stay hidden[\s\S]*tap \*\*Edit\*\*[\s\S]*tap \*\*Done\*\*/, "technical reference should explain the full-screen mobile paths and explicit Control Deck editing");
|
|
58
57
|
assert.match(technical, /## Mobile layout[\s\S]*open full-screen terminal navigation[\s\S]*regular or subagent terminal-group title is a dropdown button[\s\S]*Git footer \*\*Details\*\* opens as a full-screen legacy-mobile overlay[\s\S]*Tap \*\*More\*\* to open[\s\S]*accessible top-right `−` control[\s\S]*Control Deck section reordering is always enabled on desktop[\s\S]*`Alt\+ArrowUp` \/ `Alt\+ArrowDown`[\s\S]*Mobile keeps the transient \*\*Edit\*\* \/ \*\*Done\*\* mode[\s\S]*Touch pointers do not schedule hover-only tooltips[\s\S]*Tablet layout, desktop tab placement/, "technical reference should document always-on desktop reordering and transient mobile Edit mode");
|
|
59
58
|
|
|
60
59
|
console.log("mobile compact layout contracts passed");
|
|
@@ -4,12 +4,12 @@ import { dirname, join } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
-
const [app, html, css, serviceWorker,
|
|
7
|
+
const [app, html, css, serviceWorker, technical] = await Promise.all([
|
|
8
8
|
readFile(join(root, "public", "app.js"), "utf8"),
|
|
9
9
|
readFile(join(root, "public", "index.html"), "utf8"),
|
|
10
10
|
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
11
|
readFile(join(root, "public", "service-worker.js"), "utf8"),
|
|
12
|
-
readFile(join(root, "
|
|
12
|
+
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
13
13
|
]);
|
|
14
14
|
|
|
15
15
|
assert.match(app, /MOBILE_CONTINUITY_STORAGE_KEY = "pi-webui-mobile-continuity-v1"/, "continuity state must be browser-scoped and versioned");
|
|
@@ -47,9 +47,9 @@ assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-nav[\s\S]*?widt
|
|
|
47
47
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.mobile-shell-surface[\s\S]*?width: min\(30rem, 72vw\)/, "tablet inspector must be a bounded right-side sheet");
|
|
48
48
|
assert.match(css, /html\[data-tablet-shell="v2"\] \.file-viewer-pane[\s\S]*?position: fixed[\s\S]*?inset: 0/, "tablet files must default to full-screen replacement");
|
|
49
49
|
assert.match(css, /and \(pointer: coarse\)[\s\S]*?min-height: 44px/, "coarse tablet pointers must retain the 44px target floor");
|
|
50
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
51
|
-
assert.match(html, /styles\.css\?v=
|
|
52
|
-
assert.match(html, /app\.js\?v=
|
|
53
|
-
assert.match(
|
|
50
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112"/, "continuity/tablet assets need a coherent cache identity");
|
|
51
|
+
assert.match(html, /styles\.css\?v=126/, "tablet CSS must have a coherent HTML revision");
|
|
52
|
+
assert.match(html, /app\.js\?v=148/, "continuity app logic must have a coherent HTML revision");
|
|
53
|
+
assert.match(technical, /tabletShell=v2[\s\S]*tabletShell=legacy/, "technical reference should document tablet preview and rollback");
|
|
54
54
|
|
|
55
55
|
console.log("mobile-continuity-tablet-static.test.mjs passed");
|
|
@@ -37,9 +37,9 @@ assert.match(pkg.scripts.check, /node --check public\/transcript-renderer\.mjs/,
|
|
|
37
37
|
assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server must serve typed startup modules from the public asset boundary");
|
|
38
38
|
assert.match(serviceWorker, /"\/mobile-shell-state\.mjs"/, "the PWA shell must cache the new startup module");
|
|
39
39
|
assert.match(serviceWorker, /"\/transcript-renderer\.mjs"/, "the PWA shell must cache the transcript startup module");
|
|
40
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
41
|
-
assert.match(html, /styles\.css\?v=
|
|
42
|
-
assert.match(html, /app\.js\?v=
|
|
40
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112"/, "the cache identity must change with the startup graph");
|
|
41
|
+
assert.match(html, /styles\.css\?v=126/, "the stylesheet revision must change with mobile/tablet CSS fixes");
|
|
42
|
+
assert.match(html, /app\.js\?v=148/, "the app revision must change with continuity/tablet wiring");
|
|
43
43
|
assert.match(serviceWorker, /const APP_SHELL_NETWORK_TIMEOUT_MS = 8_000;[\s\S]*?event\.waitUntil\([\s\S]*?cache\.put\(request, response\.clone\(\)\)[\s\S]*?return networkResponse;/, "runtime cache writes must extend the event lifetime without blocking bounded network responses");
|
|
44
44
|
assert.match(serviceWorker, /MOBILE_NAVIGATION_MESSAGE_TYPE = "pi-webui:navigate:v1"/, "the service worker must use a versioned active-client navigation message");
|
|
45
45
|
assert.match(serviceWorker, /client\.postMessage\(\{ type: MOBILE_NAVIGATION_MESSAGE_TYPE, target \}\)/, "existing clients must receive only a validated target message");
|
|
@@ -60,6 +60,6 @@ assert.match(css, /data-mobile-presentation="essential"/, "Essential presentatio
|
|
|
60
60
|
assert.match(css, /html\[data-mobile-shell="v2"\] body\.mobile-keyboard-open \.widget-area,[\s\S]*?\.composer-actions-button \{ display: block !important; \}/, "v2 keyboard mode must keep run widgets and the actions entry available");
|
|
61
61
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)/, "reduced-motion behavior is required");
|
|
62
62
|
assert.match(css, /@media \(forced-colors: active\)/, "forced-color affordances are required");
|
|
63
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
63
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112"/, "browser asset changes need a coherent cache tuple");
|
|
64
64
|
|
|
65
65
|
console.log("mobile-phone-experience-static.test.mjs passed");
|
|
@@ -5,7 +5,7 @@ import { dirname, join } from "node:path";
|
|
|
5
5
|
import { fileURLToPath } from "node:url";
|
|
6
6
|
|
|
7
7
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
8
|
-
const [pkgRaw, html, css, app, server, extension, readme, startScript, manifestRaw, serviceWorker, appleIcon, icon192, icon512, matrixBackground, mochaBackground] = await Promise.all([
|
|
8
|
+
const [pkgRaw, html, css, app, server, extension, readme, technical, development, startScript, manifestRaw, serviceWorker, appleIcon, icon192, icon512, matrixBackground, mochaBackground] = await Promise.all([
|
|
9
9
|
readFile(join(root, "package.json"), "utf8"),
|
|
10
10
|
readFile(join(root, "public", "index.html"), "utf8"),
|
|
11
11
|
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
@@ -13,6 +13,8 @@ const [pkgRaw, html, css, app, server, extension, readme, startScript, manifestR
|
|
|
13
13
|
readFile(join(root, "bin", "pi-webui.mjs"), "utf8").then((value) => value.replace(/\r\n/g, "\n")),
|
|
14
14
|
readFile(join(root, "index.ts"), "utf8"),
|
|
15
15
|
readFile(join(root, "README.md"), "utf8"),
|
|
16
|
+
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
17
|
+
readFile(join(root, "DEVELOPMENT.md"), "utf8"),
|
|
16
18
|
readFile(join(root, "dev", "scripts", "start-webui.sh"), "utf8"),
|
|
17
19
|
readFile(join(root, "public", "manifest.webmanifest"), "utf8"),
|
|
18
20
|
readFile(join(root, "public", "service-worker.js"), "utf8"),
|
|
@@ -109,10 +111,10 @@ assert.match(html, /id="optionsSafetyGuardSetupButton"[\s\S]*data-command="\/saf
|
|
|
109
111
|
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");
|
|
110
112
|
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
113
|
assert.match(app, /function createTerminalTabSessionSummaryButton\(tab\)[\s\S]*hasAvailableCommand\("summary", \{ tabId: tab\.id \}\)[\s\S]*setAttribute\("aria-busy"[\s\S]*openSessionSummaryForTab\(tab\.id, \{ focusReturnKey:/, "each terminal tab summary action should use that tab's command catalog, busy state, focus restoration, and direct target");
|
|
112
|
-
assert.match(app, /function renderTerminalTab\(tab\)[\s\S]*createTerminalTabActions\(tab\)[\s\S]*function renderTerminalTabGroupItem\(tab, group\)[\s\S]*createTerminalTabActions\(tab\)/, "regular and grouped Pi terminal tabs should render shared per-tab split and summary actions");
|
|
114
|
+
assert.match(app, /function renderTerminalTab\(tab, \{ showCwdAdd = false \} = \{\}\)[\s\S]*createTerminalTabActions\(tab\)[\s\S]*function renderTerminalTabGroupItem\(tab, group\)[\s\S]*createTerminalTabActions\(tab\)/, "regular and grouped Pi terminal tabs should render shared per-tab split and summary actions");
|
|
113
115
|
assert.match(app, /function createTerminalTabActions\(tab\)[\s\S]*createTerminalTabSplitButton\(tab\)[\s\S]*createTerminalTabSessionSummaryButton\(tab\)/, "each terminal action slot should place Split beside Summary");
|
|
114
116
|
assert.match(app, /function terminalTabControlKey\(node\)[\s\S]*terminal-tab-split-button[\s\S]*terminal-tab:\$\{tabId\}:split[\s\S]*terminal-tab-summary-button[\s\S]*terminal-tab:\$\{tabId\}:summary/, "per-tab split and summary actions should retain stable focus continuity keys");
|
|
115
|
-
assert.match(app, /\.terminal-tab-close, \.terminal-tab-actions, \.terminal-tab-group-add/, "per-tab actions should not initiate terminal-tab dragging");
|
|
117
|
+
assert.match(app, /\.terminal-tab-close, \.terminal-tab-actions, \.terminal-tab-cwd-add, \.terminal-tab-group-add/, "per-tab actions should not initiate terminal-tab dragging");
|
|
116
118
|
assert.match(app, /function prefetchInactiveTabCommandCatalogs\(\)[\s\S]*refreshCommands\(activeTabContext\(tab\.id\)\)[\s\S]*function refreshTabs[\s\S]*prefetchInactiveTabCommandCatalogs\(\)/, "restored inactive tabs should fetch their own command catalogs without activation");
|
|
117
119
|
assert.match(app, /const focusReturnKey = sessionSummaryOverlayFocusReturnKey[\s\S]*querySelectorAll\("button"\)[\s\S]*terminalTabControlKey\(node\) === focusReturnKey/, "summary overlay focus restoration should resolve rerendered per-tab controls by continuity key");
|
|
118
120
|
assert.match(app, /sessionSummaryOverlayFocusReturnKey = focusReturnKey \|\| terminalTabControlKey\(sessionSummaryOverlayFocusReturn\)/, "summary overlay opening should preserve an explicit per-tab focus key or capture the active control key");
|
|
@@ -194,13 +196,13 @@ assert.match(css, /\.git-side-panel-repository[\s\S]*\.git-side-panel-file[\s\S]
|
|
|
194
196
|
assert.match(server, /async function readGitPanel\(cwd\)[\s\S]*GIT_PANEL_HISTORY_LIMIT[\s\S]*"status", "--porcelain=v1", "-z"[\s\S]*"--numstat", "-z"/, "server should build compact bounded local Git snapshots without full file contents");
|
|
195
197
|
assert.match(server, /async function readGitCommit\(cwd, requestedHash\)[\s\S]*\^\[a-f0-9\][\s\S]*"show", "--format="/, "commit inspection should require a full hash and use a bounded read-only Git show");
|
|
196
198
|
assert.match(server, /"\/api\/git-changes\/stage-all"[\s\S]*stageAllGitChanges[\s\S]*"\/api\/git-changes\/unstage-all"[\s\S]*unstageAllGitChanges/, "server should expose repository-wide stage and unstage mutations");
|
|
197
|
-
assert.match(
|
|
199
|
+
assert.match(technical, /side-panel \*\*Git\*\* section[\s\S]*five-minute cache window[\s\S]*confirmed discard\/delete actions[\s\S]*latest 30 commits/, "technical reference should document Git panel grouping, refresh, actions, and history behavior");
|
|
198
200
|
assert.match(html, /id="optionalFeaturesBox"/, "side panel should expose optional feature status and controls");
|
|
199
201
|
assert.match(html, /class="optional-features-description[\s\S]*href="https:\/\/github\.com\/Firstp1ck\/pi-coding-agent-forge\/issues\/new"[\s\S]*open a GitHub issue/, "optional features should link users to GitHub issues for additional feature requests");
|
|
200
202
|
assert.doesNotMatch(html, /id="btwOverlayDialog"/, "/btw should not use a blocking modal overlay");
|
|
201
203
|
assert.match(html, /id="codexUsageBox"/, "side panel should expose Codex subscription usage status");
|
|
202
204
|
assert.match(html, /data-side-panel-section="codex-usage"/, "Codex usage should live in a collapsible side-panel section");
|
|
203
|
-
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]
|
|
205
|
+
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]*Managed and registered Pi agent runs appear here[\s\S]*External agents[\s\S]*id="subagentsBox"/, "side panel should explain managed and registered agent visibility with a live count");
|
|
204
206
|
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");
|
|
205
207
|
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");
|
|
206
208
|
const subagentCancelDialogHtml = html.match(/<dialog id="subagentCancelDialog"[\s\S]*?<\/dialog>/)?.[0] || "";
|
|
@@ -265,7 +267,7 @@ assert.deepEqual(Object.fromEntries(Object.entries(telemetryCardElements).map(([
|
|
|
265
267
|
}, "terminal telemetry cards should render only normalized telemetry values");
|
|
266
268
|
assert.match(css, /\.subagent-terminal-card-list\s*\{[\s\S]*?display:\s*grid;[\s\S]*?grid-template-columns:\s*repeat\(auto-fit,\s*minmax\(/, "telemetry cards should wrap responsively through a grid rather than require a fixed row");
|
|
267
269
|
assert.match(css, /@media\s*\([^)]*max-width[^)]*\)\s*\{[\s\S]*?\.subagent-terminal-card-list\s*\{[\s\S]*?grid-template-columns:\s*minmax\(0,\s*1fr\)/, "narrow viewports should collapse telemetry cards without horizontal overflow");
|
|
268
|
-
assert.match(
|
|
270
|
+
assert.match(technical, /exactly six telemetry cards: PI, measured token speed, context, model, effort, and input\/output tokens from a bounded recent session scan[\s\S]*Unavailable or legacy evidence remains `—` or `unknown` rather than being estimated/, "technical reference should document each subagent telemetry card, bounded scan scope, and honest unknown behavior");
|
|
269
271
|
assert.doesNotMatch(html, /id="subagentOverlayDialog"/, "subagent output should not use a blocking modal dialog");
|
|
270
272
|
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");
|
|
271
273
|
assert.match(html, /data-side-panel-section="sampling"[\s\S]*class="side-panel-section-label">Sampling parameters<\/span>[\s\S]*id="samplingParametersSupport"[\s\S]*id="samplingParametersControls"[\s\S]*id="samplingParametersPreserved"[\s\S]*id="applySamplingParametersButton"[\s\S]*id="resetSamplingParametersButton"[\s\S]*id="samplingParametersStatus"/, "Sampling parameters should be a labelled side-panel section with native controls, hidden-key preservation status, apply/reset actions, and live status");
|
|
@@ -1075,7 +1077,7 @@ assert.match(server, /async function closeNetworkAccess\(\)/, "server should exp
|
|
|
1075
1077
|
assert.match(server, /url\.pathname === "\/api\/network\/close" && req\.method === "POST"/, "server should route network close requests");
|
|
1076
1078
|
assert.match(server, /server\.closeAllConnections\?\.\(\)/, "network rebind should force-close long-lived clients so close-to-localhost can complete");
|
|
1077
1079
|
assert.match(server, /connection: "close"/, "network rebind API responses should not hold keep-alive sockets open");
|
|
1078
|
-
assert.match(
|
|
1080
|
+
assert.match(technical, /toggles to "Close for network"/, "technical reference should document the close-network toggle");
|
|
1079
1081
|
assert.match(app, /window\.visualViewport/, "app should listen to VisualViewport for keyboard/viewport updates");
|
|
1080
1082
|
assert.match(html, /<textarea id="promptInput"[^>]*autofocus/, "prompt composer should autofocus for new Web UI/app launches");
|
|
1081
1083
|
assert.match(app, /function syncMobileChatToBottomForInput\(\)/, "mobile input focus should force the output view to the latest message");
|
|
@@ -1147,7 +1149,8 @@ assert.match(app, /async function refreshQuestionnaireFeatureAvailability[\s\S]*
|
|
|
1147
1149
|
assert.match(app, /async function setToolManagedOptionalFeatureEnabled\(feature, enabled\)[\s\S]*\/api\/tools\?scope=session[\s\S]*enabledTools[\s\S]*scope: "session"[\s\S]*\/api\/tools/, "the questionnaire row toggle should update the active session tool allowlist while preserving other tool states");
|
|
1148
1150
|
assert.match(app, /detected && feature\.manageWith === "tools"[\s\S]*action\.textContent = enabled \? "Disable" : "Enable"[\s\S]*setToolManagedOptionalFeatureEnabled/, "loaded questionnaire access should expose a dedicated enable or disable action");
|
|
1149
1151
|
assert.match(app, /if \(detected && feature\.setup\)[\s\S]*"optional-feature-action setup", "Setup"[\s\S]*openOptionalFeatureSetup/, "detected configurable optional features should expose a separate Setup action");
|
|
1150
|
-
assert.match(app, /case "
|
|
1152
|
+
assert.match(app, /case "skills": return openNativeSkillsSelector\(\)/, "TUI Skills command Setup should open the browser-native Skills Setup dialog");
|
|
1153
|
+
assert.match(app, /case "tools": return openNativeToolsSelector\(\)/, "TUI Tools command Setup should open the browser-native Tools Setup dialog");
|
|
1151
1154
|
assert.match(app, /function setSidePanelSectionCollapsed\(record, collapsed/, "side panel sections should have explicit collapse/expand behavior");
|
|
1152
1155
|
assert.match(
|
|
1153
1156
|
app,
|
|
@@ -1166,9 +1169,29 @@ assert.match(
|
|
|
1166
1169
|
);
|
|
1167
1170
|
assert.match(app, /function renderCodexUsage\(\)/, "frontend should render Codex usage buckets in the side panel");
|
|
1168
1171
|
assert.match(app, /function renderSubagents\(\)[\s\S]*subagentTabsWithRunningAgents\(\)[\s\S]*totalGates[\s\S]*renderSubagentTabGroup\(tab\)/, "frontend should group running subagents and retained retry gates by terminal and session");
|
|
1169
|
-
assert.match(app, /function renderSubagents\(\)[\s\S]*
|
|
1172
|
+
assert.match(app, /function renderSubagents\(\)[\s\S]*activeTabs\.reduce\(\(count, tab\) => count \+ Number\(tab\.runningAgents \|\| 0\), 0\)[\s\S]*subagentCountBadge\.textContent = String\(totalAgents\)/, "the subagent count badge should derive visible agent totals without counting workflow containers or retry-gated attempts twice");
|
|
1173
|
+
const workflowControllerSource = appFunctionSource("subagentIsWorkflowController", "subagentCapabilities");
|
|
1174
|
+
const workflowRenderSource = appFunctionSource("renderSubagentWorkflow", "renderSubagentAgent");
|
|
1170
1175
|
const compactSubagentAgentSource = appFunctionSource("renderSubagentAgent", "renderSubagentRun");
|
|
1171
1176
|
const compactSubagentRunSource = appFunctionSource("renderSubagentRun", "subagentGateStatusLabel");
|
|
1177
|
+
assert.match(workflowControllerSource, /name \|\| ""[\s\S]*launcher === "pi-subagents"[\s\S]*function subagentRunAgents[\s\S]*function subagentRunAgentCounts/, "pi-subagents workflow controllers should be recognized separately from model-powered agents and excluded from agent counts");
|
|
1178
|
+
const workflowCountContext = {
|
|
1179
|
+
subagentAgentStatus(run, agent) { return String(agent?.status || run?.status || "running").toLowerCase(); },
|
|
1180
|
+
};
|
|
1181
|
+
vm.runInNewContext(`${workflowControllerSource}\nthis.isWorkflowController = subagentIsWorkflowController; this.workflowAgents = subagentRunAgents; this.workflowCounts = subagentRunAgentCounts;`, workflowCountContext);
|
|
1182
|
+
const syntheticWorkflowRun = {
|
|
1183
|
+
launcher: "pi-subagents",
|
|
1184
|
+
status: "running",
|
|
1185
|
+
agents: [
|
|
1186
|
+
{ id: "run:workflow", name: "workflow", status: "running" },
|
|
1187
|
+
{ id: "run:worker", name: "worker", status: "running", model: "openai-codex/gpt-5.6-sol", thinking: "high" },
|
|
1188
|
+
],
|
|
1189
|
+
};
|
|
1190
|
+
assert.equal(workflowCountContext.isWorkflowController(syntheticWorkflowRun, syntheticWorkflowRun.agents[0]), true, "the model-less pi-subagents workflow row should be treated as the workflow controller");
|
|
1191
|
+
assert.deepEqual(JSON.parse(JSON.stringify(workflowCountContext.workflowAgents(syntheticWorkflowRun).map((agent) => agent.name))), ["worker"], "only actual child agents should remain in the workflow agent list");
|
|
1192
|
+
assert.deepEqual(JSON.parse(JSON.stringify(workflowCountContext.workflowCounts([syntheticWorkflowRun]))), { total: 1, running: 1, stale: 0 }, "workflow controllers should be count-neutral while their children retain lifecycle counts");
|
|
1193
|
+
assert.equal(workflowCountContext.isWorkflowController(syntheticWorkflowRun, { name: "workflow", launcher: "pi-subagents", model: "provider/real-model", thinking: "high" }), false, "a real model-powered agent named workflow must remain an agent row");
|
|
1194
|
+
assert.match(workflowRenderSource, /const status = subagentWorkflowPresentationStatus\(run, agents\);[\s\S]*make\("details", `subagent-workflow[\s\S]*details\.open = !collapsedSubagentWorkflowRunKeys\.has\(key\)[\s\S]*make\("summary", "subagent-workflow-header"\)[\s\S]*renderSubagentAgent\(tab, entry\.run, entry\.agent\)/, "workflow controllers should render as stateful native disclosure headers using the aggregate lifecycle while preserving each child run");
|
|
1172
1195
|
assert.match(compactSubagentAgentSource, /const \[model, thinking\] = subagentExecutionValues\(agent\)[\s\S]*identity\.append\([\s\S]*"subagent-agent-name", name[\s\S]*"subagent-agent-inline-meta", `· \$\{model\} · \$\{thinking\}`[\s\S]*row\.append\(dot, identity, open\)/, "side-panel agent rows should show type, provider\/model, and thinking effort on one compact line");
|
|
1173
1196
|
assert.doesNotMatch(compactSubagentAgentSource, /subagent-agent-meta|subagentExecutionFacts|subagentSourceLabel|subagentRunElapsed|currentTool/, "side-panel agent rows should leave all other execution metadata to the selected subagent view");
|
|
1174
1197
|
assert.doesNotMatch(compactSubagentRunSource, /subagent-run-(?:header|title|meta|state)|`Run \$\{/, "side-panel run groups should not repeat IDs, metadata headers, or state badges");
|
|
@@ -1200,7 +1223,8 @@ const closeSubagentTerminalGroupSource = app.slice(closeSubagentTerminalGroupSta
|
|
|
1200
1223
|
assert.match(closeSubagentTerminalGroupSource, /subagentTerminalViews\.delete\(view\.id\)[\s\S]*renderTabs\(\)/, "closing a workspace subagent group should remove its view tabs as one UI operation");
|
|
1201
1224
|
assert.doesNotMatch(closeSubagentTerminalGroupSource, /cancel|\/api\/subagents/, "closing a workspace subagent group must not stop its child runs");
|
|
1202
1225
|
assert.match(css, /\.subagent-tab-title \{[\s\S]*container-type: inline-size;[\s\S]*flex: 1 1 0;[\s\S]*min-width: 0;[\s\S]*\.subagent-tab-title strong \{[\s\S]*font-size: clamp\(0\.64rem, calc\(0\.5rem \+ 0\.65cqi\), 0\.78rem\);[\s\S]*\.subagent-tab-count \{[\s\S]*flex: 0 0 auto;[\s\S]*white-space: nowrap;/, "subagent titles should scale with their available inline width while summary badges stay fixed and text can still truncate");
|
|
1203
|
-
assert.match(css, /\.subagent-agent-list \{[\s\S]*gap: 0\.16rem;[\s\S]*\.subagent-agent-row \{[\s\S]*min-height: 1\.75rem;[\s\S]*background: transparent;[\s\S]*\.subagent-agent-identity \{[\s\S]*display: flex;[\s\S]*white-space: nowrap;[\s\S]*\.subagent-agent-inline-meta \{[\s\S]*text-overflow: ellipsis;[\s\S]*white-space: nowrap;[\s\S]*\.subagent-run \{[\s\S]*grid-template-columns: minmax\(0, 1fr\) auto;[\s\S]*border: 0;/, "the inline subagent monitor should keep type, model, and effort in compact
|
|
1226
|
+
assert.match(css, /\.subagent-agent-list \{[\s\S]*gap: 0\.16rem;[\s\S]*\.subagent-agent-row \{[\s\S]*min-height: 1\.75rem;[\s\S]*background: transparent;[\s\S]*\.subagent-agent-identity \{[\s\S]*display: flex;[\s\S]*white-space: nowrap;[\s\S]*\.subagent-agent-inline-meta \{[\s\S]*text-overflow: ellipsis;[\s\S]*white-space: nowrap;[\s\S]*\.subagent-run \{[\s\S]*grid-template-columns: minmax\(0, 1fr\) auto;[\s\S]*border: 0;/, "the inline subagent monitor should keep type, model, and effort in compact rows without overflow");
|
|
1227
|
+
assert.match(css, /\.subagent-workflow \{[\s\S]*\.subagent-workflow-header \{[\s\S]*list-style: none;[\s\S]*\.subagent-workflow:not\(\[open\]\)[\s\S]*\.subagent-workflow-agents \{[\s\S]*border-left:/, "workflow disclosures should have a distinct collapsible header and visually nested child-agent section");
|
|
1204
1228
|
assert.match(app, /function renderSubagentOverlayWidget\(\)[\s\S]*openSubagentCancelDialog\(tab, selection\.run, agent\)[\s\S]*subagent-overlay-cancel-action/, "running overlays should route cancel through the shared dialog");
|
|
1205
1229
|
assert.match(app, /subagentTerminalCancelButton[\s\S]*openSubagentCancelDialog\(view\.tab \|\| \{ tabId: view\.parentTabId, tabTitle: view\.parentTitle \}, view\.run, view\.data\?\.agent \|\| view\.agent\)/, "running terminal headers should route cancel through the shared dialog");
|
|
1206
1230
|
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");
|
|
@@ -1600,10 +1624,10 @@ assert.match(app, /id: "btwCommand"[\s\S]*?@firstpick\/pi-extension-btw/, "optio
|
|
|
1600
1624
|
assert.match(app, /BTW_OUTPUT_WIDGET_KEY = "btw:output"[\s\S]*function renderBtwOutputWidget/, "Web UI should render structured /btw output widgets");
|
|
1601
1625
|
assert.match(app, /if \(key\.startsWith\("btw:"\)\) return "btwCommand"/, "extension widget routing should associate /btw widgets with the optional feature");
|
|
1602
1626
|
assert.match(app, /id: "safetyGuard"[\s\S]*?@firstpick\/pi-extension-safety-guard/, "optional features should include the safety guard companion");
|
|
1603
|
-
assert.match(app, /id: "tuiSkillsCommand"[\s\S]*?@firstpick\/pi-extension-setup-skills/, "optional features should
|
|
1604
|
-
assert.match(app, /id: "tuiToolsCommand"[\s\S]*?@firstpick\/pi-extension-tools/, "optional features should
|
|
1627
|
+
assert.match(app, /id: "tuiSkillsCommand"[\s\S]*?@firstpick\/pi-extension-setup-skills[\s\S]*?setup: "skills"/, "optional features should expose Skills Setup from the TUI skills command companion");
|
|
1628
|
+
assert.match(app, /id: "tuiToolsCommand"[\s\S]*?@firstpick\/pi-extension-tools[\s\S]*?setup: "tools"/, "optional features should expose Tools Setup from the TUI tools command companion");
|
|
1605
1629
|
assert.match(app, /id: "remoteWebui"[\s\S]*?@firstpick\/pi-package-remote-webui/, "optional features should include the Remote WebUI companion");
|
|
1606
|
-
assert.match(app, /id: "questionnaire"[\s\S]*?@firstpick\/pi-package-questionnaire[\s\S]*?capabilityLabel: "questionnaire tool in \/tools"[\s\S]*?manageWith: "tools"
|
|
1630
|
+
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 with direct session access control");
|
|
1607
1631
|
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");
|
|
1608
1632
|
assert.match(app, /NATURAL_CONVERSATION_COMMAND_NAMES = \["talk", "voice", "conversation"\]/, "frontend should detect Natural Conversation only from RPC-visible command aliases");
|
|
1609
1633
|
assert.match(app, /const conversationModeByTab = new Map\(\)/, "frontend should track Natural Conversation state per terminal tab");
|
|
@@ -2062,7 +2086,7 @@ assert.match(app, /\/api\/skills\?scope=\$\{encodeURIComponent\(scope\)\}[\s\S]*
|
|
|
2062
2086
|
assert.match(server, /writeWebuiSettings\(\{ resourceDefaults: \{ tools: \{ enabledTools \} \} \}\)[\s\S]*writeWebuiSettings\(\{ resourceDefaults: \{ skills: \{ enabledSkills \} \} \}\)/, "server should persist global tool and skill defaults in the shared Web UI settings file");
|
|
2063
2087
|
assert.match(helper, /const saved = lastBranchConfig\(ctx, TOOLS_CONFIG_TYPE\)\?\.enabledTools;[\s\S]*const selected = Array\.isArray\(saved\) \? saved : inherited/, "session tool entries should take precedence over global defaults");
|
|
2064
2088
|
assert.match(helper, /const saved = lastBranchConfig\(ctx, SKILLS_CONFIG_TYPE\)\?\.disabledSkills;[\s\S]*if \(Array\.isArray\(saved\)\)/, "session skill entries should take precedence over global defaults");
|
|
2065
|
-
assert.match(
|
|
2089
|
+
assert.match(technical, /Session only[\s\S]*Global default/, "technical reference should document resource selector scopes");
|
|
2066
2090
|
assert.match(app, /const tags = Array\.isArray\(item\.tags\)[\s\S]*?item\.badge, \.\.\.tags/, "native selector filtering should include extra resource tags");
|
|
2067
2091
|
assert.match(app, /publishMenuContainer\?\.addEventListener\("pointerenter", \(\) => \{[\s\S]*?setPublishMenuOpen\(true\);[\s\S]*?\}\)/, "Publish menu should expand on hover");
|
|
2068
2092
|
assert.match(app, /publishMenuContainer\?\.addEventListener\("pointerleave", \(\) => setPublishMenuOpen\(false\)\)/, "Publish menu should collapse after hover leaves");
|
|
@@ -2157,7 +2181,7 @@ assert.match(app, /const totalTabCount = tabs\.length \+ subagentTerminalViews\.
|
|
|
2157
2181
|
assert.match(app, /appendTerminalTabContent\(button, \{ title: activeTitle,[\s\S]*?count: groupTabs\.length,[^}]*\}\)/, "group buttons should show the active terminal name instead of only the cwd label");
|
|
2158
2182
|
assert.match(app, /wrapper\.addEventListener\("pointerenter", \(\) => setOpenTerminalTabGroup\(group\.key\)\)/, "terminal tab groups should mark themselves open while hovered");
|
|
2159
2183
|
assert.match(app, /if \(openTerminalTabGroupKey\) \{\n\s+scheduleRefreshTabs\(600\);/, "tab polling should defer full tab refreshes while a group menu is open");
|
|
2160
|
-
assert.match(app, /function shouldRenderTerminalTabGroup\(group, groupCount\) \{\n\s+if \(group\.custom\) return group\.tabs\.length > 1;\n\s+return groupCount > 1 && group\.tabs\.length > 1 && Boolean\(group\.cwd\);\n\}/, "terminal tabs should always render custom groups while only collapsing cwd groups when multiple groups are available");
|
|
2184
|
+
assert.match(app, /function shouldRenderTerminalTabGroup\(group, groupCount\) \{\n\s+if \(group\.custom\) return group\.tabs\.length > 1;\n\s+return groupCount > 1 && group\.tabs\.length > 1 && Boolean\(group\.cwd\);\n\}/, "terminal tabs should always render custom groups while only collapsing multi-tab cwd groups when multiple groups are available");
|
|
2161
2185
|
assert.match(app, /TERMINAL_CUSTOM_GROUPS_STORAGE_KEY/, "frontend should persist custom terminal tab groups in browser storage");
|
|
2162
2186
|
assert.match(app, /function bindTerminalTabDragAndDrop\(/, "terminal tabs should bind drag-and-drop grouping behavior");
|
|
2163
2187
|
assert.match(app, /function handleTerminalTabDrop\(sourceTabId, target\)[\s\S]*?createTerminalCustomGroup/, "dropping a terminal tab onto another tab or group should create or update a custom group");
|
|
@@ -2168,7 +2192,7 @@ assert.match(app, /WARNING: \$\{activeAgentTabs\.length\}[\s\S]*?still running o
|
|
|
2168
2192
|
assert.match(app, /elements\.closeAllTabsButton\.addEventListener\("click", \(\) => closeAllTerminalTabs\(\)\)/, "close-all tabs button should be wired in JS");
|
|
2169
2193
|
assert.match(app, /const groups = tabCwdGroups\(\);[\s\S]*?for \(const group of groups\) \{\n\s+if \(shouldRenderTerminalTabGroup\(group, groups\.length\)\)[\s\S]*?renderTerminalTabGroup\(group, groups\.length\)[\s\S]*?for \(const tab of group\.tabs\) elements\.tabBar\.append\(renderTerminalTab\(tab\)\);/, "terminal tabs should render groups with group count and ungrouped tabs when grouping is skipped");
|
|
2170
2194
|
assert.match(app, /const subagentGroups = subagentTerminalViewGroups\(\)[\s\S]*renderSubagentTerminalTabGroup\(group\)[\s\S]*renderSubagentTerminalTab\(group\.views\[0\]\)/, "open subagent views should render as first-class virtual tabs, grouped by parent workspace when siblings exist");
|
|
2171
|
-
assert.match(
|
|
2195
|
+
assert.match(technical, /Tracked subagent output[\s\S]*dedicated \*\*Subagent\*\* terminal tab[\s\S]*read-only[\s\S]*does not stop or interrupt/, "technical reference should document the selectable read-only child terminal behavior");
|
|
2172
2196
|
assert.match(app, /let tabSeenCompletionSerials = new Map\(\)/, "frontend should track which tab completions have been seen");
|
|
2173
2197
|
assert.match(app, /let activeTabGeneration = 0/, "frontend should version active-tab UI state to reject stale async work");
|
|
2174
2198
|
assert.match(app, /function isCurrentTabContext\(context\)/, "frontend should identify stale active-tab refresh contexts");
|
|
@@ -2439,32 +2463,32 @@ assert.match(server, /function configuredScopedModelPatterns\(cwd = options\.cwd
|
|
|
2439
2463
|
assert.match(server, /readJsonFileIfExists\(path\.join\(cwd, "\.pi", "settings\.json"\)\)/, "server should read project-local scoped-model settings from active tab cwd");
|
|
2440
2464
|
assert.match(server, /resolveScopedModelsFromPatterns\(patterns, response\.data\?\.models/, "server should resolve scoped patterns against available models");
|
|
2441
2465
|
assert.match(server, /writeFile\(tmpFile[\s\S]*?rename\(tmpFile, storageFile\)/, "server should persist fast picks with an atomic temp-file rename");
|
|
2442
|
-
assert.match(
|
|
2443
|
-
assert.match(
|
|
2444
|
-
assert.match(
|
|
2445
|
-
assert.match(
|
|
2446
|
-
assert.match(
|
|
2447
|
-
assert.match(
|
|
2448
|
-
assert.match(
|
|
2449
|
-
assert.match(
|
|
2450
|
-
assert.match(
|
|
2451
|
-
assert.match(
|
|
2452
|
-
assert.match(
|
|
2453
|
-
assert.match(
|
|
2454
|
-
assert.match(
|
|
2455
|
-
assert.match(
|
|
2456
|
-
assert.match(
|
|
2457
|
-
assert.match(
|
|
2458
|
-
assert.match(
|
|
2459
|
-
assert.match(
|
|
2460
|
-
assert.match(
|
|
2461
|
-
assert.match(
|
|
2462
|
-
assert.match(
|
|
2463
|
-
assert.match(
|
|
2464
|
-
assert.match(
|
|
2465
|
-
assert.match(
|
|
2466
|
-
assert.match(
|
|
2467
|
-
assert.match(
|
|
2466
|
+
assert.match(technical, /automatic naming from the first prompt/i, "technical reference should describe automatic terminal-tab naming");
|
|
2467
|
+
assert.match(development, /Feedback reactions \(`👍`, `👎`, `\?`\) on final assistant output plus tool\/bash action cards/, "development guide should describe final-output and action feedback reactions");
|
|
2468
|
+
assert.match(development, /POST \/api\/action-feedback\?tab=<tabId>/, "development guide should document the action-feedback endpoint");
|
|
2469
|
+
assert.match(development, /`@` file\/path references with live suggestions/, "development guide should describe @ file/path reference autocomplete");
|
|
2470
|
+
assert.match(development, /optional `@firstpick\/pi-extension-bang-command-autocomplete` companion[\s\S]*GET \/api\/bang-suggestions\?tab=<tabId>&query=<command>/, "development guide should document optional bang-command autocomplete and its endpoint");
|
|
2471
|
+
assert.match(development, /optional `@firstpick\/pi-extension-fish-user-bash` companion/, "development guide should document optional fish user-bash integration");
|
|
2472
|
+
assert.match(development, /GET \/api\/path-suggestions\?tab=<tabId>&query=<path>/, "development guide should document the path-suggestions endpoint");
|
|
2473
|
+
assert.match(development, /GET \/api\/optional-features/, "development guide should document optional feature status endpoint");
|
|
2474
|
+
assert.match(development, /POST \/api\/optional-feature-install/, "development guide should document optional feature install endpoint");
|
|
2475
|
+
assert.match(development, /POST \/api\/optional-feature-install-batch[\s\S]*bounded allowlisted[\s\S]*sequentially/, "development guide should document the bounded sequential batch endpoint");
|
|
2476
|
+
assert.match(technical, /\*\*Install all\*\*[\s\S]*\*\*Install missing\*\*[\s\S]*missing or unregistered[\s\S]*one confirmation[\s\S]*continue after individual failures/, "technical reference should document bulk control scope and partial-failure behavior");
|
|
2477
|
+
assert.match(technical, /pi install npm:@firstpick\/pi-extension-stats[\s\S]*Re-running the same `pi install npm:<package>` command is the supported update path/, "technical reference should document separate manual Pi package installation and updates");
|
|
2478
|
+
assert.match(development, /server-persisted fast picks/, "development guide should describe server-persisted fast picks");
|
|
2479
|
+
assert.match(development, /`\/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/, "development guide should describe /btw, blocked-tab, and agent-done notifications");
|
|
2480
|
+
assert.match(development, /blocked-tab browser notifications, and optional agent-done notifications require browser service-worker\/notification support/, "development guide should document notification requirements");
|
|
2481
|
+
assert.match(development, /Side-panel theme picker backed by optional `@firstpick\/pi-themes-bundle` themes plus Pi-native project\/global custom themes/, "development guide should describe bundled and custom theme selection");
|
|
2482
|
+
assert.match(development, /## Optional companion packages/, "development guide should document optional Web UI companion packages");
|
|
2483
|
+
assert.match(development, /Web UI tabs load enabled resources resolved from normal Pi settings/, "development guide should document Pi-settings-based optional feature loading");
|
|
2484
|
+
assert.match(development, /legacy\/hoisted package files without either a Pi settings entry or an enabled top-level resource remain installable/i, "development guide should document migration handling for physically present but unregistered packages");
|
|
2485
|
+
assert.match(development, /excluding the Web UI package itself from re-loading/, "development guide should document Web UI self-loading duplicate prevention");
|
|
2486
|
+
assert.match(development, /checks loaded Pi capabilities directly through RPC-visible commands, tools, themes, and live widget events/, "development guide should document capability-based startup checks");
|
|
2487
|
+
assert.match(development, /side panel separately reports physical installation and Pi registration/, "development guide should document distinct installed and registered optional feature status");
|
|
2488
|
+
assert.match(development, /per-row \*\*Install\*\* or \*\*Update\*\* action[\s\S]*batch has one confirmation[\s\S]*bounded diagnostics/, "development guide should document per-row and bulk warning/result behavior");
|
|
2489
|
+
assert.match(development, /Natural Conversation Mode shell[\s\S]*\/talk[\s\S]*read-only/, "development guide should document the optional Natural Conversation WebUI shell");
|
|
2490
|
+
assert.match(development, /\.\/dev\/scripts\/start-webui\.sh --dev --cwd \/path\/to\/project/, "development guide should document the dev helper launcher");
|
|
2491
|
+
assert.match(development, /register that package with Pi from its absolute local path[\s\S]*resolved from Pi settings rather than the Web UI manifest/, "development guide should document local companion registration through Pi settings");
|
|
2468
2492
|
assert.match(startScript, /--dev\)/, "start-webui.sh should accept a --dev flag");
|
|
2469
2493
|
assert.match(startScript, /local_pi_webui_bin\(\)/, "start-webui.sh should resolve this checkout's local server entrypoint");
|
|
2470
2494
|
assert.match(startScript, /candidate="\$\(package_root\)\/bin\/pi-webui\.mjs"/, "start-webui.sh should resolve the package-root bin from dev/scripts");
|
|
@@ -173,13 +173,14 @@ assert.match(server, /url\.pathname === "\/api\/tools" && req\.method === "GET"/
|
|
|
173
173
|
assert.match(server, /url\.pathname === "\/api\/tools" && req\.method === "POST"/, "server should expose POST /api/tools for native /tools updates");
|
|
174
174
|
assert.match(server, /url\.pathname === "\/api\/skills" && req\.method === "GET"/, "server should expose GET /api/skills for native /skills");
|
|
175
175
|
assert.match(server, /url\.pathname === "\/api\/skills" && req\.method === "POST"/, "server should expose POST /api/skills for native /skills updates");
|
|
176
|
-
assert.match(server, /function requireResourceScope\(value\)[\s\S]*scope !== "session" && scope !== "global"/, "resource APIs should accept
|
|
177
|
-
assert.match(server, /
|
|
178
|
-
assert.match(server, /
|
|
179
|
-
assert.match(app, /function nativeResourceScopeControl\(scope,[\s\S]*Session only[\s\S]*Global default/, "Tools and Skills Setup should expose session/global scope choices");
|
|
180
|
-
assert.match(app, /body
|
|
181
|
-
assert.match(app, /body
|
|
182
|
-
assert.match(app, /
|
|
176
|
+
assert.match(server, /function requireResourceScope\(value\)[\s\S]*scope !== "session" && scope !== "global" && scope !== "model"/, "resource APIs should accept session, global, and model scopes");
|
|
177
|
+
assert.match(server, /updateWebuiSettings\([\s\S]*resourceDefaults[\s\S]*tools[\s\S]*enabledTools/, "global tool choices should persist through the locked Web UI settings updater");
|
|
178
|
+
assert.match(server, /updateWebuiSettings\([\s\S]*resourceDefaults[\s\S]*skills[\s\S]*enabledSkills/, "global skill choices should persist through the locked Web UI settings updater");
|
|
179
|
+
assert.match(app, /function nativeResourceScopeControl\(scope,[\s\S]*Session only[\s\S]*Global default[\s\S]*Model default/, "Tools and Skills Setup should expose session/global/model scope choices");
|
|
180
|
+
assert.match(app, /const body = \{ enabledTools: \[\.\.\.enabledTools\], scope \};/, "Tools Setup should submit its selected persistence scope");
|
|
181
|
+
assert.match(app, /const body = \{ enabledSkills: \[\.\.\.enabledSkills\], scope \};/, "Skills Setup should submit its selected persistence scope");
|
|
182
|
+
assert.match(app, /Unpinned active tools update immediately; pinned tools are unchanged\./, "global selector feedback should explain live precedence");
|
|
183
|
+
assert.match(app, /aria-pressed/, "resource toggles should expose their enabled state programmatically");
|
|
183
184
|
assert.match(app, /const HIDDEN_COMMAND_NAMES = new Set\(\["webui-tree-navigate", "webui-helper"\]\)/, "frontend should hide Web UI internal helper commands");
|
|
184
185
|
assert.match(app, /"scoped-models", "tools", "skills"/, "frontend native selector commands should include /tools and /skills");
|
|
185
186
|
assert.match(app, /return match \? match\[1\]\.toLowerCase\(\) : ""/, "frontend native slash command matching should be case-insensitive");
|
|
@@ -68,7 +68,7 @@ assert.match(server, /STATIC_PUBLIC_FILE_EXTENSIONS[\s\S]*"\.mjs"/, "the server
|
|
|
68
68
|
assert.match(serviceWorker, /"\/issue-wizard-state\.mjs"/, "the PWA shell must keep caching the pure wizard module");
|
|
69
69
|
assert.match(serviceWorker, /"\/issue-bot-client\.mjs"/, "the PWA shell must cache the browser client module");
|
|
70
70
|
// Intent preserved: changing the public startup graph advances the PWA cache identity.
|
|
71
|
-
assert.match(serviceWorker, /pi-webui-pwa-
|
|
71
|
+
assert.match(serviceWorker, /pi-webui-pwa-v112/, "the PWA cache name must change with browser wiring updates");
|
|
72
72
|
assert.match(packageJson, /node --check public\/issue-wizard-state\.mjs/, "the package check must keep syntax-checking the pure wizard module");
|
|
73
73
|
assert.match(packageJson, /node --check public\/issue-bot-client\.mjs/, "the package check must syntax-check the browser client module");
|
|
74
74
|
|
|
@@ -4,11 +4,11 @@ import { dirname, join } from "node:path";
|
|
|
4
4
|
import { fileURLToPath } from "node:url";
|
|
5
5
|
|
|
6
6
|
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
-
const [app, html, css,
|
|
7
|
+
const [app, html, css, technical] = await Promise.all([
|
|
8
8
|
readFile(join(root, "public", "app.js"), "utf8"),
|
|
9
9
|
readFile(join(root, "public", "index.html"), "utf8"),
|
|
10
10
|
readFile(join(root, "public", "styles.css"), "utf8"),
|
|
11
|
-
readFile(join(root, "
|
|
11
|
+
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
12
12
|
]);
|
|
13
13
|
|
|
14
14
|
function sourceBetween(startMarker, endMarker) {
|
|
@@ -76,8 +76,8 @@ assert.match(css, /\.optional-feature-migration-surface[\s\S]*\.optional-feature
|
|
|
76
76
|
assert.match(css, /\.optional-feature-migration-card:focus-visible/, "focused completion summary should have a visible focus treatment");
|
|
77
77
|
assert.match(css, /\.optional-feature-migration-card\.phase-degraded[\s\S]*padding-right:[^;]+;[\s\S]*\.optional-feature-migration-dismiss \{[\s\S]*position: absolute;[\s\S]*top:[^;]+;[\s\S]*right:[^;]+;/, "the degraded popup should reserve space for a top-right dismiss button");
|
|
78
78
|
|
|
79
|
-
assert.match(
|
|
80
|
-
assert.match(
|
|
81
|
-
assert.match(
|
|
79
|
+
assert.match(technical, /read-only startup audit/i, "technical reference should document startup auditing");
|
|
80
|
+
assert.match(technical, /--migrate-optional-features[\s\S]*--migration-dry-run/, "technical reference should document explicit unattended migration and dry-run flags");
|
|
81
|
+
assert.match(technical, /Retry failed[\s\S]*Copy commands[\s\S]*Recheck/i, "technical reference should document migration troubleshooting actions");
|
|
82
82
|
|
|
83
83
|
console.log("optional feature migration frontend static tests passed");
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { readFile } from "node:fs/promises";
|
|
3
|
+
import { dirname, join } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
|
|
6
|
+
const root = join(dirname(fileURLToPath(import.meta.url)), "..");
|
|
7
|
+
const [app, readme, technical] = await Promise.all([
|
|
8
|
+
readFile(join(root, "public", "app.js"), "utf8"),
|
|
9
|
+
readFile(join(root, "README.md"), "utf8"),
|
|
10
|
+
readFile(join(root, "TECHNICAL.md"), "utf8"),
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
function optionalFeatureBlock(featureId) {
|
|
14
|
+
const match = app.match(new RegExp(`\\{\\n\\s+id: "${featureId}",[\\s\\S]*?\\n\\s+\\},`));
|
|
15
|
+
assert.ok(match, `optional feature ${featureId} should remain declared`);
|
|
16
|
+
return match[0];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
assert.match(optionalFeatureBlock("tuiSkillsCommand"), /setup: "skills"/, "TUI Skills command should expose a Setup action");
|
|
20
|
+
assert.match(optionalFeatureBlock("tuiToolsCommand"), /setup: "tools"/, "TUI Tools command should expose a Setup action");
|
|
21
|
+
assert.doesNotMatch(optionalFeatureBlock("questionnaire"), /setup:/, "Native questionnaires should use direct Enable/Disable controls without an unrelated Setup action");
|
|
22
|
+
assert.doesNotMatch(app, /Use Setup to manage session and global tool defaults\./, "tool-managed optional features should not refer users to a removed Setup action");
|
|
23
|
+
assert.match(app, /function optionalFeatureSetupAvailable\(feature\)[\s\S]*?case "skills": return hasLoadedRpcCommand\("skills"\);[\s\S]*?case "tools":/, "resource Setup actions should require their loaded RPC commands");
|
|
24
|
+
assert.match(app, /function openOptionalFeatureSetup\(feature\)[\s\S]*?case "skills": return openNativeSkillsSelector\(\);[\s\S]*?case "tools": return openNativeToolsSelector\(\);/, "resource Setup actions should open the browser-native selectors");
|
|
25
|
+
assert.match(app, /if \(detected && feature\.setup\)[\s\S]*?"optional-feature-action setup", "Setup"[\s\S]*?openOptionalFeatureSetup\(feature\)/, "loaded configurable optional features should render a Setup button");
|
|
26
|
+
assert.match(readme, /TUI Skills command[\s\S]*TUI Tools command[\s\S]*Setup/, "README should identify the Optional features entry points");
|
|
27
|
+
assert.match(technical, /TUI Skills command[\s\S]*TUI Tools command[\s\S]*Skills Setup and Tools Setup/, "technical reference should document both setup targets");
|
|
28
|
+
|
|
29
|
+
console.log("optional-feature-resource-setup-static.test.mjs passed");
|
|
@@ -271,8 +271,8 @@ assert.match(
|
|
|
271
271
|
|
|
272
272
|
// --- Coherent browser asset revisions --------------------------------------
|
|
273
273
|
|
|
274
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
275
|
-
assert.match(html, /styles\.css\?v=
|
|
276
|
-
assert.match(html, /data-app-src="\/app\.js\?v=
|
|
274
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112"/, "changed browser assets should advance the PWA cache identity");
|
|
275
|
+
assert.match(html, /styles\.css\?v=126/, "the page should request the updated layout stylesheet revision");
|
|
276
|
+
assert.match(html, /data-app-src="\/app\.js\?v=148"/, "the boot loader should request the updated app module revision");
|
|
277
277
|
|
|
278
278
|
console.log("persistent-ui-layout-static.test.mjs passed");
|
|
@@ -504,8 +504,8 @@ assert.match(css, /@media \(max-width: 720px\), \(max-device-width: 720px\), \(p
|
|
|
504
504
|
assert.match(css, /\.questionnaire-options button\s*\{\s*min-height:\s*3\.35rem/, "mobile questionnaire targets must exceed the 44px floor");
|
|
505
505
|
assert.match(css, /@media \(prefers-reduced-motion: reduce\)\s*\{[\s\S]*?\*, \*::before, \*::after[\s\S]*?transition-duration:\s*1ms !important/, "global reduced-motion rules must cover questionnaire transitions");
|
|
506
506
|
|
|
507
|
-
assert.match(html, /styles\.css\?v=
|
|
508
|
-
assert.match(html, /app\.js\?v=
|
|
509
|
-
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-
|
|
507
|
+
assert.match(html, /styles\.css\?v=126/, "questionnaire CSS needs the current stylesheet revision");
|
|
508
|
+
assert.match(html, /app\.js\?v=148/, "questionnaire behavior needs the current app revision");
|
|
509
|
+
assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v112"/, "questionnaire public assets need a coherent PWA cache revision");
|
|
510
510
|
|
|
511
511
|
console.log("questionnaire-dialog.test.mjs passed");
|
|
@@ -179,7 +179,7 @@ try {
|
|
|
179
179
|
const disableAuth = await request("/api/remote-auth/settings", { method: "POST", body: { enabled: false } });
|
|
180
180
|
assert.equal(disableAuth.status, 200);
|
|
181
181
|
const savedAfterDisable = JSON.parse(await readFile(settingsFile, "utf8"));
|
|
182
|
-
assert.equal(savedAfterDisable.version,
|
|
182
|
+
assert.equal(savedAfterDisable.version, 8, "Web UI settings should retain the current private settings envelope version");
|
|
183
183
|
assert.equal(savedAfterDisable.remoteAuthEnabled, false, "disabling Remote PIN auth should persist the off preference");
|
|
184
184
|
assert.equal(savedAfterDisable.gitWorkflow?.generation?.modelId, "fake-model", "Remote PIN updates should preserve guided Git preferences");
|
|
185
185
|
|