@incodetech/core 0.0.0-dev-20260817-acfa6f73 → 0.0.0-dev-20260817-941e76d2

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 (115) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-Bm4ZX5t3.esm.js → BrowserDiagnosticsCryptoProvider-CPcF1K4D.esm.js} +1 -1
  2. package/dist/{BrowserStorageProvider-k-FDkC4W.esm.js → BrowserStorageProvider-C8847M9W.esm.js} +1 -1
  3. package/dist/FaceDetectionProvider-Cn1wS-sA.d.ts +95 -0
  4. package/dist/{IIdCaptureCapability-DHTT3FC2.d.ts → IIdCaptureCapability-DDWlQzhi.d.ts} +2 -32
  5. package/dist/IWasmUtilCapability-5-Pncgma.d.ts +149 -0
  6. package/dist/{MotionSensorProvider-DGiV77J_.esm.js → MotionSensorProvider-CxTjgXe6.esm.js} +1 -1
  7. package/dist/ae-signature.esm.js +1 -1
  8. package/dist/{apiError-B3T64yxT.esm.js → apiError-B3TI9TK9.esm.js} +1 -1
  9. package/dist/authentication.d.ts +3 -3
  10. package/dist/authentication.esm.js +2 -2
  11. package/dist/{authenticationManager-CVURxKl7.esm.js → authenticationManager-BL7RvcC8.esm.js} +4 -4
  12. package/dist/{authenticationManager-D8DEugXP.d.ts → authenticationManager-Cb4b4dgt.d.ts} +1 -1
  13. package/dist/{authenticationStateMachine-B-0XBXp-.esm.js → authenticationStateMachine-D1XsBKTx.esm.js} +2 -2
  14. package/dist/avatar.d.ts +1 -2
  15. package/dist/camera.esm.js +1 -1
  16. package/dist/createFaceAvatar-pUEkdk4X.d.ts +489 -0
  17. package/dist/curp-validation.d.ts +1 -1
  18. package/dist/{curpValidationManager-BxWhpCLA.d.ts → curpValidationManager-C_TQjX2P.d.ts} +1 -1
  19. package/dist/{deepsightLoader-C9G0gmwl.esm.js → deepsightLoader-BnU_V6rk.esm.js} +6 -6
  20. package/dist/{deepsightService-DLVQS_RH.d.ts → deepsightService-Dr7sNZ5r.d.ts} +2 -1
  21. package/dist/document-capture.d.ts +2 -2
  22. package/dist/document-capture.esm.js +2 -2
  23. package/dist/document-upload.d.ts +4 -4
  24. package/dist/{documentCaptureManager-CaXWUo_N.esm.js → documentCaptureManager-D7A4k-GE.esm.js} +1 -1
  25. package/dist/{documentCaptureManager-Bvipl_tY.d.ts → documentCaptureManager-DlGYd-sJ.d.ts} +67 -67
  26. package/dist/{documentCaptureStateMachine-DpWiaUPB.esm.js → documentCaptureStateMachine-fk7MDfSZ.esm.js} +2 -2
  27. package/dist/dynamic-forms.d.ts +2 -2
  28. package/dist/dynamic-forms.esm.js +2 -2
  29. package/dist/{dynamicFormsManager-CIFvUb6Q.esm.js → dynamicFormsManager-CH1eSNvy.esm.js} +1 -1
  30. package/dist/{dynamicFormsManager-fhK0yINk.d.ts → dynamicFormsManager-DhveFHPS.d.ts} +1 -1
  31. package/dist/{dynamicFormsStateMachine-C8_koaQ2.esm.js → dynamicFormsStateMachine-D144f-2m.esm.js} +1 -1
  32. package/dist/ekyb.d.ts +1 -1
  33. package/dist/ekyb.esm.js +3 -3
  34. package/dist/{ekybManager-DvHK24Ai.esm.js → ekybManager-BBJwCOsR.esm.js} +1 -1
  35. package/dist/{ekybStateMachine-Bd9SGUOZ.esm.js → ekybStateMachine-jym81TFF.esm.js} +1 -1
  36. package/dist/electronic-signature.esm.js +1 -1
  37. package/dist/{electronicSignatureManager-DdhVjAVe.esm.js → electronicSignatureManager-CWYfI4hO.esm.js} +1 -1
  38. package/dist/extensibility.d.ts +14 -12
  39. package/dist/extensibility.esm.js +12 -12
  40. package/dist/{faceCaptureManagerFactory-fq0Rl3ik.d.ts → faceCaptureManagerFactory-CKyaVKsu.d.ts} +17 -45
  41. package/dist/{faceCaptureManagerFactory-9X4WspD-.esm.js → faceCaptureManagerFactory-DysNuSGO.esm.js} +3 -3
  42. package/dist/{faceCaptureSetup-D1xDWdEi.esm.js → faceCaptureSetup-DXCPmEv2.esm.js} +4 -4
  43. package/dist/flow-events.d.ts +1 -1
  44. package/dist/flow.d.ts +8 -8
  45. package/dist/flow.esm.js +3 -3
  46. package/dist/{flowCompletionService-CBCd4sTT.esm.js → flowCompletionService-DvWL2nH-.esm.js} +1 -1
  47. package/dist/{flowServices-Clyz_AFS.esm.js → flowServices-CAz3XO92.esm.js} +3 -3
  48. package/dist/geolocation.esm.js +2 -2
  49. package/dist/{geolocationManager-Dnp8XTcy.esm.js → geolocationManager-CPwKn86Q.esm.js} +1 -1
  50. package/dist/{geolocationStateMachine-BBMCEfv9.esm.js → geolocationStateMachine-Cm28EW1O.esm.js} +1 -1
  51. package/dist/home.d.ts +1 -1
  52. package/dist/id-selfie-flow.d.ts +3 -2
  53. package/dist/id-selfie-flow.esm.js +8 -8
  54. package/dist/id.d.ts +3 -3
  55. package/dist/id.esm.js +4 -4
  56. package/dist/{idCaptureDefaults-WeHbQM7W.esm.js → idCaptureDefaults-Dowxd3J3.esm.js} +4 -3
  57. package/dist/{idCaptureManager-BG07OgVe.esm.js → idCaptureManager-BuFn4xQl.esm.js} +5 -5
  58. package/dist/{idCaptureManager-DVWM-L4V.d.ts → idCaptureManager-DlCqj6R1.d.ts} +4 -4
  59. package/dist/{idCaptureServices-CqRJOcig.esm.js → idCaptureServices-Bn656NFx.esm.js} +3 -3
  60. package/dist/{idCaptureStateMachine-DhnmhN0s.esm.js → idCaptureStateMachine-CBpdXe7D.esm.js} +9 -9
  61. package/dist/{index-Bivs6yJF.d.ts → index-BwudEtre.d.ts} +1 -1
  62. package/dist/index.d.ts +1 -1
  63. package/dist/index.esm.js +1 -1
  64. package/dist/mandatory-consent.d.ts +2 -2
  65. package/dist/{mandatoryConsentManager-CVxw-noP.d.ts → mandatoryConsentManager-BZpKPJ1b.d.ts} +1 -1
  66. package/dist/{onDeviceFaceResults-DnxtQAz3.esm.js → onDeviceFaceResults-DT9SoUq7.esm.js} +4 -4
  67. package/dist/{permissionGuards-D2OgV9XX.esm.js → permissionGuards-BEgOUwwQ.esm.js} +1 -1
  68. package/dist/{permissionServices-B7sMtZ8f.esm.js → permissionServices-BPUkbztJ.esm.js} +2 -2
  69. package/dist/personhood.d.ts +5 -4
  70. package/dist/personhood.esm.js +6 -6
  71. package/dist/qe-signature.esm.js +1 -1
  72. package/dist/{recordingService-0VWL71An.esm.js → recordingService-DgwNVrR4.esm.js} +1 -1
  73. package/dist/{runChildModule-Dlr2Kwvn.esm.js → runChildModule-BCd-d039.esm.js} +1 -1
  74. package/dist/{safeStorage-Ep56I-f_.esm.js → safeStorage-2nOSCCnG.esm.js} +43 -70
  75. package/dist/selfie.d.ts +4 -4
  76. package/dist/selfie.esm.js +6 -6
  77. package/dist/{selfieManager-CsFpBfry.esm.js → selfieManager-DfeUZfgL.esm.js} +4 -4
  78. package/dist/{selfieManager-DlAKn0rp.d.ts → selfieManager-Dxj984_L.d.ts} +2 -11
  79. package/dist/{selfieStateMachine-DWDmcet8.esm.js → selfieStateMachine-CHSNxzhO.esm.js} +2 -2
  80. package/dist/{session-BuGZN95Y.esm.js → session-CuM9od2S.esm.js} +4 -4
  81. package/dist/session.d.ts +1 -9
  82. package/dist/session.esm.js +4 -4
  83. package/dist/{sessionInitializer-ShclX9vD.esm.js → sessionInitializer-D_B-8Ujt.esm.js} +2 -2
  84. package/dist/{setup-DywQeePQ.d.ts → setup-BwA7zG5D.d.ts} +19 -31
  85. package/dist/{setup-1lLa3WHQ.esm.js → setup-y1bXyMoz.esm.js} +14 -8
  86. package/dist/trueSight-lNCajJAf.esm.js +1 -0
  87. package/dist/{trueSightService-CNuiVjvN.esm.js → trueSightService-zTWODJoh.esm.js} +4 -4
  88. package/dist/{types-GqIocZi-.d.ts → types-BUdX2CB-.d.ts} +5 -4
  89. package/dist/{types-8LPRL1Ni2.d.ts → types-BlrYfFj3.d.ts} +1 -1
  90. package/dist/types-OehE3PKn.d.ts +6 -0
  91. package/dist/{types-Cyiwbg-r.d.ts → types-RMhiEIm9.d.ts} +4 -80
  92. package/dist/types-W5OCjqmi.d.ts +10 -0
  93. package/dist/{types-CRw2IBPn.d.ts → types-s0fF3TpX.d.ts} +1 -0
  94. package/dist/video-selfie.d.ts +3 -3
  95. package/dist/video-selfie.esm.js +4 -4
  96. package/dist/{videoSelfieCameraWarmer-C95ZbuSU.esm.js → videoSelfieCameraWarmer-Da9lJmK8.esm.js} +4 -4
  97. package/dist/{videoSelfieStepDetector-TyrYWahm.d.ts → videoSelfieStepDetector-Bw5t6XCU.d.ts} +4 -3
  98. package/dist/warmup-CXHBgvFC.d.ts +117 -0
  99. package/dist/wasm.d.ts +23 -5
  100. package/dist/wasm.esm.js +31 -4
  101. package/dist/{wasmDefaults-DTUrftxR.esm.js → wasmDefaults-BrwMccqW.esm.js} +27 -12
  102. package/dist/{wasmDsFlagSync-BqUCwLY8.esm.js → wasmDsFlagSync-Dd7Yj25O.esm.js} +1 -1
  103. package/dist/{wasmWebClient-DM8lkb0z.esm.js → wasmWebClient-BzFsDjU6.esm.js} +82 -22
  104. package/dist/workflow.d.ts +5 -5
  105. package/dist/workflow.esm.js +15 -15
  106. package/package.json +1 -1
  107. package/dist/FaceDetectionProvider-Mh6q3EbA.d.ts +0 -349
  108. package/dist/IFaceAvatarCapability-BrL19G0s.d.ts +0 -23
  109. package/dist/IStorageCapability-ORkQfK3F.d.ts +0 -242
  110. package/dist/createFaceAvatar-BEj18KXi.d.ts +0 -50
  111. package/dist/trueSight-BxA2W2OB.esm.js +0 -1
  112. package/dist/types-C2JzKH_L.d.ts +0 -6
  113. package/dist/warmup-Dv2alr2-.d.ts +0 -82
  114. /package/dist/{types-BSBzhHRH.d.ts → types-BSBzhHRH2.d.ts} +0 -0
  115. /package/dist/{types-DelMqZLe2.d.ts → types-DelMqZLe.d.ts} +0 -0
@@ -0,0 +1,489 @@
1
+ import { i as WasmModuleConfig, n as WasmModelsConfig } from "./warmup-CXHBgvFC.js";
2
+ //#region ../infra/src/media/canvas.d.ts
3
+ /**
4
+ * Class representing a canvas element for image capture and manipulation.
5
+ */
6
+ declare class IncodeCanvas {
7
+ canvas: HTMLCanvasElement;
8
+ private base64Image;
9
+ private blobData;
10
+ /**
11
+ * Creates an {@link IncodeCanvas} from a raw {@link ImageData} frame.
12
+ * @param imageData - Frame pixels in RGBA format
13
+ * @returns An {@link IncodeCanvas} containing the provided pixels
14
+ */
15
+ static fromImageData(imageData: ImageData): IncodeCanvas;
16
+ /**
17
+ * Create a new canvas element.
18
+ * @param canvas_ - The canvas element to clone.
19
+ */
20
+ constructor(canvas_: HTMLCanvasElement);
21
+ /**
22
+ * Check if the current canvas is valid.
23
+ */
24
+ private checkCanvas;
25
+ /**
26
+ * Disposes of resources, including revoking object URLs to prevent memory leaks.
27
+ */
28
+ dispose(): void;
29
+ /**
30
+ * Release the data stored by IncodeCanvas.
31
+ */
32
+ release(): void;
33
+ /**
34
+ * Revokes the object URL if one exists, preventing memory leaks.
35
+ * Use this when you no longer need the preview image URL.
36
+ */
37
+ revokeObjectURL(): void;
38
+ /**
39
+ * Get the width of the canvas.
40
+ */
41
+ width(): number | null;
42
+ /**
43
+ * Get the height of the canvas.
44
+ */
45
+ height(): number | null;
46
+ /**
47
+ * Set the width of the canvas.
48
+ */
49
+ setWidth(width: number): void;
50
+ /**
51
+ * Set the height of the canvas.
52
+ */
53
+ setHeight(height: number): void;
54
+ /**
55
+ * Clone the current canvas.
56
+ */
57
+ clone(): IncodeCanvas | null;
58
+ /**
59
+ * Deep clone the current IncodeCanvas including blob data.
60
+ */
61
+ deepClone(): Promise<IncodeCanvas | null>;
62
+ /**
63
+ * Returns the drawing context on the canvas.
64
+ */
65
+ getContext(contextId: '2d', contextAttributes?: CanvasRenderingContext2DSettings): CanvasRenderingContext2D | null;
66
+ /**
67
+ * Retrieves the image data from the canvas.
68
+ */
69
+ getImageData(): ImageData | null;
70
+ /**
71
+ * Updates the base64 representation of the current canvas image.
72
+ */
73
+ updateBase64Image(jpegQuality?: number): void;
74
+ /**
75
+ * Converts the current canvas element to a base64 string.
76
+ */
77
+ getBase64Image(jpegQuality?: number, includeDataURLPrefix?: boolean): string | null;
78
+ /**
79
+ * Sets the base64 representation of the current canvas image.
80
+ */
81
+ setBase64Image(base64Image: string | null): void;
82
+ /**
83
+ * Updates the Blob representation of the current canvas image.
84
+ */
85
+ updateBlob(jpegQuality?: number, includeDataURLPrefix?: boolean): void;
86
+ /**
87
+ * Converts a base64 string to a Blob and creates a URL for it.
88
+ */
89
+ static base64ToBlob(base64: string): {
90
+ blob: Blob;
91
+ url: string;
92
+ } | null;
93
+ /**
94
+ * Retrieves the Blob data and its URL from the current canvas.
95
+ */
96
+ getBlobData(jpegQuality?: number, includeDataURLPrefix?: boolean): {
97
+ blob: Blob;
98
+ url: string;
99
+ } | null;
100
+ /**
101
+ * Sets the Blob data of the current canvas image.
102
+ */
103
+ setBlobData(blobData: {
104
+ blob: Blob;
105
+ url: string;
106
+ }): Promise<void>;
107
+ /**
108
+ * Returns a resized canvas according to video element size.
109
+ */
110
+ getResizedCanvas(videoElementWidth: number, videoElementHeight: number): IncodeCanvas | null;
111
+ }
112
+ //#endregion
113
+ //#region ../infra/src/wasm/wasmWebClient.d.ts
114
+ /**
115
+ * Configuration shape that the C++ `WebApi` passes when calling `.post(...)`
116
+ * on its host JS adapter. Mirrors the upstream `ml-wasm-kit/WebClient`
117
+ * `RequestConfig` for the subset of fields actually set by `WebApi`.
118
+ */
119
+ type WebApiHostRequestConfig = {
120
+ ie?: boolean;
121
+ headers?: Record<string, string>;
122
+ params?: Record<string, string | number | boolean | undefined>;
123
+ timeout?: number;
124
+ };
125
+ //#endregion
126
+ //#region ../infra/src/capabilities/IMLProviderCapability.d.ts
127
+ /** WASM module and model configuration shared by ML providers. */
128
+ type MLProviderConfig = Partial<WasmModuleConfig> & WasmModelsConfig;
129
+ /**
130
+ * Base interface for ML provider capabilities.
131
+ * Provides common lifecycle and frame processing methods shared by
132
+ * FaceDetectionCapability and IdCaptureCapability.
133
+ */
134
+ interface IMLProviderCapability<TConfig extends MLProviderConfig> {
135
+ /**
136
+ * Whether the provider has been initialized and is ready to process frames.
137
+ */
138
+ readonly initialized: boolean;
139
+ /**
140
+ * Initializes the provider with the given configuration.
141
+ * If WASM was already warmed up via `setup()` or `warmupWasm()`, this returns almost instantly.
142
+ * @param config - Provider configuration including WASM paths
143
+ */
144
+ initialize(config: TConfig): Promise<void>;
145
+ /**
146
+ * Processes a frame through the ML pipeline.
147
+ * Callbacks set via `setCallbacks()` will be invoked based on the analysis results.
148
+ * @param image - Image data to process
149
+ * @throws Error if provider is not initialized
150
+ */
151
+ processFrame(image: ImageData): Promise<void>;
152
+ /**
153
+ * Resets the pipeline to its initial state.
154
+ * Safe to call even if not initialized (no-op in that case).
155
+ */
156
+ reset(): void;
157
+ /**
158
+ * Disposes of resources and resets initialization state.
159
+ * Safe to call even if not initialized.
160
+ */
161
+ dispose(): Promise<void>;
162
+ }
163
+ //#endregion
164
+ //#region ../infra/src/capabilities/IFaceDetectionCapability.d.ts
165
+ /**
166
+ * Configuration for face detection provider.
167
+ * Extends base ML provider config with face-detection specific options.
168
+ */
169
+ interface FaceDetectionConfig extends MLProviderConfig {
170
+ autocaptureInterval?: number;
171
+ /**
172
+ * Load the on-device selfie workflow (6 models including liveness + age
173
+ * estimation) instead of the default selfie workflow (4 models). Required
174
+ * when SELFIE/AUTHENTICATION has `onDeviceFaceResultsSubmissionEnabled`.
175
+ */
176
+ useOnDeviceWorkflow?: boolean;
177
+ /**
178
+ * Load the video-selfie face workflow (`SelfieWithAggregationMetrics`, the
179
+ * frame-aggregation best-shot pipeline used by the video-selfie flow)
180
+ * instead of the default quality-metrics selfie workflow. Mutually exclusive
181
+ * with `useOnDeviceWorkflow`.
182
+ */
183
+ videoSelfie?: boolean;
184
+ }
185
+ interface FacePositionConstraints {
186
+ minX: number;
187
+ minY: number;
188
+ maxX: number;
189
+ maxY: number;
190
+ }
191
+ interface FaceDetectionThresholds {
192
+ brightnessThreshold: number;
193
+ blurrinessThreshold: number;
194
+ tiltRotationAngleThreshold: number;
195
+ minMagicCropSize: number;
196
+ autocaptureInterval: number;
197
+ minFaceQualityScore: number;
198
+ faceOcclusionThreshold: number;
199
+ /**
200
+ * Milliseconds the C++ workflow waits after `onGetReady` fires before
201
+ * triggering autocapture. Mirrors V1's `getReadyDelay` (2000 ms) — without
202
+ * it, autocapture can fire on the first quality-passing frame, before the
203
+ * front camera has finished locking focus, producing blurry captures that
204
+ * the on-device quality model rejects.
205
+ */
206
+ getReadyDelay: number;
207
+ /**
208
+ * Milliseconds over which face-detection results are aggregated before the
209
+ * autocapture decision. Mirrors V1's `framesAggregationInterval` (2000 ms).
210
+ */
211
+ framesAggregationInterval: number;
212
+ /**
213
+ * Minimum consecutive frames with a detected face required before
214
+ * autocapture can trigger. Mirrors V1's `minFramesWithFace` (3).
215
+ */
216
+ minFramesWithFace: number;
217
+ }
218
+ interface FaceAttributesThresholds {
219
+ headwearThreshold: number;
220
+ lensesThreshold: number;
221
+ closedEyesThreshold: number;
222
+ maskThreshold: number;
223
+ }
224
+ interface FaceChecksConfig {
225
+ lenses: boolean;
226
+ mask: boolean;
227
+ closedEyes: boolean;
228
+ headWear: boolean;
229
+ occlusion: boolean;
230
+ }
231
+ interface FaceData {
232
+ rect: {
233
+ x: number;
234
+ y: number;
235
+ width: number;
236
+ height: number;
237
+ };
238
+ rightEye: {
239
+ x: number;
240
+ y: number;
241
+ };
242
+ leftEye: {
243
+ x: number;
244
+ y: number;
245
+ };
246
+ noseTip: {
247
+ x: number;
248
+ y: number;
249
+ };
250
+ rightMouthCorner: {
251
+ x: number;
252
+ y: number;
253
+ };
254
+ leftMouthCorner: {
255
+ x: number;
256
+ y: number;
257
+ };
258
+ pitch: number;
259
+ yaw: number;
260
+ roll: number;
261
+ }
262
+ type FaceCoordinates = {
263
+ rightEyeX: number;
264
+ rightEyeY: number;
265
+ leftEyeX: number;
266
+ leftEyeY: number;
267
+ noseTipX: number;
268
+ noseTipY: number;
269
+ rightMouthX: number;
270
+ rightMouthY: number;
271
+ mouthX: number;
272
+ mouthY: number;
273
+ x: number;
274
+ y: number;
275
+ width: number;
276
+ height: number;
277
+ };
278
+ interface FaceDetectionCallbacks {
279
+ onFarAway?: () => void;
280
+ onTooClose?: () => void;
281
+ onTooManyFaces?: () => void;
282
+ onNoFace?: () => void;
283
+ onCapture?: (canvas: IncodeCanvas, faceCoordinates: FaceCoordinates) => void;
284
+ onGetReady?: () => void;
285
+ onGetReadyFinished?: () => void;
286
+ onCenterFace?: () => void;
287
+ onDark?: () => void;
288
+ onBlur?: () => void;
289
+ onFaceAngle?: () => void;
290
+ /**
291
+ * Fires on **every** processed frame that contains at least one detected
292
+ * face, with the freshly-computed face data (pitch/yaw/roll/landmarks).
293
+ *
294
+ * Use `onFaceData` when you need a dense per-frame signal for live UI
295
+ * feedback — e.g. the Personhood avatar that mirrors head pose. The
296
+ * default capture pipeline does not subscribe to this, so consumers
297
+ * that don't need per-frame data pay no cost.
298
+ *
299
+ * `frameSize` is the source frame's pixel dimensions. Optional so
300
+ * existing single-arg consumers keep working (TypeScript callback
301
+ * variance handles it). Personhood uses it to compute an
302
+ * orientation-invariant face-size ratio for distance-aware smoothing.
303
+ */
304
+ onFaceData?: (face: FaceData, frameSize?: {
305
+ width: number;
306
+ height: number;
307
+ }) => void;
308
+ onLenses?: () => void;
309
+ onMask?: () => void;
310
+ onEyesClosed?: () => void;
311
+ onHeadWear?: () => void;
312
+ onSwitchToManualCapture?: () => void;
313
+ onFaceOccluded?: () => void;
314
+ }
315
+ /**
316
+ * Capability interface for face detection and selfie capture.
317
+ * Extends the base ML provider capability with face-detection specific methods.
318
+ */
319
+ interface IFaceDetectionCapability extends IMLProviderCapability<FaceDetectionConfig> {
320
+ /**
321
+ * Sets callbacks for face detection events.
322
+ * @param callbacks - Object containing callback functions for various detection events
323
+ */
324
+ setCallbacks(callbacks: FaceDetectionCallbacks): void;
325
+ /**
326
+ * Sets position constraints for face detection.
327
+ * @param constraints - Bounding box constraints for valid face position
328
+ */
329
+ setPositionConstraints(constraints: FacePositionConstraints): void;
330
+ /**
331
+ * Sets detection thresholds for quality checks.
332
+ * @param thresholds - Threshold values for various quality metrics
333
+ */
334
+ setThresholds(thresholds: FaceDetectionThresholds): void;
335
+ /**
336
+ * Sets thresholds for face attribute detection.
337
+ * @param thresholds - Threshold values for attribute detection (headwear, lenses, etc.)
338
+ */
339
+ setAttributesThresholds(thresholds: FaceAttributesThresholds): void;
340
+ /**
341
+ * Enables or disables specific face checks.
342
+ * @param config - Configuration for which checks to enable
343
+ */
344
+ setChecksEnabled(config: FaceChecksConfig): void;
345
+ /**
346
+ * Sets video selfie mode.
347
+ * @param enabled - Whether to enable video selfie mode
348
+ */
349
+ setVideoSelfieMode(enabled: boolean): void;
350
+ /**
351
+ * Manually triggers the `onCapture` callback registered via
352
+ * `setCallbacks`, using the best-quality frame the provider has
353
+ * seen so far (or the most recent processed frame as a fallback).
354
+ * Used by callers that want to complete a capture flow without
355
+ * waiting for WASM's own autocapture criteria — e.g. Personhood's
356
+ * "complete with far-away face" path, where the user may be too
357
+ * small in frame for autocapture to ever fire but a verdict
358
+ * (likely lower-confidence) is still desired.
359
+ *
360
+ * No-op when no frame is available at all (camera hasn't produced
361
+ * a single decoded frame yet) or when no `onCapture` callback was
362
+ * registered.
363
+ */
364
+ forceCapture(): void;
365
+ /**
366
+ * Synchronous manual-capture entry point for the on-device selfie workflow.
367
+ * Runs the full on-device pipeline on a single canvas image and stages the
368
+ * results inside WASM for the next {@link postFaceResults} call. No-op for
369
+ * default (non-on-device) configurations; callers should guard with the
370
+ * `onDeviceFaceResultsSubmissionEnabled` flag.
371
+ */
372
+ processPhoto(canvas: HTMLCanvasElement): void;
373
+ /**
374
+ * POSTs the staged on-device face-results JSON to `/omni/add/face-results`.
375
+ * The C++ side encrypts the body via `SessionEncryptor` and routes through
376
+ * the WASM `WebClient`, so the SDK's WebClient must be initialized first
377
+ * (consumers calling this must configure `setup({ apiURL, wasm })`).
378
+ */
379
+ postFaceResults(config?: WebApiHostRequestConfig): Promise<unknown>;
380
+ }
381
+ //#endregion
382
+ //#region ../infra/src/avatar/faceFeed.d.ts
383
+ /**
384
+ * A tiny per-frame pub/sub channel for the Incode WASM pipeline's `FaceData`.
385
+ *
386
+ * The parked `incode-2d` avatar drives the cosmetic avatar from the **existing** Incode face-detection
387
+ * pipeline (no second MediaPipe model). The detection pipeline lives in core's
388
+ * detection actor, while the avatar lives in the avatar actor — so the avatar is
389
+ * *fed* `FaceData` through this channel rather than running its own model.
390
+ *
391
+ * Deliberately NOT routed through XState events/context: the pipeline emits
392
+ * ~10×/s, and assigning that into context would re-run `mapState` and notify all
393
+ * manager subscribers 10×/s — needless churn that could itself regress UI perf.
394
+ * The feed is a plain emitter passed as input to both actors (detection
395
+ * publishes, the avatar source subscribes); nothing else observes it.
396
+ *
397
+ * Strictly read-only w.r.t. the authoritative pipeline — the feed only forwards
398
+ * data the pipeline already computed; it never influences detection/autocapture.
399
+ */
400
+ interface FaceFeedReader {
401
+ /** Subscribe to per-frame faces. Returns an unsubscribe function. */
402
+ subscribe(listener: (face: FaceData) => void): () => void;
403
+ /** The most recently published face, or null if none yet. */
404
+ getLatest(): FaceData | null;
405
+ /**
406
+ * Subscribe to the coarse "eyes closed" pulse — the only real eye signal the
407
+ * Incode pipeline exposes (a threshold event, both eyes, fired only when the
408
+ * closed-eyes check is enabled via `validateClosedEyes`). The avatar uses it
409
+ * to drive a real blink. Returns an unsubscribe function.
410
+ */
411
+ onEyesClosed(listener: () => void): () => void;
412
+ }
413
+ interface FaceFeed extends FaceFeedReader {
414
+ publish(face: FaceData): void;
415
+ /** Fire the eyes-closed pulse (from the detection pipeline's threshold event). */
416
+ signalEyesClosed(): void;
417
+ }
418
+ //#endregion
419
+ //#region ../infra/src/capabilities/IFaceAvatarCapability.d.ts
420
+ /**
421
+ * Caller-supplied overrides. Any omitted field falls back to the default
422
+ * CDN layout (see `avatar/avatarDefaults.ts`). `basePath`/`version` rewrite
423
+ * the whole directory; the individual `*Path` fields win over both.
424
+ */
425
+ interface AvatarAssetsOverrides {
426
+ basePath?: string;
427
+ version?: string;
428
+ mediapipeModulePath?: string;
429
+ mediapipeWasmPath?: string;
430
+ faceLandmarkerModelPath?: string;
431
+ vrmModelPath?: string;
432
+ }
433
+ /**
434
+ * Verdict cue an avatar can reflect: `detecting` (working) / `success` / `error`.
435
+ * Pose-driven 2D avatars colour the face accordingly (green wink / red frown);
436
+ * avatars without a verdict visual (VRM, privacy-lens) treat `setState` as a no-op.
437
+ * Driven by the host module (selfie capture outcome, personhood verdict).
438
+ */
439
+ type AvatarFaceState = 'detecting' | 'success' | 'error';
440
+ //#endregion
441
+ //#region src/internal/avatar/createFaceAvatar.d.ts
442
+ /**
443
+ * Shared face-avatar dispatch — the single code path BOTH the selfie module
444
+ * (`faceCapture` runAvatar actor) and the public `@incodetech/core/avatar` facade
445
+ * use, so every camera module mounts avatars the same way. Lives in `internal/`
446
+ * (not `modules/`) because `internal/` may not import from `modules/`; the public
447
+ * `modules/avatar` entry is a thin re-export of this. See
448
+ * docs/features/FACE_AVATAR.md.
449
+ *
450
+ * Public catalog of shippable face avatars. Each id maps to a lazily-loaded
451
+ * provider, so a module only pays the bundle cost of the avatar it picks:
452
+ * - `avatar-3d` → 3D VRM character, MediaPipe-tracked (premium look).
453
+ * - `avatar-2d` → stylized 2D "satin" face, MediaPipe-tracked. Also the
454
+ * personhood avatar.
455
+ * - `privacy-lens` → WebGL frosted-glass lens over the real video (no tracking).
456
+ *
457
+ * (The Incode-data 2D avatar is parked — kept in infra, not in the public
458
+ * catalog. See docs/features/FACE_AVATAR.md → Parked: the Incode-data avatar.)
459
+ */
460
+ type AvatarId = 'avatar-3d' | 'avatar-2d' | 'privacy-lens';
461
+ interface FaceAvatarOptions {
462
+ /** Which avatar to render. */
463
+ variant: AvatarId;
464
+ /** The already-acquired camera stream (the host module owns it). */
465
+ stream: MediaStream;
466
+ /** Runtime asset overrides (MediaPipe wasm/model, VRM); defaults to the CDN layout. */
467
+ assets?: AvatarAssetsOverrides;
468
+ /** Upper bound on the avatar's internal detect/render loop (default 30). */
469
+ maxFps?: number;
470
+ /** Initial verdict cue; defaults to `detecting`. */
471
+ initialState?: AvatarFaceState;
472
+ }
473
+ interface FaceAvatarHandle {
474
+ /** The canvas to mount in place of the live video. */
475
+ readonly canvas: HTMLCanvasElement;
476
+ /** Push a verdict cue (no-op for avatars without a verdict visual). */
477
+ setState(state: AvatarFaceState): void;
478
+ /** Tear down the loop, model and hidden decode video. */
479
+ stop(): void;
480
+ }
481
+ /**
482
+ * Mounts a cosmetic face avatar: lazy-loads the chosen provider, starts it on the
483
+ * given stream, and returns a handle to mount the canvas + push verdict cues. The
484
+ * avatar is **cosmetic-only** — it never feeds the authoritative
485
+ * detection/quality/liveness/upload pipeline.
486
+ */
487
+ declare function createFaceAvatar(options: FaceAvatarOptions): Promise<FaceAvatarHandle>;
488
+ //#endregion
489
+ export { MLProviderConfig as _, AvatarAssetsOverrides as a, FaceAttributesThresholds as c, FaceDetectionCallbacks as d, FaceDetectionConfig as f, IMLProviderCapability as g, IFaceDetectionCapability as h, createFaceAvatar as i, FaceChecksConfig as l, FacePositionConstraints as m, FaceAvatarHandle as n, AvatarFaceState as o, FaceDetectionThresholds as p, FaceAvatarOptions as r, FaceFeed as s, AvatarId as t, FaceCoordinates as u, WebApiHostRequestConfig as v, IncodeCanvas as y };
@@ -1,4 +1,4 @@
1
- import { a as CurpValidationActor, c as CurpValidationErrors, d as GenerateCurpFieldDef, f as GenerateCurpFieldType, i as createCurpValidationManagerFromActor, l as CurpValidationRule, n as CurpValidationState, o as curpValidationMachine, p as GenerateCurpForm, r as createCurpValidationManager, s as CurpValidationConfig, t as CurpValidationManager, u as EnterCurpFieldDef } from "./curpValidationManager-BxWhpCLA.js";
1
+ import { a as CurpValidationActor, c as CurpValidationErrors, d as GenerateCurpFieldDef, f as GenerateCurpFieldType, i as createCurpValidationManagerFromActor, l as CurpValidationRule, n as CurpValidationState, o as curpValidationMachine, p as GenerateCurpForm, r as createCurpValidationManager, s as CurpValidationConfig, t as CurpValidationManager, u as EnterCurpFieldDef } from "./curpValidationManager-C_TQjX2P.js";
2
2
  //#region src/modules/curp-validation/curpValidationUtils.d.ts
3
3
  type MexicanState = {
4
4
  value: string;
@@ -1,7 +1,7 @@
1
1
  import { i as ActorRefFrom } from "./spawn-D9jgw9pW.js";
2
2
  import { t as Manager } from "./Manager-CQQ99QOI.js";
3
3
  import "./Actor-iTq7YY48.js";
4
- import { i as FlowModuleConfig } from "./types-CRw2IBPn.js";
4
+ import { i as FlowModuleConfig } from "./types-s0fF3TpX.js";
5
5
  //#region src/modules/curp-validation/types.d.ts
6
6
  type CurpValidationConfig = FlowModuleConfig['CURP_VALIDATION'] & {
7
7
  /** Maximum validation retries before auto-advancing. @default 1 */
@@ -1,13 +1,13 @@
1
- import { r as WasmUtilProvider } from "./safeStorage-Ep56I-f_.esm.js";
1
+ import { r as WasmUtilProvider } from "./safeStorage-2nOSCCnG.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-CNuiVjvN.esm.js";
4
- import { g as getThumbmarkId, h as IpifyProvider, n as getFingerprintEnabled, p as isBrowserSimulation, t as getDisableIpify, v as BrowserEnvironmentProvider } from "./sessionInitializer-ShclX9vD.esm.js";
5
- import "./trueSight-BxA2W2OB.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-zTWODJoh.esm.js";
4
+ import { g as getThumbmarkId, h as IpifyProvider, n as getFingerprintEnabled, p as isBrowserSimulation, t as getDisableIpify, v as BrowserEnvironmentProvider } from "./sessionInitializer-D_B-8Ujt.esm.js";
5
+ import "./trueSight-lNCajJAf.esm.js";
6
6
  import { t as addDeviceStats } from "./stats-B0nFKawG.esm.js";
7
7
  import { t as getParsedUserAgent } from "./getParsedUserAgent-pJjATANs.esm.js";
8
8
  import { t as getUserAgent } from "./getBrowser-Cb8Zgrgp.esm.js";
9
- import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-BqUCwLY8.esm.js";
10
- import { t as MotionSensorProvider } from "./MotionSensorProvider-DGiV77J_.esm.js";
9
+ import { t as setWasmDsFlagSync } from "./wasmDsFlagSync-Dd7Yj25O.esm.js";
10
+ import { t as MotionSensorProvider } from "./MotionSensorProvider-CxTjgXe6.esm.js";
11
11
  import { a as stopCameraStream, r as requestCameraAccess } from "./camera-_2sXMXiF.esm.js";
12
12
  import { t as IncodeCanvas } from "./canvas-E1zGkel4.esm.js";
13
13
  import { t as createHiddenVideoElement } from "./video-BtSWtHy1.esm.js";
@@ -1,5 +1,6 @@
1
1
  import { t as CameraStream } from "./camera-9wWD-pwg.js";
2
- import { o as IncodeCanvas } from "./IStorageCapability-ORkQfK3F.js";
2
+ import { y as IncodeCanvas } from "./createFaceAvatar-pUEkdk4X.js";
3
+ import "./IWasmUtilCapability-5-Pncgma.js";
3
4
  //#region ../infra/src/media/StreamCanvasCapture.d.ts
4
5
  type StreamCanvasCaptureOptions = {
5
6
  fps?: number;
@@ -1,3 +1,3 @@
1
- import { a as DocumentCaptureErrorCode, c as DocumentType, n as DOCUMENT_CAPTURE_ERROR_CODES, r as DocumentCaptureConfig, s as DocumentCaptureNextPageType } from "./types-DelMqZLe2.js";
2
- import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-Bvipl_tY.js";
1
+ import { a as DocumentCaptureErrorCode, c as DocumentType, n as DOCUMENT_CAPTURE_ERROR_CODES, r as DocumentCaptureConfig, s as DocumentCaptureNextPageType } from "./types-DelMqZLe.js";
2
+ import { a as DocumentCaptureActor, i as createDocumentCaptureManagerFromActor, n as DocumentCaptureState, o as documentCaptureMachine, r as createDocumentCaptureManager, t as DocumentCaptureManager } from "./documentCaptureManager-DlGYd-sJ.js";
3
3
  export { DOCUMENT_CAPTURE_ERROR_CODES, type DocumentCaptureActor, type DocumentCaptureConfig, type DocumentCaptureErrorCode, type DocumentCaptureManager, type DocumentCaptureNextPageType, type DocumentCaptureState, type DocumentType, createDocumentCaptureManager, createDocumentCaptureManagerFromActor, documentCaptureMachine };
@@ -1,3 +1,3 @@
1
- import { n as DOCUMENT_CAPTURE_ERROR_CODES, t as documentCaptureMachine } from "./documentCaptureStateMachine-DpWiaUPB.esm.js";
2
- import { n as createDocumentCaptureManagerFromActor, t as createDocumentCaptureManager } from "./documentCaptureManager-CaXWUo_N.esm.js";
1
+ import { n as DOCUMENT_CAPTURE_ERROR_CODES, t as documentCaptureMachine } from "./documentCaptureStateMachine-fk7MDfSZ.esm.js";
2
+ import { n as createDocumentCaptureManagerFromActor, t as createDocumentCaptureManager } from "./documentCaptureManager-D7A4k-GE.esm.js";
3
3
  export { DOCUMENT_CAPTURE_ERROR_CODES, createDocumentCaptureManager, createDocumentCaptureManagerFromActor, documentCaptureMachine };
@@ -38,10 +38,6 @@ declare const documentUploadMachine: StateMachine<DocumentUploadContext, {
38
38
  id: string | undefined;
39
39
  };
40
40
  }>, Values<{
41
- setError: {
42
- type: "setError";
43
- params: NonReducibleUnknown;
44
- };
45
41
  setStream: {
46
42
  type: "setStream";
47
43
  params: NonReducibleUnknown;
@@ -54,6 +50,10 @@ declare const documentUploadMachine: StateMachine<DocumentUploadContext, {
54
50
  type: "setProgress";
55
51
  params: NonReducibleUnknown;
56
52
  };
53
+ setError: {
54
+ type: "setError";
55
+ params: NonReducibleUnknown;
56
+ };
57
57
  clearError: {
58
58
  type: "clearError";
59
59
  params: NonReducibleUnknown;
@@ -1,7 +1,7 @@
1
1
  import { n as eventModuleNames, o as createManagerInstrumentation } from "./events-CxfNJVZW.esm.js";
2
2
  import { t as topLevelStateName } from "./topLevelStateName-B5i2avbh.esm.js";
3
3
  import { c as createManager, o as createActor } from "./xstate.esm-Cf4e0Cfd.esm.js";
4
- import { n as DOCUMENT_CAPTURE_ERROR_CODES, t as documentCaptureMachine } from "./documentCaptureStateMachine-DpWiaUPB.esm.js";
4
+ import { n as DOCUMENT_CAPTURE_ERROR_CODES, t as documentCaptureMachine } from "./documentCaptureStateMachine-fk7MDfSZ.esm.js";
5
5
  //#region src/modules/document-capture/documentCaptureActor.ts
6
6
  function createDocumentCaptureActor(options) {
7
7
  return createActor(documentCaptureMachine, { input: { config: options.config } }).start();