@sekyro/web 0.1.0-rc.1 → 0.1.0-rc.10
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 +213 -0
- package/LICENSE +25 -16
- package/README.md +105 -61
- package/THIRD-PARTY-NOTICES.txt +154 -0
- package/dist/background-monitor-A7FKJOAG.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-GK6G7JOI.js +1 -0
- package/dist/{capture-session-v3-CAoWM8iT.d.cts → capture-session-v3-CmJw_bK0.d.cts} +141 -13
- package/dist/{capture-session-v3-BJ8ciaWl.d.ts → capture-session-v3-DGG2stO6.d.ts} +141 -13
- package/dist/chunk-3MSUJYBO.js +1 -0
- package/dist/chunk-7ZCZY3ZP.js +1 -0
- package/dist/chunk-A3FUGHAH.js +2 -0
- package/dist/chunk-BAGSM67V.js +1 -0
- package/dist/chunk-BPE5NSQ2.js +1 -0
- package/dist/chunk-CJHMFPL6.js +1 -0
- package/dist/chunk-DFTCAWMP.js +1 -0
- package/dist/chunk-DK5YPBDQ.js +1 -0
- package/dist/chunk-ETY6SAAZ.js +1 -0
- package/dist/chunk-FFDB6LQN.js +1 -0
- package/dist/chunk-FHJ7HO3M.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-HAO6EQTH.js +1 -0
- package/dist/chunk-HWAXEQD5.js +1 -0
- package/dist/chunk-MXWLCDFX.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-SEC64KZ3.js +1 -0
- package/dist/chunk-SMKCBUJL.js +1 -0
- package/dist/chunk-SXZCL5NO.js +1 -0
- package/dist/chunk-SZ7YGNUZ.js +1 -0
- package/dist/chunk-TDLIXFDT.js +1 -0
- package/dist/chunk-UGMHAFEY.js +1 -0
- package/dist/chunk-WKJJEPWA.js +1 -0
- package/dist/chunk-XR64UFLK.js +1 -0
- package/dist/client/index.cjs +1 -357
- package/dist/client/index.d.cts +35 -3
- package/dist/client/index.d.ts +35 -3
- package/dist/client/index.js +1 -15
- package/dist/core/index.cjs +1 -1605
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -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-IGUQP2NS.js +1 -0
- package/dist/create-portrait-capture-RJSFY37D.js +1 -0
- package/dist/create-verification-Bb20j6zk.d.ts +2968 -0
- package/dist/create-verification-CtqF4A9W.d.cts +2968 -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-PWBMKRGC.js +1 -0
- package/dist/icao-gate-terzKYD7.d.cts +1770 -0
- package/dist/icao-gate-terzKYD7.d.ts +1770 -0
- package/dist/icao-tuning-4GGVX6B4.js +1 -0
- package/dist/index.cjs +1 -2580
- package/dist/index.d.cts +73 -5
- package/dist/index.d.ts +73 -5
- package/dist/index.js +1 -28
- package/dist/internal/index.cjs +1 -4110
- package/dist/internal/index.d.cts +353 -322
- package/dist/internal/index.d.ts +353 -322
- 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-QCK2SOGS.js +1 -0
- package/dist/popup/index.cjs +1 -76
- package/dist/popup/index.js +1 -11
- package/dist/scanic-ml-stub-KW7IZHUT.js +1 -0
- package/dist/segmenter-USLNBX65.js +1 -0
- package/dist/turnstile-FATNZ4AG.js +1 -0
- package/package.json +25 -10
- package/sbom.cdx.json +195 -0
- package/dist/capture-constraints-BujkZcfb.d.cts +0 -21
- package/dist/capture-constraints-BujkZcfb.d.ts +0 -21
- 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-NU4YOLCN.js +0 -796
- package/dist/chunk-NU4YOLCN.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--ldwakXV.d.cts +0 -341
- package/dist/create-verification-BlAPWeW5.d.ts +0 -341
- 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
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
@sekyro/web: third-party notices
|
|
2
|
+
================================
|
|
3
|
+
|
|
4
|
+
@sekyro/web is licensed under the Sekyro AI SDK License (see LICENSE). The
|
|
5
|
+
dist/ files of this package also contain the third-party components below,
|
|
6
|
+
which remain under their own licenses.
|
|
7
|
+
|
|
8
|
+
1. scanic (document edge detection, classical pipeline)
|
|
9
|
+
Bundled in dist/ (the document detector chunks).
|
|
10
|
+
Copyright (c) 2025 marquaye
|
|
11
|
+
License: MIT License (full text in section A).
|
|
12
|
+
|
|
13
|
+
2. Emscripten runtime and JavaScript glue, version 4.0.23
|
|
14
|
+
Bundled in the OCR worker (dist/core/ocr/worker.js, worker.cjs and
|
|
15
|
+
worker.bundle.js) as the loader of the on-device OCR engine.
|
|
16
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
17
|
+
License: MIT License or University of Illinois/NCSA Open Source License,
|
|
18
|
+
at your choice (full text in section B).
|
|
19
|
+
|
|
20
|
+
The OCR engine binary (sekyro-ocr.wasm) and its models are not part of this
|
|
21
|
+
package: they are downloaded at runtime, and their notices are published with
|
|
22
|
+
them.
|
|
23
|
+
|
|
24
|
+
-------------------------------------------------------------------------------
|
|
25
|
+
A. scanic: MIT License
|
|
26
|
+
-------------------------------------------------------------------------------
|
|
27
|
+
|
|
28
|
+
MIT License
|
|
29
|
+
|
|
30
|
+
Copyright (c) 2025 marquaye
|
|
31
|
+
|
|
32
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
33
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
34
|
+
in the Software without restriction, including without limitation the rights
|
|
35
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
36
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
37
|
+
furnished to do so, subject to the following conditions:
|
|
38
|
+
|
|
39
|
+
The above copyright notice and this permission notice shall be included in all
|
|
40
|
+
copies or substantial portions of the Software.
|
|
41
|
+
|
|
42
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
43
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
44
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
45
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
46
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
47
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
48
|
+
SOFTWARE.
|
|
49
|
+
-------------------------------------------------------------------------------
|
|
50
|
+
B. Emscripten: MIT License or University of Illinois/NCSA Open Source License
|
|
51
|
+
-------------------------------------------------------------------------------
|
|
52
|
+
|
|
53
|
+
Emscripten is available under 2 licenses, the MIT license and the
|
|
54
|
+
University of Illinois/NCSA Open Source License.
|
|
55
|
+
|
|
56
|
+
Both are permissive open source licenses, with little if any
|
|
57
|
+
practical difference between them.
|
|
58
|
+
|
|
59
|
+
The reason for offering both is that (1) the MIT license is
|
|
60
|
+
well-known, while (2) the University of Illinois/NCSA Open Source
|
|
61
|
+
License allows Emscripten's code to be integrated upstream into
|
|
62
|
+
LLVM, which uses that license, should the opportunity arise.
|
|
63
|
+
|
|
64
|
+
The full text of both licenses follows.
|
|
65
|
+
|
|
66
|
+
==============================================================================
|
|
67
|
+
|
|
68
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
69
|
+
|
|
70
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
71
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
72
|
+
in the Software without restriction, including without limitation the rights
|
|
73
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
74
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
75
|
+
furnished to do so, subject to the following conditions:
|
|
76
|
+
|
|
77
|
+
The above copyright notice and this permission notice shall be included in
|
|
78
|
+
all copies or substantial portions of the Software.
|
|
79
|
+
|
|
80
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
81
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
82
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
83
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
84
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
85
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
86
|
+
THE SOFTWARE.
|
|
87
|
+
|
|
88
|
+
==============================================================================
|
|
89
|
+
|
|
90
|
+
Copyright (c) 2010-2014 Emscripten authors, see AUTHORS file.
|
|
91
|
+
All rights reserved.
|
|
92
|
+
|
|
93
|
+
Permission is hereby granted, free of charge, to any person obtaining a
|
|
94
|
+
copy of this software and associated documentation files (the
|
|
95
|
+
"Software"), to deal with the Software without restriction, including
|
|
96
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
|
97
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
|
98
|
+
permit persons to whom the Software is furnished to do so, subject to
|
|
99
|
+
the following conditions:
|
|
100
|
+
|
|
101
|
+
Redistributions of source code must retain the above copyright
|
|
102
|
+
notice, this list of conditions and the following disclaimers.
|
|
103
|
+
|
|
104
|
+
Redistributions in binary form must reproduce the above
|
|
105
|
+
copyright notice, this list of conditions and the following disclaimers
|
|
106
|
+
in the documentation and/or other materials provided with the
|
|
107
|
+
distribution.
|
|
108
|
+
|
|
109
|
+
Neither the names of Mozilla,
|
|
110
|
+
nor the names of its contributors may be used to endorse
|
|
111
|
+
or promote products derived from this Software without specific prior
|
|
112
|
+
written permission.
|
|
113
|
+
|
|
114
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
115
|
+
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
116
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
117
|
+
IN NO EVENT SHALL THE CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR
|
|
118
|
+
ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
119
|
+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
120
|
+
SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE SOFTWARE.
|
|
121
|
+
|
|
122
|
+
==============================================================================
|
|
123
|
+
|
|
124
|
+
This program uses portions of Node.js source code located in src/library_path.js,
|
|
125
|
+
in accordance with the terms of the MIT license. Node's license follows:
|
|
126
|
+
|
|
127
|
+
"""
|
|
128
|
+
Copyright Joyent, Inc. and other Node contributors. All rights reserved.
|
|
129
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
130
|
+
of this software and associated documentation files (the "Software"), to
|
|
131
|
+
deal in the Software without restriction, including without limitation the
|
|
132
|
+
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
133
|
+
sell copies of the Software, and to permit persons to whom the Software is
|
|
134
|
+
furnished to do so, subject to the following conditions:
|
|
135
|
+
|
|
136
|
+
The above copyright notice and this permission notice shall be included in
|
|
137
|
+
all copies or substantial portions of the Software.
|
|
138
|
+
|
|
139
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
140
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
141
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
142
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
143
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
144
|
+
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
145
|
+
IN THE SOFTWARE.
|
|
146
|
+
"""
|
|
147
|
+
|
|
148
|
+
The musl libc project is bundled in this repo, and it has the MIT license, see
|
|
149
|
+
system/lib/libc/musl/COPYRIGHT
|
|
150
|
+
|
|
151
|
+
The third_party/ subdirectory contains code with other licenses. None of it is
|
|
152
|
+
used by default, but certain options use it (e.g., the optional closure compiler
|
|
153
|
+
flag will run closure compiler from third_party/).
|
|
154
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a}from"./chunk-RI3E7GBN.js";import"./chunk-GI3UFGRQ.js";export{a as createBackgroundMonitor};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** getUserMedia constraint tier — 720p-class on every device since 2026-07-06.
|
|
2
|
+
* The v2 FAS-CLIP liveness head loses its texture cues below ~720p: the SAME
|
|
3
|
+
* genuine clip scores heads 0.0001 at 720x1280 vs 0.355 at the old 480x360
|
|
4
|
+
* mobile tier, which pushed real users into review (first observed live on
|
|
5
|
+
* staging 2026-07-06; falsified on corpus clips the same day). Dimensions are
|
|
6
|
+
* sensor-relative (landscape); mobile browsers deliver portrait via rotation
|
|
7
|
+
* metadata, which the liveness service's decoder applies (cv2
|
|
8
|
+
* ORIENTATION_AUTO). `isMobile` is kept for call-site compat and future
|
|
9
|
+
* divergence — both tiers are 720p today. Bitrate pairs with VIDEO_BPS in
|
|
10
|
+
* clip-recorder.ts (2.5 Mbps). */
|
|
11
|
+
declare function buildCaptureConstraints(isMobile: boolean, facingMode: "user" | "environment"): MediaStreamConstraints;
|
|
12
|
+
/** The kind of device the browser runs on (spec 2026-10-28 §4.2). */
|
|
13
|
+
type FormFactor = "phone" | "tablet" | "desktop";
|
|
14
|
+
/** A touch device whose shorter screen side is below this (CSS px) is a phone; at or above it, a tablet. */
|
|
15
|
+
declare const PHONE_MAX_SHORT_SIDE = 600;
|
|
16
|
+
/**
|
|
17
|
+
* Phone, tablet or desktop:
|
|
18
|
+
* - phone: an iPhone / iPod user agent, an Android user agent with `Mobile`, a legacy mobile user agent, or a touch
|
|
19
|
+
* device with a coarse primary pointer whose shorter screen side is under {@link PHONE_MAX_SHORT_SIDE} CSS px;
|
|
20
|
+
* - tablet: iPadOS (an iPad user agent, or the desktop `Macintosh` one with touch points), Android without `Mobile`,
|
|
21
|
+
* and other touch devices with a coarse primary pointer (Windows / ChromeOS tablets);
|
|
22
|
+
* - desktop: everything else. The window width plays no part: a narrow desktop window is still a desktop, and a touch
|
|
23
|
+
* laptop keeps a fine primary pointer.
|
|
24
|
+
* SSR-safe (`desktop` without window / navigator).
|
|
25
|
+
*/
|
|
26
|
+
declare function detectFormFactor(): FormFactor;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this browser runs on a phone or tablet ({@link detectFormFactor} is not `desktop`): the capture channel,
|
|
29
|
+
* `mobile_required` and the hand-over use it. The upright guard is phones only.
|
|
30
|
+
*/
|
|
31
|
+
declare function detectIsMobile(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The facing the live video track of `stream` reports (`getSettings().facingMode`), or `null` when the track does not
|
|
34
|
+
* say (most desktop webcams) or reports something else (`left` / `right`). Never throws.
|
|
35
|
+
*/
|
|
36
|
+
declare function trackFacingMode(stream: MediaStream | null | undefined): "user" | "environment" | null;
|
|
37
|
+
/** Gate radius as a fraction of the guidance circle (v1 L501: circleSize × 0.45). */
|
|
38
|
+
declare const CIRCLE_RADIUS_FACTOR = 0.45;
|
|
39
|
+
/** `inCircle` tolerance as a fraction of the gate radius (v1 L508: r × 0.9). */
|
|
40
|
+
declare const IN_CIRCLE_FACTOR = 0.9;
|
|
41
|
+
/** `centered` tolerance as a fraction of the gate radius (v1 L509: r × 0.4). */
|
|
42
|
+
declare const CENTERED_FACTOR = 0.4;
|
|
43
|
+
|
|
44
|
+
export { CENTERED_FACTOR as C, type FormFactor as F, IN_CIRCLE_FACTOR as I, PHONE_MAX_SHORT_SIDE as P, CIRCLE_RADIUS_FACTOR as a, buildCaptureConstraints as b, detectIsMobile as c, detectFormFactor as d, trackFacingMode as t };
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/** getUserMedia constraint tier — 720p-class on every device since 2026-07-06.
|
|
2
|
+
* The v2 FAS-CLIP liveness head loses its texture cues below ~720p: the SAME
|
|
3
|
+
* genuine clip scores heads 0.0001 at 720x1280 vs 0.355 at the old 480x360
|
|
4
|
+
* mobile tier, which pushed real users into review (first observed live on
|
|
5
|
+
* staging 2026-07-06; falsified on corpus clips the same day). Dimensions are
|
|
6
|
+
* sensor-relative (landscape); mobile browsers deliver portrait via rotation
|
|
7
|
+
* metadata, which the liveness service's decoder applies (cv2
|
|
8
|
+
* ORIENTATION_AUTO). `isMobile` is kept for call-site compat and future
|
|
9
|
+
* divergence — both tiers are 720p today. Bitrate pairs with VIDEO_BPS in
|
|
10
|
+
* clip-recorder.ts (2.5 Mbps). */
|
|
11
|
+
declare function buildCaptureConstraints(isMobile: boolean, facingMode: "user" | "environment"): MediaStreamConstraints;
|
|
12
|
+
/** The kind of device the browser runs on (spec 2026-10-28 §4.2). */
|
|
13
|
+
type FormFactor = "phone" | "tablet" | "desktop";
|
|
14
|
+
/** A touch device whose shorter screen side is below this (CSS px) is a phone; at or above it, a tablet. */
|
|
15
|
+
declare const PHONE_MAX_SHORT_SIDE = 600;
|
|
16
|
+
/**
|
|
17
|
+
* Phone, tablet or desktop:
|
|
18
|
+
* - phone: an iPhone / iPod user agent, an Android user agent with `Mobile`, a legacy mobile user agent, or a touch
|
|
19
|
+
* device with a coarse primary pointer whose shorter screen side is under {@link PHONE_MAX_SHORT_SIDE} CSS px;
|
|
20
|
+
* - tablet: iPadOS (an iPad user agent, or the desktop `Macintosh` one with touch points), Android without `Mobile`,
|
|
21
|
+
* and other touch devices with a coarse primary pointer (Windows / ChromeOS tablets);
|
|
22
|
+
* - desktop: everything else. The window width plays no part: a narrow desktop window is still a desktop, and a touch
|
|
23
|
+
* laptop keeps a fine primary pointer.
|
|
24
|
+
* SSR-safe (`desktop` without window / navigator).
|
|
25
|
+
*/
|
|
26
|
+
declare function detectFormFactor(): FormFactor;
|
|
27
|
+
/**
|
|
28
|
+
* Whether this browser runs on a phone or tablet ({@link detectFormFactor} is not `desktop`): the capture channel,
|
|
29
|
+
* `mobile_required` and the hand-over use it. The upright guard is phones only.
|
|
30
|
+
*/
|
|
31
|
+
declare function detectIsMobile(): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The facing the live video track of `stream` reports (`getSettings().facingMode`), or `null` when the track does not
|
|
34
|
+
* say (most desktop webcams) or reports something else (`left` / `right`). Never throws.
|
|
35
|
+
*/
|
|
36
|
+
declare function trackFacingMode(stream: MediaStream | null | undefined): "user" | "environment" | null;
|
|
37
|
+
/** Gate radius as a fraction of the guidance circle (v1 L501: circleSize × 0.45). */
|
|
38
|
+
declare const CIRCLE_RADIUS_FACTOR = 0.45;
|
|
39
|
+
/** `inCircle` tolerance as a fraction of the gate radius (v1 L508: r × 0.9). */
|
|
40
|
+
declare const IN_CIRCLE_FACTOR = 0.9;
|
|
41
|
+
/** `centered` tolerance as a fraction of the gate radius (v1 L509: r × 0.4). */
|
|
42
|
+
declare const CENTERED_FACTOR = 0.4;
|
|
43
|
+
|
|
44
|
+
export { CENTERED_FACTOR as C, type FormFactor as F, IN_CIRCLE_FACTOR as I, PHONE_MAX_SHORT_SIDE as P, CIRCLE_RADIUS_FACTOR as a, buildCaptureConstraints as b, detectIsMobile as c, detectFormFactor as d, trackFacingMode as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{C as a,D as b,E as c,F as d,G as e,H as f,I as g,J as h}from"./chunk-UGMHAFEY.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-POIQGEZM.js";import"./chunk-FHJ7HO3M.js";import"./chunk-FPXL63KZ.js";import"./chunk-BAGSM67V.js";import"./chunk-DK5YPBDQ.js";export{h as CAPTURE_CANDIDATE_SPACING_MS,g as CAPTURE_EXTRA_CANDIDATES,e as CaptureSessionDoc,b as DOC_CADENCE_HZ,c as DOC_SHUTTER_DEFAULTS,f as passportBandOf,d as resolveDocShutterTuning,a as warmDocDetector};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { F as FaceObservation, b as Detector, W as WorkerLike } from './detect-worker-
|
|
1
|
+
import { F as FaceObservation, b as Detector, W as WorkerLike } from './detect-worker-DclNxkZT.cjs';
|
|
2
2
|
|
|
3
3
|
/** MP4-first ladder: one container (H.264 MP4) covers iOS/macOS Safari + Chrome 130+.
|
|
4
4
|
* WebM/VP9→VP8 only as the Firefox/older-Chromium fallback. */
|
|
@@ -105,16 +105,35 @@ interface GateChecks {
|
|
|
105
105
|
goodQuality: boolean;
|
|
106
106
|
stable: boolean;
|
|
107
107
|
}
|
|
108
|
+
/**
|
|
109
|
+
* Client-side capture timing (face-capture duration, 2026-10-17), measured
|
|
110
|
+
* by the engine with its monotonic clock (`performance.now()` by default) and
|
|
111
|
+
* rounded to whole milliseconds. All fields are optional: a phase that never
|
|
112
|
+
* happened (e.g. no face ever detected before a retry) is simply absent.
|
|
113
|
+
*/
|
|
114
|
+
interface CaptureTiming {
|
|
115
|
+
/** `getUserMedia` call → stream attached and the preview playing. */
|
|
116
|
+
cameraReadyMs?: number;
|
|
117
|
+
/** Camera ready → the first tick on which the GATE accepted the face
|
|
118
|
+
* (present + size / centering / quality good enough to make progress —
|
|
119
|
+
* not merely detected). */
|
|
120
|
+
faceAcquireMs?: number;
|
|
121
|
+
/** FIRST accepted face → gate progress 100 % (capture complete, BEFORE the
|
|
122
|
+
* clip window / upload). A face lost and re-acquired keeps the first start. */
|
|
123
|
+
captureMs?: number;
|
|
124
|
+
}
|
|
108
125
|
/** Capture output. Upload is NOT the engine's job — hosts submit these themselves. */
|
|
109
126
|
interface CaptureArtifacts {
|
|
110
127
|
/** Absent in photo mode. */
|
|
111
128
|
clip?: Blob;
|
|
112
129
|
/** Container mime the clip finalized with. Absent in photo mode. */
|
|
113
130
|
clipMimeType?: string;
|
|
114
|
-
/**
|
|
131
|
+
/** JPEG keyframe (captureMirroredKeyframe): mirrored on the front camera, as the sensor sees it on the back one. */
|
|
115
132
|
keyframe: Blob;
|
|
116
133
|
/** JPEG data URL of the keyframe canvas (v1 preview, quality 0.92). */
|
|
117
134
|
previewDataUrl: string;
|
|
135
|
+
/** Capture-phase timing of the attempt that produced these artifacts. */
|
|
136
|
+
timing?: CaptureTiming;
|
|
118
137
|
}
|
|
119
138
|
interface CaptureSessionEvents {
|
|
120
139
|
statechange: {
|
|
@@ -167,12 +186,13 @@ interface V3GateThresholds {
|
|
|
167
186
|
/** Velocities at/below this (IOD/s) count as stillness — absorbs detector
|
|
168
187
|
* box jitter (largest on LOW's 128px input) before it reaches the EMA. */
|
|
169
188
|
MOTION_DEADBAND_IOD_PER_S: number;
|
|
170
|
-
/** ready = p ≥ 1 AND
|
|
171
|
-
*
|
|
172
|
-
*
|
|
173
|
-
*
|
|
189
|
+
/** ready = p ≥ 1 AND no bad tick (q < Q_GOOD) left in this window after
|
|
190
|
+
* TRIMMING: with ≥3 samples the single worst is dropped, so one flaky tick
|
|
191
|
+
* (5 Hz LOW cadence = only 2–3 samples per window) cannot veto an
|
|
192
|
+
* otherwise-ready user, while a SECOND bad tick (a real sustained wobble)
|
|
193
|
+
* still blocks. The readiness bar is Q_GOOD itself — the level the
|
|
194
|
+
* integrator rises on — so any input that fills the ring also fires it. */
|
|
174
195
|
READY_WINDOW_MS: number;
|
|
175
|
-
READY_MEAN_Q: number;
|
|
176
196
|
/** Per-factor guidance trigger levels (lowest failing factor speaks). */
|
|
177
197
|
GUIDE_SIZE: number;
|
|
178
198
|
GUIDE_CENTERING: number;
|
|
@@ -215,8 +235,12 @@ interface V3GateTick {
|
|
|
215
235
|
factors: Record<V3GateFactor, number>;
|
|
216
236
|
/** fcv3.* message key for the lowest failing factor (host translates). */
|
|
217
237
|
guidanceKey: string;
|
|
218
|
-
/** Fire signal: p ≥ 1 AND
|
|
238
|
+
/** Fire signal: p ≥ 1 AND no second bad tick (q < Q_GOOD) in READY_WINDOW_MS. */
|
|
219
239
|
ready: boolean;
|
|
240
|
+
/** The face on THIS tick is ACCEPTED by the gate — present and every factor
|
|
241
|
+
* (size, centering, pose, sharpness, exposure, motion) good enough that the
|
|
242
|
+
* integrator RISES (q ≥ Q_GOOD). The engine's "first accepted face" mark. */
|
|
243
|
+
accepted: boolean;
|
|
220
244
|
}
|
|
221
245
|
declare class FaceGateV3 {
|
|
222
246
|
private readonly t;
|
|
@@ -288,6 +312,41 @@ declare class DeviceProfiler {
|
|
|
288
312
|
record(detectMs: number): DeviceClass;
|
|
289
313
|
}
|
|
290
314
|
|
|
315
|
+
/** Why a gate tick did not advance: no face, or the weakest gate check. */
|
|
316
|
+
type GateBlockReason = "no_face" | Exclude<V3GateFactor, "presence">;
|
|
317
|
+
interface GateBlockEntry {
|
|
318
|
+
/** Ticks blocked by this reason. */
|
|
319
|
+
count: number;
|
|
320
|
+
/** Wall time (whole ms) those ticks covered. */
|
|
321
|
+
ms: number;
|
|
322
|
+
}
|
|
323
|
+
interface GateBlockSummary {
|
|
324
|
+
/** Only the reasons that blocked at least once. */
|
|
325
|
+
blocked: Partial<Record<GateBlockReason, GateBlockEntry>>;
|
|
326
|
+
/** Wall time (whole ms) of ticks the gate accepted (progress rising). */
|
|
327
|
+
acceptedMs: number;
|
|
328
|
+
/** Total ticks seen. */
|
|
329
|
+
ticks: number;
|
|
330
|
+
}
|
|
331
|
+
/** The reason one tick was held back, or null when the gate accepted it. */
|
|
332
|
+
declare function blockReasonOf(tick: Pick<V3GateTick, "accepted" | "factors">): GateBlockReason | null;
|
|
333
|
+
declare class GateBlockStats {
|
|
334
|
+
private blocked;
|
|
335
|
+
private acceptedMs;
|
|
336
|
+
private ticks;
|
|
337
|
+
private lastAt;
|
|
338
|
+
/** Record one gate tick; the time since the previous tick is charged to THIS tick's state. */
|
|
339
|
+
record(tick: Pick<V3GateTick, "at" | "accepted" | "factors">): void;
|
|
340
|
+
summary(): GateBlockSummary;
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
/** A non-final `gate` telemetry snapshot at most this often while positioning
|
|
344
|
+
* (so an abandoned attempt still reports where its time went). */
|
|
345
|
+
declare const GATE_SNAPSHOT_MS = 1000;
|
|
346
|
+
/** Guidance key while a phone shows a landscape camera frame (the upright guard). */
|
|
347
|
+
declare const HOLD_UPRIGHT_KEY = "fcv3.hold_upright";
|
|
348
|
+
/** How often the upright guard re-reads the frame size while the clip records (plus every `resize` event). */
|
|
349
|
+
declare const UPRIGHT_WATCH_MS = 200;
|
|
291
350
|
/** Best-of-N keyframe window: up to 4 candidates over the first 600ms. */
|
|
292
351
|
declare const KEYFRAME_CANDIDATES = 4;
|
|
293
352
|
declare const KEYFRAME_WINDOW_MS = 600;
|
|
@@ -339,10 +398,39 @@ type V3TelemetryEvent = {
|
|
|
339
398
|
timeToGateMs: number;
|
|
340
399
|
degradeCount: number;
|
|
341
400
|
meanDetectMs: number;
|
|
342
|
-
}
|
|
401
|
+
}
|
|
402
|
+
/** Where the attempt's gate time went (see gate-blocking.ts): per-reason
|
|
403
|
+
* blocked tick counts + ms, accepted ms, and the ACTIVE device class /
|
|
404
|
+
* cadence after any dynamic profile adjustment. `final` on the attempt's
|
|
405
|
+
* end (fired / error / retry / destroy); throttled snapshots before it. */
|
|
406
|
+
| ({
|
|
407
|
+
type: "gate";
|
|
408
|
+
final: boolean;
|
|
409
|
+
activeClass: DeviceClass;
|
|
410
|
+
cadenceHz: number;
|
|
411
|
+
} & GateBlockSummary) | {
|
|
343
412
|
type: "error";
|
|
344
413
|
kind: CaptureErrorKind;
|
|
345
414
|
fallbackReason?: string;
|
|
415
|
+
}
|
|
416
|
+
/** Keyframe ranking (SDK spec §4.8a; only when `rankKeyframes` is on): the
|
|
417
|
+
* rank numbers of every candidate (never an image), the chosen index, the
|
|
418
|
+
* index sharpness alone would have chosen, and the extra detector time. */
|
|
419
|
+
| {
|
|
420
|
+
type: "keyframe";
|
|
421
|
+
tier: Detector["tier"] | null;
|
|
422
|
+
chosen: number;
|
|
423
|
+
sharpest: number;
|
|
424
|
+
detectMs: number;
|
|
425
|
+
candidates: Array<{
|
|
426
|
+
face: boolean;
|
|
427
|
+
frontal: number;
|
|
428
|
+
yaw?: number;
|
|
429
|
+
roll?: number;
|
|
430
|
+
eyes?: number;
|
|
431
|
+
score: number;
|
|
432
|
+
sharpness: number;
|
|
433
|
+
}>;
|
|
346
434
|
};
|
|
347
435
|
interface KeyframeCandidate {
|
|
348
436
|
blob: Blob;
|
|
@@ -381,7 +469,7 @@ interface CaptureSessionV3Options {
|
|
|
381
469
|
createRecorder?: () => Pick<ClipRecorder, "record" | "stop">;
|
|
382
470
|
/** (navigator.mediaDevices.getUserMedia) */
|
|
383
471
|
getUserMedia?: (constraints: MediaStreamConstraints) => Promise<MediaStream>;
|
|
384
|
-
/** (
|
|
472
|
+
/** (canvas keyframe, mirrored on the front camera only, + downscaled Laplacian sharpness) */
|
|
385
473
|
captureKeyframe?: (video: HTMLVideoElement) => Promise<KeyframeCandidate>;
|
|
386
474
|
/** (downscaled face-crop sharpness/exposure via canvas) */
|
|
387
475
|
measureQuality?: (video: HTMLVideoElement, box: {
|
|
@@ -398,13 +486,28 @@ interface CaptureSessionV3Options {
|
|
|
398
486
|
* worker-side through WorkerDetectorProxy. Hosts own Worker construction
|
|
399
487
|
* (bundler-specific `new Worker(new URL(...))`). */
|
|
400
488
|
createWorker?: () => WorkerLike;
|
|
489
|
+
/** Keyframe ranking switch (SDK spec §4.8a; server tuning
|
|
490
|
+
* `capture.liveness.keyframe.rank`, default off): read when positioning
|
|
491
|
+
* starts (prefetches the lazy ranker) and again when the capture fires.
|
|
492
|
+
* Off → today's sharpest-of-N, byte for byte. */
|
|
493
|
+
rankKeyframes?: () => boolean;
|
|
401
494
|
/** INERT (Phase 3 escalation seam — see EscalationHook). Accepted and
|
|
402
495
|
* retained, never called in Phases 1–2. */
|
|
403
496
|
escalation?: EscalationHook;
|
|
497
|
+
/** Upright guard (spec 2026-10-28 §4.2): the device is a phone, so a landscape frame (videoWidth > videoHeight)
|
|
498
|
+
* holds the gate and drops a clip being recorded (or the keyframes of a photo-mode capture). Read at each attempt
|
|
499
|
+
* start. (detectFormFactor() === 'phone' — desktop webcams are landscape by nature, and a tablet may stand in
|
|
500
|
+
* landscape on a stand: neither is ever guarded) */
|
|
501
|
+
isPhone?: () => boolean;
|
|
404
502
|
/** (performance.now) */
|
|
405
503
|
now?: () => number;
|
|
406
504
|
}
|
|
407
505
|
type Handler<K extends keyof CaptureSessionV3Events> = (payload: CaptureSessionV3Events[K]) => void;
|
|
506
|
+
/** Per-start options (the public handle's `start({ facing })`). */
|
|
507
|
+
interface CaptureSessionV3StartOptions {
|
|
508
|
+
/** Camera for this attempt AND later retries; absent → keep the current one. */
|
|
509
|
+
facingMode?: "user" | "environment";
|
|
510
|
+
}
|
|
408
511
|
declare class CaptureSessionV3 {
|
|
409
512
|
private readonly options;
|
|
410
513
|
private readonly handlers;
|
|
@@ -418,14 +521,25 @@ declare class CaptureSessionV3 {
|
|
|
418
521
|
private profiler;
|
|
419
522
|
private lastGuidanceKey;
|
|
420
523
|
private positioningStartedAt;
|
|
524
|
+
private cameraRequestedAt;
|
|
525
|
+
private cameraReadyAt;
|
|
526
|
+
private faceAcquiredAt;
|
|
527
|
+
private captureCompleteAt;
|
|
421
528
|
private fired;
|
|
422
529
|
private carriedDegrade;
|
|
423
530
|
private carriedMeans;
|
|
531
|
+
private blockStats;
|
|
532
|
+
private lastGateSnapshotAt;
|
|
533
|
+
/** The upright guard applies to this attempt (a phone). */
|
|
534
|
+
private uprightGuard;
|
|
424
535
|
constructor(options: CaptureSessionV3Options);
|
|
425
536
|
get state(): CaptureState;
|
|
426
537
|
on<K extends keyof CaptureSessionV3Events>(event: K, handler: Handler<K>): () => void;
|
|
427
538
|
private emit;
|
|
428
|
-
start(): Promise<void>;
|
|
539
|
+
start(options?: CaptureSessionV3StartOptions): Promise<void>;
|
|
540
|
+
/** The camera of the current attempt: the one its track reports once the stream is live, else the requested one
|
|
541
|
+
* (start option, switchCamera toggles). */
|
|
542
|
+
get facingMode(): "user" | "environment";
|
|
429
543
|
/** Full reset + camera restart — the documented recovery path (v1 parity). */
|
|
430
544
|
retry(): void;
|
|
431
545
|
switchCamera(): void;
|
|
@@ -436,10 +550,22 @@ declare class CaptureSessionV3 {
|
|
|
436
550
|
private startScheduler;
|
|
437
551
|
private detectTick;
|
|
438
552
|
private fire;
|
|
439
|
-
/**
|
|
553
|
+
/** A phone showing a landscape frame: the guard holds the gate. */
|
|
554
|
+
private isLandscape;
|
|
555
|
+
/** Positioning on a sideways phone: no detection, the gate restarts from zero and the coaching says why. */
|
|
556
|
+
private holdUpright;
|
|
557
|
+
/** While the clip records (or, `recorder` null, the photo-mode keyframes are taken): a rotation to landscape aborts
|
|
558
|
+
* it. Returns the unwatch function. */
|
|
559
|
+
private watchRotation;
|
|
560
|
+
/** Drop the clip being recorded (or the photo-mode keyframes being taken; same stream, same detector) and go back to
|
|
561
|
+
* positioning with the upright coaching. */
|
|
562
|
+
private abortRecording;
|
|
563
|
+
/** Up to KEYFRAME_CANDIDATES frames (mirrored on the front camera) over KEYFRAME_WINDOW_MS —
|
|
440
564
|
* sharpest wins (reuses frame-quality.sharpness via the capture seam). */
|
|
441
565
|
private collectKeyframes;
|
|
442
566
|
private finishCapture;
|
|
567
|
+
/** The attempt's capture-phase timing (whole ms, ≥ 0); undefined when no mark landed. */
|
|
568
|
+
private captureTiming;
|
|
443
569
|
private defaultKeyframe;
|
|
444
570
|
/** Reused downscale canvas — falls back to the raw video where canvas 2D
|
|
445
571
|
* is unavailable (jsdom) so tests and exotic hosts keep detecting. */
|
|
@@ -448,10 +574,12 @@ declare class CaptureSessionV3 {
|
|
|
448
574
|
private defaultQuality;
|
|
449
575
|
private centerSharpness;
|
|
450
576
|
private teardownAttempt;
|
|
577
|
+
/** Emit the attempt's gate breakdown; a final report closes it (exactly once). */
|
|
578
|
+
private reportGate;
|
|
451
579
|
private stopTracks;
|
|
452
580
|
private fail;
|
|
453
581
|
private setState;
|
|
454
582
|
private now;
|
|
455
583
|
}
|
|
456
584
|
|
|
457
|
-
export {
|
|
585
|
+
export { isMediaRecorderSupported 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, V3_GATE_DEFAULTS as P, VIDEO_BPS as Q, blockReasonOf as R, STOP_GRACE_MS as S, TIMESLICE_MS as T, UPRIGHT_WATCH_MS as U, type V3ChecksPayload as V, buildLivenessV2FormData as W, cameraPreflight as X, classifyDevice as Y, extForMime as Z, isClipTooLarge as _, CLIP_MS as a, mapGetUserMediaError as a0, pickMimeType as a1, probeDevice as a2, 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 };
|