@wrongstack/webui 0.313.0 → 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.
- package/dist/assets/AgentRosterView-CESYPVXA.js +9 -0
- package/dist/assets/AnalyticsDashboard-zDBIqTxO.js +1 -0
- package/dist/assets/AudienceMemoryPanel-BnNJ0EhQ.js +3 -0
- package/dist/assets/ChangesView-CGwCocSR.js +1 -0
- package/dist/assets/ChimeraReviewsView-CFxZwJBI.js +1 -0
- package/dist/assets/ChronicleDashboard-DKiMK5nl.js +1 -0
- package/dist/assets/CodeEditor-CZcMPNTH.js +2 -0
- package/dist/assets/CodeMap-zPUlmh5G.js +1 -0
- package/dist/assets/ConfirmModal-CUGk-0lT.js +1 -0
- package/dist/assets/{CronJobsPanel-CUPHNDwl.js → CronJobsPanel-C_wutCVP.js} +1 -1
- package/dist/assets/{DeadCodeScanPanel-Dj-5SAEE.js → DeadCodeScanPanel-DCCjg17Q.js} +2 -2
- package/dist/assets/{DebugDashboard-DmgHPeuw.js → DebugDashboard-D-ogYAbO.js} +1 -1
- package/dist/assets/DesignGalleryView-CtlHZWOn.js +1 -0
- package/dist/assets/GoalView-Czksj2nD.js +1 -0
- package/dist/assets/KanbanView-C5_GD0qk.js +3 -0
- package/dist/assets/MailboxDetailView-2rWp3cTv.js +1 -0
- package/dist/assets/MemoryDrawer-D9Chtt6v.js +1 -0
- package/dist/assets/MemoryManager-Bj41s3KW.js +1 -0
- package/dist/assets/ModelPicker-vwrqLOL4.js +1 -0
- package/dist/assets/OfficeMapPanel-BfuePIGH.js +4 -0
- package/dist/assets/ProcessMonitor-CHPTCtyu.js +1 -0
- package/dist/assets/PromptJournalView-tOTjKpi8.js +1 -0
- package/dist/assets/QueuePanel-BIwoG-tG.js +1 -0
- package/dist/assets/RefreshDebugView-DesPEAAq.js +1 -0
- package/dist/assets/RequirementIntakeView-BonXC1a5.js +1 -0
- package/dist/assets/SageTabs-82lpgRh-.js +2 -0
- package/dist/assets/SddFlowGraph-CMedulJi.js +1 -0
- package/dist/assets/SddHub-D3Gm4Io2.js +2 -0
- package/dist/assets/SessionInspectView-BUs2B4mF.js +1 -0
- package/dist/assets/SessionList-DxQgJqgl.js +1 -0
- package/dist/assets/SessionsDashboard-JtwQf-N5.js +1 -0
- package/dist/assets/SetupScreen-XFBFjPbd.js +1 -0
- package/dist/assets/SkillDetailView-C_P_-783.js +3 -0
- package/dist/assets/{SpecsView-Bkrq2hhM.js → SpecsView-D6GqoZ2L.js} +1 -1
- package/dist/assets/TechStackView-BE4tdEYZ.js +2 -0
- package/dist/assets/TerminalPanel-BcizpYrZ.js +1 -0
- package/dist/assets/activity-B2_Vr2oD.js +10 -0
- package/dist/assets/activity-BF1idM4Y.js +10 -0
- package/dist/assets/activity-C-kOJZXC.js +10 -0
- package/dist/assets/activity-DPpMW8BU.js +10 -0
- package/dist/assets/activity-DYMBKGt0.js +10 -0
- package/dist/assets/activity-IxgYWPDt.js +10 -0
- package/dist/assets/activity-q85HXQNv.js +10 -0
- package/dist/assets/{button-Dhmop_yM.js → button-C_EYpeP-.js} +1 -1
- package/dist/assets/{chat-CR2B97dj.js → chat-B5a3cvps.js} +1 -1
- package/dist/assets/{chat-DResBrkV.js → chat-B60h8Cji.js} +1 -1
- package/dist/assets/{chat-BnkVCZ3Q.js → chat-BNWqeV-N.js} +1 -1
- package/dist/assets/chat-BlllxfpP.js +1 -0
- package/dist/assets/{chat-BfQBSiII.js → chat-BvKkSd09.js} +1 -1
- package/dist/assets/{chat-BPuAsrkF.js → chat-DTI7lNDx.js} +1 -1
- package/dist/assets/{chat-Di8o0wDz.js → chat-DlhXGxxi.js} +1 -1
- package/dist/assets/chat-store-x5w4ss_D.js +1 -0
- package/dist/assets/{codemap-activity-store-BWt_a7Gs.js → codemap-activity-store-ZCXcHlwd.js} +1 -1
- package/dist/assets/codemap-index-store-Cb5mn74P.js +1 -0
- package/dist/assets/{dialog-DPl7DolS.js → dialog-9eW9sG90.js} +1 -1
- package/dist/assets/{empty-state-IT10GzRA.js → empty-state-DJb_tw7Q.js} +1 -1
- package/dist/assets/i18n-DkMSw3tI.js +2 -0
- package/dist/assets/index-BSpLtv9S.css +1 -0
- package/dist/assets/index-CTyM4bm8.js +137 -0
- package/dist/assets/{input-C3rIQ26u.js → input-CsEvo8Oo.js} +1 -1
- package/dist/assets/{mailbox-store-DhAVkVJQ.js → mailbox-store-KHcrg_Fm.js} +1 -1
- package/dist/assets/{roster-ws-Vj_HH49O.js → roster-ws-CXnrEaEu.js} +1 -1
- package/dist/assets/settings-1o1gooaL.js +1 -0
- package/dist/assets/settings-BGvRM3vJ.js +1 -0
- package/dist/assets/{settings-BV1_j8_-.js → settings-BV8EFmpH.js} +1 -1
- package/dist/assets/settings-Ci_RMpCQ.js +1 -0
- package/dist/assets/settings-Cy_xp4Jt.js +1 -0
- package/dist/assets/settings-D-LlBmzO.js +1 -0
- package/dist/assets/settings-nWMBX3xS.js +1 -0
- package/dist/assets/{shared-BUXBOqyO.js → shared-sYlGVRJI.js} +1 -1
- package/dist/assets/stores-5ynEAenb.js +7 -0
- package/dist/assets/toasts-BsmyGP95.js +1 -0
- package/dist/assets/toasts-CgXHu8ZB.js +1 -0
- package/dist/assets/toasts-DZ6HdKgG.js +1 -0
- package/dist/assets/toasts-DizCJjAR.js +1 -0
- package/dist/assets/toasts-NC2MT4uN.js +1 -0
- package/dist/assets/toasts-bPl097de.js +1 -0
- package/dist/assets/toasts-tCVo15mP.js +1 -0
- package/dist/assets/ui-store-9b7zzi3V.js +1 -0
- package/dist/assets/useWebSocket-1kxFH7f8.js +27 -0
- package/dist/assets/utils-DIo8iytt.js +1 -0
- package/dist/assets/{vector-memory-panel-CBA4CK6N.js → vector-memory-panel-Dd3jXXYA.js} +1 -1
- package/dist/assets/{vendor-DZ9_OO6N.js → vendor-UFryhfbN.js} +30 -30
- package/dist/assets/view-navigation-ICwpL9qw.js +1 -0
- package/dist/assets/ws-client-Ccf_VLRQ.js +22 -0
- package/dist/components/AgentOfficeView/model.d.ts +4 -3
- package/dist/components/AgentRosterView.d.ts +8 -1
- package/dist/components/ChatInput/composer-button-bar.d.ts +6 -2
- package/dist/components/ChatInput/image-attachments.d.ts +2 -1
- package/dist/components/ChatInput/next-steps-helpers.d.ts +0 -16
- package/dist/components/ChatInput/refine-panel-host.d.ts +2 -2
- package/dist/components/ChatInput/session-effort-select.d.ts +16 -0
- package/dist/components/ChatInput/slash-commands.d.ts +2 -1
- package/dist/components/ChatInput/slash-routing.d.ts +8 -0
- package/dist/components/ChatInput/use-chat-input-mcp.d.ts +2 -1
- package/dist/components/ChatInput/use-paste-drop.d.ts +2 -1
- package/dist/components/ChatInput/use-refine-timeout.d.ts +2 -1
- package/dist/components/ChatInput/use-speech-recognition.d.ts +9 -0
- package/dist/components/ChatView/AgentTabs.d.ts +1 -1
- package/dist/components/ChatView/BrainDecisionCard.d.ts +9 -0
- package/dist/components/ChatView/ChatHeader.d.ts +3 -3
- package/dist/components/ChatView/ChatRowView.d.ts +3 -1
- package/dist/components/ChatView/ChimeraReportCard.d.ts +22 -0
- package/dist/components/ChatView/CouncilDecisionCard.d.ts +9 -0
- package/dist/components/ChatView/auto-collapse.d.ts +2 -1
- package/dist/components/ChatView/useChatViewState.d.ts +14 -28
- package/dist/components/ChatView/utils.d.ts +2 -1
- package/dist/components/ChimeraReviewsView.d.ts +2 -0
- package/dist/components/CodeMapActivityStreamPanel.d.ts +2 -1
- package/dist/components/CodeMapDirectoryTree.d.ts +2 -1
- package/dist/components/CodeMapLiveOverlay.d.ts +0 -3
- package/dist/components/CodeMapSelectedNodeSummary.d.ts +2 -1
- package/dist/components/CollabPanel.d.ts +2 -7
- package/dist/components/ConfirmModal.d.ts +6 -13
- package/dist/components/CronJobsPanel.d.ts +2 -1
- package/dist/components/CustomRosterPanel.d.ts +0 -1
- package/dist/components/DependencyGraph.d.ts +2 -1
- package/dist/components/FileActivityDrawer.d.ts +2 -2
- package/dist/components/FileExplorer/FileExplorerModals.d.ts +11 -6
- package/dist/components/FileExplorer/TreeRow.d.ts +2 -6
- package/dist/components/FileExplorer/tree-helpers.d.ts +7 -0
- package/dist/components/FleetPanel.d.ts +4 -13
- package/dist/components/InspectorPanel.d.ts +6 -1
- package/dist/components/KanbanBoardSidebar.d.ts +2 -1
- package/dist/components/KanbanBoardState.d.ts +1 -1
- package/dist/components/KanbanContractGraphView.d.ts +3 -2
- package/dist/components/KanbanQueueHealthBar.d.ts +2 -1
- package/dist/components/KanbanTaskActivityRecorder.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryDetail.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryEditor.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryFilters.d.ts +2 -1
- package/dist/components/MemoryManager/MemoryList.d.ts +2 -1
- package/dist/components/MemoryManager/MemorySearchBreakdown.d.ts +2 -1
- package/dist/components/MemoryManager/ReviewQueue.d.ts +2 -1
- package/dist/components/MemoryManager/SageTabs.d.ts +2 -1
- package/dist/components/MemoryManager/shared.d.ts +0 -1
- package/dist/components/MessageBubble/FailedRunContinue.d.ts +12 -0
- package/dist/components/MessageBubble/utils.d.ts +6 -0
- package/dist/components/ModelPickDialog.d.ts +1 -1
- package/dist/components/ModelSelectDialog.d.ts +4 -3
- package/dist/components/NextStepsBar.d.ts +1 -6
- package/dist/components/NotificationMenu.d.ts +6 -0
- package/dist/components/OfficeMapCanvas/edges.d.ts +0 -6
- package/dist/components/OfficeMapCanvas/nodes.d.ts +0 -32
- package/dist/components/OfficeMapCanvas/use-recently-finished.d.ts +2 -1
- package/dist/components/OfficeMapCanvas/utils.d.ts +4 -10
- package/dist/components/ProcessMonitor.d.ts +2 -1
- package/dist/components/ProviderWaitingRoom.d.ts +8 -0
- package/dist/components/QueuePanel.d.ts +1 -1
- package/dist/components/QuickModelSwitcher.filter.d.ts +23 -7
- package/dist/components/RestoreTabsModal.d.ts +20 -0
- package/dist/components/SddFlowGraph.d.ts +3 -2
- package/dist/components/SessionTabBar/TabMap.d.ts +19 -0
- package/dist/components/SessionTabBar/summaries.d.ts +39 -0
- package/dist/components/SessionTabBar.d.ts +14 -0
- package/dist/components/SettingsPanel/ClearAllowlistDialog.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelCatalogPicker.d.ts +2 -14
- package/dist/components/SettingsPanel/ModelEffortSelect.d.ts +12 -0
- package/dist/components/SettingsPanel/ModelListEditor.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelSchemaEditor.d.ts +2 -1
- package/dist/components/SettingsPanel/ModelSection.d.ts +3 -1
- package/dist/components/SettingsPanel/ModelTiersSection.d.ts +7 -0
- package/dist/components/SettingsPanel/OAuthLoginSection.d.ts +2 -2
- package/dist/components/SettingsPanel/PluginToggleList.d.ts +3 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.d.ts +2 -1
- package/dist/components/SettingsPanel/ProviderModelsPanel.filter.d.ts +2 -1
- package/dist/components/SettingsPanel/ProviderSection.d.ts +2 -2
- package/dist/components/SettingsPanel/ToolsSection.d.ts +0 -10
- package/dist/components/SettingsPanel/brain-section-options.d.ts +3 -10
- package/dist/components/SettingsPanel/contracts.d.ts +5 -3
- package/dist/components/SettingsPanel/sync-settings-preference.d.ts +8 -0
- package/dist/components/SettingsPanel/undo-send-decision.d.ts +2 -1
- package/dist/components/SidePanel/ChangesPanel.d.ts +0 -6
- package/dist/components/SidePanel/DesignStudioPanel.d.ts +7 -0
- package/dist/components/SidePanel/SessionList.d.ts +6 -6
- package/dist/components/SystemPromptDialog.d.ts +18 -0
- package/dist/components/TaskActivityTimeline.d.ts +3 -3
- package/dist/components/TaskBoard.d.ts +1 -1
- package/dist/components/TaskCard.d.ts +2 -7
- package/dist/components/TaskExecutionAttempts.d.ts +2 -1
- package/dist/components/TaskIntelligencePanel.d.ts +1 -1
- package/dist/components/TaskRiskPanel.d.ts +4 -3
- package/dist/components/TechStackView/DependencyDetail.d.ts +2 -1
- package/dist/components/TechStackView/DependencyTable.d.ts +2 -1
- package/dist/components/TechStackView/FindingsPanel.d.ts +2 -1
- package/dist/components/TechStackView/TechStackToolbar.d.ts +2 -1
- package/dist/components/TechStackView/shared.d.ts +5 -5
- package/dist/components/Toaster.d.ts +3 -31
- package/dist/components/ToolStatsModal.d.ts +15 -0
- package/dist/components/UpdateBanner.d.ts +6 -4
- package/dist/components/WorkbenchTopbar.d.ts +1 -3
- package/dist/components/agent-roster-data.d.ts +1 -1
- package/dist/components/agents/AgentDetailSection.d.ts +2 -1
- package/dist/components/agents/AgentRosterCard.d.ts +2 -1
- package/dist/components/agents/FleetSummaryBar.d.ts +6 -3
- package/dist/components/codemap-model.d.ts +3 -2
- package/dist/components/ui/PickerCardList.d.ts +3 -2
- package/dist/components/ui/badge.d.ts +2 -2
- package/dist/components/ui/button.d.ts +2 -2
- package/dist/components/ui/concurrency-gauge.d.ts +2 -1
- package/dist/components/ui/dialog.d.ts +5 -5
- package/dist/components/ui/dropdown-menu.d.ts +8 -8
- package/dist/components/ui/event-timeline.d.ts +2 -1
- package/dist/components/ui/fleet-agent-row.d.ts +2 -7
- package/dist/components/ui/scroll-area.d.ts +2 -2
- package/dist/components/ui/sheet.d.ts +2 -2
- package/dist/components/ui/sparkline.d.ts +2 -1
- package/dist/components/vector-memory-panel/model.d.ts +2 -7
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useDesktopBridge.d.ts +2 -1
- package/dist/hooks/useF5Resilience.d.ts +0 -14
- package/dist/hooks/useFleetPolling.d.ts +2 -1
- package/dist/hooks/useGlobalKeyboardShortcuts.d.ts +4 -1
- package/dist/hooks/useIntegrationStatus.d.ts +10 -0
- package/dist/hooks/useKanbanMeta.d.ts +4 -3
- package/dist/hooks/useLiveContextDebug.d.ts +4 -3
- package/dist/hooks/useMemoryForFile.d.ts +3 -2
- package/dist/hooks/usePagination.d.ts +2 -1
- package/dist/hooks/useProviderModels.d.ts +1 -0
- package/dist/hooks/useSessionSubscription.d.ts +15 -0
- package/dist/hooks/useViewport.d.ts +2 -3
- package/dist/hooks/useWebSocket.d.ts +6 -1
- package/dist/hooks/ws-handlers/chat-handlers.d.ts +22 -10
- package/dist/hooks/ws-handlers/coordinator-handlers.d.ts +7 -0
- package/dist/hooks/ws-handlers/files-mailbox-handlers.d.ts +1 -3
- package/dist/hooks/ws-handlers/misc-handlers.d.ts +22 -0
- package/dist/hooks/ws-handlers/session-context-handlers.d.ts +24 -2
- package/dist/hooks/ws-handlers/session-execution-handlers.d.ts +13 -0
- package/dist/hooks/ws-handlers/session-handlers.d.ts +3 -3
- package/dist/hooks/ws-handlers/session-replay-handlers.d.ts +31 -2
- package/dist/hooks/ws-handlers/techstack-handlers.d.ts +0 -3
- package/dist/index.html +30 -26
- package/dist/index.js +77838 -67041
- package/dist/lib/agent-office.d.ts +3 -3
- package/dist/lib/agent-session.d.ts +19 -0
- package/dist/lib/agent-status.d.ts +5 -4
- package/dist/lib/completion.d.ts +3 -2
- package/dist/lib/delegate-format.d.ts +33 -0
- package/dist/lib/favicon.d.ts +2 -1
- package/dist/lib/kanban-verification.d.ts +3 -2
- package/dist/lib/model-matrix-routes.d.ts +3 -3
- package/dist/lib/plugin-enablement.d.ts +1 -1
- package/dist/lib/reasoning-effort.d.ts +76 -0
- package/dist/lib/sdd-theme.d.ts +4 -3
- package/dist/lib/task-brief-preview.d.ts +5 -0
- package/dist/lib/terminal-dock.d.ts +0 -1
- package/dist/lib/view-navigation.d.ts +2 -2
- package/dist/lib/ws-client-actions.d.ts +1 -0
- package/dist/lib/ws-client-domain-methods.d.ts +45 -5
- package/dist/lib/ws-client-utils.d.ts +33 -0
- package/dist/lib/ws-client.d.ts +135 -6
- package/dist/manifest.json +17 -0
- package/dist/protocol-compatibility.d.ts +0 -10
- package/dist/stores/auto-submit-streak.d.ts +3 -1
- package/dist/stores/chat-lanes.d.ts +279 -0
- package/dist/stores/chat-retention.d.ts +2 -4
- package/dist/stores/chat-store-types.d.ts +1 -0
- package/dist/stores/chat-store.d.ts +46 -25
- package/dist/stores/chimera-hub-store.d.ts +140 -0
- package/dist/stores/chimera-reports-store.d.ts +45 -0
- package/dist/stores/codemap-activity-store.d.ts +4 -4
- package/dist/stores/context-editor-store.d.ts +4 -5
- package/dist/stores/coordinator-monitor-store.d.ts +3 -2
- package/dist/stores/council-log-store.d.ts +6 -20
- package/dist/stores/file-store.d.ts +32 -13
- package/dist/stores/fleet-store.d.ts +49 -5
- package/dist/stores/git-changes-store.d.ts +25 -1
- package/dist/stores/goal-run-store.d.ts +2 -2
- package/dist/stores/history-store.d.ts +11 -0
- package/dist/stores/index.d.ts +17 -9
- package/dist/stores/local-prefs.d.ts +87 -0
- package/dist/stores/mailbox-store.d.ts +2 -2
- package/dist/stores/memory-injector-store.d.ts +2 -2
- package/dist/stores/memory-lifecycle-store.d.ts +6 -2
- package/dist/stores/monitor-store.d.ts +3 -2
- package/dist/stores/notification-store.d.ts +141 -0
- package/dist/stores/provider-status-store.d.ts +19 -0
- package/dist/stores/restore-tabs-store.d.ts +29 -0
- package/dist/stores/resume-progress-store.d.ts +58 -0
- package/dist/stores/session-inspect-store.d.ts +1 -1
- package/dist/stores/session-lanes.d.ts +242 -0
- package/dist/stores/session-scoped-store.d.ts +56 -0
- package/dist/stores/session-store.d.ts +97 -154
- package/dist/stores/session-tab-store.d.ts +197 -0
- package/dist/stores/side-effect-store.d.ts +9 -1
- package/dist/stores/system-prompt-store.d.ts +48 -0
- package/dist/stores/tool-stats-store.d.ts +52 -0
- package/dist/stores/types.d.ts +81 -4
- package/dist/stores/ui-store.d.ts +113 -11
- package/dist/types/brain.d.ts +17 -16
- package/dist/types/chronicle.d.ts +3 -2
- package/dist/types/client-message.d.ts +139 -23
- package/dist/types/collab.d.ts +0 -2
- package/dist/types/protocol-core.d.ts +62 -6
- package/dist/types/server-message.d.ts +204 -3
- package/dist/types/skills-design.d.ts +2 -1
- package/package.json +9 -9
- package/dist/assets/AgentRosterView-CoAI4zVY.js +0 -9
- package/dist/assets/AnalyticsDashboard-BHKB7MA7.js +0 -1
- package/dist/assets/AudienceMemoryPanel-B1Ddueaa.js +0 -3
- package/dist/assets/ChangesView-DEsqwAdJ.js +0 -1
- package/dist/assets/ChronicleDashboard-CCoGRIP2.js +0 -1
- package/dist/assets/CodeEditor-C8nAvIw1.js +0 -2
- package/dist/assets/CodeMap-BvqQN6MG.js +0 -1
- package/dist/assets/ConfirmModal-CRSE2t_c.js +0 -1
- package/dist/assets/DesignGalleryView-DHVayfgO.js +0 -1
- package/dist/assets/GoalView-BV0HgkVM.js +0 -1
- package/dist/assets/KanbanView-_S_44j5W.js +0 -3
- package/dist/assets/MailboxDetailView-DS0INWjY.js +0 -1
- package/dist/assets/MemoryDrawer-CASOliWm.js +0 -1
- package/dist/assets/MemoryManager-CHJccmRF.js +0 -1
- package/dist/assets/ModelPicker-BD-yKqK0.js +0 -1
- package/dist/assets/OfficeMapPanel-CeK44Zg_.js +0 -4
- package/dist/assets/ProcessMonitor-QErl6IY_.js +0 -1
- package/dist/assets/PromptJournalView-CoLmLGEt.js +0 -1
- package/dist/assets/QueuePanel-rdZBX64y.js +0 -1
- package/dist/assets/RefreshDebugView-CzGncYqB.js +0 -1
- package/dist/assets/RequirementIntakeView-exfkRXjK.js +0 -1
- package/dist/assets/SageTabs-he_mI7tp.js +0 -2
- package/dist/assets/SddFlowGraph-C484p5L9.js +0 -1
- package/dist/assets/SddHub-Fv-cENSK.js +0 -2
- package/dist/assets/SessionInspectView--89Niv2G.js +0 -1
- package/dist/assets/SessionList-DLmayeUi.js +0 -1
- package/dist/assets/SessionsDashboard-DiGHUFnB.js +0 -1
- package/dist/assets/SetupScreen-DHa4BQF7.js +0 -1
- package/dist/assets/SkillDetailView-CQ6luqj6.js +0 -3
- package/dist/assets/TechStackView-B4xMV0Z9.js +0 -2
- package/dist/assets/TerminalPanel-D25-VKJU.js +0 -1
- package/dist/assets/Toaster-CcgCyzaU.js +0 -1
- package/dist/assets/activity-BA8C9ueU.js +0 -9
- package/dist/assets/activity-BYnOci5N.js +0 -9
- package/dist/assets/activity-COQ9xSFu.js +0 -9
- package/dist/assets/activity-CuJqhGz7.js +0 -9
- package/dist/assets/activity-D3ZccGOh.js +0 -9
- package/dist/assets/activity-YMES6OPI.js +0 -9
- package/dist/assets/activity-zlMMaNE1.js +0 -9
- package/dist/assets/chat-CzaGXz_W.js +0 -1
- package/dist/assets/chat-store-BiEXyguk.js +0 -17
- package/dist/assets/codemap-index-store-CDhApwWQ.js +0 -1
- package/dist/assets/i18n-BeHaHx3x.js +0 -2
- package/dist/assets/index-B8J_xxU5.css +0 -1
- package/dist/assets/index-CGMJmLO0.js +0 -134
- package/dist/assets/session-store-CKpAwNIm.js +0 -1
- package/dist/assets/settings-BNbqEBSr.js +0 -1
- package/dist/assets/settings-BsZgLIo2.js +0 -1
- package/dist/assets/settings-C3OnmFrY.js +0 -1
- package/dist/assets/settings-C3bNf1Bx.js +0 -1
- package/dist/assets/settings-C9FOpDBt.js +0 -1
- package/dist/assets/settings-oeXlO4HA.js +0 -1
- package/dist/assets/stores-CHaV9Mb9.js +0 -7
- package/dist/assets/toasts-BCDGDcyq.js +0 -1
- package/dist/assets/toasts-BwQJwYLe.js +0 -1
- package/dist/assets/toasts-CFzweRH5.js +0 -1
- package/dist/assets/toasts-DDYQsJV8.js +0 -1
- package/dist/assets/toasts-DOfXc7Rt.js +0 -1
- package/dist/assets/toasts-Dm12Nq8t.js +0 -1
- package/dist/assets/toasts-frBt6fvE.js +0 -1
- package/dist/assets/ui-store-3HoYrTu5.js +0 -1
- package/dist/assets/useWebSocket-DJWEKY_A.js +0 -29
- package/dist/assets/utils-BecmXwgG.js +0 -1
- package/dist/assets/view-navigation-C1UDTk5R.js +0 -1
- package/dist/assets/ws-client-DXT4gi-N.js +0 -1
package/dist/lib/ws-client.d.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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
|
-
/**
|
|
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
|
|
@@ -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
|
|
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
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|