@base44/superagent-native 0.0.2 → 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/lib/commonjs/AgentSettingsPanel.js +123 -47
- 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 +3 -2
- 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 +11 -2
- package/lib/commonjs/ConversationChat.js.map +1 -1
- package/lib/commonjs/ConversationComposer.js +8 -7
- package/lib/commonjs/ConversationComposer.js.map +1 -1
- package/lib/commonjs/ConversationScreen.js +2 -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/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 +27 -9
- package/lib/commonjs/SuperagentHomeScreen.js.map +1 -1
- package/lib/commonjs/ToolApprovalCard.js +72 -14
- package/lib/commonjs/ToolApprovalCard.js.map +1 -1
- package/lib/commonjs/ToolCallSummary.js +14 -9
- 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/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 +120 -12
- 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/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 +71 -60
- 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 +133 -20
- package/lib/commonjs/useSuperagentConversation.js.map +1 -1
- package/lib/commonjs/useSuperagentRuntime.js +167 -82
- package/lib/commonjs/useSuperagentRuntime.js.map +1 -1
- package/lib/module/AgentSettingsPanel.js +125 -49
- 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 +4 -3
- 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 +11 -2
- package/lib/module/ConversationChat.js.map +1 -1
- package/lib/module/ConversationComposer.js +8 -7
- package/lib/module/ConversationComposer.js.map +1 -1
- package/lib/module/ConversationScreen.js +2 -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/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 +27 -9
- package/lib/module/SuperagentHomeScreen.js.map +1 -1
- package/lib/module/ToolApprovalCard.js +72 -14
- package/lib/module/ToolApprovalCard.js.map +1 -1
- package/lib/module/ToolCallSummary.js +14 -9
- 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/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 +118 -12
- 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/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 +71 -60
- 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 +135 -22
- package/lib/module/useSuperagentConversation.js.map +1 -1
- package/lib/module/useSuperagentRuntime.js +167 -82
- 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 +6 -1
- 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/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 +16 -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 +2 -1
- 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 +6 -1
- 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/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 +16 -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 +2 -1
- package/lib/typescript/module/useSuperagentRuntime.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/AgentSettingsPanel.tsx +118 -49
- package/src/AgentSphereIcon.tsx +11 -62
- package/src/AttachmentPickerStatusModal.tsx +4 -3
- package/src/ChannelsPanel.tsx +59 -39
- package/src/ConversationChat.tsx +12 -3
- package/src/ConversationComposer.tsx +7 -6
- package/src/ConversationMessageList.tsx +1 -1
- package/src/ConversationScreen.tsx +3 -0
- package/src/EditorDrawer.tsx +66 -41
- package/src/FilesPanel.tsx +48 -20
- package/src/RenameAgentModal.tsx +2 -1
- package/src/ShareAgentModal.styles.ts +2 -1
- package/src/ShareAgentModal.tsx +9 -8
- package/src/SuperagentHomeScreen.tsx +27 -7
- package/src/ToolApprovalCard.tsx +82 -14
- package/src/ToolCallSummary.tsx +18 -12
- package/src/agentSphereAssets.ts +325 -0
- package/src/agentSphereStyles.ts +3 -2
- package/src/apiClient.ts +7 -0
- 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 +123 -12
- package/src/conversationStyles.ts +2 -1
- package/src/editorShellStyles.ts +6 -1
- 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 +63 -54
- package/src/superagentApiClient.ts +68 -18
- package/src/theme.ts +254 -0
- package/src/types.ts +21 -2
- package/src/useSuperagentConversation.ts +141 -24
- package/src/useSuperagentRuntime.ts +165 -84
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;
|
|
@@ -116,6 +117,7 @@ export function ConversationChat({
|
|
|
116
117
|
const sendMessage = useCallback(async () => {
|
|
117
118
|
const selectedAttachments = attachments;
|
|
118
119
|
const selectedReplyTo = replyTo;
|
|
120
|
+
const selectedDraft = draft;
|
|
119
121
|
const content = draft.trim() || buildAttachmentPrompt(selectedAttachments);
|
|
120
122
|
// Don't send (and clear the composer) until the conversation is ready — while
|
|
121
123
|
// it's still loading or failed to init the hook can't reach the server and
|
|
@@ -126,10 +128,17 @@ export function ConversationChat({
|
|
|
126
128
|
setAttachments([]);
|
|
127
129
|
setReplyTo(null);
|
|
128
130
|
|
|
129
|
-
await conversation.sendMessage(content, {
|
|
131
|
+
const delivered = await conversation.sendMessage(content, {
|
|
130
132
|
fileUrls: selectedAttachments.map((attachment) => attachment.url),
|
|
131
133
|
replyTo: selectedReplyTo ?? undefined,
|
|
132
134
|
});
|
|
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
|
+
}
|
|
133
142
|
}, [attachments, conversation, conversationUnavailable, draft, replyTo]);
|
|
134
143
|
|
|
135
144
|
const addAttachments = useCallback((incoming: SuperagentMediaAttachment[]) => {
|
|
@@ -234,7 +243,7 @@ function ConversationStates({ conversation }: { conversation: ConversationState
|
|
|
234
243
|
function LoadingPanel() {
|
|
235
244
|
return (
|
|
236
245
|
<View style={conversationStyles.statePanel}>
|
|
237
|
-
<ActivityIndicator color=
|
|
246
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} size="small" />
|
|
238
247
|
<Text style={conversationStyles.statePanelText}>Loading conversation...</Text>
|
|
239
248
|
</View>
|
|
240
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}
|
|
@@ -267,7 +268,7 @@ function AttachmentMenuItem({
|
|
|
267
268
|
]}
|
|
268
269
|
>
|
|
269
270
|
<View style={composerStyles.attachmentMenuIcon}>
|
|
270
|
-
<Icon color={disabled ? '#8E8E93' : '#F4F4F5'} size={22} strokeWidth={2.2} />
|
|
271
|
+
<Icon color={disabled ? themedColor('#8E8E93') : themedColor('#F4F4F5')} size={22} strokeWidth={2.2} />
|
|
271
272
|
</View>
|
|
272
273
|
<Text style={[composerStyles.attachmentMenuItemText, disabled && composerStyles.attachmentMenuItemTextDisabled]}>
|
|
273
274
|
{label}
|
|
@@ -282,7 +283,7 @@ function ReplyPreview({ onClear, replyTo }: { onClear: () => void; replyTo: Supe
|
|
|
282
283
|
<View style={composerStyles.replyPreviewMarker} />
|
|
283
284
|
<Text numberOfLines={2} style={composerStyles.replyPreviewText}>{replyTo.content}</Text>
|
|
284
285
|
<Pressable accessibilityLabel="Clear reply" accessibilityRole="button" onPress={onClear} style={composerStyles.replyPreviewClose}>
|
|
285
|
-
<X color=
|
|
286
|
+
<X color={themedColor('#F4F4F5')} size={16} strokeWidth={2.6} />
|
|
286
287
|
</Pressable>
|
|
287
288
|
</View>
|
|
288
289
|
);
|
|
@@ -339,7 +340,7 @@ function ComposerActionButton({
|
|
|
339
340
|
if (isSending) {
|
|
340
341
|
return (
|
|
341
342
|
<Pressable accessibilityLabel="Stop Superagent" accessibilityRole="button" onPress={onStop} style={composerStyles.stopButton}>
|
|
342
|
-
<Square color=
|
|
343
|
+
<Square color={themedColor('#111111')} fill={themedColor('#111111')} size={17} strokeWidth={2.2} />
|
|
343
344
|
</Pressable>
|
|
344
345
|
);
|
|
345
346
|
}
|
|
@@ -356,7 +357,7 @@ function ComposerActionButton({
|
|
|
356
357
|
disabled && composerStyles.sendButtonDisabled,
|
|
357
358
|
pressed && styles.pressed,
|
|
358
359
|
]}>
|
|
359
|
-
<AudioLines color={disabled ? '#8E8E93' : '#F4F4F5'} size={21} strokeWidth={2.4} />
|
|
360
|
+
<AudioLines color={disabled ? themedColor('#8E8E93') : themedColor('#F4F4F5')} size={21} strokeWidth={2.4} />
|
|
360
361
|
</Pressable>
|
|
361
362
|
);
|
|
362
363
|
}
|
|
@@ -367,7 +368,7 @@ function ComposerActionButton({
|
|
|
367
368
|
!canSend && composerStyles.sendButtonDisabled,
|
|
368
369
|
pressed && styles.pressed,
|
|
369
370
|
]}>
|
|
370
|
-
<Send color={canSend ? '#111111' : '#8E8E93'} size={19} strokeWidth={2.6} />
|
|
371
|
+
<Send color={canSend ? themedColor('#111111') : themedColor('#8E8E93')} size={19} strokeWidth={2.6} />
|
|
371
372
|
</Pressable>
|
|
372
373
|
);
|
|
373
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,6 +26,7 @@ export function ConversationScreen({
|
|
|
26
26
|
connectedConnectors,
|
|
27
27
|
connectingConnectorId,
|
|
28
28
|
currentUserAvatarUrl,
|
|
29
|
+
currentUserId,
|
|
29
30
|
fileLoadError,
|
|
30
31
|
fileLoadFailed,
|
|
31
32
|
filePaths,
|
|
@@ -102,6 +103,7 @@ export function ConversationScreen({
|
|
|
102
103
|
connectedConnectors: SuperagentHomeScreenProps['connectedConnectors'];
|
|
103
104
|
connectingConnectorId: SuperagentHomeScreenProps['connectingConnectorId'];
|
|
104
105
|
currentUserAvatarUrl: SuperagentHomeScreenProps['currentUserAvatarUrl'];
|
|
106
|
+
currentUserId: SuperagentHomeScreenProps['currentUserId'];
|
|
105
107
|
fileLoadError: SuperagentHomeScreenProps['fileLoadError'];
|
|
106
108
|
fileLoadFailed: SuperagentHomeScreenProps['fileLoadFailed'];
|
|
107
109
|
filePaths: SuperagentHomeScreenProps['filePaths'];
|
|
@@ -178,6 +180,7 @@ export function ConversationScreen({
|
|
|
178
180
|
const conversation = useSuperagentConversation({
|
|
179
181
|
agentId: agent.id,
|
|
180
182
|
apiClient,
|
|
183
|
+
currentUserId,
|
|
181
184
|
fallbackMessages: messages,
|
|
182
185
|
fallbackSending: isSending,
|
|
183
186
|
onAgentMessageDone,
|