@base44/superagent-native 0.0.1

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 (465) hide show
  1. package/README.md +132 -0
  2. package/lib/commonjs/AgentSettingsPanel.js +1067 -0
  3. package/lib/commonjs/AgentSettingsPanel.js.map +1 -0
  4. package/lib/commonjs/AgentSphereIcon.js +243 -0
  5. package/lib/commonjs/AgentSphereIcon.js.map +1 -0
  6. package/lib/commonjs/AttachmentPickerStatusModal.js +96 -0
  7. package/lib/commonjs/AttachmentPickerStatusModal.js.map +1 -0
  8. package/lib/commonjs/AttachmentPreviewStrip.js +49 -0
  9. package/lib/commonjs/AttachmentPreviewStrip.js.map +1 -0
  10. package/lib/commonjs/ChannelsPanel.js +733 -0
  11. package/lib/commonjs/ChannelsPanel.js.map +1 -0
  12. package/lib/commonjs/ConversationChat.js +219 -0
  13. package/lib/commonjs/ConversationChat.js.map +1 -0
  14. package/lib/commonjs/ConversationComposer.js +323 -0
  15. package/lib/commonjs/ConversationComposer.js.map +1 -0
  16. package/lib/commonjs/ConversationMessageList.js +105 -0
  17. package/lib/commonjs/ConversationMessageList.js.map +1 -0
  18. package/lib/commonjs/ConversationScreen.js +241 -0
  19. package/lib/commonjs/ConversationScreen.js.map +1 -0
  20. package/lib/commonjs/EditorDrawer.js +1127 -0
  21. package/lib/commonjs/EditorDrawer.js.map +1 -0
  22. package/lib/commonjs/EditorTabPanel.js +28 -0
  23. package/lib/commonjs/EditorTabPanel.js.map +1 -0
  24. package/lib/commonjs/FilesPanel.js +533 -0
  25. package/lib/commonjs/FilesPanel.js.map +1 -0
  26. package/lib/commonjs/MarkdownText.js +313 -0
  27. package/lib/commonjs/MarkdownText.js.map +1 -0
  28. package/lib/commonjs/MessageActionBar.js +90 -0
  29. package/lib/commonjs/MessageActionBar.js.map +1 -0
  30. package/lib/commonjs/RenameAgentModal.js +99 -0
  31. package/lib/commonjs/RenameAgentModal.js.map +1 -0
  32. package/lib/commonjs/ShareAgentModal.js +349 -0
  33. package/lib/commonjs/ShareAgentModal.js.map +1 -0
  34. package/lib/commonjs/ShareAgentModal.styles.js +236 -0
  35. package/lib/commonjs/ShareAgentModal.styles.js.map +1 -0
  36. package/lib/commonjs/SuperagentHomeScreen.js +316 -0
  37. package/lib/commonjs/SuperagentHomeScreen.js.map +1 -0
  38. package/lib/commonjs/ToolApprovalCard.js +542 -0
  39. package/lib/commonjs/ToolApprovalCard.js.map +1 -0
  40. package/lib/commonjs/ToolCallSummary.js +632 -0
  41. package/lib/commonjs/ToolCallSummary.js.map +1 -0
  42. package/lib/commonjs/agentSphereStyles.js +38 -0
  43. package/lib/commonjs/agentSphereStyles.js.map +1 -0
  44. package/lib/commonjs/apiClient.js +158 -0
  45. package/lib/commonjs/apiClient.js.map +1 -0
  46. package/lib/commonjs/attachmentFileHelpers.js +104 -0
  47. package/lib/commonjs/attachmentFileHelpers.js.map +1 -0
  48. package/lib/commonjs/attachmentUpload.js +87 -0
  49. package/lib/commonjs/attachmentUpload.js.map +1 -0
  50. package/lib/commonjs/composerStyles.js +248 -0
  51. package/lib/commonjs/composerStyles.js.map +1 -0
  52. package/lib/commonjs/connectorBrandIcons.js +82 -0
  53. package/lib/commonjs/connectorBrandIcons.js.map +1 -0
  54. package/lib/commonjs/connectorCatalog.js +377 -0
  55. package/lib/commonjs/connectorCatalog.js.map +1 -0
  56. package/lib/commonjs/constants.js +15 -0
  57. package/lib/commonjs/constants.js.map +1 -0
  58. package/lib/commonjs/conversationParts.js +273 -0
  59. package/lib/commonjs/conversationParts.js.map +1 -0
  60. package/lib/commonjs/conversationRuntime.js +144 -0
  61. package/lib/commonjs/conversationRuntime.js.map +1 -0
  62. package/lib/commonjs/conversationStyles.js +758 -0
  63. package/lib/commonjs/conversationStyles.js.map +1 -0
  64. package/lib/commonjs/editorShellStyles.js +1032 -0
  65. package/lib/commonjs/editorShellStyles.js.map +1 -0
  66. package/lib/commonjs/editorTabs.js +42 -0
  67. package/lib/commonjs/editorTabs.js.map +1 -0
  68. package/lib/commonjs/fileTreeUtils.js +133 -0
  69. package/lib/commonjs/fileTreeUtils.js.map +1 -0
  70. package/lib/commonjs/index.js +110 -0
  71. package/lib/commonjs/index.js.map +1 -0
  72. package/lib/commonjs/markdownStyles.js +157 -0
  73. package/lib/commonjs/markdownStyles.js.map +1 -0
  74. package/lib/commonjs/mediaUtils.js +61 -0
  75. package/lib/commonjs/mediaUtils.js.map +1 -0
  76. package/lib/commonjs/messageActionStyles.js +45 -0
  77. package/lib/commonjs/messageActionStyles.js.map +1 -0
  78. package/lib/commonjs/messageUtils.js +55 -0
  79. package/lib/commonjs/messageUtils.js.map +1 -0
  80. package/lib/commonjs/nativeActionSheet.js +21 -0
  81. package/lib/commonjs/nativeActionSheet.js.map +1 -0
  82. package/lib/commonjs/nativeActionSheet.web.js +10 -0
  83. package/lib/commonjs/nativeActionSheet.web.js.map +1 -0
  84. package/lib/commonjs/package.json +1 -0
  85. package/lib/commonjs/paperTheme.js +59 -0
  86. package/lib/commonjs/paperTheme.js.map +1 -0
  87. package/lib/commonjs/realtimeClient.js +99 -0
  88. package/lib/commonjs/realtimeClient.js.map +1 -0
  89. package/lib/commonjs/renameAgentModalStyles.js +83 -0
  90. package/lib/commonjs/renameAgentModalStyles.js.map +1 -0
  91. package/lib/commonjs/screenParts.js +220 -0
  92. package/lib/commonjs/screenParts.js.map +1 -0
  93. package/lib/commonjs/styles.js +343 -0
  94. package/lib/commonjs/styles.js.map +1 -0
  95. package/lib/commonjs/superagentApiClient.js +613 -0
  96. package/lib/commonjs/superagentApiClient.js.map +1 -0
  97. package/lib/commonjs/types.js +6 -0
  98. package/lib/commonjs/types.js.map +1 -0
  99. package/lib/commonjs/useSuperagentAttachmentPicker.js +80 -0
  100. package/lib/commonjs/useSuperagentAttachmentPicker.js.map +1 -0
  101. package/lib/commonjs/useSuperagentConversation.js +216 -0
  102. package/lib/commonjs/useSuperagentConversation.js.map +1 -0
  103. package/lib/commonjs/useSuperagentRuntime.js +1207 -0
  104. package/lib/commonjs/useSuperagentRuntime.js.map +1 -0
  105. package/lib/module/AgentSettingsPanel.js +1062 -0
  106. package/lib/module/AgentSettingsPanel.js.map +1 -0
  107. package/lib/module/AgentSphereIcon.js +237 -0
  108. package/lib/module/AgentSphereIcon.js.map +1 -0
  109. package/lib/module/AttachmentPickerStatusModal.js +91 -0
  110. package/lib/module/AttachmentPickerStatusModal.js.map +1 -0
  111. package/lib/module/AttachmentPreviewStrip.js +44 -0
  112. package/lib/module/AttachmentPreviewStrip.js.map +1 -0
  113. package/lib/module/ChannelsPanel.js +728 -0
  114. package/lib/module/ChannelsPanel.js.map +1 -0
  115. package/lib/module/ConversationChat.js +214 -0
  116. package/lib/module/ConversationChat.js.map +1 -0
  117. package/lib/module/ConversationComposer.js +318 -0
  118. package/lib/module/ConversationComposer.js.map +1 -0
  119. package/lib/module/ConversationMessageList.js +100 -0
  120. package/lib/module/ConversationMessageList.js.map +1 -0
  121. package/lib/module/ConversationScreen.js +236 -0
  122. package/lib/module/ConversationScreen.js.map +1 -0
  123. package/lib/module/EditorDrawer.js +1122 -0
  124. package/lib/module/EditorDrawer.js.map +1 -0
  125. package/lib/module/EditorTabPanel.js +23 -0
  126. package/lib/module/EditorTabPanel.js.map +1 -0
  127. package/lib/module/FilesPanel.js +528 -0
  128. package/lib/module/FilesPanel.js.map +1 -0
  129. package/lib/module/MarkdownText.js +308 -0
  130. package/lib/module/MarkdownText.js.map +1 -0
  131. package/lib/module/MessageActionBar.js +85 -0
  132. package/lib/module/MessageActionBar.js.map +1 -0
  133. package/lib/module/RenameAgentModal.js +94 -0
  134. package/lib/module/RenameAgentModal.js.map +1 -0
  135. package/lib/module/ShareAgentModal.js +344 -0
  136. package/lib/module/ShareAgentModal.js.map +1 -0
  137. package/lib/module/ShareAgentModal.styles.js +232 -0
  138. package/lib/module/ShareAgentModal.styles.js.map +1 -0
  139. package/lib/module/SuperagentHomeScreen.js +311 -0
  140. package/lib/module/SuperagentHomeScreen.js.map +1 -0
  141. package/lib/module/ToolApprovalCard.js +537 -0
  142. package/lib/module/ToolApprovalCard.js.map +1 -0
  143. package/lib/module/ToolCallSummary.js +627 -0
  144. package/lib/module/ToolCallSummary.js.map +1 -0
  145. package/lib/module/agentSphereStyles.js +34 -0
  146. package/lib/module/agentSphereStyles.js.map +1 -0
  147. package/lib/module/apiClient.js +154 -0
  148. package/lib/module/apiClient.js.map +1 -0
  149. package/lib/module/attachmentFileHelpers.js +97 -0
  150. package/lib/module/attachmentFileHelpers.js.map +1 -0
  151. package/lib/module/attachmentUpload.js +82 -0
  152. package/lib/module/attachmentUpload.js.map +1 -0
  153. package/lib/module/composerStyles.js +244 -0
  154. package/lib/module/composerStyles.js.map +1 -0
  155. package/lib/module/connectorBrandIcons.js +76 -0
  156. package/lib/module/connectorBrandIcons.js.map +1 -0
  157. package/lib/module/connectorCatalog.js +373 -0
  158. package/lib/module/connectorCatalog.js.map +1 -0
  159. package/lib/module/constants.js +10 -0
  160. package/lib/module/constants.js.map +1 -0
  161. package/lib/module/conversationParts.js +266 -0
  162. package/lib/module/conversationParts.js.map +1 -0
  163. package/lib/module/conversationRuntime.js +129 -0
  164. package/lib/module/conversationRuntime.js.map +1 -0
  165. package/lib/module/conversationStyles.js +754 -0
  166. package/lib/module/conversationStyles.js.map +1 -0
  167. package/lib/module/editorShellStyles.js +1028 -0
  168. package/lib/module/editorShellStyles.js.map +1 -0
  169. package/lib/module/editorTabs.js +37 -0
  170. package/lib/module/editorTabs.js.map +1 -0
  171. package/lib/module/fileTreeUtils.js +120 -0
  172. package/lib/module/fileTreeUtils.js.map +1 -0
  173. package/lib/module/index.js +17 -0
  174. package/lib/module/index.js.map +1 -0
  175. package/lib/module/markdownStyles.js +153 -0
  176. package/lib/module/markdownStyles.js.map +1 -0
  177. package/lib/module/mediaUtils.js +53 -0
  178. package/lib/module/mediaUtils.js.map +1 -0
  179. package/lib/module/messageActionStyles.js +41 -0
  180. package/lib/module/messageActionStyles.js.map +1 -0
  181. package/lib/module/messageUtils.js +46 -0
  182. package/lib/module/messageUtils.js.map +1 -0
  183. package/lib/module/nativeActionSheet.js +17 -0
  184. package/lib/module/nativeActionSheet.js.map +1 -0
  185. package/lib/module/nativeActionSheet.web.js +6 -0
  186. package/lib/module/nativeActionSheet.web.js.map +1 -0
  187. package/lib/module/package.json +1 -0
  188. package/lib/module/paperTheme.js +55 -0
  189. package/lib/module/paperTheme.js.map +1 -0
  190. package/lib/module/realtimeClient.js +95 -0
  191. package/lib/module/realtimeClient.js.map +1 -0
  192. package/lib/module/renameAgentModalStyles.js +79 -0
  193. package/lib/module/renameAgentModalStyles.js.map +1 -0
  194. package/lib/module/screenParts.js +210 -0
  195. package/lib/module/screenParts.js.map +1 -0
  196. package/lib/module/styles.js +339 -0
  197. package/lib/module/styles.js.map +1 -0
  198. package/lib/module/superagentApiClient.js +609 -0
  199. package/lib/module/superagentApiClient.js.map +1 -0
  200. package/lib/module/types.js +4 -0
  201. package/lib/module/types.js.map +1 -0
  202. package/lib/module/useSuperagentAttachmentPicker.js +75 -0
  203. package/lib/module/useSuperagentAttachmentPicker.js.map +1 -0
  204. package/lib/module/useSuperagentConversation.js +212 -0
  205. package/lib/module/useSuperagentConversation.js.map +1 -0
  206. package/lib/module/useSuperagentRuntime.js +1203 -0
  207. package/lib/module/useSuperagentRuntime.js.map +1 -0
  208. package/lib/typescript/commonjs/AgentSettingsPanel.d.ts +19 -0
  209. package/lib/typescript/commonjs/AgentSettingsPanel.d.ts.map +1 -0
  210. package/lib/typescript/commonjs/AgentSphereIcon.d.ts +15 -0
  211. package/lib/typescript/commonjs/AgentSphereIcon.d.ts.map +1 -0
  212. package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts +8 -0
  213. package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts.map +1 -0
  214. package/lib/typescript/commonjs/AttachmentPreviewStrip.d.ts +7 -0
  215. package/lib/typescript/commonjs/AttachmentPreviewStrip.d.ts.map +1 -0
  216. package/lib/typescript/commonjs/ChannelsPanel.d.ts +21 -0
  217. package/lib/typescript/commonjs/ChannelsPanel.d.ts.map +1 -0
  218. package/lib/typescript/commonjs/ConversationChat.d.ts +22 -0
  219. package/lib/typescript/commonjs/ConversationChat.d.ts.map +1 -0
  220. package/lib/typescript/commonjs/ConversationComposer.d.ts +24 -0
  221. package/lib/typescript/commonjs/ConversationComposer.d.ts.map +1 -0
  222. package/lib/typescript/commonjs/ConversationMessageList.d.ts +17 -0
  223. package/lib/typescript/commonjs/ConversationMessageList.d.ts.map +1 -0
  224. package/lib/typescript/commonjs/ConversationScreen.d.ts +80 -0
  225. package/lib/typescript/commonjs/ConversationScreen.d.ts.map +1 -0
  226. package/lib/typescript/commonjs/EditorDrawer.d.ts +67 -0
  227. package/lib/typescript/commonjs/EditorDrawer.d.ts.map +1 -0
  228. package/lib/typescript/commonjs/EditorTabPanel.d.ts +6 -0
  229. package/lib/typescript/commonjs/EditorTabPanel.d.ts.map +1 -0
  230. package/lib/typescript/commonjs/FilesPanel.d.ts +14 -0
  231. package/lib/typescript/commonjs/FilesPanel.d.ts.map +1 -0
  232. package/lib/typescript/commonjs/MarkdownText.d.ts +10 -0
  233. package/lib/typescript/commonjs/MarkdownText.d.ts.map +1 -0
  234. package/lib/typescript/commonjs/MessageActionBar.d.ts +8 -0
  235. package/lib/typescript/commonjs/MessageActionBar.d.ts.map +1 -0
  236. package/lib/typescript/commonjs/RenameAgentModal.d.ts +10 -0
  237. package/lib/typescript/commonjs/RenameAgentModal.d.ts.map +1 -0
  238. package/lib/typescript/commonjs/ShareAgentModal.d.ts +15 -0
  239. package/lib/typescript/commonjs/ShareAgentModal.d.ts.map +1 -0
  240. package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts +229 -0
  241. package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts.map +1 -0
  242. package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts +4 -0
  243. package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts.map +1 -0
  244. package/lib/typescript/commonjs/ToolApprovalCard.d.ts +13 -0
  245. package/lib/typescript/commonjs/ToolApprovalCard.d.ts.map +1 -0
  246. package/lib/typescript/commonjs/ToolCallSummary.d.ts +16 -0
  247. package/lib/typescript/commonjs/ToolCallSummary.d.ts.map +1 -0
  248. package/lib/typescript/commonjs/agentSphereStyles.d.ts +31 -0
  249. package/lib/typescript/commonjs/agentSphereStyles.d.ts.map +1 -0
  250. package/lib/typescript/commonjs/apiClient.d.ts +4 -0
  251. package/lib/typescript/commonjs/apiClient.d.ts.map +1 -0
  252. package/lib/typescript/commonjs/attachmentFileHelpers.d.ts +6 -0
  253. package/lib/typescript/commonjs/attachmentFileHelpers.d.ts.map +1 -0
  254. package/lib/typescript/commonjs/attachmentUpload.d.ts +12 -0
  255. package/lib/typescript/commonjs/attachmentUpload.d.ts.map +1 -0
  256. package/lib/typescript/commonjs/composerStyles.d.ts +241 -0
  257. package/lib/typescript/commonjs/composerStyles.d.ts.map +1 -0
  258. package/lib/typescript/commonjs/connectorBrandIcons.d.ts +7 -0
  259. package/lib/typescript/commonjs/connectorBrandIcons.d.ts.map +1 -0
  260. package/lib/typescript/commonjs/connectorCatalog.d.ts +3 -0
  261. package/lib/typescript/commonjs/connectorCatalog.d.ts.map +1 -0
  262. package/lib/typescript/commonjs/constants.d.ts +4 -0
  263. package/lib/typescript/commonjs/constants.d.ts.map +1 -0
  264. package/lib/typescript/commonjs/conversationParts.d.ts +29 -0
  265. package/lib/typescript/commonjs/conversationParts.d.ts.map +1 -0
  266. package/lib/typescript/commonjs/conversationRuntime.d.ts +67 -0
  267. package/lib/typescript/commonjs/conversationRuntime.d.ts.map +1 -0
  268. package/lib/typescript/commonjs/conversationStyles.d.ts +742 -0
  269. package/lib/typescript/commonjs/conversationStyles.d.ts.map +1 -0
  270. package/lib/typescript/commonjs/editorShellStyles.d.ts +1025 -0
  271. package/lib/typescript/commonjs/editorShellStyles.d.ts.map +1 -0
  272. package/lib/typescript/commonjs/editorTabs.d.ts +11 -0
  273. package/lib/typescript/commonjs/editorTabs.d.ts.map +1 -0
  274. package/lib/typescript/commonjs/fileTreeUtils.d.ts +17 -0
  275. package/lib/typescript/commonjs/fileTreeUtils.d.ts.map +1 -0
  276. package/lib/typescript/commonjs/index.d.ts +20 -0
  277. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  278. package/lib/typescript/commonjs/markdownStyles.d.ts +150 -0
  279. package/lib/typescript/commonjs/markdownStyles.d.ts.map +1 -0
  280. package/lib/typescript/commonjs/mediaUtils.d.ts +9 -0
  281. package/lib/typescript/commonjs/mediaUtils.d.ts.map +1 -0
  282. package/lib/typescript/commonjs/messageActionStyles.d.ts +38 -0
  283. package/lib/typescript/commonjs/messageActionStyles.d.ts.map +1 -0
  284. package/lib/typescript/commonjs/messageUtils.d.ts +8 -0
  285. package/lib/typescript/commonjs/messageUtils.d.ts.map +1 -0
  286. package/lib/typescript/commonjs/nativeActionSheet.d.ts +6 -0
  287. package/lib/typescript/commonjs/nativeActionSheet.d.ts.map +1 -0
  288. package/lib/typescript/commonjs/nativeActionSheet.web.d.ts +3 -0
  289. package/lib/typescript/commonjs/nativeActionSheet.web.d.ts.map +1 -0
  290. package/lib/typescript/commonjs/package.json +1 -0
  291. package/lib/typescript/commonjs/paperTheme.d.ts +3 -0
  292. package/lib/typescript/commonjs/paperTheme.d.ts.map +1 -0
  293. package/lib/typescript/commonjs/realtimeClient.d.ts +16 -0
  294. package/lib/typescript/commonjs/realtimeClient.d.ts.map +1 -0
  295. package/lib/typescript/commonjs/renameAgentModalStyles.d.ts +76 -0
  296. package/lib/typescript/commonjs/renameAgentModalStyles.d.ts.map +1 -0
  297. package/lib/typescript/commonjs/screenParts.d.ts +31 -0
  298. package/lib/typescript/commonjs/screenParts.d.ts.map +1 -0
  299. package/lib/typescript/commonjs/styles.d.ts +336 -0
  300. package/lib/typescript/commonjs/styles.d.ts.map +1 -0
  301. package/lib/typescript/commonjs/superagentApiClient.d.ts +66 -0
  302. package/lib/typescript/commonjs/superagentApiClient.d.ts.map +1 -0
  303. package/lib/typescript/commonjs/types.d.ts +437 -0
  304. package/lib/typescript/commonjs/types.d.ts.map +1 -0
  305. package/lib/typescript/commonjs/useSuperagentAttachmentPicker.d.ts +30 -0
  306. package/lib/typescript/commonjs/useSuperagentAttachmentPicker.d.ts.map +1 -0
  307. package/lib/typescript/commonjs/useSuperagentConversation.d.ts +36 -0
  308. package/lib/typescript/commonjs/useSuperagentConversation.d.ts.map +1 -0
  309. package/lib/typescript/commonjs/useSuperagentRuntime.d.ts +163 -0
  310. package/lib/typescript/commonjs/useSuperagentRuntime.d.ts.map +1 -0
  311. package/lib/typescript/module/AgentSettingsPanel.d.ts +19 -0
  312. package/lib/typescript/module/AgentSettingsPanel.d.ts.map +1 -0
  313. package/lib/typescript/module/AgentSphereIcon.d.ts +15 -0
  314. package/lib/typescript/module/AgentSphereIcon.d.ts.map +1 -0
  315. package/lib/typescript/module/AttachmentPickerStatusModal.d.ts +8 -0
  316. package/lib/typescript/module/AttachmentPickerStatusModal.d.ts.map +1 -0
  317. package/lib/typescript/module/AttachmentPreviewStrip.d.ts +7 -0
  318. package/lib/typescript/module/AttachmentPreviewStrip.d.ts.map +1 -0
  319. package/lib/typescript/module/ChannelsPanel.d.ts +21 -0
  320. package/lib/typescript/module/ChannelsPanel.d.ts.map +1 -0
  321. package/lib/typescript/module/ConversationChat.d.ts +22 -0
  322. package/lib/typescript/module/ConversationChat.d.ts.map +1 -0
  323. package/lib/typescript/module/ConversationComposer.d.ts +24 -0
  324. package/lib/typescript/module/ConversationComposer.d.ts.map +1 -0
  325. package/lib/typescript/module/ConversationMessageList.d.ts +17 -0
  326. package/lib/typescript/module/ConversationMessageList.d.ts.map +1 -0
  327. package/lib/typescript/module/ConversationScreen.d.ts +80 -0
  328. package/lib/typescript/module/ConversationScreen.d.ts.map +1 -0
  329. package/lib/typescript/module/EditorDrawer.d.ts +67 -0
  330. package/lib/typescript/module/EditorDrawer.d.ts.map +1 -0
  331. package/lib/typescript/module/EditorTabPanel.d.ts +6 -0
  332. package/lib/typescript/module/EditorTabPanel.d.ts.map +1 -0
  333. package/lib/typescript/module/FilesPanel.d.ts +14 -0
  334. package/lib/typescript/module/FilesPanel.d.ts.map +1 -0
  335. package/lib/typescript/module/MarkdownText.d.ts +10 -0
  336. package/lib/typescript/module/MarkdownText.d.ts.map +1 -0
  337. package/lib/typescript/module/MessageActionBar.d.ts +8 -0
  338. package/lib/typescript/module/MessageActionBar.d.ts.map +1 -0
  339. package/lib/typescript/module/RenameAgentModal.d.ts +10 -0
  340. package/lib/typescript/module/RenameAgentModal.d.ts.map +1 -0
  341. package/lib/typescript/module/ShareAgentModal.d.ts +15 -0
  342. package/lib/typescript/module/ShareAgentModal.d.ts.map +1 -0
  343. package/lib/typescript/module/ShareAgentModal.styles.d.ts +229 -0
  344. package/lib/typescript/module/ShareAgentModal.styles.d.ts.map +1 -0
  345. package/lib/typescript/module/SuperagentHomeScreen.d.ts +4 -0
  346. package/lib/typescript/module/SuperagentHomeScreen.d.ts.map +1 -0
  347. package/lib/typescript/module/ToolApprovalCard.d.ts +13 -0
  348. package/lib/typescript/module/ToolApprovalCard.d.ts.map +1 -0
  349. package/lib/typescript/module/ToolCallSummary.d.ts +16 -0
  350. package/lib/typescript/module/ToolCallSummary.d.ts.map +1 -0
  351. package/lib/typescript/module/agentSphereStyles.d.ts +31 -0
  352. package/lib/typescript/module/agentSphereStyles.d.ts.map +1 -0
  353. package/lib/typescript/module/apiClient.d.ts +4 -0
  354. package/lib/typescript/module/apiClient.d.ts.map +1 -0
  355. package/lib/typescript/module/attachmentFileHelpers.d.ts +6 -0
  356. package/lib/typescript/module/attachmentFileHelpers.d.ts.map +1 -0
  357. package/lib/typescript/module/attachmentUpload.d.ts +12 -0
  358. package/lib/typescript/module/attachmentUpload.d.ts.map +1 -0
  359. package/lib/typescript/module/composerStyles.d.ts +241 -0
  360. package/lib/typescript/module/composerStyles.d.ts.map +1 -0
  361. package/lib/typescript/module/connectorBrandIcons.d.ts +7 -0
  362. package/lib/typescript/module/connectorBrandIcons.d.ts.map +1 -0
  363. package/lib/typescript/module/connectorCatalog.d.ts +3 -0
  364. package/lib/typescript/module/connectorCatalog.d.ts.map +1 -0
  365. package/lib/typescript/module/constants.d.ts +4 -0
  366. package/lib/typescript/module/constants.d.ts.map +1 -0
  367. package/lib/typescript/module/conversationParts.d.ts +29 -0
  368. package/lib/typescript/module/conversationParts.d.ts.map +1 -0
  369. package/lib/typescript/module/conversationRuntime.d.ts +67 -0
  370. package/lib/typescript/module/conversationRuntime.d.ts.map +1 -0
  371. package/lib/typescript/module/conversationStyles.d.ts +742 -0
  372. package/lib/typescript/module/conversationStyles.d.ts.map +1 -0
  373. package/lib/typescript/module/editorShellStyles.d.ts +1025 -0
  374. package/lib/typescript/module/editorShellStyles.d.ts.map +1 -0
  375. package/lib/typescript/module/editorTabs.d.ts +11 -0
  376. package/lib/typescript/module/editorTabs.d.ts.map +1 -0
  377. package/lib/typescript/module/fileTreeUtils.d.ts +17 -0
  378. package/lib/typescript/module/fileTreeUtils.d.ts.map +1 -0
  379. package/lib/typescript/module/index.d.ts +20 -0
  380. package/lib/typescript/module/index.d.ts.map +1 -0
  381. package/lib/typescript/module/markdownStyles.d.ts +150 -0
  382. package/lib/typescript/module/markdownStyles.d.ts.map +1 -0
  383. package/lib/typescript/module/mediaUtils.d.ts +9 -0
  384. package/lib/typescript/module/mediaUtils.d.ts.map +1 -0
  385. package/lib/typescript/module/messageActionStyles.d.ts +38 -0
  386. package/lib/typescript/module/messageActionStyles.d.ts.map +1 -0
  387. package/lib/typescript/module/messageUtils.d.ts +8 -0
  388. package/lib/typescript/module/messageUtils.d.ts.map +1 -0
  389. package/lib/typescript/module/nativeActionSheet.d.ts +6 -0
  390. package/lib/typescript/module/nativeActionSheet.d.ts.map +1 -0
  391. package/lib/typescript/module/nativeActionSheet.web.d.ts +3 -0
  392. package/lib/typescript/module/nativeActionSheet.web.d.ts.map +1 -0
  393. package/lib/typescript/module/package.json +1 -0
  394. package/lib/typescript/module/paperTheme.d.ts +3 -0
  395. package/lib/typescript/module/paperTheme.d.ts.map +1 -0
  396. package/lib/typescript/module/realtimeClient.d.ts +16 -0
  397. package/lib/typescript/module/realtimeClient.d.ts.map +1 -0
  398. package/lib/typescript/module/renameAgentModalStyles.d.ts +76 -0
  399. package/lib/typescript/module/renameAgentModalStyles.d.ts.map +1 -0
  400. package/lib/typescript/module/screenParts.d.ts +31 -0
  401. package/lib/typescript/module/screenParts.d.ts.map +1 -0
  402. package/lib/typescript/module/styles.d.ts +336 -0
  403. package/lib/typescript/module/styles.d.ts.map +1 -0
  404. package/lib/typescript/module/superagentApiClient.d.ts +66 -0
  405. package/lib/typescript/module/superagentApiClient.d.ts.map +1 -0
  406. package/lib/typescript/module/types.d.ts +437 -0
  407. package/lib/typescript/module/types.d.ts.map +1 -0
  408. package/lib/typescript/module/useSuperagentAttachmentPicker.d.ts +30 -0
  409. package/lib/typescript/module/useSuperagentAttachmentPicker.d.ts.map +1 -0
  410. package/lib/typescript/module/useSuperagentConversation.d.ts +36 -0
  411. package/lib/typescript/module/useSuperagentConversation.d.ts.map +1 -0
  412. package/lib/typescript/module/useSuperagentRuntime.d.ts +163 -0
  413. package/lib/typescript/module/useSuperagentRuntime.d.ts.map +1 -0
  414. package/package.json +87 -0
  415. package/src/AgentSettingsPanel.tsx +1122 -0
  416. package/src/AgentSphereIcon.tsx +170 -0
  417. package/src/AttachmentPickerStatusModal.tsx +80 -0
  418. package/src/AttachmentPreviewStrip.tsx +38 -0
  419. package/src/ChannelsPanel.tsx +705 -0
  420. package/src/ConversationChat.tsx +245 -0
  421. package/src/ConversationComposer.tsx +368 -0
  422. package/src/ConversationMessageList.tsx +140 -0
  423. package/src/ConversationScreen.tsx +320 -0
  424. package/src/EditorDrawer.tsx +1297 -0
  425. package/src/EditorTabPanel.tsx +19 -0
  426. package/src/FilesPanel.tsx +577 -0
  427. package/src/MarkdownText.tsx +317 -0
  428. package/src/MessageActionBar.tsx +126 -0
  429. package/src/RenameAgentModal.tsx +107 -0
  430. package/src/ShareAgentModal.styles.ts +95 -0
  431. package/src/ShareAgentModal.tsx +320 -0
  432. package/src/SuperagentHomeScreen.tsx +318 -0
  433. package/src/ToolApprovalCard.tsx +592 -0
  434. package/src/ToolCallSummary.tsx +599 -0
  435. package/src/agentSphereStyles.ts +25 -0
  436. package/src/apiClient.ts +189 -0
  437. package/src/attachmentFileHelpers.ts +109 -0
  438. package/src/attachmentUpload.ts +112 -0
  439. package/src/composerStyles.ts +167 -0
  440. package/src/connectorBrandIcons.tsx +69 -0
  441. package/src/connectorCatalog.ts +414 -0
  442. package/src/constants.ts +9 -0
  443. package/src/conversationParts.tsx +307 -0
  444. package/src/conversationRuntime.ts +171 -0
  445. package/src/conversationStyles.ts +412 -0
  446. package/src/editorShellStyles.ts +1023 -0
  447. package/src/editorTabs.ts +26 -0
  448. package/src/fileTreeUtils.ts +165 -0
  449. package/src/index.ts +110 -0
  450. package/src/markdownStyles.ts +64 -0
  451. package/src/mediaUtils.ts +75 -0
  452. package/src/messageActionStyles.ts +26 -0
  453. package/src/messageUtils.ts +58 -0
  454. package/src/nativeActionSheet.ts +25 -0
  455. package/src/nativeActionSheet.web.ts +5 -0
  456. package/src/paperTheme.ts +52 -0
  457. package/src/realtimeClient.ts +149 -0
  458. package/src/renameAgentModalStyles.ts +77 -0
  459. package/src/screenParts.tsx +185 -0
  460. package/src/styles.ts +190 -0
  461. package/src/superagentApiClient.ts +895 -0
  462. package/src/types.ts +514 -0
  463. package/src/useSuperagentAttachmentPicker.tsx +117 -0
  464. package/src/useSuperagentConversation.ts +242 -0
  465. package/src/useSuperagentRuntime.ts +1371 -0
@@ -0,0 +1,189 @@
1
+ import type {
2
+ QueuedSuperagentMessage,
3
+ SuperagentConversation,
4
+ SuperagentMessage,
5
+ SuperagentNativeClient,
6
+ SuperagentNativeClientConfig,
7
+ SuperagentPaginatedMessages,
8
+ } from './types';
9
+
10
+ type QueryValue = string | number | boolean | undefined;
11
+
12
+ export function createSuperagentNativeClient({
13
+ apiBaseUrl,
14
+ appId,
15
+ getAuthToken,
16
+ getHeaders,
17
+ }: SuperagentNativeClientConfig): SuperagentNativeClient {
18
+ const request = async <TResponse>(
19
+ method: string,
20
+ path: string,
21
+ options: {
22
+ body?: unknown;
23
+ query?: Record<string, QueryValue>;
24
+ headers?: Record<string, string>;
25
+ } = {},
26
+ ): Promise<TResponse> => {
27
+ const token = await getAuthToken();
28
+ const extraHeaders = await getHeaders?.();
29
+ const response = await fetch(buildUrl(apiBaseUrl, path, options.query), {
30
+ method,
31
+ headers: {
32
+ ...(options.body === undefined ? {} : { 'Content-Type': 'application/json' }),
33
+ ...(token ? { Authorization: `Bearer ${token}` } : {}),
34
+ ...extraHeaders,
35
+ ...options.headers,
36
+ },
37
+ body: options.body === undefined ? undefined : JSON.stringify(options.body),
38
+ });
39
+
40
+ if (!response.ok) {
41
+ throw await createClientError(response);
42
+ }
43
+
44
+ if (response.status === 204) {
45
+ return undefined as TResponse;
46
+ }
47
+
48
+ return response.json() as Promise<TResponse>;
49
+ };
50
+
51
+ const basePath = `/${pathSegment(appId, 'appId')}/user-agent/conversations`;
52
+
53
+ return {
54
+ getConversations(limit = 1) {
55
+ return request<SuperagentConversation[]>('GET', basePath, {
56
+ query: { sort: '-updated_date', limit },
57
+ });
58
+ },
59
+ getConversation(conversationId) {
60
+ return request<SuperagentConversation>('GET', `${basePath}/${pathSegment(conversationId, 'conversationId')}`);
61
+ },
62
+ getMessages(conversationId, params = {}) {
63
+ return request<SuperagentPaginatedMessages>('GET', `${basePath}/${pathSegment(conversationId, 'conversationId')}/messages`, {
64
+ query: params,
65
+ });
66
+ },
67
+ createConversation(metadata = {}) {
68
+ return request<SuperagentConversation>('POST', basePath, { body: { metadata } });
69
+ },
70
+ addMessage(conversationId, message) {
71
+ return request('POST', `${basePath}/${pathSegment(conversationId, 'conversationId')}/messages`, {
72
+ body: serializeMessageForBackend(message),
73
+ });
74
+ },
75
+ stopConversation(conversationId) {
76
+ return request<void>('POST', `${basePath}/${pathSegment(conversationId, 'conversationId')}/stop`);
77
+ },
78
+ getQueuedMessages(conversationId) {
79
+ return request<{ messages: QueuedSuperagentMessage[] }>(
80
+ 'GET',
81
+ `${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages`,
82
+ );
83
+ },
84
+ editQueuedMessage(conversationId, messageId, content) {
85
+ return request<{ ok: boolean }>(
86
+ 'PUT',
87
+ `${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages/${pathSegment(messageId, 'messageId')}`,
88
+ { body: { content } },
89
+ );
90
+ },
91
+ deleteQueuedMessage(conversationId, messageId) {
92
+ return request<{ ok: boolean }>(
93
+ 'DELETE',
94
+ `${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages/${pathSegment(messageId, 'messageId')}`,
95
+ );
96
+ },
97
+ deleteMessage(conversationId, messageId) {
98
+ return request<{ message: string }>(
99
+ 'DELETE',
100
+ `${basePath}/${pathSegment(conversationId, 'conversationId')}/messages/${pathSegment(messageId, 'messageId')}`,
101
+ );
102
+ },
103
+ submitToolCallInput(conversationId, toolCallId, approve, extraUserInput, originRequestId) {
104
+ return request<SuperagentConversation>(
105
+ 'POST',
106
+ `${basePath}/${pathSegment(conversationId, 'conversationId')}/submit-tool-call-input`,
107
+ {
108
+ body: {
109
+ tool_call_id: toolCallId,
110
+ action: approve ? 'approved' : 'rejected',
111
+ extra_user_input: extraUserInput,
112
+ },
113
+ headers: originRequestId ? { 'X-Request-ID': originRequestId } : undefined,
114
+ },
115
+ );
116
+ },
117
+ };
118
+ }
119
+
120
+ function buildUrl(baseUrl: string, path: string, query?: Record<string, QueryValue>) {
121
+ const normalizedBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
122
+ const url = `${normalizedBase}${path}`;
123
+ const queryString = buildQueryString(query);
124
+ return queryString ? `${url}?${queryString}` : url;
125
+ }
126
+
127
+ function buildQueryString(query?: Record<string, QueryValue>) {
128
+ return Object.entries(query ?? {})
129
+ .filter(([, value]) => value !== undefined)
130
+ .map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)
131
+ .join('&');
132
+ }
133
+
134
+ function pathSegment(value: string, name: string) {
135
+ if (!value || value.includes('\0')) {
136
+ throw new Error(`Invalid ${name}`);
137
+ }
138
+
139
+ return encodeURIComponent(value);
140
+ }
141
+
142
+ async function createClientError(response: Response) {
143
+ let message = `Request failed with status ${response.status}`;
144
+
145
+ try {
146
+ const body = await response.json();
147
+ if (typeof body?.message === 'string') message = body.message;
148
+ else if (typeof body?.detail === 'string') message = body.detail;
149
+ } catch {
150
+ // Keep the status-based fallback message.
151
+ }
152
+
153
+ const error = new Error(message) as Error & { status?: number };
154
+ error.status = response.status;
155
+ return error;
156
+ }
157
+
158
+ function serializeMessageForBackend(message: Partial<SuperagentMessage>) {
159
+ const {
160
+ createdAt,
161
+ created_at,
162
+ fileUrls,
163
+ file_urls,
164
+ replyTo,
165
+ toolCalls,
166
+ tool_calls,
167
+ ...backendMessage
168
+ } = message;
169
+
170
+ const additionalParams = {
171
+ ...backendMessage.additional_message_params,
172
+ ...(replyTo ? { reply_to: { message_id: replyTo.messageId, content: replyTo.content } } : {}),
173
+ };
174
+
175
+ return omitUndefined({
176
+ ...backendMessage,
177
+ file_urls: file_urls ?? fileUrls,
178
+ tool_calls: tool_calls ?? toolCalls,
179
+ additional_message_params: Object.keys(additionalParams).length > 0 ? additionalParams : undefined,
180
+ });
181
+ }
182
+
183
+ function omitUndefined<T extends Record<string, unknown>>(value: T) {
184
+ return Object.fromEntries(
185
+ Object.entries(value).filter(([, entry]) => entry !== undefined),
186
+ );
187
+ }
188
+
189
+ export type { SuperagentNativeClient };
@@ -0,0 +1,109 @@
1
+ import type {SuperagentNativeMediaItem} from './useSuperagentAttachmentPicker';
2
+ import {
3
+ SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB,
4
+ SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS,
5
+ } from './mediaUtils';
6
+
7
+ export function validateNativeAttachment(item: SuperagentNativeMediaItem, name: string, extension: string) {
8
+ if (!SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS.includes(extension as typeof SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS[number])) {
9
+ throw new Error(`File type "${extension || 'unknown'}" is not supported.`);
10
+ }
11
+
12
+ const limitMb = SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB[extension] ?? 5;
13
+ if (typeof item.size === 'number' && item.size > limitMb * 1024 * 1024) {
14
+ throw new Error(`File "${name}" exceeds the maximum size of ${limitMb}MB.`);
15
+ }
16
+ }
17
+
18
+ export function getUploadName(item: SuperagentNativeMediaItem, index: number) {
19
+ const baseName = item.name || getNameFromUri(item.uri) || `attachment-${index + 1}`;
20
+ if (getExtension(baseName)) {
21
+ return baseName;
22
+ }
23
+
24
+ const extension = getExtension(item.uri) || getExtensionForMimeType(item.mimeType) || '.jpg';
25
+ return `${baseName}${extension}`;
26
+ }
27
+
28
+ export function getExtension(value?: string) {
29
+ const cleanValue = String(value || '').split('?')[0].toLowerCase();
30
+ const index = cleanValue.lastIndexOf('.');
31
+ return index >= 0 ? cleanValue.slice(index) : '';
32
+ }
33
+
34
+ export function getMimeType(item: SuperagentNativeMediaItem, extension: string) {
35
+ if (item.mimeType) {
36
+ return item.mimeType;
37
+ }
38
+
39
+ switch (extension) {
40
+ case '.jpg':
41
+ case '.jpeg':
42
+ return 'image/jpeg';
43
+ case '.png':
44
+ return 'image/png';
45
+ case '.webp':
46
+ return 'image/webp';
47
+ case '.pdf':
48
+ return 'application/pdf';
49
+ case '.csv':
50
+ return 'text/csv';
51
+ case '.html':
52
+ return 'text/html';
53
+ case '.txt':
54
+ return 'text/plain';
55
+ case '.xlsx':
56
+ return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
57
+ case '.docx':
58
+ return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
59
+ case '.json':
60
+ return 'application/json';
61
+ case '.md':
62
+ return 'text/markdown';
63
+ default:
64
+ return 'application/octet-stream';
65
+ }
66
+ }
67
+
68
+ function getNameFromUri(uri?: string) {
69
+ if (!uri) {
70
+ return null;
71
+ }
72
+
73
+ const cleanUri = uri.split('?')[0];
74
+ const name = cleanUri.split('/').filter(Boolean).pop();
75
+ if (!name || name.startsWith('ph:')) {
76
+ return null;
77
+ }
78
+
79
+ try {
80
+ return decodeURIComponent(name);
81
+ } catch {
82
+ return name;
83
+ }
84
+ }
85
+
86
+ function getExtensionForMimeType(mimeType?: string) {
87
+ switch (mimeType) {
88
+ case 'image/jpeg':
89
+ return '.jpg';
90
+ case 'image/png':
91
+ return '.png';
92
+ case 'image/webp':
93
+ return '.webp';
94
+ case 'application/pdf':
95
+ return '.pdf';
96
+ case 'text/plain':
97
+ return '.txt';
98
+ case 'text/html':
99
+ return '.html';
100
+ case 'text/csv':
101
+ return '.csv';
102
+ case 'application/json':
103
+ return '.json';
104
+ case 'text/markdown':
105
+ return '.md';
106
+ default:
107
+ return null;
108
+ }
109
+ }
@@ -0,0 +1,112 @@
1
+ import type {SuperagentMediaActionContext, SuperagentMediaAttachment} from './types';
2
+ import type {
3
+ SuperagentAttachmentPickerAdapters,
4
+ SuperagentAttachmentPickerMode,
5
+ SuperagentNativeMediaItem,
6
+ } from './useSuperagentAttachmentPicker';
7
+ import {
8
+ getExtension,
9
+ getMimeType,
10
+ getUploadName,
11
+ validateNativeAttachment,
12
+ } from './attachmentFileHelpers';
13
+
14
+ const MAX_ATTACHMENTS = 10;
15
+ const IMAGE_EXTENSIONS = new Set(['.jpg', '.jpeg', '.png', '.webp']);
16
+
17
+ export async function pickAndUploadAttachments({
18
+ authToken,
19
+ baseUrl,
20
+ context,
21
+ mode,
22
+ nativeAdapters,
23
+ onUploadStart,
24
+ }: {
25
+ authToken: string;
26
+ baseUrl: string;
27
+ context: SuperagentMediaActionContext;
28
+ mode: SuperagentAttachmentPickerMode;
29
+ nativeAdapters: SuperagentAttachmentPickerAdapters;
30
+ onUploadStart?: (count: number) => void;
31
+ }) {
32
+ const items = await nativeAdapters.pickNativeMedia(mode);
33
+ const uploadItems = (items ?? []).filter((item) => Boolean(item?.uri || item?.uploadUri)).slice(0, MAX_ATTACHMENTS);
34
+ if (!uploadItems.length) {
35
+ return [];
36
+ }
37
+
38
+ onUploadStart?.(uploadItems.length);
39
+
40
+ const attachments: SuperagentMediaAttachment[] = [];
41
+ for (const [index, item] of uploadItems.entries()) {
42
+ attachments.push(await uploadNativeItem({authToken, baseUrl, agentId: context.agentId, index, item}));
43
+ }
44
+
45
+ return attachments;
46
+ }
47
+
48
+ export function getAttachmentPickerErrorMessage(error: unknown) {
49
+ if (error instanceof Error && error.message) {
50
+ return error.message;
51
+ }
52
+ const candidate = error as {message?: unknown} | null;
53
+ return typeof candidate?.message === 'string' && candidate.message ?
54
+ candidate.message :
55
+ 'Failed to attach the selected file.';
56
+ }
57
+
58
+ async function uploadNativeItem({
59
+ agentId,
60
+ authToken,
61
+ baseUrl,
62
+ index,
63
+ item,
64
+ }: {
65
+ agentId: string;
66
+ authToken: string;
67
+ baseUrl: string;
68
+ index: number;
69
+ item: SuperagentNativeMediaItem;
70
+ }) {
71
+ const uri = item.uploadUri ?? item.uri;
72
+ if (!uri) {
73
+ throw new Error('The selected file does not have a readable local URI.');
74
+ }
75
+
76
+ const name = getUploadName(item, index);
77
+ const extension = getExtension(name);
78
+ validateNativeAttachment(item, name, extension);
79
+
80
+ const formData = new FormData();
81
+ formData.append('file', {
82
+ name,
83
+ type: getMimeType(item, extension),
84
+ uri,
85
+ } as unknown as Blob);
86
+
87
+ const response = await fetch(`${normalizeBaseUrl(baseUrl)}/api/files/apps/${encodeURIComponent(agentId)}/upload`, {
88
+ body: formData,
89
+ headers: {
90
+ Authorization: `Bearer ${authToken}`,
91
+ 'X-Client-Platform': 'mobile_native',
92
+ },
93
+ method: 'POST',
94
+ });
95
+ const body = await response.json().catch(() => ({}));
96
+
97
+ if (!response.ok || typeof body.url !== 'string') {
98
+ throw new Error(body.message || body.detail || 'Upload failed.');
99
+ }
100
+
101
+ return {
102
+ kind: IMAGE_EXTENSIONS.has(extension) ? 'image' : 'file',
103
+ mimeType: getMimeType(item, extension),
104
+ name,
105
+ previewUri: item.thumbnailUri ?? item.previewUri ?? item.uri,
106
+ url: body.url,
107
+ } satisfies SuperagentMediaAttachment;
108
+ }
109
+
110
+ function normalizeBaseUrl(url: string) {
111
+ return url.trim().replace(/\/+$/, '');
112
+ }
@@ -0,0 +1,167 @@
1
+ import { StyleSheet } from 'react-native';
2
+
3
+ export const composerStyles = StyleSheet.create({
4
+ wrap: {
5
+ alignItems: 'center',
6
+ backgroundColor: '#000000',
7
+ paddingBottom: 14,
8
+ paddingHorizontal: 8,
9
+ paddingTop: 6,
10
+ },
11
+ shell: {
12
+ alignItems: 'flex-end',
13
+ backgroundColor: '#151515',
14
+ borderColor: '#2A2A2A',
15
+ borderRadius: 28,
16
+ borderWidth: 1,
17
+ flexDirection: 'row',
18
+ minHeight: 58,
19
+ paddingHorizontal: 7,
20
+ paddingVertical: 6,
21
+ position: 'relative',
22
+ width: '100%',
23
+ },
24
+ attachmentMenu: {
25
+ backgroundColor: 'rgba(22, 22, 22, 0.96)',
26
+ borderColor: '#2A2A2A',
27
+ borderRadius: 28,
28
+ borderWidth: 1,
29
+ bottom: 64,
30
+ left: 0,
31
+ minWidth: 250,
32
+ overflow: 'hidden',
33
+ paddingBottom: 10,
34
+ paddingTop: 10,
35
+ position: 'absolute',
36
+ shadowColor: '#000000',
37
+ shadowOffset: { height: 20, width: 0 },
38
+ shadowOpacity: 0.35,
39
+ shadowRadius: 30,
40
+ zIndex: 20,
41
+ },
42
+ attachmentMenuIcon: {
43
+ alignItems: 'center',
44
+ backgroundColor: '#252528',
45
+ borderRadius: 20,
46
+ height: 40,
47
+ justifyContent: 'center',
48
+ marginRight: 16,
49
+ width: 40,
50
+ },
51
+ attachmentMenuItem: {
52
+ alignItems: 'center',
53
+ flexDirection: 'row',
54
+ minHeight: 58,
55
+ paddingHorizontal: 18,
56
+ },
57
+ attachmentMenuItemText: { color: '#F4F4F5', fontSize: 20, fontWeight: '600' },
58
+ attachmentMenuItemTextDisabled: { color: '#8E8E93' },
59
+ attachmentMenuSectionLabel: {
60
+ color: '#A1A1AA',
61
+ fontSize: 12,
62
+ fontWeight: '800',
63
+ marginBottom: 2,
64
+ marginTop: 8,
65
+ paddingHorizontal: 18,
66
+ },
67
+ iconButton: { alignItems: 'center', borderRadius: 22, height: 44, justifyContent: 'center', minWidth: 44, paddingHorizontal: 9 },
68
+ iconButtonText: { color: '#F4F4F5', fontSize: 13, fontWeight: '800' },
69
+ activeButton: { backgroundColor: '#2A2A2A' },
70
+ disabledButton: { opacity: 0.38 },
71
+ input: {
72
+ backgroundColor: '#151515',
73
+ color: '#F4F4F5',
74
+ flex: 1,
75
+ fontSize: 18,
76
+ lineHeight: 24,
77
+ maxHeight: 120,
78
+ minHeight: 44,
79
+ paddingHorizontal: 6,
80
+ paddingBottom: 9,
81
+ paddingTop: 10,
82
+ },
83
+ replyPreview: {
84
+ alignItems: 'center',
85
+ backgroundColor: '#151515',
86
+ borderColor: '#2A2A2A',
87
+ borderRadius: 16,
88
+ borderWidth: 1,
89
+ flexDirection: 'row',
90
+ marginBottom: 8,
91
+ maxWidth: 900,
92
+ minHeight: 48,
93
+ paddingHorizontal: 12,
94
+ paddingVertical: 8,
95
+ width: '100%',
96
+ },
97
+ replyPreviewClose: {
98
+ alignItems: 'center',
99
+ borderRadius: 15,
100
+ height: 30,
101
+ justifyContent: 'center',
102
+ marginLeft: 8,
103
+ width: 30,
104
+ },
105
+ replyPreviewMarker: {
106
+ alignSelf: 'stretch',
107
+ backgroundColor: '#FF5A1F',
108
+ borderRadius: 2,
109
+ marginRight: 10,
110
+ width: 3,
111
+ },
112
+ replyPreviewText: {
113
+ color: '#D4D4D8',
114
+ flex: 1,
115
+ fontSize: 14,
116
+ fontWeight: '700',
117
+ lineHeight: 19,
118
+ },
119
+ sendButton: {
120
+ alignItems: 'center',
121
+ backgroundColor: '#F4F4F5',
122
+ borderRadius: 22,
123
+ height: 44,
124
+ justifyContent: 'center',
125
+ width: 44,
126
+ },
127
+ sendButtonDisabled: { backgroundColor: '#2A2A2A' },
128
+ sendButtonText: { color: '#111111', fontSize: 21, fontWeight: '900', lineHeight: 24 },
129
+ liveActionButton: { backgroundColor: '#151515', borderColor: '#2A2A2A', borderWidth: 1 },
130
+ stopButton: {
131
+ alignItems: 'center',
132
+ backgroundColor: '#F4F4F5',
133
+ borderRadius: 22,
134
+ height: 44,
135
+ justifyContent: 'center',
136
+ width: 44,
137
+ },
138
+ stopButtonText: { color: '#111111', fontSize: 18, fontWeight: '900', lineHeight: 22 },
139
+ attachmentStrip: { flexDirection: 'row', flexWrap: 'wrap', marginBottom: 8, maxWidth: 900, width: '100%' },
140
+ attachmentItem: {
141
+ backgroundColor: '#151515',
142
+ borderColor: '#2A2A2A',
143
+ borderRadius: 12,
144
+ borderWidth: 1,
145
+ marginRight: 8,
146
+ marginTop: 8,
147
+ maxWidth: 180,
148
+ overflow: 'hidden',
149
+ },
150
+ attachmentImage: { height: 72, width: 72 },
151
+ attachmentFile: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 10, paddingVertical: 8 },
152
+ attachmentFileIcon: { color: '#A1A1AA', fontSize: 13, fontWeight: '800', marginRight: 6 },
153
+ attachmentName: { color: '#D4D4D8', flexShrink: 1, fontSize: 12, fontWeight: '700' },
154
+ removeAttachment: {
155
+ alignItems: 'center',
156
+ backgroundColor: '#F4F4F5',
157
+ borderRadius: 9,
158
+ height: 18,
159
+ justifyContent: 'center',
160
+ position: 'absolute',
161
+ right: 4,
162
+ top: 4,
163
+ width: 18,
164
+ },
165
+ removeAttachmentText: { color: '#111111', fontSize: 12, fontWeight: '800', lineHeight: 14 },
166
+ errorText: { color: '#FCA5A5', fontSize: 12, marginBottom: 6, maxWidth: 900, width: '100%' },
167
+ });
@@ -0,0 +1,69 @@
1
+ import React from 'react';
2
+ import { SvgXml } from 'react-native-svg';
3
+
4
+ const CONNECTOR_BRAND_ICON_XML: Record<string, string> = {
5
+ salesforce: `
6
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0.5 -149.38 999 999">
7
+ <path fill="#00A1E0" d="M416.224 76.763c32.219-33.57 77.074-54.391 126.682-54.391 65.946 0 123.48 36.772 154.12 91.361 26.626-11.896 56.098-18.514 87.106-18.514 118.94 0 215.368 97.268 215.368 217.247 0 119.993-96.428 217.261-215.368 217.261a213.735 213.735 0 0 1-42.422-4.227c-26.981 48.128-78.397 80.646-137.412 80.646-24.705 0-48.072-5.706-68.877-15.853-27.352 64.337-91.077 109.448-165.348 109.448-77.344 0-143.261-48.939-168.563-117.574-11.057 2.348-22.513 3.572-34.268 3.572C75.155 585.74.5 510.317.5 417.262c0-62.359 33.542-116.807 83.378-145.937-10.26-23.608-15.967-49.665-15.967-77.06C67.911 87.25 154.79.5 261.948.5c62.914 0 118.827 29.913 154.276 76.263"/>
8
+ </svg>`,
9
+ gmail: `
10
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="2 6 44 36">
11
+ <path fill="#4caf50" d="M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"/>
12
+ <path fill="#1e88e5" d="M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"/>
13
+ <polygon fill="#e53935" points="35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"/>
14
+ <path fill="#c62828" d="M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8C4.924,8,3,9.924,3,12.298z"/>
15
+ <path fill="#fbc02d" d="M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8C43.076,8,45,9.924,45,12.298z"/>
16
+ </svg>`,
17
+ googlecalendar: `
18
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
19
+ <path fill="#fff" d="M195.368 60.632H60.632v134.736h134.736z"/>
20
+ <path fill="#ea4335" d="M195.368 256L256 195.368l-30.316-5.172l-30.316 5.172l-5.533 27.73z"/>
21
+ <path fill="#188038" d="M0 195.368v40.421C0 246.956 9.044 256 20.21 256h40.422l6.225-30.316l-6.225-30.316l-33.033-5.172z"/>
22
+ <path fill="#1967d2" d="M256 60.632V20.21C256 9.044 246.956 0 235.79 0h-40.422q-5.532 22.554-5.533 33.196q0 10.641 5.533 27.436q20.115 5.76 30.316 5.76T256 60.631"/>
23
+ <path fill="#fbbc04" d="M256 60.632h-60.632v134.736H256z"/>
24
+ <path fill="#34a853" d="M195.368 195.368H60.632V256h134.736z"/>
25
+ <path fill="#4285f4" d="M195.368 0H20.211C9.044 0 0 9.044 0 20.21v175.158h60.632V60.632h134.736z"/>
26
+ <path fill="#4285f4" d="M88.27 165.154c-5.036-3.402-8.523-8.37-10.426-14.94l11.689-4.816q1.59 6.063 5.558 9.398c2.627 2.223 5.827 3.318 9.566 3.318q5.734 0 9.852-3.487c2.746-2.324 4.127-5.288 4.127-8.875q0-5.508-4.345-8.994c-2.897-2.324-6.535-3.486-10.88-3.486h-6.754v-11.57h6.063q5.608 0 9.448-3.033c2.56-2.02 3.84-4.783 3.84-8.303c0-3.132-1.145-5.625-3.435-7.494c-2.29-1.87-5.188-2.813-8.708-2.813c-3.436 0-6.164.91-8.185 2.745a16.1 16.1 0 0 0-4.413 6.754l-11.57-4.817c1.532-4.345 4.345-8.185 8.471-11.503s9.398-4.985 15.798-4.985c4.733 0 8.994.91 12.767 2.745c3.772 1.836 6.736 4.379 8.875 7.613c2.14 3.25 3.2 6.888 3.2 10.93c0 4.126-.993 7.613-2.98 10.476s-4.43 5.052-7.327 6.585v.69a22.25 22.25 0 0 1 9.398 7.327c2.442 3.284 3.672 7.208 3.672 11.79c0 4.58-1.163 8.673-3.487 12.26c-2.324 3.588-5.54 6.417-9.617 8.472c-4.092 2.055-8.69 3.1-13.793 3.1c-5.912.016-11.369-1.685-16.405-5.087m71.797-58.005l-12.833 9.28l-6.417-9.734l23.023-16.607h8.825v78.333h-12.598z"/>
27
+ </svg>`,
28
+ googledrive: `
29
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 112 100">
30
+ <path d="M8.46154 85.7051L13.3974 94.2308C14.4231 96.0256 15.8974 97.4359 17.6282 98.4615L35.2564 67.9487H0C0 69.9359 0.512821 71.9231 1.53846 73.7179L8.46154 85.7051Z" fill="#0066DA"/>
31
+ <path d="M55.9615 32.0513L38.3333 1.53846C36.6026 2.5641 35.1282 3.97436 34.1026 5.76923L1.53846 62.1795C0.531683 63.9357 0.00134047 65.9244 0 67.9487H35.2564L55.9615 32.0513Z" fill="#00AC47"/>
32
+ <path d="M94.2949 98.4615C96.0256 97.4359 97.5 96.0256 98.5256 94.2308L100.577 90.7051L110.385 73.7179C111.41 71.9231 111.923 69.9359 111.923 67.9487H76.6641L84.1667 82.6923L94.2949 98.4615Z" fill="#EA4335"/>
33
+ <path d="M55.9615 32.0513L73.5898 1.53846C71.859 0.512821 69.8718 0 67.8205 0H44.1026C42.0513 0 40.0641 0.576923 38.3333 1.53846L55.9615 32.0513Z" fill="#00832D"/>
34
+ <path d="M76.6667 67.9487H35.2564L17.6282 98.4615C19.359 99.4872 21.3462 100 23.3974 100H88.5256C90.5769 100 92.5641 99.4231 94.2949 98.4615L76.6667 67.9487Z" fill="#2684FC"/>
35
+ <path d="M94.1026 33.9744L77.8205 5.76923C76.7949 3.97436 75.3205 2.5641 73.5897 1.53846L55.9615 32.0513L76.6667 67.9487H111.859C111.859 65.9615 111.346 63.9744 110.321 62.1795L94.1026 33.9744Z" fill="#FFBA00"/>
36
+ </svg>`,
37
+ notion: `
38
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
39
+ <path fill="#fff" d="M16.092 11.538L164.09.608c18.179-1.56 22.85-.508 34.28 7.801l47.243 33.282C253.406 47.414 256 48.975 256 55.207v182.527c0 11.439-4.155 18.205-18.696 19.24L65.44 267.378c-10.913.517-16.11-1.043-21.825-8.327L8.826 213.814C2.586 205.487 0 199.254 0 191.97V29.726c0-9.352 4.155-17.153 16.092-18.188"/>
40
+ <path fill="#111" d="M164.09.608L16.092 11.538C4.155 12.573 0 20.374 0 29.726v162.245c0 7.284 2.585 13.516 8.826 21.843l34.789 45.237c5.715 7.284 10.912 8.844 21.825 8.327l171.864-10.404c14.532-1.035 18.696-7.801 18.696-19.24V55.207c0-5.911-2.336-7.614-9.21-12.66l-1.185-.856L198.37 8.409C186.94.1 182.27-.952 164.09.608M69.327 52.22c-14.033.945-17.216 1.159-25.186-5.323L23.876 30.778c-2.06-2.086-1.026-4.69 4.163-5.207l142.274-10.395c11.947-1.043 18.17 3.12 22.842 6.758l24.401 17.68c1.043.525 3.638 3.637.517 3.637L71.146 52.095zm-16.36 183.954V81.222c0-6.767 2.077-9.887 8.3-10.413L230.02 60.93c5.724-.517 8.31 3.12 8.31 9.879v153.917c0 6.767-1.044 12.49-10.387 13.008l-161.487 9.361c-9.343.517-13.489-2.594-13.489-10.921M212.377 89.53c1.034 4.681 0 9.362-4.681 9.897l-7.783 1.542v114.404c-6.758 3.637-12.981 5.715-18.18 5.715c-8.308 0-10.386-2.604-16.609-10.396l-50.898-80.079v77.476l16.1 3.646s0 9.362-12.989 9.362l-35.814 2.077c-1.043-2.086 0-7.284 3.63-8.318l9.351-2.595V109.823l-12.98-1.052c-1.044-4.68 1.55-11.439 8.826-11.965l38.426-2.585l52.958 81.113v-71.76l-13.498-1.552c-1.043-5.733 3.111-9.896 8.3-10.404z"/>
41
+ </svg>`,
42
+ slack: `
43
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
44
+ <path fill="#de1c59" d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317S.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317c-7.33 0-13.317-5.987-13.317-13.317zm0 0"/>
45
+ <path fill="#35c5f0" d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309S39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0"/>
46
+ <path fill="#2eb57d" d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317s13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0"/>
47
+ <path fill="#ebb02e" d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309s-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317c0 7.33-5.987 13.317-13.317 13.317zm0 0"/>
48
+ </svg>`,
49
+ slackbot: `
50
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
51
+ <path fill="#de1c59" d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317S.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317c-7.33 0-13.317-5.987-13.317-13.317zm0 0"/>
52
+ <path fill="#35c5f0" d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309S39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0"/>
53
+ <path fill="#2eb57d" d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317s13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0"/>
54
+ <path fill="#ebb02e" d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309s-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317c0 7.33-5.987 13.317-13.317 13.317zm0 0"/>
55
+ </svg>`,
56
+ };
57
+
58
+ export function hasConnectorBrandIcon(connectorId: string) {
59
+ return !!CONNECTOR_BRAND_ICON_XML[connectorId];
60
+ }
61
+
62
+ export function ConnectorBrandIcon({ connectorId, size }: { connectorId: string; size: number }) {
63
+ const xml = CONNECTOR_BRAND_ICON_XML[connectorId];
64
+ if (!xml) {
65
+ return null;
66
+ }
67
+
68
+ return <SvgXml height={size} width={size} xml={xml} />;
69
+ }