@solidxai/core-ui 0.1.19-beta.0 → 0.1.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (512) hide show
  1. package/README.md +19 -0
  2. package/dist/components/common/SolidPopupContainer.d.ts.map +1 -1
  3. package/dist/components/common/SolidPopupContainer.js +3 -2
  4. package/dist/components/common/SolidPopupContainer.js.map +1 -1
  5. package/dist/components/common/SolidPopupContainer.tsx +3 -2
  6. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.d.ts.map +1 -1
  7. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js +4 -1
  8. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.js.map +1 -1
  9. package/dist/components/common/SolidSettings/LlmSettings/AiModelConfigTab.tsx +11 -5
  10. package/dist/components/core/chatter/SolidChatter.d.ts.map +1 -1
  11. package/dist/components/core/chatter/SolidChatter.js +2 -1
  12. package/dist/components/core/chatter/SolidChatter.js.map +1 -1
  13. package/dist/components/core/chatter/SolidChatter.tsx +2 -0
  14. package/dist/components/core/chatter/SolidChatterMessageBox.d.ts +2 -0
  15. package/dist/components/core/chatter/SolidChatterMessageBox.d.ts.map +1 -1
  16. package/dist/components/core/chatter/SolidChatterMessageBox.js +7 -4
  17. package/dist/components/core/chatter/SolidChatterMessageBox.js.map +1 -1
  18. package/dist/components/core/chatter/SolidChatterMessageBox.tsx +8 -3
  19. package/dist/components/core/chatter/SolidChatterMessageWidget.d.ts +5 -0
  20. package/dist/components/core/chatter/SolidChatterMessageWidget.d.ts.map +1 -0
  21. package/dist/components/core/chatter/SolidChatterMessageWidget.js +85 -0
  22. package/dist/components/core/chatter/SolidChatterMessageWidget.js.map +1 -0
  23. package/dist/components/core/chatter/SolidChatterMessageWidget.tsx +59 -0
  24. package/dist/components/core/common/SolidGlobalSearchElement.d.ts.map +1 -1
  25. package/dist/components/core/common/SolidGlobalSearchElement.js +6 -5
  26. package/dist/components/core/common/SolidGlobalSearchElement.js.map +1 -1
  27. package/dist/components/core/common/SolidGlobalSearchElement.tsx +6 -5
  28. package/dist/components/core/extension/solid-core/agentEvent/list/AgentEventOutcomeListWidget.d.ts +11 -0
  29. package/dist/components/core/extension/solid-core/agentEvent/list/AgentEventOutcomeListWidget.d.ts.map +1 -0
  30. package/dist/components/core/extension/solid-core/agentEvent/list/AgentEventOutcomeListWidget.js +102 -0
  31. package/dist/components/core/extension/solid-core/agentEvent/list/AgentEventOutcomeListWidget.js.map +1 -0
  32. package/dist/components/core/extension/solid-core/agentEvent/list/AgentEventOutcomeListWidget.tsx +129 -0
  33. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.d.ts +4 -0
  34. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.d.ts.map +1 -0
  35. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js +29 -0
  36. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.js.map +1 -0
  37. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.module.css +226 -0
  38. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentRegistryCardWidget.tsx +57 -0
  39. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts +4 -0
  40. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.d.ts.map +1 -0
  41. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js +33 -0
  42. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.js.map +1 -0
  43. package/dist/components/core/extension/solid-core/agentRegistry/card/AgentResourceCardWidget.tsx +47 -0
  44. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel.d.ts +5 -0
  45. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel.d.ts.map +1 -0
  46. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel.js +59 -0
  47. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel.js.map +1 -0
  48. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentProcessesPanel.tsx +82 -0
  49. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel.d.ts +17 -0
  50. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel.d.ts.map +1 -0
  51. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel.js +258 -0
  52. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel.js.map +1 -0
  53. package/dist/components/core/extension/solid-core/agentToolRegistry/AgentToolSessionsPanel.tsx +286 -0
  54. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.d.ts.map +1 -1
  55. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js +102 -62
  56. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.js.map +1 -1
  57. package/dist/components/core/extension/solid-core/modelMetadata/list/DeleteModelRowAction.tsx +116 -106
  58. package/dist/components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction.d.ts +6 -0
  59. package/dist/components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction.d.ts.map +1 -0
  60. package/dist/components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction.js +37 -0
  61. package/dist/components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction.js.map +1 -0
  62. package/dist/components/core/extension/solid-core/mqMessage/MqMessageSelectedRecordsSummaryHeaderAction.tsx +89 -0
  63. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction.d.ts +3 -0
  64. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction.d.ts.map +1 -0
  65. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction.js +18 -0
  66. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction.js.map +1 -0
  67. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageDetailsKanbanCardAction.tsx +51 -0
  68. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction.d.ts +10 -0
  69. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction.d.ts.map +1 -0
  70. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction.js +63 -0
  71. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction.js.map +1 -0
  72. package/dist/components/core/extension/solid-core/mqMessage/kanban/MqMessageKanbanQuickFilterHeaderAction.tsx +111 -0
  73. package/dist/components/core/field/FieldListViewData.d.ts.map +1 -1
  74. package/dist/components/core/field/FieldListViewData.js +29 -9
  75. package/dist/components/core/field/FieldListViewData.js.map +1 -1
  76. package/dist/components/core/field/FieldListViewData.tsx +7 -6
  77. package/dist/components/core/form/SolidFormView.d.ts +1 -0
  78. package/dist/components/core/form/SolidFormView.d.ts.map +1 -1
  79. package/dist/components/core/form/SolidFormView.js +49 -48
  80. package/dist/components/core/form/SolidFormView.js.map +1 -1
  81. package/dist/components/core/form/SolidFormView.tsx +4 -3
  82. package/dist/components/core/form/fields/SolidPasswordField.d.ts.map +1 -1
  83. package/dist/components/core/form/fields/SolidPasswordField.js +13 -1
  84. package/dist/components/core/form/fields/SolidPasswordField.js.map +1 -1
  85. package/dist/components/core/form/fields/SolidPasswordField.tsx +14 -3
  86. package/dist/components/core/kanban/KanbanBoard.d.ts +1 -1
  87. package/dist/components/core/kanban/KanbanBoard.d.ts.map +1 -1
  88. package/dist/components/core/kanban/KanbanBoard.js +2 -2
  89. package/dist/components/core/kanban/KanbanBoard.js.map +1 -1
  90. package/dist/components/core/kanban/KanbanBoard.tsx +5 -1
  91. package/dist/components/core/kanban/KanbanCard.d.ts +3 -0
  92. package/dist/components/core/kanban/KanbanCard.d.ts.map +1 -1
  93. package/dist/components/core/kanban/KanbanCard.js +5 -4
  94. package/dist/components/core/kanban/KanbanCard.js.map +1 -1
  95. package/dist/components/core/kanban/KanbanCard.tsx +31 -11
  96. package/dist/components/core/kanban/KanbanColumn.d.ts +5 -1
  97. package/dist/components/core/kanban/KanbanColumn.d.ts.map +1 -1
  98. package/dist/components/core/kanban/KanbanColumn.js +14 -3
  99. package/dist/components/core/kanban/KanbanColumn.js.map +1 -1
  100. package/dist/components/core/kanban/KanbanColumn.tsx +43 -3
  101. package/dist/components/core/kanban/SolidKanbanView.d.ts +2 -0
  102. package/dist/components/core/kanban/SolidKanbanView.d.ts.map +1 -1
  103. package/dist/components/core/kanban/SolidKanbanView.js +90 -52
  104. package/dist/components/core/kanban/SolidKanbanView.js.map +1 -1
  105. package/dist/components/core/kanban/SolidKanbanView.tsx +93 -13
  106. package/dist/components/core/list/SolidDataTable.d.ts +2 -1
  107. package/dist/components/core/list/SolidDataTable.d.ts.map +1 -1
  108. package/dist/components/core/list/SolidDataTable.js +2 -2
  109. package/dist/components/core/list/SolidDataTable.js.map +1 -1
  110. package/dist/components/core/list/SolidDataTable.tsx +3 -0
  111. package/dist/components/core/list/SolidListView.d.ts.map +1 -1
  112. package/dist/components/core/list/SolidListView.js +114 -57
  113. package/dist/components/core/list/SolidListView.js.map +1 -1
  114. package/dist/components/core/list/SolidListView.tsx +71 -7
  115. package/dist/components/core/list/SolidListViewHeaderContextMenuButton.d.ts.map +1 -1
  116. package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js +14 -0
  117. package/dist/components/core/list/SolidListViewHeaderContextMenuButton.js.map +1 -1
  118. package/dist/components/core/list/SolidListViewHeaderContextMenuButton.tsx +13 -0
  119. package/dist/components/core/list/widgets/AgentProcessNeedsRestartListWidget.d.ts +3 -0
  120. package/dist/components/core/list/widgets/AgentProcessNeedsRestartListWidget.d.ts.map +1 -0
  121. package/dist/components/core/list/widgets/AgentProcessNeedsRestartListWidget.js +51 -0
  122. package/dist/components/core/list/widgets/AgentProcessNeedsRestartListWidget.js.map +1 -0
  123. package/dist/components/core/list/widgets/AgentProcessNeedsRestartListWidget.tsx +60 -0
  124. package/dist/components/core/list/widgets/SolidIconNameListViewWidget.d.ts +4 -0
  125. package/dist/components/core/list/widgets/SolidIconNameListViewWidget.d.ts.map +1 -0
  126. package/dist/components/core/list/widgets/SolidIconNameListViewWidget.js +24 -0
  127. package/dist/components/core/list/widgets/SolidIconNameListViewWidget.js.map +1 -0
  128. package/dist/components/core/list/widgets/SolidIconNameListViewWidget.tsx +32 -0
  129. package/dist/components/core/model/ModelListViewData.d.ts.map +1 -1
  130. package/dist/components/core/model/ModelListViewData.js +6 -23
  131. package/dist/components/core/model/ModelListViewData.js.map +1 -1
  132. package/dist/components/core/model/ModelListViewData.tsx +1 -48
  133. package/dist/components/core/solid-agent/AgentModelIndicator.d.ts +5 -0
  134. package/dist/components/core/solid-agent/AgentModelIndicator.d.ts.map +1 -0
  135. package/dist/components/core/solid-agent/AgentModelIndicator.js +14 -0
  136. package/dist/components/core/solid-agent/AgentModelIndicator.js.map +1 -0
  137. package/dist/components/core/solid-agent/AgentModelIndicator.tsx +40 -0
  138. package/dist/components/core/solid-agent/AgentSignIn.d.ts +12 -0
  139. package/dist/components/core/solid-agent/AgentSignIn.d.ts.map +1 -0
  140. package/dist/components/core/solid-agent/AgentSignIn.js +82 -0
  141. package/dist/components/core/solid-agent/AgentSignIn.js.map +1 -0
  142. package/dist/components/core/solid-agent/AgentSignIn.tsx +91 -0
  143. package/dist/components/core/solid-agent/SolidAgent.module.css +596 -0
  144. package/dist/components/core/solid-agent/SolidAgentChat.d.ts +30 -0
  145. package/dist/components/core/solid-agent/SolidAgentChat.d.ts.map +1 -0
  146. package/dist/components/core/solid-agent/SolidAgentChat.js +300 -0
  147. package/dist/components/core/solid-agent/SolidAgentChat.js.map +1 -0
  148. package/dist/components/core/solid-agent/SolidAgentChat.tsx +451 -0
  149. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts +44 -0
  150. package/dist/components/core/solid-agent/SolidAgentEmbedded.d.ts.map +1 -0
  151. package/dist/components/core/solid-agent/SolidAgentEmbedded.js +46 -0
  152. package/dist/components/core/solid-agent/SolidAgentEmbedded.js.map +1 -0
  153. package/dist/components/core/solid-agent/SolidAgentEmbedded.tsx +87 -0
  154. package/dist/components/core/solid-agent/SolidAgentHost.d.ts +8 -0
  155. package/dist/components/core/solid-agent/SolidAgentHost.d.ts.map +1 -0
  156. package/dist/components/core/solid-agent/SolidAgentHost.js +152 -0
  157. package/dist/components/core/solid-agent/SolidAgentHost.js.map +1 -0
  158. package/dist/components/core/solid-agent/SolidAgentHost.tsx +164 -0
  159. package/dist/components/core/solid-agent/SolidAgentMarkdown.d.ts +16 -0
  160. package/dist/components/core/solid-agent/SolidAgentMarkdown.d.ts.map +1 -0
  161. package/dist/components/core/solid-agent/SolidAgentMarkdown.js +161 -0
  162. package/dist/components/core/solid-agent/SolidAgentMarkdown.js.map +1 -0
  163. package/dist/components/core/solid-agent/SolidAgentMarkdown.tsx +133 -0
  164. package/dist/components/core/solid-agent/SolidAgentMount.d.ts +3 -0
  165. package/dist/components/core/solid-agent/SolidAgentMount.d.ts.map +1 -0
  166. package/dist/components/core/solid-agent/SolidAgentMount.js +62 -0
  167. package/dist/components/core/solid-agent/SolidAgentMount.js.map +1 -0
  168. package/dist/components/core/solid-agent/SolidAgentMount.tsx +31 -0
  169. package/dist/components/core/solid-agent/SolidXAIIcon.d.ts +5 -0
  170. package/dist/components/core/solid-agent/SolidXAIIcon.d.ts.map +1 -0
  171. package/dist/components/core/solid-agent/SolidXAIIcon.js +7 -0
  172. package/dist/components/core/solid-agent/SolidXAIIcon.js.map +1 -0
  173. package/dist/components/core/solid-agent/SolidXAIIcon.tsx +6 -0
  174. package/dist/components/core/solid-agent/agentAttachments.d.ts +20 -0
  175. package/dist/components/core/solid-agent/agentAttachments.d.ts.map +1 -0
  176. package/dist/components/core/solid-agent/agentAttachments.js +184 -0
  177. package/dist/components/core/solid-agent/agentAttachments.js.map +1 -0
  178. package/dist/components/core/solid-agent/agentAttachments.ts +119 -0
  179. package/dist/components/core/solid-agent/agentEvents.d.ts +34 -0
  180. package/dist/components/core/solid-agent/agentEvents.d.ts.map +1 -0
  181. package/dist/components/core/solid-agent/agentEvents.js +282 -0
  182. package/dist/components/core/solid-agent/agentEvents.js.map +1 -0
  183. package/dist/components/core/solid-agent/agentEvents.ts +292 -0
  184. package/dist/components/core/solid-agent/agentFormat.d.ts +18 -0
  185. package/dist/components/core/solid-agent/agentFormat.d.ts.map +1 -0
  186. package/dist/components/core/solid-agent/agentFormat.js +179 -0
  187. package/dist/components/core/solid-agent/agentFormat.js.map +1 -0
  188. package/dist/components/core/solid-agent/agentFormat.ts +160 -0
  189. package/dist/components/core/solid-agent/client/agentAttachmentMedia.d.ts +9 -0
  190. package/dist/components/core/solid-agent/client/agentAttachmentMedia.d.ts.map +1 -0
  191. package/dist/components/core/solid-agent/client/agentAttachmentMedia.js +129 -0
  192. package/dist/components/core/solid-agent/client/agentAttachmentMedia.js.map +1 -0
  193. package/dist/components/core/solid-agent/client/agentAttachmentMedia.ts +69 -0
  194. package/dist/components/core/solid-agent/client/agentAuth.d.ts +63 -0
  195. package/dist/components/core/solid-agent/client/agentAuth.d.ts.map +1 -0
  196. package/dist/components/core/solid-agent/client/agentAuth.js +307 -0
  197. package/dist/components/core/solid-agent/client/agentAuth.js.map +1 -0
  198. package/dist/components/core/solid-agent/client/agentAuth.ts +222 -0
  199. package/dist/components/core/solid-agent/client/agentRest.d.ts +30 -0
  200. package/dist/components/core/solid-agent/client/agentRest.d.ts.map +1 -0
  201. package/dist/components/core/solid-agent/client/agentRest.js +178 -0
  202. package/dist/components/core/solid-agent/client/agentRest.js.map +1 -0
  203. package/dist/components/core/solid-agent/client/agentRest.ts +100 -0
  204. package/dist/components/core/solid-agent/client/agentRuntime.d.ts +48 -0
  205. package/dist/components/core/solid-agent/client/agentRuntime.d.ts.map +1 -0
  206. package/dist/components/core/solid-agent/client/agentRuntime.js +406 -0
  207. package/dist/components/core/solid-agent/client/agentRuntime.js.map +1 -0
  208. package/dist/components/core/solid-agent/client/agentRuntime.ts +226 -0
  209. package/dist/components/core/solid-agent/client/agentSocket.d.ts +46 -0
  210. package/dist/components/core/solid-agent/client/agentSocket.d.ts.map +1 -0
  211. package/dist/components/core/solid-agent/client/agentSocket.js +535 -0
  212. package/dist/components/core/solid-agent/client/agentSocket.js.map +1 -0
  213. package/dist/components/core/solid-agent/client/agentSocket.ts +276 -0
  214. package/dist/components/core/solid-agent/client/agentUrls.d.ts +11 -0
  215. package/dist/components/core/solid-agent/client/agentUrls.d.ts.map +1 -0
  216. package/dist/components/core/solid-agent/client/agentUrls.js +18 -0
  217. package/dist/components/core/solid-agent/client/agentUrls.js.map +1 -0
  218. package/dist/components/core/solid-agent/client/agentUrls.ts +19 -0
  219. package/dist/components/core/solid-agent/composer/AgentComposer.d.ts +21 -0
  220. package/dist/components/core/solid-agent/composer/AgentComposer.d.ts.map +1 -0
  221. package/dist/components/core/solid-agent/composer/AgentComposer.js +219 -0
  222. package/dist/components/core/solid-agent/composer/AgentComposer.js.map +1 -0
  223. package/dist/components/core/solid-agent/composer/AgentComposer.tsx +241 -0
  224. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.d.ts +8 -0
  225. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.d.ts.map +1 -0
  226. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js +87 -0
  227. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.js.map +1 -0
  228. package/dist/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx +58 -0
  229. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts +20 -0
  230. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.d.ts.map +1 -0
  231. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js +103 -0
  232. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.js.map +1 -0
  233. package/dist/components/core/solid-agent/embed/agentEmbedProtocol.ts +60 -0
  234. package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts +11 -0
  235. package/dist/components/core/solid-agent/embed/agentEmbedSamples.d.ts.map +1 -0
  236. package/dist/components/core/solid-agent/embed/agentEmbedSamples.js +21 -0
  237. package/dist/components/core/solid-agent/embed/agentEmbedSamples.js.map +1 -0
  238. package/dist/components/core/solid-agent/embed/agentEmbedSamples.ts +266 -0
  239. package/dist/components/core/solid-agent/processes/agentHubProcessApi.d.ts +15 -0
  240. package/dist/components/core/solid-agent/processes/agentHubProcessApi.d.ts.map +1 -0
  241. package/dist/components/core/solid-agent/processes/agentHubProcessApi.js +122 -0
  242. package/dist/components/core/solid-agent/processes/agentHubProcessApi.js.map +1 -0
  243. package/dist/components/core/solid-agent/processes/agentHubProcessApi.ts +64 -0
  244. package/dist/components/core/solid-agent/sdk/solidAgent.d.ts +39 -0
  245. package/dist/components/core/solid-agent/sdk/solidAgent.d.ts.map +1 -0
  246. package/dist/components/core/solid-agent/sdk/solidAgent.js +44 -0
  247. package/dist/components/core/solid-agent/sdk/solidAgent.js.map +1 -0
  248. package/dist/components/core/solid-agent/sdk/solidAgent.ts +56 -0
  249. package/dist/components/core/solid-agent/thread/AgentThread.d.ts +17 -0
  250. package/dist/components/core/solid-agent/thread/AgentThread.d.ts.map +1 -0
  251. package/dist/components/core/solid-agent/thread/AgentThread.js +166 -0
  252. package/dist/components/core/solid-agent/thread/AgentThread.js.map +1 -0
  253. package/dist/components/core/solid-agent/thread/AgentThread.tsx +248 -0
  254. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts +36 -0
  255. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.d.ts.map +1 -0
  256. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js +148 -0
  257. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.js.map +1 -0
  258. package/dist/components/core/solid-agent/thread/SolidAgentChatItem.tsx +116 -0
  259. package/dist/components/core/solid-agent/thread/inlineWidget.d.ts +8 -0
  260. package/dist/components/core/solid-agent/thread/inlineWidget.d.ts.map +1 -0
  261. package/dist/components/core/solid-agent/thread/inlineWidget.js +30 -0
  262. package/dist/components/core/solid-agent/thread/inlineWidget.js.map +1 -0
  263. package/dist/components/core/solid-agent/thread/inlineWidget.ts +27 -0
  264. package/dist/components/core/solid-agent/types.d.ts +155 -0
  265. package/dist/components/core/solid-agent/types.d.ts.map +1 -0
  266. package/dist/components/core/solid-agent/types.js +31 -0
  267. package/dist/components/core/solid-agent/types.js.map +1 -0
  268. package/dist/components/core/solid-agent/types.ts +148 -0
  269. package/dist/components/core/solid-agent/useAdminInputContext.d.ts +4 -0
  270. package/dist/components/core/solid-agent/useAdminInputContext.d.ts.map +1 -0
  271. package/dist/components/core/solid-agent/useAdminInputContext.js +49 -0
  272. package/dist/components/core/solid-agent/useAdminInputContext.js.map +1 -0
  273. package/dist/components/core/solid-agent/useAdminInputContext.ts +52 -0
  274. package/dist/components/core/solid-agent/useAgentAuth.d.ts +14 -0
  275. package/dist/components/core/solid-agent/useAgentAuth.d.ts.map +1 -0
  276. package/dist/components/core/solid-agent/useAgentAuth.js +88 -0
  277. package/dist/components/core/solid-agent/useAgentAuth.js.map +1 -0
  278. package/dist/components/core/solid-agent/useAgentAuth.ts +40 -0
  279. package/dist/components/core/solid-agent/useAgentAvailability.d.ts +19 -0
  280. package/dist/components/core/solid-agent/useAgentAvailability.d.ts.map +1 -0
  281. package/dist/components/core/solid-agent/useAgentAvailability.js +109 -0
  282. package/dist/components/core/solid-agent/useAgentAvailability.js.map +1 -0
  283. package/dist/components/core/solid-agent/useAgentAvailability.ts +80 -0
  284. package/dist/components/core/solid-agent/useAgentChat.d.ts +22 -0
  285. package/dist/components/core/solid-agent/useAgentChat.d.ts.map +1 -0
  286. package/dist/components/core/solid-agent/useAgentChat.js +45 -0
  287. package/dist/components/core/solid-agent/useAgentChat.js.map +1 -0
  288. package/dist/components/core/solid-agent/useAgentChat.ts +57 -0
  289. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts +7 -0
  290. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.d.ts.map +1 -0
  291. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js +15 -0
  292. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.js.map +1 -0
  293. package/dist/components/core/solid-agent/widgets/DefaultAssistantMessageChatWidget.tsx +24 -0
  294. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.d.ts +7 -0
  295. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.d.ts.map +1 -0
  296. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js +15 -0
  297. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.js.map +1 -0
  298. package/dist/components/core/solid-agent/widgets/DefaultErrorChatWidget.tsx +28 -0
  299. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.d.ts +4 -0
  300. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.d.ts.map +1 -0
  301. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js +20 -0
  302. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.js.map +1 -0
  303. package/dist/components/core/solid-agent/widgets/DefaultNoticeChatWidget.tsx +8 -0
  304. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.d.ts +7 -0
  305. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.d.ts.map +1 -0
  306. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js +11 -0
  307. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.js.map +1 -0
  308. package/dist/components/core/solid-agent/widgets/DefaultThinkingChatWidget.tsx +16 -0
  309. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts +7 -0
  310. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.d.ts.map +1 -0
  311. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js +67 -0
  312. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.js.map +1 -0
  313. package/dist/components/core/solid-agent/widgets/DefaultToolCallChatWidget.tsx +135 -0
  314. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.d.ts +7 -0
  315. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.d.ts.map +1 -0
  316. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js +24 -0
  317. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.js.map +1 -0
  318. package/dist/components/core/solid-agent/widgets/DefaultUnknownChatWidget.tsx +17 -0
  319. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.d.ts +8 -0
  320. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.d.ts.map +1 -0
  321. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js +30 -0
  322. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.js.map +1 -0
  323. package/dist/components/core/solid-agent/widgets/DefaultUserMessageChatWidget.tsx +77 -0
  324. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.d.ts +7 -0
  325. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.d.ts.map +1 -0
  326. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js +40 -0
  327. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.js.map +1 -0
  328. package/dist/components/core/solid-agent/widgets/SolidChecklistChatWidget.tsx +57 -0
  329. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.d.ts +4 -0
  330. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.d.ts.map +1 -0
  331. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js +13 -0
  332. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.js.map +1 -0
  333. package/dist/components/core/solid-agent/widgets/SolidCodeChatWidget.tsx +19 -0
  334. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.d.ts +7 -0
  335. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.d.ts.map +1 -0
  336. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js +55 -0
  337. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.js.map +1 -0
  338. package/dist/components/core/solid-agent/widgets/SolidDiffListChatWidget.tsx +81 -0
  339. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.d.ts +4 -0
  340. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.d.ts.map +1 -0
  341. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js +15 -0
  342. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.js.map +1 -0
  343. package/dist/components/core/solid-agent/widgets/SolidGalleryChatWidget.tsx +30 -0
  344. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.d.ts +4 -0
  345. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.d.ts.map +1 -0
  346. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js +15 -0
  347. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.js.map +1 -0
  348. package/dist/components/core/solid-agent/widgets/SolidJsonChatWidget.tsx +21 -0
  349. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.d.ts +7 -0
  350. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.d.ts.map +1 -0
  351. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js +21 -0
  352. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.js.map +1 -0
  353. package/dist/components/core/solid-agent/widgets/SolidLinkCardChatWidget.tsx +33 -0
  354. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.d.ts +4 -0
  355. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.d.ts.map +1 -0
  356. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js +11 -0
  357. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.js.map +1 -0
  358. package/dist/components/core/solid-agent/widgets/SolidMarkdownChatWidget.tsx +9 -0
  359. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.d.ts +15 -0
  360. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.d.ts.map +1 -0
  361. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js +26 -0
  362. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.js.map +1 -0
  363. package/dist/components/core/solid-agent/widgets/SolidProgressChatWidget.tsx +42 -0
  364. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.d.ts +7 -0
  365. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.d.ts.map +1 -0
  366. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js +41 -0
  367. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.js.map +1 -0
  368. package/dist/components/core/solid-agent/widgets/SolidQuestionChatWidget.tsx +69 -0
  369. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.d.ts +7 -0
  370. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.d.ts.map +1 -0
  371. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js +23 -0
  372. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.js.map +1 -0
  373. package/dist/components/core/solid-agent/widgets/SolidStatusChatWidget.tsx +40 -0
  374. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts +4 -0
  375. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.d.ts.map +1 -0
  376. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js +32 -0
  377. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.js.map +1 -0
  378. package/dist/components/core/solid-agent/widgets/SolidTableChatWidget.tsx +55 -0
  379. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts +7 -0
  380. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.d.ts.map +1 -0
  381. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js +17 -0
  382. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.js.map +1 -0
  383. package/dist/components/core/solid-agent/widgets/SolidToolActivityChatWidget.tsx +31 -0
  384. package/dist/components/core/solid-agent/widgets/chatWidgetUtils.d.ts +12 -0
  385. package/dist/components/core/solid-agent/widgets/chatWidgetUtils.d.ts.map +1 -0
  386. package/dist/components/core/solid-agent/widgets/chatWidgetUtils.js +17 -0
  387. package/dist/components/core/solid-agent/widgets/chatWidgetUtils.js.map +1 -0
  388. package/dist/components/core/solid-agent/widgets/chatWidgetUtils.ts +19 -0
  389. package/dist/components/core/solid-agent/widgets/solidChatWidgets.module.css +909 -0
  390. package/dist/components/core/solid-ai/SolidAiChat.js +1 -1
  391. package/dist/components/core/solid-ai/SolidAiChat.js.map +1 -1
  392. package/dist/components/core/solid-ai/SolidAiChat.tsx +2 -2
  393. package/dist/components/layout/AdminLayout.d.ts.map +1 -1
  394. package/dist/components/layout/AdminLayout.js +2 -1
  395. package/dist/components/layout/AdminLayout.js.map +1 -1
  396. package/dist/components/layout/AdminLayout.tsx +2 -0
  397. package/dist/components/shad-cn-ui/SolidAutocomplete.d.ts.map +1 -1
  398. package/dist/components/shad-cn-ui/SolidAutocomplete.js +2 -2
  399. package/dist/components/shad-cn-ui/SolidAutocomplete.js.map +1 -1
  400. package/dist/components/shad-cn-ui/SolidAutocomplete.tsx +19 -15
  401. package/dist/components/shad-cn-ui/SolidDialog.d.ts +2 -1
  402. package/dist/components/shad-cn-ui/SolidDialog.d.ts.map +1 -1
  403. package/dist/components/shad-cn-ui/SolidDialog.js +2 -2
  404. package/dist/components/shad-cn-ui/SolidDialog.js.map +1 -1
  405. package/dist/components/shad-cn-ui/SolidDialog.tsx +3 -0
  406. package/dist/components/shad-cn-ui/SolidIconPicker.d.ts +7 -0
  407. package/dist/components/shad-cn-ui/SolidIconPicker.d.ts.map +1 -0
  408. package/dist/components/shad-cn-ui/SolidIconPicker.js +43 -0
  409. package/dist/components/shad-cn-ui/SolidIconPicker.js.map +1 -0
  410. package/dist/components/shad-cn-ui/SolidIconPicker.tsx +73 -0
  411. package/dist/components/shad-cn-ui/index.d.ts +1 -0
  412. package/dist/components/shad-cn-ui/index.d.ts.map +1 -1
  413. package/dist/components/shad-cn-ui/index.js +1 -0
  414. package/dist/components/shad-cn-ui/index.js.map +1 -1
  415. package/dist/components/shad-cn-ui/index.ts +1 -0
  416. package/dist/constants/allowed-ai-models.d.ts +8 -0
  417. package/dist/constants/allowed-ai-models.d.ts.map +1 -0
  418. package/dist/constants/allowed-ai-models.js +33 -0
  419. package/dist/constants/allowed-ai-models.js.map +1 -0
  420. package/dist/constants/allowed-ai-models.ts +39 -0
  421. package/dist/helpers/hydrateRelationRules.d.ts.map +1 -1
  422. package/dist/helpers/hydrateRelationRules.js +3 -1
  423. package/dist/helpers/hydrateRelationRules.js.map +1 -1
  424. package/dist/helpers/hydrateRelationRules.ts +5 -1
  425. package/dist/helpers/registry.d.ts +4 -2
  426. package/dist/helpers/registry.d.ts.map +1 -1
  427. package/dist/helpers/registry.js +75 -12
  428. package/dist/helpers/registry.js.map +1 -1
  429. package/dist/helpers/registry.ts +73 -16
  430. package/dist/helpers/updatePasswordField.d.ts.map +1 -1
  431. package/dist/helpers/updatePasswordField.js +21 -15
  432. package/dist/helpers/updatePasswordField.js.map +1 -1
  433. package/dist/helpers/updatePasswordField.ts +6 -1
  434. package/dist/index.d.ts +21 -5
  435. package/dist/index.d.ts.map +1 -1
  436. package/dist/index.js +16 -3
  437. package/dist/index.js.map +1 -1
  438. package/dist/index.ts +34 -3
  439. package/dist/redux/api/fieldApi.js +1 -1
  440. package/dist/redux/api/fieldApi.js.map +1 -1
  441. package/dist/redux/api/fieldApi.ts +2 -2
  442. package/dist/redux/api/modelApi.d.ts +13 -13
  443. package/dist/redux/api/modelApi.d.ts.map +1 -1
  444. package/dist/redux/api/modelApi.js +15 -15
  445. package/dist/redux/api/modelApi.js.map +1 -1
  446. package/dist/redux/api/modelApi.ts +12 -15
  447. package/dist/redux/features/agentSlice.d.ts +34 -0
  448. package/dist/redux/features/agentSlice.d.ts.map +1 -0
  449. package/dist/redux/features/agentSlice.js +92 -0
  450. package/dist/redux/features/agentSlice.js.map +1 -0
  451. package/dist/redux/features/agentSlice.ts +119 -0
  452. package/dist/redux/store/defaultStoreConfig.d.ts +11 -10
  453. package/dist/redux/store/defaultStoreConfig.d.ts.map +1 -1
  454. package/dist/redux/store/defaultStoreConfig.js +2 -0
  455. package/dist/redux/store/defaultStoreConfig.js.map +1 -1
  456. package/dist/redux/store/defaultStoreConfig.ts +2 -0
  457. package/dist/redux/store/solidEntityApiPool.d.ts.map +1 -1
  458. package/dist/redux/store/solidEntityApiPool.js +7 -0
  459. package/dist/redux/store/solidEntityApiPool.js.map +1 -1
  460. package/dist/redux/store/solidEntityApiPool.ts +6 -0
  461. package/dist/resources/globals.css +109 -1
  462. package/dist/resources/solid-custom.css +295 -0
  463. package/dist/resources/solid-tailwind-generated.css +1 -1
  464. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.css +47 -0
  465. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.d.ts +12 -0
  466. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.d.ts.map +1 -0
  467. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js +80 -0
  468. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.js.map +1 -0
  469. package/dist/routes/pages/admin/core/AgentRegistryAuditPanel.tsx +123 -0
  470. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.css +110 -0
  471. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts +3 -0
  472. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.d.ts.map +1 -0
  473. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js +702 -0
  474. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.js.map +1 -0
  475. package/dist/routes/pages/admin/core/AgentRegistryEditorPage.tsx +630 -0
  476. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.css +303 -0
  477. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts +3 -0
  478. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.d.ts.map +1 -0
  479. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js +330 -0
  480. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.js.map +1 -0
  481. package/dist/routes/pages/admin/core/AgentSkillRegistryEditorPage.tsx +460 -0
  482. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.css +125 -0
  483. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts +3 -0
  484. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.d.ts.map +1 -0
  485. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js +295 -0
  486. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.js.map +1 -0
  487. package/dist/routes/pages/admin/core/AgentToolRegistryEditorPage.tsx +275 -0
  488. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js +11 -11
  489. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.js.map +1 -1
  490. package/dist/routes/pages/admin/core/WorkflowDefinitionEditorPage.tsx +15 -15
  491. package/dist/routes/pages/embed/AgentEmbedPage.d.ts +3 -0
  492. package/dist/routes/pages/embed/AgentEmbedPage.d.ts.map +1 -0
  493. package/dist/routes/pages/embed/AgentEmbedPage.js +170 -0
  494. package/dist/routes/pages/embed/AgentEmbedPage.js.map +1 -0
  495. package/dist/routes/pages/embed/AgentEmbedPage.module.css +195 -0
  496. package/dist/routes/pages/embed/AgentEmbedPage.tsx +169 -0
  497. package/dist/routes/solidRoutes.d.ts.map +1 -1
  498. package/dist/routes/solidRoutes.js +8 -0
  499. package/dist/routes/solidRoutes.js.map +1 -1
  500. package/dist/routes/solidRoutes.tsx +8 -0
  501. package/dist/types/extension-registry.d.ts +4 -0
  502. package/dist/types/extension-registry.d.ts.map +1 -1
  503. package/dist/types/extension-registry.js +7 -0
  504. package/dist/types/extension-registry.js.map +1 -1
  505. package/dist/types/extension-registry.ts +7 -0
  506. package/dist/types/index.d.ts +4 -0
  507. package/dist/types/list-row-action.d.ts +2 -0
  508. package/dist/types/list-row-action.d.ts.map +1 -1
  509. package/dist/types/list-row-action.js.map +1 -1
  510. package/dist/types/list-row-action.ts +3 -0
  511. package/dist/types/solid-core.d.ts +36 -0
  512. package/package.json +1 -1
@@ -0,0 +1,241 @@
1
+ import React, { useEffect, useMemo, useRef, useState } from "react";
2
+ import { ArrowUp, FileText, Paperclip, Square, X } from "lucide-react";
3
+ import styles from "../SolidAgent.module.css";
4
+ import type { AgentAttachment, AgentCommand } from "../types";
5
+ import { AGENT_ATTACHMENT_ACCEPT, MAX_AGENT_ATTACHMENTS, formatFileSize, readAgentAttachments } from "../agentAttachments";
6
+
7
+ type Props = {
8
+ working: boolean;
9
+ disabled: boolean;
10
+ placeholder?: string;
11
+ commands: AgentCommand[];
12
+ /** Text to place in the box (e.g. a prefilled prompt); changing `seedKey` re-applies it. */
13
+ seed?: string;
14
+ seedKey?: number;
15
+ onSend: (text: string, attachments: AgentAttachment[]) => void | Promise<void>;
16
+ onStop: () => void;
17
+ modelIndicator?: React.ReactNode;
18
+ };
19
+
20
+ /**
21
+ * Message box: Enter sends, Shift+Enter adds a line, "/" at the start lists the agent's commands.
22
+ * Files can be attached with the paperclip, dropped onto the box, or pasted.
23
+ */
24
+ export function AgentComposer({ working, disabled, placeholder, commands, seed, seedKey, onSend, onStop, modelIndicator }: Props) {
25
+ const [text, setText] = useState("");
26
+ const [active, setActive] = useState(0);
27
+ const [attachments, setAttachments] = useState<AgentAttachment[]>([]);
28
+ const [attachErrors, setAttachErrors] = useState<string[]>([]);
29
+ const [dragging, setDragging] = useState(false);
30
+ const [sending, setSending] = useState(false);
31
+ const ref = useRef<HTMLTextAreaElement>(null);
32
+ const fileInputRef = useRef<HTMLInputElement>(null);
33
+
34
+ useEffect(() => {
35
+ if (seed == null) return;
36
+ setText(seed);
37
+ requestAnimationFrame(() => {
38
+ ref.current?.focus();
39
+ autosize();
40
+ });
41
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
+ }, [seedKey]);
43
+
44
+ useEffect(() => {
45
+ if (!disabled) ref.current?.focus();
46
+ }, [disabled]);
47
+
48
+ const slashQuery = text.startsWith("/") && !text.includes(" ") ? text.slice(1).toLowerCase() : null;
49
+ const matches = useMemo(
50
+ () => (slashQuery == null ? [] : commands.filter((cmd) => cmd.name.replace(/^\//, "").toLowerCase().startsWith(slashQuery))),
51
+ [commands, slashQuery],
52
+ );
53
+
54
+ function autosize() {
55
+ const el = ref.current;
56
+ if (!el) return;
57
+ el.style.height = "auto";
58
+ el.style.height = `${Math.min(el.scrollHeight, 200)}px`;
59
+ }
60
+
61
+ const addFiles = async (files: File[]) => {
62
+ if (!files.length || disabled || sending) return;
63
+ const { added, errors } = await readAgentAttachments(files, attachments);
64
+ if (added.length) setAttachments((prev) => [...prev, ...added]);
65
+ setAttachErrors(errors);
66
+ };
67
+
68
+ const removeAttachment = (index: number) => {
69
+ setAttachments((prev) => prev.filter((_, i) => i !== index));
70
+ setAttachErrors([]);
71
+ };
72
+
73
+ const canSend = (!!text.trim() || attachments.length > 0) && !working && !disabled && !sending;
74
+
75
+ const submit = async () => {
76
+ if (!canSend) return;
77
+ setSending(true);
78
+ setAttachErrors([]);
79
+ try {
80
+ await onSend(text.trim(), attachments);
81
+ setText("");
82
+ setAttachments([]);
83
+ requestAnimationFrame(autosize);
84
+ } catch (error) {
85
+ setAttachErrors([error instanceof Error ? error.message : "The message could not be sent."]);
86
+ } finally {
87
+ setSending(false);
88
+ }
89
+ };
90
+
91
+ const pickCommand = (cmd: AgentCommand) => {
92
+ setText(`/${cmd.name.replace(/^\//, "")} `);
93
+ ref.current?.focus();
94
+ };
95
+
96
+ const onKeyDown = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
97
+ if (matches.length) {
98
+ if (event.key === "ArrowDown" || event.key === "ArrowUp") {
99
+ event.preventDefault();
100
+ setActive((i) => (i + (event.key === "ArrowDown" ? 1 : -1) + matches.length) % matches.length);
101
+ return;
102
+ }
103
+ if (event.key === "Tab" || (event.key === "Enter" && !event.shiftKey)) {
104
+ event.preventDefault();
105
+ pickCommand(matches[Math.min(active, matches.length - 1)]);
106
+ return;
107
+ }
108
+ }
109
+ if (event.key === "Enter" && !event.shiftKey) {
110
+ event.preventDefault();
111
+ submit();
112
+ }
113
+ };
114
+
115
+ const onPaste = (event: React.ClipboardEvent<HTMLTextAreaElement>) => {
116
+ const files = Array.from(event.clipboardData?.files ?? []);
117
+ if (files.length) {
118
+ event.preventDefault();
119
+ void addFiles(files);
120
+ }
121
+ };
122
+
123
+ const dropHandlers = {
124
+ onDragOver: (event: React.DragEvent) => {
125
+ if (disabled || sending || !event.dataTransfer?.types?.includes("Files")) return;
126
+ event.preventDefault();
127
+ setDragging(true);
128
+ },
129
+ onDragLeave: (event: React.DragEvent) => {
130
+ if (!event.currentTarget.contains(event.relatedTarget as Node)) setDragging(false);
131
+ },
132
+ onDrop: (event: React.DragEvent) => {
133
+ if (disabled || sending) return;
134
+ event.preventDefault();
135
+ setDragging(false);
136
+ void addFiles(Array.from(event.dataTransfer?.files ?? []));
137
+ },
138
+ };
139
+
140
+ return (
141
+ <div className={`${styles.composer} ${dragging ? styles.composerDragging : ""}`} {...dropHandlers}>
142
+ {matches.length > 0 && (
143
+ <div className={styles.popover} role="listbox" aria-label="Commands">
144
+ {matches.map((cmd, i) => (
145
+ <button
146
+ key={cmd.name}
147
+ type="button"
148
+ role="option"
149
+ aria-selected={i === active}
150
+ className={`${styles.popoverItem} ${i === active ? styles.popoverItemActive : ""}`}
151
+ onMouseDown={(event) => {
152
+ event.preventDefault();
153
+ pickCommand(cmd);
154
+ }}
155
+ >
156
+ <span className={styles.popoverCmd}>/{cmd.name.replace(/^\//, "")}</span>
157
+ {cmd.description && <span className={styles.popoverDesc}>{cmd.description}</span>}
158
+ </button>
159
+ ))}
160
+ </div>
161
+ )}
162
+
163
+ {attachments.length > 0 && (
164
+ <ul className={styles.attachmentTray} aria-label="Attached files">
165
+ {attachments.map((item, index) => (
166
+ <li key={`${item.meta.name}-${index}`} className={styles.attachmentChip}>
167
+ {item.meta.previewUrl ? (
168
+ <img className={styles.attachmentThumb} src={item.meta.previewUrl} alt="" />
169
+ ) : (
170
+ <span className={styles.attachmentIcon}><FileText size={14} /></span>
171
+ )}
172
+ <span className={styles.attachmentText}>
173
+ <span className={styles.attachmentName} title={item.meta.name}>{item.meta.name}</span>
174
+ <span className={styles.attachmentSize}>{formatFileSize(item.meta.size)}</span>
175
+ </span>
176
+ <button type="button" className={styles.attachmentRemove} aria-label={`Remove ${item.meta.name}`} onClick={() => removeAttachment(index)}>
177
+ <X size={12} />
178
+ </button>
179
+ </li>
180
+ ))}
181
+ </ul>
182
+ )}
183
+
184
+ {attachErrors.length > 0 && (
185
+ <div className={styles.attachmentErrors} role="alert">
186
+ {attachErrors.map((error) => <div key={error}>{error}</div>)}
187
+ </div>
188
+ )}
189
+
190
+ <textarea
191
+ ref={ref}
192
+ className={styles.textarea}
193
+ rows={1}
194
+ value={text}
195
+ disabled={disabled || sending}
196
+ aria-label="Message the SolidX Agent"
197
+ placeholder={dragging ? "Drop files to attach" : placeholder ?? "Ask the agent…"}
198
+ onChange={(event) => {
199
+ setText(event.target.value);
200
+ setActive(0);
201
+ autosize();
202
+ }}
203
+ onKeyDown={onKeyDown}
204
+ onPaste={onPaste}
205
+ />
206
+ <div className={styles.composerRow}>
207
+ <input
208
+ ref={fileInputRef}
209
+ type="file"
210
+ multiple
211
+ accept={AGENT_ATTACHMENT_ACCEPT}
212
+ hidden
213
+ onChange={(event) => {
214
+ void addFiles(Array.from(event.target.files ?? []));
215
+ event.target.value = "";
216
+ }}
217
+ />
218
+ <button
219
+ type="button"
220
+ className={styles.iconBtn}
221
+ aria-label="Attach files"
222
+ title={`Attach files (up to ${MAX_AGENT_ATTACHMENTS}: images or text files)`}
223
+ disabled={disabled || sending || attachments.length >= MAX_AGENT_ATTACHMENTS}
224
+ onClick={() => fileInputRef.current?.click()}
225
+ >
226
+ <Paperclip size={16} />
227
+ </button>
228
+ {modelIndicator}
229
+ {working ? (
230
+ <button type="button" className={styles.stopBtn} onClick={onStop} aria-label="Stop the agent">
231
+ <Square size={10} fill="currentColor" /> Stop
232
+ </button>
233
+ ) : (
234
+ <button type="button" className={styles.sendBtn} onClick={submit} disabled={!canSend} aria-label="Send">
235
+ <ArrowUp size={16} />
236
+ </button>
237
+ )}
238
+ </div>
239
+ </div>
240
+ );
241
+ }
@@ -0,0 +1,8 @@
1
+ import type { AgentInputDefinition } from "./agentEmbedProtocol";
2
+ export declare function AgentEmbeddingPanel({ agentId, fields, hubUrl, active }: {
3
+ agentId: number;
4
+ fields: AgentInputDefinition[];
5
+ hubUrl: string;
6
+ active: boolean;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ //# sourceMappingURL=AgentEmbeddingPanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentEmbeddingPanel.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAGjE,wBAAgB,mBAAmB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,OAAO,CAAA;CAAE,2CAkD5J"}
@@ -0,0 +1,87 @@
1
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
2
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
3
+ return new (P || (P = Promise))(function (resolve, reject) {
4
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
5
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
6
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
7
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
8
+ });
9
+ };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
37
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
+ import { useState } from "react";
39
+ import { Copy, Check } from "lucide-react";
40
+ import { env } from "../../../../adapters/env";
41
+ import { SolidButton, SolidCodeEditor, SolidTabGroup } from "../../../shad-cn-ui";
42
+ import { embedSamples } from "./agentEmbedSamples";
43
+ export function AgentEmbeddingPanel(_a) {
44
+ var agentId = _a.agentId, fields = _a.fields, hubUrl = _a.hubUrl, active = _a.active;
45
+ var _b = useState("javascript"), tab = _b[0], setTab = _b[1];
46
+ var _c = useState("express"), backend = _c[0], setBackend = _c[1];
47
+ var _d = useState(""), copied = _d[0], setCopied = _d[1];
48
+ var _e = useState(""), copyError = _e[0], setCopyError = _e[1];
49
+ var sdkUrl = "".concat(env("NEXT_PUBLIC_BACKEND_API_URL").replace(/\/$/, ""), "/api/agent-embed/sdk.js?v=2");
50
+ var samples = embedSamples(agentId, fields, sdkUrl, hubUrl || "https://agenthub.example.com");
51
+ function copy(key, code) {
52
+ return __awaiter(this, void 0, void 0, function () {
53
+ var _a;
54
+ return __generator(this, function (_b) {
55
+ switch (_b.label) {
56
+ case 0:
57
+ _b.trys.push([0, 2, , 3]);
58
+ return [4 /*yield*/, navigator.clipboard.writeText(code)];
59
+ case 1:
60
+ _b.sent();
61
+ setCopied(key);
62
+ setCopyError("");
63
+ return [3 /*break*/, 3];
64
+ case 2:
65
+ _a = _b.sent();
66
+ setCopyError("Clipboard access is unavailable. Select and copy the code below.");
67
+ return [3 /*break*/, 3];
68
+ case 3: return [2 /*return*/];
69
+ }
70
+ });
71
+ });
72
+ }
73
+ var code = function (value, language) { return _jsx(SolidCodeEditor, { readOnly: true, value: value, language: language, fontSize: 11, height: "420px" }); };
74
+ var copyButton = function (key, value) { return _jsxs(SolidButton, { variant: "secondary", size: "small", onClick: function () { return void copy(key, value); }, children: [copied === key ? _jsx(Check, { size: 14 }) : _jsx(Copy, { size: 14 }), " ", copied === key ? "Copied" : "Copy code"] }); };
75
+ return _jsxs("div", { className: "agent-editor__stack", children: [!active && _jsx("p", { role: "status", className: "agent-editor__hint", children: "Activate this agent before embedding it. Samples use the saved agent definition." }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "1. Keep your API key on your server" }), _jsxs("p", { children: ["Configure ", _jsx("code", { children: "AGENTHUB_API_KEY" }), ", ", _jsx("code", { children: "AGENTHUB_AGENT_ID" }), ", and ", _jsx("code", { children: "AGENTHUB_BACKEND_URL" }), " on the server that hosts your app API. Never expose the API key or AgentHub runtime URL in browser code. The browser receives only the short-lived embed response through the SDK handshake."] })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "2. Create your token endpoint" }), _jsxs("p", { children: ["Your app API accepts the SDK's token request, ignores any client-selected backend or API key, and uses the configured agent ID to call ", _jsx("code", { children: "/api/agent/api-keys/embedded/me" }), " on AgentHub Runtime. Return the successful JSON response unchanged with ", _jsx("code", { children: "Cache-Control: no-store" }), "; never cache or log credentials or tokens."] }), _jsxs("p", { children: ["Anonymous embeds can expose this endpoint publicly, as in the demo. Add rate limiting at your API or gateway and use your app's authorization policy when chat access should require sign-in. ", _jsx("code", { children: "externalUserId" }), " is optional: when the trusted auth layer supplies a stable user ID, send a namespaced value; omit it for anonymous visitors. The runtime manages chat sessions independently."] }), _jsx(SolidTabGroup, { tabs: [
76
+ { value: "python", label: "Python / FastAPI", content: code(samples.python, "python") },
77
+ { value: "nestjs", label: "NestJS", content: code(samples.nestjs, "typescript") },
78
+ { value: "express", label: "Express", content: code(samples.express, "javascript") },
79
+ { value: "java", label: "Java / Spring Boot", content: code(samples.java, "java") },
80
+ { value: "dotnet", label: ".NET / ASP.NET Core", content: code(samples.dotnet, "csharp") },
81
+ ], value: backend, onValueChange: setBackend, extra: copyButton(backend, samples[backend]) })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "3. Embed the chat" }), _jsxs("p", { children: ["Load the SDK from the public SDK URL shown below and mount it into a browser container. The SDK calls your app's ", _jsx("code", { children: "tokenEndpoint" }), ", passes the response to the hosted chat in memory, and manages the iframe handshake and token renewal. No SolidX npm dependency is required."] }), _jsxs("p", { children: ["Use a same-origin path such as ", _jsx("code", { children: "/api/agent-chat/token" }), " when possible. If your app API has another origin, give ", _jsx("code", { children: "tokenEndpoint" }), " its absolute URL and configure that API's CORS policy for the browser app origin."] }), _jsxs("p", { children: ["The SDK-serving SolidX API selects the hosted chat UI from its server-side ", _jsx("code", { children: "AGENT_EMBED_UI_URL" }), " setting. The consuming app does not supply an ", _jsx("code", { children: "embedUrl" }), " or choose the iframe host. Keep the SDK script URL and the configured hosted UI origin aligned to the same SolidX deployment."] }), _jsxs("p", { children: ["Pass the current page's required input values in ", _jsx("code", { children: "inputs" }), " using the names and types in this agent's schema. These values provide task context; they are not authorization to access records. Enforce access to protected data in your own API/tools. For a logged-in app, use ", _jsx("code", { children: "getTokenHeaders" }), " to send the app's normal bearer or CSRF header to your app API; do not send the AgentHub API key from the browser."] }), _jsx(SolidTabGroup, { tabs: [
82
+ { value: "javascript", label: "JavaScript", content: code(samples.javascript, "html") },
83
+ { value: "react", label: "React", content: code(samples.react, "javascript") },
84
+ ], value: tab, onValueChange: setTab, extra: copyButton(tab, tab === "javascript" ? samples.javascript : samples.react) })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "Required inputs" }), fields.length ? _jsxs("table", { style: { width: "100%", textAlign: "left" }, children: [_jsx("thead", { children: _jsxs("tr", { children: [_jsx("th", { children: "Variable" }), _jsx("th", { children: "Data type" }), _jsx("th", { children: "Description" })] }) }), _jsx("tbody", { children: fields.map(function (field) { return _jsxs("tr", { children: [_jsx("td", { children: _jsx("code", { children: field.name }) }), _jsx("td", { children: field.dataType }), _jsx("td", { children: field.description })] }, field.name); }) })] })
85
+ : _jsx("p", { children: "This agent has no required inputs." }), _jsx("p", { children: "Replace sample values with the current page's values and preserve each declared type. The SDK validates required inputs before the chat starts. Inputs are fixed after the first message; start a new chat to change them. They describe the task and do not grant access to data." })] }), _jsxs("section", { className: "agent-editor__section", children: [_jsx("h2", { children: "Hosting and deployment" }), _jsxs("p", { children: ["Make ", _jsxs("code", { children: ["/embed/agent/", agentId] }), " available on the hosted UI selected by ", _jsx("code", { children: "AGENT_EMBED_UI_URL" }), ". Allow the consuming app origin in the hosted UI's frame-ancestors policy, the AgentHub Runtime origin in its CORS configuration, and the SDK/API/iframe origins in the consuming app's CSP. Use HTTPS for the consuming page, SDK, hosted UI, and runtime in production."] })] }), copyError && _jsx("p", { role: "alert", children: copyError })] });
86
+ }
87
+ //# sourceMappingURL=AgentEmbeddingPanel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentEmbeddingPanel.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/embed/AgentEmbeddingPanel.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,UAAU,mBAAmB,CAAC,EAAyH;QAAvH,OAAO,aAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA;IAC3D,IAAA,KAAgB,QAAQ,CAAC,YAAY,CAAC,EAArC,GAAG,QAAA,EAAE,MAAM,QAA0B,CAAC;IACvC,IAAA,KAAwB,QAAQ,CAAC,SAAS,CAAC,EAA1C,OAAO,QAAA,EAAE,UA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AAM,KAAnG,KAAK,CAAC,IAAI,CAA8F,EAAjH,CAAiH,CAAC,GAAS,IAAQ;wBACjK,CAAC,CAAC,6DAAyC,EAC/C,6SAAyR,IACnR,EACV,mBAAS,SAAS,EAAC,uBAAuB,aAAC,kDAA+B,EAAA,iCAAQ,4CAAoB,OAAO,IAAQ,8CAAwC,gDAA+B,kRAA8Q,IAAU,EACnd,SAAS,IAAI,YAAG,IAAI,EAAC,OAAO,YAAE,SAAS,GAAK,IAC3C,CAAC;AACX,CAAC","sourcesContent":["import React, { useState } from \"react\";\nimport { Copy, Check } from \"lucide-react\";\nimport { env } from \"../../../../adapters/env\";\nimport { SolidButton, SolidCodeEditor, SolidTabGroup } from \"../../../shad-cn-ui\";\nimport type { AgentInputDefinition } from \"./agentEmbedProtocol\";\nimport { embedSamples } from \"./agentEmbedSamples\";\n\nexport function AgentEmbeddingPanel({ agentId, fields, hubUrl, active }: { agentId: number; fields: AgentInputDefinition[]; hubUrl: string; active: boolean }) {\n const [tab, setTab] = useState(\"javascript\");\n const [backend, setBackend] = useState(\"express\");\n const [copied, setCopied] = useState(\"\");\n const [copyError, setCopyError] = useState(\"\");\n const sdkUrl = `${env(\"NEXT_PUBLIC_BACKEND_API_URL\").replace(/\\/$/, \"\")}/api/agent-embed/sdk.js?v=2`;\n const samples = embedSamples(agentId, fields, sdkUrl, hubUrl || \"https://agenthub.example.com\");\n async function copy(key: string, code: string) {\n try { await navigator.clipboard.writeText(code); setCopied(key); setCopyError(\"\"); }\n catch { setCopyError(\"Clipboard access is unavailable. Select and copy the code below.\"); }\n }\n const code = (value: string, language: string) => <SolidCodeEditor readOnly value={value} language={language} fontSize={11} height=\"420px\" />;\n const copyButton = (key: string, value: string) => <SolidButton variant=\"secondary\" size=\"small\" onClick={() => void copy(key, value)}>\n {copied === key ? <Check size={14} /> : <Copy size={14} />} {copied === key ? \"Copied\" : \"Copy code\"}\n </SolidButton>;\n return <div className=\"agent-editor__stack\">\n {!active && <p role=\"status\" className=\"agent-editor__hint\">Activate this agent before embedding it. Samples use the saved agent definition.</p>}\n <section className=\"agent-editor__section\"><h2>1. Keep your API key on your server</h2>\n <p>Configure <code>AGENTHUB_API_KEY</code>, <code>AGENTHUB_AGENT_ID</code>, and <code>AGENTHUB_BACKEND_URL</code> on the server that hosts your app API. Never expose the API key or AgentHub runtime URL in browser code. The browser receives only the short-lived embed response through the SDK handshake.</p>\n </section>\n <section className=\"agent-editor__section\"><h2>2. Create your token endpoint</h2>\n <p>Your app API accepts the SDK's token request, ignores any client-selected backend or API key, and uses the configured agent ID to call <code>/api/agent/api-keys/embedded/me</code> on AgentHub Runtime. Return the successful JSON response unchanged with <code>Cache-Control: no-store</code>; never cache or log credentials or tokens.</p>\n <p>Anonymous embeds can expose this endpoint publicly, as in the demo. Add rate limiting at your API or gateway and use your app's authorization policy when chat access should require sign-in. <code>externalUserId</code> is optional: when the trusted auth layer supplies a stable user ID, send a namespaced value; omit it for anonymous visitors. The runtime manages chat sessions independently.</p>\n <SolidTabGroup tabs={[\n { value: \"python\", label: \"Python / FastAPI\", content: code(samples.python, \"python\") },\n { value: \"nestjs\", label: \"NestJS\", content: code(samples.nestjs, \"typescript\") },\n { value: \"express\", label: \"Express\", content: code(samples.express, \"javascript\") },\n { value: \"java\", label: \"Java / Spring Boot\", content: code(samples.java, \"java\") },\n { value: \"dotnet\", label: \".NET / ASP.NET Core\", content: code(samples.dotnet, \"csharp\") },\n ]} value={backend} onValueChange={setBackend} extra={copyButton(backend, samples[backend as keyof typeof samples])} />\n </section>\n <section className=\"agent-editor__section\"><h2>3. Embed the chat</h2>\n <p>Load the SDK from the public SDK URL shown below and mount it into a browser container. The SDK calls your app's <code>tokenEndpoint</code>, passes the response to the hosted chat in memory, and manages the iframe handshake and token renewal. No SolidX npm dependency is required.</p>\n <p>Use a same-origin path such as <code>/api/agent-chat/token</code> when possible. If your app API has another origin, give <code>tokenEndpoint</code> its absolute URL and configure that API's CORS policy for the browser app origin.</p>\n <p>The SDK-serving SolidX API selects the hosted chat UI from its server-side <code>AGENT_EMBED_UI_URL</code> setting. The consuming app does not supply an <code>embedUrl</code> or choose the iframe host. Keep the SDK script URL and the configured hosted UI origin aligned to the same SolidX deployment.</p>\n <p>Pass the current page's required input values in <code>inputs</code> using the names and types in this agent's schema. These values provide task context; they are not authorization to access records. Enforce access to protected data in your own API/tools. For a logged-in app, use <code>getTokenHeaders</code> to send the app's normal bearer or CSRF header to your app API; do not send the AgentHub API key from the browser.</p>\n <SolidTabGroup tabs={[\n { value: \"javascript\", label: \"JavaScript\", content: code(samples.javascript, \"html\") },\n { value: \"react\", label: \"React\", content: code(samples.react, \"javascript\") },\n ]} value={tab} onValueChange={setTab} extra={copyButton(tab, tab === \"javascript\" ? samples.javascript : samples.react)} />\n </section>\n <section className=\"agent-editor__section\"><h2>Required inputs</h2>\n {fields.length ? <table style={{ width: \"100%\", textAlign: \"left\" }}><thead><tr><th>Variable</th><th>Data type</th><th>Description</th></tr></thead>\n <tbody>{fields.map((field) => <tr key={field.name}><td><code>{field.name}</code></td><td>{field.dataType}</td><td>{field.description}</td></tr>)}</tbody></table>\n : <p>This agent has no required inputs.</p>}\n <p>Replace sample values with the current page's values and preserve each declared type. The SDK validates required inputs before the chat starts. Inputs are fixed after the first message; start a new chat to change them. They describe the task and do not grant access to data.</p>\n </section>\n <section className=\"agent-editor__section\"><h2>Hosting and deployment</h2><p>Make <code>/embed/agent/{agentId}</code> available on the hosted UI selected by <code>AGENT_EMBED_UI_URL</code>. Allow the consuming app origin in the hosted UI's frame-ancestors policy, the AgentHub Runtime origin in its CORS configuration, and the SDK/API/iframe origins in the consuming app's CSP. Use HTTPS for the consuming page, SDK, hosted UI, and runtime in production.</p></section>\n {copyError && <p role=\"alert\">{copyError}</p>}\n </div>;\n}\n"]}
@@ -0,0 +1,58 @@
1
+ import React, { useState } from "react";
2
+ import { Copy, Check } from "lucide-react";
3
+ import { env } from "../../../../adapters/env";
4
+ import { SolidButton, SolidCodeEditor, SolidTabGroup } from "../../../shad-cn-ui";
5
+ import type { AgentInputDefinition } from "./agentEmbedProtocol";
6
+ import { embedSamples } from "./agentEmbedSamples";
7
+
8
+ export function AgentEmbeddingPanel({ agentId, fields, hubUrl, active }: { agentId: number; fields: AgentInputDefinition[]; hubUrl: string; active: boolean }) {
9
+ const [tab, setTab] = useState("javascript");
10
+ const [backend, setBackend] = useState("express");
11
+ const [copied, setCopied] = useState("");
12
+ const [copyError, setCopyError] = useState("");
13
+ const sdkUrl = `${env("NEXT_PUBLIC_BACKEND_API_URL").replace(/\/$/, "")}/api/agent-embed/sdk.js?v=2`;
14
+ const samples = embedSamples(agentId, fields, sdkUrl, hubUrl || "https://agenthub.example.com");
15
+ async function copy(key: string, code: string) {
16
+ try { await navigator.clipboard.writeText(code); setCopied(key); setCopyError(""); }
17
+ catch { setCopyError("Clipboard access is unavailable. Select and copy the code below."); }
18
+ }
19
+ const code = (value: string, language: string) => <SolidCodeEditor readOnly value={value} language={language} fontSize={11} height="420px" />;
20
+ const copyButton = (key: string, value: string) => <SolidButton variant="secondary" size="small" onClick={() => void copy(key, value)}>
21
+ {copied === key ? <Check size={14} /> : <Copy size={14} />} {copied === key ? "Copied" : "Copy code"}
22
+ </SolidButton>;
23
+ return <div className="agent-editor__stack">
24
+ {!active && <p role="status" className="agent-editor__hint">Activate this agent before embedding it. Samples use the saved agent definition.</p>}
25
+ <section className="agent-editor__section"><h2>1. Keep your API key on your server</h2>
26
+ <p>Configure <code>AGENTHUB_API_KEY</code>, <code>AGENTHUB_AGENT_ID</code>, and <code>AGENTHUB_BACKEND_URL</code> on the server that hosts your app API. Never expose the API key or AgentHub runtime URL in browser code. The browser receives only the short-lived embed response through the SDK handshake.</p>
27
+ </section>
28
+ <section className="agent-editor__section"><h2>2. Create your token endpoint</h2>
29
+ <p>Your app API accepts the SDK's token request, ignores any client-selected backend or API key, and uses the configured agent ID to call <code>/api/agent/api-keys/embedded/me</code> on AgentHub Runtime. Return the successful JSON response unchanged with <code>Cache-Control: no-store</code>; never cache or log credentials or tokens.</p>
30
+ <p>Anonymous embeds can expose this endpoint publicly, as in the demo. Add rate limiting at your API or gateway and use your app's authorization policy when chat access should require sign-in. <code>externalUserId</code> is optional: when the trusted auth layer supplies a stable user ID, send a namespaced value; omit it for anonymous visitors. The runtime manages chat sessions independently.</p>
31
+ <SolidTabGroup tabs={[
32
+ { value: "python", label: "Python / FastAPI", content: code(samples.python, "python") },
33
+ { value: "nestjs", label: "NestJS", content: code(samples.nestjs, "typescript") },
34
+ { value: "express", label: "Express", content: code(samples.express, "javascript") },
35
+ { value: "java", label: "Java / Spring Boot", content: code(samples.java, "java") },
36
+ { value: "dotnet", label: ".NET / ASP.NET Core", content: code(samples.dotnet, "csharp") },
37
+ ]} value={backend} onValueChange={setBackend} extra={copyButton(backend, samples[backend as keyof typeof samples])} />
38
+ </section>
39
+ <section className="agent-editor__section"><h2>3. Embed the chat</h2>
40
+ <p>Load the SDK from the public SDK URL shown below and mount it into a browser container. The SDK calls your app's <code>tokenEndpoint</code>, passes the response to the hosted chat in memory, and manages the iframe handshake and token renewal. No SolidX npm dependency is required.</p>
41
+ <p>Use a same-origin path such as <code>/api/agent-chat/token</code> when possible. If your app API has another origin, give <code>tokenEndpoint</code> its absolute URL and configure that API's CORS policy for the browser app origin.</p>
42
+ <p>The SDK-serving SolidX API selects the hosted chat UI from its server-side <code>AGENT_EMBED_UI_URL</code> setting. The consuming app does not supply an <code>embedUrl</code> or choose the iframe host. Keep the SDK script URL and the configured hosted UI origin aligned to the same SolidX deployment.</p>
43
+ <p>Pass the current page's required input values in <code>inputs</code> using the names and types in this agent's schema. These values provide task context; they are not authorization to access records. Enforce access to protected data in your own API/tools. For a logged-in app, use <code>getTokenHeaders</code> to send the app's normal bearer or CSRF header to your app API; do not send the AgentHub API key from the browser.</p>
44
+ <SolidTabGroup tabs={[
45
+ { value: "javascript", label: "JavaScript", content: code(samples.javascript, "html") },
46
+ { value: "react", label: "React", content: code(samples.react, "javascript") },
47
+ ]} value={tab} onValueChange={setTab} extra={copyButton(tab, tab === "javascript" ? samples.javascript : samples.react)} />
48
+ </section>
49
+ <section className="agent-editor__section"><h2>Required inputs</h2>
50
+ {fields.length ? <table style={{ width: "100%", textAlign: "left" }}><thead><tr><th>Variable</th><th>Data type</th><th>Description</th></tr></thead>
51
+ <tbody>{fields.map((field) => <tr key={field.name}><td><code>{field.name}</code></td><td>{field.dataType}</td><td>{field.description}</td></tr>)}</tbody></table>
52
+ : <p>This agent has no required inputs.</p>}
53
+ <p>Replace sample values with the current page's values and preserve each declared type. The SDK validates required inputs before the chat starts. Inputs are fixed after the first message; start a new chat to change them. They describe the task and do not grant access to data.</p>
54
+ </section>
55
+ <section className="agent-editor__section"><h2>Hosting and deployment</h2><p>Make <code>/embed/agent/{agentId}</code> available on the hosted UI selected by <code>AGENT_EMBED_UI_URL</code>. Allow the consuming app origin in the hosted UI's frame-ancestors policy, the AgentHub Runtime origin in its CORS configuration, and the SDK/API/iframe origins in the consuming app's CSP. Use HTTPS for the consuming page, SDK, hosted UI, and runtime in production.</p></section>
56
+ {copyError && <p role="alert">{copyError}</p>}
57
+ </div>;
58
+ }
@@ -0,0 +1,20 @@
1
+ import type { AgentBootstrap } from "../client/agentAuth";
2
+ export declare const EMBED_CHANNEL = "solidx-agent-embed";
3
+ export type AgentInputDefinition = {
4
+ name: string;
5
+ description: string;
6
+ dataType: string;
7
+ };
8
+ export type AgentEmbedBootstrap = AgentBootstrap & {
9
+ embed: true;
10
+ agentId: number;
11
+ title?: string;
12
+ requiredInputs: AgentInputDefinition[];
13
+ };
14
+ export declare class MissingAgentInputsError extends Error {
15
+ readonly inputNames: string[];
16
+ constructor(inputNames: string[]);
17
+ }
18
+ export declare function validateBootstrap(value: unknown, agentId: number): AgentEmbedBootstrap;
19
+ export declare function validateEmbedInputs(fields: AgentInputDefinition[], suppliedValues?: Record<string, unknown>): void;
20
+ //# sourceMappingURL=agentEmbedProtocol.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentEmbedProtocol.d.ts","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/embed/agentEmbedProtocol.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1D,eAAO,MAAM,aAAa,uBAAuB,CAAC;AAClD,MAAM,MAAM,oBAAoB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAC3F,MAAM,MAAM,mBAAmB,GAAG,cAAc,GAAG;IAC/C,KAAK,EAAE,IAAI,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,oBAAoB,EAAE,CAAC;CAC1C,CAAC;AAEF,qBAAa,uBAAwB,SAAQ,KAAK;IAClC,QAAQ,CAAC,UAAU,EAAE,MAAM,EAAE;gBAApB,UAAU,EAAE,MAAM,EAAE;CAI5C;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,mBAAmB,CAWtF;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CA4BlH"}
@@ -0,0 +1,103 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ export var EMBED_CHANNEL = "solidx-agent-embed";
17
+ var MissingAgentInputsError = /** @class */ (function (_super) {
18
+ __extends(MissingAgentInputsError, _super);
19
+ function MissingAgentInputsError(inputNames) {
20
+ var _this = _super.call(this, "Required inputs are missing: ".concat(inputNames.join(", "))) || this;
21
+ Object.defineProperty(_this, "inputNames", {
22
+ enumerable: true,
23
+ configurable: true,
24
+ writable: true,
25
+ value: inputNames
26
+ });
27
+ _this.name = "MissingAgentInputsError";
28
+ return _this;
29
+ }
30
+ return MissingAgentInputsError;
31
+ }(Error));
32
+ export { MissingAgentInputsError };
33
+ export function validateBootstrap(value, agentId) {
34
+ var body = value;
35
+ if (!body || body.embed !== true || body.agentId !== agentId || typeof body.agentToken !== "string" || !body.agentToken
36
+ || !Array.isArray(body.requiredInputs))
37
+ throw new Error("The token endpoint returned an invalid embed response.");
38
+ var ws = new URL(body.wsUrl), http = new URL(body.httpUrl);
39
+ if (!["ws:", "wss:"].includes(ws.protocol) || !["http:", "https:"].includes(http.protocol)
40
+ || ws.username || ws.password || http.username || http.password || ws.search || http.search || ws.hash || http.hash)
41
+ throw new Error("The token endpoint returned invalid connection URLs.");
42
+ if (window.location.protocol === "https:" && (ws.protocol !== "wss:" || http.protocol !== "https:"))
43
+ throw new Error("HTTPS embeds require HTTPS and WSS AgentHub endpoints.");
44
+ return body;
45
+ }
46
+ export function validateEmbedInputs(fields, suppliedValues) {
47
+ var values = suppliedValues !== null && suppliedValues !== void 0 ? suppliedValues : {};
48
+ if (typeof values !== "object" || Array.isArray(values))
49
+ throw new Error("inputs must be an object.");
50
+ var names = new Set(fields.map(function (field) { return field.name; }));
51
+ for (var _i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
52
+ var name_1 = _a[_i];
53
+ if (!names.has(name_1))
54
+ throw new Error("Unknown input: ".concat(name_1));
55
+ }
56
+ var missing = fields
57
+ .filter(function (_a) {
58
+ var name = _a.name;
59
+ var value = values[name];
60
+ return value === undefined || value === null || (typeof value === "string" && !value.trim());
61
+ })
62
+ .map(function (_a) {
63
+ var name = _a.name;
64
+ return name;
65
+ });
66
+ if (missing.length)
67
+ throw new MissingAgentInputsError(missing);
68
+ for (var _b = 0, fields_1 = fields; _b < fields_1.length; _b++) {
69
+ var field = fields_1[_b];
70
+ var value = values[field.name];
71
+ var valid = false;
72
+ switch (field.dataType) {
73
+ case "string":
74
+ valid = typeof value === "string";
75
+ break;
76
+ case "number":
77
+ valid = typeof value === "number" && Number.isFinite(value);
78
+ break;
79
+ case "integer":
80
+ valid = typeof value === "number" && Number.isSafeInteger(value);
81
+ break;
82
+ case "boolean":
83
+ valid = typeof value === "boolean";
84
+ break;
85
+ case "array":
86
+ valid = Array.isArray(value);
87
+ break;
88
+ case "object":
89
+ valid = typeof value === "object" && value !== null && !Array.isArray(value);
90
+ break;
91
+ case "date":
92
+ valid = typeof value === "string" && /^\d{4}-\d{2}-\d{2}$/.test(value)
93
+ && !Number.isNaN(Date.parse(value)) && new Date(value).toISOString().slice(0, 10) === value;
94
+ break;
95
+ case "datetime":
96
+ valid = typeof value === "string" && /^\d{4}-\d{2}-\d{2}T/.test(value) && !Number.isNaN(Date.parse(value));
97
+ break;
98
+ }
99
+ if (!valid)
100
+ throw new Error("Input ".concat(field.name, " must have data type ").concat(field.dataType, "."));
101
+ }
102
+ }
103
+ //# sourceMappingURL=agentEmbedProtocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"agentEmbedProtocol.js","sourceRoot":"","sources":["../../../../../src/components/core/solid-agent/embed/agentEmbedProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAEA,MAAM,CAAC,IAAM,aAAa,GAAG,oBAAoB,CAAC;AASlD;IAA6C,2CAAK;IAC9C,iCAAqB,UAAoB;QAAzC,YACI,kBAAM,uCAAgC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAE,CAAC,SAEjE;QAHW;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IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;gBAAC,MAAM;SACtI;QACD,IAAI,CAAC,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,gBAAS,KAAK,CAAC,IAAI,kCAAwB,KAAK,CAAC,QAAQ,MAAG,CAAC,CAAC;KAC7F;AACL,CAAC","sourcesContent":["import type { AgentBootstrap } from \"../client/agentAuth\";\n\nexport const EMBED_CHANNEL = \"solidx-agent-embed\";\nexport type AgentInputDefinition = { name: string; description: string; dataType: string };\nexport type AgentEmbedBootstrap = AgentBootstrap & {\n embed: true;\n agentId: number;\n title?: string;\n requiredInputs: AgentInputDefinition[];\n};\n\nexport class MissingAgentInputsError extends Error {\n constructor(readonly inputNames: string[]) {\n super(`Required inputs are missing: ${inputNames.join(\", \")}`);\n this.name = \"MissingAgentInputsError\";\n }\n}\n\nexport function validateBootstrap(value: unknown, agentId: number): AgentEmbedBootstrap {\n const body = value as AgentEmbedBootstrap;\n if (!body || body.embed !== true || body.agentId !== agentId || typeof body.agentToken !== \"string\" || !body.agentToken\n || !Array.isArray(body.requiredInputs)) throw new Error(\"The token endpoint returned an invalid embed response.\");\n const ws = new URL(body.wsUrl), http = new URL(body.httpUrl);\n if (![\"ws:\", \"wss:\"].includes(ws.protocol) || ![\"http:\", \"https:\"].includes(http.protocol)\n || ws.username || ws.password || http.username || http.password || ws.search || http.search || ws.hash || http.hash)\n throw new Error(\"The token endpoint returned invalid connection URLs.\");\n if (window.location.protocol === \"https:\" && (ws.protocol !== \"wss:\" || http.protocol !== \"https:\"))\n throw new Error(\"HTTPS embeds require HTTPS and WSS AgentHub endpoints.\");\n return body;\n}\n\nexport function validateEmbedInputs(fields: AgentInputDefinition[], suppliedValues?: Record<string, unknown>): void {\n const values = suppliedValues ?? {};\n if (typeof values !== \"object\" || Array.isArray(values)) throw new Error(\"inputs must be an object.\");\n const names = new Set(fields.map((field) => field.name));\n for (const name of Object.keys(values)) if (!names.has(name)) throw new Error(`Unknown input: ${name}`);\n const missing = fields\n .filter(({ name }) => {\n const value = values[name];\n return value === undefined || value === null || (typeof value === \"string\" && !value.trim());\n })\n .map(({ name }) => name);\n if (missing.length) throw new MissingAgentInputsError(missing);\n for (const field of fields) {\n const value = values[field.name];\n let valid = false;\n switch (field.dataType) {\n case \"string\": valid = typeof value === \"string\"; break;\n case \"number\": valid = typeof value === \"number\" && Number.isFinite(value); break;\n case \"integer\": valid = typeof value === \"number\" && Number.isSafeInteger(value); break;\n case \"boolean\": valid = typeof value === \"boolean\"; break;\n case \"array\": valid = Array.isArray(value); break;\n case \"object\": valid = typeof value === \"object\" && value !== null && !Array.isArray(value); break;\n case \"date\": valid = typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}$/.test(value)\n && !Number.isNaN(Date.parse(value)) && new Date(value).toISOString().slice(0, 10) === value; break;\n case \"datetime\": valid = typeof value === \"string\" && /^\\d{4}-\\d{2}-\\d{2}T/.test(value) && !Number.isNaN(Date.parse(value)); break;\n }\n if (!valid) throw new Error(`Input ${field.name} must have data type ${field.dataType}.`);\n }\n}\n"]}