import React, { type ReactNode } from 'react'; import type { useSuperagentRuntime } from './useSuperagentRuntime'; import type { SuperagentAgent, SuperagentCreateAgentInput, SuperagentMediaPicker, SuperagentMessage, SuperagentRoute } from '../types'; /** * Runtime state + handlers shared across the Superagent screen tree via React * context, so components read what they need through domain hooks * (`useSuperagentChannels`, `useSuperagentConnectors`, …) instead of receiving * dozens of drilled props. Mirrors the web agent-editor's store-hook consumption * model; we use a context-backed value rather than a module singleton so the two * mounted screens (home tab + pushed conversation) each keep their own isolated * runtime. Genuine identity/UI props (`agent`, `isVisible`, refs) stay props — * only shared runtime state flows through here, matching the web boundary. */ type RuntimeReturn = ReturnType; /** * The full context value: the runtime hook's return, minus the navigation/route * fields the shell overrides with host-aware versions, plus the shell-owned * extras (host navigation, media pickers, plans CTA, debug flag, insets). */ export type SuperagentRuntimeContextValue = Omit & { latestMessages: SuperagentMessage[]; messagesByAgentId: Record; onCreateAgent: (input?: SuperagentCreateAgentInput) => Promise | SuperagentAgent | void; onRenameAgent?: RuntimeReturn['onRenameAgent']; onCloneAgent?: RuntimeReturn['onCloneAgent']; onDeleteAgent?: RuntimeReturn['onDeleteAgent']; onShareAgentLink?: RuntimeReturn['onShareAgentLink']; navigationMode?: 'internal' | 'external'; initialRoute?: SuperagentRoute; onOpenAgent?: (agentId: string) => void; onAgentBack?: () => void; onRouteChange?: (route: SuperagentRoute) => void; onViewPlans?: () => void; showDebugPayloads?: boolean; isActive?: boolean; contentTopInset?: number; hideConversationHeader?: boolean; onPickFiles?: SuperagentMediaPicker; onPickPhotos?: SuperagentMediaPicker; onTakePhoto?: SuperagentMediaPicker; }; export declare function SuperagentRuntimeProvider({ value, children, }: { value: SuperagentRuntimeContextValue; children: ReactNode; }): React.JSX.Element; /** * Base accessor for the whole runtime value. Throws when used outside the * provider (i.e. outside a `SuperagentHomeScreen`) so a missing provider surfaces * immediately rather than as confusing `undefined` reads. Prefer the domain hooks * below; reach for this only when a component genuinely spans several domains. */ export declare function useSuperagentRuntimeContext(): SuperagentRuntimeContextValue; /** Agents list + agent-lifecycle actions (home list, overflow menu). */ export declare function useSuperagentAgents(): { agents: SuperagentAgent[]; activeAgentId: string | null; activeAgent: SuperagentAgent | null; isLoading: boolean; isRefreshingAgents: boolean; loadError: string | null; onRefreshAgents: (options?: import("@tanstack/react-query").RefetchOptions) => Promise, Error>>; onCreateAgent: (input?: SuperagentCreateAgentInput) => Promise | SuperagentAgent | void; onRenameAgent: ((input: import("../types").SuperagentRenameAgentInput) => Promise) | undefined; onCloneAgent: (({ agentId }: import("../types").SuperagentAgentActionInput) => void) | undefined; onDeleteAgent: (({ agentId }: import("../types").SuperagentAgentActionInput) => Promise) | undefined; onShareAgentLink: (({ agentId }: import("../types").SuperagentAgentActionInput) => Promise) | undefined; }; /** App-shell navigation wiring (routing between home and agent screens). */ export declare function useSuperagentNavigation(): { navigationMode: "internal" | "external" | undefined; initialRoute: SuperagentRoute | undefined; onOpenAgent: ((agentId: string) => void) | undefined; onAgentBack: (() => void) | undefined; onRouteChange: ((route: SuperagentRoute) => void) | undefined; }; /** Conversation-runtime dependencies (clients, current user, message seeds). */ export declare function useSuperagentConversationRuntime(): { apiClient: import("./nativeClient").SuperagentNativeClient | undefined; realtimeClient: import("../types").SuperagentRealtimeClient | undefined; currentUserId: string | null; currentUserAvatarUrl: string | null; currentUserName: string | undefined; latestMessages: SuperagentMessage[]; messagesByAgentId: Record; onAgentMessageDone: () => Promise; copyToClipboard: ((text: string) => Promise) | undefined; }; /** OAuth connectors: catalog, connection state, and connect/disconnect actions. */ export declare function useSuperagentConnectors(): { availableConnectors: import("../types").SuperagentConnector[]; connectedConnectors: import("../types").SuperagentConnector[]; connectingConnectorId: string | null; isLoadingConnectors: boolean; onConnectConnector: ({ accessMode, agentId, connectorId, forceReconnect, scopes, }: import("../types").SuperagentConnectorActionInput) => Promise; onDisconnectConnector: ({ agentId, connectorId }: import("../types").SuperagentConnectorActionInput) => Promise; onRemoveConnector: ({ agentId, connectorId }: import("../types").SuperagentConnectorActionInput) => Promise; onCancelConnectorConnection: ({ agentId, connectorId }: { agentId: string; connectorId: string; }) => void; }; /** Messaging channels (WhatsApp, Telegram, LINE, iMessage, Slack). */ export declare function useSuperagentChannels(): { channelStatus: import("../types").SuperagentChannelStatus; connectingChannelId: import("../types").SuperagentChannelId | null; disconnectingChannelId: import("../types").SuperagentChannelId | null; isLoadingChannels: boolean; onConnectSlack: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onDisconnectSlack: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onDisconnectTelegram: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onDisconnectIMessage: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onDisconnectWhatsApp: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onGenerateLineCode: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onGenerateIMessageCode: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onOpenIMessage: ({ code, phoneNumber }: import("../types").SuperagentIMessageCodeShareInput) => Promise; onOpenLine: ({ url }: import("../types").SuperagentChannelUrlActionInput) => Promise; onOpenTelegram: ({ url }: import("../types").SuperagentChannelUrlActionInput) => Promise; onOpenWhatsApp: ({ agentId }: import("../types").SuperagentChannelActionInput) => Promise; onSetupTelegram: ({ agentDisplayName, agentId, agentProfilePhotoUrl, }: import("../types").SuperagentTelegramSetupInput) => Promise; onShareIMessageCode: ({ code, phoneNumber }: import("../types").SuperagentIMessageCodeShareInput) => Promise; onShareLineCode: ({ addFriendUrl, code }: import("../types").SuperagentLineCodeShareInput) => Promise; onRefreshChannels: (agentId: string) => Promise; }; /** Scheduled/triggered automations ("Tasks") + their credit usage. */ export declare function useSuperagentAutomations(): { automations: import("../types").SuperagentAutomation[]; automationCredits: Record; automationLoadError: string | null; isLoadingAutomations: boolean; onToggleAutomation: ({ agentId, automation }: import("../types").SuperagentAutomationActionInput) => Promise; onArchiveAutomation: ({ agentId, automation }: import("../types").SuperagentAutomationActionInput) => Promise; onRestoreAutomation: ({ agentId, automation }: import("../types").SuperagentAutomationActionInput) => Promise; onDeleteAutomation: ({ agentId, automation }: import("../types").SuperagentAutomationActionInput) => Promise; onRunAutomationNow: ({ agentId, automation }: import("../types").SuperagentAutomationActionInput) => Promise; onEditAutomation: ({ agentId }: import("../types").SuperagentAutomationActionInput) => void; onRefreshAutomations: (agentId: string) => Promise; }; /** * Workflows ("Tasks") for a workflows-enabled agent + their lifecycle actions. * An agent runs EITHER workflows OR automations — the Tasks panel picks the * surface via `agent.workflowsEnabled` and reads the matching domain hook. */ export declare function useSuperagentWorkflows(): { workflows: import("../types").SuperagentWorkflow[]; workflowLoadError: string | null; isLoadingWorkflows: boolean; onToggleWorkflow: ({ agentId, workflow }: import("../types").SuperagentWorkflowActionInput) => Promise; onArchiveWorkflow: ({ agentId, workflow }: import("../types").SuperagentWorkflowActionInput) => Promise; onRestoreWorkflow: ({ agentId, workflow }: import("../types").SuperagentWorkflowActionInput) => Promise; onRunWorkflowNow: ({ agentId, workflow }: import("../types").SuperagentWorkflowActionInput) => Promise; onRefreshWorkflows: (agentId: string) => Promise; }; /** Sandbox files browser. */ export declare function useSuperagentFiles(): { filePaths: string[]; fileLoadError: string | null; fileLoadFailed: boolean; isLoadingFiles: boolean; onOpenSandboxFile: ({ agentId, path }: import("../types").SuperagentSandboxFileActionInput) => Promise; onSaveSandboxFile: ({ agentId, content, path }: import("../types").SuperagentSandboxFileSaveInput) => Promise; onUploadSandboxFiles: ({ agentId }: import("../types").SuperagentSandboxFileUploadInput) => Promise<{ path: string; }[]>; onRefreshFiles: (agentId: string) => Promise; }; /** Agent secrets (env vars) + the agent-settings load flag. */ export declare function useSuperagentSecrets(): { secrets: import("../types").SuperagentSecret[]; isLoadingAgentSettings: boolean; onSaveSecret: ({ agentId, name, value }: import("../types").SuperagentSecretSaveInput) => Promise; onDeleteSecret: ({ agentId, name }: import("../types").SuperagentSecretDeleteInput) => Promise; onRefreshAgentSettings: (agentId: string) => Promise; }; /** Collaborators / sharing (invite, refresh, open workspace members). */ export declare function useSuperagentCollaborators(): { collaborators: import("../types").SuperagentCollaborator[]; isLoadingCollaborators: boolean; onShareAgent: ({ agentId, addAsGuest, emails }: import("../types").SuperagentShareAgentInput) => Promise; onRefreshCollaborators: (agentId: string) => Promise; onOpenWorkspaceMembers: ({ organizationId }: import("../types").SuperagentOpenWorkspaceMembersInput) => void; }; /** Model + tool-permission mutations (chat model, automation model, guards). */ export declare function useSuperagentModelActions(): { onUpdateAgentModel: (input: import("../types").SuperagentModelUpdateInput) => Promise; onUpdateAgentAutomationModel: (input: import("../types").SuperagentModelUpdateInput) => Promise; onUpdateToolPermissions: (input: import("../types").SuperagentToolPermissionsUpdateInput) => Promise; }; /** Native media capture/pick + live voice for the composer. */ export declare function useSuperagentMedia(): { onPickFiles: SuperagentMediaPicker | undefined; onPickPhotos: SuperagentMediaPicker | undefined; onTakePhoto: SuperagentMediaPicker | undefined; onStartLiveVoice: import("../types").SuperagentLiveVoiceInput | undefined; speechToText: import("./useSpeechToText").UseSpeechToTextResult; }; /** Cross-cutting shell options (plans CTA, debug payloads, content inset). */ export declare function useSuperagentShellOptions(): { onViewPlans: (() => void) | undefined; showDebugPayloads: boolean | undefined; isActive: boolean | undefined; contentTopInset: number | undefined; hideConversationHeader: boolean | undefined; }; export {}; //# sourceMappingURL=runtimeContext.d.ts.map