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