import type { ComponentType, ReactNode } from 'react'; import type { SuperagentColorScheme } from './theme'; import type { SuperagentSessionConfig, SuperagentShellAdapters } from './runtime/useSuperagentRuntime'; /** * The host build flavor. Drives environment-dependent behavior inside the package * (e.g. surfacing raw tool-call debug payloads off `'production'`). Distinct from * `session.baseUrl` — the host still owns which API origin each flavor points at. */ export type SuperagentEnvironment = 'local' | 'preview' | 'production'; export type SuperagentToolCall = { id?: string; name: string; arguments?: Record | string; arguments_string?: string; results?: string | Record; status?: string; user_input?: unknown; grouped?: boolean; toolCalls?: SuperagentToolCall[]; [key: string]: unknown; }; export type SuperagentReplyTo = { messageId?: string; content: string; }; export type SuperagentAgent = { id: string; name: string; ownerId?: string; createdBy?: string; description?: string; emoji?: string | null; logoUrl?: string; model?: SuperagentModelChoice | string | null; automationModel?: SuperagentModelChoice | string | null; organizationId?: string | null; toolsPermissionConfig?: SuperagentToolPermissionConfig; avatarIndex?: number | null; updatedAt?: string; /** Folder this agent belongs to, if any (matches a SuperagentFolder.id). */ folderId?: string | null; /** * Whether this agent runs the workflows pipeline (vs legacy automations). * Base44 apps run EITHER workflows OR automations — the Tasks panel gates on * this to list workflows rather than automations. Mirrors the web builder's * `isWorkflowsEnabled(app)` gate: workflows is the default; only the * `legacy_automations` marker opts an app out. */ workflowsEnabled?: boolean; }; /** Seed for a new agent created from the home composer / a tapped idea card. */ export type SuperagentCreateAgentInput = { /** Prompt text to seed the new agent's first message. */ initialMessage?: string; /** Suggested connector ids (e.g. "linkedin", "gmail") to surface on the agent. */ connectorIds?: string[]; /** Set when the create was seeded from an idea card (for BI); cleared when the prompt diverges. */ ideaKey?: string; ideaCategory?: string; }; export type SuperagentFolder = { id: string; name: string; }; export type SuperagentModelChoice = 'default' | 'claude_sonnet_4' | 'claude_sonnet_4_5' | 'claude_sonnet_4_6' | 'claude-sonnet-5' | 'claude_opus_4_5' | 'claude_opus_4_6' | 'claude_opus_4_7' | 'claude_opus_4_8' | 'claude_3_7' | 'gemini_2_5_pro' | 'gemini_2_5_flash' | 'gemini_3_pro' | 'gemini_3_1_pro' | 'gpt_5' | 'gpt_5_4' | 'gpt_5_5' | 'gpt_5_6_sol' | 'gpt_5_6_luna' | 'glm_5' | 'glm_5_2_superagent' | 'deepseek_v3'; export type SuperagentToolPermissionConfig = { auto_approved_operations?: string[]; connector_guards?: Record; }; export type SuperagentSecret = { name: string; value: string; }; export type SuperagentCollaborator = { email: string; full_name?: string | null; id: string; is_guest?: boolean; is_owner?: boolean; is_pending?: boolean; profile_image_url?: string | null; }; export type SuperagentAgentActionInput = { agentId: string; }; export type SuperagentShareAgentInput = SuperagentAgentActionInput & { addAsGuest?: boolean; emails: string[]; }; export type SuperagentOpenWorkspaceMembersInput = SuperagentAgentActionInput & { organizationId?: string | null; }; export type SuperagentInviteCollaboratorResult = { email: string; error?: string; error_code?: string; has_pending_invitation?: boolean; success: boolean; }; export type SuperagentInviteCollaboratorsResult = { results: SuperagentInviteCollaboratorResult[]; }; export type SuperagentModelUpdateInput = SuperagentAgentActionInput & { model: SuperagentModelChoice | string; }; export type SuperagentSecretSaveInput = SuperagentAgentActionInput & SuperagentSecret; export type SuperagentSecretDeleteInput = SuperagentAgentActionInput & { name: string; }; export type SuperagentToolPermissionsUpdateInput = SuperagentAgentActionInput & { config: SuperagentToolPermissionConfig; }; export type SuperagentMessage = { id?: string; role: 'user' | 'assistant' | 'system'; content: string; createdAt?: string; created_at?: number | string; fileUrls?: string[]; file_urls?: string[]; hidden?: boolean; metadata?: { created_date?: number | string | Date; [key: string]: unknown; }; replyTo?: SuperagentReplyTo; additional_message_params?: { reply_to?: { message_id?: string; content?: string; }; } & Record; toolCalls?: SuperagentToolCall[]; tool_calls?: SuperagentToolCall[]; }; export type SuperagentRoute = { name: 'home'; } | { name: 'create-agent'; } | { name: 'agent'; agentId: string; }; export type { SuperagentEditorTab, SuperagentFeatureTab } from './features/settings/featureMenu'; export type SuperagentConversation = { id: string; messages?: SuperagentMessage[]; }; export type SuperagentAgentDonePayload = { sender_platform_user_id?: string; bootstrap_intro?: boolean; /** Paused on a question: the backend keeps the queue parked, so don't promote. */ pending_clarification?: boolean; }; export type SuperagentRealtimeHandlers = { onMessage?: (message: SuperagentMessage) => void; onConversation?: (conversation: SuperagentConversation) => void; onAgentDone?: (payload?: SuperagentAgentDonePayload) => void; onReconnect?: () => void; onError?: (error: unknown) => void; }; export type SuperagentRealtimeClient = { subscribeToConversation(conversationId: string, handlers: SuperagentRealtimeHandlers): () => void; }; export type SuperagentPaginatedMessages = { messages: SuperagentMessage[]; has_more?: boolean; hasMore?: boolean; }; export type QueuedSuperagentMessage = { id: string; content: string; position?: number; }; export type SuperagentMediaAttachment = { id?: string; url: string; name?: string; mimeType?: string; kind?: 'image' | 'file' | 'audio'; previewUri?: string; }; export type SuperagentMediaActionContext = { agentId: string; conversationId: string | null; }; export type SuperagentMediaPicker = (context: SuperagentMediaActionContext) => Promise | SuperagentMediaAttachment[] | SuperagentMediaAttachment | null | undefined; export type SuperagentLiveVoiceInput = (context: SuperagentMediaActionContext) => Promise | void; export type SuperagentConnectorAccessMode = 'read_only' | 'full_access'; export type SuperagentConnectorStatus = 'active' | 'disconnected' | 'expired'; export type SuperagentConnectorAccessModeConfig = { fullAccess: string[]; readOnly: string[]; }; export type SuperagentConnector = { accountIdentifier?: string | null; accessMode?: SuperagentConnectorAccessMode | null; accessModes?: SuperagentConnectorAccessModeConfig; category?: string; description?: string; exampleScopes?: string[]; iconBackgroundColor?: string; iconFallbackLabel?: string; iconUrl?: string; id: string; name: string; popularity?: number; requiresConnectionConfig?: boolean; scopes?: string[]; status?: SuperagentConnectorStatus; subtitle?: string; supportsReadOnly?: boolean; }; export type SuperagentConnectorActionInput = { accessMode?: SuperagentConnectorAccessMode; agentId: string; connectorId: string; forceReconnect?: boolean; scopes?: string[]; }; export type SuperagentChannelId = 'whatsapp' | 'telegram' | 'line' | 'imessage' | 'slack'; export type SuperagentTelegramChannelStatus = { connected: boolean; botLink?: string | null; botName?: string | null; botUsername?: string | null; }; export type SuperagentWhatsAppChannelStatus = { connected?: boolean; connectUrl?: string | null; userHandle?: string | null; }; export type SuperagentLineActivation = { addFriendUrl: string; code: string; }; export type SuperagentLineChannelStatus = { activation?: SuperagentLineActivation | null; connected?: boolean; }; export type SuperagentIMessageActivation = { code: string; phoneNumber: string; }; export type SuperagentIMessageChannelStatus = { activation?: SuperagentIMessageActivation | null; connected?: boolean; phoneNumber?: string | null; }; export type SuperagentSlackWorkspace = { teamId?: string | null; teamName?: string | null; usergroupHandle?: string | null; }; export type SuperagentSlackChannelStatus = { agentDisplayName?: string | null; connected?: boolean; supported?: boolean; pendingCleanup?: boolean; teamId?: string | null; teamName?: string | null; usergroupHandle?: string | null; workspaces?: SuperagentSlackWorkspace[]; }; export type SuperagentSlackConnectResult = { supported: boolean; url?: string | null; expiresInSeconds?: number | null; }; export type SuperagentChannelStatus = { imessage?: SuperagentIMessageChannelStatus; line?: SuperagentLineChannelStatus; slack?: SuperagentSlackChannelStatus; telegram?: SuperagentTelegramChannelStatus; whatsapp?: SuperagentWhatsAppChannelStatus; }; export type SuperagentChannelActionInput = { agentId: string; }; export type SuperagentChannelUrlActionInput = SuperagentChannelActionInput & { url: string; }; export type SuperagentTelegramSetupInput = SuperagentChannelActionInput & { agentDisplayName?: string; agentProfilePhotoUrl?: string | null; }; export type SuperagentLineCodeShareInput = SuperagentChannelActionInput & SuperagentLineActivation; export type SuperagentIMessageCodeShareInput = SuperagentChannelActionInput & SuperagentIMessageActivation; export type SuperagentAutomationType = 'scheduled' | 'entity' | 'connector'; export type SuperagentAutomation = { app_id?: string; automation_type: SuperagentAutomationType | string; consecutive_failures?: number; created_date?: string; description?: string; ends_after_count?: number; ends_on_date?: string; ends_type?: 'never' | 'on' | 'after' | string; entity_name?: string; event_types?: string[]; events?: string[]; failed_runs?: number; function_args?: Record; function_name?: string; id: string; integration_type?: string; is_active?: boolean; is_archived?: boolean; last_run_at?: string; last_run_status?: 'success' | 'failed' | string; name: string; one_time_date?: string; repeat_interval?: number; repeat_on_day_of_month?: number; repeat_on_days?: number[]; repeat_unit?: 'minutes' | 'hours' | 'days' | 'weeks' | 'months' | string; schedule_mode?: 'recurring' | 'one-time' | string; schedule_type?: 'simple' | 'cron' | string; start_time?: string; successful_runs?: number; total_runs?: number; trigger_conditions?: Record | null; updated_date?: string; [key: string]: unknown; }; export type SuperagentAutomationCreditsSummary = { since: string | null; total: number; }; /** * The builder/chat credit-usage snapshot from `/usage-logs/current-usage`. Only the * fields the out-of-credits derivation reads are typed (see `computeIsOutOfCredits`); * the backend payload carries more. Mirrors the web builder's `CurrentUsage` subset. */ export type SuperagentCurrentUsage = { is_over_limit: boolean; daily_usage: number; daily_limit: number; monthly_usage: number; monthly_limit: number | null; gift_card_credit_details?: { remaining?: number; } | null; }; export type SuperagentAutomationActionInput = { agentId: string; automation: SuperagentAutomation; }; /** * Workflows are the successor to legacy automations. An agent runs EITHER the * workflows pipeline OR automations (see `SuperagentAgent.workflowsEnabled`). * These types mirror the web builder's `WorkflowListItem` / `WorkflowStatus` / * `WorkflowTrigger` (frontend/apps/builder/src/api/workflows) — the native * package can't import them, so they're re-declared here. */ export type SuperagentWorkflowStatus = 'active' | 'inactive' | 'archived'; /** Why a workflow reached its current non-active status (drives a UI hint). */ export type SuperagentWorkflowStatusReason = 'consecutive_failures' | 'end_condition_reached'; export type SuperagentWorkflowTriggerType = 'scheduled' | 'entity' | 'connector' | 'in_app_agent' | 'app_user_auth'; export type SuperagentWorkflowTriggerConfig = { trigger_type: SuperagentWorkflowTriggerType | string; cron_expression?: string | null; timezone?: string; schedule_mode?: string; one_time_date?: string | null; interval_value?: number | null; interval_unit?: string | null; entity_name?: string; integration_type?: string; agent_name?: string | null; events?: string[]; event_types?: string[]; [key: string]: unknown; }; export type SuperagentWorkflowTrigger = { id?: string; condition?: string | null; config?: SuperagentWorkflowTriggerConfig; }; /** One row in the Tasks list for a workflows-enabled agent. */ export type SuperagentWorkflow = { id: string; app_id?: string; file_key?: string | null; name: string; description?: string | null; status: SuperagentWorkflowStatus | string; status_reason?: SuperagentWorkflowStatusReason | string | null; trigger?: SuperagentWorkflowTrigger | null; total_runs?: number; consecutive_failures?: number; last_run_at?: string | null; last_run_status?: string | null; created_date?: string | null; [key: string]: unknown; }; export type SuperagentWorkflowActionInput = { agentId: string; workflow: SuperagentWorkflow; }; export type SuperagentSandboxFileNode = { children?: SuperagentSandboxFileNode[]; name: string; type: 'file' | 'folder'; }; export type SuperagentSandboxFileActionInput = { agentId: string; path: string; }; export type SuperagentSandboxFileContent = { content: string; path: string; }; export type SuperagentSandboxFileSaveInput = SuperagentSandboxFileActionInput & { content: string; }; export type SuperagentSandboxFileUploadInput = { agentId: string; }; export type SuperagentSandboxFileUploadResult = { path: string; }; export type SuperagentRenameAgentInput = { agentId: string; name: string; }; export type SuperagentNativeClientConfig = { apiBaseUrl: string; appId: string; getAuthToken: () => Promise | string | null | undefined; getHeaders?: () => Promise | undefined> | Record | undefined; }; /** * A single prompt-suggestion chip shown above the composer. `title` is the label; * `title_short` is an optional abbreviated label (used by the web builder on narrow * desktop widths — native always renders `title`); `prompt` is the text inserted into * the composer on tap; `connector_types` lists integration ids whose brand icons are * shown as leading adornments. */ export type SuperagentPromptSuggestion = { title: string; title_short?: string; prompt: string; connector_types?: string[]; }; /** * The composer's view of the prompt-suggestion state, produced by `usePromptSuggestions` * and consumed by `ConversationComposer` to render the chip row. `onSelect` reports the * click (the composer itself fills the draft and focuses the input); the rest drive the * refresh / dismiss / restore controls. */ export type SuperagentComposerSuggestions = { items: SuperagentPromptSuggestion[]; visible: boolean; showRestore: boolean; refreshing: boolean; onSelect: (suggestion: SuperagentPromptSuggestion) => void; onRefresh: () => void; onDismiss: () => void; onRestore: () => void; }; export type SuperagentNativeClient = { getConversations(limit?: number): Promise; getConversation(conversationId: string): Promise; getMessages(conversationId: string, params?: { limit?: number; before?: string; }): Promise; createConversation(metadata?: Record): Promise; bootstrapIntro(conversationId: string, messageParams?: Record): Promise<{ started: boolean; }>; addMessage(conversationId: string, message: Partial): Promise; stopConversation(conversationId: string): Promise; getQueuedMessages(conversationId: string): Promise<{ messages: QueuedSuperagentMessage[]; }>; editQueuedMessage(conversationId: string, messageId: string, content: string): Promise<{ ok: boolean; }>; deleteQueuedMessage(conversationId: string, messageId: string): Promise<{ ok: boolean; }>; deleteMessage(conversationId: string, messageId: string): Promise<{ message: string; }>; submitToolCallInput(conversationId: string, toolCallId: string, approve: boolean, extraUserInput?: unknown, originRequestId?: string): Promise; /** * Fetches the prompt-suggestion chips for the app's agent. `refresh` bypasses the * server cache to generate a fresh set; `exclude` is the list of titles already shown * (so a refresh returns different suggestions); `conversationId` scopes them to the * conversation currently on screen. */ getPromptSuggestions(options?: { refresh?: boolean; exclude?: string[]; conversationId?: string; }): Promise<{ suggestions: SuperagentPromptSuggestion[]; }>; getCurrentUsage(): Promise; }; export type SuperagentToolRendererProps = { agent: SuperagentAgent; conversationId: string | null; /** * Whether the renderer's message is the latest assistant turn. Approval * widgets gate submissions on it (web isLastAssistantMessage parity — the * submit endpoint resumes by tool_call_id, so a stale card could resume an * old turn out of order). `undefined` (host-supplied renderers that don't * pass it) is treated as actionable. */ isLastAssistantMessage?: boolean; message: SuperagentMessage; /** Mirror of the view's `showDebugPayloads`. Absent = hidden. */ showDebugPayloads?: boolean; submitToolCallInput?: (toolCallId: string, approve: boolean, extraUserInput?: unknown, originRequestId?: string) => Promise; toolCall: SuperagentToolCall; }; export type SuperagentToolRenderer = ComponentType; export type SuperagentToolRenderers = Record; /** Fallback matcher for tool families that can't be exact-name-keyed (mcp_*, artifact aliases). */ export type SuperagentToolRendererResolver = (toolCall: SuperagentToolCall) => SuperagentToolRenderer | undefined; export type SuperagentMarkdownRendererProps = { content: string; isUser: boolean; message: SuperagentMessage; }; export type SuperagentMarkdownRenderer = ComponentType; /** * Imperative handle exposed on a `SuperagentHomeScreen` ref. Lets the host drive the * conversation's actions from outside the package — e.g. native nav-bar buttons when the * in-package header is suppressed via `hideConversationHeader`. Each method targets the * currently-active conversation and is a no-op when none is open. */ export type SuperagentHomeScreenHandle = { /** Open the settings / integrations drawer (the in-header "..." menu). */ openConversationMenu: () => void; /** Open the share-agent modal. */ openConversationShare: () => void; /** Open the rename-agent modal (was a long-press on the in-package title). */ openConversationRename: () => void; }; /** * The signed-in platform user as returned by the builder `/me` endpoint, injected * by the host app. The native package never fetches it — auth is a shell concern * (see CLAUDE.md). Only the fields the package reads are typed; the rest of the * `/me` payload is preserved via the index signature so the whole object flows * through unchanged and downstream consumers can read other fields. */ export type SuperagentUser = { id?: string; email?: string; full_name?: string; profile_image_url?: string | null; /** Platform role, e.g. 'user' | 'support_personnel' | 'platform_admin' | 'platform_owner'. */ platform_role?: string | null; /** Allowed (paid) capability keys — the single source of truth for capability gates. */ allowed_capabilities?: string[]; /** Names of the feature flags enabled for this user. */ feature_flags?: string[]; /** Active variant per multivariate feature flag (flag name → variant key). */ feature_flag_variants?: Record; /** * Subscription tier from `/me`; gates the "best" Superagent models via * `useSuperagentModelAccess` (`subscription_pricing_tier` preferred). */ subscription_pricing_tier?: string | null; subscription_tier?: string | null; [key: string]: unknown; }; /** * The full internal prop surface consumed by the `SuperagentHomeScreenView` (and * threaded into `ConversationScreen`, `EditorDrawer`, the settings panels, …). * NOT the public API: the exported `SuperagentHomeScreen` shell builds this shape * internally from `useSuperagentRuntime` + the lean `SuperagentHomeScreenProps`. */ export type SuperagentHomeScreenViewProps = { activeAgentId?: string | null; /** * The signed-in platform user object returned by `/me`, injected by the host. * Held in context by `UserProvider` and read by the `useFeatureFlags` / * `useCapability` hooks. */ user?: SuperagentUser | null; /** Initial color scheme; the in-app settings toggle can change it. Defaults to 'light'. */ defaultColorScheme?: SuperagentColorScheme; /** Called when the user changes the scheme from settings (e.g. to persist it). */ onColorSchemeChange?: (scheme: SuperagentColorScheme) => void; agents?: SuperagentAgent[]; /** Home screen title (default "Agents"); pass an empty string to hide it. */ homeTitle?: string; /** Optional folders to group agents under on the home screen. */ folders?: SuperagentFolder[]; latestMessages?: SuperagentMessage[]; messagesByAgentId?: Record; apiClient?: SuperagentNativeClient; realtimeClient?: SuperagentRealtimeClient; renderMarkdown?: SuperagentMarkdownRenderer; /** * Host opt-in to render raw tool payloads that are hidden by default — e.g. * get_backend_function_logs results (console output, admin-only debug data * on web). Leave unset for end users; enable only for admin/debug builds. */ showDebugPayloads?: boolean; toolRenderers?: SuperagentToolRenderers; isLoading?: boolean; isSendingMessage?: boolean; navigationMode?: 'internal' | 'external'; currentUserAvatarUrl?: string | null; currentUserId?: string | null; currentUserName?: string; fileLoadError?: string | null; fileLoadFailed?: boolean; filePaths?: string[]; collaborators?: SuperagentCollaborator[]; headerAccessory?: ReactNode; /** * Hide the in-package conversation header (back / title / share / menu bar) so * the host app can supply its own — e.g. a native-stack navigation bar with the * iOS glass/blur effect (`headerTransparent` + `headerBlurEffect`). When hidden, * the host is responsible for wiring back/menu/share/rename via the navigation * options it controls. Defaults to false (renders the custom header). */ hideConversationHeader?: boolean; /** * Extra top padding (in pt) applied to the conversation's scrollable content. Use with * `hideConversationHeader` when the host floats a draw-behind native nav bar over the * content: pass the bar's height so the first message rests below it yet still scrolls * under the translucent bar. The package keeps its own top safe-area inset (status bar), * so this value is the host nav bar's height *below* the top safe area (the RNN topBar * height, typically ~44–56pt), not the full status-bar + nav-bar height. Replaces the * default content top padding when set. */ contentTopInset?: number; initialRoute?: SuperagentRoute; isLoadingAgentSettings?: boolean; isLoadingCollaborators?: boolean; isLoadingFiles?: boolean; secrets?: SuperagentSecret[]; onAgentBack?: () => void; onAgentMessageDone?: () => Promise | void; onCreateAgent?: (input?: SuperagentCreateAgentInput) => Promise | SuperagentAgent | void; onOpenAgent?: (agentId: string) => void; onOpenWorkspaceMembers?: (input: SuperagentOpenWorkspaceMembersInput) => Promise | void; onOpenNotifications?: () => void; onRouteChange?: (route: SuperagentRoute) => void; onImportFromDrive?: SuperagentMediaPicker; onPickFiles?: SuperagentMediaPicker; onPickPhotos?: SuperagentMediaPicker; automations?: SuperagentAutomation[]; automationCredits?: Record; workflows?: SuperagentWorkflow[]; isLoadingWorkflows?: boolean; workflowLoadError?: string | null; availableConnectors?: SuperagentConnector[]; channelStatus?: SuperagentChannelStatus; connectedConnectors?: SuperagentConnector[]; connectingConnectorId?: string | null; connectingChannelId?: SuperagentChannelId | null; disconnectingChannelId?: SuperagentChannelId | null; isLoadingAutomations?: boolean; isLoadingChannels?: boolean; isLoadingConnectors?: boolean; onCancelConnectorConnection?: (input: { agentId: string; connectorId: string; }) => void; onConnectConnector?: (input: SuperagentConnectorActionInput) => Promise | boolean | string | void; onConnectSlack?: (input: SuperagentChannelActionInput) => Promise | void; onDisconnectSlack?: (input: SuperagentChannelActionInput) => Promise | void; onDisconnectConnector?: (input: SuperagentConnectorActionInput) => Promise | void; onArchiveAutomation?: (input: SuperagentAutomationActionInput) => Promise | void; onCloneAgent?: (input: SuperagentAgentActionInput) => Promise | void; onDeleteAgent?: (input: SuperagentAgentActionInput) => Promise | void; onOpenAgentSettings?: (input: SuperagentAgentActionInput) => Promise | void; onDeleteAutomation?: (input: SuperagentAutomationActionInput) => Promise | void; onDeleteSecret?: (input: SuperagentSecretDeleteInput) => Promise | void; onEditAutomation?: (input: SuperagentAutomationActionInput) => Promise | void; onRemoveConnector?: (input: SuperagentConnectorActionInput) => Promise | void; onRenameAgent?: (input: SuperagentRenameAgentInput) => Promise | SuperagentAgent | void; onRefreshAgentSettings?: (agentId: string) => Promise | void; onRefreshAutomations?: (agentId: string) => Promise | void; onRefreshCollaborators?: (agentId: string) => Promise | void; onRefreshFiles?: (agentId: string) => Promise | void; onRestoreAutomation?: (input: SuperagentAutomationActionInput) => Promise | void; onRunAutomationNow?: (input: SuperagentAutomationActionInput) => Promise | void; onToggleWorkflow?: (input: SuperagentWorkflowActionInput) => Promise | void; onArchiveWorkflow?: (input: SuperagentWorkflowActionInput) => Promise | void; onRestoreWorkflow?: (input: SuperagentWorkflowActionInput) => Promise | void; onRunWorkflowNow?: (input: SuperagentWorkflowActionInput) => Promise | void; onRefreshWorkflows?: (agentId: string) => Promise | void; onOpenSandboxFile?: (input: SuperagentSandboxFileActionInput) => Promise | SuperagentSandboxFileContent; onDisconnectTelegram?: (input: SuperagentChannelActionInput) => Promise | void; onGenerateLineCode?: (input: SuperagentChannelActionInput) => Promise | void; onGenerateIMessageCode?: (input: SuperagentChannelActionInput) => Promise | SuperagentIMessageActivation | void; onDisconnectIMessage?: (input: SuperagentChannelActionInput) => Promise | void; onOpenIMessage?: (input: SuperagentIMessageCodeShareInput) => Promise | void; onOpenLine?: (input: SuperagentChannelUrlActionInput) => Promise | void; onOpenTelegram?: (input: SuperagentChannelUrlActionInput) => Promise | void; onOpenWhatsApp?: (input: SuperagentChannelActionInput) => Promise | void; onDisconnectWhatsApp?: (input: SuperagentChannelActionInput) => Promise | void; onRefreshChannels?: (agentId: string) => Promise | void; onSaveSandboxFile?: (input: SuperagentSandboxFileSaveInput) => Promise | void; onSaveSecret?: (input: SuperagentSecretSaveInput) => Promise | void; onShareAgent?: (input: SuperagentShareAgentInput) => Promise | SuperagentInviteCollaboratorsResult | void; onShareAgentLink?: (input: SuperagentAgentActionInput) => Promise | void; onShareIMessageCode?: (input: SuperagentIMessageCodeShareInput) => Promise | void; onShareLineCode?: (input: SuperagentLineCodeShareInput) => Promise | void; onStartLiveVoice?: SuperagentLiveVoiceInput; onSetupTelegram?: (input: SuperagentTelegramSetupInput) => Promise | void; onTakePhoto?: SuperagentMediaPicker; onToggleAutomation?: (input: SuperagentAutomationActionInput) => Promise | void; onUpdateAgentModel?: (input: SuperagentModelUpdateInput) => Promise | void; onUpdateAgentAutomationModel?: (input: SuperagentModelUpdateInput) => Promise | void; /** Opens the host's plans/upgrade flow, wired to the locked models' upgrade CTA. */ onViewPlans?: () => void; onUpdateToolPermissions?: (input: SuperagentToolPermissionsUpdateInput) => Promise | void; onUploadSandboxFiles?: (input: SuperagentSandboxFileUploadInput) => Promise | SuperagentSandboxFileUploadResult[] | void; onSendMessage?: (params: { agentId: string; fileUrls?: string[]; message: string; replyTo?: SuperagentReplyTo; requestedConnectors?: string[]; connectRequested?: boolean; hidden?: boolean; }) => Promise | SuperagentMessage | SuperagentMessage[] | void; }; /** * The public props for the exported `SuperagentHomeScreen` shell. Everything the * screen needs beyond this — agents, channels, connectors, automations, secrets, * files, the API/realtime clients, and every mutation handler — is produced * internally by `useSuperagentRuntime`. The host supplies only what it alone can: * the auth-backed connection (`session`), the signed-in `user`, the build flavor * (`environment`), native capabilities (`adapters`), and the app-shell navigation * wiring. Group `session`/`adapters` are object props whose identity feeds runtime * effects — build them in `useMemo` on the host side. */ export type SuperagentHomeScreenProps = { /** Auth-backed API connection and shared query cache. The host owns both lifecycles. */ session: SuperagentSessionConfig; /** * The signed-in platform user object returned by `/me`, injected by the host. * Held in context by `UserProvider`; the runtime also derives the current user's * id / name / avatar from it (no separate `currentUser*` props needed). */ user?: SuperagentUser | null; /** Host build flavor. Defaults to `'production'`. Also the Mixpanel environment label. */ environment?: SuperagentEnvironment; /** Whether the Superagent tab is the visible/foreground tab; gates the home page-view event. */ isActive?: boolean; /** * Native adapters the package can't implement itself: alerts/confirm, URL & * deep-link opening, realtime socket factory, live-voice audio, external-auth * callbacks, sandbox-file picking, and (folded in) attachment picking via * `adapters.attachments`. Required — the host must at least provide * `voiceRecorder` (dictation is a mandatory composer capability). */ adapters: SuperagentShellAdapters; /** `'external'` = the host pushes its own conversation screen; `'internal'` = in-package nav. */ navigationMode?: 'internal' | 'external'; /** Opening route; also seeds the runtime's initial agent when it is `{ name: 'agent' }`. */ initialRoute?: SuperagentRoute; onOpenAgent?: (agentId: string) => void; onAgentBack?: () => void; onRouteChange?: (route: SuperagentRoute) => void; /** * Fires whenever the resolved active agent changes (including once its details * load). Lets a host-owned native nav bar set its title/subtitle without reaching * into the internal runtime. */ onActiveAgentChange?: (agent: SuperagentAgent | null) => void; /** Suppress the in-package conversation header so the host can supply a native one. */ hideConversationHeader?: boolean; /** Extra top padding (pt) for the conversation content when a native nav bar floats over it. */ contentTopInset?: number; /** Opens the host's plans/upgrade flow, wired to the locked-models upgrade CTA. */ onViewPlans?: () => void; /** Initial color scheme; the in-app settings toggle can change it. Defaults to 'light'. */ defaultColorScheme?: SuperagentColorScheme; /** Notified when the user changes the scheme from settings (e.g. to persist it). */ onColorSchemeChange?: (scheme: SuperagentColorScheme) => void; }; //# sourceMappingURL=types.d.ts.map