@incodetech/core 0.0.0-dev-20260909-14ef44cf → 0.0.0-dev-20260911-3c28f170

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 (67) hide show
  1. package/dist/{BrowserDiagnosticsCryptoProvider-BqvOagjI.esm.js → BrowserDiagnosticsCryptoProvider-D8H3nWpr.esm.js} +1 -1
  2. package/dist/{MotionSensorProvider-nnSH-kVd.esm.js → MotionSensorProvider-Vlyhbcty.esm.js} +1 -1
  3. package/dist/ae-signature.esm.js +1 -1
  4. package/dist/{apiError-CE5YD5T0.esm.js → apiError-CY6lWIaQ.esm.js} +1 -1
  5. package/dist/authentication.esm.js +2 -2
  6. package/dist/{authenticationManager-BMqAIjH1.esm.js → authenticationManager-BxkiSz79.esm.js} +4 -4
  7. package/dist/{authenticationStateMachine-BKMxS3yH.esm.js → authenticationStateMachine-DAQ4dBAD.esm.js} +2 -2
  8. package/dist/camera.esm.js +1 -1
  9. package/dist/{deepsightLoader-nTArZgT2.esm.js → deepsightLoader-Cpjfw3EQ.esm.js} +5 -5
  10. package/dist/device.esm.js +5 -2
  11. package/dist/document-capture.esm.js +2 -2
  12. package/dist/{documentCaptureManager-BqY_B0Ii.esm.js → documentCaptureManager-BTpHZMgW.esm.js} +1 -1
  13. package/dist/{documentCaptureStateMachine-D_9dw5b1.esm.js → documentCaptureStateMachine-CPizkpcg.esm.js} +2 -2
  14. package/dist/dynamic-forms.esm.js +2 -2
  15. package/dist/{dynamicFormsManager-HVbJKaF8.esm.js → dynamicFormsManager-CKkEm4x5.esm.js} +1 -1
  16. package/dist/{dynamicFormsStateMachine-BGYqEGcO.esm.js → dynamicFormsStateMachine-CoBVJjYk.esm.js} +1 -1
  17. package/dist/ekyb.esm.js +3 -3
  18. package/dist/{ekybManager-D080qI3d.esm.js → ekybManager-hFZnmQzb.esm.js} +1 -1
  19. package/dist/{ekybStateMachine-4Ac_gP-0.esm.js → ekybStateMachine-CHzi9XHk.esm.js} +1 -1
  20. package/dist/electronic-signature.esm.js +1 -1
  21. package/dist/{electronicSignatureManager-CuZp9R8p.esm.js → electronicSignatureManager-vLj_aBwI.esm.js} +1 -1
  22. package/dist/extensibility.esm.js +12 -12
  23. package/dist/{faceCaptureManagerFactory-waLeHRj_.esm.js → faceCaptureManagerFactory-BRuA7cbI.esm.js} +3 -3
  24. package/dist/{faceCaptureSetup-JxQbmDt_.esm.js → faceCaptureSetup-Bhpk__dy.esm.js} +3 -3
  25. package/dist/{feature-management-DkbzJPHi.esm.js → feature-management-Dd_npJ0p.esm.js} +30 -5
  26. package/dist/feature-management.esm.js +1 -1
  27. package/dist/flow.d.ts +202 -177
  28. package/dist/flow.esm.js +107 -24
  29. package/dist/{flowCompletionService-1HFgv9BU.esm.js → flowCompletionService-cuWgokHI.esm.js} +1 -1
  30. package/dist/{flowServices-C2pUbFWe.esm.js → flowServices-CzgZ-VRv.esm.js} +83 -14
  31. package/dist/geolocation.esm.js +2 -2
  32. package/dist/{geolocationManager-CeDChUNS.esm.js → geolocationManager-Vh9KYMeo.esm.js} +1 -1
  33. package/dist/{geolocationStateMachine-C1fxKLJP.esm.js → geolocationStateMachine-BPzG-LrP.esm.js} +1 -1
  34. package/dist/id-selfie-flow.esm.js +8 -8
  35. package/dist/id.esm.js +4 -4
  36. package/dist/{idCaptureDefaults-CbCpNaoY.esm.js → idCaptureDefaults-Dic5mQfO.esm.js} +3 -2
  37. package/dist/{idCaptureManager-Cpd9uT8z.esm.js → idCaptureManager-De-5JavX.esm.js} +5 -5
  38. package/dist/{idCaptureServices-X5poMwbu.esm.js → idCaptureServices-BZvFZyyy.esm.js} +4 -4
  39. package/dist/{idCaptureStateMachine-BZPAUJzI.esm.js → idCaptureStateMachine-UTll8mMx.esm.js} +9 -9
  40. package/dist/index.d.ts +1 -1
  41. package/dist/index.esm.js +1 -1
  42. package/dist/{onDeviceFaceResults-BgIPrRr2.esm.js → onDeviceFaceResults-CU5XlhqG.esm.js} +6 -5
  43. package/dist/{permissionGuards-BHw_SD3h.esm.js → permissionGuards-DxbvOoZJ.esm.js} +1 -1
  44. package/dist/{permissionServices-J5S1dEIf.esm.js → permissionServices-f7nBnW5P.esm.js} +2 -2
  45. package/dist/personhood.esm.js +6 -6
  46. package/dist/qe-signature.esm.js +1 -1
  47. package/dist/{runChildModule-Bq791c2t.esm.js → runChildModule-6P8ofHxL.esm.js} +1 -1
  48. package/dist/safeStorage-Dp9m6aOh.esm.js +422 -0
  49. package/dist/{sdkVersion-Bc55H50S.esm.js → sdkVersion-DlL6SxXs.esm.js} +1 -1
  50. package/dist/selfie.esm.js +6 -6
  51. package/dist/{selfieManager-I_h3YE2X.esm.js → selfieManager-C4esDm_H.esm.js} +4 -4
  52. package/dist/{selfieStateMachine-DJwDxPAT.esm.js → selfieStateMachine-B7vhKLV7.esm.js} +2 -2
  53. package/dist/{session-CoY3St8F.esm.js → session-DWnBmR2a.esm.js} +3 -3
  54. package/dist/session.d.ts +16 -1
  55. package/dist/session.esm.js +5 -5
  56. package/dist/{sessionInitializer-BEjB0UVH.esm.js → sessionInitializer-DUpE6yBR.esm.js} +92 -33
  57. package/dist/{setup-DLn1eHU9.esm.js → setup-CQNSur1c.esm.js} +8 -6
  58. package/dist/{setup-B9s2jaZK.d.ts → setup-D6yz9se2.d.ts} +14 -0
  59. package/dist/{trueSightService-VUN8WK4N.esm.js → trueSightService-CvdDnFul.esm.js} +2 -2
  60. package/dist/video-selfie.esm.js +5 -5
  61. package/dist/{videoSelfieCameraWarmer-Dkey7P7h.esm.js → videoSelfieCameraWarmer-Gcgw9ze7.esm.js} +4 -4
  62. package/dist/{safeStorage-0bZuUtSP.esm.js → warmup-BOM-sD-6.esm.js} +14 -434
  63. package/dist/wasm.d.ts +1 -1
  64. package/dist/wasm.esm.js +2 -2
  65. package/dist/{wasmDsFlagSync-CyCdsfox.esm.js → wasmDsFlagSync-C3k_VK9o.esm.js} +1 -1
  66. package/dist/workflow.esm.js +15 -15
  67. package/package.json +3 -3
@@ -1,4 +1,4 @@
1
- import { _ as resolveWasmSource, c as wasmCallWrapper, g as missingWasmModelError, l as loadWasmModule, m as WASM_PIPELINE_MODELS, n as createWebApiHostAdapter, s as ML_CALL_MAX_POLLS, u as SemaphoreProvider } from "./wasmWebClient-BJCaFeBL.esm.js";
1
+ import { _ as resolveWasmSource, g as missingWasmModelError, l as loadWasmModule, m as WASM_PIPELINE_MODELS, n as createWebApiHostAdapter, u as SemaphoreProvider } from "./wasmWebClient-BJCaFeBL.esm.js";
2
2
  //#region ../infra/src/wasm/wasmEnumMaps.ts
3
3
  function pipelineTypeToWasmEnum(wasmModule, type) {
4
4
  switch (type) {
@@ -43,6 +43,7 @@ function idCaptureModelTypeFromWasmEnum(wasmModule, type) {
43
43
  var WasmRuntime = class WasmRuntime {
44
44
  constructor(loadModule = loadWasmModule) {
45
45
  this.loadModule = loadModule;
46
+ this.loadedModels = /* @__PURE__ */ new Map();
46
47
  this.modelsBuffers = null;
47
48
  this.inputImageBuffer = null;
48
49
  this.wasmModule = null;
@@ -117,6 +118,7 @@ var WasmRuntime = class WasmRuntime {
117
118
  * Free allocated memory
118
119
  */
119
120
  async freeResources() {
121
+ this.loadedModels.clear();
120
122
  this.modelsBuffers = null;
121
123
  this.inputImageBuffer = null;
122
124
  this.imageWidth_ = null;
@@ -179,13 +181,11 @@ var WasmRuntime = class WasmRuntime {
179
181
  default: throw new Error("Unknown pipeline type");
180
182
  }
181
183
  }
182
- async loadModels() {
184
+ async loadModels(pipelines = this.pipelines_) {
183
185
  const message = "Unable load the models, cpp API hasn't been initialized";
184
186
  const buffSizes = new (this.requireWasmModule(message)).WorkflowTypeToIntMap();
185
187
  const modelData = /* @__PURE__ */ new Map();
186
- const loadedModels = /* @__PURE__ */ new Map();
187
188
  const sizeVectors = [];
188
- const pipelines = this.pipelines_;
189
189
  if (pipelines === null) throw new Error(message);
190
190
  for (const [type, modelsPaths] of pipelines) {
191
191
  const wasmType = this.pipelineTypeToWasmEnum(type);
@@ -193,10 +193,10 @@ var WasmRuntime = class WasmRuntime {
193
193
  const sizes = new (this.requireWasmModule(message)).VectorInt();
194
194
  sizeVectors.push(sizes);
195
195
  for (const path of modelsPaths) {
196
- let model = loadedModels.get(path);
196
+ let model = this.loadedModels.get(path);
197
197
  if (!model) {
198
198
  model = await resolveWasmSource(path, "model");
199
- loadedModels.set(path, model);
199
+ this.loadedModels.set(path, model);
200
200
  }
201
201
  sizes.push_back(model.byteLength);
202
202
  pipelineBuffers.push(model);
@@ -207,6 +207,7 @@ var WasmRuntime = class WasmRuntime {
207
207
  const modelsBuffers = this.requireWorkflowApiUtilities(message).allocateModelsBuffers(buffSizes);
208
208
  for (const sizes of sizeVectors) sizes.delete?.();
209
209
  buffSizes.delete?.();
210
+ for (const [type, paths] of pipelines) this.pipelines_?.set(type, paths);
210
211
  this.modelsBuffers = modelsBuffers;
211
212
  for (const [type, data] of modelData) {
212
213
  const buffers = modelsBuffers.get(type);
@@ -405,12 +406,14 @@ function buildPipelinesMap(pipelines, config) {
405
406
  async function warmupWasm(config) {
406
407
  const pipelines = config.pipelines ?? [...WASM_PIPELINES];
407
408
  if (state === "loading" && loadingPromise) {
409
+ if (lastConfig && pipelines.every((p) => loadedPipelines.includes(p))) return;
408
410
  const inFlight = loadingPromise;
409
411
  if (pipelines.filter((p) => !pipelinesInFlight.includes(p)).length === 0) return inFlight;
410
412
  return inFlight.then(() => warmupWasm(config));
411
413
  }
412
414
  if (state === "ready") {
413
- if (pipelines.filter((p) => !loadedPipelines.includes(p)).length === 0) return;
415
+ const missingPipelines = pipelines.filter((p) => !loadedPipelines.includes(p));
416
+ if (missingPipelines.length === 0) return;
414
417
  if (!lastConfig) throw new Error("Cannot add pipelines: original warmup config not available");
415
418
  if (lastConfig.wasmPath !== config.wasmPath || lastConfig.glueCodePath !== config.glueCodePath || (lastConfig.wasmSimdPath ?? lastConfig.wasmPath) !== (config.wasmSimdPath ?? config.wasmPath) || (lastConfig.glueCodeSimdPath ?? "") !== (config.glueCodeSimdPath ?? "") || lastConfig.loadGlue !== config.loadGlue || lastConfig.loadGlueSimd !== config.loadGlueSimd || (lastConfig.useSimd ?? true) !== (config.useSimd ?? true)) throw new Error("Cannot add pipelines: WASM config mismatch. Use same wasmPath, glueCodePath, and useSimd settings.");
416
419
  const combinedPipelines = [.../* @__PURE__ */ new Set([...loadedPipelines, ...pipelines])];
@@ -419,12 +422,8 @@ async function warmupWasm(config) {
419
422
  wasmError = null;
420
423
  loadingPromise = (async () => {
421
424
  try {
422
- const pipelinesMap = buildPipelinesMap(combinedPipelines, lastConfig);
423
- await wasmRuntime.initialize({
424
- module: lastConfig,
425
- pipelines: pipelinesMap
426
- });
427
- await wasmRuntime.loadModels();
425
+ const pipelinesMap = buildPipelinesMap(missingPipelines, lastConfig);
426
+ await wasmRuntime.loadModels(pipelinesMap);
428
427
  await wasmRuntime.initializePipelines();
429
428
  state = "ready";
430
429
  loadedPipelines = combinedPipelines;
@@ -434,7 +433,7 @@ async function warmupWasm(config) {
434
433
  };
435
434
  loadingPromise = null;
436
435
  } catch (error) {
437
- state = "error";
436
+ state = "ready";
438
437
  wasmError = error instanceof Error ? error : new Error(String(error));
439
438
  loadingPromise = null;
440
439
  pipelinesInFlight = [];
@@ -520,423 +519,4 @@ function setWasmOnDeviceMode(enabled) {
520
519
  wasmRuntime.setOnDeviceMode(enabled);
521
520
  }
522
521
  //#endregion
523
- //#region ../infra/src/wasm/utilityWasmApi.ts
524
- /**
525
- * Utility / metadata domain facade over {@link WasmRuntime}.
526
- *
527
- * Holds no WASM state — the runtime owns every handle and buffer. The one
528
- * qualification: it owns exactly two JS-side flags that the C++ side does not
529
- * persist and that must be replayed into it at call time —
530
- *
531
- * - `dsEnabled_` (deepsight) is passed as an argument on every
532
- * `prc`/`poc`/`rsp`/`ssl` call;
533
- * - `inspectorOpened_` is pushed into C++ inside {@link getMetadata}, right
534
- * before reading the metadata, because `setInspectorOpened` may legitimately be
535
- * called before WASM is initialized.
536
- *
537
- * Both are deliberately **unguarded** setters: they never throw, so the SDK can
538
- * record them during setup and have them honored once WASM comes up.
539
- *
540
- * `prc`/`poc`/`rsp` are the only methods here that hold the ML semaphore.
541
- * `ssl`/`stl`/`osv`/`oev`/`ckvcks` and everything else are unlocked **by design**
542
- * (decision D6) — never add locking.
543
- *
544
- * Method names, argument order and the pre-initialization error strings are
545
- * copied verbatim from the mirrored upstream `wasmApi.ts` so a WASM version bump
546
- * stays a diff against upstream (`docs/processes/WASM_VERSION_MIGRATION.md`).
547
- * `setSdkPlatform`'s message says "device type" on purpose — do not "fix" it.
548
- */
549
- var UtilityWasmApi = class {
550
- constructor(runtime = wasmRuntime) {
551
- this.runtime = runtime;
552
- this.inspectorOpened_ = false;
553
- this.dsEnabled_ = false;
554
- }
555
- ens(image) {
556
- return this.runtime.requireUtilityApi("Unable to encrypt the image, cpp API hasn't been initialized").ens(image);
557
- }
558
- isVirtualCamera(label) {
559
- const utilityApi = this.runtime.requireUtilityApi("Unable to check if the camera is virtual, cpp API hasn't been initialized");
560
- if (label) return utilityApi.isVirtualCamera(label);
561
- return false;
562
- }
563
- estimatePerformance() {
564
- return this.runtime.requireUtilityApi("Unable to estimate performance, cpp API hasn't been initialized").estimatePerformance();
565
- }
566
- async analyzeFrame(image) {
567
- const message = "Unable to analyze the frame, cpp API hasn't been initialized";
568
- this.runtime.requireUtilityApi(message);
569
- await this.runtime.allocateImageBuffers(image.width, image.height);
570
- this.runtime.writeFrame(image);
571
- this.runtime.requireUtilityApi(message).analyzeFrame();
572
- }
573
- /**
574
- * Sets the native (C++) utility API's production mode. When `true`, the WASM
575
- * module suppresses its verbose debug logging; when `false`, it emits it.
576
- *
577
- * @param productionMode - `true` to silence WASM logs, `false` to emit them.
578
- * @throws If the WASM C++ API has not been initialized yet.
579
- */
580
- async setProductionMode(productionMode) {
581
- this.runtime.requireUtilityApi("Unable to set production mode, cpp API hasn't been initialized").setProductionMode(productionMode);
582
- }
583
- setSdkVersion(sdkVersion) {
584
- this.runtime.requireUtilityApi("Unable to set sdk version, cpp API hasn't been initialized").setSdkVersion(sdkVersion);
585
- }
586
- setSdkPlatform(sdkPlatform) {
587
- this.runtime.requireUtilityApi("Unable to set device type, cpp API hasn't been initialized").setSdkPlatform(sdkPlatform);
588
- }
589
- setDeviceInfo(deviceInfo, overrideExisting = true) {
590
- this.runtime.requireUtilityApi("Unable to set device info, cpp API hasn't been initialized").setDeviceInfo(deviceInfo, overrideExisting);
591
- }
592
- setBrowserInfo(browserInfo, overrideExisting = true) {
593
- this.runtime.requireUtilityApi("Unable to set browser info, cpp API hasn't been initialized").setBrowserInfo(browserInfo, overrideExisting);
594
- }
595
- setCameraInfo(cameraInfo, overrideExisting = true) {
596
- this.runtime.requireUtilityApi("Unable to set camera info, cpp API hasn't been initialized").setCameraInfo(cameraInfo, overrideExisting);
597
- }
598
- setZc(zc) {
599
- this.runtime.requireUtilityApi("Unable to set zc, cpp API hasn't been initialized").setZc(zc);
600
- }
601
- setMotionStatus(motionStatus) {
602
- this.runtime.requireUtilityApi("Unable to set motion status, cpp API hasn't been initialized").setMotionStatus(motionStatus);
603
- }
604
- setInspectorOpened(inspectorOpened) {
605
- this.inspectorOpened_ = inspectorOpened;
606
- }
607
- getInspectorOpened() {
608
- return this.inspectorOpened_;
609
- }
610
- setBackgroundMode(backgroundMode) {
611
- this.runtime.requireUtilityApi("Unable to set background mode, cpp API hasn't been initialized").setBackgroundMode(backgroundMode);
612
- }
613
- setDsEnabled(enabled) {
614
- this.dsEnabled_ = enabled;
615
- }
616
- getCheck() {
617
- return this.runtime.requireUtilityApi("Unable to get check, cpp API hasn't been initialized").getCheck();
618
- }
619
- getMetadata() {
620
- const utilityApi = this.runtime.requireUtilityApi("Unable to get metadata, cpp API hasn't been initialized");
621
- utilityApi.setInspectorOpened(this.inspectorOpened_);
622
- return utilityApi.getMetadata();
623
- }
624
- async prc() {
625
- const message = "Unable to prc, cpp API hasn't been initialized";
626
- this.runtime.requireUtilityApi(message);
627
- await wasmCallWrapper(this.runtime.mlCallSemaphore, () => this.runtime.requireUtilityApi(message).prc(this.dsEnabled_, false), true, {
628
- maxPolls: ML_CALL_MAX_POLLS,
629
- label: "prc"
630
- });
631
- }
632
- async poc(output) {
633
- const message = "Unable to poc, cpp API hasn't been initialized";
634
- this.runtime.requireUtilityApi(message);
635
- await wasmCallWrapper(this.runtime.mlCallSemaphore, () => this.runtime.requireUtilityApi(message).poc(this.dsEnabled_, output), true, {
636
- maxPolls: ML_CALL_MAX_POLLS,
637
- label: "poc"
638
- });
639
- }
640
- async rsp() {
641
- const message = "Unable to rsp, cpp API hasn't been initialized";
642
- this.runtime.requireUtilityApi(message);
643
- await wasmCallWrapper(this.runtime.mlCallSemaphore, () => this.runtime.requireUtilityApi(message).rsp(this.dsEnabled_), true, {
644
- maxPolls: ML_CALL_MAX_POLLS,
645
- label: "rsp"
646
- });
647
- }
648
- ssl() {
649
- this.runtime.requireUtilityApi("Unable to ssl, cpp API hasn't been initialized").ssl(this.dsEnabled_);
650
- }
651
- stl() {
652
- this.runtime.requireUtilityApi("Unable to stl, cpp API hasn't been initialized").stl();
653
- }
654
- osv() {
655
- this.runtime.requireUtilityApi("Unable to set sensor beginning timestamp, cpp API hasn't been initialized").osv();
656
- }
657
- oev() {
658
- this.runtime.requireUtilityApi("Unable to set sensor ending timestamp, cpp API hasn't been initialized").oev();
659
- }
660
- ckvcks(data) {
661
- this.runtime.requireUtilityApi("Unable to ckvcks, cpp API hasn't been initialized").ckvcks(data);
662
- }
663
- /**
664
- * Clear all states, not related to ml pipelines
665
- */
666
- resetOther() {
667
- this.runtime.requireUtilityApi("Unable to reset other states, cpp API hasn't been initialized").resetOther();
668
- }
669
- /**
670
- * Full reset. Pipelines first, then the non-pipeline state — the order the
671
- * mirrored upstream wrapper uses.
672
- */
673
- reset() {
674
- this.runtime.resetAllPipelines();
675
- this.resetOther();
676
- }
677
- };
678
- const utilityWasmApi = new UtilityWasmApi();
679
- //#endregion
680
- //#region ../infra/src/providers/wasm/BaseWasmProvider.ts
681
- /**
682
- * Base provider class that abstracts common WASM functionality.
683
- * This serves as a foundation for specific ML capability providers
684
- * like FaceDetectionProvider and IdCaptureProvider.
685
- */
686
- var BaseWasmProvider = class {
687
- /**
688
- * Creates a new BaseWasmProvider
689
- * @param pipelineType - The WASM pipeline type this provider uses
690
- */
691
- constructor(pipelineType) {
692
- this._isInitialized = false;
693
- this.pipelineType = pipelineType;
694
- }
695
- /**
696
- * Returns whether this provider has been initialized.
697
- */
698
- get initialized() {
699
- return this._isInitialized;
700
- }
701
- getPipelineType() {
702
- if (this.pipelineType === void 0) throw new Error(`${this.constructor.name} has no pipeline type configured.`);
703
- return this.pipelineType;
704
- }
705
- /**
706
- * Initializes the provider by ensuring WASM is loaded
707
- * @param config - Provider configuration
708
- * @param pipeline - The pipeline type to warm up ('selfie', 'idCapture', etc.)
709
- */
710
- async initializeBase(config, pipeline) {
711
- if (this._isInitialized) return;
712
- const status = getWasmStatus();
713
- if (status.isLoading || isWasmReady() || status.error) {
714
- await waitForWasm();
715
- if (this.pipelineType !== void 0 && !getWasmStatus().loadedPipelines.includes(pipeline)) throw new Error(`WASM pipeline "${pipeline}" is not loaded.`);
716
- } else {
717
- if (!config.wasmPath || !config.glueCodePath && !config.loadGlue) throw new Error("WASM path and glue code path are required. Call warmupWasm() first.");
718
- await warmupWasm({
719
- ...config,
720
- wasmPath: config.wasmPath,
721
- glueCodePath: config.glueCodePath ?? "",
722
- pipelines: [pipeline]
723
- });
724
- }
725
- this._isInitialized = true;
726
- }
727
- /**
728
- * Ensures the provider is initialized before performing operations.
729
- * @throws Error if not initialized
730
- */
731
- ensureInitialized() {
732
- if (!this._isInitialized) throw new Error(`${this.constructor.name} not initialized. Call initialize() first.`);
733
- }
734
- /**
735
- * Processes a frame through the WASM pipeline
736
- * @param image - Image data to process
737
- * @returns The pipeline result (type depends on pipeline - WASM returns any)
738
- */
739
- async processFrameWasm(image) {
740
- this.ensureInitialized();
741
- const pipelineType = this.getPipelineType();
742
- await wasmRuntime.allocateImageBuffers(image.width, image.height);
743
- await wasmRuntime.handleDetectionCallAndUpdateState(pipelineType);
744
- return await wasmRuntime.process(image, pipelineType);
745
- }
746
- /**
747
- * Resets the pipeline to its initial state.
748
- * Safe to call even if not initialized (no-op in that case).
749
- */
750
- reset() {
751
- if (this._isInitialized && this.pipelineType !== void 0) wasmRuntime.resetPipeline(this.pipelineType);
752
- }
753
- /**
754
- * Disposes of resources and resets initialization state.
755
- * Safe to call even if not initialized.
756
- */
757
- async dispose() {
758
- this.reset();
759
- this._isInitialized = false;
760
- }
761
- };
762
- //#endregion
763
- //#region ../infra/src/providers/wasm/WasmUtilProvider.ts
764
- var WasmUtilProvider = class WasmUtilProvider extends BaseWasmProvider {
765
- static async getInstance() {
766
- if (WasmUtilProvider.instance) return WasmUtilProvider.instance;
767
- if (WasmUtilProvider.initPromise) return WasmUtilProvider.initPromise;
768
- WasmUtilProvider.initPromise = (async () => {
769
- const instance = new WasmUtilProvider();
770
- await instance.initializeBase({}, "selfie");
771
- WasmUtilProvider.instance = instance;
772
- return instance;
773
- })();
774
- return WasmUtilProvider.initPromise;
775
- }
776
- static resetInstance() {
777
- WasmUtilProvider.instance = void 0;
778
- WasmUtilProvider.initPromise = void 0;
779
- }
780
- constructor() {
781
- super(void 0);
782
- }
783
- async initialize(config) {
784
- if (this.initialized) return;
785
- const pipeline = config.pipelines?.[0] ?? "selfie";
786
- await this.initializeBase(config, pipeline);
787
- }
788
- async processFrame(_image) {
789
- throw new Error("WasmUtilProvider does not support frame processing. Use encryptImage() instead.");
790
- }
791
- encryptImage(image) {
792
- this.ensureInitialized();
793
- return utilityWasmApi.ens(image);
794
- }
795
- setSdkVersion(version) {
796
- this.ensureInitialized();
797
- utilityWasmApi.setSdkVersion(version);
798
- }
799
- setSdkPlatform(platform) {
800
- this.ensureInitialized();
801
- utilityWasmApi.setSdkPlatform(platform);
802
- }
803
- setDeviceInfo(deviceInfo, overrideExisting = true) {
804
- this.ensureInitialized();
805
- utilityWasmApi.setDeviceInfo(deviceInfo, overrideExisting);
806
- }
807
- setBrowserInfo(browserInfo, overrideExisting = true) {
808
- this.ensureInitialized();
809
- utilityWasmApi.setBrowserInfo(browserInfo, overrideExisting);
810
- }
811
- setCameraInfo(cameraInfo, overrideExisting = true) {
812
- this.ensureInitialized();
813
- utilityWasmApi.setCameraInfo(cameraInfo, overrideExisting);
814
- }
815
- setMotionStatus(status) {
816
- this.ensureInitialized();
817
- utilityWasmApi.setMotionStatus(status);
818
- }
819
- setBackgroundMode(backgroundMode) {
820
- this.ensureInitialized();
821
- utilityWasmApi.setBackgroundMode(backgroundMode);
822
- }
823
- setOnDeviceMode(enabled) {
824
- this.ensureInitialized();
825
- wasmRuntime.setOnDeviceMode(enabled);
826
- }
827
- setZc(zc) {
828
- this.ensureInitialized();
829
- utilityWasmApi.setZc(zc);
830
- }
831
- setInspectorOpened(opened) {
832
- this.ensureInitialized();
833
- utilityWasmApi.setInspectorOpened(opened);
834
- }
835
- getInspectorOpened() {
836
- return utilityWasmApi.getInspectorOpened();
837
- }
838
- /**
839
- * Toggles the WASM module's production mode. When `true`, the native module
840
- * suppresses its verbose debug logging/console output; when `false`, those
841
- * logs are emitted. The SDK forces this to `true` by default and only flips
842
- * it off when the caller opts in via `setup({ wasm: { showLogs: true } })`.
843
- *
844
- * @param productionMode - `true` to silence WASM logs, `false` to emit them.
845
- */
846
- async setProductionMode(productionMode) {
847
- this.ensureInitialized();
848
- await utilityWasmApi.setProductionMode(productionMode);
849
- }
850
- getMetadata() {
851
- this.ensureInitialized();
852
- return utilityWasmApi.getMetadata();
853
- }
854
- async analyzeFrame(image) {
855
- this.ensureInitialized();
856
- await utilityWasmApi.analyzeFrame(image);
857
- }
858
- getCheck() {
859
- this.ensureInitialized();
860
- return utilityWasmApi.getCheck();
861
- }
862
- getPipelineState() {
863
- this.ensureInitialized();
864
- return wasmRuntime.getPipelineState();
865
- }
866
- estimatePerformance() {
867
- this.ensureInitialized();
868
- return utilityWasmApi.estimatePerformance();
869
- }
870
- isVirtualCamera(label) {
871
- this.ensureInitialized();
872
- return utilityWasmApi.isVirtualCamera(label);
873
- }
874
- async prc() {
875
- this.ensureInitialized();
876
- await utilityWasmApi.prc();
877
- }
878
- async poc(output) {
879
- this.ensureInitialized();
880
- await utilityWasmApi.poc(output);
881
- }
882
- async rsp() {
883
- this.ensureInitialized();
884
- await utilityWasmApi.rsp();
885
- }
886
- ssl() {
887
- this.ensureInitialized();
888
- utilityWasmApi.ssl();
889
- }
890
- stl() {
891
- this.ensureInitialized();
892
- utilityWasmApi.stl();
893
- }
894
- osv() {
895
- this.ensureInitialized();
896
- utilityWasmApi.osv();
897
- }
898
- oev() {
899
- this.ensureInitialized();
900
- utilityWasmApi.oev();
901
- }
902
- ckvcks(data) {
903
- this.ensureInitialized();
904
- utilityWasmApi.ckvcks(data);
905
- }
906
- };
907
- //#endregion
908
- //#region ../infra/src/storage/safeStorage.ts
909
- /**
910
- * Storage resolvers that tolerate hosts which make Web Storage unreachable.
911
- *
912
- * Two hostile shapes occur in the field, and they fail differently:
913
- *
914
- * 1. **Deleted bare global** — a page mitigates self-XSS with
915
- * `delete window.localStorage` and keeps a module-private reference. Since
916
- * `window` *is* the global object, the identifier stops resolving: a bare
917
- * read throws `ReferenceError`. `typeof` is the only safe probe, because it
918
- * is the one operator that tolerates an unresolvable identifier.
919
- * 2. **Blocked storage** — a webview or a cross-origin/partitioned context
920
- * makes the accessor itself throw (`SecurityError`). Here `typeof` is *not*
921
- * enough: it invokes the getter, so the throw escapes the guard.
922
- *
923
- * Handling only one shape leaves the other live, so always go through these
924
- * resolvers instead of touching the globals directly. A `null` return means
925
- * "no storage in this host" — callers degrade, they do not throw.
926
- */
927
- function resolveLocalStorage() {
928
- try {
929
- return typeof localStorage === "undefined" ? null : localStorage;
930
- } catch {
931
- return null;
932
- }
933
- }
934
- function resolveSessionStorage() {
935
- try {
936
- return typeof sessionStorage === "undefined" ? null : sessionStorage;
937
- } catch {
938
- return null;
939
- }
940
- }
941
- //#endregion
942
- export { utilityWasmApi as a, warmupWasm as c, BaseWasmProvider as i, wasmRuntime as l, resolveSessionStorage as n, getResolvedModelSource as o, WasmUtilProvider as r, setWasmOnDeviceMode as s, resolveLocalStorage as t };
522
+ export { waitForWasm as a, setWasmOnDeviceMode as i, getWasmStatus as n, warmupWasm as o, isWasmReady as r, wasmRuntime as s, getResolvedModelSource as t };
package/dist/wasm.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as WASM_MODEL_FILES, c as WasmPipeline, l as WasmSource, o as WasmGlueLoader, r as warmupWasm, s as WasmModelName, t as WarmupConfig } from "./warmup-CXHBgvFC.js";
2
- import { c as setWasmConfig, i as initializeWasmUtil, n as WasmConfig, r as ensureWasmPipelines, s as resolveWasmConfigForPipelines, u as upgradeToWasmHttpClient } from "./setup-B9s2jaZK.js";
2
+ import { c as setWasmConfig, i as initializeWasmUtil, n as WasmConfig, r as ensureWasmPipelines, s as resolveWasmConfigForPipelines, u as upgradeToWasmHttpClient } from "./setup-D6yz9se2.js";
3
3
  //#region ../infra/src/wasm/wasmDefaults.d.ts
4
4
  /** The WASM version bundled and tested with this SDK release. */
5
5
  declare const DEFAULT_WASM_VERSION = "v2.14.07-post7-post3";
package/dist/wasm.esm.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { f as WASM_MODEL_FILES, h as WASM_PIPELINE_MODEL_NAMES, p as WASM_PIPELINE_LAZY_MODEL_NAMES } from "./wasmWebClient-BJCaFeBL.esm.js";
2
- import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, d as buildDefaultWasmConfig, f as buildWasmConfigFromBasePath, m as resolveWasmConfig, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines, u as DEFAULT_WASM_VERSION } from "./setup-DLn1eHU9.esm.js";
3
- import { c as warmupWasm } from "./safeStorage-0bZuUtSP.esm.js";
2
+ import { a as resolveWasmConfigForPipelines, c as upgradeToWasmHttpClient, d as buildDefaultWasmConfig, f as buildWasmConfigFromBasePath, m as resolveWasmConfig, n as initializeWasmUtil, o as setWasmConfig, t as ensureWasmPipelines, u as DEFAULT_WASM_VERSION } from "./setup-CQNSur1c.esm.js";
3
+ import { o as warmupWasm } from "./warmup-BOM-sD-6.esm.js";
4
4
  //#region src/defineWasm.ts
5
5
  function requiredModels(pipelines) {
6
6
  const models = /* @__PURE__ */ new Set();
@@ -1,4 +1,4 @@
1
- import { a as utilityWasmApi } from "./safeStorage-0bZuUtSP.esm.js";
1
+ import { a as utilityWasmApi } from "./safeStorage-Dp9m6aOh.esm.js";
2
2
  //#region ../infra/src/wasm/wasmDsFlagSync.ts
3
3
  /**
4
4
  * Sets the Deepsight (ds) flag that the WASM utility API receives on every
@@ -1,29 +1,29 @@
1
- import { E as updateFeatureManagementUser } from "./feature-management-DkbzJPHi.esm.js";
1
+ import { E as updateFeatureManagementUser } from "./feature-management-Dd_npJ0p.esm.js";
2
2
  import { t as api } from "./api-Bx3gKW_y.esm.js";
3
- import { l as trueSightLog } from "./trueSightService-VUN8WK4N.esm.js";
3
+ import { l as trueSightLog } from "./trueSightService-CvdDnFul.esm.js";
4
4
  import { n as eventModuleNames, o as createManagerInstrumentation, v as addEvent } from "./events-ijlbX_Wx.esm.js";
5
- import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-BEjB0UVH.esm.js";
5
+ import { i as initializeSession, r as getSessionFingerprintResult } from "./sessionInitializer-DUpE6yBR.esm.js";
6
6
  import { t as endpoints } from "./endpoints-D3B9mUHh.esm.js";
7
- import { i as toIncodeApiError } from "./apiError-CE5YD5T0.esm.js";
8
- import { g as toEkybConfig } from "./flowServices-C2pUbFWe.esm.js";
7
+ import { i as toIncodeApiError } from "./apiError-CY6lWIaQ.esm.js";
8
+ import { v as toEkybConfig } from "./flowServices-CzgZ-VRv.esm.js";
9
9
  import { i as toEkycConfig } from "./ekycUtils-Dew1rBG0.esm.js";
10
10
  import { i as assign, s as createActor, t as setup, u as createManager } from "./xstate.esm-BuFLFuzz.esm.js";
11
11
  import { n as fromPromise } from "./xstate-actors.esm-BXeQ-Ucz.esm.js";
12
- import { r as electronicSignatureMachine } from "./electronicSignatureManager-CuZp9R8p.esm.js";
12
+ import { r as electronicSignatureMachine } from "./electronicSignatureManager-vLj_aBwI.esm.js";
13
13
  import "./ae-signature.esm.js";
14
14
  import { t as antifraudMachine } from "./antifraudStateMachine-BHxehiJZ.esm.js";
15
- import { t as authenticationMachine } from "./authenticationStateMachine-BKMxS3yH.esm.js";
15
+ import { t as authenticationMachine } from "./authenticationStateMachine-DAQ4dBAD.esm.js";
16
16
  import { t as certificateIssuanceMachine } from "./certificateIssuanceStateMachine-BBD5h8c4.esm.js";
17
17
  import { t as consentMachine } from "./consentStateMachine-DbUmqWgV.esm.js";
18
18
  import { t as curpValidationMachine } from "./curpValidationStateMachine-DvUPC_8S.esm.js";
19
19
  import { t as customWatchlistMachine } from "./customWatchlistStateMachine-qZVgkKgP.esm.js";
20
- import { t as documentCaptureMachine } from "./documentCaptureStateMachine-D_9dw5b1.esm.js";
21
- import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-BGYqEGcO.esm.js";
22
- import { t as ekybMachine } from "./ekybStateMachine-4Ac_gP-0.esm.js";
20
+ import { t as documentCaptureMachine } from "./documentCaptureStateMachine-CPizkpcg.esm.js";
21
+ import { t as dynamicFormsMachine } from "./dynamicFormsStateMachine-CoBVJjYk.esm.js";
22
+ import { t as ekybMachine } from "./ekybStateMachine-CHzi9XHk.esm.js";
23
23
  import { t as ekycMachine } from "./ekycStateMachine-CmdW2gVm.esm.js";
24
24
  import { t as emailMachine } from "./emailStateMachine-CyPFZ7dW.esm.js";
25
- import { t as selfieMachine } from "./selfieStateMachine-DJwDxPAT.esm.js";
26
- import { t as idCaptureMachine } from "./idCaptureStateMachine-BZPAUJzI.esm.js";
25
+ import { t as selfieMachine } from "./selfieStateMachine-B7vhKLV7.esm.js";
26
+ import { t as idCaptureMachine } from "./idCaptureStateMachine-UTll8mMx.esm.js";
27
27
  import { t as phoneMachine } from "./phoneStateMachine-jl8LJKCo.esm.js";
28
28
  import { t as watchlistMachine } from "./watchlistStateMachine-DvOby3a-.esm.js";
29
29
  import { t as watchlistForBusinessMachine } from "./watchlistForBusinessStateMachine-DEzgjz7C.esm.js";
@@ -32,12 +32,12 @@ import { t as mandatoryConsentMachine } from "./mandatoryConsentStateMachine-DSD
32
32
  import { t as idOcrStateMachine } from "./idOcrStateMachine-33UvRAHE.esm.js";
33
33
  import { n as redirectToMobileMachine } from "./redirectToMobileStateMachine-v3otpT-L.esm.js";
34
34
  import { t as signatureMachine } from "./signatureStateMachine-BHPwkJZS.esm.js";
35
- import { t as geolocationMachine } from "./geolocationStateMachine-C1fxKLJP.esm.js";
35
+ import { t as geolocationMachine } from "./geolocationStateMachine-BPzG-LrP.esm.js";
36
36
  import { t as governmentValidationMachine } from "./governmentValidationStateMachine-D1ZnEqdd.esm.js";
37
37
  import { t as idVerificationMachine } from "./idVerificationStateMachine-BPGrQZEm.esm.js";
38
38
  import { t as faceMatchMachine } from "./faceMatchStateMachine-BUc5FXYy.esm.js";
39
- import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-1HFgv9BU.esm.js";
40
- import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-Bq791c2t.esm.js";
39
+ import { n as getFinishStatus, r as getTotalScoreStatus } from "./flowCompletionService-cuWgokHI.esm.js";
40
+ import { n as attachFlowEventEmitter, t as runChildModule } from "./runChildModule-6P8ofHxL.esm.js";
41
41
  import { n as isAdvanceableError } from "./advanceableErrors-CpF2cBy6.esm.js";
42
42
  import "./qe-signature.esm.js";
43
43
  import { t as videoSelfieFlowModuleMachine } from "./videoSelfieFlowModuleMachine-BUe2uACW.esm.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@incodetech/core",
3
- "version": "0.0.0-dev-20260909-14ef44cf",
3
+ "version": "0.0.0-dev-20260911-3c28f170",
4
4
  "license": "ISC",
5
5
  "repository": {
6
6
  "type": "git",
@@ -276,8 +276,8 @@
276
276
  "tsdown": "^0.22.8",
277
277
  "typescript": "^5.9.3",
278
278
  "vitest": "4.1.10",
279
- "@incodetech/infra": "1.3.0",
280
- "@incodetech/config": "1.0.2"
279
+ "@incodetech/config": "1.0.2",
280
+ "@incodetech/infra": "1.3.0"
281
281
  },
282
282
  "scripts": {
283
283
  "build": "tsdown -c tsdown.config.ts",