@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,26 @@
|
|
|
1
|
+
import type { SuperagentEditorTab } from './types';
|
|
2
|
+
|
|
3
|
+
export const EDITOR_TAB_SECTIONS: Array<{
|
|
4
|
+
title?: string;
|
|
5
|
+
tabs: Array<{ id: SuperagentEditorTab; label: string; detail?: string }>;
|
|
6
|
+
}> = [
|
|
7
|
+
{
|
|
8
|
+
tabs: [
|
|
9
|
+
{ id: 'chat', label: 'Chat', detail: 'Talk to the agent' },
|
|
10
|
+
{ id: 'integrations', label: 'Integrations', detail: 'Connect tools' },
|
|
11
|
+
{ id: 'tasks', label: 'Tasks', detail: 'Automations' },
|
|
12
|
+
{ id: 'files', label: 'Files', detail: 'Generated project files' },
|
|
13
|
+
{ id: 'channels', label: 'Channels', detail: 'Messaging surfaces' },
|
|
14
|
+
{ id: 'agent_settings', label: 'Agent Settings', detail: 'Access and sharing' },
|
|
15
|
+
],
|
|
16
|
+
},
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
export function getEditorTabLabel(tab: SuperagentEditorTab) {
|
|
20
|
+
for (const section of EDITOR_TAB_SECTIONS) {
|
|
21
|
+
const match = section.tabs.find((item) => item.id === tab);
|
|
22
|
+
if (match) return match.label;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return 'Chat';
|
|
26
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { SuperagentSandboxFileNode } from './types';
|
|
2
|
+
|
|
3
|
+
const HIDDEN_FILE_NAMES = new Set(['.gitignore', '.gitkeep', 'BOOTSTRAP.md', 'bootstrap.md']);
|
|
4
|
+
|
|
5
|
+
export const DEFAULT_SANDBOX_FILE_PATHS = [
|
|
6
|
+
'.agents/',
|
|
7
|
+
'.agents/rules/',
|
|
8
|
+
'.agents/skills/',
|
|
9
|
+
'.agents/mcps/',
|
|
10
|
+
'.agents/hooks/',
|
|
11
|
+
'.agents/cron/',
|
|
12
|
+
'.agents/memory/',
|
|
13
|
+
'incoming_files/',
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
export type SuperagentFileCategory = 'code' | 'html' | 'image' | 'markdown' | 'pdf' | 'text';
|
|
17
|
+
|
|
18
|
+
export function normalizeFilePaths(paths: string[] = []) {
|
|
19
|
+
return paths
|
|
20
|
+
.filter((path) => typeof path === 'string' && path.trim().length > 0)
|
|
21
|
+
.map((path) => path.replace(/^\/+/, ''))
|
|
22
|
+
.filter((path) => !path.includes('\0'))
|
|
23
|
+
.filter((path) => !HIDDEN_FILE_NAMES.has(getFileName(path)));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function buildFileTree(paths: string[]) {
|
|
27
|
+
const root: Record<string, unknown> = {};
|
|
28
|
+
let fileCount = 0;
|
|
29
|
+
let folderCount = 0;
|
|
30
|
+
|
|
31
|
+
for (const path of normalizeFilePaths(paths)) {
|
|
32
|
+
const parts = path.split('/').filter(Boolean);
|
|
33
|
+
let current = root;
|
|
34
|
+
for (let index = 0; index < parts.length; index += 1) {
|
|
35
|
+
const part = parts[index];
|
|
36
|
+
const isFile = index === parts.length - 1 && !path.endsWith('/');
|
|
37
|
+
if (!(part in current)) {
|
|
38
|
+
current[part] = isFile ? null : {};
|
|
39
|
+
}
|
|
40
|
+
if (current[part] !== null) {
|
|
41
|
+
current = current[part] as Record<string, unknown>;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
const toNodes = (value: Record<string, unknown>): SuperagentSandboxFileNode[] => Object.entries(value)
|
|
47
|
+
.map(([name, children]) => {
|
|
48
|
+
if (children === null) {
|
|
49
|
+
fileCount += 1;
|
|
50
|
+
return { name, type: 'file' as const };
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
folderCount += 1;
|
|
54
|
+
return {
|
|
55
|
+
children: toNodes(children as Record<string, unknown>),
|
|
56
|
+
name,
|
|
57
|
+
type: 'folder' as const,
|
|
58
|
+
};
|
|
59
|
+
})
|
|
60
|
+
.sort((first, second) => {
|
|
61
|
+
if (first.type !== second.type) {
|
|
62
|
+
return first.type === 'folder' ? -1 : 1;
|
|
63
|
+
}
|
|
64
|
+
return first.name.localeCompare(second.name);
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const tree = toNodes(root);
|
|
68
|
+
|
|
69
|
+
return { fileCount, folderCount, tree };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function flattenFileTree(nodes: SuperagentSandboxFileNode[], parentPath = '') {
|
|
73
|
+
const paths: string[] = [];
|
|
74
|
+
|
|
75
|
+
for (const node of nodes) {
|
|
76
|
+
const path = parentPath ? `${parentPath}/${node.name}` : node.name;
|
|
77
|
+
if (node.type === 'file') {
|
|
78
|
+
paths.push(path);
|
|
79
|
+
} else {
|
|
80
|
+
paths.push(...flattenFileTree(node.children ?? [], path));
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return paths;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
export function getFileCategory(filePath: string): SuperagentFileCategory {
|
|
88
|
+
const extension = getFileExtension(filePath);
|
|
89
|
+
if (extension === 'html' || extension === 'htm') {
|
|
90
|
+
return 'html';
|
|
91
|
+
}
|
|
92
|
+
if (['png', 'jpg', 'jpeg', 'gif', 'webp', 'svg', 'ico', 'bmp'].includes(extension)) {
|
|
93
|
+
return 'image';
|
|
94
|
+
}
|
|
95
|
+
if (extension === 'pdf') {
|
|
96
|
+
return 'pdf';
|
|
97
|
+
}
|
|
98
|
+
if (extension === 'md' || extension === 'mdx') {
|
|
99
|
+
return 'markdown';
|
|
100
|
+
}
|
|
101
|
+
if ([
|
|
102
|
+
'bash',
|
|
103
|
+
'css',
|
|
104
|
+
'env',
|
|
105
|
+
'gitignore',
|
|
106
|
+
'graphql',
|
|
107
|
+
'js',
|
|
108
|
+
'json',
|
|
109
|
+
'jsx',
|
|
110
|
+
'py',
|
|
111
|
+
'sh',
|
|
112
|
+
'sql',
|
|
113
|
+
'toml',
|
|
114
|
+
'ts',
|
|
115
|
+
'tsx',
|
|
116
|
+
'xml',
|
|
117
|
+
'yaml',
|
|
118
|
+
'yml',
|
|
119
|
+
].includes(extension)) {
|
|
120
|
+
return 'code';
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return 'text';
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export function isEditableFile(filePath: string) {
|
|
127
|
+
const category = getFileCategory(filePath);
|
|
128
|
+
return category !== 'image' && category !== 'pdf';
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export function getFileName(path: string) {
|
|
132
|
+
return path.split('/').filter(Boolean).pop() ?? path;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
export function getFolderPath(path: string) {
|
|
136
|
+
const parts = path.split('/').filter(Boolean);
|
|
137
|
+
parts.pop();
|
|
138
|
+
return parts.join('/');
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function getFileExtension(path: string) {
|
|
142
|
+
const fileName = getFileName(path).toLowerCase();
|
|
143
|
+
const dotIndex = fileName.lastIndexOf('.');
|
|
144
|
+
return dotIndex >= 0 ? fileName.slice(dotIndex + 1) : '';
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export function getImageMimeType(filePath: string) {
|
|
148
|
+
switch (getFileExtension(filePath)) {
|
|
149
|
+
case 'bmp':
|
|
150
|
+
return 'image/bmp';
|
|
151
|
+
case 'gif':
|
|
152
|
+
return 'image/gif';
|
|
153
|
+
case 'ico':
|
|
154
|
+
return 'image/x-icon';
|
|
155
|
+
case 'jpg':
|
|
156
|
+
case 'jpeg':
|
|
157
|
+
return 'image/jpeg';
|
|
158
|
+
case 'svg':
|
|
159
|
+
return 'image/svg+xml';
|
|
160
|
+
case 'webp':
|
|
161
|
+
return 'image/webp';
|
|
162
|
+
default:
|
|
163
|
+
return 'image/png';
|
|
164
|
+
}
|
|
165
|
+
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
export { createSuperagentNativeClient } from './apiClient';
|
|
2
|
+
export { createSuperagentApiClient } from './superagentApiClient';
|
|
3
|
+
export { SUPERAGENT_CONNECTOR_CATALOG } from './connectorCatalog';
|
|
4
|
+
export { MarkdownText } from './MarkdownText';
|
|
5
|
+
export { createSuperagentSocketClient } from './realtimeClient';
|
|
6
|
+
export {
|
|
7
|
+
SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB,
|
|
8
|
+
SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS,
|
|
9
|
+
} from './mediaUtils';
|
|
10
|
+
export { EditorDrawer } from './EditorDrawer';
|
|
11
|
+
export { EditorTabPanel } from './EditorTabPanel';
|
|
12
|
+
export { superagentPaperTheme } from './paperTheme';
|
|
13
|
+
export { SuperagentHomeScreen } from './SuperagentHomeScreen';
|
|
14
|
+
export { ToolCallSummary } from './ToolCallSummary';
|
|
15
|
+
export { useSuperagentAttachmentPicker } from './useSuperagentAttachmentPicker';
|
|
16
|
+
export { useSuperagentConversation } from './useSuperagentConversation';
|
|
17
|
+
export { useSuperagentRuntime } from './useSuperagentRuntime';
|
|
18
|
+
export type { SuperagentSocketClientConfig, SuperagentSocketLike } from './realtimeClient';
|
|
19
|
+
export type {
|
|
20
|
+
ConnectorConnectionStatus,
|
|
21
|
+
InitiateConnectorConnectionResult,
|
|
22
|
+
SuperagentApiClientConfig,
|
|
23
|
+
SuperagentConnectorsResult,
|
|
24
|
+
SuperagentVoiceLiveSession,
|
|
25
|
+
} from './superagentApiClient';
|
|
26
|
+
export type {
|
|
27
|
+
SuperagentAttachmentPickerAdapters,
|
|
28
|
+
SuperagentAttachmentPickerMode,
|
|
29
|
+
SuperagentNativeMediaItem,
|
|
30
|
+
} from './useSuperagentAttachmentPicker';
|
|
31
|
+
export type {
|
|
32
|
+
SuperagentLiveAudioCapture,
|
|
33
|
+
SuperagentLiveAudioCaptureInput,
|
|
34
|
+
SuperagentLiveAudioChunk,
|
|
35
|
+
SuperagentExternalAuthCallbackEvent,
|
|
36
|
+
SuperagentExternalAuthCallbackStatus,
|
|
37
|
+
SuperagentLiveVoiceAudioAdapters,
|
|
38
|
+
SuperagentNativeRuntimeAdapters,
|
|
39
|
+
SuperagentRealtimeSocketFactoryInput,
|
|
40
|
+
SuperagentRuntimeConfig,
|
|
41
|
+
SuperagentRuntimeSocket,
|
|
42
|
+
SuperagentSandboxPickedFile,
|
|
43
|
+
} from './useSuperagentRuntime';
|
|
44
|
+
export type {
|
|
45
|
+
QueuedSuperagentMessage,
|
|
46
|
+
SuperagentAgent,
|
|
47
|
+
SuperagentAgentActionInput,
|
|
48
|
+
SuperagentAutomation,
|
|
49
|
+
SuperagentAutomationActionInput,
|
|
50
|
+
SuperagentAutomationCreditsSummary,
|
|
51
|
+
SuperagentAutomationType,
|
|
52
|
+
SuperagentChannelActionInput,
|
|
53
|
+
SuperagentChannelId,
|
|
54
|
+
SuperagentChannelStatus,
|
|
55
|
+
SuperagentChannelUrlActionInput,
|
|
56
|
+
SuperagentCollaborator,
|
|
57
|
+
SuperagentConnector,
|
|
58
|
+
SuperagentConnectorAccessMode,
|
|
59
|
+
SuperagentConnectorActionInput,
|
|
60
|
+
SuperagentConnectorStatus,
|
|
61
|
+
SuperagentConversation,
|
|
62
|
+
SuperagentEditorTab,
|
|
63
|
+
SuperagentHomeScreenProps,
|
|
64
|
+
SuperagentIMessageActivation,
|
|
65
|
+
SuperagentIMessageChannelStatus,
|
|
66
|
+
SuperagentIMessageCodeShareInput,
|
|
67
|
+
SuperagentLineActivation,
|
|
68
|
+
SuperagentLineChannelStatus,
|
|
69
|
+
SuperagentLineCodeShareInput,
|
|
70
|
+
SuperagentLiveVoiceInput,
|
|
71
|
+
SuperagentInviteCollaboratorResult,
|
|
72
|
+
SuperagentInviteCollaboratorsResult,
|
|
73
|
+
SuperagentMarkdownRenderer,
|
|
74
|
+
SuperagentMarkdownRendererProps,
|
|
75
|
+
SuperagentMediaActionContext,
|
|
76
|
+
SuperagentMediaAttachment,
|
|
77
|
+
SuperagentMediaPicker,
|
|
78
|
+
SuperagentMessage,
|
|
79
|
+
SuperagentModelChoice,
|
|
80
|
+
SuperagentModelUpdateInput,
|
|
81
|
+
SuperagentNativeClient,
|
|
82
|
+
SuperagentNativeClientConfig,
|
|
83
|
+
SuperagentOpenWorkspaceMembersInput,
|
|
84
|
+
SuperagentPaginatedMessages,
|
|
85
|
+
SuperagentCopyMessageInput,
|
|
86
|
+
SuperagentRealtimeClient,
|
|
87
|
+
SuperagentRealtimeHandlers,
|
|
88
|
+
SuperagentRenameAgentInput,
|
|
89
|
+
SuperagentRoute,
|
|
90
|
+
SuperagentSandboxFileActionInput,
|
|
91
|
+
SuperagentSandboxFileContent,
|
|
92
|
+
SuperagentSandboxFileNode,
|
|
93
|
+
SuperagentSandboxFileSaveInput,
|
|
94
|
+
SuperagentSandboxFileUploadInput,
|
|
95
|
+
SuperagentSandboxFileUploadResult,
|
|
96
|
+
SuperagentSecret,
|
|
97
|
+
SuperagentSecretDeleteInput,
|
|
98
|
+
SuperagentSecretSaveInput,
|
|
99
|
+
SuperagentShareAgentInput,
|
|
100
|
+
SuperagentTelegramChannelStatus,
|
|
101
|
+
SuperagentTelegramSetupInput,
|
|
102
|
+
SuperagentToolCall,
|
|
103
|
+
SuperagentToolPermissionConfig,
|
|
104
|
+
SuperagentToolPermissionsUpdateInput,
|
|
105
|
+
SuperagentToolRenderer,
|
|
106
|
+
SuperagentToolRendererProps,
|
|
107
|
+
SuperagentToolRenderers,
|
|
108
|
+
SuperagentVoiceInput,
|
|
109
|
+
SuperagentWhatsAppChannelStatus,
|
|
110
|
+
} from './types';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const markdownStyles = StyleSheet.create({
|
|
4
|
+
root: {},
|
|
5
|
+
wideRoot: { width: '100%' },
|
|
6
|
+
paragraph: { color: '#F4F4F5', fontSize: 17, lineHeight: 25, marginVertical: 3 },
|
|
7
|
+
heading1: { color: '#FFFFFF', fontSize: 22, fontWeight: '800', lineHeight: 29, marginBottom: 6, marginTop: 8 },
|
|
8
|
+
heading2: { color: '#FFFFFF', fontSize: 20, fontWeight: '800', lineHeight: 27, marginBottom: 5, marginTop: 7 },
|
|
9
|
+
heading3: { color: '#FFFFFF', fontSize: 18, fontWeight: '800', lineHeight: 25, marginBottom: 4, marginTop: 6 },
|
|
10
|
+
list: { marginVertical: 4 },
|
|
11
|
+
listItem: { flexDirection: 'row', marginVertical: 3 },
|
|
12
|
+
listMarker: { color: '#F4F4F5', fontSize: 18, lineHeight: 25, marginRight: 8, minWidth: 18, textAlign: 'center' },
|
|
13
|
+
listText: { color: '#F4F4F5', flex: 1, fontSize: 17, lineHeight: 25 },
|
|
14
|
+
quote: {
|
|
15
|
+
backgroundColor: '#111111',
|
|
16
|
+
borderLeftColor: '#3F3F46',
|
|
17
|
+
borderLeftWidth: 2,
|
|
18
|
+
borderRadius: 10,
|
|
19
|
+
marginVertical: 6,
|
|
20
|
+
paddingHorizontal: 11,
|
|
21
|
+
paddingVertical: 8,
|
|
22
|
+
},
|
|
23
|
+
quoteText: { color: '#C7C7CC', fontSize: 16, fontStyle: 'italic', lineHeight: 23 },
|
|
24
|
+
codeBlockScroll: { marginVertical: 8, width: '100%' },
|
|
25
|
+
codeBlock: {
|
|
26
|
+
backgroundColor: '#101010',
|
|
27
|
+
borderColor: '#27272A',
|
|
28
|
+
borderRadius: 12,
|
|
29
|
+
borderWidth: 1,
|
|
30
|
+
minWidth: '100%',
|
|
31
|
+
paddingHorizontal: 12,
|
|
32
|
+
paddingVertical: 10,
|
|
33
|
+
},
|
|
34
|
+
codeBlockText: { color: '#A1A1AA', fontFamily: 'Menlo', fontSize: 14, lineHeight: 21 },
|
|
35
|
+
tableScroll: { marginVertical: 8, width: '100%' },
|
|
36
|
+
table: {
|
|
37
|
+
backgroundColor: '#0B0B0C',
|
|
38
|
+
borderColor: '#27272A',
|
|
39
|
+
borderRadius: 12,
|
|
40
|
+
borderWidth: 1,
|
|
41
|
+
overflow: 'hidden',
|
|
42
|
+
},
|
|
43
|
+
tableRow: { borderTopColor: '#242429', borderTopWidth: 1, flexDirection: 'row' },
|
|
44
|
+
tableHeaderRow: { backgroundColor: '#151515', borderTopWidth: 0 },
|
|
45
|
+
tableCell: {
|
|
46
|
+
borderLeftColor: '#242429',
|
|
47
|
+
borderLeftWidth: 1,
|
|
48
|
+
paddingHorizontal: 10,
|
|
49
|
+
paddingVertical: 8,
|
|
50
|
+
},
|
|
51
|
+
tableHeaderCell: { borderLeftWidth: 1 },
|
|
52
|
+
tableText: { color: '#E4E4E7', fontSize: 14, lineHeight: 20 },
|
|
53
|
+
tableHeaderText: { color: '#F4F4F5', fontSize: 14, fontWeight: '800', lineHeight: 20 },
|
|
54
|
+
inlineCode: {
|
|
55
|
+
backgroundColor: '#171717',
|
|
56
|
+
borderRadius: 5,
|
|
57
|
+
color: '#A1A1AA',
|
|
58
|
+
fontFamily: 'Menlo',
|
|
59
|
+
fontSize: 15,
|
|
60
|
+
},
|
|
61
|
+
strong: { color: '#FFFFFF', fontWeight: '800' },
|
|
62
|
+
italic: { fontStyle: 'italic' },
|
|
63
|
+
link: { color: '#8AB4F8', textDecorationLine: 'underline' },
|
|
64
|
+
});
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import type { SuperagentMediaAttachment } from './types';
|
|
2
|
+
|
|
3
|
+
export const MAX_ATTACHMENTS = 10;
|
|
4
|
+
export const SUPERAGENT_SUPPORTED_ATTACHMENT_EXTENSIONS = [
|
|
5
|
+
'.jpg',
|
|
6
|
+
'.jpeg',
|
|
7
|
+
'.png',
|
|
8
|
+
'.webp',
|
|
9
|
+
'.pdf',
|
|
10
|
+
'.txt',
|
|
11
|
+
'.html',
|
|
12
|
+
'.csv',
|
|
13
|
+
'.xlsx',
|
|
14
|
+
'.docx',
|
|
15
|
+
'.json',
|
|
16
|
+
'.md',
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
19
|
+
export const SUPERAGENT_ATTACHMENT_SIZE_LIMIT_MB: Record<string, number> = {
|
|
20
|
+
'.jpg': 40,
|
|
21
|
+
'.jpeg': 40,
|
|
22
|
+
'.png': 40,
|
|
23
|
+
'.webp': 40,
|
|
24
|
+
'.pdf': 10,
|
|
25
|
+
'.txt': 5,
|
|
26
|
+
'.html': 5,
|
|
27
|
+
'.csv': 10,
|
|
28
|
+
'.xlsx': 15,
|
|
29
|
+
'.docx': 5,
|
|
30
|
+
'.json': 10,
|
|
31
|
+
'.md': 5,
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export function normalizeMediaAttachments(input: unknown) {
|
|
35
|
+
const attachments = Array.isArray(input) ? input : input ? [input] : [];
|
|
36
|
+
|
|
37
|
+
return attachments.filter(isAttachment).filter((attachment) => isSafeAttachmentUrl(attachment.url));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export function buildAttachmentPrompt(attachments: SuperagentMediaAttachment[]) {
|
|
41
|
+
const images = attachments.filter(isImageAttachment);
|
|
42
|
+
const allImages = images.length === attachments.length;
|
|
43
|
+
|
|
44
|
+
if (allImages && attachments.length === 1) return "What's in this image?";
|
|
45
|
+
if (allImages && attachments.length > 1) return `What's in these ${attachments.length} images?`;
|
|
46
|
+
if (attachments.length === 1) return `Here's a file: ${getAttachmentName(attachments[0])}`;
|
|
47
|
+
return `Here are ${attachments.length} files.`;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export function getAttachmentName(attachment: SuperagentMediaAttachment) {
|
|
51
|
+
if (attachment.name) return attachment.name;
|
|
52
|
+
const cleanUrl = attachment.url.split('?')[0];
|
|
53
|
+
const filename = cleanUrl.split('/').pop();
|
|
54
|
+
if (!filename) return 'file';
|
|
55
|
+
|
|
56
|
+
try {
|
|
57
|
+
return decodeURIComponent(filename);
|
|
58
|
+
} catch {
|
|
59
|
+
return filename;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
export function isImageAttachment(attachment: SuperagentMediaAttachment) {
|
|
64
|
+
if (attachment.kind === 'image') return true;
|
|
65
|
+
if (attachment.mimeType?.startsWith('image/')) return true;
|
|
66
|
+
return /\.(jpg|jpeg|png|gif|webp|bmp)(?:\?|$)/i.test(attachment.url);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function isAttachment(value: unknown): value is SuperagentMediaAttachment {
|
|
70
|
+
return Boolean(value && typeof value === 'object' && typeof (value as { url?: unknown }).url === 'string');
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function isSafeAttachmentUrl(url: string) {
|
|
74
|
+
return /^https?:\/\//i.test(url.trim()) && !url.includes('\0');
|
|
75
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const messageActionStyles = StyleSheet.create({
|
|
4
|
+
bar: {
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
alignSelf: 'flex-start',
|
|
7
|
+
flexDirection: 'row',
|
|
8
|
+
marginTop: 5,
|
|
9
|
+
},
|
|
10
|
+
barUser: { alignSelf: 'flex-end' },
|
|
11
|
+
button: {
|
|
12
|
+
alignItems: 'center',
|
|
13
|
+
backgroundColor: '#0F0F10',
|
|
14
|
+
borderColor: '#252529',
|
|
15
|
+
borderRadius: 15,
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
flexDirection: 'row',
|
|
18
|
+
marginRight: 6,
|
|
19
|
+
minHeight: 30,
|
|
20
|
+
paddingHorizontal: 8,
|
|
21
|
+
},
|
|
22
|
+
buttonDanger: { borderColor: '#3B2222' },
|
|
23
|
+
buttonDisabled: { opacity: 0.45 },
|
|
24
|
+
label: { color: '#A1A1AA', fontSize: 11, fontWeight: '700', marginLeft: 4 },
|
|
25
|
+
labelDanger: { color: '#FCA5A5' },
|
|
26
|
+
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { SuperagentMessage, SuperagentReplyTo, SuperagentToolCall } from './types';
|
|
2
|
+
|
|
3
|
+
export function getMessageFiles(message: SuperagentMessage) {
|
|
4
|
+
return message.fileUrls ?? message.file_urls ?? [];
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export function getMessageToolCalls(message: SuperagentMessage): SuperagentToolCall[] {
|
|
8
|
+
return message.toolCalls ?? message.tool_calls ?? [];
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function getReplyTo(message: SuperagentMessage): SuperagentReplyTo | undefined {
|
|
12
|
+
if (message.replyTo) return message.replyTo;
|
|
13
|
+
|
|
14
|
+
const params = message.additional_message_params;
|
|
15
|
+
const replyTo = params && typeof params === 'object' ? params.reply_to : undefined;
|
|
16
|
+
if (replyTo && typeof replyTo === 'object' && typeof replyTo.content === 'string') {
|
|
17
|
+
return {
|
|
18
|
+
content: replyTo.content,
|
|
19
|
+
messageId: typeof replyTo.message_id === 'string' ? replyTo.message_id : undefined,
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function shouldShowDateSeparator(
|
|
27
|
+
message: SuperagentMessage,
|
|
28
|
+
previousMessage?: SuperagentMessage,
|
|
29
|
+
) {
|
|
30
|
+
const currentLabel = formatDateLabel(message.createdAt);
|
|
31
|
+
if (!currentLabel) return false;
|
|
32
|
+
return currentLabel !== formatDateLabel(previousMessage?.createdAt);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function formatDateLabel(value?: string) {
|
|
36
|
+
if (!value) return '';
|
|
37
|
+
const date = new Date(value);
|
|
38
|
+
if (Number.isNaN(date.getTime())) return '';
|
|
39
|
+
|
|
40
|
+
const today = new Date();
|
|
41
|
+
if (date.toDateString() === today.toDateString()) return 'Today';
|
|
42
|
+
|
|
43
|
+
return date.toLocaleDateString([], {
|
|
44
|
+
day: 'numeric',
|
|
45
|
+
month: 'short',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function getFileName(url: string) {
|
|
50
|
+
const withoutQuery = url.split('?')[0] ?? url;
|
|
51
|
+
const fileName = withoutQuery.split('/').pop() ?? 'File';
|
|
52
|
+
|
|
53
|
+
try {
|
|
54
|
+
return decodeURIComponent(fileName);
|
|
55
|
+
} catch {
|
|
56
|
+
return fileName;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ActionSheetIOS, Platform } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export type NativeActionSheetOption = {
|
|
4
|
+
label: string;
|
|
5
|
+
onPress: () => void;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export function showNativeActionSheet(title: string, actions: NativeActionSheetOption[]) {
|
|
9
|
+
if (Platform.OS !== 'ios' || !ActionSheetIOS?.showActionSheetWithOptions) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
ActionSheetIOS.showActionSheetWithOptions(
|
|
14
|
+
{
|
|
15
|
+
cancelButtonIndex: actions.length,
|
|
16
|
+
options: [...actions.map((action) => action.label), 'Cancel'],
|
|
17
|
+
title,
|
|
18
|
+
},
|
|
19
|
+
(selectedIndex) => {
|
|
20
|
+
actions[selectedIndex]?.onPress();
|
|
21
|
+
},
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ProviderProps } from 'react-native-paper';
|
|
2
|
+
|
|
3
|
+
export const superagentPaperTheme = {
|
|
4
|
+
animation: { scale: 1 },
|
|
5
|
+
dark: true,
|
|
6
|
+
isV3: true,
|
|
7
|
+
mode: 'adaptive',
|
|
8
|
+
roundness: 4,
|
|
9
|
+
version: 3,
|
|
10
|
+
colors: {
|
|
11
|
+
background: '#000000',
|
|
12
|
+
backdrop: 'rgba(0,0,0,0.5)',
|
|
13
|
+
elevation: {
|
|
14
|
+
level0: 'transparent',
|
|
15
|
+
level1: '#111111',
|
|
16
|
+
level2: '#151515',
|
|
17
|
+
level3: '#171717',
|
|
18
|
+
level4: '#1C1C1E',
|
|
19
|
+
level5: '#242427',
|
|
20
|
+
},
|
|
21
|
+
error: '#FCA5A5',
|
|
22
|
+
errorContainer: '#3F1212',
|
|
23
|
+
inverseOnSurface: '#111111',
|
|
24
|
+
inversePrimary: '#111111',
|
|
25
|
+
inverseSurface: '#F4F4F5',
|
|
26
|
+
onBackground: '#F4F4F5',
|
|
27
|
+
onError: '#111111',
|
|
28
|
+
onErrorContainer: '#FCA5A5',
|
|
29
|
+
onPrimary: '#111111',
|
|
30
|
+
onPrimaryContainer: '#F4F4F5',
|
|
31
|
+
onSecondary: '#111111',
|
|
32
|
+
onSecondaryContainer: '#F4F4F5',
|
|
33
|
+
onSurface: '#F4F4F5',
|
|
34
|
+
onSurfaceDisabled: 'rgba(244,244,245,0.38)',
|
|
35
|
+
onSurfaceVariant: '#A1A1AA',
|
|
36
|
+
onTertiary: '#111111',
|
|
37
|
+
onTertiaryContainer: '#F4F4F5',
|
|
38
|
+
outline: '#2A2A2A',
|
|
39
|
+
outlineVariant: '#242427',
|
|
40
|
+
primary: '#F4F4F5',
|
|
41
|
+
primaryContainer: '#242427',
|
|
42
|
+
scrim: 'rgba(0,0,0,0.6)',
|
|
43
|
+
secondary: '#D4D4D8',
|
|
44
|
+
secondaryContainer: '#171717',
|
|
45
|
+
shadow: '#000000',
|
|
46
|
+
surface: '#111111',
|
|
47
|
+
surfaceDisabled: 'rgba(244,244,245,0.12)',
|
|
48
|
+
surfaceVariant: '#171717',
|
|
49
|
+
tertiary: '#FF5A1F',
|
|
50
|
+
tertiaryContainer: '#3A180C',
|
|
51
|
+
},
|
|
52
|
+
} as ProviderProps['theme'];
|