@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.
- package/README.md +132 -0
- package/lib/commonjs/AgentSettingsPanel.js +1067 -0
- package/lib/commonjs/AgentSettingsPanel.js.map +1 -0
- package/lib/commonjs/AgentSphereIcon.js +243 -0
- package/lib/commonjs/AgentSphereIcon.js.map +1 -0
- package/lib/commonjs/AttachmentPickerStatusModal.js +96 -0
- package/lib/commonjs/AttachmentPickerStatusModal.js.map +1 -0
- package/lib/commonjs/AttachmentPreviewStrip.js +49 -0
- package/lib/commonjs/AttachmentPreviewStrip.js.map +1 -0
- package/lib/commonjs/ChannelsPanel.js +733 -0
- package/lib/commonjs/ChannelsPanel.js.map +1 -0
- package/lib/commonjs/ConversationChat.js +219 -0
- package/lib/commonjs/ConversationChat.js.map +1 -0
- package/lib/commonjs/ConversationComposer.js +323 -0
- package/lib/commonjs/ConversationComposer.js.map +1 -0
- package/lib/commonjs/ConversationMessageList.js +105 -0
- package/lib/commonjs/ConversationMessageList.js.map +1 -0
- package/lib/commonjs/ConversationScreen.js +241 -0
- package/lib/commonjs/ConversationScreen.js.map +1 -0
- package/lib/commonjs/EditorDrawer.js +1127 -0
- package/lib/commonjs/EditorDrawer.js.map +1 -0
- package/lib/commonjs/EditorTabPanel.js +28 -0
- package/lib/commonjs/EditorTabPanel.js.map +1 -0
- package/lib/commonjs/FilesPanel.js +533 -0
- package/lib/commonjs/FilesPanel.js.map +1 -0
- package/lib/commonjs/MarkdownText.js +313 -0
- package/lib/commonjs/MarkdownText.js.map +1 -0
- package/lib/commonjs/MessageActionBar.js +90 -0
- package/lib/commonjs/MessageActionBar.js.map +1 -0
- package/lib/commonjs/RenameAgentModal.js +99 -0
- package/lib/commonjs/RenameAgentModal.js.map +1 -0
- package/lib/commonjs/ShareAgentModal.js +349 -0
- package/lib/commonjs/ShareAgentModal.js.map +1 -0
- package/lib/commonjs/ShareAgentModal.styles.js +236 -0
- package/lib/commonjs/ShareAgentModal.styles.js.map +1 -0
- package/lib/commonjs/SuperagentHomeScreen.js +316 -0
- package/lib/commonjs/SuperagentHomeScreen.js.map +1 -0
- package/lib/commonjs/ToolApprovalCard.js +542 -0
- package/lib/commonjs/ToolApprovalCard.js.map +1 -0
- package/lib/commonjs/ToolCallSummary.js +632 -0
- package/lib/commonjs/ToolCallSummary.js.map +1 -0
- package/lib/commonjs/agentSphereStyles.js +38 -0
- package/lib/commonjs/agentSphereStyles.js.map +1 -0
- package/lib/commonjs/apiClient.js +158 -0
- package/lib/commonjs/apiClient.js.map +1 -0
- package/lib/commonjs/attachmentFileHelpers.js +104 -0
- package/lib/commonjs/attachmentFileHelpers.js.map +1 -0
- package/lib/commonjs/attachmentUpload.js +87 -0
- package/lib/commonjs/attachmentUpload.js.map +1 -0
- package/lib/commonjs/composerStyles.js +248 -0
- package/lib/commonjs/composerStyles.js.map +1 -0
- package/lib/commonjs/connectorBrandIcons.js +82 -0
- package/lib/commonjs/connectorBrandIcons.js.map +1 -0
- package/lib/commonjs/connectorCatalog.js +377 -0
- package/lib/commonjs/connectorCatalog.js.map +1 -0
- package/lib/commonjs/constants.js +15 -0
- package/lib/commonjs/constants.js.map +1 -0
- package/lib/commonjs/conversationParts.js +273 -0
- package/lib/commonjs/conversationParts.js.map +1 -0
- package/lib/commonjs/conversationRuntime.js +144 -0
- package/lib/commonjs/conversationRuntime.js.map +1 -0
- package/lib/commonjs/conversationStyles.js +758 -0
- package/lib/commonjs/conversationStyles.js.map +1 -0
- package/lib/commonjs/editorShellStyles.js +1032 -0
- package/lib/commonjs/editorShellStyles.js.map +1 -0
- package/lib/commonjs/editorTabs.js +42 -0
- package/lib/commonjs/editorTabs.js.map +1 -0
- package/lib/commonjs/fileTreeUtils.js +133 -0
- package/lib/commonjs/fileTreeUtils.js.map +1 -0
- package/lib/commonjs/index.js +110 -0
- package/lib/commonjs/index.js.map +1 -0
- package/lib/commonjs/markdownStyles.js +157 -0
- package/lib/commonjs/markdownStyles.js.map +1 -0
- package/lib/commonjs/mediaUtils.js +61 -0
- package/lib/commonjs/mediaUtils.js.map +1 -0
- package/lib/commonjs/messageActionStyles.js +45 -0
- package/lib/commonjs/messageActionStyles.js.map +1 -0
- package/lib/commonjs/messageUtils.js +55 -0
- package/lib/commonjs/messageUtils.js.map +1 -0
- package/lib/commonjs/nativeActionSheet.js +21 -0
- package/lib/commonjs/nativeActionSheet.js.map +1 -0
- package/lib/commonjs/nativeActionSheet.web.js +10 -0
- package/lib/commonjs/nativeActionSheet.web.js.map +1 -0
- package/lib/commonjs/package.json +1 -0
- package/lib/commonjs/paperTheme.js +59 -0
- package/lib/commonjs/paperTheme.js.map +1 -0
- package/lib/commonjs/realtimeClient.js +99 -0
- package/lib/commonjs/realtimeClient.js.map +1 -0
- package/lib/commonjs/renameAgentModalStyles.js +83 -0
- package/lib/commonjs/renameAgentModalStyles.js.map +1 -0
- package/lib/commonjs/screenParts.js +220 -0
- package/lib/commonjs/screenParts.js.map +1 -0
- package/lib/commonjs/styles.js +343 -0
- package/lib/commonjs/styles.js.map +1 -0
- package/lib/commonjs/superagentApiClient.js +613 -0
- package/lib/commonjs/superagentApiClient.js.map +1 -0
- package/lib/commonjs/types.js +6 -0
- package/lib/commonjs/types.js.map +1 -0
- package/lib/commonjs/useSuperagentAttachmentPicker.js +80 -0
- package/lib/commonjs/useSuperagentAttachmentPicker.js.map +1 -0
- package/lib/commonjs/useSuperagentConversation.js +216 -0
- package/lib/commonjs/useSuperagentConversation.js.map +1 -0
- package/lib/commonjs/useSuperagentRuntime.js +1207 -0
- package/lib/commonjs/useSuperagentRuntime.js.map +1 -0
- package/lib/module/AgentSettingsPanel.js +1062 -0
- package/lib/module/AgentSettingsPanel.js.map +1 -0
- package/lib/module/AgentSphereIcon.js +237 -0
- package/lib/module/AgentSphereIcon.js.map +1 -0
- package/lib/module/AttachmentPickerStatusModal.js +91 -0
- package/lib/module/AttachmentPickerStatusModal.js.map +1 -0
- package/lib/module/AttachmentPreviewStrip.js +44 -0
- package/lib/module/AttachmentPreviewStrip.js.map +1 -0
- package/lib/module/ChannelsPanel.js +728 -0
- package/lib/module/ChannelsPanel.js.map +1 -0
- package/lib/module/ConversationChat.js +214 -0
- package/lib/module/ConversationChat.js.map +1 -0
- package/lib/module/ConversationComposer.js +318 -0
- package/lib/module/ConversationComposer.js.map +1 -0
- package/lib/module/ConversationMessageList.js +100 -0
- package/lib/module/ConversationMessageList.js.map +1 -0
- package/lib/module/ConversationScreen.js +236 -0
- package/lib/module/ConversationScreen.js.map +1 -0
- package/lib/module/EditorDrawer.js +1122 -0
- package/lib/module/EditorDrawer.js.map +1 -0
- package/lib/module/EditorTabPanel.js +23 -0
- package/lib/module/EditorTabPanel.js.map +1 -0
- package/lib/module/FilesPanel.js +528 -0
- package/lib/module/FilesPanel.js.map +1 -0
- package/lib/module/MarkdownText.js +308 -0
- package/lib/module/MarkdownText.js.map +1 -0
- package/lib/module/MessageActionBar.js +85 -0
- package/lib/module/MessageActionBar.js.map +1 -0
- package/lib/module/RenameAgentModal.js +94 -0
- package/lib/module/RenameAgentModal.js.map +1 -0
- package/lib/module/ShareAgentModal.js +344 -0
- package/lib/module/ShareAgentModal.js.map +1 -0
- package/lib/module/ShareAgentModal.styles.js +232 -0
- package/lib/module/ShareAgentModal.styles.js.map +1 -0
- package/lib/module/SuperagentHomeScreen.js +311 -0
- package/lib/module/SuperagentHomeScreen.js.map +1 -0
- package/lib/module/ToolApprovalCard.js +537 -0
- package/lib/module/ToolApprovalCard.js.map +1 -0
- package/lib/module/ToolCallSummary.js +627 -0
- package/lib/module/ToolCallSummary.js.map +1 -0
- package/lib/module/agentSphereStyles.js +34 -0
- package/lib/module/agentSphereStyles.js.map +1 -0
- package/lib/module/apiClient.js +154 -0
- package/lib/module/apiClient.js.map +1 -0
- package/lib/module/attachmentFileHelpers.js +97 -0
- package/lib/module/attachmentFileHelpers.js.map +1 -0
- package/lib/module/attachmentUpload.js +82 -0
- package/lib/module/attachmentUpload.js.map +1 -0
- package/lib/module/composerStyles.js +244 -0
- package/lib/module/composerStyles.js.map +1 -0
- package/lib/module/connectorBrandIcons.js +76 -0
- package/lib/module/connectorBrandIcons.js.map +1 -0
- package/lib/module/connectorCatalog.js +373 -0
- package/lib/module/connectorCatalog.js.map +1 -0
- package/lib/module/constants.js +10 -0
- package/lib/module/constants.js.map +1 -0
- package/lib/module/conversationParts.js +266 -0
- package/lib/module/conversationParts.js.map +1 -0
- package/lib/module/conversationRuntime.js +129 -0
- package/lib/module/conversationRuntime.js.map +1 -0
- package/lib/module/conversationStyles.js +754 -0
- package/lib/module/conversationStyles.js.map +1 -0
- package/lib/module/editorShellStyles.js +1028 -0
- package/lib/module/editorShellStyles.js.map +1 -0
- package/lib/module/editorTabs.js +37 -0
- package/lib/module/editorTabs.js.map +1 -0
- package/lib/module/fileTreeUtils.js +120 -0
- package/lib/module/fileTreeUtils.js.map +1 -0
- package/lib/module/index.js +17 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/markdownStyles.js +153 -0
- package/lib/module/markdownStyles.js.map +1 -0
- package/lib/module/mediaUtils.js +53 -0
- package/lib/module/mediaUtils.js.map +1 -0
- package/lib/module/messageActionStyles.js +41 -0
- package/lib/module/messageActionStyles.js.map +1 -0
- package/lib/module/messageUtils.js +46 -0
- package/lib/module/messageUtils.js.map +1 -0
- package/lib/module/nativeActionSheet.js +17 -0
- package/lib/module/nativeActionSheet.js.map +1 -0
- package/lib/module/nativeActionSheet.web.js +6 -0
- package/lib/module/nativeActionSheet.web.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/module/paperTheme.js +55 -0
- package/lib/module/paperTheme.js.map +1 -0
- package/lib/module/realtimeClient.js +95 -0
- package/lib/module/realtimeClient.js.map +1 -0
- package/lib/module/renameAgentModalStyles.js +79 -0
- package/lib/module/renameAgentModalStyles.js.map +1 -0
- package/lib/module/screenParts.js +210 -0
- package/lib/module/screenParts.js.map +1 -0
- package/lib/module/styles.js +339 -0
- package/lib/module/styles.js.map +1 -0
- package/lib/module/superagentApiClient.js +609 -0
- package/lib/module/superagentApiClient.js.map +1 -0
- package/lib/module/types.js +4 -0
- package/lib/module/types.js.map +1 -0
- package/lib/module/useSuperagentAttachmentPicker.js +75 -0
- package/lib/module/useSuperagentAttachmentPicker.js.map +1 -0
- package/lib/module/useSuperagentConversation.js +212 -0
- package/lib/module/useSuperagentConversation.js.map +1 -0
- package/lib/module/useSuperagentRuntime.js +1203 -0
- package/lib/module/useSuperagentRuntime.js.map +1 -0
- package/lib/typescript/commonjs/AgentSettingsPanel.d.ts +19 -0
- package/lib/typescript/commonjs/AgentSettingsPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/AgentSphereIcon.d.ts +15 -0
- package/lib/typescript/commonjs/AgentSphereIcon.d.ts.map +1 -0
- package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts +8 -0
- package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/AttachmentPreviewStrip.d.ts +7 -0
- package/lib/typescript/commonjs/AttachmentPreviewStrip.d.ts.map +1 -0
- package/lib/typescript/commonjs/ChannelsPanel.d.ts +21 -0
- package/lib/typescript/commonjs/ChannelsPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/ConversationChat.d.ts +22 -0
- package/lib/typescript/commonjs/ConversationChat.d.ts.map +1 -0
- package/lib/typescript/commonjs/ConversationComposer.d.ts +24 -0
- package/lib/typescript/commonjs/ConversationComposer.d.ts.map +1 -0
- package/lib/typescript/commonjs/ConversationMessageList.d.ts +17 -0
- package/lib/typescript/commonjs/ConversationMessageList.d.ts.map +1 -0
- package/lib/typescript/commonjs/ConversationScreen.d.ts +80 -0
- package/lib/typescript/commonjs/ConversationScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/EditorDrawer.d.ts +67 -0
- package/lib/typescript/commonjs/EditorDrawer.d.ts.map +1 -0
- package/lib/typescript/commonjs/EditorTabPanel.d.ts +6 -0
- package/lib/typescript/commonjs/EditorTabPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/FilesPanel.d.ts +14 -0
- package/lib/typescript/commonjs/FilesPanel.d.ts.map +1 -0
- package/lib/typescript/commonjs/MarkdownText.d.ts +10 -0
- package/lib/typescript/commonjs/MarkdownText.d.ts.map +1 -0
- package/lib/typescript/commonjs/MessageActionBar.d.ts +8 -0
- package/lib/typescript/commonjs/MessageActionBar.d.ts.map +1 -0
- package/lib/typescript/commonjs/RenameAgentModal.d.ts +10 -0
- package/lib/typescript/commonjs/RenameAgentModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/ShareAgentModal.d.ts +15 -0
- package/lib/typescript/commonjs/ShareAgentModal.d.ts.map +1 -0
- package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts +229 -0
- package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts +4 -0
- package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts.map +1 -0
- package/lib/typescript/commonjs/ToolApprovalCard.d.ts +13 -0
- package/lib/typescript/commonjs/ToolApprovalCard.d.ts.map +1 -0
- package/lib/typescript/commonjs/ToolCallSummary.d.ts +16 -0
- package/lib/typescript/commonjs/ToolCallSummary.d.ts.map +1 -0
- package/lib/typescript/commonjs/agentSphereStyles.d.ts +31 -0
- package/lib/typescript/commonjs/agentSphereStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/apiClient.d.ts +4 -0
- package/lib/typescript/commonjs/apiClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/attachmentFileHelpers.d.ts +6 -0
- package/lib/typescript/commonjs/attachmentFileHelpers.d.ts.map +1 -0
- package/lib/typescript/commonjs/attachmentUpload.d.ts +12 -0
- package/lib/typescript/commonjs/attachmentUpload.d.ts.map +1 -0
- package/lib/typescript/commonjs/composerStyles.d.ts +241 -0
- package/lib/typescript/commonjs/composerStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/connectorBrandIcons.d.ts +7 -0
- package/lib/typescript/commonjs/connectorBrandIcons.d.ts.map +1 -0
- package/lib/typescript/commonjs/connectorCatalog.d.ts +3 -0
- package/lib/typescript/commonjs/connectorCatalog.d.ts.map +1 -0
- package/lib/typescript/commonjs/constants.d.ts +4 -0
- package/lib/typescript/commonjs/constants.d.ts.map +1 -0
- package/lib/typescript/commonjs/conversationParts.d.ts +29 -0
- package/lib/typescript/commonjs/conversationParts.d.ts.map +1 -0
- package/lib/typescript/commonjs/conversationRuntime.d.ts +67 -0
- package/lib/typescript/commonjs/conversationRuntime.d.ts.map +1 -0
- package/lib/typescript/commonjs/conversationStyles.d.ts +742 -0
- package/lib/typescript/commonjs/conversationStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/editorShellStyles.d.ts +1025 -0
- package/lib/typescript/commonjs/editorShellStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/editorTabs.d.ts +11 -0
- package/lib/typescript/commonjs/editorTabs.d.ts.map +1 -0
- package/lib/typescript/commonjs/fileTreeUtils.d.ts +17 -0
- package/lib/typescript/commonjs/fileTreeUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/index.d.ts +20 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -0
- package/lib/typescript/commonjs/markdownStyles.d.ts +150 -0
- package/lib/typescript/commonjs/markdownStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/mediaUtils.d.ts +9 -0
- package/lib/typescript/commonjs/mediaUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/messageActionStyles.d.ts +38 -0
- package/lib/typescript/commonjs/messageActionStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/messageUtils.d.ts +8 -0
- package/lib/typescript/commonjs/messageUtils.d.ts.map +1 -0
- package/lib/typescript/commonjs/nativeActionSheet.d.ts +6 -0
- package/lib/typescript/commonjs/nativeActionSheet.d.ts.map +1 -0
- package/lib/typescript/commonjs/nativeActionSheet.web.d.ts +3 -0
- package/lib/typescript/commonjs/nativeActionSheet.web.d.ts.map +1 -0
- package/lib/typescript/commonjs/package.json +1 -0
- package/lib/typescript/commonjs/paperTheme.d.ts +3 -0
- package/lib/typescript/commonjs/paperTheme.d.ts.map +1 -0
- package/lib/typescript/commonjs/realtimeClient.d.ts +16 -0
- package/lib/typescript/commonjs/realtimeClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/renameAgentModalStyles.d.ts +76 -0
- package/lib/typescript/commonjs/renameAgentModalStyles.d.ts.map +1 -0
- package/lib/typescript/commonjs/screenParts.d.ts +31 -0
- package/lib/typescript/commonjs/screenParts.d.ts.map +1 -0
- package/lib/typescript/commonjs/styles.d.ts +336 -0
- package/lib/typescript/commonjs/styles.d.ts.map +1 -0
- package/lib/typescript/commonjs/superagentApiClient.d.ts +66 -0
- package/lib/typescript/commonjs/superagentApiClient.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +437 -0
- package/lib/typescript/commonjs/types.d.ts.map +1 -0
- package/lib/typescript/commonjs/useSuperagentAttachmentPicker.d.ts +30 -0
- package/lib/typescript/commonjs/useSuperagentAttachmentPicker.d.ts.map +1 -0
- package/lib/typescript/commonjs/useSuperagentConversation.d.ts +36 -0
- package/lib/typescript/commonjs/useSuperagentConversation.d.ts.map +1 -0
- package/lib/typescript/commonjs/useSuperagentRuntime.d.ts +163 -0
- package/lib/typescript/commonjs/useSuperagentRuntime.d.ts.map +1 -0
- package/lib/typescript/module/AgentSettingsPanel.d.ts +19 -0
- package/lib/typescript/module/AgentSettingsPanel.d.ts.map +1 -0
- package/lib/typescript/module/AgentSphereIcon.d.ts +15 -0
- package/lib/typescript/module/AgentSphereIcon.d.ts.map +1 -0
- package/lib/typescript/module/AttachmentPickerStatusModal.d.ts +8 -0
- package/lib/typescript/module/AttachmentPickerStatusModal.d.ts.map +1 -0
- package/lib/typescript/module/AttachmentPreviewStrip.d.ts +7 -0
- package/lib/typescript/module/AttachmentPreviewStrip.d.ts.map +1 -0
- package/lib/typescript/module/ChannelsPanel.d.ts +21 -0
- package/lib/typescript/module/ChannelsPanel.d.ts.map +1 -0
- package/lib/typescript/module/ConversationChat.d.ts +22 -0
- package/lib/typescript/module/ConversationChat.d.ts.map +1 -0
- package/lib/typescript/module/ConversationComposer.d.ts +24 -0
- package/lib/typescript/module/ConversationComposer.d.ts.map +1 -0
- package/lib/typescript/module/ConversationMessageList.d.ts +17 -0
- package/lib/typescript/module/ConversationMessageList.d.ts.map +1 -0
- package/lib/typescript/module/ConversationScreen.d.ts +80 -0
- package/lib/typescript/module/ConversationScreen.d.ts.map +1 -0
- package/lib/typescript/module/EditorDrawer.d.ts +67 -0
- package/lib/typescript/module/EditorDrawer.d.ts.map +1 -0
- package/lib/typescript/module/EditorTabPanel.d.ts +6 -0
- package/lib/typescript/module/EditorTabPanel.d.ts.map +1 -0
- package/lib/typescript/module/FilesPanel.d.ts +14 -0
- package/lib/typescript/module/FilesPanel.d.ts.map +1 -0
- package/lib/typescript/module/MarkdownText.d.ts +10 -0
- package/lib/typescript/module/MarkdownText.d.ts.map +1 -0
- package/lib/typescript/module/MessageActionBar.d.ts +8 -0
- package/lib/typescript/module/MessageActionBar.d.ts.map +1 -0
- package/lib/typescript/module/RenameAgentModal.d.ts +10 -0
- package/lib/typescript/module/RenameAgentModal.d.ts.map +1 -0
- package/lib/typescript/module/ShareAgentModal.d.ts +15 -0
- package/lib/typescript/module/ShareAgentModal.d.ts.map +1 -0
- package/lib/typescript/module/ShareAgentModal.styles.d.ts +229 -0
- package/lib/typescript/module/ShareAgentModal.styles.d.ts.map +1 -0
- package/lib/typescript/module/SuperagentHomeScreen.d.ts +4 -0
- package/lib/typescript/module/SuperagentHomeScreen.d.ts.map +1 -0
- package/lib/typescript/module/ToolApprovalCard.d.ts +13 -0
- package/lib/typescript/module/ToolApprovalCard.d.ts.map +1 -0
- package/lib/typescript/module/ToolCallSummary.d.ts +16 -0
- package/lib/typescript/module/ToolCallSummary.d.ts.map +1 -0
- package/lib/typescript/module/agentSphereStyles.d.ts +31 -0
- package/lib/typescript/module/agentSphereStyles.d.ts.map +1 -0
- package/lib/typescript/module/apiClient.d.ts +4 -0
- package/lib/typescript/module/apiClient.d.ts.map +1 -0
- package/lib/typescript/module/attachmentFileHelpers.d.ts +6 -0
- package/lib/typescript/module/attachmentFileHelpers.d.ts.map +1 -0
- package/lib/typescript/module/attachmentUpload.d.ts +12 -0
- package/lib/typescript/module/attachmentUpload.d.ts.map +1 -0
- package/lib/typescript/module/composerStyles.d.ts +241 -0
- package/lib/typescript/module/composerStyles.d.ts.map +1 -0
- package/lib/typescript/module/connectorBrandIcons.d.ts +7 -0
- package/lib/typescript/module/connectorBrandIcons.d.ts.map +1 -0
- package/lib/typescript/module/connectorCatalog.d.ts +3 -0
- package/lib/typescript/module/connectorCatalog.d.ts.map +1 -0
- package/lib/typescript/module/constants.d.ts +4 -0
- package/lib/typescript/module/constants.d.ts.map +1 -0
- package/lib/typescript/module/conversationParts.d.ts +29 -0
- package/lib/typescript/module/conversationParts.d.ts.map +1 -0
- package/lib/typescript/module/conversationRuntime.d.ts +67 -0
- package/lib/typescript/module/conversationRuntime.d.ts.map +1 -0
- package/lib/typescript/module/conversationStyles.d.ts +742 -0
- package/lib/typescript/module/conversationStyles.d.ts.map +1 -0
- package/lib/typescript/module/editorShellStyles.d.ts +1025 -0
- package/lib/typescript/module/editorShellStyles.d.ts.map +1 -0
- package/lib/typescript/module/editorTabs.d.ts +11 -0
- package/lib/typescript/module/editorTabs.d.ts.map +1 -0
- package/lib/typescript/module/fileTreeUtils.d.ts +17 -0
- package/lib/typescript/module/fileTreeUtils.d.ts.map +1 -0
- package/lib/typescript/module/index.d.ts +20 -0
- package/lib/typescript/module/index.d.ts.map +1 -0
- package/lib/typescript/module/markdownStyles.d.ts +150 -0
- package/lib/typescript/module/markdownStyles.d.ts.map +1 -0
- package/lib/typescript/module/mediaUtils.d.ts +9 -0
- package/lib/typescript/module/mediaUtils.d.ts.map +1 -0
- package/lib/typescript/module/messageActionStyles.d.ts +38 -0
- package/lib/typescript/module/messageActionStyles.d.ts.map +1 -0
- package/lib/typescript/module/messageUtils.d.ts +8 -0
- package/lib/typescript/module/messageUtils.d.ts.map +1 -0
- package/lib/typescript/module/nativeActionSheet.d.ts +6 -0
- package/lib/typescript/module/nativeActionSheet.d.ts.map +1 -0
- package/lib/typescript/module/nativeActionSheet.web.d.ts +3 -0
- package/lib/typescript/module/nativeActionSheet.web.d.ts.map +1 -0
- package/lib/typescript/module/package.json +1 -0
- package/lib/typescript/module/paperTheme.d.ts +3 -0
- package/lib/typescript/module/paperTheme.d.ts.map +1 -0
- package/lib/typescript/module/realtimeClient.d.ts +16 -0
- package/lib/typescript/module/realtimeClient.d.ts.map +1 -0
- package/lib/typescript/module/renameAgentModalStyles.d.ts +76 -0
- package/lib/typescript/module/renameAgentModalStyles.d.ts.map +1 -0
- package/lib/typescript/module/screenParts.d.ts +31 -0
- package/lib/typescript/module/screenParts.d.ts.map +1 -0
- package/lib/typescript/module/styles.d.ts +336 -0
- package/lib/typescript/module/styles.d.ts.map +1 -0
- package/lib/typescript/module/superagentApiClient.d.ts +66 -0
- package/lib/typescript/module/superagentApiClient.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +437 -0
- package/lib/typescript/module/types.d.ts.map +1 -0
- package/lib/typescript/module/useSuperagentAttachmentPicker.d.ts +30 -0
- package/lib/typescript/module/useSuperagentAttachmentPicker.d.ts.map +1 -0
- package/lib/typescript/module/useSuperagentConversation.d.ts +36 -0
- package/lib/typescript/module/useSuperagentConversation.d.ts.map +1 -0
- package/lib/typescript/module/useSuperagentRuntime.d.ts +163 -0
- package/lib/typescript/module/useSuperagentRuntime.d.ts.map +1 -0
- package/package.json +87 -0
- package/src/AgentSettingsPanel.tsx +1122 -0
- package/src/AgentSphereIcon.tsx +170 -0
- package/src/AttachmentPickerStatusModal.tsx +80 -0
- package/src/AttachmentPreviewStrip.tsx +38 -0
- package/src/ChannelsPanel.tsx +705 -0
- package/src/ConversationChat.tsx +245 -0
- package/src/ConversationComposer.tsx +368 -0
- package/src/ConversationMessageList.tsx +140 -0
- package/src/ConversationScreen.tsx +320 -0
- package/src/EditorDrawer.tsx +1297 -0
- package/src/EditorTabPanel.tsx +19 -0
- package/src/FilesPanel.tsx +577 -0
- package/src/MarkdownText.tsx +317 -0
- package/src/MessageActionBar.tsx +126 -0
- package/src/RenameAgentModal.tsx +107 -0
- package/src/ShareAgentModal.styles.ts +95 -0
- package/src/ShareAgentModal.tsx +320 -0
- package/src/SuperagentHomeScreen.tsx +318 -0
- package/src/ToolApprovalCard.tsx +592 -0
- package/src/ToolCallSummary.tsx +599 -0
- package/src/agentSphereStyles.ts +25 -0
- package/src/apiClient.ts +189 -0
- package/src/attachmentFileHelpers.ts +109 -0
- package/src/attachmentUpload.ts +112 -0
- package/src/composerStyles.ts +167 -0
- package/src/connectorBrandIcons.tsx +69 -0
- package/src/connectorCatalog.ts +414 -0
- package/src/constants.ts +9 -0
- package/src/conversationParts.tsx +307 -0
- package/src/conversationRuntime.ts +171 -0
- package/src/conversationStyles.ts +412 -0
- package/src/editorShellStyles.ts +1023 -0
- package/src/editorTabs.ts +26 -0
- package/src/fileTreeUtils.ts +165 -0
- package/src/index.ts +110 -0
- package/src/markdownStyles.ts +64 -0
- package/src/mediaUtils.ts +75 -0
- package/src/messageActionStyles.ts +26 -0
- package/src/messageUtils.ts +58 -0
- package/src/nativeActionSheet.ts +25 -0
- package/src/nativeActionSheet.web.ts +5 -0
- package/src/paperTheme.ts +52 -0
- package/src/realtimeClient.ts +149 -0
- package/src/renameAgentModalStyles.ts +77 -0
- package/src/screenParts.tsx +185 -0
- package/src/styles.ts +190 -0
- package/src/superagentApiClient.ts +895 -0
- package/src/types.ts +514 -0
- package/src/useSuperagentAttachmentPicker.tsx +117 -0
- package/src/useSuperagentConversation.ts +242 -0
- package/src/useSuperagentRuntime.ts +1371 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
|
+
import { Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { MessageBubble } from './conversationParts';
|
|
5
|
+
import { conversationStyles } from './conversationStyles';
|
|
6
|
+
import { formatDateLabel, getMessageFiles, getMessageToolCalls, shouldShowDateSeparator } from './messageUtils';
|
|
7
|
+
import type {
|
|
8
|
+
SuperagentAgent,
|
|
9
|
+
SuperagentConnector,
|
|
10
|
+
SuperagentConnectorActionInput,
|
|
11
|
+
SuperagentConversation,
|
|
12
|
+
SuperagentCopyMessageInput,
|
|
13
|
+
SuperagentMarkdownRenderer,
|
|
14
|
+
SuperagentMessage,
|
|
15
|
+
SuperagentToolRenderers,
|
|
16
|
+
} from './types';
|
|
17
|
+
|
|
18
|
+
export function ConversationMessageList({
|
|
19
|
+
agent,
|
|
20
|
+
availableConnectors,
|
|
21
|
+
conversationId,
|
|
22
|
+
currentUserAvatarUrl,
|
|
23
|
+
messages,
|
|
24
|
+
onConnectConnector,
|
|
25
|
+
onCopyMessage,
|
|
26
|
+
onDeleteMessage,
|
|
27
|
+
onReplyMessage,
|
|
28
|
+
renderMarkdown,
|
|
29
|
+
submitToolCallInput,
|
|
30
|
+
toolRenderers,
|
|
31
|
+
}: {
|
|
32
|
+
agent: SuperagentAgent;
|
|
33
|
+
availableConnectors?: SuperagentConnector[];
|
|
34
|
+
conversationId: string | null;
|
|
35
|
+
currentUserAvatarUrl?: string | null;
|
|
36
|
+
messages: SuperagentMessage[];
|
|
37
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
38
|
+
onCopyMessage?: SuperagentCopyMessageInput;
|
|
39
|
+
onDeleteMessage?: (messageId: string) => Promise<boolean> | boolean;
|
|
40
|
+
onReplyMessage?: (message: SuperagentMessage) => void;
|
|
41
|
+
renderMarkdown?: SuperagentMarkdownRenderer;
|
|
42
|
+
submitToolCallInput?: (
|
|
43
|
+
toolCallId: string,
|
|
44
|
+
approve: boolean,
|
|
45
|
+
extraUserInput?: unknown,
|
|
46
|
+
originRequestId?: string,
|
|
47
|
+
) => Promise<SuperagentConversation | null>;
|
|
48
|
+
toolRenderers?: SuperagentToolRenderers;
|
|
49
|
+
}) {
|
|
50
|
+
const displayMessages = useMemo(() => mergeConsecutiveToolOnlyMessages(messages), [messages]);
|
|
51
|
+
const lastAssistantMessageIndex = useMemo(() => {
|
|
52
|
+
for (let index = displayMessages.length - 1; index >= 0; index -= 1) {
|
|
53
|
+
if (displayMessages[index].role === 'assistant') return index;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
return -1;
|
|
57
|
+
}, [displayMessages]);
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
{displayMessages.map((message, index) => {
|
|
62
|
+
const previousMessage = displayMessages[index - 1];
|
|
63
|
+
const nextMessage = displayMessages[index + 1];
|
|
64
|
+
const showAvatar = !previousMessage || previousMessage.role !== message.role;
|
|
65
|
+
const showTimestamp = !nextMessage || nextMessage.role !== message.role;
|
|
66
|
+
return (
|
|
67
|
+
<View key={message.id ?? `${message.role}-${index}`}>
|
|
68
|
+
{shouldShowDateSeparator(message, previousMessage) ? (
|
|
69
|
+
<DateSeparator label={formatDateLabel(message.createdAt)} />
|
|
70
|
+
) : null}
|
|
71
|
+
<MessageBubble
|
|
72
|
+
agent={agent}
|
|
73
|
+
availableConnectors={availableConnectors}
|
|
74
|
+
conversationId={conversationId}
|
|
75
|
+
currentUserAvatarUrl={currentUserAvatarUrl}
|
|
76
|
+
isLastAssistantMessage={index === lastAssistantMessageIndex}
|
|
77
|
+
message={message}
|
|
78
|
+
onConnectConnector={onConnectConnector}
|
|
79
|
+
onCopyMessage={onCopyMessage}
|
|
80
|
+
onDeleteMessage={onDeleteMessage}
|
|
81
|
+
onReplyMessage={onReplyMessage}
|
|
82
|
+
renderMarkdown={renderMarkdown}
|
|
83
|
+
showAvatar={showAvatar}
|
|
84
|
+
showTimestamp={showTimestamp}
|
|
85
|
+
submitToolCallInput={submitToolCallInput}
|
|
86
|
+
toolRenderers={toolRenderers}
|
|
87
|
+
/>
|
|
88
|
+
</View>
|
|
89
|
+
);
|
|
90
|
+
})}
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function mergeConsecutiveToolOnlyMessages(messages: SuperagentMessage[]) {
|
|
96
|
+
const merged: SuperagentMessage[] = [];
|
|
97
|
+
|
|
98
|
+
messages.forEach((message) => {
|
|
99
|
+
const toolCalls = getMessageToolCalls(message);
|
|
100
|
+
const isToolOnly = message.role === 'assistant' &&
|
|
101
|
+
!message.content?.trim() &&
|
|
102
|
+
toolCalls.length > 0 &&
|
|
103
|
+
getMessageFiles(message).length === 0;
|
|
104
|
+
const previous = merged[merged.length - 1];
|
|
105
|
+
|
|
106
|
+
if (isToolOnly && previous && isMergeableToolOnlyMessage(previous)) {
|
|
107
|
+
const previousToolCalls = getMessageToolCalls(previous);
|
|
108
|
+
merged[merged.length - 1] = {
|
|
109
|
+
...previous,
|
|
110
|
+
id: previous.id ? `${previous.id}:${message.id ?? toolCalls.length}` : message.id,
|
|
111
|
+
toolCalls: [...previousToolCalls, ...toolCalls],
|
|
112
|
+
tool_calls: [...previousToolCalls, ...toolCalls],
|
|
113
|
+
createdAt: message.createdAt ?? previous.createdAt,
|
|
114
|
+
created_at: message.created_at ?? previous.created_at,
|
|
115
|
+
};
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
merged.push(message);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
return merged;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function isMergeableToolOnlyMessage(message: SuperagentMessage) {
|
|
126
|
+
return message.role === 'assistant' &&
|
|
127
|
+
!message.content?.trim() &&
|
|
128
|
+
getMessageToolCalls(message).length > 0 &&
|
|
129
|
+
getMessageFiles(message).length === 0;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function DateSeparator({ label }: { label: string }) {
|
|
133
|
+
return (
|
|
134
|
+
<View style={conversationStyles.dateSeparator}>
|
|
135
|
+
<View style={conversationStyles.dateSeparatorLine} />
|
|
136
|
+
<Text style={conversationStyles.dateSeparatorText}>{label}</Text>
|
|
137
|
+
<View style={conversationStyles.dateSeparatorLine} />
|
|
138
|
+
</View>
|
|
139
|
+
);
|
|
140
|
+
}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { KeyboardAvoidingView, Platform, SafeAreaView } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { ConversationChat } from './ConversationChat';
|
|
5
|
+
import { ConversationHeader } from './conversationParts';
|
|
6
|
+
import { conversationStyles } from './conversationStyles';
|
|
7
|
+
import { EditorDrawer } from './EditorDrawer';
|
|
8
|
+
import { RenameAgentModal } from './RenameAgentModal';
|
|
9
|
+
import { ShareAgentModal } from './ShareAgentModal';
|
|
10
|
+
import type {
|
|
11
|
+
SuperagentAgent,
|
|
12
|
+
SuperagentHomeScreenProps,
|
|
13
|
+
SuperagentMessage,
|
|
14
|
+
} from './types';
|
|
15
|
+
import { useSuperagentConversation } from './useSuperagentConversation';
|
|
16
|
+
|
|
17
|
+
export function ConversationScreen({
|
|
18
|
+
agent,
|
|
19
|
+
apiClient,
|
|
20
|
+
automations,
|
|
21
|
+
automationCredits,
|
|
22
|
+
availableConnectors,
|
|
23
|
+
channelStatus,
|
|
24
|
+
collaborators,
|
|
25
|
+
connectingChannelId,
|
|
26
|
+
connectedConnectors,
|
|
27
|
+
connectingConnectorId,
|
|
28
|
+
currentUserAvatarUrl,
|
|
29
|
+
fileLoadError,
|
|
30
|
+
fileLoadFailed,
|
|
31
|
+
filePaths,
|
|
32
|
+
isLoadingAgentSettings,
|
|
33
|
+
isLoadingAutomations,
|
|
34
|
+
isLoadingCollaborators,
|
|
35
|
+
isLoadingConnectors,
|
|
36
|
+
isLoadingFiles,
|
|
37
|
+
messages,
|
|
38
|
+
isSending,
|
|
39
|
+
onAgentMessageDone,
|
|
40
|
+
onCancelConnectorConnection,
|
|
41
|
+
onArchiveAutomation,
|
|
42
|
+
onCloneAgent,
|
|
43
|
+
onCopyMessage,
|
|
44
|
+
onBack,
|
|
45
|
+
onConnectConnector,
|
|
46
|
+
onDeleteAgent,
|
|
47
|
+
onDeleteAutomation,
|
|
48
|
+
onDeleteSecret,
|
|
49
|
+
onDisconnectConnector,
|
|
50
|
+
onDisconnectIMessage,
|
|
51
|
+
onDisconnectTelegram,
|
|
52
|
+
onEditAutomation,
|
|
53
|
+
onGenerateLineCode,
|
|
54
|
+
onGenerateIMessageCode,
|
|
55
|
+
onImportFromDrive,
|
|
56
|
+
onOpenIMessage,
|
|
57
|
+
onOpenLine,
|
|
58
|
+
onOpenTelegram,
|
|
59
|
+
onOpenWhatsApp,
|
|
60
|
+
onOpenSandboxFile,
|
|
61
|
+
onOpenWorkspaceMembers,
|
|
62
|
+
onPickFiles,
|
|
63
|
+
onPickPhotos,
|
|
64
|
+
onRemoveConnector,
|
|
65
|
+
onRenameAgent,
|
|
66
|
+
onRefreshAgentSettings,
|
|
67
|
+
onRefreshAutomations,
|
|
68
|
+
onRefreshChannels,
|
|
69
|
+
onRefreshCollaborators,
|
|
70
|
+
onRefreshFiles,
|
|
71
|
+
onRestoreAutomation,
|
|
72
|
+
onRunAutomationNow,
|
|
73
|
+
onSaveSandboxFile,
|
|
74
|
+
onSaveSecret,
|
|
75
|
+
onSendMessage,
|
|
76
|
+
onShareAgent,
|
|
77
|
+
onShareAgentLink,
|
|
78
|
+
onShareIMessageCode,
|
|
79
|
+
onShareLineCode,
|
|
80
|
+
onStartLiveVoice,
|
|
81
|
+
onStartVoiceInput,
|
|
82
|
+
onSetupTelegram,
|
|
83
|
+
onTakePhoto,
|
|
84
|
+
onToggleAutomation,
|
|
85
|
+
onUpdateAgentModel,
|
|
86
|
+
onUpdateToolPermissions,
|
|
87
|
+
onUploadSandboxFiles,
|
|
88
|
+
realtimeClient,
|
|
89
|
+
renderMarkdown,
|
|
90
|
+
secrets,
|
|
91
|
+
toolRenderers,
|
|
92
|
+
}: {
|
|
93
|
+
agent: SuperagentAgent;
|
|
94
|
+
apiClient: SuperagentHomeScreenProps['apiClient'];
|
|
95
|
+
automations: SuperagentHomeScreenProps['automations'];
|
|
96
|
+
automationCredits: SuperagentHomeScreenProps['automationCredits'];
|
|
97
|
+
availableConnectors: SuperagentHomeScreenProps['availableConnectors'];
|
|
98
|
+
channelStatus: SuperagentHomeScreenProps['channelStatus'];
|
|
99
|
+
collaborators: SuperagentHomeScreenProps['collaborators'];
|
|
100
|
+
connectingChannelId: SuperagentHomeScreenProps['connectingChannelId'];
|
|
101
|
+
connectedConnectors: SuperagentHomeScreenProps['connectedConnectors'];
|
|
102
|
+
connectingConnectorId: SuperagentHomeScreenProps['connectingConnectorId'];
|
|
103
|
+
currentUserAvatarUrl: SuperagentHomeScreenProps['currentUserAvatarUrl'];
|
|
104
|
+
fileLoadError: SuperagentHomeScreenProps['fileLoadError'];
|
|
105
|
+
fileLoadFailed: SuperagentHomeScreenProps['fileLoadFailed'];
|
|
106
|
+
filePaths: SuperagentHomeScreenProps['filePaths'];
|
|
107
|
+
isLoadingAgentSettings: SuperagentHomeScreenProps['isLoadingAgentSettings'];
|
|
108
|
+
isLoadingAutomations: SuperagentHomeScreenProps['isLoadingAutomations'];
|
|
109
|
+
isLoadingChannels: SuperagentHomeScreenProps['isLoadingChannels'];
|
|
110
|
+
isLoadingCollaborators: SuperagentHomeScreenProps['isLoadingCollaborators'];
|
|
111
|
+
isLoadingConnectors: SuperagentHomeScreenProps['isLoadingConnectors'];
|
|
112
|
+
isLoadingFiles: SuperagentHomeScreenProps['isLoadingFiles'];
|
|
113
|
+
messages: SuperagentMessage[];
|
|
114
|
+
isSending: boolean;
|
|
115
|
+
onBack: () => void;
|
|
116
|
+
onCancelConnectorConnection: SuperagentHomeScreenProps['onCancelConnectorConnection'];
|
|
117
|
+
onArchiveAutomation: SuperagentHomeScreenProps['onArchiveAutomation'];
|
|
118
|
+
onCloneAgent: SuperagentHomeScreenProps['onCloneAgent'];
|
|
119
|
+
onCopyMessage: SuperagentHomeScreenProps['onCopyMessage'];
|
|
120
|
+
onConnectConnector: SuperagentHomeScreenProps['onConnectConnector'];
|
|
121
|
+
onDeleteAgent: SuperagentHomeScreenProps['onDeleteAgent'];
|
|
122
|
+
onDeleteAutomation: SuperagentHomeScreenProps['onDeleteAutomation'];
|
|
123
|
+
onDeleteSecret: SuperagentHomeScreenProps['onDeleteSecret'];
|
|
124
|
+
onDisconnectConnector: SuperagentHomeScreenProps['onDisconnectConnector'];
|
|
125
|
+
onDisconnectIMessage: SuperagentHomeScreenProps['onDisconnectIMessage'];
|
|
126
|
+
onDisconnectTelegram: SuperagentHomeScreenProps['onDisconnectTelegram'];
|
|
127
|
+
onEditAutomation: SuperagentHomeScreenProps['onEditAutomation'];
|
|
128
|
+
onGenerateLineCode: SuperagentHomeScreenProps['onGenerateLineCode'];
|
|
129
|
+
onGenerateIMessageCode: SuperagentHomeScreenProps['onGenerateIMessageCode'];
|
|
130
|
+
onImportFromDrive: SuperagentHomeScreenProps['onImportFromDrive'];
|
|
131
|
+
onOpenIMessage: SuperagentHomeScreenProps['onOpenIMessage'];
|
|
132
|
+
onOpenLine: SuperagentHomeScreenProps['onOpenLine'];
|
|
133
|
+
onOpenTelegram: SuperagentHomeScreenProps['onOpenTelegram'];
|
|
134
|
+
onOpenWhatsApp: SuperagentHomeScreenProps['onOpenWhatsApp'];
|
|
135
|
+
onOpenSandboxFile: SuperagentHomeScreenProps['onOpenSandboxFile'];
|
|
136
|
+
onOpenWorkspaceMembers: SuperagentHomeScreenProps['onOpenWorkspaceMembers'];
|
|
137
|
+
onPickFiles: SuperagentHomeScreenProps['onPickFiles'];
|
|
138
|
+
onPickPhotos: SuperagentHomeScreenProps['onPickPhotos'];
|
|
139
|
+
onRemoveConnector: SuperagentHomeScreenProps['onRemoveConnector'];
|
|
140
|
+
onRenameAgent: SuperagentHomeScreenProps['onRenameAgent'];
|
|
141
|
+
onRefreshAgentSettings: SuperagentHomeScreenProps['onRefreshAgentSettings'];
|
|
142
|
+
onRefreshAutomations: SuperagentHomeScreenProps['onRefreshAutomations'];
|
|
143
|
+
onRefreshChannels: SuperagentHomeScreenProps['onRefreshChannels'];
|
|
144
|
+
onRefreshCollaborators: SuperagentHomeScreenProps['onRefreshCollaborators'];
|
|
145
|
+
onRefreshFiles: SuperagentHomeScreenProps['onRefreshFiles'];
|
|
146
|
+
onRestoreAutomation: SuperagentHomeScreenProps['onRestoreAutomation'];
|
|
147
|
+
onRunAutomationNow: SuperagentHomeScreenProps['onRunAutomationNow'];
|
|
148
|
+
onSaveSandboxFile: SuperagentHomeScreenProps['onSaveSandboxFile'];
|
|
149
|
+
onSaveSecret: SuperagentHomeScreenProps['onSaveSecret'];
|
|
150
|
+
onSendMessage: SuperagentHomeScreenProps['onSendMessage'];
|
|
151
|
+
onShareAgent: SuperagentHomeScreenProps['onShareAgent'];
|
|
152
|
+
onShareAgentLink: SuperagentHomeScreenProps['onShareAgentLink'];
|
|
153
|
+
onShareIMessageCode: SuperagentHomeScreenProps['onShareIMessageCode'];
|
|
154
|
+
onShareLineCode: SuperagentHomeScreenProps['onShareLineCode'];
|
|
155
|
+
onStartLiveVoice: SuperagentHomeScreenProps['onStartLiveVoice'];
|
|
156
|
+
onStartVoiceInput: SuperagentHomeScreenProps['onStartVoiceInput'];
|
|
157
|
+
onSetupTelegram: SuperagentHomeScreenProps['onSetupTelegram'];
|
|
158
|
+
onTakePhoto: SuperagentHomeScreenProps['onTakePhoto'];
|
|
159
|
+
onToggleAutomation: SuperagentHomeScreenProps['onToggleAutomation'];
|
|
160
|
+
onUpdateAgentModel: SuperagentHomeScreenProps['onUpdateAgentModel'];
|
|
161
|
+
onUpdateToolPermissions: SuperagentHomeScreenProps['onUpdateToolPermissions'];
|
|
162
|
+
onUploadSandboxFiles: SuperagentHomeScreenProps['onUploadSandboxFiles'];
|
|
163
|
+
onAgentMessageDone: SuperagentHomeScreenProps['onAgentMessageDone'];
|
|
164
|
+
realtimeClient: SuperagentHomeScreenProps['realtimeClient'];
|
|
165
|
+
renderMarkdown: SuperagentHomeScreenProps['renderMarkdown'];
|
|
166
|
+
secrets: SuperagentHomeScreenProps['secrets'];
|
|
167
|
+
toolRenderers: SuperagentHomeScreenProps['toolRenderers'];
|
|
168
|
+
}) {
|
|
169
|
+
const [isDrawerOpen, setIsDrawerOpen] = useState(false);
|
|
170
|
+
const [isShareModalOpen, setIsShareModalOpen] = useState(false);
|
|
171
|
+
const [isRenameModalOpen, setIsRenameModalOpen] = useState(false);
|
|
172
|
+
const [isRenaming, setIsRenaming] = useState(false);
|
|
173
|
+
const [renameError, setRenameError] = useState<string | null>(null);
|
|
174
|
+
const refreshAutomations = useCallback(() => {
|
|
175
|
+
return onRefreshAutomations?.(agent.id);
|
|
176
|
+
}, [agent.id, onRefreshAutomations]);
|
|
177
|
+
const conversation = useSuperagentConversation({
|
|
178
|
+
agentId: agent.id,
|
|
179
|
+
apiClient,
|
|
180
|
+
fallbackMessages: messages,
|
|
181
|
+
fallbackSending: isSending,
|
|
182
|
+
onAgentMessageDone,
|
|
183
|
+
onConversationSettled: onRefreshAutomations ? refreshAutomations : undefined,
|
|
184
|
+
onSendMessage,
|
|
185
|
+
realtimeClient,
|
|
186
|
+
});
|
|
187
|
+
const saveAgentName = async (name: string) => {
|
|
188
|
+
if (!onRenameAgent) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
setIsRenaming(true);
|
|
193
|
+
setRenameError(null);
|
|
194
|
+
try {
|
|
195
|
+
await onRenameAgent({ agentId: agent.id, name });
|
|
196
|
+
setIsRenameModalOpen(false);
|
|
197
|
+
} catch (error) {
|
|
198
|
+
setRenameError(error instanceof Error ? error.message : 'Failed to rename Superagent');
|
|
199
|
+
} finally {
|
|
200
|
+
setIsRenaming(false);
|
|
201
|
+
}
|
|
202
|
+
};
|
|
203
|
+
|
|
204
|
+
return (
|
|
205
|
+
<SafeAreaView style={conversationStyles.safeArea}>
|
|
206
|
+
<KeyboardAvoidingView
|
|
207
|
+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
208
|
+
style={conversationStyles.keyboard}
|
|
209
|
+
>
|
|
210
|
+
<ConversationHeader
|
|
211
|
+
activeTab="chat"
|
|
212
|
+
agent={agent}
|
|
213
|
+
onBack={onBack}
|
|
214
|
+
onOpenMenu={() => setIsDrawerOpen(true)}
|
|
215
|
+
onOpenShare={onShareAgent ? () => setIsShareModalOpen(true) : undefined}
|
|
216
|
+
onRenameRequest={onRenameAgent ? () => setIsRenameModalOpen(true) : undefined}
|
|
217
|
+
/>
|
|
218
|
+
<ConversationChat
|
|
219
|
+
agent={agent}
|
|
220
|
+
availableConnectors={availableConnectors}
|
|
221
|
+
conversation={conversation}
|
|
222
|
+
currentUserAvatarUrl={currentUserAvatarUrl}
|
|
223
|
+
onConnectConnector={onConnectConnector}
|
|
224
|
+
onCopyMessage={onCopyMessage}
|
|
225
|
+
onImportFromDrive={onImportFromDrive}
|
|
226
|
+
onPickFiles={onPickFiles}
|
|
227
|
+
onPickPhotos={onPickPhotos}
|
|
228
|
+
onStartLiveVoice={onStartLiveVoice}
|
|
229
|
+
onStartVoiceInput={onStartVoiceInput}
|
|
230
|
+
onTakePhoto={onTakePhoto}
|
|
231
|
+
renderMarkdown={renderMarkdown}
|
|
232
|
+
toolRenderers={toolRenderers}
|
|
233
|
+
/>
|
|
234
|
+
<EditorDrawer
|
|
235
|
+
activeTab="integrations"
|
|
236
|
+
agent={agent}
|
|
237
|
+
automationCredits={automationCredits}
|
|
238
|
+
automations={automations}
|
|
239
|
+
availableConnectors={availableConnectors}
|
|
240
|
+
channelStatus={channelStatus}
|
|
241
|
+
collaborators={collaborators}
|
|
242
|
+
connectingChannelId={connectingChannelId}
|
|
243
|
+
connectedConnectors={connectedConnectors}
|
|
244
|
+
connectingConnectorId={connectingConnectorId}
|
|
245
|
+
fileLoadError={fileLoadError}
|
|
246
|
+
fileLoadFailed={fileLoadFailed}
|
|
247
|
+
filePaths={filePaths}
|
|
248
|
+
isLoadingAgentSettings={isLoadingAgentSettings}
|
|
249
|
+
isLoadingCollaborators={isLoadingCollaborators}
|
|
250
|
+
isLoadingFiles={isLoadingFiles}
|
|
251
|
+
isLoadingAutomations={isLoadingAutomations}
|
|
252
|
+
isLoadingConnectors={isLoadingConnectors}
|
|
253
|
+
isVisible={isDrawerOpen}
|
|
254
|
+
secrets={secrets}
|
|
255
|
+
onClose={() => setIsDrawerOpen(false)}
|
|
256
|
+
onCancelConnectorConnection={onCancelConnectorConnection}
|
|
257
|
+
onArchiveAutomation={onArchiveAutomation}
|
|
258
|
+
onCloneAgent={onCloneAgent}
|
|
259
|
+
onConnectConnector={onConnectConnector}
|
|
260
|
+
onDeleteAgent={onDeleteAgent}
|
|
261
|
+
onDeleteAutomation={onDeleteAutomation}
|
|
262
|
+
onDeleteSecret={onDeleteSecret}
|
|
263
|
+
onDisconnectConnector={onDisconnectConnector}
|
|
264
|
+
onDisconnectIMessage={onDisconnectIMessage}
|
|
265
|
+
onDisconnectTelegram={onDisconnectTelegram}
|
|
266
|
+
onEditAutomation={onEditAutomation}
|
|
267
|
+
onGenerateLineCode={onGenerateLineCode}
|
|
268
|
+
onGenerateIMessageCode={onGenerateIMessageCode}
|
|
269
|
+
onOpenIMessage={onOpenIMessage}
|
|
270
|
+
onOpenLine={onOpenLine}
|
|
271
|
+
onOpenTelegram={onOpenTelegram}
|
|
272
|
+
onOpenWhatsApp={onOpenWhatsApp}
|
|
273
|
+
onOpenSandboxFile={onOpenSandboxFile}
|
|
274
|
+
onRemoveConnector={onRemoveConnector}
|
|
275
|
+
onRefreshAgentSettings={onRefreshAgentSettings}
|
|
276
|
+
onRefreshAutomations={onRefreshAutomations}
|
|
277
|
+
onRefreshChannels={onRefreshChannels}
|
|
278
|
+
onRefreshCollaborators={onRefreshCollaborators}
|
|
279
|
+
onRefreshFiles={onRefreshFiles}
|
|
280
|
+
onRestoreAutomation={onRestoreAutomation}
|
|
281
|
+
onRunAutomationNow={onRunAutomationNow}
|
|
282
|
+
onSaveSandboxFile={onSaveSandboxFile}
|
|
283
|
+
onSaveSecret={onSaveSecret}
|
|
284
|
+
onSelectTab={() => {}}
|
|
285
|
+
onShareAgentLink={onShareAgentLink}
|
|
286
|
+
onShareIMessageCode={onShareIMessageCode}
|
|
287
|
+
onShareLineCode={onShareLineCode}
|
|
288
|
+
onSetupTelegram={onSetupTelegram}
|
|
289
|
+
onToggleAutomation={onToggleAutomation}
|
|
290
|
+
onUpdateAgentModel={onUpdateAgentModel}
|
|
291
|
+
onUpdateToolPermissions={onUpdateToolPermissions}
|
|
292
|
+
onUploadSandboxFiles={onUploadSandboxFiles}
|
|
293
|
+
/>
|
|
294
|
+
<ShareAgentModal
|
|
295
|
+
agent={agent}
|
|
296
|
+
collaborators={collaborators}
|
|
297
|
+
isLoading={isLoadingCollaborators}
|
|
298
|
+
isVisible={isShareModalOpen}
|
|
299
|
+
onClose={() => setIsShareModalOpen(false)}
|
|
300
|
+
onRefreshCollaborators={onRefreshCollaborators}
|
|
301
|
+
onOpenWorkspaceMembers={onOpenWorkspaceMembers}
|
|
302
|
+
onShareAgent={onShareAgent}
|
|
303
|
+
/>
|
|
304
|
+
<RenameAgentModal
|
|
305
|
+
error={renameError}
|
|
306
|
+
initialName={agent.name || 'Superagent'}
|
|
307
|
+
isSaving={isRenaming}
|
|
308
|
+
isVisible={isRenameModalOpen}
|
|
309
|
+
onClose={() => {
|
|
310
|
+
if (!isRenaming) {
|
|
311
|
+
setIsRenameModalOpen(false);
|
|
312
|
+
setRenameError(null);
|
|
313
|
+
}
|
|
314
|
+
}}
|
|
315
|
+
onSave={saveAgentName}
|
|
316
|
+
/>
|
|
317
|
+
</KeyboardAvoidingView>
|
|
318
|
+
</SafeAreaView>
|
|
319
|
+
);
|
|
320
|
+
}
|