@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
package/README.md
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
# @sekyro/web
|
|
2
2
|
|
|
3
|
-
Browser SDK for [Sekyro](https://sekyro.ai) identity verification: liveness capture
|
|
4
|
-
(v3 engine), the
|
|
5
|
-
|
|
3
|
+
Browser SDK for [Sekyro AI](https://sekyro.ai) identity verification: liveness capture
|
|
4
|
+
(v3 engine), the step runner that renders any Sekyro flow headless
|
|
5
|
+
(`verification.run()`), the document scanner, the typed hosted-verification client
|
|
6
|
+
and the hosted-flow popup embed. Framework-free; pair it with `@sekyro/react` for
|
|
7
|
+
ready-made `<LivenessCapture>` and `<SekyroVerification>` components.
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install @sekyro/web@next
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Use of the SDK is governed by the [Sekyro AI SDK License](https://sekyro.ai/legal/sdk-license)
|
|
14
|
+
(summarised in `LICENSE`) and your Sekyro AI customer agreement.
|
|
6
15
|
|
|
7
16
|
```ts
|
|
8
17
|
import { createVerification } from "@sekyro/web";
|
|
9
18
|
|
|
10
19
|
const v = createVerification({ clientToken, locale: "ar" }); // token from your server (@sekyro/node)
|
|
11
20
|
v.on("result", ({ status, reason }) => {
|
|
12
|
-
// approved | rejected | review | retry | unavailable
|
|
21
|
+
// approved | rejected | review | retry | unavailable: for display;
|
|
13
22
|
// the verdict that counts is read server-side (sessions.get + webhooks).
|
|
14
23
|
});
|
|
15
24
|
const cap = v.liveness({ video }); // your <video playsinline muted>
|
|
@@ -19,75 +28,117 @@ void v.startRegistry();
|
|
|
19
28
|
await cap.start();
|
|
20
29
|
```
|
|
21
30
|
|
|
22
|
-
**Read the [
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
31
|
+
**Read the [web SDK guide](https://docs.sekyro.ai/en/web/embedded-sdk)** for the full integration:
|
|
32
|
+
flows and session creation, every step of a flow headless (`verification.run()`),
|
|
33
|
+
results, webhooks, allowed web origins, CSP, model assets (`assetBaseUrl`), reason
|
|
34
|
+
codes, billing. Hosted-flow embed only? See *Hosted popup* below and the
|
|
35
|
+
[quickstart](https://docs.sekyro.ai/en/getting-started/quickstart).
|
|
26
36
|
|
|
27
37
|
Requirements: a secure context (HTTPS or `localhost`), self-hosted detector assets
|
|
28
|
-
under `/models-v3` (or `assetBaseUrl`), and your page origin
|
|
38
|
+
under `/models-v3` (or `assetBaseUrl`), and your page origin in the app's allowed web
|
|
39
|
+
origins (dashboard: app page → Integration → Platforms → Web).
|
|
40
|
+
|
|
41
|
+
Privacy: the SDK collects a device fingerprint for fraud prevention (browser, hardware
|
|
42
|
+
and camera traits, hashed in the browser before they are sent, plus the Chromium phone
|
|
43
|
+
model and operating system version). No permission is asked, the fingerprinting library makes no network
|
|
44
|
+
request of its own, and nothing is stored for it. Name it in your privacy notice; see
|
|
45
|
+
*Device fingerprinting* in the [web SDK guide](https://docs.sekyro.ai/en/web/embedded-sdk).
|
|
46
|
+
|
|
47
|
+
## Preload & camera probes
|
|
48
|
+
|
|
49
|
+
Warm the face detector before the user taps Start (on the step before the
|
|
50
|
+
capture, or at mount), and read the camera permission for your "get ready" UI:
|
|
51
|
+
|
|
52
|
+
```ts
|
|
53
|
+
import { createLivenessCapture, getLivenessAssetsStatus, hasMultipleCameras,
|
|
54
|
+
preloadLivenessAssets, subscribeCameraPermission, subscribeLivenessAssets } from "@sekyro/web";
|
|
55
|
+
|
|
56
|
+
void preloadLivenessAssets({ assetBaseUrl: "/models-v3", idle: true }); // never rejects
|
|
57
|
+
const gateStart = (s: string) => (startBtn.disabled = s === "loading");
|
|
58
|
+
gateStart(getLivenessAssetsStatus("/models-v3")); // subscribe does not emit the current status
|
|
59
|
+
subscribeLivenessAssets(gateStart, "/models-v3");
|
|
60
|
+
subscribeCameraPermission((p) => showCameraRow(p)); // granted|prompt|denied|unknown
|
|
61
|
+
const showFacingChoice = await hasMultipleCameras();
|
|
62
|
+
|
|
63
|
+
const cap = createLivenessCapture({ video, assetBaseUrl: "/models-v3" });
|
|
64
|
+
await cap.start({ facing: "user" }); // reuses the warm detector automatically
|
|
65
|
+
```
|
|
29
66
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
67
|
+
- `preloadLivenessAssets` is idempotent per `assetBaseUrl` and resolves the settled
|
|
68
|
+
status: `'ready'`, `'failed'` (call it again to retry), or `'idle'`: nothing was
|
|
69
|
+
preloaded (SSR, no camera API, Data Saver with `respectSaveData`), so start
|
|
70
|
+
normally. `idle: true` defers the load to browser idle time; a capture that
|
|
71
|
+
starts meanwhile begins it at once.
|
|
72
|
+
- The preload warms the blaze (MediaPipe) tier with a generous deadline. Every
|
|
73
|
+
capture created afterwards with the same `assetBaseUrl` uses it without any extra
|
|
74
|
+
wiring, and destroying a capture never frees it; call
|
|
75
|
+
`releaseLivenessAssets(assetBaseUrl)` when the user leaves the flow (never while a
|
|
76
|
+
capture is mounted). Without a preload the capture loads the detector itself.
|
|
77
|
+
- `getLivenessAssetsStatus` / `subscribeLivenessAssets` follow the
|
|
78
|
+
`useSyncExternalStore` contract (no emit on subscribe). `subscribeCameraPermission`
|
|
79
|
+
emits the current state first, then every change; `queryCameraPermission` is the
|
|
80
|
+
one-shot read. Both report `'unknown'` where the Permissions API cannot tell.
|
|
81
|
+
- The session decides who films the face (`HostedSessionView.capture.mode`, a flow
|
|
82
|
+
setting), read from `handle.captureMode`. A **self** capture (the default, and
|
|
83
|
+
every `createLivenessCapture()` not bound to a session) uses the front camera:
|
|
84
|
+
`facing: "environment"` is ignored with a console warning and `switchCamera()`
|
|
85
|
+
returns `false`. An **assisted** capture (an agent films the person) opens the back
|
|
86
|
+
camera by default (the front one on a device without a front/back choice);
|
|
87
|
+
`handle.facingMode` reports the camera the stream actually uses; `start({ facing })` picks the camera for the attempt and its
|
|
88
|
+
retries and `switchCamera()` flips it (returns `true`).
|
|
89
|
+
- On a phone the camera must be held upright: a landscape frame holds the gate
|
|
90
|
+
(hint `upright`), and turning the phone sideways while the clip records drops that
|
|
91
|
+
clip and goes back to positioning. Tablets and desktop webcams are not affected.
|
|
92
|
+
- `keepScreenAwake` (capture option, default `true`) holds a Screen Wake Lock while
|
|
93
|
+
the camera is live (`starting` / `gating` / `recording`), released on `captured`,
|
|
94
|
+
`error` and `destroy()`, re-taken on `retry()` and when the page is visible again.
|
|
95
|
+
Best effort: unsupported or refused requests never affect the capture. In an
|
|
96
|
+
iframe, allow it: `<iframe allow="camera; screen-wake-lock">`. Pass `false` to
|
|
97
|
+
never request it.
|
|
98
|
+
|
|
99
|
+
## Hosted popup
|
|
100
|
+
|
|
101
|
+
`openHosted(hostedUrl, { mode, onEvent })` opens the hosted flow (the session's
|
|
102
|
+
`hostedUrl`) in a popup (`mode: "popup"`) or navigates this tab to it
|
|
103
|
+
(`mode: "redirect"`). A blocked popup returns `{ error: "popup_blocked" }`: fall back
|
|
104
|
+
to `mode: "redirect"` yourself.
|
|
105
|
+
|
|
106
|
+
```ts
|
|
107
|
+
import { openHosted } from "@sekyro/web";
|
|
108
|
+
|
|
109
|
+
const popup = openHosted(hostedUrl, {
|
|
110
|
+
mode: "popup",
|
|
111
|
+
onEvent: ({ event, sessionId }) => {
|
|
112
|
+
// session.completed | session.failed | session.review_pending | session.expired | session.cancelled
|
|
113
|
+
// A hint only: read the session on your server (sessions.get) before deciding.
|
|
114
|
+
},
|
|
115
|
+
});
|
|
116
|
+
if ("error" in popup) window.location.assign(hostedUrl);
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Events carry `{ source: "sekyro", version: 1, event, sessionId }` and nothing else (no
|
|
120
|
+
scores, no personal data). The hosted page posts them only to the **first** allowed web
|
|
121
|
+
origin of the app (dashboard: app page → Integration → Platforms → Web), so open the
|
|
122
|
+
popup from a page on that origin. The listener accepts a message only from that popup
|
|
123
|
+
window and the hosted page's origin. Events can repeat (a reload after a terminal state posts
|
|
124
|
+
it again; closing or reloading mid-flow posts `session.cancelled`), so confirm the
|
|
125
|
+
outcome server-side. Keep one popup per page: call `close()` on the previous handle
|
|
126
|
+
before opening another.
|
|
33
127
|
|
|
34
128
|
## Entry points
|
|
35
129
|
|
|
36
130
|
| Export | Contents | Public API |
|
|
37
131
|
|---|---|---|
|
|
38
|
-
| `@sekyro/web` | **The partner API
|
|
132
|
+
| `@sekyro/web` | **The partner API**: `createVerification` (consent → early registry → liveness capture → upload → Turnstile attestation → `liveness` + `face_match` → `result`, and `run()`, the step runner for every step of the session's flow), `createLivenessCapture` (standalone capture handle), `createDocumentCapture` (standalone document scanner), `openHosted` (popup/redirect embed) and the contract types. Surface pinned by `etc/sekyro-web.api.md` (api-extractor) | Yes |
|
|
39
133
|
| `@sekyro/web/core` | Framework-free capture: `CaptureSessionV3`, `createDetector`, `FaceGateV3`, frame quality, device profile, `media`/`keyframe`/`messages`/`ClipRecorder` (calibration-pinned v1 port), camera constraints | Yes |
|
|
40
|
-
| `@sekyro/web/core/v3/detect-worker` | Standalone detection-worker entry
|
|
134
|
+
| `@sekyro/web/core/v3/detect-worker` | Standalone detection-worker entry: construct with `new Worker(new URL('@sekyro/web/core/v3/detect-worker', import.meta.url))` so its worker-scope auto-install never rides a main-thread bundle | Yes |
|
|
135
|
+
| `@sekyro/web/core/ocr/worker` (+ `worker.bundle.js`) | The live MRZ reader's Web Worker: pass `new URL('@sekyro/web/core/ocr/worker', import.meta.url)` as `liveMrz.workerUrl`, or copy the self-contained `dist/core/ocr/worker.bundle.js` to your static folder | Yes |
|
|
41
136
|
| `@sekyro/web/client` | Typed client for the hosted session API: `HostedClient`, error codes, check input/view types | Yes |
|
|
42
137
|
| `@sekyro/web/popup` | Partner-facing popup/redirect embed (`open`, `SekyroEvent`) | Yes |
|
|
43
|
-
| `@sekyro/web/internal` | **Not public.** Document scanner (doc catalog, `DocGateV1`, MRZ band, frame analysis, feedback aggregator, `CaptureSessionDoc`) + gate-debug geometry constants + the verification internals (`createVerificationInternal` / `createLivenessCaptureInternal` seams, `runLivenessFlow`, `runSubmission`, result mapping, Turnstile loader), consumed by Sekyro's hosted page / `@sekyro/react` only. No semver guarantees; may change in any release | No |
|
|
138
|
+
| `@sekyro/web/internal` | **Not public.** Document scanner (doc catalog, `DocGateV1`, MRZ band, frame analysis, feedback aggregator, `CaptureSessionDoc`) + gate-debug geometry constants + the verification internals (`createVerificationInternal` / `createLivenessCaptureInternal` seams, `runLivenessFlow`, `runSubmission`, result mapping, Turnstile loader), consumed by Sekyro AI's hosted page / `@sekyro/react` only. No semver guarantees; may change in any release | No |
|
|
44
139
|
|
|
45
140
|
Every entry ships ESM + CJS + `.d.ts` (`tsup`). `./core` deliberately does **not**
|
|
46
141
|
re-export the document scanner (that lives only under `./internal`) nor the worker
|
|
47
142
|
entry.
|
|
48
143
|
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
`src/core/media.ts`, `keyframe.ts`, and `messages.ts` are **byte-identical ports** of
|
|
52
|
-
v1's `kyc-ibtikar/lib/faceCaptureV2/*`. The only allowed delta is the 3-line port
|
|
53
|
-
header block (two comment lines + one blank separator line) prepended to each file.
|
|
54
|
-
`src/core/clip-recorder.ts` is the de-hooked `useClipRecorder` with identical
|
|
55
|
-
constants and behavior (`CLIP_MS=2500`, `TIMESLICE_MS=1000`, `STOP_GRACE_MS=1500`,
|
|
56
|
-
`VIDEO_BPS=2_500_000`, `MAX_CLIP_BYTES=8MiB`, mime ladder, guarded double construction,
|
|
57
|
-
incremental cap enforcement, stop-grace finalize, single-settle, stop-all-tracks).
|
|
58
|
-
|
|
59
|
-
The FAS-CLIP liveness model was calibrated on clips produced by exactly this v1
|
|
60
|
-
pipeline (spec §6 / risk 1). Any drift silently invalidates the calibration.
|
|
61
|
-
`test/port-parity.test.ts` enforces this in two layers: a sha256 checksum pin against
|
|
62
|
-
the committed `test/port-manifest.json` that runs **everywhere, CI included**, and a
|
|
63
|
-
byte-level comparison against the real v1 sources that runs on every dev machine with
|
|
64
|
-
the `kyc-ibtikar/` checkout alongside (that layer self-skips in CI, where the
|
|
65
|
-
gitignored v1 checkout is absent — and it also verifies the manifest itself matches
|
|
66
|
-
header + v1 bytes, so the manifest cannot drift). Do NOT edit `src/core/` without a
|
|
67
|
-
calibration re-validation; if a re-validated change ever lands, regenerate the
|
|
68
|
-
manifest hashes alongside it.
|
|
69
|
-
|
|
70
|
-
The parity test resolves the v1 checkout as `../../kyc-ibtikar/lib/faceCaptureV2`
|
|
71
|
-
from the package root, so this package must stay **two levels below the repo root**
|
|
72
|
-
(`packages/sekyro-web`).
|
|
73
|
-
|
|
74
|
-
Note: v1's `upload.ts` is intentionally NOT ported — uploading is the typed client's
|
|
75
|
-
job in v2 (`HostedClient.uploadAndSubmit`).
|
|
76
|
-
|
|
77
|
-
## Develop
|
|
78
|
-
|
|
79
|
-
```bash
|
|
80
|
-
npm ci
|
|
81
|
-
npm run build # tsup → dist/ (ESM + CJS + d.ts per entry)
|
|
82
|
-
npm test # vitest (jsdom)
|
|
83
|
-
npm run typecheck # tsc --noEmit
|
|
84
|
-
npm run api:check # api-extractor: fails when the ROOT public surface drifts from etc/sekyro-web.api.md
|
|
85
|
-
npm run api:report # regenerate etc/sekyro-web.api.md after an intentional, reviewed API change
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
The api-extractor report covers the root `.` entry only (the partner contract); the
|
|
89
|
-
subpath entries (`./core`, `./client`, `./popup`) are not reported. `npm run build` must
|
|
90
|
-
precede `api:check` (it reads `dist/index.d.ts`).
|
|
91
|
-
|
|
92
|
-
Standalone package: own lockfile, no workspace wiring. `identity-hosted` consumes it
|
|
93
|
-
via `"@sekyro/web": "file:../packages/sekyro-web"` and needs `dist/` built first.
|
|
144
|
+
When the service is busy (503 `server_busy` or `request_timeout`), `HostedClient` retries a call that is safe to repeat once, after the `Retry-After` the service sends (2 seconds without one). When the model service is unavailable (503 `inference_unavailable`), a submission retries up to three times, after the `Retry-After` (10 seconds without one), and emits `busy` with the wait. Both waits are capped at 20 seconds and spread by ±25 % (at least 0.5 seconds) so clients do not all come back at once.
|
|
@@ -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 @@
|
|
|
1
|
+
import{a,b,c,d}from"./chunk-TQB3URP2.js";export{a as bounded,c as cameraHash,b as hex16,d as noteCameraTrait};
|
|
@@ -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,K as i,L as j,M as k}from"./chunk-U6S7SCBY.js";import"./chunk-SMKCBUJL.js";import"./chunk-MXWLCDFX.js";import"./chunk-G6LKLN4U.js";import"./chunk-TDLIXFDT.js";import"./chunk-POIQGEZM.js";import"./chunk-CQ7SKLMC.js";import"./chunk-FPXL63KZ.js";import"./chunk-ZLWH4RBO.js";import"./chunk-DK5YPBDQ.js";export{k as CAPTURE_CANDIDATE_SPACING_MS,j as CAPTURE_EXTRA_CANDIDATES,h as CaptureSessionDoc,c as DOC_BLACK_FRAME_LUMA,d as DOC_BLACK_FRAME_TICKS,e as DOC_CADENCE_HZ,b as DOC_FIRST_FRAME_MS,f as DOC_SHUTTER_DEFAULTS,i as passportBandOf,g as resolveDocShutterTuning,a as warmDocDetector};
|