@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,599 @@
|
|
|
1
|
+
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, Pressable, ScrollView, Text, View } from 'react-native';
|
|
3
|
+
import { CheckCircle2, ChevronRight, CircleAlert, Clock, Wrench } from 'lucide-react-native';
|
|
4
|
+
|
|
5
|
+
import { conversationStyles } from './conversationStyles';
|
|
6
|
+
import { ToolApprovalCard } from './ToolApprovalCard';
|
|
7
|
+
import type {
|
|
8
|
+
SuperagentAgent,
|
|
9
|
+
SuperagentConnector,
|
|
10
|
+
SuperagentConnectorActionInput,
|
|
11
|
+
SuperagentConversation,
|
|
12
|
+
SuperagentMessage,
|
|
13
|
+
SuperagentToolCall,
|
|
14
|
+
SuperagentToolRenderers,
|
|
15
|
+
} from './types';
|
|
16
|
+
|
|
17
|
+
const HIDDEN_TOOLS = new Set([
|
|
18
|
+
'browserbase_get_session',
|
|
19
|
+
'browserbase_stop_session',
|
|
20
|
+
'browserbase_get_live_urls',
|
|
21
|
+
'browserbase_reset_context',
|
|
22
|
+
'browserbase_navigate',
|
|
23
|
+
'browserbase_click',
|
|
24
|
+
'browserbase_type',
|
|
25
|
+
'browserbase_get_content',
|
|
26
|
+
'write_file',
|
|
27
|
+
'edit_file',
|
|
28
|
+
'read_file',
|
|
29
|
+
]);
|
|
30
|
+
|
|
31
|
+
const FRIENDLY_TOOL_LABELS: Record<string, { active: string; completed: string }> = {
|
|
32
|
+
anchor_replace: { active: 'Editing code...', completed: 'Edited code' },
|
|
33
|
+
bash: { active: 'Running commands...', completed: 'Ran commands' },
|
|
34
|
+
browserbase_screenshot: { active: 'Taking screenshots...', completed: 'Took screenshots' },
|
|
35
|
+
call_backend_function: { active: 'Calling backend...', completed: 'Called backend' },
|
|
36
|
+
create_automation: { active: 'Creating automation...', completed: 'Created automation' },
|
|
37
|
+
create_scheduled_task: { active: 'Creating task...', completed: 'Created task' },
|
|
38
|
+
delete_entities: { active: 'Deleting data...', completed: 'Deleted data' },
|
|
39
|
+
delete_file: { active: 'Deleting files...', completed: 'Deleted files' },
|
|
40
|
+
deploy_backend_functions: { active: 'Deploying backend...', completed: 'Deployed backend' },
|
|
41
|
+
fetch_website: { active: 'Reading websites...', completed: 'Read websites' },
|
|
42
|
+
find_replace: { active: 'Editing code...', completed: 'Edited code' },
|
|
43
|
+
get_connectors_info: { active: 'Checking connectors...', completed: 'Checked connectors' },
|
|
44
|
+
get_runtime_logs: { active: 'Reading logs...', completed: 'Read logs' },
|
|
45
|
+
grep: { active: 'Searching files...', completed: 'Searched files' },
|
|
46
|
+
install_npm_package: { active: 'Installing packages...', completed: 'Installed packages' },
|
|
47
|
+
list_automations: { active: 'Listing automations...', completed: 'Listed automations' },
|
|
48
|
+
list_files: { active: 'Browsing files...', completed: 'Browsed files' },
|
|
49
|
+
list_scheduled_tasks: { active: 'Listing tasks...', completed: 'Listed tasks' },
|
|
50
|
+
manage_app: { active: 'Publishing pages...', completed: 'Published pages' },
|
|
51
|
+
request_oauth_authorization: { active: 'Requesting connector access...', completed: 'Requested connector access' },
|
|
52
|
+
request_secrets: { active: 'Requesting secrets...', completed: 'Requested secrets' },
|
|
53
|
+
run_skill: { active: 'Running a skill...', completed: 'Ran a skill' },
|
|
54
|
+
search_base44_docs: { active: 'Checking docs...', completed: 'Checked docs' },
|
|
55
|
+
search_web: { active: 'Searching the web...', completed: 'Searched the web' },
|
|
56
|
+
send_message_to_user: { active: 'Sending message...', completed: 'Sent message' },
|
|
57
|
+
set_app_user_connector: { active: 'Requesting connector credentials...', completed: 'Requested connector credentials' },
|
|
58
|
+
set_secrets: { active: 'Setting a secret...', completed: 'Set a secret' },
|
|
59
|
+
setup_slack_connection: { active: 'Connecting Slack...', completed: 'Connected Slack' },
|
|
60
|
+
setup_telegram_connection: { active: 'Connecting Telegram...', completed: 'Connected Telegram' },
|
|
61
|
+
suggest_payments_installation: { active: 'Setting up payments...', completed: 'Requested payment setup' },
|
|
62
|
+
suggest_stripe_installation: { active: 'Setting up Stripe...', completed: 'Requested Stripe setup' },
|
|
63
|
+
str_replace_based_edit_tool: { active: 'Editing code...', completed: 'Edited code' },
|
|
64
|
+
test_backend_function: { active: 'Testing backend...', completed: 'Tested backend' },
|
|
65
|
+
toggle_scheduled_task: { active: 'Toggling task...', completed: 'Toggled task' },
|
|
66
|
+
update_entities: { active: 'Updating data...', completed: 'Updated data' },
|
|
67
|
+
update_identity: { active: 'Updating memory...', completed: 'Updated memory' },
|
|
68
|
+
update_scheduled_task: { active: 'Updating task...', completed: 'Updated task' },
|
|
69
|
+
web_search: { active: 'Searching the web...', completed: 'Searched the web' },
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
type SubmitToolCallInput = (
|
|
73
|
+
toolCallId: string,
|
|
74
|
+
approve: boolean,
|
|
75
|
+
extraUserInput?: unknown,
|
|
76
|
+
originRequestId?: string,
|
|
77
|
+
) => Promise<SuperagentConversation | null>;
|
|
78
|
+
|
|
79
|
+
export function ToolCallSummary({
|
|
80
|
+
agent,
|
|
81
|
+
availableConnectors,
|
|
82
|
+
conversationId,
|
|
83
|
+
isLastAssistantMessage,
|
|
84
|
+
message,
|
|
85
|
+
onConnectConnector,
|
|
86
|
+
submitToolCallInput,
|
|
87
|
+
toolCalls,
|
|
88
|
+
toolRenderers,
|
|
89
|
+
}: {
|
|
90
|
+
agent: SuperagentAgent;
|
|
91
|
+
availableConnectors?: SuperagentConnector[];
|
|
92
|
+
conversationId: string | null;
|
|
93
|
+
isLastAssistantMessage: boolean;
|
|
94
|
+
message: SuperagentMessage;
|
|
95
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
96
|
+
submitToolCallInput?: SubmitToolCallInput;
|
|
97
|
+
toolCalls: SuperagentToolCall[];
|
|
98
|
+
toolRenderers?: SuperagentToolRenderers;
|
|
99
|
+
}) {
|
|
100
|
+
const chunks = useMemo(() => createToolChunks(toolCalls, toolRenderers), [toolCalls, toolRenderers]);
|
|
101
|
+
|
|
102
|
+
if (chunks.length === 0) return null;
|
|
103
|
+
|
|
104
|
+
return (
|
|
105
|
+
<View style={conversationStyles.toolCallWrap}>
|
|
106
|
+
{chunks.map((chunk) => {
|
|
107
|
+
if (chunk.type === 'timeline') {
|
|
108
|
+
return (
|
|
109
|
+
<DefaultToolTimeline
|
|
110
|
+
agent={agent}
|
|
111
|
+
availableConnectors={availableConnectors}
|
|
112
|
+
isLastAssistantMessage={isLastAssistantMessage}
|
|
113
|
+
key={chunk.key}
|
|
114
|
+
onConnectConnector={onConnectConnector}
|
|
115
|
+
submitToolCallInput={submitToolCallInput}
|
|
116
|
+
toolCalls={chunk.toolCalls}
|
|
117
|
+
/>
|
|
118
|
+
);
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
const Renderer = chunk.Renderer;
|
|
122
|
+
return (
|
|
123
|
+
<View key={chunk.key} style={conversationStyles.toolCallSlot}>
|
|
124
|
+
<View style={conversationStyles.customToolWidget}>
|
|
125
|
+
<Renderer
|
|
126
|
+
agent={agent}
|
|
127
|
+
conversationId={conversationId}
|
|
128
|
+
message={message}
|
|
129
|
+
submitToolCallInput={submitToolCallInput}
|
|
130
|
+
toolCall={chunk.toolCall}
|
|
131
|
+
/>
|
|
132
|
+
</View>
|
|
133
|
+
</View>
|
|
134
|
+
);
|
|
135
|
+
})}
|
|
136
|
+
</View>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function DefaultToolTimeline({
|
|
141
|
+
agent,
|
|
142
|
+
availableConnectors,
|
|
143
|
+
isLastAssistantMessage,
|
|
144
|
+
onConnectConnector,
|
|
145
|
+
submitToolCallInput,
|
|
146
|
+
toolCalls,
|
|
147
|
+
}: {
|
|
148
|
+
agent: SuperagentAgent;
|
|
149
|
+
availableConnectors?: SuperagentConnector[];
|
|
150
|
+
isLastAssistantMessage: boolean;
|
|
151
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
152
|
+
submitToolCallInput?: SubmitToolCallInput;
|
|
153
|
+
toolCalls: SuperagentToolCall[];
|
|
154
|
+
}) {
|
|
155
|
+
const visibleToolCalls = useMemo(
|
|
156
|
+
() => toolCalls.flatMap(flattenToolCall).filter((toolCall) => !HIDDEN_TOOLS.has(toolCall.name || '')),
|
|
157
|
+
[toolCalls],
|
|
158
|
+
);
|
|
159
|
+
const hasWaitingTool = visibleToolCalls.some(isApprovalRequest);
|
|
160
|
+
const isRunning = visibleToolCalls.some(isRunningStatus);
|
|
161
|
+
const [expanded, setExpanded] = useState(hasWaitingTool);
|
|
162
|
+
const [openRows, setOpenRows] = useState<Record<string, boolean>>({});
|
|
163
|
+
|
|
164
|
+
useEffect(() => {
|
|
165
|
+
if (hasWaitingTool) setExpanded(true);
|
|
166
|
+
}, [hasWaitingTool]);
|
|
167
|
+
|
|
168
|
+
if (visibleToolCalls.length === 0) return null;
|
|
169
|
+
|
|
170
|
+
const label = getCollapsedLabel(visibleToolCalls, isRunning);
|
|
171
|
+
|
|
172
|
+
if (isRunning) {
|
|
173
|
+
return (
|
|
174
|
+
<View style={conversationStyles.toolCallSlot}>
|
|
175
|
+
<RunningToolIndicator label={label} />
|
|
176
|
+
</View>
|
|
177
|
+
);
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
return (
|
|
181
|
+
<View style={conversationStyles.toolCallSlot}>
|
|
182
|
+
<Pressable
|
|
183
|
+
accessibilityRole="button"
|
|
184
|
+
onPress={() => setExpanded((current) => !current)}
|
|
185
|
+
style={conversationStyles.toolTimelineHeader}
|
|
186
|
+
>
|
|
187
|
+
<Text style={conversationStyles.toolTimelineHeaderText}>{label}</Text>
|
|
188
|
+
<ChevronRight
|
|
189
|
+
color="#8E8E93"
|
|
190
|
+
size={15}
|
|
191
|
+
strokeWidth={2.3}
|
|
192
|
+
style={expanded ? conversationStyles.toolTimelineChevronOpen : conversationStyles.toolTimelineChevron}
|
|
193
|
+
/>
|
|
194
|
+
</Pressable>
|
|
195
|
+
|
|
196
|
+
{expanded ? (
|
|
197
|
+
<View style={conversationStyles.toolTimelineRows}>
|
|
198
|
+
{visibleToolCalls.map((toolCall, index) => {
|
|
199
|
+
const rowKey = getToolCallKey(toolCall, index);
|
|
200
|
+
const isOpen = Boolean(openRows[rowKey]);
|
|
201
|
+
return (
|
|
202
|
+
<ToolTimelineRow
|
|
203
|
+
agent={agent}
|
|
204
|
+
availableConnectors={availableConnectors}
|
|
205
|
+
isLastAssistantMessage={isLastAssistantMessage}
|
|
206
|
+
isLast={index === visibleToolCalls.length - 1}
|
|
207
|
+
isOpen={isOpen}
|
|
208
|
+
key={rowKey}
|
|
209
|
+
onToggle={() => setOpenRows((current) => ({ ...current, [rowKey]: !current[rowKey] }))}
|
|
210
|
+
onConnectConnector={onConnectConnector}
|
|
211
|
+
submitToolCallInput={submitToolCallInput}
|
|
212
|
+
toolCall={toolCall}
|
|
213
|
+
/>
|
|
214
|
+
);
|
|
215
|
+
})}
|
|
216
|
+
{!hasWaitingTool ? <DoneRow /> : null}
|
|
217
|
+
</View>
|
|
218
|
+
) : null}
|
|
219
|
+
</View>
|
|
220
|
+
);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
function ToolTimelineRow({
|
|
224
|
+
agent,
|
|
225
|
+
availableConnectors,
|
|
226
|
+
isLastAssistantMessage,
|
|
227
|
+
isLast,
|
|
228
|
+
isOpen,
|
|
229
|
+
onConnectConnector,
|
|
230
|
+
onToggle,
|
|
231
|
+
submitToolCallInput,
|
|
232
|
+
toolCall,
|
|
233
|
+
}: {
|
|
234
|
+
agent: SuperagentAgent;
|
|
235
|
+
availableConnectors?: SuperagentConnector[];
|
|
236
|
+
isLastAssistantMessage: boolean;
|
|
237
|
+
isLast: boolean;
|
|
238
|
+
isOpen: boolean;
|
|
239
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
240
|
+
onToggle: () => void;
|
|
241
|
+
submitToolCallInput?: SubmitToolCallInput;
|
|
242
|
+
toolCall: SuperagentToolCall;
|
|
243
|
+
}) {
|
|
244
|
+
const preview = getToolPreview(toolCall);
|
|
245
|
+
const detail = getToolDetail(toolCall);
|
|
246
|
+
const showsApproval = isApprovalRequest(toolCall);
|
|
247
|
+
const canOpen = Boolean(detail) && !showsApproval;
|
|
248
|
+
|
|
249
|
+
return (
|
|
250
|
+
<View style={conversationStyles.toolTimelineItem}>
|
|
251
|
+
<View style={conversationStyles.toolTimelineRow}>
|
|
252
|
+
<View style={conversationStyles.toolTimelineIconCol}>
|
|
253
|
+
<ToolStatusIcon status={toolCall.status} />
|
|
254
|
+
{!isLast ? <View style={conversationStyles.toolTimelineLine} /> : null}
|
|
255
|
+
</View>
|
|
256
|
+
<View style={conversationStyles.toolTimelineMeta}>
|
|
257
|
+
<Pressable
|
|
258
|
+
accessibilityRole={canOpen ? 'button' : undefined}
|
|
259
|
+
disabled={!canOpen}
|
|
260
|
+
onPress={onToggle}
|
|
261
|
+
style={conversationStyles.toolTimelineRowHeader}
|
|
262
|
+
>
|
|
263
|
+
<ChevronRight
|
|
264
|
+
color="#A1A1AA"
|
|
265
|
+
size={15}
|
|
266
|
+
strokeWidth={2.3}
|
|
267
|
+
style={isOpen ? conversationStyles.toolTimelineChevronOpen : conversationStyles.toolTimelineChevron}
|
|
268
|
+
/>
|
|
269
|
+
<Text style={conversationStyles.toolTimelineTitle} numberOfLines={1}>{getToolTitle(toolCall)}</Text>
|
|
270
|
+
{preview ? <Text style={conversationStyles.toolTimelineInline} numberOfLines={1}>{preview}</Text> : null}
|
|
271
|
+
</Pressable>
|
|
272
|
+
{shouldShowStatusLine(toolCall, preview) ? (
|
|
273
|
+
<Text style={conversationStyles.toolTimelineStatus} numberOfLines={1}>{formatStatus(toolCall.status || 'done')}</Text>
|
|
274
|
+
) : null}
|
|
275
|
+
</View>
|
|
276
|
+
</View>
|
|
277
|
+
|
|
278
|
+
<View style={conversationStyles.toolTimelineDetailsSlot}>
|
|
279
|
+
{showsApproval ? (
|
|
280
|
+
<ToolApprovalCard
|
|
281
|
+
agent={agent}
|
|
282
|
+
availableConnectors={availableConnectors}
|
|
283
|
+
isLastAssistantMessage={isLastAssistantMessage}
|
|
284
|
+
onConnectConnector={onConnectConnector}
|
|
285
|
+
submitToolCallInput={submitToolCallInput}
|
|
286
|
+
toolCall={toolCall}
|
|
287
|
+
/>
|
|
288
|
+
) : null}
|
|
289
|
+
{!showsApproval && isOpen && detail ? <ToolDetailBox detail={detail} /> : null}
|
|
290
|
+
</View>
|
|
291
|
+
</View>
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
function ToolDetailBox({ detail }: { detail: string }) {
|
|
296
|
+
return (
|
|
297
|
+
<View style={conversationStyles.toolTimelineDetails}>
|
|
298
|
+
<ScrollView
|
|
299
|
+
nestedScrollEnabled
|
|
300
|
+
showsVerticalScrollIndicator
|
|
301
|
+
style={conversationStyles.toolTimelineDetailVerticalScroll}
|
|
302
|
+
>
|
|
303
|
+
<ScrollView
|
|
304
|
+
horizontal
|
|
305
|
+
nestedScrollEnabled
|
|
306
|
+
showsHorizontalScrollIndicator
|
|
307
|
+
contentContainerStyle={conversationStyles.toolTimelineDetailScrollContent}
|
|
308
|
+
style={conversationStyles.toolTimelineDetailHorizontalScroll}
|
|
309
|
+
>
|
|
310
|
+
<Text style={conversationStyles.toolTimelineDetailText}>{detail}</Text>
|
|
311
|
+
</ScrollView>
|
|
312
|
+
</ScrollView>
|
|
313
|
+
</View>
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
function DoneRow() {
|
|
318
|
+
return (
|
|
319
|
+
<View style={conversationStyles.toolDoneRow}>
|
|
320
|
+
<View style={conversationStyles.toolTimelineIconCol}>
|
|
321
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
322
|
+
<CheckCircle2 color="#E4E4E7" size={17} strokeWidth={2.3} />
|
|
323
|
+
</View>
|
|
324
|
+
</View>
|
|
325
|
+
<Text style={conversationStyles.toolDoneText}>Done</Text>
|
|
326
|
+
</View>
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function RunningToolIndicator({ label }: { label: string }) {
|
|
331
|
+
return (
|
|
332
|
+
<View style={conversationStyles.toolRunningWrap}>
|
|
333
|
+
<View style={conversationStyles.toolRunningDots}>
|
|
334
|
+
<View style={conversationStyles.toolRunningDot} />
|
|
335
|
+
<View style={conversationStyles.toolRunningDot} />
|
|
336
|
+
<View style={conversationStyles.toolRunningDot} />
|
|
337
|
+
</View>
|
|
338
|
+
<Text style={conversationStyles.toolRunningText}>{label}</Text>
|
|
339
|
+
</View>
|
|
340
|
+
);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
function ToolStatusIcon({ status }: { status?: string }) {
|
|
344
|
+
if (isRunningStatus({ status })) {
|
|
345
|
+
return (
|
|
346
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
347
|
+
<ActivityIndicator color="#C9CAF8" size="small" />
|
|
348
|
+
</View>
|
|
349
|
+
);
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
if (isErrorStatus({ status })) {
|
|
353
|
+
return (
|
|
354
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
355
|
+
<CircleAlert color="#FCA5A5" size={17} strokeWidth={2.3} />
|
|
356
|
+
</View>
|
|
357
|
+
);
|
|
358
|
+
}
|
|
359
|
+
|
|
360
|
+
if (isWaitingStatus({ status })) {
|
|
361
|
+
return (
|
|
362
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
363
|
+
<Clock color="#FDE047" size={17} strokeWidth={2.3} />
|
|
364
|
+
</View>
|
|
365
|
+
);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (isSuccessStatus({ status })) {
|
|
369
|
+
return (
|
|
370
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
371
|
+
<CheckCircle2 color="#86EFAC" size={17} strokeWidth={2.3} />
|
|
372
|
+
</View>
|
|
373
|
+
);
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
return (
|
|
377
|
+
<View style={conversationStyles.toolCallIcon}>
|
|
378
|
+
<Wrench color="#A1A1AA" size={17} strokeWidth={2.3} />
|
|
379
|
+
</View>
|
|
380
|
+
);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
function createToolChunks(toolCalls: SuperagentToolCall[], toolRenderers?: SuperagentToolRenderers) {
|
|
384
|
+
const chunks: Array<
|
|
385
|
+
| { key: string; toolCalls: SuperagentToolCall[]; type: 'timeline' }
|
|
386
|
+
| { key: string; Renderer: NonNullable<SuperagentToolRenderers>[string]; toolCall: SuperagentToolCall; type: 'custom' }
|
|
387
|
+
> = [];
|
|
388
|
+
let timelineBuffer: SuperagentToolCall[] = [];
|
|
389
|
+
let timelineIndex = 0;
|
|
390
|
+
|
|
391
|
+
const flushTimeline = () => {
|
|
392
|
+
if (timelineBuffer.length === 0) return;
|
|
393
|
+
chunks.push({
|
|
394
|
+
key: `timeline-${timelineIndex}`,
|
|
395
|
+
toolCalls: timelineBuffer,
|
|
396
|
+
type: 'timeline',
|
|
397
|
+
});
|
|
398
|
+
timelineIndex += 1;
|
|
399
|
+
timelineBuffer = [];
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
toolCalls.forEach((toolCall, index) => {
|
|
403
|
+
const Renderer = toolRenderers?.[toolCall.name];
|
|
404
|
+
if (!Renderer) {
|
|
405
|
+
timelineBuffer.push(toolCall);
|
|
406
|
+
return;
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
flushTimeline();
|
|
410
|
+
chunks.push({
|
|
411
|
+
key: toolCall.id ?? `${toolCall.name}-${index}`,
|
|
412
|
+
Renderer,
|
|
413
|
+
toolCall,
|
|
414
|
+
type: 'custom',
|
|
415
|
+
});
|
|
416
|
+
});
|
|
417
|
+
|
|
418
|
+
flushTimeline();
|
|
419
|
+
return chunks;
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
function flattenToolCall(toolCall: SuperagentToolCall): SuperagentToolCall[] {
|
|
423
|
+
if (toolCall.grouped && Array.isArray(toolCall.toolCalls)) return toolCall.toolCalls;
|
|
424
|
+
return [toolCall];
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
function getCollapsedLabel(toolCalls: SuperagentToolCall[], isRunning: boolean) {
|
|
428
|
+
if (toolCalls.some(isApprovalRequest)) return 'Waiting for input';
|
|
429
|
+
|
|
430
|
+
const firstName = toolCalls[0]?.name || '';
|
|
431
|
+
if (toolCalls.length > 0 && toolCalls.every((toolCall) => toolCall.name === firstName)) {
|
|
432
|
+
if (firstName === 'bash') {
|
|
433
|
+
if (isRunning) return 'Running commands...';
|
|
434
|
+
return toolCalls.length === 1 ? 'Ran a command' : `Ran ${toolCalls.length} commands`;
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
const label = FRIENDLY_TOOL_LABELS[firstName];
|
|
438
|
+
if (label) {
|
|
439
|
+
const base = isRunning ? label.active : label.completed;
|
|
440
|
+
return !isRunning && toolCalls.length > 1 ? `${base} (${toolCalls.length})` : base;
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (isRunning) return 'Working...';
|
|
445
|
+
return `${toolCalls.length} ${toolCalls.length === 1 ? 'action' : 'actions'}`;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
function getToolTitle(toolCall: SuperagentToolCall) {
|
|
449
|
+
const label = FRIENDLY_TOOL_LABELS[toolCall.name || ''];
|
|
450
|
+
if (label) return isRunningStatus(toolCall) ? label.active.replace(/\.\.\.$/, '') : label.completed;
|
|
451
|
+
return formatToolName(toolCall.name || 'Tool');
|
|
452
|
+
}
|
|
453
|
+
|
|
454
|
+
function getToolPreview(toolCall: SuperagentToolCall) {
|
|
455
|
+
const args = getToolArgs(toolCall);
|
|
456
|
+
const rawArgs = getRawArgs(toolCall);
|
|
457
|
+
|
|
458
|
+
if (toolCall.name === 'bash') {
|
|
459
|
+
const command = getStringArg(args, ['command', 'cmd', 'script']) || (typeof rawArgs === 'string' ? rawArgs : '');
|
|
460
|
+
return command ? truncateSingleLine(command, 48) : null;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
if (toolCall.name === 'grep') {
|
|
464
|
+
const pattern = getStringArg(args, ['pattern', 'query']);
|
|
465
|
+
const path = getStringArg(args, ['path', 'include']);
|
|
466
|
+
return truncateSingleLine([pattern, path].filter(Boolean).join(' in '), 48);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
if (toolCall.name === 'search_web' || toolCall.name === 'web_search') {
|
|
470
|
+
return truncateSingleLine(getStringArg(args, ['query', 'q']) || '', 48);
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
if (toolCall.name === 'request_oauth_authorization') {
|
|
474
|
+
return 'waiting for user input / approval';
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
if (toolCall.name === 'get_connectors_info') {
|
|
478
|
+
return getResultPreview(toolCall.results);
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
return getStringArg(args, ['name', 'title', 'path', 'filename', 'integration_type', 'connector_id']) || null;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function getToolDetail(toolCall: SuperagentToolCall) {
|
|
485
|
+
const sections: string[] = [];
|
|
486
|
+
const args = getRawArgs(toolCall);
|
|
487
|
+
const results = toolCall.results;
|
|
488
|
+
|
|
489
|
+
if (args) sections.push(`Input:\n${formatValue(args)}`);
|
|
490
|
+
if (results) sections.push(`Output:\n${formatValue(results)}`);
|
|
491
|
+
|
|
492
|
+
return sections.length > 0 ? sections.join('\n\n') : null;
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function getRawArgs(toolCall: SuperagentToolCall) {
|
|
496
|
+
return toolCall.arguments_string ?? toolCall.arguments ?? null;
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
function getToolArgs(toolCall: SuperagentToolCall): Record<string, unknown> | string | null {
|
|
500
|
+
const raw = getRawArgs(toolCall);
|
|
501
|
+
if (!raw) return null;
|
|
502
|
+
if (typeof raw !== 'string') return raw as Record<string, unknown>;
|
|
503
|
+
|
|
504
|
+
try {
|
|
505
|
+
const parsed = JSON.parse(raw);
|
|
506
|
+
return parsed && typeof parsed === 'object' ? parsed as Record<string, unknown> : raw;
|
|
507
|
+
} catch {
|
|
508
|
+
return raw;
|
|
509
|
+
}
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
function getStringArg(args: Record<string, unknown> | string | null, keys: string[]) {
|
|
513
|
+
if (!args || typeof args === 'string') return '';
|
|
514
|
+
for (const key of keys) {
|
|
515
|
+
const value = args[key];
|
|
516
|
+
if (typeof value === 'string' && value.trim()) return value.trim();
|
|
517
|
+
}
|
|
518
|
+
return '';
|
|
519
|
+
}
|
|
520
|
+
|
|
521
|
+
function getResultPreview(result: unknown) {
|
|
522
|
+
if (!result) return null;
|
|
523
|
+
const value = typeof result === 'string' ? result : formatValue(result);
|
|
524
|
+
const firstLine = value.split('\n').find((line) => line.trim());
|
|
525
|
+
return firstLine ? truncateSingleLine(firstLine, 52) : null;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
function shouldShowStatusLine(toolCall: SuperagentToolCall, preview: string | null) {
|
|
529
|
+
if (!toolCall.status) return false;
|
|
530
|
+
if (toolCall.name === 'bash' || toolCall.name === 'grep') return false;
|
|
531
|
+
return !preview || isWaitingStatus(toolCall) || isErrorStatus(toolCall);
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
function isRunningStatus(toolCall: Pick<SuperagentToolCall, 'status'>) {
|
|
535
|
+
const normalized = normalizeStatus(toolCall.status);
|
|
536
|
+
return normalized === 'running' || normalized === 'pending';
|
|
537
|
+
}
|
|
538
|
+
|
|
539
|
+
function isWaitingStatus(toolCall: Pick<SuperagentToolCall, 'status'>) {
|
|
540
|
+
return normalizeStatus(toolCall.status).includes('waiting');
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
function isApprovalRequest(toolCall: SuperagentToolCall) {
|
|
544
|
+
if (isWaitingStatus(toolCall)) return true;
|
|
545
|
+
|
|
546
|
+
const resultPreview = getResultPreview(toolCall.results);
|
|
547
|
+
return Boolean(resultPreview?.toLowerCase().includes('waiting for user input'));
|
|
548
|
+
}
|
|
549
|
+
|
|
550
|
+
function isErrorStatus(toolCall: Pick<SuperagentToolCall, 'status'>) {
|
|
551
|
+
const normalized = normalizeStatus(toolCall.status);
|
|
552
|
+
return normalized.includes('error') || normalized.includes('failed') || normalized.includes('rejected');
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
function isSuccessStatus(toolCall: Pick<SuperagentToolCall, 'status'>) {
|
|
556
|
+
const normalized = normalizeStatus(toolCall.status);
|
|
557
|
+
return normalized.includes('success') || normalized.includes('complete');
|
|
558
|
+
}
|
|
559
|
+
|
|
560
|
+
function normalizeStatus(status?: string) {
|
|
561
|
+
return (status || '').toLowerCase();
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
function formatToolName(name: string) {
|
|
565
|
+
return name
|
|
566
|
+
.split('_')
|
|
567
|
+
.filter(Boolean)
|
|
568
|
+
.map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))
|
|
569
|
+
.join(' ');
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
function formatStatus(status: string) {
|
|
573
|
+
return status
|
|
574
|
+
.split('_')
|
|
575
|
+
.filter(Boolean)
|
|
576
|
+
.map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))
|
|
577
|
+
.join(' ');
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
function formatValue(value: unknown) {
|
|
581
|
+
if (typeof value === 'string') return value.length > 900 ? `${value.slice(0, 900)}...` : value;
|
|
582
|
+
|
|
583
|
+
try {
|
|
584
|
+
const stringified = JSON.stringify(value, null, 2);
|
|
585
|
+
return stringified.length > 900 ? `${stringified.slice(0, 900)}...` : stringified;
|
|
586
|
+
} catch {
|
|
587
|
+
return String(value);
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
function truncateSingleLine(value: string, maxLength: number) {
|
|
592
|
+
const singleLine = value.replace(/\s+/g, ' ').trim();
|
|
593
|
+
if (!singleLine) return null;
|
|
594
|
+
return singleLine.length > maxLength ? `${singleLine.slice(0, maxLength - 3)}...` : singleLine;
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
function getToolCallKey(toolCall: SuperagentToolCall, index: number) {
|
|
598
|
+
return toolCall.id ?? `${toolCall.name || 'tool'}-${index}`;
|
|
599
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const agentSphereStyles = StyleSheet.create({
|
|
4
|
+
frame: {
|
|
5
|
+
alignItems: 'center',
|
|
6
|
+
justifyContent: 'center',
|
|
7
|
+
overflow: 'hidden',
|
|
8
|
+
position: 'relative',
|
|
9
|
+
},
|
|
10
|
+
builtInFrame: {
|
|
11
|
+
backgroundColor: '#0A0A0F',
|
|
12
|
+
},
|
|
13
|
+
userFrame: {
|
|
14
|
+
backgroundColor: '#242427',
|
|
15
|
+
borderColor: '#38383D',
|
|
16
|
+
borderWidth: 1,
|
|
17
|
+
},
|
|
18
|
+
emojiFrame: {
|
|
19
|
+
backgroundColor: '#151515',
|
|
20
|
+
borderColor: '#2A2A2A',
|
|
21
|
+
borderWidth: 1,
|
|
22
|
+
},
|
|
23
|
+
image: { height: '100%', width: '100%' },
|
|
24
|
+
emoji: { color: '#FFFFFF', fontWeight: '800', textAlign: 'center' },
|
|
25
|
+
});
|