@mobileai/react-native 0.9.17 → 0.9.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +28 -20
- package/MobileAIFloatingOverlay.podspec +25 -0
- package/android/build.gradle +61 -0
- package/android/src/main/AndroidManifest.xml +3 -0
- package/android/src/main/java/com/mobileai/overlay/FloatingOverlayView.kt +151 -0
- package/android/src/main/java/com/mobileai/overlay/MobileAIOverlayPackage.kt +23 -0
- package/android/src/newarch/com/mobileai/overlay/FloatingOverlayViewManager.kt +45 -0
- package/android/src/oldarch/com/mobileai/overlay/FloatingOverlayViewManager.kt +29 -0
- package/ios/MobileAIFloatingOverlayComponentView.mm +73 -0
- package/lib/module/components/AIAgent.js +902 -136
- package/lib/module/components/AIConsentDialog.js +439 -0
- package/lib/module/components/AgentChatBar.js +828 -134
- package/lib/module/components/AgentOverlay.js +2 -1
- package/lib/module/components/DiscoveryTooltip.js +21 -9
- package/lib/module/components/FloatingOverlayWrapper.js +108 -0
- package/lib/module/components/Icons.js +123 -0
- package/lib/module/config/endpoints.js +12 -2
- package/lib/module/core/AgentRuntime.js +373 -27
- package/lib/module/core/FiberAdapter.js +56 -0
- package/lib/module/core/FiberTreeWalker.js +186 -80
- package/lib/module/core/IdleDetector.js +19 -0
- package/lib/module/core/NativeAlertInterceptor.js +191 -0
- package/lib/module/core/systemPrompt.js +203 -45
- package/lib/module/index.js +3 -0
- package/lib/module/providers/GeminiProvider.js +72 -56
- package/lib/module/providers/ProviderFactory.js +6 -2
- package/lib/module/services/AudioInputService.js +3 -12
- package/lib/module/services/AudioOutputService.js +1 -13
- package/lib/module/services/ConversationService.js +166 -0
- package/lib/module/services/MobileAIKnowledgeRetriever.js +41 -0
- package/lib/module/services/VoiceService.js +29 -8
- package/lib/module/services/telemetry/MobileAI.js +44 -0
- package/lib/module/services/telemetry/TelemetryService.js +13 -1
- package/lib/module/services/telemetry/TouchAutoCapture.js +44 -18
- package/lib/module/specs/FloatingOverlayNativeComponent.ts +19 -0
- package/lib/module/support/CSATSurvey.js +95 -12
- package/lib/module/support/EscalationSocket.js +70 -1
- package/lib/module/support/ReportedIssueEventSource.js +148 -0
- package/lib/module/support/escalateTool.js +4 -2
- package/lib/module/support/index.js +1 -0
- package/lib/module/support/reportIssueTool.js +127 -0
- package/lib/module/support/supportPrompt.js +77 -9
- package/lib/module/tools/guideTool.js +2 -1
- package/lib/module/tools/longPressTool.js +4 -3
- package/lib/module/tools/pickerTool.js +6 -4
- package/lib/module/tools/tapTool.js +12 -3
- package/lib/module/tools/typeTool.js +19 -10
- package/lib/module/utils/logger.js +175 -6
- package/lib/typescript/react-native.config.d.ts +11 -0
- package/lib/typescript/src/components/AIAgent.d.ts +28 -2
- package/lib/typescript/src/components/AIConsentDialog.d.ts +153 -0
- package/lib/typescript/src/components/AgentChatBar.d.ts +15 -2
- package/lib/typescript/src/components/DiscoveryTooltip.d.ts +3 -1
- package/lib/typescript/src/components/FloatingOverlayWrapper.d.ts +51 -0
- package/lib/typescript/src/components/Icons.d.ts +8 -0
- package/lib/typescript/src/config/endpoints.d.ts +5 -3
- package/lib/typescript/src/core/AgentRuntime.d.ts +4 -0
- package/lib/typescript/src/core/FiberAdapter.d.ts +25 -0
- package/lib/typescript/src/core/FiberTreeWalker.d.ts +2 -0
- package/lib/typescript/src/core/IdleDetector.d.ts +11 -0
- package/lib/typescript/src/core/NativeAlertInterceptor.d.ts +55 -0
- package/lib/typescript/src/core/types.d.ts +106 -1
- package/lib/typescript/src/index.d.ts +9 -4
- package/lib/typescript/src/providers/GeminiProvider.d.ts +6 -5
- package/lib/typescript/src/services/ConversationService.d.ts +55 -0
- package/lib/typescript/src/services/MobileAIKnowledgeRetriever.d.ts +9 -0
- package/lib/typescript/src/services/telemetry/MobileAI.d.ts +7 -0
- package/lib/typescript/src/services/telemetry/TelemetryService.d.ts +1 -1
- package/lib/typescript/src/services/telemetry/TouchAutoCapture.d.ts +9 -6
- package/lib/typescript/src/services/telemetry/types.d.ts +3 -1
- package/lib/typescript/src/specs/FloatingOverlayNativeComponent.d.ts +17 -0
- package/lib/typescript/src/support/EscalationSocket.d.ts +17 -0
- package/lib/typescript/src/support/ReportedIssueEventSource.d.ts +24 -0
- package/lib/typescript/src/support/escalateTool.d.ts +5 -0
- package/lib/typescript/src/support/index.d.ts +2 -1
- package/lib/typescript/src/support/reportIssueTool.d.ts +20 -0
- package/lib/typescript/src/support/types.d.ts +56 -1
- package/lib/typescript/src/utils/logger.d.ts +15 -0
- package/package.json +20 -9
- package/react-native.config.js +12 -0
- package/lib/module/__cli_tmp__.js.map +0 -1
- package/lib/module/components/AIAgent.js.map +0 -1
- package/lib/module/components/AIZone.js.map +0 -1
- package/lib/module/components/AgentChatBar.js.map +0 -1
- package/lib/module/components/AgentErrorBoundary.js.map +0 -1
- package/lib/module/components/AgentOverlay.js.map +0 -1
- package/lib/module/components/DiscoveryTooltip.js.map +0 -1
- package/lib/module/components/HighlightOverlay.js.map +0 -1
- package/lib/module/components/Icons.js.map +0 -1
- package/lib/module/components/ProactiveHint.js.map +0 -1
- package/lib/module/components/cards/InfoCard.js.map +0 -1
- package/lib/module/components/cards/ReviewSummary.js.map +0 -1
- package/lib/module/config/endpoints.js.map +0 -1
- package/lib/module/core/ActionRegistry.js.map +0 -1
- package/lib/module/core/AgentRuntime.js.map +0 -1
- package/lib/module/core/FiberTreeWalker.js.map +0 -1
- package/lib/module/core/IdleDetector.js.map +0 -1
- package/lib/module/core/MCPBridge.js.map +0 -1
- package/lib/module/core/ScreenDehydrator.js.map +0 -1
- package/lib/module/core/ZoneRegistry.js.map +0 -1
- package/lib/module/core/systemPrompt.js.map +0 -1
- package/lib/module/core/types.js.map +0 -1
- package/lib/module/hooks/useAction.js.map +0 -1
- package/lib/module/index.js.map +0 -1
- package/lib/module/plugin/withAppIntents.js.map +0 -1
- package/lib/module/providers/GeminiProvider.js.map +0 -1
- package/lib/module/providers/OpenAIProvider.js.map +0 -1
- package/lib/module/providers/ProviderFactory.js.map +0 -1
- package/lib/module/services/AudioInputService.js.map +0 -1
- package/lib/module/services/AudioOutputService.js.map +0 -1
- package/lib/module/services/KnowledgeBaseService.js.map +0 -1
- package/lib/module/services/VoiceService.js.map +0 -1
- package/lib/module/services/flags/FlagService.js.map +0 -1
- package/lib/module/services/telemetry/MobileAI.js.map +0 -1
- package/lib/module/services/telemetry/PiiScrubber.js.map +0 -1
- package/lib/module/services/telemetry/TelemetryService.js.map +0 -1
- package/lib/module/services/telemetry/TouchAutoCapture.js.map +0 -1
- package/lib/module/services/telemetry/device.js.map +0 -1
- package/lib/module/services/telemetry/deviceMetadata.js.map +0 -1
- package/lib/module/services/telemetry/index.js.map +0 -1
- package/lib/module/services/telemetry/types.js.map +0 -1
- package/lib/module/support/CSATSurvey.js.map +0 -1
- package/lib/module/support/EscalationEventSource.js.map +0 -1
- package/lib/module/support/EscalationSocket.js.map +0 -1
- package/lib/module/support/SupportChatModal.js.map +0 -1
- package/lib/module/support/SupportGreeting.js.map +0 -1
- package/lib/module/support/TicketStore.js.map +0 -1
- package/lib/module/support/escalateTool.js.map +0 -1
- package/lib/module/support/index.js.map +0 -1
- package/lib/module/support/supportPrompt.js.map +0 -1
- package/lib/module/support/types.js.map +0 -1
- package/lib/module/tools/datePickerTool.js.map +0 -1
- package/lib/module/tools/guideTool.js.map +0 -1
- package/lib/module/tools/index.js.map +0 -1
- package/lib/module/tools/keyboardTool.js.map +0 -1
- package/lib/module/tools/longPressTool.js.map +0 -1
- package/lib/module/tools/pickerTool.js.map +0 -1
- package/lib/module/tools/restoreTool.js.map +0 -1
- package/lib/module/tools/scrollTool.js.map +0 -1
- package/lib/module/tools/simplifyTool.js.map +0 -1
- package/lib/module/tools/sliderTool.js.map +0 -1
- package/lib/module/tools/tapTool.js.map +0 -1
- package/lib/module/tools/typeTool.js.map +0 -1
- package/lib/module/tools/types.js.map +0 -1
- package/lib/module/types/jsx.d.js.map +0 -1
- package/lib/module/utils/audioUtils.js.map +0 -1
- package/lib/module/utils/logger.js.map +0 -1
- package/lib/typescript/babel.config.d.ts.map +0 -1
- package/lib/typescript/bin/generate-map.d.cts.map +0 -1
- package/lib/typescript/eslint.config.d.mts.map +0 -1
- package/lib/typescript/generate-map.d.ts.map +0 -1
- package/lib/typescript/src/__cli_tmp__.d.ts.map +0 -1
- package/lib/typescript/src/components/AIAgent.d.ts.map +0 -1
- package/lib/typescript/src/components/AIZone.d.ts.map +0 -1
- package/lib/typescript/src/components/AgentChatBar.d.ts.map +0 -1
- package/lib/typescript/src/components/AgentErrorBoundary.d.ts.map +0 -1
- package/lib/typescript/src/components/AgentOverlay.d.ts.map +0 -1
- package/lib/typescript/src/components/DiscoveryTooltip.d.ts.map +0 -1
- package/lib/typescript/src/components/HighlightOverlay.d.ts.map +0 -1
- package/lib/typescript/src/components/Icons.d.ts.map +0 -1
- package/lib/typescript/src/components/ProactiveHint.d.ts.map +0 -1
- package/lib/typescript/src/components/cards/InfoCard.d.ts.map +0 -1
- package/lib/typescript/src/components/cards/ReviewSummary.d.ts.map +0 -1
- package/lib/typescript/src/config/endpoints.d.ts.map +0 -1
- package/lib/typescript/src/core/ActionRegistry.d.ts.map +0 -1
- package/lib/typescript/src/core/AgentRuntime.d.ts.map +0 -1
- package/lib/typescript/src/core/FiberTreeWalker.d.ts.map +0 -1
- package/lib/typescript/src/core/IdleDetector.d.ts.map +0 -1
- package/lib/typescript/src/core/MCPBridge.d.ts.map +0 -1
- package/lib/typescript/src/core/ScreenDehydrator.d.ts.map +0 -1
- package/lib/typescript/src/core/ZoneRegistry.d.ts.map +0 -1
- package/lib/typescript/src/core/systemPrompt.d.ts.map +0 -1
- package/lib/typescript/src/core/types.d.ts.map +0 -1
- package/lib/typescript/src/hooks/useAction.d.ts.map +0 -1
- package/lib/typescript/src/index.d.ts.map +0 -1
- package/lib/typescript/src/plugin/withAppIntents.d.ts.map +0 -1
- package/lib/typescript/src/providers/GeminiProvider.d.ts.map +0 -1
- package/lib/typescript/src/providers/OpenAIProvider.d.ts.map +0 -1
- package/lib/typescript/src/providers/ProviderFactory.d.ts.map +0 -1
- package/lib/typescript/src/services/AudioInputService.d.ts.map +0 -1
- package/lib/typescript/src/services/AudioOutputService.d.ts.map +0 -1
- package/lib/typescript/src/services/KnowledgeBaseService.d.ts.map +0 -1
- package/lib/typescript/src/services/VoiceService.d.ts.map +0 -1
- package/lib/typescript/src/services/flags/FlagService.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/MobileAI.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/PiiScrubber.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/TelemetryService.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/TouchAutoCapture.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/device.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/deviceMetadata.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/index.d.ts.map +0 -1
- package/lib/typescript/src/services/telemetry/types.d.ts.map +0 -1
- package/lib/typescript/src/support/CSATSurvey.d.ts.map +0 -1
- package/lib/typescript/src/support/EscalationEventSource.d.ts.map +0 -1
- package/lib/typescript/src/support/EscalationSocket.d.ts.map +0 -1
- package/lib/typescript/src/support/SupportChatModal.d.ts.map +0 -1
- package/lib/typescript/src/support/SupportGreeting.d.ts.map +0 -1
- package/lib/typescript/src/support/TicketStore.d.ts.map +0 -1
- package/lib/typescript/src/support/escalateTool.d.ts.map +0 -1
- package/lib/typescript/src/support/index.d.ts.map +0 -1
- package/lib/typescript/src/support/supportPrompt.d.ts.map +0 -1
- package/lib/typescript/src/support/types.d.ts.map +0 -1
- package/lib/typescript/src/tools/datePickerTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/guideTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/index.d.ts.map +0 -1
- package/lib/typescript/src/tools/keyboardTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/longPressTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/pickerTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/restoreTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/scrollTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/simplifyTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/sliderTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/tapTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/typeTool.d.ts.map +0 -1
- package/lib/typescript/src/tools/types.d.ts.map +0 -1
- package/lib/typescript/src/utils/audioUtils.d.ts.map +0 -1
- package/lib/typescript/src/utils/logger.d.ts.map +0 -1
- package/src/__cli_tmp__.tsx +0 -9
- package/src/cli/analyzers/chain-analyzer.ts +0 -183
- package/src/cli/extractors/ai-extractor.ts +0 -6
- package/src/cli/extractors/ast-extractor.ts +0 -551
- package/src/cli/generate-intents.ts +0 -140
- package/src/cli/generate-map.ts +0 -121
- package/src/cli/generate-swift.ts +0 -116
- package/src/cli/scanners/expo-scanner.ts +0 -203
- package/src/cli/scanners/rn-scanner.ts +0 -445
- package/src/components/AIAgent.tsx +0 -1716
- package/src/components/AIZone.tsx +0 -147
- package/src/components/AgentChatBar.tsx +0 -1143
- package/src/components/AgentErrorBoundary.tsx +0 -78
- package/src/components/AgentOverlay.tsx +0 -73
- package/src/components/DiscoveryTooltip.tsx +0 -148
- package/src/components/HighlightOverlay.tsx +0 -136
- package/src/components/Icons.tsx +0 -253
- package/src/components/ProactiveHint.tsx +0 -145
- package/src/components/cards/InfoCard.tsx +0 -58
- package/src/components/cards/ReviewSummary.tsx +0 -76
- package/src/config/endpoints.ts +0 -22
- package/src/core/ActionRegistry.ts +0 -105
- package/src/core/AgentRuntime.ts +0 -1471
- package/src/core/FiberTreeWalker.ts +0 -930
- package/src/core/IdleDetector.ts +0 -72
- package/src/core/MCPBridge.ts +0 -163
- package/src/core/ScreenDehydrator.ts +0 -53
- package/src/core/ZoneRegistry.ts +0 -44
- package/src/core/systemPrompt.ts +0 -431
- package/src/core/types.ts +0 -521
- package/src/hooks/useAction.ts +0 -182
- package/src/index.ts +0 -83
- package/src/plugin/withAppIntents.ts +0 -98
- package/src/providers/GeminiProvider.ts +0 -357
- package/src/providers/OpenAIProvider.ts +0 -379
- package/src/providers/ProviderFactory.ts +0 -36
- package/src/services/AudioInputService.ts +0 -226
- package/src/services/AudioOutputService.ts +0 -236
- package/src/services/KnowledgeBaseService.ts +0 -156
- package/src/services/VoiceService.ts +0 -451
- package/src/services/flags/FlagService.ts +0 -137
- package/src/services/telemetry/MobileAI.ts +0 -66
- package/src/services/telemetry/PiiScrubber.ts +0 -17
- package/src/services/telemetry/TelemetryService.ts +0 -323
- package/src/services/telemetry/TouchAutoCapture.ts +0 -165
- package/src/services/telemetry/device.ts +0 -93
- package/src/services/telemetry/deviceMetadata.ts +0 -13
- package/src/services/telemetry/index.ts +0 -13
- package/src/services/telemetry/types.ts +0 -75
- package/src/support/CSATSurvey.tsx +0 -304
- package/src/support/EscalationEventSource.ts +0 -190
- package/src/support/EscalationSocket.ts +0 -152
- package/src/support/SupportChatModal.tsx +0 -563
- package/src/support/SupportGreeting.tsx +0 -161
- package/src/support/TicketStore.ts +0 -100
- package/src/support/escalateTool.ts +0 -174
- package/src/support/index.ts +0 -29
- package/src/support/supportPrompt.ts +0 -55
- package/src/support/types.ts +0 -155
- package/src/tools/datePickerTool.ts +0 -60
- package/src/tools/guideTool.ts +0 -76
- package/src/tools/index.ts +0 -20
- package/src/tools/keyboardTool.ts +0 -30
- package/src/tools/longPressTool.ts +0 -61
- package/src/tools/pickerTool.ts +0 -115
- package/src/tools/restoreTool.ts +0 -33
- package/src/tools/scrollTool.ts +0 -156
- package/src/tools/simplifyTool.ts +0 -33
- package/src/tools/sliderTool.ts +0 -65
- package/src/tools/tapTool.ts +0 -93
- package/src/tools/typeTool.ts +0 -113
- package/src/tools/types.ts +0 -58
- package/src/types/jsx.d.ts +0 -20
- package/src/utils/audioUtils.ts +0 -54
- package/src/utils/logger.ts +0 -38
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* - Agent runtime context for useAction hooks
|
|
9
9
|
*/
|
|
10
10
|
import React from 'react';
|
|
11
|
-
import type {
|
|
11
|
+
import type { AIConsentConfig } from './AIConsentDialog';
|
|
12
|
+
import type { ExecutionResult, ToolDefinition, AgentStep, TokenUsage, KnowledgeBaseConfig, ChatBarTheme, AIProviderName, ScreenMap, ProactiveHelpConfig, InteractionMode, CustomerSuccessConfig, OnboardingConfig } from '../core/types';
|
|
12
13
|
interface AIAgentProps {
|
|
13
14
|
/**
|
|
14
15
|
* API key (for local prototyping only).
|
|
@@ -92,6 +93,8 @@ interface AIAgentProps {
|
|
|
92
93
|
/**
|
|
93
94
|
* Domain knowledge the AI can query via the query_knowledge tool.
|
|
94
95
|
* Pass a static KnowledgeEntry[] or a { retrieve(query, screen) } function.
|
|
96
|
+
* If omitted and analyticsKey is configured, the SDK will query the project
|
|
97
|
+
* knowledge configured in the MobileAI dashboard automatically.
|
|
95
98
|
*/
|
|
96
99
|
knowledgeBase?: KnowledgeBaseConfig;
|
|
97
100
|
/** Max token budget for knowledge retrieval (default: 2000) */
|
|
@@ -189,7 +192,30 @@ interface AIAgentProps {
|
|
|
189
192
|
* Default: true (shows once, then remembered via AsyncStorage)
|
|
190
193
|
*/
|
|
191
194
|
showDiscoveryTooltip?: boolean;
|
|
195
|
+
/**
|
|
196
|
+
* Custom discovery tooltip copy shown above the chat FAB.
|
|
197
|
+
* Pass a string to override the default onboarding message for this app.
|
|
198
|
+
*/
|
|
199
|
+
discoveryTooltipMessage?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Health score configuration. Enable to automatically track screen
|
|
202
|
+
* flow, feature adoption, and success milestones for the MobileAI Dashboard.
|
|
203
|
+
*/
|
|
204
|
+
customerSuccess?: CustomerSuccessConfig;
|
|
205
|
+
/**
|
|
206
|
+
* Onboarding journey configuration.
|
|
207
|
+
* Proactively guides users through structured steps when the app launches.
|
|
208
|
+
*/
|
|
209
|
+
onboarding?: OnboardingConfig;
|
|
210
|
+
/**
|
|
211
|
+
* AI consent configuration (Apple Guideline 5.1.2(i)).
|
|
212
|
+
* Consent is REQUIRED by default — a consent dialog is shown before
|
|
213
|
+
* the first AI interaction. The agent will NOT send any data to
|
|
214
|
+
* the AI provider until the user explicitly consents.
|
|
215
|
+
* To opt out: `consent={{ required: false }}`.
|
|
216
|
+
*/
|
|
217
|
+
consent?: AIConsentConfig;
|
|
192
218
|
}
|
|
193
|
-
export declare function AIAgent({ apiKey, proxyUrl, proxyHeaders, voiceProxyUrl, voiceProxyHeaders, provider: providerName, model, navRef, maxSteps, showChatBar, children, onResult, interactiveBlacklist, interactiveWhitelist, onBeforeStep, onAfterStep, onBeforeTask, onAfterTask, transformScreenContent, customTools, instructions, stepDelay, mcpServerUrl, router, pathname, enableVoice, onTokenUsage, debug, knowledgeBase, knowledgeMaxTokens, enableUIControl, accentColor, theme, screenMap, useScreenMap, maxTokenBudget, maxCostUSD, analyticsKey, analyticsProxyUrl, analyticsProxyHeaders, proactiveHelp, userContext, pushToken, pushTokenType, interactionMode, showDiscoveryTooltip: showDiscoveryTooltipProp, }: AIAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
219
|
+
export declare function AIAgent({ apiKey, proxyUrl, proxyHeaders, voiceProxyUrl, voiceProxyHeaders, provider: providerName, model, navRef, maxSteps, showChatBar, children, onResult, interactiveBlacklist, interactiveWhitelist, onBeforeStep, onAfterStep, onBeforeTask, onAfterTask, transformScreenContent, customTools, instructions, stepDelay, mcpServerUrl, router, pathname, enableVoice, onTokenUsage, debug, knowledgeBase, knowledgeMaxTokens, enableUIControl, accentColor, theme, screenMap, useScreenMap, maxTokenBudget, maxCostUSD, analyticsKey, analyticsProxyUrl, analyticsProxyHeaders, proactiveHelp, userContext, pushToken, pushTokenType, interactionMode, showDiscoveryTooltip: showDiscoveryTooltipProp, discoveryTooltipMessage, customerSuccess, onboarding, consent, }: AIAgentProps): import("react/jsx-runtime").JSX.Element;
|
|
194
220
|
export {};
|
|
195
221
|
//# sourceMappingURL=AIAgent.d.ts.map
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AIConsentDialog — Apple App Store Guideline 5.1.2(i) compliant consent flow.
|
|
3
|
+
*
|
|
4
|
+
* Displays a modal before the first AI interaction that:
|
|
5
|
+
* 1. Names the specific third-party AI provider (e.g., "Google Gemini")
|
|
6
|
+
* 2. Explains what data is shared (screen content, messages)
|
|
7
|
+
* 3. Collects explicit user consent via affirmative tap
|
|
8
|
+
*
|
|
9
|
+
* Persists consent via AsyncStorage so the dialog is shown once per device.
|
|
10
|
+
* If AsyncStorage is unavailable, consent is session-scoped (per app launch).
|
|
11
|
+
*
|
|
12
|
+
* ## Business rationale
|
|
13
|
+
* Apple rejects apps that silently send personal data to third-party AI services.
|
|
14
|
+
* This component ensures compliance WITHOUT the app developer needing to build
|
|
15
|
+
* their own consent flow — they just set `requireConsent={true}` on <AIAgent>.
|
|
16
|
+
*/
|
|
17
|
+
import type { AIProviderName } from '../core/types';
|
|
18
|
+
declare const DEFAULT_THEME: {
|
|
19
|
+
backdrop: string;
|
|
20
|
+
cardBackground: string;
|
|
21
|
+
cardBorder: string;
|
|
22
|
+
iconBackground: string;
|
|
23
|
+
iconColor: string;
|
|
24
|
+
title: string;
|
|
25
|
+
body: string;
|
|
26
|
+
muted: string;
|
|
27
|
+
sectionBackground: string;
|
|
28
|
+
sectionBorder: string;
|
|
29
|
+
bullet: string;
|
|
30
|
+
badgeBackground: string;
|
|
31
|
+
badgeText: string;
|
|
32
|
+
secondaryButtonBackground: string;
|
|
33
|
+
secondaryButtonText: string;
|
|
34
|
+
primaryButtonBackground: string;
|
|
35
|
+
primaryButtonText: string;
|
|
36
|
+
link: string;
|
|
37
|
+
};
|
|
38
|
+
export interface AIConsentConfig {
|
|
39
|
+
/**
|
|
40
|
+
* Whether consent is required before AI interactions.
|
|
41
|
+
* When true, the agent will NOT send any data to the AI provider
|
|
42
|
+
* until the user explicitly consents.
|
|
43
|
+
* @default true
|
|
44
|
+
*/
|
|
45
|
+
required?: boolean;
|
|
46
|
+
/**
|
|
47
|
+
* Whether to persist the consent decision across app restarts.
|
|
48
|
+
* When false, the user must consent every time they launch the app.
|
|
49
|
+
* When true, the decision is saved locally (e.g. AsyncStorage) and
|
|
50
|
+
* the dialog is shown only once per device.
|
|
51
|
+
* @default false
|
|
52
|
+
*/
|
|
53
|
+
persist?: boolean;
|
|
54
|
+
/**
|
|
55
|
+
* Optional custom title for the consent dialog.
|
|
56
|
+
* Default: "AI Assistant"
|
|
57
|
+
*/
|
|
58
|
+
title?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Optional custom body text.
|
|
61
|
+
* Default: Auto-generated based on provider name.
|
|
62
|
+
*/
|
|
63
|
+
body?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Optional custom title for the consent dialog (Arabic).
|
|
66
|
+
* Default: "مساعد الذكاء الاصطناعي"
|
|
67
|
+
*/
|
|
68
|
+
titleAr?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Optional custom body text (Arabic).
|
|
71
|
+
* Default: Auto-generated based on provider name.
|
|
72
|
+
*/
|
|
73
|
+
bodyAr?: string;
|
|
74
|
+
/**
|
|
75
|
+
* URL to the app's privacy policy.
|
|
76
|
+
* If provided, a "Privacy Policy" link is shown in the dialog.
|
|
77
|
+
*/
|
|
78
|
+
privacyPolicyUrl?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Callback fired when user grants consent.
|
|
81
|
+
*/
|
|
82
|
+
onConsent?: () => void;
|
|
83
|
+
/**
|
|
84
|
+
* Callback fired when user declines consent.
|
|
85
|
+
*/
|
|
86
|
+
onDecline?: () => void;
|
|
87
|
+
/**
|
|
88
|
+
* Optional developer-controlled provider label.
|
|
89
|
+
* Example: "FoodApp AI" or "Secure AI Service".
|
|
90
|
+
* If omitted, the dialog uses a neutral generic label by default.
|
|
91
|
+
*/
|
|
92
|
+
providerLabel?: string;
|
|
93
|
+
/**
|
|
94
|
+
* Optional provider company/owner name shown in the description.
|
|
95
|
+
*/
|
|
96
|
+
providerCompany?: string;
|
|
97
|
+
/**
|
|
98
|
+
* Optional URL to provider terms or documentation.
|
|
99
|
+
*/
|
|
100
|
+
providerUrl?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Show or hide the small provider badge.
|
|
103
|
+
* Default: false
|
|
104
|
+
*/
|
|
105
|
+
showProviderBadge?: boolean;
|
|
106
|
+
/**
|
|
107
|
+
* Optional override for the provider badge text.
|
|
108
|
+
*/
|
|
109
|
+
providerBadgeText?: string;
|
|
110
|
+
/**
|
|
111
|
+
* Optional softer explanation shown above the shared-data list.
|
|
112
|
+
*/
|
|
113
|
+
summary?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Optional calmer explanation shown above the shared-data list (Arabic).
|
|
116
|
+
*/
|
|
117
|
+
summaryAr?: string;
|
|
118
|
+
/**
|
|
119
|
+
* Optional custom list of shared-data lines.
|
|
120
|
+
*/
|
|
121
|
+
sharedDataItems?: string[];
|
|
122
|
+
/**
|
|
123
|
+
* Optional custom list of shared-data lines (Arabic).
|
|
124
|
+
*/
|
|
125
|
+
sharedDataItemsAr?: string[];
|
|
126
|
+
/**
|
|
127
|
+
* Theme colors for the consent dialog.
|
|
128
|
+
*/
|
|
129
|
+
theme?: Partial<typeof DEFAULT_THEME>;
|
|
130
|
+
}
|
|
131
|
+
interface AIConsentDialogProps {
|
|
132
|
+
visible: boolean;
|
|
133
|
+
provider: AIProviderName;
|
|
134
|
+
config: AIConsentConfig;
|
|
135
|
+
onConsent: () => void;
|
|
136
|
+
onDecline: () => void;
|
|
137
|
+
language?: 'en' | 'ar';
|
|
138
|
+
}
|
|
139
|
+
export declare function AIConsentDialog({ visible, provider, config, onConsent, onDecline, language, }: AIConsentDialogProps): import("react/jsx-runtime").JSX.Element | null;
|
|
140
|
+
/**
|
|
141
|
+
* Manages consent state persistence via AsyncStorage.
|
|
142
|
+
* Falls back to session-scoped state if AsyncStorage is unavailable.
|
|
143
|
+
*
|
|
144
|
+
* @returns [hasConsented, grantConsent, revokeConsent, isLoading]
|
|
145
|
+
*/
|
|
146
|
+
export declare function useAIConsent(persist?: boolean): [
|
|
147
|
+
hasConsented: boolean,
|
|
148
|
+
grantConsent: () => Promise<void>,
|
|
149
|
+
revokeConsent: () => Promise<void>,
|
|
150
|
+
isLoading: boolean
|
|
151
|
+
];
|
|
152
|
+
export {};
|
|
153
|
+
//# sourceMappingURL=AIConsentDialog.d.ts.map
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
* Supports two modes: Text and Voice.
|
|
4
4
|
* Does not block underlying UI natively.
|
|
5
5
|
*/
|
|
6
|
-
import type { ExecutionResult, AgentMode, ChatBarTheme, AIMessage } from '../core/types';
|
|
6
|
+
import type { ExecutionResult, AgentMode, ChatBarTheme, AIMessage, ConversationSummary } from '../core/types';
|
|
7
7
|
import type { SupportTicket } from '../support/types';
|
|
8
8
|
interface AgentChatBarProps {
|
|
9
9
|
onSend: (message: string) => void;
|
|
10
10
|
isThinking: boolean;
|
|
11
|
+
statusText?: string;
|
|
11
12
|
lastResult: ExecutionResult | null;
|
|
12
13
|
language: 'en' | 'ar';
|
|
13
14
|
onDismiss?: () => void;
|
|
@@ -52,9 +53,21 @@ interface AgentChatBarProps {
|
|
|
52
53
|
totalUnread?: number;
|
|
53
54
|
/** Show first-use discovery tooltip above FAB */
|
|
54
55
|
showDiscoveryTooltip?: boolean;
|
|
56
|
+
/** Custom discovery tooltip copy */
|
|
57
|
+
discoveryTooltipMessage?: string;
|
|
55
58
|
/** Called when discovery tooltip is dismissed */
|
|
56
59
|
onTooltipDismiss?: () => void;
|
|
60
|
+
/** Past conversation sessions fetched from backend */
|
|
61
|
+
conversations?: ConversationSummary[];
|
|
62
|
+
/** True while history is loading from backend */
|
|
63
|
+
isLoadingHistory?: boolean;
|
|
64
|
+
/** Called when user taps a past conversation */
|
|
65
|
+
onConversationSelect?: (conversationId: string) => void;
|
|
66
|
+
/** Called when user starts a new conversation */
|
|
67
|
+
onNewConversation?: () => void;
|
|
68
|
+
pendingApprovalQuestion?: string | null;
|
|
69
|
+
onPendingApprovalAction?: (action: 'approve' | 'reject') => void;
|
|
57
70
|
}
|
|
58
|
-
export declare function AgentChatBar({ onSend, isThinking, lastResult, language,
|
|
71
|
+
export declare function AgentChatBar({ onSend, isThinking, statusText, lastResult, language, availableModes, mode, onModeChange, onMicToggle, onSpeakerToggle, isMicActive, isSpeakerMuted, isAISpeaking, isVoiceConnected, onStopSession, theme, tickets, selectedTicketId, onTicketSelect, autoExpandTrigger, unreadCounts, totalUnread, showDiscoveryTooltip, discoveryTooltipMessage, onTooltipDismiss, chatMessages, conversations, isLoadingHistory, onConversationSelect, onNewConversation, pendingApprovalQuestion, onPendingApprovalAction, }: AgentChatBarProps): import("react/jsx-runtime").JSX.Element;
|
|
59
72
|
export {};
|
|
60
73
|
//# sourceMappingURL=AgentChatBar.d.ts.map
|
|
@@ -9,7 +9,9 @@ interface DiscoveryTooltipProps {
|
|
|
9
9
|
language: 'en' | 'ar';
|
|
10
10
|
primaryColor?: string;
|
|
11
11
|
onDismiss: () => void;
|
|
12
|
+
side?: 'left' | 'right';
|
|
13
|
+
message?: string;
|
|
12
14
|
}
|
|
13
|
-
export declare function DiscoveryTooltip({ language, primaryColor, onDismiss, }: DiscoveryTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function DiscoveryTooltip({ language, primaryColor, onDismiss, side, message, }: DiscoveryTooltipProps): import("react/jsx-runtime").JSX.Element;
|
|
14
16
|
export {};
|
|
15
17
|
//# sourceMappingURL=DiscoveryTooltip.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FloatingOverlayWrapper — Cross-platform elevated overlay.
|
|
3
|
+
*
|
|
4
|
+
* Platform strategy (in priority order):
|
|
5
|
+
*
|
|
6
|
+
* iOS:
|
|
7
|
+
* 1. `FullWindowOverlay` from react-native-screens (optional peer dep).
|
|
8
|
+
* Creates a separate UIWindow at UIWindow.Level.alert+1.
|
|
9
|
+
* Renders ABOVE all native Modals, system alerts, and navigation chrome.
|
|
10
|
+
* 2. Falls back to plain View if react-native-screens is not installed.
|
|
11
|
+
*
|
|
12
|
+
* Android (both Old and New Architecture):
|
|
13
|
+
* 1. Native `MobileAIFloatingOverlay` ViewManager (bundled in this library).
|
|
14
|
+
* Creates a Dialog window with TYPE_APPLICATION_PANEL (z=1000),
|
|
15
|
+
* above normal app Dialog windows (TYPE_APPLICATION, z=2).
|
|
16
|
+
* No SYSTEM_ALERT_WINDOW permission needed — scoped to app's own window.
|
|
17
|
+
* 2. Falls back to plain View if the app hasn't been rebuilt after install
|
|
18
|
+
* (graceful degradation with DEV warning).
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* <FloatingOverlayWrapper fallbackStyle={styles.floatingLayer}>
|
|
22
|
+
* <View pointerEvents="box-none" style={StyleSheet.absoluteFill}>
|
|
23
|
+
* {chatBar}
|
|
24
|
+
* {consentDialog} ← must be INSIDE the wrapper, AFTER the chat bar in JSX
|
|
25
|
+
* </View>
|
|
26
|
+
* </FloatingOverlayWrapper>
|
|
27
|
+
*
|
|
28
|
+
* Note: FullWindowOverlay on iOS does NOT officially accept style props in its TS definition,
|
|
29
|
+
* but passing StyleSheet.absoluteFill is often necessary to prevent dimensions collapsing conditionally.
|
|
30
|
+
*/
|
|
31
|
+
/**
|
|
32
|
+
* True when a native elevated overlay is available on the current platform.
|
|
33
|
+
* Used by AIConsentDialog to decide whether to render as View vs Modal.
|
|
34
|
+
*
|
|
35
|
+
* iOS + react-native-screens installed → true
|
|
36
|
+
* Android + native rebuild done → true
|
|
37
|
+
* Everything else (fallback) → false
|
|
38
|
+
*/
|
|
39
|
+
export declare const isNativeOverlayActive: boolean;
|
|
40
|
+
interface FloatingOverlayWrapperProps {
|
|
41
|
+
children: React.ReactNode;
|
|
42
|
+
/**
|
|
43
|
+
* Style applied to the View wrapper when no native overlay is available.
|
|
44
|
+
* Ignored on iOS (FullWindowOverlay creates its own UIWindow) and
|
|
45
|
+
* Android (native module creates its own Dialog window).
|
|
46
|
+
*/
|
|
47
|
+
fallbackStyle?: any;
|
|
48
|
+
}
|
|
49
|
+
export declare function FloatingOverlayWrapper({ children, fallbackStyle, }: FloatingOverlayWrapperProps): React.ReactElement;
|
|
50
|
+
export {};
|
|
51
|
+
//# sourceMappingURL=FloatingOverlayWrapper.d.ts.map
|
|
@@ -40,4 +40,12 @@ export declare function CloseIcon({ size, color }: {
|
|
|
40
40
|
export declare function AIBadge({ size }: {
|
|
41
41
|
size?: number;
|
|
42
42
|
}): import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare function HistoryIcon({ size, color }: {
|
|
44
|
+
size?: number;
|
|
45
|
+
color?: string;
|
|
46
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
47
|
+
export declare function NewChatIcon({ size, color }: {
|
|
48
|
+
size?: number;
|
|
49
|
+
color?: string;
|
|
50
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
43
51
|
//# sourceMappingURL=Icons.d.ts.map
|
|
@@ -9,10 +9,12 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export declare const ENDPOINTS: {
|
|
11
11
|
/** Telemetry event ingest — receives batched SDK events */
|
|
12
|
-
readonly telemetryIngest:
|
|
12
|
+
readonly telemetryIngest: `${string}/api/v1/events`;
|
|
13
13
|
/** Feature flag sync — fetches remote flags for this analyticsKey */
|
|
14
|
-
readonly featureFlags:
|
|
14
|
+
readonly featureFlags: `${string}/api/v1/flags`;
|
|
15
15
|
/** Live agent escalation (support handoff) */
|
|
16
|
-
readonly escalation:
|
|
16
|
+
readonly escalation: string;
|
|
17
|
+
/** AI conversation history — save and retrieve per-user AI chat sessions */
|
|
18
|
+
readonly conversations: `${string}/api/v1/conversations`;
|
|
17
19
|
};
|
|
18
20
|
//# sourceMappingURL=endpoints.d.ts.map
|
|
@@ -22,10 +22,13 @@ export declare class AgentRuntime {
|
|
|
22
22
|
private knowledgeService;
|
|
23
23
|
private uiControlOverride?;
|
|
24
24
|
private lastDehydratedRoot;
|
|
25
|
+
private currentTraceId;
|
|
25
26
|
private originalErrorHandler;
|
|
26
27
|
private lastSuppressedError;
|
|
27
28
|
private graceTimer;
|
|
28
29
|
private originalReportErrorsAsExceptions;
|
|
30
|
+
private appActionApproved;
|
|
31
|
+
private static readonly APP_ACTION_TOOLS;
|
|
29
32
|
getConfig(): AgentConfig;
|
|
30
33
|
constructor(provider: AIProvider, config: AgentConfig, rootRef: any, navRef: any);
|
|
31
34
|
private registerBuiltInTools;
|
|
@@ -116,6 +119,7 @@ export declare class AgentRuntime {
|
|
|
116
119
|
* Returns error string if validation fails, null if valid.
|
|
117
120
|
*/
|
|
118
121
|
private validateToolArgs;
|
|
122
|
+
private emitTrace;
|
|
119
123
|
/** Write tools that can mutate state — only these are checked for aiConfirm */
|
|
120
124
|
private static readonly WRITE_TOOLS;
|
|
121
125
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FiberAdapter — Defense in depth for React internals.
|
|
3
|
+
*
|
|
4
|
+
* Centralizes all direct access to React Fiber internal properties.
|
|
5
|
+
* If React renames an internal property (e.g., in React 19/20), we only
|
|
6
|
+
* need to update it here instead of auditing the entire codebase.
|
|
7
|
+
*
|
|
8
|
+
* These are intentionally simple getter functions, not a complex class abstraction,
|
|
9
|
+
* to ensure maximum performance during tree walk.
|
|
10
|
+
*/
|
|
11
|
+
export declare function getChild(node: any): any | null;
|
|
12
|
+
export declare function getSibling(node: any): any | null;
|
|
13
|
+
export declare function getParent(node: any): any | null;
|
|
14
|
+
export declare function getProps(node: any): Record<string, any>;
|
|
15
|
+
export declare function getStateNode(node: any): any | null;
|
|
16
|
+
export declare function getType(node: any): any | null;
|
|
17
|
+
export declare function getDisplayName(node: any): string | null;
|
|
18
|
+
/**
|
|
19
|
+
* Common heuristic to find the Fiber node attached to a native view.
|
|
20
|
+
*
|
|
21
|
+
* Old Architecture (Bridge): __reactFiber$<hash> or __reactInternalInstance$<hash>
|
|
22
|
+
* New Architecture (Fabric): __internalInstanceHandle (ReactNativeElement)
|
|
23
|
+
*/
|
|
24
|
+
export declare function getFiberFromNativeNode(nativeNode: any): any | null;
|
|
25
|
+
//# sourceMappingURL=FiberAdapter.d.ts.map
|
|
@@ -14,6 +14,8 @@ export interface WalkConfig {
|
|
|
14
14
|
interactiveWhitelist?: React.RefObject<any>[];
|
|
15
15
|
/** Optional screen name to scope interactives to the active screen */
|
|
16
16
|
screenName?: string;
|
|
17
|
+
/** Whether to inject intercepted native UI elements */
|
|
18
|
+
interceptNativeAlerts?: boolean;
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Check if a node has ANY event handler prop (on* function).
|
|
@@ -11,6 +11,13 @@ export interface IdleDetectorConfig {
|
|
|
11
11
|
onReset: () => void;
|
|
12
12
|
/** Dynamic context suggestion generator based on current screen */
|
|
13
13
|
generateSuggestion?: () => string;
|
|
14
|
+
/** Configured behavior triggers */
|
|
15
|
+
behaviorTriggers?: Array<{
|
|
16
|
+
screen: string;
|
|
17
|
+
type: string;
|
|
18
|
+
message?: string;
|
|
19
|
+
delayMs?: number;
|
|
20
|
+
}>;
|
|
14
21
|
}
|
|
15
22
|
export declare class IdleDetector {
|
|
16
23
|
private pulseTimer;
|
|
@@ -21,6 +28,10 @@ export declare class IdleDetector {
|
|
|
21
28
|
reset(): void;
|
|
22
29
|
dismiss(): void;
|
|
23
30
|
destroy(): void;
|
|
31
|
+
/**
|
|
32
|
+
* Instantly trigger proactive help if the behavior matches a configured trigger.
|
|
33
|
+
*/
|
|
34
|
+
triggerBehavior(type: string, currentScreen: string): void;
|
|
24
35
|
private resetTimers;
|
|
25
36
|
private clearTimers;
|
|
26
37
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* NativeAlertInterceptor — Gray-box interception for React Native Alert dialogs.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: same approach used by Jest/RNTL (jest.spyOn(Alert, 'alert')) and
|
|
5
|
+
* inspired by Detox's gray-box native dialog detection.
|
|
6
|
+
*
|
|
7
|
+
* How it works:
|
|
8
|
+
* 1. install() — patches Alert.alert / Alert.prompt at agent execution start
|
|
9
|
+
* 2. The patched function STILL calls the original (so the user sees the native alert)
|
|
10
|
+
* AND captures the metadata (title, message, buttons) into a registry.
|
|
11
|
+
* 3. FiberTreeWalker reads hasActiveAlert() / getActiveAlert() and injects
|
|
12
|
+
* virtual elements into the dehydrated screen so the LLM can see them.
|
|
13
|
+
* 4. tapTool routes virtual alert element taps to dismissAlert().
|
|
14
|
+
* 5. uninstall() — restores originals at execution end (in finally block).
|
|
15
|
+
*
|
|
16
|
+
* Safety:
|
|
17
|
+
* - Patch is ONLY active while the agent is running.
|
|
18
|
+
* - Original Alert is always restored — even on unhandled errors.
|
|
19
|
+
* - Active alert auto-clears after ALERT_AUTO_CLEAR_MS to prevent stale state.
|
|
20
|
+
*/
|
|
21
|
+
export interface AlertButton {
|
|
22
|
+
text: string;
|
|
23
|
+
style?: 'default' | 'cancel' | 'destructive';
|
|
24
|
+
/** Original onPress callback from the app */
|
|
25
|
+
onPress?: () => void;
|
|
26
|
+
}
|
|
27
|
+
export interface ActiveAlert {
|
|
28
|
+
title: string;
|
|
29
|
+
message: string;
|
|
30
|
+
buttons: AlertButton[];
|
|
31
|
+
/** Timestamp when the alert appeared */
|
|
32
|
+
capturedAt: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Install the Alert interceptor.
|
|
36
|
+
* Patches Alert.alert and Alert.prompt — stores originals for restoration.
|
|
37
|
+
* Safe to call multiple times (idempotent).
|
|
38
|
+
*/
|
|
39
|
+
export declare function installAlertInterceptor(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Uninstall the Alert interceptor — restores original Alert methods.
|
|
42
|
+
* Called in the agent's finally block after execution ends.
|
|
43
|
+
*/
|
|
44
|
+
export declare function uninstallAlertInterceptor(): void;
|
|
45
|
+
/** Returns the currently active alert metadata, or null if no alert is showing. */
|
|
46
|
+
export declare function getActiveAlert(): ActiveAlert | null;
|
|
47
|
+
/** Returns true if a native alert is currently intercepted and active. */
|
|
48
|
+
export declare function hasActiveAlert(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Dismiss the active alert by calling the button's onPress callback.
|
|
51
|
+
* @param buttonIndex - 0-based index of the button to tap
|
|
52
|
+
* @returns true if successfully dismissed, false if no alert or invalid index
|
|
53
|
+
*/
|
|
54
|
+
export declare function dismissAlert(buttonIndex: number): boolean;
|
|
55
|
+
//# sourceMappingURL=NativeAlertInterceptor.d.ts.map
|
|
@@ -40,6 +40,15 @@ export interface InteractiveElement {
|
|
|
40
40
|
* Set automatically by the FiberTreeWalker when the element has aiConfirm={true} prop.
|
|
41
41
|
*/
|
|
42
42
|
requiresConfirmation?: boolean;
|
|
43
|
+
/**
|
|
44
|
+
* If set, this is a virtual element injected by NativeAlertInterceptor.
|
|
45
|
+
* Not backed by a real Fiber node — tapTool routes it to the interceptor instead.
|
|
46
|
+
*/
|
|
47
|
+
virtual?: {
|
|
48
|
+
kind: 'alert_button';
|
|
49
|
+
/** 0-based index of the button in the active alert */
|
|
50
|
+
alertButtonIndex: number;
|
|
51
|
+
};
|
|
43
52
|
}
|
|
44
53
|
export interface DehydratedScreen {
|
|
45
54
|
/** Current screen name (from navigation state) */
|
|
@@ -54,6 +63,7 @@ export interface DehydratedScreen {
|
|
|
54
63
|
export interface ScreenMapEntry {
|
|
55
64
|
title?: string;
|
|
56
65
|
description: string;
|
|
66
|
+
navigatesTo?: string[];
|
|
57
67
|
}
|
|
58
68
|
export interface ScreenMap {
|
|
59
69
|
generatedAt: string;
|
|
@@ -70,6 +80,18 @@ export interface AgentStep {
|
|
|
70
80
|
output: string;
|
|
71
81
|
};
|
|
72
82
|
}
|
|
83
|
+
export interface AgentTraceEvent {
|
|
84
|
+
traceId: string;
|
|
85
|
+
stage: string;
|
|
86
|
+
timestamp?: string;
|
|
87
|
+
stepIndex?: number;
|
|
88
|
+
screenName?: string;
|
|
89
|
+
data?: Record<string, unknown>;
|
|
90
|
+
}
|
|
91
|
+
export interface AskUserRequest {
|
|
92
|
+
question: string;
|
|
93
|
+
kind?: 'freeform' | 'approval';
|
|
94
|
+
}
|
|
73
95
|
export interface AgentConfig {
|
|
74
96
|
/**
|
|
75
97
|
* Which LLM provider to use for text mode.
|
|
@@ -180,6 +202,8 @@ export interface AgentConfig {
|
|
|
180
202
|
/**
|
|
181
203
|
* Called after each step with token usage data.
|
|
182
204
|
* Use to track cost, enforce budgets, or display usage to the user.
|
|
205
|
+
* NOTE: Estimated costs are raw provider rates. They do not include the
|
|
206
|
+
* dashboard's hosted proxy tier multiplier.
|
|
183
207
|
*/
|
|
184
208
|
onTokenUsage?: (usage: TokenUsage) => void;
|
|
185
209
|
/**
|
|
@@ -188,7 +212,7 @@ export interface AgentConfig {
|
|
|
188
212
|
* If not set, ask_user tool will break the loop (legacy behavior).
|
|
189
213
|
* @example onAskUser: (q) => new Promise(resolve => showPrompt(q, resolve))
|
|
190
214
|
*/
|
|
191
|
-
onAskUser?: (
|
|
215
|
+
onAskUser?: (request: AskUserRequest | string) => Promise<string>;
|
|
192
216
|
/**
|
|
193
217
|
* Called immediately before and after each agent tool execution.
|
|
194
218
|
* Used by AIAgent to toggle isAgentActing on TelemetryService so that
|
|
@@ -196,6 +220,11 @@ export interface AgentConfig {
|
|
|
196
220
|
* @param active - true = agent is acting, false = agent finished acting
|
|
197
221
|
*/
|
|
198
222
|
onToolExecute?: (active: boolean) => void;
|
|
223
|
+
/**
|
|
224
|
+
* Called whenever the runtime emits a detailed audit trace event.
|
|
225
|
+
* Intended for backend persistence of high-signal execution trails.
|
|
226
|
+
*/
|
|
227
|
+
onTrace?: (event: AgentTraceEvent) => void;
|
|
199
228
|
/**
|
|
200
229
|
* Expo Router instance (from useRouter()).
|
|
201
230
|
* When provided, the navigate tool uses router.push('/path') instead of navRef.navigate().
|
|
@@ -227,6 +256,8 @@ export interface AgentConfig {
|
|
|
227
256
|
* Maximum estimated cost (USD) allowed per task.
|
|
228
257
|
* The agent loop auto-stops when this budget is exceeded, returning partial results.
|
|
229
258
|
* Cost is estimated based on the provider's pricing (see provider source for rates).
|
|
259
|
+
* NOTE: This represents raw provider cost (Gemini's base pricing).
|
|
260
|
+
* It does NOT include the MobileAI dashboard tier-based markup multiplier.
|
|
230
261
|
*/
|
|
231
262
|
maxCostUSD?: number;
|
|
232
263
|
/**
|
|
@@ -235,6 +266,15 @@ export interface AgentConfig {
|
|
|
235
266
|
* from external AI agents (like OpenClaw, Claude Desktop, etc).
|
|
236
267
|
*/
|
|
237
268
|
mcpServerUrl?: string;
|
|
269
|
+
/**
|
|
270
|
+
* When true, the agent monkey-patches Alert.alert and Alert.prompt during execution
|
|
271
|
+
* to capture native dialog metadata and inject virtual elements into the Fiber tree.
|
|
272
|
+
* This lets the agent see and tap alert buttons that are normally invisible.
|
|
273
|
+
*
|
|
274
|
+
* Default: false (opt-in — only enable if your app uses Alert dialogs the agent needs
|
|
275
|
+
* to interact with)
|
|
276
|
+
*/
|
|
277
|
+
interceptNativeAlerts?: boolean;
|
|
238
278
|
}
|
|
239
279
|
export interface ExecutionResult {
|
|
240
280
|
success: boolean;
|
|
@@ -308,6 +348,28 @@ export interface AIMessage {
|
|
|
308
348
|
timestamp: number;
|
|
309
349
|
/** Attached execution result (assistant messages only) */
|
|
310
350
|
result?: ExecutionResult;
|
|
351
|
+
/** Optional UI hint for rendering assistant prompts */
|
|
352
|
+
promptKind?: 'approval';
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* A past conversation session summary returned by the history list endpoint.
|
|
356
|
+
* Used to populate the history panel in AgentChatBar.
|
|
357
|
+
*/
|
|
358
|
+
export interface ConversationSummary {
|
|
359
|
+
/** Unique conversation ID (backend cuid) */
|
|
360
|
+
id: string;
|
|
361
|
+
/** Auto-generated title from the first user message */
|
|
362
|
+
title: string;
|
|
363
|
+
/** Preview text — last message content, truncated */
|
|
364
|
+
preview: string;
|
|
365
|
+
/** Role of the last message ('user' | 'assistant') */
|
|
366
|
+
previewRole: string;
|
|
367
|
+
/** Total number of messages in the conversation */
|
|
368
|
+
messageCount: number;
|
|
369
|
+
/** Unix ms — when the conversation was created */
|
|
370
|
+
createdAt: number;
|
|
371
|
+
/** Unix ms — when it was last updated */
|
|
372
|
+
updatedAt: number;
|
|
311
373
|
}
|
|
312
374
|
/** Color customization for the floating chat bar / popup. */
|
|
313
375
|
export interface ChatBarTheme {
|
|
@@ -406,5 +468,48 @@ export interface ProactiveHelpConfig {
|
|
|
406
468
|
dismissForSession?: boolean;
|
|
407
469
|
/** Dynamic context suggestion generator based on current screen */
|
|
408
470
|
generateSuggestion?: (screenName: string) => string;
|
|
471
|
+
/**
|
|
472
|
+
* Behavior-based triggers to detect user struggle (e.g., rage tapping) and show help instantly.
|
|
473
|
+
*/
|
|
474
|
+
behaviorTriggers?: Array<{
|
|
475
|
+
/** Exact screen name or '*' for all screens */
|
|
476
|
+
screen: string;
|
|
477
|
+
/** Type of struggle behavior to detect */
|
|
478
|
+
type: 'rage_tap' | 'error_screen' | 'repeated_navigation';
|
|
479
|
+
/** Custom badge message when triggered */
|
|
480
|
+
message?: string;
|
|
481
|
+
/** Delay before showing badge once triggered (ms) */
|
|
482
|
+
delayMs?: number;
|
|
483
|
+
}>;
|
|
484
|
+
}
|
|
485
|
+
export interface CustomerSuccessConfig {
|
|
486
|
+
/** Enable background collection of health and adoption signals */
|
|
487
|
+
enabled: boolean;
|
|
488
|
+
/** Key features to track adoption for */
|
|
489
|
+
keyFeatures?: string[];
|
|
490
|
+
/** Milestones that indicate the user is "succeeding" */
|
|
491
|
+
successMilestones?: Array<{
|
|
492
|
+
name: string;
|
|
493
|
+
/** Screen or action that indicates this milestone */
|
|
494
|
+
screen?: string;
|
|
495
|
+
action?: string;
|
|
496
|
+
}>;
|
|
497
|
+
}
|
|
498
|
+
export interface OnboardingConfig {
|
|
499
|
+
/** Automatically guide the user through these steps */
|
|
500
|
+
enabled: boolean;
|
|
501
|
+
/** Steps in the onboarding journey */
|
|
502
|
+
steps: Array<{
|
|
503
|
+
screen: string;
|
|
504
|
+
message: string;
|
|
505
|
+
/** Element index to highlight via guide tool (optional) */
|
|
506
|
+
highlightIndex?: number;
|
|
507
|
+
/** Auto-complete action if user agrees (optional) */
|
|
508
|
+
action?: string;
|
|
509
|
+
}>;
|
|
510
|
+
/** Only show on the very first time the app is launched. Default: true */
|
|
511
|
+
firstLaunchOnly?: boolean;
|
|
512
|
+
/** Callback fired when the final step is completed */
|
|
513
|
+
onComplete?: () => void;
|
|
409
514
|
}
|
|
410
515
|
//# sourceMappingURL=types.d.ts.map
|