@onairosofficial/onairos-capacitor 0.1.0 → 0.1.1

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.
Files changed (181) hide show
  1. package/LICENSE +194 -10
  2. package/README.md +182 -25
  3. package/dist/onairos.capacitor.esm.js +1 -0
  4. package/dist/onairos.capacitor.esm.turbopack.js +1 -0
  5. package/onairos.d.ts +656 -0
  6. package/package.json +186 -38
  7. package/src/OnairosReconnectButton.jsx +272 -0
  8. package/src/RSA.jsx +57 -0
  9. package/src/assets/NewLogo.png +0 -0
  10. package/src/assets/OnairosNewLogo.png +0 -0
  11. package/src/assets/chatgpt-icon.png +0 -0
  12. package/src/assets/fire-horse.png +0 -0
  13. package/src/assets/fire-horse.transparent.png +0 -0
  14. package/src/assets/latest-firehorse.png +0 -0
  15. package/src/assets/perplexity.png +0 -0
  16. package/src/assets/persona.png +0 -0
  17. package/src/assets/persona1.png +0 -0
  18. package/src/assets/persona2.png +0 -0
  19. package/src/assets/persona3.png +0 -0
  20. package/src/assets/persona4.png +0 -0
  21. package/src/assets/persona5.png +0 -0
  22. package/src/capacitorConnectorCatalog.js +38 -0
  23. package/src/capacitorOAuthConfig.js +52 -0
  24. package/src/chatgptHostedImport/index.js +303 -0
  25. package/src/components/AuthButtons.jsx +48 -0
  26. package/src/components/ConnectChatGPTModal.jsx +666 -0
  27. package/src/components/ConnectClaudeModal.jsx +610 -0
  28. package/src/components/ConnectGeminiModal.jsx +639 -0
  29. package/src/components/ConnectGrokModal.jsx +701 -0
  30. package/src/components/ConnectPerplexityModal.jsx +726 -0
  31. package/src/components/DataExplainerScreen.jsx +349 -0
  32. package/src/components/DataRequest.js +885 -0
  33. package/src/components/DataRequest.jsx +1055 -0
  34. package/src/components/EmailAuth.js +1871 -0
  35. package/src/components/EmailAuth.jsx +2062 -0
  36. package/src/components/ExtensionInstallPrompt.jsx +142 -0
  37. package/src/components/GoogleButton.js +133 -0
  38. package/src/components/LLMConnectorManager.jsx +201 -0
  39. package/src/components/LoadingPage.jsx +19 -0
  40. package/src/components/LoadingScreen.jsx +81 -0
  41. package/src/components/LunarBirthdate.jsx +96 -0
  42. package/src/components/LunarLoadingPage.jsx +251 -0
  43. package/src/components/Notification.jsx +21 -0
  44. package/src/components/OnairosAppButton.jsx +85 -0
  45. package/src/components/OnairosSSO.jsx +645 -0
  46. package/src/components/OnairosTrigger.jsx +61 -0
  47. package/src/components/PerplexityLogo.jsx +43 -0
  48. package/src/components/PinSetup.js +200 -0
  49. package/src/components/PinSetup.jsx +228 -0
  50. package/src/components/SDK_PIN_INTEGRATION_REQUIRED_CHANGES.md +526 -0
  51. package/src/components/SdkErrorBoundary.jsx +36 -0
  52. package/src/components/SecuritySetup.js +81 -0
  53. package/src/components/SessionUserBar.jsx +83 -0
  54. package/src/components/SignUp.js +123 -0
  55. package/src/components/TestTelegramButton.js +53 -0
  56. package/src/components/TrainingComponent.jsx +200 -0
  57. package/src/components/TrainingScreen.jsx +897 -0
  58. package/src/components/UniversalOnboarding.js +306 -0
  59. package/src/components/UniversalOnboarding.jsx +4837 -0
  60. package/src/components/ValentineLoadingPage.jsx +502 -0
  61. package/src/components/ValentineModeSelector.jsx +162 -0
  62. package/src/components/WelcomeScreen.jsx +435 -0
  63. package/src/components/WrappedLoadingPage.jsx +205 -0
  64. package/src/components/connectors/ChatGPTConnector.js +348 -0
  65. package/src/components/connectors/ChatGPTConnector.jsx +348 -0
  66. package/src/components/connectors/ClaudeConnector.js +44 -0
  67. package/src/components/connectors/ClaudeConnector.jsx +44 -0
  68. package/src/components/connectors/GeminiConnector.js +170 -0
  69. package/src/components/connectors/GeminiConnector.jsx +170 -0
  70. package/src/components/connectors/GmailConnector.js +148 -0
  71. package/src/components/connectors/GmailConnector.jsx +148 -0
  72. package/src/components/connectors/GrokConnector.js +16 -0
  73. package/src/components/connectors/GrokConnector.jsx +16 -0
  74. package/src/components/connectors/HingeConnector.js +419 -0
  75. package/src/components/connectors/HingeConnector.jsx +419 -0
  76. package/src/components/connectors/InstagramDataConnector.js +726 -0
  77. package/src/components/connectors/InstagramDataConnector.jsx +726 -0
  78. package/src/components/connectors/LinkedInConnector.js +4 -0
  79. package/src/components/connectors/LinkedInConnector.jsx +296 -0
  80. package/src/components/connectors/PerplexityConnector.jsx +16 -0
  81. package/src/components/connectors/PinterestConnector.js +208 -0
  82. package/src/components/connectors/PinterestConnector.jsx +208 -0
  83. package/src/components/connectors/README.md +292 -0
  84. package/src/components/connectors/RedditConnector.js +229 -0
  85. package/src/components/connectors/RedditConnector.jsx +229 -0
  86. package/src/components/connectors/SephoraConnector.js +482 -0
  87. package/src/components/connectors/SephoraConnector.jsx +482 -0
  88. package/src/components/connectors/TikTokConnector.jsx +430 -0
  89. package/src/components/connectors/YoutubeConnector.js +361 -0
  90. package/src/components/connectors/YoutubeConnector.jsx +361 -0
  91. package/src/components/connectors/index.js +50 -0
  92. package/src/components/icons.jsx +46 -0
  93. package/src/components/icons.tsx +21 -0
  94. package/src/components/ui/PageLayout.jsx +1255 -0
  95. package/src/components/ui/PrimaryButton.jsx +162 -0
  96. package/src/components/ui/button.jsx +49 -0
  97. package/src/components/ui/card.jsx +61 -0
  98. package/src/components/ui/checkbox.jsx +33 -0
  99. package/src/components/ui/label.jsx +29 -0
  100. package/src/components/utils/UpdateConnections.js +45 -0
  101. package/src/components/utils/oauthHelper.js +97 -0
  102. package/src/config/api-config.js +138 -0
  103. package/src/deepLink.jsx +38 -0
  104. package/src/getPin.js +26 -0
  105. package/src/icons/Avatar.png +0 -0
  106. package/src/icons/Sentiment.png +0 -0
  107. package/src/icons/Trait.png +0 -0
  108. package/src/iframe/DataRequestPage.jsx +285 -0
  109. package/src/iframe/OnairosButtonIntegration.md +148 -0
  110. package/src/iframe/components/Box.jsx +56 -0
  111. package/src/iframe/components/IndividualConnection.jsx +88 -0
  112. package/src/iframe/dataRequestHandler.js +714 -0
  113. package/src/iframe/data_request_iframe.html +27 -0
  114. package/src/iframe/data_request_page.js +47 -0
  115. package/src/iframe/icons/Avatar.png +1 -0
  116. package/src/iframe/icons/Avatar2.png +1 -0
  117. package/src/iframe/icons/Sentiment.png +1 -0
  118. package/src/iframe/icons/Trait.png +1 -0
  119. package/src/iframe/icons/onairos_logo.png +0 -0
  120. package/src/iframe/utils/api.js +57 -0
  121. package/src/index.js +274 -0
  122. package/src/laravel/OnairosVue.vue +410 -0
  123. package/src/laravel/blade-helpers.js +320 -0
  124. package/src/laravel/vite-plugin.js +179 -0
  125. package/src/mobile/MobileDataRequestPage.jsx +233 -0
  126. package/src/mobile/components/MobileBox.jsx +71 -0
  127. package/src/mobile/components/MobileIndividualConnection.jsx +51 -0
  128. package/src/mobile/shims/browser-apis.js +78 -0
  129. package/src/mobile/shims/lucide-shim.js +85 -0
  130. package/src/newUI/EMAIL_VERIFICATION_API_SCHEMA.md +268 -0
  131. package/src/newUI/PlatformConnectorsStep.tsx +435 -0
  132. package/src/newUI/PrimaryButton.tsx +213 -0
  133. package/src/newUI/SignInStep.tsx +194 -0
  134. package/src/newUI/VerificationStep.tsx +133 -0
  135. package/src/newUI/WelcomeScreen.tsx +311 -0
  136. package/src/newUI/services/connectedAccountsService.js +129 -0
  137. package/src/onairos.capacitor.jsx +16 -0
  138. package/src/onairos.core.jsx +133 -0
  139. package/src/onairos.jsx +14 -0
  140. package/src/onairos.native.jsx +15 -0
  141. package/src/onairosButton.jsx +9000 -0
  142. package/src/overlay/CheckBox.jsx +114 -0
  143. package/src/overlay/IndividualConnection copy.js +86 -0
  144. package/src/overlay/IndividualConnection.js +191 -0
  145. package/src/overlay/IndividualConnectionNew.jsx +157 -0
  146. package/src/overlay/box.js +84 -0
  147. package/src/overlay/overlay.js +437 -0
  148. package/src/styles/onairos-scoped-preflight.css +97 -0
  149. package/src/styles/sdkCssRegistry.js +20 -0
  150. package/src/styles/styleLoaderInsertShadow.js +69 -0
  151. package/src/styles/tailwind.capacitor.css +395 -0
  152. package/src/styles/tailwind.css +395 -0
  153. package/src/theme/colors.js +40 -0
  154. package/src/utils/apiKeyValidation.js +341 -0
  155. package/src/utils/apiResponseLogger.js +316 -0
  156. package/src/utils/authHeaders.js +275 -0
  157. package/src/utils/biometrics.js +26 -0
  158. package/src/utils/bookmarkletUtils.js +28 -0
  159. package/src/utils/capacitorDetection.js +278 -0
  160. package/src/utils/capacitorLLMHelper.js +352 -0
  161. package/src/utils/capacitorPlugins.js +366 -0
  162. package/src/utils/crossDomainSSO.js +587 -0
  163. package/src/utils/deepLinking.js +27 -0
  164. package/src/utils/devLogger.js +46 -0
  165. package/src/utils/extensionDetection.js +418 -0
  166. package/src/utils/extractMemory.js +277 -0
  167. package/src/utils/framerBrandingOverrides.js +40 -0
  168. package/src/utils/googleWebClientId.js +55 -0
  169. package/src/utils/overlayHandler.js +224 -0
  170. package/src/utils/platformDisconnect.js +309 -0
  171. package/src/utils/pollTrainingStatus.js +200 -0
  172. package/src/utils/rawMemoriesAccess.js +211 -0
  173. package/src/utils/resolveBackendAppId.js +47 -0
  174. package/src/utils/responseFormatter.js +140 -0
  175. package/src/utils/sdkDebugStorage.js +113 -0
  176. package/src/utils/sdkInitialization.js +645 -0
  177. package/src/utils/sessionManager.js +1258 -0
  178. package/src/utils/startBackgroundTraining.js +100 -0
  179. package/src/utils/userDataFormatter.js +222 -0
  180. package/index.d.ts +0 -1
  181. package/index.js +0 -1
@@ -0,0 +1,311 @@
1
+ import React, { useEffect, useRef, useState } from 'react';
2
+ import {
3
+ View,
4
+ StyleSheet,
5
+ Modal,
6
+ TouchableWithoutFeedback,
7
+ Animated,
8
+ Easing,
9
+ StatusBar,
10
+ } from 'react-native';
11
+ import { useNavigation } from '@react-navigation/native';
12
+ import { NativeStackNavigationProp } from '@react-navigation/native-stack';
13
+ import { triggerHaptic, HapticType } from '../../utils/haptics';
14
+
15
+ // Import our new components
16
+ import ModalSheet from '../components/ModalSheet';
17
+ import ModalHeader from '../components/ModalHeader';
18
+ import BrandMark from '../components/BrandMark';
19
+ import HeadingGroup from '../components/HeadingGroup';
20
+ import BodyText from '../components/BodyText';
21
+ import PrimaryButton from '../components/PrimaryButton';
22
+ import SignInStep from '../components/SignInStep';
23
+ import VerificationStep from '../components/VerificationStep';
24
+ import PlatformConnectorsStep from '../components/PlatformConnectorsStep';
25
+
26
+
27
+ // Type definitions for navigation
28
+ type RootStackParamList = {
29
+ SignIn: { photo?: string };
30
+ Welcome: undefined;
31
+ };
32
+
33
+ type NavigationProp = NativeStackNavigationProp<RootStackParamList>;
34
+
35
+ interface WelcomeScreenProps {
36
+ visible: boolean;
37
+ onClose: () => void;
38
+ }
39
+
40
+ type ModalStep = 'welcome' | 'signin' | 'verification' | 'platforms';
41
+
42
+ const WelcomeScreen: React.FC<WelcomeScreenProps> = ({
43
+ visible,
44
+ onClose,
45
+ }) => {
46
+ const navigation = useNavigation<NavigationProp>();
47
+ const [currentStep, setCurrentStep] = useState<ModalStep>('welcome');
48
+ const [userEmail, setUserEmail] = useState<string>('');
49
+
50
+ // Animation values
51
+ const slideAnim = useRef(new Animated.Value(1)).current; // Start from bottom
52
+ const fadeAnim = useRef(new Animated.Value(0)).current;
53
+
54
+ // Animate in when visible (matching existing modal style)
55
+ useEffect(() => {
56
+ if (visible) {
57
+ Animated.parallel([
58
+ Animated.timing(slideAnim, {
59
+ toValue: 0,
60
+ duration: 400,
61
+ easing: Easing.out(Easing.cubic),
62
+ useNativeDriver: true,
63
+ }),
64
+ Animated.timing(fadeAnim, {
65
+ toValue: 1,
66
+ duration: 300,
67
+ useNativeDriver: true,
68
+ }),
69
+ ]).start();
70
+ } else {
71
+ slideAnim.setValue(1);
72
+ fadeAnim.setValue(0);
73
+ }
74
+ }, [visible]);
75
+
76
+ const handleClose = () => {
77
+ triggerHaptic(HapticType.BUTTON_PRESS);
78
+
79
+ // Reset to welcome step
80
+ setCurrentStep('welcome');
81
+
82
+ Animated.parallel([
83
+ Animated.timing(slideAnim, {
84
+ toValue: 1,
85
+ duration: 300,
86
+ easing: Easing.in(Easing.cubic),
87
+ useNativeDriver: true,
88
+ }),
89
+ Animated.timing(fadeAnim, {
90
+ toValue: 0,
91
+ duration: 250,
92
+ useNativeDriver: true,
93
+ }),
94
+ ]).start(() => {
95
+ onClose();
96
+ });
97
+ };
98
+
99
+ const handleGetStarted = () => {
100
+ triggerHaptic(HapticType.BUTTON_PRESS);
101
+ // Move to sign-in step instead of closing modal
102
+ setCurrentStep('signin');
103
+ };
104
+
105
+ const handleEmailSubmit = (email: string) => {
106
+ triggerHaptic(HapticType.BUTTON_PRESS);
107
+ // Store the email and move to verification
108
+ setUserEmail(email);
109
+ setCurrentStep('verification');
110
+ };
111
+
112
+ const handleGoogleSignIn = () => {
113
+ triggerHaptic(HapticType.BUTTON_PRESS);
114
+ // TODO: Integrate with existing Google sign-in logic
115
+ console.log('Google sign-in pressed');
116
+ };
117
+
118
+ const handleContinue = () => {
119
+ triggerHaptic(HapticType.BUTTON_PRESS);
120
+ // Move to verification step
121
+ setCurrentStep('verification');
122
+ };
123
+
124
+ const handleCodeSubmit = (code: string) => {
125
+ triggerHaptic(HapticType.BUTTON_PRESS);
126
+ // TODO: Handle verification code submission
127
+ console.log('Verification code submitted:', code);
128
+ // Move to platform connectors step
129
+ setCurrentStep('platforms');
130
+ };
131
+
132
+ const handleBackToSignIn = () => {
133
+ triggerHaptic(HapticType.BUTTON_PRESS);
134
+ setCurrentStep('signin');
135
+ };
136
+
137
+ const handleBackToVerification = () => {
138
+ triggerHaptic(HapticType.BUTTON_PRESS);
139
+ setCurrentStep('verification');
140
+ };
141
+
142
+ const handlePlatformUpdate = (connectedPlatforms: string[]) => {
143
+ triggerHaptic(HapticType.BUTTON_PRESS);
144
+ // TODO: Handle platform connections
145
+ console.log('Connected platforms:', connectedPlatforms);
146
+ // For now, close the modal (could proceed to next step)
147
+ onClose();
148
+ };
149
+
150
+ const handlePlatformSkip = () => {
151
+ triggerHaptic(HapticType.BUTTON_PRESS);
152
+ // Skip platform connections and close modal
153
+ onClose();
154
+ };
155
+
156
+ const handleBackdropPress = () => {
157
+ // Optional: allow closing by tapping backdrop
158
+ handleClose();
159
+ };
160
+
161
+ if (!visible) {
162
+ return null;
163
+ }
164
+
165
+ return (
166
+ <Modal
167
+ visible={visible}
168
+ transparent
169
+ animationType="slide" // Use built-in slide animation like existing modal
170
+ onRequestClose={handleClose}
171
+ statusBarTranslucent
172
+ >
173
+ <StatusBar backgroundColor="rgba(0,0,0,0.5)" barStyle="light-content" />
174
+
175
+ {/* Backdrop */}
176
+ <Animated.View style={[styles.backdrop, { opacity: fadeAnim }]}>
177
+ <TouchableWithoutFeedback onPress={handleBackdropPress}>
178
+ <View style={styles.backdropTouchable} />
179
+ </TouchableWithoutFeedback>
180
+ </Animated.View>
181
+
182
+ {/* Modal Content */}
183
+ <Animated.View
184
+ style={[
185
+ styles.modalContainer,
186
+ {
187
+ transform: [{
188
+ translateY: slideAnim.interpolate({
189
+ inputRange: [0, 1],
190
+ outputRange: [0, 600], // Slide from bottom
191
+ })
192
+ }]
193
+ }
194
+ ]}
195
+ >
196
+ <ModalSheet topPadding={0}>
197
+ <ModalHeader
198
+ onClose={handleClose}
199
+ onBack={currentStep === 'verification' ? handleBackToSignIn : handleBackToVerification}
200
+ showBackButton={currentStep === 'verification' || currentStep === 'platforms'}
201
+ />
202
+
203
+ {currentStep === 'welcome' && (
204
+ <View style={styles.content}>
205
+ {/* Brand Mark */}
206
+ <View style={styles.brandMarkContainer}>
207
+ <BrandMark />
208
+ </View>
209
+
210
+ {/* Heading Group */}
211
+ <View style={styles.headingContainer}>
212
+ <HeadingGroup />
213
+ </View>
214
+
215
+ {/* Body Text */}
216
+ <View style={styles.bodyContainer}>
217
+ <BodyText />
218
+ </View>
219
+
220
+ {/* Flexible Spacer */}
221
+ <View style={styles.spacer} />
222
+
223
+ {/* Primary Button */}
224
+ <View style={styles.buttonContainer}>
225
+ <PrimaryButton
226
+ label="Get Started"
227
+ onPress={handleGetStarted}
228
+ testID="welcome-get-started-button"
229
+ />
230
+ </View>
231
+ </View>
232
+ )}
233
+
234
+ {currentStep === 'signin' && (
235
+ <SignInStep
236
+ onEmailSubmit={handleEmailSubmit}
237
+ onGoogleSignIn={handleGoogleSignIn}
238
+ onContinue={handleContinue}
239
+ />
240
+ )}
241
+
242
+ {currentStep === 'verification' && (
243
+ <VerificationStep
244
+ email={userEmail}
245
+ onCodeSubmit={handleCodeSubmit}
246
+ onBack={handleBackToSignIn}
247
+ />
248
+ )}
249
+
250
+ {currentStep === 'platforms' && (
251
+ <PlatformConnectorsStep
252
+ onUpdate={handlePlatformUpdate}
253
+ onSkip={handlePlatformSkip}
254
+ />
255
+ )}
256
+ </ModalSheet>
257
+ </Animated.View>
258
+ </Modal>
259
+ );
260
+ };
261
+
262
+ const styles = StyleSheet.create({
263
+ backdrop: {
264
+ ...StyleSheet.absoluteFillObject,
265
+ backgroundColor: 'transparent', // Remove grey overlay
266
+ },
267
+
268
+ backdropTouchable: {
269
+ flex: 1,
270
+ },
271
+
272
+ modalContainer: {
273
+ position: 'absolute',
274
+ bottom: 0,
275
+ left: 0,
276
+ right: 0,
277
+ height: '85%', // Take most of the screen
278
+ },
279
+
280
+ content: {
281
+ flex: 1,
282
+ alignItems: 'center',
283
+ paddingTop: 20,
284
+ },
285
+
286
+ brandMarkContainer: {
287
+ marginBottom: 32,
288
+ },
289
+
290
+ headingContainer: {
291
+ marginBottom: 24,
292
+ },
293
+
294
+ bodyContainer: {
295
+ marginBottom: 32,
296
+ width: '100%',
297
+ },
298
+
299
+ spacer: {
300
+ flex: 1,
301
+ minHeight: 20, // Ensure some minimum space
302
+ },
303
+
304
+ buttonContainer: {
305
+ width: '100%',
306
+ paddingHorizontal: 24,
307
+ paddingBottom: 20,
308
+ },
309
+ });
310
+
311
+ export default WelcomeScreen;
@@ -0,0 +1,129 @@
1
+ /**
2
+ * Connected Accounts Service
3
+ * Provides platform icons and related utilities
4
+ */
5
+
6
+ /**
7
+ * Get platform icon (emoji, image path, or component)
8
+ * @param {string} platform - Platform name
9
+ * @returns {string|object} - Platform icon emoji or image component
10
+ */
11
+ export function getPlatformIcon(platform) {
12
+ const platformLower = platform.toLowerCase();
13
+
14
+ // Special handling for ChatGPT - return image component
15
+ if (platformLower === 'chatgpt') {
16
+ return {
17
+ type: 'image',
18
+ src: '/chatgpt-icon.png',
19
+ alt: 'ChatGPT',
20
+ fallback: '🤖'
21
+ };
22
+ }
23
+
24
+ // Regular emoji icons for other platforms
25
+ const icons = {
26
+ youtube: '📺',
27
+ linkedin: '💼',
28
+ instagram: '📷',
29
+ pinterest: '📌',
30
+ reddit: '🔥',
31
+ gmail: '📧',
32
+ facebook: '📘',
33
+ twitter: '🐦',
34
+ tiktok: '🎵',
35
+ snapchat: '👻',
36
+ discord: '🎮',
37
+ spotify: '🎵',
38
+ apple: '🍎',
39
+ google: '🔍'
40
+ };
41
+
42
+ return icons[platformLower] || '🔗';
43
+ }
44
+
45
+ /**
46
+ * Get platform color
47
+ * @param {string} platform - Platform name
48
+ * @returns {string} - Platform color class
49
+ */
50
+ export function getPlatformColor(platform) {
51
+ const colors = {
52
+ chatgpt: 'bg-green-600',
53
+ youtube: 'bg-red-500',
54
+ linkedin: 'bg-blue-700',
55
+ instagram: 'bg-pink-500',
56
+ pinterest: 'bg-red-600',
57
+ reddit: 'bg-orange-500',
58
+ gmail: 'bg-red-500',
59
+ facebook: 'bg-blue-600',
60
+ twitter: 'bg-blue-400',
61
+ tiktok: 'bg-black',
62
+ snapchat: 'bg-yellow-400',
63
+ discord: 'bg-indigo-600',
64
+ spotify: 'bg-green-500',
65
+ apple: 'bg-gray-800',
66
+ google: 'bg-blue-500'
67
+ };
68
+
69
+ return colors[platform.toLowerCase()] || 'bg-gray-500';
70
+ }
71
+
72
+ /**
73
+ * Get platform display name
74
+ * @param {string} platform - Platform name
75
+ * @returns {string} - Platform display name
76
+ */
77
+ export function getPlatformDisplayName(platform) {
78
+ const names = {
79
+ chatgpt: 'ChatGPT',
80
+ youtube: 'YouTube',
81
+ linkedin: 'LinkedIn',
82
+ instagram: 'Instagram',
83
+ pinterest: 'Pinterest',
84
+ reddit: 'Reddit',
85
+ gmail: 'Gmail',
86
+ facebook: 'Facebook',
87
+ twitter: 'Twitter',
88
+ tiktok: 'TikTok',
89
+ snapchat: 'Snapchat',
90
+ discord: 'Discord',
91
+ spotify: 'Spotify',
92
+ apple: 'Apple',
93
+ google: 'Google'
94
+ };
95
+
96
+ return names[platform.toLowerCase()] || platform;
97
+ }
98
+
99
+ /**
100
+ * Check if platform supports OAuth
101
+ * @param {string} platform - Platform name
102
+ * @returns {boolean} - Whether platform supports OAuth
103
+ */
104
+ export function supportsOAuth(platform) {
105
+ const oauthPlatforms = [
106
+ 'youtube', 'linkedin', 'instagram', 'pinterest',
107
+ 'reddit', 'gmail', 'facebook', 'twitter', 'tiktok', 'google'
108
+ ];
109
+
110
+ return oauthPlatforms.includes(platform.toLowerCase());
111
+ }
112
+
113
+ /**
114
+ * Check if platform has special behavior
115
+ * @param {string} platform - Platform name
116
+ * @returns {boolean} - Whether platform has special behavior
117
+ */
118
+ export function hasSpecialBehavior(platform) {
119
+ const specialPlatforms = ['chatgpt'];
120
+ return specialPlatforms.includes(platform.toLowerCase());
121
+ }
122
+
123
+ export default {
124
+ getPlatformIcon,
125
+ getPlatformColor,
126
+ getPlatformDisplayName,
127
+ supportsOAuth,
128
+ hasSpecialBehavior
129
+ };
@@ -0,0 +1,16 @@
1
+ // IMPORTANT:
2
+ // Capacitor-only entrypoint.
3
+ //
4
+ // This build avoids global Tailwind preflight (which can pollute the host app),
5
+ // but includes a minimal scoped reset inside `.onairos-modal` so the SDK UI
6
+ // still renders correctly.
7
+ import '@onairosofficial/capacitor-llm-onairos';
8
+ import cssText from './styles/tailwind.capacitor.css?inline';
9
+ import { registerOnairosCssText } from './styles/sdkCssRegistry.js';
10
+
11
+ // Register compiled CSS so the modal can inject into ShadowRoot (no document.head pollution).
12
+ registerOnairosCssText(cssText);
13
+
14
+ export * from './onairos.core.jsx';
15
+ export { default } from './onairos.core.jsx';
16
+
@@ -0,0 +1,133 @@
1
+ // Core Onairos entry WITHOUT importing any CSS.
2
+ // Wrapper entrypoints (`src/onairos.jsx`, `src/onairos.capacitor.jsx`) are responsible for styles.
3
+
4
+ import React from 'react';
5
+ import { GoogleOAuthProvider } from '@react-oauth/google';
6
+ import OnairosButton from './onairosButton.jsx';
7
+ import SdkErrorBoundary from './components/SdkErrorBoundary.jsx';
8
+ import {
9
+ DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID,
10
+ resolveGoogleWebClientId,
11
+ } from './utils/googleWebClientId.js';
12
+
13
+ // Main Onairos component
14
+ export function Onairos(props) {
15
+ const googleClientId = resolveGoogleWebClientId(props.googleClientId);
16
+
17
+ // Helpful warning: origin_mismatch is almost always due to missing origins for the chosen clientId.
18
+ // We warn when the SDK is using the baked-in fallback clientId so integrators know to override it.
19
+ if (typeof window !== 'undefined') {
20
+ const isDefault = googleClientId === DEFAULT_ONAIROS_GOOGLE_WEB_CLIENT_ID;
21
+ if (isDefault) {
22
+ const origin = window.location?.origin;
23
+ // eslint-disable-next-line no-console
24
+ console.warn(
25
+ `[onairos] Using default Google OAuth clientId. If you see Google error "origin_mismatch", ` +
26
+ `you must either (a) pass googleClientId to <Onairos />, or (b) set window.onairosGoogleClientId, ` +
27
+ `and add this origin in Google Cloud Console: ${origin}`
28
+ );
29
+ }
30
+ }
31
+
32
+ return (
33
+ <SdkErrorBoundary onError={props.onSdkError}>
34
+ <GoogleOAuthProvider clientId={googleClientId}>
35
+ <OnairosButton {...props} googleClientId={googleClientId} />
36
+ </GoogleOAuthProvider>
37
+ </SdkErrorBoundary>
38
+ );
39
+ }
40
+
41
+ // Export both the main component and individual components.
42
+ // NOTE: use a DIRECT re-export for OnairosButton (not `export { OnairosButton }`
43
+ // of the imported binding). The import-then-reexport form was being dropped from
44
+ // the production ESM build's export table — the same init-order fragility noted
45
+ // below — which broke consumers doing `module.OnairosButton` (React "Element
46
+ // type is invalid ... got: object"). A direct re-export is tracked as a live
47
+ // binding and survives concatenation/IIFE rewrites.
48
+ export { default as OnairosButton } from './onairosButton.jsx';
49
+ export default Onairos;
50
+
51
+ // v7.1.0 — Render-props sugar for hosts wanting custom button UI.
52
+ // <OnairosTrigger config={{ ...sameAsOnairosProps }}>
53
+ // {({ open, isLoading, isReady }) => <YourButton onClick={open} />}
54
+ // </OnairosTrigger>
55
+ export { OnairosTrigger } from './components/OnairosTrigger.jsx';
56
+
57
+ export {
58
+ CONNECTOR_IDS,
59
+ SUPPORTED_PLATFORMS,
60
+ } from './capacitorConnectorCatalog.js';
61
+
62
+ export {
63
+ getGoogleClientIds,
64
+ getYoutubeClientId,
65
+ updateGoogleClientIds,
66
+ updateYoutubeClientId,
67
+ } from './capacitorOAuthConfig.js';
68
+
69
+ // Export overlay handler functions for programmatic access
70
+ export {
71
+ openOnairosOverlay,
72
+ useOnairosOverlay,
73
+ getOnairosData
74
+ } from './utils/overlayHandler.js';
75
+
76
+ // Export response formatting utilities
77
+ export {
78
+ formatOnairosResponse,
79
+ formatPersonalityScores,
80
+ getPersonalityTypes,
81
+ getTraitCategories,
82
+ PERSONALITY_TYPES,
83
+ TRAIT_CATEGORIES
84
+ } from './utils/responseFormatter.js';
85
+
86
+ // Initialize SDK functionality with standardized API key validation
87
+ export {
88
+ initializeApiKey,
89
+ isSDKInitialized,
90
+ getSDKState,
91
+ getApiKey,
92
+ getSDKConfig,
93
+ resetSDK
94
+ } from './utils/sdkInitialization.js';
95
+
96
+ // Export API key validation utilities
97
+ export {
98
+ validateApiKey,
99
+ ApiKeyType,
100
+ ErrorCodes
101
+ } from './utils/apiKeyValidation.js';
102
+
103
+ // Training status polling — exposed on window.Onairos for host-managed flows
104
+ // (backgroundLoadData=true / trainingScreenMode='none'). Mirrors src/index.js.
105
+ export {
106
+ pollTrainingStatus,
107
+ normalizeTrainingFromResolution
108
+ } from './utils/pollTrainingStatus.js';
109
+
110
+ // rawMemoriesAccess helpers: export from `onairos` package index only — not here.
111
+ // Re-exporting from this barrel while importing OnairosButton caused ESM init-order
112
+ // TDZ failures in Vite/Rollup production graphs (8.3.15+).
113
+
114
+ export {
115
+ SDK_VERSION,
116
+ SDK_BUILD_TIME,
117
+ persistSdkDebugMeta,
118
+ getSdkDebugMeta,
119
+ getSdkDebugRing,
120
+ pushSdkDebugEvent,
121
+ maskEmail,
122
+ } from './utils/sdkDebugStorage.js';
123
+
124
+ // ChatGPT hosted temporary browser import (one-time, user-directed import).
125
+ // Additive — does not affect the existing ChatGPTConnector bookmarklet flow.
126
+ export {
127
+ connectHostedImport,
128
+ connectChatGPTHostedImport,
129
+ connectClaudeHostedImport,
130
+ connectGeminiHostedImport,
131
+ connectGrokHostedImport,
132
+ connectInstagramHostedImport,
133
+ } from './chatgptHostedImport/index.js';
@@ -0,0 +1,14 @@
1
+ // IMPORTANT:
2
+ // `package.json#exports.import` points at `dist/onairos.esm.js` built from this file.
3
+ // This is the default web entrypoint and includes full Tailwind (including preflight).
4
+ import '@onairosofficial/capacitor-llm-onairos';
5
+ import './styles/tailwind.css';
6
+ import cssText from './styles/tailwind.css?inline';
7
+ import { registerOnairosCssText } from './styles/sdkCssRegistry.js';
8
+
9
+ // Register CSS text so the shadow-root modal can render synchronously without
10
+ // waiting for a linked stylesheet to load, which avoids first-open flicker.
11
+ registerOnairosCssText(cssText);
12
+
13
+ export * from './onairos.core.jsx';
14
+ export { default } from './onairos.core.jsx';
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import { OnairosButton } from './onairosButton.jsx';
3
+
4
+ /**
5
+ * Main export for React Native environments
6
+ * This component is optimized for React Native usage
7
+ */
8
+ const Onairos = (props) => {
9
+ return (
10
+ <OnairosButton {...props} />
11
+ );
12
+ };
13
+
14
+ export { OnairosButton };
15
+ export default Onairos;