@base44/superagent-native 0.0.1 → 0.0.3
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/LICENSE +21 -0
- package/README.md +12 -20
- package/lib/commonjs/AgentSettingsPanel.js +155 -62
- package/lib/commonjs/AgentSettingsPanel.js.map +1 -1
- package/lib/commonjs/AgentSphereIcon.js +14 -118
- package/lib/commonjs/AgentSphereIcon.js.map +1 -1
- package/lib/commonjs/AttachmentPickerStatusModal.js +5 -4
- package/lib/commonjs/AttachmentPickerStatusModal.js.map +1 -1
- package/lib/commonjs/ChannelsPanel.js +66 -44
- package/lib/commonjs/ChannelsPanel.js.map +1 -1
- package/lib/commonjs/ConversationChat.js +38 -13
- package/lib/commonjs/ConversationChat.js.map +1 -1
- package/lib/commonjs/ConversationComposer.js +18 -13
- package/lib/commonjs/ConversationComposer.js.map +1 -1
- package/lib/commonjs/ConversationScreen.js +4 -0
- package/lib/commonjs/ConversationScreen.js.map +1 -1
- package/lib/commonjs/EditorDrawer.js +54 -24
- package/lib/commonjs/EditorDrawer.js.map +1 -1
- package/lib/commonjs/FilesPanel.js +56 -20
- package/lib/commonjs/FilesPanel.js.map +1 -1
- package/lib/commonjs/MarkdownText.js +1 -1
- package/lib/commonjs/MarkdownText.js.map +1 -1
- package/lib/commonjs/MessageActionBar.js +10 -3
- package/lib/commonjs/MessageActionBar.js.map +1 -1
- package/lib/commonjs/RenameAgentModal.js +2 -1
- package/lib/commonjs/RenameAgentModal.js.map +1 -1
- package/lib/commonjs/ShareAgentModal.js +11 -10
- package/lib/commonjs/ShareAgentModal.js.map +1 -1
- package/lib/commonjs/ShareAgentModal.styles.js +2 -2
- package/lib/commonjs/ShareAgentModal.styles.js.map +1 -1
- package/lib/commonjs/SuperagentHomeScreen.js +44 -12
- package/lib/commonjs/SuperagentHomeScreen.js.map +1 -1
- package/lib/commonjs/ToolApprovalCard.js +73 -15
- package/lib/commonjs/ToolApprovalCard.js.map +1 -1
- package/lib/commonjs/ToolCallSummary.js +19 -10
- package/lib/commonjs/ToolCallSummary.js.map +1 -1
- package/lib/commonjs/agentSphereAssets.js +327 -0
- package/lib/commonjs/agentSphereAssets.js.map +1 -0
- package/lib/commonjs/agentSphereStyles.js +3 -3
- package/lib/commonjs/agentSphereStyles.js.map +1 -1
- package/lib/commonjs/apiClient.js +7 -0
- package/lib/commonjs/apiClient.js.map +1 -1
- package/lib/commonjs/attachmentUpload.js +2 -1
- package/lib/commonjs/attachmentUpload.js.map +1 -1
- package/lib/commonjs/composerStyles.js +2 -2
- package/lib/commonjs/composerStyles.js.map +1 -1
- package/lib/commonjs/connectorBrandIcons.generated.js +625 -0
- package/lib/commonjs/connectorBrandIcons.generated.js.map +1 -0
- package/lib/commonjs/connectorBrandIcons.js +3 -55
- package/lib/commonjs/connectorBrandIcons.js.map +1 -1
- package/lib/commonjs/connectorCatalog.js +19 -1
- package/lib/commonjs/connectorCatalog.js.map +1 -1
- package/lib/commonjs/conversationParts.js +5 -4
- package/lib/commonjs/conversationParts.js.map +1 -1
- package/lib/commonjs/conversationRuntime.js +152 -9
- package/lib/commonjs/conversationRuntime.js.map +1 -1
- package/lib/commonjs/conversationStyles.js +2 -1
- package/lib/commonjs/conversationStyles.js.map +1 -1
- package/lib/commonjs/editorShellStyles.js +6 -2
- package/lib/commonjs/editorShellStyles.js.map +1 -1
- package/lib/commonjs/fileTreeUtils.js +7 -0
- package/lib/commonjs/fileTreeUtils.js.map +1 -1
- package/lib/commonjs/index.js +7 -0
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/markdownStyles.js +2 -2
- package/lib/commonjs/markdownStyles.js.map +1 -1
- package/lib/commonjs/messageActionStyles.js +2 -2
- package/lib/commonjs/messageActionStyles.js.map +1 -1
- package/lib/commonjs/realtimeClient.js +4 -1
- package/lib/commonjs/realtimeClient.js.map +1 -1
- package/lib/commonjs/renameAgentModalStyles.js +2 -2
- package/lib/commonjs/renameAgentModalStyles.js.map +1 -1
- package/lib/commonjs/screenParts.js +24 -41
- package/lib/commonjs/screenParts.js.map +1 -1
- package/lib/commonjs/styles.js +32 -21
- package/lib/commonjs/styles.js.map +1 -1
- package/lib/commonjs/superagentApiClient.js +63 -18
- package/lib/commonjs/superagentApiClient.js.map +1 -1
- package/lib/commonjs/theme.js +249 -0
- package/lib/commonjs/theme.js.map +1 -0
- package/lib/commonjs/useSuperagentConversation.js +240 -44
- package/lib/commonjs/useSuperagentConversation.js.map +1 -1
- package/lib/commonjs/useSuperagentRuntime.js +245 -105
- package/lib/commonjs/useSuperagentRuntime.js.map +1 -1
- package/lib/module/AgentSettingsPanel.js +157 -64
- package/lib/module/AgentSettingsPanel.js.map +1 -1
- package/lib/module/AgentSphereIcon.js +15 -118
- package/lib/module/AgentSphereIcon.js.map +1 -1
- package/lib/module/AttachmentPickerStatusModal.js +6 -5
- package/lib/module/AttachmentPickerStatusModal.js.map +1 -1
- package/lib/module/ChannelsPanel.js +67 -45
- package/lib/module/ChannelsPanel.js.map +1 -1
- package/lib/module/ConversationChat.js +38 -13
- package/lib/module/ConversationChat.js.map +1 -1
- package/lib/module/ConversationComposer.js +18 -13
- package/lib/module/ConversationComposer.js.map +1 -1
- package/lib/module/ConversationScreen.js +4 -0
- package/lib/module/ConversationScreen.js.map +1 -1
- package/lib/module/EditorDrawer.js +55 -25
- package/lib/module/EditorDrawer.js.map +1 -1
- package/lib/module/FilesPanel.js +56 -20
- package/lib/module/FilesPanel.js.map +1 -1
- package/lib/module/MarkdownText.js +1 -1
- package/lib/module/MarkdownText.js.map +1 -1
- package/lib/module/MessageActionBar.js +10 -3
- package/lib/module/MessageActionBar.js.map +1 -1
- package/lib/module/RenameAgentModal.js +2 -1
- package/lib/module/RenameAgentModal.js.map +1 -1
- package/lib/module/ShareAgentModal.js +11 -10
- package/lib/module/ShareAgentModal.js.map +1 -1
- package/lib/module/ShareAgentModal.styles.js +2 -2
- package/lib/module/ShareAgentModal.styles.js.map +1 -1
- package/lib/module/SuperagentHomeScreen.js +45 -13
- package/lib/module/SuperagentHomeScreen.js.map +1 -1
- package/lib/module/ToolApprovalCard.js +73 -15
- package/lib/module/ToolApprovalCard.js.map +1 -1
- package/lib/module/ToolCallSummary.js +19 -10
- package/lib/module/ToolCallSummary.js.map +1 -1
- package/lib/module/agentSphereAssets.js +323 -0
- package/lib/module/agentSphereAssets.js.map +1 -0
- package/lib/module/agentSphereStyles.js +3 -3
- package/lib/module/agentSphereStyles.js.map +1 -1
- package/lib/module/apiClient.js +7 -0
- package/lib/module/apiClient.js.map +1 -1
- package/lib/module/attachmentUpload.js +2 -1
- package/lib/module/attachmentUpload.js.map +1 -1
- package/lib/module/composerStyles.js +2 -2
- package/lib/module/composerStyles.js.map +1 -1
- package/lib/module/connectorBrandIcons.generated.js +621 -0
- package/lib/module/connectorBrandIcons.generated.js.map +1 -0
- package/lib/module/connectorBrandIcons.js +1 -53
- package/lib/module/connectorBrandIcons.js.map +1 -1
- package/lib/module/connectorCatalog.js +17 -0
- package/lib/module/connectorCatalog.js.map +1 -1
- package/lib/module/conversationParts.js +5 -4
- package/lib/module/conversationParts.js.map +1 -1
- package/lib/module/conversationRuntime.js +149 -9
- package/lib/module/conversationRuntime.js.map +1 -1
- package/lib/module/conversationStyles.js +3 -2
- package/lib/module/conversationStyles.js.map +1 -1
- package/lib/module/editorShellStyles.js +6 -2
- package/lib/module/editorShellStyles.js.map +1 -1
- package/lib/module/fileTreeUtils.js +6 -0
- package/lib/module/fileTreeUtils.js.map +1 -1
- package/lib/module/index.js +1 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/markdownStyles.js +2 -2
- package/lib/module/markdownStyles.js.map +1 -1
- package/lib/module/messageActionStyles.js +2 -2
- package/lib/module/messageActionStyles.js.map +1 -1
- package/lib/module/realtimeClient.js +4 -1
- package/lib/module/realtimeClient.js.map +1 -1
- package/lib/module/renameAgentModalStyles.js +2 -2
- package/lib/module/renameAgentModalStyles.js.map +1 -1
- package/lib/module/screenParts.js +25 -42
- package/lib/module/screenParts.js.map +1 -1
- package/lib/module/styles.js +32 -21
- package/lib/module/styles.js.map +1 -1
- package/lib/module/superagentApiClient.js +63 -18
- package/lib/module/superagentApiClient.js.map +1 -1
- package/lib/module/theme.js +239 -0
- package/lib/module/theme.js.map +1 -0
- package/lib/module/useSuperagentConversation.js +242 -46
- package/lib/module/useSuperagentConversation.js.map +1 -1
- package/lib/module/useSuperagentRuntime.js +246 -106
- package/lib/module/useSuperagentRuntime.js.map +1 -1
- package/lib/typescript/commonjs/AgentSettingsPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/AgentSphereIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/AttachmentPickerStatusModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ChannelsPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/ConversationChat.d.ts +1 -1
- package/lib/typescript/commonjs/ConversationChat.d.ts.map +1 -1
- package/lib/typescript/commonjs/ConversationComposer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ConversationMessageList.d.ts +1 -1
- package/lib/typescript/commonjs/ConversationMessageList.d.ts.map +1 -1
- package/lib/typescript/commonjs/ConversationScreen.d.ts +2 -1
- package/lib/typescript/commonjs/ConversationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/EditorDrawer.d.ts +1 -1
- package/lib/typescript/commonjs/EditorDrawer.d.ts.map +1 -1
- package/lib/typescript/commonjs/FilesPanel.d.ts.map +1 -1
- package/lib/typescript/commonjs/RenameAgentModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ShareAgentModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ShareAgentModal.styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/SuperagentHomeScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ToolApprovalCard.d.ts +3 -3
- package/lib/typescript/commonjs/ToolApprovalCard.d.ts.map +1 -1
- package/lib/typescript/commonjs/ToolCallSummary.d.ts +1 -1
- package/lib/typescript/commonjs/ToolCallSummary.d.ts.map +1 -1
- package/lib/typescript/commonjs/agentSphereAssets.d.ts +2 -0
- package/lib/typescript/commonjs/agentSphereAssets.d.ts.map +1 -0
- package/lib/typescript/commonjs/agentSphereStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/apiClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/composerStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/connectorBrandIcons.d.ts.map +1 -1
- package/lib/typescript/commonjs/connectorBrandIcons.generated.d.ts +2 -0
- package/lib/typescript/commonjs/connectorBrandIcons.generated.d.ts.map +1 -0
- package/lib/typescript/commonjs/connectorCatalog.d.ts +2 -0
- package/lib/typescript/commonjs/connectorCatalog.d.ts.map +1 -1
- package/lib/typescript/commonjs/conversationParts.d.ts +1 -1
- package/lib/typescript/commonjs/conversationParts.d.ts.map +1 -1
- package/lib/typescript/commonjs/conversationRuntime.d.ts +9 -3
- package/lib/typescript/commonjs/conversationRuntime.d.ts.map +1 -1
- package/lib/typescript/commonjs/conversationStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/editorShellStyles.d.ts +4 -0
- package/lib/typescript/commonjs/editorShellStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/fileTreeUtils.d.ts +1 -0
- package/lib/typescript/commonjs/fileTreeUtils.d.ts.map +1 -1
- package/lib/typescript/commonjs/index.d.ts +2 -0
- package/lib/typescript/commonjs/index.d.ts.map +1 -1
- package/lib/typescript/commonjs/markdownStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/messageActionStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/realtimeClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/renameAgentModalStyles.d.ts.map +1 -1
- package/lib/typescript/commonjs/screenParts.d.ts +1 -1
- package/lib/typescript/commonjs/screenParts.d.ts.map +1 -1
- package/lib/typescript/commonjs/styles.d.ts +20 -11
- package/lib/typescript/commonjs/styles.d.ts.map +1 -1
- package/lib/typescript/commonjs/superagentApiClient.d.ts +2 -1
- package/lib/typescript/commonjs/superagentApiClient.d.ts.map +1 -1
- package/lib/typescript/commonjs/theme.d.ts +36 -0
- package/lib/typescript/commonjs/theme.d.ts.map +1 -0
- package/lib/typescript/commonjs/types.d.ts +17 -2
- package/lib/typescript/commonjs/types.d.ts.map +1 -1
- package/lib/typescript/commonjs/useSuperagentConversation.d.ts +3 -2
- package/lib/typescript/commonjs/useSuperagentConversation.d.ts.map +1 -1
- package/lib/typescript/commonjs/useSuperagentRuntime.d.ts +5 -2
- package/lib/typescript/commonjs/useSuperagentRuntime.d.ts.map +1 -1
- package/lib/typescript/module/AgentSettingsPanel.d.ts.map +1 -1
- package/lib/typescript/module/AgentSphereIcon.d.ts.map +1 -1
- package/lib/typescript/module/AttachmentPickerStatusModal.d.ts.map +1 -1
- package/lib/typescript/module/ChannelsPanel.d.ts.map +1 -1
- package/lib/typescript/module/ConversationChat.d.ts +1 -1
- package/lib/typescript/module/ConversationChat.d.ts.map +1 -1
- package/lib/typescript/module/ConversationComposer.d.ts.map +1 -1
- package/lib/typescript/module/ConversationMessageList.d.ts +1 -1
- package/lib/typescript/module/ConversationMessageList.d.ts.map +1 -1
- package/lib/typescript/module/ConversationScreen.d.ts +2 -1
- package/lib/typescript/module/ConversationScreen.d.ts.map +1 -1
- package/lib/typescript/module/EditorDrawer.d.ts +1 -1
- package/lib/typescript/module/EditorDrawer.d.ts.map +1 -1
- package/lib/typescript/module/FilesPanel.d.ts.map +1 -1
- package/lib/typescript/module/RenameAgentModal.d.ts.map +1 -1
- package/lib/typescript/module/ShareAgentModal.d.ts.map +1 -1
- package/lib/typescript/module/ShareAgentModal.styles.d.ts.map +1 -1
- package/lib/typescript/module/SuperagentHomeScreen.d.ts.map +1 -1
- package/lib/typescript/module/ToolApprovalCard.d.ts +3 -3
- package/lib/typescript/module/ToolApprovalCard.d.ts.map +1 -1
- package/lib/typescript/module/ToolCallSummary.d.ts +1 -1
- package/lib/typescript/module/ToolCallSummary.d.ts.map +1 -1
- package/lib/typescript/module/agentSphereAssets.d.ts +2 -0
- package/lib/typescript/module/agentSphereAssets.d.ts.map +1 -0
- package/lib/typescript/module/agentSphereStyles.d.ts.map +1 -1
- package/lib/typescript/module/apiClient.d.ts.map +1 -1
- package/lib/typescript/module/composerStyles.d.ts.map +1 -1
- package/lib/typescript/module/connectorBrandIcons.d.ts.map +1 -1
- package/lib/typescript/module/connectorBrandIcons.generated.d.ts +2 -0
- package/lib/typescript/module/connectorBrandIcons.generated.d.ts.map +1 -0
- package/lib/typescript/module/connectorCatalog.d.ts +2 -0
- package/lib/typescript/module/connectorCatalog.d.ts.map +1 -1
- package/lib/typescript/module/conversationParts.d.ts +1 -1
- package/lib/typescript/module/conversationParts.d.ts.map +1 -1
- package/lib/typescript/module/conversationRuntime.d.ts +9 -3
- package/lib/typescript/module/conversationRuntime.d.ts.map +1 -1
- package/lib/typescript/module/conversationStyles.d.ts.map +1 -1
- package/lib/typescript/module/editorShellStyles.d.ts +4 -0
- package/lib/typescript/module/editorShellStyles.d.ts.map +1 -1
- package/lib/typescript/module/fileTreeUtils.d.ts +1 -0
- package/lib/typescript/module/fileTreeUtils.d.ts.map +1 -1
- package/lib/typescript/module/index.d.ts +2 -0
- package/lib/typescript/module/index.d.ts.map +1 -1
- package/lib/typescript/module/markdownStyles.d.ts.map +1 -1
- package/lib/typescript/module/messageActionStyles.d.ts.map +1 -1
- package/lib/typescript/module/realtimeClient.d.ts.map +1 -1
- package/lib/typescript/module/renameAgentModalStyles.d.ts.map +1 -1
- package/lib/typescript/module/screenParts.d.ts +1 -1
- package/lib/typescript/module/screenParts.d.ts.map +1 -1
- package/lib/typescript/module/styles.d.ts +20 -11
- package/lib/typescript/module/styles.d.ts.map +1 -1
- package/lib/typescript/module/superagentApiClient.d.ts +2 -1
- package/lib/typescript/module/superagentApiClient.d.ts.map +1 -1
- package/lib/typescript/module/theme.d.ts +36 -0
- package/lib/typescript/module/theme.d.ts.map +1 -0
- package/lib/typescript/module/types.d.ts +17 -2
- package/lib/typescript/module/types.d.ts.map +1 -1
- package/lib/typescript/module/useSuperagentConversation.d.ts +3 -2
- package/lib/typescript/module/useSuperagentConversation.d.ts.map +1 -1
- package/lib/typescript/module/useSuperagentRuntime.d.ts +5 -2
- package/lib/typescript/module/useSuperagentRuntime.d.ts.map +1 -1
- package/package.json +13 -11
- package/src/AgentSettingsPanel.tsx +146 -58
- package/src/AgentSphereIcon.tsx +11 -62
- package/src/AttachmentPickerStatusModal.tsx +6 -5
- package/src/ChannelsPanel.tsx +59 -39
- package/src/ConversationChat.tsx +49 -12
- package/src/ConversationComposer.tsx +18 -12
- package/src/ConversationMessageList.tsx +1 -1
- package/src/ConversationScreen.tsx +5 -0
- package/src/EditorDrawer.tsx +66 -41
- package/src/FilesPanel.tsx +48 -20
- package/src/MarkdownText.tsx +1 -1
- package/src/MessageActionBar.tsx +9 -3
- package/src/RenameAgentModal.tsx +2 -1
- package/src/ShareAgentModal.styles.ts +2 -1
- package/src/ShareAgentModal.tsx +9 -8
- package/src/SuperagentHomeScreen.tsx +45 -10
- package/src/ToolApprovalCard.tsx +83 -15
- package/src/ToolCallSummary.tsx +22 -13
- package/src/agentSphereAssets.ts +325 -0
- package/src/agentSphereStyles.ts +3 -2
- package/src/apiClient.ts +7 -0
- package/src/attachmentUpload.ts +2 -1
- package/src/composerStyles.ts +2 -1
- package/src/connectorBrandIcons.generated.ts +618 -0
- package/src/connectorBrandIcons.tsx +1 -53
- package/src/connectorCatalog.ts +24 -0
- package/src/conversationParts.tsx +6 -5
- package/src/conversationRuntime.ts +166 -11
- package/src/conversationStyles.ts +2 -1
- package/src/editorShellStyles.ts +6 -1
- package/src/fileTreeUtils.ts +13 -0
- package/src/index.ts +2 -0
- package/src/markdownStyles.ts +2 -1
- package/src/messageActionStyles.ts +2 -1
- package/src/realtimeClient.ts +7 -1
- package/src/renameAgentModalStyles.ts +2 -1
- package/src/screenParts.tsx +17 -29
- package/src/styles.ts +25 -16
- package/src/superagentApiClient.ts +68 -18
- package/src/theme.ts +254 -0
- package/src/types.ts +22 -2
- package/src/useSuperagentConversation.ts +247 -45
- package/src/useSuperagentRuntime.ts +244 -107
package/src/ChannelsPanel.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { createThemedStyles, themedColor } from './theme';
|
|
3
|
+
import { ActivityIndicator, Pressable, Text, TextInput, View } from 'react-native';
|
|
3
4
|
import {
|
|
4
5
|
CheckCircle2,
|
|
5
6
|
Copy,
|
|
@@ -60,9 +61,10 @@ export function ChannelsPanel({
|
|
|
60
61
|
}) {
|
|
61
62
|
const imessage = channelStatus?.imessage;
|
|
62
63
|
const telegram = channelStatus?.telegram;
|
|
63
|
-
const line = channelStatus?.line;
|
|
64
64
|
const whatsapp = channelStatus?.whatsapp;
|
|
65
|
-
|
|
65
|
+
// LINE is hidden for now — its connection status isn't wired on native yet
|
|
66
|
+
// (no runtime status route), so it would always show as disconnected.
|
|
67
|
+
const supportedCount = 3;
|
|
66
68
|
|
|
67
69
|
return (
|
|
68
70
|
<View style={editorShellStyles.settingsStack}>
|
|
@@ -73,7 +75,7 @@ export function ChannelsPanel({
|
|
|
73
75
|
<Text style={editorShellStyles.panelSubtitle}>Messaging surfaces this agent can use.</Text>
|
|
74
76
|
</View>
|
|
75
77
|
<View style={channelStyles.headerActions}>
|
|
76
|
-
{isLoading ? <ActivityIndicator color=
|
|
78
|
+
{isLoading ? <ActivityIndicator color={themedColor('#FF5A1F')} size="small" /> : null}
|
|
77
79
|
{onRefreshChannels ? (
|
|
78
80
|
<Pressable
|
|
79
81
|
accessibilityLabel="Refresh channels"
|
|
@@ -86,7 +88,7 @@ export function ChannelsPanel({
|
|
|
86
88
|
pressed && styles.pressed,
|
|
87
89
|
]}
|
|
88
90
|
>
|
|
89
|
-
<RefreshCw color=
|
|
91
|
+
<RefreshCw color={themedColor('#F4F4F5')} size={17} strokeWidth={2.4} />
|
|
90
92
|
</Pressable>
|
|
91
93
|
) : null}
|
|
92
94
|
<Text style={editorShellStyles.countBadge}>{supportedCount}</Text>
|
|
@@ -96,9 +98,11 @@ export function ChannelsPanel({
|
|
|
96
98
|
<View style={channelStyles.stack}>
|
|
97
99
|
<WhatsAppChannel
|
|
98
100
|
agentId={agent.id}
|
|
101
|
+
connected={!!whatsapp?.connected}
|
|
99
102
|
isBusy={connectingChannelId === 'whatsapp'}
|
|
100
103
|
isReady={!!whatsapp?.connectUrl}
|
|
101
104
|
onOpenWhatsApp={onOpenWhatsApp}
|
|
105
|
+
userHandle={whatsapp?.userHandle ?? null}
|
|
102
106
|
/>
|
|
103
107
|
<IMessageChannel
|
|
104
108
|
agentId={agent.id}
|
|
@@ -117,14 +121,8 @@ export function ChannelsPanel({
|
|
|
117
121
|
onSetupTelegram={onSetupTelegram}
|
|
118
122
|
telegram={telegram}
|
|
119
123
|
/>
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
isBusy={connectingChannelId === 'line'}
|
|
123
|
-
line={line}
|
|
124
|
-
onGenerateLineCode={onGenerateLineCode}
|
|
125
|
-
onOpenLine={onOpenLine}
|
|
126
|
-
onShareLineCode={onShareLineCode}
|
|
127
|
-
/>
|
|
124
|
+
{/* LINE hidden for now — real connection status isn't wired on native
|
|
125
|
+
yet (no runtime status route). Re-add <LineChannel/> once it is. */}
|
|
128
126
|
</View>
|
|
129
127
|
</View>
|
|
130
128
|
</View>
|
|
@@ -133,32 +131,54 @@ export function ChannelsPanel({
|
|
|
133
131
|
|
|
134
132
|
function WhatsAppChannel({
|
|
135
133
|
agentId,
|
|
134
|
+
connected,
|
|
136
135
|
isBusy,
|
|
137
136
|
isReady,
|
|
138
137
|
onOpenWhatsApp,
|
|
138
|
+
userHandle,
|
|
139
139
|
}: {
|
|
140
140
|
agentId: string;
|
|
141
|
+
connected: boolean;
|
|
141
142
|
isBusy: boolean;
|
|
142
143
|
isReady: boolean;
|
|
143
144
|
onOpenWhatsApp?: SuperagentHomeScreenProps['onOpenWhatsApp'];
|
|
145
|
+
userHandle?: string | null;
|
|
144
146
|
}) {
|
|
147
|
+
// The handler builds the connect URL on press, so don't gate on a preloaded
|
|
148
|
+
// connectUrl — it's missing before status loads / after a failed refresh even
|
|
149
|
+
// though pressing the button would work.
|
|
150
|
+
const openButton = (
|
|
151
|
+
<ChannelButton
|
|
152
|
+
disabled={!onOpenWhatsApp || isBusy}
|
|
153
|
+
icon={<ExternalLink color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
154
|
+
isBusy={isBusy}
|
|
155
|
+
label="Open WhatsApp"
|
|
156
|
+
onPress={() => onOpenWhatsApp?.({ agentId })}
|
|
157
|
+
/>
|
|
158
|
+
);
|
|
159
|
+
|
|
145
160
|
return (
|
|
146
161
|
<ChannelCard
|
|
147
162
|
accent="#25D366"
|
|
148
|
-
body=
|
|
149
|
-
|
|
150
|
-
|
|
163
|
+
body={connected
|
|
164
|
+
? 'Connected and active via WhatsApp.'
|
|
165
|
+
: 'Open WhatsApp with the generated activation message for this Superagent.'}
|
|
166
|
+
icon={<MessageCircle color={themedColor('#111111')} size={20} strokeWidth={2.45} />}
|
|
167
|
+
status={connected ? 'Active' : isReady ? 'Setup link ready' : 'Tap to open setup'}
|
|
151
168
|
title="WhatsApp"
|
|
152
169
|
>
|
|
153
|
-
|
|
154
|
-
<
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
170
|
+
{connected ? (
|
|
171
|
+
<View style={channelStyles.connectedBox}>
|
|
172
|
+
<View style={channelStyles.connectedTitleRow}>
|
|
173
|
+
<CheckCircle2 color={themedColor('#34D399')} size={17} strokeWidth={2.4} />
|
|
174
|
+
<Text style={channelStyles.connectedTitle}>WhatsApp connection</Text>
|
|
175
|
+
</View>
|
|
176
|
+
{userHandle ? <Text style={channelStyles.connectedBody}>From: {userHandle}</Text> : null}
|
|
177
|
+
<View style={channelStyles.actionRow}>{openButton}</View>
|
|
178
|
+
</View>
|
|
179
|
+
) : (
|
|
180
|
+
<View style={channelStyles.actionRow}>{openButton}</View>
|
|
181
|
+
)}
|
|
162
182
|
</ChannelCard>
|
|
163
183
|
);
|
|
164
184
|
}
|
|
@@ -211,7 +231,7 @@ function IMessageChannel({
|
|
|
211
231
|
{imessage?.connected ? (
|
|
212
232
|
<View style={channelStyles.connectedBox}>
|
|
213
233
|
<View style={channelStyles.connectedTitleRow}>
|
|
214
|
-
<CheckCircle2 color=
|
|
234
|
+
<CheckCircle2 color={themedColor('#34D399')} size={17} strokeWidth={2.4} />
|
|
215
235
|
<Text style={channelStyles.connectedTitle}>iMessage connection</Text>
|
|
216
236
|
</View>
|
|
217
237
|
{phoneNumber ? <Text style={channelStyles.connectedBody}>Number: {phoneNumber}</Text> : null}
|
|
@@ -219,7 +239,7 @@ function IMessageChannel({
|
|
|
219
239
|
<ChannelButton
|
|
220
240
|
danger
|
|
221
241
|
disabled={!onDisconnectIMessage || isBusy}
|
|
222
|
-
icon={<Unplug color=
|
|
242
|
+
icon={<Unplug color={themedColor('#FCA5A5')} size={15} strokeWidth={2.4} />}
|
|
223
243
|
isBusy={isBusy}
|
|
224
244
|
label="Disconnect"
|
|
225
245
|
onPress={() => onDisconnectIMessage?.({ agentId })}
|
|
@@ -250,14 +270,14 @@ function IMessageChannel({
|
|
|
250
270
|
<>
|
|
251
271
|
<ChannelButton
|
|
252
272
|
disabled={!onOpenIMessage || isBusy}
|
|
253
|
-
icon={<ExternalLink color=
|
|
273
|
+
icon={<ExternalLink color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
254
274
|
label="Open Messages"
|
|
255
275
|
onPress={() => onOpenIMessage?.({ agentId, ...activation })}
|
|
256
276
|
/>
|
|
257
277
|
<ChannelButton
|
|
258
278
|
secondary
|
|
259
279
|
disabled={!onShareIMessageCode}
|
|
260
|
-
icon={<Copy color=
|
|
280
|
+
icon={<Copy color={themedColor('#F4F4F5')} size={15} strokeWidth={2.4} />}
|
|
261
281
|
label="Share code"
|
|
262
282
|
onPress={() => onShareIMessageCode?.({ agentId, ...activation })}
|
|
263
283
|
/>
|
|
@@ -316,14 +336,14 @@ function TelegramChannel({
|
|
|
316
336
|
{telegram?.connected ? (
|
|
317
337
|
<View style={channelStyles.connectedBox}>
|
|
318
338
|
<View style={channelStyles.connectedTitleRow}>
|
|
319
|
-
<CheckCircle2 color=
|
|
339
|
+
<CheckCircle2 color={themedColor('#34D399')} size={17} strokeWidth={2.4} />
|
|
320
340
|
<Text style={channelStyles.connectedTitle}>{botTitle}</Text>
|
|
321
341
|
</View>
|
|
322
342
|
{telegram.botUsername ? <Text style={channelStyles.connectedBody}>@{telegram.botUsername}</Text> : null}
|
|
323
343
|
<View style={channelStyles.actionRow}>
|
|
324
344
|
{telegram.botLink ? (
|
|
325
345
|
<ChannelButton
|
|
326
|
-
icon={<ExternalLink color=
|
|
346
|
+
icon={<ExternalLink color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
327
347
|
label="Open bot"
|
|
328
348
|
onPress={() => onOpenTelegram?.({ agentId, url: telegram.botLink || '' })}
|
|
329
349
|
/>
|
|
@@ -331,7 +351,7 @@ function TelegramChannel({
|
|
|
331
351
|
<ChannelButton
|
|
332
352
|
danger
|
|
333
353
|
disabled={!onDisconnectTelegram || isBusy}
|
|
334
|
-
icon={<Unplug color=
|
|
354
|
+
icon={<Unplug color={themedColor('#FCA5A5')} size={15} strokeWidth={2.4} />}
|
|
335
355
|
isBusy={isBusy}
|
|
336
356
|
label="Disconnect"
|
|
337
357
|
onPress={() => onDisconnectTelegram?.({ agentId })}
|
|
@@ -354,7 +374,7 @@ function TelegramChannel({
|
|
|
354
374
|
}
|
|
355
375
|
}}
|
|
356
376
|
placeholder="123456789:AA..."
|
|
357
|
-
placeholderTextColor=
|
|
377
|
+
placeholderTextColor={themedColor('#71717A')}
|
|
358
378
|
style={channelStyles.tokenInput}
|
|
359
379
|
value={tokenText}
|
|
360
380
|
/>
|
|
@@ -362,7 +382,7 @@ function TelegramChannel({
|
|
|
362
382
|
<View style={channelStyles.actionRow}>
|
|
363
383
|
<ChannelButton
|
|
364
384
|
disabled={!onSetupTelegram || isBusy}
|
|
365
|
-
icon={<CheckCircle2 color=
|
|
385
|
+
icon={<CheckCircle2 color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
366
386
|
isBusy={isBusy}
|
|
367
387
|
label="Connect bot"
|
|
368
388
|
onPress={setupTelegram}
|
|
@@ -405,13 +425,13 @@ function LineChannel({
|
|
|
405
425
|
<Text selectable style={channelStyles.activationCode}>{activation.code}</Text>
|
|
406
426
|
<View style={channelStyles.actionRow}>
|
|
407
427
|
<ChannelButton
|
|
408
|
-
icon={<ExternalLink color=
|
|
428
|
+
icon={<ExternalLink color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
409
429
|
label="Open LINE"
|
|
410
430
|
onPress={() => onOpenLine?.({ agentId, url: activation.addFriendUrl })}
|
|
411
431
|
/>
|
|
412
432
|
<ChannelButton
|
|
413
433
|
secondary
|
|
414
|
-
icon={<Copy color=
|
|
434
|
+
icon={<Copy color={themedColor('#F4F4F5')} size={15} strokeWidth={2.4} />}
|
|
415
435
|
label="Share code"
|
|
416
436
|
onPress={() => onShareLineCode?.({ agentId, ...activation })}
|
|
417
437
|
/>
|
|
@@ -421,7 +441,7 @@ function LineChannel({
|
|
|
421
441
|
<View style={channelStyles.actionRow}>
|
|
422
442
|
<ChannelButton
|
|
423
443
|
disabled={!onGenerateLineCode || isBusy}
|
|
424
|
-
icon={<RefreshCw color=
|
|
444
|
+
icon={<RefreshCw color={themedColor('#111111')} size={15} strokeWidth={2.4} />}
|
|
425
445
|
isBusy={isBusy}
|
|
426
446
|
label="Generate code"
|
|
427
447
|
onPress={() => onGenerateLineCode?.({ agentId })}
|
|
@@ -496,7 +516,7 @@ function ChannelButton({
|
|
|
496
516
|
pressed && styles.pressed,
|
|
497
517
|
]}
|
|
498
518
|
>
|
|
499
|
-
{isBusy ? <ActivityIndicator color={danger || secondary ? '#F4F4F5' : '#111111'} size="small" /> : icon}
|
|
519
|
+
{isBusy ? <ActivityIndicator color={danger || secondary ? themedColor('#F4F4F5') : themedColor('#111111')} size="small" /> : icon}
|
|
500
520
|
<Text style={[
|
|
501
521
|
channelStyles.buttonText,
|
|
502
522
|
secondary && channelStyles.buttonTextSecondary,
|
|
@@ -515,7 +535,7 @@ function extractTelegramToken(value: string) {
|
|
|
515
535
|
return TELEGRAM_TOKEN_SEARCH.exec(trimmed)?.[0] ?? null;
|
|
516
536
|
}
|
|
517
537
|
|
|
518
|
-
const channelStyles =
|
|
538
|
+
const channelStyles = createThemedStyles({
|
|
519
539
|
actionRow: {
|
|
520
540
|
flexDirection: 'row',
|
|
521
541
|
flexWrap: 'wrap',
|
package/src/ConversationChat.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { themedColor } from './theme';
|
|
2
3
|
import { ActivityIndicator, Pressable, ScrollView, Text, View } from 'react-native';
|
|
3
4
|
|
|
4
5
|
import { ConversationComposer } from './ConversationComposer';
|
|
@@ -46,7 +47,7 @@ export function ConversationChat({
|
|
|
46
47
|
availableConnectors?: SuperagentConnector[];
|
|
47
48
|
conversation: ConversationState;
|
|
48
49
|
currentUserAvatarUrl?: string | null;
|
|
49
|
-
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
50
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
50
51
|
onImportFromDrive?: SuperagentMediaPicker;
|
|
51
52
|
onCopyMessage?: SuperagentCopyMessageInput;
|
|
52
53
|
onPickFiles?: SuperagentMediaPicker;
|
|
@@ -63,10 +64,23 @@ export function ConversationChat({
|
|
|
63
64
|
const [draft, setDraft] = useState('');
|
|
64
65
|
const [attachments, setAttachments] = useState<SuperagentMediaAttachment[]>([]);
|
|
65
66
|
const [replyTo, setReplyTo] = useState<SuperagentReplyTo | null>(null);
|
|
66
|
-
|
|
67
|
+
// Conversation failed to initialize (apiClient path): no conversation id to send
|
|
68
|
+
// against, so block sends rather than clear the composer and drop the text.
|
|
69
|
+
const conversationUnavailable = Boolean(conversation.initError && !conversation.conversationId);
|
|
70
|
+
const canSend = (draft.trim().length > 0 || attachments.length > 0)
|
|
71
|
+
&& !conversation.isSending
|
|
72
|
+
&& !conversation.isLoading
|
|
73
|
+
&& !conversationUnavailable;
|
|
67
74
|
const displayedMessages = useMemo(
|
|
68
|
-
() =>
|
|
69
|
-
|
|
75
|
+
() => {
|
|
76
|
+
if (conversation.messages.length > 0) return conversation.messages;
|
|
77
|
+
// While the real conversation is still loading, don't fabricate a welcome
|
|
78
|
+
// bubble — it would render next to the loading panel as if the agent already
|
|
79
|
+
// sent an intro.
|
|
80
|
+
if (conversation.isLoading) return [];
|
|
81
|
+
return [createWelcomeMessage(agent)];
|
|
82
|
+
},
|
|
83
|
+
[agent, conversation.messages, conversation.isLoading],
|
|
70
84
|
);
|
|
71
85
|
const tailMessage = displayedMessages[displayedMessages.length - 1];
|
|
72
86
|
const tailMessageId = tailMessage ? getMessageAutoScrollId(tailMessage, displayedMessages.length - 1) : null;
|
|
@@ -103,18 +117,29 @@ export function ConversationChat({
|
|
|
103
117
|
const sendMessage = useCallback(async () => {
|
|
104
118
|
const selectedAttachments = attachments;
|
|
105
119
|
const selectedReplyTo = replyTo;
|
|
120
|
+
const selectedDraft = draft;
|
|
106
121
|
const content = draft.trim() || buildAttachmentPrompt(selectedAttachments);
|
|
107
|
-
|
|
122
|
+
// Don't send (and clear the composer) until the conversation is ready — while
|
|
123
|
+
// it's still loading or failed to init the hook can't reach the server and
|
|
124
|
+
// would drop the text.
|
|
125
|
+
if ((!content && selectedAttachments.length === 0) || conversation.isSending || conversation.isLoading || conversationUnavailable) return;
|
|
108
126
|
|
|
109
127
|
setDraft('');
|
|
110
128
|
setAttachments([]);
|
|
111
129
|
setReplyTo(null);
|
|
112
130
|
|
|
113
|
-
await conversation.sendMessage(content, {
|
|
131
|
+
const delivered = await conversation.sendMessage(content, {
|
|
114
132
|
fileUrls: selectedAttachments.map((attachment) => attachment.url),
|
|
115
133
|
replyTo: selectedReplyTo ?? undefined,
|
|
116
134
|
});
|
|
117
|
-
|
|
135
|
+
if (!delivered) {
|
|
136
|
+
// The send failed before reaching the conversation — restore what the user
|
|
137
|
+
// had typed (unless they've already started a new draft in the meantime).
|
|
138
|
+
setDraft((current) => current || selectedDraft);
|
|
139
|
+
setAttachments((current) => (current.length > 0 ? current : selectedAttachments));
|
|
140
|
+
setReplyTo((current) => current ?? selectedReplyTo);
|
|
141
|
+
}
|
|
142
|
+
}, [attachments, conversation, conversationUnavailable, draft, replyTo]);
|
|
118
143
|
|
|
119
144
|
const addAttachments = useCallback((incoming: SuperagentMediaAttachment[]) => {
|
|
120
145
|
setAttachments((current) => [...current, ...incoming].slice(0, MAX_ATTACHMENTS));
|
|
@@ -125,7 +150,7 @@ export function ConversationChat({
|
|
|
125
150
|
}, []);
|
|
126
151
|
|
|
127
152
|
const replyToMessage = useCallback((message: SuperagentMessage) => {
|
|
128
|
-
const content = message.content
|
|
153
|
+
const content = message.content?.trim();
|
|
129
154
|
if (!content) return;
|
|
130
155
|
setReplyTo({
|
|
131
156
|
content,
|
|
@@ -133,6 +158,18 @@ export function ConversationChat({
|
|
|
133
158
|
});
|
|
134
159
|
}, []);
|
|
135
160
|
|
|
161
|
+
const composerContext = useMemo(
|
|
162
|
+
() => ({ agentId: agent.id, conversationId: conversation.conversationId }),
|
|
163
|
+
[agent.id, conversation.conversationId],
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const clearReply = useCallback(() => setReplyTo(null), []);
|
|
167
|
+
|
|
168
|
+
const removeAttachment = useCallback(
|
|
169
|
+
(index: number) => setAttachments((current) => current.filter((_, itemIndex) => itemIndex !== index)),
|
|
170
|
+
[],
|
|
171
|
+
);
|
|
172
|
+
|
|
136
173
|
return (
|
|
137
174
|
<>
|
|
138
175
|
<ScrollView
|
|
@@ -167,17 +204,17 @@ export function ConversationChat({
|
|
|
167
204
|
<ConversationComposer
|
|
168
205
|
attachments={attachments}
|
|
169
206
|
canSend={canSend}
|
|
170
|
-
context={
|
|
207
|
+
context={composerContext}
|
|
171
208
|
draft={draft}
|
|
172
209
|
isSending={conversation.isSending}
|
|
173
210
|
onAddAttachments={addAttachments}
|
|
174
211
|
onAppendTranscript={appendTranscript}
|
|
175
212
|
onChangeDraft={setDraft}
|
|
176
|
-
onClearReply={
|
|
213
|
+
onClearReply={clearReply}
|
|
177
214
|
onImportFromDrive={onImportFromDrive}
|
|
178
215
|
onPickFiles={onPickFiles}
|
|
179
216
|
onPickPhotos={onPickPhotos}
|
|
180
|
-
onRemoveAttachment={
|
|
217
|
+
onRemoveAttachment={removeAttachment}
|
|
181
218
|
onSend={sendMessage}
|
|
182
219
|
onStartLiveVoice={onStartLiveVoice}
|
|
183
220
|
onStartVoiceInput={onStartVoiceInput}
|
|
@@ -206,7 +243,7 @@ function ConversationStates({ conversation }: { conversation: ConversationState
|
|
|
206
243
|
function LoadingPanel() {
|
|
207
244
|
return (
|
|
208
245
|
<View style={conversationStyles.statePanel}>
|
|
209
|
-
<ActivityIndicator color=
|
|
246
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} size="small" />
|
|
210
247
|
<Text style={conversationStyles.statePanelText}>Loading conversation...</Text>
|
|
211
248
|
</View>
|
|
212
249
|
);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useCallback, useState } from 'react';
|
|
2
|
+
import { themedColor } from './theme';
|
|
2
3
|
import { Alert, Pressable, Text, TextInput, View } from 'react-native';
|
|
3
4
|
import {
|
|
4
5
|
AudioLines,
|
|
@@ -174,7 +175,7 @@ export function ConversationComposer({
|
|
|
174
175
|
onChangeText={onChangeDraft}
|
|
175
176
|
onFocus={() => setIsAttachmentMenuOpen(false)}
|
|
176
177
|
placeholder="Ask Superagent"
|
|
177
|
-
placeholderTextColor=
|
|
178
|
+
placeholderTextColor={themedColor('#A1A1AA')}
|
|
178
179
|
style={composerStyles.input}
|
|
179
180
|
textAlignVertical="top"
|
|
180
181
|
value={draft}
|
|
@@ -185,7 +186,8 @@ export function ConversationComposer({
|
|
|
185
186
|
isLiveVoiceActive={liveVoiceState === 'processing'}
|
|
186
187
|
isVoiceInputActive={voiceState === 'processing'}
|
|
187
188
|
onSend={onSend}
|
|
188
|
-
|
|
189
|
+
onStartVoice={context.conversationId ? (onStartLiveVoice ? startLiveVoice : onStartVoiceInput ? startVoiceInput : undefined) : undefined}
|
|
190
|
+
voiceMode={context.conversationId ? (onStartLiveVoice ? 'live' : onStartVoiceInput ? 'input' : null) : null}
|
|
189
191
|
onStop={onStop}
|
|
190
192
|
isSending={isSending}
|
|
191
193
|
/>
|
|
@@ -266,7 +268,7 @@ function AttachmentMenuItem({
|
|
|
266
268
|
]}
|
|
267
269
|
>
|
|
268
270
|
<View style={composerStyles.attachmentMenuIcon}>
|
|
269
|
-
<Icon color={disabled ? '#8E8E93' : '#F4F4F5'} size={22} strokeWidth={2.2} />
|
|
271
|
+
<Icon color={disabled ? themedColor('#8E8E93') : themedColor('#F4F4F5')} size={22} strokeWidth={2.2} />
|
|
270
272
|
</View>
|
|
271
273
|
<Text style={[composerStyles.attachmentMenuItemText, disabled && composerStyles.attachmentMenuItemTextDisabled]}>
|
|
272
274
|
{label}
|
|
@@ -281,7 +283,7 @@ function ReplyPreview({ onClear, replyTo }: { onClear: () => void; replyTo: Supe
|
|
|
281
283
|
<View style={composerStyles.replyPreviewMarker} />
|
|
282
284
|
<Text numberOfLines={2} style={composerStyles.replyPreviewText}>{replyTo.content}</Text>
|
|
283
285
|
<Pressable accessibilityLabel="Clear reply" accessibilityRole="button" onPress={onClear} style={composerStyles.replyPreviewClose}>
|
|
284
|
-
<X color=
|
|
286
|
+
<X color={themedColor('#F4F4F5')} size={16} strokeWidth={2.6} />
|
|
285
287
|
</Pressable>
|
|
286
288
|
</View>
|
|
287
289
|
);
|
|
@@ -321,7 +323,8 @@ function ComposerActionButton({
|
|
|
321
323
|
isSending,
|
|
322
324
|
isVoiceInputActive,
|
|
323
325
|
onSend,
|
|
324
|
-
|
|
326
|
+
onStartVoice,
|
|
327
|
+
voiceMode,
|
|
325
328
|
onStop,
|
|
326
329
|
}: {
|
|
327
330
|
canSend: boolean;
|
|
@@ -330,28 +333,31 @@ function ComposerActionButton({
|
|
|
330
333
|
isSending: boolean;
|
|
331
334
|
isVoiceInputActive: boolean;
|
|
332
335
|
onSend: () => void;
|
|
333
|
-
|
|
336
|
+
onStartVoice?: () => void;
|
|
337
|
+
voiceMode: 'live' | 'input' | null;
|
|
334
338
|
onStop: () => void;
|
|
335
339
|
}) {
|
|
336
340
|
if (isSending) {
|
|
337
341
|
return (
|
|
338
342
|
<Pressable accessibilityLabel="Stop Superagent" accessibilityRole="button" onPress={onStop} style={composerStyles.stopButton}>
|
|
339
|
-
<Square color=
|
|
343
|
+
<Square color={themedColor('#111111')} fill={themedColor('#111111')} size={17} strokeWidth={2.2} />
|
|
340
344
|
</Pressable>
|
|
341
345
|
);
|
|
342
346
|
}
|
|
343
347
|
|
|
344
348
|
if (isDraftEmpty) {
|
|
345
|
-
const disabled = !
|
|
349
|
+
const disabled = !onStartVoice;
|
|
350
|
+
const isActive = voiceMode === 'live' ? isLiveVoiceActive : isVoiceInputActive;
|
|
351
|
+
const label = voiceMode === 'input' ? 'Start voice input' : 'Start Live Voice';
|
|
346
352
|
return (
|
|
347
|
-
<Pressable accessibilityLabel=
|
|
353
|
+
<Pressable accessibilityLabel={label} accessibilityRole="button" disabled={disabled} onPress={onStartVoice} style={({ pressed }) => [
|
|
348
354
|
composerStyles.sendButton,
|
|
349
355
|
composerStyles.liveActionButton,
|
|
350
|
-
|
|
356
|
+
isActive && composerStyles.activeButton,
|
|
351
357
|
disabled && composerStyles.sendButtonDisabled,
|
|
352
358
|
pressed && styles.pressed,
|
|
353
359
|
]}>
|
|
354
|
-
<AudioLines color={disabled ? '#8E8E93' : '#F4F4F5'} size={21} strokeWidth={2.4} />
|
|
360
|
+
<AudioLines color={disabled ? themedColor('#8E8E93') : themedColor('#F4F4F5')} size={21} strokeWidth={2.4} />
|
|
355
361
|
</Pressable>
|
|
356
362
|
);
|
|
357
363
|
}
|
|
@@ -362,7 +368,7 @@ function ComposerActionButton({
|
|
|
362
368
|
!canSend && composerStyles.sendButtonDisabled,
|
|
363
369
|
pressed && styles.pressed,
|
|
364
370
|
]}>
|
|
365
|
-
<Send color={canSend ? '#111111' : '#8E8E93'} size={19} strokeWidth={2.6} />
|
|
371
|
+
<Send color={canSend ? themedColor('#111111') : themedColor('#8E8E93')} size={19} strokeWidth={2.6} />
|
|
366
372
|
</Pressable>
|
|
367
373
|
);
|
|
368
374
|
}
|
|
@@ -34,7 +34,7 @@ export function ConversationMessageList({
|
|
|
34
34
|
conversationId: string | null;
|
|
35
35
|
currentUserAvatarUrl?: string | null;
|
|
36
36
|
messages: SuperagentMessage[];
|
|
37
|
-
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
37
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
38
38
|
onCopyMessage?: SuperagentCopyMessageInput;
|
|
39
39
|
onDeleteMessage?: (messageId: string) => Promise<boolean> | boolean;
|
|
40
40
|
onReplyMessage?: (message: SuperagentMessage) => void;
|
|
@@ -26,11 +26,13 @@ export function ConversationScreen({
|
|
|
26
26
|
connectedConnectors,
|
|
27
27
|
connectingConnectorId,
|
|
28
28
|
currentUserAvatarUrl,
|
|
29
|
+
currentUserId,
|
|
29
30
|
fileLoadError,
|
|
30
31
|
fileLoadFailed,
|
|
31
32
|
filePaths,
|
|
32
33
|
isLoadingAgentSettings,
|
|
33
34
|
isLoadingAutomations,
|
|
35
|
+
isLoadingChannels,
|
|
34
36
|
isLoadingCollaborators,
|
|
35
37
|
isLoadingConnectors,
|
|
36
38
|
isLoadingFiles,
|
|
@@ -101,6 +103,7 @@ export function ConversationScreen({
|
|
|
101
103
|
connectedConnectors: SuperagentHomeScreenProps['connectedConnectors'];
|
|
102
104
|
connectingConnectorId: SuperagentHomeScreenProps['connectingConnectorId'];
|
|
103
105
|
currentUserAvatarUrl: SuperagentHomeScreenProps['currentUserAvatarUrl'];
|
|
106
|
+
currentUserId: SuperagentHomeScreenProps['currentUserId'];
|
|
104
107
|
fileLoadError: SuperagentHomeScreenProps['fileLoadError'];
|
|
105
108
|
fileLoadFailed: SuperagentHomeScreenProps['fileLoadFailed'];
|
|
106
109
|
filePaths: SuperagentHomeScreenProps['filePaths'];
|
|
@@ -177,6 +180,7 @@ export function ConversationScreen({
|
|
|
177
180
|
const conversation = useSuperagentConversation({
|
|
178
181
|
agentId: agent.id,
|
|
179
182
|
apiClient,
|
|
183
|
+
currentUserId,
|
|
180
184
|
fallbackMessages: messages,
|
|
181
185
|
fallbackSending: isSending,
|
|
182
186
|
onAgentMessageDone,
|
|
@@ -246,6 +250,7 @@ export function ConversationScreen({
|
|
|
246
250
|
fileLoadFailed={fileLoadFailed}
|
|
247
251
|
filePaths={filePaths}
|
|
248
252
|
isLoadingAgentSettings={isLoadingAgentSettings}
|
|
253
|
+
isLoadingChannels={isLoadingChannels}
|
|
249
254
|
isLoadingCollaborators={isLoadingCollaborators}
|
|
250
255
|
isLoadingFiles={isLoadingFiles}
|
|
251
256
|
isLoadingAutomations={isLoadingAutomations}
|