@solidxai/core-ui 0.1.20 → 0.1.21-beta.2

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 (430) hide show
  1. package/dist/components/common/FileReaderExt.d.ts.map +1 -1
  2. package/dist/components/common/FileReaderExt.js +22 -11
  3. package/dist/components/common/FileReaderExt.js.map +1 -1
  4. package/dist/components/common/FileReaderExt.tsx +27 -14
  5. package/dist/components/common/SocialMediaLogin.d.ts.map +1 -1
  6. package/dist/components/common/SocialMediaLogin.js +1 -1
  7. package/dist/components/common/SocialMediaLogin.js.map +1 -1
  8. package/dist/components/common/SocialMediaLogin.tsx +50 -19
  9. package/dist/components/common/SolidPopupContainer.js +1 -1
  10. package/dist/components/common/SolidPopupContainer.js.map +1 -1
  11. package/dist/components/common/SolidPopupContainer.tsx +1 -1
  12. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts +1 -0
  13. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
  14. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +46 -19
  15. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
  16. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +69 -14
  17. package/dist/components/common/solid-export.css +75 -0
  18. package/dist/components/core/card/CardItem.d.ts.map +1 -1
  19. package/dist/components/core/card/CardItem.js +13 -2
  20. package/dist/components/core/card/CardItem.js.map +1 -1
  21. package/dist/components/core/card/CardItem.tsx +13 -2
  22. package/dist/components/core/card/SolidCardView.js +2 -2
  23. package/dist/components/core/card/SolidCardView.js.map +1 -1
  24. package/dist/components/core/card/SolidCardView.tsx +2 -2
  25. package/dist/components/core/chatter/SolidChatterAuditMessage.css +68 -0
  26. package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts +1 -0
  27. package/dist/components/core/chatter/SolidChatterAuditMessage.d.ts.map +1 -1
  28. package/dist/components/core/chatter/SolidChatterAuditMessage.js +20 -2
  29. package/dist/components/core/chatter/SolidChatterAuditMessage.js.map +1 -1
  30. package/dist/components/core/chatter/SolidChatterAuditMessage.tsx +49 -12
  31. package/dist/components/core/common/SolidGenericImport/SolidImport.module.css +71 -0
  32. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.d.ts.map +1 -1
  33. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js +83 -1
  34. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js.map +1 -1
  35. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.module.css +45 -1
  36. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.tsx +106 -2
  37. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.d.ts +3 -0
  38. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.d.ts.map +1 -0
  39. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.js +163 -0
  40. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.js.map +1 -0
  41. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.module.css +86 -0
  42. package/dist/components/core/extension/solid-core/agentSession/AgentSessionChatFormWidget.tsx +129 -0
  43. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.d.ts +23 -0
  44. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.d.ts.map +1 -0
  45. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.js +270 -0
  46. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.js.map +1 -0
  47. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.module.css +167 -0
  48. package/dist/components/core/extension/solid-core/agentSession/AgentSessionComparisonHeaderAction.tsx +270 -0
  49. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.d.ts +3 -0
  50. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.d.ts.map +1 -0
  51. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.js +67 -0
  52. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.js.map +1 -0
  53. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.module.css +68 -0
  54. package/dist/components/core/extension/solid-core/agentSession/AgentSessionConfigVersionListWidget.tsx +107 -0
  55. package/dist/components/core/form/SolidFormFieldRender.d.ts.map +1 -1
  56. package/dist/components/core/form/SolidFormFieldRender.js +2 -1
  57. package/dist/components/core/form/SolidFormFieldRender.js.map +1 -1
  58. package/dist/components/core/form/SolidFormFieldRender.tsx +6 -3
  59. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  60. package/dist/components/core/form/SolidFormView.js +29 -4
  61. package/dist/components/core/form/SolidFormView.js.map +1 -1
  62. package/dist/components/core/form/SolidFormView.tsx +27 -5
  63. package/dist/components/core/form/fields/SolidBooleanField.d.ts.map +1 -1
  64. package/dist/components/core/form/fields/SolidBooleanField.js +4 -4
  65. package/dist/components/core/form/fields/SolidBooleanField.js.map +1 -1
  66. package/dist/components/core/form/fields/SolidBooleanField.tsx +15 -3
  67. package/dist/components/core/form/fields/SolidDateField.d.ts.map +1 -1
  68. package/dist/components/core/form/fields/SolidDateField.js +1 -1
  69. package/dist/components/core/form/fields/SolidDateField.js.map +1 -1
  70. package/dist/components/core/form/fields/SolidDateField.tsx +5 -4
  71. package/dist/components/core/form/fields/SolidDateTimeField.d.ts.map +1 -1
  72. package/dist/components/core/form/fields/SolidDateTimeField.js +3 -5
  73. package/dist/components/core/form/fields/SolidDateTimeField.js.map +1 -1
  74. package/dist/components/core/form/fields/SolidDateTimeField.tsx +7 -8
  75. package/dist/components/core/form/fields/SolidDecimalField.d.ts.map +1 -1
  76. package/dist/components/core/form/fields/SolidDecimalField.js +2 -1
  77. package/dist/components/core/form/fields/SolidDecimalField.js.map +1 -1
  78. package/dist/components/core/form/fields/SolidDecimalField.tsx +6 -1
  79. package/dist/components/core/form/fields/SolidEmailField.d.ts.map +1 -1
  80. package/dist/components/core/form/fields/SolidEmailField.js +2 -1
  81. package/dist/components/core/form/fields/SolidEmailField.js.map +1 -1
  82. package/dist/components/core/form/fields/SolidEmailField.tsx +6 -1
  83. package/dist/components/core/form/fields/SolidIntegerField.d.ts.map +1 -1
  84. package/dist/components/core/form/fields/SolidIntegerField.js +3 -3
  85. package/dist/components/core/form/fields/SolidIntegerField.js.map +1 -1
  86. package/dist/components/core/form/fields/SolidIntegerField.tsx +11 -5
  87. package/dist/components/core/form/fields/SolidJsonField.d.ts.map +1 -1
  88. package/dist/components/core/form/fields/SolidJsonField.js +1 -1
  89. package/dist/components/core/form/fields/SolidJsonField.js.map +1 -1
  90. package/dist/components/core/form/fields/SolidJsonField.tsx +5 -3
  91. package/dist/components/core/form/fields/SolidLongTextField.d.ts.map +1 -1
  92. package/dist/components/core/form/fields/SolidLongTextField.js +2 -2
  93. package/dist/components/core/form/fields/SolidLongTextField.js.map +1 -1
  94. package/dist/components/core/form/fields/SolidLongTextField.tsx +10 -4
  95. package/dist/components/core/form/fields/SolidMediaMultipleField.d.ts.map +1 -1
  96. package/dist/components/core/form/fields/SolidMediaMultipleField.js +4 -4
  97. package/dist/components/core/form/fields/SolidMediaMultipleField.js.map +1 -1
  98. package/dist/components/core/form/fields/SolidMediaMultipleField.tsx +8 -6
  99. package/dist/components/core/form/fields/SolidMediaSingleField.d.ts.map +1 -1
  100. package/dist/components/core/form/fields/SolidMediaSingleField.js +3 -3
  101. package/dist/components/core/form/fields/SolidMediaSingleField.js.map +1 -1
  102. package/dist/components/core/form/fields/SolidMediaSingleField.tsx +7 -5
  103. package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
  104. package/dist/components/core/form/fields/SolidPasswordField.js +4 -3
  105. package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
  106. package/dist/components/core/form/fields/SolidPasswordField.tsx +21 -4
  107. package/dist/components/core/form/fields/SolidRichTextField.d.ts.map +1 -1
  108. package/dist/components/core/form/fields/SolidRichTextField.js +2 -1
  109. package/dist/components/core/form/fields/SolidRichTextField.js.map +1 -1
  110. package/dist/components/core/form/fields/SolidRichTextField.tsx +5 -1
  111. package/dist/components/core/form/fields/SolidSelectionDynamicField.d.ts.map +1 -1
  112. package/dist/components/core/form/fields/SolidSelectionDynamicField.js +2 -1
  113. package/dist/components/core/form/fields/SolidSelectionDynamicField.js.map +1 -1
  114. package/dist/components/core/form/fields/SolidSelectionDynamicField.tsx +6 -3
  115. package/dist/components/core/form/fields/SolidSelectionStaticField.d.ts.map +1 -1
  116. package/dist/components/core/form/fields/SolidSelectionStaticField.js +6 -5
  117. package/dist/components/core/form/fields/SolidSelectionStaticField.js.map +1 -1
  118. package/dist/components/core/form/fields/SolidSelectionStaticField.tsx +26 -7
  119. package/dist/components/core/form/fields/SolidShortTextField.d.ts.map +1 -1
  120. package/dist/components/core/form/fields/SolidShortTextField.js +3 -2
  121. package/dist/components/core/form/fields/SolidShortTextField.js.map +1 -1
  122. package/dist/components/core/form/fields/SolidShortTextField.tsx +11 -2
  123. package/dist/components/core/form/fields/SolidTimeField.d.ts.map +1 -1
  124. package/dist/components/core/form/fields/SolidTimeField.js +1 -1
  125. package/dist/components/core/form/fields/SolidTimeField.js.map +1 -1
  126. package/dist/components/core/form/fields/SolidTimeField.tsx +5 -3
  127. package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
  128. package/dist/components/core/kanban/KanbanCard.js +13 -2
  129. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  130. package/dist/components/core/kanban/KanbanCard.tsx +13 -2
  131. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  132. package/dist/components/core/kanban/SolidKanbanView.js +18 -11
  133. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  134. package/dist/components/core/kanban/SolidKanbanView.tsx +10 -6
  135. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  136. package/dist/components/core/list/SolidListView.js +49 -38
  137. package/dist/components/core/list/SolidListView.js.map +1 -1
  138. package/dist/components/core/list/SolidListView.tsx +20 -21
  139. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js +2 -2
  140. package/dist/components/core/list/columns/SolidMediaMultipleColumn.js.map +1 -1
  141. package/dist/components/core/list/columns/SolidMediaMultipleColumn.tsx +4 -4
  142. package/dist/components/core/list/columns/SolidMediaSingleColumn.js +1 -1
  143. package/dist/components/core/list/columns/SolidMediaSingleColumn.js.map +1 -1
  144. package/dist/components/core/list/columns/SolidMediaSingleColumn.tsx +3 -3
  145. package/dist/components/core/solid-agent/AgentContextPill.d.ts +9 -0
  146. package/dist/components/core/solid-agent/AgentContextPill.d.ts.map +1 -0
  147. package/dist/components/core/solid-agent/AgentContextPill.js +92 -0
  148. package/dist/components/core/solid-agent/AgentContextPill.js.map +1 -0
  149. package/dist/components/core/solid-agent/AgentContextPill.tsx +175 -0
  150. package/dist/components/core/solid-agent/AgentModelIndicator.d.ts +29 -3
  151. package/dist/components/core/solid-agent/AgentModelIndicator.d.ts.map +1 -1
  152. package/dist/components/core/solid-agent/AgentModelIndicator.js +279 -4
  153. package/dist/components/core/solid-agent/AgentModelIndicator.js.map +1 -1
  154. package/dist/components/core/solid-agent/AgentModelIndicator.tsx +546 -18
  155. package/dist/components/core/solid-agent/SolidAgent.module.css +1271 -128
  156. package/dist/components/core/solid-agent/SolidAgentChat.d.ts +6 -1
  157. package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -1
  158. package/dist/components/core/solid-agent/SolidAgentChat.js +693 -68
  159. package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -1
  160. package/dist/components/core/solid-agent/SolidAgentChat.tsx +832 -62
  161. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +4 -0
  162. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -1
  163. package/dist/components/core/solid-agent/SolidAgentEmbedded.js +19 -13
  164. package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -1
  165. package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +40 -12
  166. package/dist/components/core/solid-agent/SolidAgentHost.d.ts.map +1 -1
  167. package/dist/components/core/solid-agent/SolidAgentHost.js +84 -1
  168. package/dist/components/core/solid-agent/SolidAgentHost.js.map +1 -1
  169. package/dist/components/core/solid-agent/SolidAgentHost.tsx +75 -2
  170. package/dist/components/core/solid-agent/agentEvents.d.ts +4 -1
  171. package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -1
  172. package/dist/components/core/solid-agent/agentEvents.js +108 -27
  173. package/dist/components/core/solid-agent/agentEvents.js.map +1 -1
  174. package/dist/components/core/solid-agent/agentEvents.ts +105 -14
  175. package/dist/components/core/solid-agent/agentFormat.d.ts.map +1 -1
  176. package/dist/components/core/solid-agent/agentFormat.js +80 -9
  177. package/dist/components/core/solid-agent/agentFormat.js.map +1 -1
  178. package/dist/components/core/solid-agent/agentFormat.ts +85 -8
  179. package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts +88 -0
  180. package/dist/components/core/solid-agent/client/agentPublicEvents.d.ts.map +1 -0
  181. package/dist/components/core/solid-agent/client/agentPublicEvents.js +26 -0
  182. package/dist/components/core/solid-agent/client/agentPublicEvents.js.map +1 -0
  183. package/dist/components/core/solid-agent/client/agentPublicEvents.ts +66 -0
  184. package/dist/components/core/solid-agent/client/agentRest.d.ts +23 -2
  185. package/dist/components/core/solid-agent/client/agentRest.d.ts.map +1 -1
  186. package/dist/components/core/solid-agent/client/agentRest.js +223 -1
  187. package/dist/components/core/solid-agent/client/agentRest.js.map +1 -1
  188. package/dist/components/core/solid-agent/client/agentRest.ts +173 -5
  189. package/dist/components/core/solid-agent/client/agentRuntime.d.ts +38 -5
  190. package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -1
  191. package/dist/components/core/solid-agent/client/agentRuntime.js +400 -59
  192. package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -1
  193. package/dist/components/core/solid-agent/client/agentRuntime.ts +322 -32
  194. package/dist/components/core/solid-agent/client/agentSocket.d.ts +28 -6
  195. package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -1
  196. package/dist/components/core/solid-agent/client/agentSocket.js +206 -39
  197. package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -1
  198. package/dist/components/core/solid-agent/client/agentSocket.ts +153 -24
  199. package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts +9 -0
  200. package/dist/components/core/solid-agent/client/beforeUserMessageSend.d.ts.map +1 -0
  201. package/dist/components/core/solid-agent/client/beforeUserMessageSend.js +53 -0
  202. package/dist/components/core/solid-agent/client/beforeUserMessageSend.js.map +1 -0
  203. package/dist/components/core/solid-agent/client/beforeUserMessageSend.ts +26 -0
  204. package/dist/components/core/solid-agent/composer/AgentComposer.d.ts +3 -1
  205. package/dist/components/core/solid-agent/composer/AgentComposer.d.ts.map +1 -1
  206. package/dist/components/core/solid-agent/composer/AgentComposer.js +37 -21
  207. package/dist/components/core/solid-agent/composer/AgentComposer.js.map +1 -1
  208. package/dist/components/core/solid-agent/composer/AgentComposer.tsx +113 -71
  209. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.d.ts.map +1 -1
  210. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +4 -3
  211. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -1
  212. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +4 -2
  213. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +29 -0
  214. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -1
  215. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +45 -2
  216. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -1
  217. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +49 -2
  218. package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts +1 -0
  219. package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts.map +1 -1
  220. package/dist/components/core/solid-agent/embed/agentEmbedSamples.js +2 -1
  221. package/dist/components/core/solid-agent/embed/agentEmbedSamples.js.map +1 -1
  222. package/dist/components/core/solid-agent/embed/agentEmbedSamples.ts +15 -1
  223. package/dist/components/core/solid-agent/sdk/solidAgent.d.ts +4 -1
  224. package/dist/components/core/solid-agent/sdk/solidAgent.d.ts.map +1 -1
  225. package/dist/components/core/solid-agent/sdk/solidAgent.js.map +1 -1
  226. package/dist/components/core/solid-agent/sdk/solidAgent.ts +2 -2
  227. package/dist/components/core/solid-agent/thread/AgentThread.d.ts +2 -1
  228. package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -1
  229. package/dist/components/core/solid-agent/thread/AgentThread.js +46 -36
  230. package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -1
  231. package/dist/components/core/solid-agent/thread/AgentThread.tsx +65 -62
  232. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +2 -2
  233. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -1
  234. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +9 -3
  235. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -1
  236. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +12 -3
  237. package/dist/components/core/solid-agent/thread/inlineWidget.d.ts +15 -0
  238. package/dist/components/core/solid-agent/thread/inlineWidget.d.ts.map +1 -1
  239. package/dist/components/core/solid-agent/thread/inlineWidget.js +170 -19
  240. package/dist/components/core/solid-agent/thread/inlineWidget.js.map +1 -1
  241. package/dist/components/core/solid-agent/thread/inlineWidget.ts +164 -15
  242. package/dist/components/core/solid-agent/types.d.ts +86 -4
  243. package/dist/components/core/solid-agent/types.d.ts.map +1 -1
  244. package/dist/components/core/solid-agent/types.js +2 -0
  245. package/dist/components/core/solid-agent/types.js.map +1 -1
  246. package/dist/components/core/solid-agent/types.ts +76 -4
  247. package/dist/components/core/solid-agent/useAgentAvailability.d.ts +3 -1
  248. package/dist/components/core/solid-agent/useAgentAvailability.d.ts.map +1 -1
  249. package/dist/components/core/solid-agent/useAgentAvailability.js +16 -7
  250. package/dist/components/core/solid-agent/useAgentAvailability.js.map +1 -1
  251. package/dist/components/core/solid-agent/useAgentAvailability.ts +13 -6
  252. package/dist/components/core/solid-agent/useAgentChat.d.ts +1 -1
  253. package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -1
  254. package/dist/components/core/solid-agent/useAgentChat.js +7 -4
  255. package/dist/components/core/solid-agent/useAgentChat.js.map +1 -1
  256. package/dist/components/core/solid-agent/useAgentChat.ts +9 -5
  257. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts +1 -1
  258. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts.map +1 -1
  259. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +7 -38
  260. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -1
  261. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +8 -51
  262. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.d.ts.map +1 -1
  263. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +12 -4
  264. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -1
  265. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +18 -0
  266. package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts +4 -0
  267. package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.d.ts.map +1 -0
  268. package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js +30 -0
  269. package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.js.map +1 -0
  270. package/dist/components/core/solid-agent/widgets/SolidNavigationIntentChatWidget.tsx +41 -0
  271. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +2 -1
  272. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -1
  273. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +2 -2
  274. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.d.ts.map +1 -1
  275. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +3 -1
  276. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -1
  277. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +3 -2
  278. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts +1 -1
  279. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts.map +1 -1
  280. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +77 -10
  281. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -1
  282. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +96 -18
  283. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts.map +1 -1
  284. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +1 -2
  285. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -1
  286. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +1 -3
  287. package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +101 -76
  288. package/dist/components/core/solid-ai/SolidAiChat.d.ts.map +1 -1
  289. package/dist/components/core/solid-ai/SolidAiChat.js +2 -2
  290. package/dist/components/core/solid-ai/SolidAiChat.js.map +1 -1
  291. package/dist/components/core/solid-ai/SolidAiChat.tsx +12 -10
  292. package/dist/components/core/tree/SolidTreeView.d.ts.map +1 -1
  293. package/dist/components/core/tree/SolidTreeView.js +42 -44
  294. package/dist/components/core/tree/SolidTreeView.js.map +1 -1
  295. package/dist/components/core/tree/SolidTreeView.tsx +2 -20
  296. package/dist/components/layout/AdminTopHeader.d.ts.map +1 -1
  297. package/dist/components/layout/AdminTopHeader.js +20 -4
  298. package/dist/components/layout/AdminTopHeader.js.map +1 -1
  299. package/dist/components/layout/AdminTopHeader.tsx +19 -4
  300. package/dist/components/layout/user-profile-menu.d.ts.map +1 -1
  301. package/dist/components/layout/user-profile-menu.js +12 -8
  302. package/dist/components/layout/user-profile-menu.js.map +1 -1
  303. package/dist/components/layout/user-profile-menu.tsx +26 -7
  304. package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts +2 -1
  305. package/dist/components/shad-cn-ui/SolidCodeEditor.d.ts.map +1 -1
  306. package/dist/components/shad-cn-ui/SolidCodeEditor.js +3 -2
  307. package/dist/components/shad-cn-ui/SolidCodeEditor.js.map +1 -1
  308. package/dist/components/shad-cn-ui/SolidCodeEditor.tsx +3 -0
  309. package/dist/helpers/adminViewRefresh.d.ts +13 -0
  310. package/dist/helpers/adminViewRefresh.d.ts.map +1 -0
  311. package/dist/helpers/adminViewRefresh.js +14 -0
  312. package/dist/helpers/adminViewRefresh.js.map +1 -0
  313. package/dist/helpers/adminViewRefresh.ts +26 -0
  314. package/dist/helpers/eventBus.d.ts +1 -0
  315. package/dist/helpers/eventBus.d.ts.map +1 -1
  316. package/dist/helpers/eventBus.js +1 -0
  317. package/dist/helpers/eventBus.js.map +1 -1
  318. package/dist/helpers/eventBus.ts +1 -0
  319. package/dist/helpers/fileTypeIcon.d.ts.map +1 -1
  320. package/dist/helpers/fileTypeIcon.js +4 -1
  321. package/dist/helpers/fileTypeIcon.js.map +1 -1
  322. package/dist/helpers/fileTypeIcon.tsx +15 -0
  323. package/dist/helpers/registry.d.ts.map +1 -1
  324. package/dist/helpers/registry.js +8 -0
  325. package/dist/helpers/registry.js.map +1 -1
  326. package/dist/helpers/registry.ts +8 -0
  327. package/dist/helpers/routePaths.d.ts +16 -0
  328. package/dist/helpers/routePaths.d.ts.map +1 -1
  329. package/dist/helpers/routePaths.js +71 -0
  330. package/dist/helpers/routePaths.js.map +1 -1
  331. package/dist/helpers/routePaths.ts +75 -0
  332. package/dist/redux/api/solidEntityApi.d.ts +1 -1
  333. package/dist/redux/api/solidEntityApi.js +5 -2
  334. package/dist/redux/api/solidEntityApi.js.map +1 -1
  335. package/dist/redux/api/solidEntityApi.tsx +5 -2
  336. package/dist/redux/features/agentSlice.d.ts +3 -1
  337. package/dist/redux/features/agentSlice.d.ts.map +1 -1
  338. package/dist/redux/features/agentSlice.js +7 -3
  339. package/dist/redux/features/agentSlice.js.map +1 -1
  340. package/dist/redux/features/agentSlice.ts +17 -5
  341. package/dist/redux/store/StoreProvider.d.ts.map +1 -1
  342. package/dist/redux/store/StoreProvider.js +46 -5
  343. package/dist/redux/store/StoreProvider.js.map +1 -1
  344. package/dist/redux/store/StoreProvider.tsx +48 -5
  345. package/dist/redux/store/createSolidStore.d.ts +3 -1
  346. package/dist/redux/store/createSolidStore.d.ts.map +1 -1
  347. package/dist/redux/store/createSolidStore.js +2 -1
  348. package/dist/redux/store/createSolidStore.js.map +1 -1
  349. package/dist/redux/store/createSolidStore.ts +2 -1
  350. package/dist/resources/globals.css +31 -4
  351. package/dist/resources/solid-custom.css +136 -0
  352. package/dist/resources/solid-tailwind-generated.css +1 -1
  353. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.css +124 -0
  354. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.d.ts +3 -0
  355. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.d.ts.map +1 -0
  356. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js +144 -0
  357. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.js.map +1 -0
  358. package/dist/routes/pages/admin/core/AgentConfigComparisonPage.tsx +164 -0
  359. package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.d.ts +6 -0
  360. package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.d.ts.map +1 -0
  361. package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.js +52 -0
  362. package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.js.map +1 -0
  363. package/dist/routes/pages/admin/core/AgentConfigVersionsPanel.tsx +53 -0
  364. package/dist/routes/pages/admin/core/AgentHubModuleField.css +15 -0
  365. package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts +22 -0
  366. package/dist/routes/pages/admin/core/AgentHubModuleField.d.ts.map +1 -0
  367. package/dist/routes/pages/admin/core/AgentHubModuleField.js +42 -0
  368. package/dist/routes/pages/admin/core/AgentHubModuleField.js.map +1 -0
  369. package/dist/routes/pages/admin/core/AgentHubModuleField.tsx +54 -0
  370. package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts +3 -1
  371. package/dist/routes/pages/admin/core/AgentHubTagsField.d.ts.map +1 -1
  372. package/dist/routes/pages/admin/core/AgentHubTagsField.js +3 -3
  373. package/dist/routes/pages/admin/core/AgentHubTagsField.js.map +1 -1
  374. package/dist/routes/pages/admin/core/AgentHubTagsField.tsx +7 -3
  375. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.d.ts.map +1 -1
  376. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js +6 -2
  377. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js.map +1 -1
  378. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.tsx +5 -3
  379. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +23 -2
  380. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -1
  381. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +284 -135
  382. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -1
  383. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +179 -27
  384. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -1
  385. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +22 -15
  386. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -1
  387. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +17 -7
  388. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -1
  389. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +21 -15
  390. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -1
  391. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +16 -9
  392. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.d.ts.map +1 -1
  393. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js +149 -37
  394. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.js.map +1 -1
  395. package/dist/routes/pages/admin/core/ArchivedChatterMessagesPage.tsx +283 -73
  396. package/dist/routes/pages/admin/core/CardPage.d.ts.map +1 -1
  397. package/dist/routes/pages/admin/core/CardPage.js +9 -1
  398. package/dist/routes/pages/admin/core/CardPage.js.map +1 -1
  399. package/dist/routes/pages/admin/core/CardPage.tsx +9 -1
  400. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.css +361 -37
  401. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.d.ts.map +1 -1
  402. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js +1 -1
  403. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.js.map +1 -1
  404. package/dist/routes/pages/admin/core/DatasourceIntrospectionPage.tsx +2 -0
  405. package/dist/routes/pages/admin/core/KanbanPage.d.ts.map +1 -1
  406. package/dist/routes/pages/admin/core/KanbanPage.js +9 -1
  407. package/dist/routes/pages/admin/core/KanbanPage.js.map +1 -1
  408. package/dist/routes/pages/admin/core/KanbanPage.tsx +9 -1
  409. package/dist/routes/pages/admin/core/ListPage.d.ts.map +1 -1
  410. package/dist/routes/pages/admin/core/ListPage.js +10 -1
  411. package/dist/routes/pages/admin/core/ListPage.js.map +1 -1
  412. package/dist/routes/pages/admin/core/ListPage.tsx +10 -1
  413. package/dist/routes/pages/admin/core/TreePage.d.ts.map +1 -1
  414. package/dist/routes/pages/admin/core/TreePage.js +9 -1
  415. package/dist/routes/pages/admin/core/TreePage.js.map +1 -1
  416. package/dist/routes/pages/admin/core/TreePage.tsx +9 -1
  417. package/dist/routes/pages/admin/core/agentConfigComparison.d.ts +84 -0
  418. package/dist/routes/pages/admin/core/agentConfigComparison.d.ts.map +1 -0
  419. package/dist/routes/pages/admin/core/agentConfigComparison.js +75 -0
  420. package/dist/routes/pages/admin/core/agentConfigComparison.js.map +1 -0
  421. package/dist/routes/pages/admin/core/agentConfigComparison.ts +40 -0
  422. package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -1
  423. package/dist/routes/pages/embed/AgentEmbedPage.js +67 -4
  424. package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -1
  425. package/dist/routes/pages/embed/AgentEmbedPage.tsx +61 -4
  426. package/dist/routes/solidRoutes.d.ts.map +1 -1
  427. package/dist/routes/solidRoutes.js +2 -0
  428. package/dist/routes/solidRoutes.js.map +1 -1
  429. package/dist/routes/solidRoutes.tsx +2 -0
  430. package/package.json +1 -1
@@ -1,30 +1,181 @@
1
+ var WIDGET_NAME_KEY = "widgetName";
2
+ /**
3
+ * True while a streamed reply can still become a widget envelope. The agent
4
+ * protocol puts widgetName first, so this checks that key incrementally instead
5
+ * of treating every partial JSON object as a widget.
6
+ */
7
+ function isPendingWidgetEnvelope(content) {
8
+ var candidate = content.trimStart();
9
+ if (!candidate)
10
+ return false;
11
+ if (candidate.startsWith("```")) {
12
+ var newline = candidate.indexOf("\n");
13
+ if (newline === -1)
14
+ return "```json".startsWith(candidate.toLowerCase());
15
+ var fence = candidate.slice(0, newline).trim().toLowerCase();
16
+ if (fence !== "```" && fence !== "```json")
17
+ return false;
18
+ candidate = candidate.slice(newline + 1).trimStart();
19
+ }
20
+ if (!candidate.startsWith("{"))
21
+ return false;
22
+ var afterBrace = candidate.slice(1).trimStart();
23
+ if (!afterBrace)
24
+ return true;
25
+ if (!afterBrace.startsWith('"'))
26
+ return false;
27
+ var closingQuote = afterBrace.indexOf('"', 1);
28
+ if (closingQuote === -1) {
29
+ return WIDGET_NAME_KEY.startsWith(afterBrace.slice(1));
30
+ }
31
+ var firstKey = afterBrace.slice(1, closingQuote);
32
+ if (firstKey !== WIDGET_NAME_KEY)
33
+ return false;
34
+ var afterKey = afterBrace.slice(closingQuote + 1).trimStart();
35
+ return afterKey === "" || afterKey.startsWith(":");
36
+ }
1
37
  /** Returns the widget in a reply, or null when the reply is not that JSON (it then renders as text). */
2
38
  export function parseWidgetContent(content) {
3
39
  if (typeof content !== "string")
4
40
  return null;
5
- try {
6
- var parsed = JSON.parse(content);
7
- if (typeof (parsed === null || parsed === void 0 ? void 0 : parsed.widgetName) !== "string")
8
- return null;
9
- var data = parsed.data;
10
- if (typeof data === "string") {
11
- try {
12
- data = JSON.parse(data);
13
- }
14
- catch (_a) {
15
- // Assistant markdown envelopes carry the markdown itself as a string.
16
- if (parsed.widgetName === "markdown")
17
- data = { text: data };
18
- else
19
- return null;
41
+ var trimmed = content.trim();
42
+ if (!trimmed)
43
+ return null;
44
+ var candidate = trimmed;
45
+ // Strip markdown code fences if wrapped in ```json ... ``` or ``` ... ```
46
+ if (candidate.startsWith("```")) {
47
+ var lines = candidate.split("\n");
48
+ if (lines.length >= 2 && lines[lines.length - 1].trim().startsWith("```")) {
49
+ candidate = lines.slice(1, -1).join("\n").trim();
50
+ }
51
+ }
52
+ var parsed = null;
53
+ if (candidate.startsWith("{") && candidate.endsWith("}")) {
54
+ try {
55
+ parsed = JSON.parse(candidate);
56
+ }
57
+ catch (_a) {
58
+ // ignore
59
+ }
60
+ }
61
+ // If candidate wasn't a standalone JSON object, look for embedded {"widgetName" envelope
62
+ if (!parsed || typeof parsed !== "object" || typeof parsed.widgetName !== "string") {
63
+ var idx = candidate.indexOf('{"widgetName"');
64
+ if (idx !== -1) {
65
+ var depth = 0;
66
+ var inString = false;
67
+ var escape_1 = false;
68
+ for (var i = idx; i < candidate.length; i++) {
69
+ var ch = candidate[i];
70
+ if (escape_1) {
71
+ escape_1 = false;
72
+ continue;
73
+ }
74
+ if (ch === "\\" && inString) {
75
+ escape_1 = true;
76
+ continue;
77
+ }
78
+ if (ch === '"') {
79
+ inString = !inString;
80
+ continue;
81
+ }
82
+ if (!inString) {
83
+ if (ch === "{")
84
+ depth++;
85
+ else if (ch === "}") {
86
+ depth--;
87
+ if (depth === 0) {
88
+ try {
89
+ var candidateParsed = JSON.parse(candidate.slice(idx, i + 1));
90
+ if (candidateParsed && typeof candidateParsed === "object" && typeof candidateParsed.widgetName === "string") {
91
+ parsed = candidateParsed;
92
+ }
93
+ }
94
+ catch (_b) {
95
+ // ignore
96
+ }
97
+ break;
98
+ }
99
+ }
100
+ }
20
101
  }
21
102
  }
22
- if (!data || typeof data !== "object" || Array.isArray(data))
23
- return null;
24
- return { widget: parsed.widgetName, data: data };
25
103
  }
26
- catch (_b) {
104
+ if (!parsed || typeof parsed !== "object" || typeof parsed.widgetName !== "string") {
105
+ return null;
106
+ }
107
+ var widgetName = parsed.widgetName.trim().toLowerCase();
108
+ var data = parsed.data;
109
+ if (typeof data === "string") {
110
+ try {
111
+ data = JSON.parse(data);
112
+ }
113
+ catch (_c) {
114
+ // Assistant envelopes carry text or raw strings for specific widgets
115
+ if (widgetName === "markdown")
116
+ data = { text: data };
117
+ else if (widgetName === "code")
118
+ data = { code: data };
119
+ else if (widgetName === "json")
120
+ data = { json: data };
121
+ else
122
+ data = { text: data, raw: data };
123
+ }
124
+ }
125
+ // Support data being an array directly
126
+ if (Array.isArray(data)) {
127
+ if (widgetName === "table")
128
+ data = { rows: data };
129
+ else if (widgetName === "checklist" || widgetName === "progress")
130
+ data = { items: data };
131
+ else
132
+ data = { items: data, data: data };
133
+ }
134
+ if (!data || typeof data !== "object")
27
135
  return null;
136
+ return { widget: widgetName, data: data };
137
+ }
138
+ /** Classifies live assistant content without exposing an incomplete JSON envelope as text. */
139
+ export function classifyWidgetContent(content) {
140
+ var widget = parseWidgetContent(content);
141
+ if (widget)
142
+ return { state: "widget", value: widget };
143
+ if (typeof content === "string" && isPendingWidgetEnvelope(content))
144
+ return { state: "pending" };
145
+ return { state: "text" };
146
+ }
147
+ /**
148
+ * Compares two assistant text strings, accounting for JSON serialization / formatting differences
149
+ * and widget markdown envelopes so duplicate turn completions do not append repeated cards.
150
+ */
151
+ export function isSameAssistantContent(a, b) {
152
+ var _a, _b, _c, _d;
153
+ var trimA = (_a = a === null || a === void 0 ? void 0 : a.trim()) !== null && _a !== void 0 ? _a : "";
154
+ var trimB = (_b = b === null || b === void 0 ? void 0 : b.trim()) !== null && _b !== void 0 ? _b : "";
155
+ if (!trimA && !trimB)
156
+ return true;
157
+ if (!trimA || !trimB)
158
+ return false;
159
+ if (trimA === trimB)
160
+ return true;
161
+ var wa = parseWidgetContent(trimA);
162
+ var wb = parseWidgetContent(trimB);
163
+ if (wa && wb) {
164
+ if (wa.widget !== wb.widget)
165
+ return false;
166
+ try {
167
+ return JSON.stringify(wa.data) === JSON.stringify(wb.data);
168
+ }
169
+ catch (_e) {
170
+ return false;
171
+ }
172
+ }
173
+ if ((wa === null || wa === void 0 ? void 0 : wa.widget) === "markdown" && typeof ((_c = wa.data) === null || _c === void 0 ? void 0 : _c.text) === "string" && wa.data.text.trim() === trimB) {
174
+ return true;
175
+ }
176
+ if ((wb === null || wb === void 0 ? void 0 : wb.widget) === "markdown" && typeof ((_d = wb.data) === null || _d === void 0 ? void 0 : _d.text) === "string" && wb.data.text.trim() === trimA) {
177
+ return true;
28
178
  }
179
+ return false;
29
180
  }
30
181
  //# sourceMappingURL=inlineWidget.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"inlineWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/thread/inlineWidget.ts"],"names":[],"mappings":"AAGA,wGAAwG;AACxG,MAAM,UAAU,kBAAkB,CAAC,OAAgB;IAC/C,IAAI,OAAO,OAAO,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IAC7C,IAAI;QACA,IAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACnC,IAAI,OAAO,CAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,UAAU,CAAA,KAAK,QAAQ;YAAE,OAAO,IAAI,CAAC;QAExD,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC;QACvB,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;YAC1B,IAAI;gBACA,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;aAC3B;YAAC,WAAM;gBACJ,sEAAsE;gBACtE,IAAI,MAAM,CAAC,UAAU,KAAK,UAAU;oBAAE,IAAI,GAAG,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;;oBACvD,OAAO,IAAI,CAAC;aACpB;SACJ;QAED,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1E,OAAO,EAAE,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,IAAI,MAAA,EAAE,CAAC;KAC9C;IAAC,WAAM;QACJ,OAAO,IAAI,CAAC;KACf;AACL,CAAC","sourcesContent":["/** A widget the agent sent as its text reply: `{\"widgetName\": \"...\", \"data\": {...} | \"<json>\"}`. */\nexport type InlineChatWidget = { widget: string; data: Record<string, any> };\n\n/** Returns the widget in a reply, or null when the reply is not that JSON (it then renders as text). */\nexport function parseWidgetContent(content: unknown): InlineChatWidget | null {\n if (typeof content !== \"string\") return null;\n try {\n const parsed = JSON.parse(content);\n if (typeof parsed?.widgetName !== \"string\") return null;\n\n let data = parsed.data;\n if (typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch {\n // Assistant markdown envelopes carry the markdown itself as a string.\n if (parsed.widgetName === \"markdown\") data = { text: data };\n else return null;\n }\n }\n\n if (!data || typeof data !== \"object\" || Array.isArray(data)) return null;\n return { widget: parsed.widgetName, data };\n } catch {\n return null;\n }\n}\n"]}
1
+ {"version":3,"file":"inlineWidget.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/thread/inlineWidget.ts"],"names":[],"mappings":"AAOA,IAAM,eAAe,GAAG,YAAY,CAAC;AAErC;;;;GAIG;AACH,SAAS,uBAAuB,CAAC,OAAe;IAC5C,IAAI,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,CAAC;IACpC,IAAI,CAAC,SAAS;QAAE,OAAO,KAAK,CAAC;IAE7B,IAAI,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,EAAE;QAC7B,IAAM,OAAO,GAAG,SAAS,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;QACxC,IAAI,OAAO,KAAK,CAAC,CAAC;YAAE,OAAO,SAAS,CAAC,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC,CAAC;QACzE,IAAM,KAAK,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QAC/D,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,SAAS;YAAE,OAAO,KAAK,CAAC;QACzD,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,OAAO,GAAG,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;KACxD;IAED,IAAI,CAAC,SAAS,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC7C,IAAM,UAAU,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAAE,CAAC;IAClD,IAAI,CAAC,UAAU;QAAE,OAAO,IAAI,CAAC;IAC7B,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAE9C,IAAM,YAAY,GAAG,UAAU,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;IAChD,IAAI,YAAY,KAAK,CAAC,CA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E,CAAC,MAAM,KAAK,EAAE,CAAC,MAAM;YAAE,OAAO,KAAK,CAAC;QAC1C,IAAI;YACA,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,KAAK,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC;SAC9D;QAAC,WAAM;YACJ,OAAO,KAAK,CAAC;SAChB;KACJ;IACD,IAAI,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,MAAM,MAAK,UAAU,IAAI,OAAO,CAAA,MAAA,EAAE,CAAC,IAAI,0CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE;QACjG,OAAO,IAAI,CAAC;KACf;IACD,IAAI,CAAA,EAAE,aAAF,EAAE,uBAAF,EAAE,CAAE,MAAM,MAAK,UAAU,IAAI,OAAO,CAAA,MAAA,EAAE,CAAC,IAAI,0CAAE,IAAI,CAAA,KAAK,QAAQ,IAAI,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,KAAK,KAAK,EAAE;QACjG,OAAO,IAAI,CAAC;KACf;IACD,OAAO,KAAK,CAAC;AACjB,CAAC","sourcesContent":["/** A widget the agent sent as its text reply: `{\"widgetName\": \"...\", \"data\": {...} | \"<json>\"}`. */\nexport type InlineChatWidget = { widget: string; data: Record<string, any> };\nexport type InlineChatWidgetState =\n | { state: \"widget\"; value: InlineChatWidget }\n | { state: \"pending\" }\n | { state: \"text\" };\n\nconst WIDGET_NAME_KEY = \"widgetName\";\n\n/**\n * True while a streamed reply can still become a widget envelope. The agent\n * protocol puts widgetName first, so this checks that key incrementally instead\n * of treating every partial JSON object as a widget.\n */\nfunction isPendingWidgetEnvelope(content: string): boolean {\n let candidate = content.trimStart();\n if (!candidate) return false;\n\n if (candidate.startsWith(\"```\")) {\n const newline = candidate.indexOf(\"\\n\");\n if (newline === -1) return \"```json\".startsWith(candidate.toLowerCase());\n const fence = candidate.slice(0, newline).trim().toLowerCase();\n if (fence !== \"```\" && fence !== \"```json\") return false;\n candidate = candidate.slice(newline + 1).trimStart();\n }\n\n if (!candidate.startsWith(\"{\")) return false;\n const afterBrace = candidate.slice(1).trimStart();\n if (!afterBrace) return true;\n if (!afterBrace.startsWith('\"')) return false;\n\n const closingQuote = afterBrace.indexOf('\"', 1);\n if (closingQuote === -1) {\n return WIDGET_NAME_KEY.startsWith(afterBrace.slice(1));\n }\n\n const firstKey = afterBrace.slice(1, closingQuote);\n if (firstKey !== WIDGET_NAME_KEY) return false;\n\n const afterKey = afterBrace.slice(closingQuote + 1).trimStart();\n return afterKey === \"\" || afterKey.startsWith(\":\");\n}\n\n/** Returns the widget in a reply, or null when the reply is not that JSON (it then renders as text). */\nexport function parseWidgetContent(content: unknown): InlineChatWidget | null {\n if (typeof content !== \"string\") return null;\n const trimmed = content.trim();\n if (!trimmed) return null;\n\n let candidate = trimmed;\n // Strip markdown code fences if wrapped in ```json ... ``` or ``` ... ```\n if (candidate.startsWith(\"```\")) {\n const lines = candidate.split(\"\\n\");\n if (lines.length >= 2 && lines[lines.length - 1].trim().startsWith(\"```\")) {\n candidate = lines.slice(1, -1).join(\"\\n\").trim();\n }\n }\n\n let parsed: any = null;\n if (candidate.startsWith(\"{\") && candidate.endsWith(\"}\")) {\n try {\n parsed = JSON.parse(candidate);\n } catch {\n // ignore\n }\n }\n\n // If candidate wasn't a standalone JSON object, look for embedded {\"widgetName\" envelope\n if (!parsed || typeof parsed !== \"object\" || typeof parsed.widgetName !== \"string\") {\n const idx = candidate.indexOf('{\"widgetName\"');\n if (idx !== -1) {\n let depth = 0;\n let inString = false;\n let escape = false;\n for (let i = idx; i < candidate.length; i++) {\n const ch = candidate[i];\n if (escape) {\n escape = false;\n continue;\n }\n if (ch === \"\\\\\" && inString) {\n escape = true;\n continue;\n }\n if (ch === '\"') {\n inString = !inString;\n continue;\n }\n if (!inString) {\n if (ch === \"{\") depth++;\n else if (ch === \"}\") {\n depth--;\n if (depth === 0) {\n try {\n const candidateParsed = JSON.parse(candidate.slice(idx, i + 1));\n if (candidateParsed && typeof candidateParsed === \"object\" && typeof candidateParsed.widgetName === \"string\") {\n parsed = candidateParsed;\n }\n } catch {\n // ignore\n }\n break;\n }\n }\n }\n }\n }\n }\n\n if (!parsed || typeof parsed !== \"object\" || typeof parsed.widgetName !== \"string\") {\n return null;\n }\n\n const widgetName = parsed.widgetName.trim().toLowerCase();\n let data = parsed.data;\n\n if (typeof data === \"string\") {\n try {\n data = JSON.parse(data);\n } catch {\n // Assistant envelopes carry text or raw strings for specific widgets\n if (widgetName === \"markdown\") data = { text: data };\n else if (widgetName === \"code\") data = { code: data };\n else if (widgetName === \"json\") data = { json: data };\n else data = { text: data, raw: data };\n }\n }\n\n // Support data being an array directly\n if (Array.isArray(data)) {\n if (widgetName === \"table\") data = { rows: data };\n else if (widgetName === \"checklist\" || widgetName === \"progress\") data = { items: data };\n else data = { items: data, data };\n }\n\n if (!data || typeof data !== \"object\") return null;\n return { widget: widgetName, data };\n}\n\n/** Classifies live assistant content without exposing an incomplete JSON envelope as text. */\nexport function classifyWidgetContent(content: unknown): InlineChatWidgetState {\n const widget = parseWidgetContent(content);\n if (widget) return { state: \"widget\", value: widget };\n if (typeof content === \"string\" && isPendingWidgetEnvelope(content)) return { state: \"pending\" };\n return { state: \"text\" };\n}\n\n/**\n * Compares two assistant text strings, accounting for JSON serialization / formatting differences\n * and widget markdown envelopes so duplicate turn completions do not append repeated cards.\n */\nexport function isSameAssistantContent(a: string | undefined, b: string | undefined): boolean {\n const trimA = a?.trim() ?? \"\";\n const trimB = b?.trim() ?? \"\";\n if (!trimA && !trimB) return true;\n if (!trimA || !trimB) return false;\n if (trimA === trimB) return true;\n\n const wa = parseWidgetContent(trimA);\n const wb = parseWidgetContent(trimB);\n if (wa && wb) {\n if (wa.widget !== wb.widget) return false;\n try {\n return JSON.stringify(wa.data) === JSON.stringify(wb.data);\n } catch {\n return false;\n }\n }\n if (wa?.widget === \"markdown\" && typeof wa.data?.text === \"string\" && wa.data.text.trim() === trimB) {\n return true;\n }\n if (wb?.widget === \"markdown\" && typeof wb.data?.text === \"string\" && wb.data.text.trim() === trimA) {\n return true;\n }\n return false;\n}\n"]}
@@ -1,27 +1,176 @@
1
1
  /** A widget the agent sent as its text reply: `{"widgetName": "...", "data": {...} | "<json>"}`. */
2
2
  export type InlineChatWidget = { widget: string; data: Record<string, any> };
3
+ export type InlineChatWidgetState =
4
+ | { state: "widget"; value: InlineChatWidget }
5
+ | { state: "pending" }
6
+ | { state: "text" };
7
+
8
+ const WIDGET_NAME_KEY = "widgetName";
9
+
10
+ /**
11
+ * True while a streamed reply can still become a widget envelope. The agent
12
+ * protocol puts widgetName first, so this checks that key incrementally instead
13
+ * of treating every partial JSON object as a widget.
14
+ */
15
+ function isPendingWidgetEnvelope(content: string): boolean {
16
+ let candidate = content.trimStart();
17
+ if (!candidate) return false;
18
+
19
+ if (candidate.startsWith("```")) {
20
+ const newline = candidate.indexOf("\n");
21
+ if (newline === -1) return "```json".startsWith(candidate.toLowerCase());
22
+ const fence = candidate.slice(0, newline).trim().toLowerCase();
23
+ if (fence !== "```" && fence !== "```json") return false;
24
+ candidate = candidate.slice(newline + 1).trimStart();
25
+ }
26
+
27
+ if (!candidate.startsWith("{")) return false;
28
+ const afterBrace = candidate.slice(1).trimStart();
29
+ if (!afterBrace) return true;
30
+ if (!afterBrace.startsWith('"')) return false;
31
+
32
+ const closingQuote = afterBrace.indexOf('"', 1);
33
+ if (closingQuote === -1) {
34
+ return WIDGET_NAME_KEY.startsWith(afterBrace.slice(1));
35
+ }
36
+
37
+ const firstKey = afterBrace.slice(1, closingQuote);
38
+ if (firstKey !== WIDGET_NAME_KEY) return false;
39
+
40
+ const afterKey = afterBrace.slice(closingQuote + 1).trimStart();
41
+ return afterKey === "" || afterKey.startsWith(":");
42
+ }
3
43
 
4
44
  /** Returns the widget in a reply, or null when the reply is not that JSON (it then renders as text). */
5
45
  export function parseWidgetContent(content: unknown): InlineChatWidget | null {
6
46
  if (typeof content !== "string") return null;
7
- try {
8
- const parsed = JSON.parse(content);
9
- if (typeof parsed?.widgetName !== "string") return null;
10
-
11
- let data = parsed.data;
12
- if (typeof data === "string") {
13
- try {
14
- data = JSON.parse(data);
15
- } catch {
16
- // Assistant markdown envelopes carry the markdown itself as a string.
17
- if (parsed.widgetName === "markdown") data = { text: data };
18
- else return null;
47
+ const trimmed = content.trim();
48
+ if (!trimmed) return null;
49
+
50
+ let candidate = trimmed;
51
+ // Strip markdown code fences if wrapped in ```json ... ``` or ``` ... ```
52
+ if (candidate.startsWith("```")) {
53
+ const lines = candidate.split("\n");
54
+ if (lines.length >= 2 && lines[lines.length - 1].trim().startsWith("```")) {
55
+ candidate = lines.slice(1, -1).join("\n").trim();
56
+ }
57
+ }
58
+
59
+ let parsed: any = null;
60
+ if (candidate.startsWith("{") && candidate.endsWith("}")) {
61
+ try {
62
+ parsed = JSON.parse(candidate);
63
+ } catch {
64
+ // ignore
65
+ }
66
+ }
67
+
68
+ // If candidate wasn't a standalone JSON object, look for embedded {"widgetName" envelope
69
+ if (!parsed || typeof parsed !== "object" || typeof parsed.widgetName !== "string") {
70
+ const idx = candidate.indexOf('{"widgetName"');
71
+ if (idx !== -1) {
72
+ let depth = 0;
73
+ let inString = false;
74
+ let escape = false;
75
+ for (let i = idx; i < candidate.length; i++) {
76
+ const ch = candidate[i];
77
+ if (escape) {
78
+ escape = false;
79
+ continue;
80
+ }
81
+ if (ch === "\\" && inString) {
82
+ escape = true;
83
+ continue;
84
+ }
85
+ if (ch === '"') {
86
+ inString = !inString;
87
+ continue;
88
+ }
89
+ if (!inString) {
90
+ if (ch === "{") depth++;
91
+ else if (ch === "}") {
92
+ depth--;
93
+ if (depth === 0) {
94
+ try {
95
+ const candidateParsed = JSON.parse(candidate.slice(idx, i + 1));
96
+ if (candidateParsed && typeof candidateParsed === "object" && typeof candidateParsed.widgetName === "string") {
97
+ parsed = candidateParsed;
98
+ }
99
+ } catch {
100
+ // ignore
101
+ }
102
+ break;
103
+ }
104
+ }
105
+ }
19
106
  }
20
107
  }
108
+ }
21
109
 
22
- if (!data || typeof data !== "object" || Array.isArray(data)) return null;
23
- return { widget: parsed.widgetName, data };
24
- } catch {
110
+ if (!parsed || typeof parsed !== "object" || typeof parsed.widgetName !== "string") {
25
111
  return null;
26
112
  }
113
+
114
+ const widgetName = parsed.widgetName.trim().toLowerCase();
115
+ let data = parsed.data;
116
+
117
+ if (typeof data === "string") {
118
+ try {
119
+ data = JSON.parse(data);
120
+ } catch {
121
+ // Assistant envelopes carry text or raw strings for specific widgets
122
+ if (widgetName === "markdown") data = { text: data };
123
+ else if (widgetName === "code") data = { code: data };
124
+ else if (widgetName === "json") data = { json: data };
125
+ else data = { text: data, raw: data };
126
+ }
127
+ }
128
+
129
+ // Support data being an array directly
130
+ if (Array.isArray(data)) {
131
+ if (widgetName === "table") data = { rows: data };
132
+ else if (widgetName === "checklist" || widgetName === "progress") data = { items: data };
133
+ else data = { items: data, data };
134
+ }
135
+
136
+ if (!data || typeof data !== "object") return null;
137
+ return { widget: widgetName, data };
138
+ }
139
+
140
+ /** Classifies live assistant content without exposing an incomplete JSON envelope as text. */
141
+ export function classifyWidgetContent(content: unknown): InlineChatWidgetState {
142
+ const widget = parseWidgetContent(content);
143
+ if (widget) return { state: "widget", value: widget };
144
+ if (typeof content === "string" && isPendingWidgetEnvelope(content)) return { state: "pending" };
145
+ return { state: "text" };
146
+ }
147
+
148
+ /**
149
+ * Compares two assistant text strings, accounting for JSON serialization / formatting differences
150
+ * and widget markdown envelopes so duplicate turn completions do not append repeated cards.
151
+ */
152
+ export function isSameAssistantContent(a: string | undefined, b: string | undefined): boolean {
153
+ const trimA = a?.trim() ?? "";
154
+ const trimB = b?.trim() ?? "";
155
+ if (!trimA && !trimB) return true;
156
+ if (!trimA || !trimB) return false;
157
+ if (trimA === trimB) return true;
158
+
159
+ const wa = parseWidgetContent(trimA);
160
+ const wb = parseWidgetContent(trimB);
161
+ if (wa && wb) {
162
+ if (wa.widget !== wb.widget) return false;
163
+ try {
164
+ return JSON.stringify(wa.data) === JSON.stringify(wb.data);
165
+ } catch {
166
+ return false;
167
+ }
168
+ }
169
+ if (wa?.widget === "markdown" && typeof wa.data?.text === "string" && wa.data.text.trim() === trimB) {
170
+ return true;
171
+ }
172
+ if (wb?.widget === "markdown" && typeof wb.data?.text === "string" && wb.data.text.trim() === trimA) {
173
+ return true;
174
+ }
175
+ return false;
27
176
  }
@@ -16,6 +16,17 @@ export type AgentContext = {
16
16
  route?: string;
17
17
  [key: string]: unknown;
18
18
  };
19
+ export type AgentJson = null | boolean | number | string | AgentJson[] | {
20
+ [key: string]: AgentJson;
21
+ };
22
+ export type AgentMessageContext = {
23
+ schemaVersion: 1;
24
+ namespaces: Record<string, {
25
+ context: AgentJson;
26
+ revision: string;
27
+ displaySummary?: string;
28
+ }>;
29
+ };
19
30
  export type AgentMode = "bubble" | "compact" | "docked" | "maximized";
20
31
  /**
21
32
  * Which agent backend a chat talks to: "solidx" (setting solidxAgentBackendUrl; the floating
@@ -32,7 +43,54 @@ export type AgentModelAssignments = {
32
43
  };
33
44
  /** @deprecated Use AgentRuntimeType. */
34
45
  export type AgentType = AgentRuntimeType;
46
+ export interface AgentProviderInfo {
47
+ id: string;
48
+ name: string;
49
+ installed: boolean;
50
+ version?: string;
51
+ default_model?: string;
52
+ }
53
+ export interface ReasoningEffortInfo {
54
+ id: string;
55
+ name: string;
56
+ description?: string;
57
+ }
58
+ export interface SpeedTierInfo {
59
+ id: string;
60
+ name: string;
61
+ description?: string;
62
+ }
63
+ export interface ProviderModelInfo {
64
+ id: string;
65
+ name: string;
66
+ is_default?: boolean;
67
+ description?: string;
68
+ supports_vision?: boolean;
69
+ supports_image?: boolean;
70
+ supports_images?: boolean;
71
+ capabilities?: {
72
+ input?: {
73
+ image?: boolean;
74
+ [key: string]: any;
75
+ };
76
+ [key: string]: any;
77
+ };
78
+ reasoning_efforts?: ReasoningEffortInfo[];
79
+ default_reasoning?: string;
80
+ supports_thinking?: boolean;
81
+ speed_tiers?: SpeedTierInfo[];
82
+ default_speed?: string;
83
+ supports_fast?: boolean;
84
+ }
35
85
  export type AgentConnection = "idle" | "connecting" | "open" | "reconnecting" | "offline";
86
+ export interface AgentUsageStats {
87
+ totalCost: number;
88
+ totalInputTokens: number;
89
+ totalOutputTokens: number;
90
+ totalTokens: number;
91
+ contextTokens: number;
92
+ contextLimit: number;
93
+ }
36
94
  /** A slash command advertised by the agent in `session_started`. */
37
95
  export type AgentCommand = {
38
96
  name: string;
@@ -59,8 +117,10 @@ export type AgentChatEvent = {
59
117
  export declare const AgentEventTypes: {
60
118
  readonly sessionStarted: "session_started";
61
119
  readonly sessionEnded: "session_ended";
120
+ readonly sessionUpdated: "session_updated";
62
121
  readonly userMessage: "UserMessage";
63
122
  readonly agentStarted: "AgentStarted";
123
+ readonly agentThinking: "AgentThinking";
64
124
  readonly stepStarted: "StepStarted";
65
125
  readonly stepComplete: "StepComplete";
66
126
  readonly llmToken: "LlmToken";
@@ -110,22 +170,44 @@ export type AgentUploadedAttachment = {
110
170
  mimeType: string;
111
171
  size: number;
112
172
  };
113
- export type AgentAction = {
173
+ export type AgentSessionOptions = {
174
+ thinking?: boolean;
175
+ fast?: boolean;
176
+ reasoning?: string;
177
+ speed?: string;
178
+ };
179
+ export type AgentAction = ({
114
180
  action: "start_session";
115
181
  widget_catalog?: AgentChatWidgetMetadata[];
116
- } | {
182
+ provider?: string;
183
+ model?: string;
184
+ runtime?: AgentRuntimeType;
185
+ } & AgentSessionOptions) | ({
117
186
  action: "resume_session";
118
187
  session_id: string;
119
188
  widget_catalog?: AgentChatWidgetMetadata[];
120
- } | {
189
+ provider?: string;
190
+ model?: string;
191
+ runtime?: AgentRuntimeType;
192
+ } & AgentSessionOptions) | ({
193
+ action: "update_session";
194
+ session_id: string;
195
+ provider?: string;
196
+ model?: string;
197
+ runtime?: AgentRuntimeType;
198
+ } & AgentSessionOptions) | ({
121
199
  action: "message";
122
200
  session_id: string;
123
201
  content: string;
202
+ source?: "composer" | "sdk" | "prefill" | "widget";
124
203
  context?: AgentContext;
204
+ message_context?: AgentMessageContext;
125
205
  inputs?: Record<string, unknown>;
126
206
  widget_reply?: WidgetReply | null;
127
207
  attachments?: AgentAttachmentPayload[] | AgentUploadedAttachment[];
128
- } | {
208
+ provider?: string;
209
+ model?: string;
210
+ } & AgentSessionOptions) | {
129
211
  action: "cancel";
130
212
  session_id: string;
131
213
  } | {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/core/solid-agent/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,mCAAmC,CAAC;AAEjF;;;;;;;;GAQG;AAEH,8EAA8E;AAC9E,MAAM,MAAM,YAAY,GAAG;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEtE;;;GAGG;AACH,MAAM,MAAM,gBAAgB,GAAG,QAAQ,GAAG,UAAU,CAAC;AACrD,MAAM,MAAM,oBAAoB,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAAC;AAC9E,MAAM,MAAM,qBAAqB,GAAG;IAAE,SAAS,EAAE,oBAAoB,CAAC;IAAC,IAAI,EAAE,oBAAoB,CAAA;CAAE,CAAC;AACpG,wCAAwC;AACxC,MAAM,MAAM,SAAS,GAAG,gBAAgB,CAAC;AAEzC,MAAM,MAAM,e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,CAAC;IACvB,eAAe,CAAC,EAAE,mBAAmB,CAAC;IACtC,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,YAAY,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAClC,WAAW,CAAC,EAAE,sBAAsB,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,GAAG,mBAAmB,CAAC,GACxB;IAAE,MAAM,EAAE,QAAQ,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,GACxC;IAAE,MAAM,EAAE,aAAa,CAAC;IAAC,UAAU,EAAE,MAAM,CAAA;CAAE,CAAC;AAIpD;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,EAAE,EAAE,MAAM,CAAC;IACX,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC/B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yEAAyE;IACzE,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,yDAAyD;IACzD,KAAK,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,qCAAqC;AACrC,MAAM,MAAM,qBAAqB,GAAG;IAChC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,IAAI,CAAC,EAAE,OAAO,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAC;CACvC,CAAC"}
@@ -2,8 +2,10 @@
2
2
  export var AgentEventTypes = {
3
3
  sessionStarted: "session_started",
4
4
  sessionEnded: "session_ended",
5
+ sessionUpdated: "session_updated",
5
6
  userMessage: "UserMessage",
6
7
  agentStarted: "AgentStarted",
8
+ agentThinking: "AgentThinking",
7
9
  stepStarted: "StepStarted",
8
10
  stepComplete: "StepComplete",
9
11
  llmToken: "LlmToken",
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/core/solid-agent/types.ts"],"names":[],"mappings":"AA2DA,4GAA4G;AAC5G,MAAM,CAAC,IAAM,eAAe,GAAG;IAC3B,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;IAC7B,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,mBAAmB;IACjC,kBAAkB,EAAE,eAAe;IACnC,aAAa,EAAE,eAAe;IAC9B,kBAAkB,EAAE,oBAAoB;IACxC,wBAAwB,EAAE,qBAAqB;IAC/C,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["import type { AgentChatWidgetMetadata } from \"../../../types/extension-registry\";\n\n/**\n * Shared types for the SolidX Agent chat (launcher, window, thread).\n *\n * Wire format: every agent payload carries `event_type` and `event_data`. When\n * `event_data.widget` names a registered chat widget, that widget renders the event;\n * otherwise the event is rendered by the default widget for its `event_type`.\n * (Legacy frames `{ type, data }` are normalised to the same shape.)\n * The widget contract itself (SolidChatWidgetProps) lives in types/solid-core.d.ts.\n */\n\n/** Page context passed with a prompt so the agent knows where the user is. */\nexport type AgentContext = {\n module?: string;\n model?: string;\n recordId?: string | number;\n route?: string;\n [key: string]: unknown;\n};\n\nexport type AgentMode = \"bubble\" | \"compact\" | \"docked\" | \"maximized\";\n\n/**\n * Which agent backend a chat talks to: \"solidx\" (setting solidxAgentBackendUrl; the floating\n * launcher) or \"agentHub\" (setting solidxAgentHubBackendUrl).\n */\nexport type AgentRuntimeType = \"solidx\" | \"agentHub\";\nexport type AgentModelAssignment = { provider: string; model: string } | null;\nexport type AgentModelAssignments = { reasoning: AgentModelAssignment; fast: AgentModelAssignment };\n/** @deprecated Use AgentRuntimeType. */\nexport type AgentType = AgentRuntimeType;\n\nexport type AgentConnection = \"idle\" | \"connecting\" | \"open\" | \"reconnecting\" | \"offline\";\n\n/** A slash command advertised by the agent in `session_started`. */\nexport type AgentCommand = { name: string; description?: string };\n\n// ── Inbound ───────────────────────────────────────────────────────────────────\n\n/** A frame as it arrives on the socket or from session history (before normalisation). */\nexport type AgentWireFrame = {\n event_type?: string;\n event_data?: Record<string, any>;\n type?: string;\n data?: Record<string, any>;\n session_id?: string;\n history_session_id?: string;\n [key: string]: any;\n};\n\n/** The normalised event every reducer and widget works with. */\nexport type AgentChatEvent = {\n eventType: string;\n eventData: Record<string, any>;\n /** Top-level fields of the frame (session_id, history_session_id, commands, ...). */\n frame: AgentWireFrame;\n};\n\n/** Event types the chat knows by name. Anything else is still rendered (via its widget or the fallback). */\nexport const AgentEventTypes = {\n sessionStarted: \"session_started\",\n sessionEnded: \"session_ended\",\n userMessage: \"UserMessage\",\n agentStarted: \"AgentStarted\",\n stepStarted: \"StepStarted\",\n stepComplete: \"StepComplete\",\n llmToken: \"LlmToken\",\n llmComplete: \"LlmComplete\",\n toolCalling: \"ToolCalling\",\n toolProgress: \"ToolProgress\",\n toolResult: \"ToolResult\",\n turnComplete: \"TurnCompleteEvent\",\n turnCompleteLegacy: \"turn_complete\",\n agentComplete: \"AgentComplete\",\n executionCancelled: \"ExecutionCancelled\",\n executionCancelledLegacy: \"execution_cancelled\",\n agentError: \"AgentError\",\n error: \"error\",\n} as const;\n\n// ── Outbound ──────────────────────────────────────────────────────────────────\n\nexport type WidgetReply = { widgetId: string; value: unknown };\n\n/** A file sent inline with a message: text files as text, images base64-encoded (no data: prefix). */\nexport type AgentAttachmentPayload = {\n name: string;\n mimeType: string;\n size: number;\n encoding: \"text\" | \"base64\";\n content: string;\n};\n\n/** What the thread shows for an attachment (history only has name/type/size). */\nexport type AgentAttachmentMeta = {\n mediaId?: number;\n name: string;\n mimeType: string;\n size: number;\n /** data: URL for image thumbnails of files attached in this browser session. */\n previewUrl?: string;\n /** Stored copy in Solid media storage (resolved when a conversation is reopened). */\n url?: string;\n};\n\nexport type AgentAttachment = { payload: AgentAttachmentPayload; meta: AgentAttachmentMeta; file: File };\nexport type AgentUploadedAttachment = { id: number; name: string; mimeType: string; size: number };\n\nexport type AgentAction =\n | { action: \"start_session\"; widget_catalog?: AgentChatWidgetMetadata[] }\n | { action: \"resume_session\"; session_id: string; widget_catalog?: AgentChatWidgetMetadata[] }\n | {\n action: \"message\";\n session_id: string;\n content: string;\n context?: AgentContext;\n inputs?: Record<string, unknown>;\n widget_reply?: WidgetReply | null;\n attachments?: AgentAttachmentPayload[] | AgentUploadedAttachment[];\n }\n | { action: \"cancel\"; session_id: string }\n | { action: \"end_session\"; session_id: string };\n\n// ── Thread items ──────────────────────────────────────────────────────────────\n\n/**\n * One rendered entry in the thread. `eventData` is the (accumulated) event payload handed to\n * the widget; `widget` is set when the agent named one, otherwise the default for `eventType`.\n */\nexport type AgentChatItem = {\n id: string;\n at: number;\n eventType: string;\n eventData: Record<string, any>;\n widget?: string;\n widgetId?: string;\n /** Live items (a running tool, a streaming reply) are still updating. */\n live?: boolean;\n /** A final widget accepts no more updates or replies. */\n final?: boolean;\n};\n\n/** Options for `solidAgent.open`. */\nexport type SolidAgentOpenOptions = {\n prompt?: string;\n autoSend?: boolean;\n context?: AgentContext;\n mode?: Exclude<AgentMode, \"bubble\">;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../src/components/core/solid-agent/types.ts"],"names":[],"mappings":"AAqHA,4GAA4G;AAC5G,MAAM,CAAC,IAAM,eAAe,GAAG;IAC3B,cAAc,EAAE,iBAAiB;IACjC,YAAY,EAAE,eAAe;IAC7B,cAAc,EAAE,iBAAiB;IACjC,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,aAAa,EAAE,eAAe;IAC9B,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,YAAY,EAAE,cAAc;IAC5B,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,mBAAmB;IACjC,kBAAkB,EAAE,eAAe;IACnC,aAAa,EAAE,eAAe;IAC9B,kBAAkB,EAAE,oBAAoB;IACxC,wBAAwB,EAAE,qBAAqB;IAC/C,UAAU,EAAE,YAAY;IACxB,KAAK,EAAE,OAAO;CACR,CAAC","sourcesContent":["import type { AgentChatWidgetMetadata } from \"../../../types/extension-registry\";\n\n/**\n * Shared types for the SolidX Agent chat (launcher, window, thread).\n *\n * Wire format: every agent payload carries `event_type` and `event_data`. When\n * `event_data.widget` names a registered chat widget, that widget renders the event;\n * otherwise the event is rendered by the default widget for its `event_type`.\n * (Legacy frames `{ type, data }` are normalised to the same shape.)\n * The widget contract itself (SolidChatWidgetProps) lives in types/solid-core.d.ts.\n */\n\n/** Page context passed with a prompt so the agent knows where the user is. */\nexport type AgentContext = {\n module?: string;\n model?: string;\n recordId?: string | number;\n route?: string;\n [key: string]: unknown;\n};\n\nexport type AgentJson = null | boolean | number | string | AgentJson[] | { [key: string]: AgentJson };\nexport type AgentMessageContext = {\n schemaVersion: 1;\n namespaces: Record<string, { context: AgentJson; revision: string; displaySummary?: string }>;\n};\n\nexport type AgentMode = \"bubble\" | \"compact\" | \"docked\" | \"maximized\";\n\n/**\n * Which agent backend a chat talks to: \"solidx\" (setting solidxAgentBackendUrl; the floating\n * launcher) or \"agentHub\" (setting solidxAgentHubBackendUrl).\n */\nexport type AgentRuntimeType = \"solidx\" | \"agentHub\";\nexport type AgentModelAssignment = { provider: string; model: string } | null;\nexport type AgentModelAssignments = { reasoning: AgentModelAssignment; fast: AgentModelAssignment };\n/** @deprecated Use AgentRuntimeType. */\nexport type AgentType = AgentRuntimeType;\n\nexport interface AgentProviderInfo {\n id: string;\n name: string;\n installed: boolean;\n version?: string;\n default_model?: string;\n}\n\nexport interface ReasoningEffortInfo {\n id: string;\n name: string;\n description?: string;\n}\n\nexport interface SpeedTierInfo {\n id: string;\n name: string;\n description?: string;\n}\n\nexport interface ProviderModelInfo {\n id: string;\n name: string;\n is_default?: boolean;\n description?: string;\n supports_vision?: boolean;\n supports_image?: boolean;\n supports_images?: boolean;\n capabilities?: {\n input?: {\n image?: boolean;\n [key: string]: any;\n };\n [key: string]: any;\n };\n reasoning_efforts?: ReasoningEffortInfo[];\n default_reasoning?: string;\n supports_thinking?: boolean;\n speed_tiers?: SpeedTierInfo[];\n default_speed?: string;\n supports_fast?: boolean;\n}\n\nexport type AgentConnection = \"idle\" | \"connecting\" | \"open\" | \"reconnecting\" | \"offline\";\n\nexport interface AgentUsageStats {\n totalCost: number;\n totalInputTokens: number;\n totalOutputTokens: number;\n totalTokens: number;\n contextTokens: number;\n contextLimit: number;\n}\n\n/** A slash command advertised by the agent in `session_started`. */\nexport type AgentCommand = { name: string; description?: string };\n\n// ── Inbound ───────────────────────────────────────────────────────────────────\n\n/** A frame as it arrives on the socket or from session history (before normalisation). */\nexport type AgentWireFrame = {\n event_type?: string;\n event_data?: Record<string, any>;\n type?: string;\n data?: Record<string, any>;\n session_id?: string;\n history_session_id?: string;\n [key: string]: any;\n};\n\n/** The normalised event every reducer and widget works with. */\nexport type AgentChatEvent = {\n eventType: string;\n eventData: Record<string, any>;\n /** Top-level fields of the frame (session_id, history_session_id, commands, ...). */\n frame: AgentWireFrame;\n};\n\n/** Event types the chat knows by name. Anything else is still rendered (via its widget or the fallback). */\nexport const AgentEventTypes = {\n sessionStarted: \"session_started\",\n sessionEnded: \"session_ended\",\n sessionUpdated: \"session_updated\",\n userMessage: \"UserMessage\",\n agentStarted: \"AgentStarted\",\n agentThinking: \"AgentThinking\",\n stepStarted: \"StepStarted\",\n stepComplete: \"StepComplete\",\n llmToken: \"LlmToken\",\n llmComplete: \"LlmComplete\",\n toolCalling: \"ToolCalling\",\n toolProgress: \"ToolProgress\",\n toolResult: \"ToolResult\",\n turnComplete: \"TurnCompleteEvent\",\n turnCompleteLegacy: \"turn_complete\",\n agentComplete: \"AgentComplete\",\n executionCancelled: \"ExecutionCancelled\",\n executionCancelledLegacy: \"execution_cancelled\",\n agentError: \"AgentError\",\n error: \"error\",\n} as const;\n\n// ── Outbound ──────────────────────────────────────────────────────────────────\n\nexport type WidgetReply = { widgetId: string; value: unknown };\n\n/** A file sent inline with a message: text files as text, images base64-encoded (no data: prefix). */\nexport type AgentAttachmentPayload = {\n name: string;\n mimeType: string;\n size: number;\n encoding: \"text\" | \"base64\";\n content: string;\n};\n\n/** What the thread shows for an attachment (history only has name/type/size). */\nexport type AgentAttachmentMeta = {\n mediaId?: number;\n name: string;\n mimeType: string;\n size: number;\n /** data: URL for image thumbnails of files attached in this browser session. */\n previewUrl?: string;\n /** Stored copy in Solid media storage (resolved when a conversation is reopened). */\n url?: string;\n};\n\nexport type AgentAttachment = { payload: AgentAttachmentPayload; meta: AgentAttachmentMeta; file: File };\nexport type AgentUploadedAttachment = { id: number; name: string; mimeType: string; size: number };\n\nexport type AgentSessionOptions = {\n thinking?: boolean;\n fast?: boolean;\n reasoning?: string;\n speed?: string;\n};\n\nexport type AgentAction =\n | ({ action: \"start_session\"; widget_catalog?: AgentChatWidgetMetadata[]; provider?: string; model?: string; runtime?: AgentRuntimeType } & AgentSessionOptions)\n | ({ action: \"resume_session\"; session_id: string; widget_catalog?: AgentChatWidgetMetadata[]; provider?: string; model?: string; runtime?: AgentRuntimeType } & AgentSessionOptions)\n | ({ action: \"update_session\"; session_id: string; provider?: string; model?: string; runtime?: AgentRuntimeType } & AgentSessionOptions)\n | ({\n action: \"message\";\n session_id: string;\n content: string;\n source?: \"composer\" | \"sdk\" | \"prefill\" | \"widget\";\n context?: AgentContext;\n message_context?: AgentMessageContext;\n inputs?: Record<string, unknown>;\n widget_reply?: WidgetReply | null;\n attachments?: AgentAttachmentPayload[] | AgentUploadedAttachment[];\n provider?: string;\n model?: string;\n } & AgentSessionOptions)\n | { action: \"cancel\"; session_id: string }\n | { action: \"end_session\"; session_id: string };\n\n// ── Thread items ──────────────────────────────────────────────────────────────\n\n/**\n * One rendered entry in the thread. `eventData` is the (accumulated) event payload handed to\n * the widget; `widget` is set when the agent named one, otherwise the default for `eventType`.\n */\nexport type AgentChatItem = {\n id: string;\n at: number;\n eventType: string;\n eventData: Record<string, any>;\n widget?: string;\n widgetId?: string;\n /** Live items (a running tool, a streaming reply) are still updating. */\n live?: boolean;\n /** A final widget accepts no more updates or replies. */\n final?: boolean;\n};\n\n/** Options for `solidAgent.open`. */\nexport type SolidAgentOpenOptions = {\n prompt?: string;\n autoSend?: boolean;\n context?: AgentContext;\n mode?: Exclude<AgentMode, \"bubble\">;\n};\n"]}