@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,19 @@
1
+ import React from 'react';
2
+ import { Text, View } from 'react-native';
3
+
4
+ import { getEditorTabLabel } from './editorTabs';
5
+ import { editorShellStyles } from './editorShellStyles';
6
+ import type { SuperagentEditorTab } from './types';
7
+
8
+ export function EditorTabPanel({ tab }: { tab: SuperagentEditorTab }) {
9
+ const label = getEditorTabLabel(tab);
10
+
11
+ return (
12
+ <View style={editorShellStyles.placeholderPanel}>
13
+ <Text style={editorShellStyles.placeholderTitle}>{label}</Text>
14
+ <Text style={editorShellStyles.placeholderBody}>
15
+ This section now lives inside the native settings modal.
16
+ </Text>
17
+ </View>
18
+ );
19
+ }
@@ -0,0 +1,577 @@
1
+ import React, { useMemo, useState } from 'react';
2
+ import {
3
+ ActivityIndicator,
4
+ Image,
5
+ Modal,
6
+ Pressable,
7
+ ScrollView,
8
+ Text,
9
+ TextInput,
10
+ View,
11
+ } from 'react-native';
12
+ import {
13
+ AlertCircle,
14
+ ChevronDown,
15
+ ChevronRight,
16
+ File,
17
+ FileCode,
18
+ FileImage,
19
+ FileText,
20
+ Folder,
21
+ RefreshCw,
22
+ Save,
23
+ Search,
24
+ Upload,
25
+ X,
26
+ type LucideIcon,
27
+ } from 'lucide-react-native';
28
+
29
+ import {
30
+ DEFAULT_SANDBOX_FILE_PATHS,
31
+ buildFileTree,
32
+ flattenFileTree,
33
+ getFileCategory,
34
+ getFileName,
35
+ getFolderPath,
36
+ getImageMimeType,
37
+ isEditableFile,
38
+ } from './fileTreeUtils';
39
+ import { editorShellStyles } from './editorShellStyles';
40
+ import { styles } from './styles';
41
+ import type {
42
+ SuperagentAgent,
43
+ SuperagentSandboxFileActionInput,
44
+ SuperagentSandboxFileContent,
45
+ SuperagentSandboxFileNode,
46
+ SuperagentSandboxFileSaveInput,
47
+ SuperagentSandboxFileUploadInput,
48
+ SuperagentSandboxFileUploadResult,
49
+ } from './types';
50
+
51
+ export function FilesPanel({
52
+ agent,
53
+ fileLoadError,
54
+ fileLoadFailed,
55
+ filePaths = [],
56
+ isLoading,
57
+ onOpenSandboxFile,
58
+ onRefreshFiles,
59
+ onSaveSandboxFile,
60
+ onUploadSandboxFiles,
61
+ }: {
62
+ agent: SuperagentAgent;
63
+ fileLoadError?: string | null;
64
+ fileLoadFailed?: boolean;
65
+ filePaths?: string[];
66
+ isLoading?: boolean;
67
+ onOpenSandboxFile?: (input: SuperagentSandboxFileActionInput) => Promise<SuperagentSandboxFileContent> | SuperagentSandboxFileContent;
68
+ onRefreshFiles?: (agentId: string) => Promise<void> | void;
69
+ onSaveSandboxFile?: (input: SuperagentSandboxFileSaveInput) => Promise<void> | void;
70
+ onUploadSandboxFiles?: (input: SuperagentSandboxFileUploadInput) => Promise<SuperagentSandboxFileUploadResult[] | void> | SuperagentSandboxFileUploadResult[] | void;
71
+ }) {
72
+ const [query, setQuery] = useState('');
73
+ const [openedFile, setOpenedFile] = useState<SuperagentSandboxFileContent | null>(null);
74
+ const [draftContent, setDraftContent] = useState('');
75
+ const [fileError, setFileError] = useState<string | null>(null);
76
+ const [loadingPath, setLoadingPath] = useState<string | null>(null);
77
+ const [isRefreshing, setIsRefreshing] = useState(false);
78
+ const [isSaving, setIsSaving] = useState(false);
79
+ const [isUploading, setIsUploading] = useState(false);
80
+ const [uploadStatus, setUploadStatus] = useState<string | null>(null);
81
+ const { fileCount, folderCount, tree } = useMemo(() => {
82
+ const primaryTree = buildFileTree(filePaths);
83
+ if (primaryTree.fileCount > 0 || primaryTree.folderCount > 0 || primaryTree.tree.length > 0) {
84
+ return primaryTree;
85
+ }
86
+
87
+ return buildFileTree(DEFAULT_SANDBOX_FILE_PATHS);
88
+ }, [filePaths]);
89
+ const allFiles = useMemo(() => flattenFileTree(tree), [tree]);
90
+ const filteredFiles = useMemo(() => {
91
+ const normalizedQuery = query.trim().toLowerCase();
92
+ if (!normalizedQuery) {
93
+ return [];
94
+ }
95
+
96
+ return allFiles.filter((path) => path.toLowerCase().includes(normalizedQuery));
97
+ }, [allFiles, query]);
98
+
99
+ const openFile = async (path: string) => {
100
+ if (!onOpenSandboxFile) {
101
+ setFileError('File opening is not connected in this app build.');
102
+ return;
103
+ }
104
+
105
+ setLoadingPath(path);
106
+ setFileError(null);
107
+ try {
108
+ const file = await onOpenSandboxFile({ agentId: agent.id, path });
109
+ setOpenedFile(file);
110
+ setDraftContent(file.content);
111
+ } catch (error) {
112
+ setFileError(error instanceof Error ? error.message : 'Failed to open file.');
113
+ } finally {
114
+ setLoadingPath(null);
115
+ }
116
+ };
117
+
118
+ const refreshFiles = async () => {
119
+ if (!onRefreshFiles) {
120
+ return;
121
+ }
122
+
123
+ setIsRefreshing(true);
124
+ setFileError(null);
125
+ try {
126
+ await onRefreshFiles(agent.id);
127
+ } catch (error) {
128
+ setFileError(error instanceof Error ? error.message : 'Failed to refresh files.');
129
+ } finally {
130
+ setIsRefreshing(false);
131
+ }
132
+ };
133
+
134
+ const uploadFiles = async () => {
135
+ if (!onUploadSandboxFiles) {
136
+ setFileError('Native sandbox upload is not connected in this app build.');
137
+ return;
138
+ }
139
+
140
+ setIsUploading(true);
141
+ setFileError(null);
142
+ setUploadStatus(null);
143
+ try {
144
+ const result = await onUploadSandboxFiles({ agentId: agent.id });
145
+ const uploadedCount = Array.isArray(result) ? result.length : 0;
146
+ setUploadStatus(uploadedCount > 0 ? `Uploaded ${uploadedCount} file${uploadedCount === 1 ? '' : 's'}.` : null);
147
+ } catch (error) {
148
+ setFileError(error instanceof Error ? error.message : 'Failed to upload files.');
149
+ } finally {
150
+ setIsUploading(false);
151
+ }
152
+ };
153
+
154
+ const closeOpenedFile = () => {
155
+ setOpenedFile(null);
156
+ setDraftContent('');
157
+ };
158
+
159
+ const saveOpenedFile = async () => {
160
+ if (!openedFile || !onSaveSandboxFile || !isEditableFile(openedFile.path)) {
161
+ return;
162
+ }
163
+
164
+ setIsSaving(true);
165
+ setFileError(null);
166
+ try {
167
+ await onSaveSandboxFile({
168
+ agentId: agent.id,
169
+ content: draftContent,
170
+ path: openedFile.path,
171
+ });
172
+ setOpenedFile({ content: draftContent, path: openedFile.path });
173
+ } catch (error) {
174
+ setFileError(error instanceof Error ? error.message : 'Failed to save file.');
175
+ } finally {
176
+ setIsSaving(false);
177
+ }
178
+ };
179
+
180
+ return (
181
+ <View style={editorShellStyles.settingsStack}>
182
+ <View style={editorShellStyles.panel}>
183
+ <View style={editorShellStyles.panelHeader}>
184
+ <View>
185
+ <Text style={editorShellStyles.panelTitle}>Sandbox files</Text>
186
+ <Text style={editorShellStyles.panelSubtitle}>
187
+ {fileCount} files · {folderCount} folders
188
+ </Text>
189
+ </View>
190
+ <View style={editorShellStyles.fileHeaderActions}>
191
+ <Pressable
192
+ accessibilityLabel="Upload files"
193
+ accessibilityRole="button"
194
+ disabled={isUploading}
195
+ onPress={uploadFiles}
196
+ style={({ pressed }) => [
197
+ editorShellStyles.fileIconButton,
198
+ pressed && styles.pressed,
199
+ isUploading && editorShellStyles.disabledAction,
200
+ ]}
201
+ >
202
+ {isUploading ? (
203
+ <ActivityIndicator color="#F4F4F5" size="small" />
204
+ ) : (
205
+ <Upload color="#F4F4F5" size={16} strokeWidth={2.4} />
206
+ )}
207
+ </Pressable>
208
+ <Pressable
209
+ accessibilityLabel="Refresh files"
210
+ accessibilityRole="button"
211
+ disabled={isRefreshing || isLoading}
212
+ onPress={refreshFiles}
213
+ style={({ pressed }) => [
214
+ editorShellStyles.fileIconButton,
215
+ pressed && styles.pressed,
216
+ (isRefreshing || isLoading) && editorShellStyles.disabledAction,
217
+ ]}
218
+ >
219
+ {isRefreshing || isLoading ? (
220
+ <ActivityIndicator color="#F4F4F5" size="small" />
221
+ ) : (
222
+ <RefreshCw color="#F4F4F5" size={16} strokeWidth={2.4} />
223
+ )}
224
+ </Pressable>
225
+ </View>
226
+ </View>
227
+
228
+ <View style={editorShellStyles.fileSearchWrap}>
229
+ <Search color="#A1A1AA" size={16} strokeWidth={2.4} />
230
+ <TextInput
231
+ autoCapitalize="none"
232
+ autoCorrect={false}
233
+ clearButtonMode="while-editing"
234
+ onChangeText={setQuery}
235
+ placeholder="Search files"
236
+ placeholderTextColor="#8E8E93"
237
+ returnKeyType="search"
238
+ style={editorShellStyles.fileSearchInput}
239
+ value={query}
240
+ />
241
+ </View>
242
+
243
+ {fileError ? <Text style={editorShellStyles.fileStatusError}>{fileError}</Text> : null}
244
+ {uploadStatus ? <Text style={editorShellStyles.fileStatusText}>{uploadStatus}</Text> : null}
245
+ {fileLoadFailed ? (
246
+ <View style={editorShellStyles.fileStatusBanner}>
247
+ <AlertCircle color="#FBBF24" size={15} strokeWidth={2.4} />
248
+ <Text style={editorShellStyles.fileStatusBannerText}>
249
+ Files API did not return a list. Showing the default sandbox folders.
250
+ </Text>
251
+ </View>
252
+ ) : null}
253
+ {fileLoadFailed && fileLoadError ? (
254
+ <Text style={editorShellStyles.fileStatusError}>{fileLoadError}</Text>
255
+ ) : null}
256
+
257
+ {isLoading ? (
258
+ <View style={editorShellStyles.loadingPanel}>
259
+ <ActivityIndicator color="#FF5A1F" />
260
+ <Text style={editorShellStyles.loadingText}>Loading files...</Text>
261
+ </View>
262
+ ) : fileCount === 0 && folderCount === 0 && tree.length === 0 ? (
263
+ <View style={editorShellStyles.emptyPanel}>
264
+ <Folder color="#8E8E93" size={22} strokeWidth={2.2} />
265
+ <Text style={editorShellStyles.emptyTitle}>No files yet</Text>
266
+ <Text style={editorShellStyles.emptyBody}>Generated and uploaded sandbox files will appear here.</Text>
267
+ </View>
268
+ ) : (
269
+ <View style={editorShellStyles.fileTreeWrap}>
270
+ {query.trim() ? (
271
+ filteredFiles.length > 0 ? (
272
+ filteredFiles.map((path) => (
273
+ <FileSearchRow
274
+ isLoading={loadingPath === path}
275
+ key={path}
276
+ onPress={() => openFile(path)}
277
+ path={path}
278
+ />
279
+ ))
280
+ ) : (
281
+ <View style={editorShellStyles.emptyPanel}>
282
+ <Search color="#8E8E93" size={22} strokeWidth={2.2} />
283
+ <Text style={editorShellStyles.emptyTitle}>No matching files</Text>
284
+ <Text style={editorShellStyles.emptyBody}>Try another folder or file name.</Text>
285
+ </View>
286
+ )
287
+ ) : (
288
+ tree.map((node) => (
289
+ <FileTreeNode
290
+ isLoadingPath={loadingPath}
291
+ key={node.name}
292
+ node={node}
293
+ onFilePress={openFile}
294
+ />
295
+ ))
296
+ )}
297
+ </View>
298
+ )}
299
+ </View>
300
+
301
+ <FileEditorModal
302
+ draftContent={draftContent}
303
+ file={openedFile}
304
+ isSaving={isSaving}
305
+ onChangeDraft={setDraftContent}
306
+ onClose={closeOpenedFile}
307
+ onSave={saveOpenedFile}
308
+ />
309
+ </View>
310
+ );
311
+ }
312
+
313
+ function FileTreeNode({
314
+ depth = 0,
315
+ isLoadingPath,
316
+ node,
317
+ onFilePress,
318
+ parentPath = '',
319
+ }: {
320
+ depth?: number;
321
+ isLoadingPath: string | null;
322
+ node: SuperagentSandboxFileNode;
323
+ onFilePress: (path: string) => void;
324
+ parentPath?: string;
325
+ }) {
326
+ const [expanded, setExpanded] = useState(depth < 1);
327
+ const isFolder = node.type === 'folder';
328
+ const path = parentPath ? `${parentPath}/${node.name}` : node.name;
329
+
330
+ if (!isFolder) {
331
+ return (
332
+ <FileTreeRow
333
+ depth={depth}
334
+ isLoading={isLoadingPath === path}
335
+ onPress={() => onFilePress(path)}
336
+ path={path}
337
+ />
338
+ );
339
+ }
340
+
341
+ return (
342
+ <View>
343
+ <Pressable
344
+ accessibilityRole="button"
345
+ onPress={() => setExpanded((current) => !current)}
346
+ style={({ pressed }) => [
347
+ editorShellStyles.fileTreeRow,
348
+ { paddingLeft: 10 + depth * 14 },
349
+ pressed && styles.pressed,
350
+ ]}
351
+ >
352
+ {expanded ? (
353
+ <ChevronDown color="#8E8E93" size={16} strokeWidth={2.5} />
354
+ ) : (
355
+ <ChevronRight color="#8E8E93" size={16} strokeWidth={2.5} />
356
+ )}
357
+ <Folder color="#F59E0B" size={17} strokeWidth={2.3} />
358
+ <Text numberOfLines={1} style={editorShellStyles.fileFolderName}>{node.name}</Text>
359
+ <Text style={editorShellStyles.fileFolderCount}>{flattenFileTree(node.children ?? []).length}</Text>
360
+ </Pressable>
361
+ {expanded ? (
362
+ node.children?.map((child) => (
363
+ <FileTreeNode
364
+ depth={depth + 1}
365
+ isLoadingPath={isLoadingPath}
366
+ key={child.name}
367
+ node={child}
368
+ onFilePress={onFilePress}
369
+ parentPath={path}
370
+ />
371
+ ))
372
+ ) : null}
373
+ </View>
374
+ );
375
+ }
376
+
377
+ function FileSearchRow({
378
+ isLoading,
379
+ onPress,
380
+ path,
381
+ }: {
382
+ isLoading: boolean;
383
+ onPress: () => void;
384
+ path: string;
385
+ }) {
386
+ return (
387
+ <Pressable
388
+ accessibilityRole="button"
389
+ onPress={onPress}
390
+ style={({ pressed }) => [
391
+ editorShellStyles.fileSearchRow,
392
+ pressed && styles.pressed,
393
+ ]}
394
+ >
395
+ <FileKindIcon path={path} />
396
+ <View style={editorShellStyles.fileRowText}>
397
+ <Text numberOfLines={1} style={editorShellStyles.fileName}>{getFileName(path)}</Text>
398
+ <Text numberOfLines={1} style={editorShellStyles.filePath}>{getFolderPath(path) || 'root'}</Text>
399
+ </View>
400
+ {isLoading ? <ActivityIndicator color="#F4F4F5" size="small" /> : null}
401
+ </Pressable>
402
+ );
403
+ }
404
+
405
+ function FileTreeRow({
406
+ depth,
407
+ isLoading,
408
+ onPress,
409
+ path,
410
+ }: {
411
+ depth: number;
412
+ isLoading: boolean;
413
+ onPress: () => void;
414
+ path: string;
415
+ }) {
416
+ return (
417
+ <Pressable
418
+ accessibilityRole="button"
419
+ onPress={onPress}
420
+ style={({ pressed }) => [
421
+ editorShellStyles.fileTreeRow,
422
+ { paddingLeft: 32 + depth * 14 },
423
+ pressed && styles.pressed,
424
+ ]}
425
+ >
426
+ <FileKindIcon path={path} />
427
+ <Text numberOfLines={1} style={editorShellStyles.fileName}>{getFileName(path)}</Text>
428
+ {isLoading ? <ActivityIndicator color="#F4F4F5" size="small" /> : null}
429
+ </Pressable>
430
+ );
431
+ }
432
+
433
+ function FileKindIcon({ path }: { path: string }) {
434
+ const category = getFileCategory(path);
435
+ const Icon: LucideIcon = category === 'image'
436
+ ? FileImage
437
+ : category === 'code' || category === 'html'
438
+ ? FileCode
439
+ : category === 'markdown' || category === 'text'
440
+ ? FileText
441
+ : File;
442
+
443
+ return <Icon color={category === 'image' ? '#67E8F9' : '#A1A1AA'} size={16} strokeWidth={2.3} />;
444
+ }
445
+
446
+ function FileEditorModal({
447
+ draftContent,
448
+ file,
449
+ isSaving,
450
+ onChangeDraft,
451
+ onClose,
452
+ onSave,
453
+ }: {
454
+ draftContent: string;
455
+ file: SuperagentSandboxFileContent | null;
456
+ isSaving: boolean;
457
+ onChangeDraft: (content: string) => void;
458
+ onClose: () => void;
459
+ onSave: () => void;
460
+ }) {
461
+ if (!file) {
462
+ return null;
463
+ }
464
+
465
+ const editable = isEditableFile(file.path);
466
+ const isDirty = draftContent !== file.content;
467
+ const category = getFileCategory(file.path);
468
+
469
+ return (
470
+ <Modal animationType="slide" presentationStyle="pageSheet" visible={!!file} onRequestClose={onClose}>
471
+ <View style={editorShellStyles.fileModalRoot}>
472
+ <View style={editorShellStyles.fileModalHeader}>
473
+ <Pressable
474
+ accessibilityLabel="Close file"
475
+ accessibilityRole="button"
476
+ onPress={onClose}
477
+ style={({ pressed }) => [editorShellStyles.fileIconButton, pressed && styles.pressed]}
478
+ >
479
+ <X color="#F4F4F5" size={18} strokeWidth={2.5} />
480
+ </Pressable>
481
+ <View style={editorShellStyles.fileModalTitleWrap}>
482
+ <Text numberOfLines={1} style={editorShellStyles.fileModalTitle}>{getFileName(file.path)}</Text>
483
+ <Text numberOfLines={1} style={editorShellStyles.fileModalPath}>{file.path}</Text>
484
+ </View>
485
+ {editable ? (
486
+ <Pressable
487
+ accessibilityLabel="Save file"
488
+ accessibilityRole="button"
489
+ disabled={!isDirty || isSaving}
490
+ onPress={onSave}
491
+ style={({ pressed }) => [
492
+ editorShellStyles.fileSaveButton,
493
+ (!isDirty || isSaving) && editorShellStyles.disabledAction,
494
+ pressed && styles.pressed,
495
+ ]}
496
+ >
497
+ {isSaving ? (
498
+ <ActivityIndicator color="#111111" size="small" />
499
+ ) : (
500
+ <Save color="#111111" size={16} strokeWidth={2.5} />
501
+ )}
502
+ <Text style={editorShellStyles.fileSaveText}>Save</Text>
503
+ </Pressable>
504
+ ) : (
505
+ <View style={editorShellStyles.fileReadOnlyBadge}>
506
+ <Text style={editorShellStyles.fileReadOnlyText}>Read only</Text>
507
+ </View>
508
+ )}
509
+ </View>
510
+ <View style={editorShellStyles.fileEditorBody}>
511
+ <FileContentView
512
+ category={category}
513
+ content={draftContent}
514
+ editable={editable}
515
+ onChangeText={onChangeDraft}
516
+ path={file.path}
517
+ />
518
+ </View>
519
+ </View>
520
+ </Modal>
521
+ );
522
+ }
523
+
524
+ function FileContentView({
525
+ category,
526
+ content,
527
+ editable,
528
+ onChangeText,
529
+ path,
530
+ }: {
531
+ category: ReturnType<typeof getFileCategory>;
532
+ content: string;
533
+ editable: boolean;
534
+ onChangeText: (content: string) => void;
535
+ path: string;
536
+ }) {
537
+ if (category === 'image' && getImageMimeType(path) !== 'image/svg+xml') {
538
+ const source = content.startsWith('data:')
539
+ ? content
540
+ : `data:${getImageMimeType(path)};base64,${content}`;
541
+ return (
542
+ <ScrollView contentContainerStyle={editorShellStyles.fileImagePreviewWrap}>
543
+ <Image resizeMode="contain" source={{ uri: source }} style={editorShellStyles.fileImagePreview} />
544
+ </ScrollView>
545
+ );
546
+ }
547
+
548
+ if (category === 'pdf') {
549
+ return (
550
+ <View style={editorShellStyles.fileUnsupportedPreview}>
551
+ <File color="#A1A1AA" size={32} strokeWidth={2.2} />
552
+ <Text style={editorShellStyles.fileUnsupportedTitle}>PDF preview</Text>
553
+ <Text style={editorShellStyles.fileUnsupportedBody}>
554
+ This file is available in the sandbox. Native PDF viewing is not enabled in this build yet.
555
+ </Text>
556
+ </View>
557
+ );
558
+ }
559
+
560
+ return (
561
+ <TextInput
562
+ autoCapitalize="none"
563
+ autoCorrect={false}
564
+ editable={editable}
565
+ multiline
566
+ onChangeText={onChangeText}
567
+ scrollEnabled
568
+ spellCheck={false}
569
+ style={[
570
+ editorShellStyles.fileSourceInput,
571
+ !editable && editorShellStyles.fileSourceInputReadOnly,
572
+ ]}
573
+ textAlignVertical="top"
574
+ value={content}
575
+ />
576
+ );
577
+ }