@ateam-ai-mobile/expo 0.1.4 → 0.1.7
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/android/build.gradle +16 -0
- package/android/src/main/java/expo/modules/adavision/AdaVisionModule.kt +75 -0
- package/dist/attachmentCache-DhQTqi2E.d.mts +18 -0
- package/dist/attachmentCache-DhQTqi2E.d.ts +18 -0
- package/dist/bootstrap.d.mts +95 -0
- package/dist/bootstrap.d.ts +95 -0
- package/dist/bootstrap.js +2473 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/bootstrap.mjs +64 -0
- package/dist/bootstrap.mjs.map +1 -0
- package/dist/chunk-4BMWVN25.mjs +91 -0
- package/dist/chunk-4BMWVN25.mjs.map +1 -0
- package/dist/chunk-4XYXJYN5.mjs +1513 -0
- package/dist/chunk-4XYXJYN5.mjs.map +1 -0
- package/dist/chunk-5HM6UA2K.mjs +571 -0
- package/dist/chunk-5HM6UA2K.mjs.map +1 -0
- package/dist/chunk-6LXF3JVX.mjs +96 -0
- package/dist/chunk-6LXF3JVX.mjs.map +1 -0
- package/dist/chunk-FF6ZZZXH.mjs +71 -0
- package/dist/chunk-FF6ZZZXH.mjs.map +1 -0
- package/dist/chunk-KOXF2FZM.mjs +92 -0
- package/dist/chunk-KOXF2FZM.mjs.map +1 -0
- package/dist/chunk-L4V7OCJ3.mjs +71 -0
- package/dist/chunk-L4V7OCJ3.mjs.map +1 -0
- package/dist/chunk-TZXWVYYR.mjs +67 -0
- package/dist/chunk-TZXWVYYR.mjs.map +1 -0
- package/dist/chunk-VQJPSLHP.mjs +1801 -0
- package/dist/chunk-VQJPSLHP.mjs.map +1 -0
- package/dist/chunk-WMJKH4XE.mjs +34 -0
- package/dist/chunk-WMJKH4XE.mjs.map +1 -0
- package/dist/chunk-XQSY6MHP.mjs +213 -0
- package/dist/chunk-XQSY6MHP.mjs.map +1 -0
- package/dist/createBridge.mjs +2 -0
- package/dist/createBridge.mjs.map +1 -1
- package/dist/device/createDeviceProvider.d.mts +23 -0
- package/dist/device/createDeviceProvider.d.ts +23 -0
- package/dist/device/createDeviceProvider.js +967 -0
- package/dist/device/createDeviceProvider.js.map +1 -0
- package/dist/device/createDeviceProvider.mjs +17 -0
- package/dist/device/createDeviceProvider.mjs.map +1 -0
- package/dist/device-bridge/collectors/appEngagement.d.mts +10 -0
- package/dist/device-bridge/collectors/appEngagement.d.ts +10 -0
- package/dist/device-bridge/collectors/appEngagement.js +128 -0
- package/dist/device-bridge/collectors/appEngagement.js.map +1 -0
- package/dist/device-bridge/collectors/appEngagement.mjs +12 -0
- package/dist/device-bridge/collectors/appEngagement.mjs.map +1 -0
- package/dist/device-bridge/collectors/health.d.mts +24 -0
- package/dist/device-bridge/collectors/health.d.ts +24 -0
- package/dist/device-bridge/collectors/health.js +238 -0
- package/dist/device-bridge/collectors/health.js.map +1 -0
- package/dist/device-bridge/collectors/health.mjs +18 -0
- package/dist/device-bridge/collectors/health.mjs.map +1 -0
- package/dist/device-bridge/cookies.d.mts +49 -0
- package/dist/device-bridge/cookies.d.ts +49 -0
- package/dist/device-bridge/cookies.js +90 -0
- package/dist/device-bridge/cookies.js.map +1 -0
- package/dist/device-bridge/cookies.mjs +14 -0
- package/dist/device-bridge/cookies.mjs.map +1 -0
- package/dist/device-bridge/index.d.mts +483 -0
- package/dist/device-bridge/index.d.ts +483 -0
- package/dist/device-bridge/index.js +2084 -0
- package/dist/device-bridge/index.js.map +1 -0
- package/dist/device-bridge/index.mjs +32 -0
- package/dist/device-bridge/index.mjs.map +1 -0
- package/dist/device-bridge/nfc.d.mts +30 -0
- package/dist/device-bridge/nfc.d.ts +30 -0
- package/dist/device-bridge/nfc.js +109 -0
- package/dist/device-bridge/nfc.js.map +1 -0
- package/dist/device-bridge/nfc.mjs +14 -0
- package/dist/device-bridge/nfc.mjs.map +1 -0
- package/dist/index.d.mts +493 -18
- package/dist/index.d.ts +493 -18
- package/dist/index.js +1409 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +23 -194
- package/dist/index.mjs.map +1 -1
- package/dist/oauth/expoOAuth.d.mts +18 -0
- package/dist/oauth/expoOAuth.d.ts +18 -0
- package/dist/oauth/expoOAuth.js +102 -0
- package/dist/oauth/expoOAuth.js.map +1 -0
- package/dist/oauth/expoOAuth.mjs +8 -0
- package/dist/oauth/expoOAuth.mjs.map +1 -0
- package/dist/types-BRanJYTn.d.mts +138 -0
- package/dist/types-BRanJYTn.d.ts +138 -0
- package/dist/vision/index.d.mts +81 -0
- package/dist/vision/index.d.ts +81 -0
- package/dist/vision/index.js +101 -0
- package/dist/vision/index.js.map +1 -0
- package/dist/vision/index.mjs +28 -0
- package/dist/vision/index.mjs.map +1 -0
- package/expo-module.config.json +9 -0
- package/ios/AdaVision.podspec +28 -0
- package/ios/AdaVisionModule.swift +432 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/analytics/coremldata.bin +0 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/coremldata.bin +0 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/metadata.json +773 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/model0/analytics/coremldata.bin +0 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/model0/coremldata.bin +0 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/model0/model.mil +720 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/model0/weights/weight.bin +0 -0
- package/ios/Resources/yolov8n-oiv7.mlmodelc/model1/coremldata.bin +0 -0
- package/package.json +107 -7
- package/src/bootstrap.ts +159 -0
- package/src/camera/CameraTaskHost.tsx +175 -0
- package/src/camera/cameraTasks.ts +129 -0
- package/src/device/createDeviceProvider.ts +832 -0
- package/src/device-bridge/actions/calendar-actions.ts +217 -0
- package/src/device-bridge/actions/dnd.ts +74 -0
- package/src/device-bridge/actions/health-actions.ts +58 -0
- package/src/device-bridge/actions/index.ts +12 -0
- package/src/device-bridge/actions/messaging.ts +74 -0
- package/src/device-bridge/actions/navigation.ts +88 -0
- package/src/device-bridge/actions/queue-poller.ts +151 -0
- package/src/device-bridge/background.ts +137 -0
- package/src/device-bridge/biometrics.ts +64 -0
- package/src/device-bridge/capabilities.ts +218 -0
- package/src/device-bridge/collectors/appEngagement.ts +120 -0
- package/src/device-bridge/collectors/battery.ts +83 -0
- package/src/device-bridge/collectors/calendar.ts +162 -0
- package/src/device-bridge/collectors/camera.ts +27 -0
- package/src/device-bridge/collectors/connectivity.ts +60 -0
- package/src/device-bridge/collectors/contacts.ts +200 -0
- package/src/device-bridge/collectors/health.ts +299 -0
- package/src/device-bridge/collectors/index.ts +12 -0
- package/src/device-bridge/collectors/location.ts +224 -0
- package/src/device-bridge/collectors/mood.ts +141 -0
- package/src/device-bridge/collectors/notifications.ts +70 -0
- package/src/device-bridge/cookies.ts +89 -0
- package/src/device-bridge/dynamic-connector.ts +422 -0
- package/src/device-bridge/index.ts +467 -0
- package/src/device-bridge/nfc.ts +85 -0
- package/src/device-bridge/plugin.ts +71 -0
- package/src/device-bridge/relay-client.ts +237 -0
- package/src/device-bridge/scanner.ts +42 -0
- package/src/device-bridge/sharing.ts +35 -0
- package/src/device-bridge/types.ts +326 -0
- package/src/device-state/activityClassifier.ts +151 -0
- package/src/device-state/activityEngine.ts +252 -0
- package/src/device-state/collectors.ts +31 -0
- package/src/device-state/domains/activity.ts +93 -0
- package/src/device-state/domains/capability.ts +60 -0
- package/src/device-state/domains/connectivity.ts +60 -0
- package/src/device-state/domains/deviceContext.ts +55 -0
- package/src/device-state/domains/interaction.ts +59 -0
- package/src/device-state/domains/spatial.ts +283 -0
- package/src/device-state/domains/visual.ts +100 -0
- package/src/device-state/headingSource.ts +84 -0
- package/src/device-state/index.ts +77 -0
- package/src/device-state/quality.ts +60 -0
- package/src/device-state/replay.ts +220 -0
- package/src/device-state/turnDetector.ts +121 -0
- package/src/device-state/visualEngine.ts +341 -0
- package/src/haptics.ts +4 -0
- package/src/index.ts +37 -0
- package/src/oauth/expoOAuth.tsx +113 -0
- package/src/vision/analysis.js +80 -0
- package/src/vision/index.ts +144 -0
- package/src/vision/ring.js +35 -0
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import { C as Capability, D as DeviceDataBundle, R as RelayResponse, P as PendingAction, A as ActionResult, L as LocationData, a as DeviceBridgeConfig, b as CapabilityStatus, c as PermissionState, B as BridgeStatus } from '../types-BRanJYTn.js';
|
|
2
|
+
export { d as BridgeError, e as DomainSyncStatus } from '../types-BRanJYTn.js';
|
|
3
|
+
import { BarcodeScanningResult, CameraView, useCameraPermissions } from 'expo-camera';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Built-in Capabilities — wraps each collector as a registerable Capability.
|
|
7
|
+
*
|
|
8
|
+
* Each capability defines:
|
|
9
|
+
* - id, name, description, reason (for UI)
|
|
10
|
+
* - permission check/request
|
|
11
|
+
* - collect function
|
|
12
|
+
*
|
|
13
|
+
* The host app can register these selectively, or add custom ones.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
declare function calendarCapability(): Capability;
|
|
17
|
+
declare function contactsCapability(): Capability;
|
|
18
|
+
declare function locationCapability(): Capability;
|
|
19
|
+
declare function batteryCapability(): Capability;
|
|
20
|
+
declare function connectivityCapability(): Capability;
|
|
21
|
+
declare function healthCapability(): Capability;
|
|
22
|
+
declare function moodCapability(): Capability;
|
|
23
|
+
declare function cameraCapability(): Capability;
|
|
24
|
+
declare function notificationsCapability(): Capability;
|
|
25
|
+
declare function allBuiltIn(): Capability[];
|
|
26
|
+
|
|
27
|
+
declare const capabilities$1_allBuiltIn: typeof allBuiltIn;
|
|
28
|
+
declare const capabilities$1_batteryCapability: typeof batteryCapability;
|
|
29
|
+
declare const capabilities$1_calendarCapability: typeof calendarCapability;
|
|
30
|
+
declare const capabilities$1_cameraCapability: typeof cameraCapability;
|
|
31
|
+
declare const capabilities$1_connectivityCapability: typeof connectivityCapability;
|
|
32
|
+
declare const capabilities$1_contactsCapability: typeof contactsCapability;
|
|
33
|
+
declare const capabilities$1_healthCapability: typeof healthCapability;
|
|
34
|
+
declare const capabilities$1_locationCapability: typeof locationCapability;
|
|
35
|
+
declare const capabilities$1_moodCapability: typeof moodCapability;
|
|
36
|
+
declare const capabilities$1_notificationsCapability: typeof notificationsCapability;
|
|
37
|
+
declare namespace capabilities$1 {
|
|
38
|
+
export { capabilities$1_allBuiltIn as allBuiltIn, capabilities$1_batteryCapability as batteryCapability, capabilities$1_calendarCapability as calendarCapability, capabilities$1_cameraCapability as cameraCapability, capabilities$1_connectivityCapability as connectivityCapability, capabilities$1_contactsCapability as contactsCapability, capabilities$1_healthCapability as healthCapability, capabilities$1_locationCapability as locationCapability, capabilities$1_moodCapability as moodCapability, capabilities$1_notificationsCapability as notificationsCapability };
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* Background Sync — registers an expo-task-manager task for periodic
|
|
43
|
+
* data sync when the app is in the background, and exposes a one-shot
|
|
44
|
+
* `syncDomains()` for silent-push triggered syncs.
|
|
45
|
+
*
|
|
46
|
+
* iOS minimum background fetch interval is ~15 minutes.
|
|
47
|
+
* Android allows more frequent background execution via WorkManager.
|
|
48
|
+
*
|
|
49
|
+
* Usage:
|
|
50
|
+
* import { registerBackgroundSync, syncDomains } from '@mobile-pa/device-bridge';
|
|
51
|
+
*
|
|
52
|
+
* // Periodic background fetch — call once at app startup, outside any component
|
|
53
|
+
* registerBackgroundSync({
|
|
54
|
+
* relayUrl: 'https://relay.example.com',
|
|
55
|
+
* deviceId: 'device-123',
|
|
56
|
+
* tenant: 'mobile-pa',
|
|
57
|
+
* actorId: 'user-abc',
|
|
58
|
+
* apiKey: 'key-xxx',
|
|
59
|
+
* });
|
|
60
|
+
*
|
|
61
|
+
* // Silent-push triggered sync — from FCM background message handler
|
|
62
|
+
* await syncDomains(config, ['location', 'calendar']);
|
|
63
|
+
*/
|
|
64
|
+
declare const BACKGROUND_TASK_NAME = "DEVICE_BRIDGE_BACKGROUND_SYNC";
|
|
65
|
+
interface BackgroundSyncConfig {
|
|
66
|
+
relayUrl: string;
|
|
67
|
+
deviceId: string;
|
|
68
|
+
tenant: string;
|
|
69
|
+
actorId?: string;
|
|
70
|
+
apiKey: string;
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Register the periodic background-fetch task.
|
|
74
|
+
* Call once at app startup, outside any React component.
|
|
75
|
+
*/
|
|
76
|
+
declare function registerBackgroundSync(config: BackgroundSyncConfig): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* Unregister the background sync task.
|
|
79
|
+
*/
|
|
80
|
+
declare function unregisterBackgroundSync(): Promise<void>;
|
|
81
|
+
/**
|
|
82
|
+
* Collect and push the listed domains once. Used by both the periodic
|
|
83
|
+
* background-fetch task and the silent-push handler.
|
|
84
|
+
*
|
|
85
|
+
* Returns true if at least one domain pushed new data.
|
|
86
|
+
*/
|
|
87
|
+
declare function syncDomains(config: BackgroundSyncConfig, domains: string[]): Promise<boolean>;
|
|
88
|
+
|
|
89
|
+
/**
|
|
90
|
+
* Relay Client — REST client for the cloud relay service.
|
|
91
|
+
* Handles data push, action polling, and offline buffering.
|
|
92
|
+
*
|
|
93
|
+
* Endpoints:
|
|
94
|
+
* POST /api/device/{deviceId}/sync ← push data bundle
|
|
95
|
+
* GET /api/device/{deviceId}/data/{domain} ← read latest (used by connector, not phone)
|
|
96
|
+
* POST /api/device/{deviceId}/actions ← queue action (used by connector)
|
|
97
|
+
* GET /api/device/{deviceId}/actions ← poll pending actions
|
|
98
|
+
* DELETE /api/device/{deviceId}/actions/{id} ← confirm action executed
|
|
99
|
+
*/
|
|
100
|
+
|
|
101
|
+
interface RelayClientConfig {
|
|
102
|
+
relayUrl: string;
|
|
103
|
+
deviceId: string;
|
|
104
|
+
tenant: string;
|
|
105
|
+
actorId?: string;
|
|
106
|
+
apiKey?: string;
|
|
107
|
+
timeout?: number;
|
|
108
|
+
}
|
|
109
|
+
declare class RelayClient {
|
|
110
|
+
private baseUrl;
|
|
111
|
+
private deviceId;
|
|
112
|
+
private tenant;
|
|
113
|
+
private actorId;
|
|
114
|
+
private apiKey;
|
|
115
|
+
private timeout;
|
|
116
|
+
private offlineQueue;
|
|
117
|
+
constructor(config: RelayClientConfig);
|
|
118
|
+
/**
|
|
119
|
+
* Push a full device data bundle to the relay.
|
|
120
|
+
* If offline, buffers the bundle and retries on next sync.
|
|
121
|
+
*/
|
|
122
|
+
pushData(bundle: DeviceDataBundle): Promise<RelayResponse<void>>;
|
|
123
|
+
/**
|
|
124
|
+
* Push a single domain update (partial sync).
|
|
125
|
+
*/
|
|
126
|
+
pushDomain(domain: string, data: unknown): Promise<RelayResponse<void>>;
|
|
127
|
+
/**
|
|
128
|
+
* Poll for pending actions the phone needs to execute.
|
|
129
|
+
*/
|
|
130
|
+
pollActions(): Promise<RelayResponse<PendingAction[]>>;
|
|
131
|
+
/**
|
|
132
|
+
* Report action execution result and remove from queue.
|
|
133
|
+
*/
|
|
134
|
+
completeAction(result: ActionResult): Promise<RelayResponse<void>>;
|
|
135
|
+
/**
|
|
136
|
+
* Ping the relay to check connectivity.
|
|
137
|
+
*/
|
|
138
|
+
ping(): Promise<boolean>;
|
|
139
|
+
/**
|
|
140
|
+
* Get count of buffered offline bundles.
|
|
141
|
+
*/
|
|
142
|
+
getOfflineQueueSize(): number;
|
|
143
|
+
private fetch;
|
|
144
|
+
private flushOfflineQueue;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/**
|
|
148
|
+
* Action Queue Poller — polls the relay for pending actions and executes them.
|
|
149
|
+
* Routes each action to the appropriate executor based on action type.
|
|
150
|
+
*/
|
|
151
|
+
|
|
152
|
+
interface QueuePollerConfig {
|
|
153
|
+
/** Polling interval in ms (default: 5000) */
|
|
154
|
+
pollInterval?: number;
|
|
155
|
+
/** Relay client instance */
|
|
156
|
+
relayClient: RelayClient;
|
|
157
|
+
/** Callback when an action is executed */
|
|
158
|
+
onActionExecuted?: (result: ActionResult) => void;
|
|
159
|
+
/** Callback for errors */
|
|
160
|
+
onError?: (error: Error) => void;
|
|
161
|
+
}
|
|
162
|
+
declare class QueuePoller {
|
|
163
|
+
private relayClient;
|
|
164
|
+
private pollInterval;
|
|
165
|
+
private timer;
|
|
166
|
+
private running;
|
|
167
|
+
private onActionExecuted?;
|
|
168
|
+
private onError?;
|
|
169
|
+
constructor(config: QueuePollerConfig);
|
|
170
|
+
/**
|
|
171
|
+
* Start polling for actions.
|
|
172
|
+
*/
|
|
173
|
+
start(): void;
|
|
174
|
+
/**
|
|
175
|
+
* Stop polling.
|
|
176
|
+
*/
|
|
177
|
+
stop(): void;
|
|
178
|
+
/**
|
|
179
|
+
* Check if poller is running.
|
|
180
|
+
*/
|
|
181
|
+
isRunning(): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Execute a single poll cycle.
|
|
184
|
+
*/
|
|
185
|
+
private poll;
|
|
186
|
+
/**
|
|
187
|
+
* Route an action to the appropriate executor.
|
|
188
|
+
*/
|
|
189
|
+
private executeAction;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Device-bridge: Biometrics (Face ID / Touch ID / fingerprint)
|
|
194
|
+
*
|
|
195
|
+
* Used by solutions that need a biometric gate before sensitive actions
|
|
196
|
+
* (e.g. "unlock payment", "confirm financial transfer", "reveal stored
|
|
197
|
+
* credentials"). Also useful for protecting session cookies at rest.
|
|
198
|
+
*
|
|
199
|
+
* Wraps expo-local-authentication.
|
|
200
|
+
*/
|
|
201
|
+
type BiometricType = 'fingerprint' | 'face' | 'iris' | 'none';
|
|
202
|
+
interface BiometricCapabilities {
|
|
203
|
+
hasHardware: boolean;
|
|
204
|
+
isEnrolled: boolean;
|
|
205
|
+
/**
|
|
206
|
+
* Never contains 'none' — the mapper filters it out, since 'none' means
|
|
207
|
+
* "the OS reported an auth type we do not recognise" and is not a
|
|
208
|
+
* biometric a caller can offer. Typed as the guarantee the code makes.
|
|
209
|
+
*/
|
|
210
|
+
supportedTypes: Exclude<BiometricType, 'none'>[];
|
|
211
|
+
}
|
|
212
|
+
/** What can the device do right now? */
|
|
213
|
+
declare function capabilities(): Promise<BiometricCapabilities>;
|
|
214
|
+
interface AuthenticateOptions {
|
|
215
|
+
/** User-visible reason shown in the system dialog. */
|
|
216
|
+
reason: string;
|
|
217
|
+
/** Label on the "cancel" button (iOS only; Android has system default). */
|
|
218
|
+
cancelLabel?: string;
|
|
219
|
+
/** If biometrics aren't enrolled, fall back to device passcode. Default true. */
|
|
220
|
+
fallbackToPasscode?: boolean;
|
|
221
|
+
}
|
|
222
|
+
/** Prompt the user for biometric auth. Resolves { success } or { success:false, error }. */
|
|
223
|
+
declare function authenticate(opts: AuthenticateOptions): Promise<{
|
|
224
|
+
success: boolean;
|
|
225
|
+
error?: string;
|
|
226
|
+
}>;
|
|
227
|
+
|
|
228
|
+
type biometrics_AuthenticateOptions = AuthenticateOptions;
|
|
229
|
+
type biometrics_BiometricCapabilities = BiometricCapabilities;
|
|
230
|
+
type biometrics_BiometricType = BiometricType;
|
|
231
|
+
declare const biometrics_authenticate: typeof authenticate;
|
|
232
|
+
declare const biometrics_capabilities: typeof capabilities;
|
|
233
|
+
declare namespace biometrics {
|
|
234
|
+
export { type biometrics_AuthenticateOptions as AuthenticateOptions, type biometrics_BiometricCapabilities as BiometricCapabilities, type biometrics_BiometricType as BiometricType, biometrics_authenticate as authenticate, biometrics_capabilities as capabilities };
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Device-bridge: Sharing (native share sheet)
|
|
239
|
+
*
|
|
240
|
+
* Wraps expo-sharing. Lets solutions hand content off to the OS share sheet
|
|
241
|
+
* — any installed app can receive it (Messages, WhatsApp, Mail, Files, etc.).
|
|
242
|
+
*
|
|
243
|
+
* Typical use: "Share this article / calendar invite / photo with a contact."
|
|
244
|
+
*/
|
|
245
|
+
interface ShareOptions {
|
|
246
|
+
/** MIME type, e.g. 'application/pdf'. Optional. */
|
|
247
|
+
mimeType?: string;
|
|
248
|
+
/** iOS UTI, e.g. 'public.image'. Optional. */
|
|
249
|
+
UTI?: string;
|
|
250
|
+
/** Dialog title (Android only). */
|
|
251
|
+
dialogTitle?: string;
|
|
252
|
+
}
|
|
253
|
+
/** Share a local file URI. */
|
|
254
|
+
declare function shareFile(fileUri: string, opts?: ShareOptions): Promise<{
|
|
255
|
+
ok: boolean;
|
|
256
|
+
error?: string;
|
|
257
|
+
}>;
|
|
258
|
+
declare function isAvailable(): Promise<boolean>;
|
|
259
|
+
|
|
260
|
+
type sharing_ShareOptions = ShareOptions;
|
|
261
|
+
declare const sharing_isAvailable: typeof isAvailable;
|
|
262
|
+
declare const sharing_shareFile: typeof shareFile;
|
|
263
|
+
declare namespace sharing {
|
|
264
|
+
export { type sharing_ShareOptions as ShareOptions, sharing_isAvailable as isAvailable, sharing_shareFile as shareFile };
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Device-bridge: Scanner (QR / barcode)
|
|
269
|
+
*
|
|
270
|
+
* Wraps expo-camera (which replaced the deprecated expo-barcode-scanner
|
|
271
|
+
* in Expo SDK 50+). The CameraView component has built-in barcode scanning.
|
|
272
|
+
*
|
|
273
|
+
* Use cases:
|
|
274
|
+
* - Wi-Fi QR handoff
|
|
275
|
+
* - OAuth / pairing codes
|
|
276
|
+
* - Payment QR codes
|
|
277
|
+
* - Product lookup
|
|
278
|
+
*
|
|
279
|
+
* Plugins mount <CameraView onBarcodeScanned={...} /> directly. This module
|
|
280
|
+
* exposes the permission helper + a result normalizer so plugins don't need
|
|
281
|
+
* to import expo-camera directly.
|
|
282
|
+
*/
|
|
283
|
+
|
|
284
|
+
interface ScanResult {
|
|
285
|
+
type: string;
|
|
286
|
+
data: string;
|
|
287
|
+
}
|
|
288
|
+
/** Request camera permission if not already granted. */
|
|
289
|
+
declare function requestPermissions(): Promise<{
|
|
290
|
+
granted: boolean;
|
|
291
|
+
status: string;
|
|
292
|
+
}>;
|
|
293
|
+
/** Normalize a CameraView barcode result to a stable shape. */
|
|
294
|
+
declare function normalizeResult(r: BarcodeScanningResult): ScanResult;
|
|
295
|
+
|
|
296
|
+
declare const scanner_CameraView: typeof CameraView;
|
|
297
|
+
type scanner_ScanResult = ScanResult;
|
|
298
|
+
declare const scanner_normalizeResult: typeof normalizeResult;
|
|
299
|
+
declare const scanner_requestPermissions: typeof requestPermissions;
|
|
300
|
+
declare const scanner_useCameraPermissions: typeof useCameraPermissions;
|
|
301
|
+
declare namespace scanner {
|
|
302
|
+
export { scanner_CameraView as CameraView, type scanner_ScanResult as ScanResult, scanner_normalizeResult as normalizeResult, scanner_requestPermissions as requestPermissions, scanner_useCameraPermissions as useCameraPermissions };
|
|
303
|
+
}
|
|
304
|
+
|
|
305
|
+
/**
|
|
306
|
+
* Location Collector — reads device location via expo-location.
|
|
307
|
+
* Output format matches device-mock-mcp's location.current schema.
|
|
308
|
+
*/
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Request location permissions (foreground + background).
|
|
312
|
+
*/
|
|
313
|
+
declare function requestPermission(): Promise<boolean>;
|
|
314
|
+
/**
|
|
315
|
+
* Check if location permission is granted.
|
|
316
|
+
*/
|
|
317
|
+
declare function hasPermission(): Promise<boolean>;
|
|
318
|
+
/**
|
|
319
|
+
* Collect current location.
|
|
320
|
+
* Matches the device.location.current tool output schema.
|
|
321
|
+
*/
|
|
322
|
+
declare function collectCurrent(): Promise<LocationData>;
|
|
323
|
+
interface Position {
|
|
324
|
+
latitude: number;
|
|
325
|
+
longitude: number;
|
|
326
|
+
altitude?: number;
|
|
327
|
+
accuracy?: number;
|
|
328
|
+
timestamp: number;
|
|
329
|
+
/**
|
|
330
|
+
* Metres per second. `undefined` = the OS gave no estimate.
|
|
331
|
+
*
|
|
332
|
+
* iOS reports -1 rather than omitting it, and -1 m/s passed through as a
|
|
333
|
+
* speed would read as "moving backwards"; it is normalised away here so no
|
|
334
|
+
* caller has to know the platform's sentinel.
|
|
335
|
+
*/
|
|
336
|
+
speed?: number;
|
|
337
|
+
/**
|
|
338
|
+
* COURSE OVER GROUND in degrees — the direction the user is TRAVELLING.
|
|
339
|
+
*
|
|
340
|
+
* Deliberately not called `heading`: this and the compass answer different
|
|
341
|
+
* questions and disagree constantly. Walking backwards down a corridor gives
|
|
342
|
+
* a course of south and a compass heading of north; a phone held sideways
|
|
343
|
+
* while walking forward gives the same course and a heading 90° off.
|
|
344
|
+
* "Turn right" needs the compass. "You are heading north on Main Street"
|
|
345
|
+
* needs this. The old code assigned one to the other, which is only ever
|
|
346
|
+
* right by accident.
|
|
347
|
+
*
|
|
348
|
+
* `undefined` when not moving or not estimated — iOS reports -1 for both.
|
|
349
|
+
*/
|
|
350
|
+
course?: number;
|
|
351
|
+
}
|
|
352
|
+
/** One position fix. `accuracy: "high"` costs battery and time — default low. */
|
|
353
|
+
declare function getPosition(opts?: {
|
|
354
|
+
accuracy?: 'low' | 'high';
|
|
355
|
+
}): Promise<Position>;
|
|
356
|
+
/**
|
|
357
|
+
* Stream position updates. Returns an unsubscribe function — call it, or the
|
|
358
|
+
* GPS keeps running and drains the battery.
|
|
359
|
+
*/
|
|
360
|
+
declare function watchPosition(cb: (pos: Position) => void): () => void;
|
|
361
|
+
|
|
362
|
+
type location_Position = Position;
|
|
363
|
+
declare const location_collectCurrent: typeof collectCurrent;
|
|
364
|
+
declare const location_getPosition: typeof getPosition;
|
|
365
|
+
declare const location_hasPermission: typeof hasPermission;
|
|
366
|
+
declare const location_requestPermission: typeof requestPermission;
|
|
367
|
+
declare const location_watchPosition: typeof watchPosition;
|
|
368
|
+
declare namespace location {
|
|
369
|
+
export { type location_Position as Position, location_collectCurrent as collectCurrent, location_getPosition as getPosition, location_hasPermission as hasPermission, location_requestPermission as requestPermission, location_watchPosition as watchPosition };
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
/**
|
|
373
|
+
* @mobile-pa/device-bridge
|
|
374
|
+
*
|
|
375
|
+
* Isolated device data sync module. Zero coupling to chat, voice, or UI.
|
|
376
|
+
* Pluggable capability system — register built-in or custom capabilities.
|
|
377
|
+
*
|
|
378
|
+
* Usage (host app controls permission flow):
|
|
379
|
+
*
|
|
380
|
+
* import { DeviceBridge, capabilities } from '@mobile-pa/device-bridge';
|
|
381
|
+
*
|
|
382
|
+
* const bridge = new DeviceBridge({ relayUrl, deviceId, apiKey });
|
|
383
|
+
*
|
|
384
|
+
* // 1. Register capabilities
|
|
385
|
+
* bridge.registerAll(capabilities.allBuiltIn());
|
|
386
|
+
*
|
|
387
|
+
* // 2. Permission flow — host app shows its own UI per capability
|
|
388
|
+
* for (const cap of bridge.getPendingPermissions()) {
|
|
389
|
+
* // → show explanation: cap.name, cap.description, cap.reason
|
|
390
|
+
* // → user taps "Allow"
|
|
391
|
+
* await bridge.requestPermission(cap.id);
|
|
392
|
+
* }
|
|
393
|
+
*
|
|
394
|
+
* // 3. Start syncing (only syncs permitted capabilities)
|
|
395
|
+
* await bridge.startSync();
|
|
396
|
+
*
|
|
397
|
+
* // 4. Add more capabilities later (even after sync started)
|
|
398
|
+
* bridge.register(myCustomCapability);
|
|
399
|
+
* await bridge.requestPermission(myCustomCapability.id);
|
|
400
|
+
* // → auto-starts syncing if bridge is already running
|
|
401
|
+
*/
|
|
402
|
+
|
|
403
|
+
declare class DeviceBridge {
|
|
404
|
+
private config;
|
|
405
|
+
private relay;
|
|
406
|
+
private queuePoller;
|
|
407
|
+
private caps;
|
|
408
|
+
private syncTimers;
|
|
409
|
+
private subscriptions;
|
|
410
|
+
private domainStatus;
|
|
411
|
+
private running;
|
|
412
|
+
constructor(config: DeviceBridgeConfig);
|
|
413
|
+
/**
|
|
414
|
+
* Register a capability. Does NOT request permission — just makes it known.
|
|
415
|
+
* Can be called before or after startSync().
|
|
416
|
+
*/
|
|
417
|
+
register(cap: Capability): void;
|
|
418
|
+
/**
|
|
419
|
+
* Register multiple capabilities at once.
|
|
420
|
+
*/
|
|
421
|
+
registerAll(caps: Capability[]): void;
|
|
422
|
+
/**
|
|
423
|
+
* Get a registered capability by ID.
|
|
424
|
+
* Use this to read name/description/reason for your permission UI.
|
|
425
|
+
*/
|
|
426
|
+
getCapability(id: string): Capability | undefined;
|
|
427
|
+
/**
|
|
428
|
+
* Get all registered capabilities with their current status.
|
|
429
|
+
*/
|
|
430
|
+
listCapabilities(): CapabilityStatus[];
|
|
431
|
+
/**
|
|
432
|
+
* Request permission for ONE capability.
|
|
433
|
+
* Call after showing your own explanation screen.
|
|
434
|
+
* If bridge is already running and granted, syncing starts automatically.
|
|
435
|
+
*/
|
|
436
|
+
requestPermission(capId: string): Promise<boolean>;
|
|
437
|
+
/**
|
|
438
|
+
* Check permission WITHOUT prompting.
|
|
439
|
+
*/
|
|
440
|
+
checkPermission(capId: string): Promise<PermissionState>;
|
|
441
|
+
/**
|
|
442
|
+
* Request ALL permissions sequentially (one at a time, not bombarded).
|
|
443
|
+
*/
|
|
444
|
+
requestAllPermissions(): Promise<Map<string, boolean>>;
|
|
445
|
+
/**
|
|
446
|
+
* Get capabilities that still need permission.
|
|
447
|
+
* Use this to drive a "next permission" onboarding flow.
|
|
448
|
+
*/
|
|
449
|
+
getPendingPermissions(): Capability[];
|
|
450
|
+
/**
|
|
451
|
+
* Start syncing all permitted capabilities + action queue poller.
|
|
452
|
+
*/
|
|
453
|
+
startSync(): Promise<void>;
|
|
454
|
+
/**
|
|
455
|
+
* Stop all syncing.
|
|
456
|
+
*/
|
|
457
|
+
stopSync(): void;
|
|
458
|
+
/**
|
|
459
|
+
* Force immediate sync of all permitted capabilities.
|
|
460
|
+
*/
|
|
461
|
+
syncNow(): Promise<void>;
|
|
462
|
+
/**
|
|
463
|
+
* Force immediate sync of a single capability by id. Used by the host to
|
|
464
|
+
* refresh fast-moving sources (battery) on app-foreground so the relay
|
|
465
|
+
* gets a fresh reading the moment the user opens the app.
|
|
466
|
+
*/
|
|
467
|
+
syncCapabilityNow(capId: string): Promise<void>;
|
|
468
|
+
/**
|
|
469
|
+
* Get current bridge status.
|
|
470
|
+
*/
|
|
471
|
+
getStatus(): BridgeStatus;
|
|
472
|
+
/**
|
|
473
|
+
* Check if the relay is reachable.
|
|
474
|
+
*/
|
|
475
|
+
checkConnectivity(): Promise<boolean>;
|
|
476
|
+
private startCapabilitySync;
|
|
477
|
+
private syncCapability;
|
|
478
|
+
private updateDomainStatus;
|
|
479
|
+
private getLastFullSync;
|
|
480
|
+
private notifyStatusChange;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
export { ActionResult, type AuthenticateOptions, BACKGROUND_TASK_NAME, type BackgroundSyncConfig, type BiometricCapabilities, type BiometricType, BridgeStatus, Capability, CapabilityStatus, DeviceBridge, DeviceBridgeConfig, PermissionState, type Position, QueuePoller, RelayClient, type ScanResult, type ShareOptions, biometrics, capabilities$1 as capabilities, location, registerBackgroundSync, scanner, sharing, syncDomains, unregisterBackgroundSync };
|