@firstpick/pi-package-webui 0.11.0 → 0.11.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 (318) hide show
  1. package/DEVELOPMENT.md +181 -12
  2. package/README.md +41 -9
  3. package/TECHNICAL.md +91 -8
  4. package/bin/pi-webui.mjs +5432 -11428
  5. package/index.ts +10 -3
  6. package/lib/codex-cli-usage.mjs +232 -0
  7. package/lib/codex-usage-auth.mjs +39 -3
  8. package/lib/codex-usage-source.mjs +36 -0
  9. package/lib/component-update-state.mjs +2 -2
  10. package/lib/git-workflow-preference-values.mjs +122 -0
  11. package/lib/git-workflow-preferences.mjs +35 -563
  12. package/lib/package-updates.mjs +260 -0
  13. package/lib/rpc-supervisor-client.mjs +8 -4
  14. package/lib/server/app-runners.mjs +1667 -0
  15. package/lib/server/codex-fast-mode.mjs +161 -0
  16. package/lib/server/conversation-mode.mjs +218 -0
  17. package/lib/server/conversation-voice.mjs +318 -0
  18. package/lib/server/extension-ui-requests.mjs +114 -0
  19. package/lib/server/git-generation.mjs +459 -0
  20. package/lib/server/git-mutations.mjs +1827 -0
  21. package/lib/server/git-reads.mjs +608 -0
  22. package/lib/server/git-worktree-sessions.mjs +408 -0
  23. package/lib/server/helper-requests.mjs +82 -0
  24. package/lib/server/no-project-workspaces.mjs +103 -0
  25. package/lib/server/rpc-transports.mjs +394 -0
  26. package/lib/server/settings-store.mjs +544 -0
  27. package/lib/server/sse-delivery.mjs +138 -0
  28. package/lib/server/workspace-files.mjs +563 -0
  29. package/lib/update/supervisor.mjs +4 -0
  30. package/lib/webui-workspaces.mjs +2 -0
  31. package/package.json +5 -5
  32. package/public/activity-agents-controller.mjs +269 -0
  33. package/public/activity-events-controller.mjs +236 -0
  34. package/public/activity-intercom-controller.mjs +627 -0
  35. package/public/activity-queue-controller.mjs +534 -0
  36. package/public/activity-todo-view.mjs +89 -0
  37. package/public/activity-usage-controller.mjs +589 -0
  38. package/public/app.js +3761 -3878
  39. package/public/conversation-overview.css +84 -0
  40. package/public/conversation-overview.mjs +193 -0
  41. package/public/draft-conversations.mjs +135 -0
  42. package/public/focused-composer-controls.css +111 -0
  43. package/public/focused-composer-controls.mjs +143 -0
  44. package/public/focused-composer-disclosure.mjs +223 -0
  45. package/public/focused-shell-adapter.css +264 -0
  46. package/public/focused-shell-adapter.mjs +257 -0
  47. package/public/index.html +137 -80
  48. package/public/model-catalog-order.mjs +63 -0
  49. package/public/platform-event-stream.mjs +64 -0
  50. package/public/project-artifact-controller.mjs +218 -0
  51. package/public/project-file-viewer-controller.mjs +383 -0
  52. package/public/project-git-tools-controller.mjs +181 -0
  53. package/public/project-runners-controller.mjs +220 -0
  54. package/public/service-worker.js +52 -1
  55. package/public/session-attention-scheduler.mjs +182 -0
  56. package/public/session-composer-store.mjs +56 -0
  57. package/public/session-context.mjs +51 -0
  58. package/public/session-extension-requests.mjs +63 -0
  59. package/public/session-shelf-state.mjs +151 -0
  60. package/public/session-shelves.css +171 -0
  61. package/public/session-shelves.mjs +95 -0
  62. package/public/settings-navigation-controller.mjs +249 -0
  63. package/public/settings-navigation.css +61 -0
  64. package/public/settings-resource-controller.mjs +232 -0
  65. package/public/settings-workspace.css +19 -0
  66. package/public/settings-workspace.mjs +175 -0
  67. package/public/shell-actions.mjs +87 -0
  68. package/public/shell-attention-inbox.css +72 -0
  69. package/public/shell-attention-inbox.mjs +198 -0
  70. package/public/shell-context-actions.css +61 -0
  71. package/public/shell-context-actions.mjs +168 -0
  72. package/public/shell-inspector-resize.mjs +124 -0
  73. package/public/shell-navigation-resize.mjs +107 -0
  74. package/public/shell-navigation.mjs +127 -0
  75. package/public/shell-preferences.mjs +108 -0
  76. package/public/shell-surfaces.mjs +99 -0
  77. package/public/shell-tools-launcher.css +97 -0
  78. package/public/shell-tools-launcher.mjs +222 -0
  79. package/public/shell-view-host.mjs +115 -0
  80. package/public/shell-workspace.css +266 -0
  81. package/public/shell-workspace.mjs +402 -0
  82. package/public/sidebar-update-menu.css +190 -0
  83. package/public/sidebar-update-menu.mjs +512 -0
  84. package/public/styles.css +320 -169
  85. package/public/subagent-launch-slot-state.mjs +2 -2
  86. package/public/theme-contract.mjs +1 -1
  87. package/public/themed-selects.css +156 -0
  88. package/public/workspace-choices.mjs +104 -0
  89. package/tests/activity-agents-controller.test.mjs +652 -0
  90. package/tests/activity-events-controller.test.mjs +511 -0
  91. package/tests/app-runner-terminal-static.test.mjs +3 -3
  92. package/tests/append-system-http.test.mjs +7 -6
  93. package/tests/append-system-selector-static.test.mjs +6 -6
  94. package/tests/aur-review-widget-static.test.mjs +11 -3
  95. package/tests/boot-failure-diagnostics.test.mjs +8 -3
  96. package/tests/browser/activity-intercom-controller.spec.mjs +457 -0
  97. package/tests/browser/activity-navigation-integration.spec.mjs +45 -0
  98. package/tests/browser/activity-owner-integration.spec.mjs +201 -0
  99. package/tests/browser/activity-queue-controller.spec.mjs +405 -0
  100. package/tests/browser/activity-section-picker.spec.mjs +294 -0
  101. package/tests/browser/activity-todo-view.spec.mjs +60 -0
  102. package/tests/browser/activity-usage-controller.spec.mjs +416 -0
  103. package/tests/browser/compact-layout-integration.spec.mjs +58 -0
  104. package/tests/browser/composer-action-grid-reorder.spec.mjs +16 -0
  105. package/tests/browser/composer-disclosure.spec.mjs +389 -0
  106. package/tests/browser/composer-toolbar-polish.spec.mjs +343 -0
  107. package/tests/browser/control-deck-component-updates.spec.mjs +5 -14
  108. package/tests/browser/control-deck-side-panels.spec.mjs +27 -12
  109. package/tests/browser/control-visibility.spec.mjs +5 -0
  110. package/tests/browser/controls-layout.spec.mjs +21 -2
  111. package/tests/browser/conversation-overview.spec.mjs +251 -0
  112. package/tests/browser/draft-conversations.spec.mjs +276 -0
  113. package/tests/browser/empty-startup-fixture.mjs +135 -0
  114. package/tests/browser/empty-startup.spec.mjs +282 -0
  115. package/tests/browser/events-tree-context-menu.spec.mjs +1 -0
  116. package/tests/browser/focused-composer-more.spec.mjs +127 -0
  117. package/tests/browser/focused-model-shortcuts.spec.mjs +120 -0
  118. package/tests/browser/focused-navigation-fixture.mjs +32 -0
  119. package/tests/browser/focused-project-activity.spec.mjs +111 -0
  120. package/tests/browser/focused-shell-integration.spec.mjs +208 -0
  121. package/tests/browser/folder-picker-layout-fixture.mjs +13 -0
  122. package/tests/browser/folder-picker-layout.spec.mjs +302 -0
  123. package/tests/browser/footer-model-advanced-layout.spec.mjs +27 -14
  124. package/tests/browser/git-setup-cancel.spec.mjs +251 -0
  125. package/tests/browser/guided-git-fallback.spec.mjs +40 -21
  126. package/tests/browser/inspector-header.spec.mjs +221 -0
  127. package/tests/browser/inspector-overview-integration.spec.mjs +104 -0
  128. package/tests/browser/inspector-resize.spec.mjs +227 -0
  129. package/tests/browser/inspector-topic-overflow.spec.mjs +56 -0
  130. package/tests/browser/interaction-action-discovery.spec.mjs +332 -0
  131. package/tests/browser/interaction-attention-inbox.spec.mjs +364 -0
  132. package/tests/browser/interaction-attention-integration.spec.mjs +53 -0
  133. package/tests/browser/interaction-composer-controls.spec.mjs +267 -0
  134. package/tests/browser/interaction-composer-integration.spec.mjs +175 -0
  135. package/tests/browser/interaction-continuity.spec.mjs +50 -26
  136. package/tests/browser/interaction-model-picker.spec.mjs +86 -0
  137. package/tests/browser/last-terminal-close.spec.mjs +280 -0
  138. package/tests/browser/mobile-foundation.spec.mjs +172 -20
  139. package/tests/browser/model-catalog-groups.spec.mjs +104 -0
  140. package/tests/browser/more-row-menus.spec.mjs +258 -0
  141. package/tests/browser/new-tab-hit-target.spec.mjs +228 -0
  142. package/tests/browser/no-project-conversation.spec.mjs +113 -0
  143. package/tests/browser/optimistic-prompt.spec.mjs +3 -0
  144. package/tests/browser/overhaul-w7-accessibility.spec.mjs +227 -0
  145. package/tests/browser/overhaul-w7-capabilities.spec.mjs +298 -0
  146. package/tests/browser/overhaul-w7-companions.spec.mjs +290 -0
  147. package/tests/browser/overhaul-w7-focus-repairs.spec.mjs +210 -0
  148. package/tests/browser/overhaul-w7-layout-repairs.spec.mjs +183 -0
  149. package/tests/browser/overhaul-w7-parent-repairs.spec.mjs +97 -0
  150. package/tests/browser/overhaul-w7-pwa.spec.mjs +247 -0
  151. package/tests/browser/overhaul-w7-responsive.spec.mjs +450 -0
  152. package/tests/browser/overhaul-w7-update.spec.mjs +215 -0
  153. package/tests/browser/overhaul-w7-zoom.spec.mjs +243 -0
  154. package/tests/browser/overview-agent-ownership.spec.mjs +45 -0
  155. package/tests/browser/persistent-ui-layout.spec.mjs +3 -0
  156. package/tests/browser/project-artifact-controller.spec.mjs +324 -0
  157. package/tests/browser/project-artifact-integration.spec.mjs +103 -0
  158. package/tests/browser/project-file-buffer-integration.spec.mjs +230 -0
  159. package/tests/browser/project-git-tools-integration.spec.mjs +369 -0
  160. package/tests/browser/session-fixture.mjs +118 -0
  161. package/tests/browser/session-ownership.spec.mjs +175 -0
  162. package/tests/browser/session-shelves-integration.spec.mjs +219 -0
  163. package/tests/browser/session-shelves.spec.mjs +340 -0
  164. package/tests/browser/session-sidebar-resize.spec.mjs +138 -0
  165. package/tests/browser/session-summary.spec.mjs +17 -12
  166. package/tests/browser/settings-complete-home.spec.mjs +463 -0
  167. package/tests/browser/settings-entrypoint.spec.mjs +104 -0
  168. package/tests/browser/settings-navigation-controller.spec.mjs +383 -0
  169. package/tests/browser/settings-navigation-integration.spec.mjs +348 -0
  170. package/tests/browser/settings-resource-lifetime.spec.mjs +349 -0
  171. package/tests/browser/settings-workspace-integration.spec.mjs +132 -0
  172. package/tests/browser/shell-ownership.spec.mjs +398 -0
  173. package/tests/browser/shell-rollout-fixture.mjs +259 -0
  174. package/tests/browser/shell-rollout.spec.mjs +357 -0
  175. package/tests/browser/shell-tools-launcher.spec.mjs +260 -0
  176. package/tests/browser/shell-workspace.spec.mjs +433 -0
  177. package/tests/browser/side-panel-section-reorder.spec.mjs +3 -1
  178. package/tests/browser/sidebar-floating-tooltips.spec.mjs +37 -0
  179. package/tests/browser/sidebar-update-integration.spec.mjs +277 -0
  180. package/tests/browser/sidebar-update-menu.spec.mjs +402 -0
  181. package/tests/browser/sidebar-update-progress.spec.mjs +472 -0
  182. package/tests/browser/stream-output-isolation.spec.mjs +6 -3
  183. package/tests/browser/themed-selects.spec.mjs +297 -0
  184. package/tests/browser/thread-start-flow.spec.mjs +481 -0
  185. package/tests/browser/ui-polish-activity-controls.spec.mjs +177 -0
  186. package/tests/browser/ui-polish-features.spec.mjs +85 -0
  187. package/tests/browser/ui-polish-file-header.spec.mjs +43 -0
  188. package/tests/browser/ui-polish-local-git.spec.mjs +183 -0
  189. package/tests/browser/ui-polish-mobile-recovery.spec.mjs +36 -0
  190. package/tests/browser/ui-polish-navigation.spec.mjs +127 -0
  191. package/tests/browser/ui-polish-session-actions.spec.mjs +282 -0
  192. package/tests/browser/user-noticeable-fixes.spec.mjs +10 -3
  193. package/tests/browser/windows-drive-parent.spec.mjs +4 -2
  194. package/tests/browser/workspace-draft-selection.spec.mjs +266 -0
  195. package/tests/codex-cli-usage.test.mjs +189 -0
  196. package/tests/codex-fast-mode-static.test.mjs +16 -11
  197. package/tests/codex-speed-mode-browser-state.test.mjs +6 -3
  198. package/tests/codex-usage-auth.test.mjs +168 -9
  199. package/tests/codex-usage-http.test.mjs +124 -0
  200. package/tests/codex-usage-source.test.mjs +146 -0
  201. package/tests/component-update-api-static.test.mjs +2 -2
  202. package/tests/composer-action-grid-reorder-static.test.mjs +3 -3
  203. package/tests/control-deck-component-updates-static.test.mjs +9 -4
  204. package/tests/control-visibility-static.test.mjs +3 -3
  205. package/tests/controls-layout-static.test.mjs +5 -5
  206. package/tests/conversation-overview-adapter.test.mjs +100 -0
  207. package/tests/document-artifact-static.test.mjs +2 -1
  208. package/tests/draft-conversations.test.mjs +205 -0
  209. package/tests/empty-startup-launcher.test.mjs +197 -0
  210. package/tests/events-tree-context-menu-static.test.mjs +22 -18
  211. package/tests/fake-pi-session-ownership.test.mjs +302 -0
  212. package/tests/fast-mode-client-static.test.mjs +1 -1
  213. package/tests/feature-decision-output-popup-static.test.mjs +2 -2
  214. package/tests/feature-system-prompt-optional-feature-static.test.mjs +1 -1
  215. package/tests/file-viewer-image-static.test.mjs +15 -11
  216. package/tests/file-viewer-search-static.test.mjs +5 -5
  217. package/tests/fixtures/fake-codex-app-server.mjs +61 -0
  218. package/tests/fixtures/fake-pi.mjs +41 -9
  219. package/tests/footer-provider-usage-visual-static.test.mjs +7 -6
  220. package/tests/foreground-transcript-catch-up-static.test.mjs +7 -4
  221. package/tests/git-footer-context-menu-static.test.mjs +1 -1
  222. package/tests/git-panel-file-preview-static.test.mjs +41 -48
  223. package/tests/git-panel-live-updates-static.test.mjs +2 -1
  224. package/tests/git-workflow-dispatch.test.mjs +66 -0
  225. package/tests/git-workflow-preferences.test.mjs +9 -1
  226. package/tests/guided-git-activation-static.test.mjs +14 -11
  227. package/tests/guided-git-fallback-ui-static.test.mjs +8 -5
  228. package/tests/guided-git-message-reliability-static.test.mjs +10 -6
  229. package/tests/guided-git-publication-backend-static.test.mjs +16 -11
  230. package/tests/http-endpoints-harness.test.mjs +29 -9
  231. package/tests/interaction-state-stability-static.test.mjs +4 -3
  232. package/tests/intercom-conversation-viewer-static.test.mjs +29 -17
  233. package/tests/intercom-tag-layout-static.test.mjs +13 -12
  234. package/tests/intercom-tag-overflow-layout.test.mjs +11 -10
  235. package/tests/main-output-loading-static.test.mjs +4 -4
  236. package/tests/middle-button-drag-scroll-static.test.mjs +3 -3
  237. package/tests/mobile-compact-layout.test.mjs +2 -2
  238. package/tests/mobile-continuity-tablet-static.test.mjs +3 -3
  239. package/tests/mobile-foundation-static.test.mjs +10 -7
  240. package/tests/mobile-phone-experience-static.test.mjs +3 -2
  241. package/tests/mobile-static.test.mjs +173 -135
  242. package/tests/model-catalog-order.test.mjs +103 -0
  243. package/tests/native-parity.test.mjs +6 -4
  244. package/tests/native-session-choice-owner.test.mjs +102 -0
  245. package/tests/native-update-lifecycle.test.mjs +10 -5
  246. package/tests/no-project-http-harness.test.mjs +328 -0
  247. package/tests/no-project-navigation.test.mjs +54 -0
  248. package/tests/no-project-workspaces.test.mjs +77 -0
  249. package/tests/open-issue-wizard-static.test.mjs +1 -1
  250. package/tests/optional-feature-migration-frontend.test.mjs +4 -4
  251. package/tests/optional-feature-prompt-impact-static.test.mjs +3 -3
  252. package/tests/package-updates.test.mjs +630 -0
  253. package/tests/persistent-ui-layout-static.test.mjs +3 -3
  254. package/tests/platform-event-stream.test.mjs +253 -0
  255. package/tests/project-file-viewer-controller.test.mjs +652 -0
  256. package/tests/project-git-tools-adapter.test.mjs +103 -0
  257. package/tests/project-git-tools-controller.test.mjs +577 -0
  258. package/tests/project-runners-controller.test.mjs +453 -0
  259. package/tests/prompt-input-vertical-scroll-static.test.mjs +3 -3
  260. package/tests/prompt-routing-input-clear-static.test.mjs +2 -2
  261. package/tests/questionnaire-dialog.test.mjs +6 -6
  262. package/tests/queue-edit-reorder-static.test.mjs +48 -51
  263. package/tests/rpc-supervisor-host.test.mjs +4 -1
  264. package/tests/safety-guard-auto-review-static.test.mjs +1 -1
  265. package/tests/sampling-native-controls-user-flow.test.mjs +7 -1
  266. package/tests/server-app-runners.test.mjs +536 -0
  267. package/tests/server-codex-fast-mode.test.mjs +346 -0
  268. package/tests/server-conversation-mode.test.mjs +386 -0
  269. package/tests/server-conversation-voice.test.mjs +426 -0
  270. package/tests/server-extension-ui-requests.test.mjs +357 -0
  271. package/tests/server-git-generation.test.mjs +558 -0
  272. package/tests/server-git-mutations.test.mjs +729 -0
  273. package/tests/server-git-reads.test.mjs +381 -0
  274. package/tests/server-git-worktree-sessions.test.mjs +502 -0
  275. package/tests/server-helper-requests.test.mjs +364 -0
  276. package/tests/server-rpc-transports.test.mjs +553 -0
  277. package/tests/server-settings-store.test.mjs +132 -0
  278. package/tests/server-shell-rollout.test.mjs +478 -0
  279. package/tests/server-sse-delivery.test.mjs +410 -0
  280. package/tests/server-workspace-files.test.mjs +546 -0
  281. package/tests/session-attention-scheduler.test.mjs +514 -0
  282. package/tests/session-composer-store.test.mjs +153 -0
  283. package/tests/session-context.test.mjs +134 -0
  284. package/tests/session-extension-requests.test.mjs +193 -0
  285. package/tests/session-ownership-adapter.test.mjs +130 -0
  286. package/tests/session-sampling-ui-static.test.mjs +10 -4
  287. package/tests/session-send-lifetime.test.mjs +140 -0
  288. package/tests/session-shelf-state.test.mjs +348 -0
  289. package/tests/session-shelves-adapter.test.mjs +79 -0
  290. package/tests/session-summary-lifetime.test.mjs +54 -0
  291. package/tests/settings-resource-controller.test.mjs +548 -0
  292. package/tests/shell-action-adapter.test.mjs +169 -0
  293. package/tests/shell-actions.test.mjs +182 -0
  294. package/tests/shell-navigation.test.mjs +348 -0
  295. package/tests/shell-preferences.test.mjs +367 -0
  296. package/tests/side-panel-section-height-removal-static.test.mjs +3 -3
  297. package/tests/stream-output-isolation-static.test.mjs +1 -1
  298. package/tests/subagent-gate-visibility.test.mjs +1 -1
  299. package/tests/subagent-launch-slot-state.test.mjs +2 -2
  300. package/tests/subagent-launch-slots-static.test.mjs +1 -1
  301. package/tests/subagent-observability-static.test.mjs +2 -2
  302. package/tests/subagent-reliability-integration.test.mjs +13 -30
  303. package/tests/syntax-highlighting-static.test.mjs +3 -3
  304. package/tests/tab-close-continuity-static.test.mjs +1 -1
  305. package/tests/tab-metadata-ordering.test.mjs +99 -0
  306. package/tests/terminal-cwd-grouping-static.test.mjs +2 -2
  307. package/tests/terminal-tab-prompt-tooltip-static.test.mjs +2 -0
  308. package/tests/terminal-tab-workspace-static.test.mjs +5 -4
  309. package/tests/terminal-tabs-resize-static.test.mjs +1 -1
  310. package/tests/theme-contract.test.mjs +10 -3
  311. package/tests/theme-customizer-static.test.mjs +1 -1
  312. package/tests/thread-display-title.test.mjs +44 -0
  313. package/tests/update-api-harness.test.mjs +15 -14
  314. package/tests/update-tab-restore-harness.test.mjs +3 -0
  315. package/tests/webui-settings-locking.test.mjs +2 -2
  316. package/tests/windows-drive-cwd-picker-static.test.mjs +7 -9
  317. package/tests/workspace-choices.test.mjs +114 -0
  318. package/tests/workspace-save-load-static.test.mjs +7 -4
@@ -0,0 +1,66 @@
1
+ import assert from "node:assert/strict";
2
+ import { readFile } from "node:fs/promises";
3
+ import test from "node:test";
4
+ import vm from "node:vm";
5
+
6
+ const server = await readFile(new URL("../bin/pi-webui.mjs", import.meta.url), "utf8");
7
+ const source = server.match(/^async function handleGitWorkflowRequest\([^\n]*\n[\s\S]*?^}/m)?.[0];
8
+ assert.ok(source, "the route adapter must remain inspectable");
9
+
10
+ function dispatcher(dependencies) {
11
+ return vm.runInNewContext(`(${source})`, {
12
+ options: { cwd: "/default" },
13
+ sanitizeError: (error) => error.message,
14
+ ...dependencies,
15
+ });
16
+ }
17
+
18
+ for (const [route, method, receivesBody] of [
19
+ ["init", "initializeGitRepository", false],
20
+ ["initial-commit", "initialGitCommit", false],
21
+ ["main-branch", "renameGitMainBranch", false],
22
+ ["remote", "addGitOrigin", true],
23
+ ["init-push", "pushInitialGitMain", false],
24
+ ["commit", "commitGitWorkflow", true],
25
+ ["push", "pushGitWorkflow", true],
26
+ ["publish", "publishGitRepository", true],
27
+ ["create-pr", "createGitWorkflowPr", true],
28
+ ]) {
29
+ test(`${route} retains the workflow envelope across an asynchronous service boundary`, async () => {
30
+ const body = { confirmed: true, expectedStagedContentHash: "approved" };
31
+ const tab = { id: "origin", cwd: "/origin" };
32
+ const payload = { ok: true, data: { marker: route } };
33
+ let reject = false;
34
+ const dispatch = dispatcher({
35
+ [method]: async (...args) => {
36
+ assert.deepEqual(args, receivesBody ? [tab.cwd, body] : [tab.cwd]);
37
+ await Promise.resolve();
38
+ if (reject) throw Object.assign(new Error("fixture validation refusal"), { status: 409 });
39
+ return payload;
40
+ },
41
+ });
42
+ assert.equal(await dispatch(`/api/git-workflow/${route}`, body, tab), payload);
43
+ reject = true;
44
+ const failure = await dispatch(`/api/git-workflow/${route}`, body, tab);
45
+ assert.equal(failure.ok, false);
46
+ assert.equal(failure.error, "fixture validation refusal");
47
+ assert.deepEqual(Object.keys(failure).sort(), ["error", "ok"]);
48
+ });
49
+ }
50
+
51
+ test("cancel invokes both owners even when generation cancellation succeeds", async () => {
52
+ const tab = { id: "origin", cwd: "/origin" };
53
+ const calls = [];
54
+ const dispatch = dispatcher({
55
+ cancelGitWorkflowGeneration: (target) => {
56
+ assert.equal(target, tab);
57
+ calls.push("generation");
58
+ return true;
59
+ },
60
+ cancelGitWorkflowProcess: () => { calls.push("process"); return false; },
61
+ });
62
+ const result = await dispatch("/api/git-workflow/cancel", {}, tab);
63
+ assert.deepEqual(calls, ["generation", "process"]);
64
+ assert.equal(result.ok, true);
65
+ assert.equal(result.data.cancelled, true);
66
+ });
@@ -2,18 +2,26 @@ import assert from "node:assert/strict";
2
2
  import { mkdtemp, readFile, rm, stat, writeFile } from "node:fs/promises";
3
3
  import { tmpdir } from "node:os";
4
4
  import path from "node:path";
5
+ import * as compatibility from "../lib/git-workflow-preferences.mjs";
6
+ import * as preferenceValues from "../lib/git-workflow-preference-values.mjs";
5
7
  import {
6
8
  GIT_WORKFLOW_SETUP_VERSION,
7
9
  gitWorkflowPreferencesSummary,
8
10
  isGitWorkflowSetupComplete,
11
+ supportedGitWorkflowThinkingLevels,
12
+ } from "../lib/git-workflow-preference-values.mjs";
13
+ import {
9
14
  normalizeInterfacePreferences,
10
15
  readGitWorkflowPreferences,
11
16
  readWebuiSettings,
12
- supportedGitWorkflowThinkingLevels,
13
17
  writeGitWorkflowPreferences,
14
18
  writeWebuiSettings,
15
19
  } from "../lib/git-workflow-preferences.mjs";
16
20
 
21
+ for (const [name, value] of Object.entries(preferenceValues)) {
22
+ assert.equal(compatibility[name], value, `${name} must retain its identity through the compatibility path`);
23
+ }
24
+
17
25
  assert.deepEqual(supportedGitWorkflowThinkingLevels({ reasoning: false }), ["off"]);
18
26
  assert.deepEqual(
19
27
  supportedGitWorkflowThinkingLevels({ reasoning: true }),
@@ -4,6 +4,9 @@ import { readFile } from "node:fs/promises";
4
4
  import { dirname, join } from "node:path";
5
5
  import { fileURLToPath } from "node:url";
6
6
 
7
+ const gitGeneration = await readFile(new URL("../lib/server/git-generation.mjs", import.meta.url), "utf8");
8
+ const gitMutations = await readFile(new URL("../lib/server/git-mutations.mjs", import.meta.url), "utf8");
9
+
7
10
  const root = join(dirname(fileURLToPath(import.meta.url)), "..");
8
11
  const [app, state, server, html, serviceWorker, readme, technical, development, fakePi] = await Promise.all([
9
12
  readFile(join(root, "public", "app.js"), "utf8"),
@@ -71,27 +74,27 @@ test("native generation capabilities are extension-only and tab-local", () => {
71
74
  });
72
75
 
73
76
  test("server dispatch requires extension provenance and completes on a fresh native artifact", () => {
74
- assert.match(server, /async function resolveGuidedGitNativeCommand[\s\S]*candidate\?\.source === "extension"[\s\S]*Same-named prompt templates are not used/u);
75
- const dispatchStart = server.indexOf("async function dispatchGitWorkflowGenerationAttempt");
76
- const dispatchEnd = server.indexOf("\nasync function settleGitWorkflowGeneration", dispatchStart);
77
+ assert.match(gitGeneration, /async function resolveGuidedGitNativeCommand[\s\S]*candidate\?\.source === "extension"[\s\S]*Same-named prompt templates are not used/u);
78
+ const dispatchStart = gitGeneration.indexOf("async function dispatchGitWorkflowGenerationAttempt");
79
+ const dispatchEnd = gitGeneration.indexOf("\n async function settleGitWorkflowGeneration", dispatchStart);
77
80
  assert.notEqual(dispatchStart, -1);
78
81
  assert.notEqual(dispatchEnd, -1);
79
- const dispatch = server.slice(dispatchStart, dispatchEnd);
82
+ const dispatch = gitGeneration.slice(dispatchStart, dispatchEnd);
80
83
  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");
84
+ assert.match(gitGeneration, /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
85
  assert.doesNotMatch(dispatch, /set_model|set_thinking_level|setThinkingLevelForTab/u, "guided generation must not switch or restore the parent tab model or reasoning effort");
83
- assert.match(server, /function guidedGitNativeCommandErrorFromEvent[\s\S]*event\?\.type !== "extension_error"[\s\S]*event\.extensionPath !== `command:\$\{commandName\}`/u);
84
- assert.match(server, /if \(record\.nativeCommandError\) throw record\.nativeCommandError;[\s\S]*await assertGuidedGitNativeArtifactUpdated\(tab, record\);[\s\S]*finishGitWorkflowGeneration\(tab, record, \{ successful: true \}\)/u);
85
- assert.match(server, /const target = path\.resolve\(base, `\$\{encodeURIComponent\(branch\)\}\.md`\)/u);
86
+ assert.match(gitGeneration, /function guidedGitNativeCommandErrorFromEvent[\s\S]*event\?\.type !== "extension_error"[\s\S]*event\.extensionPath !== `command:\$\{commandName\}`/u);
87
+ assert.match(gitGeneration, /if \(record\.nativeCommandError\) throw record\.nativeCommandError;[\s\S]*await assertGuidedGitNativeArtifactUpdated\(tab, record\);[\s\S]*finishGitWorkflowGeneration\(tab, record, \{ successful: true \}\)/u);
88
+ assert.match(gitMutations, /const target = path\.resolve\(base, `\$\{encodeURIComponent\(branch\)\}\.md`\)/u);
86
89
  assert.match(development, /correlated `extension_error` event as the native command's terminal failure/u);
87
90
  });
88
91
 
89
92
  test("fixture, cache revisions, and layered docs expose the migration contract", () => {
90
93
  assert.match(fakePi, /FAKE_PI_GUIDED_GIT_ACTIVATION/u);
91
94
  assert.match(fakePi, /git-guided-workflow:webui-start/u);
92
- assert.match(html, /styles\.css\?v=154/u);
93
- assert.match(html, /app\.js\?v=185/u);
94
- assert.match(serviceWorker, /pi-webui-pwa-v156/u);
95
+ assert.match(html, /styles\.css\?v=167/u);
96
+ assert.match(html, /app\.js\?v=220/u);
97
+ assert.match(serviceWorker, /pi-webui-pwa-v200/u);
95
98
  assert.match(serviceWorker, /"\/guided-git-command-state\.mjs"/u);
96
99
  assert.match(readme, /pi-extension-git-guided-workflow/u);
97
100
  assert.match(technical, /\/git-guided-workflow/u);
@@ -1,8 +1,11 @@
1
1
  import assert from "node:assert/strict";
2
2
  import { readFile } from "node:fs/promises";
3
+
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
6
 
7
+ const gitGeneration = await readFile(new URL("../lib/server/git-generation.mjs", import.meta.url), "utf8");
8
+
6
9
  const testsDir = path.dirname(fileURLToPath(import.meta.url));
7
10
  const packageDir = path.resolve(testsDir, "..");
8
11
  const [app, server, html, serviceWorker, readme, technical, development] = await Promise.all([
@@ -33,7 +36,7 @@ assert.match(setup, /Guided Git setup saved\. Primary:[\s\S]*Fallback:/, "save c
33
36
 
34
37
  const acceptedText = sourceBetween(app, "function gitWorkflowGenerationAcceptedText", "function gitWorkflowFallbackEventMatches", "immediate fallback copy");
35
38
  assert.match(acceptedText, /fallbackUsed === true[\s\S]*primaryGeneration[\s\S]*continued with the fallback/, "immediate fallback responses should explain that primary failed and fallback continued");
36
- assert.match(app, /gitWorkflowConfiguredGenerationText\(preferences\)[\s\S]*active tab model and effort are restored/, "workflow startup should identify configured generation profiles and restoration");
39
+ assert.match(app, /gitWorkflowConfiguredGenerationText\(preferences\)[\s\S]*active thread model and effort are restored/, "workflow startup should identify configured generation profiles and restoration");
37
40
 
38
41
  const lifecycle = sourceBetween(app, "function gitWorkflowFallbackEventMatchesPendingRequest", "function formatGitCommandResult", "fallback lifecycle handler");
39
42
  assert.match(lifecycle, /webui_git_workflow_generation_fallback_started/, "the browser should observe fallback start events");
@@ -43,9 +46,9 @@ assert.match(lifecycle, /pendingFallbackLifecycleEvents[\s\S]*slice\(-4\)/, "pre
43
46
  assert.match(lifecycle, /flushPendingGitWorkflowFallbackLifecycleEvents[\s\S]*generationAccepted: true[\s\S]*flushPendingGitWorkflowFallbackLifecycleEvents\(tabId\)/, "buffered lifecycle events should flush only after response correlation");
44
47
  assert.match(lifecycle, /generationId[\s\S]*workflow\.generationId/, "all lifecycle kinds should require the exact server generation ID");
45
48
  assert.doesNotMatch(lifecycle, /\bapi\(|gitWorkflowRequest\(|fetch\(/, "browser lifecycle handling must never dispatch fallback or another request");
46
- assert.match(server, /lifecycle\.events = [\s\S]*\.slice\(-2\)/, "the server should retain a bounded per-tab lifecycle replay snapshot");
49
+ assert.match(gitGeneration, /lifecycle\.events = [\s\S]*\.slice\(-2\)/, "the server should retain a bounded per-tab lifecycle replay snapshot");
47
50
  assert.match(server, /replayGitWorkflowFallbackLifecycle\(tab, client\)/, "EventSource reconnect should replay Guided Git lifecycle state");
48
- assert.match(server, /reason: boundedGitWorkflowGenerationError\("The primary Git-writing model ended with an error\."\)/, "lifecycle reason copy should be curated rather than exposing provider diagnostics");
51
+ assert.match(gitGeneration, /reason: boundedGitWorkflowGenerationError\("The primary Git-writing model ended with an error\."\)/, "lifecycle reason copy should be curated rather than exposing provider diagnostics");
49
52
  assert.match(app, /handleGitWorkflowFallbackLifecycleEvent\(event\)\) return;[\s\S]*if \(!eventTargetsActiveTab\(event\)\)/, "tab-scoped fallback events should be handled before inactive-tab routing");
50
53
  assert.match(app, /generationKind: "commit"[\s\S]*generationKind: "branch"[\s\S]*generationKind: "pr"/, "all three Guided Git generation kinds should register browser correlation state");
51
54
  assert.match(app, /branch-name\$\{query\}[\s\S]*pr-description\$\{query\}/, "branch and PR artifact reads should send their exact generation IDs");
@@ -54,7 +57,7 @@ assert.match(readme, /fallback model and its own reasoning effort[\s\S]*tries th
54
57
  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
58
  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
59
 
57
- assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the changed browser app should use the next query revision");
58
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156";/, "the PWA cache identity should advance with browser behavior");
60
+ assert.match(html, /data-app-src="\/app\.js\?v=220"/, "the changed browser app should use the next query revision");
61
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v200";/, "the PWA cache identity should advance with browser behavior");
59
62
 
60
63
  console.log("guided-git-fallback-ui-static.test.mjs passed");
@@ -1,8 +1,12 @@
1
1
  import assert from "node:assert/strict";
2
2
  import { readFile } from "node:fs/promises";
3
+
3
4
  import path from "node:path";
4
5
  import { fileURLToPath } from "node:url";
5
6
 
7
+ const gitGeneration = await readFile(new URL("../lib/server/git-generation.mjs", import.meta.url), "utf8");
8
+ const gitMutations = await readFile(new URL("../lib/server/git-mutations.mjs", import.meta.url), "utf8");
9
+
6
10
  const testsDir = path.dirname(fileURLToPath(import.meta.url));
7
11
  const packageDir = path.resolve(testsDir, "..");
8
12
  const [app, server, artifacts] = await Promise.all([
@@ -11,13 +15,13 @@ const [app, server, artifacts] = await Promise.all([
11
15
  readFile(path.join(packageDir, "lib", "git-message-artifacts.mjs"), "utf8"),
12
16
  ]);
13
17
 
14
- assert.match(server, /async function createGitWorkflowArtifactGeneration\(tab, generationId, kind\)[\s\S]*kind === "commit"[\s\S]*id: generationId[\s\S]*baseline: await readStableGitMessageArtifactPair\(commitMessagePaths\(cwd\)\)/, "commit generation must retain the shared server-owned ID and exact pre-primary baseline");
15
- assert.match(server, /function gitWorkflowMessageCwd\(root, cwd\)[\s\S]*suppliedCwd !== repositoryRoot[\s\S]*return repositoryRoot;/, "commit and branch artifacts must resolve at repository root after validating a nested tab cwd");
16
- assert.match(server, /generationId: record\.generationId/, "generation dispatch must return one server-owned correlation ID across every kind and both attempts");
17
- assert.match(server, /tab\.gitWorkflowArtifactGeneration = record\.artifactGeneration/, "the artifact generation record must be owned by the originating tab");
18
+ assert.match(gitGeneration, /async function createGitWorkflowArtifactGeneration\(tab, generationId, kind\)[\s\S]*kind === "commit"[\s\S]*id: generationId[\s\S]*baseline: await readStableGitMessageArtifactPair\(commitMessagePaths\(cwd\)\)/, "commit generation must retain the shared server-owned ID and exact pre-primary baseline");
19
+ assert.match(gitMutations, /function gitWorkflowMessageCwd\(root, cwd\)[\s\S]*suppliedCwd !== repositoryRoot[\s\S]*return repositoryRoot;/, "commit and branch artifacts must resolve at repository root after validating a nested tab cwd");
20
+ assert.match(gitGeneration, /generationId: record\.generationId/, "generation dispatch must return one server-owned correlation ID across every kind and both attempts");
21
+ assert.match(gitGeneration, /tab\.gitWorkflowArtifactGeneration = record\.artifactGeneration/, "the artifact generation record must be owned by the originating tab");
18
22
  assert.match(server, /case "\/api\/git-workflow\/message"[\s\S]*generationId[\s\S]*tab\?\.gitWorkflowArtifactGeneration/, "fresh message reads must resolve the correlated generation from the requested tab");
19
- assert.match(server, /readGitWorkflowMessages\(cwd, \{ generationId = "", generation = null \} = \{\}\)[\s\S]*generation\.cwd !== messageCwd[\s\S]*!generation\.terminal[\s\S]*running: true[\s\S]*!generation\.successful/, "message readiness must reject wrong identity and terminal failure while identifying an active attempt");
20
- assert.match(server, /gitMessageArtifactPairReadiness\(generation\.baseline, pair\)[\s\S]*GIT_WORKFLOW_MESSAGE_PAIR_SETTLE_MS[\s\S]*sameGitMessageArtifactPair\(pair, settledPair\)/, "the backend must require both changed artifacts and a stable settled pair");
23
+ assert.match(gitMutations, /readGitWorkflowMessages\(cwd, \{ generationId = "", generation = null \} = \{\}\)[\s\S]*generation\.cwd !== messageCwd[\s\S]*!generation\.terminal[\s\S]*running: true[\s\S]*!generation\.successful/, "message readiness must reject wrong identity and terminal failure while identifying an active attempt");
24
+ assert.match(gitMutations, /gitMessageArtifactPairReadiness\(generation\.baseline, pair\)[\s\S]*GIT_WORKFLOW_MESSAGE_PAIR_SETTLE_MS[\s\S]*sameGitMessageArtifactPair\(pair, settledPair\)/, "the backend must require both changed artifacts and a stable settled pair");
21
25
  assert.doesNotMatch(app, /newestMtime \+ 10000 < currentWorkflow\.messageRequestedAt/, "freshness must not use the previous wall-clock/mtime tolerance");
22
26
 
23
27
  assert.match(app, /const gitWorkflowMessageLoadsByTab = new Map\(\)/, "browser message loading must have tab-scoped single-flight ownership");
@@ -1,15 +1,18 @@
1
1
  import assert from "node:assert/strict";
2
2
  import { readFile } from "node:fs/promises";
3
3
 
4
+ const gitMutations = await readFile(new URL("../lib/server/git-mutations.mjs", import.meta.url), "utf8");
5
+
6
+
4
7
  const server = await readFile(new URL("../bin/pi-webui.mjs", import.meta.url), "utf8");
5
8
 
6
9
  assert.match(
7
- server,
10
+ gitMutations,
8
11
  /if \(push && \/fatal:\\s\+no configured push destination\\\.\/\.test\(text\)\) \{\s*return \{ code: "NO_REMOTE", hint: NO_REMOTE_HINT \};/,
9
12
  "only Git's explicit no-push-destination failure should receive NO_REMOTE classification",
10
13
  );
11
14
  assert.doesNotMatch(
12
- server,
15
+ gitMutations,
13
16
  /does not appear to be a git repository[\s\S]{0,160}NO_REMOTE|NO_REMOTE[\s\S]{0,160}does not appear to be a git repository/,
14
17
  "an invalid configured remote must not be reclassified as remote-less",
15
18
  );
@@ -19,27 +22,29 @@ assert.match(
19
22
  "publication must use the POST-only mutating workflow allowlist",
20
23
  );
21
24
  assert.match(
22
- server,
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\)/,
25
+ gitMutations,
26
+ /async function publishGitRepository\(cwd, body = \{\}\) \{[\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
27
  "the server must derive and validate the Git root directory name, validate visibility/confirmation, and refuse existing-remote repair before publication",
25
28
  );
26
29
  assert.doesNotMatch(
27
- server,
28
- /case "\/api\/git-workflow\/publish": \{[\s\S]*?cleanGitHubRepoName\(body\.repoName\)[\s\S]*?case "\/api\/git-workflow\/create-pr"/,
30
+ gitMutations,
31
+ /async function publishGitRepository\(cwd, body = \{\}\) \{[\s\S]*?cleanGitHubRepoName\(body\.repoName\)[\s\S]*?async function createGitWorkflowPr/,
29
32
  "publication must not trust a client-selected repository name",
30
33
  );
31
34
  assert.match(
32
- server,
35
+ gitMutations,
33
36
  /runGitHubWorkflowCommand\(\s*\["repo", "create", repoName, `--\$\{visibility\}`, "--source", "\.", "--remote", "origin", "--push"\],[\s\S]*\{ cwd: root, timeoutMs: 15 \* 60 \* 1000/,
34
37
  "publication must run gh repo create from the Git root so system GitHub CLI configuration adds origin and pushes",
35
38
  );
36
39
  assert.match(
37
- server,
40
+ gitMutations,
38
41
  /if \(payload\.ok\) Object\.assign\(payload\.data, \{ repoName, visibility, remote: "origin", branch, protectedBranch \}\);/,
39
42
  "successful publication must extend the process envelope with the approved metadata",
40
43
  );
41
- assert.match(server, /payload\.code = "AUTH";[\s\S]*gh auth login/, "gh authentication failures should receive an actionable AUTH 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");
43
- assert.match(server, /GH_PROMPT_DISABLED: process\.env\.GH_PROMPT_DISABLED \|\| "1"/, "gh publication must inherit disabled interactive prompts");
44
+ assert.match(gitMutations, /payload\.code = "AUTH";[\s\S]*gh auth login/, "gh authentication failures should receive an actionable AUTH hint");
45
+ assert.match(gitMutations, /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");
46
+ assert.match(gitMutations, /GH_PROMPT_DISABLED: process\.env\.GH_PROMPT_DISABLED \|\| "1"/, "gh publication must inherit disabled interactive prompts");
47
+
48
+ assert.match(server, /case "\/api\/git-workflow\/publish":[\s\S]*return await publishGitRepository\(cwd, body\);/, "publication must dispatch the selected tab cwd and unchanged request to its service");
44
49
 
45
50
  console.log("guided git publication backend static tests passed");
@@ -16,7 +16,13 @@ import { REQUIRED_THEME_TOKENS, serializeTheme } from "../public/theme-contract.
16
16
  const root = join(dirname(fileURLToPath(import.meta.url)), "..");
17
17
  const serverScript = join(root, "bin", "pi-webui.mjs");
18
18
  const fakePi = join(root, "tests", "fixtures", "fake-pi.mjs");
19
- const port = 30000 + Math.floor(Math.random() * 20000);
19
+ const portReservation = createServer();
20
+ await new Promise((resolve, reject) => {
21
+ portReservation.once("error", reject);
22
+ portReservation.listen(0, "0.0.0.0", resolve);
23
+ });
24
+ portReservation.unref();
25
+ const port = portReservation.address().port;
20
26
  const optionalFeatureFocus = process.env.PI_WEBUI_OPTIONAL_FEATURES_FOCUS === "1";
21
27
 
22
28
  function themeFixture(name, color = "#123456") {
@@ -37,12 +43,17 @@ function lanAddress() {
37
43
  }
38
44
 
39
45
  async function request(host, pathname, { method = "GET", body, headers = {}, timeoutMs = 5_000 } = {}) {
40
- const response = await fetch(`http://${host}:${port}${pathname}`, {
41
- method,
42
- headers: body === undefined ? headers : { "Content-Type": "application/json", ...headers },
43
- body: body === undefined ? undefined : JSON.stringify(body),
44
- signal: AbortSignal.timeout(timeoutMs),
45
- });
46
+ let response;
47
+ try {
48
+ response = await fetch(`http://${host}:${port}${pathname}`, {
49
+ method,
50
+ headers: body === undefined ? headers : { "Content-Type": "application/json", ...headers },
51
+ body: body === undefined ? undefined : JSON.stringify(body),
52
+ signal: AbortSignal.timeout(timeoutMs),
53
+ });
54
+ } catch (error) {
55
+ throw new Error(`HTTP fixture ${method} ${pathname} failed after a ${timeoutMs}ms request budget`, { cause: error });
56
+ }
46
57
  let payload;
47
58
  try {
48
59
  payload = await response.json();
@@ -159,6 +170,9 @@ await writeFile(artifactManifest, JSON.stringify({ artifact: { schema: "pi.artif
159
170
  await mkdir(managedThemeDir, { recursive: true });
160
171
  await writeFile(path.join(managedThemePackageRoot, "package.json"), JSON.stringify({ name: "@firstpick/pi-themes-bundle", version: "0.0.0-test", pi: { themes: ["./themes"] } }));
161
172
  await writeFile(path.join(managedThemeDir, "managed-fixture.json"), serializeTheme(themeFixture("managed-fixture")));
173
+ await writeFile(path.join(managedThemePackageRoot, "webui-backgrounds.json"), JSON.stringify({
174
+ "managed-fixture": { backgroundImage: "url(\"/matrix-background.webp\")", backgroundSize: "cover", pageBg: "#ffffff", arbitrary: "ignored" },
175
+ }));
162
176
  await writeFile(path.join(workflowPolicyAgentDir, "trust.json"), `${JSON.stringify({ [cwd]: true }, null, 2)}\n`);
163
177
  await chmod(fakePi, 0o755);
164
178
  await mkdir(fakeOpenBinDir, { recursive: true });
@@ -274,6 +288,7 @@ for (const [producerId, status, updatedAt] of [
274
288
  }, { recordId: `${producerId}-record` });
275
289
  }
276
290
 
291
+ await new Promise((resolve, reject) => portReservation.close(error => error ? reject(error) : resolve()));
277
292
  const child = spawn(process.execPath, [serverScript, "--cwd", cwd, "--host", "0.0.0.0", "--port", String(port), "--pi", fakePiCli], {
278
293
  stdio: ["ignore", "pipe", "pipe"],
279
294
  env: {
@@ -355,7 +370,7 @@ async function runOptionalFeatureFocus() {
355
370
 
356
371
  const manifest = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
357
372
  assert.deepEqual(manifest.optionalDependencies, { "node-pty": "^1.1.0" });
358
- assert.equal(manifest.dependencies?.["@firstpick/pi-utils"], "^0.2.5");
373
+ assert.equal(manifest.dependencies?.["@firstpick/pi-utils"], "^0.3.2");
359
374
  assert.equal(JSON.stringify(manifest.pi).includes("node_modules/@firstpick"), false);
360
375
 
361
376
  const initial = await request("127.0.0.1", "/api/optional-features");
@@ -513,6 +528,11 @@ try {
513
528
  assert.deepEqual(managedThemesResponse.body?.data?.themes?.map(({ name }) => name), ["managed-fixture"], "themes installed only under PI_CODING_AGENT_DIR/npm/node_modules should be exposed to the browser");
514
529
  assert.equal(managedThemesResponse.body?.data?.themes?.[0]?.colors?.accent, "#123456");
515
530
  assert.equal(managedThemesResponse.body?.data?.themes?.[0]?.scope, "bundled");
531
+ const managedExport = managedThemesResponse.body.data.themes[0].export;
532
+ assert.equal(managedExport.backgroundImage, "url(\"/matrix-background.webp\")", "separate WebUI metadata must preserve bundled backgrounds");
533
+ assert.equal(managedExport.backgroundSize, "cover");
534
+ assert.notEqual(managedExport.pageBg, "#ffffff", "background metadata must not replace native Pi export colors");
535
+ assert.equal(Object.hasOwn(managedExport, "arbitrary"), false, "only supported background fields may enter the catalog");
516
536
 
517
537
  const themeTabs = await request("127.0.0.1", "/api/tabs");
518
538
  const themeTabId = themeTabs.body?.data?.tabs?.[0]?.id;
@@ -1321,7 +1341,7 @@ try {
1321
1341
 
1322
1342
  const webuiManifest = JSON.parse(await readFile(path.join(root, "package.json"), "utf8"));
1323
1343
  assert.deepEqual(webuiManifest.optionalDependencies, { "node-pty": "^1.1.0" }, "node-pty should be the only optional dependency");
1324
- assert.equal(webuiManifest.dependencies?.["@firstpick/pi-utils"], "^0.2.5", "the required pi-utils runtime dependency must remain regular");
1344
+ assert.equal(webuiManifest.dependencies?.["@firstpick/pi-utils"], "^0.3.2", "the required pi-utils runtime dependency must remain regular");
1325
1345
  assert.equal(JSON.stringify(webuiManifest.pi).includes("node_modules/@firstpick"), false, "the WebUI manifest must not claim optional companion resources");
1326
1346
 
1327
1347
  const optionalFeatures = await request("127.0.0.1", "/api/optional-features");
@@ -5,6 +5,7 @@ import { fileURLToPath } from "node:url";
5
5
 
6
6
  const root = join(dirname(fileURLToPath(import.meta.url)), "..");
7
7
  const app = await readFile(join(root, "public", "app.js"), "utf8");
8
+ const queue = await readFile(join(root, "public", "activity-queue-controller.mjs"), "utf8");
8
9
  const renderer = await readFile(join(root, "public", "transcript-renderer.mjs"), "utf8");
9
10
 
10
11
  function functionBody(name, source = app) {
@@ -53,7 +54,7 @@ const renderWidgets = functionBody("renderWidgets");
53
54
  const renderSubagents = functionBody("renderSubagents");
54
55
  const renderGitWorkflow = functionBody("renderGitWorkflow");
55
56
  const renderGitPanel = functionBody("renderGitPanel");
56
- const renderQueue = functionBody("renderQueue");
57
+ const renderQueue = functionBody("render", queue);
57
58
  const captureChatText = functionBody("captureChatTextSelection");
58
59
  const matchChatText = functionBody("chatTextSelectionMatch");
59
60
  const restoreChatText = functionBody("restoreChatTextSelection");
@@ -119,12 +120,12 @@ assert.match(renderGitWorkflow, /captureGitWorkflowInputFocus\(\)[\s\S]*deferUiR
119
120
 
120
121
  assert.match(captureAppRunnerInput, /activeTabContext\(\)[\s\S]*selectionDirection:[\s\S]*scrollTop:[\s\S]*scrollLeft:/, "app-runner input capture must include its tab context and complete text-control state");
121
122
  assert.match(restoreAppRunnerInput, /isCurrentTabContext\(state\.context\) \|\| state\.source\?\.isConnected/, "app-runner input restore must reject stale tab contexts and connected sources");
122
- assert.match(restoreAppRunnerInput, /isMeaningfulConnectedFocus\(document\.activeElement\)[\s\S]*elements\.widgetArea\.querySelectorAll\("\.app-runner-stdin-input"\)[\s\S]*candidate\.dataset\.runId === state\.runId/, "app-runner input restore must stay inside the widget root and match runner identity");
123
+ assert.match(restoreAppRunnerInput, /isMeaningfulConnectedFocus\(document\.activeElement\)[\s\S]*featureWidgetElements\("\.app-runner-stdin-input"\)[\s\S]*candidate\.dataset\.runId === state\.runId/, "app-runner input restore must stay inside canonical feature widget roots and match runner identity");
123
124
  assert.match(captureGitInput, /activeTabContext\(\)[\s\S]*selectionDirection:[\s\S]*scrollTop:[\s\S]*scrollLeft:/, "Guided Git input capture must include its context and complete text-control state");
124
125
  assert.match(restoreGitInput, /state\.tabId !== activeTabId \|\| state\.runId !== gitWorkflow\?\.runId \|\| !isCurrentTabContext\(state\.context\) \|\| state\.source\?\.isConnected/, "Guided Git input restore must require the exact tab, run, and current context");
125
126
 
126
127
  assert.match(renderGitPanel, /captureScopedControlContinuity\(elements\.gitPanelGroups[\s\S]*data-git-panel-continuity-key[\s\S]*scrollTop = scrollTop/, "Git-panel rebuilds must preserve semantic focus and panel scroll");
127
- assert.match(renderQueue, /captureScopedControlContinuity\(elements\.queueBox[\s\S]*data-queue-continuity-key[\s\S]*restoreContinuity\(\)/, "queue rebuilds must preserve semantic action focus and panel scroll");
128
+ assert.match(renderQueue, /captureContinuity\(nodes\.queueBox[\s\S]*data-queue-continuity-key[\s\S]*restore\(\)/, "queue rebuilds must preserve semantic action focus and panel scroll");
128
129
  assert.match(app, /dataset\.mobileContinuityKey = "context:paste-text"[\s\S]*dataset\.mobileDraftAuthority = "dom"/, "mobile paste text must have a stable DOM-authoritative continuity identity");
129
130
  assert.match(captureMobileSurface, /mobileDraftAuthority === "dom"[\s\S]*selectionDirection:[\s\S]*scrollTop:[\s\S]*scrollLeft:/, "mobile DOM drafts must capture selection and scroll state");
130
131
  assert.match(restoreMobileSurface, /target\.dataset\.mobileDraftAuthority === "dom"[\s\S]*target\.value = snapshot\.value[\s\S]*setSelectionRange[\s\S]*target\.focus\(\{ preventScroll: true \}\)/, "mobile DOM drafts must restore value, selection, scroll, and focus");
@@ -4,7 +4,7 @@ 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, app, css, serviceWorker, readme, technical, development] = await Promise.all([
7
+ const [html, app, css, serviceWorker, readme, technical, development, controller] = await Promise.all([
8
8
  readFile(join(root, "public", "index.html"), "utf8"),
9
9
  readFile(join(root, "public", "app.js"), "utf8"),
10
10
  readFile(join(root, "public", "styles.css"), "utf8"),
@@ -12,6 +12,7 @@ const [html, app, css, serviceWorker, readme, technical, development] = await Pr
12
12
  readFile(join(root, "README.md"), "utf8"),
13
13
  readFile(join(root, "TECHNICAL.md"), "utf8"),
14
14
  readFile(join(root, "DEVELOPMENT.md"), "utf8"),
15
+ readFile(join(root, "public", "activity-intercom-controller.mjs"), "utf8"),
15
16
  ]);
16
17
 
17
18
  function count(value, pattern) {
@@ -19,11 +20,18 @@ function count(value, pattern) {
19
20
  }
20
21
 
21
22
  function functionSource(name) {
22
- const start = app.indexOf(`function ${name}(`);
23
- assert.ok(start >= 0, `${name} should exist`);
24
- const next = app.slice(start + 1).match(/\n(?:async )?function [A-Za-z0-9_$]+\(/);
25
- const end = next ? start + 1 + next.index : app.length;
26
- return app.slice(start, end);
23
+ const aliases = {
24
+ openIntercomConversation: "open", renderIntercomConversationTags: "renderTags",
25
+ refreshIntercomConversationSummaries: "refreshSummaries", refreshIntercomConversationDetail: "refreshDetail",
26
+ scheduleIntercomConversationDetailRefresh: "scheduleDetailRefresh", resetIntercomConversationDialog: "resetDetail",
27
+ };
28
+ const source = name === "setActiveTabId" ? app : controller;
29
+ const actualName = aliases[name] || name;
30
+ const start = source.indexOf(`function ${actualName}(`);
31
+ assert.ok(start >= 0, `${name} should exist in its owner`);
32
+ const next = source.slice(start + 1).match(/\n\s*(?:async )?function [A-Za-z0-9_$]+\(/);
33
+ const end = next ? start + 1 + next.index : source.length;
34
+ return source.slice(start, end);
27
35
  }
28
36
 
29
37
  for (const id of [
@@ -50,8 +58,8 @@ assert.match(
50
58
  "the viewer should be a labelled native dialog with a live transcript and explicit close control",
51
59
  );
52
60
  assert.match(app, /installModalPrimitives\(\)/, "the native dialog should use the shared focus-management primitive");
53
- assert.match(functionSource("openIntercomConversation"), /showModal\(\)[\s\S]*intercomConversationCloseButton\?\.focus/, "opening should use the modal primitive and establish an explicit keyboard target");
54
- assert.match(functionSource("setActiveTabId"), /closeIntercomConversationDialog\(\{ restoreFocus: false \}\)/, "tab switching should close the old conversation without restoring focus into the old tab");
61
+ assert.match(functionSource("openIntercomConversation"), /onDialogOpen\(dialog\)[\s\S]*intercomConversationCloseButton\?\.focus/, "opening should use the modal primitive and establish an explicit keyboard target");
62
+ assert.match(functionSource("setActiveTabId"), /activityIntercom\.activate\(projectTargetFromContext\(\)\)/, "tab switching should close the old conversation without restoring focus into the old tab");
55
63
 
56
64
  const tagsSource = functionSource("renderIntercomConversationTags");
57
65
  assert.match(tagsSource, /const seenConversationIds = new Set\(\)/, "tag rendering should deduplicate conversation IDs defensively");
@@ -61,13 +69,13 @@ assert.match(tagsSource, /aria-haspopup", "dialog"[\s\S]*aria-controls", "interc
61
69
  assert.match(tagsSource, /if \(!conversations\.length\)[\s\S]*container\.replaceChildren\(\)[\s\S]*container\.hidden = true/, "the tag list should disappear and clear stale disclosure state when there are no conversations");
62
70
 
63
71
  const summarySource = functionSource("refreshIntercomConversationSummaries");
64
- assert.match(summarySource, /api\("\/api\/intercom\/conversations", \{ tabId: tabContext\.tabId \}\)/, "summary requests should stay scoped to the selected tab");
65
- assert.match(summarySource, /requestSerial !== intercomSummaryRequestSerial \|\| !isCurrentTabContext\(tabContext\)/, "summary responses should be rejected after a newer request or tab switch");
72
+ assert.match(summarySource, /api\("\/api\/intercom\/conversations", \{ tabId: target\.tabId \}\)/, "summary requests should stay scoped to the selected tab");
73
+ assert.match(summarySource, /serial !== intercomSummaryRequestSerial \|\| !current\(target\)/, "summary responses should be rejected after a newer request or tab switch");
66
74
  const detailSource = functionSource("refreshIntercomConversationDetail");
67
75
  assert.match(detailSource, /conversation=\$\{encodeURIComponent\(state\.conversationId\)\}/, "detail selection should send only an encoded opaque ID");
68
- assert.match(detailSource, /requestSerial !== intercomDetailRequestSerial[\s\S]*state !== intercomConversationDialogState[\s\S]*!isCurrentTabContext\(state\)/, "detail responses should be rejected after rapid selection or tab changes");
69
- assert.match(app, /\["webui_connected", "agent_end", "message_end", "tool_execution_end"\][\s\S]*scheduleIntercomConversationRefresh\(tabContext\)/, "settlement and reconnect events should refresh conversation summaries");
70
- assert.match(app, /source\.onopen = \(\) => \{[\s\S]*scheduleIntercomConversationRefresh\(tabContext, 0\)/, "event-stream reconnection should authoritatively refetch tags");
76
+ assert.match(detailSource, /serial !== intercomDetailRequestSerial \|\| !detailCurrent\(state\)/, "detail responses should be rejected after rapid selection or tab changes");
77
+ assert.match(app, /\["webui_connected", "agent_end", "message_end", "tool_execution_end"\][\s\S]*activityIntercom\.scheduleRefresh\(projectTargetFromContext\(tabContext\)\)/, "settlement and reconnect events should refresh conversation summaries");
78
+ assert.match(app, /function handleSessionStreamOpen\(event, tabContext\) \{[\s\S]*activityIntercom\.scheduleRefresh\(projectTargetFromContext\(tabContext\), 0\)/, "event-stream reconnection should authoritatively refetch tags");
71
79
 
72
80
  const messageRenderSource = functionSource("renderIntercomConversationMessage");
73
81
  const renderSource = functionSource("renderIntercomConversationDetail");
@@ -86,7 +94,11 @@ assert.match(renderSource, /const anchorOffset = anchor \? anchor\.getBoundingCl
86
94
 
87
95
  assert.match(functionSource("scheduleIntercomConversationDetailRefresh"), /INTERCOM_DETAIL_REFRESH_MS/, "an open dialog should use the bounded detail refresh interval");
88
96
  assert.match(functionSource("resetIntercomConversationDialog"), /intercomDetailRequestSerial \+= 1[\s\S]*clearTimeout\(intercomDetailRefreshTimer\)[\s\S]*intercomConversationDialogState = null/, "dialog close should invalidate requests, cancel polling, and clear selection state");
89
- assert.match(app, /elements\.intercomConversationDialog\?\.addEventListener\("close", resetIntercomConversationDialog\)/, "native Escape and close-button paths should share polling cleanup");
97
+ assert.match(app, /elements\.intercomConversationDialog\?\.addEventListener\("close",[\s\S]*if \(!elements\.intercomConversationDialog\.open\) activityIntercom\.reset\(\)/, "native Escape and close-button paths should share polling cleanup");
98
+
99
+ assert.match(controller, /state === intercomConversationDialogState && nodes\.intercomConversationDialog\?\.open && current\(state\)/, "detail acceptance checks the selected owner, open dialog and current session");
100
+ assert.match(app, /onDialogOpen\(dialog\) \{ if \(!dialog\.open\) dialog\.showModal\(\); \}/, "the parent opens the canonical native dialog");
101
+ assert.match(controller, /function activate[\s\S]*close\(\{ restoreFocus: false \}\)/, "activation closes the old detail without restoring old focus");
90
102
 
91
103
  assert.match(css, /\.composer-intercom-tags \{[\s\S]*display: inline-flex;[\s\S]*flex: 0 1 50%;[\s\S]*max-width: 50%;[\s\S]*overflow: hidden;/, "conversation tags should use up to half the desktop input width without a horizontal scroller");
92
104
  assert.match(css, /\.composer-intercom-overflow-menu \{[\s\S]*position: absolute;[\s\S]*max-height:[\s\S]*overflow-y: auto;/, "hidden conversations should remain reachable in a bounded popup");
@@ -96,9 +108,9 @@ assert.match(css, /\.composer-intercom-tag:hover,[\s\S]*\.composer-intercom-tag:
96
108
  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
109
  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
110
 
99
- assert.match(html, /\/styles\.css\?v=154/, "the stylesheet URL should advance for the bounded conversation tags");
100
- assert.match(html, /data-app-src="\/app\.js\?v=185"/, "the guarded app URL should advance for current browser wiring");
101
- assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v156"/, "the PWA cache identity should advance with browser assets");
111
+ assert.match(html, /\/styles\.css\?v=167/, "the stylesheet URL should advance for the bounded conversation tags");
112
+ assert.match(html, /data-app-src="\/app\.js\?v=220"/, "the guarded app URL should advance for current browser wiring");
113
+ assert.match(serviceWorker, /const CACHE_NAME = "pi-webui-pwa-v200"/, "the PWA cache identity should advance with browser assets");
102
114
 
103
115
  assert.match(readme, /one compact tag per conversation appears beneath the composer/i, "the README should explain the user-visible entry point");
104
116
  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");
@@ -4,9 +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 [css, app] = await Promise.all([
7
+ const [css, app, controller] = await Promise.all([
8
8
  readFile(join(root, "public", "styles.css"), "utf8"),
9
9
  readFile(join(root, "public", "app.js"), "utf8"),
10
+ readFile(join(root, "public", "activity-intercom-controller.mjs"), "utf8"),
10
11
  ]);
11
12
 
12
13
  function rule(selector, label) {
@@ -18,14 +19,14 @@ function rule(selector, label) {
18
19
  }
19
20
 
20
21
  function functionSource(name, nextName) {
21
- const start = app.indexOf(`function ${name}(`);
22
+ const start = controller.indexOf(`function ${name}(`);
22
23
  const candidates = [
23
- app.indexOf(`\nfunction ${nextName}(`, start),
24
- app.indexOf(`\nasync function ${nextName}(`, start),
24
+ controller.indexOf(`\n function ${nextName}(`, start),
25
+ controller.indexOf(`\n async function ${nextName}(`, start),
25
26
  ].filter((index) => index > start);
26
27
  const end = Math.min(...candidates);
27
28
  assert.ok(start >= 0 && Number.isFinite(end), `${name} should remain a standalone frontend helper`);
28
- return app.slice(start, end);
29
+ return controller.slice(start, end);
29
30
  }
30
31
 
31
32
  const container = rule(".composer-intercom-tags", "conversation tag container styles");
@@ -33,9 +34,9 @@ const tag = rule(".composer-intercom-tag", "conversation tag styles");
33
34
  const label = rule(".composer-intercom-tag-label", "conversation tag label styles");
34
35
  const icon = rule(".composer-intercom-tag-icon", "conversation tag icon styles");
35
36
  const count = rule(".composer-intercom-tag-count", "conversation tag count styles");
36
- const disclosure = functionSource("setIntercomConversationOverflowOpen", "fitIntercomConversationTags");
37
- const install = functionSource("installIntercomConversationTagResizeHandling", "updateIntercomConversationTag");
38
- const render = functionSource("renderIntercomConversationTags", "refreshIntercomConversationSummaries");
37
+ const disclosure = functionSource("setOverflowOpen", "fitTags");
38
+ const install = functionSource("install", "updateIntercomConversationTag");
39
+ const render = functionSource("renderTags", "refreshSummaries");
39
40
 
40
41
  assert.match(container, /position:\s*relative;/, "the overflow popup should anchor to the conversation tag strip");
41
42
  assert.match(container, /display:\s*inline-flex;/, "conversation tags should remain on one measured row");
@@ -53,13 +54,13 @@ assert.match(icon, /flex:\s*0 0 auto;/, "the conversation icon should stay stabl
53
54
  assert.match(count, /flex:\s*0 0 auto;/, "the conversation count should stay stable while the label shrinks");
54
55
 
55
56
  assert.match(disclosure, /classList\.toggle\("overflow-open", expanded\)[\s\S]*aria-expanded[\s\S]*menu\.hidden = !expanded/, "the +X disclosure should synchronize visual, accessible, and hidden state");
56
- assert.match(install, /ResizeObserver[\s\S]*event\.key !== "Escape"[\s\S]*restoreFocus: true[\s\S]*document\.addEventListener\("pointerdown"/, "resize, Escape, and outside-click handling should keep the disclosure usable");
57
+ assert.match(install, /ResizeObserver[\s\S]*event\.key !== "Escape"[\s\S]*restoreFocus: true[\s\S]*listen\(document, "pointerdown"/, "resize, Escape, and outside-click handling should keep the disclosure usable");
57
58
  assert.match(render, /make\("button", "composer-intercom-tag overflow"[\s\S]*aria-haspopup[\s\S]*intercomConversationOverflowMenu[\s\S]*role", "dialog"/, "the hidden conversation count should render as an accessible popup button");
58
- assert.match(render, /composer-intercom-overflow-menu-item[\s\S]*setIntercomConversationOverflowOpen\(false\);[\s\S]*openIntercomConversation\(conversationId\)/, "hidden conversations should open through the existing conversation dialog");
59
+ assert.match(install, /listen\(container, "click"[\s\S]*setOverflowOpen\(false, \{ restoreFocus: true \}\);[\s\S]*open\(button\.dataset\.intercomConversationId\)/, "hidden conversations should open through the existing conversation dialog");
59
60
  assert.match(css, /\.composer-intercom-overflow-menu \{[\s\S]*position: absolute;[\s\S]*bottom: calc\(100% \+ 0\.42rem\);[\s\S]*max-height:[\s\S]*overflow-y: auto;/, "the bounded popup should expand upward above the compact strip");
60
61
  assert.match(css, /@media \(max-width: 720px\)[\s\S]*?\.composer-intercom-tags \{ flex: 0 0 100%; width: 100%; min-width: 0; max-width: 100%; \}[\s\S]*?\.composer-intercom-overflow-menu \.composer-intercom-tag \{ min-height: 44px; \}/, "narrow disclosures should use the full row and keep hidden conversations touch-friendly");
61
62
  assert.match(css, /body\.mobile-composer-disclosure \.composer-actions-panel > \.composer-context-tags \{[\s\S]*display: flex;[\s\S]*flex-wrap: wrap;/, "the narrow composer disclosure should give the full-width conversation strip its own row");
62
- assert.match(app, /installSessionSkillTagResizeHandling\(\);\s*installIntercomConversationTagResizeHandling\(\);/, "startup should install responsive fitting for both compact tag groups");
63
- assert.match(app, /const visualSignature = JSON\.stringify\(\[label, conversation\.messageCount\]\);[\s\S]*tag\.replaceChildren\(\.\.\.children\);[\s\S]*tag\.dataset\.intercomVisualSignature = visualSignature;/, "unchanged tag visuals should retain their existing children inside the polite live region");
63
+ assert.match(app, /installSessionSkillTagResizeHandling\(\);\s*activityIntercom\.install\(\);/, "startup should install responsive fitting for both compact tag groups");
64
+ assert.match(controller, /const visualSignature = JSON\.stringify\(\[label, conversation\.messageCount\]\);[\s\S]*tag\.replaceChildren\(\.\.\.children\);[\s\S]*tag\.dataset\.intercomVisualSignature = visualSignature;/, "unchanged tag visuals should retain their existing children inside the polite live region");
64
65
 
65
66
  console.log("intercom-tag-layout-static.test.mjs passed");