@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,705 @@
|
|
|
1
|
+
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { ActivityIndicator, Pressable, StyleSheet, Text, TextInput, View } from 'react-native';
|
|
3
|
+
import {
|
|
4
|
+
CheckCircle2,
|
|
5
|
+
Copy,
|
|
6
|
+
ExternalLink,
|
|
7
|
+
MessageCircle,
|
|
8
|
+
MessageSquare,
|
|
9
|
+
RefreshCw,
|
|
10
|
+
Send,
|
|
11
|
+
Unplug,
|
|
12
|
+
} from 'lucide-react-native';
|
|
13
|
+
|
|
14
|
+
import { editorShellStyles } from './editorShellStyles';
|
|
15
|
+
import { styles } from './styles';
|
|
16
|
+
import type {
|
|
17
|
+
SuperagentAgent,
|
|
18
|
+
SuperagentChannelId,
|
|
19
|
+
SuperagentChannelStatus,
|
|
20
|
+
SuperagentHomeScreenProps,
|
|
21
|
+
} from './types';
|
|
22
|
+
|
|
23
|
+
const TELEGRAM_TOKEN_PATTERN = /^\d{5,15}:[A-Za-z0-9_-]{35,50}$/;
|
|
24
|
+
const TELEGRAM_TOKEN_SEARCH = /\d{5,15}:[A-Za-z0-9_-]{35,50}/;
|
|
25
|
+
|
|
26
|
+
export function ChannelsPanel({
|
|
27
|
+
agent,
|
|
28
|
+
channelStatus,
|
|
29
|
+
connectingChannelId,
|
|
30
|
+
isLoading,
|
|
31
|
+
onDisconnectTelegram,
|
|
32
|
+
onDisconnectIMessage,
|
|
33
|
+
onGenerateIMessageCode,
|
|
34
|
+
onGenerateLineCode,
|
|
35
|
+
onOpenIMessage,
|
|
36
|
+
onOpenLine,
|
|
37
|
+
onOpenTelegram,
|
|
38
|
+
onOpenWhatsApp,
|
|
39
|
+
onRefreshChannels,
|
|
40
|
+
onSetupTelegram,
|
|
41
|
+
onShareIMessageCode,
|
|
42
|
+
onShareLineCode,
|
|
43
|
+
}: {
|
|
44
|
+
agent: SuperagentAgent;
|
|
45
|
+
channelStatus?: SuperagentChannelStatus;
|
|
46
|
+
connectingChannelId?: SuperagentChannelId | null;
|
|
47
|
+
isLoading?: boolean;
|
|
48
|
+
onDisconnectTelegram?: SuperagentHomeScreenProps['onDisconnectTelegram'];
|
|
49
|
+
onDisconnectIMessage?: SuperagentHomeScreenProps['onDisconnectIMessage'];
|
|
50
|
+
onGenerateIMessageCode?: SuperagentHomeScreenProps['onGenerateIMessageCode'];
|
|
51
|
+
onGenerateLineCode?: SuperagentHomeScreenProps['onGenerateLineCode'];
|
|
52
|
+
onOpenIMessage?: SuperagentHomeScreenProps['onOpenIMessage'];
|
|
53
|
+
onOpenLine?: SuperagentHomeScreenProps['onOpenLine'];
|
|
54
|
+
onOpenTelegram?: SuperagentHomeScreenProps['onOpenTelegram'];
|
|
55
|
+
onOpenWhatsApp?: SuperagentHomeScreenProps['onOpenWhatsApp'];
|
|
56
|
+
onRefreshChannels?: SuperagentHomeScreenProps['onRefreshChannels'];
|
|
57
|
+
onSetupTelegram?: SuperagentHomeScreenProps['onSetupTelegram'];
|
|
58
|
+
onShareIMessageCode?: SuperagentHomeScreenProps['onShareIMessageCode'];
|
|
59
|
+
onShareLineCode?: SuperagentHomeScreenProps['onShareLineCode'];
|
|
60
|
+
}) {
|
|
61
|
+
const imessage = channelStatus?.imessage;
|
|
62
|
+
const telegram = channelStatus?.telegram;
|
|
63
|
+
const line = channelStatus?.line;
|
|
64
|
+
const whatsapp = channelStatus?.whatsapp;
|
|
65
|
+
const supportedCount = 4;
|
|
66
|
+
|
|
67
|
+
return (
|
|
68
|
+
<View style={editorShellStyles.settingsStack}>
|
|
69
|
+
<View style={editorShellStyles.panel}>
|
|
70
|
+
<View style={editorShellStyles.panelHeader}>
|
|
71
|
+
<View>
|
|
72
|
+
<Text style={editorShellStyles.panelTitle}>Channels</Text>
|
|
73
|
+
<Text style={editorShellStyles.panelSubtitle}>Messaging surfaces this agent can use.</Text>
|
|
74
|
+
</View>
|
|
75
|
+
<View style={channelStyles.headerActions}>
|
|
76
|
+
{isLoading ? <ActivityIndicator color="#FF5A1F" size="small" /> : null}
|
|
77
|
+
{onRefreshChannels ? (
|
|
78
|
+
<Pressable
|
|
79
|
+
accessibilityLabel="Refresh channels"
|
|
80
|
+
accessibilityRole="button"
|
|
81
|
+
disabled={isLoading}
|
|
82
|
+
onPress={() => onRefreshChannels(agent.id)}
|
|
83
|
+
style={({ pressed }) => [
|
|
84
|
+
channelStyles.iconButton,
|
|
85
|
+
isLoading && channelStyles.disabled,
|
|
86
|
+
pressed && styles.pressed,
|
|
87
|
+
]}
|
|
88
|
+
>
|
|
89
|
+
<RefreshCw color="#F4F4F5" size={17} strokeWidth={2.4} />
|
|
90
|
+
</Pressable>
|
|
91
|
+
) : null}
|
|
92
|
+
<Text style={editorShellStyles.countBadge}>{supportedCount}</Text>
|
|
93
|
+
</View>
|
|
94
|
+
</View>
|
|
95
|
+
|
|
96
|
+
<View style={channelStyles.stack}>
|
|
97
|
+
<WhatsAppChannel
|
|
98
|
+
agentId={agent.id}
|
|
99
|
+
isBusy={connectingChannelId === 'whatsapp'}
|
|
100
|
+
isReady={!!whatsapp?.connectUrl}
|
|
101
|
+
onOpenWhatsApp={onOpenWhatsApp}
|
|
102
|
+
/>
|
|
103
|
+
<IMessageChannel
|
|
104
|
+
agentId={agent.id}
|
|
105
|
+
imessage={imessage}
|
|
106
|
+
isBusy={connectingChannelId === 'imessage'}
|
|
107
|
+
onDisconnectIMessage={onDisconnectIMessage}
|
|
108
|
+
onGenerateIMessageCode={onGenerateIMessageCode}
|
|
109
|
+
onOpenIMessage={onOpenIMessage}
|
|
110
|
+
onShareIMessageCode={onShareIMessageCode}
|
|
111
|
+
/>
|
|
112
|
+
<TelegramChannel
|
|
113
|
+
agentId={agent.id}
|
|
114
|
+
isBusy={connectingChannelId === 'telegram'}
|
|
115
|
+
onDisconnectTelegram={onDisconnectTelegram}
|
|
116
|
+
onOpenTelegram={onOpenTelegram}
|
|
117
|
+
onSetupTelegram={onSetupTelegram}
|
|
118
|
+
telegram={telegram}
|
|
119
|
+
/>
|
|
120
|
+
<LineChannel
|
|
121
|
+
agentId={agent.id}
|
|
122
|
+
isBusy={connectingChannelId === 'line'}
|
|
123
|
+
line={line}
|
|
124
|
+
onGenerateLineCode={onGenerateLineCode}
|
|
125
|
+
onOpenLine={onOpenLine}
|
|
126
|
+
onShareLineCode={onShareLineCode}
|
|
127
|
+
/>
|
|
128
|
+
</View>
|
|
129
|
+
</View>
|
|
130
|
+
</View>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function WhatsAppChannel({
|
|
135
|
+
agentId,
|
|
136
|
+
isBusy,
|
|
137
|
+
isReady,
|
|
138
|
+
onOpenWhatsApp,
|
|
139
|
+
}: {
|
|
140
|
+
agentId: string;
|
|
141
|
+
isBusy: boolean;
|
|
142
|
+
isReady: boolean;
|
|
143
|
+
onOpenWhatsApp?: SuperagentHomeScreenProps['onOpenWhatsApp'];
|
|
144
|
+
}) {
|
|
145
|
+
return (
|
|
146
|
+
<ChannelCard
|
|
147
|
+
accent="#25D366"
|
|
148
|
+
body="Open WhatsApp with the generated activation message for this Superagent."
|
|
149
|
+
icon={<MessageCircle color="#111111" size={20} strokeWidth={2.45} />}
|
|
150
|
+
status={isReady ? 'Setup link ready' : 'Needs auth token'}
|
|
151
|
+
title="WhatsApp"
|
|
152
|
+
>
|
|
153
|
+
<View style={channelStyles.actionRow}>
|
|
154
|
+
<ChannelButton
|
|
155
|
+
disabled={!isReady || !onOpenWhatsApp || isBusy}
|
|
156
|
+
icon={<ExternalLink color="#111111" size={15} strokeWidth={2.4} />}
|
|
157
|
+
isBusy={isBusy}
|
|
158
|
+
label="Open WhatsApp"
|
|
159
|
+
onPress={() => onOpenWhatsApp?.({ agentId })}
|
|
160
|
+
/>
|
|
161
|
+
</View>
|
|
162
|
+
</ChannelCard>
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function IMessageChannel({
|
|
167
|
+
agentId,
|
|
168
|
+
imessage,
|
|
169
|
+
isBusy,
|
|
170
|
+
onDisconnectIMessage,
|
|
171
|
+
onGenerateIMessageCode,
|
|
172
|
+
onOpenIMessage,
|
|
173
|
+
onShareIMessageCode,
|
|
174
|
+
}: {
|
|
175
|
+
agentId: string;
|
|
176
|
+
imessage?: SuperagentChannelStatus['imessage'];
|
|
177
|
+
isBusy: boolean;
|
|
178
|
+
onDisconnectIMessage?: SuperagentHomeScreenProps['onDisconnectIMessage'];
|
|
179
|
+
onGenerateIMessageCode?: SuperagentHomeScreenProps['onGenerateIMessageCode'];
|
|
180
|
+
onOpenIMessage?: SuperagentHomeScreenProps['onOpenIMessage'];
|
|
181
|
+
onShareIMessageCode?: SuperagentHomeScreenProps['onShareIMessageCode'];
|
|
182
|
+
}) {
|
|
183
|
+
const activation = imessage?.activation;
|
|
184
|
+
const phoneNumber = imessage?.phoneNumber ?? activation?.phoneNumber ?? null;
|
|
185
|
+
const [localError, setLocalError] = useState<string | null>(null);
|
|
186
|
+
|
|
187
|
+
const connectIMessage = async () => {
|
|
188
|
+
if (!onGenerateIMessageCode) {
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
setLocalError(null);
|
|
193
|
+
try {
|
|
194
|
+
const generated = await onGenerateIMessageCode({ agentId });
|
|
195
|
+
if (generated && onOpenIMessage) {
|
|
196
|
+
await onOpenIMessage({ agentId, ...generated });
|
|
197
|
+
}
|
|
198
|
+
} catch (error) {
|
|
199
|
+
setLocalError(error instanceof Error ? error.message : 'iMessage setup failed.');
|
|
200
|
+
}
|
|
201
|
+
};
|
|
202
|
+
|
|
203
|
+
return (
|
|
204
|
+
<ChannelCard
|
|
205
|
+
accent="#3B82F6"
|
|
206
|
+
body={imessage?.connected ? 'Connected and active via iMessage.' : 'Open Messages with the activation code ready to send.'}
|
|
207
|
+
icon={<MessageSquare color="#FFFFFF" size={20} strokeWidth={2.45} />}
|
|
208
|
+
status={imessage?.connected ? 'Active' : activation ? 'Code ready' : 'Not connected'}
|
|
209
|
+
title="iMessage"
|
|
210
|
+
>
|
|
211
|
+
{imessage?.connected ? (
|
|
212
|
+
<View style={channelStyles.connectedBox}>
|
|
213
|
+
<View style={channelStyles.connectedTitleRow}>
|
|
214
|
+
<CheckCircle2 color="#34D399" size={17} strokeWidth={2.4} />
|
|
215
|
+
<Text style={channelStyles.connectedTitle}>iMessage connection</Text>
|
|
216
|
+
</View>
|
|
217
|
+
{phoneNumber ? <Text style={channelStyles.connectedBody}>Number: {phoneNumber}</Text> : null}
|
|
218
|
+
<View style={channelStyles.actionRow}>
|
|
219
|
+
<ChannelButton
|
|
220
|
+
danger
|
|
221
|
+
disabled={!onDisconnectIMessage || isBusy}
|
|
222
|
+
icon={<Unplug color="#FCA5A5" size={15} strokeWidth={2.4} />}
|
|
223
|
+
isBusy={isBusy}
|
|
224
|
+
label="Disconnect"
|
|
225
|
+
onPress={() => onDisconnectIMessage?.({ agentId })}
|
|
226
|
+
/>
|
|
227
|
+
</View>
|
|
228
|
+
</View>
|
|
229
|
+
) : (
|
|
230
|
+
<View style={channelStyles.setupStack}>
|
|
231
|
+
{localError ? <Text style={channelStyles.errorText}>{localError}</Text> : null}
|
|
232
|
+
{activation ? (
|
|
233
|
+
<View style={channelStyles.connectedBox}>
|
|
234
|
+
<Text style={channelStyles.codeLabel}>Text this activation code</Text>
|
|
235
|
+
<Text selectable style={channelStyles.activationCode}>{activation.code}</Text>
|
|
236
|
+
<Text selectable style={channelStyles.connectedBody}>To: {activation.phoneNumber}</Text>
|
|
237
|
+
<Text style={channelStyles.expiryText}>Code expires in 30 minutes.</Text>
|
|
238
|
+
</View>
|
|
239
|
+
) : null}
|
|
240
|
+
<View style={channelStyles.actionRow}>
|
|
241
|
+
<ChannelButton
|
|
242
|
+
disabled={!onGenerateIMessageCode || isBusy}
|
|
243
|
+
icon={<MessageSquare color="#FFFFFF" size={15} strokeWidth={2.4} />}
|
|
244
|
+
isBusy={isBusy}
|
|
245
|
+
label="Connect via iMessage"
|
|
246
|
+
onPress={connectIMessage}
|
|
247
|
+
secondary
|
|
248
|
+
/>
|
|
249
|
+
{activation ? (
|
|
250
|
+
<>
|
|
251
|
+
<ChannelButton
|
|
252
|
+
disabled={!onOpenIMessage || isBusy}
|
|
253
|
+
icon={<ExternalLink color="#111111" size={15} strokeWidth={2.4} />}
|
|
254
|
+
label="Open Messages"
|
|
255
|
+
onPress={() => onOpenIMessage?.({ agentId, ...activation })}
|
|
256
|
+
/>
|
|
257
|
+
<ChannelButton
|
|
258
|
+
secondary
|
|
259
|
+
disabled={!onShareIMessageCode}
|
|
260
|
+
icon={<Copy color="#F4F4F5" size={15} strokeWidth={2.4} />}
|
|
261
|
+
label="Share code"
|
|
262
|
+
onPress={() => onShareIMessageCode?.({ agentId, ...activation })}
|
|
263
|
+
/>
|
|
264
|
+
</>
|
|
265
|
+
) : null}
|
|
266
|
+
</View>
|
|
267
|
+
</View>
|
|
268
|
+
)}
|
|
269
|
+
</ChannelCard>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
function TelegramChannel({
|
|
274
|
+
agentId,
|
|
275
|
+
isBusy,
|
|
276
|
+
onDisconnectTelegram,
|
|
277
|
+
onOpenTelegram,
|
|
278
|
+
onSetupTelegram,
|
|
279
|
+
telegram,
|
|
280
|
+
}: {
|
|
281
|
+
agentId: string;
|
|
282
|
+
isBusy: boolean;
|
|
283
|
+
onDisconnectTelegram?: SuperagentHomeScreenProps['onDisconnectTelegram'];
|
|
284
|
+
onOpenTelegram?: SuperagentHomeScreenProps['onOpenTelegram'];
|
|
285
|
+
onSetupTelegram?: SuperagentHomeScreenProps['onSetupTelegram'];
|
|
286
|
+
telegram?: SuperagentChannelStatus['telegram'];
|
|
287
|
+
}) {
|
|
288
|
+
const [tokenText, setTokenText] = useState('');
|
|
289
|
+
const [tokenError, setTokenError] = useState<string | null>(null);
|
|
290
|
+
const token = useMemo(() => extractTelegramToken(tokenText), [tokenText]);
|
|
291
|
+
const botTitle = telegram?.botName || telegram?.botUsername || 'Telegram bot';
|
|
292
|
+
|
|
293
|
+
const setupTelegram = async () => {
|
|
294
|
+
if (!token) {
|
|
295
|
+
setTokenError('Paste the BotFather token to connect Telegram.');
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
setTokenError(null);
|
|
300
|
+
try {
|
|
301
|
+
await onSetupTelegram?.({ agentId, token });
|
|
302
|
+
setTokenText('');
|
|
303
|
+
} catch (error) {
|
|
304
|
+
setTokenError(error instanceof Error ? error.message : 'Telegram setup failed.');
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
|
|
308
|
+
return (
|
|
309
|
+
<ChannelCard
|
|
310
|
+
accent="#37AEE2"
|
|
311
|
+
body={telegram?.connected ? `Connected as ${botTitle}.` : 'Paste a BotFather token to register the webhook.'}
|
|
312
|
+
icon={<Send color="#FFFFFF" size={19} strokeWidth={2.45} />}
|
|
313
|
+
status={telegram?.connected ? 'Active' : 'Not connected'}
|
|
314
|
+
title="Telegram"
|
|
315
|
+
>
|
|
316
|
+
{telegram?.connected ? (
|
|
317
|
+
<View style={channelStyles.connectedBox}>
|
|
318
|
+
<View style={channelStyles.connectedTitleRow}>
|
|
319
|
+
<CheckCircle2 color="#34D399" size={17} strokeWidth={2.4} />
|
|
320
|
+
<Text style={channelStyles.connectedTitle}>{botTitle}</Text>
|
|
321
|
+
</View>
|
|
322
|
+
{telegram.botUsername ? <Text style={channelStyles.connectedBody}>@{telegram.botUsername}</Text> : null}
|
|
323
|
+
<View style={channelStyles.actionRow}>
|
|
324
|
+
{telegram.botLink ? (
|
|
325
|
+
<ChannelButton
|
|
326
|
+
icon={<ExternalLink color="#111111" size={15} strokeWidth={2.4} />}
|
|
327
|
+
label="Open bot"
|
|
328
|
+
onPress={() => onOpenTelegram?.({ agentId, url: telegram.botLink || '' })}
|
|
329
|
+
/>
|
|
330
|
+
) : null}
|
|
331
|
+
<ChannelButton
|
|
332
|
+
danger
|
|
333
|
+
disabled={!onDisconnectTelegram || isBusy}
|
|
334
|
+
icon={<Unplug color="#FCA5A5" size={15} strokeWidth={2.4} />}
|
|
335
|
+
isBusy={isBusy}
|
|
336
|
+
label="Disconnect"
|
|
337
|
+
onPress={() => onDisconnectTelegram?.({ agentId })}
|
|
338
|
+
/>
|
|
339
|
+
</View>
|
|
340
|
+
</View>
|
|
341
|
+
) : (
|
|
342
|
+
<View style={channelStyles.setupStack}>
|
|
343
|
+
<Text style={channelStyles.helpText}>
|
|
344
|
+
Create a bot in BotFather, then paste the full token here.
|
|
345
|
+
</Text>
|
|
346
|
+
<TextInput
|
|
347
|
+
autoCapitalize="none"
|
|
348
|
+
autoCorrect={false}
|
|
349
|
+
multiline
|
|
350
|
+
onChangeText={(value) => {
|
|
351
|
+
setTokenText(value);
|
|
352
|
+
if (tokenError) {
|
|
353
|
+
setTokenError(null);
|
|
354
|
+
}
|
|
355
|
+
}}
|
|
356
|
+
placeholder="123456789:AA..."
|
|
357
|
+
placeholderTextColor="#71717A"
|
|
358
|
+
style={channelStyles.tokenInput}
|
|
359
|
+
value={tokenText}
|
|
360
|
+
/>
|
|
361
|
+
{tokenError ? <Text style={channelStyles.errorText}>{tokenError}</Text> : null}
|
|
362
|
+
<View style={channelStyles.actionRow}>
|
|
363
|
+
<ChannelButton
|
|
364
|
+
disabled={!onSetupTelegram || isBusy}
|
|
365
|
+
icon={<CheckCircle2 color="#111111" size={15} strokeWidth={2.4} />}
|
|
366
|
+
isBusy={isBusy}
|
|
367
|
+
label="Connect bot"
|
|
368
|
+
onPress={setupTelegram}
|
|
369
|
+
/>
|
|
370
|
+
</View>
|
|
371
|
+
</View>
|
|
372
|
+
)}
|
|
373
|
+
</ChannelCard>
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function LineChannel({
|
|
378
|
+
agentId,
|
|
379
|
+
isBusy,
|
|
380
|
+
line,
|
|
381
|
+
onGenerateLineCode,
|
|
382
|
+
onOpenLine,
|
|
383
|
+
onShareLineCode,
|
|
384
|
+
}: {
|
|
385
|
+
agentId: string;
|
|
386
|
+
isBusy: boolean;
|
|
387
|
+
line?: SuperagentChannelStatus['line'];
|
|
388
|
+
onGenerateLineCode?: SuperagentHomeScreenProps['onGenerateLineCode'];
|
|
389
|
+
onOpenLine?: SuperagentHomeScreenProps['onOpenLine'];
|
|
390
|
+
onShareLineCode?: SuperagentHomeScreenProps['onShareLineCode'];
|
|
391
|
+
}) {
|
|
392
|
+
const activation = line?.activation;
|
|
393
|
+
|
|
394
|
+
return (
|
|
395
|
+
<ChannelCard
|
|
396
|
+
accent="#06C755"
|
|
397
|
+
body={activation ? 'Activation code is ready. Add the bot in LINE, then send this code.' : 'Generate a short-lived activation code for the shared LINE bot.'}
|
|
398
|
+
icon={<MessageCircle color="#FFFFFF" size={20} strokeWidth={2.45} />}
|
|
399
|
+
status={activation ? 'Code ready' : 'Not connected'}
|
|
400
|
+
title="LINE"
|
|
401
|
+
>
|
|
402
|
+
{activation ? (
|
|
403
|
+
<View style={channelStyles.connectedBox}>
|
|
404
|
+
<Text style={channelStyles.codeLabel}>Activation code</Text>
|
|
405
|
+
<Text selectable style={channelStyles.activationCode}>{activation.code}</Text>
|
|
406
|
+
<View style={channelStyles.actionRow}>
|
|
407
|
+
<ChannelButton
|
|
408
|
+
icon={<ExternalLink color="#111111" size={15} strokeWidth={2.4} />}
|
|
409
|
+
label="Open LINE"
|
|
410
|
+
onPress={() => onOpenLine?.({ agentId, url: activation.addFriendUrl })}
|
|
411
|
+
/>
|
|
412
|
+
<ChannelButton
|
|
413
|
+
secondary
|
|
414
|
+
icon={<Copy color="#F4F4F5" size={15} strokeWidth={2.4} />}
|
|
415
|
+
label="Share code"
|
|
416
|
+
onPress={() => onShareLineCode?.({ agentId, ...activation })}
|
|
417
|
+
/>
|
|
418
|
+
</View>
|
|
419
|
+
</View>
|
|
420
|
+
) : (
|
|
421
|
+
<View style={channelStyles.actionRow}>
|
|
422
|
+
<ChannelButton
|
|
423
|
+
disabled={!onGenerateLineCode || isBusy}
|
|
424
|
+
icon={<RefreshCw color="#111111" size={15} strokeWidth={2.4} />}
|
|
425
|
+
isBusy={isBusy}
|
|
426
|
+
label="Generate code"
|
|
427
|
+
onPress={() => onGenerateLineCode?.({ agentId })}
|
|
428
|
+
/>
|
|
429
|
+
</View>
|
|
430
|
+
)}
|
|
431
|
+
</ChannelCard>
|
|
432
|
+
);
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
function ChannelCard({
|
|
436
|
+
accent,
|
|
437
|
+
body,
|
|
438
|
+
children,
|
|
439
|
+
icon,
|
|
440
|
+
status,
|
|
441
|
+
title,
|
|
442
|
+
}: {
|
|
443
|
+
accent: string;
|
|
444
|
+
body: string;
|
|
445
|
+
children: React.ReactNode;
|
|
446
|
+
icon: React.ReactNode;
|
|
447
|
+
status: string;
|
|
448
|
+
title: string;
|
|
449
|
+
}) {
|
|
450
|
+
return (
|
|
451
|
+
<View style={channelStyles.card}>
|
|
452
|
+
<View style={channelStyles.cardHeader}>
|
|
453
|
+
<View style={[channelStyles.channelIcon, { backgroundColor: accent }]}>
|
|
454
|
+
{icon}
|
|
455
|
+
</View>
|
|
456
|
+
<View style={channelStyles.channelText}>
|
|
457
|
+
<View style={channelStyles.titleRow}>
|
|
458
|
+
<Text style={channelStyles.channelTitle}>{title}</Text>
|
|
459
|
+
<Text style={channelStyles.statusBadge}>{status}</Text>
|
|
460
|
+
</View>
|
|
461
|
+
<Text style={channelStyles.channelBody}>{body}</Text>
|
|
462
|
+
</View>
|
|
463
|
+
</View>
|
|
464
|
+
{children}
|
|
465
|
+
</View>
|
|
466
|
+
);
|
|
467
|
+
}
|
|
468
|
+
|
|
469
|
+
function ChannelButton({
|
|
470
|
+
danger,
|
|
471
|
+
disabled,
|
|
472
|
+
icon,
|
|
473
|
+
isBusy,
|
|
474
|
+
label,
|
|
475
|
+
onPress,
|
|
476
|
+
secondary,
|
|
477
|
+
}: {
|
|
478
|
+
danger?: boolean;
|
|
479
|
+
disabled?: boolean;
|
|
480
|
+
icon?: React.ReactNode;
|
|
481
|
+
isBusy?: boolean;
|
|
482
|
+
label: string;
|
|
483
|
+
onPress?: () => void;
|
|
484
|
+
secondary?: boolean;
|
|
485
|
+
}) {
|
|
486
|
+
return (
|
|
487
|
+
<Pressable
|
|
488
|
+
accessibilityRole="button"
|
|
489
|
+
disabled={disabled}
|
|
490
|
+
onPress={onPress}
|
|
491
|
+
style={({ pressed }) => [
|
|
492
|
+
channelStyles.button,
|
|
493
|
+
secondary && channelStyles.buttonSecondary,
|
|
494
|
+
danger && channelStyles.buttonDanger,
|
|
495
|
+
disabled && channelStyles.disabled,
|
|
496
|
+
pressed && styles.pressed,
|
|
497
|
+
]}
|
|
498
|
+
>
|
|
499
|
+
{isBusy ? <ActivityIndicator color={danger || secondary ? '#F4F4F5' : '#111111'} size="small" /> : icon}
|
|
500
|
+
<Text style={[
|
|
501
|
+
channelStyles.buttonText,
|
|
502
|
+
secondary && channelStyles.buttonTextSecondary,
|
|
503
|
+
danger && channelStyles.buttonTextDanger,
|
|
504
|
+
]}>{label}</Text>
|
|
505
|
+
</Pressable>
|
|
506
|
+
);
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function extractTelegramToken(value: string) {
|
|
510
|
+
const trimmed = value.trim();
|
|
511
|
+
if (TELEGRAM_TOKEN_PATTERN.test(trimmed)) {
|
|
512
|
+
return trimmed;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
return TELEGRAM_TOKEN_SEARCH.exec(trimmed)?.[0] ?? null;
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const channelStyles = StyleSheet.create({
|
|
519
|
+
actionRow: {
|
|
520
|
+
flexDirection: 'row',
|
|
521
|
+
flexWrap: 'wrap',
|
|
522
|
+
gap: 8,
|
|
523
|
+
marginTop: 12,
|
|
524
|
+
},
|
|
525
|
+
activationCode: {
|
|
526
|
+
color: '#F4F4F5',
|
|
527
|
+
fontFamily: 'Courier',
|
|
528
|
+
fontSize: 20,
|
|
529
|
+
fontWeight: '900',
|
|
530
|
+
letterSpacing: 0,
|
|
531
|
+
marginTop: 5,
|
|
532
|
+
},
|
|
533
|
+
button: {
|
|
534
|
+
alignItems: 'center',
|
|
535
|
+
backgroundColor: '#F4F4F5',
|
|
536
|
+
borderRadius: 999,
|
|
537
|
+
flexDirection: 'row',
|
|
538
|
+
gap: 6,
|
|
539
|
+
minHeight: 34,
|
|
540
|
+
paddingHorizontal: 12,
|
|
541
|
+
},
|
|
542
|
+
buttonDanger: {
|
|
543
|
+
backgroundColor: '#351516',
|
|
544
|
+
borderColor: '#552022',
|
|
545
|
+
borderWidth: 1,
|
|
546
|
+
},
|
|
547
|
+
buttonSecondary: {
|
|
548
|
+
backgroundColor: '#242427',
|
|
549
|
+
borderColor: '#353539',
|
|
550
|
+
borderWidth: 1,
|
|
551
|
+
},
|
|
552
|
+
buttonText: {
|
|
553
|
+
color: '#111111',
|
|
554
|
+
fontSize: 12,
|
|
555
|
+
fontWeight: '900',
|
|
556
|
+
},
|
|
557
|
+
buttonTextDanger: {
|
|
558
|
+
color: '#FCA5A5',
|
|
559
|
+
},
|
|
560
|
+
buttonTextSecondary: {
|
|
561
|
+
color: '#F4F4F5',
|
|
562
|
+
},
|
|
563
|
+
card: {
|
|
564
|
+
backgroundColor: '#151515',
|
|
565
|
+
borderColor: '#2A2A2A',
|
|
566
|
+
borderRadius: 14,
|
|
567
|
+
borderWidth: 1,
|
|
568
|
+
marginBottom: 10,
|
|
569
|
+
padding: 12,
|
|
570
|
+
},
|
|
571
|
+
cardHeader: {
|
|
572
|
+
alignItems: 'flex-start',
|
|
573
|
+
flexDirection: 'row',
|
|
574
|
+
},
|
|
575
|
+
channelBody: {
|
|
576
|
+
color: '#A1A1AA',
|
|
577
|
+
fontSize: 12,
|
|
578
|
+
fontWeight: '600',
|
|
579
|
+
lineHeight: 17,
|
|
580
|
+
marginTop: 4,
|
|
581
|
+
},
|
|
582
|
+
channelIcon: {
|
|
583
|
+
alignItems: 'center',
|
|
584
|
+
borderRadius: 12,
|
|
585
|
+
height: 40,
|
|
586
|
+
justifyContent: 'center',
|
|
587
|
+
marginRight: 11,
|
|
588
|
+
width: 40,
|
|
589
|
+
},
|
|
590
|
+
channelText: {
|
|
591
|
+
flex: 1,
|
|
592
|
+
minWidth: 0,
|
|
593
|
+
},
|
|
594
|
+
channelTitle: {
|
|
595
|
+
color: '#F4F4F5',
|
|
596
|
+
flexShrink: 1,
|
|
597
|
+
fontSize: 14,
|
|
598
|
+
fontWeight: '900',
|
|
599
|
+
},
|
|
600
|
+
codeLabel: {
|
|
601
|
+
color: '#8E8E93',
|
|
602
|
+
fontSize: 11,
|
|
603
|
+
fontWeight: '900',
|
|
604
|
+
textTransform: 'uppercase',
|
|
605
|
+
},
|
|
606
|
+
connectedBody: {
|
|
607
|
+
color: '#A1A1AA',
|
|
608
|
+
fontSize: 12,
|
|
609
|
+
fontWeight: '700',
|
|
610
|
+
marginTop: 4,
|
|
611
|
+
},
|
|
612
|
+
connectedBox: {
|
|
613
|
+
backgroundColor: '#101012',
|
|
614
|
+
borderColor: '#2A2A2A',
|
|
615
|
+
borderRadius: 12,
|
|
616
|
+
borderWidth: 1,
|
|
617
|
+
marginTop: 12,
|
|
618
|
+
padding: 11,
|
|
619
|
+
},
|
|
620
|
+
connectedTitle: {
|
|
621
|
+
color: '#F4F4F5',
|
|
622
|
+
flex: 1,
|
|
623
|
+
fontSize: 13,
|
|
624
|
+
fontWeight: '900',
|
|
625
|
+
marginLeft: 6,
|
|
626
|
+
},
|
|
627
|
+
connectedTitleRow: {
|
|
628
|
+
alignItems: 'center',
|
|
629
|
+
flexDirection: 'row',
|
|
630
|
+
},
|
|
631
|
+
disabled: {
|
|
632
|
+
opacity: 0.55,
|
|
633
|
+
},
|
|
634
|
+
errorText: {
|
|
635
|
+
color: '#FCA5A5',
|
|
636
|
+
fontSize: 12,
|
|
637
|
+
fontWeight: '700',
|
|
638
|
+
marginTop: 7,
|
|
639
|
+
},
|
|
640
|
+
expiryText: {
|
|
641
|
+
color: '#71717A',
|
|
642
|
+
fontSize: 11,
|
|
643
|
+
fontWeight: '700',
|
|
644
|
+
marginTop: 7,
|
|
645
|
+
},
|
|
646
|
+
headerActions: {
|
|
647
|
+
alignItems: 'center',
|
|
648
|
+
flexDirection: 'row',
|
|
649
|
+
gap: 8,
|
|
650
|
+
},
|
|
651
|
+
helpText: {
|
|
652
|
+
color: '#A1A1AA',
|
|
653
|
+
fontSize: 12,
|
|
654
|
+
fontWeight: '600',
|
|
655
|
+
lineHeight: 17,
|
|
656
|
+
},
|
|
657
|
+
iconButton: {
|
|
658
|
+
alignItems: 'center',
|
|
659
|
+
backgroundColor: '#1F1F23',
|
|
660
|
+
borderColor: '#2A2A2A',
|
|
661
|
+
borderRadius: 11,
|
|
662
|
+
borderWidth: 1,
|
|
663
|
+
height: 34,
|
|
664
|
+
justifyContent: 'center',
|
|
665
|
+
width: 34,
|
|
666
|
+
},
|
|
667
|
+
setupStack: {
|
|
668
|
+
marginTop: 12,
|
|
669
|
+
},
|
|
670
|
+
stack: {
|
|
671
|
+
padding: 10,
|
|
672
|
+
},
|
|
673
|
+
statusBadge: {
|
|
674
|
+
backgroundColor: '#242427',
|
|
675
|
+
borderRadius: 10,
|
|
676
|
+
color: '#C7C7CC',
|
|
677
|
+
fontSize: 10,
|
|
678
|
+
fontWeight: '900',
|
|
679
|
+
marginLeft: 8,
|
|
680
|
+
overflow: 'hidden',
|
|
681
|
+
paddingHorizontal: 7,
|
|
682
|
+
paddingVertical: 4,
|
|
683
|
+
},
|
|
684
|
+
titleRow: {
|
|
685
|
+
alignItems: 'center',
|
|
686
|
+
flexDirection: 'row',
|
|
687
|
+
flexWrap: 'wrap',
|
|
688
|
+
},
|
|
689
|
+
tokenInput: {
|
|
690
|
+
backgroundColor: '#0B0B0C',
|
|
691
|
+
borderColor: '#2A2A2A',
|
|
692
|
+
borderRadius: 12,
|
|
693
|
+
borderWidth: 1,
|
|
694
|
+
color: '#F4F4F5',
|
|
695
|
+
fontFamily: 'Courier',
|
|
696
|
+
fontSize: 12,
|
|
697
|
+
fontWeight: '700',
|
|
698
|
+
lineHeight: 17,
|
|
699
|
+
marginTop: 9,
|
|
700
|
+
minHeight: 72,
|
|
701
|
+
paddingHorizontal: 11,
|
|
702
|
+
paddingVertical: 10,
|
|
703
|
+
textAlignVertical: 'top',
|
|
704
|
+
},
|
|
705
|
+
});
|