@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,1122 @@
1
+ "use strict";
2
+
3
+ import React, { useEffect, useMemo, useState } from 'react';
4
+ import { ActivityIndicator, Modal, Pressable, ScrollView, Text, TextInput, View } from 'react-native';
5
+ import { AlertCircle, Archive, BriefcaseBusiness, CalendarDays, Check, ChevronDown, Coins, Cloud, Database, Edit3, FileText, GitBranch, HardDrive, Mail, MessageCircle, MoreHorizontal, Plug, Play, RotateCcw, Search, Settings, Timer, ToggleLeft, ToggleRight, Trash2, Unplug, Webhook, X, Zap } from 'lucide-react-native';
6
+ import { AgentSettingsPanel } from "./AgentSettingsPanel.js";
7
+ import { AgentSphereIcon } from "./AgentSphereIcon.js";
8
+ import { ChannelsPanel } from "./ChannelsPanel.js";
9
+ import { ConnectorBrandIcon, hasConnectorBrandIcon } from "./connectorBrandIcons.js";
10
+ import { SUPERAGENT_CONNECTOR_CATALOG } from "./connectorCatalog.js";
11
+ import { EDITOR_TAB_SECTIONS, getEditorTabLabel } from "./editorTabs.js";
12
+ import { editorShellStyles } from "./editorShellStyles.js";
13
+ import { FilesPanel } from "./FilesPanel.js";
14
+ import { styles } from "./styles.js";
15
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
16
+ const CONNECTOR_ICONS = {
17
+ github: GitBranch,
18
+ gmail: Mail,
19
+ googlecalendar: CalendarDays,
20
+ googledocs: FileText,
21
+ googledrive: HardDrive,
22
+ googlesheets: Database,
23
+ hubspot: BriefcaseBusiness,
24
+ notion: FileText,
25
+ outlook: Mail,
26
+ salesforce: Cloud,
27
+ slack: MessageCircle,
28
+ slackbot: MessageCircle,
29
+ stripe: Database
30
+ };
31
+ const AUTOMATION_ICONS = {
32
+ connector: Webhook,
33
+ entity: Zap,
34
+ scheduled: Timer
35
+ };
36
+ const SETTING_TABS = EDITOR_TAB_SECTIONS.flatMap(section => section.tabs).filter(tab => tab.id !== 'chat');
37
+ export function EditorDrawer({
38
+ activeTab,
39
+ agent,
40
+ automations,
41
+ automationCredits,
42
+ availableConnectors,
43
+ channelStatus,
44
+ collaborators,
45
+ connectedConnectors,
46
+ connectingChannelId,
47
+ connectingConnectorId,
48
+ fileLoadError,
49
+ fileLoadFailed,
50
+ filePaths,
51
+ isLoadingAgentSettings,
52
+ isLoadingChannels,
53
+ isLoadingCollaborators,
54
+ isLoadingFiles,
55
+ isLoadingAutomations,
56
+ isLoadingConnectors,
57
+ isVisible,
58
+ secrets,
59
+ onClose,
60
+ onCancelConnectorConnection,
61
+ onArchiveAutomation,
62
+ onCloneAgent,
63
+ onConnectConnector,
64
+ onDeleteAgent,
65
+ onDeleteAutomation,
66
+ onDeleteSecret,
67
+ onDisconnectConnector,
68
+ onDisconnectIMessage,
69
+ onDisconnectTelegram,
70
+ onEditAutomation,
71
+ onGenerateLineCode,
72
+ onGenerateIMessageCode,
73
+ onOpenIMessage,
74
+ onOpenLine,
75
+ onRemoveConnector,
76
+ onOpenTelegram,
77
+ onOpenWhatsApp,
78
+ onOpenSandboxFile,
79
+ onRefreshChannels,
80
+ onRefreshAgentSettings,
81
+ onRefreshAutomations,
82
+ onRefreshCollaborators,
83
+ onRefreshFiles,
84
+ onRestoreAutomation,
85
+ onRunAutomationNow,
86
+ onSaveSandboxFile,
87
+ onSaveSecret,
88
+ onSelectTab,
89
+ onShareAgentLink,
90
+ onShareIMessageCode,
91
+ onShareLineCode,
92
+ onSetupTelegram,
93
+ onToggleAutomation,
94
+ onUpdateAgentModel,
95
+ onUpdateToolPermissions,
96
+ onUploadSandboxFiles
97
+ }) {
98
+ const initialTab = activeTab === 'chat' ? 'integrations' : activeTab;
99
+ const [selectedTab, setSelectedTab] = useState(initialTab);
100
+ useEffect(() => {
101
+ if (isVisible) {
102
+ setSelectedTab(activeTab === 'chat' ? 'integrations' : activeTab);
103
+ }
104
+ }, [activeTab, isVisible]);
105
+ const selectTab = tab => {
106
+ setSelectedTab(tab);
107
+ onSelectTab(tab);
108
+ if (tab === 'tasks') {
109
+ onRefreshAutomations?.(agent.id);
110
+ }
111
+ if (tab === 'files') {
112
+ onRefreshFiles?.(agent.id);
113
+ }
114
+ if (tab === 'channels') {
115
+ onRefreshChannels?.(agent.id);
116
+ }
117
+ if (tab === 'agent_settings') {
118
+ onRefreshAgentSettings?.(agent.id);
119
+ onRefreshCollaborators?.(agent.id);
120
+ }
121
+ };
122
+ return /*#__PURE__*/_jsx(Modal, {
123
+ animationType: "slide",
124
+ presentationStyle: "pageSheet",
125
+ visible: isVisible,
126
+ onRequestClose: onClose,
127
+ children: /*#__PURE__*/_jsxs(View, {
128
+ style: editorShellStyles.modalRoot,
129
+ children: [/*#__PURE__*/_jsxs(View, {
130
+ style: editorShellStyles.modalTopBar,
131
+ children: [/*#__PURE__*/_jsx(Pressable, {
132
+ accessibilityLabel: "Close settings",
133
+ accessibilityRole: "button",
134
+ onPress: onClose,
135
+ style: ({
136
+ pressed
137
+ }) => [editorShellStyles.closeButton, pressed && styles.pressed],
138
+ children: /*#__PURE__*/_jsx(X, {
139
+ color: "#F4F4F5",
140
+ size: 22,
141
+ strokeWidth: 2.5
142
+ })
143
+ }), /*#__PURE__*/_jsx(View, {
144
+ style: editorShellStyles.modalTitleWrap,
145
+ children: /*#__PURE__*/_jsx(Text, {
146
+ style: editorShellStyles.modalTitle,
147
+ children: "Settings"
148
+ })
149
+ }), /*#__PURE__*/_jsx(AgentSphereIcon, {
150
+ agent: agent,
151
+ size: "header"
152
+ })]
153
+ }), /*#__PURE__*/_jsxs(ScrollView, {
154
+ contentContainerStyle: editorShellStyles.modalScrollContent,
155
+ showsVerticalScrollIndicator: false,
156
+ stickyHeaderIndices: [0],
157
+ children: [/*#__PURE__*/_jsx(View, {
158
+ style: editorShellStyles.stickyTabsWrap,
159
+ children: /*#__PURE__*/_jsx(ScrollView, {
160
+ horizontal: true,
161
+ showsHorizontalScrollIndicator: false,
162
+ contentContainerStyle: editorShellStyles.tabsContent,
163
+ children: SETTING_TABS.map(tab => /*#__PURE__*/_jsx(Pressable, {
164
+ accessibilityRole: "button",
165
+ onPress: () => selectTab(tab.id),
166
+ style: ({
167
+ pressed
168
+ }) => [editorShellStyles.segmentButton, selectedTab === tab.id && editorShellStyles.segmentButtonActive, pressed && styles.pressed],
169
+ children: /*#__PURE__*/_jsx(Text, {
170
+ style: [editorShellStyles.segmentLabel, selectedTab === tab.id && editorShellStyles.segmentLabelActive],
171
+ children: tab.label
172
+ })
173
+ }, tab.id))
174
+ })
175
+ }), selectedTab === 'integrations' ? /*#__PURE__*/_jsx(ConnectorsPanel, {
176
+ agent: agent,
177
+ availableConnectors: availableConnectors,
178
+ connectedConnectors: connectedConnectors,
179
+ connectingConnectorId: connectingConnectorId,
180
+ isLoading: isLoadingConnectors,
181
+ onCancel: onCancelConnectorConnection,
182
+ onConnect: onConnectConnector,
183
+ onDisconnect: onDisconnectConnector,
184
+ onRemove: onRemoveConnector
185
+ }) : selectedTab === 'tasks' ? /*#__PURE__*/_jsx(TasksPanel, {
186
+ agent: agent,
187
+ automationCredits: automationCredits,
188
+ automations: automations,
189
+ isLoading: isLoadingAutomations,
190
+ onArchiveAutomation: onArchiveAutomation,
191
+ onDeleteAutomation: onDeleteAutomation,
192
+ onEditAutomation: onEditAutomation,
193
+ onRestoreAutomation: onRestoreAutomation,
194
+ onRunAutomationNow: onRunAutomationNow,
195
+ onToggleAutomation: onToggleAutomation
196
+ }) : selectedTab === 'files' ? /*#__PURE__*/_jsx(FilesPanel, {
197
+ agent: agent,
198
+ fileLoadError: fileLoadError,
199
+ fileLoadFailed: fileLoadFailed,
200
+ filePaths: filePaths,
201
+ isLoading: isLoadingFiles,
202
+ onOpenSandboxFile: onOpenSandboxFile,
203
+ onRefreshFiles: onRefreshFiles,
204
+ onSaveSandboxFile: onSaveSandboxFile,
205
+ onUploadSandboxFiles: onUploadSandboxFiles
206
+ }) : selectedTab === 'channels' ? /*#__PURE__*/_jsx(ChannelsPanel, {
207
+ agent: agent,
208
+ channelStatus: channelStatus,
209
+ connectingChannelId: connectingChannelId,
210
+ isLoading: isLoadingChannels,
211
+ onDisconnectIMessage: onDisconnectIMessage,
212
+ onDisconnectTelegram: onDisconnectTelegram,
213
+ onGenerateIMessageCode: onGenerateIMessageCode,
214
+ onGenerateLineCode: onGenerateLineCode,
215
+ onOpenIMessage: onOpenIMessage,
216
+ onOpenLine: onOpenLine,
217
+ onOpenTelegram: onOpenTelegram,
218
+ onOpenWhatsApp: onOpenWhatsApp,
219
+ onRefreshChannels: onRefreshChannels,
220
+ onSetupTelegram: onSetupTelegram,
221
+ onShareIMessageCode: onShareIMessageCode,
222
+ onShareLineCode: onShareLineCode
223
+ }) : selectedTab === 'agent_settings' ? /*#__PURE__*/_jsx(AgentSettingsPanel, {
224
+ agent: agent,
225
+ collaborators: collaborators,
226
+ connectedConnectors: connectedConnectors,
227
+ isLoading: isLoadingAgentSettings,
228
+ isLoadingCollaborators: isLoadingCollaborators,
229
+ onCloneAgent: onCloneAgent,
230
+ onDeleteAgent: onDeleteAgent,
231
+ onDeleteSecret: onDeleteSecret,
232
+ onRefreshAgentSettings: onRefreshAgentSettings,
233
+ onSaveSecret: onSaveSecret,
234
+ onShareAgentLink: onShareAgentLink,
235
+ onUpdateAgentModel: onUpdateAgentModel,
236
+ onUpdateToolPermissions: onUpdateToolPermissions,
237
+ secrets: secrets
238
+ }) : /*#__PURE__*/_jsx(PlaceholderSettingsPanel, {
239
+ tab: selectedTab
240
+ })]
241
+ })]
242
+ })
243
+ });
244
+ }
245
+ function TasksPanel({
246
+ agent,
247
+ automationCredits = {},
248
+ automations = [],
249
+ isLoading,
250
+ onArchiveAutomation,
251
+ onDeleteAutomation,
252
+ onEditAutomation,
253
+ onRestoreAutomation,
254
+ onRunAutomationNow,
255
+ onToggleAutomation
256
+ }) {
257
+ const [viewTab, setViewTab] = useState('active');
258
+ const sortedAutomations = useMemo(() => [...automations].sort((a, b) => getAutomationTime(b) - getAutomationTime(a)), [automations]);
259
+ const activeAutomations = sortedAutomations.filter(automation => !automation.is_archived);
260
+ const archivedAutomations = sortedAutomations.filter(automation => automation.is_archived);
261
+ if (isLoading) {
262
+ return /*#__PURE__*/_jsxs(View, {
263
+ style: editorShellStyles.loadingPanel,
264
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
265
+ color: "#FF5A1F"
266
+ }), /*#__PURE__*/_jsx(Text, {
267
+ style: editorShellStyles.loadingText,
268
+ children: "Loading automations..."
269
+ })]
270
+ });
271
+ }
272
+ const displayAutomations = viewTab === 'archived' ? archivedAutomations : activeAutomations;
273
+ return /*#__PURE__*/_jsx(View, {
274
+ style: editorShellStyles.settingsStack,
275
+ children: /*#__PURE__*/_jsxs(View, {
276
+ style: editorShellStyles.panel,
277
+ children: [/*#__PURE__*/_jsxs(View, {
278
+ style: editorShellStyles.panelHeader,
279
+ children: [/*#__PURE__*/_jsxs(View, {
280
+ children: [/*#__PURE__*/_jsx(Text, {
281
+ style: editorShellStyles.panelTitle,
282
+ children: "Automations"
283
+ }), /*#__PURE__*/_jsx(Text, {
284
+ style: editorShellStyles.panelSubtitle,
285
+ children: "Scheduled tasks, triggers, history, and usage."
286
+ })]
287
+ }), /*#__PURE__*/_jsx(Text, {
288
+ style: editorShellStyles.countBadge,
289
+ children: displayAutomations.length
290
+ })]
291
+ }), /*#__PURE__*/_jsxs(View, {
292
+ style: editorShellStyles.automationTabs,
293
+ children: [/*#__PURE__*/_jsx(Pressable, {
294
+ accessibilityRole: "button",
295
+ onPress: () => setViewTab('active'),
296
+ style: ({
297
+ pressed
298
+ }) => [editorShellStyles.automationTabButton, viewTab === 'active' && editorShellStyles.automationTabButtonActive, pressed && styles.pressed],
299
+ children: /*#__PURE__*/_jsxs(Text, {
300
+ style: [editorShellStyles.automationTabText, viewTab === 'active' && editorShellStyles.automationTabTextActive],
301
+ children: ["Active ", activeAutomations.length]
302
+ })
303
+ }), /*#__PURE__*/_jsx(Pressable, {
304
+ accessibilityRole: "button",
305
+ onPress: () => setViewTab('archived'),
306
+ style: ({
307
+ pressed
308
+ }) => [editorShellStyles.automationTabButton, viewTab === 'archived' && editorShellStyles.automationTabButtonActive, pressed && styles.pressed],
309
+ children: /*#__PURE__*/_jsxs(Text, {
310
+ style: [editorShellStyles.automationTabText, viewTab === 'archived' && editorShellStyles.automationTabTextActive],
311
+ children: ["Archived ", archivedAutomations.length]
312
+ })
313
+ })]
314
+ }), displayAutomations.length > 0 ? /*#__PURE__*/_jsx(View, {
315
+ style: editorShellStyles.automationList,
316
+ children: displayAutomations.map(automation => /*#__PURE__*/_jsx(AutomationCard, {
317
+ agentId: agent.id,
318
+ automation: automation,
319
+ credits: automationCredits[automation.id],
320
+ onArchiveAutomation: onArchiveAutomation,
321
+ onDeleteAutomation: onDeleteAutomation,
322
+ onEditAutomation: onEditAutomation,
323
+ onRestoreAutomation: onRestoreAutomation,
324
+ onRunAutomationNow: onRunAutomationNow,
325
+ onToggleAutomation: onToggleAutomation
326
+ }, automation.id))
327
+ }) : /*#__PURE__*/_jsxs(View, {
328
+ style: editorShellStyles.emptyPanel,
329
+ children: [viewTab === 'archived' ? /*#__PURE__*/_jsx(Archive, {
330
+ color: "#8E8E93",
331
+ size: 22,
332
+ strokeWidth: 2.2
333
+ }) : /*#__PURE__*/_jsx(Timer, {
334
+ color: "#8E8E93",
335
+ size: 22,
336
+ strokeWidth: 2.2
337
+ }), /*#__PURE__*/_jsx(Text, {
338
+ style: editorShellStyles.emptyTitle,
339
+ children: viewTab === 'archived' ? 'No archived automations' : 'No automations yet'
340
+ }), /*#__PURE__*/_jsx(Text, {
341
+ style: editorShellStyles.emptyBody,
342
+ children: viewTab === 'archived' ? 'Automations you archive will appear here.' : 'Ask Superagent to create a scheduled or connector task.'
343
+ })]
344
+ })]
345
+ })
346
+ });
347
+ }
348
+ function AutomationCard({
349
+ agentId,
350
+ automation,
351
+ credits,
352
+ onArchiveAutomation,
353
+ onDeleteAutomation,
354
+ onEditAutomation,
355
+ onRestoreAutomation,
356
+ onRunAutomationNow,
357
+ onToggleAutomation
358
+ }) {
359
+ const [expanded, setExpanded] = useState(false);
360
+ const [pendingAction, setPendingAction] = useState(null);
361
+ const Icon = AUTOMATION_ICONS[automation.automation_type] ?? Timer;
362
+ const trigger = describeAutomationTrigger(automation);
363
+ const lastRun = formatDateTime(automation.last_run_at);
364
+ const isArchived = !!automation.is_archived;
365
+ const isActive = !isArchived && automation.is_active !== false;
366
+ const canRunNow = automation.automation_type === 'scheduled' && !isArchived && !!onRunAutomationNow;
367
+ const actionInput = {
368
+ agentId,
369
+ automation
370
+ };
371
+ const runAction = async (action, handler) => {
372
+ if (!handler || pendingAction) {
373
+ return;
374
+ }
375
+ setPendingAction(action);
376
+ try {
377
+ await handler(actionInput);
378
+ } finally {
379
+ setPendingAction(null);
380
+ }
381
+ };
382
+ return /*#__PURE__*/_jsxs(View, {
383
+ style: editorShellStyles.automationCard,
384
+ children: [/*#__PURE__*/_jsx(View, {
385
+ style: editorShellStyles.automationIcon,
386
+ children: /*#__PURE__*/_jsx(Icon, {
387
+ color: "#F4F4F5",
388
+ size: 19,
389
+ strokeWidth: 2.35
390
+ })
391
+ }), /*#__PURE__*/_jsxs(View, {
392
+ style: editorShellStyles.automationText,
393
+ children: [/*#__PURE__*/_jsxs(View, {
394
+ style: editorShellStyles.inlineTitleRow,
395
+ children: [/*#__PURE__*/_jsx(Text, {
396
+ numberOfLines: 1,
397
+ style: editorShellStyles.automationName,
398
+ children: automation.name
399
+ }), /*#__PURE__*/_jsx(AutomationStatusBadge, {
400
+ automation: automation
401
+ })]
402
+ }), trigger ? /*#__PURE__*/_jsx(Text, {
403
+ numberOfLines: 2,
404
+ style: editorShellStyles.automationTrigger,
405
+ children: trigger
406
+ }) : null, automation.description ? /*#__PURE__*/_jsx(Text, {
407
+ numberOfLines: 2,
408
+ style: editorShellStyles.automationDescription,
409
+ children: automation.description
410
+ }) : null, /*#__PURE__*/_jsxs(View, {
411
+ style: editorShellStyles.automationMetaRow,
412
+ children: [/*#__PURE__*/_jsx(Text, {
413
+ numberOfLines: 1,
414
+ style: editorShellStyles.automationMeta,
415
+ children: formatAutomationType(automation.automation_type)
416
+ }), automation.function_name ? /*#__PURE__*/_jsx(Text, {
417
+ numberOfLines: 1,
418
+ style: editorShellStyles.automationMeta,
419
+ children: automation.function_name
420
+ }) : null, /*#__PURE__*/_jsxs(View, {
421
+ style: editorShellStyles.automationCreditBadge,
422
+ children: [/*#__PURE__*/_jsx(Coins, {
423
+ color: "#A1A1AA",
424
+ size: 11,
425
+ strokeWidth: 2.4
426
+ }), /*#__PURE__*/_jsx(Text, {
427
+ numberOfLines: 1,
428
+ style: editorShellStyles.automationCreditText,
429
+ children: credits ? `${formatCredits(credits.total)} credits used` : 'Consumes credits'
430
+ })]
431
+ })]
432
+ }), /*#__PURE__*/_jsxs(Text, {
433
+ numberOfLines: 1,
434
+ style: editorShellStyles.automationRuns,
435
+ children: [formatRuns(automation), lastRun ? ` · Last run ${lastRun}` : '']
436
+ }), /*#__PURE__*/_jsxs(View, {
437
+ style: editorShellStyles.automationActionRow,
438
+ children: [/*#__PURE__*/_jsx(AutomationActionButton, {
439
+ icon: expanded ? X : ChevronDown,
440
+ label: expanded ? 'Close' : 'Details',
441
+ onPress: () => setExpanded(current => !current)
442
+ }), onEditAutomation ? /*#__PURE__*/_jsx(AutomationActionButton, {
443
+ icon: Edit3,
444
+ isLoading: pendingAction === 'edit',
445
+ label: "Edit",
446
+ onPress: () => runAction('edit', onEditAutomation)
447
+ }) : null, canRunNow ? /*#__PURE__*/_jsx(AutomationActionButton, {
448
+ icon: Play,
449
+ isLoading: pendingAction === 'run',
450
+ label: "Run",
451
+ onPress: () => runAction('run', onRunAutomationNow)
452
+ }) : null, !isArchived && onToggleAutomation ? /*#__PURE__*/_jsx(AutomationActionButton, {
453
+ icon: isActive ? ToggleRight : ToggleLeft,
454
+ isLoading: pendingAction === 'toggle',
455
+ label: isActive ? 'Pause' : 'Activate',
456
+ onPress: () => runAction('toggle', onToggleAutomation)
457
+ }) : null, !isArchived && onArchiveAutomation ? /*#__PURE__*/_jsx(AutomationActionButton, {
458
+ icon: Archive,
459
+ isLoading: pendingAction === 'archive',
460
+ label: "Archive",
461
+ onPress: () => runAction('archive', onArchiveAutomation)
462
+ }) : null, isArchived && onRestoreAutomation ? /*#__PURE__*/_jsx(AutomationActionButton, {
463
+ icon: RotateCcw,
464
+ isLoading: pendingAction === 'restore',
465
+ label: "Restore",
466
+ onPress: () => runAction('restore', onRestoreAutomation)
467
+ }) : null, onDeleteAutomation ? /*#__PURE__*/_jsx(AutomationActionButton, {
468
+ danger: true,
469
+ icon: Trash2,
470
+ isLoading: pendingAction === 'delete',
471
+ label: "Delete",
472
+ onPress: () => runAction('delete', onDeleteAutomation)
473
+ }) : null]
474
+ }), expanded ? /*#__PURE__*/_jsxs(View, {
475
+ style: editorShellStyles.automationDetailsPanel,
476
+ children: [trigger ? /*#__PURE__*/_jsx(AutomationDetailBlock, {
477
+ label: "Trigger",
478
+ value: trigger
479
+ }) : null, automation.description ? /*#__PURE__*/_jsx(AutomationDetailBlock, {
480
+ label: "Instructions",
481
+ value: automation.description
482
+ }) : null, automation.function_name ? /*#__PURE__*/_jsx(AutomationDetailBlock, {
483
+ label: "Task ID",
484
+ monospace: true,
485
+ value: automation.function_name
486
+ }) : null, automation.function_args && Object.keys(automation.function_args).length > 0 ? /*#__PURE__*/_jsx(AutomationDetailBlock, {
487
+ label: "Parameters",
488
+ monospace: true,
489
+ value: JSON.stringify(automation.function_args, null, 2)
490
+ }) : null, /*#__PURE__*/_jsxs(View, {
491
+ style: editorShellStyles.automationDetailStats,
492
+ children: [/*#__PURE__*/_jsxs(Text, {
493
+ style: editorShellStyles.automationDetailStatText,
494
+ children: [automation.total_runs ?? 0, " total"]
495
+ }), /*#__PURE__*/_jsxs(Text, {
496
+ style: editorShellStyles.automationDetailSuccess,
497
+ children: [automation.successful_runs ?? 0, " succeeded"]
498
+ }), /*#__PURE__*/_jsxs(Text, {
499
+ style: editorShellStyles.automationDetailFailure,
500
+ children: [automation.failed_runs ?? 0, " failed"]
501
+ })]
502
+ }), credits ? /*#__PURE__*/_jsxs(Text, {
503
+ style: editorShellStyles.automationDetailMuted,
504
+ children: ["Total credits: ", formatCredits(credits.total), credits.since ? ` · since ${formatDate(credits.since) ?? credits.since}` : '']
505
+ }) : null, lastRun ? /*#__PURE__*/_jsxs(Text, {
506
+ style: editorShellStyles.automationDetailMuted,
507
+ children: ["Last run: ", lastRun, automation.last_run_status ? ` · ${automation.last_run_status}` : '']
508
+ }) : null, automation.created_date ? /*#__PURE__*/_jsxs(Text, {
509
+ style: editorShellStyles.automationDetailMuted,
510
+ children: ["Created ", formatDate(automation.created_date) ?? automation.created_date]
511
+ }) : null]
512
+ }) : null]
513
+ })]
514
+ });
515
+ }
516
+ function AutomationActionButton({
517
+ danger,
518
+ icon: Icon,
519
+ isLoading,
520
+ label,
521
+ onPress
522
+ }) {
523
+ return /*#__PURE__*/_jsxs(Pressable, {
524
+ accessibilityLabel: label,
525
+ accessibilityRole: "button",
526
+ disabled: isLoading,
527
+ onPress: onPress,
528
+ style: ({
529
+ pressed
530
+ }) => [editorShellStyles.automationActionButton, danger && editorShellStyles.automationActionButtonDanger, pressed && styles.pressed, isLoading && editorShellStyles.automationActionButtonDisabled],
531
+ children: [isLoading ? /*#__PURE__*/_jsx(ActivityIndicator, {
532
+ color: danger ? '#FCA5A5' : '#F4F4F5',
533
+ size: "small"
534
+ }) : /*#__PURE__*/_jsx(Icon, {
535
+ color: danger ? '#FCA5A5' : '#F4F4F5',
536
+ size: 13,
537
+ strokeWidth: 2.45
538
+ }), /*#__PURE__*/_jsx(Text, {
539
+ style: [editorShellStyles.automationActionText, danger && editorShellStyles.automationActionTextDanger],
540
+ children: label
541
+ })]
542
+ });
543
+ }
544
+ function AutomationDetailBlock({
545
+ label,
546
+ monospace,
547
+ value
548
+ }) {
549
+ return /*#__PURE__*/_jsxs(View, {
550
+ style: editorShellStyles.automationDetailBlock,
551
+ children: [/*#__PURE__*/_jsx(Text, {
552
+ style: editorShellStyles.automationDetailLabel,
553
+ children: label
554
+ }), /*#__PURE__*/_jsx(Text, {
555
+ style: [editorShellStyles.automationDetailValue, monospace && editorShellStyles.automationDetailValueMono],
556
+ children: value
557
+ })]
558
+ });
559
+ }
560
+ function AutomationStatusBadge({
561
+ automation
562
+ }) {
563
+ const isArchived = !!automation.is_archived;
564
+ const isActive = !isArchived && automation.is_active !== false;
565
+ const label = isArchived ? 'Archived' : isActive ? 'Active' : 'Paused';
566
+ return /*#__PURE__*/_jsx(View, {
567
+ style: [editorShellStyles.automationStatusBadge, isActive ? editorShellStyles.automationStatusActive : editorShellStyles.automationStatusInactive],
568
+ children: /*#__PURE__*/_jsx(Text, {
569
+ style: [editorShellStyles.automationStatusText, isActive ? editorShellStyles.automationStatusTextActive : editorShellStyles.automationStatusTextInactive],
570
+ children: label
571
+ })
572
+ });
573
+ }
574
+ function ConnectorsPanel({
575
+ agent,
576
+ availableConnectors,
577
+ connectedConnectors,
578
+ connectingConnectorId,
579
+ isLoading,
580
+ onCancel,
581
+ onConnect,
582
+ onDisconnect,
583
+ onRemove
584
+ }) {
585
+ const [searchQuery, setSearchQuery] = useState('');
586
+ const connectedIds = useMemo(() => new Set((connectedConnectors ?? []).map(connector => connector.id)), [connectedConnectors]);
587
+ const available = useMemo(() => {
588
+ const normalizedQuery = searchQuery.trim().toLowerCase();
589
+ return (availableConnectors ?? SUPERAGENT_CONNECTOR_CATALOG).filter(connector => !connectedIds.has(connector.id)).filter(connector => {
590
+ if (!normalizedQuery) {
591
+ return true;
592
+ }
593
+ return [connector.id, connector.name, connector.subtitle, connector.category].filter(Boolean).join(' ').toLowerCase().includes(normalizedQuery);
594
+ });
595
+ }, [availableConnectors, connectedIds, searchQuery]);
596
+ if (isLoading) {
597
+ return /*#__PURE__*/_jsxs(View, {
598
+ style: editorShellStyles.loadingPanel,
599
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
600
+ color: "#FF5A1F"
601
+ }), /*#__PURE__*/_jsx(Text, {
602
+ style: editorShellStyles.loadingText,
603
+ children: "Loading connectors..."
604
+ })]
605
+ });
606
+ }
607
+ return /*#__PURE__*/_jsxs(View, {
608
+ style: editorShellStyles.settingsStack,
609
+ children: [/*#__PURE__*/_jsxs(View, {
610
+ style: editorShellStyles.panel,
611
+ children: [/*#__PURE__*/_jsxs(View, {
612
+ style: editorShellStyles.panelHeader,
613
+ children: [/*#__PURE__*/_jsxs(View, {
614
+ children: [/*#__PURE__*/_jsx(Text, {
615
+ style: editorShellStyles.panelTitle,
616
+ children: "Connected"
617
+ }), /*#__PURE__*/_jsx(Text, {
618
+ style: editorShellStyles.panelSubtitle,
619
+ children: "Tools this agent can already use."
620
+ })]
621
+ }), /*#__PURE__*/_jsx(Text, {
622
+ style: editorShellStyles.countBadge,
623
+ children: connectedConnectors?.length ?? 0
624
+ })]
625
+ }), connectedConnectors && connectedConnectors.length > 0 ? /*#__PURE__*/_jsx(View, {
626
+ style: editorShellStyles.connectorList,
627
+ children: connectedConnectors.map(connector => /*#__PURE__*/_jsx(ConnectedConnectorCard, {
628
+ agentId: agent.id,
629
+ connector: connector,
630
+ isConnecting: connectingConnectorId === connector.id,
631
+ onCancel: onCancel,
632
+ onConnect: onConnect,
633
+ onDisconnect: onDisconnect,
634
+ onRemove: onRemove
635
+ }, connector.id))
636
+ }) : /*#__PURE__*/_jsxs(View, {
637
+ style: editorShellStyles.emptyPanel,
638
+ children: [/*#__PURE__*/_jsx(Plug, {
639
+ color: "#8E8E93",
640
+ size: 22,
641
+ strokeWidth: 2.2
642
+ }), /*#__PURE__*/_jsx(Text, {
643
+ style: editorShellStyles.emptyTitle,
644
+ children: "No connectors yet"
645
+ }), /*#__PURE__*/_jsx(Text, {
646
+ style: editorShellStyles.emptyBody,
647
+ children: "Connect a service below to let this agent use it from chat."
648
+ })]
649
+ })]
650
+ }), /*#__PURE__*/_jsxs(View, {
651
+ style: editorShellStyles.panel,
652
+ children: [/*#__PURE__*/_jsxs(View, {
653
+ style: editorShellStyles.panelHeader,
654
+ children: [/*#__PURE__*/_jsxs(View, {
655
+ children: [/*#__PURE__*/_jsx(Text, {
656
+ style: editorShellStyles.panelTitle,
657
+ children: "Available connectors"
658
+ }), /*#__PURE__*/_jsx(Text, {
659
+ style: editorShellStyles.panelSubtitle,
660
+ children: "Browse the same tools from the web editor."
661
+ })]
662
+ }), /*#__PURE__*/_jsx(Text, {
663
+ style: editorShellStyles.countBadge,
664
+ children: available.length
665
+ })]
666
+ }), /*#__PURE__*/_jsxs(View, {
667
+ style: editorShellStyles.connectorSearchWrap,
668
+ children: [/*#__PURE__*/_jsx(Search, {
669
+ color: "#A1A1AA",
670
+ size: 16,
671
+ strokeWidth: 2.4
672
+ }), /*#__PURE__*/_jsx(TextInput, {
673
+ autoCapitalize: "none",
674
+ autoCorrect: false,
675
+ clearButtonMode: "while-editing",
676
+ onChangeText: setSearchQuery,
677
+ placeholder: "Search connectors",
678
+ placeholderTextColor: "#8E8E93",
679
+ returnKeyType: "search",
680
+ style: editorShellStyles.connectorSearchInput,
681
+ value: searchQuery
682
+ })]
683
+ }), /*#__PURE__*/_jsx(View, {
684
+ style: editorShellStyles.connectorList,
685
+ children: available.length > 0 ? available.map(connector => /*#__PURE__*/_jsx(AvailableConnectorCard, {
686
+ agentId: agent.id,
687
+ connector: connector,
688
+ isConnecting: connectingConnectorId === connector.id,
689
+ onCancel: onCancel,
690
+ onConnect: onConnect
691
+ }, connector.id)) : /*#__PURE__*/_jsxs(View, {
692
+ style: editorShellStyles.emptyPanel,
693
+ children: [/*#__PURE__*/_jsx(Search, {
694
+ color: "#8E8E93",
695
+ size: 22,
696
+ strokeWidth: 2.2
697
+ }), /*#__PURE__*/_jsx(Text, {
698
+ style: editorShellStyles.emptyTitle,
699
+ children: "No matching connectors"
700
+ }), /*#__PURE__*/_jsx(Text, {
701
+ style: editorShellStyles.emptyBody,
702
+ children: "Try a different connector name or category."
703
+ })]
704
+ })
705
+ })]
706
+ })]
707
+ });
708
+ }
709
+ function ConnectedConnectorCard({
710
+ agentId,
711
+ connector,
712
+ isConnecting,
713
+ onCancel,
714
+ onConnect,
715
+ onDisconnect,
716
+ onRemove
717
+ }) {
718
+ const status = connector.status ?? 'active';
719
+ const [menuOpen, setMenuOpen] = useState(false);
720
+ const hasAccessModes = !!connector.accessModes;
721
+ const currentMode = connector.accessMode ?? null;
722
+ const oppositeMode = currentMode === 'read_only' ? 'full_access' : 'read_only';
723
+ return /*#__PURE__*/_jsxs(View, {
724
+ style: [editorShellStyles.connectorCard, menuOpen && editorShellStyles.connectorCardMenuOpen],
725
+ children: [/*#__PURE__*/_jsx(ConnectorIcon, {
726
+ connector: connector
727
+ }), /*#__PURE__*/_jsxs(View, {
728
+ style: editorShellStyles.connectorText,
729
+ children: [/*#__PURE__*/_jsxs(View, {
730
+ style: editorShellStyles.inlineTitleRow,
731
+ children: [/*#__PURE__*/_jsx(Text, {
732
+ numberOfLines: 1,
733
+ style: editorShellStyles.connectorName,
734
+ children: connector.name
735
+ }), /*#__PURE__*/_jsx(StatusBadge, {
736
+ status: status
737
+ }), currentMode ? /*#__PURE__*/_jsx(AccessModeBadge, {
738
+ mode: currentMode
739
+ }) : null]
740
+ }), /*#__PURE__*/_jsx(Text, {
741
+ numberOfLines: 1,
742
+ style: editorShellStyles.connectorSubtitle,
743
+ children: connector.accountIdentifier || connector.subtitle || 'Connected account'
744
+ })]
745
+ }), isConnecting ? /*#__PURE__*/_jsxs(View, {
746
+ style: editorShellStyles.connectingWrap,
747
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
748
+ color: "#8B5CF6",
749
+ size: "small"
750
+ }), /*#__PURE__*/_jsx(Pressable, {
751
+ accessibilityLabel: `Cancel ${connector.name} connection`,
752
+ accessibilityRole: "button",
753
+ onPress: () => onCancel?.({
754
+ agentId,
755
+ connectorId: connector.id
756
+ }),
757
+ style: ({
758
+ pressed
759
+ }) => [editorShellStyles.cancelConnectButton, pressed && styles.pressed],
760
+ children: /*#__PURE__*/_jsx(Text, {
761
+ style: editorShellStyles.cancelConnectText,
762
+ children: "Cancel"
763
+ })
764
+ })]
765
+ }) : /*#__PURE__*/_jsx(View, {
766
+ style: editorShellStyles.connectorActions,
767
+ children: /*#__PURE__*/_jsx(Pressable, {
768
+ accessibilityLabel: `${connector.name} actions`,
769
+ accessibilityRole: "button",
770
+ onPress: () => setMenuOpen(open => !open),
771
+ style: ({
772
+ pressed
773
+ }) => [editorShellStyles.moreButton, pressed && styles.pressed],
774
+ children: /*#__PURE__*/_jsx(MoreHorizontal, {
775
+ color: "#E4E4E7",
776
+ size: 19,
777
+ strokeWidth: 2.4
778
+ })
779
+ })
780
+ }), menuOpen ? /*#__PURE__*/_jsxs(View, {
781
+ style: editorShellStyles.connectorMenu,
782
+ children: [hasAccessModes && onConnect ? /*#__PURE__*/_jsx(MenuAction, {
783
+ label: oppositeMode === 'read_only' ? 'Switch to read only' : 'Switch to full access',
784
+ onPress: () => {
785
+ setMenuOpen(false);
786
+ onConnect({
787
+ accessMode: oppositeMode,
788
+ agentId,
789
+ connectorId: connector.id,
790
+ forceReconnect: true,
791
+ scopes: getConnectorScopesForMode(connector, oppositeMode)
792
+ });
793
+ }
794
+ }) : null, /*#__PURE__*/_jsx(MenuAction, {
795
+ label: status === 'active' ? 'Switch account' : 'Reconnect',
796
+ onPress: () => {
797
+ setMenuOpen(false);
798
+ onConnect?.({
799
+ accessMode: connector.accessMode ?? undefined,
800
+ agentId,
801
+ connectorId: connector.id,
802
+ forceReconnect: true,
803
+ scopes: connector.scopes?.length ? connector.scopes : getConnectorScopesForMode(connector, connector.accessMode ?? 'full_access')
804
+ });
805
+ }
806
+ }), status !== 'disconnected' ? /*#__PURE__*/_jsx(MenuAction, {
807
+ destructive: true,
808
+ label: "Disconnect",
809
+ onPress: () => {
810
+ setMenuOpen(false);
811
+ onDisconnect?.({
812
+ agentId,
813
+ connectorId: connector.id
814
+ });
815
+ }
816
+ }) : null, /*#__PURE__*/_jsx(MenuAction, {
817
+ destructive: true,
818
+ label: "Remove",
819
+ onPress: () => {
820
+ setMenuOpen(false);
821
+ onRemove?.({
822
+ agentId,
823
+ connectorId: connector.id
824
+ });
825
+ }
826
+ })]
827
+ }) : null]
828
+ });
829
+ }
830
+ function MenuAction({
831
+ destructive,
832
+ label,
833
+ onPress
834
+ }) {
835
+ return /*#__PURE__*/_jsx(Pressable, {
836
+ accessibilityRole: "button",
837
+ onPress: onPress,
838
+ style: ({
839
+ pressed
840
+ }) => [editorShellStyles.menuAction, pressed && styles.pressed],
841
+ children: /*#__PURE__*/_jsx(Text, {
842
+ style: [editorShellStyles.menuActionText, destructive && editorShellStyles.menuActionTextDestructive],
843
+ children: label
844
+ })
845
+ });
846
+ }
847
+ function AvailableConnectorCard({
848
+ agentId,
849
+ connector,
850
+ isConnecting,
851
+ onCancel,
852
+ onConnect
853
+ }) {
854
+ const [accessMode, setAccessMode] = useState(connector.accessMode ?? 'full_access');
855
+ const hasAccessModes = !!connector.accessModes || connector.supportsReadOnly;
856
+ return /*#__PURE__*/_jsxs(View, {
857
+ style: editorShellStyles.connectorCard,
858
+ children: [/*#__PURE__*/_jsx(ConnectorIcon, {
859
+ connector: connector
860
+ }), /*#__PURE__*/_jsxs(View, {
861
+ style: editorShellStyles.connectorText,
862
+ children: [/*#__PURE__*/_jsx(Text, {
863
+ numberOfLines: 1,
864
+ style: editorShellStyles.connectorName,
865
+ children: connector.name
866
+ }), /*#__PURE__*/_jsx(Text, {
867
+ numberOfLines: 1,
868
+ style: editorShellStyles.connectorSubtitle,
869
+ children: connector.subtitle
870
+ })]
871
+ }), isConnecting ? /*#__PURE__*/_jsxs(View, {
872
+ style: editorShellStyles.connectingWrap,
873
+ children: [/*#__PURE__*/_jsx(ActivityIndicator, {
874
+ color: "#8B5CF6",
875
+ size: "small"
876
+ }), /*#__PURE__*/_jsx(Pressable, {
877
+ accessibilityLabel: `Cancel ${connector.name} connection`,
878
+ accessibilityRole: "button",
879
+ onPress: () => onCancel?.({
880
+ agentId,
881
+ connectorId: connector.id
882
+ }),
883
+ style: ({
884
+ pressed
885
+ }) => [editorShellStyles.cancelConnectButton, pressed && styles.pressed],
886
+ children: /*#__PURE__*/_jsx(Text, {
887
+ style: editorShellStyles.cancelConnectText,
888
+ children: "Cancel"
889
+ })
890
+ })]
891
+ }) : /*#__PURE__*/_jsxs(View, {
892
+ style: editorShellStyles.availableActions,
893
+ children: [/*#__PURE__*/_jsx(Pressable, {
894
+ accessibilityLabel: `Connect ${connector.name}`,
895
+ accessibilityRole: "button",
896
+ disabled: !onConnect,
897
+ onPress: () => onConnect?.({
898
+ accessMode,
899
+ agentId,
900
+ connectorId: connector.id,
901
+ scopes: getConnectorScopesForMode(connector, accessMode)
902
+ }),
903
+ style: ({
904
+ pressed
905
+ }) => [editorShellStyles.webConnectButton, !onConnect && editorShellStyles.disabledAction, pressed && styles.pressed],
906
+ children: /*#__PURE__*/_jsx(Text, {
907
+ style: editorShellStyles.webConnectText,
908
+ children: "Connect"
909
+ })
910
+ }), hasAccessModes ? /*#__PURE__*/_jsxs(View, {
911
+ style: editorShellStyles.accessToggle,
912
+ children: [/*#__PURE__*/_jsx(AccessButton, {
913
+ active: accessMode === 'read_only',
914
+ label: "Read",
915
+ onPress: () => setAccessMode('read_only')
916
+ }), /*#__PURE__*/_jsx(AccessButton, {
917
+ active: accessMode === 'full_access',
918
+ label: "Full",
919
+ onPress: () => setAccessMode('full_access')
920
+ })]
921
+ }) : null]
922
+ })]
923
+ });
924
+ }
925
+ function AccessModeBadge({
926
+ mode
927
+ }) {
928
+ const isReadOnly = mode === 'read_only';
929
+ return /*#__PURE__*/_jsx(View, {
930
+ style: [editorShellStyles.accessBadge, isReadOnly ? editorShellStyles.accessBadgeReadOnly : editorShellStyles.accessBadgeFull],
931
+ children: /*#__PURE__*/_jsx(Text, {
932
+ style: [editorShellStyles.accessBadgeText, isReadOnly ? editorShellStyles.accessBadgeTextReadOnly : editorShellStyles.accessBadgeTextFull],
933
+ children: isReadOnly ? 'Read only' : 'Full access'
934
+ })
935
+ });
936
+ }
937
+ function getConnectorScopesForMode(connector, mode) {
938
+ if (connector.accessModes) {
939
+ return mode === 'read_only' ? connector.accessModes.readOnly : connector.accessModes.fullAccess;
940
+ }
941
+ return connector.exampleScopes ?? connector.scopes;
942
+ }
943
+ function AccessButton({
944
+ active,
945
+ label,
946
+ onPress
947
+ }) {
948
+ return /*#__PURE__*/_jsx(Pressable, {
949
+ accessibilityRole: "button",
950
+ onPress: onPress,
951
+ style: [editorShellStyles.accessButton, active && editorShellStyles.accessButtonActive],
952
+ children: /*#__PURE__*/_jsx(Text, {
953
+ style: [editorShellStyles.accessButtonText, active && editorShellStyles.accessButtonTextActive],
954
+ children: label
955
+ })
956
+ });
957
+ }
958
+ const DAY_NAMES = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
959
+ function describeAutomationTrigger(automation) {
960
+ if (automation.automation_type === 'scheduled') {
961
+ return describeSchedule(automation);
962
+ }
963
+ if (automation.automation_type === 'entity') {
964
+ const events = automation.event_types?.length ? automation.event_types.join(', ') : 'changes';
965
+ return automation.entity_name ? `${automation.entity_name} · ${events}` : events;
966
+ }
967
+ if (automation.automation_type === 'connector') {
968
+ const connectorName = getConnectorDisplayName(automation.integration_type);
969
+ const events = automation.events?.length ? automation.events.join(', ') : '';
970
+ return events ? `${connectorName} · ${events}` : connectorName;
971
+ }
972
+ return null;
973
+ }
974
+ function describeSchedule(automation) {
975
+ if (automation.schedule_mode === 'one-time' && automation.one_time_date) {
976
+ return `One-time · ${formatDateTime(automation.one_time_date) ?? automation.one_time_date}`;
977
+ }
978
+ if (automation.schedule_type === 'cron' && automation.cron_expression) {
979
+ return `Cron · ${automation.cron_expression}`;
980
+ }
981
+ const parts = [];
982
+ if (automation.repeat_interval && automation.repeat_unit) {
983
+ const unit = automation.repeat_interval === 1 ? automation.repeat_unit.replace(/s$/, '') : automation.repeat_unit;
984
+ parts.push(`Every ${automation.repeat_interval === 1 ? '' : `${automation.repeat_interval} `}${unit}`.trim());
985
+ }
986
+ if (automation.repeat_unit === 'weeks' && automation.repeat_on_days?.length) {
987
+ parts.push(`on ${automation.repeat_on_days.map(day => DAY_NAMES[day]).filter(Boolean).join(', ')}`);
988
+ }
989
+ if (automation.repeat_unit === 'months' && automation.repeat_on_day_of_month) {
990
+ parts.push(`on day ${automation.repeat_on_day_of_month}`);
991
+ }
992
+ if (automation.start_time) {
993
+ parts.push(`at ${automation.start_time}`);
994
+ }
995
+ if (automation.ends_type === 'on' && automation.ends_on_date) {
996
+ parts.push(`until ${formatDate(automation.ends_on_date) ?? automation.ends_on_date}`);
997
+ } else if (automation.ends_type === 'after' && automation.ends_after_count) {
998
+ parts.push(`for ${automation.ends_after_count} runs`);
999
+ }
1000
+ return parts.length > 0 ? parts.join(' ') : null;
1001
+ }
1002
+ function formatAutomationType(type) {
1003
+ if (type === 'scheduled') {
1004
+ return 'Scheduled';
1005
+ }
1006
+ if (type === 'entity') {
1007
+ return 'Entity trigger';
1008
+ }
1009
+ if (type === 'connector') {
1010
+ return 'Connector trigger';
1011
+ }
1012
+ return String(type);
1013
+ }
1014
+ function formatRuns(automation) {
1015
+ const total = automation.total_runs ?? 0;
1016
+ const successful = automation.successful_runs ?? 0;
1017
+ const failed = automation.failed_runs ?? 0;
1018
+ return `${total} runs · ${successful} succeeded · ${failed} failed`;
1019
+ }
1020
+ function formatCredits(value) {
1021
+ return Number.isInteger(value) ? String(value) : value.toFixed(1).replace(/\.0$/, '');
1022
+ }
1023
+ function getAutomationTime(automation) {
1024
+ const dateValue = automation.updated_date ?? automation.created_date ?? automation.last_run_at;
1025
+ if (!dateValue) {
1026
+ return 0;
1027
+ }
1028
+ const timestamp = Date.parse(dateValue);
1029
+ return Number.isNaN(timestamp) ? 0 : timestamp;
1030
+ }
1031
+ function getConnectorDisplayName(connectorId) {
1032
+ if (!connectorId) {
1033
+ return 'Connector';
1034
+ }
1035
+ return SUPERAGENT_CONNECTOR_CATALOG.find(connector => connector.id === connectorId)?.name ?? connectorId.split(/[_-]/).filter(Boolean).map(part => part.charAt(0).toUpperCase() + part.slice(1)).join(' ');
1036
+ }
1037
+ function formatDate(value) {
1038
+ if (!value) {
1039
+ return null;
1040
+ }
1041
+ const date = new Date(value);
1042
+ if (Number.isNaN(date.getTime())) {
1043
+ return value;
1044
+ }
1045
+ return date.toLocaleDateString();
1046
+ }
1047
+ function formatDateTime(value) {
1048
+ if (!value) {
1049
+ return null;
1050
+ }
1051
+ const date = new Date(value);
1052
+ if (Number.isNaN(date.getTime())) {
1053
+ return value;
1054
+ }
1055
+ return date.toLocaleString();
1056
+ }
1057
+ function ConnectorIcon({
1058
+ connector
1059
+ }) {
1060
+ const Icon = CONNECTOR_ICONS[connector.id] ?? Plug;
1061
+ const iconBackgroundColor = connector.iconBackgroundColor ?? '#FFFFFF';
1062
+ const hasBrandIcon = hasConnectorBrandIcon(connector.id);
1063
+ return /*#__PURE__*/_jsx(View, {
1064
+ style: [editorShellStyles.connectorIcon, {
1065
+ backgroundColor: iconBackgroundColor
1066
+ }],
1067
+ children: hasBrandIcon ? /*#__PURE__*/_jsx(ConnectorBrandIcon, {
1068
+ connectorId: connector.id,
1069
+ size: 22
1070
+ }) : /*#__PURE__*/_jsx(Icon, {
1071
+ color: "#111827",
1072
+ size: 20,
1073
+ strokeWidth: 2.35
1074
+ })
1075
+ });
1076
+ }
1077
+ function StatusBadge({
1078
+ status
1079
+ }) {
1080
+ const isActive = status === 'active' || !status;
1081
+ const isDisconnected = status === 'disconnected';
1082
+ const Icon = isActive ? Check : isDisconnected ? Unplug : AlertCircle;
1083
+ return /*#__PURE__*/_jsxs(View, {
1084
+ style: [editorShellStyles.statusBadge, isActive ? editorShellStyles.statusBadgeActive : isDisconnected ? editorShellStyles.statusBadgeDisconnected : editorShellStyles.statusBadgeWarning],
1085
+ children: [/*#__PURE__*/_jsx(Icon, {
1086
+ color: isActive ? '#34D399' : isDisconnected ? '#A1A1AA' : '#FCA5A5',
1087
+ size: 11,
1088
+ strokeWidth: 2.7
1089
+ }), /*#__PURE__*/_jsx(Text, {
1090
+ style: [editorShellStyles.statusBadgeText, isActive ? editorShellStyles.statusBadgeTextActive : isDisconnected ? editorShellStyles.statusBadgeTextDisconnected : editorShellStyles.statusBadgeTextWarning],
1091
+ children: isActive ? 'Active' : status
1092
+ })]
1093
+ });
1094
+ }
1095
+ function PlaceholderSettingsPanel({
1096
+ tab
1097
+ }) {
1098
+ const label = getEditorTabLabel(tab);
1099
+ const iconMap = {
1100
+ files: FileText,
1101
+ tasks: Settings
1102
+ };
1103
+ const Icon = iconMap[tab] ?? Settings;
1104
+ return /*#__PURE__*/_jsxs(View, {
1105
+ style: editorShellStyles.placeholderPanel,
1106
+ children: [/*#__PURE__*/_jsx(View, {
1107
+ style: editorShellStyles.placeholderIcon,
1108
+ children: /*#__PURE__*/_jsx(Icon, {
1109
+ color: "#FF5A1F",
1110
+ size: 24,
1111
+ strokeWidth: 2.3
1112
+ })
1113
+ }), /*#__PURE__*/_jsx(Text, {
1114
+ style: editorShellStyles.placeholderTitle,
1115
+ children: label
1116
+ }), /*#__PURE__*/_jsx(Text, {
1117
+ style: editorShellStyles.placeholderBody,
1118
+ children: "This section now lives in the settings modal. The next slice can replace this placeholder with the matching native controls."
1119
+ })]
1120
+ });
1121
+ }
1122
+ //# sourceMappingURL=EditorDrawer.js.map