@ai-matrx/chat 0.5.0 → 0.5.3

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 (512) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/action-requests/components/ActionRequestAnswerForm.js +313 -209
  3. package/dist/action-requests/components/ActionRequestInlineAnswer.js +9 -2
  4. package/dist/action-requests/components/ParkedOnPersonCard.js +17 -4
  5. package/dist/action-requests/hooks/useToolAction.js +25 -15
  6. package/dist/agent-copy/AlchemySurfaceBridge.js +2 -1
  7. package/dist/agent-copy/RichCopySplit.js +20 -15
  8. package/dist/agents/coding-session-reply/CodingReplyNotice.js +39 -14
  9. package/dist/agents/components/AutoSubmitForm.js +2 -1
  10. package/dist/agents/components/agent-widgets/AgentChatBubble.js +44 -32
  11. package/dist/agents/components/agent-widgets/AgentChatHistorySidebar.js +46 -27
  12. package/dist/agents/components/agent-widgets/AgentCompactModal.js +16 -13
  13. package/dist/agents/components/agent-widgets/AgentFlexiblePanel.js +11 -10
  14. package/dist/agents/components/agent-widgets/AgentFloatingChat.js +6 -5
  15. package/dist/agents/components/agent-widgets/AgentFullModal.js +15 -12
  16. package/dist/agents/components/agent-widgets/AgentInlineOverlay.js +40 -32
  17. package/dist/agents/components/agent-widgets/AgentPanelOverlay.js +11 -10
  18. package/dist/agents/components/agent-widgets/AgentSidebarOverlay.js +11 -10
  19. package/dist/agents/components/agent-widgets/AgentToastOverlay.js +107 -86
  20. package/dist/agents/components/agent-widgets/ChatCollapsible.js +51 -42
  21. package/dist/agents/components/agent-widgets/chat-assistant/AgentChatAssistant.js +43 -30
  22. package/dist/agents/components/agent-widgets/chat-assistant/AssistantCardStack.js +49 -41
  23. package/dist/agents/components/agent-widgets/chat-assistant/AssistantControlBar.js +59 -45
  24. package/dist/agents/components/agent-widgets/chat-assistant/AssistantMessageCard.js +21 -14
  25. package/dist/agents/components/agent-widgets/chat-assistant/ChatAssistantVariableInputs.js +87 -67
  26. package/dist/agents/components/agent-widgets/chat-assistant/CompactAssistantInput.js +91 -73
  27. package/dist/agents/components/agent-widgets/chat-assistant/StatusCard.js +8 -1
  28. package/dist/agents/components/agent-widgets/chat-assistant/UserMessageCard.js +5 -1
  29. package/dist/agents/components/agent-widgets/execution-gates/AgentGateInput.js +36 -35
  30. package/dist/agents/components/agent-widgets/execution-gates/PreExecutionCard.js +39 -27
  31. package/dist/agents/components/ambient-assistant/ScrollAssistantLauncher.js +3 -2
  32. package/dist/agents/components/ambient-assistant/ScrollAssistantLauncherImpl.js +117 -105
  33. package/dist/agents/components/ambient-assistant/ScrollVoiceAssistantLauncherImpl.js +193 -155
  34. package/dist/agents/components/chat/ChatConversationRoom.js +8 -7
  35. package/dist/agents/components/chat/ChatConversationSurface.js +5 -4
  36. package/dist/agents/components/chat/ChatHistorySidebar.js +2 -2
  37. package/dist/agents/components/chat/ChatIncognitoHeaderButton.js +3 -2
  38. package/dist/agents/components/chat/ChatIncognitoProvider.js +2 -1
  39. package/dist/agents/components/chat/ChatNewClient.js +37 -22
  40. package/dist/agents/components/chat/ChatNewHeader.js +4 -3
  41. package/dist/agents/components/chat/ChatRoomClient.js +36 -33
  42. package/dist/agents/components/chat/ChatRoomSkeleton.js +49 -32
  43. package/dist/agents/components/chat/ChatRunHeader.js +26 -18
  44. package/dist/agents/components/chat/ChatSidebarMenu.js +204 -183
  45. package/dist/agents/components/chat/ConversationAttachmentsChip.js +53 -29
  46. package/dist/agents/components/chat/ConversationPageMenu.js +39 -35
  47. package/dist/agents/components/chat/ConversationRecordsChip.js +28 -19
  48. package/dist/agents/components/chat/ConversationRoomNotice.js +18 -14
  49. package/dist/agents/components/chat/NewChatGreeting.js +29 -23
  50. package/dist/agents/components/chat/PinnedAgentsSection.js +58 -49
  51. package/dist/agents/components/chat/SandboxPanel.js +203 -147
  52. package/dist/agents/components/chat/sandbox-insight/SandboxActivityFeed.js +70 -39
  53. package/dist/agents/components/chat/sandbox-insight/SandboxCanvasBody.js +87 -67
  54. package/dist/agents/components/coming-soon/AgentComingSoonContent.js +22 -9
  55. package/dist/agents/components/context-items/ContextItemViewer.js +43 -12
  56. package/dist/agents/components/context-items/bodies/BookmarkReferenceBody.js +6 -5
  57. package/dist/agents/components/context-items/bodies/ContextInputBody.js +15 -5
  58. package/dist/agents/components/context-items/bodies/ContextLayerBodies.js +100 -61
  59. package/dist/agents/components/context-items/bodies/DataBody.js +3 -2
  60. package/dist/agents/components/context-items/bodies/EntityReferenceBody.js +26 -19
  61. package/dist/agents/components/context-items/bodies/GenericBody.js +7 -6
  62. package/dist/agents/components/context-items/bodies/MediaBody.js +39 -32
  63. package/dist/agents/components/context-items/bodies/NoteBody.js +2 -1
  64. package/dist/agents/components/context-items/bodies/ProcessedDocumentBody.js +7 -3
  65. package/dist/agents/components/context-items/bodies/ProcessedDocumentTitle.js +2 -1
  66. package/dist/agents/components/context-items/bodies/RemarkBody.js +3 -2
  67. package/dist/agents/components/context-items/bodies/ResourceSnapshotView.js +10 -3
  68. package/dist/agents/components/context-items/bodies/TaskBody.js +2 -1
  69. package/dist/agents/components/context-items/bodies/UnregisteredBody.js +2 -1
  70. package/dist/agents/components/context-items/bodies/WebpageBody.js +38 -24
  71. package/dist/agents/components/context-items/bodies/WorkingDocumentBody.js +3 -2
  72. package/dist/agents/components/context-policies-display/ContextPolicyChip.js +2 -1
  73. package/dist/agents/components/context-policies-display/ContextPolicyChipStrip.js +23 -16
  74. package/dist/agents/components/context-policies-display/ContextPolicyDetail.js +54 -29
  75. package/dist/agents/components/context-policies-display/ContextPolicyItemsPopover.js +51 -41
  76. package/dist/agents/components/context-policies-display/ContextPolicyTile.js +13 -7
  77. package/dist/agents/components/context-policies-display/ContextRulesPanel.js +19 -12
  78. package/dist/agents/components/context-policies-display/ContextValueBody.js +20 -17
  79. package/dist/agents/components/context-policies-display/MessageContextReceipt.js +71 -30
  80. package/dist/agents/components/context-policies-display/ValueCountPill.js +6 -5
  81. package/dist/agents/components/context-policies-display/knownContextValues.js +20 -16
  82. package/dist/agents/components/context-preview/AttachedContextSection.js +169 -85
  83. package/dist/agents/components/context-preview/ContextCompareView.js +413 -196
  84. package/dist/agents/components/context-preview/ContextPreviewPanel.js +220 -105
  85. package/dist/agents/components/context-preview/SystemItemsLine.js +27 -13
  86. package/dist/agents/components/context-preview/inspector/ContextInspector.js +63 -31
  87. package/dist/agents/components/context-preview/inspector/ContextParityLastRun.js +48 -12
  88. package/dist/agents/components/conversation-actions/conversationActionRegistry.js +6 -1
  89. package/dist/agents/components/conversation-actions/rename/ConversationRenameDialogHost.js +2 -1
  90. package/dist/agents/components/conversation-actions/rename/ConversationRenameDialogHostImpl.js +4 -3
  91. package/dist/agents/components/conversation-history/ConversationHistorySidebar.js +450 -358
  92. package/dist/agents/components/conversation-history/ConversationLaneToggles.js +30 -28
  93. package/dist/agents/components/conversation-history/ConversationPickerWindow.js +20 -19
  94. package/dist/agents/components/conversation-history/ConversationSearchStatus.js +19 -5
  95. package/dist/agents/components/conversation-history/ConversationSourceFilterTree.js +242 -184
  96. package/dist/agents/components/conversation-history/ConversationTrashSection.js +53 -36
  97. package/dist/agents/components/custom-agent/CustomAgentWindow.js +97 -62
  98. package/dist/agents/components/debug/RoutingPanel.js +58 -15
  99. package/dist/agents/components/debug/SandboxFileViewer.js +56 -38
  100. package/dist/agents/components/debug/SandboxInsightPanel.js +27 -2
  101. package/dist/agents/components/debug/StreamDebugFloating.js +12 -12
  102. package/dist/agents/components/debug/StreamDebugPanel.js +1012 -597
  103. package/dist/agents/components/inputs/AgentVariablesInline.js +200 -177
  104. package/dist/agents/components/inputs/BoundVariableChips.js +117 -76
  105. package/dist/agents/components/inputs/DataBoundVariableChips.js +36 -23
  106. package/dist/agents/components/inputs/PreExecutionAgentInput.js +20 -9
  107. package/dist/agents/components/inputs/RowChoicesButton.js +27 -21
  108. package/dist/agents/components/inputs/input-components/AudioVariableInput.js +2 -1
  109. package/dist/agents/components/inputs/input-components/CheckboxGroupInput.js +72 -63
  110. package/dist/agents/components/inputs/input-components/CurrencyVariableInput.js +36 -30
  111. package/dist/agents/components/inputs/input-components/DocumentVariableInput.js +2 -1
  112. package/dist/agents/components/inputs/input-components/ImageVariableInput.js +2 -1
  113. package/dist/agents/components/inputs/input-components/MediaVariableInput.js +177 -126
  114. package/dist/agents/components/inputs/input-components/NumberInput.js +52 -47
  115. package/dist/agents/components/inputs/input-components/PicklistVariableInput.js +11 -11
  116. package/dist/agents/components/inputs/input-components/PillToggleInput.js +2 -2
  117. package/dist/agents/components/inputs/input-components/RadioGroupInput.js +53 -43
  118. package/dist/agents/components/inputs/input-components/ScalarVariableInput.js +46 -39
  119. package/dist/agents/components/inputs/input-components/SelectInput.js +91 -74
  120. package/dist/agents/components/inputs/input-components/SliderInput.js +37 -30
  121. package/dist/agents/components/inputs/input-components/TableVariableInput.js +29 -23
  122. package/dist/agents/components/inputs/input-components/TextareaInput.js +3 -2
  123. package/dist/agents/components/inputs/input-components/ToggleInput.js +24 -22
  124. package/dist/agents/components/inputs/input-components/VariableInputComponent.js +53 -40
  125. package/dist/agents/components/inputs/input-components/VideoVariableInput.js +2 -1
  126. package/dist/agents/components/inputs/input-components/YoutubeVariableInput.js +29 -17
  127. package/dist/agents/components/inputs/resources/AttachedDocumentChip.js +83 -57
  128. package/dist/agents/components/inputs/resources/AttachedDocumentChips.js +68 -62
  129. package/dist/agents/components/inputs/resources/ResourceFamilyPolicyEditor.js +214 -144
  130. package/dist/agents/components/inputs/resources/SmartAgentResourceChips.js +70 -69
  131. package/dist/agents/components/inputs/resources/SmartAgentResourcePickerButton.js +22 -18
  132. package/dist/agents/components/inputs/smart-input/AgentMicrophoneButton.js +3 -2
  133. package/dist/agents/components/inputs/smart-input/AgentTextarea.js +70 -58
  134. package/dist/agents/components/inputs/smart-input/ChatConnectionsStrip.js +172 -142
  135. package/dist/agents/components/inputs/smart-input/ComposerChip.js +30 -22
  136. package/dist/agents/components/inputs/smart-input/ComposerDraftNotice.js +15 -2
  137. package/dist/agents/components/inputs/smart-input/ComposerToolsNotice.js +12 -7
  138. package/dist/agents/components/inputs/smart-input/ComputeLensBar.js +141 -106
  139. package/dist/agents/components/inputs/smart-input/ContextDocsMenu.js +139 -91
  140. package/dist/agents/components/inputs/smart-input/ConversationContextChip.js +9 -6
  141. package/dist/agents/components/inputs/smart-input/ConversationContextRail.js +106 -80
  142. package/dist/agents/components/inputs/smart-input/DesktopPresenceIndicator.js +58 -37
  143. package/dist/agents/components/inputs/smart-input/InboxQueueStrip.js +227 -190
  144. package/dist/agents/components/inputs/smart-input/InputActionButtons.js +80 -36
  145. package/dist/agents/components/inputs/smart-input/PlusAttachMenu.js +163 -118
  146. package/dist/agents/components/inputs/smart-input/QuicksetPanel.js +147 -110
  147. package/dist/agents/components/inputs/smart-input/RunControlsMenu.js +105 -90
  148. package/dist/agents/components/inputs/smart-input/RunControlsTabPanel.js +86 -62
  149. package/dist/agents/components/inputs/smart-input/RunPicksSurface.js +157 -110
  150. package/dist/agents/components/inputs/smart-input/RunSkillPicker.js +12 -11
  151. package/dist/agents/components/inputs/smart-input/RunToolPicker.js +42 -38
  152. package/dist/agents/components/inputs/smart-input/ShapeChipsRow.js +20 -16
  153. package/dist/agents/components/inputs/smart-input/SmartAgentInput.js +40 -33
  154. package/dist/agents/components/inputs/smart-input/SmartAgentInputStacked.js +203 -177
  155. package/dist/agents/components/inputs/smart-input/SmartInputFileDropTarget.js +30 -21
  156. package/dist/agents/components/inputs/smart-input/UninitializedShell.js +22 -19
  157. package/dist/agents/components/inputs/smart-input/ViewOnlyComposerBar.js +8 -5
  158. package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPeek.js +3 -2
  159. package/dist/agents/components/inputs/smart-input/composer/ComposerAgentPill.js +129 -99
  160. package/dist/agents/components/inputs/smart-input/composer/ComposerChipsRow.js +53 -47
  161. package/dist/agents/components/inputs/smart-input/composer/ComposerConnectPromo.js +25 -21
  162. package/dist/agents/components/inputs/smart-input/composer/ComposerConnectorsPanel.js +91 -55
  163. package/dist/agents/components/inputs/smart-input/composer/ComposerEffortPill.js +51 -42
  164. package/dist/agents/components/inputs/smart-input/composer/ComposerMenu.js +143 -115
  165. package/dist/agents/components/inputs/smart-input/composer/ComposerMenuSheet.js +26 -23
  166. package/dist/agents/components/inputs/smart-input/composer/ComposerMetaRow.js +41 -30
  167. package/dist/agents/components/inputs/smart-input/composer/ComposerModeSwitch.js +38 -26
  168. package/dist/agents/components/inputs/smart-input/composer/ComposerOutput.js +150 -101
  169. package/dist/agents/components/inputs/smart-input/composer/ComposerPlusMenu.js +264 -198
  170. package/dist/agents/components/inputs/smart-input/composer/ComposerSplash.js +54 -38
  171. package/dist/agents/components/inputs/variable-input-variations/AgentVariableCards.js +144 -127
  172. package/dist/agents/components/inputs/variable-input-variations/AgentVariableForm.js +247 -165
  173. package/dist/agents/components/inputs/variable-input-variations/AgentVariablesGuided.js +323 -244
  174. package/dist/agents/components/inputs/variable-input-variations/AgentVariablesStacked.js +32 -28
  175. package/dist/agents/components/inputs/variable-input-variations/AgentVariablesWizard.js +43 -16
  176. package/dist/agents/components/inputs/variable-input-variations/SmartAgentVariables.js +7 -6
  177. package/dist/agents/components/live-run/LiveRunDisplay.js +81 -53
  178. package/dist/agents/components/live-run/LiveRunProgress.js +72 -48
  179. package/dist/agents/components/live-run/RunSetDisplay.js +20 -17
  180. package/dist/agents/components/memory/components/AgentMemoryAllView.js +45 -27
  181. package/dist/agents/components/memory/components/AgentMemoryBody.js +4 -3
  182. package/dist/agents/components/memory/components/AgentMemoryEditor.js +52 -36
  183. package/dist/agents/components/memory/components/AgentMemoryFooter.js +66 -44
  184. package/dist/agents/components/memory/components/AgentMemoryInlinePanel.js +10 -2
  185. package/dist/agents/components/memory/components/AgentMemorySidebar.js +125 -89
  186. package/dist/agents/components/messages-display/AgentConversationDisplay.js +130 -119
  187. package/dist/agents/components/messages-display/MessageAttachmentStrip.js +8 -7
  188. package/dist/agents/components/messages-display/MessageTimestamp.js +8 -5
  189. package/dist/agents/components/messages-display/TranscriptIntegrityCopyButton.js +4 -3
  190. package/dist/agents/components/messages-display/assistant/AgentAssistantMessage.js +135 -108
  191. package/dist/agents/components/messages-display/assistant/AgentEmptyMessageDisplay.js +20 -9
  192. package/dist/agents/components/messages-display/assistant/AssistantMessageFooter.js +76 -65
  193. package/dist/agents/components/messages-display/assistant/AssistantNoAnswer.js +28 -17
  194. package/dist/agents/components/messages-display/assistant/AssistantTurnGroup.js +65 -62
  195. package/dist/agents/components/messages-display/assistant/BreathingOrb.js +70 -57
  196. package/dist/agents/components/messages-display/assistant/InPlaceAnswerEditor.js +7 -3
  197. package/dist/agents/components/messages-display/assistant/ProviderRetryCard.js +61 -36
  198. package/dist/agents/components/messages-display/citations/MessageCitationsContext.js +2 -1
  199. package/dist/agents/components/messages-display/citations/MessageSourcesRow.js +25 -21
  200. package/dist/agents/components/messages-display/conversation-tools/ConversationFindBar.js +46 -43
  201. package/dist/agents/components/messages-display/conversation-tools/FollowUpSuggestions.js +2 -2
  202. package/dist/agents/components/messages-display/message-options/DeleteMessageDialog.js +61 -40
  203. package/dist/agents/components/messages-display/message-options/EditHistoryDialog.js +91 -56
  204. package/dist/agents/components/messages-display/message-options/shareMessageAsWebpage.js +1 -1
  205. package/dist/agents/components/messages-display/user/AgentUserMessage.js +180 -144
  206. package/dist/agents/components/messages-display/user/CollabNoteMessage.js +16 -6
  207. package/dist/agents/components/messages-display/user/FirstTurnVariables.js +51 -40
  208. package/dist/agents/components/messages-display/user/PendingSendMessage.js +60 -37
  209. package/dist/agents/components/messages-display/user/RemarksTranscriptView.js +22 -5
  210. package/dist/agents/components/messages-display/user/ResourceAttachmentTile.js +187 -147
  211. package/dist/agents/components/messages-display/user/ResourceEditableToggleSamples.js +17 -1
  212. package/dist/agents/components/messages-display/user/UserActionBar.js +77 -62
  213. package/dist/agents/components/messages-display/user/UserMessageAttachmentStyleComparison.js +82 -39
  214. package/dist/agents/components/messages-display/user/UserMessageChipsDemo.js +189 -105
  215. package/dist/agents/components/messages-display/user/UserMessageHybridTileSamples.js +212 -130
  216. package/dist/agents/components/model/AgentModelPanel.js +2 -1
  217. package/dist/agents/components/model-tiers/ModelTierIdentityList.js +18 -15
  218. package/dist/agents/components/notifications/ImageArrivalPeek.js +45 -34
  219. package/dist/agents/components/notifications/ImageArrivalPeekHost.js +14 -13
  220. package/dist/agents/components/observational-memory/ObservationalMemoryCore.js +46 -31
  221. package/dist/agents/components/observational-memory/components/MemoryControls.js +84 -48
  222. package/dist/agents/components/observational-memory/components/MemoryCostCard.js +136 -84
  223. package/dist/agents/components/observational-memory/components/MemoryEventTimeline.js +127 -78
  224. package/dist/agents/components/observational-memory/components/MemoryOverviewCard.js +113 -72
  225. package/dist/agents/components/observational-memory/components/MemoryStateInspector.js +384 -216
  226. package/dist/agents/components/run/AgentRunHeader.js +44 -27
  227. package/dist/agents/components/run/AgentRunnerPage.js +47 -31
  228. package/dist/agents/components/run/AgentStatusIndicator.js +2 -1
  229. package/dist/agents/components/run/AssistantError.js +61 -27
  230. package/dist/agents/components/run/AssistantWarning.js +18 -2
  231. package/dist/agents/components/run/GenerationJobCard.js +19 -6
  232. package/dist/agents/components/run/IncompleteNote.js +11 -1
  233. package/dist/agents/components/run/RunJobWorkingLine.js +14 -11
  234. package/dist/agents/components/run/run-sidebar/SidebarHeader.js +25 -18
  235. package/dist/agents/components/run-controls/AdvancedRunSettings/AdvancedRunSettings.js +72 -56
  236. package/dist/agents/components/run-controls/AdvancedRunSettings/ComplexityBadge.js +10 -8
  237. package/dist/agents/components/run-controls/AdvancedRunSettings/primitives.js +84 -66
  238. package/dist/agents/components/run-controls/ContextPoliciesTab.js +194 -130
  239. package/dist/agents/components/run-controls/RunConfigOverrides.js +245 -179
  240. package/dist/agents/components/run-controls/RunInputCapabilities.js +24 -20
  241. package/dist/agents/components/run-controls/RunModelPicker.js +35 -25
  242. package/dist/agents/components/run-controls/RunSettingsEditor.js +356 -267
  243. package/dist/agents/components/run-controls/RunSettingsModal.js +8 -1
  244. package/dist/agents/components/run-controls/SimpleRunSettings/CapabilityGrid.js +25 -20
  245. package/dist/agents/components/run-controls/SimpleRunSettings/ReasoningLevelSelector.js +14 -11
  246. package/dist/agents/components/run-controls/SimpleRunSettings/SimpleRunSettings.js +32 -21
  247. package/dist/agents/components/run-controls/SimpleRunSettings/SimpleRunSettingsButton.js +41 -35
  248. package/dist/agents/components/run-controls/StoredModelOverridesField.js +38 -27
  249. package/dist/agents/components/run-controls/SurfaceSimulatorSelect.js +117 -69
  250. package/dist/agents/components/run-controls/panels/BackendTargetPanel.js +81 -35
  251. package/dist/agents/components/run-controls/panels/ClientMetricsPanel.js +65 -33
  252. package/dist/agents/components/run-controls/panels/ModelContextPanel.js +94 -46
  253. package/dist/agents/components/run-controls/panels/RequestStatsPanel.js +82 -53
  254. package/dist/agents/components/run-controls/panels/SessionStatsPanel.js +33 -9
  255. package/dist/agents/components/run-controls/panels/shared.js +10 -4
  256. package/dist/agents/components/send-to-agent/SendToAgentWindow.js +89 -57
  257. package/dist/agents/components/shared/AgentConversationColumn.js +135 -123
  258. package/dist/agents/components/shared/AgentHeader.js +47 -29
  259. package/dist/agents/components/shared/AgentHeaderMobile.js +173 -133
  260. package/dist/agents/components/shared/AgentModeController.js +58 -43
  261. package/dist/agents/components/shared/AgentNewRunButton.js +2 -1
  262. package/dist/agents/components/shared/AgentPlanningIndicator.js +2 -1
  263. package/dist/agents/components/shared/AgentReferenceCopyButton.js +2 -1
  264. package/dist/agents/components/shared/AgentSelectorIsland.js +26 -18
  265. package/dist/agents/components/shared/AutoInjectionSwitch.js +66 -55
  266. package/dist/agents/components/shared/DesktopFilterPanel.js +183 -140
  267. package/dist/agents/components/shared/OlderMessagesSentinel.js +2 -1
  268. package/dist/agents/components/shared/StreamProfilerOverlay.js +64 -5
  269. package/dist/agents/components/shared/transcript-audience.js +2 -1
  270. package/dist/agents/components/shell/AgentBuildSidebarExtras.js +14 -3
  271. package/dist/agents/components/shell/AgentRunSidebarMenu.js +82 -58
  272. package/dist/agents/components/smart/AgentRunWrapper.js +2 -1
  273. package/dist/agents/components/smart/AgentRunner.js +45 -40
  274. package/dist/agents/components/smart/CreateWithAiTabs.js +88 -73
  275. package/dist/agents/components/working-document/DocumentLinkPicker.js +74 -47
  276. package/dist/agents/components/working-document/ScratchpadQuickPanel.js +3 -2
  277. package/dist/agents/components/working-document/ScratchpadSwitcherMenu.js +58 -35
  278. package/dist/agents/components/working-document/WorkingDocumentAgentDiff.js +8 -4
  279. package/dist/agents/components/working-document/WorkingDocumentEditor.js +35 -34
  280. package/dist/agents/components/working-document/WorkingDocumentLatestVersionDiff.js +15 -5
  281. package/dist/agents/components/working-document/WorkingDocumentPanel.js +250 -174
  282. package/dist/agents/components/working-document/WorkingDocumentVersionHistory.js +82 -46
  283. package/dist/agents/components/working-document/WorkingDocumentViewControls.js +64 -52
  284. package/dist/agents/components/working-document/documents-workspace/DocumentsListRail.js +127 -106
  285. package/dist/agents/components/working-document/documents-workspace/DocumentsWorkspace.js +116 -103
  286. package/dist/agents/decision-answers/DecisionAnswers.js +164 -107
  287. package/dist/agents/image-roles/ImageRoleSelector.js +60 -50
  288. package/dist/agents/image-roles/ReferenceRoleCaption.js +5 -4
  289. package/dist/agents/message-flags/ExampleTurnsGroup.js +8 -1
  290. package/dist/agents/message-flags/MessageFlagToggles.js +72 -56
  291. package/dist/agents/message-flags/MessageFlagsPreview.js +35 -10
  292. package/dist/agents/message-flags/PrefillNote.js +5 -4
  293. package/dist/agents/message-flags/StoppedNote.js +8 -5
  294. package/dist/agents/prompt-preview/PromptPreviewContent.js +72 -34
  295. package/dist/agents/redux/execution-system/host-conversations/conversation-abilities.js +2 -1
  296. package/dist/agents/redux/execution-system/inbox/inbox.thunks.js +19 -10
  297. package/dist/agents/redux/execution-system/instance-ui-state/components/InstanceUIStateCore.js +430 -313
  298. package/dist/agents/redux/execution-system/instance-ui-state/components/InstanceUIStateList.js +120 -104
  299. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.persistence.d.ts +6 -0
  300. package/dist/agents/redux/execution-system/instance-variable-values/instance-variable-values.persistence.js +4 -2
  301. package/dist/agents/redux/execution-system/thunks/execute-instance.thunk.js +24 -8
  302. package/dist/agents/resources/ResourceChips.js +37 -34
  303. package/dist/agents/resources/ResourceDisplay.js +51 -32
  304. package/dist/agents/route/AgentHydratorServer.js +2 -1
  305. package/dist/agents/routing/ConfidentialToggle.js +8 -6
  306. package/dist/agents/runtime-reconnect/ServerOperationBanner.js +33 -28
  307. package/dist/agents/speech-script/SpeechScriptTranscriptView.js +20 -1
  308. package/dist/agents/ui-first-tools/ui/AgentCardShell.js +78 -67
  309. package/dist/agents/ui-first-tools/ui/ApprovalCard.js +136 -102
  310. package/dist/agents/ui-first-tools/ui/AskCard.js +383 -293
  311. package/dist/agents/ui-first-tools/ui/AskCardCountdown.js +10 -9
  312. package/dist/agents/ui-first-tools/ui/AskWizard.js +91 -70
  313. package/dist/agents/ui-first-tools/ui/BatchAskCard.js +2 -1
  314. package/dist/agents/ui-first-tools/ui/CredentialCaptureCard.js +54 -33
  315. package/dist/agents/ui-first-tools/ui/PendingAsksZone.js +66 -55
  316. package/dist/agents/ui-first-tools/ui/QuestionsAskForm.js +2 -1
  317. package/dist/agents/ui-first-tools/ui/lists/ListsHubView.js +112 -63
  318. package/dist/agents/ui-first-tools/ui/lists/TaskPanel.js +209 -140
  319. package/dist/agents/ui-first-tools/ui/lists/TaskPanelChip.js +7 -6
  320. package/dist/canvas/workspace/CanvasChatColumn.js +28 -17
  321. package/dist/canvas/workspace/CanvasPropertiesPanel.js +38 -32
  322. package/dist/canvas/workspace/ChatCanvasWorkspace.js +87 -53
  323. package/dist/canvas/workspace/ChatPanelTitleMenu.js +56 -44
  324. package/dist/canvas/workspace/ShellChatDock.js +71 -54
  325. package/dist/context-menu/types.d.ts +12 -6
  326. package/dist/cx-chat/components/ChatConversationSkeleton.js +35 -2
  327. package/dist/cx-chat/components/ChatHeaderControls.js +35 -23
  328. package/dist/cx-chat/components/ChatInstanceManager.js +3 -2
  329. package/dist/cx-chat/components/ChatMobileAdminToggles.js +16 -11
  330. package/dist/cx-chat/components/ChatMobileAgentName.js +13 -9
  331. package/dist/cx-chat/components/ChatMobileHeaderBar.js +25 -22
  332. package/dist/cx-chat/components/ChatPanelBackButton.js +2 -1
  333. package/dist/cx-chat/components/ChatSidebarClient.js +164 -135
  334. package/dist/cx-chat/components/ChatWelcomeClient.js +27 -17
  335. package/dist/cx-chat/components/ChatWelcomeServer.js +3 -2
  336. package/dist/cx-chat/components/ContextGaugeWidget.js +22 -13
  337. package/dist/cx-chat/components/SsrSidebarAgents.js +4 -3
  338. package/dist/cx-chat/components/SsrSidebarChats.js +159 -105
  339. package/dist/cx-chat/components/agent/AgentPickerSheet.js +16 -3
  340. package/dist/cx-chat/components/core/ChatConversationClient.js +47 -32
  341. package/dist/cx-chat/components/messages/MessageErrorBoundary.js +8 -1
  342. package/dist/cx-chat/components/messages/UserMessage.js +142 -116
  343. package/dist/cx-chat/components/sidebar/SidebarActions.js +24 -16
  344. package/dist/cx-chat/components/sidebar/SidebarUserFooter.js +43 -30
  345. package/dist/cx-chat/components/user-input/ConversationInput.js +157 -136
  346. package/dist/cx-chat/components/user-input/InpuControlButtons.js +18 -17
  347. package/dist/cx-chat/components/user-input/InputActionButtons.js +33 -28
  348. package/dist/cx-chat/components/user-input/StackedVariableInputs.js +79 -65
  349. package/dist/cx-chat/components/variable-inputs/CheckboxGroupInput.js +90 -63
  350. package/dist/cx-chat/components/variable-inputs/NumberInput.js +41 -30
  351. package/dist/cx-chat/components/variable-inputs/RadioGroupInput.js +64 -46
  352. package/dist/cx-chat/components/variable-inputs/SelectInput.js +32 -15
  353. package/dist/cx-chat/components/variable-inputs/TextareaInput.js +3 -2
  354. package/dist/cx-chat/components/variable-inputs/ToggleInput.js +28 -8
  355. package/dist/host/bare-host-chrome.js +2 -1
  356. package/dist/host/chrome.js +10 -9
  357. package/dist/host/configure.js +7 -1
  358. package/dist/host/conversation-hooks-react.d.ts +7 -0
  359. package/dist/host/conversation-hooks-react.js +15 -2
  360. package/dist/host/conversation-hooks.d.ts +10 -0
  361. package/dist/host/conversation-hooks.js +7 -0
  362. package/dist/host/defaults/memory-navigation.js +5 -4
  363. package/dist/host/defaults/resource-picker-menu.js +30 -25
  364. package/dist/host/defaults/setting-control-input.js +13 -10
  365. package/dist/host/defaults/window-panel.js +38 -17
  366. package/dist/host/defaults/workspace-gate.js +31 -20
  367. package/dist/host/navigation.js +2 -1
  368. package/dist/host/react.js +3 -2
  369. package/dist/host/ui-slots.d.ts +3 -2
  370. package/dist/mandates/RunFailureCard.js +27 -16
  371. package/dist/public-chat/components/AgentSelector.js +26 -26
  372. package/dist/public-chat/components/GuidedVariableInputs.js +282 -216
  373. package/dist/public-chat/components/PublicMessageOptionsMenu.js +36 -31
  374. package/dist/public-chat/components/PublicVariableInputs.js +79 -65
  375. package/dist/quick-actions/components/QuickChatSheet.js +83 -59
  376. package/dist/surfaces/components/chrome/PageIntelligenceSection.js +36 -22
  377. package/dist/surfaces/components/chrome/SurfaceAgentsHeaderButton.js +31 -21
  378. package/dist/surfaces/components/chrome/SurfaceAgentsPanelImpl.js +109 -64
  379. package/dist/surfaces/components/chrome/SurfaceConversationsSection.js +87 -41
  380. package/dist/surfaces/components/chrome/SurfaceMandatesSection.js +118 -75
  381. package/dist/surfaces/components/chrome/SurfaceRoleAgentButton.js +8 -5
  382. package/dist/surfaces/runtime/StaticSurfaceRuntimeProvider.js +2 -1
  383. package/dist/surfaces/runtime/SurfaceRuntimeContext.js +8 -7
  384. package/dist/surfaces/runtime/intelligence.js +2 -1
  385. package/dist/testing/chat-host-test-provider.js +2 -1
  386. package/dist/testing/render-hook.js +2 -2
  387. package/dist/tool-call-visualization/components/AgentWorkGroup.js +15 -11
  388. package/dist/tool-call-visualization/components/ArtifactResultBar.js +78 -51
  389. package/dist/tool-call-visualization/components/ChatResultColumn.js +2 -2
  390. package/dist/tool-call-visualization/components/LiveToolCallCard.js +2 -1
  391. package/dist/tool-call-visualization/components/ToolCallBatch.js +35 -29
  392. package/dist/tool-call-visualization/components/ToolCallVisualization.js +217 -200
  393. package/dist/tool-call-visualization/components/ToolConversationContext.js +3 -2
  394. package/dist/tool-call-visualization/components/ToolTabBodies.js +122 -70
  395. package/dist/tool-call-visualization/components/ToolUpdatesOverlay.js +68 -50
  396. package/dist/tool-call-visualization/components/agentWorkTurn.js +8 -8
  397. package/dist/tool-call-visualization/db-renderer/DbToolRenderer.js +2 -2
  398. package/dist/tool-call-visualization/db-renderer/DbToolRendererImpl.js +7 -6
  399. package/dist/tool-call-visualization/grouping/foldAgentWork.js +10 -3
  400. package/dist/tool-call-visualization/registry/GenericRenderer.js +68 -51
  401. package/dist/tool-call-visualization/registry/registry.js +62 -10
  402. package/dist/tool-call-visualization/renderers/_shared-entity/EmptyResultCard.js +9 -4
  403. package/dist/tool-call-visualization/renderers/_shared-entity/EntityCard.js +116 -85
  404. package/dist/tool-call-visualization/renderers/_shared-entity/EntityOpenActions.js +16 -9
  405. package/dist/tool-call-visualization/renderers/_shared-entity/PartPeekPopover.js +24 -18
  406. package/dist/tool-call-visualization/renderers/_shared-entity/ToolGlyph.js +2 -1
  407. package/dist/tool-call-visualization/renderers/_shared-entity/ToolResultCard.js +89 -65
  408. package/dist/tool-call-visualization/renderers/agent-call/AgentCallInline.js +71 -54
  409. package/dist/tool-call-visualization/renderers/agent-call/CollabCallCard.js +90 -54
  410. package/dist/tool-call-visualization/renderers/agent-call/ImageGenerationResult.js +39 -31
  411. package/dist/tool-call-visualization/renderers/ask/AskInline.js +20 -15
  412. package/dist/tool-call-visualization/renderers/ask-person/AskPersonInline.js +17 -8
  413. package/dist/tool-call-visualization/renderers/cloud-browser/CloudBrowserRunCard.js +89 -55
  414. package/dist/tool-call-visualization/renderers/ctx/ContextActionInline.js +4 -4
  415. package/dist/tool-call-visualization/renderers/ctx/CtxBatchInline.js +50 -18
  416. package/dist/tool-call-visualization/renderers/ctx/CtxGetInline.js +13 -5
  417. package/dist/tool-call-visualization/renderers/ctx/CtxItemCard.js +22 -13
  418. package/dist/tool-call-visualization/renderers/ctx/CtxPatchInline.js +25 -6
  419. package/dist/tool-call-visualization/renderers/dictionary/DictEntryList.js +37 -5
  420. package/dist/tool-call-visualization/renderers/dictionary/DictionaryInline.js +5 -4
  421. package/dist/tool-call-visualization/renderers/dictionary/DictionaryOverlay.js +18 -2
  422. package/dist/tool-call-visualization/renderers/fs/FsInline.js +73 -55
  423. package/dist/tool-call-visualization/renderers/news-api/NewsInline.js +90 -41
  424. package/dist/tool-call-visualization/renderers/news-api/NewsOverlay.js +152 -84
  425. package/dist/tool-call-visualization/renderers/random-wheel/RandomWheelInline.js +297 -180
  426. package/dist/tool-call-visualization/renderers/records/RecordsInline.js +7 -2
  427. package/dist/tool-call-visualization/renderers/research/ResearchInline.js +88 -45
  428. package/dist/tool-call-visualization/renderers/research/ResearchOverlay.js +102 -54
  429. package/dist/tool-call-visualization/renderers/research/SubagentReportBlock.js +95 -65
  430. package/dist/tool-call-visualization/renderers/scrape/ScrapeInline.js +170 -100
  431. package/dist/tool-call-visualization/renderers/scrape/ScrapeOverlay.js +109 -55
  432. package/dist/tool-call-visualization/renderers/search/SearchInline.js +297 -186
  433. package/dist/tool-call-visualization/renderers/search/SearchOverlay.js +240 -105
  434. package/dist/tool-call-visualization/renderers/shell/ShellInline.js +52 -33
  435. package/dist/tool-call-visualization/renderers/skill/SkillInline.js +44 -36
  436. package/dist/tool-call-visualization/renderers/sql/DbSchemaInline.js +33 -7
  437. package/dist/tool-call-visualization/renderers/sql/SqlInline.js +46 -14
  438. package/dist/tool-call-visualization/renderers/web/WebInline.js +4 -4
  439. package/dist/tool-call-visualization/renderers/web/WebOverlay.js +4 -4
  440. package/dist/tool-call-visualization/renderers/workbook/WorkbookGrid.js +25 -15
  441. package/dist/tool-call-visualization/renderers/workbook/WorkbookInline.js +24 -15
  442. package/dist/tool-call-visualization/renderers/workbook/WorkbookOverlay.js +25 -11
  443. package/dist/tool-call-visualization/renderers/working-document/PatchDiffInline.js +11 -10
  444. package/dist/tool-call-visualization/result-fields/EmptyResult.js +8 -6
  445. package/dist/tool-call-visualization/result-fields/KeyValueGrid.js +121 -78
  446. package/dist/tool-call-visualization/result-fields/KindValueNode.js +4 -3
  447. package/dist/tool-call-visualization/result-fields/ResultFile.js +28 -19
  448. package/dist/tool-call-visualization/result-fields/ResultJson.js +2 -2
  449. package/dist/tool-call-visualization/result-fields/ResultMarkdown.js +31 -24
  450. package/dist/tool-call-visualization/result-fields/ResultMedia.js +23 -19
  451. package/dist/tool-call-visualization/result-fields/ResultRecordRef.js +3 -2
  452. package/dist/tool-call-visualization/result-fields/ResultScalar.js +4 -4
  453. package/dist/tool-call-visualization/result-fields/ResultTable.js +144 -107
  454. package/dist/tool-call-visualization/result-fields/ResultValue.js +78 -61
  455. package/dist/tool-call-visualization/result-fields/ShortId.js +21 -13
  456. package/dist/tool-call-visualization/result-fields/ToolErrorCard.js +22 -17
  457. package/dist/tool-call-visualization/result-fields/ToolResultValue.js +3 -3
  458. package/dist/tool-call-visualization/result-fields/UrlChips.js +13 -11
  459. package/dist/tool-call-visualization/result-fields/document-presentation.js +3 -2
  460. package/dist/tool-call-visualization/surface-write/SurfaceWriteDiff.js +69 -55
  461. package/dist/tool-call-visualization/surface-write/SurfaceWriteStress.js +8 -1
  462. package/dist/tool-call-visualization/surface-write/withSurfaceWriteDiff.js +3 -2
  463. package/dist/tool-call-visualization/window-panel/ToolCallWindowPanel.js +140 -120
  464. package/dist/ui/AudioOutputBlockSkeleton.js +61 -21
  465. package/dist/ui/chat-panel/ChatPanel.js +61 -45
  466. package/dist/ui/checkbox.js +2 -1
  467. package/dist/ui/html-preview/HtmlPreviewBridge.js +3 -2
  468. package/dist/ui/lazy/SurfaceAgentsPanelImpl.js +5 -1
  469. package/dist/ui/markdown-stream/EnhancedChatMarkdown.js +141 -131
  470. package/dist/ui/markdown-stream/MarkdownStreamImpl.js +42 -42
  471. package/dist/ui/markdown-stream/StreamAwareChatMarkdown.js +19 -18
  472. package/dist/ui/markdown-stream/internal-handlers/AgentCallChildTrace.js +59 -56
  473. package/dist/ui/markdown-stream/internal-handlers/InlineAssistantError.js +2 -1
  474. package/dist/ui/markdown-stream/internal-handlers/InlineThinkingSlot.js +3 -3
  475. package/dist/ui/markdown-stream/internal-handlers/ToolHandlers.js +34 -31
  476. package/dist/ui/scroll-fade.js +5 -4
  477. package/dist/ui/tabs.js +2 -1
  478. package/dist/ui/usages/DriftSeverityBadge.js +9 -6
  479. package/dist/utils/connectors/marks.js +122 -59
  480. package/dist/utils/resource-picker/ResourcePickerSubViewHeader.js +66 -40
  481. package/dist/voice-agent/components/GoogleLiveSurface.js +127 -90
  482. package/dist/voice-agent/components/LiveVoiceDoor.js +10 -7
  483. package/dist/voice-agent/components/VoiceAgentSurface.js +114 -92
  484. package/dist/voice-agent/components/VoiceControlCluster.js +5 -1
  485. package/dist/voice-agent/components/VoiceDebugPanel.js +212 -107
  486. package/dist/voice-agent/components/VoiceEdgeRibbon.js +63 -60
  487. package/dist/voice-agent/components/VoiceErrorBanner.js +20 -17
  488. package/dist/voice-agent/components/VoiceMicButton.js +5 -4
  489. package/dist/voice-agent/components/VoiceMuteButton.js +5 -4
  490. package/dist/voice-agent/components/VoiceOrb.js +84 -81
  491. package/dist/voice-agent/components/VoiceStatusPill.js +12 -11
  492. package/dist/voice-agent/components/VoiceTranscriptStream.js +8 -5
  493. package/dist/voice-agent/components/VoiceTranscriptTurn.js +20 -17
  494. package/dist/voice-agent/components/playground/InstructionsEditor.js +34 -27
  495. package/dist/voice-agent/components/playground/PlaygroundSettingsSheet.js +27 -15
  496. package/dist/voice-agent/components/playground/ToolToggleList.js +34 -25
  497. package/dist/voice-agent/components/playground/VoicePicker.js +17 -10
  498. package/dist/voice-agent/relay/VoiceChatClient.js +3 -2
  499. package/dist/voice-agent/relay/VoiceRelayBar.js +60 -53
  500. package/dist/voice-agent/relay/VoiceRelayDock.js +26 -14
  501. package/dist/voice-agent/relay/VoiceRelayPanel.js +21 -10
  502. package/dist/window-panels/windows/agents/AgentAssistantMarkdownDebugWindow.js +74 -59
  503. package/dist/window-panels/windows/agents/AgentMemoryWindow.js +24 -20
  504. package/dist/window-panels/windows/agents/AgentPickerFrame.js +14 -13
  505. package/dist/window-panels/windows/agents/AgentRunHistoryWindow.js +151 -112
  506. package/dist/window-panels/windows/agents/AgentRunWindow.js +118 -78
  507. package/dist/window-panels/windows/agents/ChatHistoryWindow.js +49 -38
  508. package/dist/window-panels/windows/agents/LiveRunWindow.js +34 -31
  509. package/dist/window-panels/windows/agents/MessageAnalysisWindow.js +39 -34
  510. package/dist/window-panels/windows/agents/ObservationalMemoryWindow.js +189 -137
  511. package/dist/window-panels/windows/agents/RunControlsWindow.js +50 -49
  512. package/package.json +9 -9
@@ -1,8 +1,9 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { useClipboard } from "@ai-matrx/kit/clipboard";
3
4
  import { toast } from "../../../../host/notify.js";
4
5
  import { formatDurationSeconds } from "@ai-matrx/kit/format";
5
- import React, { useState } from "react";
6
+ import { useState } from "react";
6
7
  import { Copy, Check } from "lucide-react";
7
8
  import { useAppSelector } from "../../../../store/hooks.js";
8
9
  import { selectInstanceUIState } from "../../../redux/execution-system/instance-ui-state/instance-ui-state.selectors.js";
@@ -31,49 +32,55 @@ function CopyableValue({
31
32
  setTimeout(() => setCopied(false), 1200);
32
33
  });
33
34
  };
34
- return /* @__PURE__ */ React.createElement("span", { className: cn("flex items-center gap-1.5 min-w-0", className) }, /* @__PURE__ */ React.createElement(
35
- "span",
36
- {
37
- className: cn(
38
- "truncate text-[11px] text-foreground",
39
- mono && "font-mono"
40
- ),
41
- title: value
42
- },
43
- value
44
- ), /* @__PURE__ */ React.createElement(
45
- Button,
46
- {
47
- variant: "quiet",
48
- icon: copied ? /* @__PURE__ */ React.createElement(Check, null) : /* @__PURE__ */ React.createElement(Copy, null),
49
- glyphTone: copied ? "success" : void 0,
50
- onClick: handleCopy,
51
- title: "Copy",
52
- "aria-label": "Copy",
53
- className: "shrink-0"
54
- }
55
- ));
35
+ return /* @__PURE__ */ jsxs("span", { className: cn("flex items-center gap-1.5 min-w-0", className), children: [
36
+ /* @__PURE__ */ jsx(
37
+ "span",
38
+ {
39
+ className: cn(
40
+ "truncate text-[11px] text-foreground",
41
+ mono && "font-mono"
42
+ ),
43
+ title: value,
44
+ children: value
45
+ }
46
+ ),
47
+ /* @__PURE__ */ jsx(
48
+ Button,
49
+ {
50
+ variant: "quiet",
51
+ icon: copied ? /* @__PURE__ */ jsx(Check, {}) : /* @__PURE__ */ jsx(Copy, {}),
52
+ glyphTone: copied ? "success" : void 0,
53
+ onClick: handleCopy,
54
+ title: "Copy",
55
+ "aria-label": "Copy",
56
+ className: "shrink-0"
57
+ }
58
+ )
59
+ ] });
56
60
  }
57
61
  function Row({
58
62
  label,
59
63
  children
60
64
  }) {
61
- return /* @__PURE__ */ React.createElement("div", { className: "flex items-baseline gap-3 py-1 border-b border-border/40 last:border-0" }, /* @__PURE__ */ React.createElement("span", { className: "w-32 min-w-32 shrink-0 text-right text-[11px] text-muted-foreground" }, label), /* @__PURE__ */ React.createElement("span", { className: "flex-1 min-w-0 text-[11px] text-foreground break-all" }, children));
65
+ return /* @__PURE__ */ jsxs("div", { className: "flex items-baseline gap-3 py-1 border-b border-border/40 last:border-0", children: [
66
+ /* @__PURE__ */ jsx("span", { className: "w-32 min-w-32 shrink-0 text-right text-[11px] text-muted-foreground", children: label }),
67
+ /* @__PURE__ */ jsx("span", { className: "flex-1 min-w-0 text-[11px] text-foreground break-all", children })
68
+ ] });
62
69
  }
63
70
  function Pill({
64
71
  variant,
65
72
  children
66
73
  }) {
67
74
  const cls = variant === "active" ? "bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 border-emerald-500/30" : variant === "warn" ? "bg-amber-500/15 text-amber-600 dark:text-amber-400 border-amber-500/30" : "bg-muted text-muted-foreground border-border";
68
- return /* @__PURE__ */ React.createElement(
75
+ return /* @__PURE__ */ jsx(
69
76
  "span",
70
77
  {
71
78
  className: cn(
72
79
  "inline-flex items-center px-1.5 py-0.5 rounded border text-[10px] font-mono uppercase tracking-wider",
73
80
  cls
74
- )
75
- },
76
- children
81
+ ),
82
+ children
83
+ }
77
84
  );
78
85
  }
79
86
  function maskToken(token) {
@@ -100,13 +107,52 @@ function BackendTargetPanel({
100
107
  const channel = overrideUrl ? "override" : "global";
101
108
  const effectiveUrl = overrideUrl ?? globalBaseUrl ?? "(unconfigured)";
102
109
  const tokenStatus = channel === "override" ? overrideToken ? "minted" : "missing" : "n/a";
103
- return /* @__PURE__ */ React.createElement("div", { className: "px-3 py-2 space-y-3" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center gap-2 flex-wrap" }, /* @__PURE__ */ React.createElement("span", { className: "text-[11px] text-muted-foreground" }, "Channel:"), channel === "override" ? /* @__PURE__ */ React.createElement(Pill, { variant: "active" }, "Sandbox proxy") : /* @__PURE__ */ React.createElement(Pill, { variant: "muted" }, "Cloud server"), /* @__PURE__ */ React.createElement("span", { className: "text-[11px] text-muted-foreground" }, "\xB7"), /* @__PURE__ */ React.createElement("span", { className: "text-[11px] text-muted-foreground" }, "Editor:"), /* @__PURE__ */ React.createElement(Pill, { variant: editorMode === "sandbox" ? "active" : "muted" }, editorMode)), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement(Row, { label: "Effective URL" }, /* @__PURE__ */ React.createElement(CopyableValue, { value: effectiveUrl })), /* @__PURE__ */ React.createElement(Row, { label: "Auth scheme" }, /* @__PURE__ */ React.createElement("span", null, "Bearer (Supabase JWT)"))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1" }, "Cloud (global)"), /* @__PURE__ */ React.createElement(Row, { label: "Resolved URL" }, globalBaseUrl ? /* @__PURE__ */ React.createElement(CopyableValue, { value: globalBaseUrl }) : /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground/60" }, "(none)"))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1" }, "Per-conversation override"), /* @__PURE__ */ React.createElement(Row, { label: "Override URL" }, overrideUrl ? /* @__PURE__ */ React.createElement(CopyableValue, { value: overrideUrl }) : /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground/60" }, "(none)")), /* @__PURE__ */ React.createElement(Row, { label: "Bearer token" }, overrideToken ? /* @__PURE__ */ React.createElement("span", { className: "flex items-center gap-2" }, /* @__PURE__ */ React.createElement("span", { className: "font-mono text-[11px]" }, maskToken(overrideToken)), /* @__PURE__ */ React.createElement(CopyableValue, { value: overrideToken, mono: true, className: "hidden" })) : /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground/60" }, "(none)")), /* @__PURE__ */ React.createElement(Row, { label: "Token status" }, /* @__PURE__ */ React.createElement(
104
- Pill,
105
- {
106
- variant: tokenStatus === "minted" ? "active" : tokenStatus === "missing" ? "warn" : "muted"
107
- },
108
- tokenStatus
109
- )), overrideTokenError && /* @__PURE__ */ React.createElement(Row, { label: "Mint error" }, /* @__PURE__ */ React.createElement("span", { className: "text-amber-600 dark:text-amber-400 break-words" }, overrideTokenError, /* @__PURE__ */ React.createElement(ErrorAlchemyMenu, { error: overrideTokenError })))), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1" }, "Sandbox binding (codeWorkspace)"), /* @__PURE__ */ React.createElement(Row, { label: "Active sandbox id" }, activeSandboxId ? /* @__PURE__ */ React.createElement(CopyableValue, { value: activeSandboxId }) : /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground/60" }, "(none)")), /* @__PURE__ */ React.createElement(Row, { label: "Sandbox proxy URL" }, activeSandboxProxyUrl ? /* @__PURE__ */ React.createElement(CopyableValue, { value: activeSandboxProxyUrl }) : /* @__PURE__ */ React.createElement("span", { className: "text-muted-foreground/60" }, "(orchestrator hasn\u2019t shipped one for this sandbox)"))), /* @__PURE__ */ React.createElement("p", { className: "text-[10px] text-muted-foreground/70 leading-relaxed" }, "Read-only; redirects only this conversation\u2019s ", /* @__PURE__ */ React.createElement("code", null, "/ai/*"), " calls"));
110
+ return /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 space-y-3", children: [
111
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 flex-wrap", children: [
112
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: "Channel:" }),
113
+ channel === "override" ? /* @__PURE__ */ jsx(Pill, { variant: "active", children: "Sandbox proxy" }) : /* @__PURE__ */ jsx(Pill, { variant: "muted", children: "Cloud server" }),
114
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: "\xB7" }),
115
+ /* @__PURE__ */ jsx("span", { className: "text-[11px] text-muted-foreground", children: "Editor:" }),
116
+ /* @__PURE__ */ jsx(Pill, { variant: editorMode === "sandbox" ? "active" : "muted", children: editorMode })
117
+ ] }),
118
+ /* @__PURE__ */ jsxs("div", { children: [
119
+ /* @__PURE__ */ jsx(Row, { label: "Effective URL", children: /* @__PURE__ */ jsx(CopyableValue, { value: effectiveUrl }) }),
120
+ /* @__PURE__ */ jsx(Row, { label: "Auth scheme", children: /* @__PURE__ */ jsx("span", { children: "Bearer (Supabase JWT)" }) })
121
+ ] }),
122
+ /* @__PURE__ */ jsxs("div", { children: [
123
+ /* @__PURE__ */ jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1", children: "Cloud (global)" }),
124
+ /* @__PURE__ */ jsx(Row, { label: "Resolved URL", children: globalBaseUrl ? /* @__PURE__ */ jsx(CopyableValue, { value: globalBaseUrl }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "(none)" }) })
125
+ ] }),
126
+ /* @__PURE__ */ jsxs("div", { children: [
127
+ /* @__PURE__ */ jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1", children: "Per-conversation override" }),
128
+ /* @__PURE__ */ jsx(Row, { label: "Override URL", children: overrideUrl ? /* @__PURE__ */ jsx(CopyableValue, { value: overrideUrl }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "(none)" }) }),
129
+ /* @__PURE__ */ jsx(Row, { label: "Bearer token", children: overrideToken ? /* @__PURE__ */ jsxs("span", { className: "flex items-center gap-2", children: [
130
+ /* @__PURE__ */ jsx("span", { className: "font-mono text-[11px]", children: maskToken(overrideToken) }),
131
+ /* @__PURE__ */ jsx(CopyableValue, { value: overrideToken, mono: true, className: "hidden" })
132
+ ] }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "(none)" }) }),
133
+ /* @__PURE__ */ jsx(Row, { label: "Token status", children: /* @__PURE__ */ jsx(
134
+ Pill,
135
+ {
136
+ variant: tokenStatus === "minted" ? "active" : tokenStatus === "missing" ? "warn" : "muted",
137
+ children: tokenStatus
138
+ }
139
+ ) }),
140
+ overrideTokenError && /* @__PURE__ */ jsx(Row, { label: "Mint error", children: /* @__PURE__ */ jsxs("span", { className: "text-amber-600 dark:text-amber-400 break-words", children: [
141
+ overrideTokenError,
142
+ /* @__PURE__ */ jsx(ErrorAlchemyMenu, { error: overrideTokenError })
143
+ ] }) })
144
+ ] }),
145
+ /* @__PURE__ */ jsxs("div", { children: [
146
+ /* @__PURE__ */ jsx("div", { className: "text-[10px] font-semibold uppercase tracking-wider text-muted-foreground/70 pb-1 border-b border-border/40 mb-1", children: "Sandbox binding (codeWorkspace)" }),
147
+ /* @__PURE__ */ jsx(Row, { label: "Active sandbox id", children: activeSandboxId ? /* @__PURE__ */ jsx(CopyableValue, { value: activeSandboxId }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "(none)" }) }),
148
+ /* @__PURE__ */ jsx(Row, { label: "Sandbox proxy URL", children: activeSandboxProxyUrl ? /* @__PURE__ */ jsx(CopyableValue, { value: activeSandboxProxyUrl }) : /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60", children: "(orchestrator hasn\u2019t shipped one for this sandbox)" }) })
149
+ ] }),
150
+ /* @__PURE__ */ jsxs("p", { className: "text-[10px] text-muted-foreground/70 leading-relaxed", children: [
151
+ "Read-only; redirects only this conversation\u2019s ",
152
+ /* @__PURE__ */ jsx("code", { children: "/ai/*" }),
153
+ " calls"
154
+ ] })
155
+ ] });
110
156
  }
111
157
  export {
112
158
  BackendTargetPanel
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
2
3
  import { useMemo } from "react";
3
4
  import { useAppSelector } from "../../../../store/hooks.js";
4
5
  import { formatFileSize } from "@ai-matrx/kit/format";
@@ -21,7 +22,7 @@ function ClientMetricsPanel({
21
22
  const request = useAppSelector(selector);
22
23
  const metrics = request?.clientMetrics ?? null;
23
24
  if (!metrics) {
24
- return /* @__PURE__ */ React.createElement(
25
+ return /* @__PURE__ */ jsx(
25
26
  EmptyStats,
26
27
  {
27
28
  text: (
@@ -31,38 +32,69 @@ function ClientMetricsPanel({
31
32
  }
32
33
  );
33
34
  }
34
- return /* @__PURE__ */ React.createElement("div", { className: "px-3 py-2 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 overflow-y-auto h-full" }, /* @__PURE__ */ React.createElement(StatSection, { title: "Timing" }, /* @__PURE__ */ React.createElement(
35
- StatRow,
36
- {
37
- label: "Internal latency",
38
- value: fmtMs(metrics.internalLatencyMs)
39
- }
40
- ), /* @__PURE__ */ React.createElement(StatRow, { label: "TTFT", value: fmtMs(metrics.ttftMs) }), /* @__PURE__ */ React.createElement(
41
- StatRow,
42
- {
43
- label: "Stream duration",
44
- value: fmtMs(metrics.streamDurationMs)
45
- }
46
- ), /* @__PURE__ */ React.createElement(StatRow, { label: "Render delay", value: fmtMs(metrics.renderDelayMs) }), /* @__PURE__ */ React.createElement(
47
- StatRow,
48
- {
49
- label: "Total client",
50
- value: fmtMs(metrics.totalClientDurationMs)
51
- }
52
- )), /* @__PURE__ */ React.createElement(StatSection, { title: "Payload" }, /* @__PURE__ */ React.createElement(
53
- StatRow,
54
- {
55
- label: "Accumulated text",
56
- value: formatFileSize(metrics.accumulatedTextBytes)
57
- }
58
- ), /* @__PURE__ */ React.createElement(StatRow, { label: "Total", value: formatFileSize(metrics.totalPayloadBytes) })), /* @__PURE__ */ React.createElement(StatSection, { title: "Event counts" }, /* @__PURE__ */ React.createElement(StatRow, { label: "Total", value: metrics.totalEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Chunks", value: metrics.chunkEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Reasoning", value: metrics.reasoningChunkEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Phases", value: metrics.phaseEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Tool events", value: metrics.toolEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Render blocks", value: metrics.renderBlockEvents })), /* @__PURE__ */ React.createElement(StatSection, { title: "Records" }, /* @__PURE__ */ React.createElement(StatRow, { label: "Init", value: metrics.initEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Completion", value: metrics.completionEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Data", value: metrics.dataEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Reserved", value: metrics.recordReservedEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "Updated", value: metrics.recordUpdateEvents }), /* @__PURE__ */ React.createElement(StatRow, { label: "FS Changes", value: metrics.resourceChangedEvents }), metrics.warningEvents > 0 && /* @__PURE__ */ React.createElement(
59
- StatRow,
60
- {
61
- label: "Warnings",
62
- value: metrics.warningEvents,
63
- valueClassName: "text-amber-500"
64
- }
65
- ), metrics.infoEvents > 0 && /* @__PURE__ */ React.createElement(StatRow, { label: "Info", value: metrics.infoEvents }), metrics.otherEvents > 0 && /* @__PURE__ */ React.createElement(StatRow, { label: "Other", value: metrics.otherEvents })));
35
+ return /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 overflow-y-auto h-full", children: [
36
+ /* @__PURE__ */ jsxs(StatSection, { title: "Timing", children: [
37
+ /* @__PURE__ */ jsx(
38
+ StatRow,
39
+ {
40
+ label: "Internal latency",
41
+ value: fmtMs(metrics.internalLatencyMs)
42
+ }
43
+ ),
44
+ /* @__PURE__ */ jsx(StatRow, { label: "TTFT", value: fmtMs(metrics.ttftMs) }),
45
+ /* @__PURE__ */ jsx(
46
+ StatRow,
47
+ {
48
+ label: "Stream duration",
49
+ value: fmtMs(metrics.streamDurationMs)
50
+ }
51
+ ),
52
+ /* @__PURE__ */ jsx(StatRow, { label: "Render delay", value: fmtMs(metrics.renderDelayMs) }),
53
+ /* @__PURE__ */ jsx(
54
+ StatRow,
55
+ {
56
+ label: "Total client",
57
+ value: fmtMs(metrics.totalClientDurationMs)
58
+ }
59
+ )
60
+ ] }),
61
+ /* @__PURE__ */ jsxs(StatSection, { title: "Payload", children: [
62
+ /* @__PURE__ */ jsx(
63
+ StatRow,
64
+ {
65
+ label: "Accumulated text",
66
+ value: formatFileSize(metrics.accumulatedTextBytes)
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsx(StatRow, { label: "Total", value: formatFileSize(metrics.totalPayloadBytes) })
70
+ ] }),
71
+ /* @__PURE__ */ jsxs(StatSection, { title: "Event counts", children: [
72
+ /* @__PURE__ */ jsx(StatRow, { label: "Total", value: metrics.totalEvents }),
73
+ /* @__PURE__ */ jsx(StatRow, { label: "Chunks", value: metrics.chunkEvents }),
74
+ /* @__PURE__ */ jsx(StatRow, { label: "Reasoning", value: metrics.reasoningChunkEvents }),
75
+ /* @__PURE__ */ jsx(StatRow, { label: "Phases", value: metrics.phaseEvents }),
76
+ /* @__PURE__ */ jsx(StatRow, { label: "Tool events", value: metrics.toolEvents }),
77
+ /* @__PURE__ */ jsx(StatRow, { label: "Render blocks", value: metrics.renderBlockEvents })
78
+ ] }),
79
+ /* @__PURE__ */ jsxs(StatSection, { title: "Records", children: [
80
+ /* @__PURE__ */ jsx(StatRow, { label: "Init", value: metrics.initEvents }),
81
+ /* @__PURE__ */ jsx(StatRow, { label: "Completion", value: metrics.completionEvents }),
82
+ /* @__PURE__ */ jsx(StatRow, { label: "Data", value: metrics.dataEvents }),
83
+ /* @__PURE__ */ jsx(StatRow, { label: "Reserved", value: metrics.recordReservedEvents }),
84
+ /* @__PURE__ */ jsx(StatRow, { label: "Updated", value: metrics.recordUpdateEvents }),
85
+ /* @__PURE__ */ jsx(StatRow, { label: "FS Changes", value: metrics.resourceChangedEvents }),
86
+ metrics.warningEvents > 0 && /* @__PURE__ */ jsx(
87
+ StatRow,
88
+ {
89
+ label: "Warnings",
90
+ value: metrics.warningEvents,
91
+ valueClassName: "text-amber-500"
92
+ }
93
+ ),
94
+ metrics.infoEvents > 0 && /* @__PURE__ */ jsx(StatRow, { label: "Info", value: metrics.infoEvents }),
95
+ metrics.otherEvents > 0 && /* @__PURE__ */ jsx(StatRow, { label: "Other", value: metrics.otherEvents })
96
+ ] })
97
+ ] });
66
98
  }
67
99
  export {
68
100
  ClientMetricsPanel
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { formatDurationSeconds, formatCount } from "@ai-matrx/kit/format";
3
4
  import { useEffect, useMemo, useState } from "react";
4
5
  import { useAppDispatch, useAppSelector } from "../../../../store/hooks.js";
@@ -68,7 +69,7 @@ function ModelContextPanel({ conversationId }) {
68
69
  return () => controller.abort();
69
70
  }, [canLoad, conversationId, dispatch, readAttempt]);
70
71
  if (!state && (organizationState === "required" || organizationState === "unavailable")) {
71
- return /* @__PURE__ */ React.createElement(
72
+ return /* @__PURE__ */ jsx(
72
73
  OrganizationContextNotice,
73
74
  {
74
75
  compact: true,
@@ -80,7 +81,7 @@ function ModelContextPanel({ conversationId }) {
80
81
  );
81
82
  }
82
83
  if (!state && contextReadError) {
83
- return /* @__PURE__ */ React.createElement(
84
+ return /* @__PURE__ */ jsx(
84
85
  ReadFailure,
85
86
  {
86
87
  error: contextReadError,
@@ -93,7 +94,7 @@ function ModelContextPanel({ conversationId }) {
93
94
  );
94
95
  }
95
96
  if (!state) {
96
- return /* @__PURE__ */ React.createElement(
97
+ return /* @__PURE__ */ jsx(
97
98
  EmptyStats,
98
99
  {
99
100
  text: organizationState === "resolving" ? "Reading this conversation's context\u2026" : "No context measurements yet. Fire a turn to populate."
@@ -103,41 +104,64 @@ function ModelContextPanel({ conversationId }) {
103
104
  const fillPct = Math.round(fillRatio * 100);
104
105
  const fillTone = fillRatio < 0.6 ? "text-emerald-500" : fillRatio < 0.85 ? "text-amber-500" : "text-rose-500";
105
106
  const fillBar = fillRatio < 0.6 ? "bg-emerald-500" : fillRatio < 0.85 ? "bg-amber-500" : "bg-rose-500";
106
- return /* @__PURE__ */ React.createElement("div", { className: "px-3 py-2 grid grid-cols-1 gap-y-3 overflow-y-auto h-full" }, /* @__PURE__ */ React.createElement(StatSection, { title: "Now" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between text-[11px]" }, /* @__PURE__ */ React.createElement("span", { className: cn("font-mono tabular-nums", fillTone) }, fillPct, "% full"), /* @__PURE__ */ React.createElement("span", { className: "font-mono tabular-nums text-muted-foreground" }, fmtTokens(estTokens), " / ", fmtTokens(DEFAULT_CONTEXT_WINDOW_TOKENS), " ", "est tokens")), /* @__PURE__ */ React.createElement("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden" }, /* @__PURE__ */ React.createElement(
107
- "div",
108
- {
109
- className: cn("h-full transition-all duration-300", fillBar),
110
- style: { width: `${fillPct}%` }
111
- }
112
- )), /* @__PURE__ */ React.createElement(
113
- StatRow,
114
- {
115
- label: "Last request",
116
- value: `${fmtTokens(state.lastRequestInputTokens)} in \xB7 ${fmtTokens(
117
- state.lastRequestCachedTokens
118
- )} cached \xB7 ${fmtTokens(state.lastRequestOutputTokens)} out`
119
- }
120
- ), /* @__PURE__ */ React.createElement(
121
- StatRow,
122
- {
123
- label: "Visible to model",
124
- value: `${fmtTokens(state.totalCharsVisibleToModel)} chars \xB7 ${state.messageCountVisible} messages`
125
- }
126
- ), /* @__PURE__ */ React.createElement(
127
- StatRow,
128
- {
129
- label: "Cache",
130
- value: cacheAlive ? `alive (${formatSecs(cacheSecs)} left)` : "expired / unknown",
131
- valueClassName: cacheAlive ? "text-emerald-500" : "text-muted-foreground"
132
- }
133
- ), state.measuredAt && /* @__PURE__ */ React.createElement(
134
- StatRow,
135
- {
136
- label: "Measured at",
137
- value: new Date(state.measuredAt).toLocaleTimeString(),
138
- valueClassName: "text-muted-foreground"
139
- }
140
- )), /* @__PURE__ */ React.createElement(StatSection, { title: "What just happened" }, trim ? /* @__PURE__ */ React.createElement(TrimSummaryView, { trim }) : /* @__PURE__ */ React.createElement("p", { className: "text-[11px] text-muted-foreground/80" }, "No trim activity recorded for this turn.")), /* @__PURE__ */ React.createElement(StatSection, { title: "Raw provider usage" }, rawUsage && Object.keys(rawUsage).length > 0 ? /* @__PURE__ */ React.createElement("pre", { className: "text-[10px] leading-snug bg-muted/40 rounded p-2 overflow-x-auto font-mono" }, JSON.stringify(rawUsage, null, 2)) : /* @__PURE__ */ React.createElement("p", { className: "text-[11px] text-muted-foreground/80" }, "No raw provider usage available \u2014 try a turn that returns a real response.")));
107
+ return /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 grid grid-cols-1 gap-y-3 overflow-y-auto h-full", children: [
108
+ /* @__PURE__ */ jsxs(StatSection, { title: "Now", children: [
109
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-[11px]", children: [
110
+ /* @__PURE__ */ jsxs("span", { className: cn("font-mono tabular-nums", fillTone), children: [
111
+ fillPct,
112
+ "% full"
113
+ ] }),
114
+ /* @__PURE__ */ jsxs("span", { className: "font-mono tabular-nums text-muted-foreground", children: [
115
+ fmtTokens(estTokens),
116
+ " / ",
117
+ fmtTokens(DEFAULT_CONTEXT_WINDOW_TOKENS),
118
+ " ",
119
+ "est tokens"
120
+ ] })
121
+ ] }),
122
+ /* @__PURE__ */ jsx("div", { className: "h-1.5 w-full rounded-full bg-muted overflow-hidden", children: /* @__PURE__ */ jsx(
123
+ "div",
124
+ {
125
+ className: cn("h-full transition-all duration-300", fillBar),
126
+ style: { width: `${fillPct}%` }
127
+ }
128
+ ) }),
129
+ /* @__PURE__ */ jsx(
130
+ StatRow,
131
+ {
132
+ label: "Last request",
133
+ value: `${fmtTokens(state.lastRequestInputTokens)} in \xB7 ${fmtTokens(
134
+ state.lastRequestCachedTokens
135
+ )} cached \xB7 ${fmtTokens(state.lastRequestOutputTokens)} out`
136
+ }
137
+ ),
138
+ /* @__PURE__ */ jsx(
139
+ StatRow,
140
+ {
141
+ label: "Visible to model",
142
+ value: `${fmtTokens(state.totalCharsVisibleToModel)} chars \xB7 ${state.messageCountVisible} messages`
143
+ }
144
+ ),
145
+ /* @__PURE__ */ jsx(
146
+ StatRow,
147
+ {
148
+ label: "Cache",
149
+ value: cacheAlive ? `alive (${formatSecs(cacheSecs)} left)` : "expired / unknown",
150
+ valueClassName: cacheAlive ? "text-emerald-500" : "text-muted-foreground"
151
+ }
152
+ ),
153
+ state.measuredAt && /* @__PURE__ */ jsx(
154
+ StatRow,
155
+ {
156
+ label: "Measured at",
157
+ value: new Date(state.measuredAt).toLocaleTimeString(),
158
+ valueClassName: "text-muted-foreground"
159
+ }
160
+ )
161
+ ] }),
162
+ /* @__PURE__ */ jsx(StatSection, { title: "What just happened", children: trim ? /* @__PURE__ */ jsx(TrimSummaryView, { trim }) : /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground/80", children: "No trim activity recorded for this turn." }) }),
163
+ /* @__PURE__ */ jsx(StatSection, { title: "Raw provider usage", children: rawUsage && Object.keys(rawUsage).length > 0 ? /* @__PURE__ */ jsx("pre", { className: "text-[10px] leading-snug bg-muted/40 rounded p-2 overflow-x-auto font-mono", children: JSON.stringify(rawUsage, null, 2) }) : /* @__PURE__ */ jsx("p", { className: "text-[11px] text-muted-foreground/80", children: "No raw provider usage available \u2014 try a turn that returns a real response." }) })
164
+ ] });
141
165
  }
142
166
  function TrimSummaryView({ trim }) {
143
167
  if (!trim) return null;
@@ -145,14 +169,38 @@ function TrimSummaryView({ trim }) {
145
169
  const rewrittenCount = trim.blocks_rewritten ?? 0;
146
170
  const freed = trim.freed_chars ?? 0;
147
171
  const rewrittenBlocks = trim.rewritten_blocks ?? [];
148
- return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
149
- StatRow,
150
- {
151
- label: "Outcome",
152
- value: skipped ? `skipped (${skipped})` : `${rewrittenCount} block(s) rewritten`,
153
- valueClassName: skipped ? "text-amber-500" : rewrittenCount > 0 ? "text-emerald-500" : "text-muted-foreground"
154
- }
155
- ), rewrittenCount > 0 && /* @__PURE__ */ React.createElement(StatRow, { label: "Freed", value: `${formatCount(freed)} chars` }), rewrittenBlocks.length > 0 && /* @__PURE__ */ React.createElement("div", { className: "text-[10px] font-mono text-muted-foreground space-y-0.5 mt-1" }, rewrittenBlocks.slice(0, 8).map((b) => /* @__PURE__ */ React.createElement("div", { key: `${b.message_position}:${b.call_id}`, className: "truncate" }, "pos ", b.message_position, " \xB7 ", b.tool_name, " (", b.tier, ") \xB7", " ", formatCount(b.before_chars), " \u2192 ", formatCount(b.after_chars))), rewrittenBlocks.length > 8 && /* @__PURE__ */ React.createElement("div", { className: "italic" }, "\u2026and ", rewrittenBlocks.length - 8, " more")), skipped === "cache_protect" && /* @__PURE__ */ React.createElement("p", { className: "text-[10px] text-muted-foreground/80 mt-1" }, "Cache protected; retries at 5K tokens saved or cache expiry"));
172
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
173
+ /* @__PURE__ */ jsx(
174
+ StatRow,
175
+ {
176
+ label: "Outcome",
177
+ value: skipped ? `skipped (${skipped})` : `${rewrittenCount} block(s) rewritten`,
178
+ valueClassName: skipped ? "text-amber-500" : rewrittenCount > 0 ? "text-emerald-500" : "text-muted-foreground"
179
+ }
180
+ ),
181
+ rewrittenCount > 0 && /* @__PURE__ */ jsx(StatRow, { label: "Freed", value: `${formatCount(freed)} chars` }),
182
+ rewrittenBlocks.length > 0 && /* @__PURE__ */ jsxs("div", { className: "text-[10px] font-mono text-muted-foreground space-y-0.5 mt-1", children: [
183
+ rewrittenBlocks.slice(0, 8).map((b) => /* @__PURE__ */ jsxs("div", { className: "truncate", children: [
184
+ "pos ",
185
+ b.message_position,
186
+ " \xB7 ",
187
+ b.tool_name,
188
+ " (",
189
+ b.tier,
190
+ ") \xB7",
191
+ " ",
192
+ formatCount(b.before_chars),
193
+ " \u2192 ",
194
+ formatCount(b.after_chars)
195
+ ] }, `${b.message_position}:${b.call_id}`)),
196
+ rewrittenBlocks.length > 8 && /* @__PURE__ */ jsxs("div", { className: "italic", children: [
197
+ "\u2026and ",
198
+ rewrittenBlocks.length - 8,
199
+ " more"
200
+ ] })
201
+ ] }),
202
+ skipped === "cache_protect" && /* @__PURE__ */ jsx("p", { className: "text-[10px] text-muted-foreground/80 mt-1", children: "Cache protected; retries at 5K tokens saved or cache expiry" })
203
+ ] });
156
204
  }
157
205
  function formatSecs(secs) {
158
206
  if (secs <= 0) return "expired";
@@ -1,4 +1,5 @@
1
1
  "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { useCostDisplay } from "../../../cost.js";
3
4
  import { useMemo } from "react";
4
5
  import { useAppSelector } from "../../../../store/hooks.js";
@@ -24,7 +25,7 @@ function RequestStatsPanel({
24
25
  );
25
26
  const request = useAppSelector(selector);
26
27
  if (!request) {
27
- return /* @__PURE__ */ React.createElement(
28
+ return /* @__PURE__ */ jsx(
28
29
  EmptyStats,
29
30
  {
30
31
  text: (
@@ -39,58 +40,86 @@ function RequestStatsPanel({
39
40
  const timing = result?.timing_stats ?? void 0;
40
41
  const toolStats = result?.tool_call_stats ?? void 0;
41
42
  const isComplete = request.status === "complete" || request.status === "error";
42
- return /* @__PURE__ */ React.createElement("div", { className: "px-3 py-2 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 overflow-y-auto h-full" }, /* @__PURE__ */ React.createElement(StatSection, { title: "Status" }, /* @__PURE__ */ React.createElement(StatRow, { label: "Request", value: request.status }), /* @__PURE__ */ React.createElement(StatRow, { label: "Finish reason", value: result?.finish_reason ?? "\u2014" }), /* @__PURE__ */ React.createElement(
43
- StatRow,
44
- {
45
- label: "Iterations",
46
- value: result?.iterations != null ? String(result.iterations) : "\u2014"
47
- }
48
- ), request.error && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(
49
- StatRow,
50
- {
51
- label: "Error",
52
- value: `[${request.error.error_type}${request.error.code ? `:${request.error.code}` : ""}] ${request.error.message}`,
53
- valueClassName: "text-destructive text-[10px]"
54
- }
55
- ), request.error.user_message && /* @__PURE__ */ React.createElement(
56
- StatRow,
57
- {
58
- label: "User message",
59
- value: request.error.user_message,
60
- valueClassName: "text-destructive text-[10px]"
61
- }
62
- ))), /* @__PURE__ */ React.createElement(StatSection, { title: "Tokens" }, /* @__PURE__ */ React.createElement(StatRow, { label: "Input", value: fmtTokens(usage?.input_tokens) }), /* @__PURE__ */ React.createElement(
63
- StatRow,
64
- {
65
- label: "Cached in",
66
- value: fmtTokens(usage?.cached_input_tokens)
67
- }
68
- ), /* @__PURE__ */ React.createElement(StatRow, { label: "Output", value: fmtTokens(usage?.output_tokens) }), /* @__PURE__ */ React.createElement(StatRow, { label: "Total", value: fmtTokens(usage?.total_tokens) })), /* @__PURE__ */ React.createElement(StatSection, { title: "Cost & duration" }, /* @__PURE__ */ React.createElement(StatRow, { label: "Cost", value: fmtCost(usage?.total_cost, costUnit) }), /* @__PURE__ */ React.createElement(StatRow, { label: "Total", value: fmtServerSeconds(timing?.total_duration) }), /* @__PURE__ */ React.createElement(StatRow, { label: "API", value: fmtServerSeconds(timing?.api_duration) }), /* @__PURE__ */ React.createElement(StatRow, { label: "Tools", value: fmtServerSeconds(timing?.tool_duration) })), /* @__PURE__ */ React.createElement(StatSection, { title: "Tools" }, /* @__PURE__ */ React.createElement(
69
- StatRow,
70
- {
71
- label: "Tool calls",
72
- value: toolStats?.total_tool_calls != null ? String(toolStats.total_tool_calls) : "\u2014"
73
- }
74
- ), /* @__PURE__ */ React.createElement(
75
- StatRow,
76
- {
77
- label: "Iters w/ tools",
78
- value: toolStats?.iterations_with_tools != null ? String(toolStats.iterations_with_tools) : "\u2014"
79
- }
80
- ), /* @__PURE__ */ React.createElement(
81
- StatRow,
82
- {
83
- label: "Tool types",
84
- value: toolStats?.by_tool ? Object.keys(toolStats.by_tool).length : "\u2014"
85
- }
86
- ), !isComplete && /* @__PURE__ */ React.createElement(
87
- StatRow,
88
- {
89
- label: "State",
90
- value: "streaming\u2026",
91
- valueClassName: "text-blue-500 text-[10px]"
92
- }
93
- )));
43
+ return /* @__PURE__ */ jsxs("div", { className: "px-3 py-2 grid grid-cols-1 sm:grid-cols-2 gap-x-6 gap-y-3 overflow-y-auto h-full", children: [
44
+ /* @__PURE__ */ jsxs(StatSection, { title: "Status", children: [
45
+ /* @__PURE__ */ jsx(StatRow, { label: "Request", value: request.status }),
46
+ /* @__PURE__ */ jsx(StatRow, { label: "Finish reason", value: result?.finish_reason ?? "\u2014" }),
47
+ /* @__PURE__ */ jsx(
48
+ StatRow,
49
+ {
50
+ label: "Iterations",
51
+ value: result?.iterations != null ? String(result.iterations) : "\u2014"
52
+ }
53
+ ),
54
+ request.error && /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ /* @__PURE__ */ jsx(
56
+ StatRow,
57
+ {
58
+ label: "Error",
59
+ value: `[${request.error.error_type}${request.error.code ? `:${request.error.code}` : ""}] ${request.error.message}`,
60
+ valueClassName: "text-destructive text-[10px]"
61
+ }
62
+ ),
63
+ request.error.user_message && /* @__PURE__ */ jsx(
64
+ StatRow,
65
+ {
66
+ label: "User message",
67
+ value: request.error.user_message,
68
+ valueClassName: "text-destructive text-[10px]"
69
+ }
70
+ )
71
+ ] })
72
+ ] }),
73
+ /* @__PURE__ */ jsxs(StatSection, { title: "Tokens", children: [
74
+ /* @__PURE__ */ jsx(StatRow, { label: "Input", value: fmtTokens(usage?.input_tokens) }),
75
+ /* @__PURE__ */ jsx(
76
+ StatRow,
77
+ {
78
+ label: "Cached in",
79
+ value: fmtTokens(usage?.cached_input_tokens)
80
+ }
81
+ ),
82
+ /* @__PURE__ */ jsx(StatRow, { label: "Output", value: fmtTokens(usage?.output_tokens) }),
83
+ /* @__PURE__ */ jsx(StatRow, { label: "Total", value: fmtTokens(usage?.total_tokens) })
84
+ ] }),
85
+ /* @__PURE__ */ jsxs(StatSection, { title: "Cost & duration", children: [
86
+ /* @__PURE__ */ jsx(StatRow, { label: "Cost", value: fmtCost(usage?.total_cost, costUnit) }),
87
+ /* @__PURE__ */ jsx(StatRow, { label: "Total", value: fmtServerSeconds(timing?.total_duration) }),
88
+ /* @__PURE__ */ jsx(StatRow, { label: "API", value: fmtServerSeconds(timing?.api_duration) }),
89
+ /* @__PURE__ */ jsx(StatRow, { label: "Tools", value: fmtServerSeconds(timing?.tool_duration) })
90
+ ] }),
91
+ /* @__PURE__ */ jsxs(StatSection, { title: "Tools", children: [
92
+ /* @__PURE__ */ jsx(
93
+ StatRow,
94
+ {
95
+ label: "Tool calls",
96
+ value: toolStats?.total_tool_calls != null ? String(toolStats.total_tool_calls) : "\u2014"
97
+ }
98
+ ),
99
+ /* @__PURE__ */ jsx(
100
+ StatRow,
101
+ {
102
+ label: "Iters w/ tools",
103
+ value: toolStats?.iterations_with_tools != null ? String(toolStats.iterations_with_tools) : "\u2014"
104
+ }
105
+ ),
106
+ /* @__PURE__ */ jsx(
107
+ StatRow,
108
+ {
109
+ label: "Tool types",
110
+ value: toolStats?.by_tool ? Object.keys(toolStats.by_tool).length : "\u2014"
111
+ }
112
+ ),
113
+ !isComplete && /* @__PURE__ */ jsx(
114
+ StatRow,
115
+ {
116
+ label: "State",
117
+ value: "streaming\u2026",
118
+ valueClassName: "text-blue-500 text-[10px]"
119
+ }
120
+ )
121
+ ] })
122
+ ] });
94
123
  }
95
124
  export {
96
125
  RequestStatsPanel