@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,320 @@
|
|
|
1
|
+
import React, { useEffect, 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 { Building2, MailPlus, User, UserPlus, X } from 'lucide-react-native';
|
|
13
|
+
|
|
14
|
+
import { AgentSphereIcon } from './AgentSphereIcon';
|
|
15
|
+
import { shareAgentModalStyles as localStyles } from './ShareAgentModal.styles';
|
|
16
|
+
import { styles as sharedStyles } from './styles';
|
|
17
|
+
import type {
|
|
18
|
+
SuperagentAgent,
|
|
19
|
+
SuperagentCollaborator,
|
|
20
|
+
SuperagentHomeScreenProps,
|
|
21
|
+
SuperagentInviteCollaboratorsResult,
|
|
22
|
+
} from './types';
|
|
23
|
+
|
|
24
|
+
const NOT_WORKSPACE_MEMBER_CODE = 'not_workspace_member';
|
|
25
|
+
|
|
26
|
+
type ShareAgentModalProps = {
|
|
27
|
+
agent: SuperagentAgent;
|
|
28
|
+
collaborators?: SuperagentCollaborator[];
|
|
29
|
+
isLoading?: boolean;
|
|
30
|
+
isVisible: boolean;
|
|
31
|
+
onClose: () => void;
|
|
32
|
+
onOpenWorkspaceMembers?: SuperagentHomeScreenProps['onOpenWorkspaceMembers'];
|
|
33
|
+
onRefreshCollaborators?: SuperagentHomeScreenProps['onRefreshCollaborators'];
|
|
34
|
+
onShareAgent?: SuperagentHomeScreenProps['onShareAgent'];
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
type GuestInvitePrompt = {
|
|
38
|
+
emails: string[];
|
|
39
|
+
pendingInvitationEmails: string[];
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export function ShareAgentModal({
|
|
43
|
+
agent,
|
|
44
|
+
collaborators = [],
|
|
45
|
+
isLoading,
|
|
46
|
+
isVisible,
|
|
47
|
+
onClose,
|
|
48
|
+
onOpenWorkspaceMembers,
|
|
49
|
+
onRefreshCollaborators,
|
|
50
|
+
onShareAgent,
|
|
51
|
+
}: ShareAgentModalProps) {
|
|
52
|
+
const [emailText, setEmailText] = useState('');
|
|
53
|
+
const [error, setError] = useState<string | null>(null);
|
|
54
|
+
const [guestInvitePrompt, setGuestInvitePrompt] = useState<GuestInvitePrompt | null>(null);
|
|
55
|
+
const [isInviting, setIsInviting] = useState(false);
|
|
56
|
+
const [success, setSuccess] = useState<string | null>(null);
|
|
57
|
+
useEffect(() => {
|
|
58
|
+
if (isVisible) {
|
|
59
|
+
onRefreshCollaborators?.(agent.id);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
setEmailText('');
|
|
64
|
+
setError(null);
|
|
65
|
+
setGuestInvitePrompt(null);
|
|
66
|
+
setSuccess(null);
|
|
67
|
+
}, [agent.id, isVisible, onRefreshCollaborators]);
|
|
68
|
+
const parsedEmails = useMemo(() => parseEmails(emailText), [emailText]);
|
|
69
|
+
const memberCount = collaborators.length;
|
|
70
|
+
const sendInvites = async (emails: string[], addAsGuest = false) => {
|
|
71
|
+
setError(null);
|
|
72
|
+
setSuccess(null);
|
|
73
|
+
setGuestInvitePrompt(null);
|
|
74
|
+
if (!onShareAgent) {
|
|
75
|
+
setError('Sharing is not available in this app build.');
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
78
|
+
if (emails.length === 0) {
|
|
79
|
+
setError('Enter at least one email.');
|
|
80
|
+
return;
|
|
81
|
+
}
|
|
82
|
+
const invalidEmails = emails.filter((email) => !isValidEmail(email));
|
|
83
|
+
if (invalidEmails.length > 0) {
|
|
84
|
+
setError(`Invalid email: ${invalidEmails[0]}`);
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
setIsInviting(true);
|
|
88
|
+
try {
|
|
89
|
+
const result = await onShareAgent({agentId: agent.id, addAsGuest, emails});
|
|
90
|
+
const summary = applyInviteResult(
|
|
91
|
+
result,
|
|
92
|
+
emails.length,
|
|
93
|
+
setError,
|
|
94
|
+
setSuccess,
|
|
95
|
+
addAsGuest ? [] : [NOT_WORKSPACE_MEMBER_CODE],
|
|
96
|
+
);
|
|
97
|
+
if (!addAsGuest && summary.notWorkspaceMembers.length > 0) {
|
|
98
|
+
setGuestInvitePrompt({
|
|
99
|
+
emails: summary.notWorkspaceMembers.map((item) => item.email),
|
|
100
|
+
pendingInvitationEmails: summary.notWorkspaceMembers
|
|
101
|
+
.filter((item) => item.has_pending_invitation)
|
|
102
|
+
.map((item) => item.email),
|
|
103
|
+
});
|
|
104
|
+
} else if (summary.failed.length === 0) {
|
|
105
|
+
setEmailText('');
|
|
106
|
+
}
|
|
107
|
+
await onRefreshCollaborators?.(agent.id);
|
|
108
|
+
} catch (inviteError) {
|
|
109
|
+
const message = inviteError instanceof Error ? inviteError.message : 'Failed to invite collaborators.';
|
|
110
|
+
if (!addAsGuest && isNotWorkspaceMemberMessage(message)) {
|
|
111
|
+
setGuestInvitePrompt({
|
|
112
|
+
emails,
|
|
113
|
+
pendingInvitationEmails: [],
|
|
114
|
+
});
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
setError(message);
|
|
119
|
+
} finally {
|
|
120
|
+
setIsInviting(false);
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
const invite = async () => {
|
|
124
|
+
await sendInvites(parsedEmails);
|
|
125
|
+
};
|
|
126
|
+
const inviteGuests = async () => {
|
|
127
|
+
if (!guestInvitePrompt) {
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
await sendInvites(guestInvitePrompt.emails, true);
|
|
132
|
+
};
|
|
133
|
+
const openWorkspaceMembers = async () => {
|
|
134
|
+
setGuestInvitePrompt(null);
|
|
135
|
+
onClose();
|
|
136
|
+
await onOpenWorkspaceMembers?.({agentId: agent.id, organizationId: agent.organizationId});
|
|
137
|
+
};
|
|
138
|
+
return (
|
|
139
|
+
<Modal animationType="fade" transparent visible={isVisible} onRequestClose={onClose}>
|
|
140
|
+
<View style={localStyles.backdrop}>
|
|
141
|
+
<View style={localStyles.sheet}>
|
|
142
|
+
<View style={localStyles.header}>
|
|
143
|
+
<View style={localStyles.agentTitle}>
|
|
144
|
+
<AgentSphereIcon agent={agent} size="md" />
|
|
145
|
+
<View style={localStyles.titleTextWrap}>
|
|
146
|
+
<Text numberOfLines={1} style={localStyles.title}>Share chat</Text>
|
|
147
|
+
<Text numberOfLines={1} style={localStyles.subtitle}>
|
|
148
|
+
{memberCount === 1 ? '1 person has access' : `${memberCount} people have access`}
|
|
149
|
+
</Text>
|
|
150
|
+
</View>
|
|
151
|
+
</View>
|
|
152
|
+
<Pressable accessibilityLabel="Close share" accessibilityRole="button" onPress={onClose} style={localStyles.closeButton}>
|
|
153
|
+
<X color="#F4F4F5" size={20} strokeWidth={2.4} />
|
|
154
|
+
</Pressable>
|
|
155
|
+
</View>
|
|
156
|
+
<View style={localStyles.inputCard}>
|
|
157
|
+
<Text style={localStyles.inputLabel}>Invite by email</Text>
|
|
158
|
+
<TextInput
|
|
159
|
+
autoCapitalize="none"
|
|
160
|
+
autoCorrect={false}
|
|
161
|
+
editable={!isInviting}
|
|
162
|
+
keyboardType="email-address"
|
|
163
|
+
multiline
|
|
164
|
+
onChangeText={setEmailText}
|
|
165
|
+
placeholder="name@company.com"
|
|
166
|
+
placeholderTextColor="#71717A"
|
|
167
|
+
style={localStyles.input}
|
|
168
|
+
value={emailText}
|
|
169
|
+
/>
|
|
170
|
+
{error ? <Text style={localStyles.errorText}>{error}</Text> : null}
|
|
171
|
+
{success ? <Text style={localStyles.successText}>{success}</Text> : null}
|
|
172
|
+
<Pressable
|
|
173
|
+
accessibilityLabel="Invite collaborators"
|
|
174
|
+
accessibilityRole="button"
|
|
175
|
+
disabled={isInviting}
|
|
176
|
+
onPress={invite}
|
|
177
|
+
style={({ pressed }) => [
|
|
178
|
+
localStyles.inviteButton,
|
|
179
|
+
isInviting && localStyles.disabledButton,
|
|
180
|
+
pressed && sharedStyles.pressed,
|
|
181
|
+
]}
|
|
182
|
+
>
|
|
183
|
+
{isInviting ? <ActivityIndicator color="#111111" size="small" /> : <MailPlus color="#111111" size={18} strokeWidth={2.5} />}
|
|
184
|
+
<Text style={localStyles.inviteButtonText}>Invite</Text>
|
|
185
|
+
</Pressable>
|
|
186
|
+
</View>
|
|
187
|
+
{guestInvitePrompt ? (
|
|
188
|
+
<View style={localStyles.guestCard}>
|
|
189
|
+
<Text style={localStyles.guestTitle}>Invite outside workspace?</Text>
|
|
190
|
+
<Text style={localStyles.guestBody}>
|
|
191
|
+
{formatEmailList(guestInvitePrompt.emails)} {guestInvitePrompt.emails.length === 1 ? 'is' : 'are'} not in this workspace.
|
|
192
|
+
Add {guestInvitePrompt.emails.length === 1 ? 'them' : 'these people'} as guests to this Superagent, or manage workspace members first.
|
|
193
|
+
</Text>
|
|
194
|
+
{guestInvitePrompt.pendingInvitationEmails.length > 0 ? (
|
|
195
|
+
<Text style={localStyles.guestHint}>
|
|
196
|
+
Pending workspace invite: {formatEmailList(guestInvitePrompt.pendingInvitationEmails)}
|
|
197
|
+
</Text>
|
|
198
|
+
) : null}
|
|
199
|
+
<View style={localStyles.guestActions}>
|
|
200
|
+
<Pressable
|
|
201
|
+
accessibilityLabel="Add invitees as guests"
|
|
202
|
+
accessibilityRole="button"
|
|
203
|
+
disabled={isInviting}
|
|
204
|
+
onPress={inviteGuests}
|
|
205
|
+
style={({ pressed }) => [
|
|
206
|
+
localStyles.guestPrimaryButton,
|
|
207
|
+
isInviting && localStyles.disabledButton,
|
|
208
|
+
pressed && sharedStyles.pressed,
|
|
209
|
+
]}
|
|
210
|
+
>
|
|
211
|
+
{isInviting ? <ActivityIndicator color="#111111" size="small" /> : <UserPlus color="#111111" size={16} strokeWidth={2.6} />}
|
|
212
|
+
<Text style={localStyles.guestPrimaryButtonText}>Add as guest</Text>
|
|
213
|
+
</Pressable>
|
|
214
|
+
<Pressable
|
|
215
|
+
accessibilityLabel="Open workspace members"
|
|
216
|
+
accessibilityRole="button"
|
|
217
|
+
disabled={!onOpenWorkspaceMembers}
|
|
218
|
+
onPress={openWorkspaceMembers}
|
|
219
|
+
style={({ pressed }) => [
|
|
220
|
+
localStyles.guestSecondaryButton,
|
|
221
|
+
!onOpenWorkspaceMembers && localStyles.disabledButton,
|
|
222
|
+
pressed && sharedStyles.pressed,
|
|
223
|
+
]}
|
|
224
|
+
>
|
|
225
|
+
<Building2 color="#F4F4F5" size={16} strokeWidth={2.3} />
|
|
226
|
+
<Text style={localStyles.guestSecondaryButtonText}>Add to workspace</Text>
|
|
227
|
+
</Pressable>
|
|
228
|
+
</View>
|
|
229
|
+
</View>
|
|
230
|
+
) : null}
|
|
231
|
+
<View style={localStyles.membersHeader}>
|
|
232
|
+
<Text style={localStyles.membersTitle}>People</Text>
|
|
233
|
+
{isLoading ? <ActivityIndicator color="#F4F4F5" size="small" /> : null}
|
|
234
|
+
</View>
|
|
235
|
+
<ScrollView contentContainerStyle={localStyles.membersList} showsVerticalScrollIndicator={false}>
|
|
236
|
+
{collaborators.map((collaborator) => (
|
|
237
|
+
<CollaboratorRow collaborator={collaborator} key={`${collaborator.id}-${collaborator.email}`} />
|
|
238
|
+
))}
|
|
239
|
+
{!isLoading && collaborators.length === 0 ? (
|
|
240
|
+
<Text style={localStyles.emptyText}>No collaborators loaded yet.</Text>
|
|
241
|
+
) : null}
|
|
242
|
+
</ScrollView>
|
|
243
|
+
</View>
|
|
244
|
+
</View>
|
|
245
|
+
</Modal>
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
function CollaboratorRow({collaborator}: {collaborator: SuperagentCollaborator}) {
|
|
249
|
+
const displayName = collaborator.full_name || collaborator.email.split('@')[0] || collaborator.email;
|
|
250
|
+
return (
|
|
251
|
+
<View style={localStyles.memberRow}>
|
|
252
|
+
<View style={localStyles.avatarWrap}>
|
|
253
|
+
{collaborator.profile_image_url && !collaborator.is_pending ? (
|
|
254
|
+
<Image source={{uri: collaborator.profile_image_url}} style={localStyles.avatarImage} />
|
|
255
|
+
) : (
|
|
256
|
+
<User color="#F4F4F5" size={17} strokeWidth={2.2} />
|
|
257
|
+
)}
|
|
258
|
+
</View>
|
|
259
|
+
<View style={localStyles.memberTextWrap}>
|
|
260
|
+
<View style={localStyles.memberNameRow}>
|
|
261
|
+
<Text numberOfLines={1} style={localStyles.memberName}>{displayName}</Text>
|
|
262
|
+
{collaborator.is_owner ? <Text style={localStyles.badge}>Owner</Text> : null}
|
|
263
|
+
{collaborator.is_pending ? <Text style={localStyles.badge}>Pending</Text> : null}
|
|
264
|
+
</View>
|
|
265
|
+
<Text numberOfLines={1} style={localStyles.memberEmail}>{collaborator.email}</Text>
|
|
266
|
+
</View>
|
|
267
|
+
</View>
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
function parseEmails(value: string) {
|
|
271
|
+
return [...new Set(value.split(/[,\s]+/).map((email) => email.trim().toLowerCase()).filter(Boolean))];
|
|
272
|
+
}
|
|
273
|
+
function isValidEmail(email: string) {
|
|
274
|
+
return /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(email);
|
|
275
|
+
}
|
|
276
|
+
function applyInviteResult(
|
|
277
|
+
result: SuperagentInviteCollaboratorsResult | void,
|
|
278
|
+
invitedCount: number,
|
|
279
|
+
setError: (error: string | null) => void,
|
|
280
|
+
setSuccess: (success: string | null) => void,
|
|
281
|
+
ignoredErrorCodes: string[] = [],
|
|
282
|
+
) {
|
|
283
|
+
const results = result?.results ?? [];
|
|
284
|
+
const ignoredErrorCodeSet = new Set(ignoredErrorCodes);
|
|
285
|
+
const shouldIgnoreFailure = (item: { error?: string; error_code?: string; success: boolean }) => {
|
|
286
|
+
if (item.success) {
|
|
287
|
+
return false;
|
|
288
|
+
}
|
|
289
|
+
if (ignoredErrorCodeSet.has(item.error_code ?? '')) {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
return ignoredErrorCodeSet.has(NOT_WORKSPACE_MEMBER_CODE) && isNotWorkspaceMemberFailure(item);
|
|
293
|
+
};
|
|
294
|
+
const notWorkspaceMembers = results.filter(isNotWorkspaceMemberFailure);
|
|
295
|
+
const failed = results.filter((item) => !item.success && !shouldIgnoreFailure(item));
|
|
296
|
+
const successful = results.filter((item) => item.success);
|
|
297
|
+
if (failed.length > 0) {
|
|
298
|
+
setError(failed.map((item) => `${item.email}: ${item.error || 'Invite failed'}`).join('\n'));
|
|
299
|
+
}
|
|
300
|
+
if (successful.length > 0 || results.length === 0) {
|
|
301
|
+
const count = successful.length || invitedCount;
|
|
302
|
+
setSuccess(count === 1 ? 'Invitation sent.' : `${count} invitations sent.`);
|
|
303
|
+
}
|
|
304
|
+
return { failed, notWorkspaceMembers, successful };
|
|
305
|
+
}
|
|
306
|
+
function formatEmailList(emails: string[]) {
|
|
307
|
+
if (emails.length <= 2) {
|
|
308
|
+
return emails.join(' and ');
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
return `${emails.slice(0, 2).join(', ')} and ${emails.length - 2} more`;
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function isNotWorkspaceMemberFailure(item: { error?: string; error_code?: string; success: boolean }) {
|
|
315
|
+
return !item.success && (item.error_code === NOT_WORKSPACE_MEMBER_CODE || isNotWorkspaceMemberMessage(item.error));
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
function isNotWorkspaceMemberMessage(message?: string) {
|
|
319
|
+
return /not (?:a )?member of this workspace|not in this workspace/i.test(message ?? '');
|
|
320
|
+
}
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import React, { useCallback, useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
ActivityIndicator,
|
|
4
|
+
SafeAreaView,
|
|
5
|
+
ScrollView,
|
|
6
|
+
Text,
|
|
7
|
+
View,
|
|
8
|
+
} from 'react-native';
|
|
9
|
+
|
|
10
|
+
import { AgentCard, AgentRow, CreateAgentButton, EmptyState, PlaceholderPage } from './screenParts';
|
|
11
|
+
import { ConversationScreen } from './ConversationScreen';
|
|
12
|
+
import { styles } from './styles';
|
|
13
|
+
import type { SuperagentAgent, SuperagentHomeScreenProps, SuperagentRoute } from './types';
|
|
14
|
+
|
|
15
|
+
const DEFAULT_ROUTE: SuperagentRoute = { name: 'home' };
|
|
16
|
+
|
|
17
|
+
export function SuperagentHomeScreen(props: SuperagentHomeScreenProps) {
|
|
18
|
+
return <SuperagentHomeScreenContent {...props} />;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
function SuperagentHomeScreenContent({
|
|
22
|
+
agents = [],
|
|
23
|
+
automations,
|
|
24
|
+
automationCredits,
|
|
25
|
+
availableConnectors,
|
|
26
|
+
channelStatus,
|
|
27
|
+
collaborators,
|
|
28
|
+
connectingChannelId,
|
|
29
|
+
connectedConnectors,
|
|
30
|
+
connectingConnectorId,
|
|
31
|
+
latestMessages = [],
|
|
32
|
+
messagesByAgentId = {},
|
|
33
|
+
apiClient,
|
|
34
|
+
isLoadingConnectors,
|
|
35
|
+
isLoadingAutomations,
|
|
36
|
+
isLoadingChannels,
|
|
37
|
+
isLoading = false,
|
|
38
|
+
isSendingMessage = false,
|
|
39
|
+
navigationMode = 'internal',
|
|
40
|
+
currentUserAvatarUrl,
|
|
41
|
+
currentUserName,
|
|
42
|
+
fileLoadError,
|
|
43
|
+
fileLoadFailed,
|
|
44
|
+
filePaths,
|
|
45
|
+
headerAccessory,
|
|
46
|
+
initialRoute = DEFAULT_ROUTE,
|
|
47
|
+
isLoadingAgentSettings,
|
|
48
|
+
isLoadingCollaborators,
|
|
49
|
+
isLoadingFiles,
|
|
50
|
+
secrets,
|
|
51
|
+
onAgentBack,
|
|
52
|
+
onAgentMessageDone,
|
|
53
|
+
onCancelConnectorConnection,
|
|
54
|
+
onArchiveAutomation,
|
|
55
|
+
onCloneAgent,
|
|
56
|
+
onConnectConnector,
|
|
57
|
+
onCopyMessage,
|
|
58
|
+
onCreateAgent,
|
|
59
|
+
onDeleteAgent,
|
|
60
|
+
onDeleteAutomation,
|
|
61
|
+
onDeleteSecret,
|
|
62
|
+
onDisconnectConnector,
|
|
63
|
+
onDisconnectIMessage,
|
|
64
|
+
onDisconnectTelegram,
|
|
65
|
+
onEditAutomation,
|
|
66
|
+
onGenerateLineCode,
|
|
67
|
+
onGenerateIMessageCode,
|
|
68
|
+
onImportFromDrive,
|
|
69
|
+
onOpenIMessage,
|
|
70
|
+
onOpenLine,
|
|
71
|
+
onOpenAgent,
|
|
72
|
+
onOpenTelegram,
|
|
73
|
+
onOpenWhatsApp,
|
|
74
|
+
onOpenSandboxFile,
|
|
75
|
+
onOpenWorkspaceMembers,
|
|
76
|
+
onPickFiles,
|
|
77
|
+
onPickPhotos,
|
|
78
|
+
onRemoveConnector,
|
|
79
|
+
onRenameAgent,
|
|
80
|
+
onRefreshAgentSettings,
|
|
81
|
+
onRefreshAutomations,
|
|
82
|
+
onRefreshChannels,
|
|
83
|
+
onRefreshCollaborators,
|
|
84
|
+
onRefreshFiles,
|
|
85
|
+
onRestoreAutomation,
|
|
86
|
+
onRouteChange,
|
|
87
|
+
onRunAutomationNow,
|
|
88
|
+
onSaveSandboxFile,
|
|
89
|
+
onSaveSecret,
|
|
90
|
+
onSendMessage,
|
|
91
|
+
onShareAgent,
|
|
92
|
+
onShareAgentLink,
|
|
93
|
+
onShareIMessageCode,
|
|
94
|
+
onShareLineCode,
|
|
95
|
+
onStartLiveVoice,
|
|
96
|
+
onStartVoiceInput,
|
|
97
|
+
onSetupTelegram,
|
|
98
|
+
onTakePhoto,
|
|
99
|
+
onToggleAutomation,
|
|
100
|
+
onUpdateAgentModel,
|
|
101
|
+
onUpdateToolPermissions,
|
|
102
|
+
onUploadSandboxFiles,
|
|
103
|
+
realtimeClient,
|
|
104
|
+
renderMarkdown,
|
|
105
|
+
toolRenderers,
|
|
106
|
+
}: SuperagentHomeScreenProps) {
|
|
107
|
+
const [route, setRoute] = useState<SuperagentRoute>(initialRoute);
|
|
108
|
+
const [isCreating, setIsCreating] = useState(false);
|
|
109
|
+
const latestAgent = agents[0] ?? null;
|
|
110
|
+
const automationCount = automations?.length ?? 0;
|
|
111
|
+
const connectedConnectorCount = connectedConnectors?.length ?? 0;
|
|
112
|
+
|
|
113
|
+
const navigate = useCallback((nextRoute: SuperagentRoute) => {
|
|
114
|
+
setRoute(nextRoute);
|
|
115
|
+
onRouteChange?.(nextRoute);
|
|
116
|
+
}, [onRouteChange]);
|
|
117
|
+
|
|
118
|
+
const openAgent = useCallback((agentId: string) => {
|
|
119
|
+
if (navigationMode === 'internal') {
|
|
120
|
+
navigate({ name: 'agent', agentId });
|
|
121
|
+
}
|
|
122
|
+
onOpenAgent?.(agentId);
|
|
123
|
+
}, [navigate, navigationMode, onOpenAgent]);
|
|
124
|
+
|
|
125
|
+
const createAgent = useCallback(async () => {
|
|
126
|
+
if (!onCreateAgent) {
|
|
127
|
+
navigate({ name: 'create-agent' });
|
|
128
|
+
return;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
setIsCreating(true);
|
|
132
|
+
try {
|
|
133
|
+
const createdAgent = await onCreateAgent();
|
|
134
|
+
if (createdAgent?.id) {
|
|
135
|
+
openAgent(createdAgent.id);
|
|
136
|
+
} else {
|
|
137
|
+
navigate({ name: 'create-agent' });
|
|
138
|
+
}
|
|
139
|
+
} finally {
|
|
140
|
+
setIsCreating(false);
|
|
141
|
+
}
|
|
142
|
+
}, [navigate, onCreateAgent, openAgent]);
|
|
143
|
+
|
|
144
|
+
const recentAgents = useMemo(() => agents.slice(1, 5), [agents]);
|
|
145
|
+
|
|
146
|
+
if (route.name === 'agent') {
|
|
147
|
+
const activeAgent = findAgentById(agents, route.agentId);
|
|
148
|
+
const routeMessages = messagesByAgentId[route.agentId] ?? (
|
|
149
|
+
latestAgent?.id === route.agentId ? latestMessages : []
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
return (
|
|
153
|
+
<ConversationScreen
|
|
154
|
+
apiClient={apiClient}
|
|
155
|
+
agent={activeAgent ?? createUnknownAgent(route.agentId)}
|
|
156
|
+
automationCredits={automationCredits}
|
|
157
|
+
automations={automations}
|
|
158
|
+
availableConnectors={availableConnectors}
|
|
159
|
+
channelStatus={channelStatus}
|
|
160
|
+
collaborators={collaborators}
|
|
161
|
+
connectingChannelId={connectingChannelId}
|
|
162
|
+
connectedConnectors={connectedConnectors}
|
|
163
|
+
connectingConnectorId={connectingConnectorId}
|
|
164
|
+
currentUserAvatarUrl={currentUserAvatarUrl}
|
|
165
|
+
fileLoadError={fileLoadError}
|
|
166
|
+
fileLoadFailed={fileLoadFailed}
|
|
167
|
+
filePaths={filePaths}
|
|
168
|
+
isLoadingAgentSettings={isLoadingAgentSettings}
|
|
169
|
+
isLoadingAutomations={isLoadingAutomations}
|
|
170
|
+
isLoadingChannels={isLoadingChannels}
|
|
171
|
+
isLoadingCollaborators={isLoadingCollaborators}
|
|
172
|
+
isLoadingConnectors={isLoadingConnectors}
|
|
173
|
+
isLoadingFiles={isLoadingFiles}
|
|
174
|
+
isSending={isSendingMessage}
|
|
175
|
+
messages={routeMessages}
|
|
176
|
+
secrets={secrets}
|
|
177
|
+
onAgentMessageDone={onAgentMessageDone}
|
|
178
|
+
onBack={() => {
|
|
179
|
+
if (onAgentBack) {
|
|
180
|
+
onAgentBack();
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
navigate({ name: 'home' });
|
|
185
|
+
}}
|
|
186
|
+
onCancelConnectorConnection={onCancelConnectorConnection}
|
|
187
|
+
onArchiveAutomation={onArchiveAutomation}
|
|
188
|
+
onCloneAgent={onCloneAgent}
|
|
189
|
+
onCopyMessage={onCopyMessage}
|
|
190
|
+
onConnectConnector={onConnectConnector}
|
|
191
|
+
onDeleteAgent={onDeleteAgent}
|
|
192
|
+
onDeleteAutomation={onDeleteAutomation}
|
|
193
|
+
onDeleteSecret={onDeleteSecret}
|
|
194
|
+
onDisconnectConnector={onDisconnectConnector}
|
|
195
|
+
onDisconnectIMessage={onDisconnectIMessage}
|
|
196
|
+
onDisconnectTelegram={onDisconnectTelegram}
|
|
197
|
+
onEditAutomation={onEditAutomation}
|
|
198
|
+
onGenerateLineCode={onGenerateLineCode}
|
|
199
|
+
onGenerateIMessageCode={onGenerateIMessageCode}
|
|
200
|
+
onImportFromDrive={onImportFromDrive}
|
|
201
|
+
onOpenIMessage={onOpenIMessage}
|
|
202
|
+
onOpenLine={onOpenLine}
|
|
203
|
+
onOpenSandboxFile={onOpenSandboxFile}
|
|
204
|
+
onOpenTelegram={onOpenTelegram}
|
|
205
|
+
onOpenWhatsApp={onOpenWhatsApp}
|
|
206
|
+
onOpenWorkspaceMembers={onOpenWorkspaceMembers}
|
|
207
|
+
onPickFiles={onPickFiles}
|
|
208
|
+
onPickPhotos={onPickPhotos}
|
|
209
|
+
onRemoveConnector={onRemoveConnector}
|
|
210
|
+
onRenameAgent={onRenameAgent}
|
|
211
|
+
onRefreshAgentSettings={onRefreshAgentSettings}
|
|
212
|
+
onRefreshAutomations={onRefreshAutomations}
|
|
213
|
+
onRefreshChannels={onRefreshChannels}
|
|
214
|
+
onRefreshCollaborators={onRefreshCollaborators}
|
|
215
|
+
onRefreshFiles={onRefreshFiles}
|
|
216
|
+
onRestoreAutomation={onRestoreAutomation}
|
|
217
|
+
onRunAutomationNow={onRunAutomationNow}
|
|
218
|
+
onSaveSandboxFile={onSaveSandboxFile}
|
|
219
|
+
onSaveSecret={onSaveSecret}
|
|
220
|
+
onSendMessage={onSendMessage}
|
|
221
|
+
onShareAgent={onShareAgent}
|
|
222
|
+
onShareAgentLink={onShareAgentLink}
|
|
223
|
+
onShareIMessageCode={onShareIMessageCode}
|
|
224
|
+
onShareLineCode={onShareLineCode}
|
|
225
|
+
onStartLiveVoice={onStartLiveVoice}
|
|
226
|
+
onStartVoiceInput={onStartVoiceInput}
|
|
227
|
+
onSetupTelegram={onSetupTelegram}
|
|
228
|
+
onTakePhoto={onTakePhoto}
|
|
229
|
+
onToggleAutomation={onToggleAutomation}
|
|
230
|
+
onUpdateAgentModel={onUpdateAgentModel}
|
|
231
|
+
onUpdateToolPermissions={onUpdateToolPermissions}
|
|
232
|
+
onUploadSandboxFiles={onUploadSandboxFiles}
|
|
233
|
+
realtimeClient={realtimeClient}
|
|
234
|
+
renderMarkdown={renderMarkdown}
|
|
235
|
+
toolRenderers={toolRenderers}
|
|
236
|
+
/>
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
if (route.name === 'create-agent') {
|
|
241
|
+
return (
|
|
242
|
+
<PlaceholderPage
|
|
243
|
+
title="Create Superagent"
|
|
244
|
+
body="Creation flow will live inside this package."
|
|
245
|
+
onBack={() => navigate({ name: 'home' })}
|
|
246
|
+
/>
|
|
247
|
+
);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return (
|
|
251
|
+
<SafeAreaView style={styles.safeArea}>
|
|
252
|
+
<View style={styles.homeTopBar}>
|
|
253
|
+
<View style={styles.topBarSide} />
|
|
254
|
+
<View style={styles.topBarTitleWrap}>
|
|
255
|
+
<Text style={styles.topBarTitle}>Superagent</Text>
|
|
256
|
+
</View>
|
|
257
|
+
<View style={[styles.topBarSide, styles.topBarRight]}>
|
|
258
|
+
{headerAccessory}
|
|
259
|
+
</View>
|
|
260
|
+
</View>
|
|
261
|
+
<ScrollView contentContainerStyle={styles.container}>
|
|
262
|
+
<View style={styles.homeIntro}>
|
|
263
|
+
<Text style={styles.subtitle}>
|
|
264
|
+
{currentUserName ? `Ready when you are, ${currentUserName}.` : 'Agents, tools, and tasks.'}
|
|
265
|
+
</Text>
|
|
266
|
+
</View>
|
|
267
|
+
|
|
268
|
+
{isLoading ? (
|
|
269
|
+
<View style={styles.loadingPanel}>
|
|
270
|
+
<ActivityIndicator color="#FF5A1F" />
|
|
271
|
+
</View>
|
|
272
|
+
) : latestAgent ? (
|
|
273
|
+
<AgentCard
|
|
274
|
+
agent={latestAgent}
|
|
275
|
+
automationCount={automationCount}
|
|
276
|
+
connectorCount={connectedConnectorCount}
|
|
277
|
+
latestMessages={latestMessages}
|
|
278
|
+
onPress={() => openAgent(latestAgent.id)}
|
|
279
|
+
/>
|
|
280
|
+
) : (
|
|
281
|
+
<EmptyState onCreateAgent={createAgent} isCreating={isCreating} />
|
|
282
|
+
)}
|
|
283
|
+
|
|
284
|
+
{latestAgent ? (
|
|
285
|
+
<CreateAgentButton isCreating={isCreating} onPress={createAgent} />
|
|
286
|
+
) : null}
|
|
287
|
+
|
|
288
|
+
{recentAgents.length > 0 ? (
|
|
289
|
+
<View style={styles.recentSection}>
|
|
290
|
+
<View style={styles.sectionHeader}>
|
|
291
|
+
<Text style={styles.sectionTitle}>Recent</Text>
|
|
292
|
+
<Text style={styles.sectionCount}>{recentAgents.length}</Text>
|
|
293
|
+
</View>
|
|
294
|
+
{recentAgents.map((agent) => (
|
|
295
|
+
<AgentRow
|
|
296
|
+
key={agent.id}
|
|
297
|
+
agent={agent}
|
|
298
|
+
latestMessages={messagesByAgentId[agent.id] ?? []}
|
|
299
|
+
onPress={() => openAgent(agent.id)}
|
|
300
|
+
/>
|
|
301
|
+
))}
|
|
302
|
+
</View>
|
|
303
|
+
) : null}
|
|
304
|
+
</ScrollView>
|
|
305
|
+
</SafeAreaView>
|
|
306
|
+
);
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function findAgentById(agents: SuperagentAgent[], agentId: string) {
|
|
310
|
+
return agents.find((agent) => agent.id === agentId);
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
function createUnknownAgent(agentId: string): SuperagentAgent {
|
|
314
|
+
return {
|
|
315
|
+
id: agentId,
|
|
316
|
+
name: 'Superagent',
|
|
317
|
+
};
|
|
318
|
+
}
|