@mgamadeus/ddd-agents 0.0.0-stage → 0.1.0-alpha.21

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 (315) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +14 -2
  3. package/dist/chat.js +5263 -0
  4. package/dist/chat.js.map +1 -0
  5. package/dist/chunks/AgentsConversationClientContext-C4T7g_Qk.js +22 -0
  6. package/dist/chunks/AgentsConversationClientContext-C4T7g_Qk.js.map +1 -0
  7. package/dist/chunks/ConversationMarkdown-W7NHglmL.js +399 -0
  8. package/dist/chunks/ConversationMarkdown-W7NHglmL.js.map +1 -0
  9. package/dist/chunks/WebSearchResultsConversationWidget-BvnLWHyi.js +5059 -0
  10. package/dist/chunks/WebSearchResultsConversationWidget-BvnLWHyi.js.map +1 -0
  11. package/dist/chunks/canvas-behaviours-BRFR1ALE.js +45 -0
  12. package/dist/chunks/canvas-behaviours-BRFR1ALE.js.map +1 -0
  13. package/dist/chunks/canvas-feature-flags-BmmxC3bz.js +11 -0
  14. package/dist/chunks/canvas-feature-flags-BmmxC3bz.js.map +1 -0
  15. package/dist/chunks/canvasBodies-9SuF6NAB.js +289 -0
  16. package/dist/chunks/canvasBodies-9SuF6NAB.js.map +1 -0
  17. package/dist/chunks/d3-7.6.1.min.js-DTmPafrl.js +6 -0
  18. package/dist/chunks/d3-7.6.1.min.js-DTmPafrl.js.map +1 -0
  19. package/dist/chunks/decide-canvas-open-Ct-wnNEJ.js +20 -0
  20. package/dist/chunks/decide-canvas-open-Ct-wnNEJ.js.map +1 -0
  21. package/dist/chunks/widget-image-readiness-signal-DeOuL89j.js +25 -0
  22. package/dist/chunks/widget-image-readiness-signal-DeOuL89j.js.map +1 -0
  23. package/dist/chunks/widget-name-resolver-DyIY6Zu4.js +9736 -0
  24. package/dist/chunks/widget-name-resolver-DyIY6Zu4.js.map +1 -0
  25. package/dist/chunks/withPollingChangeSubscription-BLDAWF-o.js +251 -0
  26. package/dist/chunks/withPollingChangeSubscription-BLDAWF-o.js.map +1 -0
  27. package/dist/client-testing.js +346 -0
  28. package/dist/client-testing.js.map +1 -0
  29. package/dist/client.js +16 -0
  30. package/dist/client.js.map +1 -0
  31. package/dist/contract.js +31 -0
  32. package/dist/contract.js.map +1 -0
  33. package/dist/image-render.js +334 -0
  34. package/dist/image-render.js.map +1 -0
  35. package/dist/index.js +80 -0
  36. package/dist/index.js.map +1 -0
  37. package/dist/kit.js +13 -0
  38. package/dist/kit.js.map +1 -0
  39. package/dist/preview.js +733 -0
  40. package/dist/preview.js.map +1 -0
  41. package/dist/renderer.js +115 -0
  42. package/dist/renderer.js.map +1 -0
  43. package/dist/styles.css +6768 -0
  44. package/dist/types/chat/AgentChat/AgentChat.d.ts +37 -0
  45. package/dist/types/chat/AgentChatActivityHistory/AgentChatActivityHistory.d.ts +6 -0
  46. package/dist/types/chat/AgentChatActivityIndicator/AgentChatActivityIndicator.d.ts +8 -0
  47. package/dist/types/chat/CanvasPane/CanvasPane.d.ts +15 -0
  48. package/dist/types/chat/CanvasResizeHandle/CanvasResizeHandle.d.ts +10 -0
  49. package/dist/types/chat/CanvasResizeHandle/use-canvas-resize.d.ts +43 -0
  50. package/dist/types/chat/ConversationClosedBar/ConversationClosedBar.d.ts +10 -0
  51. package/dist/types/chat/ConversationErrorCard/ConversationErrorCard.d.ts +13 -0
  52. package/dist/types/chat/ConversationIntroCard/ConversationIntroCard.d.ts +10 -0
  53. package/dist/types/chat/ConversationLoadingStates.d.ts +2 -0
  54. package/dist/types/chat/ConversationMessage/ConversationCallMarkerChip/ConversationCallMarkerChip.d.ts +14 -0
  55. package/dist/types/chat/ConversationMessage/ConversationCallMarkerChip/VoiceBarsIcon/VoiceBarsIcon.d.ts +8 -0
  56. package/dist/types/chat/ConversationMessage/ConversationMessageSystem/ConversationMessageSystem.d.ts +8 -0
  57. package/dist/types/chat/ConversationMessage/ConversationMessageSystem/ConversationMessageSystemHeader/ConversationMessageSystemHeader.d.ts +9 -0
  58. package/dist/types/chat/ConversationMessage/ConversationMessageUser/ConversationMessageUser.d.ts +7 -0
  59. package/dist/types/chat/ConversationMessage/ConversationMessageUser/ConversationMessageUserWidgets.d.ts +14 -0
  60. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageHeader/ConversationMessageHeader.d.ts +7 -0
  61. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageThinking/ConversationMessageThinking.d.ts +7 -0
  62. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/ConversationMessageWidgets.d.ts +29 -0
  63. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/copyRichToClipboard.d.ts +1 -0
  64. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/hooks/useFreshMessageBlockReveal.d.ts +14 -0
  65. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/hooks/useStreamingText.d.ts +8 -0
  66. package/dist/types/chat/ConversationMessage/ConversationMessageWidgets/hooks/useTypewriter.d.ts +12 -0
  67. package/dist/types/chat/ConversationMessage/ConversationTaskInstructionDisclosure/ConversationTaskInstructionDisclosure.d.ts +12 -0
  68. package/dist/types/chat/ConversationMessageInput/ConversationMessageInput.d.ts +111 -0
  69. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentPreviewCard.d.ts +34 -0
  70. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentsErrorBox.d.ts +22 -0
  71. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/ConversationMessageInputAttachmentsPreviewStrip.d.ts +12 -0
  72. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputAttachments/convert-bytes-to-size-string.d.ts +2 -0
  73. package/dist/types/chat/ConversationMessageInput/ConversationMessageInputComposerWidgets/ConversationMessageInputComposerWidgets.d.ts +12 -0
  74. package/dist/types/chat/ConversationMessageList/ConversationMessageList.d.ts +75 -0
  75. package/dist/types/chat/ConversationScrollToLatestMessageButton/ConversationScrollToLatestMessageButton.d.ts +6 -0
  76. package/dist/types/chat/ConversationSuggestionCard/ConversationSuggestionCard.d.ts +7 -0
  77. package/dist/types/chat/ConversationView.d.ts +216 -0
  78. package/dist/types/chat/ConversationViewBody/ConversationViewBody.d.ts +214 -0
  79. package/dist/types/chat/ConversationViewBody/hooks/useIsMessagesBottomOutOfView.d.ts +2 -0
  80. package/dist/types/chat/ConversationViewBody/hooks/usePinQuestionOnSend.d.ts +24 -0
  81. package/dist/types/chat/assistant-message-has-renderable-markdown.d.ts +13 -0
  82. package/dist/types/chat/chat-assistant-identity.d.ts +24 -0
  83. package/dist/types/chat/chat-message.d.ts +11 -0
  84. package/dist/types/chat/controller/AgentChatController.d.ts +97 -0
  85. package/dist/types/chat/controller/activity-ticker.d.ts +120 -0
  86. package/dist/types/chat/controller/changed-messages-request.d.ts +12 -0
  87. package/dist/types/chat/controller/chat-scroll-target.d.ts +10 -0
  88. package/dist/types/chat/controller/conversation-change-signal-rules.d.ts +64 -0
  89. package/dist/types/chat/controller/derive-agent-activity.d.ts +31 -0
  90. package/dist/types/chat/controller/merge-activity-elements.d.ts +25 -0
  91. package/dist/types/chat/controller/pending-start-request.d.ts +38 -0
  92. package/dist/types/chat/controller/use-activity-ticker.d.ts +60 -0
  93. package/dist/types/chat/controller/use-conversation-activity.d.ts +38 -0
  94. package/dist/types/chat/controller/use-conversation-live-updates.d.ts +30 -0
  95. package/dist/types/chat/controller/use-conversation-message-pages.d.ts +24 -0
  96. package/dist/types/chat/controller/use-conversation-scroll-jump.d.ts +47 -0
  97. package/dist/types/chat/controller/use-conversation-search.d.ts +31 -0
  98. package/dist/types/chat/controller/use-conversation-signals.d.ts +44 -0
  99. package/dist/types/chat/controller/use-debounced-semantic-search.d.ts +15 -0
  100. package/dist/types/chat/conversation-send-message.d.ts +43 -0
  101. package/dist/types/chat/last-wire-message-is-unanswered-user-message.d.ts +22 -0
  102. package/dist/types/chat/normalize-server-message-to-markdown.d.ts +23 -0
  103. package/dist/types/chat/store/agents-chat-state.d.ts +132 -0
  104. package/dist/types/chat/store/conversation-error-type.d.ts +32 -0
  105. package/dist/types/chat/store/create-agents-chat-store.d.ts +23 -0
  106. package/dist/types/chat/store/index.d.ts +5 -0
  107. package/dist/types/chat/store/merge-chat-messages.d.ts +20 -0
  108. package/dist/types/chat/store/reduce-agents-chat-state.d.ts +7 -0
  109. package/dist/types/chat/store/use-agents-chat-store.d.ts +22 -0
  110. package/dist/types/chat/strip-pre-call-message-marker.d.ts +12 -0
  111. package/dist/types/chat/use-canvas-shell-transitions.d.ts +25 -0
  112. package/dist/types/client/AgentsConversationClient.d.ts +93 -0
  113. package/dist/types/client/AgentsConversationClientContext.d.ts +17 -0
  114. package/dist/types/client/polling/createPollingConversationChangeSubscription.d.ts +62 -0
  115. package/dist/types/client/polling/withPollingChangeSubscription.d.ts +11 -0
  116. package/dist/types/client/testing/createInMemoryAgentsConversationClient.d.ts +139 -0
  117. package/dist/types/contract/conversation.d.ts +370 -0
  118. package/dist/types/entries/chat.d.ts +21 -0
  119. package/dist/types/entries/client-testing.d.ts +1 -0
  120. package/dist/types/entries/client.d.ts +4 -0
  121. package/dist/types/entries/contract.d.ts +1 -0
  122. package/dist/types/entries/image-render.d.ts +9 -0
  123. package/dist/types/entries/index.d.ts +9 -0
  124. package/dist/types/entries/kit.d.ts +4 -0
  125. package/dist/types/entries/preview.d.ts +8 -0
  126. package/dist/types/entries/renderer.d.ts +15 -0
  127. package/dist/types/entries/widgets.d.ts +16 -0
  128. package/dist/types/image-render/ComposedViewEmailDataTimes/ComposedViewEmailDataTimes.d.ts +15 -0
  129. package/dist/types/image-render/WidgetImageRender.d.ts +55 -0
  130. package/dist/types/image-render/WidgetImageRenderContext.d.ts +14 -0
  131. package/dist/types/image-render/composed-view-data-times.d.ts +20 -0
  132. package/dist/types/image-render/frozen-widget-requests.d.ts +2 -0
  133. package/dist/types/image-render/live-widget-requests.d.ts +4 -0
  134. package/dist/types/image-render/widget-image-google-map.d.ts +7 -0
  135. package/dist/types/image-render/widget-image-readiness-signal.d.ts +16 -0
  136. package/dist/types/image-render/widget-image-readiness.d.ts +9 -0
  137. package/dist/types/image-render/widget-image-render.types.d.ts +47 -0
  138. package/dist/types/kit/ComposedViewConversationWidget.d.ts +14 -0
  139. package/dist/types/kit/ComposedViewDataSourceLoader.d.ts +20 -0
  140. package/dist/types/kit/ComposedViewRenderer.d.ts +30 -0
  141. package/dist/types/kit/ComposedViewSlotErrorBoundary.d.ts +23 -0
  142. package/dist/types/kit/ModelText/ModelText.d.ts +12 -0
  143. package/dist/types/kit/components/embedding/EmbeddedConversationWidget.d.ts +26 -0
  144. package/dist/types/kit/components/map/map-full-screen-instance.d.ts +26 -0
  145. package/dist/types/kit/components/map/map-presentation-context.d.ts +8 -0
  146. package/dist/types/kit/components/text/shared/text-node-values.d.ts +39 -0
  147. package/dist/types/kit/composed-view-component-types.d.ts +61 -0
  148. package/dist/types/kit/composed-view-components.d.ts +7 -0
  149. package/dist/types/kit/composed-view-tones.d.ts +20 -0
  150. package/dist/types/kit/entity-detail/EntityDetailCanvasBody.d.ts +9 -0
  151. package/dist/types/kit/entity-detail/entity-detail-bodies.d.ts +32 -0
  152. package/dist/types/kit/entity-detail/entity-detail-name.d.ts +9 -0
  153. package/dist/types/kit/hooks/use-debounced-value.d.ts +2 -0
  154. package/dist/types/kit/map-full-screen/MapFullScreenCanvasBody.d.ts +11 -0
  155. package/dist/types/preview/WidgetPreviewHost.d.ts +20 -0
  156. package/dist/types/preview/preview-stub-components.d.ts +3 -0
  157. package/dist/types/preview/widget-preview-fixtures.d.ts +17 -0
  158. package/dist/types/preview/widget-preview-hydration.d.ts +10 -0
  159. package/dist/types/preview/widget-preview-readiness.d.ts +27 -0
  160. package/dist/types/preview/widget-preview-requests.d.ts +16 -0
  161. package/dist/types/preview/widget-preview-signal.d.ts +10 -0
  162. package/dist/types/preview/widget-preview.types.d.ts +134 -0
  163. package/dist/types/provider/AgentsProvider.d.ts +33 -0
  164. package/dist/types/provider/class-names.d.ts +7 -0
  165. package/dist/types/provider/components/default-components.d.ts +3 -0
  166. package/dist/types/provider/components/icon-names.d.ts +9 -0
  167. package/dist/types/provider/components/index.d.ts +39 -0
  168. package/dist/types/provider/components/types.d.ts +463 -0
  169. package/dist/types/provider/environment.d.ts +262 -0
  170. package/dist/types/provider/index.d.ts +4 -0
  171. package/dist/types/renderer/ConversationDeepLinkedWidget.d.ts +18 -0
  172. package/dist/types/renderer/ConversationMarkdown.d.ts +21 -0
  173. package/dist/types/renderer/ConversationWidgetActions/ConversationWidgetActions.d.ts +7 -0
  174. package/dist/types/renderer/ConversationWidgetCallbacksContext.d.ts +234 -0
  175. package/dist/types/renderer/ConversationWidgetContext.d.ts +32 -0
  176. package/dist/types/renderer/ConversationWidgetErrorBoundary.d.ts +25 -0
  177. package/dist/types/renderer/ConversationWidgetHost.d.ts +36 -0
  178. package/dist/types/renderer/ConversationWidgetRenderContext.d.ts +3 -0
  179. package/dist/types/renderer/MarkdownLink.d.ts +6 -0
  180. package/dist/types/renderer/WindowedWidget/WindowedWidget.d.ts +16 -0
  181. package/dist/types/renderer/_access/ConversationWidgetFeatureGate.d.ts +21 -0
  182. package/dist/types/renderer/_agent-space/ConversationWidgetAgentSpaceFrame.d.ts +12 -0
  183. package/dist/types/renderer/_agent-space/ConversationWidgetAgentSpaceHeader.d.ts +15 -0
  184. package/dist/types/renderer/_agent-space/agent-space-name.hydrator.d.ts +7 -0
  185. package/dist/types/renderer/_agent-space/declared-agent-space-key-field-name.d.ts +8 -0
  186. package/dist/types/renderer/_agent-space/use-resolved-conversation-widget-agent-space-key.d.ts +16 -0
  187. package/dist/types/renderer/_agent-space/widget-agent-space-key-attribute.d.ts +13 -0
  188. package/dist/types/renderer/balanced-json-object.d.ts +12 -0
  189. package/dist/types/renderer/canvas/CanvasRestoreOnMount.d.ts +19 -0
  190. package/dist/types/renderer/canvas/canvas-behaviours.d.ts +84 -0
  191. package/dist/types/renderer/canvas/canvas-body-props.d.ts +18 -0
  192. package/dist/types/renderer/canvas/canvas-feature-flags.d.ts +11 -0
  193. package/dist/types/renderer/canvas/canvas-reducers.d.ts +46 -0
  194. package/dist/types/renderer/canvas/canvas-state.d.ts +107 -0
  195. package/dist/types/renderer/canvas/canvasBodies.d.ts +19 -0
  196. package/dist/types/renderer/canvas/canvasStorage.d.ts +25 -0
  197. package/dist/types/renderer/canvas/decide-canvas-open.d.ts +32 -0
  198. package/dist/types/renderer/canvas/entity-detail-instance.d.ts +27 -0
  199. package/dist/types/renderer/canvas/find-widget-fences-in-markdown.d.ts +32 -0
  200. package/dist/types/renderer/canvas/use-anchor-widget-payload.d.ts +8 -0
  201. package/dist/types/renderer/composer-widget-fence.d.ts +30 -0
  202. package/dist/types/renderer/conversation-composer-widget.d.ts +13 -0
  203. package/dist/types/renderer/conversation-widget-props.d.ts +54 -0
  204. package/dist/types/renderer/conversation-widget-state-partition.d.ts +31 -0
  205. package/dist/types/renderer/conversationWidgetAstPlugin.d.ts +11 -0
  206. package/dist/types/renderer/conversationWidgetRegistry.d.ts +74 -0
  207. package/dist/types/renderer/detect-unrendered-widgets.d.ts +42 -0
  208. package/dist/types/renderer/markdown-contains-widget.d.ts +13 -0
  209. package/dist/types/renderer/reference-naked-widget-json.d.ts +1 -0
  210. package/dist/types/renderer/remarkWidgetFencePlugin.d.ts +22 -0
  211. package/dist/types/renderer/render-report/widget-render-report-collector.d.ts +57 -0
  212. package/dist/types/renderer/render-report/widget-render-report.d.ts +29 -0
  213. package/dist/types/renderer/repair-malformed-widget-fences.d.ts +11 -0
  214. package/dist/types/renderer/resolve-deep-linkable-widget.d.ts +25 -0
  215. package/dist/types/renderer/restoreTextDirectivesPlugin.d.ts +12 -0
  216. package/dist/types/renderer/widget-click-signal-sources.d.ts +15 -0
  217. package/dist/types/renderer/widget-fence-json.d.ts +16 -0
  218. package/dist/types/renderer/widget-fence-syntax.d.ts +25 -0
  219. package/dist/types/renderer/widget-hydration/index.d.ts +8 -0
  220. package/dist/types/renderer/widget-hydration/section-hydration.d.ts +41 -0
  221. package/dist/types/renderer/widget-hydration/use-widget-hydration.d.ts +27 -0
  222. package/dist/types/renderer/widget-hydration/widget-hydration-state-store.d.ts +27 -0
  223. package/dist/types/renderer/widget-hydration/widget-hydration.reducer.d.ts +39 -0
  224. package/dist/types/renderer/widget-hydration/widget-hydration.registry.d.ts +7 -0
  225. package/dist/types/renderer/widget-hydration/widget-hydration.slice.d.ts +8 -0
  226. package/dist/types/renderer/widget-hydration/widget-hydration.types.d.ts +27 -0
  227. package/dist/types/renderer/widget-name-resolver.d.ts +22 -0
  228. package/dist/types/renderer/widget-tree/bounded-json.d.ts +23 -0
  229. package/dist/types/renderer/widget-tree/composed-node-schema.d.ts +143 -0
  230. package/dist/types/renderer/widget-tree/composed-view-data-sources.d.ts +41 -0
  231. package/dist/types/renderer/widget-tree/composed-view-tree.d.ts +111 -0
  232. package/dist/types/renderer/widget-tree/expression/evaluate-expression.d.ts +65 -0
  233. package/dist/types/renderer/widget-tree/expression/parse-expression.d.ts +71 -0
  234. package/dist/types/renderer/widget-tree/resolve-composed-view-values.d.ts +49 -0
  235. package/dist/types/renderer/widget-tree/use-composed-view-state.d.ts +16 -0
  236. package/dist/types/renderer/widget-windowing.d.ts +25 -0
  237. package/dist/types/widgets/CanvasWidgetCard/CanvasWidgetCard.d.ts +79 -0
  238. package/dist/types/widgets/CanvasWidgetCard/CanvasWidgetSwitch.d.ts +61 -0
  239. package/dist/types/widgets/CanvasWidgetCard/canvas-for-message-widget.d.ts +8 -0
  240. package/dist/types/widgets/CanvasWidgetCard/use-canvas-viable.d.ts +15 -0
  241. package/dist/types/widgets/ClockConversationWidget/ClockConversationWidget.d.ts +11 -0
  242. package/dist/types/widgets/ClockConversationWidget/ClockWidget/AnalogClockFace.d.ts +12 -0
  243. package/dist/types/widgets/ClockConversationWidget/ClockWidget/ClockRow.d.ts +23 -0
  244. package/dist/types/widgets/ClockConversationWidget/ClockWidget/ClockWidget.d.ts +21 -0
  245. package/dist/types/widgets/ClockConversationWidget/ClockWidget/DayNightGlyph.d.ts +8 -0
  246. package/dist/types/widgets/ClockConversationWidget/shared/clock-time.d.ts +52 -0
  247. package/dist/types/widgets/ClockConversationWidget/shared/clock-widget-payload.d.ts +23 -0
  248. package/dist/types/widgets/ClockConversationWidget/shared/use-clock-settings.d.ts +18 -0
  249. package/dist/types/widgets/ConceptExplainerConversationWidget/ConceptExplainerConversationWidget.d.ts +14 -0
  250. package/dist/types/widgets/ConceptExplainerConversationWidget/ConceptExplainerWidget/ConceptExplainerWidget.d.ts +27 -0
  251. package/dist/types/widgets/ConceptExplainerConversationWidget/shared/ConceptExplainerTextView.d.ts +11 -0
  252. package/dist/types/widgets/ConceptExplainerConversationWidget/shared/concept-explainer-type.d.ts +89 -0
  253. package/dist/types/widgets/ConceptExplainerConversationWidget/shared/concept-explainer-types.d.ts +17 -0
  254. package/dist/types/widgets/ConceptExplainerConversationWidget/shared/concept-explainer-widget-payload.d.ts +25 -0
  255. package/dist/types/widgets/ConceptExplainerConversationWidget/shared/use-concept-explainer-language.d.ts +8 -0
  256. package/dist/types/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvas.d.ts +9 -0
  257. package/dist/types/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsCanvasBody.d.ts +7 -0
  258. package/dist/types/widgets/ConversationSearchResultsConversationWidget/ConversationSearchResultsConversationWidget.d.ts +15 -0
  259. package/dist/types/widgets/ConversationSearchResultsConversationWidget/shared/conversation-search-results-widget-payload.d.ts +42 -0
  260. package/dist/types/widgets/ConversationSearchResultsConversationWidget/shared/search-hit-excerpt.d.ts +1 -0
  261. package/dist/types/widgets/CurrencyConverterConversationWidget/CurrencyConverterConversationWidget.d.ts +8 -0
  262. package/dist/types/widgets/CurrencyConverterConversationWidget/CurrencyConverterWidget/CurrencyConverterWidget.d.ts +17 -0
  263. package/dist/types/widgets/CurrencyConverterConversationWidget/CurrencyConverterWidget/CurrencyLabel/CurrencyLabel.d.ts +9 -0
  264. package/dist/types/widgets/CurrencyConverterConversationWidget/shared/currency-converter-widget-payload.d.ts +22 -0
  265. package/dist/types/widgets/CurrencyConverterConversationWidget/shared/currency-display.d.ts +30 -0
  266. package/dist/types/widgets/CustomVisualizationConversationWidget/CustomVisualizationConversationWidget.d.ts +11 -0
  267. package/dist/types/widgets/CustomVisualizationConversationWidget/CustomVisualizationWidget/CustomVisualizationFrame.d.ts +14 -0
  268. package/dist/types/widgets/CustomVisualizationConversationWidget/CustomVisualizationWidget/CustomVisualizationWidget.d.ts +15 -0
  269. package/dist/types/widgets/CustomVisualizationConversationWidget/shared/custom-visualization-frame-protocol.d.ts +77 -0
  270. package/dist/types/widgets/CustomVisualizationConversationWidget/shared/custom-visualization-libraries.d.ts +25 -0
  271. package/dist/types/widgets/CustomVisualizationConversationWidget/shared/custom-visualization-sandbox-config.d.ts +21 -0
  272. package/dist/types/widgets/CustomVisualizationConversationWidget/shared/custom-visualization-widget-payload.d.ts +55 -0
  273. package/dist/types/widgets/CustomVisualizationConversationWidget/shared/read-custom-visualization-theme.d.ts +5 -0
  274. package/dist/types/widgets/EntityMentionConversationWidget/EntityMentionAskButton/EntityMentionAskButton.d.ts +13 -0
  275. package/dist/types/widgets/EntityMentionConversationWidget/EntityMentionCard/EntityMentionCard.d.ts +11 -0
  276. package/dist/types/widgets/EntityMentionConversationWidget/EntityMentionConversationWidget.d.ts +9 -0
  277. package/dist/types/widgets/EntityMentionConversationWidget/shared/entity-mention-presentation.d.ts +4 -0
  278. package/dist/types/widgets/EntityMentionConversationWidget/shared/entity-mention.d.ts +33 -0
  279. package/dist/types/widgets/EntityMentionConversationWidget/shared/use-entity-mention-composer.d.ts +17 -0
  280. package/dist/types/widgets/MultiChoiceConversationWidget/MultiChoiceConversationWidget.d.ts +2 -0
  281. package/dist/types/widgets/MultiChoiceConversationWidget/shared/multi-choice-widget-payload.d.ts +16 -0
  282. package/dist/types/widgets/QuickRepliesConversationWidget/QuickRepliesConversationWidget.d.ts +38 -0
  283. package/dist/types/widgets/QuickRepliesConversationWidget/shared/quick-replies-widget-payload.d.ts +20 -0
  284. package/dist/types/widgets/SuggestedActions/SuggestedActions.d.ts +10 -0
  285. package/dist/types/widgets/ToolTraceConversationWidget/ToolTraceConversationWidget.d.ts +8 -0
  286. package/dist/types/widgets/WebSearchResultsConversationWidget/SourceFavicon.d.ts +10 -0
  287. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchAnswer.d.ts +6 -0
  288. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchReferences.d.ts +12 -0
  289. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvas.d.ts +10 -0
  290. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchResultsCanvasBody.d.ts +7 -0
  291. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchResultsConversationWidget.d.ts +14 -0
  292. package/dist/types/widgets/WebSearchResultsConversationWidget/WebSearchSourcesList.d.ts +10 -0
  293. package/dist/types/widgets/WebSearchResultsConversationWidget/shared/display-hostname.d.ts +9 -0
  294. package/dist/types/widgets/WebSearchResultsConversationWidget/shared/web-search-results-widget-payload.d.ts +30 -0
  295. package/dist/types/widgets/WritingDraftConversationWidget/WritingDraftConversationWidget.d.ts +14 -0
  296. package/dist/types/widgets/WritingDraftConversationWidget/WritingDraftWidget/WritingDraftBody.d.ts +9 -0
  297. package/dist/types/widgets/WritingDraftConversationWidget/WritingDraftWidget/WritingDraftWidget.d.ts +44 -0
  298. package/dist/types/widgets/WritingDraftConversationWidget/shared/draft-mail-link.d.ts +17 -0
  299. package/dist/types/widgets/WritingDraftConversationWidget/shared/draft-plain-text.d.ts +7 -0
  300. package/dist/types/widgets/WritingDraftConversationWidget/shared/remark-draft-line-breaks.d.ts +13 -0
  301. package/dist/types/widgets/WritingDraftConversationWidget/shared/writing-draft-widget-payload.d.ts +23 -0
  302. package/dist/types/widgets/_shared/ConversationWidgetButton.d.ts +4 -0
  303. package/dist/types/widgets/_shared/DonePill.d.ts +14 -0
  304. package/dist/types/widgets/_shared/modern/WidgetKpiValue.d.ts +24 -0
  305. package/dist/types/widgets/_shared/modern/WidgetListRow.d.ts +14 -0
  306. package/dist/types/widgets/_shared/modern/WidgetStatusChip.d.ts +8 -0
  307. package/dist/types/widgets/_shared/modern/WidgetSurface.d.ts +13 -0
  308. package/dist/types/widgets/_shared/modern/WidgetSurfaceSkeleton.d.ts +11 -0
  309. package/dist/types/widgets/_shared/modern/index.d.ts +16 -0
  310. package/dist/types/widgets/_shared/skeleton-primitives.d.ts +20 -0
  311. package/dist/types/widgets/_shared/use-stack-when-wrapped.d.ts +6 -0
  312. package/dist/types/widgets/_shared/widget-payload-validation.d.ts +22 -0
  313. package/dist/widgets.js +84 -0
  314. package/dist/widgets.js.map +1 -0
  315. package/package.json +147 -3
@@ -0,0 +1,262 @@
1
+ import type { ComponentType, ErrorInfo, ReactNode } from "react";
2
+ import type { AgentsComponents } from "./components/types";
3
+ import type { ConversationWidgetStatePartition } from "../renderer/conversation-widget-state-partition";
4
+ import type { ChatAssistantCategory } from "../chat/chat-assistant-identity";
5
+ import type { ComposedNodeSchemaApplicationPart } from "../renderer/widget-tree/composed-node-schema";
6
+ import type { CanvasBehaviour } from "../renderer/canvas/canvas-behaviours";
7
+ /** Translates interface copy. The key is the English source text. */
8
+ export interface AgentsTexts {
9
+ translate: (key: string, replacements?: Record<string, string | number>, context?: string) => string;
10
+ }
11
+ /** One image of a gallery the app opens over the page. */
12
+ export interface AgentsGalleryImage {
13
+ /** Identifies the image within the gallery. */
14
+ id: string;
15
+ url: string;
16
+ name?: string;
17
+ }
18
+ /** An action the package dispatches into the state store. */
19
+ export interface AgentsStateAction {
20
+ type: string;
21
+ payload?: unknown;
22
+ }
23
+ /**
24
+ * A state store as React hooks: the package keeps its widget hydration state in it, and an app's older chat state
25
+ * partitions are read through it (`defaultChatStatePartition`). Without an app store the package uses its own.
26
+ */
27
+ export interface AgentsStateStore {
28
+ useSelector: <Selected>(selector: (state: any) => Selected) => Selected;
29
+ useDispatch: () => (action: AgentsStateAction) => unknown;
30
+ }
31
+ /** The owner's language and the active agent space's date and time settings. Every field may be missing. */
32
+ export interface AgentsOwnerSettings {
33
+ /** The owner's language (`de`). */
34
+ languageCode?: string | null;
35
+ /** The owner's locale (`de-DE`). */
36
+ locale?: string | null;
37
+ /** The date locale of the active agent space (`de-DE`). */
38
+ dateLocale?: string | null;
39
+ /** The time zone of the active agent space. */
40
+ timeZone?: string | null;
41
+ /** The active agent space writes times with AM/PM. */
42
+ usesAmPm?: boolean | null;
43
+ }
44
+ /** What the error card of a reached budget offers (the error card's upgrade data). */
45
+ export interface AgentsBudgetLimit {
46
+ /** An upgrade lifts the limit: the card offers it. */
47
+ canUpgrade: boolean;
48
+ /** Opens the app's upgrade flow. */
49
+ openUpgrade: () => void;
50
+ /** The app presents the budget as a fair-use allowance (the card uses that wording). */
51
+ showsFairUseWording: boolean;
52
+ }
53
+ /** The badge of a named assistant's icon (its intro card, its openings). */
54
+ export interface AgentsAssistantIconBadgeProps {
55
+ /** The icon's name in the app's icon set (`ChatAssistantIdentity.iconClass`). */
56
+ iconName: string;
57
+ color: string;
58
+ backgroundColor: string;
59
+ /** Larger on the intro card than on an opening. */
60
+ isLarge?: boolean;
61
+ }
62
+ /** The background of a chat with a named assistant's category (or with none, the overview of every category). */
63
+ export interface AgentsAssistantBackgroundProps {
64
+ category?: ChatAssistantCategory;
65
+ /** The category's alias; undefined for a chat without a category. */
66
+ categoryAlias?: string;
67
+ }
68
+ /** The state of the app's map script loader. */
69
+ export interface AgentsMapsLoaderState {
70
+ isLoaded: boolean;
71
+ loadError: Error | undefined;
72
+ languageCode: string | undefined;
73
+ }
74
+ /**
75
+ * Further names of the sandbox and readiness signals that an app declares beside the package's own (`AGENTS_VISUALIZATION`,
76
+ * `--agents-*`, `__AGENTS_WIDGET_IMAGE_V1__`, `__AGENTS_WIDGET_PREVIEW_V1__`): the names its stored visualization scripts,
77
+ * its skill texts or its headless capture already use. Every list is optional; the package's names always exist.
78
+ */
79
+ export type AgentsSandboxLegacyAliases = {
80
+ /** Further names of the sandbox global, e.g. the name stored scripts of the app read. */
81
+ visualizationGlobalNames?: string[];
82
+ /** Further prefixes of the frame's theme variables, e.g. `--app-` (each variable is set under every prefix). */
83
+ themeVariablePrefixes?: string[];
84
+ /** Further names of the image-capture readiness signal on `window`. */
85
+ imageReadinessGlobalNames?: string[];
86
+ /** Further names of the preview readiness signal on `window`. */
87
+ previewReadinessGlobalNames?: string[];
88
+ };
89
+ /**
90
+ * Everything an app supplies to the package. Every member is optional: the package has a default for each.
91
+ * An app sets it once at start (`setAgentsEnvironment`) or per subtree (`AgentsProvider`); the functions are read
92
+ * from the app-wide environment only.
93
+ */
94
+ export interface AgentsEnvironment {
95
+ /**
96
+ * The state store hooks (see `AgentsStateStore`). Default: the package's own widget hydration store (one per page,
97
+ * `createAgentsWidgetHydrationStateStore`). An app supplies its own to keep the hydration state in its store
98
+ * (host application: its Redux store, which mounts `WidgetHydrationReducer` under `AIExtensionsWidgetHydration`).
99
+ */
100
+ stateStore?: AgentsStateStore;
101
+ /**
102
+ * The partition of the app's own chat state a widget provider reads when its host passes neither a chat store nor a
103
+ * partition (host application: the AI-Extensions chat's slice). Default: none — such a provider keeps a store of its own.
104
+ */
105
+ defaultChatStatePartition?: ConversationWidgetStatePartition;
106
+ /** A React hook returning the owner's settings. Default: none known (the browser's language stands in). */
107
+ useOwnerSettings?: () => AgentsOwnerSettings;
108
+ /**
109
+ * A React hook returning the key of the agent space the owner works in. The key of an agent space is what the
110
+ * client knows it by: the id of the space, unless the app's backend hands out another key
111
+ * (`AgentSpace::getWidgetSelfHydrationKey()`). Default: no agent space.
112
+ */
113
+ useActiveAgentSpaceKey?: () => number | undefined;
114
+ /** Reads the display name of an agent space (the header of a widget of another agent space). Default: no name. */
115
+ readAgentSpaceName?: (agentSpaceKey: number, signal: AbortSignal) => Promise<string | undefined>;
116
+ /**
117
+ * The field of a widget block that carries the key of the block's agent space, as the app's backend writes it
118
+ * (`WidgetBlockFieldNames::WIDGET_SELF_HYDRATION_KEY`). An app whose stored conversations use another field name
119
+ * declares it here and in its backend class. Default: `agentSpaceId`.
120
+ */
121
+ widgetSelfHydrationKeyFieldName?: string;
122
+ /**
123
+ * The owner's text for a click on a widget of another agent space than the active one: returns the text with the
124
+ * suffix the app's backend reads that agent space from
125
+ * (`WidgetBlockFieldNames::OWNER_TEXT_SUFFIX_PATTERN_OF_ANOTHER_SPACE`). Default: the text unchanged.
126
+ */
127
+ appendAnotherAgentSpaceToOwnerText?: (ownerText: string, anotherAgentSpaceKey: number) => string;
128
+ /** The label of an agent space whose name is not known. Default: `#<key>`. */
129
+ buildUnnamedAgentSpaceLabel?: (agentSpaceKey: number) => string;
130
+ /**
131
+ * The sentence that tells the owner that a widget shows another agent space than the active one; `agentSpaceLabel`
132
+ * is its name or the label above. Default: a sentence that names no kind of agent space.
133
+ */
134
+ buildWidgetOfAnotherAgentSpaceExplanation?: (agentSpaceLabel: string) => string;
135
+ /** The name the owner knows the agent by, for the interface texts that name it. Default: `the assistant`. */
136
+ agentDisplayName?: string;
137
+ /** A React hook returning what the error card of a reached budget offers. Default: no upgrade, the plain wording. */
138
+ useBudgetLimit?: () => AgentsBudgetLimit;
139
+ /** A React hook returning the map script loader's state. Default: no maps. */
140
+ useMapsLoader?: () => AgentsMapsLoaderState;
141
+ /**
142
+ * The action that tells the app whether an agent chat surface is open (dispatched into the state store when the
143
+ * first surface mounts and the last unmounts). Default: nothing is dispatched.
144
+ */
145
+ buildChatSurfaceOpenChangedAction?: (isOpen: boolean) => AgentsStateAction;
146
+ components?: Partial<AgentsComponents>;
147
+ texts?: AgentsTexts;
148
+ /**
149
+ * Prepares a plain text (a model's words, a business name) for the app's `Text`, `Button` and `StatusBadge`
150
+ * replacements, which may read a string as markup. Default: the text unchanged.
151
+ */
152
+ escapePlainTextForText?: (text: string) => string;
153
+ /** Opens the images in the app's lightbox, starting at `startIndex`. Default: the start image in a new tab. */
154
+ openImageGallery?: (images: AgentsGalleryImage[], startIndex: number) => void;
155
+ /** Reports a widget that crashed while rendering. Default: nothing (the crash is logged to the console). */
156
+ reportWidgetCrash?: (widgetName: string, error: Error, errorInfo: ErrorInfo) => void;
157
+ /**
158
+ * The footer under an assistant message (host application: the admin's forensics panel, which gates itself). Receives the
159
+ * message as the message view got it. Default: none.
160
+ */
161
+ MessageFooter?: ComponentType<{
162
+ message?: unknown;
163
+ }>;
164
+ /**
165
+ * The colour theme class of a named assistant's category (the assistant identity and theme). Default:
166
+ * none — the generic chat colours.
167
+ */
168
+ readAssistantThemeClassName?: (categoryAlias: string) => string;
169
+ /** The badge of a named assistant's icon. Default: none. */
170
+ AssistantIconBadge?: ComponentType<AgentsAssistantIconBadgeProps>;
171
+ /** The chat's own background when the host paints none (host application: the category illustrations). Default: none. */
172
+ AssistantBackground?: ComponentType<AgentsAssistantBackgroundProps>;
173
+ /**
174
+ * Wraps the body of an open canvas (host application: page components inside a canvas must not mirror their filters into
175
+ * the page URL). Default: no wrapper.
176
+ */
177
+ CanvasBodyContainer?: ComponentType<{
178
+ children: ReactNode;
179
+ }>;
180
+ /**
181
+ * Tells the app that a turn of the agent runs in an open chat (the host application keeps the tab "ambient active" then);
182
+ * returns the release the chat calls when the turn ends. Default: nothing.
183
+ */
184
+ reportRunningTurn?: () => () => void;
185
+ /**
186
+ * Further names of the CustomVisualization sandbox (its global, its theme variable prefixes) and of the image and
187
+ * preview readiness signals, beside the package's own names (see `AgentsSandboxLegacyAliases`). An app whose stored
188
+ * scripts or capture read older names declares them here. Default: none — only the package's names exist.
189
+ */
190
+ sandboxLegacyAliases?: AgentsSandboxLegacyAliases;
191
+ /**
192
+ * The app's part of the ComposedView node schema: the node types, widgets (which embed, at which size), data sources
193
+ * and entity types its own classes declare, as its backend generates them beside the package's
194
+ * `composed-node-schema.json`. The tree readers and the kit read the package's schema with this part added
195
+ * (`getComposedNodeSchema`). Default: none — only the package's own types exist.
196
+ */
197
+ composedNodeSchemaApplicationPart?: ComposedNodeSchemaApplicationPart;
198
+ /**
199
+ * The path prefix of the app's API reads a live widget image capture lets through (same origin, GET only, sent with
200
+ * the capture's bearer; every other request of the capture fails it). Default: `/api/`.
201
+ */
202
+ widgetImageCaptureReadPathPrefix?: string;
203
+ /**
204
+ * The app's widgets that draw a Google map: a widget image capture of one of them, or of a `ComposedView` that embeds
205
+ * one, may load the Maps SDK (the narrow transport exception of the capture; the twin of the backend's list that opens
206
+ * the capture page's CSP). A `ComposedView` holding a `Map` node always may. Default: none.
207
+ */
208
+ googleMapWidgetNames?: string[];
209
+ /**
210
+ * Further `signalSource`s a widget click of the app posts (`injectSignal`), beside the package's own
211
+ * (`FRONTEND_WIDGET_CLICK`, `OWNER_ACTION_CONFIRM`): the message list reads every one of them as the owner's answer to
212
+ * a widget, so an answered widget never comes back interactive after a reload. Default: none.
213
+ */
214
+ furtherWidgetClickSignalSources?: string[];
215
+ /**
216
+ * The canvases of the app's widgets (canvas id → behaviour), beside the package's own (`packageCanvasBehaviours`):
217
+ * every canvas an app widget lists in `opensCanvases`. The app registers each one's body with `registerCanvasBodies`
218
+ * and, when gated, its requirement with `registerCanvasFeatureFlags`. A package canvas id here is ignored. Default:
219
+ * none.
220
+ */
221
+ furtherCanvasBehaviours?: Readonly<Record<string, CanvasBehaviour>>;
222
+ }
223
+ /** Sets the app-wide environment. Call it once before the first render; a later call re-renders the readers. */
224
+ export declare const setAgentsEnvironment: (environment: AgentsEnvironment) => void;
225
+ export declare const getAgentsEnvironment: () => AgentsEnvironment;
226
+ export declare const subscribeToAgentsEnvironment: (listener: () => void) => (() => void);
227
+ /** The package default: the English key with its placeholders substituted. */
228
+ export declare const DEFAULT_AGENTS_TEXTS: AgentsTexts;
229
+ /** Translates an interface text through the app-wide environment, for a string a component hands on (a label). */
230
+ export declare const translateText: (key: string, replacements?: Record<string, string | number>, context?: string) => string;
231
+ /** A plain text as the app's text components take it (`AgentsEnvironment.escapePlainTextForText`). */
232
+ export declare const escapePlainTextForText: (text: string) => string;
233
+ /** Opens an image gallery over the page (`AgentsEnvironment.openImageGallery`). */
234
+ export declare const openImageGallery: (images: AgentsGalleryImage[], startIndex: number) => void;
235
+ /** The block field of the package's backend default (`WidgetBlockFieldNames::WIDGET_SELF_HYDRATION_KEY`). */
236
+ export declare const DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME = "agentSpaceId";
237
+ /** The field of a widget block that carries the key of its agent space (`AgentsEnvironment.widgetSelfHydrationKeyFieldName`). */
238
+ export declare const getWidgetSelfHydrationKeyFieldName: () => string;
239
+ /** The owner's text for a click on a widget of another agent space (`AgentsEnvironment.appendAnotherAgentSpaceToOwnerText`). */
240
+ export declare const appendAnotherAgentSpaceToOwnerText: (ownerText: string, anotherAgentSpaceKey: number) => string;
241
+ /** The label of an agent space without a known name (`AgentsEnvironment.buildUnnamedAgentSpaceLabel`). */
242
+ export declare const buildUnnamedAgentSpaceLabel: (agentSpaceKey: number) => string;
243
+ /** The sentence under a widget of another agent space (`AgentsEnvironment.buildWidgetOfAnotherAgentSpaceExplanation`). */
244
+ export declare const buildWidgetOfAnotherAgentSpaceExplanation: (agentSpaceLabel: string) => string;
245
+ /** The further sandbox and readiness names the app declares (`AgentsEnvironment.sandboxLegacyAliases`). */
246
+ export declare const getSandboxLegacyAliases: () => AgentsSandboxLegacyAliases;
247
+ /** The package default of `AgentsEnvironment.widgetImageCaptureReadPathPrefix`. */
248
+ export declare const DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX = "/api/";
249
+ /** The path prefix of the API reads a live widget image capture lets through (`AgentsEnvironment.widgetImageCaptureReadPathPrefix`). */
250
+ export declare const getWidgetImageCaptureReadPathPrefix: () => string;
251
+ /** The app's widgets that draw a Google map (`AgentsEnvironment.googleMapWidgetNames`). */
252
+ export declare const getGoogleMapWidgetNames: () => readonly string[];
253
+ /** The app's further widget click signal sources (`AgentsEnvironment.furtherWidgetClickSignalSources`). */
254
+ export declare const getFurtherWidgetClickSignalSources: () => readonly string[];
255
+ /** The canvases of the app's widgets (`AgentsEnvironment.furtherCanvasBehaviours`). */
256
+ export declare const getFurtherCanvasBehaviours: () => Readonly<Record<string, CanvasBehaviour>>;
257
+ /** The name the owner knows the agent by (`AgentsEnvironment.agentDisplayName`). */
258
+ export declare const getAgentDisplayName: () => string;
259
+ /** Reports a running turn of an open chat (`AgentsEnvironment.reportRunningTurn`); returns the release. */
260
+ export declare const reportRunningTurn: () => (() => void) | undefined;
261
+ /** Reports a crashed widget (`AgentsEnvironment.reportWidgetCrash`). */
262
+ export declare const reportWidgetCrash: (widgetName: string, error: Error, errorInfo: ErrorInfo) => void;
@@ -0,0 +1,4 @@
1
+ export { AgentsProvider, type AgentsProviderProps, useAgentsActiveAgentSpaceKey, useAgentsBudgetLimit, useAgentsComponents, useAgentsEnvironment, useAgentsMapsLoader, useAgentsOwnerSettings, useAgentsStateDispatch, useAgentsStateSelector, useAgentsTexts, } from "./AgentsProvider";
2
+ export { type AgentsAssistantBackgroundProps, type AgentsAssistantIconBadgeProps, type AgentsBudgetLimit, type AgentsEnvironment, type AgentsGalleryImage, type AgentsMapsLoaderState, type AgentsOwnerSettings, type AgentsSandboxLegacyAliases, type AgentsStateAction, type AgentsStateStore, type AgentsTexts, appendAnotherAgentSpaceToOwnerText, buildUnnamedAgentSpaceLabel, buildWidgetOfAnotherAgentSpaceExplanation, DEFAULT_AGENTS_TEXTS, DEFAULT_WIDGET_IMAGE_CAPTURE_READ_PATH_PREFIX, DEFAULT_WIDGET_SELF_HYDRATION_KEY_FIELD_NAME, escapePlainTextForText, getAgentDisplayName, getAgentsEnvironment, getFurtherCanvasBehaviours, getFurtherWidgetClickSignalSources, getGoogleMapWidgetNames, getSandboxLegacyAliases, getWidgetImageCaptureReadPathPrefix, getWidgetSelfHydrationKeyFieldName, openImageGallery, reportRunningTurn, reportWidgetCrash, setAgentsEnvironment, translateText, } from "./environment";
3
+ export { classNames } from "./class-names";
4
+ export * from "./components";
@@ -0,0 +1,18 @@
1
+ export interface ConversationDeepLinkedWidgetProps {
2
+ /** Canonical registry wire name, from `?agentWidget=` or a restored pinned canvas. Unknown / not deep-linkable → nothing renders. */
3
+ widgetName?: string;
4
+ /** The key of the chat's agent space, forwarded to the widget exactly as a markdown attribute would carry it. */
5
+ agentSpaceKey?: number;
6
+ }
7
+ /**
8
+ * Mounts ONE registered widget outside the message list — the customer opened it from a page (`?agentWidget=`). The
9
+ * widget receives `openedByPage` (plus `interactive` / `justDelivered`), so a canvas-opening widget (an app's editor
10
+ * widget, `ExampleWidget`) opens its canvas with origin `openedByPage` and a page anchor; nothing is written to the
11
+ * conversation, no message and no signal. (A canvas that was open before a reload comes back through
12
+ * `CanvasRestoreOnMount`, not through this mount.)
13
+ *
14
+ * Rendered with the entry's feature gate and the shared error boundary, but WITHOUT the viewport windowing of
15
+ * {@link ConversationWidgetHost}: there is no message to scroll past here, and a windowed wrapper would unmount a
16
+ * zero-height widget (these widgets render `null` and live entirely in the canvas), taking its canvas with it.
17
+ */
18
+ export declare const ConversationDeepLinkedWidget: ({ widgetName, agentSpaceKey }: ConversationDeepLinkedWidgetProps) => import("react/jsx-runtime").JSX.Element | null;
@@ -0,0 +1,21 @@
1
+ export interface ConversationMarkdownProps {
2
+ markdown: string;
3
+ /**
4
+ * Forwarded into every widget instance as `interactive` (and its deprecated alias `fresh`): the widget's controls
5
+ * may be used. True for a live-delivered message and for the newest assistant reply after a reload.
6
+ */
7
+ interactive?: boolean;
8
+ /**
9
+ * Forwarded into every widget instance as `justDelivered`: the message was delivered live right now. The only gate
10
+ * for one-shot side effects (canvas open, draft creation); never true after a reload or on replay.
11
+ */
12
+ justDelivered?: boolean;
13
+ /** Id of the host message, forwarded so a widget can identify the canvas it opens. */
14
+ messageId?: string | number;
15
+ /**
16
+ * When true, widgets are replaced with a lightweight placeholder.
17
+ * Used for old messages to keep the chat scroll cheap.
18
+ */
19
+ hideWidgets?: boolean;
20
+ }
21
+ export declare const ConversationMarkdown: (props: ConversationMarkdownProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from "react";
2
+ interface ConversationWidgetActionsProps {
3
+ children: ReactNode;
4
+ }
5
+ /** Wrap the entire action area, including its footer/divider, to omit it from email images. */
6
+ export declare const ConversationWidgetActions: (props: ConversationWidgetActionsProps) => import("react/jsx-runtime").JSX.Element | null;
7
+ export {};
@@ -0,0 +1,234 @@
1
+ import { ReactNode } from "react";
2
+ import { ConversationComposerWidget } from "./conversation-composer-widget";
3
+ import { CanvasOpenRequest, CanvasState, LastClosedCanvas } from "./canvas/canvas-state";
4
+ import type { CanvasCreatedEntity } from "./canvas/canvas-reducers";
5
+ /** A message of the transcript a widget reads (its id and author role); the chat's messages carry more. */
6
+ export interface ConversationWidgetTranscriptMessage {
7
+ id?: number | string | null;
8
+ role?: string | null;
9
+ }
10
+ export type ChatEngagementMediaItem = {
11
+ id?: number;
12
+ publicUrl: string;
13
+ publicThumbnailUrl?: string;
14
+ type?: string;
15
+ };
16
+ export type ChatEngagementMediaItems = ChatEngagementMediaItem[];
17
+ /** A post or event the owner edits from the chat — the fields the edit widget reads off its payload. */
18
+ export type ChatEngagementTarget = {
19
+ kind: "post";
20
+ id: number;
21
+ title?: string;
22
+ content?: string;
23
+ status?: string;
24
+ scheduleAt?: string;
25
+ startDate?: string;
26
+ endDate?: string;
27
+ mediaItems?: ChatEngagementMediaItems;
28
+ } | {
29
+ kind: "event";
30
+ id: number;
31
+ title?: string;
32
+ content?: string;
33
+ status?: string;
34
+ scheduleAt?: string;
35
+ startDate?: string;
36
+ endDate?: string;
37
+ mediaItems?: ChatEngagementMediaItems;
38
+ };
39
+ export interface OpenEngagementEditConversationWidgetPayload {
40
+ target: ChatEngagementTarget;
41
+ mode: "edit";
42
+ }
43
+ /**
44
+ * What an opener passes to `openCanvas`: the request minus the two facts the PROVIDER knows better than any widget —
45
+ * whether the viewport is wide enough for the split, and whether the host renders a canvas surface at all.
46
+ */
47
+ export type CanvasOpenRequestFromOpener = Omit<CanvasOpenRequest, "viewportViable" | "hostHasCanvasSurface">;
48
+ export type InjectSignalOptions = {
49
+ /**
50
+ * The signal is context for the CURRENT turn (e.g. specialist instructions riding along a just-posted user
51
+ * message) and must NOT drive its own agent turn / produce its own reply. The chat host delivers it only while a
52
+ * turn is observed running — a signal appended mid-turn lands in the conversation history without re-driving the
53
+ * agent (the backend only re-drives when the LAST message is an unanswered inbound). If no turn starts, the signal
54
+ * is dropped.
55
+ */
56
+ withoutOwnAgentTurn?: boolean;
57
+ /**
58
+ * Overrides the server-side default signal source (FRONTEND_WIDGET_CLICK), e.g. the business-basics form
59
+ * submit's own source.
60
+ */
61
+ signalSource?: string;
62
+ /**
63
+ * Who produced the signal. CUSTOMER_CLICK (the default when omitted): the customer pressed a widget button or CTA,
64
+ * so the chat scrolls to follow the turn and a refusal (closed conversation, backend 400) goes on the error card.
65
+ * PROGRAMMATIC: an effect or ride-along emitted it without a customer action (store-diff feedback, the
66
+ * widget-invalid corrective, specialist instructions) — refusals are dropped silently, nothing scrolls.
67
+ */
68
+ signalOrigin?: "CUSTOMER_CLICK" | "PROGRAMMATIC";
69
+ };
70
+ export interface ConversationWidgetCallbacks {
71
+ /**
72
+ * THE CANVAS MODEL. The canvas is data in the chat's slice
73
+ * partition: a pointer to its anchor message (or page), an identity and a render generation — see
74
+ * `canvas/canvas-state.ts`. `openCanvas` is the one way to open for all four origins; the opening rule
75
+ * (`canvas/decide-canvas-open.ts`) decides inside the reducer. `closeCanvas(byCustomer)` keeps the canvas re-openable
76
+ * as `lastClosedCanvas`. The shell (`CanvasPane`) renders the body from `canvasBodies`; nothing else
77
+ * holds a canvas.
78
+ */
79
+ canvas: CanvasState | null;
80
+ /**
81
+ * Whether this host renders a canvas surface at all. A mount-time opener reads it to tell "the customer has no
82
+ * canvas here" from "my request was dropped while the host was still coming up" — the latter is worth asking again.
83
+ */
84
+ hostHasCanvasSurface: boolean;
85
+ lastClosedCanvas: LastClosedCanvas | null;
86
+ openCanvas: (request: CanvasOpenRequestFromOpener) => void;
87
+ closeCanvas: (byCustomer: boolean) => void;
88
+ /**
89
+ * Re-open `lastClosedCanvas` as a customer action (origin `cardClick`): the canvas toggle button on the divider, the
90
+ * narrow-viewport re-open control, the compact → expand path. No-op when nothing was closed.
91
+ */
92
+ reopenLastClosedCanvas: () => void;
93
+ /**
94
+ * A body created its entity (the post editor's draft): remember the id on the canvas it was created for, so a
95
+ * re-open or a restore edits that entity instead of creating another. Identity + generation checked in the reducer.
96
+ */
97
+ setCanvasCreatedEntityId: (created: CanvasCreatedEntity) => void;
98
+ /**
99
+ * Contracts (minimizes) the host drawer/modal so the app behind stays
100
+ * visible during navigation. Called by the Navigate tool before animating.
101
+ * No-op by default; hosts that support compacting override this.
102
+ */
103
+ minimizeChatHost: () => void;
104
+ /**
105
+ * Forget the canvas and the last closed one — a conversation switch, where the previous conversation's canvas is
106
+ * stale outright (`clearCanvas` in the canvas model; the LEFT conversation keeps its stored pointer).
107
+ */
108
+ resetCanvas: () => void;
109
+ /**
110
+ * The SEND boundary of the canvas model, called by the shell on a typed send (the hosts call it for widget sends
111
+ * too): a `turn` canvas is over for good, a `pinned` canvas stays open — see `canvas-reducers.ts`.
112
+ */
113
+ resetCanvasForNewTurn: () => void;
114
+ /**
115
+ * Post the message as a visible USER bubble and drive one agent turn — the widget-button twin of the typed input.
116
+ * Mirrors `injectSignal`'s contract: a host may return a promise resolving to `true` only once the send was
117
+ * actually accepted (dispatched/posted), `false` when a caller-side guard dropped it (a closed conversation, an
118
+ * in-flight start). `void`/no result counts as accepted for a host that doesn't report (e.g. Conversation.tsx) —
119
+ * only a widget that explicitly awaits `false` must keep its controls usable.
120
+ */
121
+ sendMessageToChat: (message: string) => void | Promise<boolean>;
122
+ /**
123
+ * Put text into the chat's composer (the message input) and focus it, WITHOUT sending — the widget-button twin
124
+ * of a host-owned control using `ConversationMessageInputHandle.insertTextIntoInput` directly (e.g. the agent "+"
125
+ * menu's "Generate image" entry). Used by a widget option that is a TEMPLATE with a blank the owner must still
126
+ * fill in (QuickReplies' placeholder-option pill): sending it as-is would post the literal blank as the owner's
127
+ * message. No-op by default; hosts that own a chat input wire it to that input's imperative handle.
128
+ */
129
+ prefillComposer: (text: string) => void;
130
+ /**
131
+ * Inject a model-visible / user-invisible SIGNAL into the CURRENT conversation and drive one agent turn. Unlike
132
+ * `sendMessageToChat` (which posts a visible USER message), this does NOT render a chat bubble — it tells the agent
133
+ * something happened (e.g. "User selected image A") and lets it continue. The reply lands via the existing realtime
134
+ * signal, exactly like a posted message. Set by chat hosts that own a conversation id; no-op by default.
135
+ * Hosts may return a promise resolving to true only after the signal was accepted. False or no result
136
+ * means delivery is not confirmed; callers that retire controls must wait for true.
137
+ */
138
+ injectSignal: (signalText: string, options?: InjectSignalOptions) => void | Promise<boolean>;
139
+ /**
140
+ * Key of the agent space the chat is scoped to. Set by hosts that mount the chat outside a
141
+ * route of the agent space (e.g. a host whose panel opens on a page with no agent space
142
+ * in the URL). Widget hydrators fall back to this when the URL path / active-agent-space
143
+ * store can't supply one — without it they fetch with a missing key and every section 404s.
144
+ * Undefined for in-route hosts, which keep their existing behavior.
145
+ */
146
+ chatAgentSpaceKey?: number;
147
+ /**
148
+ * Whether the chat's agent turn is RUNNING right now (the slice partition's `aiThinking`). A status widget whose
149
+ * backing run is still open reads this to tell "being applied" from "paused — waiting for the owner's reply": the
150
+ * turn ended (a question, a step budget notice) while the run stays open. Read from the provider's slice, never
151
+ * passed by a host.
152
+ */
153
+ isConversationRunning: boolean;
154
+ /**
155
+ * The conversation's run is over (`runState` COMPLETED or CANCELLED): the backend rejects further input. Read from
156
+ * the provider's slice, for a canvas body, which gets no per-message `interactive` flag.
157
+ */
158
+ isConversationClosed: boolean;
159
+ /**
160
+ * Conversation id the chat is currently showing. Set by hosts that know it (AgentChat). Scopes the stored canvas
161
+ * pointer (`canvas/canvasStorage.ts`) — undefined on hosts that don't set it simply means the canvas does not come
162
+ * back after a reload there.
163
+ */
164
+ conversationId?: number;
165
+ /**
166
+ * Composer widgets currently held in the chat input — the composer-side twin of a rendered widget (a widget
167
+ * instance that lives in the input before send; see `ConversationComposerWidget`). Rendered by the generic
168
+ * `ConversationMessageInputComposerWidgets` strip via each entry's registry `composerComponent`.
169
+ *
170
+ * Always a concrete array (never undefined on the context value itself — only the CALLBACKS prop a host supplies
171
+ * is optional, deciding ownership):
172
+ * - **Controlled** — a host passes `composerWidgets` (e.g. an app's builder page, whose preview
173
+ * is a *sibling* of `<Conversation>`). Every mutation below is then routed to the host's
174
+ * `onComposerWidgetsChange(next)` instead of local state.
175
+ * - **Uncontrolled** — the host omits it (every chat-as-host surface today). The provider owns a
176
+ * `useState<ConversationComposerWidget[]>([])` and a *descendant* (e.g. an app's editor drawer) mutates it
177
+ * directly via the functions below.
178
+ */
179
+ composerWidgets: ConversationComposerWidget[];
180
+ /** Add a new composer widget (or the first element of one); returns its client-only `composerWidgetId`. */
181
+ addComposerWidget: (widgetName: string, fields: Record<string, unknown>) => string;
182
+ /** Replace one composer widget's fields in place (e.g. drop one element out of several). */
183
+ replaceComposerWidgetFields: (composerWidgetId: string, fields: Record<string, unknown>) => void;
184
+ /** Remove one composer widget entirely (its ✕, or Backspace when it has no removable parts left). */
185
+ removeComposerWidget: (composerWidgetId: string) => void;
186
+ /** Remove every composer widget — called on send. */
187
+ clearComposerWidgets: () => void;
188
+ /**
189
+ * Controlled-mode sink: called with the FULL next array on every composer-widget mutation
190
+ * (add/replace/remove/clear). Ignored (mutations apply to local state instead) when the host doesn't also pass
191
+ * `composerWidgets`.
192
+ */
193
+ onComposerWidgetsChange?: (next: ConversationComposerWidget[]) => void;
194
+ onOpenConversation?: (conversationId: number, messageId?: number) => void;
195
+ /**
196
+ * Switch THIS chat to another conversation of the same agent space in place (no new tab) — the door a widget that links
197
+ * to related work ("Open the conversation") takes when that conversation belongs to the agent space the chat is open
198
+ * on. Undefined on hosts without a conversation switcher.
199
+ */
200
+ onSwitchConversation?: (conversationId: number) => void;
201
+ /**
202
+ * True while the chat is the guided first-run setup: the host mounts the agent on ONE conversation it may not
203
+ * leave (the full-page setup route) AND that conversation's purpose declares a customer progress stepper — the
204
+ * same presence contract the stepper itself renders on (no purpose-name checks in the frontend). Widgets read it
205
+ * to offer setup-only affordances, e.g. a connect widget's "Skip for now" deferral. False on every
206
+ * other surface (the floating widget, the website builder, a purposed setup conversation reopened from history).
207
+ */
208
+ isOnboardingSetupConversation?: boolean;
209
+ /**
210
+ * The transcript this widget lives in, read from the door's own partition (`sliceInstance.selectState`) — the same
211
+ * source `canvas` above reads. `null` before the conversation loads. A one-shot widget (e.g. QuickReplies) reads
212
+ * this to tell "the owner already answered a later question" from its own `messageId`: any message with
213
+ * `role === "USER"` AFTER the widget's host message means the widget is stale, regardless of `interactive` (which
214
+ * stays true for the whole live session, not just until the next owner message).
215
+ */
216
+ messages: ConversationWidgetTranscriptMessage[] | null;
217
+ }
218
+ export declare const defaultConversationWidgetCallbacks: ConversationWidgetCallbacks;
219
+ /** The widget callbacks a chat host (or a standalone host) supplies to every widget below it. */
220
+ export declare const ConversationWidgetContext: import("react").Context<ConversationWidgetCallbacks>;
221
+ /** Static capture host: no conversation, persistence, canvas effects or action callbacks. */
222
+ export declare const ReadOnlyConversationWidgetProvider: (props: {
223
+ children: ReactNode;
224
+ agentSpaceKey: number;
225
+ }) => import("react/jsx-runtime").JSX.Element;
226
+ /**
227
+ * A host outside the chat that supplies its OWN callbacks — the widget preview keeps its canvas and its
228
+ * composer log itself. Every callback it leaves out keeps the no-op default; no conversation slice is involved.
229
+ */
230
+ export declare const StandaloneConversationWidgetProvider: (props: {
231
+ children: ReactNode;
232
+ callbacks: Partial<ConversationWidgetCallbacks>;
233
+ }) => import("react/jsx-runtime").JSX.Element;
234
+ export declare const useConversationWidgetContext: () => ConversationWidgetCallbacks;
@@ -0,0 +1,32 @@
1
+ import { ReactNode } from "react";
2
+ import type { ConversationWidgetStatePartition } from "./conversation-widget-state-partition";
3
+ import type { AgentsChatStore } from "../chat/store/create-agents-chat-store";
4
+ import { type ConversationWidgetCallbacks } from "./ConversationWidgetCallbacksContext";
5
+ export * from "./ConversationWidgetCallbacksContext";
6
+ export interface ConversationWidgetProviderProps {
7
+ children: ReactNode;
8
+ callbacks: Partial<ConversationWidgetCallbacks>;
9
+ /**
10
+ * The chat slice partition this provider's canvas lives in. The shell is shared by the two chat doors, so the door
11
+ * says which partition: `AgentChat` passes `AgentChatInstance`; the AI-Extensions chat, every story and every spec
12
+ * keep the default. A prop, not a callback — `callbacks` is `Partial`, and the partition is not optional.
13
+ */
14
+ sliceInstance?: ConversationWidgetStatePartition;
15
+ /**
16
+ * The package chat store of the chat: the agent chat passes its window's store and the provider reads
17
+ * and writes the canvas there. Without it the provider reads a partition of the app's own chat state
18
+ * (`sliceInstance`, else the environment's `defaultChatStatePartition`).
19
+ */
20
+ chatStore?: AgentsChatStore;
21
+ /**
22
+ * False for a host that renders the chat without the split (`ConversationView.disableSplitView`): there is nowhere
23
+ * to open a canvas, so every open request is ignored with reason `noSurface`. Default true.
24
+ */
25
+ hostHasCanvasSurface?: boolean;
26
+ }
27
+ /**
28
+ * The widget callbacks of one chat, the canvas model included. Reads the chat's state from the package chat store when
29
+ * the host passes one (`chatStore`), else from a partition of the app's own chat state (`sliceInstance`, or the
30
+ * environment's `defaultChatStatePartition` — host application: the AI-Extensions chat), else from a store of its own.
31
+ */
32
+ export declare const ConversationWidgetProvider: (props: ConversationWidgetProviderProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,25 @@
1
+ import React from "react";
2
+ interface Props {
3
+ /** Canonical widget name, for the error log. */
4
+ widgetName: string;
5
+ /** Called once when the widget threw — the render report marks the block `failed`. */
6
+ onCrash?: () => void;
7
+ children: React.ReactNode;
8
+ }
9
+ interface State {
10
+ hasError: boolean;
11
+ }
12
+ /**
13
+ * Per-widget error boundary. Widget props originate from LLM output, so a
14
+ * malformed payload can throw anywhere in a widget's render/effects — without a
15
+ * boundary one bad widget unmounts the entire chat message. On error the
16
+ * widget renders nothing (the surrounding prose stays intact) and the failure
17
+ * is logged with the widget name.
18
+ */
19
+ export declare class ConversationWidgetErrorBoundary extends React.Component<Props, State> {
20
+ state: State;
21
+ static getDerivedStateFromError(): State;
22
+ componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
23
+ render(): React.ReactNode;
24
+ }
25
+ export {};
@@ -0,0 +1,36 @@
1
+ import React from "react";
2
+ import { ConversationWidgetEntry } from "./conversationWidgetRegistry";
3
+ export type ConversationWidgetRenderProps = Record<string, unknown> & {
4
+ children?: React.ReactNode;
5
+ fresh?: boolean;
6
+ interactive?: boolean;
7
+ justDelivered?: boolean;
8
+ messageId?: string | number;
9
+ };
10
+ interface ConversationWidgetHostProps {
11
+ widget: ConversationWidgetEntry;
12
+ /** Forwarded into the widget (and as its deprecated alias `fresh`): the widget's controls may be used. */
13
+ interactive: boolean;
14
+ /** Forwarded into the widget: the host message was delivered live right now — the one-shot side-effect gate. */
15
+ justDelivered: boolean;
16
+ /** Id of the host message, forwarded so a widget can identify the canvas it opens. */
17
+ messageId?: string | number;
18
+ /** When true, the widget renders as a lightweight placeholder (cheap scroll). */
19
+ hideWidgets: boolean;
20
+ /** Parsed markdown attributes for this widget instance. */
21
+ conversationWidgetRenderProps: ConversationWidgetRenderProps;
22
+ }
23
+ /**
24
+ * Single render path for every widget. Each concern is applied as a sequential gate
25
+ * (innermost → outermost):
26
+ * 1. the widget itself, with `interactive` / `justDelivered`
27
+ * 2. feature-flag gate
28
+ * 3. viewport-windowing (mount near the viewport, placeholder when far — WindowedWidget)
29
+ * 4. block spacing wrapper
30
+ *
31
+ * A block of a JUST-DELIVERED message is also registered with the chat's render-report collector: it
32
+ * counts as `mounted` unless the widget reports otherwise through `useReportWidgetRenderStatus`, and a crash caught by
33
+ * the error boundary reports `failed` (`RENDER_FAILED`). A replayed message reports nothing.
34
+ */
35
+ export declare const ConversationWidgetHost: ({ widget, interactive, justDelivered, messageId, hideWidgets, conversationWidgetRenderProps, }: ConversationWidgetHostProps) => import("react/jsx-runtime").JSX.Element;
36
+ export {};