@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
package/src/apiClient.ts
ADDED
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
QueuedSuperagentMessage,
|
|
3
|
+
SuperagentConversation,
|
|
4
|
+
SuperagentMessage,
|
|
5
|
+
SuperagentNativeClient,
|
|
6
|
+
SuperagentNativeClientConfig,
|
|
7
|
+
SuperagentPaginatedMessages,
|
|
8
|
+
} from './types';
|
|
9
|
+
|
|
10
|
+
type QueryValue = string | number | boolean | undefined;
|
|
11
|
+
|
|
12
|
+
export function createSuperagentNativeClient({
|
|
13
|
+
apiBaseUrl,
|
|
14
|
+
appId,
|
|
15
|
+
getAuthToken,
|
|
16
|
+
getHeaders,
|
|
17
|
+
}: SuperagentNativeClientConfig): SuperagentNativeClient {
|
|
18
|
+
const request = async <TResponse>(
|
|
19
|
+
method: string,
|
|
20
|
+
path: string,
|
|
21
|
+
options: {
|
|
22
|
+
body?: unknown;
|
|
23
|
+
query?: Record<string, QueryValue>;
|
|
24
|
+
headers?: Record<string, string>;
|
|
25
|
+
} = {},
|
|
26
|
+
): Promise<TResponse> => {
|
|
27
|
+
const token = await getAuthToken();
|
|
28
|
+
const extraHeaders = await getHeaders?.();
|
|
29
|
+
const response = await fetch(buildUrl(apiBaseUrl, path, options.query), {
|
|
30
|
+
method,
|
|
31
|
+
headers: {
|
|
32
|
+
...(options.body === undefined ? {} : { 'Content-Type': 'application/json' }),
|
|
33
|
+
...(token ? { Authorization: `Bearer ${token}` } : {}),
|
|
34
|
+
...extraHeaders,
|
|
35
|
+
...options.headers,
|
|
36
|
+
},
|
|
37
|
+
body: options.body === undefined ? undefined : JSON.stringify(options.body),
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
if (!response.ok) {
|
|
41
|
+
throw await createClientError(response);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (response.status === 204) {
|
|
45
|
+
return undefined as TResponse;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return response.json() as Promise<TResponse>;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
const basePath = `/${pathSegment(appId, 'appId')}/user-agent/conversations`;
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
getConversations(limit = 1) {
|
|
55
|
+
return request<SuperagentConversation[]>('GET', basePath, {
|
|
56
|
+
query: { sort: '-updated_date', limit },
|
|
57
|
+
});
|
|
58
|
+
},
|
|
59
|
+
getConversation(conversationId) {
|
|
60
|
+
return request<SuperagentConversation>('GET', `${basePath}/${pathSegment(conversationId, 'conversationId')}`);
|
|
61
|
+
},
|
|
62
|
+
getMessages(conversationId, params = {}) {
|
|
63
|
+
return request<SuperagentPaginatedMessages>('GET', `${basePath}/${pathSegment(conversationId, 'conversationId')}/messages`, {
|
|
64
|
+
query: params,
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
createConversation(metadata = {}) {
|
|
68
|
+
return request<SuperagentConversation>('POST', basePath, { body: { metadata } });
|
|
69
|
+
},
|
|
70
|
+
addMessage(conversationId, message) {
|
|
71
|
+
return request('POST', `${basePath}/${pathSegment(conversationId, 'conversationId')}/messages`, {
|
|
72
|
+
body: serializeMessageForBackend(message),
|
|
73
|
+
});
|
|
74
|
+
},
|
|
75
|
+
stopConversation(conversationId) {
|
|
76
|
+
return request<void>('POST', `${basePath}/${pathSegment(conversationId, 'conversationId')}/stop`);
|
|
77
|
+
},
|
|
78
|
+
getQueuedMessages(conversationId) {
|
|
79
|
+
return request<{ messages: QueuedSuperagentMessage[] }>(
|
|
80
|
+
'GET',
|
|
81
|
+
`${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages`,
|
|
82
|
+
);
|
|
83
|
+
},
|
|
84
|
+
editQueuedMessage(conversationId, messageId, content) {
|
|
85
|
+
return request<{ ok: boolean }>(
|
|
86
|
+
'PUT',
|
|
87
|
+
`${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages/${pathSegment(messageId, 'messageId')}`,
|
|
88
|
+
{ body: { content } },
|
|
89
|
+
);
|
|
90
|
+
},
|
|
91
|
+
deleteQueuedMessage(conversationId, messageId) {
|
|
92
|
+
return request<{ ok: boolean }>(
|
|
93
|
+
'DELETE',
|
|
94
|
+
`${basePath}/${pathSegment(conversationId, 'conversationId')}/queued-messages/${pathSegment(messageId, 'messageId')}`,
|
|
95
|
+
);
|
|
96
|
+
},
|
|
97
|
+
deleteMessage(conversationId, messageId) {
|
|
98
|
+
return request<{ message: string }>(
|
|
99
|
+
'DELETE',
|
|
100
|
+
`${basePath}/${pathSegment(conversationId, 'conversationId')}/messages/${pathSegment(messageId, 'messageId')}`,
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
submitToolCallInput(conversationId, toolCallId, approve, extraUserInput, originRequestId) {
|
|
104
|
+
return request<SuperagentConversation>(
|
|
105
|
+
'POST',
|
|
106
|
+
`${basePath}/${pathSegment(conversationId, 'conversationId')}/submit-tool-call-input`,
|
|
107
|
+
{
|
|
108
|
+
body: {
|
|
109
|
+
tool_call_id: toolCallId,
|
|
110
|
+
action: approve ? 'approved' : 'rejected',
|
|
111
|
+
extra_user_input: extraUserInput,
|
|
112
|
+
},
|
|
113
|
+
headers: originRequestId ? { 'X-Request-ID': originRequestId } : undefined,
|
|
114
|
+
},
|
|
115
|
+
);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
function buildUrl(baseUrl: string, path: string, query?: Record<string, QueryValue>) {
|
|
121
|
+
const normalizedBase = baseUrl.endsWith('/') ? baseUrl.slice(0, -1) : baseUrl;
|
|
122
|
+
const url = `${normalizedBase}${path}`;
|
|
123
|
+
const queryString = buildQueryString(query);
|
|
124
|
+
return queryString ? `${url}?${queryString}` : url;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
function buildQueryString(query?: Record<string, QueryValue>) {
|
|
128
|
+
return Object.entries(query ?? {})
|
|
129
|
+
.filter(([, value]) => value !== undefined)
|
|
130
|
+
.map(([key, value]) => `${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`)
|
|
131
|
+
.join('&');
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function pathSegment(value: string, name: string) {
|
|
135
|
+
if (!value || value.includes('\0')) {
|
|
136
|
+
throw new Error(`Invalid ${name}`);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return encodeURIComponent(value);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
async function createClientError(response: Response) {
|
|
143
|
+
let message = `Request failed with status ${response.status}`;
|
|
144
|
+
|
|
145
|
+
try {
|
|
146
|
+
const body = await response.json();
|
|
147
|
+
if (typeof body?.message === 'string') message = body.message;
|
|
148
|
+
else if (typeof body?.detail === 'string') message = body.detail;
|
|
149
|
+
} catch {
|
|
150
|
+
// Keep the status-based fallback message.
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
const error = new Error(message) as Error & { status?: number };
|
|
154
|
+
error.status = response.status;
|
|
155
|
+
return error;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function serializeMessageForBackend(message: Partial<SuperagentMessage>) {
|
|
159
|
+
const {
|
|
160
|
+
createdAt,
|
|
161
|
+
created_at,
|
|
162
|
+
fileUrls,
|
|
163
|
+
file_urls,
|
|
164
|
+
replyTo,
|
|
165
|
+
toolCalls,
|
|
166
|
+
tool_calls,
|
|
167
|
+
...backendMessage
|
|
168
|
+
} = message;
|
|
169
|
+
|
|
170
|
+
const additionalParams = {
|
|
171
|
+
...backendMessage.additional_message_params,
|
|
172
|
+
...(replyTo ? { reply_to: { message_id: replyTo.messageId, content: replyTo.content } } : {}),
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
return omitUndefined({
|
|
176
|
+
...backendMessage,
|
|
177
|
+
file_urls: file_urls ?? fileUrls,
|
|
178
|
+
tool_calls: tool_calls ?? toolCalls,
|
|
179
|
+
additional_message_params: Object.keys(additionalParams).length > 0 ? additionalParams : undefined,
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function omitUndefined<T extends Record<string, unknown>>(value: T) {
|
|
184
|
+
return Object.fromEntries(
|
|
185
|
+
Object.entries(value).filter(([, entry]) => entry !== undefined),
|
|
186
|
+
);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export type { SuperagentNativeClient };
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type {SuperagentNativeMediaItem} from './useSuperagentAttachmentPicker';
|
|
2
|
+
import {
|
|
3
|
+
SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB,
|
|
4
|
+
SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS,
|
|
5
|
+
} from './mediaUtils';
|
|
6
|
+
|
|
7
|
+
export function validateNativeAttachment(item: SuperagentNativeMediaItem, name: string, extension: string) {
|
|
8
|
+
if (!SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS.includes(extension as typeof SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS[number])) {
|
|
9
|
+
throw new Error(`File type "${extension || 'unknown'}" is not supported.`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const limitMb = SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB[extension] ?? 5;
|
|
13
|
+
if (typeof item.size === 'number' && item.size > limitMb * 1024 * 1024) {
|
|
14
|
+
throw new Error(`File "${name}" exceeds the maximum size of ${limitMb}MB.`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export function getUploadName(item: SuperagentNativeMediaItem, index: number) {
|
|
19
|
+
const baseName = item.name || getNameFromUri(item.uri) || `attachment-${index + 1}`;
|
|
20
|
+
if (getExtension(baseName)) {
|
|
21
|
+
return baseName;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const extension = getExtension(item.uri) || getExtensionForMimeType(item.mimeType) || '.jpg';
|
|
25
|
+
return `${baseName}${extension}`;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function getExtension(value?: string) {
|
|
29
|
+
const cleanValue = String(value || '').split('?')[0].toLowerCase();
|
|
30
|
+
const index = cleanValue.lastIndexOf('.');
|
|
31
|
+
return index >= 0 ? cleanValue.slice(index) : '';
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export function getMimeType(item: SuperagentNativeMediaItem, extension: string) {
|
|
35
|
+
if (item.mimeType) {
|
|
36
|
+
return item.mimeType;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
switch (extension) {
|
|
40
|
+
case '.jpg':
|
|
41
|
+
case '.jpeg':
|
|
42
|
+
return 'image/jpeg';
|
|
43
|
+
case '.png':
|
|
44
|
+
return 'image/png';
|
|
45
|
+
case '.webp':
|
|
46
|
+
return 'image/webp';
|
|
47
|
+
case '.pdf':
|
|
48
|
+
return 'application/pdf';
|
|
49
|
+
case '.csv':
|
|
50
|
+
return 'text/csv';
|
|
51
|
+
case '.html':
|
|
52
|
+
return 'text/html';
|
|
53
|
+
case '.txt':
|
|
54
|
+
return 'text/plain';
|
|
55
|
+
case '.xlsx':
|
|
56
|
+
return 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet';
|
|
57
|
+
case '.docx':
|
|
58
|
+
return 'application/vnd.openxmlformats-officedocument.wordprocessingml.document';
|
|
59
|
+
case '.json':
|
|
60
|
+
return 'application/json';
|
|
61
|
+
case '.md':
|
|
62
|
+
return 'text/markdown';
|
|
63
|
+
default:
|
|
64
|
+
return 'application/octet-stream';
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
function getNameFromUri(uri?: string) {
|
|
69
|
+
if (!uri) {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const cleanUri = uri.split('?')[0];
|
|
74
|
+
const name = cleanUri.split('/').filter(Boolean).pop();
|
|
75
|
+
if (!name || name.startsWith('ph:')) {
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
try {
|
|
80
|
+
return decodeURIComponent(name);
|
|
81
|
+
} catch {
|
|
82
|
+
return name;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function getExtensionForMimeType(mimeType?: string) {
|
|
87
|
+
switch (mimeType) {
|
|
88
|
+
case 'image/jpeg':
|
|
89
|
+
return '.jpg';
|
|
90
|
+
case 'image/png':
|
|
91
|
+
return '.png';
|
|
92
|
+
case 'image/webp':
|
|
93
|
+
return '.webp';
|
|
94
|
+
case 'application/pdf':
|
|
95
|
+
return '.pdf';
|
|
96
|
+
case 'text/plain':
|
|
97
|
+
return '.txt';
|
|
98
|
+
case 'text/html':
|
|
99
|
+
return '.html';
|
|
100
|
+
case 'text/csv':
|
|
101
|
+
return '.csv';
|
|
102
|
+
case 'application/json':
|
|
103
|
+
return '.json';
|
|
104
|
+
case 'text/markdown':
|
|
105
|
+
return '.md';
|
|
106
|
+
default:
|
|
107
|
+
return null;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import type {SuperagentMediaActionContext, SuperagentMediaAttachment} from './types';
|
|
2
|
+
import type {
|
|
3
|
+
SuperagentAttachmentPickerAdapters,
|
|
4
|
+
SuperagentAttachmentPickerMode,
|
|
5
|
+
SuperagentNativeMediaItem,
|
|
6
|
+
} from './useSuperagentAttachmentPicker';
|
|
7
|
+
import {
|
|
8
|
+
getExtension,
|
|
9
|
+
getMimeType,
|
|
10
|
+
getUploadName,
|
|
11
|
+
validateNativeAttachment,
|
|
12
|
+
} from './attachmentFileHelpers';
|
|
13
|
+
|
|
14
|
+
const MAX_ATTACHMENTS = 10;
|
|
15
|
+
const IMAGE_EXTENSIONS = new Set(['.jpg', '.jpeg', '.png', '.webp']);
|
|
16
|
+
|
|
17
|
+
export async function pickAndUploadAttachments({
|
|
18
|
+
authToken,
|
|
19
|
+
baseUrl,
|
|
20
|
+
context,
|
|
21
|
+
mode,
|
|
22
|
+
nativeAdapters,
|
|
23
|
+
onUploadStart,
|
|
24
|
+
}: {
|
|
25
|
+
authToken: string;
|
|
26
|
+
baseUrl: string;
|
|
27
|
+
context: SuperagentMediaActionContext;
|
|
28
|
+
mode: SuperagentAttachmentPickerMode;
|
|
29
|
+
nativeAdapters: SuperagentAttachmentPickerAdapters;
|
|
30
|
+
onUploadStart?: (count: number) => void;
|
|
31
|
+
}) {
|
|
32
|
+
const items = await nativeAdapters.pickNativeMedia(mode);
|
|
33
|
+
const uploadItems = (items ?? []).filter((item) => Boolean(item?.uri || item?.uploadUri)).slice(0, MAX_ATTACHMENTS);
|
|
34
|
+
if (!uploadItems.length) {
|
|
35
|
+
return [];
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
onUploadStart?.(uploadItems.length);
|
|
39
|
+
|
|
40
|
+
const attachments: SuperagentMediaAttachment[] = [];
|
|
41
|
+
for (const [index, item] of uploadItems.entries()) {
|
|
42
|
+
attachments.push(await uploadNativeItem({authToken, baseUrl, agentId: context.agentId, index, item}));
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
return attachments;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export function getAttachmentPickerErrorMessage(error: unknown) {
|
|
49
|
+
if (error instanceof Error && error.message) {
|
|
50
|
+
return error.message;
|
|
51
|
+
}
|
|
52
|
+
const candidate = error as {message?: unknown} | null;
|
|
53
|
+
return typeof candidate?.message === 'string' && candidate.message ?
|
|
54
|
+
candidate.message :
|
|
55
|
+
'Failed to attach the selected file.';
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
async function uploadNativeItem({
|
|
59
|
+
agentId,
|
|
60
|
+
authToken,
|
|
61
|
+
baseUrl,
|
|
62
|
+
index,
|
|
63
|
+
item,
|
|
64
|
+
}: {
|
|
65
|
+
agentId: string;
|
|
66
|
+
authToken: string;
|
|
67
|
+
baseUrl: string;
|
|
68
|
+
index: number;
|
|
69
|
+
item: SuperagentNativeMediaItem;
|
|
70
|
+
}) {
|
|
71
|
+
const uri = item.uploadUri ?? item.uri;
|
|
72
|
+
if (!uri) {
|
|
73
|
+
throw new Error('The selected file does not have a readable local URI.');
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
const name = getUploadName(item, index);
|
|
77
|
+
const extension = getExtension(name);
|
|
78
|
+
validateNativeAttachment(item, name, extension);
|
|
79
|
+
|
|
80
|
+
const formData = new FormData();
|
|
81
|
+
formData.append('file', {
|
|
82
|
+
name,
|
|
83
|
+
type: getMimeType(item, extension),
|
|
84
|
+
uri,
|
|
85
|
+
} as unknown as Blob);
|
|
86
|
+
|
|
87
|
+
const response = await fetch(`${normalizeBaseUrl(baseUrl)}/api/files/apps/${encodeURIComponent(agentId)}/upload`, {
|
|
88
|
+
body: formData,
|
|
89
|
+
headers: {
|
|
90
|
+
Authorization: `Bearer ${authToken}`,
|
|
91
|
+
'X-Client-Platform': 'mobile_native',
|
|
92
|
+
},
|
|
93
|
+
method: 'POST',
|
|
94
|
+
});
|
|
95
|
+
const body = await response.json().catch(() => ({}));
|
|
96
|
+
|
|
97
|
+
if (!response.ok || typeof body.url !== 'string') {
|
|
98
|
+
throw new Error(body.message || body.detail || 'Upload failed.');
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return {
|
|
102
|
+
kind: IMAGE_EXTENSIONS.has(extension) ? 'image' : 'file',
|
|
103
|
+
mimeType: getMimeType(item, extension),
|
|
104
|
+
name,
|
|
105
|
+
previewUri: item.thumbnailUri ?? item.previewUri ?? item.uri,
|
|
106
|
+
url: body.url,
|
|
107
|
+
} satisfies SuperagentMediaAttachment;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
function normalizeBaseUrl(url: string) {
|
|
111
|
+
return url.trim().replace(/\/+$/, '');
|
|
112
|
+
}
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const composerStyles = StyleSheet.create({
|
|
4
|
+
wrap: {
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
backgroundColor: '#000000',
|
|
7
|
+
paddingBottom: 14,
|
|
8
|
+
paddingHorizontal: 8,
|
|
9
|
+
paddingTop: 6,
|
|
10
|
+
},
|
|
11
|
+
shell: {
|
|
12
|
+
alignItems: 'flex-end',
|
|
13
|
+
backgroundColor: '#151515',
|
|
14
|
+
borderColor: '#2A2A2A',
|
|
15
|
+
borderRadius: 28,
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
minHeight: 58,
|
|
19
|
+
paddingHorizontal: 7,
|
|
20
|
+
paddingVertical: 6,
|
|
21
|
+
position: 'relative',
|
|
22
|
+
width: '100%',
|
|
23
|
+
},
|
|
24
|
+
attachmentMenu: {
|
|
25
|
+
backgroundColor: 'rgba(22, 22, 22, 0.96)',
|
|
26
|
+
borderColor: '#2A2A2A',
|
|
27
|
+
borderRadius: 28,
|
|
28
|
+
borderWidth: 1,
|
|
29
|
+
bottom: 64,
|
|
30
|
+
left: 0,
|
|
31
|
+
minWidth: 250,
|
|
32
|
+
overflow: 'hidden',
|
|
33
|
+
paddingBottom: 10,
|
|
34
|
+
paddingTop: 10,
|
|
35
|
+
position: 'absolute',
|
|
36
|
+
shadowColor: '#000000',
|
|
37
|
+
shadowOffset: { height: 20, width: 0 },
|
|
38
|
+
shadowOpacity: 0.35,
|
|
39
|
+
shadowRadius: 30,
|
|
40
|
+
zIndex: 20,
|
|
41
|
+
},
|
|
42
|
+
attachmentMenuIcon: {
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
backgroundColor: '#252528',
|
|
45
|
+
borderRadius: 20,
|
|
46
|
+
height: 40,
|
|
47
|
+
justifyContent: 'center',
|
|
48
|
+
marginRight: 16,
|
|
49
|
+
width: 40,
|
|
50
|
+
},
|
|
51
|
+
attachmentMenuItem: {
|
|
52
|
+
alignItems: 'center',
|
|
53
|
+
flexDirection: 'row',
|
|
54
|
+
minHeight: 58,
|
|
55
|
+
paddingHorizontal: 18,
|
|
56
|
+
},
|
|
57
|
+
attachmentMenuItemText: { color: '#F4F4F5', fontSize: 20, fontWeight: '600' },
|
|
58
|
+
attachmentMenuItemTextDisabled: { color: '#8E8E93' },
|
|
59
|
+
attachmentMenuSectionLabel: {
|
|
60
|
+
color: '#A1A1AA',
|
|
61
|
+
fontSize: 12,
|
|
62
|
+
fontWeight: '800',
|
|
63
|
+
marginBottom: 2,
|
|
64
|
+
marginTop: 8,
|
|
65
|
+
paddingHorizontal: 18,
|
|
66
|
+
},
|
|
67
|
+
iconButton: { alignItems: 'center', borderRadius: 22, height: 44, justifyContent: 'center', minWidth: 44, paddingHorizontal: 9 },
|
|
68
|
+
iconButtonText: { color: '#F4F4F5', fontSize: 13, fontWeight: '800' },
|
|
69
|
+
activeButton: { backgroundColor: '#2A2A2A' },
|
|
70
|
+
disabledButton: { opacity: 0.38 },
|
|
71
|
+
input: {
|
|
72
|
+
backgroundColor: '#151515',
|
|
73
|
+
color: '#F4F4F5',
|
|
74
|
+
flex: 1,
|
|
75
|
+
fontSize: 18,
|
|
76
|
+
lineHeight: 24,
|
|
77
|
+
maxHeight: 120,
|
|
78
|
+
minHeight: 44,
|
|
79
|
+
paddingHorizontal: 6,
|
|
80
|
+
paddingBottom: 9,
|
|
81
|
+
paddingTop: 10,
|
|
82
|
+
},
|
|
83
|
+
replyPreview: {
|
|
84
|
+
alignItems: 'center',
|
|
85
|
+
backgroundColor: '#151515',
|
|
86
|
+
borderColor: '#2A2A2A',
|
|
87
|
+
borderRadius: 16,
|
|
88
|
+
borderWidth: 1,
|
|
89
|
+
flexDirection: 'row',
|
|
90
|
+
marginBottom: 8,
|
|
91
|
+
maxWidth: 900,
|
|
92
|
+
minHeight: 48,
|
|
93
|
+
paddingHorizontal: 12,
|
|
94
|
+
paddingVertical: 8,
|
|
95
|
+
width: '100%',
|
|
96
|
+
},
|
|
97
|
+
replyPreviewClose: {
|
|
98
|
+
alignItems: 'center',
|
|
99
|
+
borderRadius: 15,
|
|
100
|
+
height: 30,
|
|
101
|
+
justifyContent: 'center',
|
|
102
|
+
marginLeft: 8,
|
|
103
|
+
width: 30,
|
|
104
|
+
},
|
|
105
|
+
replyPreviewMarker: {
|
|
106
|
+
alignSelf: 'stretch',
|
|
107
|
+
backgroundColor: '#FF5A1F',
|
|
108
|
+
borderRadius: 2,
|
|
109
|
+
marginRight: 10,
|
|
110
|
+
width: 3,
|
|
111
|
+
},
|
|
112
|
+
replyPreviewText: {
|
|
113
|
+
color: '#D4D4D8',
|
|
114
|
+
flex: 1,
|
|
115
|
+
fontSize: 14,
|
|
116
|
+
fontWeight: '700',
|
|
117
|
+
lineHeight: 19,
|
|
118
|
+
},
|
|
119
|
+
sendButton: {
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
backgroundColor: '#F4F4F5',
|
|
122
|
+
borderRadius: 22,
|
|
123
|
+
height: 44,
|
|
124
|
+
justifyContent: 'center',
|
|
125
|
+
width: 44,
|
|
126
|
+
},
|
|
127
|
+
sendButtonDisabled: { backgroundColor: '#2A2A2A' },
|
|
128
|
+
sendButtonText: { color: '#111111', fontSize: 21, fontWeight: '900', lineHeight: 24 },
|
|
129
|
+
liveActionButton: { backgroundColor: '#151515', borderColor: '#2A2A2A', borderWidth: 1 },
|
|
130
|
+
stopButton: {
|
|
131
|
+
alignItems: 'center',
|
|
132
|
+
backgroundColor: '#F4F4F5',
|
|
133
|
+
borderRadius: 22,
|
|
134
|
+
height: 44,
|
|
135
|
+
justifyContent: 'center',
|
|
136
|
+
width: 44,
|
|
137
|
+
},
|
|
138
|
+
stopButtonText: { color: '#111111', fontSize: 18, fontWeight: '900', lineHeight: 22 },
|
|
139
|
+
attachmentStrip: { flexDirection: 'row', flexWrap: 'wrap', marginBottom: 8, maxWidth: 900, width: '100%' },
|
|
140
|
+
attachmentItem: {
|
|
141
|
+
backgroundColor: '#151515',
|
|
142
|
+
borderColor: '#2A2A2A',
|
|
143
|
+
borderRadius: 12,
|
|
144
|
+
borderWidth: 1,
|
|
145
|
+
marginRight: 8,
|
|
146
|
+
marginTop: 8,
|
|
147
|
+
maxWidth: 180,
|
|
148
|
+
overflow: 'hidden',
|
|
149
|
+
},
|
|
150
|
+
attachmentImage: { height: 72, width: 72 },
|
|
151
|
+
attachmentFile: { flexDirection: 'row', alignItems: 'center', paddingHorizontal: 10, paddingVertical: 8 },
|
|
152
|
+
attachmentFileIcon: { color: '#A1A1AA', fontSize: 13, fontWeight: '800', marginRight: 6 },
|
|
153
|
+
attachmentName: { color: '#D4D4D8', flexShrink: 1, fontSize: 12, fontWeight: '700' },
|
|
154
|
+
removeAttachment: {
|
|
155
|
+
alignItems: 'center',
|
|
156
|
+
backgroundColor: '#F4F4F5',
|
|
157
|
+
borderRadius: 9,
|
|
158
|
+
height: 18,
|
|
159
|
+
justifyContent: 'center',
|
|
160
|
+
position: 'absolute',
|
|
161
|
+
right: 4,
|
|
162
|
+
top: 4,
|
|
163
|
+
width: 18,
|
|
164
|
+
},
|
|
165
|
+
removeAttachmentText: { color: '#111111', fontSize: 12, fontWeight: '800', lineHeight: 14 },
|
|
166
|
+
errorText: { color: '#FCA5A5', fontSize: 12, marginBottom: 6, maxWidth: 900, width: '100%' },
|
|
167
|
+
});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SvgXml } from 'react-native-svg';
|
|
3
|
+
|
|
4
|
+
const CONNECTOR_BRAND_ICON_XML: Record<string, string> = {
|
|
5
|
+
salesforce: `
|
|
6
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0.5 -149.38 999 999">
|
|
7
|
+
<path fill="#00A1E0" d="M416.224 76.763c32.219-33.57 77.074-54.391 126.682-54.391 65.946 0 123.48 36.772 154.12 91.361 26.626-11.896 56.098-18.514 87.106-18.514 118.94 0 215.368 97.268 215.368 217.247 0 119.993-96.428 217.261-215.368 217.261a213.735 213.735 0 0 1-42.422-4.227c-26.981 48.128-78.397 80.646-137.412 80.646-24.705 0-48.072-5.706-68.877-15.853-27.352 64.337-91.077 109.448-165.348 109.448-77.344 0-143.261-48.939-168.563-117.574-11.057 2.348-22.513 3.572-34.268 3.572C75.155 585.74.5 510.317.5 417.262c0-62.359 33.542-116.807 83.378-145.937-10.26-23.608-15.967-49.665-15.967-77.06C67.911 87.25 154.79.5 261.948.5c62.914 0 118.827 29.913 154.276 76.263"/>
|
|
8
|
+
</svg>`,
|
|
9
|
+
gmail: `
|
|
10
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="2 6 44 36">
|
|
11
|
+
<path fill="#4caf50" d="M45,16.2l-5,2.75l-5,4.75L35,40h7c1.657,0,3-1.343,3-3V16.2z"/>
|
|
12
|
+
<path fill="#1e88e5" d="M3,16.2l3.614,1.71L13,23.7V40H6c-1.657,0-3-1.343-3-3V16.2z"/>
|
|
13
|
+
<polygon fill="#e53935" points="35,11.2 24,19.45 13,11.2 12,17 13,23.7 24,31.95 35,23.7 36,17"/>
|
|
14
|
+
<path fill="#c62828" d="M3,12.298V16.2l10,7.5V11.2L9.876,8.859C9.132,8.301,8.228,8,7.298,8C4.924,8,3,9.924,3,12.298z"/>
|
|
15
|
+
<path fill="#fbc02d" d="M45,12.298V16.2l-10,7.5V11.2l3.124-2.341C38.868,8.301,39.772,8,40.702,8C43.076,8,45,9.924,45,12.298z"/>
|
|
16
|
+
</svg>`,
|
|
17
|
+
googlecalendar: `
|
|
18
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
19
|
+
<path fill="#fff" d="M195.368 60.632H60.632v134.736h134.736z"/>
|
|
20
|
+
<path fill="#ea4335" d="M195.368 256L256 195.368l-30.316-5.172l-30.316 5.172l-5.533 27.73z"/>
|
|
21
|
+
<path fill="#188038" d="M0 195.368v40.421C0 246.956 9.044 256 20.21 256h40.422l6.225-30.316l-6.225-30.316l-33.033-5.172z"/>
|
|
22
|
+
<path fill="#1967d2" d="M256 60.632V20.21C256 9.044 246.956 0 235.79 0h-40.422q-5.532 22.554-5.533 33.196q0 10.641 5.533 27.436q20.115 5.76 30.316 5.76T256 60.631"/>
|
|
23
|
+
<path fill="#fbbc04" d="M256 60.632h-60.632v134.736H256z"/>
|
|
24
|
+
<path fill="#34a853" d="M195.368 195.368H60.632V256h134.736z"/>
|
|
25
|
+
<path fill="#4285f4" d="M195.368 0H20.211C9.044 0 0 9.044 0 20.21v175.158h60.632V60.632h134.736z"/>
|
|
26
|
+
<path fill="#4285f4" d="M88.27 165.154c-5.036-3.402-8.523-8.37-10.426-14.94l11.689-4.816q1.59 6.063 5.558 9.398c2.627 2.223 5.827 3.318 9.566 3.318q5.734 0 9.852-3.487c2.746-2.324 4.127-5.288 4.127-8.875q0-5.508-4.345-8.994c-2.897-2.324-6.535-3.486-10.88-3.486h-6.754v-11.57h6.063q5.608 0 9.448-3.033c2.56-2.02 3.84-4.783 3.84-8.303c0-3.132-1.145-5.625-3.435-7.494c-2.29-1.87-5.188-2.813-8.708-2.813c-3.436 0-6.164.91-8.185 2.745a16.1 16.1 0 0 0-4.413 6.754l-11.57-4.817c1.532-4.345 4.345-8.185 8.471-11.503s9.398-4.985 15.798-4.985c4.733 0 8.994.91 12.767 2.745c3.772 1.836 6.736 4.379 8.875 7.613c2.14 3.25 3.2 6.888 3.2 10.93c0 4.126-.993 7.613-2.98 10.476s-4.43 5.052-7.327 6.585v.69a22.25 22.25 0 0 1 9.398 7.327c2.442 3.284 3.672 7.208 3.672 11.79c0 4.58-1.163 8.673-3.487 12.26c-2.324 3.588-5.54 6.417-9.617 8.472c-4.092 2.055-8.69 3.1-13.793 3.1c-5.912.016-11.369-1.685-16.405-5.087m71.797-58.005l-12.833 9.28l-6.417-9.734l23.023-16.607h8.825v78.333h-12.598z"/>
|
|
27
|
+
</svg>`,
|
|
28
|
+
googledrive: `
|
|
29
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 112 100">
|
|
30
|
+
<path d="M8.46154 85.7051L13.3974 94.2308C14.4231 96.0256 15.8974 97.4359 17.6282 98.4615L35.2564 67.9487H0C0 69.9359 0.512821 71.9231 1.53846 73.7179L8.46154 85.7051Z" fill="#0066DA"/>
|
|
31
|
+
<path d="M55.9615 32.0513L38.3333 1.53846C36.6026 2.5641 35.1282 3.97436 34.1026 5.76923L1.53846 62.1795C0.531683 63.9357 0.00134047 65.9244 0 67.9487H35.2564L55.9615 32.0513Z" fill="#00AC47"/>
|
|
32
|
+
<path d="M94.2949 98.4615C96.0256 97.4359 97.5 96.0256 98.5256 94.2308L100.577 90.7051L110.385 73.7179C111.41 71.9231 111.923 69.9359 111.923 67.9487H76.6641L84.1667 82.6923L94.2949 98.4615Z" fill="#EA4335"/>
|
|
33
|
+
<path d="M55.9615 32.0513L73.5898 1.53846C71.859 0.512821 69.8718 0 67.8205 0H44.1026C42.0513 0 40.0641 0.576923 38.3333 1.53846L55.9615 32.0513Z" fill="#00832D"/>
|
|
34
|
+
<path d="M76.6667 67.9487H35.2564L17.6282 98.4615C19.359 99.4872 21.3462 100 23.3974 100H88.5256C90.5769 100 92.5641 99.4231 94.2949 98.4615L76.6667 67.9487Z" fill="#2684FC"/>
|
|
35
|
+
<path d="M94.1026 33.9744L77.8205 5.76923C76.7949 3.97436 75.3205 2.5641 73.5897 1.53846L55.9615 32.0513L76.6667 67.9487H111.859C111.859 65.9615 111.346 63.9744 110.321 62.1795L94.1026 33.9744Z" fill="#FFBA00"/>
|
|
36
|
+
</svg>`,
|
|
37
|
+
notion: `
|
|
38
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 256">
|
|
39
|
+
<path fill="#fff" d="M16.092 11.538L164.09.608c18.179-1.56 22.85-.508 34.28 7.801l47.243 33.282C253.406 47.414 256 48.975 256 55.207v182.527c0 11.439-4.155 18.205-18.696 19.24L65.44 267.378c-10.913.517-16.11-1.043-21.825-8.327L8.826 213.814C2.586 205.487 0 199.254 0 191.97V29.726c0-9.352 4.155-17.153 16.092-18.188"/>
|
|
40
|
+
<path fill="#111" d="M164.09.608L16.092 11.538C4.155 12.573 0 20.374 0 29.726v162.245c0 7.284 2.585 13.516 8.826 21.843l34.789 45.237c5.715 7.284 10.912 8.844 21.825 8.327l171.864-10.404c14.532-1.035 18.696-7.801 18.696-19.24V55.207c0-5.911-2.336-7.614-9.21-12.66l-1.185-.856L198.37 8.409C186.94.1 182.27-.952 164.09.608M69.327 52.22c-14.033.945-17.216 1.159-25.186-5.323L23.876 30.778c-2.06-2.086-1.026-4.69 4.163-5.207l142.274-10.395c11.947-1.043 18.17 3.12 22.842 6.758l24.401 17.68c1.043.525 3.638 3.637.517 3.637L71.146 52.095zm-16.36 183.954V81.222c0-6.767 2.077-9.887 8.3-10.413L230.02 60.93c5.724-.517 8.31 3.12 8.31 9.879v153.917c0 6.767-1.044 12.49-10.387 13.008l-161.487 9.361c-9.343.517-13.489-2.594-13.489-10.921M212.377 89.53c1.034 4.681 0 9.362-4.681 9.897l-7.783 1.542v114.404c-6.758 3.637-12.981 5.715-18.18 5.715c-8.308 0-10.386-2.604-16.609-10.396l-50.898-80.079v77.476l16.1 3.646s0 9.362-12.989 9.362l-35.814 2.077c-1.043-2.086 0-7.284 3.63-8.318l9.351-2.595V109.823l-12.98-1.052c-1.044-4.68 1.55-11.439 8.826-11.965l38.426-2.585l52.958 81.113v-71.76l-13.498-1.552c-1.043-5.733 3.111-9.896 8.3-10.404z"/>
|
|
41
|
+
</svg>`,
|
|
42
|
+
slack: `
|
|
43
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
|
44
|
+
<path fill="#de1c59" d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317S.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317c-7.33 0-13.317-5.987-13.317-13.317zm0 0"/>
|
|
45
|
+
<path fill="#35c5f0" d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309S39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0"/>
|
|
46
|
+
<path fill="#2eb57d" d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317s13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0"/>
|
|
47
|
+
<path fill="#ebb02e" d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309s-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317c0 7.33-5.987 13.317-13.317 13.317zm0 0"/>
|
|
48
|
+
</svg>`,
|
|
49
|
+
slackbot: `
|
|
50
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128">
|
|
51
|
+
<path fill="#de1c59" d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317S.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317c-7.33 0-13.317-5.987-13.317-13.317zm0 0"/>
|
|
52
|
+
<path fill="#35c5f0" d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309S39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0"/>
|
|
53
|
+
<path fill="#2eb57d" d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317s13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0"/>
|
|
54
|
+
<path fill="#ebb02e" d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309s-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317c0 7.33-5.987 13.317-13.317 13.317zm0 0"/>
|
|
55
|
+
</svg>`,
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
export function hasConnectorBrandIcon(connectorId: string) {
|
|
59
|
+
return !!CONNECTOR_BRAND_ICON_XML[connectorId];
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
export function ConnectorBrandIcon({ connectorId, size }: { connectorId: string; size: number }) {
|
|
63
|
+
const xml = CONNECTOR_BRAND_ICON_XML[connectorId];
|
|
64
|
+
if (!xml) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return <SvgXml height={size} width={size} xml={xml} />;
|
|
69
|
+
}
|