@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,4 +1,5 @@
1
1
  "use client";
2
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
2
3
  import { useId, useRef, useState } from "react";
3
4
  import { Button } from "@ai-matrx/design-system/controls";
4
5
  import { Eye, EyeOff } from "lucide-react";
@@ -76,16 +77,35 @@ function ActionRequestAnswerForm({
76
77
  }) {
77
78
  const card = layout === "card";
78
79
  const idPrefix = `q${useId().replace(/:/g, "")}`;
79
- const problem = refusal ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1" }, /* @__PURE__ */ React.createElement("p", { className: "text-sm text-destructive" }, refusal.message, " ", /* @__PURE__ */ React.createElement(ErrorAlchemyMenu, { error: refusal.message })), refusal.remedy ? /* @__PURE__ */ React.createElement("p", { className: "text-sm text-muted-foreground" }, refusal.remedy, " ", /* @__PURE__ */ React.createElement(ErrorAlchemyMenu, { error: refusal.remedy })) : null) : null;
80
- const head = (title) => !card || render.subtitle ? /* @__PURE__ */ React.createElement("header", { className: "flex flex-col gap-2" }, card ? null : /* @__PURE__ */ React.createElement("h1", { className: "text-xl font-medium" }, title), render.subtitle ? /* @__PURE__ */ React.createElement("p", { className: "text-sm text-muted-foreground" }, render.subtitle) : null) : null;
81
- const foot = render.footnote ? /* @__PURE__ */ React.createElement("p", { className: "text-xs text-muted-foreground" }, render.footnote) : null;
82
- const shell = (body, title = render.title) => /* @__PURE__ */ React.createElement("section", { className: cn("flex flex-col", card ? "gap-4 p-4" : "gap-5 py-10") }, head(title), problem, body, foot);
80
+ const problem = refusal ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1", children: [
81
+ /* @__PURE__ */ jsxs("p", { className: "text-sm text-destructive", children: [
82
+ refusal.message,
83
+ " ",
84
+ /* @__PURE__ */ jsx(ErrorAlchemyMenu, { error: refusal.message })
85
+ ] }),
86
+ refusal.remedy ? /* @__PURE__ */ jsxs("p", { className: "text-sm text-muted-foreground", children: [
87
+ refusal.remedy,
88
+ " ",
89
+ /* @__PURE__ */ jsx(ErrorAlchemyMenu, { error: refusal.remedy })
90
+ ] }) : null
91
+ ] }) : null;
92
+ const head = (title) => !card || render.subtitle ? /* @__PURE__ */ jsxs("header", { className: "flex flex-col gap-2", children: [
93
+ card ? null : /* @__PURE__ */ jsx("h1", { className: "text-xl font-medium", children: title }),
94
+ render.subtitle ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: render.subtitle }) : null
95
+ ] }) : null;
96
+ const foot = render.footnote ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: render.footnote }) : null;
97
+ const shell = (body, title = render.title) => /* @__PURE__ */ jsxs("section", { className: cn("flex flex-col", card ? "gap-4 p-4" : "gap-5 py-10"), children: [
98
+ head(title),
99
+ problem,
100
+ body,
101
+ foot
102
+ ] });
83
103
  const common = { busy, onSubmit, idPrefix, autoFocus: !card };
84
104
  switch (render.form) {
85
105
  // THE ASKCARD WIZARD, from the server's stored questions. It carries its
86
106
  // own card chrome, so it is not wrapped in `shell` inside a chat card.
87
107
  case "questions": {
88
- const wizard = /* @__PURE__ */ React.createElement(
108
+ const wizard = /* @__PURE__ */ jsx(
89
109
  QuestionsAskForm,
90
110
  {
91
111
  askKey: askKey ?? idPrefix,
@@ -95,59 +115,71 @@ function ActionRequestAnswerForm({
95
115
  onSubmit: (body) => void onSubmit({ result: body })
96
116
  }
97
117
  );
98
- return card ? /* @__PURE__ */ React.createElement("div", { className: "p-2" }, wizard) : /* @__PURE__ */ React.createElement("section", { className: "flex flex-col gap-5 py-10" }, head(render.title), wizard, foot);
118
+ return card ? /* @__PURE__ */ jsx("div", { className: "p-2", children: wizard }) : /* @__PURE__ */ jsxs("section", { className: "flex flex-col gap-5 py-10", children: [
119
+ head(render.title),
120
+ wizard,
121
+ foot
122
+ ] });
99
123
  }
100
124
  case "approve":
101
125
  return shell(
102
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-3" }, render.consequence_note ? /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.consequence_note) : null, render.choices.map((choice) => /* @__PURE__ */ React.createElement(
103
- Button,
104
- {
105
- key: choice.value,
106
- variant: choice.tone === "primary" ? "primary" : "quiet",
107
- className: "w-full",
108
- disabled: busy,
109
- onClick: () => void onSubmit({ result: { approved: choice.value === "yes" } })
110
- },
111
- choice.label
112
- )))
126
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
127
+ render.consequence_note ? /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.consequence_note }) : null,
128
+ render.choices.map((choice) => /* @__PURE__ */ jsx(
129
+ Button,
130
+ {
131
+ variant: choice.tone === "primary" ? "primary" : "quiet",
132
+ className: "w-full",
133
+ disabled: busy,
134
+ onClick: () => void onSubmit({ result: { approved: choice.value === "yes" } }),
135
+ children: choice.label
136
+ },
137
+ choice.value
138
+ ))
139
+ ] })
113
140
  );
114
141
  case "approve_spend":
115
- return /* @__PURE__ */ React.createElement(ApproveSpend, { render, frame: shell, ...common });
142
+ return /* @__PURE__ */ jsx(ApproveSpend, { render, frame: shell, ...common });
116
143
  case "choose_one":
117
144
  return shell(
118
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-3" }, render.choices.map((choice) => /* @__PURE__ */ React.createElement(
145
+ /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: render.choices.map((choice) => /* @__PURE__ */ jsxs(
119
146
  SurfaceButton,
120
147
  {
121
- key: choice.value,
122
148
  variant: "outline",
123
149
  className: "h-auto w-full flex-col items-start gap-1 whitespace-normal py-3 text-left",
124
150
  disabled: busy,
125
- onClick: () => void onSubmit({ result: { value: choice.value } })
151
+ onClick: () => void onSubmit({ result: { value: choice.value } }),
152
+ children: [
153
+ /* @__PURE__ */ jsx("span", { className: "font-medium", children: choice.label }),
154
+ choice.detail ? /* @__PURE__ */ jsx("span", { className: "text-xs font-normal text-muted-foreground", children: choice.detail }) : null
155
+ ]
126
156
  },
127
- /* @__PURE__ */ React.createElement("span", { className: "font-medium" }, choice.label),
128
- choice.detail ? /* @__PURE__ */ React.createElement("span", { className: "text-xs font-normal text-muted-foreground" }, choice.detail) : null
129
- )))
157
+ choice.value
158
+ )) })
130
159
  );
131
160
  case "confirm_details":
132
- return shell(/* @__PURE__ */ React.createElement(ConfirmDetails, { render, ...common }));
161
+ return shell(/* @__PURE__ */ jsx(ConfirmDetails, { render, ...common }));
133
162
  case "pick_time":
134
- return shell(/* @__PURE__ */ React.createElement(PickTime, { render, ...common }));
163
+ return shell(/* @__PURE__ */ jsx(PickTime, { render, ...common }));
135
164
  case "credential":
136
- return shell(/* @__PURE__ */ React.createElement(Credential, { render, ...common }));
165
+ return shell(/* @__PURE__ */ jsx(Credential, { render, ...common }));
137
166
  case "vault_item":
138
- return shell(/* @__PURE__ */ React.createElement(VaultItem, { render, ...common }));
167
+ return shell(/* @__PURE__ */ jsx(VaultItem, { render, ...common }));
139
168
  case "browser_takeover":
140
169
  return shell(
141
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-3" }, render.detail ? /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.detail) : null, /* @__PURE__ */ React.createElement(
142
- Button,
143
- {
144
- variant: "primary",
145
- className: "w-full",
146
- disabled: busy,
147
- onClick: () => void onSubmit({ result: { taking_over: true }, origin: render.origin })
148
- },
149
- render.submit_label
150
- ))
170
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
171
+ render.detail ? /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.detail }) : null,
172
+ /* @__PURE__ */ jsx(
173
+ Button,
174
+ {
175
+ variant: "primary",
176
+ className: "w-full",
177
+ disabled: busy,
178
+ onClick: () => void onSubmit({ result: { taking_over: true }, origin: render.origin }),
179
+ children: render.submit_label
180
+ }
181
+ )
182
+ ] })
151
183
  );
152
184
  // NO FILE DOOR YET, AND A PICKER THAT CANNOT SEND ANYTHING IS WORSE THAN
153
185
  // NONE. aidream's `upload_file` result is a list of file ids and nothing on
@@ -155,10 +187,10 @@ function ActionRequestAnswerForm({
155
187
  // and the screen says plainly what to do instead.
156
188
  case "upload_file":
157
189
  return shell(
158
- /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, "Files cannot be sent from here yet. Reply to the message your agent sent you with the file attached, and it will pick it up there.")
190
+ /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: "Files cannot be sent from here yet. Reply to the message your agent sent you with the file attached, and it will pick it up there." })
159
191
  );
160
192
  case "one_time_code":
161
- return shell(/* @__PURE__ */ React.createElement(OneTimeCode, { render, ...common }));
193
+ return shell(/* @__PURE__ */ jsx(OneTimeCode, { render, ...common }));
162
194
  }
163
195
  }
164
196
  function prefilledValues(fields) {
@@ -172,52 +204,67 @@ function prefilledValues(fields) {
172
204
  }
173
205
  function ConfirmDetails({ render, busy, idPrefix, onSubmit }) {
174
206
  const [edits, setEdits] = useState({});
175
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, render.rows.map(
176
- (row) => row.editable ? /* @__PURE__ */ React.createElement("div", { key: row.key, className: "flex flex-col gap-1.5" }, /* @__PURE__ */ React.createElement("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-${row.key}` }, row.label), /* @__PURE__ */ React.createElement(
177
- Input,
207
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
208
+ render.rows.map(
209
+ (row) => row.editable ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
210
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-${row.key}`, children: row.label }),
211
+ /* @__PURE__ */ jsx(
212
+ Input,
213
+ {
214
+ id: `${idPrefix}-${row.key}`,
215
+ className: "text-base",
216
+ value: edits[row.key] ?? row.value,
217
+ onChange: (event) => setEdits((current) => ({ ...current, [row.key]: event.target.value }))
218
+ }
219
+ )
220
+ ] }, row.key) : /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
221
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: row.label }),
222
+ /* @__PURE__ */ jsx("span", { className: "text-sm", children: row.value })
223
+ ] }, row.key)
224
+ ),
225
+ /* @__PURE__ */ jsx(
226
+ Button,
178
227
  {
179
- id: `${idPrefix}-${row.key}`,
180
- className: "text-base",
181
- value: edits[row.key] ?? row.value,
182
- onChange: (event) => setEdits((current) => ({ ...current, [row.key]: event.target.value }))
183
- }
184
- )) : /* @__PURE__ */ React.createElement("div", { key: row.key, className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React.createElement("span", { className: "text-xs text-muted-foreground" }, row.label), /* @__PURE__ */ React.createElement("span", { className: "text-sm" }, row.value))
185
- ), /* @__PURE__ */ React.createElement(
186
- Button,
187
- {
188
- variant: "primary",
189
- className: "w-full",
190
- disabled: busy,
191
- onClick: () => {
192
- const corrections = {};
193
- for (const row of render.rows) {
194
- const edited = edits[row.key];
195
- if (edited !== void 0 && edited !== row.value) corrections[row.key] = edited;
196
- }
197
- void onSubmit({ result: { confirmed: true, corrections } });
228
+ variant: "primary",
229
+ className: "w-full",
230
+ disabled: busy,
231
+ onClick: () => {
232
+ const corrections = {};
233
+ for (const row of render.rows) {
234
+ const edited = edits[row.key];
235
+ if (edited !== void 0 && edited !== row.value) corrections[row.key] = edited;
236
+ }
237
+ void onSubmit({ result: { confirmed: true, corrections } });
238
+ },
239
+ children: render.submit_label
198
240
  }
199
- },
200
- render.submit_label
201
- ));
241
+ )
242
+ ] });
202
243
  }
203
244
  function PickTime({ render, busy, onSubmit }) {
204
245
  const format = timeFormat(render.timezone);
205
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-3" }, render.options.map((option) => /* @__PURE__ */ React.createElement(
206
- SurfaceButton,
207
- {
208
- key: option,
209
- variant: "outline",
210
- className: "h-auto w-full justify-start whitespace-normal py-3 text-left",
211
- disabled: busy,
212
- onClick: () => void onSubmit({
213
- result: {
214
- chosen_at: option,
215
- ...render.timezone ? { timezone: render.timezone } : {}
216
- }
217
- })
218
- },
219
- safeFormat(format, option)
220
- )), /* @__PURE__ */ React.createElement("p", { className: "text-xs text-muted-foreground" }, render.timezone ? `Times are ${render.timezone}.` : "Times are in your device's timezone.", render.duration_minutes ? ` ${render.duration_minutes} minutes.` : ""));
246
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
247
+ render.options.map((option) => /* @__PURE__ */ jsx(
248
+ SurfaceButton,
249
+ {
250
+ variant: "outline",
251
+ className: "h-auto w-full justify-start whitespace-normal py-3 text-left",
252
+ disabled: busy,
253
+ onClick: () => void onSubmit({
254
+ result: {
255
+ chosen_at: option,
256
+ ...render.timezone ? { timezone: render.timezone } : {}
257
+ }
258
+ }),
259
+ children: safeFormat(format, option)
260
+ },
261
+ option
262
+ )),
263
+ /* @__PURE__ */ jsxs("p", { className: "text-xs text-muted-foreground", children: [
264
+ render.timezone ? `Times are ${render.timezone}.` : "Times are in your device's timezone.",
265
+ render.duration_minutes ? ` ${render.duration_minutes} minutes.` : ""
266
+ ] })
267
+ ] });
221
268
  }
222
269
  function FieldList({
223
270
  fields,
@@ -226,20 +273,23 @@ function FieldList({
226
273
  idPrefix
227
274
  }) {
228
275
  const firstPlain = fields.find((field) => !field.secret)?.key;
229
- return /* @__PURE__ */ React.createElement(React.Fragment, null, fields.map((field) => /* @__PURE__ */ React.createElement("div", { key: field.key, className: "flex flex-col gap-1.5" }, /* @__PURE__ */ React.createElement("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-${field.key}` }, field.label), /* @__PURE__ */ React.createElement(
230
- Input,
231
- {
232
- id: `${idPrefix}-${field.key}`,
233
- className: "text-base",
234
- type: field.secret ? "password" : "text",
235
- autoComplete: field.secret ? "current-password" : field.key === firstPlain ? "username" : "off",
236
- autoCapitalize: "none",
237
- autoCorrect: "off",
238
- spellCheck: false,
239
- value: values[field.key] ?? "",
240
- onChange: (event) => setValues((current) => ({ ...current, [field.key]: event.target.value }))
241
- }
242
- ))));
276
+ return /* @__PURE__ */ jsx(Fragment, { children: fields.map((field) => /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
277
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-${field.key}`, children: field.label }),
278
+ /* @__PURE__ */ jsx(
279
+ Input,
280
+ {
281
+ id: `${idPrefix}-${field.key}`,
282
+ className: "text-base",
283
+ type: field.secret ? "password" : "text",
284
+ autoComplete: field.secret ? "current-password" : field.key === firstPlain ? "username" : "off",
285
+ autoCapitalize: "none",
286
+ autoCorrect: "off",
287
+ spellCheck: false,
288
+ value: values[field.key] ?? "",
289
+ onChange: (event) => setValues((current) => ({ ...current, [field.key]: event.target.value }))
290
+ }
291
+ )
292
+ ] }, field.key)) });
243
293
  }
244
294
  function Credential({ render, busy, idPrefix, onSubmit }) {
245
295
  const [values, setValues] = useState(
@@ -247,73 +297,88 @@ function Credential({ render, busy, idPrefix, onSubmit }) {
247
297
  );
248
298
  const [authenticator, setAuthenticator] = useState("");
249
299
  const [showAuthenticator, setShowAuthenticator] = useState(false);
250
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.origin), /* @__PURE__ */ React.createElement(
251
- FieldList,
252
- {
253
- fields: render.fields,
254
- values,
255
- setValues,
256
- idPrefix
257
- }
258
- ), render.allow_authenticator_secret ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ React.createElement("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-authenticator` }, "Authenticator setup key (optional)"), /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(
259
- Input,
260
- {
261
- id: `${idPrefix}-authenticator`,
262
- className: "pr-10 text-base",
263
- type: showAuthenticator ? "text" : "password",
264
- autoComplete: "off",
265
- autoCapitalize: "none",
266
- autoCorrect: "off",
267
- spellCheck: false,
268
- value: authenticator,
269
- onChange: (event) => setAuthenticator(event.target.value),
270
- placeholder: "The long code shown beside the QR when you set up two-factor."
271
- }
272
- ), /* @__PURE__ */ React.createElement(Button, { variant: "quiet", icon: showAuthenticator ? /* @__PURE__ */ React.createElement(EyeOff, null) : /* @__PURE__ */ React.createElement(Eye, null), "aria-label": showAuthenticator ? "Hide setup key" : "Show setup key", "aria-pressed": showAuthenticator, onClick: () => setShowAuthenticator((shown) => !shown), className: "absolute inset-y-0 right-0" }))) : null, /* @__PURE__ */ React.createElement(
273
- Button,
274
- {
275
- variant: "primary",
276
- className: "w-full",
277
- disabled: busy,
278
- onClick: () => void onSubmit({
279
- field_values: Object.fromEntries(
280
- render.fields.map((field) => [field.key, values[field.key] ?? ""])
300
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
301
+ /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.origin }),
302
+ /* @__PURE__ */ jsx(
303
+ FieldList,
304
+ {
305
+ fields: render.fields,
306
+ values,
307
+ setValues,
308
+ idPrefix
309
+ }
310
+ ),
311
+ render.allow_authenticator_secret ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
312
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-authenticator`, children: "Authenticator setup key (optional)" }),
313
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
314
+ /* @__PURE__ */ jsx(
315
+ Input,
316
+ {
317
+ id: `${idPrefix}-authenticator`,
318
+ className: "pr-10 text-base",
319
+ type: showAuthenticator ? "text" : "password",
320
+ autoComplete: "off",
321
+ autoCapitalize: "none",
322
+ autoCorrect: "off",
323
+ spellCheck: false,
324
+ value: authenticator,
325
+ onChange: (event) => setAuthenticator(event.target.value),
326
+ placeholder: "The long code shown beside the QR when you set up two-factor."
327
+ }
281
328
  ),
282
- ...authenticator.trim() ? { authenticator_secret: authenticator.trim() } : {},
283
- // THE ECHO. aidream compares this to the origin stored on the row and
284
- // saves nothing if they differ — scheme, host and port, exactly.
285
- origin: render.origin
286
- })
287
- },
288
- render.submit_label
289
- ));
329
+ /* @__PURE__ */ jsx(Button, { variant: "quiet", icon: showAuthenticator ? /* @__PURE__ */ jsx(EyeOff, {}) : /* @__PURE__ */ jsx(Eye, {}), "aria-label": showAuthenticator ? "Hide setup key" : "Show setup key", "aria-pressed": showAuthenticator, onClick: () => setShowAuthenticator((shown) => !shown), className: "absolute inset-y-0 right-0" })
330
+ ] })
331
+ ] }) : null,
332
+ /* @__PURE__ */ jsx(
333
+ Button,
334
+ {
335
+ variant: "primary",
336
+ className: "w-full",
337
+ disabled: busy,
338
+ onClick: () => void onSubmit({
339
+ field_values: Object.fromEntries(
340
+ render.fields.map((field) => [field.key, values[field.key] ?? ""])
341
+ ),
342
+ ...authenticator.trim() ? { authenticator_secret: authenticator.trim() } : {},
343
+ // THE ECHO. aidream compares this to the origin stored on the row and
344
+ // saves nothing if they differ — scheme, host and port, exactly.
345
+ origin: render.origin
346
+ }),
347
+ children: render.submit_label
348
+ }
349
+ )
350
+ ] });
290
351
  }
291
352
  function VaultItem({ render, busy, idPrefix, onSubmit }) {
292
353
  const [values, setValues] = useState(
293
354
  () => prefilledValues(render.fields)
294
355
  );
295
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, render.note ? /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.note) : null, /* @__PURE__ */ React.createElement(
296
- FieldList,
297
- {
298
- fields: render.fields,
299
- values,
300
- setValues,
301
- idPrefix
302
- }
303
- ), /* @__PURE__ */ React.createElement(
304
- Button,
305
- {
306
- variant: "primary",
307
- className: "w-full",
308
- disabled: busy,
309
- onClick: () => void onSubmit({
310
- field_values: Object.fromEntries(
311
- render.fields.map((field) => [field.key, values[field.key] ?? ""])
312
- )
313
- })
314
- },
315
- render.submit_label
316
- ));
356
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
357
+ render.note ? /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.note }) : null,
358
+ /* @__PURE__ */ jsx(
359
+ FieldList,
360
+ {
361
+ fields: render.fields,
362
+ values,
363
+ setValues,
364
+ idPrefix
365
+ }
366
+ ),
367
+ /* @__PURE__ */ jsx(
368
+ Button,
369
+ {
370
+ variant: "primary",
371
+ className: "w-full",
372
+ disabled: busy,
373
+ onClick: () => void onSubmit({
374
+ field_values: Object.fromEntries(
375
+ render.fields.map((field) => [field.key, values[field.key] ?? ""])
376
+ )
377
+ }),
378
+ children: render.submit_label
379
+ }
380
+ )
381
+ ] });
317
382
  }
318
383
  function OneTimeCode({ render, busy, idPrefix, autoFocus, onSubmit }) {
319
384
  const [code, setCode] = useState("");
@@ -324,27 +389,34 @@ function OneTimeCode({ render, busy, idPrefix, autoFocus, onSubmit }) {
324
389
  setCode("");
325
390
  void onSubmit({ field_values: { code: cleaned }, origin: render.origin });
326
391
  };
327
- return /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.origin), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ React.createElement("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-one-time-code` }, "Verification code"), /* @__PURE__ */ React.createElement(
328
- Input,
329
- {
330
- id: `${idPrefix}-one-time-code`,
331
- className: "text-center font-mono text-2xl tracking-[0.3em]",
332
- type: "text",
333
- inputMode: "numeric",
334
- autoComplete: "one-time-code",
335
- autoFocus,
336
- autoCapitalize: "none",
337
- autoCorrect: "off",
338
- spellCheck: false,
339
- maxLength: 12,
340
- placeholder: "000000",
341
- value: code,
342
- onChange: (event) => setCode(event.target.value),
343
- onKeyDown: (event) => {
344
- if (event.key === "Enter") send();
345
- }
346
- }
347
- )), /* @__PURE__ */ React.createElement(Button, { variant: "primary", className: "w-full", disabled: !ready, onClick: send }, render.submit_label));
392
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
393
+ /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.origin }),
394
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
395
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-one-time-code`, children: "Verification code" }),
396
+ /* @__PURE__ */ jsx(
397
+ Input,
398
+ {
399
+ id: `${idPrefix}-one-time-code`,
400
+ className: "text-center font-mono text-2xl tracking-[0.3em]",
401
+ type: "text",
402
+ inputMode: "numeric",
403
+ autoComplete: "one-time-code",
404
+ autoFocus,
405
+ autoCapitalize: "none",
406
+ autoCorrect: "off",
407
+ spellCheck: false,
408
+ maxLength: 12,
409
+ placeholder: "000000",
410
+ value: code,
411
+ onChange: (event) => setCode(event.target.value),
412
+ onKeyDown: (event) => {
413
+ if (event.key === "Enter") send();
414
+ }
415
+ }
416
+ )
417
+ ] }),
418
+ /* @__PURE__ */ jsx(Button, { variant: "primary", className: "w-full", disabled: !ready, onClick: send, children: render.submit_label })
419
+ ] });
348
420
  }
349
421
  function ApproveSpend({
350
422
  render,
@@ -387,38 +459,70 @@ function ApproveSpend({
387
459
  };
388
460
  const title = amount !== null && amount > 0 ? `Approve up to ${money(amount)}?` : `Approve up to ${money(render.amount_usd)}?`;
389
461
  return frame(
390
- /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-4" }, render.consequence_note ? /* @__PURE__ */ React.createElement("p", { className: "rounded-md border border-border bg-card p-3 text-sm" }, render.consequence_note) : null, /* @__PURE__ */ React.createElement("dl", { className: "flex flex-col gap-3 rounded-md border border-border bg-card p-3 text-sm" }, render.what_it_buys ? /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-0.5" }, /* @__PURE__ */ React.createElement("dt", { className: "text-xs text-muted-foreground" }, "What it buys"), /* @__PURE__ */ React.createElement("dd", null, render.what_it_buys)) : null, /* @__PURE__ */ React.createElement("div", { className: "flex items-baseline justify-between gap-3" }, /* @__PURE__ */ React.createElement("dt", { className: "text-xs text-muted-foreground" }, "Estimated cost"), /* @__PURE__ */ React.createElement("dd", { className: "font-medium tabular-nums" }, money(render.estimate_usd))), cap !== null ? /* @__PURE__ */ React.createElement("div", { className: "flex items-baseline justify-between gap-3" }, /* @__PURE__ */ React.createElement("dt", { className: "text-xs text-muted-foreground" }, "Your organization's remaining limit"), /* @__PURE__ */ React.createElement("dd", { className: "font-medium tabular-nums" }, money(cap))) : null), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-1.5" }, /* @__PURE__ */ React.createElement("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-amount` }, "Amount you approve"), /* @__PURE__ */ React.createElement("div", { className: "relative" }, unit === "usd" ? /* @__PURE__ */ React.createElement("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex w-8 items-center justify-center text-muted-foreground" }, "$") : /* @__PURE__ */ React.createElement("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-muted-foreground" }, "points"), /* @__PURE__ */ React.createElement(
391
- Input,
392
- {
393
- ref: input,
394
- id: `${idPrefix}-amount`,
395
- className: cn("text-base tabular-nums", unit === "usd" ? "pl-8" : "pr-16"),
396
- type: "text",
397
- inputMode: "decimal",
398
- autoComplete: "off",
399
- autoFocus,
400
- readOnly: !render.amount_editable,
401
- "aria-invalid": problem ? true : void 0,
402
- "aria-describedby": `${idPrefix}-amount-help`,
403
- value: text,
404
- onChange: (event) => {
405
- setText(event.target.value);
406
- setProblem(null);
407
- },
408
- onKeyDown: (event) => {
409
- if (event.key === "Enter" && !busy) approve();
410
- }
411
- }
412
- )), /* @__PURE__ */ React.createElement("div", { id: `${idPrefix}-amount-help`, className: "flex flex-col gap-1" }, problem ? /* @__PURE__ */ React.createElement("p", { className: "text-sm text-destructive" }, problem) : null, advisories.map((line) => /* @__PURE__ */ React.createElement("p", { key: line, className: "text-sm text-muted-foreground" }, line)), !problem && advisories.length === 0 ? /* @__PURE__ */ React.createElement("p", { className: "text-xs text-muted-foreground" }, "Your agent can spend up to this amount on this job, and no more.") : null)), /* @__PURE__ */ React.createElement("div", { className: "flex flex-col gap-3" }, /* @__PURE__ */ React.createElement(Button, { variant: "primary", className: "w-full", disabled: busy, onClick: approve }, yes?.label ?? "Approve this amount"), /* @__PURE__ */ React.createElement(
413
- Button,
414
- {
415
- variant: "quiet",
416
- className: "w-full",
417
- disabled: busy,
418
- onClick: () => void onSubmit({ result: { approved: false } })
419
- },
420
- no?.label ?? "Don't spend"
421
- ))),
462
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-4", children: [
463
+ render.consequence_note ? /* @__PURE__ */ jsx("p", { className: "rounded-md border border-border bg-card p-3 text-sm", children: render.consequence_note }) : null,
464
+ /* @__PURE__ */ jsxs("dl", { className: "flex flex-col gap-3 rounded-md border border-border bg-card p-3 text-sm", children: [
465
+ render.what_it_buys ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-0.5", children: [
466
+ /* @__PURE__ */ jsx("dt", { className: "text-xs text-muted-foreground", children: "What it buys" }),
467
+ /* @__PURE__ */ jsx("dd", { children: render.what_it_buys })
468
+ ] }) : null,
469
+ /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
470
+ /* @__PURE__ */ jsx("dt", { className: "text-xs text-muted-foreground", children: "Estimated cost" }),
471
+ /* @__PURE__ */ jsx("dd", { className: "font-medium tabular-nums", children: money(render.estimate_usd) })
472
+ ] }),
473
+ cap !== null ? /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [
474
+ /* @__PURE__ */ jsx("dt", { className: "text-xs text-muted-foreground", children: "Your organization's remaining limit" }),
475
+ /* @__PURE__ */ jsx("dd", { className: "font-medium tabular-nums", children: money(cap) })
476
+ ] }) : null
477
+ ] }),
478
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-1.5", children: [
479
+ /* @__PURE__ */ jsx("label", { className: "text-sm font-medium", htmlFor: `${idPrefix}-amount`, children: "Amount you approve" }),
480
+ /* @__PURE__ */ jsxs("div", { className: "relative", children: [
481
+ unit === "usd" ? /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute inset-y-0 left-0 flex w-8 items-center justify-center text-muted-foreground", children: "$" }) : /* @__PURE__ */ jsx("span", { className: "pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3 text-sm text-muted-foreground", children: "points" }),
482
+ /* @__PURE__ */ jsx(
483
+ Input,
484
+ {
485
+ ref: input,
486
+ id: `${idPrefix}-amount`,
487
+ className: cn("text-base tabular-nums", unit === "usd" ? "pl-8" : "pr-16"),
488
+ type: "text",
489
+ inputMode: "decimal",
490
+ autoComplete: "off",
491
+ autoFocus,
492
+ readOnly: !render.amount_editable,
493
+ "aria-invalid": problem ? true : void 0,
494
+ "aria-describedby": `${idPrefix}-amount-help`,
495
+ value: text,
496
+ onChange: (event) => {
497
+ setText(event.target.value);
498
+ setProblem(null);
499
+ },
500
+ onKeyDown: (event) => {
501
+ if (event.key === "Enter" && !busy) approve();
502
+ }
503
+ }
504
+ )
505
+ ] }),
506
+ /* @__PURE__ */ jsxs("div", { id: `${idPrefix}-amount-help`, className: "flex flex-col gap-1", children: [
507
+ problem ? /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: problem }) : null,
508
+ advisories.map((line) => /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: line }, line)),
509
+ !problem && advisories.length === 0 ? /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: "Your agent can spend up to this amount on this job, and no more." }) : null
510
+ ] })
511
+ ] }),
512
+ /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-3", children: [
513
+ /* @__PURE__ */ jsx(Button, { variant: "primary", className: "w-full", disabled: busy, onClick: approve, children: yes?.label ?? "Approve this amount" }),
514
+ /* @__PURE__ */ jsx(
515
+ Button,
516
+ {
517
+ variant: "quiet",
518
+ className: "w-full",
519
+ disabled: busy,
520
+ onClick: () => void onSubmit({ result: { approved: false } }),
521
+ children: no?.label ?? "Don't spend"
522
+ }
523
+ )
524
+ ] })
525
+ ] }),
422
526
  title
423
527
  );
424
528
  }