@wrongstack/webui 0.313.1 → 0.316.1

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 (362) hide show
  1. package/dist/assets/AgentRosterView-CESYPVXA.js +9 -0
  2. package/dist/assets/AnalyticsDashboard-zDBIqTxO.js +1 -0
  3. package/dist/assets/AudienceMemoryPanel-BnNJ0EhQ.js +3 -0
  4. package/dist/assets/ChangesView-CGwCocSR.js +1 -0
  5. package/dist/assets/ChimeraReviewsView-CFxZwJBI.js +1 -0
  6. package/dist/assets/ChronicleDashboard-DKiMK5nl.js +1 -0
  7. package/dist/assets/CodeEditor-CZcMPNTH.js +2 -0
  8. package/dist/assets/CodeMap-zPUlmh5G.js +1 -0
  9. package/dist/assets/ConfirmModal-CUGk-0lT.js +1 -0
  10. package/dist/assets/{CronJobsPanel-BzH_InFe.js → CronJobsPanel-C_wutCVP.js} +1 -1
  11. package/dist/assets/{DeadCodeScanPanel-Dj-5SAEE.js → DeadCodeScanPanel-DCCjg17Q.js} +2 -2
  12. package/dist/assets/{DebugDashboard-C-lpnxsJ.js → DebugDashboard-D-ogYAbO.js} +1 -1
  13. package/dist/assets/DesignGalleryView-CtlHZWOn.js +1 -0
  14. package/dist/assets/GoalView-Czksj2nD.js +1 -0
  15. package/dist/assets/KanbanView-C5_GD0qk.js +3 -0
  16. package/dist/assets/MailboxDetailView-2rWp3cTv.js +1 -0
  17. package/dist/assets/MemoryDrawer-D9Chtt6v.js +1 -0
  18. package/dist/assets/MemoryManager-Bj41s3KW.js +1 -0
  19. package/dist/assets/ModelPicker-vwrqLOL4.js +1 -0
  20. package/dist/assets/OfficeMapPanel-BfuePIGH.js +4 -0
  21. package/dist/assets/ProcessMonitor-CHPTCtyu.js +1 -0
  22. package/dist/assets/PromptJournalView-tOTjKpi8.js +1 -0
  23. package/dist/assets/QueuePanel-BIwoG-tG.js +1 -0
  24. package/dist/assets/RefreshDebugView-DesPEAAq.js +1 -0
  25. package/dist/assets/RequirementIntakeView-BonXC1a5.js +1 -0
  26. package/dist/assets/SageTabs-82lpgRh-.js +2 -0
  27. package/dist/assets/SddFlowGraph-CMedulJi.js +1 -0
  28. package/dist/assets/SddHub-D3Gm4Io2.js +2 -0
  29. package/dist/assets/SessionInspectView-BUs2B4mF.js +1 -0
  30. package/dist/assets/SessionList-DxQgJqgl.js +1 -0
  31. package/dist/assets/SessionsDashboard-JtwQf-N5.js +1 -0
  32. package/dist/assets/SetupScreen-XFBFjPbd.js +1 -0
  33. package/dist/assets/SkillDetailView-C_P_-783.js +3 -0
  34. package/dist/assets/{SpecsView-B9Aj1qpe.js → SpecsView-D6GqoZ2L.js} +1 -1
  35. package/dist/assets/TechStackView-BE4tdEYZ.js +2 -0
  36. package/dist/assets/TerminalPanel-BcizpYrZ.js +1 -0
  37. package/dist/assets/activity-B2_Vr2oD.js +10 -0
  38. package/dist/assets/activity-BF1idM4Y.js +10 -0
  39. package/dist/assets/activity-C-kOJZXC.js +10 -0
  40. package/dist/assets/activity-DPpMW8BU.js +10 -0
  41. package/dist/assets/activity-DYMBKGt0.js +10 -0
  42. package/dist/assets/activity-IxgYWPDt.js +10 -0
  43. package/dist/assets/activity-q85HXQNv.js +10 -0
  44. package/dist/assets/{button-Dhmop_yM.js → button-C_EYpeP-.js} +1 -1
  45. package/dist/assets/{chat-CR2B97dj.js → chat-B5a3cvps.js} +1 -1
  46. package/dist/assets/{chat-DResBrkV.js → chat-B60h8Cji.js} +1 -1
  47. package/dist/assets/{chat-BnkVCZ3Q.js → chat-BNWqeV-N.js} +1 -1
  48. package/dist/assets/chat-BlllxfpP.js +1 -0
  49. package/dist/assets/{chat-BfQBSiII.js → chat-BvKkSd09.js} +1 -1
  50. package/dist/assets/{chat-BPuAsrkF.js → chat-DTI7lNDx.js} +1 -1
  51. package/dist/assets/{chat-Di8o0wDz.js → chat-DlhXGxxi.js} +1 -1
  52. package/dist/assets/chat-store-x5w4ss_D.js +1 -0
  53. package/dist/assets/{codemap-activity-store-BWt_a7Gs.js → codemap-activity-store-ZCXcHlwd.js} +1 -1
  54. package/dist/assets/codemap-index-store-Cb5mn74P.js +1 -0
  55. package/dist/assets/{dialog-DPl7DolS.js → dialog-9eW9sG90.js} +1 -1
  56. package/dist/assets/{empty-state-IT10GzRA.js → empty-state-DJb_tw7Q.js} +1 -1
  57. package/dist/assets/i18n-DkMSw3tI.js +2 -0
  58. package/dist/assets/index-BSpLtv9S.css +1 -0
  59. package/dist/assets/index-CTyM4bm8.js +137 -0
  60. package/dist/assets/{input-C3rIQ26u.js → input-CsEvo8Oo.js} +1 -1
  61. package/dist/assets/{mailbox-store-DhAVkVJQ.js → mailbox-store-KHcrg_Fm.js} +1 -1
  62. package/dist/assets/{roster-ws-Ch6O90eT.js → roster-ws-CXnrEaEu.js} +1 -1
  63. package/dist/assets/settings-1o1gooaL.js +1 -0
  64. package/dist/assets/settings-BGvRM3vJ.js +1 -0
  65. package/dist/assets/{settings-BV1_j8_-.js → settings-BV8EFmpH.js} +1 -1
  66. package/dist/assets/settings-Ci_RMpCQ.js +1 -0
  67. package/dist/assets/settings-Cy_xp4Jt.js +1 -0
  68. package/dist/assets/settings-D-LlBmzO.js +1 -0
  69. package/dist/assets/settings-nWMBX3xS.js +1 -0
  70. package/dist/assets/{shared-BUXBOqyO.js → shared-sYlGVRJI.js} +1 -1
  71. package/dist/assets/stores-5ynEAenb.js +7 -0
  72. package/dist/assets/toasts-BsmyGP95.js +1 -0
  73. package/dist/assets/toasts-CgXHu8ZB.js +1 -0
  74. package/dist/assets/toasts-DZ6HdKgG.js +1 -0
  75. package/dist/assets/toasts-DizCJjAR.js +1 -0
  76. package/dist/assets/toasts-NC2MT4uN.js +1 -0
  77. package/dist/assets/toasts-bPl097de.js +1 -0
  78. package/dist/assets/toasts-tCVo15mP.js +1 -0
  79. package/dist/assets/ui-store-9b7zzi3V.js +1 -0
  80. package/dist/assets/useWebSocket-1kxFH7f8.js +27 -0
  81. package/dist/assets/utils-DIo8iytt.js +1 -0
  82. package/dist/assets/{vector-memory-panel-CBA4CK6N.js → vector-memory-panel-Dd3jXXYA.js} +1 -1
  83. package/dist/assets/{vendor-DZ9_OO6N.js → vendor-UFryhfbN.js} +30 -30
  84. package/dist/assets/view-navigation-ICwpL9qw.js +1 -0
  85. package/dist/assets/ws-client-Ccf_VLRQ.js +22 -0
  86. package/dist/components/AgentOfficeView/model.d.ts +4 -3
  87. package/dist/components/AgentRosterView.d.ts +8 -1
  88. package/dist/components/ChatInput/composer-button-bar.d.ts +6 -2
  89. package/dist/components/ChatInput/image-attachments.d.ts +2 -1
  90. package/dist/components/ChatInput/next-steps-helpers.d.ts +0 -16
  91. package/dist/components/ChatInput/refine-panel-host.d.ts +2 -2
  92. package/dist/components/ChatInput/session-effort-select.d.ts +16 -0
  93. package/dist/components/ChatInput/slash-commands.d.ts +2 -1
  94. package/dist/components/ChatInput/slash-routing.d.ts +8 -0
  95. package/dist/components/ChatInput/use-chat-input-mcp.d.ts +2 -1
  96. package/dist/components/ChatInput/use-paste-drop.d.ts +2 -1
  97. package/dist/components/ChatInput/use-refine-timeout.d.ts +2 -1
  98. package/dist/components/ChatInput/use-speech-recognition.d.ts +9 -0
  99. package/dist/components/ChatView/AgentTabs.d.ts +1 -1
  100. package/dist/components/ChatView/BrainDecisionCard.d.ts +9 -0
  101. package/dist/components/ChatView/ChatHeader.d.ts +3 -3
  102. package/dist/components/ChatView/ChatRowView.d.ts +3 -1
  103. package/dist/components/ChatView/ChimeraReportCard.d.ts +22 -0
  104. package/dist/components/ChatView/CouncilDecisionCard.d.ts +9 -0
  105. package/dist/components/ChatView/auto-collapse.d.ts +2 -1
  106. package/dist/components/ChatView/useChatViewState.d.ts +14 -28
  107. package/dist/components/ChatView/utils.d.ts +2 -1
  108. package/dist/components/ChimeraReviewsView.d.ts +2 -0
  109. package/dist/components/CodeMapActivityStreamPanel.d.ts +2 -1
  110. package/dist/components/CodeMapDirectoryTree.d.ts +2 -1
  111. package/dist/components/CodeMapLiveOverlay.d.ts +0 -3
  112. package/dist/components/CodeMapSelectedNodeSummary.d.ts +2 -1
  113. package/dist/components/CollabPanel.d.ts +2 -7
  114. package/dist/components/ConfirmModal.d.ts +6 -13
  115. package/dist/components/CronJobsPanel.d.ts +2 -1
  116. package/dist/components/CustomRosterPanel.d.ts +0 -1
  117. package/dist/components/DependencyGraph.d.ts +2 -1
  118. package/dist/components/FileActivityDrawer.d.ts +2 -2
  119. package/dist/components/FileExplorer/FileExplorerModals.d.ts +11 -6
  120. package/dist/components/FileExplorer/TreeRow.d.ts +2 -6
  121. package/dist/components/FileExplorer/tree-helpers.d.ts +7 -0
  122. package/dist/components/FleetPanel.d.ts +4 -13
  123. package/dist/components/InspectorPanel.d.ts +6 -1
  124. package/dist/components/KanbanBoardSidebar.d.ts +2 -1
  125. package/dist/components/KanbanBoardState.d.ts +1 -1
  126. package/dist/components/KanbanContractGraphView.d.ts +3 -2
  127. package/dist/components/KanbanQueueHealthBar.d.ts +2 -1
  128. package/dist/components/KanbanTaskActivityRecorder.d.ts +2 -1
  129. package/dist/components/MemoryManager/MemoryDetail.d.ts +2 -1
  130. package/dist/components/MemoryManager/MemoryEditor.d.ts +2 -1
  131. package/dist/components/MemoryManager/MemoryFilters.d.ts +2 -1
  132. package/dist/components/MemoryManager/MemoryList.d.ts +2 -1
  133. package/dist/components/MemoryManager/MemorySearchBreakdown.d.ts +2 -1
  134. package/dist/components/MemoryManager/ReviewQueue.d.ts +2 -1
  135. package/dist/components/MemoryManager/SageTabs.d.ts +2 -1
  136. package/dist/components/MemoryManager/shared.d.ts +0 -1
  137. package/dist/components/MessageBubble/FailedRunContinue.d.ts +12 -0
  138. package/dist/components/MessageBubble/utils.d.ts +6 -0
  139. package/dist/components/ModelPickDialog.d.ts +1 -1
  140. package/dist/components/ModelSelectDialog.d.ts +4 -3
  141. package/dist/components/NextStepsBar.d.ts +1 -6
  142. package/dist/components/NotificationMenu.d.ts +6 -0
  143. package/dist/components/OfficeMapCanvas/edges.d.ts +0 -6
  144. package/dist/components/OfficeMapCanvas/nodes.d.ts +0 -32
  145. package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts +2 -1
  146. package/dist/components/OfficeMapCanvas/utils.d.ts +4 -10
  147. package/dist/components/ProcessMonitor.d.ts +2 -1
  148. package/dist/components/ProviderWaitingRoom.d.ts +8 -0
  149. package/dist/components/QueuePanel.d.ts +1 -1
  150. package/dist/components/QuickModelSwitcher.filter.d.ts +23 -7
  151. package/dist/components/RestoreTabsModal.d.ts +20 -0
  152. package/dist/components/SddFlowGraph.d.ts +3 -2
  153. package/dist/components/SessionTabBar/TabMap.d.ts +19 -0
  154. package/dist/components/SessionTabBar/summaries.d.ts +39 -0
  155. package/dist/components/SessionTabBar.d.ts +14 -0
  156. package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts +2 -1
  157. package/dist/components/SettingsPanel/ModelCatalogPicker.d.ts +2 -14
  158. package/dist/components/SettingsPanel/ModelEffortSelect.d.ts +12 -0
  159. package/dist/components/SettingsPanel/ModelListEditor.d.ts +2 -1
  160. package/dist/components/SettingsPanel/ModelSchemaEditor.d.ts +2 -1
  161. package/dist/components/SettingsPanel/ModelSection.d.ts +3 -1
  162. package/dist/components/SettingsPanel/ModelTiersSection.d.ts +7 -0
  163. package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +2 -2
  164. package/dist/components/SettingsPanel/PluginToggleList.d.ts +3 -1
  165. package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts +2 -1
  166. package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts +2 -1
  167. package/dist/components/SettingsPanel/ProviderSection.d.ts +2 -2
  168. package/dist/components/SettingsPanel/ToolsSection.d.ts +0 -10
  169. package/dist/components/SettingsPanel/brain-section-options.d.ts +3 -10
  170. package/dist/components/SettingsPanel/contracts.d.ts +5 -3
  171. package/dist/components/SettingsPanel/sync-settings-preference.d.ts +8 -0
  172. package/dist/components/SettingsPanel/undo-send-decision.d.ts +2 -1
  173. package/dist/components/SidePanel/ChangesPanel.d.ts +0 -6
  174. package/dist/components/SidePanel/DesignStudioPanel.d.ts +7 -0
  175. package/dist/components/SidePanel/SessionList.d.ts +6 -6
  176. package/dist/components/SystemPromptDialog.d.ts +18 -0
  177. package/dist/components/TaskActivityTimeline.d.ts +3 -3
  178. package/dist/components/TaskBoard.d.ts +1 -1
  179. package/dist/components/TaskCard.d.ts +2 -7
  180. package/dist/components/TaskExecutionAttempts.d.ts +2 -1
  181. package/dist/components/TaskIntelligencePanel.d.ts +1 -1
  182. package/dist/components/TaskRiskPanel.d.ts +4 -3
  183. package/dist/components/TechStackView/DependencyDetail.d.ts +2 -1
  184. package/dist/components/TechStackView/DependencyTable.d.ts +2 -1
  185. package/dist/components/TechStackView/FindingsPanel.d.ts +2 -1
  186. package/dist/components/TechStackView/TechStackToolbar.d.ts +2 -1
  187. package/dist/components/TechStackView/shared.d.ts +5 -5
  188. package/dist/components/Toaster.d.ts +3 -31
  189. package/dist/components/ToolStatsModal.d.ts +15 -0
  190. package/dist/components/UpdateBanner.d.ts +6 -4
  191. package/dist/components/WorkbenchTopbar.d.ts +1 -3
  192. package/dist/components/agent-roster-data.d.ts +1 -1
  193. package/dist/components/agents/AgentDetailSection.d.ts +2 -1
  194. package/dist/components/agents/AgentRosterCard.d.ts +2 -1
  195. package/dist/components/agents/FleetSummaryBar.d.ts +6 -3
  196. package/dist/components/codemap-model.d.ts +3 -2
  197. package/dist/components/ui/PickerCardList.d.ts +3 -2
  198. package/dist/components/ui/badge.d.ts +2 -2
  199. package/dist/components/ui/button.d.ts +2 -2
  200. package/dist/components/ui/concurrency-gauge.d.ts +2 -1
  201. package/dist/components/ui/dialog.d.ts +5 -5
  202. package/dist/components/ui/dropdown-menu.d.ts +8 -8
  203. package/dist/components/ui/event-timeline.d.ts +2 -1
  204. package/dist/components/ui/fleet-agent-row.d.ts +2 -7
  205. package/dist/components/ui/scroll-area.d.ts +2 -2
  206. package/dist/components/ui/sheet.d.ts +2 -2
  207. package/dist/components/ui/sparkline.d.ts +2 -1
  208. package/dist/components/vector-memory-panel/model.d.ts +2 -7
  209. package/dist/hooks/index.d.ts +1 -0
  210. package/dist/hooks/useDesktopBridge.d.ts +2 -1
  211. package/dist/hooks/useF5Resilience.d.ts +0 -14
  212. package/dist/hooks/useFleetPolling.d.ts +2 -1
  213. package/dist/hooks/useGlobalKeyboardShortcuts.d.ts +4 -1
  214. package/dist/hooks/useIntegrationStatus.d.ts +10 -0
  215. package/dist/hooks/useKanbanMeta.d.ts +4 -3
  216. package/dist/hooks/useLiveContextDebug.d.ts +4 -3
  217. package/dist/hooks/useMemoryForFile.d.ts +3 -2
  218. package/dist/hooks/usePagination.d.ts +2 -1
  219. package/dist/hooks/useProviderModels.d.ts +1 -0
  220. package/dist/hooks/useSessionSubscription.d.ts +15 -0
  221. package/dist/hooks/useViewport.d.ts +2 -3
  222. package/dist/hooks/useWebSocket.d.ts +6 -1
  223. package/dist/hooks/ws-handlers/chat-handlers.d.ts +22 -10
  224. package/dist/hooks/ws-handlers/coordinator-handlers.d.ts +7 -0
  225. package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +1 -3
  226. package/dist/hooks/ws-handlers/misc-handlers.d.ts +22 -0
  227. package/dist/hooks/ws-handlers/session-context-handlers.d.ts +24 -2
  228. package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +12 -0
  229. package/dist/hooks/ws-handlers/session-handlers.d.ts +3 -3
  230. package/dist/hooks/ws-handlers/session-replay-handlers.d.ts +31 -2
  231. package/dist/hooks/ws-handlers/techstack-handlers.d.ts +0 -3
  232. package/dist/index.html +30 -26
  233. package/dist/index.js +77572 -66789
  234. package/dist/lib/agent-office.d.ts +3 -3
  235. package/dist/lib/agent-session.d.ts +19 -0
  236. package/dist/lib/agent-status.d.ts +5 -4
  237. package/dist/lib/completion.d.ts +3 -2
  238. package/dist/lib/delegate-format.d.ts +33 -0
  239. package/dist/lib/favicon.d.ts +2 -1
  240. package/dist/lib/kanban-verification.d.ts +3 -2
  241. package/dist/lib/model-matrix-routes.d.ts +3 -3
  242. package/dist/lib/plugin-enablement.d.ts +1 -1
  243. package/dist/lib/reasoning-effort.d.ts +76 -0
  244. package/dist/lib/sdd-theme.d.ts +4 -3
  245. package/dist/lib/task-brief-preview.d.ts +5 -0
  246. package/dist/lib/terminal-dock.d.ts +0 -1
  247. package/dist/lib/view-navigation.d.ts +2 -2
  248. package/dist/lib/ws-client-actions.d.ts +1 -0
  249. package/dist/lib/ws-client-domain-methods.d.ts +45 -5
  250. package/dist/lib/ws-client-utils.d.ts +33 -0
  251. package/dist/lib/ws-client.d.ts +135 -6
  252. package/dist/manifest.json +17 -0
  253. package/dist/protocol-compatibility.d.ts +0 -10
  254. package/dist/stores/auto-submit-streak.d.ts +3 -1
  255. package/dist/stores/chat-lanes.d.ts +279 -0
  256. package/dist/stores/chat-retention.d.ts +2 -4
  257. package/dist/stores/chat-store-types.d.ts +1 -0
  258. package/dist/stores/chat-store.d.ts +46 -25
  259. package/dist/stores/chimera-hub-store.d.ts +140 -0
  260. package/dist/stores/chimera-reports-store.d.ts +45 -0
  261. package/dist/stores/codemap-activity-store.d.ts +4 -4
  262. package/dist/stores/context-editor-store.d.ts +4 -5
  263. package/dist/stores/coordinator-monitor-store.d.ts +3 -2
  264. package/dist/stores/council-log-store.d.ts +6 -20
  265. package/dist/stores/file-store.d.ts +32 -13
  266. package/dist/stores/fleet-store.d.ts +49 -5
  267. package/dist/stores/git-changes-store.d.ts +25 -1
  268. package/dist/stores/goal-run-store.d.ts +2 -2
  269. package/dist/stores/history-store.d.ts +11 -0
  270. package/dist/stores/index.d.ts +17 -9
  271. package/dist/stores/local-prefs.d.ts +87 -0
  272. package/dist/stores/mailbox-store.d.ts +2 -2
  273. package/dist/stores/memory-injector-store.d.ts +2 -2
  274. package/dist/stores/memory-lifecycle-store.d.ts +6 -2
  275. package/dist/stores/monitor-store.d.ts +3 -2
  276. package/dist/stores/notification-store.d.ts +141 -0
  277. package/dist/stores/provider-status-store.d.ts +19 -0
  278. package/dist/stores/restore-tabs-store.d.ts +29 -0
  279. package/dist/stores/resume-progress-store.d.ts +58 -0
  280. package/dist/stores/session-inspect-store.d.ts +1 -1
  281. package/dist/stores/session-lanes.d.ts +242 -0
  282. package/dist/stores/session-scoped-store.d.ts +56 -0
  283. package/dist/stores/session-store.d.ts +97 -154
  284. package/dist/stores/session-tab-store.d.ts +197 -0
  285. package/dist/stores/side-effect-store.d.ts +9 -1
  286. package/dist/stores/system-prompt-store.d.ts +48 -0
  287. package/dist/stores/tool-stats-store.d.ts +52 -0
  288. package/dist/stores/types.d.ts +81 -4
  289. package/dist/stores/ui-store.d.ts +113 -11
  290. package/dist/types/brain.d.ts +17 -16
  291. package/dist/types/chronicle.d.ts +3 -2
  292. package/dist/types/client-message.d.ts +139 -23
  293. package/dist/types/collab.d.ts +0 -2
  294. package/dist/types/protocol-core.d.ts +62 -6
  295. package/dist/types/server-message.d.ts +204 -3
  296. package/dist/types/skills-design.d.ts +2 -1
  297. package/package.json +9 -9
  298. package/dist/assets/AgentRosterView-p5iiedCA.js +0 -9
  299. package/dist/assets/AnalyticsDashboard-B0sbSAxw.js +0 -1
  300. package/dist/assets/AudienceMemoryPanel-DcDONq7t.js +0 -3
  301. package/dist/assets/ChangesView-CD3JR3qY.js +0 -1
  302. package/dist/assets/ChronicleDashboard-3tJUiU7K.js +0 -1
  303. package/dist/assets/CodeEditor-0RJa9mSq.js +0 -2
  304. package/dist/assets/CodeMap-BvqQN6MG.js +0 -1
  305. package/dist/assets/ConfirmModal-CRSE2t_c.js +0 -1
  306. package/dist/assets/DesignGalleryView-BKl6Ce71.js +0 -1
  307. package/dist/assets/GoalView-Db55m-Nq.js +0 -1
  308. package/dist/assets/KanbanView-BQ7duNsz.js +0 -3
  309. package/dist/assets/MailboxDetailView-CgHzqllF.js +0 -1
  310. package/dist/assets/MemoryDrawer-BNTsi4jl.js +0 -1
  311. package/dist/assets/MemoryManager-B4NAvfYx.js +0 -1
  312. package/dist/assets/ModelPicker-BtK3pwfC.js +0 -1
  313. package/dist/assets/OfficeMapPanel-Bk9q12hP.js +0 -4
  314. package/dist/assets/ProcessMonitor-BTndLGIV.js +0 -1
  315. package/dist/assets/PromptJournalView-DbwN6AWe.js +0 -1
  316. package/dist/assets/QueuePanel-Cb1mIIuO.js +0 -1
  317. package/dist/assets/RefreshDebugView-CzGncYqB.js +0 -1
  318. package/dist/assets/RequirementIntakeView-BgKJbUlD.js +0 -1
  319. package/dist/assets/SageTabs-mB6lxkdD.js +0 -2
  320. package/dist/assets/SddFlowGraph-C484p5L9.js +0 -1
  321. package/dist/assets/SddHub-DsD8ORZo.js +0 -2
  322. package/dist/assets/SessionInspectView-DtM6MBbL.js +0 -1
  323. package/dist/assets/SessionList-CCaEa3iW.js +0 -1
  324. package/dist/assets/SessionsDashboard-CxatSEv6.js +0 -1
  325. package/dist/assets/SetupScreen-CBkuOnoN.js +0 -1
  326. package/dist/assets/SkillDetailView-DKVIAnwb.js +0 -3
  327. package/dist/assets/TechStackView-B6WDU-tt.js +0 -2
  328. package/dist/assets/TerminalPanel-Dfkt3xtA.js +0 -1
  329. package/dist/assets/Toaster-CcgCyzaU.js +0 -1
  330. package/dist/assets/activity-BA8C9ueU.js +0 -9
  331. package/dist/assets/activity-BYnOci5N.js +0 -9
  332. package/dist/assets/activity-COQ9xSFu.js +0 -9
  333. package/dist/assets/activity-CuJqhGz7.js +0 -9
  334. package/dist/assets/activity-D3ZccGOh.js +0 -9
  335. package/dist/assets/activity-YMES6OPI.js +0 -9
  336. package/dist/assets/activity-zlMMaNE1.js +0 -9
  337. package/dist/assets/chat-CzaGXz_W.js +0 -1
  338. package/dist/assets/chat-store-BiEXyguk.js +0 -17
  339. package/dist/assets/codemap-index-store-CDhApwWQ.js +0 -1
  340. package/dist/assets/i18n-BeHaHx3x.js +0 -2
  341. package/dist/assets/index-B8J_xxU5.css +0 -1
  342. package/dist/assets/index-BLI23QVE.js +0 -134
  343. package/dist/assets/session-store-CKpAwNIm.js +0 -1
  344. package/dist/assets/settings-BNbqEBSr.js +0 -1
  345. package/dist/assets/settings-BsZgLIo2.js +0 -1
  346. package/dist/assets/settings-C3OnmFrY.js +0 -1
  347. package/dist/assets/settings-C3bNf1Bx.js +0 -1
  348. package/dist/assets/settings-C9FOpDBt.js +0 -1
  349. package/dist/assets/settings-oeXlO4HA.js +0 -1
  350. package/dist/assets/stores-BskP1BVl.js +0 -7
  351. package/dist/assets/toasts-BCDGDcyq.js +0 -1
  352. package/dist/assets/toasts-BwQJwYLe.js +0 -1
  353. package/dist/assets/toasts-CFzweRH5.js +0 -1
  354. package/dist/assets/toasts-DDYQsJV8.js +0 -1
  355. package/dist/assets/toasts-DOfXc7Rt.js +0 -1
  356. package/dist/assets/toasts-Dm12Nq8t.js +0 -1
  357. package/dist/assets/toasts-frBt6fvE.js +0 -1
  358. package/dist/assets/ui-store-3HoYrTu5.js +0 -1
  359. package/dist/assets/useWebSocket-6jp275vG.js +0 -29
  360. package/dist/assets/utils-BecmXwgG.js +0 -1
  361. package/dist/assets/view-navigation-C1UDTk5R.js +0 -1
  362. package/dist/assets/ws-client-C6jAU4nL.js +0 -1
@@ -1,7 +1,7 @@
1
1
  import type { WSClientMessage, WSModelSwitchResult, WSServerMessage, WSUserMessageImage } from '../types';
2
2
  import { type WsClientActionMethods } from './ws-client-actions';
3
- import { type WsClientDomainMethods } from './ws-client-domain-methods';
4
3
  import type { WSSendOptions } from './ws-client-contracts';
4
+ import { type WsClientDomainMethods } from './ws-client-domain-methods';
5
5
  import { type EventHandler, type WsStatus } from './ws-client-utils';
6
6
  export type { WSSendOptions } from './ws-client-contracts';
7
7
  export type { WsStatus };
@@ -51,7 +51,55 @@ declare class WrongStackWebSocketClientBase {
51
51
  */
52
52
  private static readonly PENDING_CONFIRM_TTL_MS;
53
53
  private sessionId;
54
- private sessionSwapPending;
54
+ /**
55
+ * The session this client is currently waiting to be switched to, or
56
+ * `NEW_SESSION_SWAP_TARGET` when it asked the server to CREATE one and does
57
+ * not know the id yet. `null` means no swap is outstanding.
58
+ *
59
+ * This used to be a bare boolean (`sessionSwapPending`), and that is what
60
+ * made four tabs fight each other: `session.start` arrives for background
61
+ * sessions too (another tab's resume answer landing late, a server-side
62
+ * re-announce, a broadcast), and an unkeyed flag was consumed by whichever
63
+ * announcement happened to arrive first. The grant meant for the tab the
64
+ * user clicked was then spent on a DIFFERENT session — which took the
65
+ * foreground — and the click's own answer, arriving with the flag already
66
+ * cleared, was treated as an unrequested re-announce and ignored. That is
67
+ * exactly "I click tab 2 and get tab 1's transcript".
68
+ */
69
+ private pendingSwapTarget;
70
+ /**
71
+ * The session id of the `session.start` currently being dispatched, when it
72
+ * is the answer to THIS client's swap request. Set in `handleMessage`
73
+ * immediately before `emit`, read (and cleared) by `handleSessionStart` via
74
+ * `consumeRequestedSwitch`. Keyed by session id so a grant can never be
75
+ * spent on a different session than the one it was issued for.
76
+ */
77
+ private requestedSwitchSessionId;
78
+ /**
79
+ * Session ids this client has already seen a `session.start` for. Used to
80
+ * recognise the answer to a `session.new`, whose id the client cannot know
81
+ * in advance: the answer is the first RESET announcement naming a session
82
+ * this client has never seen.
83
+ */
84
+ private readonly seenSessionIds;
85
+ /**
86
+ * Should the next `session.subscribe` ask the server for each tab's
87
+ * transcript? True for a page's first declaration and after every
88
+ * reconnect; cleared as soon as one goes out. See `subscribeSessions`.
89
+ */
90
+ private replayOnNextSubscribe;
91
+ /** Last declared open-tab set — see `subscribeSessions`. */
92
+ private subscribedSessionIds;
93
+ /** Minimum spacing between automatic `session_not_ready` retries for ONE session. */
94
+ private static readonly NOT_READY_RETRY_COOLDOWN_MS;
95
+ /** Upper bound on parked retries, so tab churn cannot grow the map forever. */
96
+ private static readonly MAX_ARMED_RESENDS;
97
+ /**
98
+ * Auto-retry parking for a `session_not_ready` refusal: the message the
99
+ * server refused while its session had no live writer, held until that
100
+ * session's `session.start` announces it open again. See `armNotReadyResend`.
101
+ */
102
+ private readonly armedResends;
55
103
  /** Stored last close reason / error message so the UI can show "what
56
104
  * went wrong" while reconnecting instead of a generic spinner. */
57
105
  private lastErrorText;
@@ -67,7 +115,30 @@ declare class WrongStackWebSocketClientBase {
67
115
  get status(): WsStatus;
68
116
  private setStatus;
69
117
  constructor(url?: string);
70
- withSession<T extends Record<string, unknown>>(payload: T): T & {
118
+ /**
119
+ * Stamp the outgoing payload with the session it belongs to.
120
+ *
121
+ * `sessionId` is an explicit override for anything sent on behalf of a tab
122
+ * that is NOT in front — draining a background lane's queue, aborting a
123
+ * background run. Without it the payload inherits the foreground session and
124
+ * the background tab's message starts a run in the wrong session; that is
125
+ * the send-side twin of the cross-tab transcript bleed.
126
+ *
127
+ * "The foreground" is the LANE POINTER — the same value the chat surface
128
+ * renders from — and nothing else. Two weaker sources used to stand in for
129
+ * it and both mis-addressed runs:
130
+ *
131
+ * - `useSessionStore().session?.id` is the lane's SessionInfo, which is
132
+ * null between opening a tab and its `session.start` landing. A message
133
+ * typed in that window fell through to the next fallback.
134
+ * - `this.sessionId` is whatever session announced LAST on this socket,
135
+ * background tabs included. Stamping it sent the foreground tab's message
136
+ * into another tab's session: its transcript grew there, its `isLoading`
137
+ * never cleared here (no `run.result` for a session this tab never ran),
138
+ * and when that other session was mid-run the server answered with
139
+ * "Agent.run() is already in progress on this instance".
140
+ */
141
+ withSession<T extends Record<string, unknown>>(payload: T, sessionId?: string | undefined): T & {
71
142
  sessionId?: string;
72
143
  };
73
144
  /**
@@ -107,6 +178,49 @@ declare class WrongStackWebSocketClientBase {
107
178
  */
108
179
  private flushMessageQueue;
109
180
  private handleMessage;
181
+ /**
182
+ * Is this `session.start` the answer to the swap this client is waiting on?
183
+ *
184
+ * A resume names its target, so it matches by id. A `session.new` cannot —
185
+ * the server invents the id — so its answer is recognised as the first RESET
186
+ * announcement naming a session this client has never seen. Requiring
187
+ * `reset` keeps an unrelated first-sight announcement (a background tab the
188
+ * server announces on its own) from consuming the grant.
189
+ */
190
+ private matchesPendingSwap;
191
+ private rememberSeenSession;
192
+ /**
193
+ * Claim the "this client asked to switch here" grant for ONE session.
194
+ *
195
+ * Read by `handleSessionStart` to decide whether the announced session takes
196
+ * the foreground or merely updates its own lane. Keyed by session id and
197
+ * one-shot: a later re-announce of the same session does not inherit the
198
+ * grant, and an announce for a DIFFERENT session cannot spend it.
199
+ */
200
+ consumeRequestedSwitch(sessionId: string): boolean;
201
+ /**
202
+ * Park ONE automatic retry for a `session_not_ready` refusal.
203
+ *
204
+ * The refusal means the session is not open in the runtime yet (placeholder
205
+ * writer — the F5-restored-tab case): resuming it and resending exactly what
206
+ * was refused is safe and expected. The cooldown makes the retry one-shot
207
+ * per window, so a resume→announce→resend→refuse race degrades to the
208
+ * ordinary error bubble on the second refusal instead of ping-ponging
209
+ * forever. Returns false while on cooldown — the caller then renders the
210
+ * refusal as a normal error (manual recovery).
211
+ */
212
+ armNotReadyResend(sessionId: string, message: {
213
+ content: string;
214
+ freshContext?: boolean | undefined;
215
+ images?: WSUserMessageImage[] | undefined;
216
+ }): boolean;
217
+ /**
218
+ * Fire the armed retry once the refused session announces itself live.
219
+ *
220
+ * Guarded on the lane still existing: a tab closed while the retry was
221
+ * parked must not start a server-side run nobody is watching.
222
+ */
223
+ private consumeArmedResend;
110
224
  /**
111
225
  * Drop `pendingConfirms` entries whose TTL has passed. Entries are
112
226
  * created when a `tool.confirm_needed` message arrives and only
@@ -151,14 +265,29 @@ declare class WrongStackWebSocketClientBase {
151
265
  type: K;
152
266
  }>) => void): void;
153
267
  off(eventType: string, handler: EventHandler): void;
154
- sendMessage(content: string, images?: WSUserMessageImage[], freshContext?: boolean): string;
268
+ sendMessage(content: string, images?: WSUserMessageImage[], freshContext?: boolean, sessionId?: string | undefined): string;
269
+ /** Ask the server for the persisted Chimera review reports of a session. */
270
+ getChimeraReports(sessionId?: string | undefined): void;
155
271
  adviseTopic(prompt: string, timeoutMs?: number): Promise<Extract<WSServerMessage, {
156
272
  type: 'topic.advice_result';
157
273
  }>['payload']>;
158
274
  /** Send a mailbox message of the given type (btw, steer, note, etc.)
159
275
  * to a target agent/role. Returns the requestId for response tracking. */
160
- sendMailboxMessage(opts: WSMailboxSendOptions): string;
161
- sendAbort(): void;
276
+ sendMailboxMessage(opts: WSMailboxSendOptions, sessionId?: string | undefined): string;
277
+ sendAbort(sessionId?: string | undefined): void;
278
+ /**
279
+ * Tell the server every session this page is displaying.
280
+ *
281
+ * Four tabs share ONE socket, so the server cannot infer the open set from
282
+ * the last message's `sessionId` — it would filter the other three tabs'
283
+ * runs out of every broadcast, and a background tab would simply stop
284
+ * producing output. Re-sent in full on every tab open/close (it replaces,
285
+ * it does not merge) and re-sent on reconnect, since the server forgets the
286
+ * set with the connection.
287
+ */
288
+ subscribeSessions(sessionIds: string[]): void;
289
+ /** Forget the declared set so the next call re-sends it (used on reconnect). */
290
+ clearSessionSubscription(): void;
162
291
  sendConfirm(id: string, decision: 'yes' | 'no' | 'always' | 'deny'): void;
163
292
  switchModel(provider: string, model: string, timeoutMs?: number): Promise<WSModelSwitchResult['payload']>;
164
293
  shutdownCodebaseIndexServer(timeoutMs?: number): Promise<Extract<WSServerMessage, {
@@ -0,0 +1,17 @@
1
+ {
2
+ "short_name": "WrongStack",
3
+ "name": "WrongStack Operator Workbench",
4
+ "description": "WrongStack WebUI Operator Workbench",
5
+ "icons": [
6
+ {
7
+ "src": "/wrongstack.svg",
8
+ "type": "image/svg+xml",
9
+ "sizes": "192x192 512x512 any"
10
+ }
11
+ ],
12
+ "start_url": "/",
13
+ "background_color": "#090a0f",
14
+ "theme_color": "#090a0f",
15
+ "display": "standalone",
16
+ "orientation": "any"
17
+ }
@@ -1,12 +1,2 @@
1
- import type { CanonicalClientMessageType, CanonicalServerMessageType } from '@wrongstack/webui-protocol';
2
- import type { WSClientMessageCore, WSServerMessage } from './types.js';
3
- type AssertNever<T extends never> = T;
4
- /**
5
- * Compile-time bridge while payload-rich surface types remain in this package.
6
- * A newly added detailed message cannot compile until the canonical runtime
7
- * registry represents its wire name in the matching direction.
8
- */
9
- export type UnregisteredClientSurfaceMessage = AssertNever<Exclude<WSClientMessageCore['type'], CanonicalClientMessageType>>;
10
- export type UnregisteredServerSurfaceMessage = AssertNever<Exclude<WSServerMessage['type'], CanonicalServerMessageType>>;
11
1
  export {};
12
2
  //# sourceMappingURL=protocol-compatibility.d.ts.map
@@ -53,7 +53,9 @@ interface UseAutoSubmitStreak {
53
53
  /** Reset the cap-warning flag — call when autonomy mode changes */
54
54
  resetCapWarned: () => void;
55
55
  }
56
- /** Module-level streak reset when the page hard-reloads (acceptable tradeoff) */
56
+ /** Drop a closed tab's bookkeeping. */
57
+ export declare function disposeStreakState(sessionId: string): void;
58
+ /** Per-session streak — reset when the page hard-reloads (acceptable tradeoff) */
57
59
  export declare function useAutoSubmitStreak(): UseAutoSubmitStreak;
58
60
  export {};
59
61
  //# sourceMappingURL=auto-submit-streak.d.ts.map
@@ -0,0 +1,279 @@
1
+ /**
2
+ * chat-lanes.ts — The chat surface's per-session source of truth.
3
+ *
4
+ * ONE LANE PER TAB. Four tabs, four lanes, no shared mutable chat state
5
+ * between them. Think of them as four side-by-side layouts that happen to be
6
+ * stacked: nothing in lane 2 can be observed or written by lane 1, background
7
+ * included.
8
+ *
9
+ * Why this exists (the bug it replaces): the chat surface used to be a single
10
+ * live store plus a `memorySessionCaches` map of parked snapshots. Every WS
11
+ * writer therefore had to ask "is this event for the tab in front?" and drop it
12
+ * otherwise. That is a NEGATIVE routing rule, and it fails two ways:
13
+ *
14
+ * 1. One writer that forgets the guard appends another session's tokens to
15
+ * whatever transcript happens to be in front. That is the bleed.
16
+ * 2. Even when every guard is right, a background tab's own output is
17
+ * DROPPED — it was never written anywhere — so switching back showed a
18
+ * transcript frozen at the moment you left.
19
+ *
20
+ * Lanes make routing POSITIVE: an event names its session, the router hands
21
+ * back that session's lane, and the write lands there. A message that names no
22
+ * session, or names a session with no lane, is dropped by the router — never
23
+ * mis-delivered. There is no "current lane" a writer can accidentally reach.
24
+ *
25
+ * `chat-store.ts` is a thin read/write facade over `lanes[activeSessionId]` so
26
+ * the foreground components keep their existing API.
27
+ */
28
+ import type { QueuedItem, ToolExecution } from './chat-store-types';
29
+ import type { ChatMessage } from './types.js';
30
+ /**
31
+ * Hard ceiling on concurrent lanes. Four tabs, four lanes, no exceptions —
32
+ * and the server accepts exactly this many declared sessions per connection,
33
+ * hence the shared constant rather than a second 4 that could drift from it.
34
+ */
35
+ export declare const MAX_LANES = 4;
36
+ /**
37
+ * Lane used before any session exists (boot, setup screen, tests that never
38
+ * start a session). `adoptDefaultLane` hands its contents to the first real
39
+ * session so a message typed before `session.start` lands is not lost.
40
+ */
41
+ export declare const DEFAULT_LANE_ID = "__unbound__";
42
+ /** Everything the chat surface owns for ONE session. Plain data only. */
43
+ export interface ChatLaneData {
44
+ messages: ChatMessage[];
45
+ currentAssistantMessageId: string | null;
46
+ currentToolId: string | null;
47
+ isLoading: boolean;
48
+ abortController: AbortController | null;
49
+ executions: Map<string, ToolExecution>;
50
+ toolMessageIdsByUseId: Map<string, string>;
51
+ queue: QueuedItem[];
52
+ runStart: {
53
+ at: number;
54
+ cost: number;
55
+ } | null;
56
+ refining: boolean;
57
+ pendingRefinement: {
58
+ text: string;
59
+ images: Array<{
60
+ data: string;
61
+ mime: string;
62
+ }>;
63
+ mode: QueuedItem['mode'];
64
+ } | null;
65
+ thinkingBuffer: string;
66
+ thinkingStartedAt: number | null;
67
+ thinkingLogBuffer: string;
68
+ thinkingLogStartedAt: number | null;
69
+ /**
70
+ * An approval prompt raised while this tab was in the BACKGROUND.
71
+ *
72
+ * A modal is the loudest possible cross-tab bleed, so a background tab's
73
+ * prompt is never opened over the tab in front. It is parked here instead
74
+ * and opened when the user switches to the tab that raised it — without
75
+ * this the prompt was simply discarded and the run sat blocked behind an
76
+ * attention dot with no way to answer it.
77
+ */
78
+ pendingConfirm: PendingConfirm | null;
79
+ /**
80
+ * A provider-fallback prompt raised while this tab was in the BACKGROUND.
81
+ *
82
+ * Same reasoning as `pendingConfirm`: the fallback dialog is one global
83
+ * surface, so a background tab's prompt must not open over the tab in front.
84
+ * It used to be DROPPED instead — the run then sat behind a question nobody
85
+ * could answer until the server's countdown auto-switched the model on its
86
+ * own, which is a route change the user never chose.
87
+ */
88
+ pendingFallback: LaneFallbackPrompt | null;
89
+ }
90
+ /** The provider-fallback prompt payload, as the dialog needs it. */
91
+ interface LaneFallbackPrompt {
92
+ requestId: string;
93
+ from: {
94
+ providerId: string;
95
+ model: string;
96
+ };
97
+ status: number;
98
+ candidates: Array<{
99
+ providerId: string;
100
+ model: string;
101
+ }>;
102
+ autoSwitchSeconds: number;
103
+ timestamp: number;
104
+ }
105
+ /** The tool-approval prompt payload, as the dialog needs it. */
106
+ export interface PendingConfirm {
107
+ id: string;
108
+ toolName: string;
109
+ input: unknown;
110
+ suggestedPattern: string;
111
+ decisionSource?: string | undefined;
112
+ riskTier?: 'safe' | 'standard' | 'destructive' | undefined;
113
+ boundaryReason?: string | undefined;
114
+ }
115
+ /**
116
+ * Stable empty lane handed to selectors that ask for a lane which does not
117
+ * exist. Must be a singleton: returning a fresh object would make every
118
+ * `useChatStore((s) => s.messages)` re-render on every store touch.
119
+ */
120
+ export declare const EMPTY_LANE: ChatLaneData;
121
+ interface ChatLanesState {
122
+ lanes: Record<string, ChatLaneData>;
123
+ /** Which lane the chat surface renders. Owned by the tab registry. */
124
+ activeSessionId: string;
125
+ }
126
+ export declare const useChatLanes: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ChatLanesState>, "persist" | "setState"> & {
127
+ setState(partial: ChatLanesState | Partial<ChatLanesState> | ((state: ChatLanesState) => ChatLanesState | Partial<ChatLanesState>), replace?: false | undefined): unknown;
128
+ setState(state: ChatLanesState | ((state: ChatLanesState) => ChatLanesState), replace: true): unknown;
129
+ persist: {
130
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ChatLanesState, {
131
+ lanes: {
132
+ [k: string]: {
133
+ messages: ChatMessage[];
134
+ queue: QueuedItem[];
135
+ thinkingLogBuffer: string;
136
+ };
137
+ };
138
+ }, unknown>>) => void;
139
+ clearStorage: () => void;
140
+ rehydrate: () => Promise<void> | void;
141
+ hasHydrated: () => boolean;
142
+ onHydrate: (fn: (state: ChatLanesState) => void) => () => void;
143
+ onFinishHydration: (fn: (state: ChatLanesState) => void) => () => void;
144
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<ChatLanesState, {
145
+ lanes: {
146
+ [k: string]: {
147
+ messages: ChatMessage[];
148
+ queue: QueuedItem[];
149
+ thinkingLogBuffer: string;
150
+ };
151
+ };
152
+ }, unknown>>;
153
+ };
154
+ }>;
155
+ /** Read a lane's data, or the shared empty lane when it does not exist. */
156
+ export declare function readLane(sessionId: string | null | undefined): ChatLaneData;
157
+ export declare function hasLane(sessionId: string | null | undefined): boolean;
158
+ export declare function laneIds(): string[];
159
+ /** Create the lane if missing. Returns the sessionId for chaining. */
160
+ export declare function ensureLane(sessionId: string): string;
161
+ /** Subscribe to lane disposal. Returns an unsubscribe. */
162
+ export declare function onLaneDisposed(fn: (sessionId: string) => void): () => void;
163
+ export declare function disposeLane(sessionId: string): void;
164
+ /**
165
+ * Hand the pre-session (`__unbound__`) lane's contents to a real session.
166
+ * Only ever moves the default lane, and only into an empty target — a real
167
+ * lane's transcript is never overwritten by this.
168
+ */
169
+ export declare function adoptDefaultLane(sessionId: string): void;
170
+ /** Point the foreground at a lane, creating it if needed. */
171
+ export declare function setActiveLane(sessionId: string | null): void;
172
+ export declare function activeLaneId(): string;
173
+ export interface ChatLaneActions {
174
+ readonly sessionId: string;
175
+ readonly messages: ChatMessage[];
176
+ readonly currentAssistantMessageId: string | null;
177
+ readonly currentToolId: string | null;
178
+ readonly isLoading: boolean;
179
+ readonly abortController: AbortController | null;
180
+ readonly executions: Map<string, ToolExecution>;
181
+ readonly toolMessageIdsByUseId: Map<string, string>;
182
+ readonly queue: QueuedItem[];
183
+ readonly runStart: {
184
+ at: number;
185
+ cost: number;
186
+ } | null;
187
+ readonly refining: boolean;
188
+ readonly pendingRefinement: ChatLaneData['pendingRefinement'];
189
+ readonly thinkingBuffer: string;
190
+ readonly thinkingStartedAt: number | null;
191
+ readonly thinkingLogBuffer: string;
192
+ readonly thinkingLogStartedAt: number | null;
193
+ readonly pendingConfirm: PendingConfirm | null;
194
+ addMessage: (msg: Omit<ChatMessage, 'id' | 'timestamp'> & {
195
+ id?: string;
196
+ timestamp?: number;
197
+ }) => string;
198
+ setMessages: (messages: ChatMessage[]) => void;
199
+ updateMessage: (id: string, updates: Partial<ChatMessage>) => void;
200
+ appendToMessage: (id: string, text: string) => void;
201
+ finalizeMessage: (id: string, opts?: {
202
+ final?: boolean;
203
+ }) => void;
204
+ setToolResult: (id: string, result: string, ok: boolean) => void;
205
+ appendToolProgress: (id: string, line: string) => void;
206
+ appendToolProgressLines: (id: string, lines: string[]) => void;
207
+ getToolMessageId: (toolUseId: string) => string | undefined;
208
+ setToolResultByUseId: (toolUseId: string, result: string, ok: boolean) => void;
209
+ appendToolProgressLinesByUseId: (toolUseId: string, lines: string[]) => void;
210
+ setLoading: (loading: boolean) => void;
211
+ setAbortController: (ctrl: AbortController | null) => void;
212
+ clearMessages: () => void;
213
+ setCurrentAssistantMessage: (id: string | null) => void;
214
+ setCurrentToolId: (id: string | null) => void;
215
+ truncateAfter: (id: string) => void;
216
+ addExecution: (exec: ToolExecution) => void;
217
+ updateExecution: (id: string, updates: Partial<ToolExecution>) => void;
218
+ enqueue: (text: string, mode?: QueuedItem['mode'], images?: QueuedItem['images'], alreadyDispatched?: boolean) => void;
219
+ dequeue: () => QueuedItem | null;
220
+ dequeueDrainable: () => QueuedItem | null;
221
+ removeQueued: (idx: number) => void;
222
+ clearQueue: () => void;
223
+ setRefining: (v: boolean) => void;
224
+ /** Park (or clear) this tab's unanswered approval prompt. */
225
+ setPendingConfirm: (confirm: PendingConfirm | null) => void;
226
+ setPendingFallback: (prompt: LaneFallbackPrompt | null) => void;
227
+ setPendingRefinement: (text: string | null, images?: Array<{
228
+ data: string;
229
+ mime: string;
230
+ }>, mode?: QueuedItem['mode']) => void;
231
+ removeMessage: (id: string) => void;
232
+ updateLastUserMessage: (text: string) => void;
233
+ setRunStart: (s: {
234
+ at: number;
235
+ cost: number;
236
+ } | null) => void;
237
+ appendThinking: (text: string) => void;
238
+ clearThinking: () => void;
239
+ flushThinkingLog: (iteration: number) => void;
240
+ clearThinkingLog: () => void;
241
+ /** Bulk patch — used by the facade's `setState` and by replay hydration. */
242
+ patch: (updates: Partial<ChatLaneData>) => void;
243
+ }
244
+ /**
245
+ * The one way to write chat state. `sessionId` is mandatory: there is no
246
+ * "current" lane an action can fall back to, which is what makes cross-tab
247
+ * bleed unrepresentable rather than merely guarded against.
248
+ */
249
+ /**
250
+ * Retire an approval prompt once it has been answered, wherever it is parked.
251
+ *
252
+ * Keyed on the prompt id rather than the tab, because a prompt can be resolved
253
+ * from outside the tab that raised it — turning YOLO on makes the server
254
+ * auto-approve everything pending. A stale parked prompt would then re-open a
255
+ * dead dialog the next time the user switched to that tab.
256
+ */
257
+ export declare function resolvePendingConfirm(confirmId: string): void;
258
+ /**
259
+ * Retire a parked fallback prompt by request id, wherever it is parked.
260
+ *
261
+ * The answer (or the server's own countdown) settles the request for good, so
262
+ * the copy must not survive to open a dead dialog on the next tab switch —
263
+ * the same retirement `resolvePendingConfirm` performs for approvals.
264
+ */
265
+ export declare function resolvePendingFallback(requestId: string): void;
266
+ export declare function chatLane(sessionId: string): ChatLaneActions;
267
+ /**
268
+ * Replace one or more of a lane's actions in place.
269
+ *
270
+ * The action object is a per-session singleton, so this is how a caller
271
+ * substitutes behaviour for a specific tab — and how tests keep the
272
+ * `useChatStore.setState({ clearMessages: fn })` idiom the single store
273
+ * supported. Overrides live until the lane is disposed.
274
+ */
275
+ export declare function overrideLaneActions(sessionId: string, patch: Partial<Record<keyof ChatLaneActions, unknown>>): void;
276
+ /** Actions bound to the lane currently in front. Foreground UI only. */
277
+ export declare function activeChatLane(): ChatLaneActions;
278
+ export {};
279
+ //# sourceMappingURL=chat-lanes.d.ts.map
@@ -1,4 +1,4 @@
1
- import type { ChatRetentionBudget } from './chat-store-types';
1
+ import type { ChatRetentionBudget, ToolExecution } from './chat-store-types';
2
2
  import type { ChatMessage } from './types.js';
3
3
  export declare function dedupeRepeatedBlocks(text: string): string;
4
4
  export declare const MAX_CHAT_MESSAGES = 1000;
@@ -6,9 +6,7 @@ export declare const MAX_PERSISTED_MESSAGES = 200;
6
6
  export declare const MAX_CHAT_RETAINED_BYTES: number;
7
7
  export declare const MAX_CHAT_FIELD_CHARS: number;
8
8
  export declare function boundChatField(text: string, maxChars?: number): string;
9
- export declare function estimateUnknownBytes(value: unknown): number;
10
- export declare function normalizeRetainedMessage(message: ChatMessage, maxFieldChars: number): ChatMessage;
11
- export declare function retainedChatMessageBytes(message: ChatMessage): number;
12
9
  export declare function retainWebChatMessages(messages: readonly ChatMessage[], budget?: ChatRetentionBudget): ChatMessage[];
13
10
  export declare function indexToolMessages(messages: readonly ChatMessage[]): Map<string, string>;
11
+ export declare function indexToolExecutions(messages: readonly ChatMessage[]): Map<string, ToolExecution>;
14
12
  //# sourceMappingURL=chat-retention.d.ts.map
@@ -102,5 +102,6 @@ export interface ChatState {
102
102
  clearThinking: () => void;
103
103
  flushThinkingLog: (iteration: number) => void;
104
104
  clearThinkingLog: () => void;
105
+ switchSession: (newSessionId: string) => void;
105
106
  }
106
107
  //# sourceMappingURL=chat-store-types.d.ts.map
@@ -1,30 +1,51 @@
1
+ /**
2
+ * chat-store.ts — Foreground view over the lane registry.
3
+ *
4
+ * The chat surface's real state lives in `chat-lanes.ts`, one lane per session
5
+ * tab. This module is the read/write facade the FOREGROUND components use: it
6
+ * projects `lanes[activeSessionId]` behind the historical `useChatStore` API so
7
+ * a component that renders the tab in front keeps working unchanged.
8
+ *
9
+ * Rules that keep the four tabs from bleeding into each other:
10
+ *
11
+ * - WS handlers MUST NOT use this facade. They route by `payload.sessionId`
12
+ * through `chatFor(msg)` / `chatLane(sessionId)`. Writing through the facade
13
+ * from a handler is exactly the "wrote to whichever tab happened to be in
14
+ * front" bug; `tests/hooks/ws-handlers-lane-routing.test.ts` fails the build
15
+ * if a handler reaches for it.
16
+ * - The facade has no cross-lane reach. `useChatStore.getState()` can only see
17
+ * and touch the active lane; there is no path from here to lane 2.
18
+ */
19
+ import { useChatLanes } from './chat-lanes';
1
20
  import type { ChatState } from './chat-store-types';
2
21
  export declare const MAX_CHAT_MESSAGES = 1000;
3
22
  export declare const MAX_PERSISTED_MESSAGES = 200;
4
- export * from './chat-store-types';
5
- export { boundChatField, dedupeRepeatedBlocks, indexToolMessages, MAX_CHAT_FIELD_CHARS, MAX_CHAT_RETAINED_BYTES, retainWebChatMessages, } from './chat-retention';
23
+ export { activeChatLane, activeLaneId, adoptDefaultLane, type ChatLaneActions, type ChatLaneData, chatLane, DEFAULT_LANE_ID, disposeLane, ensureLane, hasLane, laneIds, MAX_LANES, readLane, setActiveLane, useChatLanes, } from './chat-lanes';
6
24
  export { BTW_DISPATCH_GRACE_MS } from './chat-queue-helpers';
7
- export declare const useChatStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<ChatState>, "persist" | "setState"> & {
8
- setState(partial: ChatState | Partial<ChatState> | ((state: ChatState) => ChatState | Partial<ChatState>), replace?: false | undefined): unknown;
9
- setState(state: ChatState | ((state: ChatState) => ChatState), replace: true): unknown;
10
- persist: {
11
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<ChatState, {
12
- messages: ChatState['messages'];
13
- queue: ChatState['queue'];
14
- boundSessionId: string | null;
15
- thinkingLogBuffer: string;
16
- }, unknown>>) => void;
17
- clearStorage: () => void;
18
- rehydrate: () => Promise<void> | void;
19
- hasHydrated: () => boolean;
20
- onHydrate: (fn: (state: ChatState) => void) => () => void;
21
- onFinishHydration: (fn: (state: ChatState) => void) => () => void;
22
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<ChatState, {
23
- messages: ChatState['messages'];
24
- queue: ChatState['queue'];
25
- boundSessionId: string | null;
26
- thinkingLogBuffer: string;
27
- }, unknown>>;
28
- };
29
- }>;
25
+ export { boundChatField, dedupeRepeatedBlocks, indexToolExecutions, indexToolMessages, MAX_CHAT_FIELD_CHARS, MAX_CHAT_RETAINED_BYTES, retainWebChatMessages, } from './chat-retention';
26
+ export * from './chat-store-types';
27
+ declare function getState(): ChatState;
28
+ /**
29
+ * Merge a patch into the ACTIVE lane. Kept for components and tests that drive
30
+ * the store directly; `boundSessionId` is honoured as a lane switch.
31
+ */
32
+ declare function setState(partial: Partial<ChatState> | ((state: ChatState) => Partial<ChatState>)): void;
33
+ declare function subscribe(listener: (state: ChatState, prev: ChatState) => void): () => void;
34
+ interface ChatStoreFacade {
35
+ <T>(selector: (state: ChatState) => T): T;
36
+ getState: typeof getState;
37
+ getInitialState: typeof getState;
38
+ setState: typeof setState;
39
+ subscribe: typeof subscribe;
40
+ /** The lane registry's own persist API (rehydrate/flush/clearStorage). */
41
+ persist: (typeof useChatLanes)['persist'];
42
+ }
43
+ /**
44
+ * Foreground chat state. Reads and writes the ACTIVE lane only.
45
+ *
46
+ * Not a real Zustand store — a projection over `useChatLanes`. Everything a
47
+ * component needs (selector subscription, `getState`, `setState`, `subscribe`)
48
+ * is here; what is deliberately absent is any way to name another session.
49
+ */
50
+ export declare const useChatStore: ChatStoreFacade;
30
51
  //# sourceMappingURL=chat-store.d.ts.map