@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,733 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.ChannelsPanel = ChannelsPanel;
7
+ var _react = _interopRequireWildcard(require("react"));
8
+ var _reactNative = require("react-native");
9
+ var _lucideReactNative = require("lucide-react-native");
10
+ var _editorShellStyles = require("./editorShellStyles.js");
11
+ var _styles = require("./styles.js");
12
+ var _jsxRuntime = require("react/jsx-runtime");
13
+ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
14
+ const TELEGRAM_TOKEN_PATTERN = /^\d{5,15}:[A-Za-z0-9_-]{35,50}$/;
15
+ const TELEGRAM_TOKEN_SEARCH = /\d{5,15}:[A-Za-z0-9_-]{35,50}/;
16
+ function ChannelsPanel({
17
+ agent,
18
+ channelStatus,
19
+ connectingChannelId,
20
+ isLoading,
21
+ onDisconnectTelegram,
22
+ onDisconnectIMessage,
23
+ onGenerateIMessageCode,
24
+ onGenerateLineCode,
25
+ onOpenIMessage,
26
+ onOpenLine,
27
+ onOpenTelegram,
28
+ onOpenWhatsApp,
29
+ onRefreshChannels,
30
+ onSetupTelegram,
31
+ onShareIMessageCode,
32
+ onShareLineCode
33
+ }) {
34
+ const imessage = channelStatus?.imessage;
35
+ const telegram = channelStatus?.telegram;
36
+ const line = channelStatus?.line;
37
+ const whatsapp = channelStatus?.whatsapp;
38
+ const supportedCount = 4;
39
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
40
+ style: _editorShellStyles.editorShellStyles.settingsStack,
41
+ children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
42
+ style: _editorShellStyles.editorShellStyles.panel,
43
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
44
+ style: _editorShellStyles.editorShellStyles.panelHeader,
45
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
46
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
47
+ style: _editorShellStyles.editorShellStyles.panelTitle,
48
+ children: "Channels"
49
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
50
+ style: _editorShellStyles.editorShellStyles.panelSubtitle,
51
+ children: "Messaging surfaces this agent can use."
52
+ })]
53
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
54
+ style: channelStyles.headerActions,
55
+ children: [isLoading ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
56
+ color: "#FF5A1F",
57
+ size: "small"
58
+ }) : null, onRefreshChannels ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Pressable, {
59
+ accessibilityLabel: "Refresh channels",
60
+ accessibilityRole: "button",
61
+ disabled: isLoading,
62
+ onPress: () => onRefreshChannels(agent.id),
63
+ style: ({
64
+ pressed
65
+ }) => [channelStyles.iconButton, isLoading && channelStyles.disabled, pressed && _styles.styles.pressed],
66
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.RefreshCw, {
67
+ color: "#F4F4F5",
68
+ size: 17,
69
+ strokeWidth: 2.4
70
+ })
71
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
72
+ style: _editorShellStyles.editorShellStyles.countBadge,
73
+ children: supportedCount
74
+ })]
75
+ })]
76
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
77
+ style: channelStyles.stack,
78
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(WhatsAppChannel, {
79
+ agentId: agent.id,
80
+ isBusy: connectingChannelId === 'whatsapp',
81
+ isReady: !!whatsapp?.connectUrl,
82
+ onOpenWhatsApp: onOpenWhatsApp
83
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(IMessageChannel, {
84
+ agentId: agent.id,
85
+ imessage: imessage,
86
+ isBusy: connectingChannelId === 'imessage',
87
+ onDisconnectIMessage: onDisconnectIMessage,
88
+ onGenerateIMessageCode: onGenerateIMessageCode,
89
+ onOpenIMessage: onOpenIMessage,
90
+ onShareIMessageCode: onShareIMessageCode
91
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(TelegramChannel, {
92
+ agentId: agent.id,
93
+ isBusy: connectingChannelId === 'telegram',
94
+ onDisconnectTelegram: onDisconnectTelegram,
95
+ onOpenTelegram: onOpenTelegram,
96
+ onSetupTelegram: onSetupTelegram,
97
+ telegram: telegram
98
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(LineChannel, {
99
+ agentId: agent.id,
100
+ isBusy: connectingChannelId === 'line',
101
+ line: line,
102
+ onGenerateLineCode: onGenerateLineCode,
103
+ onOpenLine: onOpenLine,
104
+ onShareLineCode: onShareLineCode
105
+ })]
106
+ })]
107
+ })
108
+ });
109
+ }
110
+ function WhatsAppChannel({
111
+ agentId,
112
+ isBusy,
113
+ isReady,
114
+ onOpenWhatsApp
115
+ }) {
116
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelCard, {
117
+ accent: "#25D366",
118
+ body: "Open WhatsApp with the generated activation message for this Superagent.",
119
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.MessageCircle, {
120
+ color: "#111111",
121
+ size: 20,
122
+ strokeWidth: 2.45
123
+ }),
124
+ status: isReady ? 'Setup link ready' : 'Needs auth token',
125
+ title: "WhatsApp",
126
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
127
+ style: channelStyles.actionRow,
128
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
129
+ disabled: !isReady || !onOpenWhatsApp || isBusy,
130
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.ExternalLink, {
131
+ color: "#111111",
132
+ size: 15,
133
+ strokeWidth: 2.4
134
+ }),
135
+ isBusy: isBusy,
136
+ label: "Open WhatsApp",
137
+ onPress: () => onOpenWhatsApp?.({
138
+ agentId
139
+ })
140
+ })
141
+ })
142
+ });
143
+ }
144
+ function IMessageChannel({
145
+ agentId,
146
+ imessage,
147
+ isBusy,
148
+ onDisconnectIMessage,
149
+ onGenerateIMessageCode,
150
+ onOpenIMessage,
151
+ onShareIMessageCode
152
+ }) {
153
+ const activation = imessage?.activation;
154
+ const phoneNumber = imessage?.phoneNumber ?? activation?.phoneNumber ?? null;
155
+ const [localError, setLocalError] = (0, _react.useState)(null);
156
+ const connectIMessage = async () => {
157
+ if (!onGenerateIMessageCode) {
158
+ return;
159
+ }
160
+ setLocalError(null);
161
+ try {
162
+ const generated = await onGenerateIMessageCode({
163
+ agentId
164
+ });
165
+ if (generated && onOpenIMessage) {
166
+ await onOpenIMessage({
167
+ agentId,
168
+ ...generated
169
+ });
170
+ }
171
+ } catch (error) {
172
+ setLocalError(error instanceof Error ? error.message : 'iMessage setup failed.');
173
+ }
174
+ };
175
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelCard, {
176
+ accent: "#3B82F6",
177
+ body: imessage?.connected ? 'Connected and active via iMessage.' : 'Open Messages with the activation code ready to send.',
178
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.MessageSquare, {
179
+ color: "#FFFFFF",
180
+ size: 20,
181
+ strokeWidth: 2.45
182
+ }),
183
+ status: imessage?.connected ? 'Active' : activation ? 'Code ready' : 'Not connected',
184
+ title: "iMessage",
185
+ children: imessage?.connected ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
186
+ style: channelStyles.connectedBox,
187
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
188
+ style: channelStyles.connectedTitleRow,
189
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.CheckCircle2, {
190
+ color: "#34D399",
191
+ size: 17,
192
+ strokeWidth: 2.4
193
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
194
+ style: channelStyles.connectedTitle,
195
+ children: "iMessage connection"
196
+ })]
197
+ }), phoneNumber ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
198
+ style: channelStyles.connectedBody,
199
+ children: ["Number: ", phoneNumber]
200
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
201
+ style: channelStyles.actionRow,
202
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
203
+ danger: true,
204
+ disabled: !onDisconnectIMessage || isBusy,
205
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Unplug, {
206
+ color: "#FCA5A5",
207
+ size: 15,
208
+ strokeWidth: 2.4
209
+ }),
210
+ isBusy: isBusy,
211
+ label: "Disconnect",
212
+ onPress: () => onDisconnectIMessage?.({
213
+ agentId
214
+ })
215
+ })
216
+ })]
217
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
218
+ style: channelStyles.setupStack,
219
+ children: [localError ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
220
+ style: channelStyles.errorText,
221
+ children: localError
222
+ }) : null, activation ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
223
+ style: channelStyles.connectedBox,
224
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
225
+ style: channelStyles.codeLabel,
226
+ children: "Text this activation code"
227
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
228
+ selectable: true,
229
+ style: channelStyles.activationCode,
230
+ children: activation.code
231
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
232
+ selectable: true,
233
+ style: channelStyles.connectedBody,
234
+ children: ["To: ", activation.phoneNumber]
235
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
236
+ style: channelStyles.expiryText,
237
+ children: "Code expires in 30 minutes."
238
+ })]
239
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
240
+ style: channelStyles.actionRow,
241
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
242
+ disabled: !onGenerateIMessageCode || isBusy,
243
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.MessageSquare, {
244
+ color: "#FFFFFF",
245
+ size: 15,
246
+ strokeWidth: 2.4
247
+ }),
248
+ isBusy: isBusy,
249
+ label: "Connect via iMessage",
250
+ onPress: connectIMessage,
251
+ secondary: true
252
+ }), activation ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
253
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
254
+ disabled: !onOpenIMessage || isBusy,
255
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.ExternalLink, {
256
+ color: "#111111",
257
+ size: 15,
258
+ strokeWidth: 2.4
259
+ }),
260
+ label: "Open Messages",
261
+ onPress: () => onOpenIMessage?.({
262
+ agentId,
263
+ ...activation
264
+ })
265
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
266
+ secondary: true,
267
+ disabled: !onShareIMessageCode,
268
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Copy, {
269
+ color: "#F4F4F5",
270
+ size: 15,
271
+ strokeWidth: 2.4
272
+ }),
273
+ label: "Share code",
274
+ onPress: () => onShareIMessageCode?.({
275
+ agentId,
276
+ ...activation
277
+ })
278
+ })]
279
+ }) : null]
280
+ })]
281
+ })
282
+ });
283
+ }
284
+ function TelegramChannel({
285
+ agentId,
286
+ isBusy,
287
+ onDisconnectTelegram,
288
+ onOpenTelegram,
289
+ onSetupTelegram,
290
+ telegram
291
+ }) {
292
+ const [tokenText, setTokenText] = (0, _react.useState)('');
293
+ const [tokenError, setTokenError] = (0, _react.useState)(null);
294
+ const token = (0, _react.useMemo)(() => extractTelegramToken(tokenText), [tokenText]);
295
+ const botTitle = telegram?.botName || telegram?.botUsername || 'Telegram bot';
296
+ const setupTelegram = async () => {
297
+ if (!token) {
298
+ setTokenError('Paste the BotFather token to connect Telegram.');
299
+ return;
300
+ }
301
+ setTokenError(null);
302
+ try {
303
+ await onSetupTelegram?.({
304
+ agentId,
305
+ token
306
+ });
307
+ setTokenText('');
308
+ } catch (error) {
309
+ setTokenError(error instanceof Error ? error.message : 'Telegram setup failed.');
310
+ }
311
+ };
312
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelCard, {
313
+ accent: "#37AEE2",
314
+ body: telegram?.connected ? `Connected as ${botTitle}.` : 'Paste a BotFather token to register the webhook.',
315
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Send, {
316
+ color: "#FFFFFF",
317
+ size: 19,
318
+ strokeWidth: 2.45
319
+ }),
320
+ status: telegram?.connected ? 'Active' : 'Not connected',
321
+ title: "Telegram",
322
+ children: telegram?.connected ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
323
+ style: channelStyles.connectedBox,
324
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
325
+ style: channelStyles.connectedTitleRow,
326
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.CheckCircle2, {
327
+ color: "#34D399",
328
+ size: 17,
329
+ strokeWidth: 2.4
330
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
331
+ style: channelStyles.connectedTitle,
332
+ children: botTitle
333
+ })]
334
+ }), telegram.botUsername ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Text, {
335
+ style: channelStyles.connectedBody,
336
+ children: ["@", telegram.botUsername]
337
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
338
+ style: channelStyles.actionRow,
339
+ children: [telegram.botLink ? /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
340
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.ExternalLink, {
341
+ color: "#111111",
342
+ size: 15,
343
+ strokeWidth: 2.4
344
+ }),
345
+ label: "Open bot",
346
+ onPress: () => onOpenTelegram?.({
347
+ agentId,
348
+ url: telegram.botLink || ''
349
+ })
350
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
351
+ danger: true,
352
+ disabled: !onDisconnectTelegram || isBusy,
353
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Unplug, {
354
+ color: "#FCA5A5",
355
+ size: 15,
356
+ strokeWidth: 2.4
357
+ }),
358
+ isBusy: isBusy,
359
+ label: "Disconnect",
360
+ onPress: () => onDisconnectTelegram?.({
361
+ agentId
362
+ })
363
+ })]
364
+ })]
365
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
366
+ style: channelStyles.setupStack,
367
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
368
+ style: channelStyles.helpText,
369
+ children: "Create a bot in BotFather, then paste the full token here."
370
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.TextInput, {
371
+ autoCapitalize: "none",
372
+ autoCorrect: false,
373
+ multiline: true,
374
+ onChangeText: value => {
375
+ setTokenText(value);
376
+ if (tokenError) {
377
+ setTokenError(null);
378
+ }
379
+ },
380
+ placeholder: "123456789:AA...",
381
+ placeholderTextColor: "#71717A",
382
+ style: channelStyles.tokenInput,
383
+ value: tokenText
384
+ }), tokenError ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
385
+ style: channelStyles.errorText,
386
+ children: tokenError
387
+ }) : null, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
388
+ style: channelStyles.actionRow,
389
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
390
+ disabled: !onSetupTelegram || isBusy,
391
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.CheckCircle2, {
392
+ color: "#111111",
393
+ size: 15,
394
+ strokeWidth: 2.4
395
+ }),
396
+ isBusy: isBusy,
397
+ label: "Connect bot",
398
+ onPress: setupTelegram
399
+ })
400
+ })]
401
+ })
402
+ });
403
+ }
404
+ function LineChannel({
405
+ agentId,
406
+ isBusy,
407
+ line,
408
+ onGenerateLineCode,
409
+ onOpenLine,
410
+ onShareLineCode
411
+ }) {
412
+ const activation = line?.activation;
413
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelCard, {
414
+ accent: "#06C755",
415
+ body: activation ? 'Activation code is ready. Add the bot in LINE, then send this code.' : 'Generate a short-lived activation code for the shared LINE bot.',
416
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.MessageCircle, {
417
+ color: "#FFFFFF",
418
+ size: 20,
419
+ strokeWidth: 2.45
420
+ }),
421
+ status: activation ? 'Code ready' : 'Not connected',
422
+ title: "LINE",
423
+ children: activation ? /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
424
+ style: channelStyles.connectedBox,
425
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
426
+ style: channelStyles.codeLabel,
427
+ children: "Activation code"
428
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
429
+ selectable: true,
430
+ style: channelStyles.activationCode,
431
+ children: activation.code
432
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
433
+ style: channelStyles.actionRow,
434
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
435
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.ExternalLink, {
436
+ color: "#111111",
437
+ size: 15,
438
+ strokeWidth: 2.4
439
+ }),
440
+ label: "Open LINE",
441
+ onPress: () => onOpenLine?.({
442
+ agentId,
443
+ url: activation.addFriendUrl
444
+ })
445
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
446
+ secondary: true,
447
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.Copy, {
448
+ color: "#F4F4F5",
449
+ size: 15,
450
+ strokeWidth: 2.4
451
+ }),
452
+ label: "Share code",
453
+ onPress: () => onShareLineCode?.({
454
+ agentId,
455
+ ...activation
456
+ })
457
+ })]
458
+ })]
459
+ }) : /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
460
+ style: channelStyles.actionRow,
461
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)(ChannelButton, {
462
+ disabled: !onGenerateLineCode || isBusy,
463
+ icon: /*#__PURE__*/(0, _jsxRuntime.jsx)(_lucideReactNative.RefreshCw, {
464
+ color: "#111111",
465
+ size: 15,
466
+ strokeWidth: 2.4
467
+ }),
468
+ isBusy: isBusy,
469
+ label: "Generate code",
470
+ onPress: () => onGenerateLineCode?.({
471
+ agentId
472
+ })
473
+ })
474
+ })
475
+ });
476
+ }
477
+ function ChannelCard({
478
+ accent,
479
+ body,
480
+ children,
481
+ icon,
482
+ status,
483
+ title
484
+ }) {
485
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
486
+ style: channelStyles.card,
487
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
488
+ style: channelStyles.cardHeader,
489
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.View, {
490
+ style: [channelStyles.channelIcon, {
491
+ backgroundColor: accent
492
+ }],
493
+ children: icon
494
+ }), /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
495
+ style: channelStyles.channelText,
496
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.View, {
497
+ style: channelStyles.titleRow,
498
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
499
+ style: channelStyles.channelTitle,
500
+ children: title
501
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
502
+ style: channelStyles.statusBadge,
503
+ children: status
504
+ })]
505
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
506
+ style: channelStyles.channelBody,
507
+ children: body
508
+ })]
509
+ })]
510
+ }), children]
511
+ });
512
+ }
513
+ function ChannelButton({
514
+ danger,
515
+ disabled,
516
+ icon,
517
+ isBusy,
518
+ label,
519
+ onPress,
520
+ secondary
521
+ }) {
522
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_reactNative.Pressable, {
523
+ accessibilityRole: "button",
524
+ disabled: disabled,
525
+ onPress: onPress,
526
+ style: ({
527
+ pressed
528
+ }) => [channelStyles.button, secondary && channelStyles.buttonSecondary, danger && channelStyles.buttonDanger, disabled && channelStyles.disabled, pressed && _styles.styles.pressed],
529
+ children: [isBusy ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.ActivityIndicator, {
530
+ color: danger || secondary ? '#F4F4F5' : '#111111',
531
+ size: "small"
532
+ }) : icon, /*#__PURE__*/(0, _jsxRuntime.jsx)(_reactNative.Text, {
533
+ style: [channelStyles.buttonText, secondary && channelStyles.buttonTextSecondary, danger && channelStyles.buttonTextDanger],
534
+ children: label
535
+ })]
536
+ });
537
+ }
538
+ function extractTelegramToken(value) {
539
+ const trimmed = value.trim();
540
+ if (TELEGRAM_TOKEN_PATTERN.test(trimmed)) {
541
+ return trimmed;
542
+ }
543
+ return TELEGRAM_TOKEN_SEARCH.exec(trimmed)?.[0] ?? null;
544
+ }
545
+ const channelStyles = _reactNative.StyleSheet.create({
546
+ actionRow: {
547
+ flexDirection: 'row',
548
+ flexWrap: 'wrap',
549
+ gap: 8,
550
+ marginTop: 12
551
+ },
552
+ activationCode: {
553
+ color: '#F4F4F5',
554
+ fontFamily: 'Courier',
555
+ fontSize: 20,
556
+ fontWeight: '900',
557
+ letterSpacing: 0,
558
+ marginTop: 5
559
+ },
560
+ button: {
561
+ alignItems: 'center',
562
+ backgroundColor: '#F4F4F5',
563
+ borderRadius: 999,
564
+ flexDirection: 'row',
565
+ gap: 6,
566
+ minHeight: 34,
567
+ paddingHorizontal: 12
568
+ },
569
+ buttonDanger: {
570
+ backgroundColor: '#351516',
571
+ borderColor: '#552022',
572
+ borderWidth: 1
573
+ },
574
+ buttonSecondary: {
575
+ backgroundColor: '#242427',
576
+ borderColor: '#353539',
577
+ borderWidth: 1
578
+ },
579
+ buttonText: {
580
+ color: '#111111',
581
+ fontSize: 12,
582
+ fontWeight: '900'
583
+ },
584
+ buttonTextDanger: {
585
+ color: '#FCA5A5'
586
+ },
587
+ buttonTextSecondary: {
588
+ color: '#F4F4F5'
589
+ },
590
+ card: {
591
+ backgroundColor: '#151515',
592
+ borderColor: '#2A2A2A',
593
+ borderRadius: 14,
594
+ borderWidth: 1,
595
+ marginBottom: 10,
596
+ padding: 12
597
+ },
598
+ cardHeader: {
599
+ alignItems: 'flex-start',
600
+ flexDirection: 'row'
601
+ },
602
+ channelBody: {
603
+ color: '#A1A1AA',
604
+ fontSize: 12,
605
+ fontWeight: '600',
606
+ lineHeight: 17,
607
+ marginTop: 4
608
+ },
609
+ channelIcon: {
610
+ alignItems: 'center',
611
+ borderRadius: 12,
612
+ height: 40,
613
+ justifyContent: 'center',
614
+ marginRight: 11,
615
+ width: 40
616
+ },
617
+ channelText: {
618
+ flex: 1,
619
+ minWidth: 0
620
+ },
621
+ channelTitle: {
622
+ color: '#F4F4F5',
623
+ flexShrink: 1,
624
+ fontSize: 14,
625
+ fontWeight: '900'
626
+ },
627
+ codeLabel: {
628
+ color: '#8E8E93',
629
+ fontSize: 11,
630
+ fontWeight: '900',
631
+ textTransform: 'uppercase'
632
+ },
633
+ connectedBody: {
634
+ color: '#A1A1AA',
635
+ fontSize: 12,
636
+ fontWeight: '700',
637
+ marginTop: 4
638
+ },
639
+ connectedBox: {
640
+ backgroundColor: '#101012',
641
+ borderColor: '#2A2A2A',
642
+ borderRadius: 12,
643
+ borderWidth: 1,
644
+ marginTop: 12,
645
+ padding: 11
646
+ },
647
+ connectedTitle: {
648
+ color: '#F4F4F5',
649
+ flex: 1,
650
+ fontSize: 13,
651
+ fontWeight: '900',
652
+ marginLeft: 6
653
+ },
654
+ connectedTitleRow: {
655
+ alignItems: 'center',
656
+ flexDirection: 'row'
657
+ },
658
+ disabled: {
659
+ opacity: 0.55
660
+ },
661
+ errorText: {
662
+ color: '#FCA5A5',
663
+ fontSize: 12,
664
+ fontWeight: '700',
665
+ marginTop: 7
666
+ },
667
+ expiryText: {
668
+ color: '#71717A',
669
+ fontSize: 11,
670
+ fontWeight: '700',
671
+ marginTop: 7
672
+ },
673
+ headerActions: {
674
+ alignItems: 'center',
675
+ flexDirection: 'row',
676
+ gap: 8
677
+ },
678
+ helpText: {
679
+ color: '#A1A1AA',
680
+ fontSize: 12,
681
+ fontWeight: '600',
682
+ lineHeight: 17
683
+ },
684
+ iconButton: {
685
+ alignItems: 'center',
686
+ backgroundColor: '#1F1F23',
687
+ borderColor: '#2A2A2A',
688
+ borderRadius: 11,
689
+ borderWidth: 1,
690
+ height: 34,
691
+ justifyContent: 'center',
692
+ width: 34
693
+ },
694
+ setupStack: {
695
+ marginTop: 12
696
+ },
697
+ stack: {
698
+ padding: 10
699
+ },
700
+ statusBadge: {
701
+ backgroundColor: '#242427',
702
+ borderRadius: 10,
703
+ color: '#C7C7CC',
704
+ fontSize: 10,
705
+ fontWeight: '900',
706
+ marginLeft: 8,
707
+ overflow: 'hidden',
708
+ paddingHorizontal: 7,
709
+ paddingVertical: 4
710
+ },
711
+ titleRow: {
712
+ alignItems: 'center',
713
+ flexDirection: 'row',
714
+ flexWrap: 'wrap'
715
+ },
716
+ tokenInput: {
717
+ backgroundColor: '#0B0B0C',
718
+ borderColor: '#2A2A2A',
719
+ borderRadius: 12,
720
+ borderWidth: 1,
721
+ color: '#F4F4F5',
722
+ fontFamily: 'Courier',
723
+ fontSize: 12,
724
+ fontWeight: '700',
725
+ lineHeight: 17,
726
+ marginTop: 9,
727
+ minHeight: 72,
728
+ paddingHorizontal: 11,
729
+ paddingVertical: 10,
730
+ textAlignVertical: 'top'
731
+ }
732
+ });
733
+ //# sourceMappingURL=ChannelsPanel.js.map