@firstpick/pi-package-webui 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/DEVELOPMENT.md +20 -21
  2. package/README.md +7 -5
  3. package/TECHNICAL.md +6 -2
  4. package/bin/pi-webui.mjs +26 -60
  5. package/index.ts +1 -256
  6. package/package.json +1 -1
  7. package/public/app.js +145 -33
  8. package/public/index.html +10 -7
  9. package/public/service-worker.js +1 -1
  10. package/public/styles.css +51 -7
  11. package/tests/boot-failure-diagnostics.test.mjs +3 -3
  12. package/tests/browser/interaction-continuity.spec.mjs +9 -3
  13. package/tests/codex-fast-mode-static.test.mjs +2 -2
  14. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  15. package/tests/control-visibility-static.test.mjs +3 -3
  16. package/tests/controls-layout-static.test.mjs +3 -3
  17. package/tests/events-tree-context-menu-static.test.mjs +3 -3
  18. package/tests/fast-mode-client-static.test.mjs +1 -1
  19. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  20. package/tests/file-viewer-image-static.test.mjs +3 -3
  21. package/tests/guided-git-activation-static.test.mjs +11 -4
  22. package/tests/guided-git-fallback-runtime.test.mjs +46 -21
  23. package/tests/guided-git-fallback-ui-static.test.mjs +3 -3
  24. package/tests/guided-git-publication-backend-static.test.mjs +10 -5
  25. package/tests/http-endpoints-harness.test.mjs +5 -9
  26. package/tests/intercom-conversation-viewer-static.test.mjs +3 -3
  27. package/tests/main-output-loading-static.test.mjs +18 -12
  28. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  29. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  30. package/tests/mobile-foundation-static.test.mjs +3 -3
  31. package/tests/mobile-phone-experience-static.test.mjs +1 -1
  32. package/tests/mobile-static.test.mjs +11 -7
  33. package/tests/open-issue-wizard-static.test.mjs +1 -1
  34. package/tests/optional-feature-prompt-impact-static.test.mjs +67 -0
  35. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  36. package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
  37. package/tests/questionnaire-dialog.test.mjs +3 -3
  38. package/tests/resource-tui-extension.test.mjs +4 -18
  39. package/tests/session-sampling-ui-static.test.mjs +3 -3
  40. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  41. package/tests/streaming-ui-coupling.test.mjs +2 -0
  42. package/tests/subagent-observability-static.test.mjs +2 -2
  43. package/tests/syntax-highlighting-static.test.mjs +3 -3
  44. package/tests/theme-customizer-static.test.mjs +1 -1
  45. package/tests/windows-drive-cwd-picker-static.test.mjs +3 -3
  46. package/lib/tui-model-profile-selector.mjs +0 -183
  47. package/lib/tui-resource-selector.mjs +0 -173
  48. package/tests/tui-model-profile-selector.test.mjs +0 -102
  49. package/tests/tui-resource-selector.test.mjs +0 -74
@@ -65,7 +65,7 @@ function makeEnvironment({
65
65
  reload: new FakeElement(),
66
66
  copyStatus: new FakeElement(),
67
67
  };
68
- const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=145", sheet: stylesheetLoaded ? {} : null });
68
+ const styleLink = new FakeElement({ href: "http://127.0.0.1:31415/styles.css?v=152", sheet: stylesheetLoaded ? {} : null });
69
69
  const listeners = new Map();
70
70
  const timers = new Map();
71
71
  let timerId = 0;
@@ -84,7 +84,7 @@ function makeEnvironment({
84
84
  removeEventListener(name) { listeners.delete(name); },
85
85
  };
86
86
  const document = {
87
- currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=177" } }),
87
+ currentScript: new FakeElement({ dataset: { appSrc: "/app.js?v=182" } }),
88
88
  readyState: "complete",
89
89
  querySelector(selector) {
90
90
  return {
@@ -232,7 +232,7 @@ for (const moduleName of startupModuleNames) {
232
232
  assert.ok(serviceWorker.includes(`"/${moduleName}"`), `the PWA app shell should include every app.js startup module: ${moduleName}`);
233
233
  }
234
234
  assert.match(serviceWorker, /pi-webui-pwa-v\d+/, "the app-shell cache should retain a versioned identity");
235
- assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=177"), "the inline loader should own app module startup");
235
+ assert.ok(html.indexOf('id="webuiBootLoader"') < html.indexOf("/app.js?v=182"), "the inline loader should own app module startup");
236
236
  assert.doesNotMatch(html, /<script type="module" src="\/app\.js/, "the app module should not bypass the guarded loader");
237
237
 
238
238
  console.log("boot-failure-diagnostics.test.mjs passed");
@@ -229,19 +229,25 @@ test("main output shows non-blocking inline feedback while transcript data loads
229
229
  const loading = page.locator("#mainOutputLoading");
230
230
  const chat = page.locator("#chat");
231
231
  await expect(loading).toBeVisible();
232
- await expect(loading).toContainText("Loading agent output…");
232
+ await expect(loading).toContainText("Loading conversation history…");
233
233
  await expect(loading).toHaveCSS("pointer-events", "none");
234
234
  await expect(chat).toHaveAttribute("aria-busy", "true");
235
235
  await expect(page.locator("#promptInput")).toBeEnabled();
236
236
  assert.equal(await page.evaluate(() => document.querySelectorAll("dialog:modal").length), 0, "loading feedback should not open a popup");
237
237
  const loadingChatBounds = await chat.boundingBox();
238
- assert.ok(loadingChatBounds, "the transcript should have measurable bounds while loading");
238
+ const loadingBounds = await loading.boundingBox();
239
+ const footerBounds = await page.locator("#statusBar").boundingBox();
240
+ assert.ok(loadingChatBounds && loadingBounds && footerBounds, "the transcript, loading status, and footer should have measurable bounds");
241
+ assert.ok(loadingBounds.y + loadingBounds.height <= footerBounds.y, "the loading status should sit above the Git footer status");
239
242
 
240
243
  releaseMessages();
241
244
  await expect(loading).toBeHidden();
242
245
  await expect(chat).toHaveAttribute("aria-busy", "false");
243
246
  const settledChatBounds = await chat.boundingBox();
244
- assert.deepEqual(settledChatBounds, loadingChatBounds, "showing or hiding loading feedback must not move or resize the transcript");
247
+ assert.ok(settledChatBounds, "the settled transcript should have measurable bounds");
248
+ assert.equal(settledChatBounds.x, loadingChatBounds.x, "the loading row should not move the transcript horizontally");
249
+ assert.equal(settledChatBounds.width, loadingChatBounds.width, "the loading row should not resize the transcript horizontally");
250
+ assert.equal(settledChatBounds.height, loadingChatBounds.height, "the loading overlay should not resize the transcript");
245
251
  } finally {
246
252
  releaseMessages?.();
247
253
  await page.unroute(messagesPattern);
@@ -55,7 +55,7 @@ assert.match(app, /statusKey === CODEX_FAST_MODE_STATUS_KEY[\s\S]*?applyCodexFas
55
55
  assert.match(technical, /## Normal and compact output[\s\S]*?select \*\*Compact\*\*[\s\S]*?`compact-v1`/, "technical reference should document Compact mode with the stable identifier");
56
56
  assert.match(development, /### Codex subscription Fast mode[\s\S]*?service_tier: "priority"[\s\S]*?1\.5× faster[\s\S]*?2× Standard credits[\s\S]*?2\.5×/, "development guide should document Fast-mode integration and cost semantics");
57
57
  // Intent preserved: browser-asset changes must advance the coherent cache tuple.
58
- assert.match(serviceWorker, /pi-webui-pwa-v145/, "PWA cache identity should be bumped for changed browser assets");
59
- assert.match(html, /data-app-src="\/app\.js\?v=177"/, "browser module URL should be cache-busted for Fast-mode wiring");
58
+ assert.match(serviceWorker, /pi-webui-pwa-v153/, "PWA cache identity should be bumped for changed browser assets");
59
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "browser module URL should be cache-busted for Fast-mode wiring");
60
60
 
61
61
  console.log("codex-fast-mode-static.test.mjs passed");
@@ -57,8 +57,8 @@ assert.match(app, /function initializeComposerActionOrdering\(\)[\s\S]*MutationO
57
57
  assert.match(app, /event\.key === COMPOSER_ACTION_ORDER_STORAGE_KEY\) restoreComposerActionOrder\(\)[\s\S]*event\.key === COMPOSER_ACTION_LAYOUT_STORAGE_KEY\) restoreComposerActionSlotLayout\(\)/, "other tabs should apply persisted composer order and sparse-layout changes");
58
58
  assert.match(app, /initializeComposerActionOrdering\(\);[\s\S]*restoreSidePanelSectionOrder\(\);/, "composer ordering should initialize during guarded app startup");
59
59
 
60
- assert.match(html, /styles\.css\?v=145/, "changed composer styles should advance the stylesheet revision");
61
- assert.match(html, /app\.js\?v=177/, "changed composer behavior should advance the app revision");
62
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "changed browser assets should advance the PWA cache identity");
60
+ assert.match(html, /styles\.css\?v=152/, "changed composer styles should advance the stylesheet revision");
61
+ assert.match(html, /app\.js\?v=182/, "changed composer behavior should advance the app revision");
62
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "changed browser assets should advance the PWA cache identity");
63
63
 
64
64
  console.log("composer-action-grid-reorder-static.test.mjs passed");
@@ -348,10 +348,10 @@ assert.match(
348
348
 
349
349
  assert.match(
350
350
  serviceWorker,
351
- /const CACHE_NAME = "pi-webui-pwa-v145";/,
351
+ /const CACHE_NAME = "pi-webui-pwa-v153";/,
352
352
  "browser asset changes should advance the PWA cache identity",
353
353
  );
354
- assert.match(html, /styles\.css\?v=145/, "visibility styles should advance the stylesheet query revision");
355
- assert.match(html, /data-app-src="\/app\.js\?v=177"/, "visibility behavior should advance the app query revision");
354
+ assert.match(html, /styles\.css\?v=152/, "visibility styles should advance the stylesheet query revision");
355
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "visibility behavior should advance the app query revision");
356
356
 
357
357
  console.log("control-visibility-static.test.mjs passed");
@@ -15,8 +15,8 @@ assert.equal((html.match(/class="control-row-label"[^>]*data-tooltip=/g) || []).
15
15
  assert.match(app, /function initializeControlSettingTooltips\(\)[\s\S]*#sidePanelSectionControls \.control-row-label\[data-tooltip\][\s\S]*bindStyledTooltipEvents\(label\)[\s\S]*showFooterTooltip\(label\)/, "Controls help should use the viewport-safe floating tooltip for hover and keyboard access");
16
16
  assert.match(html, /class="control-row remote-auth-control-row" hidden[\s\S]*id="remoteAuthToggle"/, "optional PIN protection should retain its guarded visibility");
17
17
  assert.match(app, /remoteAuthToggle\?\.closest\("\.remote-auth-control-row"\)[\s\S]*remoteAuthRow\.hidden = false/, "loading remote status should reveal the optional PIN protection setting");
18
- assert.match(html, /styles\.css\?v=145/, "Controls stylesheet changes should advance the cache query");
19
- assert.match(html, /app\.js\?v=177/, "Controls tooltip wiring should advance the app cache query");
20
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "Controls browser assets should advance the PWA cache identity");
18
+ assert.match(html, /styles\.css\?v=152/, "Controls stylesheet changes should advance the cache query");
19
+ assert.match(html, /app\.js\?v=182/, "Controls tooltip wiring should advance the app cache query");
20
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "Controls browser assets should advance the PWA cache identity");
21
21
 
22
22
  console.log("controls-layout-static.test.mjs passed");
@@ -124,8 +124,8 @@ assert.match(styles, /\.event-log\[data-display-mode="compact"\] \.event\[data-e
124
124
  assert.match(styles, /\.event-tree-context-menu \{[\s\S]*max-width: calc\(100vw - 1rem\)/, "the dedicated menu should remain viewport bounded");
125
125
 
126
126
  // Cache tuple for this browser-asset change.
127
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";/, "the PWA cache identity should advance");
128
- assert.match(html, /styles\.css\?v=145/, "compact-mode styles should advance the stylesheet revision");
129
- assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the app query revision should advance");
127
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153";/, "the PWA cache identity should advance");
128
+ assert.match(html, /styles\.css\?v=152/, "compact-mode styles should advance the stylesheet revision");
129
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "the app query revision should advance");
130
130
 
131
131
  console.log("events-tree-context-menu-static.test.mjs passed");
@@ -159,7 +159,7 @@ assert.match(worker, /pi-webui-pwa-v\d+[\s\S]*?"\/fast-output-live\.mjs"/, "PWA
159
159
  assert.match(html, /<label for="fastOutputModeSelect">Compact mode \(Experimental\)<\/label>/, "the sidebar should mark compact mode as experimental");
160
160
  assert.match(html, /Lightweight browser rendering; Markdown final output; live thinking expanded; stored thinking grouped and collapsed/, "the sidebar should distinguish compact rendering from model inference");
161
161
  // Intent preserved: the guarded PWA entry point must advance whenever app wiring changes.
162
- assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=177"/, "the guarded PWA entry point should cache-bust browser wiring");
162
+ assert.match(html, /id="webuiBootLoader"[^>]*data-app-src="\/app\.js\?v=182"/, "the guarded PWA entry point should cache-bust browser wiring");
163
163
  assert.match(JSON.parse(packageRaw).scripts.check, /node --check public\/fast-output-live\.mjs/, "package checks should parse the compact helper");
164
164
 
165
165
  const events = createFastModeOutputEvents();
@@ -166,7 +166,7 @@ assert.match(functionSource("closeTerminalTabs"), /clearFeatureDecisionStateForT
166
166
  assert.match(app, /case "webui_connected":[\s\S]*clearFeatureDecisionStateForTab\(connectedTabId, \{ render: true \}\)[\s\S]*scheduleForegroundReconcile\("event stream reconnect", 0\)/, "reconnect should clear local state before authoritative replay");
167
167
  assert.match(app, /statusKey === FEATURE_DECISION_OUTPUT_STATUS_KEY[\s\S]*handleFeatureDecisionOutputStatus[\s\S]*return;[\s\S]*statusKey === FEATURE_CATEGORY_STATUS_KEY[\s\S]*return;[\s\S]*statusEntries\.set/, "both feature statuses should be intercepted before generic footer storage while preserving category handling");
168
168
 
169
- assert.match(html, /\/styles\.css\?v=145/, "integrated stylesheet changes should advance the cache query");
170
- assert.match(html, /\/app\.js\?v=177/, "integrated app changes should advance the cache query");
169
+ assert.match(html, /\/styles\.css\?v=152/, "integrated stylesheet changes should advance the cache query");
170
+ assert.match(html, /\/app\.js\?v=182/, "integrated app changes should advance the cache query");
171
171
 
172
172
  console.log("feature decision-output popup static checks passed");
@@ -62,8 +62,8 @@ assert.match(css, /\.file-viewer-image img \{[\s\S]*max-width: 100%;[\s\S]*max-h
62
62
  assert.match(readme, /PNG, JPEG, GIF, WebP, and AVIF/i, "the Files panel guide should list supported image formats");
63
63
  assert.match(technical, /supported raster images[\s\S]*2 MiB/i, "the advanced reference should document image support and its size limit");
64
64
  assert.match(development, /kind: "image"[\s\S]*base64/i, "the contributor guide should document the image response contract");
65
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "changed viewer assets should advance the PWA cache identity");
66
- assert.match(html, /styles\.css\?v=145/, "changed image styles should advance the stylesheet revision");
67
- assert.match(html, /app\.js\?v=177/, "changed image rendering should advance the app revision");
65
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "changed viewer assets should advance the PWA cache identity");
66
+ assert.match(html, /styles\.css\?v=152/, "changed image styles should advance the stylesheet revision");
67
+ assert.match(html, /app\.js\?v=182/, "changed image rendering should advance the app revision");
68
68
 
69
69
  console.log("file viewer image static tests passed");
@@ -72,7 +72,14 @@ test("native generation capabilities are extension-only and tab-local", () => {
72
72
 
73
73
  test("server dispatch requires extension provenance and completes on a fresh native artifact", () => {
74
74
  assert.match(server, /async function resolveGuidedGitNativeCommand[\s\S]*candidate\?\.source === "extension"[\s\S]*Same-named prompt templates are not used/u);
75
- assert.match(server, /record\.nativeCommandName = nativeCommandName;\s+record\.message = gitWorkflowGenerationPrompt\(kind, preferences, nativeCommandName\)/u);
75
+ const dispatchStart = server.indexOf("async function dispatchGitWorkflowGenerationAttempt");
76
+ const dispatchEnd = server.indexOf("\nasync function settleGitWorkflowGeneration", dispatchStart);
77
+ assert.notEqual(dispatchStart, -1);
78
+ assert.notEqual(dispatchEnd, -1);
79
+ const dispatch = server.slice(dispatchStart, dispatchEnd);
80
+ assert.match(dispatch, /record\.message = gitWorkflowGenerationPrompt\(record\.kind, record\.preferences, record\.nativeCommandName, profile\)/u);
81
+ assert.match(server, /record\.primary = gitWorkflowGenerationProfile\(\s+preferences\.generation\.provider,\s+preferences\.generation\.modelId,\s+preferences\.generation\.thinkingLevel,/u, "generation records should retain the configured profile used by dispatch");
82
+ assert.doesNotMatch(dispatch, /set_model|set_thinking_level|setThinkingLevelForTab/u, "guided generation must not switch or restore the parent tab model or reasoning effort");
76
83
  assert.match(server, /function guidedGitNativeCommandErrorFromEvent[\s\S]*event\?\.type !== "extension_error"[\s\S]*event\.extensionPath !== `command:\$\{commandName\}`/u);
77
84
  assert.match(server, /if \(record\.nativeCommandError\) throw record\.nativeCommandError;[\s\S]*await assertGuidedGitNativeArtifactUpdated\(tab, record\);[\s\S]*finishGitWorkflowGeneration\(tab, record, \{ successful: true \}\)/u);
78
85
  assert.match(server, /const target = path\.resolve\(base, `\$\{encodeURIComponent\(branch\)\}\.md`\)/u);
@@ -82,9 +89,9 @@ test("server dispatch requires extension provenance and completes on a fresh nat
82
89
  test("fixture, cache revisions, and layered docs expose the migration contract", () => {
83
90
  assert.match(fakePi, /FAKE_PI_GUIDED_GIT_ACTIVATION/u);
84
91
  assert.match(fakePi, /git-guided-workflow:webui-start/u);
85
- assert.match(html, /styles\.css\?v=145/u);
86
- assert.match(html, /app\.js\?v=177/u);
87
- assert.match(serviceWorker, /pi-webui-pwa-v145/u);
92
+ assert.match(html, /styles\.css\?v=152/u);
93
+ assert.match(html, /app\.js\?v=182/u);
94
+ assert.match(serviceWorker, /pi-webui-pwa-v153/u);
88
95
  assert.match(serviceWorker, /"\/guided-git-command-state\.mjs"/u);
89
96
  assert.match(readme, /pi-extension-git-guided-workflow/u);
90
97
  assert.match(technical, /\/git-guided-workflow/u);
@@ -34,6 +34,13 @@ function writeBranchArtifact() {
34
34
  mkdirSync(directory, { recursive: true });
35
35
  writeFileSync(join(directory, "staged-branch-name.txt"), "feat/native-root-artifacts\\n");
36
36
  }
37
+ function generationProfile(message) {
38
+ const prefix = "--firstpick-webui-generation-profile=";
39
+ const token = String(message || "").split(/\\s+/u).find((part) => part.startsWith(prefix));
40
+ if (!token) return null;
41
+ try { return JSON.parse(Buffer.from(token.slice(prefix.length), "base64url").toString("utf8")); }
42
+ catch { return null; }
43
+ }
37
44
  function failNativeCommand(command, error, notificationError = error) {
38
45
  const commandName = String(command.message || "").split(/\\s+/u, 1)[0].replace(/^\\//u, "");
39
46
  send({
@@ -54,7 +61,16 @@ createInterface({ input: process.stdin }).on("line", async (line) => {
54
61
  let command;
55
62
  try { command = JSON.parse(line); } catch { return; }
56
63
  if (!command?.id || !command?.type) return;
57
- log({ type: command.type, modelId: command.modelId, level: command.level, message: command.message, activeModel: activeModel.id });
64
+ const profile = generationProfile(command.message);
65
+ log({
66
+ type: command.type,
67
+ modelId: command.modelId,
68
+ level: command.level,
69
+ message: command.message,
70
+ activeModel: activeModel.id,
71
+ generationModel: profile?.modelId,
72
+ generationThinkingLevel: profile?.thinkingLevel,
73
+ });
58
74
  const response = { type: "response", id: command.id, command: command.type, success: true };
59
75
  switch (command.type) {
60
76
  case "get_state":
@@ -84,7 +100,7 @@ createInterface({ input: process.stdin }).on("line", async (line) => {
84
100
  case "prompt":
85
101
  if (scenario === "process-loss") process.exit(12);
86
102
  if (scenario === "concurrent" || scenario === "cancellation") await new Promise((resolve) => setTimeout(resolve, 150));
87
- if (scenario === "provider-failure" && activeModel.id === "primary") {
103
+ if (scenario === "provider-failure" && profile?.modelId === "primary") {
88
104
  failNativeCommand(command, "FIRSTPICK_GUIDED_GIT_PROVIDER_FAILURE: active model generation failed", "The active model provider failed");
89
105
  send(response);
90
106
  break;
@@ -116,7 +132,7 @@ createInterface({ input: process.stdin }).on("line", async (line) => {
116
132
  }
117
133
  if (!["unsafe-stale-artifact", "cancellation"].includes(scenario)) {
118
134
  if (String(command.message || "").startsWith("/git-branch-name")) writeBranchArtifact();
119
- else writeCommitArtifacts(activeModel.id);
135
+ else writeCommitArtifacts(profile?.modelId || activeModel.id);
120
136
  }
121
137
  send({ ...response, data: { output: "native extension command completed" } });
122
138
  break;
@@ -238,7 +254,7 @@ try {
238
254
  await runScenario("success", async ({ request, readLog, cwd }) => {
239
255
  const result = await request("/api/git-workflow/generate", { method: "POST", body: { kind: "commit" } });
240
256
  assert.equal(result.status, 200);
241
- assert.equal(result.body.data.message, "/git-staged-msg en auto");
257
+ assert.match(result.body.data.message, /^\/git-staged-msg en auto --firstpick-webui-generation-profile=/u);
242
258
  assert.equal(result.body.data.fallbackUsed, false);
243
259
  assert.equal(await readFile(path.join(cwd, "dev", "COMMIT", "staged-commit-short.txt"), "utf8"), "feat: primary native generation\n");
244
260
  const correlated = await request(`/api/git-workflow/message?generationId=${encodeURIComponent(result.body.data.generationId)}`);
@@ -246,9 +262,11 @@ try {
246
262
  const log = await readLog();
247
263
  assert.ok(log.some((entry) => entry.type === "get_commands"));
248
264
  assert.equal(log.filter((entry) => entry.type === "prompt").length, 1);
249
- const primary = log.findIndex((entry) => entry.type === "set_model" && entry.modelId === "primary");
250
- const restore = log.findIndex((entry) => entry.type === "set_model" && entry.modelId === "original");
251
- assert.ok(primary >= 0 && restore > primary, "the active model must be restored after native artifact verification");
265
+ const prompt = log.find((entry) => entry.type === "prompt");
266
+ assert.equal(prompt.activeModel, "original", "generation must not change the parent session model");
267
+ assert.equal(prompt.generationModel, "primary");
268
+ assert.equal(prompt.generationThinkingLevel, "low");
269
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
252
270
  });
253
271
 
254
272
  await runScenario("oversized-success", async ({ request, readLog, cwd }) => {
@@ -261,9 +279,9 @@ try {
261
279
  assert.equal(correlated.status, 200);
262
280
  assert.equal(correlated.body.data.ready, true);
263
281
  const log = await readLog();
264
- assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["primary"]);
265
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "fallback").length, 0);
266
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "original").length, 1);
282
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationModel), ["primary"]);
283
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original"]);
284
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
267
285
  });
268
286
 
269
287
  await runScenario("nested-cwd", async ({ request, cwd, tabCwd }) => {
@@ -293,9 +311,10 @@ try {
293
311
  assert.equal(result.body.data.fallbackUsed, true);
294
312
  assert.equal(await readFile(path.join(cwd, "dev", "COMMIT", "staged-commit-short.txt"), "utf8"), "feat: fallback native generation\n");
295
313
  const log = await readLog();
296
- assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["primary", "fallback"]);
297
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "fallback").length, 1);
298
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "original").length, 1);
314
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationModel), ["primary", "fallback"]);
315
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationThinkingLevel), ["low", "off"]);
316
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original", "original"]);
317
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
299
318
  });
300
319
 
301
320
  for (const [scenario, kind, expectedError] of [
@@ -312,8 +331,9 @@ try {
312
331
  assert.match(result.body.error, expectedError);
313
332
  if (scenario === "above-capture-input") assert.doesNotMatch(result.body.error, /message files? to be refreshed/iu);
314
333
  const log = await readLog();
315
- assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["primary"]);
316
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "fallback").length, 0);
334
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationModel), ["primary"]);
335
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original"]);
336
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
317
337
  });
318
338
  }
319
339
 
@@ -325,16 +345,18 @@ try {
325
345
  assert.equal(cancelled.body.data.cancelled, true);
326
346
  assert.notEqual((await generation).status, 200);
327
347
  const log = await readLog();
328
- assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["primary"]);
329
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "fallback").length, 0);
348
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationModel), ["primary"]);
349
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original"]);
350
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
330
351
  });
331
352
 
332
353
  await runScenario("process-loss", async ({ request, readLog }) => {
333
354
  const result = await request("/api/git-workflow/generate", { method: "POST", body: { kind: "commit" } });
334
355
  assert.notEqual(result.status, 200);
335
356
  const log = await readLog();
336
- assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["primary"]);
337
- assert.equal(log.filter((entry) => entry.type === "set_model" && entry.modelId === "fallback").length, 0);
357
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.generationModel), ["primary"]);
358
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original"]);
359
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
338
360
  });
339
361
 
340
362
  await runScenario("prompt-only", async ({ request, readLog }) => {
@@ -342,7 +364,7 @@ try {
342
364
  assert.equal(result.status, 409);
343
365
  assert.match(result.body.error, /extension command.*Same-named prompt templates are not used/iu);
344
366
  const log = await readLog();
345
- assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "prompt").length, 0);
367
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level" || entry.type === "prompt").length, 0);
346
368
  });
347
369
 
348
370
  await runScenario("concurrent", async ({ request, readLog }) => {
@@ -351,7 +373,10 @@ try {
351
373
  request("/api/git-workflow/generate", { method: "POST", body: { kind: "commit" } }),
352
374
  ]);
353
375
  assert.deepEqual([left.status, right.status].sort((a, b) => a - b), [200, 409]);
354
- assert.equal((await readLog()).filter((entry) => entry.type === "prompt").length, 1);
376
+ const log = await readLog();
377
+ assert.equal(log.filter((entry) => entry.type === "prompt").length, 1);
378
+ assert.deepEqual(log.filter((entry) => entry.type === "prompt").map((entry) => entry.activeModel), ["original"]);
379
+ assert.equal(log.filter((entry) => entry.type === "set_model" || entry.type === "set_thinking_level").length, 0);
355
380
  });
356
381
  } finally {
357
382
  await rm(temporaryRoot, { recursive: true, force: true });
@@ -51,10 +51,10 @@ assert.match(app, /generationKind: "commit"[\s\S]*generationKind: "branch"[\s\S]
51
51
  assert.match(app, /branch-name\$\{query\}[\s\S]*pr-description\$\{query\}/, "branch and PR artifact reads should send their exact generation IDs");
52
52
 
53
53
  assert.match(readme, /fallback model and its own reasoning effort[\s\S]*tries the fallback once[\s\S]*stopped Pi process do not trigger fallback/i, "README should explain the optional fallback and essential limits");
54
- assert.match(technical, /## Guided Git generation profiles[\s\S]*strict one-retry policy[\s\S]*model and reasoning effort are restored[\s\S]*dead Pi process cannot run the fallback/i, "technical reference should document configuration and operational limits");
54
+ assert.match(technical, /## Guided Git generation profiles[\s\S]*strict one-retry policy[\s\S]*active model and reasoning effort remain unchanged[\s\S]*dead Pi process cannot run the fallback/i, "technical reference should document configuration and operational limits");
55
55
  assert.match(development, /### Fallback browser\/runtime contract[\s\S]*fallbackUsed: true[\s\S]*webui_git_workflow_generation_fallback_started[\s\S]*never sends a retry/, "development guide should preserve the response/event and browser ownership contract");
56
56
 
57
- assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the changed browser app should use the next query revision");
58
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";/, "the PWA cache identity should advance with browser behavior");
57
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "the changed browser app should use the next query revision");
58
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153";/, "the PWA cache identity should advance with browser behavior");
59
59
 
60
60
  console.log("guided-git-fallback-ui-static.test.mjs passed");
@@ -20,13 +20,18 @@ assert.match(
20
20
  );
21
21
  assert.match(
22
22
  server,
23
- /case "\/api\/git-workflow\/publish": \{[\s\S]*cleanGitHubRepoName\(body\.repoName\)[\s\S]*visibility !== "public" && visibility !== "private"[\s\S]*requireConfirmed\(body,[\s\S]*getGitRoot\(cwd\)[\s\S]*gitRemoteNames\(root\)[\s\S]*remotes\.length[\s\S]*currentGitBranch\(root\)/,
24
- "the server must validate name/visibility/confirmation and refuse existing-remote repair before publication",
23
+ /case "\/api\/git-workflow\/publish": \{[\s\S]*const root = await getGitRoot\(cwd\);[\s\S]*cleanGitHubRepoName\(path\.basename\(root\)\)[\s\S]*visibility !== "public" && visibility !== "private"[\s\S]*requireConfirmed\(body,[\s\S]*gitRemoteNames\(root\)[\s\S]*remotes\.length[\s\S]*currentGitBranch\(root\)/,
24
+ "the server must derive and validate the Git root directory name, validate visibility/confirmation, and refuse existing-remote repair before publication",
25
+ );
26
+ assert.doesNotMatch(
27
+ server,
28
+ /case "\/api\/git-workflow\/publish": \{[\s\S]*?cleanGitHubRepoName\(body\.repoName\)[\s\S]*?case "\/api\/git-workflow\/create-pr"/,
29
+ "publication must not trust a client-selected repository name",
25
30
  );
26
31
  assert.match(
27
32
  server,
28
- /runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source", root, "--remote", "origin", "--push"\],[\s\S]*timeoutMs: 15 \* 60 \* 1000/,
29
- "publication must run the approved non-interactive gh repo create command through the bounded workflow runner",
33
+ /runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source", "\.", "--remote", "origin", "--push"\],[\s\S]*\{ cwd: root, timeoutMs: 15 \* 60 \* 1000/,
34
+ "publication must run gh repo create from the Git root so system GitHub CLI configuration adds origin and pushes",
30
35
  );
31
36
  assert.match(
32
37
  server,
@@ -34,7 +39,7 @@ assert.match(
34
39
  "successful publication must extend the process envelope with the approved metadata",
35
40
  );
36
41
  assert.match(server, /payload\.code = "AUTH";[\s\S]*gh auth login/, "gh authentication failures should receive an actionable AUTH hint");
37
- assert.match(server, /name already exists on this account\|repository \.\+ already exists[\s\S]*Choose another repository name/, "safe name-conflict output should receive a retry hint");
42
+ assert.match(server, /name already exists on this account\|repository \.\+ already exists[\s\S]*rename the local directory before retrying/, "name conflicts should explain how the directory-derived name can be changed");
38
43
  assert.match(server, /GH_PROMPT_DISABLED: process\.env\.GH_PROMPT_DISABLED \|\| "1"/, "gh publication must inherit disabled interactive prompts");
39
44
 
40
45
  console.log("guided git publication backend static tests passed");
@@ -1995,28 +1995,24 @@ try {
1995
1995
  assert.equal(pushWithoutRemote.body?.code, "NO_REMOTE", "remote-less push should have a stable recovery code");
1996
1996
  assert.match(String(pushWithoutRemote.body?.hint || ""), /publish this repository|add a Git remote/i);
1997
1997
  assert.match(String(pushWithoutRemote.body?.data?.stderr || ""), /No configured push destination/i, "classified failures should preserve process output");
1998
+ assert.equal(pushWithoutRemote.body?.data?.repoName, path.basename(cwd), "remote-less push should report the local Git root directory name for publication");
1998
1999
 
1999
2000
  const unconfirmedPublish = await request("127.0.0.1", "/api/git-workflow/publish", {
2000
2001
  method: "POST",
2001
- body: { tab: tabId, repoName: "pi-webui-http-harness", visibility: "private" },
2002
+ body: { tab: tabId, repoName: "client-selected-name", visibility: "private" },
2002
2003
  });
2003
2004
  assert.equal(unconfirmedPublish.status, 200);
2004
2005
  assert.equal(unconfirmedPublish.body?.ok, false, "publication should require exact server-side confirmation");
2005
2006
  assert.match(String(unconfirmedPublish.body?.error || ""), /confirmed: true/);
2007
+ assert.match(String(unconfirmedPublish.body?.error || ""), new RegExp(`GitHub repository ${path.basename(cwd)} as private`), "publication confirmation should use the server-derived Git root directory name");
2008
+ assert.doesNotMatch(String(unconfirmedPublish.body?.error || ""), /client-selected-name/, "publication should ignore client-supplied repository names");
2006
2009
 
2007
2010
  const invalidVisibilityPublish = await request("127.0.0.1", "/api/git-workflow/publish", {
2008
2011
  method: "POST",
2009
- body: { tab: tabId, repoName: "pi-webui-http-harness", visibility: "internal", confirmed: true },
2012
+ body: { tab: tabId, visibility: "internal", confirmed: true },
2010
2013
  });
2011
2014
  assert.equal(invalidVisibilityPublish.body?.ok, false, "publication should reject visibility outside public/private");
2012
2015
  assert.match(String(invalidVisibilityPublish.body?.error || ""), /visibility must be 'public' or 'private'/);
2013
-
2014
- const invalidNamePublish = await request("127.0.0.1", "/api/git-workflow/publish", {
2015
- method: "POST",
2016
- body: { tab: tabId, repoName: "invalid repository name", visibility: "public", confirmed: true },
2017
- });
2018
- assert.equal(invalidNamePublish.body?.ok, false, "publication should reuse GitHub repository-name validation");
2019
- assert.match(String(invalidNamePublish.body?.error || ""), /Invalid GitHub repository name/);
2020
2016
  assert.equal(runGitFixture(["remote"], cwd, "guarded publication requests must not configure a remote"), "");
2021
2017
 
2022
2018
  const initialWorktrees = await request("127.0.0.1", `/api/git-worktrees?tab=${encodeURIComponent(tabId)}`);
@@ -96,9 +96,9 @@ assert.match(css, /\.composer-intercom-tag:hover,[\s\S]*\.composer-intercom-tag:
96
96
  assert.match(css, /\.extension-dialog\.intercom-conversation-dialog \{[\s\S]*width: min\(76rem,[\s\S]*height: min\(54rem,/, "the viewer should use a large in-app modal");
97
97
  assert.match(css, /@media \(max-width: 720px\)[\s\S]*\.composer-intercom-tag \{ min-height: 44px;[\s\S]*\.extension-dialog\.intercom-conversation-dialog[\s\S]*width: calc\(100vw - 0\.7rem\)/, "tags and the dialog should remain reachable on narrow and coarse-pointer layouts");
98
98
 
99
- assert.match(html, /\/styles\.css\?v=145/, "the stylesheet URL should advance for the bounded conversation tags");
100
- assert.match(html, /data-app-src="\/app\.js\?v=177"/, "the guarded app URL should advance for current browser wiring");
101
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "the PWA cache identity should advance with browser assets");
99
+ assert.match(html, /\/styles\.css\?v=152/, "the stylesheet URL should advance for the bounded conversation tags");
100
+ assert.match(html, /data-app-src="\/app\.js\?v=182"/, "the guarded app URL should advance for current browser wiring");
101
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "the PWA cache identity should advance with browser assets");
102
102
 
103
103
  assert.match(readme, /one compact tag per conversation appears beneath the composer/i, "the README should explain the user-visible entry point");
104
104
  assert.match(technical, /## Agent conversation viewer[\s\S]*Attachments, tool calls and results, thinking, stdout\/stderr, filesystem paths, raw session records/i, "the advanced guide should document privacy exclusions");
@@ -22,40 +22,46 @@ function sourceBetween(startMarker, endMarker, label) {
22
22
 
23
23
  assert.match(
24
24
  html,
25
- /class="main-output-surface">[\s\S]*?id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>[\s\S]*?main-output-loading-spinner[\s\S]*?Loading agent output…[\s\S]*?<div id="chat" class="chat" aria-live="polite" aria-busy="false">/,
26
- "the main output surface should own an accessible loading status over the transcript",
25
+ /id="feedbackTray"[\s\S]*?<div class="footer-status-host">[\s\S]*?<div id="mainOutputLoading" class="main-output-loading" role="status" aria-live="polite" aria-atomic="true" aria-controls="chat" hidden>[\s\S]*?main-output-loading-spinner[\s\S]*?id="mainOutputLoadingLabel">Loading conversation history…<\/span>[\s\S]*?<div id="statusBar" class="statusbar"/,
26
+ "the accessible loading status and Git footer should share an overlay host",
27
27
  );
28
28
  assert.doesNotMatch(html, /<dialog[^>]+id="mainOutputLoading"/, "loading feedback must not use a popup dialog");
29
- assert.match(app, /mainOutputLoading: \$\("#mainOutputLoading"\)/, "the browser should bind the inline status element");
29
+ assert.match(app, /mainOutputLoading: \$\("#mainOutputLoading"\)[\s\S]*mainOutputLoadingLabel: \$\("#mainOutputLoadingLabel"\)/, "the browser should bind the inline status and its detail label");
30
30
  assert.match(app, /const mainOutputLoadingRequests = new Set\(\);[\s\S]*MAIN_OUTPUT_LOADING_REVEAL_DELAY_MS = 120/, "loading requests should have bounded concurrent ownership and a short anti-flicker delay");
31
31
 
32
32
  const loadingHelpers = sourceBetween("function mainOutputLoadingRequestIsCurrent(", "\nasync function refreshMessages(", "main output loading helpers");
33
33
  assert.match(loadingHelpers, /isCurrentTabContext\(request\.tabContext\)/, "only the active tab generation should control visible loading feedback");
34
+ assert.match(loadingHelpers, /filter\(mainOutputLoadingRequestIsCurrent\)\.at\(-1\)/, "the newest active request should supply the displayed operation");
34
35
  assert.match(loadingHelpers, /setAttribute\("aria-busy", active \? "true" : "false"\)/, "the transcript should expose request state immediately to assistive technology");
36
+ assert.match(loadingHelpers, /mainOutputLoadingLabel\.textContent = request\?\.label/, "the live status should name the current operation");
35
37
  assert.match(loadingHelpers, /setTimeout\([\s\S]*MAIN_OUTPUT_LOADING_REVEAL_DELAY_MS/, "visible animation should be delayed to avoid flashing on fast requests");
36
38
  assert.match(loadingHelpers, /mainOutputLoadingRequests\.add\(request\)/, "overlapping requests should receive independent tokens");
39
+ assert.match(loadingHelpers, /function updateMainOutputLoading\([\s\S]*request\.label = label/, "an active request should be able to report its next stage");
37
40
  assert.match(loadingHelpers, /mainOutputLoadingRequests\.delete\(request\)/, "settled requests should release only their own token");
38
41
  assert.doesNotMatch(loadingHelpers, /showModal|alert\(|confirm\(/, "main output loading must remain non-modal");
39
42
 
40
43
  const refreshMessages = sourceBetween("async function refreshMessages(", "\nasync function refreshModels(", "refreshMessages");
41
- assert.match(refreshMessages, /const loadingRequest = beginMainOutputLoading\(tabContext\);\s*try \{/, "message fetches should begin loading before awaiting transcript data");
44
+ assert.match(refreshMessages, /beginMainOutputLoading\(tabContext, loadDelta \? "Checking for new messages…" : "Loading conversation history…"\)/, "message fetches should distinguish delta checks from complete transcript loads");
45
+ assert.match(refreshMessages, /updateMainOutputLoading\(loadingRequest, "Loading conversation history…"\)[\s\S]*api\("\/api\/messages"/, "delta fallback should report that it is loading the complete transcript");
46
+ assert.match(refreshMessages, /updateMainOutputLoading\(loadingRequest, "Preparing your conversation…"\)[\s\S]*renderMessages\(latestMessages\)/, "the status should report transcript rendering after data arrives");
42
47
  assert.match(refreshMessages, /finally \{\s*finishMainOutputLoading\(loadingRequest\);\s*\}/, "success, failure, and stale responses should all clear their request token");
43
48
  assert.match(app, /activeTabId = nextTabId;\s*renderMainOutputLoading\(\);/, "tab changes should immediately reconcile stale and current request visibility");
44
49
 
45
50
  assert.match(css, /\.main-output-loading\[hidden\] \{ display: none !important; \}/, "hidden loading feedback should not render");
46
- assert.match(css, /\.main-output-surface \{[\s\S]*?position: relative;[\s\S]*?flex: 1 1 auto;[\s\S]*?min-height: 0;/, "the transcript and loading status should share one stable layout surface");
47
- assert.match(css, /\.main-output-loading \{[\s\S]*?position: absolute;[\s\S]*?left: 50%;[\s\S]*?transform: translateX\(-50%\);[\s\S]*?pointer-events: none;/, "the loading status should overlay the transcript without changing its layout");
51
+ assert.match(css, /\.main-output-surface \{[\s\S]*?position: relative;[\s\S]*?flex: 1 1 auto;[\s\S]*?min-height: 0;/, "the transcript should retain its flexible layout surface");
52
+ assert.match(css, /\.footer-status-host \{[\s\S]*?position: relative;[\s\S]*?flex: 0 0 auto;[\s\S]*?min-width: 0;/, "the Git footer should provide a stable positioning host");
53
+ assert.match(css, /\.main-output-loading \{[\s\S]*?position: absolute;[\s\S]*?left: 50%;[\s\S]*?bottom: calc\(100% \+ 0\.3rem\);[\s\S]*?transform: translateX\(-50%\);[\s\S]*?pointer-events: none;/, "the loading status should overlay above the footer without entering layout flow");
48
54
  assert.match(css, /\.main-output-loading \{[\s\S]*?font-size: var\(--text-xs\)/, "the loading status should remain compact");
49
55
  assert.match(css, /\.main-output-loading-spinner \{[\s\S]*?animation: main-output-loading-spin 780ms linear infinite/, "the status should include a visible spinner animation");
50
56
  assert.match(css, /@keyframes main-output-loading-spin/, "the spinner should have a local animation contract");
51
57
  assert.match(css, /@media \(prefers-reduced-motion: reduce\)[\s\S]*?animation-duration: 1ms !important;[\s\S]*?animation-iteration-count: 1 !important;/, "the existing reduced-motion policy should stop repeated spinner motion");
52
- assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4; \}/, "sidebar tab placement should keep the stable output surface in the transcript grid row");
53
- assert.match(css, /body\.subagent-terminal-active \.main-output-surface,/, "the main output surface should stay hidden in the dedicated subagent view");
58
+ assert.match(css, /body\.terminal-tabs-left \.main-output-surface \{ grid-row: 4; \}[\s\S]*body\.terminal-tabs-left \.footer-status-host \{ grid-row: 7; \}[\s\S]*body\.terminal-tabs-left \.context-meter-bar \{ grid-row: 8; \}/, "sidebar tab placement should keep the loading overlay anchored to the footer host");
59
+ assert.match(css, /body\.subagent-terminal-active \.main-output-surface,[\s\S]*body\.subagent-terminal-active \.main-output-loading,/, "dedicated subagent output should hide the main transcript and its loading status");
54
60
 
55
- assert.match(html, /styles\.css\?v=145/, "the stylesheet cache query should advance");
56
- assert.match(html, /app\.js\?v=177/, "the app cache query should advance");
57
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145"/, "the PWA cache identity should advance with browser assets");
58
- assert.match(readme, /Loading agent output/, "user documentation should describe the visible loading feedback");
61
+ assert.match(html, /styles\.css\?v=152/, "the stylesheet cache query should advance");
62
+ assert.match(html, /app\.js\?v=182/, "the app cache query should advance");
63
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "the PWA cache identity should advance with browser assets");
64
+ assert.match(readme, /Loading conversation history/, "user documentation should describe the plain-language loading feedback");
59
65
  assert.match(development, /main output loading/i, "developer documentation should preserve the request-ownership contract");
60
66
 
61
67
  console.log("main output loading static tests passed");
@@ -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=145/, "changed drag-scroll styles should advance the stylesheet revision");
20
- assert.match(html, /app\.js\?v=177/, "changed drag-scroll wiring should advance the app revision");
21
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v145";[\s\S]*"\/middle-button-drag-scroll\.mjs"/, "offline PWA installs should refresh and cache the new controller module");
19
+ assert.match(html, /styles\.css\?v=152/, "changed drag-scroll styles should advance the stylesheet revision");
20
+ assert.match(html, /app\.js\?v=182/, "changed drag-scroll wiring should advance the app revision");
21
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153";[\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");
@@ -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-v145"/, "continuity/tablet assets need a coherent cache identity");
51
- assert.match(html, /styles\.css\?v=145/, "tablet CSS must have a coherent HTML revision");
52
- assert.match(html, /app\.js\?v=177/, "continuity app logic must have a coherent HTML revision");
50
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "continuity/tablet assets need a coherent cache identity");
51
+ assert.match(html, /styles\.css\?v=152/, "tablet CSS must have a coherent HTML revision");
52
+ assert.match(html, /app\.js\?v=182/, "continuity app logic must have a coherent HTML revision");
53
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-v145"/, "the cache identity must change with the startup graph");
41
- assert.match(html, /styles\.css\?v=145/, "the stylesheet revision must change with mobile/tablet CSS fixes");
42
- assert.match(html, /app\.js\?v=177/, "the app revision must change with continuity/tablet wiring");
40
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "the cache identity must change with the startup graph");
41
+ assert.match(html, /styles\.css\?v=152/, "the stylesheet revision must change with mobile/tablet CSS fixes");
42
+ assert.match(html, /app\.js\?v=182/, "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-v145"/, "browser asset changes need a coherent cache tuple");
63
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v153"/, "browser asset changes need a coherent cache tuple");
64
64
 
65
65
  console.log("mobile-phone-experience-static.test.mjs passed");