@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/EditorDrawer.tsx
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { themedColor } from './theme';
|
|
3
|
+
import { ActivityIndicator, Image, Modal, Pressable, ScrollView, Text, TextInput, View } from 'react-native';
|
|
3
4
|
import {
|
|
4
5
|
AlertCircle,
|
|
5
6
|
Archive,
|
|
@@ -166,7 +167,7 @@ export function EditorDrawer({
|
|
|
166
167
|
onCancelConnectorConnection?: (input: { agentId: string; connectorId: string }) => void;
|
|
167
168
|
onArchiveAutomation?: (input: SuperagentAutomationActionInput) => Promise<void> | void;
|
|
168
169
|
onCloneAgent?: SuperagentHomeScreenProps['onCloneAgent'];
|
|
169
|
-
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
170
|
+
onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
170
171
|
onDeleteAgent?: SuperagentHomeScreenProps['onDeleteAgent'];
|
|
171
172
|
onDeleteAutomation?: (input: SuperagentAutomationActionInput) => Promise<void> | void;
|
|
172
173
|
onDeleteSecret?: SuperagentHomeScreenProps['onDeleteSecret'];
|
|
@@ -236,7 +237,7 @@ export function EditorDrawer({
|
|
|
236
237
|
editorShellStyles.closeButton,
|
|
237
238
|
pressed && styles.pressed,
|
|
238
239
|
]}>
|
|
239
|
-
<X color=
|
|
240
|
+
<X color={themedColor('#F4F4F5')} size={22} strokeWidth={2.5} />
|
|
240
241
|
</Pressable>
|
|
241
242
|
<View style={editorShellStyles.modalTitleWrap}>
|
|
242
243
|
<Text style={editorShellStyles.modalTitle}>Settings</Text>
|
|
@@ -387,7 +388,7 @@ function TasksPanel({
|
|
|
387
388
|
if (isLoading) {
|
|
388
389
|
return (
|
|
389
390
|
<View style={editorShellStyles.loadingPanel}>
|
|
390
|
-
<ActivityIndicator color=
|
|
391
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} />
|
|
391
392
|
<Text style={editorShellStyles.loadingText}>Loading automations...</Text>
|
|
392
393
|
</View>
|
|
393
394
|
);
|
|
@@ -457,9 +458,9 @@ function TasksPanel({
|
|
|
457
458
|
) : (
|
|
458
459
|
<View style={editorShellStyles.emptyPanel}>
|
|
459
460
|
{viewTab === 'archived' ? (
|
|
460
|
-
<Archive color=
|
|
461
|
+
<Archive color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
461
462
|
) : (
|
|
462
|
-
<Timer color=
|
|
463
|
+
<Timer color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
463
464
|
)}
|
|
464
465
|
<Text style={editorShellStyles.emptyTitle}>
|
|
465
466
|
{viewTab === 'archived' ? 'No archived automations' : 'No automations yet'}
|
|
@@ -528,7 +529,7 @@ function AutomationCard({
|
|
|
528
529
|
return (
|
|
529
530
|
<View style={editorShellStyles.automationCard}>
|
|
530
531
|
<View style={editorShellStyles.automationIcon}>
|
|
531
|
-
<Icon color=
|
|
532
|
+
<Icon color={themedColor('#F4F4F5')} size={19} strokeWidth={2.35} />
|
|
532
533
|
</View>
|
|
533
534
|
<View style={editorShellStyles.automationText}>
|
|
534
535
|
<View style={editorShellStyles.inlineTitleRow}>
|
|
@@ -551,7 +552,7 @@ function AutomationCard({
|
|
|
551
552
|
</Text>
|
|
552
553
|
) : null}
|
|
553
554
|
<View style={editorShellStyles.automationCreditBadge}>
|
|
554
|
-
<Coins color=
|
|
555
|
+
<Coins color={themedColor('#A1A1AA')} size={11} strokeWidth={2.4} />
|
|
555
556
|
<Text numberOfLines={1} style={editorShellStyles.automationCreditText}>
|
|
556
557
|
{credits ? `${formatCredits(credits.total)} credits used` : 'Consumes credits'}
|
|
557
558
|
</Text>
|
|
@@ -687,9 +688,9 @@ function AutomationActionButton({
|
|
|
687
688
|
]}
|
|
688
689
|
>
|
|
689
690
|
{isLoading ? (
|
|
690
|
-
<ActivityIndicator color={danger ? '#FCA5A5' : '#F4F4F5'} size="small" />
|
|
691
|
+
<ActivityIndicator color={danger ? themedColor('#FCA5A5') : themedColor('#F4F4F5')} size="small" />
|
|
691
692
|
) : (
|
|
692
|
-
<Icon color={danger ? '#FCA5A5' : '#F4F4F5'} size={13} strokeWidth={2.45} />
|
|
693
|
+
<Icon color={danger ? themedColor('#FCA5A5') : themedColor('#F4F4F5')} size={13} strokeWidth={2.45} />
|
|
693
694
|
)}
|
|
694
695
|
<Text style={[
|
|
695
696
|
editorShellStyles.automationActionText,
|
|
@@ -754,7 +755,7 @@ function ConnectorsPanel({
|
|
|
754
755
|
connectingConnectorId?: string | null;
|
|
755
756
|
isLoading?: boolean;
|
|
756
757
|
onCancel?: (input: { agentId: string; connectorId: string }) => void;
|
|
757
|
-
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
758
|
+
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
758
759
|
onDisconnect?: (input: SuperagentConnectorActionInput) => Promise<void> | void;
|
|
759
760
|
onRemove?: (input: SuperagentConnectorActionInput) => Promise<void> | void;
|
|
760
761
|
}) {
|
|
@@ -788,7 +789,7 @@ function ConnectorsPanel({
|
|
|
788
789
|
if (isLoading) {
|
|
789
790
|
return (
|
|
790
791
|
<View style={editorShellStyles.loadingPanel}>
|
|
791
|
-
<ActivityIndicator color=
|
|
792
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} />
|
|
792
793
|
<Text style={editorShellStyles.loadingText}>Loading connectors...</Text>
|
|
793
794
|
</View>
|
|
794
795
|
);
|
|
@@ -822,7 +823,7 @@ function ConnectorsPanel({
|
|
|
822
823
|
</View>
|
|
823
824
|
) : (
|
|
824
825
|
<View style={editorShellStyles.emptyPanel}>
|
|
825
|
-
<Plug color=
|
|
826
|
+
<Plug color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
826
827
|
<Text style={editorShellStyles.emptyTitle}>No connectors yet</Text>
|
|
827
828
|
<Text style={editorShellStyles.emptyBody}>Connect a service below to let this agent use it from chat.</Text>
|
|
828
829
|
</View>
|
|
@@ -838,14 +839,14 @@ function ConnectorsPanel({
|
|
|
838
839
|
<Text style={editorShellStyles.countBadge}>{available.length}</Text>
|
|
839
840
|
</View>
|
|
840
841
|
<View style={editorShellStyles.connectorSearchWrap}>
|
|
841
|
-
<Search color=
|
|
842
|
+
<Search color={themedColor('#A1A1AA')} size={16} strokeWidth={2.4} />
|
|
842
843
|
<TextInput
|
|
843
844
|
autoCapitalize="none"
|
|
844
845
|
autoCorrect={false}
|
|
845
846
|
clearButtonMode="while-editing"
|
|
846
847
|
onChangeText={setSearchQuery}
|
|
847
848
|
placeholder="Search connectors"
|
|
848
|
-
placeholderTextColor=
|
|
849
|
+
placeholderTextColor={themedColor('#8E8E93')}
|
|
849
850
|
returnKeyType="search"
|
|
850
851
|
style={editorShellStyles.connectorSearchInput}
|
|
851
852
|
value={searchQuery}
|
|
@@ -865,7 +866,7 @@ function ConnectorsPanel({
|
|
|
865
866
|
))
|
|
866
867
|
) : (
|
|
867
868
|
<View style={editorShellStyles.emptyPanel}>
|
|
868
|
-
<Search color=
|
|
869
|
+
<Search color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
869
870
|
<Text style={editorShellStyles.emptyTitle}>No matching connectors</Text>
|
|
870
871
|
<Text style={editorShellStyles.emptyBody}>Try a different connector name or category.</Text>
|
|
871
872
|
</View>
|
|
@@ -889,7 +890,7 @@ function ConnectedConnectorCard({
|
|
|
889
890
|
connector: SuperagentConnector;
|
|
890
891
|
isConnecting: boolean;
|
|
891
892
|
onCancel?: (input: { agentId: string; connectorId: string }) => void;
|
|
892
|
-
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
893
|
+
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
893
894
|
onDisconnect?: (input: SuperagentConnectorActionInput) => Promise<void> | void;
|
|
894
895
|
onRemove?: (input: SuperagentConnectorActionInput) => Promise<void> | void;
|
|
895
896
|
}) {
|
|
@@ -914,7 +915,7 @@ function ConnectedConnectorCard({
|
|
|
914
915
|
</View>
|
|
915
916
|
{isConnecting ? (
|
|
916
917
|
<View style={editorShellStyles.connectingWrap}>
|
|
917
|
-
<ActivityIndicator color=
|
|
918
|
+
<ActivityIndicator color={themedColor('#8B5CF6')} size="small" />
|
|
918
919
|
<Pressable
|
|
919
920
|
accessibilityLabel={`Cancel ${connector.name} connection`}
|
|
920
921
|
accessibilityRole="button"
|
|
@@ -935,13 +936,13 @@ function ConnectedConnectorCard({
|
|
|
935
936
|
pressed && styles.pressed,
|
|
936
937
|
]}
|
|
937
938
|
>
|
|
938
|
-
<MoreHorizontal color=
|
|
939
|
+
<MoreHorizontal color={themedColor('#E4E4E7')} size={19} strokeWidth={2.4} />
|
|
939
940
|
</Pressable>
|
|
940
941
|
</View>
|
|
941
942
|
)}
|
|
942
943
|
{menuOpen ? (
|
|
943
944
|
<View style={editorShellStyles.connectorMenu}>
|
|
944
|
-
{hasAccessModes && onConnect ? (
|
|
945
|
+
{hasAccessModes && onConnect && !connector.requiresConnectionConfig ? (
|
|
945
946
|
<MenuAction
|
|
946
947
|
label={oppositeMode === 'read_only' ? 'Switch to read only' : 'Switch to full access'}
|
|
947
948
|
onPress={() => {
|
|
@@ -956,19 +957,28 @@ function ConnectedConnectorCard({
|
|
|
956
957
|
}}
|
|
957
958
|
/>
|
|
958
959
|
) : null}
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
960
|
+
{connector.requiresConnectionConfig ? (
|
|
961
|
+
// Reconnect/Switch account re-runs the same OAuth initiate that the
|
|
962
|
+
// backend rejects without a connection_config this native tab can't
|
|
963
|
+
// collect yet. Steer to the web app instead of an action that fails.
|
|
964
|
+
<View style={editorShellStyles.menuAction}>
|
|
965
|
+
<Text style={editorShellStyles.connectorSubtitle}>Manage on the web app</Text>
|
|
966
|
+
</View>
|
|
967
|
+
) : (
|
|
968
|
+
<MenuAction
|
|
969
|
+
label={status === 'active' ? 'Switch account' : 'Reconnect'}
|
|
970
|
+
onPress={() => {
|
|
971
|
+
setMenuOpen(false);
|
|
972
|
+
onConnect?.({
|
|
973
|
+
accessMode: connector.accessMode ?? undefined,
|
|
974
|
+
agentId,
|
|
975
|
+
connectorId: connector.id,
|
|
976
|
+
forceReconnect: true,
|
|
977
|
+
scopes: connector.scopes?.length ? connector.scopes : getConnectorScopesForMode(connector, connector.accessMode ?? 'full_access'),
|
|
978
|
+
});
|
|
979
|
+
}}
|
|
980
|
+
/>
|
|
981
|
+
)}
|
|
972
982
|
{status !== 'disconnected' ? (
|
|
973
983
|
<MenuAction
|
|
974
984
|
destructive
|
|
@@ -1018,7 +1028,7 @@ function AvailableConnectorCard({
|
|
|
1018
1028
|
connector: SuperagentConnector;
|
|
1019
1029
|
isConnecting: boolean;
|
|
1020
1030
|
onCancel?: (input: { agentId: string; connectorId: string }) => void;
|
|
1021
|
-
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | void> | boolean | void;
|
|
1031
|
+
onConnect?: (input: SuperagentConnectorActionInput) => Promise<boolean | string | void> | boolean | string | void;
|
|
1022
1032
|
}) {
|
|
1023
1033
|
const [accessMode, setAccessMode] = useState<SuperagentConnectorAccessMode>(
|
|
1024
1034
|
connector.accessMode ?? 'full_access',
|
|
@@ -1034,7 +1044,7 @@ function AvailableConnectorCard({
|
|
|
1034
1044
|
</View>
|
|
1035
1045
|
{isConnecting ? (
|
|
1036
1046
|
<View style={editorShellStyles.connectingWrap}>
|
|
1037
|
-
<ActivityIndicator color=
|
|
1047
|
+
<ActivityIndicator color={themedColor('#8B5CF6')} size="small" />
|
|
1038
1048
|
<Pressable
|
|
1039
1049
|
accessibilityLabel={`Cancel ${connector.name} connection`}
|
|
1040
1050
|
accessibilityRole="button"
|
|
@@ -1049,7 +1059,7 @@ function AvailableConnectorCard({
|
|
|
1049
1059
|
<Pressable
|
|
1050
1060
|
accessibilityLabel={`Connect ${connector.name}`}
|
|
1051
1061
|
accessibilityRole="button"
|
|
1052
|
-
disabled={!onConnect}
|
|
1062
|
+
disabled={!onConnect || connector.requiresConnectionConfig}
|
|
1053
1063
|
onPress={() => onConnect?.({
|
|
1054
1064
|
accessMode,
|
|
1055
1065
|
agentId,
|
|
@@ -1058,13 +1068,19 @@ function AvailableConnectorCard({
|
|
|
1058
1068
|
})}
|
|
1059
1069
|
style={({ pressed }) => [
|
|
1060
1070
|
editorShellStyles.webConnectButton,
|
|
1061
|
-
!onConnect && editorShellStyles.disabledAction,
|
|
1071
|
+
(!onConnect || connector.requiresConnectionConfig) && editorShellStyles.disabledAction,
|
|
1062
1072
|
pressed && styles.pressed,
|
|
1063
1073
|
]}
|
|
1064
1074
|
>
|
|
1065
1075
|
<Text style={editorShellStyles.webConnectText}>Connect</Text>
|
|
1066
1076
|
</Pressable>
|
|
1067
|
-
{
|
|
1077
|
+
{connector.requiresConnectionConfig ? (
|
|
1078
|
+
// The backend's initiate route validates a required connection_config
|
|
1079
|
+
// (e.g. subdomain) that this native tab can't collect yet, so the
|
|
1080
|
+
// OAuth would fail before it starts. Steer the user to the web app
|
|
1081
|
+
// instead of offering a button that can't succeed.
|
|
1082
|
+
<Text style={editorShellStyles.connectorSubtitle}>Connect this from the web app</Text>
|
|
1083
|
+
) : hasAccessModes ? (
|
|
1068
1084
|
<View style={editorShellStyles.accessToggle}>
|
|
1069
1085
|
<AccessButton active={accessMode === 'read_only'} label="Read" onPress={() => setAccessMode('read_only')} />
|
|
1070
1086
|
<AccessButton active={accessMode === 'full_access'} label="Full" onPress={() => setAccessMode('full_access')} />
|
|
@@ -1245,13 +1261,22 @@ function ConnectorIcon({ connector }: { connector: SuperagentConnector }) {
|
|
|
1245
1261
|
const Icon = CONNECTOR_ICONS[connector.id] ?? Plug;
|
|
1246
1262
|
const iconBackgroundColor = connector.iconBackgroundColor ?? '#FFFFFF';
|
|
1247
1263
|
const hasBrandIcon = hasConnectorBrandIcon(connector.id);
|
|
1264
|
+
const [imageFailed, setImageFailed] = useState(false);
|
|
1265
|
+
const iconUrl = connector.iconUrl?.trim();
|
|
1248
1266
|
|
|
1249
1267
|
return (
|
|
1250
1268
|
<View style={[editorShellStyles.connectorIcon, { backgroundColor: iconBackgroundColor }]}>
|
|
1251
1269
|
{hasBrandIcon ? (
|
|
1252
1270
|
<ConnectorBrandIcon connectorId={connector.id} size={22} />
|
|
1271
|
+
) : iconUrl && !imageFailed ? (
|
|
1272
|
+
<Image
|
|
1273
|
+
onError={() => setImageFailed(true)}
|
|
1274
|
+
resizeMode="contain"
|
|
1275
|
+
source={{ uri: iconUrl }}
|
|
1276
|
+
style={editorShellStyles.connectorIconImage}
|
|
1277
|
+
/>
|
|
1253
1278
|
) : (
|
|
1254
|
-
<Icon color=
|
|
1279
|
+
<Icon color={themedColor('#111827')} size={20} strokeWidth={2.35} />
|
|
1255
1280
|
)}
|
|
1256
1281
|
</View>
|
|
1257
1282
|
);
|
|
@@ -1266,7 +1291,7 @@ function StatusBadge({ status }: { status: SuperagentConnector['status'] }) {
|
|
|
1266
1291
|
editorShellStyles.statusBadge,
|
|
1267
1292
|
isActive ? editorShellStyles.statusBadgeActive : isDisconnected ? editorShellStyles.statusBadgeDisconnected : editorShellStyles.statusBadgeWarning,
|
|
1268
1293
|
]}>
|
|
1269
|
-
<Icon color={isActive ? '#34D399' : isDisconnected ? '#A1A1AA' : '#FCA5A5'} size={11} strokeWidth={2.7} />
|
|
1294
|
+
<Icon color={isActive ? themedColor('#34D399') : isDisconnected ? themedColor('#A1A1AA') : themedColor('#FCA5A5')} size={11} strokeWidth={2.7} />
|
|
1270
1295
|
<Text style={[
|
|
1271
1296
|
editorShellStyles.statusBadgeText,
|
|
1272
1297
|
isActive ? editorShellStyles.statusBadgeTextActive : isDisconnected ? editorShellStyles.statusBadgeTextDisconnected : editorShellStyles.statusBadgeTextWarning,
|
|
@@ -1286,7 +1311,7 @@ function PlaceholderSettingsPanel({ tab }: { tab: SuperagentEditorTab }) {
|
|
|
1286
1311
|
return (
|
|
1287
1312
|
<View style={editorShellStyles.placeholderPanel}>
|
|
1288
1313
|
<View style={editorShellStyles.placeholderIcon}>
|
|
1289
|
-
<Icon color=
|
|
1314
|
+
<Icon color={themedColor('#FF5A1F')} size={24} strokeWidth={2.3} />
|
|
1290
1315
|
</View>
|
|
1291
1316
|
<Text style={editorShellStyles.placeholderTitle}>{label}</Text>
|
|
1292
1317
|
<Text style={editorShellStyles.placeholderBody}>
|
package/src/FilesPanel.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useMemo, useState } from 'react';
|
|
2
|
+
import { themedColor } from './theme';
|
|
2
3
|
import {
|
|
3
4
|
ActivityIndicator,
|
|
4
5
|
Image,
|
|
@@ -102,6 +103,19 @@ export function FilesPanel({
|
|
|
102
103
|
return;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
// Binary files (non-SVG images, PDFs) can't be read through the text-only
|
|
107
|
+
// sandbox content endpoint — it returns 415 for non-UTF-8 bytes — so don't
|
|
108
|
+
// fetch them. Open a placeholder instead of surfacing a confusing error;
|
|
109
|
+
// a real preview can return once a binary-safe read/download endpoint exists.
|
|
110
|
+
const category = getFileCategory(path);
|
|
111
|
+
const isBinaryUnreadable = (category === 'image' && getImageMimeType(path) !== 'image/svg+xml') || category === 'pdf';
|
|
112
|
+
if (isBinaryUnreadable) {
|
|
113
|
+
setFileError(null);
|
|
114
|
+
setOpenedFile({ content: '', path });
|
|
115
|
+
setDraftContent('');
|
|
116
|
+
return;
|
|
117
|
+
}
|
|
118
|
+
|
|
105
119
|
setLoadingPath(path);
|
|
106
120
|
setFileError(null);
|
|
107
121
|
try {
|
|
@@ -200,9 +214,9 @@ export function FilesPanel({
|
|
|
200
214
|
]}
|
|
201
215
|
>
|
|
202
216
|
{isUploading ? (
|
|
203
|
-
<ActivityIndicator color=
|
|
217
|
+
<ActivityIndicator color={themedColor('#F4F4F5')} size="small" />
|
|
204
218
|
) : (
|
|
205
|
-
<Upload color=
|
|
219
|
+
<Upload color={themedColor('#F4F4F5')} size={16} strokeWidth={2.4} />
|
|
206
220
|
)}
|
|
207
221
|
</Pressable>
|
|
208
222
|
<Pressable
|
|
@@ -217,23 +231,23 @@ export function FilesPanel({
|
|
|
217
231
|
]}
|
|
218
232
|
>
|
|
219
233
|
{isRefreshing || isLoading ? (
|
|
220
|
-
<ActivityIndicator color=
|
|
234
|
+
<ActivityIndicator color={themedColor('#F4F4F5')} size="small" />
|
|
221
235
|
) : (
|
|
222
|
-
<RefreshCw color=
|
|
236
|
+
<RefreshCw color={themedColor('#F4F4F5')} size={16} strokeWidth={2.4} />
|
|
223
237
|
)}
|
|
224
238
|
</Pressable>
|
|
225
239
|
</View>
|
|
226
240
|
</View>
|
|
227
241
|
|
|
228
242
|
<View style={editorShellStyles.fileSearchWrap}>
|
|
229
|
-
<Search color=
|
|
243
|
+
<Search color={themedColor('#A1A1AA')} size={16} strokeWidth={2.4} />
|
|
230
244
|
<TextInput
|
|
231
245
|
autoCapitalize="none"
|
|
232
246
|
autoCorrect={false}
|
|
233
247
|
clearButtonMode="while-editing"
|
|
234
248
|
onChangeText={setQuery}
|
|
235
249
|
placeholder="Search files"
|
|
236
|
-
placeholderTextColor=
|
|
250
|
+
placeholderTextColor={themedColor('#8E8E93')}
|
|
237
251
|
returnKeyType="search"
|
|
238
252
|
style={editorShellStyles.fileSearchInput}
|
|
239
253
|
value={query}
|
|
@@ -244,7 +258,7 @@ export function FilesPanel({
|
|
|
244
258
|
{uploadStatus ? <Text style={editorShellStyles.fileStatusText}>{uploadStatus}</Text> : null}
|
|
245
259
|
{fileLoadFailed ? (
|
|
246
260
|
<View style={editorShellStyles.fileStatusBanner}>
|
|
247
|
-
<AlertCircle color=
|
|
261
|
+
<AlertCircle color={themedColor('#FBBF24')} size={15} strokeWidth={2.4} />
|
|
248
262
|
<Text style={editorShellStyles.fileStatusBannerText}>
|
|
249
263
|
Files API did not return a list. Showing the default sandbox folders.
|
|
250
264
|
</Text>
|
|
@@ -256,12 +270,12 @@ export function FilesPanel({
|
|
|
256
270
|
|
|
257
271
|
{isLoading ? (
|
|
258
272
|
<View style={editorShellStyles.loadingPanel}>
|
|
259
|
-
<ActivityIndicator color=
|
|
273
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} />
|
|
260
274
|
<Text style={editorShellStyles.loadingText}>Loading files...</Text>
|
|
261
275
|
</View>
|
|
262
276
|
) : fileCount === 0 && folderCount === 0 && tree.length === 0 ? (
|
|
263
277
|
<View style={editorShellStyles.emptyPanel}>
|
|
264
|
-
<Folder color=
|
|
278
|
+
<Folder color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
265
279
|
<Text style={editorShellStyles.emptyTitle}>No files yet</Text>
|
|
266
280
|
<Text style={editorShellStyles.emptyBody}>Generated and uploaded sandbox files will appear here.</Text>
|
|
267
281
|
</View>
|
|
@@ -279,7 +293,7 @@ export function FilesPanel({
|
|
|
279
293
|
))
|
|
280
294
|
) : (
|
|
281
295
|
<View style={editorShellStyles.emptyPanel}>
|
|
282
|
-
<Search color=
|
|
296
|
+
<Search color={themedColor('#8E8E93')} size={22} strokeWidth={2.2} />
|
|
283
297
|
<Text style={editorShellStyles.emptyTitle}>No matching files</Text>
|
|
284
298
|
<Text style={editorShellStyles.emptyBody}>Try another folder or file name.</Text>
|
|
285
299
|
</View>
|
|
@@ -350,11 +364,11 @@ function FileTreeNode({
|
|
|
350
364
|
]}
|
|
351
365
|
>
|
|
352
366
|
{expanded ? (
|
|
353
|
-
<ChevronDown color=
|
|
367
|
+
<ChevronDown color={themedColor('#8E8E93')} size={16} strokeWidth={2.5} />
|
|
354
368
|
) : (
|
|
355
|
-
<ChevronRight color=
|
|
369
|
+
<ChevronRight color={themedColor('#8E8E93')} size={16} strokeWidth={2.5} />
|
|
356
370
|
)}
|
|
357
|
-
<Folder color=
|
|
371
|
+
<Folder color={themedColor('#F59E0B')} size={17} strokeWidth={2.3} />
|
|
358
372
|
<Text numberOfLines={1} style={editorShellStyles.fileFolderName}>{node.name}</Text>
|
|
359
373
|
<Text style={editorShellStyles.fileFolderCount}>{flattenFileTree(node.children ?? []).length}</Text>
|
|
360
374
|
</Pressable>
|
|
@@ -397,7 +411,7 @@ function FileSearchRow({
|
|
|
397
411
|
<Text numberOfLines={1} style={editorShellStyles.fileName}>{getFileName(path)}</Text>
|
|
398
412
|
<Text numberOfLines={1} style={editorShellStyles.filePath}>{getFolderPath(path) || 'root'}</Text>
|
|
399
413
|
</View>
|
|
400
|
-
{isLoading ? <ActivityIndicator color=
|
|
414
|
+
{isLoading ? <ActivityIndicator color={themedColor('#F4F4F5')} size="small" /> : null}
|
|
401
415
|
</Pressable>
|
|
402
416
|
);
|
|
403
417
|
}
|
|
@@ -425,7 +439,7 @@ function FileTreeRow({
|
|
|
425
439
|
>
|
|
426
440
|
<FileKindIcon path={path} />
|
|
427
441
|
<Text numberOfLines={1} style={editorShellStyles.fileName}>{getFileName(path)}</Text>
|
|
428
|
-
{isLoading ? <ActivityIndicator color=
|
|
442
|
+
{isLoading ? <ActivityIndicator color={themedColor('#F4F4F5')} size="small" /> : null}
|
|
429
443
|
</Pressable>
|
|
430
444
|
);
|
|
431
445
|
}
|
|
@@ -440,7 +454,7 @@ function FileKindIcon({ path }: { path: string }) {
|
|
|
440
454
|
? FileText
|
|
441
455
|
: File;
|
|
442
456
|
|
|
443
|
-
return <Icon color={category === 'image' ? '#67E8F9' : '#A1A1AA'} size={16} strokeWidth={2.3} />;
|
|
457
|
+
return <Icon color={category === 'image' ? themedColor('#67E8F9') : themedColor('#A1A1AA')} size={16} strokeWidth={2.3} />;
|
|
444
458
|
}
|
|
445
459
|
|
|
446
460
|
function FileEditorModal({
|
|
@@ -476,7 +490,7 @@ function FileEditorModal({
|
|
|
476
490
|
onPress={onClose}
|
|
477
491
|
style={({ pressed }) => [editorShellStyles.fileIconButton, pressed && styles.pressed]}
|
|
478
492
|
>
|
|
479
|
-
<X color=
|
|
493
|
+
<X color={themedColor('#F4F4F5')} size={18} strokeWidth={2.5} />
|
|
480
494
|
</Pressable>
|
|
481
495
|
<View style={editorShellStyles.fileModalTitleWrap}>
|
|
482
496
|
<Text numberOfLines={1} style={editorShellStyles.fileModalTitle}>{getFileName(file.path)}</Text>
|
|
@@ -495,9 +509,9 @@ function FileEditorModal({
|
|
|
495
509
|
]}
|
|
496
510
|
>
|
|
497
511
|
{isSaving ? (
|
|
498
|
-
<ActivityIndicator color=
|
|
512
|
+
<ActivityIndicator color={themedColor('#111111')} size="small" />
|
|
499
513
|
) : (
|
|
500
|
-
<Save color=
|
|
514
|
+
<Save color={themedColor('#111111')} size={16} strokeWidth={2.5} />
|
|
501
515
|
)}
|
|
502
516
|
<Text style={editorShellStyles.fileSaveText}>Save</Text>
|
|
503
517
|
</Pressable>
|
|
@@ -535,6 +549,20 @@ function FileContentView({
|
|
|
535
549
|
path: string;
|
|
536
550
|
}) {
|
|
537
551
|
if (category === 'image' && getImageMimeType(path) !== 'image/svg+xml') {
|
|
552
|
+
// Binary images open without content (the text content endpoint can't return
|
|
553
|
+
// them); show a placeholder rather than a broken image. If a binary-safe
|
|
554
|
+
// endpoint later supplies base64/data-URI content, render it.
|
|
555
|
+
if (!content) {
|
|
556
|
+
return (
|
|
557
|
+
<View style={editorShellStyles.fileUnsupportedPreview}>
|
|
558
|
+
<File color={themedColor('#A1A1AA')} size={32} strokeWidth={2.2} />
|
|
559
|
+
<Text style={editorShellStyles.fileUnsupportedTitle}>Image preview</Text>
|
|
560
|
+
<Text style={editorShellStyles.fileUnsupportedBody}>
|
|
561
|
+
This file is available in the sandbox. Open it in the web app to view it — native preview of binary files isn't enabled in this build yet.
|
|
562
|
+
</Text>
|
|
563
|
+
</View>
|
|
564
|
+
);
|
|
565
|
+
}
|
|
538
566
|
const source = content.startsWith('data:')
|
|
539
567
|
? content
|
|
540
568
|
: `data:${getImageMimeType(path)};base64,${content}`;
|
|
@@ -548,7 +576,7 @@ function FileContentView({
|
|
|
548
576
|
if (category === 'pdf') {
|
|
549
577
|
return (
|
|
550
578
|
<View style={editorShellStyles.fileUnsupportedPreview}>
|
|
551
|
-
<File color=
|
|
579
|
+
<File color={themedColor('#A1A1AA')} size={32} strokeWidth={2.2} />
|
|
552
580
|
<Text style={editorShellStyles.fileUnsupportedTitle}>PDF preview</Text>
|
|
553
581
|
<Text style={editorShellStyles.fileUnsupportedBody}>
|
|
554
582
|
This file is available in the sandbox. Native PDF viewing is not enabled in this build yet.
|
package/src/RenameAgentModal.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useState } from 'react';
|
|
2
|
+
import { themedColor } from './theme';
|
|
2
3
|
import {
|
|
3
4
|
KeyboardAvoidingView,
|
|
4
5
|
Modal,
|
|
@@ -65,7 +66,7 @@ export function RenameAgentModal({
|
|
|
65
66
|
}}
|
|
66
67
|
onSubmitEditing={save}
|
|
67
68
|
placeholder="Superagent name"
|
|
68
|
-
placeholderTextColor=
|
|
69
|
+
placeholderTextColor={themedColor('#8E8E93')}
|
|
69
70
|
returnKeyType="done"
|
|
70
71
|
selectTextOnFocus
|
|
71
72
|
style={styles.input}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { StyleSheet } from 'react-native';
|
|
2
|
+
import { createThemedStyles } from './theme';
|
|
2
3
|
|
|
3
|
-
export const shareAgentModalStyles =
|
|
4
|
+
export const shareAgentModalStyles = createThemedStyles({
|
|
4
5
|
agentTitle: { alignItems: 'center', flex: 1, flexDirection: 'row', minWidth: 0 },
|
|
5
6
|
avatarImage: { height: '100%', width: '100%' },
|
|
6
7
|
avatarWrap: {
|
package/src/ShareAgentModal.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import { themedColor } from './theme';
|
|
2
3
|
import {
|
|
3
4
|
ActivityIndicator,
|
|
4
5
|
Image,
|
|
@@ -143,14 +144,14 @@ export function ShareAgentModal({
|
|
|
143
144
|
<View style={localStyles.agentTitle}>
|
|
144
145
|
<AgentSphereIcon agent={agent} size="md" />
|
|
145
146
|
<View style={localStyles.titleTextWrap}>
|
|
146
|
-
<Text numberOfLines={1} style={localStyles.title}>
|
|
147
|
+
<Text numberOfLines={1} style={localStyles.title}>Invite collaborator</Text>
|
|
147
148
|
<Text numberOfLines={1} style={localStyles.subtitle}>
|
|
148
149
|
{memberCount === 1 ? '1 person has access' : `${memberCount} people have access`}
|
|
149
150
|
</Text>
|
|
150
151
|
</View>
|
|
151
152
|
</View>
|
|
152
153
|
<Pressable accessibilityLabel="Close share" accessibilityRole="button" onPress={onClose} style={localStyles.closeButton}>
|
|
153
|
-
<X color=
|
|
154
|
+
<X color={themedColor('#F4F4F5')} size={20} strokeWidth={2.4} />
|
|
154
155
|
</Pressable>
|
|
155
156
|
</View>
|
|
156
157
|
<View style={localStyles.inputCard}>
|
|
@@ -163,7 +164,7 @@ export function ShareAgentModal({
|
|
|
163
164
|
multiline
|
|
164
165
|
onChangeText={setEmailText}
|
|
165
166
|
placeholder="name@company.com"
|
|
166
|
-
placeholderTextColor=
|
|
167
|
+
placeholderTextColor={themedColor('#71717A')}
|
|
167
168
|
style={localStyles.input}
|
|
168
169
|
value={emailText}
|
|
169
170
|
/>
|
|
@@ -180,7 +181,7 @@ export function ShareAgentModal({
|
|
|
180
181
|
pressed && sharedStyles.pressed,
|
|
181
182
|
]}
|
|
182
183
|
>
|
|
183
|
-
{isInviting ? <ActivityIndicator color=
|
|
184
|
+
{isInviting ? <ActivityIndicator color={themedColor('#111111')} size="small" /> : <MailPlus color={themedColor('#111111')} size={18} strokeWidth={2.5} />}
|
|
184
185
|
<Text style={localStyles.inviteButtonText}>Invite</Text>
|
|
185
186
|
</Pressable>
|
|
186
187
|
</View>
|
|
@@ -208,7 +209,7 @@ export function ShareAgentModal({
|
|
|
208
209
|
pressed && sharedStyles.pressed,
|
|
209
210
|
]}
|
|
210
211
|
>
|
|
211
|
-
{isInviting ? <ActivityIndicator color=
|
|
212
|
+
{isInviting ? <ActivityIndicator color={themedColor('#111111')} size="small" /> : <UserPlus color={themedColor('#111111')} size={16} strokeWidth={2.6} />}
|
|
212
213
|
<Text style={localStyles.guestPrimaryButtonText}>Add as guest</Text>
|
|
213
214
|
</Pressable>
|
|
214
215
|
<Pressable
|
|
@@ -222,7 +223,7 @@ export function ShareAgentModal({
|
|
|
222
223
|
pressed && sharedStyles.pressed,
|
|
223
224
|
]}
|
|
224
225
|
>
|
|
225
|
-
<Building2 color=
|
|
226
|
+
<Building2 color={themedColor('#F4F4F5')} size={16} strokeWidth={2.3} />
|
|
226
227
|
<Text style={localStyles.guestSecondaryButtonText}>Add to workspace</Text>
|
|
227
228
|
</Pressable>
|
|
228
229
|
</View>
|
|
@@ -230,7 +231,7 @@ export function ShareAgentModal({
|
|
|
230
231
|
) : null}
|
|
231
232
|
<View style={localStyles.membersHeader}>
|
|
232
233
|
<Text style={localStyles.membersTitle}>People</Text>
|
|
233
|
-
{isLoading ? <ActivityIndicator color=
|
|
234
|
+
{isLoading ? <ActivityIndicator color={themedColor('#F4F4F5')} size="small" /> : null}
|
|
234
235
|
</View>
|
|
235
236
|
<ScrollView contentContainerStyle={localStyles.membersList} showsVerticalScrollIndicator={false}>
|
|
236
237
|
{collaborators.map((collaborator) => (
|
|
@@ -253,7 +254,7 @@ function CollaboratorRow({collaborator}: {collaborator: SuperagentCollaborator})
|
|
|
253
254
|
{collaborator.profile_image_url && !collaborator.is_pending ? (
|
|
254
255
|
<Image source={{uri: collaborator.profile_image_url}} style={localStyles.avatarImage} />
|
|
255
256
|
) : (
|
|
256
|
-
<User color=
|
|
257
|
+
<User color={themedColor('#F4F4F5')} size={17} strokeWidth={2.2} />
|
|
257
258
|
)}
|
|
258
259
|
</View>
|
|
259
260
|
<View style={localStyles.memberTextWrap}>
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
2
|
+
import {
|
|
3
|
+
SuperagentThemeContext,
|
|
4
|
+
syncSuperagentColorScheme,
|
|
5
|
+
themedColor,
|
|
6
|
+
type SuperagentColorScheme,
|
|
7
|
+
} from './theme';
|
|
2
8
|
import {
|
|
3
9
|
ActivityIndicator,
|
|
4
10
|
SafeAreaView,
|
|
@@ -15,7 +21,23 @@ import type { SuperagentAgent, SuperagentHomeScreenProps, SuperagentRoute } from
|
|
|
15
21
|
const DEFAULT_ROUTE: SuperagentRoute = { name: 'home' };
|
|
16
22
|
|
|
17
23
|
export function SuperagentHomeScreen(props: SuperagentHomeScreenProps) {
|
|
18
|
-
|
|
24
|
+
const [scheme, setSchemeState] = useState<SuperagentColorScheme>(props.defaultColorScheme ?? 'light');
|
|
25
|
+
// Sync the module-level scheme during render so themed styles resolve
|
|
26
|
+
// correctly for the whole subtree rendered after this point.
|
|
27
|
+
syncSuperagentColorScheme(scheme);
|
|
28
|
+
|
|
29
|
+
const { onColorSchemeChange } = props;
|
|
30
|
+
const setScheme = useCallback((next: SuperagentColorScheme) => {
|
|
31
|
+
setSchemeState(next);
|
|
32
|
+
onColorSchemeChange?.(next);
|
|
33
|
+
}, [onColorSchemeChange]);
|
|
34
|
+
const themeContextValue = useMemo(() => ({ scheme, setScheme }), [scheme, setScheme]);
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<SuperagentThemeContext.Provider value={themeContextValue}>
|
|
38
|
+
<SuperagentHomeScreenContent {...props} />
|
|
39
|
+
</SuperagentThemeContext.Provider>
|
|
40
|
+
);
|
|
19
41
|
}
|
|
20
42
|
|
|
21
43
|
function SuperagentHomeScreenContent({
|
|
@@ -39,6 +61,7 @@ function SuperagentHomeScreenContent({
|
|
|
39
61
|
isSendingMessage = false,
|
|
40
62
|
navigationMode = 'internal',
|
|
41
63
|
currentUserAvatarUrl,
|
|
64
|
+
currentUserId,
|
|
42
65
|
currentUserName,
|
|
43
66
|
fileLoadError,
|
|
44
67
|
fileLoadFailed,
|
|
@@ -177,6 +200,7 @@ function SuperagentHomeScreenContent({
|
|
|
177
200
|
connectedConnectors={connectedConnectors}
|
|
178
201
|
connectingConnectorId={connectingConnectorId}
|
|
179
202
|
currentUserAvatarUrl={currentUserAvatarUrl}
|
|
203
|
+
currentUserId={currentUserId}
|
|
180
204
|
fileLoadError={fileLoadError}
|
|
181
205
|
fileLoadFailed={fileLoadFailed}
|
|
182
206
|
filePaths={filePaths}
|
|
@@ -274,15 +298,11 @@ function SuperagentHomeScreenContent({
|
|
|
274
298
|
</View>
|
|
275
299
|
</View>
|
|
276
300
|
<ScrollView contentContainerStyle={styles.container}>
|
|
277
|
-
<
|
|
278
|
-
<Text style={styles.subtitle}>
|
|
279
|
-
{currentUserName ? `Ready when you are, ${currentUserName}.` : 'Agents, tools, and tasks.'}
|
|
280
|
-
</Text>
|
|
281
|
-
</View>
|
|
301
|
+
<Text style={styles.homeTitle}>Pick up where you left off</Text>
|
|
282
302
|
|
|
283
303
|
{isLoading ? (
|
|
284
304
|
<View style={styles.loadingPanel}>
|
|
285
|
-
<ActivityIndicator color=
|
|
305
|
+
<ActivityIndicator color={themedColor('#FF5A1F')} />
|
|
286
306
|
</View>
|
|
287
307
|
) : latestAgent ? (
|
|
288
308
|
<AgentCard
|