@sekyro/web 0.1.0-rc.2 → 0.1.0-rc.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +300 -0
- package/LICENSE +25 -16
- package/README.md +111 -60
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/background-monitor-A7FKJOAG.js +1 -0
- package/dist/camera-trait-45MJTW4K.js +1 -0
- package/dist/capture-constraints-B5omafmk.d.cts +44 -0
- package/dist/capture-constraints-B5omafmk.d.ts +44 -0
- package/dist/capture-session-doc-QA4DOFRF.js +1 -0
- package/dist/{capture-session-v3-CAoWM8iT.d.cts → capture-session-v3-CNL-GX11.d.cts} +185 -15
- package/dist/{capture-session-v3-BJ8ciaWl.d.ts → capture-session-v3-DaBqN8fO.d.ts} +185 -15
- package/dist/chunk-5ZKQHFFW.js +1 -0
- package/dist/chunk-7ZCZY3ZP.js +1 -0
- package/dist/chunk-A3FUGHAH.js +2 -0
- package/dist/chunk-BPE5NSQ2.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-CQ7SKLMC.js +1 -0
- package/dist/chunk-DFTCAWMP.js +1 -0
- package/dist/chunk-DK5YPBDQ.js +1 -0
- package/dist/chunk-FGOVIGGL.js +1 -0
- package/dist/chunk-FPXL63KZ.js +1 -0
- package/dist/chunk-FUHDOEBP.js +1 -0
- package/dist/chunk-G6LKLN4U.js +1 -0
- package/dist/chunk-GI3UFGRQ.js +1 -0
- package/dist/chunk-GT2ZLGF7.js +1 -0
- package/dist/chunk-IG466TOP.js +1 -0
- package/dist/chunk-KHR4U2SZ.js +1 -0
- package/dist/chunk-KZBBB5B2.js +1 -0
- package/dist/chunk-MXWLCDFX.js +1 -0
- package/dist/chunk-NJML6FMD.js +1 -0
- package/dist/chunk-O5WKNZ2C.js +1 -0
- package/dist/chunk-OKWG3PVH.js +1 -0
- package/dist/chunk-POIQGEZM.js +1 -0
- package/dist/chunk-RI3E7GBN.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-TDLIXFDT.js +1 -0
- package/dist/chunk-TQB3URP2.js +1 -0
- package/dist/chunk-U6S7SCBY.js +1 -0
- package/dist/chunk-U6TYL2IJ.js +1 -0
- package/dist/chunk-W2WD7PR2.js +1 -0
- package/dist/chunk-XCKE2MJL.js +1 -0
- package/dist/chunk-ZLWH4RBO.js +1 -0
- package/dist/client/index.cjs +1 -357
- package/dist/client/index.d.cts +6 -37
- package/dist/client/index.d.ts +6 -37
- package/dist/client/index.js +1 -15
- package/dist/core/index.cjs +1 -1605
- package/dist/core/index.d.cts +5 -4
- package/dist/core/index.d.ts +5 -4
- package/dist/core/index.js +1 -139
- package/dist/core/ocr/worker.bundle.js +42 -0
- package/dist/core/ocr/worker.cjs +42 -0
- package/dist/core/ocr/worker.d.cts +84 -0
- package/dist/core/ocr/worker.d.ts +84 -0
- package/dist/core/ocr/worker.js +41 -0
- package/dist/core/v3/detect-worker.cjs +1 -392
- package/dist/core/v3/detect-worker.d.cts +1 -1
- package/dist/core/v3/detect-worker.d.ts +1 -1
- package/dist/core/v3/detect-worker.js +1 -13
- package/dist/create-document-capture-GJXBQMTC.js +1 -0
- package/dist/create-portrait-capture-MOS2D7CL.js +1 -0
- package/dist/create-verification-BBOUYpga.d.cts +3274 -0
- package/dist/create-verification-COpe2hxf.d.ts +3274 -0
- package/dist/{detect-worker-CKXHlXx9.d.cts → detect-worker-DclNxkZT.d.cts} +6 -0
- package/dist/{detect-worker-CKXHlXx9.d.ts → detect-worker-DclNxkZT.d.ts} +6 -0
- package/dist/detector-scanic-YCDNLCGV.js +1 -0
- package/dist/icao-gate-CEGvJR3q.d.ts +534 -0
- package/dist/icao-gate-PWBMKRGC.js +1 -0
- package/dist/icao-gate-l40OU6x1.d.cts +534 -0
- package/dist/icao-policy-BgI1Y870.d.ts +71 -0
- package/dist/icao-policy-C7fIdRzo.d.cts +71 -0
- package/dist/icao-tuning-4GGVX6B4.js +1 -0
- package/dist/index.cjs +1 -2636
- package/dist/index.d.cts +110 -5
- package/dist/index.d.ts +110 -5
- package/dist/index.js +1 -28
- package/dist/internal/index.cjs +1 -4166
- package/dist/internal/index.d.cts +365 -324
- package/dist/internal/index.d.ts +365 -324
- package/dist/internal/index.js +1 -647
- package/dist/keyframe-rank-YAJLYJYF.js +1 -0
- package/dist/landmarker-KB7LVXAU.js +1 -0
- package/dist/mrz-band-VYHOTDHY.js +1 -0
- package/dist/plan-runner-35655N4Z.js +1 -0
- package/dist/popup/index.cjs +1 -76
- package/dist/popup/index.d.cts +7 -1
- package/dist/popup/index.d.ts +7 -1
- package/dist/popup/index.js +1 -11
- package/dist/print-AYSCRSZB.js +1 -0
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/turnstile-FATNZ4AG.js +1 -0
- package/dist/types-Dpfg2cO8.d.cts +1699 -0
- package/dist/types-Dpfg2cO8.d.ts +1699 -0
- package/dist/upload-file-UYXOHCRG.js +1 -0
- package/package.json +27 -11
- package/sbom.cdx.json +234 -0
- package/dist/capture-constraints-BujkZcfb.d.cts +0 -21
- package/dist/capture-constraints-BujkZcfb.d.ts +0 -21
- package/dist/chunk-BPYVZUJA.js +0 -852
- package/dist/chunk-BPYVZUJA.js.map +0 -1
- package/dist/chunk-LOTAJDRE.js +0 -1094
- package/dist/chunk-LOTAJDRE.js.map +0 -1
- package/dist/chunk-MWNFSNMP.js +0 -52
- package/dist/chunk-MWNFSNMP.js.map +0 -1
- package/dist/chunk-NILNKLK6.js +0 -50
- package/dist/chunk-NILNKLK6.js.map +0 -1
- package/dist/chunk-NWF46H7K.js +0 -359
- package/dist/chunk-NWF46H7K.js.map +0 -1
- package/dist/chunk-WY6U7AIK.js +0 -193
- package/dist/chunk-WY6U7AIK.js.map +0 -1
- package/dist/chunk-YVFF4Q4G.js +0 -327
- package/dist/chunk-YVFF4Q4G.js.map +0 -1
- package/dist/client/index.cjs.map +0 -1
- package/dist/client/index.js.map +0 -1
- package/dist/core/index.cjs.map +0 -1
- package/dist/core/index.js.map +0 -1
- package/dist/core/v3/detect-worker.cjs.map +0 -1
- package/dist/core/v3/detect-worker.js.map +0 -1
- package/dist/create-verification-CjLnJ0w6.d.ts +0 -348
- package/dist/create-verification-EnZ13uY4.d.cts +0 -348
- package/dist/detector-scanic-4C6IEW2K.js +0 -787
- package/dist/detector-scanic-4C6IEW2K.js.map +0 -1
- package/dist/hosted-client-BpvBqu9f.d.cts +0 -408
- package/dist/hosted-client-BpvBqu9f.d.ts +0 -408
- package/dist/index.cjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/internal/index.cjs.map +0 -1
- package/dist/internal/index.js.map +0 -1
- package/dist/popup/index.cjs.map +0 -1
- package/dist/popup/index.js.map +0 -1
- package/dist/scanic-ml-stub-S2OZ6HEF.js +0 -10
- package/dist/scanic-ml-stub-S2OZ6HEF.js.map +0 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aS as ScreenRampReport, aK as CaptureProvenance, aQ as ScreenRampChallenge, aG as ScreenRampColour } from './types-Dpfg2cO8.cjs';
|
|
2
|
+
import { F as FaceObservation, b as Detector, W as WorkerLike } from './detect-worker-DclNxkZT.cjs';
|
|
2
3
|
|
|
3
4
|
/** MP4-first ladder: one container (H.264 MP4) covers iOS/macOS Safari + Chrome 130+.
|
|
4
5
|
* WebM/VP9→VP8 only as the Firefox/older-Chromium fallback. */
|
|
@@ -67,8 +68,14 @@ declare class ClipRecorder {
|
|
|
67
68
|
* instead of waiting for the blob. PURE NOTIFICATION — it does not touch
|
|
68
69
|
* timers, chunks, or the finalize path, so it is calibration-neutral (no
|
|
69
70
|
* effect on clip bytes). Never fires on a rejected capture (error /
|
|
70
|
-
* cliptoolarge settle before the hard-stop and clear the timer).
|
|
71
|
-
|
|
71
|
+
* cliptoolarge settle before the hard-stop and clear the timer).
|
|
72
|
+
*
|
|
73
|
+
* `onStarted` (optional, liveness v7 §4.4) fires ONCE on the recorder's
|
|
74
|
+
* `start` event: the zero of the clip's own timeline, which the screen ramp
|
|
75
|
+
* stamps its colour changes against. PURE NOTIFICATION as well (the
|
|
76
|
+
* `onstart` handler was unset before; nothing else changes), so it is
|
|
77
|
+
* calibration-neutral. Never fires when construction or `start()` failed. */
|
|
78
|
+
record(stream: MediaStream, onStopped?: () => void, onStarted?: () => void): Promise<ClipResult>;
|
|
72
79
|
/** Idempotent teardown: stop recorder + ALL tracks (v1 `stopAndCleanup` + the unmount
|
|
73
80
|
* effect). Optional `stream` override mirrors v1's `stopAndCleanup(stream?)`.
|
|
74
81
|
*
|
|
@@ -105,16 +112,39 @@ interface GateChecks {
|
|
|
105
112
|
goodQuality: boolean;
|
|
106
113
|
stable: boolean;
|
|
107
114
|
}
|
|
115
|
+
/**
|
|
116
|
+
* Client-side capture timing (face-capture duration, 2026-10-17), measured
|
|
117
|
+
* by the engine with its monotonic clock (`performance.now()` by default) and
|
|
118
|
+
* rounded to whole milliseconds. All fields are optional: a phase that never
|
|
119
|
+
* happened (e.g. no face ever detected before a retry) is simply absent.
|
|
120
|
+
*/
|
|
121
|
+
interface CaptureTiming {
|
|
122
|
+
/** `getUserMedia` call → stream attached and the preview playing. */
|
|
123
|
+
cameraReadyMs?: number;
|
|
124
|
+
/** Camera ready → the first tick on which the GATE accepted the face
|
|
125
|
+
* (present + size / centering / quality good enough to make progress —
|
|
126
|
+
* not merely detected). */
|
|
127
|
+
faceAcquireMs?: number;
|
|
128
|
+
/** FIRST accepted face → gate progress 100 % (capture complete, BEFORE the
|
|
129
|
+
* clip window / upload). A face lost and re-acquired keeps the first start. */
|
|
130
|
+
captureMs?: number;
|
|
131
|
+
}
|
|
108
132
|
/** Capture output. Upload is NOT the engine's job — hosts submit these themselves. */
|
|
109
133
|
interface CaptureArtifacts {
|
|
110
134
|
/** Absent in photo mode. */
|
|
111
135
|
clip?: Blob;
|
|
112
136
|
/** Container mime the clip finalized with. Absent in photo mode. */
|
|
113
137
|
clipMimeType?: string;
|
|
114
|
-
/**
|
|
138
|
+
/** JPEG keyframe (captureMirroredKeyframe): mirrored on the front camera, as the sensor sees it on the back one. */
|
|
115
139
|
keyframe: Blob;
|
|
116
140
|
/** JPEG data URL of the keyframe canvas (v1 preview, quality 0.92). */
|
|
117
141
|
previewDataUrl: string;
|
|
142
|
+
/** Capture-phase timing of the attempt that produced these artifacts. */
|
|
143
|
+
timing?: CaptureTiming;
|
|
144
|
+
/** Liveness v7 §4.4: the screen ramp rendered against the session's issued challenge (clip mode, a challenge issued, a host painting). */
|
|
145
|
+
screenRamp?: ScreenRampReport;
|
|
146
|
+
/** Liveness v7 §4.5 item 2: how the capture was made (whenever the engine had a camera track). */
|
|
147
|
+
provenance?: CaptureProvenance;
|
|
118
148
|
}
|
|
119
149
|
interface CaptureSessionEvents {
|
|
120
150
|
statechange: {
|
|
@@ -167,12 +197,13 @@ interface V3GateThresholds {
|
|
|
167
197
|
/** Velocities at/below this (IOD/s) count as stillness — absorbs detector
|
|
168
198
|
* box jitter (largest on LOW's 128px input) before it reaches the EMA. */
|
|
169
199
|
MOTION_DEADBAND_IOD_PER_S: number;
|
|
170
|
-
/** ready = p ≥ 1 AND
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
200
|
+
/** ready = p ≥ 1 AND no bad tick (q < Q_GOOD) left in this window after
|
|
201
|
+
* TRIMMING: with ≥3 samples the single worst is dropped, so one flaky tick
|
|
202
|
+
* (5 Hz LOW cadence = only 2–3 samples per window) cannot veto an
|
|
203
|
+
* otherwise-ready user, while a SECOND bad tick (a real sustained wobble)
|
|
204
|
+
* still blocks. The readiness bar is Q_GOOD itself — the level the
|
|
205
|
+
* integrator rises on — so any input that fills the ring also fires it. */
|
|
174
206
|
READY_WINDOW_MS: number;
|
|
175
|
-
READY_MEAN_Q: number;
|
|
176
207
|
/** Per-factor guidance trigger levels (lowest failing factor speaks). */
|
|
177
208
|
GUIDE_SIZE: number;
|
|
178
209
|
GUIDE_CENTERING: number;
|
|
@@ -215,8 +246,12 @@ interface V3GateTick {
|
|
|
215
246
|
factors: Record<V3GateFactor, number>;
|
|
216
247
|
/** fcv3.* message key for the lowest failing factor (host translates). */
|
|
217
248
|
guidanceKey: string;
|
|
218
|
-
/** Fire signal: p ≥ 1 AND
|
|
249
|
+
/** Fire signal: p ≥ 1 AND no second bad tick (q < Q_GOOD) in READY_WINDOW_MS. */
|
|
219
250
|
ready: boolean;
|
|
251
|
+
/** The face on THIS tick is ACCEPTED by the gate — present and every factor
|
|
252
|
+
* (size, centering, pose, sharpness, exposure, motion) good enough that the
|
|
253
|
+
* integrator RISES (q ≥ Q_GOOD). The engine's "first accepted face" mark. */
|
|
254
|
+
accepted: boolean;
|
|
220
255
|
}
|
|
221
256
|
declare class FaceGateV3 {
|
|
222
257
|
private readonly t;
|
|
@@ -288,9 +323,56 @@ declare class DeviceProfiler {
|
|
|
288
323
|
record(detectMs: number): DeviceClass;
|
|
289
324
|
}
|
|
290
325
|
|
|
326
|
+
/** Where a capture failed: the engine step that was running. */
|
|
327
|
+
type CaptureErrorPhase = "preflight" | "acquiring" | "models" | "recording" | "keyframes" | "upload";
|
|
328
|
+
/** Engine-side failure detail (the public handle adds the engine kind). */
|
|
329
|
+
interface EngineErrorDetail {
|
|
330
|
+
phase: CaptureErrorPhase;
|
|
331
|
+
/** The thrown error's `name` only, sanitised by {@link errorNameOf}. */
|
|
332
|
+
name?: string;
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
/** Why a gate tick did not advance: no face, or the weakest gate check. */
|
|
336
|
+
type GateBlockReason = "no_face" | Exclude<V3GateFactor, "presence">;
|
|
337
|
+
interface GateBlockEntry {
|
|
338
|
+
/** Ticks blocked by this reason. */
|
|
339
|
+
count: number;
|
|
340
|
+
/** Wall time (whole ms) those ticks covered. */
|
|
341
|
+
ms: number;
|
|
342
|
+
}
|
|
343
|
+
interface GateBlockSummary {
|
|
344
|
+
/** Only the reasons that blocked at least once. */
|
|
345
|
+
blocked: Partial<Record<GateBlockReason, GateBlockEntry>>;
|
|
346
|
+
/** Wall time (whole ms) of ticks the gate accepted (progress rising). */
|
|
347
|
+
acceptedMs: number;
|
|
348
|
+
/** Total ticks seen. */
|
|
349
|
+
ticks: number;
|
|
350
|
+
}
|
|
351
|
+
/** The reason one tick was held back, or null when the gate accepted it. */
|
|
352
|
+
declare function blockReasonOf(tick: Pick<V3GateTick, "accepted" | "factors">): GateBlockReason | null;
|
|
353
|
+
declare class GateBlockStats {
|
|
354
|
+
private blocked;
|
|
355
|
+
private acceptedMs;
|
|
356
|
+
private ticks;
|
|
357
|
+
private lastAt;
|
|
358
|
+
/** Record one gate tick; the time since the previous tick is charged to THIS tick's state. */
|
|
359
|
+
record(tick: Pick<V3GateTick, "at" | "accepted" | "factors">): void;
|
|
360
|
+
summary(): GateBlockSummary;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
/** A non-final `gate` telemetry snapshot at most this often while positioning
|
|
364
|
+
* (so an abandoned attempt still reports where its time went). */
|
|
365
|
+
declare const GATE_SNAPSHOT_MS = 1000;
|
|
366
|
+
/** Guidance key while a phone shows a landscape camera frame (the upright guard). */
|
|
367
|
+
declare const HOLD_UPRIGHT_KEY = "fcv3.hold_upright";
|
|
368
|
+
/** How often the upright guard re-reads the frame size while the clip records (plus every `resize` event). */
|
|
369
|
+
declare const UPRIGHT_WATCH_MS = 200;
|
|
291
370
|
/** Best-of-N keyframe window: up to 4 candidates over the first 600ms. */
|
|
292
371
|
declare const KEYFRAME_CANDIDATES = 4;
|
|
293
372
|
declare const KEYFRAME_WINDOW_MS = 600;
|
|
373
|
+
/** Liveness v7 §4.5 item 2: the longest the capture waits on the track description (its WebCrypto hash) once the
|
|
374
|
+
* clip is done; past it the artifacts ship without `provenance`. */
|
|
375
|
+
declare const PROVENANCE_WAIT_MS = 1000;
|
|
294
376
|
interface V3ChecksPayload {
|
|
295
377
|
engine: "v3";
|
|
296
378
|
/** Gate integrator 0..1 — the ring drives off this directly. */
|
|
@@ -311,9 +393,11 @@ interface CaptureSessionV3Events {
|
|
|
311
393
|
key: string;
|
|
312
394
|
};
|
|
313
395
|
artifacts: CaptureArtifacts;
|
|
396
|
+
/** `detail`: where the attempt failed and the thrown error's name (never its message). */
|
|
314
397
|
error: {
|
|
315
398
|
kind: CaptureErrorKind;
|
|
316
399
|
retryable: boolean;
|
|
400
|
+
detail?: EngineErrorDetail;
|
|
317
401
|
};
|
|
318
402
|
/** v3-only, CHROME-only (no data flows here): fires the instant the clip
|
|
319
403
|
* recording window ends — BEFORE the blob finalizes (iOS onstop can lag up
|
|
@@ -324,6 +408,12 @@ interface CaptureSessionV3Events {
|
|
|
324
408
|
frozen: {
|
|
325
409
|
previewDataUrl: string;
|
|
326
410
|
};
|
|
411
|
+
/** Liveness v7 §4.4: paint the full-viewport screen-ramp layer this colour (`null` clears it). Clip mode, a
|
|
412
|
+
* challenge issued by `screenRamp()`; at most four events per recording. CHROME-only: the host paints, the
|
|
413
|
+
* engine stamps the clip timeline. */
|
|
414
|
+
ramp: {
|
|
415
|
+
colour: ScreenRampColour | null;
|
|
416
|
+
};
|
|
327
417
|
}
|
|
328
418
|
type V3TelemetryEvent = {
|
|
329
419
|
type: "detector";
|
|
@@ -339,10 +429,39 @@ type V3TelemetryEvent = {
|
|
|
339
429
|
timeToGateMs: number;
|
|
340
430
|
degradeCount: number;
|
|
341
431
|
meanDetectMs: number;
|
|
342
|
-
}
|
|
432
|
+
}
|
|
433
|
+
/** Where the attempt's gate time went (see gate-blocking.ts): per-reason
|
|
434
|
+
* blocked tick counts + ms, accepted ms, and the ACTIVE device class /
|
|
435
|
+
* cadence after any dynamic profile adjustment. `final` on the attempt's
|
|
436
|
+
* end (fired / error / retry / destroy); throttled snapshots before it. */
|
|
437
|
+
| ({
|
|
438
|
+
type: "gate";
|
|
439
|
+
final: boolean;
|
|
440
|
+
activeClass: DeviceClass;
|
|
441
|
+
cadenceHz: number;
|
|
442
|
+
} & GateBlockSummary) | {
|
|
343
443
|
type: "error";
|
|
344
444
|
kind: CaptureErrorKind;
|
|
345
445
|
fallbackReason?: string;
|
|
446
|
+
}
|
|
447
|
+
/** Keyframe ranking (SDK spec §4.8a; only when `rankKeyframes` is on): the
|
|
448
|
+
* rank numbers of every candidate (never an image), the chosen index, the
|
|
449
|
+
* index sharpness alone would have chosen, and the extra detector time. */
|
|
450
|
+
| {
|
|
451
|
+
type: "keyframe";
|
|
452
|
+
tier: Detector["tier"] | null;
|
|
453
|
+
chosen: number;
|
|
454
|
+
sharpest: number;
|
|
455
|
+
detectMs: number;
|
|
456
|
+
candidates: Array<{
|
|
457
|
+
face: boolean;
|
|
458
|
+
frontal: number;
|
|
459
|
+
yaw?: number;
|
|
460
|
+
roll?: number;
|
|
461
|
+
eyes?: number;
|
|
462
|
+
score: number;
|
|
463
|
+
sharpness: number;
|
|
464
|
+
}>;
|
|
346
465
|
};
|
|
347
466
|
interface KeyframeCandidate {
|
|
348
467
|
blob: Blob;
|
|
@@ -381,7 +500,7 @@ interface CaptureSessionV3Options {
|
|
|
381
500
|
createRecorder?: () => Pick<ClipRecorder, "record" | "stop">;
|
|
382
501
|
/** (navigator.mediaDevices.getUserMedia) */
|
|
383
502
|
getUserMedia?: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
|
|
384
|
-
/** (
|
|
503
|
+
/** (canvas keyframe, mirrored on the front camera only, + downscaled Laplacian sharpness) */
|
|
385
504
|
captureKeyframe?: (video: HTMLVideoElement) => Promise<KeyframeCandidate>;
|
|
386
505
|
/** (downscaled face-crop sharpness/exposure via canvas) */
|
|
387
506
|
measureQuality?: (video: HTMLVideoElement, box: {
|
|
@@ -398,13 +517,33 @@ interface CaptureSessionV3Options {
|
|
|
398
517
|
* worker-side through WorkerDetectorProxy. Hosts own Worker construction
|
|
399
518
|
* (bundler-specific `new Worker(new URL(...))`). */
|
|
400
519
|
createWorker?: () => WorkerLike;
|
|
520
|
+
/** Keyframe ranking switch (SDK spec §4.8a; server tuning
|
|
521
|
+
* `capture.liveness.keyframe.rank`, default off): read when positioning
|
|
522
|
+
* starts (prefetches the lazy ranker) and again when the capture fires.
|
|
523
|
+
* Off → today's sharpest-of-N, byte for byte. */
|
|
524
|
+
rankKeyframes?: () => boolean;
|
|
525
|
+
/** Screen-ramp challenge (liveness v7 §4.4; server tuning `capture.liveness.screenRamp`): read once when the
|
|
526
|
+
* clip recording starts. A challenge → the engine emits `ramp` at each issued onset on the clip timeline and
|
|
527
|
+
* reports what it rendered in `artifacts.screenRamp`; `undefined` (older backends, assisted sessions, no host
|
|
528
|
+
* painting) → no ramp, no field. Photo mode never ramps. */
|
|
529
|
+
screenRamp?: () => ScreenRampChallenge | undefined;
|
|
401
530
|
/** INERT (Phase 3 escalation seam — see EscalationHook). Accepted and
|
|
402
531
|
* retained, never called in Phases 1–2. */
|
|
403
532
|
escalation?: EscalationHook;
|
|
533
|
+
/** Upright guard (spec 2026-10-28 §4.2): the device is a phone, so a landscape frame (videoWidth > videoHeight)
|
|
534
|
+
* holds the gate and drops a clip being recorded (or the keyframes of a photo-mode capture). Read at each attempt
|
|
535
|
+
* start. (detectFormFactor() === 'phone' — desktop webcams are landscape by nature, and a tablet may stand in
|
|
536
|
+
* landscape on a stand: neither is ever guarded) */
|
|
537
|
+
isPhone?: () => boolean;
|
|
404
538
|
/** (performance.now) */
|
|
405
539
|
now?: () => number;
|
|
406
540
|
}
|
|
407
541
|
type Handler<K extends keyof CaptureSessionV3Events> = (payload: CaptureSessionV3Events[K]) => void;
|
|
542
|
+
/** Per-start options (the public handle's `start({ facing })`). */
|
|
543
|
+
interface CaptureSessionV3StartOptions {
|
|
544
|
+
/** Camera for this attempt AND later retries; absent → keep the current one. */
|
|
545
|
+
facingMode?: "user" | "environment";
|
|
546
|
+
}
|
|
408
547
|
declare class CaptureSessionV3 {
|
|
409
548
|
private readonly options;
|
|
410
549
|
private readonly handlers;
|
|
@@ -418,14 +557,29 @@ declare class CaptureSessionV3 {
|
|
|
418
557
|
private profiler;
|
|
419
558
|
private lastGuidanceKey;
|
|
420
559
|
private positioningStartedAt;
|
|
560
|
+
private cameraRequestedAt;
|
|
561
|
+
private cameraReadyAt;
|
|
562
|
+
private faceAcquiredAt;
|
|
563
|
+
private captureCompleteAt;
|
|
421
564
|
private fired;
|
|
422
565
|
private carriedDegrade;
|
|
423
566
|
private carriedMeans;
|
|
567
|
+
private blockStats;
|
|
568
|
+
private lastGateSnapshotAt;
|
|
569
|
+
/** The upright guard applies to this attempt (a phone). */
|
|
570
|
+
private uprightGuard;
|
|
571
|
+
/** Liveness v7 §4.5 item 2: the attempt's video track described right after getUserMedia (null: no track). */
|
|
572
|
+
private trackProvenance;
|
|
573
|
+
/** The ramp of the clip being recorded (stopped with the recording, the attempt or the session). */
|
|
574
|
+
private ramp;
|
|
424
575
|
constructor(options: CaptureSessionV3Options);
|
|
425
576
|
get state(): CaptureState;
|
|
426
577
|
on<K extends keyof CaptureSessionV3Events>(event: K, handler: Handler<K>): () => void;
|
|
427
578
|
private emit;
|
|
428
|
-
start(): Promise<void>;
|
|
579
|
+
start(options?: CaptureSessionV3StartOptions): Promise<void>;
|
|
580
|
+
/** The camera of the current attempt: the one its track reports once the stream is live, else the requested one
|
|
581
|
+
* (start option, switchCamera toggles). */
|
|
582
|
+
get facingMode(): "user" | "environment";
|
|
429
583
|
/** Full reset + camera restart — the documented recovery path (v1 parity). */
|
|
430
584
|
retry(): void;
|
|
431
585
|
switchCamera(): void;
|
|
@@ -436,10 +590,24 @@ declare class CaptureSessionV3 {
|
|
|
436
590
|
private startScheduler;
|
|
437
591
|
private detectTick;
|
|
438
592
|
private fire;
|
|
439
|
-
/**
|
|
593
|
+
/** `{ provenance }` from the live track's description, the recording's frame statistics and the painter flag; `{}` without a track. */
|
|
594
|
+
private provenance;
|
|
595
|
+
/** A phone showing a landscape frame: the guard holds the gate. */
|
|
596
|
+
private isLandscape;
|
|
597
|
+
/** Positioning on a sideways phone: no detection, the gate restarts from zero and the coaching says why. */
|
|
598
|
+
private holdUpright;
|
|
599
|
+
/** While the clip records (or, `recorder` null, the photo-mode keyframes are taken): a rotation to landscape aborts
|
|
600
|
+
* it. Returns the unwatch function. */
|
|
601
|
+
private watchRotation;
|
|
602
|
+
/** Drop the clip being recorded (or the photo-mode keyframes being taken; same stream, same detector) and go back to
|
|
603
|
+
* positioning with the upright coaching. */
|
|
604
|
+
private abortRecording;
|
|
605
|
+
/** Up to KEYFRAME_CANDIDATES frames (mirrored on the front camera) over KEYFRAME_WINDOW_MS —
|
|
440
606
|
* sharpest wins (reuses frame-quality.sharpness via the capture seam). */
|
|
441
607
|
private collectKeyframes;
|
|
442
608
|
private finishCapture;
|
|
609
|
+
/** The attempt's capture-phase timing (whole ms, ≥ 0); undefined when no mark landed. */
|
|
610
|
+
private captureTiming;
|
|
443
611
|
private defaultKeyframe;
|
|
444
612
|
/** Reused downscale canvas — falls back to the raw video where canvas 2D
|
|
445
613
|
* is unavailable (jsdom) so tests and exotic hosts keep detecting. */
|
|
@@ -448,10 +616,12 @@ declare class CaptureSessionV3 {
|
|
|
448
616
|
private defaultQuality;
|
|
449
617
|
private centerSharpness;
|
|
450
618
|
private teardownAttempt;
|
|
619
|
+
/** Emit the attempt's gate breakdown; a final report closes it (exactly once). */
|
|
620
|
+
private reportGate;
|
|
451
621
|
private stopTracks;
|
|
452
622
|
private fail;
|
|
453
623
|
private setState;
|
|
454
624
|
private now;
|
|
455
625
|
}
|
|
456
626
|
|
|
457
|
-
export {
|
|
627
|
+
export { isClipTooLarge as $, MIME_CANDIDATES as A, type V3GateFactor as B, type CameraErrorKind as C, DEFAULT_CLIP_MIME as D, type EscalationClipArtifact as E, FaceGateV3 as F, GATE_SNAPSHOT_MS as G, HOLD_UPRIGHT_KEY as H, type V3GateQuality as I, type V3GateThresholds as J, KEYFRAME_CANDIDATES as K, type V3GateTick as L, MAX_CLIP_BYTES as M, type V3GateTickInput as N, type V3TelemetryEvent as O, PROVENANCE_WAIT_MS as P, V3_GATE_DEFAULTS as Q, VIDEO_BPS as R, STOP_GRACE_MS as S, TIMESLICE_MS as T, UPRIGHT_WATCH_MS as U, type V3ChecksPayload as V, blockReasonOf as W, buildLivenessV2FormData as X, cameraPreflight as Y, classifyDevice as Z, extForMime as _, CLIP_MS as a, isMediaRecorderSupported as a0, mapGetUserMediaError as a1, pickMimeType as a2, probeDevice as a3, type EngineErrorDetail as a4, type CaptureArtifacts as b, type CaptureErrorKind as c, type CaptureSessionEvents as d, CaptureSessionV3 as e, type CaptureSessionV3Events as f, type CaptureSessionV3Options as g, type CaptureSessionV3StartOptions as h, type CaptureState as i, type CaptureTiming as j, ClipError as k, type ClipErrorKind as l, ClipRecorder as m, type ClipResult as n, DEVICE_PROFILES as o, type DeviceClass as p, type DeviceProbe as q, type DeviceProfile as r, DeviceProfiler as s, type EscalationHook as t, type GateBlockEntry as u, type GateBlockReason as v, GateBlockStats as w, type GateBlockSummary as x, type GateChecks as y, KEYFRAME_WINDOW_MS as z };
|