@mobileai/react-native 0.9.27 → 0.9.29
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/README.md +28 -16
- package/android/build.gradle +17 -0
- package/android/src/main/java/com/mobileai/overlay/FloatingOverlayDialogRootViewGroup.kt +243 -0
- package/android/src/main/java/com/mobileai/overlay/FloatingOverlayView.kt +281 -87
- package/android/src/newarch/com/mobileai/overlay/FloatingOverlayViewManager.kt +52 -17
- package/android/src/oldarch/com/mobileai/overlay/FloatingOverlayViewManager.kt +49 -2
- package/bin/generate-map.cjs +45 -6
- package/ios/MobileAIFloatingOverlayComponentView.h +8 -0
- package/ios/MobileAIFloatingOverlayComponentView.mm +12 -41
- package/ios/Podfile +63 -0
- package/ios/Podfile.lock +2290 -0
- package/ios/Podfile.properties.json +4 -0
- package/ios/mobileaireactnative/AppDelegate.swift +69 -0
- package/ios/mobileaireactnative/Images.xcassets/AppIcon.appiconset/Contents.json +13 -0
- package/ios/mobileaireactnative/Images.xcassets/Contents.json +6 -0
- package/ios/mobileaireactnative/Images.xcassets/SplashScreenLegacy.imageset/Contents.json +21 -0
- package/ios/mobileaireactnative/Images.xcassets/SplashScreenLegacy.imageset/SplashScreenLegacy.png +0 -0
- package/ios/mobileaireactnative/Info.plist +55 -0
- package/ios/mobileaireactnative/PrivacyInfo.xcprivacy +48 -0
- package/ios/mobileaireactnative/SplashScreen.storyboard +47 -0
- package/ios/mobileaireactnative/Supporting/Expo.plist +6 -0
- package/ios/mobileaireactnative/mobileaireactnative-Bridging-Header.h +3 -0
- package/ios/mobileaireactnative.xcodeproj/project.pbxproj +547 -0
- package/ios/mobileaireactnative.xcodeproj/xcshareddata/xcschemes/mobileaireactnative.xcscheme +88 -0
- package/ios/mobileaireactnative.xcworkspace/contents.xcworkspacedata +10 -0
- package/lib/module/components/AIAgent.js +501 -191
- package/lib/module/components/AgentChatBar.js +250 -59
- package/lib/module/components/FloatingOverlayWrapper.js +68 -32
- package/lib/module/config/endpoints.js +22 -1
- package/lib/module/core/AgentRuntime.js +110 -8
- package/lib/module/core/FiberTreeWalker.js +211 -10
- package/lib/module/core/OutcomeVerifier.js +149 -0
- package/lib/module/core/systemPrompt.js +96 -25
- package/lib/module/providers/GeminiProvider.js +9 -3
- package/lib/module/services/telemetry/TelemetryService.js +21 -2
- package/lib/module/services/telemetry/TouchAutoCapture.js +235 -38
- package/lib/module/services/telemetry/analyticsLabeling.js +187 -0
- package/lib/module/specs/FloatingOverlayNativeComponent.ts +7 -1
- package/lib/module/support/supportPrompt.js +22 -7
- package/lib/module/support/supportStyle.js +55 -0
- package/lib/module/support/types.js +2 -0
- package/lib/module/tools/typeTool.js +20 -0
- package/lib/module/utils/humanizeScreenName.js +49 -0
- package/lib/typescript/src/components/AIAgent.d.ts +6 -2
- package/lib/typescript/src/components/AgentChatBar.d.ts +15 -1
- package/lib/typescript/src/components/FloatingOverlayWrapper.d.ts +22 -10
- package/lib/typescript/src/config/endpoints.d.ts +4 -0
- package/lib/typescript/src/core/AgentRuntime.d.ts +12 -3
- package/lib/typescript/src/core/FiberTreeWalker.d.ts +12 -1
- package/lib/typescript/src/core/OutcomeVerifier.d.ts +46 -0
- package/lib/typescript/src/core/systemPrompt.d.ts +3 -10
- package/lib/typescript/src/core/types.d.ts +63 -0
- package/lib/typescript/src/index.d.ts +1 -0
- package/lib/typescript/src/services/telemetry/TelemetryService.d.ts +7 -1
- package/lib/typescript/src/services/telemetry/TouchAutoCapture.d.ts +6 -1
- package/lib/typescript/src/services/telemetry/analyticsLabeling.d.ts +20 -0
- package/lib/typescript/src/services/telemetry/types.d.ts +1 -1
- package/lib/typescript/src/specs/FloatingOverlayNativeComponent.d.ts +5 -0
- package/lib/typescript/src/support/index.d.ts +1 -0
- package/lib/typescript/src/support/supportStyle.d.ts +9 -0
- package/lib/typescript/src/support/types.d.ts +3 -0
- package/lib/typescript/src/utils/humanizeScreenName.d.ts +6 -0
- package/package.json +10 -10
- package/src/specs/FloatingOverlayNativeComponent.ts +7 -1
- package/ios/MobileAIPilotIntents.swift +0 -51
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { AIProvider, AgentConfig, InteractiveElement } from './types';
|
|
2
|
+
export type VerificationStatus = 'success' | 'error' | 'uncertain';
|
|
3
|
+
export type VerificationFailureKind = 'controllable' | 'uncontrollable';
|
|
4
|
+
export interface VerificationSnapshot {
|
|
5
|
+
screenName: string;
|
|
6
|
+
screenContent: string;
|
|
7
|
+
elements: InteractiveElement[];
|
|
8
|
+
screenshot?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface VerificationAction {
|
|
11
|
+
toolName: string;
|
|
12
|
+
args: Record<string, any>;
|
|
13
|
+
label: string;
|
|
14
|
+
targetElement?: InteractiveElement;
|
|
15
|
+
}
|
|
16
|
+
export interface VerificationContext {
|
|
17
|
+
goal: string;
|
|
18
|
+
action: VerificationAction;
|
|
19
|
+
preAction: VerificationSnapshot;
|
|
20
|
+
postAction: VerificationSnapshot;
|
|
21
|
+
}
|
|
22
|
+
export interface VerificationResult {
|
|
23
|
+
status: VerificationStatus;
|
|
24
|
+
failureKind: VerificationFailureKind;
|
|
25
|
+
evidence: string;
|
|
26
|
+
source: 'deterministic' | 'llm';
|
|
27
|
+
}
|
|
28
|
+
export interface PendingVerification {
|
|
29
|
+
goal: string;
|
|
30
|
+
action: VerificationAction;
|
|
31
|
+
preAction: VerificationSnapshot;
|
|
32
|
+
followupSteps: number;
|
|
33
|
+
}
|
|
34
|
+
export declare function createVerificationSnapshot(screenName: string, screenContent: string, elements: InteractiveElement[], screenshot?: string): VerificationSnapshot;
|
|
35
|
+
export declare function buildVerificationAction(toolName: string, args: Record<string, any>, elements: InteractiveElement[], fallbackLabel: string): VerificationAction;
|
|
36
|
+
export declare function isCriticalVerificationAction(action: VerificationAction): boolean;
|
|
37
|
+
export declare class OutcomeVerifier {
|
|
38
|
+
private readonly provider;
|
|
39
|
+
private readonly config;
|
|
40
|
+
constructor(provider: AIProvider, config: AgentConfig);
|
|
41
|
+
isEnabled(): boolean;
|
|
42
|
+
getMaxFollowupSteps(): number;
|
|
43
|
+
isCriticalAction(action: VerificationAction): boolean;
|
|
44
|
+
verify(context: VerificationContext): Promise<VerificationResult>;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=OutcomeVerifier.d.ts.map
|
|
@@ -1,13 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* Shared fragments are extracted as constants at the top so that all
|
|
5
|
-
* three prompt builders (text agent, voice agent, knowledge-only) stay
|
|
6
|
-
* in sync — one change propagates everywhere. The prompt uses XML-style
|
|
7
|
-
* tags to give the LLM clear, structured instructions.
|
|
8
|
-
*/
|
|
9
|
-
export declare function buildSystemPrompt(language: string, hasKnowledge?: boolean, isCopilot?: boolean): string;
|
|
10
|
-
export declare function buildVoiceSystemPrompt(language: string, userInstructions?: string, hasKnowledge?: boolean): string;
|
|
1
|
+
import type { SupportStyle } from './types';
|
|
2
|
+
export declare function buildSystemPrompt(language: string, hasKnowledge?: boolean, isCopilot?: boolean, supportStyle?: SupportStyle): string;
|
|
3
|
+
export declare function buildVoiceSystemPrompt(language: string, userInstructions?: string, hasKnowledge?: boolean, supportStyle?: SupportStyle): string;
|
|
11
4
|
/**
|
|
12
5
|
* Build a knowledge-only system prompt (no UI control tools).
|
|
13
6
|
*
|
|
@@ -11,7 +11,19 @@ export type AgentMode = 'text' | 'voice' | 'human';
|
|
|
11
11
|
*/
|
|
12
12
|
export type InteractionMode = 'copilot' | 'autopilot';
|
|
13
13
|
export type AIProviderName = 'gemini' | 'openai';
|
|
14
|
+
export type SupportStyle = 'warm-concise' | 'wow-service' | 'neutral-professional';
|
|
15
|
+
export interface VerifierConfig {
|
|
16
|
+
enabled?: boolean;
|
|
17
|
+
mode?: 'critical-actions';
|
|
18
|
+
provider?: AIProviderName;
|
|
19
|
+
model?: string;
|
|
20
|
+
proxyUrl?: string;
|
|
21
|
+
proxyHeaders?: Record<string, string>;
|
|
22
|
+
maxFollowupSteps?: number;
|
|
23
|
+
}
|
|
14
24
|
export type ElementType = 'pressable' | 'text-input' | 'switch' | 'radio' | 'scrollable' | 'slider' | 'picker' | 'date-picker';
|
|
25
|
+
export type AnalyticsElementKind = 'button' | 'text_input' | 'toggle' | 'slider' | 'picker' | 'link' | 'tab' | 'list_item' | 'image' | 'icon' | 'text' | 'card' | 'modal' | 'sheet' | 'scroll_area' | 'unknown';
|
|
26
|
+
export type AnalyticsLabelConfidence = 'high' | 'low';
|
|
15
27
|
export interface InteractiveElement {
|
|
16
28
|
/** Unique index assigned during tree walk */
|
|
17
29
|
index: number;
|
|
@@ -50,6 +62,47 @@ export interface InteractiveElement {
|
|
|
50
62
|
/** 0-based index of the button in the active alert */
|
|
51
63
|
alertButtonIndex: number;
|
|
52
64
|
};
|
|
65
|
+
/** Sanitized analytics label used for telemetry and wireframes. */
|
|
66
|
+
analyticsLabel?: string | null;
|
|
67
|
+
/** Generic analytics-facing element kind. */
|
|
68
|
+
analyticsElementKind?: AnalyticsElementKind;
|
|
69
|
+
/** Confidence that the analytics label is user-facing. */
|
|
70
|
+
analyticsLabelConfidence?: AnalyticsLabelConfidence;
|
|
71
|
+
/** Nearest enclosing AI zone id, preserved for analytics/debugging. */
|
|
72
|
+
analyticsZoneId?: string | null;
|
|
73
|
+
/** Nearest custom component ancestry above the interactive node. */
|
|
74
|
+
analyticsAncestorPath?: string[];
|
|
75
|
+
/** Nearby sibling interactive labels from the same parent group. */
|
|
76
|
+
analyticsSiblingLabels?: string[];
|
|
77
|
+
/** Concrete component name for the matched interactive host. */
|
|
78
|
+
analyticsComponentName?: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface WireframeComponent {
|
|
81
|
+
type: ElementType;
|
|
82
|
+
label: string;
|
|
83
|
+
elementKind?: AnalyticsElementKind;
|
|
84
|
+
labelConfidence?: AnalyticsLabelConfidence;
|
|
85
|
+
zoneId?: string | null;
|
|
86
|
+
ancestorPath?: string[];
|
|
87
|
+
siblingLabels?: string[];
|
|
88
|
+
componentName?: string | null;
|
|
89
|
+
x: number;
|
|
90
|
+
y: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
}
|
|
94
|
+
export interface WireframeSnapshot {
|
|
95
|
+
screen: string;
|
|
96
|
+
components: WireframeComponent[];
|
|
97
|
+
deviceWidth: number;
|
|
98
|
+
deviceHeight: number;
|
|
99
|
+
capturedAt: string;
|
|
100
|
+
/**
|
|
101
|
+
* Optional JPEG screenshot captured at the same moment as this wireframe.
|
|
102
|
+
* Base64 payload (without data URI prefix) to avoid embedding UI-dependent
|
|
103
|
+
* image schemes in analytics payloads.
|
|
104
|
+
*/
|
|
105
|
+
screenshot?: string | null;
|
|
53
106
|
}
|
|
54
107
|
export interface DehydratedScreen {
|
|
55
108
|
/** Current screen name (from navigation state) */
|
|
@@ -123,6 +176,16 @@ export interface AgentConfig {
|
|
|
123
176
|
*/
|
|
124
177
|
voiceProxyHeaders?: Record<string, string>;
|
|
125
178
|
model?: string;
|
|
179
|
+
/**
|
|
180
|
+
* Support personality preset used when the agent is handling support-style requests.
|
|
181
|
+
* Default: 'warm-concise'
|
|
182
|
+
*/
|
|
183
|
+
supportStyle?: SupportStyle;
|
|
184
|
+
/**
|
|
185
|
+
* Optional outcome verifier settings for critical app-changing actions.
|
|
186
|
+
* Defaults to enabled critical-action verification using the main provider.
|
|
187
|
+
*/
|
|
188
|
+
verifier?: VerifierConfig;
|
|
126
189
|
/** Maximum steps per task */
|
|
127
190
|
maxSteps?: number;
|
|
128
191
|
/**
|
|
@@ -28,4 +28,5 @@ export type { TelemetryConfig, TelemetryEvent } from './services/telemetry';
|
|
|
28
28
|
export { SupportGreeting, CSATSurvey, buildSupportPrompt, createEscalateTool, EscalationSocket, } from './support';
|
|
29
29
|
export { createReportIssueTool } from './support';
|
|
30
30
|
export type { SupportModeConfig, QuickReply, EscalationConfig, EscalationContext, CSATConfig, CSATRating, BusinessHoursConfig, SupportTicket, ReportedIssue, ReportedIssueCustomerStatus, ReportedIssueStatusUpdate, } from './support';
|
|
31
|
+
export type { SupportStyle } from './support';
|
|
31
32
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -18,6 +18,7 @@ export declare class TelemetryService {
|
|
|
18
18
|
private flushTimer;
|
|
19
19
|
private isFlushing;
|
|
20
20
|
private appStateSubscription;
|
|
21
|
+
private wireframesSent;
|
|
21
22
|
get screen(): string;
|
|
22
23
|
getScreenFlow(): string[];
|
|
23
24
|
/**
|
|
@@ -37,7 +38,12 @@ export declare class TelemetryService {
|
|
|
37
38
|
/** Track an event (auto or custom) */
|
|
38
39
|
track(type: string, data?: Record<string, unknown>): void;
|
|
39
40
|
/** Update current screen (called by AIAgent on navigation) */
|
|
40
|
-
setScreen(
|
|
41
|
+
setScreen(rawScreenName: string): void;
|
|
42
|
+
/**
|
|
43
|
+
* Track a wireframe snapshot.
|
|
44
|
+
* Deduped per session (only one wireframe per screen over a session).
|
|
45
|
+
*/
|
|
46
|
+
trackWireframe(snapshot: import('../../core/types').WireframeSnapshot): void;
|
|
41
47
|
/** Send queued events to the cloud API */
|
|
42
48
|
flush(): Promise<void>;
|
|
43
49
|
/** Save queued events to AsyncStorage for crash/restart recovery */
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* 4. Last resort: "Unknown Element".
|
|
13
13
|
*/
|
|
14
14
|
import type { TelemetryService } from './TelemetryService';
|
|
15
|
+
import type { AnalyticsTargetMetadata } from './analyticsLabeling';
|
|
15
16
|
/**
|
|
16
17
|
* Checks if the user is rage-tapping an element.
|
|
17
18
|
*
|
|
@@ -20,12 +21,16 @@ import type { TelemetryService } from './TelemetryService';
|
|
|
20
21
|
* 2. Taps must be on the SAME screen (screen change = not rage, it's navigation)
|
|
21
22
|
* 3. Navigation labels ("Next", "Skip", etc.) are excluded
|
|
22
23
|
*/
|
|
23
|
-
export declare function checkRageClick(
|
|
24
|
+
export declare function checkRageClick(target: AnalyticsTargetMetadata & {
|
|
25
|
+
x: number;
|
|
26
|
+
y: number;
|
|
27
|
+
}, telemetry: TelemetryService): void;
|
|
24
28
|
/**
|
|
25
29
|
* Extract a label from a GestureResponderEvent.
|
|
26
30
|
*
|
|
27
31
|
* @param event - The GestureResponderEvent from onStartShouldSetResponderCapture
|
|
28
32
|
* @returns A descriptive label string for the tapped element
|
|
29
33
|
*/
|
|
34
|
+
export declare function extractTouchTargetMetadata(event: any): AnalyticsTargetMetadata;
|
|
30
35
|
export declare function extractTouchLabel(event: any): string;
|
|
31
36
|
//# sourceMappingURL=TouchAutoCapture.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnalyticsElementKind, AnalyticsLabelConfidence, ElementType } from '../../core/types';
|
|
2
|
+
export type AnalyticsLabelSource = 'accessibility' | 'deep-text' | 'sibling-text' | 'placeholder' | 'title' | 'test-id' | 'icon' | 'context';
|
|
3
|
+
export interface AnalyticsLabelCandidate {
|
|
4
|
+
text?: string | null;
|
|
5
|
+
source: AnalyticsLabelSource;
|
|
6
|
+
isInteractiveContext?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface AnalyticsTargetMetadata {
|
|
9
|
+
label: string | null;
|
|
10
|
+
elementKind: AnalyticsElementKind;
|
|
11
|
+
labelConfidence: AnalyticsLabelConfidence;
|
|
12
|
+
zoneId?: string | null;
|
|
13
|
+
ancestorPath?: string[];
|
|
14
|
+
siblingLabels?: string[];
|
|
15
|
+
componentName?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare function getFallbackAnalyticsLabel(elementKind: AnalyticsElementKind): string | null;
|
|
18
|
+
export declare function getAnalyticsElementKind(elementType?: ElementType | string | null): AnalyticsElementKind;
|
|
19
|
+
export declare function chooseBestAnalyticsTarget(candidates: AnalyticsLabelCandidate[], elementKind: AnalyticsElementKind): AnalyticsTargetMetadata;
|
|
20
|
+
//# sourceMappingURL=analyticsLabeling.d.ts.map
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* 2. Consumer-tracked: via MobileAI.track() API
|
|
7
7
|
*/
|
|
8
8
|
/** Auto-captured event types */
|
|
9
|
-
export type AutoEventType = 'screen_view' | 'user_action' | 'scroll_depth' | 'idle_detected' | 'session_start' | 'session_end' | 'agent_request' | 'agent_step' | 'agent_trace' | 'agent_complete' | 'escalation' | 'knowledge_query' | 'knowledge_miss' | 'csat_response' | 'ces_response' | 'agent_first_response' | 'human_first_response' | 'fcr_achieved' | 'engagement_signal' | 'health_signal' | 'onboarding_step';
|
|
9
|
+
export type AutoEventType = 'screen_view' | 'user_action' | 'user_interaction' | 'scroll_depth' | 'idle_detected' | 'session_start' | 'session_end' | 'agent_request' | 'agent_step' | 'agent_trace' | 'agent_complete' | 'escalation' | 'knowledge_query' | 'knowledge_miss' | 'csat_response' | 'ces_response' | 'agent_first_response' | 'human_first_response' | 'fcr_achieved' | 'engagement_signal' | 'health_signal' | 'onboarding_step' | 'business_escalation' | 'dead_click' | 'dead_click_detected' | 'rage_click' | 'rage_click_detected' | 'error_screen' | 'repeated_navigation' | 'checkout_started' | 'purchase_complete' | 'purchase_completed' | 'wireframe_snapshot';
|
|
10
10
|
/** All event types (auto + custom) */
|
|
11
11
|
export type EventType = AutoEventType | string;
|
|
12
12
|
export interface TelemetryEvent {
|
|
@@ -10,7 +10,12 @@
|
|
|
10
10
|
* Naming convention: file must end in NativeComponent.ts (Codegen convention).
|
|
11
11
|
*/
|
|
12
12
|
import type { ViewProps } from 'react-native';
|
|
13
|
+
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
13
14
|
export interface NativeProps extends ViewProps {
|
|
15
|
+
windowX?: Int32;
|
|
16
|
+
windowY?: Int32;
|
|
17
|
+
windowWidth?: Int32;
|
|
18
|
+
windowHeight?: Int32;
|
|
14
19
|
}
|
|
15
20
|
declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<NativeProps>;
|
|
16
21
|
export default _default;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Support Mode — barrel export.
|
|
3
3
|
*/
|
|
4
4
|
export type { SupportModeConfig, QuickReply, EscalationConfig, EscalationContext, CSATConfig, CSATRating, BusinessHoursConfig, SupportTicket, ReportedIssue, ReportedIssueCustomerStatus, ReportedIssueStatusUpdate, } from './types';
|
|
5
|
+
export type { SupportStyle } from './supportStyle';
|
|
5
6
|
export { buildSupportPrompt } from './supportPrompt';
|
|
6
7
|
export { createEscalateTool } from './escalateTool';
|
|
7
8
|
export { createReportIssueTool } from './reportIssueTool';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type SupportStyle = 'warm-concise' | 'wow-service' | 'neutral-professional';
|
|
2
|
+
interface SupportStylePreset {
|
|
3
|
+
tone: string;
|
|
4
|
+
prompt: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveSupportStyle(style?: SupportStyle): SupportStylePreset;
|
|
7
|
+
export declare function buildSupportStylePrompt(style?: SupportStyle): string;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=supportStyle.d.ts.map
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
* - Human escalation capability
|
|
8
8
|
* - CSAT (Customer Satisfaction) collection after conversation
|
|
9
9
|
*/
|
|
10
|
+
import type { SupportStyle } from './supportStyle';
|
|
10
11
|
export interface SupportModeConfig {
|
|
11
12
|
/** Enable support mode. Default: false */
|
|
12
13
|
enabled: boolean;
|
|
@@ -42,6 +43,8 @@ export interface SupportModeConfig {
|
|
|
42
43
|
* Options for the AI's persona and tone.
|
|
43
44
|
*/
|
|
44
45
|
persona?: {
|
|
46
|
+
/** Preset support personality. Default: 'warm-concise'. */
|
|
47
|
+
preset?: SupportStyle;
|
|
45
48
|
/** The agent's name to use in conversation. */
|
|
46
49
|
agentName?: string;
|
|
47
50
|
/** The tone of the AI (e.g., 'professional', 'casual', 'empathetic'). Default: 'empathetic' */
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transforms raw navigation route names into human-readable labels.
|
|
3
|
+
* Designed to handle both Expo Router (file-based) and React Navigation conventions.
|
|
4
|
+
*/
|
|
5
|
+
export declare function humanizeScreenName(route: string | null | undefined): string;
|
|
6
|
+
//# sourceMappingURL=humanizeScreenName.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mobileai/react-native",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.29",
|
|
4
4
|
"description": "Build autonomous AI agents for React Native and Expo apps. Provides AI-native UI traversal, tool calling, and structured reasoning.",
|
|
5
5
|
"main": "./lib/module/index.js",
|
|
6
6
|
"types": "./lib/typescript/src/index.d.ts",
|
|
@@ -82,21 +82,25 @@
|
|
|
82
82
|
],
|
|
83
83
|
"repository": {
|
|
84
84
|
"type": "git",
|
|
85
|
-
"url": "git+https://github.com/
|
|
85
|
+
"url": "git+https://github.com/mohamed2m2018/react-native-agentic-ai.git"
|
|
86
86
|
},
|
|
87
87
|
"author": "Mohamed Salah <mohamed2m2018@gmail.com> (https://example.com)",
|
|
88
88
|
"license": "SEE LICENSE IN LICENSE",
|
|
89
89
|
"bugs": {
|
|
90
|
-
"url": "https://github.com/
|
|
90
|
+
"url": "https://github.com/mohamed2m2018/react-native-agentic-ai/issues"
|
|
91
91
|
},
|
|
92
|
-
"homepage": "https://github.com/
|
|
92
|
+
"homepage": "https://github.com/mohamed2m2018/react-native-agentic-ai#readme",
|
|
93
93
|
"publishConfig": {
|
|
94
94
|
"registry": "https://registry.npmjs.org/"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@babel/parser": "^7.29.2",
|
|
98
98
|
"@babel/traverse": "^7.29.0",
|
|
99
|
-
"@babel/types": "^7.29.0"
|
|
99
|
+
"@babel/types": "^7.29.0",
|
|
100
|
+
"expo": "~55.0.8",
|
|
101
|
+
"react-native-view-shot": "4.0.3",
|
|
102
|
+
"react": "19.2.0",
|
|
103
|
+
"react-native": "0.83.2"
|
|
100
104
|
},
|
|
101
105
|
"devDependencies": {
|
|
102
106
|
"@eslint/compat": "^1.3.2",
|
|
@@ -131,8 +135,7 @@
|
|
|
131
135
|
"react": "*",
|
|
132
136
|
"react-native": "*",
|
|
133
137
|
"react-native-audio-api": "*",
|
|
134
|
-
"react-native-screens": "*"
|
|
135
|
-
"react-native-view-shot": "*"
|
|
138
|
+
"react-native-screens": "*"
|
|
136
139
|
},
|
|
137
140
|
"peerDependenciesMeta": {
|
|
138
141
|
"@react-native-async-storage/async-storage": {
|
|
@@ -144,9 +147,6 @@
|
|
|
144
147
|
"react-native-screens": {
|
|
145
148
|
"optional": true
|
|
146
149
|
},
|
|
147
|
-
"react-native-view-shot": {
|
|
148
|
-
"optional": true
|
|
149
|
-
},
|
|
150
150
|
"expo-speech-recognition": {
|
|
151
151
|
"optional": true
|
|
152
152
|
}
|
|
@@ -11,9 +11,15 @@
|
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
13
|
import type { ViewProps } from 'react-native';
|
|
14
|
+
import type { Int32 } from 'react-native/Libraries/Types/CodegenTypes';
|
|
14
15
|
import codegenNativeComponent from 'react-native/Libraries/Utilities/codegenNativeComponent';
|
|
15
16
|
|
|
16
|
-
export interface NativeProps extends ViewProps {
|
|
17
|
+
export interface NativeProps extends ViewProps {
|
|
18
|
+
windowX?: Int32;
|
|
19
|
+
windowY?: Int32;
|
|
20
|
+
windowWidth?: Int32;
|
|
21
|
+
windowHeight?: Int32;
|
|
22
|
+
}
|
|
17
23
|
|
|
18
24
|
// Codegen reads this export to generate the native component interfaces.
|
|
19
25
|
export default codegenNativeComponent<NativeProps>('MobileAIFloatingOverlay');
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import AppIntents
|
|
2
|
-
import UIKit
|
|
3
|
-
|
|
4
|
-
// Auto-generated by react-native-ai-agent
|
|
5
|
-
// Do not edit manually.
|
|
6
|
-
|
|
7
|
-
@available(iOS 16.0, *)
|
|
8
|
-
struct CheckoutCartIntent: AppIntent {
|
|
9
|
-
static var title: LocalizedStringResource = "checkout_cart"
|
|
10
|
-
static var description = IntentDescription("Process checkout")
|
|
11
|
-
static var openAppWhenRun: Bool = true
|
|
12
|
-
|
|
13
|
-
@Parameter(title: "Total amount")
|
|
14
|
-
var amount: Double?
|
|
15
|
-
|
|
16
|
-
@Parameter(title: "Currency code")
|
|
17
|
-
var currency: String?
|
|
18
|
-
|
|
19
|
-
@Parameter(title: "Express checkout")
|
|
20
|
-
var isExpress: Bool?
|
|
21
|
-
|
|
22
|
-
@MainActor
|
|
23
|
-
func perform() async throws -> some IntentResult {
|
|
24
|
-
var components = URLComponents()
|
|
25
|
-
components.scheme = "feedyum"
|
|
26
|
-
components.host = "ai-action"
|
|
27
|
-
components.path = "/checkout_cart"
|
|
28
|
-
var queryItems: [URLQueryItem] = []
|
|
29
|
-
if let val = amount {
|
|
30
|
-
queryItems.append(URLQueryItem(name: "amount", value: String(describing: val)))
|
|
31
|
-
}
|
|
32
|
-
if let val = currency {
|
|
33
|
-
queryItems.append(URLQueryItem(name: "currency", value: String(describing: val)))
|
|
34
|
-
}
|
|
35
|
-
if let val = isExpress {
|
|
36
|
-
queryItems.append(URLQueryItem(name: "isExpress", value: String(describing: val)))
|
|
37
|
-
}
|
|
38
|
-
components.queryItems = queryItems
|
|
39
|
-
if let url = components.url {
|
|
40
|
-
await UIApplication.shared.open(url)
|
|
41
|
-
}
|
|
42
|
-
return .result()
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
@available(iOS 16.0, *)
|
|
47
|
-
struct MobileAIAppShortcuts: AppShortcutsProvider {
|
|
48
|
-
static var appShortcuts: [AppShortcut] {
|
|
49
|
-
AppShortcut(intent: CheckoutCartIntent(), phrases: ["\\(.applicationName) checkout cart"])
|
|
50
|
-
}
|
|
51
|
-
}
|