@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,317 @@
|
|
|
1
|
+
import React, { type ReactNode } from 'react';
|
|
2
|
+
import { Linking, ScrollView, Text, View } from 'react-native';
|
|
3
|
+
|
|
4
|
+
import { markdownStyles } from './markdownStyles';
|
|
5
|
+
import type { SuperagentMarkdownRenderer, SuperagentMessage } from './types';
|
|
6
|
+
|
|
7
|
+
type MarkdownBlock =
|
|
8
|
+
| { type: 'code'; text: string }
|
|
9
|
+
| { type: 'heading'; level: 1 | 2 | 3; text: string }
|
|
10
|
+
| { type: 'list'; ordered: boolean; items: string[] }
|
|
11
|
+
| { type: 'paragraph'; text: string }
|
|
12
|
+
| { type: 'quote'; text: string }
|
|
13
|
+
| { type: 'table'; headers: string[]; rows: string[][] };
|
|
14
|
+
|
|
15
|
+
export function MarkdownText({
|
|
16
|
+
content,
|
|
17
|
+
isUser,
|
|
18
|
+
message,
|
|
19
|
+
onLongPress,
|
|
20
|
+
renderMarkdown,
|
|
21
|
+
}: {
|
|
22
|
+
content: string;
|
|
23
|
+
isUser: boolean;
|
|
24
|
+
message: SuperagentMessage;
|
|
25
|
+
onLongPress?: () => void;
|
|
26
|
+
renderMarkdown?: SuperagentMarkdownRenderer;
|
|
27
|
+
}) {
|
|
28
|
+
const Renderer = renderMarkdown;
|
|
29
|
+
if (Renderer) return <Renderer content={content} isUser={isUser} message={message} />;
|
|
30
|
+
|
|
31
|
+
const blocks = parseMarkdownBlocks(content);
|
|
32
|
+
if (blocks.length === 0) return null;
|
|
33
|
+
const hasWideBlock = blocks.some((block) => block.type === 'code' || block.type === 'table');
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<View style={[markdownStyles.root, hasWideBlock && markdownStyles.wideRoot]}>
|
|
37
|
+
{blocks.map((block, index) => renderBlock(block, index, onLongPress))}
|
|
38
|
+
</View>
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function renderBlock(block: MarkdownBlock, index: number, onLongPress?: () => void) {
|
|
43
|
+
if (block.type === 'code') {
|
|
44
|
+
return (
|
|
45
|
+
<ScrollView
|
|
46
|
+
horizontal
|
|
47
|
+
key={`code-${index}`}
|
|
48
|
+
nestedScrollEnabled
|
|
49
|
+
showsHorizontalScrollIndicator
|
|
50
|
+
style={markdownStyles.codeBlockScroll}
|
|
51
|
+
>
|
|
52
|
+
<View style={markdownStyles.codeBlock}>
|
|
53
|
+
<Text style={markdownStyles.codeBlockText}>{block.text}</Text>
|
|
54
|
+
</View>
|
|
55
|
+
</ScrollView>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
if (block.type === 'heading') {
|
|
60
|
+
const style = block.level === 1
|
|
61
|
+
? markdownStyles.heading1
|
|
62
|
+
: block.level === 2 ? markdownStyles.heading2 : markdownStyles.heading3;
|
|
63
|
+
return <Text key={`heading-${index}`} onLongPress={onLongPress} style={style}>{renderInline(block.text, `h-${index}`)}</Text>;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
if (block.type === 'quote') {
|
|
67
|
+
return (
|
|
68
|
+
<View key={`quote-${index}`} style={markdownStyles.quote}>
|
|
69
|
+
<Text onLongPress={onLongPress} style={markdownStyles.quoteText}>{renderInline(block.text, `q-${index}`)}</Text>
|
|
70
|
+
</View>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (block.type === 'list') {
|
|
75
|
+
return (
|
|
76
|
+
<View key={`list-${index}`} style={markdownStyles.list}>
|
|
77
|
+
{block.items.map((item, itemIndex) => (
|
|
78
|
+
<View key={`${item}-${itemIndex}`} style={markdownStyles.listItem}>
|
|
79
|
+
<Text style={markdownStyles.listMarker}>{block.ordered ? `${itemIndex + 1}.` : '\u2022'}</Text>
|
|
80
|
+
<Text onLongPress={onLongPress} style={markdownStyles.listText}>{renderInline(item, `li-${index}-${itemIndex}`)}</Text>
|
|
81
|
+
</View>
|
|
82
|
+
))}
|
|
83
|
+
</View>
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
if (block.type === 'table') {
|
|
88
|
+
const columnWidths = getTableColumnWidths(block);
|
|
89
|
+
|
|
90
|
+
return (
|
|
91
|
+
<ScrollView
|
|
92
|
+
directionalLockEnabled
|
|
93
|
+
horizontal
|
|
94
|
+
key={`table-${index}`}
|
|
95
|
+
nestedScrollEnabled
|
|
96
|
+
showsHorizontalScrollIndicator
|
|
97
|
+
style={markdownStyles.tableScroll}
|
|
98
|
+
>
|
|
99
|
+
<View style={markdownStyles.table}>
|
|
100
|
+
<View style={[markdownStyles.tableRow, markdownStyles.tableHeaderRow]}>
|
|
101
|
+
{block.headers.map((header, headerIndex) => (
|
|
102
|
+
<View
|
|
103
|
+
key={`${header}-${headerIndex}`}
|
|
104
|
+
style={[markdownStyles.tableCell, markdownStyles.tableHeaderCell, { width: columnWidths[headerIndex] }]}
|
|
105
|
+
>
|
|
106
|
+
<Text numberOfLines={1} style={markdownStyles.tableHeaderText}>{renderInline(header, `th-${index}-${headerIndex}`)}</Text>
|
|
107
|
+
</View>
|
|
108
|
+
))}
|
|
109
|
+
</View>
|
|
110
|
+
{block.rows.map((row, rowIndex) => (
|
|
111
|
+
<View key={`row-${index}-${rowIndex}`} style={markdownStyles.tableRow}>
|
|
112
|
+
{block.headers.map((_header, cellIndex) => (
|
|
113
|
+
<View
|
|
114
|
+
key={`cell-${index}-${rowIndex}-${cellIndex}`}
|
|
115
|
+
style={[markdownStyles.tableCell, { width: columnWidths[cellIndex] }]}
|
|
116
|
+
>
|
|
117
|
+
<Text numberOfLines={1} style={markdownStyles.tableText}>
|
|
118
|
+
{renderInline(row[cellIndex] ?? '', `td-${index}-${rowIndex}-${cellIndex}`)}
|
|
119
|
+
</Text>
|
|
120
|
+
</View>
|
|
121
|
+
))}
|
|
122
|
+
</View>
|
|
123
|
+
))}
|
|
124
|
+
</View>
|
|
125
|
+
</ScrollView>
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return (
|
|
130
|
+
<Text key={`p-${index}`} onLongPress={onLongPress} style={markdownStyles.paragraph}>
|
|
131
|
+
{renderInline(block.text, `p-${index}`)}
|
|
132
|
+
</Text>
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function parseMarkdownBlocks(content: string) {
|
|
137
|
+
const lines = decodeEntities(content).replace(/\r\n/g, '\n').split('\n');
|
|
138
|
+
const blocks: MarkdownBlock[] = [];
|
|
139
|
+
let index = 0;
|
|
140
|
+
|
|
141
|
+
while (index < lines.length) {
|
|
142
|
+
const line = lines[index];
|
|
143
|
+
if (!line.trim()) {
|
|
144
|
+
index += 1;
|
|
145
|
+
} else if (line.trim().startsWith('```')) {
|
|
146
|
+
const codeLines: string[] = [];
|
|
147
|
+
index += 1;
|
|
148
|
+
while (index < lines.length && !lines[index].trim().startsWith('```')) {
|
|
149
|
+
codeLines.push(lines[index]);
|
|
150
|
+
index += 1;
|
|
151
|
+
}
|
|
152
|
+
blocks.push({ type: 'code', text: codeLines.join('\n') });
|
|
153
|
+
index += 1;
|
|
154
|
+
} else if (parseHeading(line)) {
|
|
155
|
+
blocks.push(parseHeading(line)!);
|
|
156
|
+
index += 1;
|
|
157
|
+
} else if (isTableStart(lines, index)) {
|
|
158
|
+
const parsedTable = parseTable(lines, index);
|
|
159
|
+
blocks.push(parsedTable.table);
|
|
160
|
+
index = parsedTable.nextIndex;
|
|
161
|
+
} else if (line.trim().startsWith('>')) {
|
|
162
|
+
const quoteLines: string[] = [];
|
|
163
|
+
while (index < lines.length && lines[index].trim().startsWith('>')) {
|
|
164
|
+
quoteLines.push(lines[index].trim().replace(/^>\s?/, ''));
|
|
165
|
+
index += 1;
|
|
166
|
+
}
|
|
167
|
+
blocks.push({ type: 'quote', text: quoteLines.join('\n') });
|
|
168
|
+
} else if (isListLine(line)) {
|
|
169
|
+
const ordered = isOrderedListLine(line);
|
|
170
|
+
const items: string[] = [];
|
|
171
|
+
while (index < lines.length && isListLine(lines[index]) && isOrderedListLine(lines[index]) === ordered) {
|
|
172
|
+
items.push(lines[index].replace(/^\s*(?:[-*]|\d+[.)])\s+/, ''));
|
|
173
|
+
index += 1;
|
|
174
|
+
}
|
|
175
|
+
blocks.push({ type: 'list', ordered, items });
|
|
176
|
+
} else {
|
|
177
|
+
const paragraphLines: string[] = [];
|
|
178
|
+
while (index < lines.length && lines[index].trim() && !isBlockStart(lines, index)) {
|
|
179
|
+
paragraphLines.push(lines[index].trim());
|
|
180
|
+
index += 1;
|
|
181
|
+
}
|
|
182
|
+
blocks.push({ type: 'paragraph', text: paragraphLines.join(' ') });
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
return blocks;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
function parseHeading(line: string): MarkdownBlock | null {
|
|
190
|
+
const match = line.match(/^(#{1,3})\s+(.+)$/);
|
|
191
|
+
if (!match) return null;
|
|
192
|
+
return { type: 'heading', level: match[1].length as 1 | 2 | 3, text: match[2] };
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function isBlockStart(lines: string[], index: number) {
|
|
196
|
+
const line = lines[index];
|
|
197
|
+
return Boolean(parseHeading(line))
|
|
198
|
+
|| line.trim().startsWith('```')
|
|
199
|
+
|| line.trim().startsWith('>')
|
|
200
|
+
|| isListLine(line)
|
|
201
|
+
|| isTableStart(lines, index);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function isListLine(line: string) {
|
|
205
|
+
return /^\s*(?:[-*]|\d+[.)])\s+/.test(line);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
function isOrderedListLine(line: string) {
|
|
209
|
+
return /^\s*\d+[.)]\s+/.test(line);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function isTableStart(lines: string[], index: number) {
|
|
213
|
+
return isTableRow(lines[index]) && isTableSeparator(lines[index + 1]);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
function parseTable(lines: string[], startIndex: number): { nextIndex: number; table: Extract<MarkdownBlock, { type: 'table' }> } {
|
|
217
|
+
const headers = splitTableRow(lines[startIndex]);
|
|
218
|
+
const rows: string[][] = [];
|
|
219
|
+
let index = startIndex + 2;
|
|
220
|
+
|
|
221
|
+
while (index < lines.length && isTableRow(lines[index]) && !isTableSeparator(lines[index])) {
|
|
222
|
+
rows.push(splitTableRow(lines[index]));
|
|
223
|
+
index += 1;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
return {
|
|
227
|
+
nextIndex: index,
|
|
228
|
+
table: { headers, rows, type: 'table' },
|
|
229
|
+
};
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
function isTableRow(line?: string) {
|
|
233
|
+
if (!line) return false;
|
|
234
|
+
return splitTableRow(line).length >= 2;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
function isTableSeparator(line?: string) {
|
|
238
|
+
if (!line) return false;
|
|
239
|
+
const cells = splitTableRow(line);
|
|
240
|
+
return cells.length >= 2 && cells.every((cell) => /^:?-{3,}:?$/.test(cell.replace(/\s+/g, '')));
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
function splitTableRow(line: string) {
|
|
244
|
+
const trimmed = line.trim();
|
|
245
|
+
const withoutOuterPipes = trimmed.replace(/^\|/, '').replace(/\|$/, '');
|
|
246
|
+
return withoutOuterPipes.split('|').map((cell) => cell.trim());
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
function getTableColumnWidths(table: Extract<MarkdownBlock, { type: 'table' }>) {
|
|
250
|
+
return table.headers.map((header, index) => {
|
|
251
|
+
const longestCell = [header, ...table.rows.map((row) => row[index] ?? '')]
|
|
252
|
+
.reduce((longest, cell) => Math.max(longest, getVisibleTextLength(cell)), 0);
|
|
253
|
+
return Math.min(Math.max(longestCell * 8.7 + 32, 104), 340);
|
|
254
|
+
});
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
function getVisibleTextLength(value: string) {
|
|
258
|
+
return value
|
|
259
|
+
.replace(/\*\*([^*]+)\*\*/g, '$1')
|
|
260
|
+
.replace(/\*([^*]+)\*/g, '$1')
|
|
261
|
+
.replace(/`([^`]+)`/g, '$1')
|
|
262
|
+
.replace(/\[([^\]]+)\]\([^)]+\)/g, '$1')
|
|
263
|
+
.length;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
function renderInline(text: string, keyPrefix: string) {
|
|
267
|
+
const nodes: ReactNode[] = [];
|
|
268
|
+
const pattern = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[[^\]]+\]\([^)]+\)|https?:\/\/\S+)/gi;
|
|
269
|
+
let lastIndex = 0;
|
|
270
|
+
|
|
271
|
+
text.replace(pattern, (match, _unused, offset) => {
|
|
272
|
+
if (offset > lastIndex) nodes.push(text.slice(lastIndex, offset));
|
|
273
|
+
nodes.push(renderInlineToken(match, `${keyPrefix}-${offset}`));
|
|
274
|
+
lastIndex = offset + match.length;
|
|
275
|
+
return match;
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
if (lastIndex < text.length) nodes.push(text.slice(lastIndex));
|
|
279
|
+
return nodes;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
function renderInlineToken(token: string, key: string) {
|
|
283
|
+
const link = parseLink(token);
|
|
284
|
+
if (link) {
|
|
285
|
+
return (
|
|
286
|
+
<Text key={key} onPress={() => openSafeUrl(link.url)} style={markdownStyles.link}>
|
|
287
|
+
{link.label}
|
|
288
|
+
</Text>
|
|
289
|
+
);
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
if (token.startsWith('`')) {
|
|
293
|
+
return <Text key={key} style={markdownStyles.inlineCode}>{token.slice(1, -1)}</Text>;
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
if (token.startsWith('**')) {
|
|
297
|
+
return <Text key={key} style={markdownStyles.strong}>{token.slice(2, -2)}</Text>;
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
if (token.startsWith('*')) return <Text key={key} style={markdownStyles.italic}>{token.slice(1, -1)}</Text>;
|
|
301
|
+
return token;
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
function parseLink(token: string) {
|
|
305
|
+
const markdownLink = token.match(/^\[([^\]]+)\]\(([^)]+)\)$/);
|
|
306
|
+
if (markdownLink && isSafeUrl(markdownLink[2])) return { label: markdownLink[1], url: markdownLink[2] };
|
|
307
|
+
if (isSafeUrl(token)) return { label: token, url: token };
|
|
308
|
+
return null;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
function isSafeUrl(url: string) {
|
|
312
|
+
return /^https?:\/\//i.test(url.trim());
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
function openSafeUrl(url: string) { if (isSafeUrl(url)) Linking.openURL(url).catch(() => {}); }
|
|
316
|
+
|
|
317
|
+
function decodeEntities(value: string) { return value.replace(/ /g, ' ').replace(/&/g, '&').replace(/</g, '<').replace(/>/g, '>').replace(/"/g, '"').replace(/'/g, "'"); }
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import * as ReactNative from 'react-native';
|
|
2
|
+
|
|
3
|
+
import type { SuperagentCopyMessageInput, SuperagentMessage } from './types';
|
|
4
|
+
|
|
5
|
+
type MessageAction = {
|
|
6
|
+
label: string;
|
|
7
|
+
destructive?: boolean;
|
|
8
|
+
run: () => Promise<void> | void;
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
type NativeActionSheet = {
|
|
12
|
+
showActionSheetWithOptions: (
|
|
13
|
+
options: {
|
|
14
|
+
cancelButtonIndex?: number;
|
|
15
|
+
destructiveButtonIndex?: number;
|
|
16
|
+
options: string[];
|
|
17
|
+
userInterfaceStyle?: 'dark' | 'light';
|
|
18
|
+
},
|
|
19
|
+
callback: (buttonIndex: number) => void,
|
|
20
|
+
) => void;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const { Alert, Platform } = ReactNative;
|
|
24
|
+
const ACTION_SHEET_IOS_KEY = 'ActionSheet' + 'IOS';
|
|
25
|
+
|
|
26
|
+
export function showMessageActions({
|
|
27
|
+
message,
|
|
28
|
+
onCopyMessage,
|
|
29
|
+
onDeleteMessage,
|
|
30
|
+
onReplyMessage,
|
|
31
|
+
}: {
|
|
32
|
+
message: SuperagentMessage;
|
|
33
|
+
onCopyMessage?: SuperagentCopyMessageInput;
|
|
34
|
+
onDeleteMessage?: (messageId: string) => Promise<boolean> | boolean;
|
|
35
|
+
onReplyMessage?: (message: SuperagentMessage) => void;
|
|
36
|
+
}) {
|
|
37
|
+
const actions = getMessageActions({
|
|
38
|
+
message,
|
|
39
|
+
onCopyMessage,
|
|
40
|
+
onDeleteMessage,
|
|
41
|
+
onReplyMessage,
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
if (actions.length === 0) return;
|
|
45
|
+
|
|
46
|
+
const actionSheet = (ReactNative as unknown as Record<string, NativeActionSheet | undefined>)[ACTION_SHEET_IOS_KEY];
|
|
47
|
+
if (Platform.OS === 'ios' && actionSheet) {
|
|
48
|
+
const options = [...actions.map((action) => action.label), 'Cancel'];
|
|
49
|
+
const cancelButtonIndex = options.length - 1;
|
|
50
|
+
const destructiveButtonIndex = actions.findIndex((action) => action.destructive);
|
|
51
|
+
|
|
52
|
+
actionSheet.showActionSheetWithOptions(
|
|
53
|
+
{
|
|
54
|
+
cancelButtonIndex,
|
|
55
|
+
destructiveButtonIndex: destructiveButtonIndex >= 0 ? destructiveButtonIndex : undefined,
|
|
56
|
+
options,
|
|
57
|
+
userInterfaceStyle: 'dark',
|
|
58
|
+
},
|
|
59
|
+
(buttonIndex) => {
|
|
60
|
+
if (buttonIndex === cancelButtonIndex) return;
|
|
61
|
+
const action = actions[buttonIndex];
|
|
62
|
+
if (action) void action.run();
|
|
63
|
+
},
|
|
64
|
+
);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Alert.alert(
|
|
69
|
+
'Message',
|
|
70
|
+
undefined,
|
|
71
|
+
[
|
|
72
|
+
...actions.map((action) => ({
|
|
73
|
+
onPress: () => {
|
|
74
|
+
void action.run();
|
|
75
|
+
},
|
|
76
|
+
style: action.destructive ? 'destructive' as const : 'default' as const,
|
|
77
|
+
text: action.label,
|
|
78
|
+
})),
|
|
79
|
+
{ style: 'cancel' as const, text: 'Cancel' },
|
|
80
|
+
],
|
|
81
|
+
{ cancelable: true },
|
|
82
|
+
);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
function getMessageActions({
|
|
86
|
+
message,
|
|
87
|
+
onCopyMessage,
|
|
88
|
+
onDeleteMessage,
|
|
89
|
+
onReplyMessage,
|
|
90
|
+
}: {
|
|
91
|
+
message: SuperagentMessage;
|
|
92
|
+
onCopyMessage?: SuperagentCopyMessageInput;
|
|
93
|
+
onDeleteMessage?: (messageId: string) => Promise<boolean> | boolean;
|
|
94
|
+
onReplyMessage?: (message: SuperagentMessage) => void;
|
|
95
|
+
}): MessageAction[] {
|
|
96
|
+
const messageId = message.id;
|
|
97
|
+
const isPreviewMessage = messageId === 'welcome';
|
|
98
|
+
const hasContent = message.content.trim().length > 0;
|
|
99
|
+
const actions: MessageAction[] = [];
|
|
100
|
+
|
|
101
|
+
if (!isPreviewMessage && hasContent && onReplyMessage) {
|
|
102
|
+
actions.push({
|
|
103
|
+
label: 'Reply',
|
|
104
|
+
run: () => onReplyMessage(message),
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
if (!isPreviewMessage && hasContent && onCopyMessage) {
|
|
109
|
+
actions.push({
|
|
110
|
+
label: 'Copy',
|
|
111
|
+
run: () => onCopyMessage(message),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
if (!isPreviewMessage && messageId && onDeleteMessage) {
|
|
116
|
+
actions.push({
|
|
117
|
+
destructive: true,
|
|
118
|
+
label: 'Delete',
|
|
119
|
+
run: async () => {
|
|
120
|
+
await onDeleteMessage(messageId);
|
|
121
|
+
},
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
return actions;
|
|
126
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
KeyboardAvoidingView,
|
|
4
|
+
Modal,
|
|
5
|
+
Platform,
|
|
6
|
+
Pressable,
|
|
7
|
+
Text,
|
|
8
|
+
TextInput,
|
|
9
|
+
View,
|
|
10
|
+
} from 'react-native';
|
|
11
|
+
|
|
12
|
+
import { renameAgentModalStyles as styles } from './renameAgentModalStyles';
|
|
13
|
+
|
|
14
|
+
export function RenameAgentModal({
|
|
15
|
+
error,
|
|
16
|
+
initialName,
|
|
17
|
+
isSaving,
|
|
18
|
+
isVisible,
|
|
19
|
+
onClose,
|
|
20
|
+
onSave,
|
|
21
|
+
}: {
|
|
22
|
+
error?: string | null;
|
|
23
|
+
initialName: string;
|
|
24
|
+
isSaving: boolean;
|
|
25
|
+
isVisible: boolean;
|
|
26
|
+
onClose: () => void;
|
|
27
|
+
onSave: (name: string) => void;
|
|
28
|
+
}) {
|
|
29
|
+
const [name, setName] = useState(initialName);
|
|
30
|
+
const [localError, setLocalError] = useState<string | null>(null);
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
if (isVisible) {
|
|
34
|
+
setName(initialName);
|
|
35
|
+
setLocalError(null);
|
|
36
|
+
}
|
|
37
|
+
}, [initialName, isVisible]);
|
|
38
|
+
|
|
39
|
+
const save = () => {
|
|
40
|
+
const trimmed = name.trim();
|
|
41
|
+
if (!trimmed) {
|
|
42
|
+
setLocalError('Name is required.');
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
onSave(trimmed);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<Modal animationType="fade" transparent visible={isVisible} onRequestClose={onClose}>
|
|
50
|
+
<KeyboardAvoidingView
|
|
51
|
+
behavior={Platform.OS === 'ios' ? 'padding' : undefined}
|
|
52
|
+
style={styles.backdrop}
|
|
53
|
+
>
|
|
54
|
+
<View style={styles.card}>
|
|
55
|
+
<Text style={styles.title}>Rename Superagent</Text>
|
|
56
|
+
<TextInput
|
|
57
|
+
autoCapitalize="words"
|
|
58
|
+
autoCorrect
|
|
59
|
+
autoFocus
|
|
60
|
+
editable={!isSaving}
|
|
61
|
+
maxLength={80}
|
|
62
|
+
onChangeText={(value) => {
|
|
63
|
+
setName(value);
|
|
64
|
+
setLocalError(null);
|
|
65
|
+
}}
|
|
66
|
+
onSubmitEditing={save}
|
|
67
|
+
placeholder="Superagent name"
|
|
68
|
+
placeholderTextColor="#8E8E93"
|
|
69
|
+
returnKeyType="done"
|
|
70
|
+
selectTextOnFocus
|
|
71
|
+
style={styles.input}
|
|
72
|
+
value={name}
|
|
73
|
+
/>
|
|
74
|
+
{localError || error ? (
|
|
75
|
+
<Text style={styles.error}>{localError || error}</Text>
|
|
76
|
+
) : null}
|
|
77
|
+
<View style={styles.actions}>
|
|
78
|
+
<Pressable
|
|
79
|
+
accessibilityRole="button"
|
|
80
|
+
disabled={isSaving}
|
|
81
|
+
onPress={onClose}
|
|
82
|
+
style={({ pressed }) => [
|
|
83
|
+
styles.button,
|
|
84
|
+
styles.secondaryButton,
|
|
85
|
+
pressed && styles.pressed,
|
|
86
|
+
]}
|
|
87
|
+
>
|
|
88
|
+
<Text style={styles.secondaryButtonText}>Cancel</Text>
|
|
89
|
+
</Pressable>
|
|
90
|
+
<Pressable
|
|
91
|
+
accessibilityRole="button"
|
|
92
|
+
disabled={isSaving}
|
|
93
|
+
onPress={save}
|
|
94
|
+
style={({ pressed }) => [
|
|
95
|
+
styles.button,
|
|
96
|
+
styles.primaryButton,
|
|
97
|
+
(pressed || isSaving) && styles.primaryPressed,
|
|
98
|
+
]}
|
|
99
|
+
>
|
|
100
|
+
<Text style={styles.primaryButtonText}>{isSaving ? 'Saving...' : 'Save'}</Text>
|
|
101
|
+
</Pressable>
|
|
102
|
+
</View>
|
|
103
|
+
</View>
|
|
104
|
+
</KeyboardAvoidingView>
|
|
105
|
+
</Modal>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
|
+
|
|
3
|
+
export const shareAgentModalStyles = StyleSheet.create({
|
|
4
|
+
agentTitle: { alignItems: 'center', flex: 1, flexDirection: 'row', minWidth: 0 },
|
|
5
|
+
avatarImage: { height: '100%', width: '100%' },
|
|
6
|
+
avatarWrap: {
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
backgroundColor: '#262626',
|
|
9
|
+
borderRadius: 20,
|
|
10
|
+
height: 40,
|
|
11
|
+
justifyContent: 'center',
|
|
12
|
+
overflow: 'hidden',
|
|
13
|
+
width: 40,
|
|
14
|
+
},
|
|
15
|
+
backdrop: { backgroundColor: 'rgba(0,0,0,0.58)', flex: 1, justifyContent: 'flex-end' },
|
|
16
|
+
badge: { color: '#DADADA', fontSize: 11, fontWeight: '800', marginLeft: 6 },
|
|
17
|
+
closeButton: { alignItems: 'center', height: 38, justifyContent: 'center', width: 38 },
|
|
18
|
+
disabledButton: { opacity: 0.62 },
|
|
19
|
+
emptyText: { color: '#8E8E93', fontSize: 13, paddingVertical: 16, textAlign: 'center' },
|
|
20
|
+
errorText: { color: '#FCA5A5', fontSize: 12, fontWeight: '700', marginTop: 8 },
|
|
21
|
+
guestActions: { flexDirection: 'row', gap: 10, marginTop: 14 },
|
|
22
|
+
guestBody: { color: '#DADADA', fontSize: 13, fontWeight: '700', lineHeight: 19, marginTop: 6 },
|
|
23
|
+
guestCard: {
|
|
24
|
+
backgroundColor: '#101010',
|
|
25
|
+
borderColor: '#353535',
|
|
26
|
+
borderRadius: 20,
|
|
27
|
+
borderWidth: 1,
|
|
28
|
+
marginTop: 10,
|
|
29
|
+
padding: 14,
|
|
30
|
+
},
|
|
31
|
+
guestHint: { color: '#F8D77B', fontSize: 12, fontWeight: '800', lineHeight: 17, marginTop: 8 },
|
|
32
|
+
guestPrimaryButton: {
|
|
33
|
+
alignItems: 'center',
|
|
34
|
+
backgroundColor: '#F7F3E7',
|
|
35
|
+
borderRadius: 17,
|
|
36
|
+
flex: 1,
|
|
37
|
+
flexDirection: 'row',
|
|
38
|
+
gap: 7,
|
|
39
|
+
justifyContent: 'center',
|
|
40
|
+
paddingVertical: 10,
|
|
41
|
+
},
|
|
42
|
+
guestPrimaryButtonText: { color: '#111111', fontSize: 13, fontWeight: '900' },
|
|
43
|
+
guestSecondaryButton: {
|
|
44
|
+
alignItems: 'center',
|
|
45
|
+
backgroundColor: '#1B1B1B',
|
|
46
|
+
borderColor: '#333333',
|
|
47
|
+
borderRadius: 17,
|
|
48
|
+
borderWidth: 1,
|
|
49
|
+
flex: 1,
|
|
50
|
+
flexDirection: 'row',
|
|
51
|
+
gap: 7,
|
|
52
|
+
justifyContent: 'center',
|
|
53
|
+
paddingVertical: 10,
|
|
54
|
+
},
|
|
55
|
+
guestSecondaryButtonText: { color: '#F4F4F5', fontSize: 13, fontWeight: '900' },
|
|
56
|
+
guestTitle: { color: '#F4F4F5', fontSize: 15, fontWeight: '900' },
|
|
57
|
+
header: { alignItems: 'center', flexDirection: 'row', marginBottom: 16 },
|
|
58
|
+
input: { color: '#F4F4F5', fontSize: 16, maxHeight: 92, minHeight: 42, paddingVertical: 8 },
|
|
59
|
+
inputCard: { backgroundColor: '#141414', borderColor: '#2A2A2A', borderRadius: 20, borderWidth: 1, padding: 14 },
|
|
60
|
+
inputLabel: { color: '#F4F4F5', fontSize: 13, fontWeight: '800' },
|
|
61
|
+
inviteButton: {
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
backgroundColor: '#F7F3E7',
|
|
64
|
+
borderRadius: 18,
|
|
65
|
+
flexDirection: 'row',
|
|
66
|
+
gap: 7,
|
|
67
|
+
justifyContent: 'center',
|
|
68
|
+
marginTop: 12,
|
|
69
|
+
paddingVertical: 11,
|
|
70
|
+
},
|
|
71
|
+
inviteButtonText: { color: '#111111', fontSize: 14, fontWeight: '900' },
|
|
72
|
+
memberEmail: { color: '#8E8E93', fontSize: 12, marginTop: 2 },
|
|
73
|
+
memberName: { color: '#F4F4F5', flexShrink: 1, fontSize: 14, fontWeight: '800' },
|
|
74
|
+
memberNameRow: { alignItems: 'center', flexDirection: 'row', minWidth: 0 },
|
|
75
|
+
memberRow: { alignItems: 'center', flexDirection: 'row', paddingVertical: 9 },
|
|
76
|
+
memberTextWrap: { flex: 1, marginLeft: 10, minWidth: 0 },
|
|
77
|
+
membersHeader: { alignItems: 'center', flexDirection: 'row', justifyContent: 'space-between', marginTop: 18 },
|
|
78
|
+
membersList: { paddingBottom: 6 },
|
|
79
|
+
membersTitle: { color: '#F4F4F5', fontSize: 15, fontWeight: '900' },
|
|
80
|
+
sheet: {
|
|
81
|
+
alignSelf: 'center',
|
|
82
|
+
backgroundColor: '#0A0A0A',
|
|
83
|
+
borderColor: '#2A2A2A',
|
|
84
|
+
borderRadius: 28,
|
|
85
|
+
borderWidth: 1,
|
|
86
|
+
marginBottom: 18,
|
|
87
|
+
maxHeight: '82%',
|
|
88
|
+
padding: 18,
|
|
89
|
+
width: '92%',
|
|
90
|
+
},
|
|
91
|
+
subtitle: { color: '#8E8E93', fontSize: 13, marginTop: 2 },
|
|
92
|
+
successText: { color: '#86EFAC', fontSize: 12, fontWeight: '800', marginTop: 8 },
|
|
93
|
+
title: { color: '#F4F4F5', fontSize: 21, fontWeight: '900' },
|
|
94
|
+
titleTextWrap: { flex: 1, marginLeft: 10, minWidth: 0 },
|
|
95
|
+
});
|