@sekyro/web 0.1.0-rc.4 → 0.1.0-rc.5

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.
@@ -1,5 +1,5 @@
1
- import { C as CameraErrorKind } from '../capture-session-v3-DEInCOUg.cjs';
2
- export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureState, i as CaptureTiming, j as ClipError, k as ClipErrorKind, l as ClipRecorder, m as ClipResult, D as DEFAULT_CLIP_MIME, n as DEVICE_PROFILES, o as DeviceClass, p as DeviceProbe, q as DeviceProfile, r as DeviceProfiler, E as EscalationClipArtifact, s as EscalationHook, F as FaceGateV3, G as GateChecks, K as KEYFRAME_CANDIDATES, t as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, u as MIME_CANDIDATES, S as STOP_GRACE_MS, T as TIMESLICE_MS, V as V3ChecksPayload, v as V3GateFactor, w as V3GateQuality, x as V3GateThresholds, y as V3GateTick, z as V3GateTickInput, A as V3TelemetryEvent, B as V3_GATE_DEFAULTS, H as VIDEO_BPS, I as buildLivenessV2FormData, J as cameraPreflight, L as classifyDevice, N as extForMime, O as isClipTooLarge, P as isMediaRecorderSupported, Q as mapGetUserMediaError, R as pickMimeType, U as probeDevice } from '../capture-session-v3-DEInCOUg.cjs';
1
+ import { C as CameraErrorKind } from '../capture-session-v3-UQU_WjO2.cjs';
2
+ export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GateChecks, K as KEYFRAME_CANDIDATES, u as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, v as MIME_CANDIDATES, S as STOP_GRACE_MS, T as TIMESLICE_MS, V as V3ChecksPayload, w as V3GateFactor, x as V3GateQuality, y as V3GateThresholds, z as V3GateTick, A as V3GateTickInput, B as V3TelemetryEvent, H as V3_GATE_DEFAULTS, I as VIDEO_BPS, J as buildLivenessV2FormData, L as cameraPreflight, N as classifyDevice, O as extForMime, P as isClipTooLarge, Q as isMediaRecorderSupported, R as mapGetUserMediaError, U as pickMimeType, W as probeDevice } from '../capture-session-v3-UQU_WjO2.cjs';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, I as IN_CIRCLE_FACTOR, b as buildCaptureConstraints, d as detectIsMobile } from '../capture-constraints-BujkZcfb.cjs';
4
4
  export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-CKXHlXx9.cjs';
5
5
 
@@ -1,5 +1,5 @@
1
- import { C as CameraErrorKind } from '../capture-session-v3-uXJr1Wlm.js';
2
- export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureState, i as CaptureTiming, j as ClipError, k as ClipErrorKind, l as ClipRecorder, m as ClipResult, D as DEFAULT_CLIP_MIME, n as DEVICE_PROFILES, o as DeviceClass, p as DeviceProbe, q as DeviceProfile, r as DeviceProfiler, E as EscalationClipArtifact, s as EscalationHook, F as FaceGateV3, G as GateChecks, K as KEYFRAME_CANDIDATES, t as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, u as MIME_CANDIDATES, S as STOP_GRACE_MS, T as TIMESLICE_MS, V as V3ChecksPayload, v as V3GateFactor, w as V3GateQuality, x as V3GateThresholds, y as V3GateTick, z as V3GateTickInput, A as V3TelemetryEvent, B as V3_GATE_DEFAULTS, H as VIDEO_BPS, I as buildLivenessV2FormData, J as cameraPreflight, L as classifyDevice, N as extForMime, O as isClipTooLarge, P as isMediaRecorderSupported, Q as mapGetUserMediaError, R as pickMimeType, U as probeDevice } from '../capture-session-v3-uXJr1Wlm.js';
1
+ import { C as CameraErrorKind } from '../capture-session-v3-Okq0EQHG.js';
2
+ export { a as CLIP_MS, b as CaptureArtifacts, c as CaptureErrorKind, d as CaptureSessionEvents, e as CaptureSessionV3, f as CaptureSessionV3Events, g as CaptureSessionV3Options, h as CaptureSessionV3StartOptions, i as CaptureState, j as CaptureTiming, k as ClipError, l as ClipErrorKind, m as ClipRecorder, n as ClipResult, D as DEFAULT_CLIP_MIME, o as DEVICE_PROFILES, p as DeviceClass, q as DeviceProbe, r as DeviceProfile, s as DeviceProfiler, E as EscalationClipArtifact, t as EscalationHook, F as FaceGateV3, G as GateChecks, K as KEYFRAME_CANDIDATES, u as KEYFRAME_WINDOW_MS, M as MAX_CLIP_BYTES, v as MIME_CANDIDATES, S as STOP_GRACE_MS, T as TIMESLICE_MS, V as V3ChecksPayload, w as V3GateFactor, x as V3GateQuality, y as V3GateThresholds, z as V3GateTick, A as V3GateTickInput, B as V3TelemetryEvent, H as V3_GATE_DEFAULTS, I as VIDEO_BPS, J as buildLivenessV2FormData, L as cameraPreflight, N as classifyDevice, O as extForMime, P as isClipTooLarge, Q as isMediaRecorderSupported, R as mapGetUserMediaError, U as pickMimeType, W as probeDevice } from '../capture-session-v3-Okq0EQHG.js';
3
3
  export { C as CENTERED_FACTOR, a as CIRCLE_RADIUS_FACTOR, I as IN_CIRCLE_FACTOR, b as buildCaptureConstraints, d as detectIsMobile } from '../capture-constraints-BujkZcfb.js';
4
4
  export { C as CreateDetectorOptions, D as DEFAULT_TIER_ORDER, a as DEFAULT_V3_ASSET_BASE_URL, b as Detector, c as DetectorLadderError, F as FaceObservation, d as createDetector, i as intrinsicSize, t as toStreamPixels } from '../detect-worker-CKXHlXx9.js';
5
5
 
@@ -31,7 +31,7 @@ import {
31
31
  mapGetUserMediaError,
32
32
  pickMimeType,
33
33
  probeDevice
34
- } from "../chunk-EWRNPKTR.js";
34
+ } from "../chunk-TG5IE552.js";
35
35
  import {
36
36
  DEFAULT_TIER_ORDER,
37
37
  DEFAULT_V3_ASSET_BASE_URL,
@@ -1,4 +1,5 @@
1
- import { h as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1 } from './capture-session-v3-DEInCOUg.cjs';
1
+ import { b as Detector } from './detect-worker-CKXHlXx9.cjs';
2
+ import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1 } from './capture-session-v3-UQU_WjO2.cjs';
2
3
  import { C as CheckReason, c as HostedSessionView, g as HostedClient, A as AttestationInput, h as SessionView, b as CheckType } from './hosted-client-DWzCRYJK.cjs';
3
4
 
4
5
  /** Gate guidance code. `'hold'` is emitted while the clip records. */
@@ -110,14 +111,28 @@ interface LivenessCaptureEvents {
110
111
  animations: "full" | "reduced";
111
112
  };
112
113
  }
114
+ /** Which camera to open: the selfie camera (`'user'`) or the rear one (`'environment'`). */
115
+ type CameraFacing = "user" | "environment";
116
+ /** Options of {@link LivenessCaptureHandle.start}. */
117
+ interface LivenessStartOptions {
118
+ /**
119
+ * Camera for this attempt and its retries; default: the current one
120
+ * ({@link LivenessCaptureOptions.facing}, else `'user'`). Use `switchCamera()`
121
+ * to change camera mid-capture.
122
+ */
123
+ facing?: CameraFacing;
124
+ }
113
125
  /** Live capture handle returned by {@link createLivenessCapture} / {@link Verification.liveness}. */
114
126
  interface LivenessCaptureHandle {
115
127
  /** Current {@link CaptureState}. */
116
128
  readonly state: CaptureState;
117
129
  /** Subscribe; returns the unsubscribe function. */
118
130
  on<K extends keyof LivenessCaptureEvents>(event: K, handler: (payload: LivenessCaptureEvents[K]) => void): () => void;
119
- /** Ask for the camera and start gating. Resolves once the attempt is running or failed. */
120
- start(): Promise<void>;
131
+ /**
132
+ * Ask for the camera and start gating. Resolves once the attempt is running or failed.
133
+ * `options.facing` picks the camera for this attempt and later retries.
134
+ */
135
+ start(options?: LivenessStartOptions): Promise<void>;
121
136
  /** Fresh attempt: resets the engine and restarts the camera. */
122
137
  retry(): void;
123
138
  /** Toggle user/environment camera (gate restarts from zero). */
@@ -129,10 +144,18 @@ interface LivenessCaptureHandle {
129
144
  interface LivenessCaptureOptions {
130
145
  /** Host-owned `<video playsInline muted>` element. */
131
146
  video: HTMLVideoElement;
132
- /** Initial camera; default `'user'`. */
133
- facing?: "user" | "environment";
147
+ /** Initial camera; default `'user'`. `start({ facing })` overrides it. */
148
+ facing?: CameraFacing;
134
149
  /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
135
150
  assetBaseUrl?: string;
151
+ /**
152
+ * Hold a Screen Wake Lock while the camera is live (`starting` / `gating` /
153
+ * `recording`) so the phone does not dim or lock mid-capture; re-taken when
154
+ * the page becomes visible again. Best-effort: unsupported browsers or a
155
+ * refused request (e.g. an iframe without `allow="screen-wake-lock"`) never
156
+ * affect the capture. Default `true`; `false` never requests the lock.
157
+ */
158
+ keepScreenAwake?: boolean;
136
159
  }
137
160
  /**
138
161
  * SDK-side failure reasons (status `'unavailable'`):
@@ -218,7 +241,10 @@ interface Verification {
218
241
  interface CaptureEngine {
219
242
  readonly state: CaptureState$1;
220
243
  on<K extends keyof CaptureSessionV3Events>(event: K, handler: (payload: CaptureSessionV3Events[K]) => void): () => void;
221
- start(): Promise<void>;
244
+ /** `facingMode` sets the camera for this attempt and later retries. */
245
+ start(options?: {
246
+ facingMode?: "user" | "environment";
247
+ }): Promise<void>;
222
248
  retry(): void;
223
249
  switchCamera(): void;
224
250
  destroy(): void;
@@ -253,6 +279,57 @@ declare function createLivenessCaptureInternal(options: LivenessCaptureOptions,
253
279
  */
254
280
  declare function createLivenessCapture(options: LivenessCaptureOptions): LivenessCaptureHandle;
255
281
 
282
+ /** Preload state per asset base URL. */
283
+ type LivenessAssetsStatus = "idle" | "loading" | "ready" | "failed";
284
+ /** Options of {@link preloadLivenessAssets}. */
285
+ interface PreloadLivenessAssetsOptions {
286
+ /** Same value as the capture's `assetBaseUrl`; default `/models-v3`. */
287
+ assetBaseUrl?: string;
288
+ /** Defer the load to browser idle time (`requestIdleCallback`, 1.2 s timeout fallback). Default `false`. */
289
+ idle?: boolean;
290
+ /** Skip when the browser asks to save data (`navigator.connection.saveData`). Default `false`. */
291
+ respectSaveData?: boolean;
292
+ }
293
+ /** Blaze init deadline for the preload — generous: a slow ~11 MB wasm download must finish. */
294
+ declare const PRELOAD_BLAZE_INIT_TIMEOUT_MS = 120000;
295
+ /** Outer budget reclaiming only a genuinely hung load (≥ the init deadline + slack). */
296
+ declare const PRELOAD_BUDGET_MS = 130000;
297
+ type Loader = (base: string) => Promise<Detector>;
298
+ /** @internal Test seam: replace the detector loader (null restores the real one). */
299
+ declare function setPreloadLoaderForTests(next: Loader | null): void;
300
+ /** @internal Test seam: drop every entry (destroying warmed detectors). */
301
+ declare function resetLivenessAssetsForTests(): void;
302
+ /**
303
+ * Warm the face detector for `assetBaseUrl` so the capture starts instantly.
304
+ * Idempotent per base URL and never rejects: resolves the settled status.
305
+ * `'idle'` means nothing was preloaded here (SSR, no camera API, Data-Saver
306
+ * skip) — start normally. Calling again after `'failed'` retries the load.
307
+ * With `idle: true` the load is deferred (status stays `'idle'` until it
308
+ * starts); a later non-idle call — or a capture mounting meanwhile — starts it
309
+ * at once, and {@link releaseLivenessAssets} cancels it.
310
+ */
311
+ declare function preloadLivenessAssets(options?: PreloadLivenessAssetsOptions): Promise<LivenessAssetsStatus>;
312
+ /** Current preload status for `assetBaseUrl` (default `/models-v3`). */
313
+ declare function getLivenessAssetsStatus(assetBaseUrl?: string): LivenessAssetsStatus;
314
+ /**
315
+ * Subscribe to status changes for `assetBaseUrl`; returns the unsubscribe
316
+ * function. Does NOT emit the current status on subscribe (read it with
317
+ * {@link getLivenessAssetsStatus}) — the
318
+ * `useSyncExternalStore(subscribe, getSnapshot)` contract, so it plugs into
319
+ * that hook directly.
320
+ */
321
+ declare function subscribeLivenessAssets(listener: (status: LivenessAssetsStatus) => void, assetBaseUrl?: string): () => void;
322
+ /** Free the warmed detector (an SPA leaving the flow). Never call while a capture is mounted. */
323
+ declare function releaseLivenessAssets(assetBaseUrl?: string): void;
324
+ /**
325
+ * @internal The capture engine's detector source when a preload exists for
326
+ * `assetBaseUrl`: a non-owning view of the warm instance (waiting for an
327
+ * in-flight load), or — once that load failed — a cold detector OWNED by the
328
+ * session (default ladder + deadline). `undefined` when nothing was preloaded.
329
+ * Invoking it on an idle-scheduled preload starts that load now and joins it.
330
+ */
331
+ declare function preloadedDetectorFactory(assetBaseUrl?: string): (() => Promise<Detector>) | undefined;
332
+
256
333
  /** The client surface the flow needs — `HostedClient` or a test fake. */
257
334
  type HostedClientLike = Pick<HostedClient, "getSession" | "recordConsent" | "presign" | "uploadToSpaces" | "completeMedia" | "submitCheck">;
258
335
  /** The presign policy allowlist for `kind: 'clip'` (media.policy.ts mirror). */
@@ -368,4 +445,4 @@ declare function createVerification(options: VerificationOptions): Verification;
368
445
  /** {@link createVerification} with construction seams (tests / Sekyro-internal hosts). */
369
446
  declare function createVerificationInternal(options: VerificationOptions, internals: VerificationInternals): Verification;
370
447
 
371
- export { AttestationError as A, type VerificationInternals as B, type CaptureChannel as C, DEFAULT_API_ORIGIN as D, createLivenessCaptureInternal as E, createVerificationInternal as F, type GateHint as G, type HostedClientLike as H, mapEngineState as I, mapErrorKind as J, mapGuidanceHint as K, type LivenessCaptureEvents as L, randomUuid as M, runLivenessFlow as N, runSubmission as O, PROCESSING_POLL_DELAY_MS as P, type ReasonCode as R, type SdkFailureReason as S, TRANSPORT_REPLAY_ATTEMPTS as T, type Verification as V, type CaptureEngineId as a, type CaptureError as b, type CaptureErrorKind as c, type CaptureState as d, type CapturedArtifacts as e, type GateUpdate as f, type LivenessCaptureHandle as g, type LivenessCaptureOptions as h, type VerificationEvents as i, type VerificationLocale as j, type VerificationOptions as k, type VerificationResult as l, type VerificationStatus as m, createLivenessCapture as n, createVerification as o, CLIP_MIME_ALLOWLIST as p, type CaptureEngine as q, type LivenessCaptureInternalHandle as r, type LivenessCaptureInternals as s, type LivenessFlowDeps as t, type LivenessFlowOutcome as u, PROCESSING_POLL_MAX as v, REGISTRY_RETRY_DELAY_MS as w, type SubmitExecutor as x, type SubmitRuntime as y, TRANSPORT_REPLAY_DELAY_MS as z };
448
+ export { preloadedDetectorFactory as $, AttestationError as A, type LivenessFlowDeps as B, type CameraFacing as C, DEFAULT_API_ORIGIN as D, type LivenessFlowOutcome as E, PRELOAD_BLAZE_INIT_TIMEOUT_MS as F, type GateHint as G, type HostedClientLike as H, PRELOAD_BUDGET_MS as I, PROCESSING_POLL_DELAY_MS as J, PROCESSING_POLL_MAX as K, type LivenessAssetsStatus as L, REGISTRY_RETRY_DELAY_MS as M, type SubmitExecutor as N, type SubmitRuntime as O, type PreloadLivenessAssetsOptions as P, TRANSPORT_REPLAY_DELAY_MS as Q, type ReasonCode as R, type SdkFailureReason as S, TRANSPORT_REPLAY_ATTEMPTS as T, type VerificationInternals as U, type Verification as V, createLivenessCaptureInternal as W, createVerificationInternal as X, mapEngineState as Y, mapErrorKind as Z, mapGuidanceHint as _, type CaptureChannel as a, randomUuid as a0, resetLivenessAssetsForTests as a1, runLivenessFlow as a2, runSubmission as a3, setPreloadLoaderForTests as a4, type CaptureEngineId as b, type CaptureError as c, type CaptureErrorKind as d, type CaptureState as e, type CapturedArtifacts as f, type GateUpdate as g, type LivenessCaptureEvents as h, type LivenessCaptureHandle as i, type LivenessCaptureOptions as j, type LivenessStartOptions as k, type VerificationEvents as l, type VerificationLocale as m, type VerificationOptions as n, type VerificationResult as o, type VerificationStatus as p, createLivenessCapture as q, createVerification as r, getLivenessAssetsStatus as s, preloadLivenessAssets as t, releaseLivenessAssets as u, subscribeLivenessAssets as v, CLIP_MIME_ALLOWLIST as w, type CaptureEngine as x, type LivenessCaptureInternalHandle as y, type LivenessCaptureInternals as z };
@@ -1,4 +1,5 @@
1
- import { h as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1 } from './capture-session-v3-uXJr1Wlm.js';
1
+ import { b as Detector } from './detect-worker-CKXHlXx9.js';
2
+ import { i as CaptureState$1, f as CaptureSessionV3Events, g as CaptureSessionV3Options, c as CaptureErrorKind$1 } from './capture-session-v3-Okq0EQHG.js';
2
3
  import { C as CheckReason, c as HostedSessionView, g as HostedClient, A as AttestationInput, h as SessionView, b as CheckType } from './hosted-client-DWzCRYJK.js';
3
4
 
4
5
  /** Gate guidance code. `'hold'` is emitted while the clip records. */
@@ -110,14 +111,28 @@ interface LivenessCaptureEvents {
110
111
  animations: "full" | "reduced";
111
112
  };
112
113
  }
114
+ /** Which camera to open: the selfie camera (`'user'`) or the rear one (`'environment'`). */
115
+ type CameraFacing = "user" | "environment";
116
+ /** Options of {@link LivenessCaptureHandle.start}. */
117
+ interface LivenessStartOptions {
118
+ /**
119
+ * Camera for this attempt and its retries; default: the current one
120
+ * ({@link LivenessCaptureOptions.facing}, else `'user'`). Use `switchCamera()`
121
+ * to change camera mid-capture.
122
+ */
123
+ facing?: CameraFacing;
124
+ }
113
125
  /** Live capture handle returned by {@link createLivenessCapture} / {@link Verification.liveness}. */
114
126
  interface LivenessCaptureHandle {
115
127
  /** Current {@link CaptureState}. */
116
128
  readonly state: CaptureState;
117
129
  /** Subscribe; returns the unsubscribe function. */
118
130
  on<K extends keyof LivenessCaptureEvents>(event: K, handler: (payload: LivenessCaptureEvents[K]) => void): () => void;
119
- /** Ask for the camera and start gating. Resolves once the attempt is running or failed. */
120
- start(): Promise<void>;
131
+ /**
132
+ * Ask for the camera and start gating. Resolves once the attempt is running or failed.
133
+ * `options.facing` picks the camera for this attempt and later retries.
134
+ */
135
+ start(options?: LivenessStartOptions): Promise<void>;
121
136
  /** Fresh attempt: resets the engine and restarts the camera. */
122
137
  retry(): void;
123
138
  /** Toggle user/environment camera (gate restarts from zero). */
@@ -129,10 +144,18 @@ interface LivenessCaptureHandle {
129
144
  interface LivenessCaptureOptions {
130
145
  /** Host-owned `<video playsInline muted>` element. */
131
146
  video: HTMLVideoElement;
132
- /** Initial camera; default `'user'`. */
133
- facing?: "user" | "environment";
147
+ /** Initial camera; default `'user'`. `start({ facing })` overrides it. */
148
+ facing?: CameraFacing;
134
149
  /** Base URL of the detector assets (tasks-vision wasm + tflite); default `/models-v3`. */
135
150
  assetBaseUrl?: string;
151
+ /**
152
+ * Hold a Screen Wake Lock while the camera is live (`starting` / `gating` /
153
+ * `recording`) so the phone does not dim or lock mid-capture; re-taken when
154
+ * the page becomes visible again. Best-effort: unsupported browsers or a
155
+ * refused request (e.g. an iframe without `allow="screen-wake-lock"`) never
156
+ * affect the capture. Default `true`; `false` never requests the lock.
157
+ */
158
+ keepScreenAwake?: boolean;
136
159
  }
137
160
  /**
138
161
  * SDK-side failure reasons (status `'unavailable'`):
@@ -218,7 +241,10 @@ interface Verification {
218
241
  interface CaptureEngine {
219
242
  readonly state: CaptureState$1;
220
243
  on<K extends keyof CaptureSessionV3Events>(event: K, handler: (payload: CaptureSessionV3Events[K]) => void): () => void;
221
- start(): Promise<void>;
244
+ /** `facingMode` sets the camera for this attempt and later retries. */
245
+ start(options?: {
246
+ facingMode?: "user" | "environment";
247
+ }): Promise<void>;
222
248
  retry(): void;
223
249
  switchCamera(): void;
224
250
  destroy(): void;
@@ -253,6 +279,57 @@ declare function createLivenessCaptureInternal(options: LivenessCaptureOptions,
253
279
  */
254
280
  declare function createLivenessCapture(options: LivenessCaptureOptions): LivenessCaptureHandle;
255
281
 
282
+ /** Preload state per asset base URL. */
283
+ type LivenessAssetsStatus = "idle" | "loading" | "ready" | "failed";
284
+ /** Options of {@link preloadLivenessAssets}. */
285
+ interface PreloadLivenessAssetsOptions {
286
+ /** Same value as the capture's `assetBaseUrl`; default `/models-v3`. */
287
+ assetBaseUrl?: string;
288
+ /** Defer the load to browser idle time (`requestIdleCallback`, 1.2 s timeout fallback). Default `false`. */
289
+ idle?: boolean;
290
+ /** Skip when the browser asks to save data (`navigator.connection.saveData`). Default `false`. */
291
+ respectSaveData?: boolean;
292
+ }
293
+ /** Blaze init deadline for the preload — generous: a slow ~11 MB wasm download must finish. */
294
+ declare const PRELOAD_BLAZE_INIT_TIMEOUT_MS = 120000;
295
+ /** Outer budget reclaiming only a genuinely hung load (≥ the init deadline + slack). */
296
+ declare const PRELOAD_BUDGET_MS = 130000;
297
+ type Loader = (base: string) => Promise<Detector>;
298
+ /** @internal Test seam: replace the detector loader (null restores the real one). */
299
+ declare function setPreloadLoaderForTests(next: Loader | null): void;
300
+ /** @internal Test seam: drop every entry (destroying warmed detectors). */
301
+ declare function resetLivenessAssetsForTests(): void;
302
+ /**
303
+ * Warm the face detector for `assetBaseUrl` so the capture starts instantly.
304
+ * Idempotent per base URL and never rejects: resolves the settled status.
305
+ * `'idle'` means nothing was preloaded here (SSR, no camera API, Data-Saver
306
+ * skip) — start normally. Calling again after `'failed'` retries the load.
307
+ * With `idle: true` the load is deferred (status stays `'idle'` until it
308
+ * starts); a later non-idle call — or a capture mounting meanwhile — starts it
309
+ * at once, and {@link releaseLivenessAssets} cancels it.
310
+ */
311
+ declare function preloadLivenessAssets(options?: PreloadLivenessAssetsOptions): Promise<LivenessAssetsStatus>;
312
+ /** Current preload status for `assetBaseUrl` (default `/models-v3`). */
313
+ declare function getLivenessAssetsStatus(assetBaseUrl?: string): LivenessAssetsStatus;
314
+ /**
315
+ * Subscribe to status changes for `assetBaseUrl`; returns the unsubscribe
316
+ * function. Does NOT emit the current status on subscribe (read it with
317
+ * {@link getLivenessAssetsStatus}) — the
318
+ * `useSyncExternalStore(subscribe, getSnapshot)` contract, so it plugs into
319
+ * that hook directly.
320
+ */
321
+ declare function subscribeLivenessAssets(listener: (status: LivenessAssetsStatus) => void, assetBaseUrl?: string): () => void;
322
+ /** Free the warmed detector (an SPA leaving the flow). Never call while a capture is mounted. */
323
+ declare function releaseLivenessAssets(assetBaseUrl?: string): void;
324
+ /**
325
+ * @internal The capture engine's detector source when a preload exists for
326
+ * `assetBaseUrl`: a non-owning view of the warm instance (waiting for an
327
+ * in-flight load), or — once that load failed — a cold detector OWNED by the
328
+ * session (default ladder + deadline). `undefined` when nothing was preloaded.
329
+ * Invoking it on an idle-scheduled preload starts that load now and joins it.
330
+ */
331
+ declare function preloadedDetectorFactory(assetBaseUrl?: string): (() => Promise<Detector>) | undefined;
332
+
256
333
  /** The client surface the flow needs — `HostedClient` or a test fake. */
257
334
  type HostedClientLike = Pick<HostedClient, "getSession" | "recordConsent" | "presign" | "uploadToSpaces" | "completeMedia" | "submitCheck">;
258
335
  /** The presign policy allowlist for `kind: 'clip'` (media.policy.ts mirror). */
@@ -368,4 +445,4 @@ declare function createVerification(options: VerificationOptions): Verification;
368
445
  /** {@link createVerification} with construction seams (tests / Sekyro-internal hosts). */
369
446
  declare function createVerificationInternal(options: VerificationOptions, internals: VerificationInternals): Verification;
370
447
 
371
- export { AttestationError as A, type VerificationInternals as B, type CaptureChannel as C, DEFAULT_API_ORIGIN as D, createLivenessCaptureInternal as E, createVerificationInternal as F, type GateHint as G, type HostedClientLike as H, mapEngineState as I, mapErrorKind as J, mapGuidanceHint as K, type LivenessCaptureEvents as L, randomUuid as M, runLivenessFlow as N, runSubmission as O, PROCESSING_POLL_DELAY_MS as P, type ReasonCode as R, type SdkFailureReason as S, TRANSPORT_REPLAY_ATTEMPTS as T, type Verification as V, type CaptureEngineId as a, type CaptureError as b, type CaptureErrorKind as c, type CaptureState as d, type CapturedArtifacts as e, type GateUpdate as f, type LivenessCaptureHandle as g, type LivenessCaptureOptions as h, type VerificationEvents as i, type VerificationLocale as j, type VerificationOptions as k, type VerificationResult as l, type VerificationStatus as m, createLivenessCapture as n, createVerification as o, CLIP_MIME_ALLOWLIST as p, type CaptureEngine as q, type LivenessCaptureInternalHandle as r, type LivenessCaptureInternals as s, type LivenessFlowDeps as t, type LivenessFlowOutcome as u, PROCESSING_POLL_MAX as v, REGISTRY_RETRY_DELAY_MS as w, type SubmitExecutor as x, type SubmitRuntime as y, TRANSPORT_REPLAY_DELAY_MS as z };
448
+ export { preloadedDetectorFactory as $, AttestationError as A, type LivenessFlowDeps as B, type CameraFacing as C, DEFAULT_API_ORIGIN as D, type LivenessFlowOutcome as E, PRELOAD_BLAZE_INIT_TIMEOUT_MS as F, type GateHint as G, type HostedClientLike as H, PRELOAD_BUDGET_MS as I, PROCESSING_POLL_DELAY_MS as J, PROCESSING_POLL_MAX as K, type LivenessAssetsStatus as L, REGISTRY_RETRY_DELAY_MS as M, type SubmitExecutor as N, type SubmitRuntime as O, type PreloadLivenessAssetsOptions as P, TRANSPORT_REPLAY_DELAY_MS as Q, type ReasonCode as R, type SdkFailureReason as S, TRANSPORT_REPLAY_ATTEMPTS as T, type VerificationInternals as U, type Verification as V, createLivenessCaptureInternal as W, createVerificationInternal as X, mapEngineState as Y, mapErrorKind as Z, mapGuidanceHint as _, type CaptureChannel as a, randomUuid as a0, resetLivenessAssetsForTests as a1, runLivenessFlow as a2, runSubmission as a3, setPreloadLoaderForTests as a4, type CaptureEngineId as b, type CaptureError as c, type CaptureErrorKind as d, type CaptureState as e, type CapturedArtifacts as f, type GateUpdate as g, type LivenessCaptureEvents as h, type LivenessCaptureHandle as i, type LivenessCaptureOptions as j, type LivenessStartOptions as k, type VerificationEvents as l, type VerificationLocale as m, type VerificationOptions as n, type VerificationResult as o, type VerificationStatus as p, createLivenessCapture as q, createVerification as r, getLivenessAssetsStatus as s, preloadLivenessAssets as t, releaseLivenessAssets as u, subscribeLivenessAssets as v, CLIP_MIME_ALLOWLIST as w, type CaptureEngine as x, type LivenessCaptureInternalHandle as y, type LivenessCaptureInternals as z };