@sekyro/web 0.1.0-rc.20 → 0.1.0-rc.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (96) hide show
  1. package/CHANGELOG.md +58 -0
  2. package/README.md +12 -11
  3. package/dist/camera-trait-V4UAOPIQ.js +1 -0
  4. package/dist/{capture-constraints-B5omafmk.d.cts → capture-constraints-CVqpMNGA.d.cts} +7 -3
  5. package/dist/{capture-constraints-B5omafmk.d.ts → capture-constraints-CVqpMNGA.d.ts} +7 -3
  6. package/dist/{capture-session-doc-QA4DOFRF.js → capture-session-doc-YDUKUN3P.js} +1 -1
  7. package/dist/{capture-session-v3-CNL-GX11.d.cts → capture-session-v3-CkcuPKSD.d.ts} +90 -13
  8. package/dist/{capture-session-v3-DaBqN8fO.d.ts → capture-session-v3-TJL-0Muv.d.cts} +90 -13
  9. package/dist/chunk-2KTSNAVR.js +1 -0
  10. package/dist/chunk-2LDOXGY3.js +1 -0
  11. package/dist/chunk-32ELI5BZ.js +1 -0
  12. package/dist/chunk-33KKMPJ5.js +1 -0
  13. package/dist/chunk-53POX7U4.js +1 -0
  14. package/dist/chunk-7QZWBDI5.js +1 -0
  15. package/dist/chunk-7XT5YDSC.js +1 -0
  16. package/dist/chunk-BATJN3VQ.js +1 -0
  17. package/dist/chunk-CPUECYAJ.js +1 -0
  18. package/dist/chunk-FSSMUAKC.js +1 -0
  19. package/dist/{chunk-IG466TOP.js → chunk-HYGINGDC.js} +1 -1
  20. package/dist/chunk-LJYMZQY2.js +1 -0
  21. package/dist/chunk-PZYVSLPG.js +1 -0
  22. package/dist/chunk-RALQBQPT.js +1 -0
  23. package/dist/chunk-SX7TUC3V.js +1 -0
  24. package/dist/chunk-TJUM65FN.js +1 -0
  25. package/dist/chunk-TSA6GHUG.js +1 -0
  26. package/dist/chunk-VWGKUQ3C.js +1 -0
  27. package/dist/chunk-Z2BIZYZQ.js +1 -0
  28. package/dist/chunk-Z5D7SZUW.js +1 -0
  29. package/dist/client/index.cjs +1 -1
  30. package/dist/client/index.d.cts +3 -3
  31. package/dist/client/index.d.ts +3 -3
  32. package/dist/client/index.js +1 -1
  33. package/dist/clip-inspect-DLJXVKV6.js +1 -0
  34. package/dist/core/index.cjs +1 -1
  35. package/dist/core/index.d.cts +5 -5
  36. package/dist/core/index.d.ts +5 -5
  37. package/dist/core/index.js +1 -1
  38. package/dist/core/v3/detect-worker.cjs +1 -1
  39. package/dist/core/v3/detect-worker.d.cts +1 -1
  40. package/dist/core/v3/detect-worker.d.ts +1 -1
  41. package/dist/core/v3/detect-worker.js +1 -1
  42. package/dist/create-document-capture-K6EHRCWN.js +1 -0
  43. package/dist/create-portrait-capture-5VGYZUOK.js +1 -0
  44. package/dist/{create-verification-COpe2hxf.d.ts → create-verification-DnyHCSu6.d.cts} +216 -82
  45. package/dist/{create-verification-BBOUYpga.d.cts → create-verification-DoISHOqL.d.ts} +216 -82
  46. package/dist/{detect-worker-DclNxkZT.d.cts → detect-worker-CHqsPJoM.d.cts} +19 -2
  47. package/dist/{detect-worker-DclNxkZT.d.ts → detect-worker-CHqsPJoM.d.ts} +19 -2
  48. package/dist/{icao-gate-CEGvJR3q.d.ts → icao-gate-BFlSZYCZ.d.cts} +36 -4
  49. package/dist/icao-gate-T3BTOKFJ.js +1 -0
  50. package/dist/{icao-gate-l40OU6x1.d.cts → icao-gate-lZ_fHE7k.d.ts} +36 -4
  51. package/dist/{icao-policy-BgI1Y870.d.ts → icao-policy-BOcutYdD.d.ts} +3 -3
  52. package/dist/{icao-policy-C7fIdRzo.d.cts → icao-policy-JZH0UdmD.d.cts} +3 -3
  53. package/dist/icao-tuning-4ETMF53W.js +1 -0
  54. package/dist/index.cjs +1 -1
  55. package/dist/index.d.cts +11 -15
  56. package/dist/index.d.ts +11 -15
  57. package/dist/index.js +1 -1
  58. package/dist/internal/index.cjs +1 -1
  59. package/dist/internal/index.d.cts +53 -34
  60. package/dist/internal/index.d.ts +53 -34
  61. package/dist/internal/index.js +1 -1
  62. package/dist/plan-runner-3ZMV7SFQ.js +1 -0
  63. package/dist/popup/index.cjs +1 -1
  64. package/dist/popup/index.d.cts +3 -3
  65. package/dist/popup/index.d.ts +3 -3
  66. package/dist/popup/index.js +1 -1
  67. package/dist/{print-AYSCRSZB.js → print-SEWS3VHQ.js} +1 -1
  68. package/dist/{turnstile-FATNZ4AG.js → turnstile-2J3LUHCG.js} +1 -1
  69. package/dist/{types-Dpfg2cO8.d.cts → types-DwfyBTte.d.cts} +167 -79
  70. package/dist/{types-Dpfg2cO8.d.ts → types-DwfyBTte.d.ts} +167 -79
  71. package/package.json +1 -1
  72. package/sbom.cdx.json +10 -10
  73. package/dist/camera-trait-45MJTW4K.js +0 -1
  74. package/dist/chunk-5ZKQHFFW.js +0 -1
  75. package/dist/chunk-7ZCZY3ZP.js +0 -1
  76. package/dist/chunk-BPE5NSQ2.js +0 -1
  77. package/dist/chunk-CQ7SKLMC.js +0 -1
  78. package/dist/chunk-FGOVIGGL.js +0 -1
  79. package/dist/chunk-FUHDOEBP.js +0 -1
  80. package/dist/chunk-GT2ZLGF7.js +0 -1
  81. package/dist/chunk-KHR4U2SZ.js +0 -1
  82. package/dist/chunk-KZBBB5B2.js +0 -1
  83. package/dist/chunk-NJML6FMD.js +0 -1
  84. package/dist/chunk-O5WKNZ2C.js +0 -1
  85. package/dist/chunk-OKWG3PVH.js +0 -1
  86. package/dist/chunk-TQB3URP2.js +0 -1
  87. package/dist/chunk-U6S7SCBY.js +0 -1
  88. package/dist/chunk-U6TYL2IJ.js +0 -1
  89. package/dist/chunk-W2WD7PR2.js +0 -1
  90. package/dist/chunk-XCKE2MJL.js +0 -1
  91. package/dist/chunk-ZLWH4RBO.js +0 -1
  92. package/dist/create-document-capture-GJXBQMTC.js +0 -1
  93. package/dist/create-portrait-capture-MOS2D7CL.js +0 -1
  94. package/dist/icao-gate-PWBMKRGC.js +0 -1
  95. package/dist/icao-tuning-4GGVX6B4.js +0 -1
  96. package/dist/plan-runner-35655N4Z.js +0 -1
@@ -52,11 +52,12 @@ declare const ICAO_DEVICE_LIMITS: {
52
52
  readonly eyes: {
53
53
  readonly relativeMin: 0.62;
54
54
  readonly blinkMax: 0.48;
55
+ readonly lowerEyeMin: 0.32;
55
56
  };
56
57
  readonly mouth: {
57
58
  readonly jawOpenMax: 0.13;
58
59
  readonly smileMax: 0.28;
59
- readonly puckerMax: 0.28;
60
+ readonly puckerMax: 0.48;
60
61
  };
61
62
  readonly lighting: {
62
63
  readonly faceLuma: readonly [95, 185];
@@ -84,6 +85,7 @@ declare const ICAO_DEVICE_LIMITS: {
84
85
  readonly eyes: {
85
86
  readonly relativeMin: 0.62;
86
87
  readonly blinkMax: 0.48;
88
+ readonly lowerEyeMin: 0.32;
87
89
  };
88
90
  readonly mouth: {
89
91
  readonly jawOpenMax: 0.13;
@@ -129,6 +131,7 @@ interface IcaoCaptureTuning {
129
131
  eyes?: {
130
132
  relativeMin?: number;
131
133
  blinkMax?: number;
134
+ lowerEyeMin?: number;
132
135
  earMin?: number;
133
136
  };
134
137
  mouth?: {
@@ -189,6 +192,7 @@ interface ResolvedIcaoTuning {
189
192
  eyes: {
190
193
  relativeMin: number;
191
194
  blinkMax: number;
195
+ lowerEyeMin: number;
192
196
  };
193
197
  mouth: {
194
198
  jawOpenMax: number;
@@ -239,19 +243,37 @@ declare const ICAO_FALLBACK: Omit<ResolvedIcaoTuning, "tuningVersion">;
239
243
  */
240
244
  declare function resolveIcaoTuning(raw: unknown, tuningVersion?: unknown): ResolvedIcaoTuning;
241
245
 
242
- /** Session lifecycle status (spec §4 two-field status/outcome model). */
243
- type SessionStatus = "created" | "in_progress" | "review_pending" | "completed" | "expired" | "failed";
244
246
  /**
245
- * Terminal verdict, orthogonal to `status`; `null` until terminal/review.
246
- * `superseded` (status `completed`): the session waited for a review and a
247
- * newer attempt of the same person took that review over; its review step
248
- * failed with `superseded_by_retry`, and the verdict is on the newer session.
247
+ * Session lifecycle status (session outcome model 2026-11-08): a finished session is
248
+ * `verified` or `not_verified`; a `not_verified` one says why in {@link SessionReason},
249
+ * and every finished one says who or what closed it in {@link ClosedBy}.
250
+ */
251
+ type SessionStatus = "created" | "in_progress" | "review_pending" | "verified" | "not_verified";
252
+ /**
253
+ * Why a `not_verified` session was not verified (verification-session.schema.ts
254
+ * `SESSION_REASONS`): a verdict against the person (`rejected`), no verdict
255
+ * (`inconclusive`), the check could not run (`unavailable`), the person left before a
256
+ * result (`abandoned`), nobody opened the link (`not_opened`), a flow rule (`policy`),
257
+ * the organization cancelled it (`cancelled`), a newer session took its review over
258
+ * (`superseded`).
249
259
  */
250
- type SessionOutcome = "approved" | "review" | "rejected" | "superseded";
260
+ type SessionReason = "rejected" | "inconclusive" | "unavailable" | "abandoned" | "not_opened" | "policy" | "cancelled" | "superseded";
261
+ /** Who or what closed a finished session (verification-session.schema.ts `CLOSED_BY`). */
262
+ type ClosedBy = "automatic" | "reviewer" | "deadline" | "expiry" | "organization";
263
+ /**
264
+ * What a step's last counted attempt said (verification-session.schema.ts `STEP_RESULTS`);
265
+ * absent before the first counted attempt.
266
+ */
267
+ type StepResult = "passed" | "rejected" | "inconclusive" | "unreadable" | "unavailable" | "review";
268
+ /** The step that decided a `not_verified` session: its node id and its service. */
269
+ interface SessionDecidingStep {
270
+ id: string;
271
+ service: string;
272
+ }
251
273
  /**
252
274
  * What a finished session proved (spec 2026-10-29 §3.2): `1` a live, real
253
275
  * person, `2` that person's identity, `3` an identity corroborated by an
254
- * independent source; `0` on a rejected session.
276
+ * independent source; `0` on a `not_verified` session.
255
277
  */
256
278
  type VerificationLevel = 0 | 1 | 2 | 3;
257
279
  /** How a session's {@link VerificationLevel} was proved (spec 2026-10-29 §3.4). */
@@ -265,9 +287,9 @@ type CheckState = "pending" | "input_required" | "processing" | "passed" | "fail
265
287
  * `eid_auth` (SDK spec §3.2) is the national eID sign-in (Houwiyeti in MR).
266
288
  */
267
289
  type CheckType = "liveness" | "face_match" | "doc_ocr" | "population_registry" | "phone_otp" | "nfc_chip" | "email_otp" | "portrait_icao" | "eid_auth";
268
- type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "uncalibrated_capture_channel" | "capture_back_camera" | "capture_not_upright" | "camera_unavailable";
269
- type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "result_from_cache" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
270
- type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved" | "prior_review_rejected";
290
+ type LivenessReason = "no_face" | "media_unreadable" | "clip_too_short" | "spoof_detected" | "review_band" | "liveness_inconclusive" | "device_integrity_failed" | "mobile_required" | "capture_back_camera" | "capture_not_upright" | "capture_front_camera" | "multiple_faces" | "camera_unavailable";
291
+ type PopulationReason = "registry_record_not_found" | "nni_not_found" | "id_number_invalid" | "nni_invalid" | "registry_unavailable" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "id_number_recheck" | "nni_recheck";
292
+ type FaceMatchReason = "no_face_source" | "no_face_reference" | "low_quality_reference" | "below_threshold" | "review_band" | "match_inconclusive" | "subject_revoked" | "probe_not_from_liveness" | "prior_review_approved";
271
293
  type DocReason = "side_missing" | "mrz_checksum_failed" | "unreadable" | "expired_document" | "authenticity_review" | "document_authenticity" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "nationality_unreadable" | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "name_mismatch" | "birth_date_mismatch" | "nationality_mismatch" | "document_number_mismatch";
272
294
  /**
273
295
  * Profile v2 step 3 matching reasons: a field the partner sent at session
@@ -302,7 +324,7 @@ type EmailOtpReason = "otp_mismatch" | "otp_expired" | "otp_send_failed" | "otp_
302
324
  /**
303
325
  * nfc_chip reasons (M-nfc, SDK spec §4.3). Native SDKs read the chip; the web
304
326
  * never does — on web the step arrives `skipped` (`platform_unsupported`) or
305
- * the session shows `failureReason: 'platform_unsupported'`.
327
+ * the session shows `reasonCode: 'platform_unsupported'`.
306
328
  */
307
329
  type NfcChipReason = "chip_read_failed" | "chip_access_denied" | "chip_parse_failed" | "chip_not_present" | "nfc_unavailable" | "chip_document_mismatch" | "chip_integrity_failed" | "registry_mismatch" | "document_id_number_mismatch" | "document_nni_mismatch" | "platform_unsupported";
308
330
  /**
@@ -339,12 +361,19 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
339
361
  */
340
362
  | "tester_document_mismatch" | "tester_phone_mismatch"
341
363
  /**
342
- * Review outcomes, on any reviewed step: `superseded_by_retry` (a newer
343
- * attempt of the same person took the review over; the session outcome is
344
- * `superseded`) and `review_split` (two reviewers disagreed and nobody
345
- * settled it before the review deadline; the session is rejected).
364
+ * Review ends, on any reviewed step: `superseded_by_retry` (a newer attempt of the
365
+ * same person took the review over; the session is `not_verified` with reason
366
+ * `superseded`) and `review_split` (two reviewers disagreed and nobody settled it
367
+ * before the review deadline; the session is `not_verified` with reason `inconclusive`).
346
368
  */
347
- | "superseded_by_retry" | "review_split";
369
+ | "superseded_by_retry" | "review_split"
370
+ /**
371
+ * Session outcome model §2.4: `review_timeout` (the review deadline passed, written on the
372
+ * reviewed step; the session is `not_verified` with reason `inconclusive`) and
373
+ * `inference_unavailable` (the model service could not run the check; the step's `result`
374
+ * is `unavailable`).
375
+ */
376
+ | "review_timeout" | "inference_unavailable";
348
377
  /**
349
378
  * Session-level failure reasons: the session was stopped by a policy gate,
350
379
  * not by a failed check. All are terminal (no retry on this session):
@@ -362,13 +391,6 @@ type CheckReason = LivenessReason | PopulationReason | FaceMatchReason | DocReas
362
391
  * - `blocked_by_org`: one of the organization's blocks stopped the session.
363
392
  */
364
393
  type SessionFailureReason = "location_not_allowed" | "anonymizer_blocked" | "capture_tampered" | "device_velocity_exceeded" | "device_cooldown" | "platform_unsupported" | "blocked_by_org" | "starter_credit_claimed";
365
- /**
366
- * The profile-v2 policy reasons a session can end on: the two session-level
367
- * reasons plus the failed check's policy reasons (`document_type_not_accepted`,
368
- * `nationality_not_allowed`, `underage`, `age_unverifiable`,
369
- * `document_id_number_mismatch`, formerly `document_nni_mismatch`).
370
- */
371
- type PolicyFailureReason = SessionFailureReason | "document_type_not_accepted" | "nationality_not_allowed" | "underage" | "age_unverifiable" | "document_id_number_mismatch" | "document_nni_mismatch" | "camera_unavailable" | "underage_estimated";
372
394
  /**
373
395
  * Why the person has no camera (spec 2026-10-29 §3.4, 2026-10-30): `denied` when the camera permission was refused,
374
396
  * `no_camera` when there is no usable camera (none found, an insecure page or a browser that cannot capture).
@@ -642,7 +664,7 @@ interface HostedEmailOtpView {
642
664
  * criterion; every one is retryable (re-run only the ICAO gate).
643
665
  * `media_unreadable` (no report) is shared with liveness.
644
666
  */
645
- type PortraitIcaoReason = "icao_pose" | "icao_eyes" | "icao_mouth" | "icao_occlusion" | "icao_lighting" | "icao_background" | "icao_resolution" | "portrait_not_from_liveness" | "portrait_recaptured" | "portrait_morph_suspected" | "portrait_reference_mismatch" | "portrait_declined_fix" | "portrait_fix_review";
667
+ type PortraitIcaoReason = "icao_pose" | "icao_eyes" | "icao_mouth" | "icao_occlusion" | "icao_lighting" | "icao_background" | "icao_resolution" | "portrait_not_from_liveness" | "portrait_morph_suspected" | "portrait_reference_mismatch" | "portrait_declined_fix" | "portrait_fix_review" | "capture_front_camera";
646
668
  /** One ICAO criterion of the server's portrait report (SDK spec §4.9). */
647
669
  type IcaoCriterion = "pose" | "eyes" | "mouth" | "occlusion" | "glare" | "lighting" | "background" | "resolution";
648
670
  /** The ICAO policy of a session's selfie (spec 2026-10-24 selfie ICAO policy §10). */
@@ -755,6 +777,8 @@ interface HostedStepView {
755
777
  state: CheckState;
756
778
  /** Frozen-taxonomy reason code explaining a `failed`/`review` state. */
757
779
  reason?: CheckReason;
780
+ /** What the last counted attempt said ({@link StepResult}); absent before the first one. */
781
+ result?: StepResult;
758
782
  /**
759
783
  * Liveness v7 §5.2: what to change for the next capture, on a liveness step parked at
760
784
  * `input_required` (the signal that weighed most in the inconclusive score). Absent on older
@@ -778,11 +802,8 @@ interface HostedStepView {
778
802
  otp?: HostedOtpView;
779
803
  /** email_otp only: the display-safe email send surface (never the handle or the address). */
780
804
  emailOtp?: HostedEmailOtpView;
781
- /**
782
- * The check failed after using all of its attempts — no retry is left.
783
- * Absent on older APIs (treat absent as `false`).
784
- */
785
- attemptsExhausted?: boolean;
805
+ /** Counted attempts and the cap (`used >= max`: no try is left). */
806
+ attempts?: PlanAttempts;
786
807
  /**
787
808
  * population_registry only: the session is not bound to an NNI, but the
788
809
  * document step already read a valid one — the page submits the registry
@@ -810,11 +831,10 @@ interface HostedStepView {
810
831
  /** phone_otp only (phone rules spec §2.1): numbers from other countries are accepted, through a free international field. */
811
832
  phoneInternational?: true;
812
833
  /**
813
- * liveness / face_match (profile v2 step 4, decision mode `automatic`): the
814
- * capture must come from a phone — the liveness band is calibrated on
815
- * mobile captures only. A desktop page hands the person off to their phone
816
- * instead of capturing (a desktop submission answers `mobile_required`).
817
- * Absent on older APIs and in `review` mode.
834
+ * Spec 2026-11-06 §3.1: the step's camera runs on a phone only, in every decision mode. Set on `liveness` and
835
+ * `face_match`, and on `doc_ocr` / `portrait_icao` whose photo source is `camera` or `choice` (under `choice` the
836
+ * upload stays on the desktop). A desktop page hands the camera over to a phone instead of opening the webcam; a
837
+ * camera capture from a desktop answers `409 mobile_required`. Absent on `upload` steps and steps without a camera.
818
838
  */
819
839
  requiresMobile?: boolean;
820
840
  /** nfc_chip only (M-nfc). */
@@ -845,8 +865,7 @@ type HostedVoiceLocale = "ar" | "fr" | "en";
845
865
  *
846
866
  * `clips[locale]` maps a voice key (`fcv3.*`, the `@sekyro/react` voice-key
847
867
  * namespace) to an ABSOLUTE URL on the Sekyro AI assets host
848
- * (`https://assets.sekyro.ai/voice/<setId>/<locale>/<name>.mp3`; staging:
849
- * `assets-staging.sekyro.ai`). URLs are immutable per `setId`. A locale or key
868
+ * (`https://assets.sekyro.ai/voice/<setId>/<locale>/<name>.mp3`). URLs are immutable per `setId`. A locale or key
850
869
  * may be missing — the player falls back to the device voice for it.
851
870
  *
852
871
  * A page with a Content-Security-Policy must allow the assets origin in
@@ -918,12 +937,18 @@ interface HostedCaptureTuning {
918
937
  * Who films the face, set in the flow (always present on current backends):
919
938
  * - `self` — the person films themselves: front camera only, no camera
920
939
  * choice, phone held upright;
921
- * - `assisted` — an agent films the person: back camera by default, the
922
- * front/back switch allowed, phone held upright.
940
+ * - `assisted` — another person films the person: back camera only, phone
941
+ * held upright.
923
942
  * `@sekyro/web` enforces it on a capture bound to the session; an absent
924
943
  * value falls back to {@link HostedCaptureTuning.cameraSwitch}, then `self`.
925
944
  */
926
945
  mode?: CaptureMode;
946
+ /**
947
+ * Spec 2026-11-06 §3.4, under `mode: 'choice'` only: the latest mode a camera attempt of this session ran in
948
+ * (`self` / `assisted`). Open the camera in it (a reloaded page), with the switch still offered. Absent before the
949
+ * first attempt and on older servers.
950
+ */
951
+ pick?: ResolvedCaptureMode;
927
952
  /**
928
953
  * @deprecated Mirror of `mode === 'assisted'`, kept for older clients. Read
929
954
  * {@link HostedCaptureTuning.mode}.
@@ -933,8 +958,9 @@ interface HostedCaptureTuning {
933
958
  /**
934
959
  * Who films the face (`HostedSessionView.capture.mode`, a flow setting):
935
960
  * `self` (the person, front camera), `assisted` (an agent, back camera) or
936
- * `choice` (the person picks `self` or `assisted` on the first camera step,
937
- * once for the session: {@link ResolvedCaptureMode}).
961
+ * `choice` (the liveness camera opens in `self` and the person can switch to
962
+ * `assisted` and back on the camera view; each attempt runs in one
963
+ * {@link ResolvedCaptureMode}).
938
964
  */
939
965
  type CaptureMode = "self" | "assisted" | "choice";
940
966
  /** The mode a camera runs in: the session's {@link CaptureMode}, or the person's pick under `choice`. */
@@ -959,23 +985,31 @@ interface HostedLivenessCaptureTuning {
959
985
  */
960
986
  screenRamp?: ScreenRampChallenge;
961
987
  }
988
+ /** A screen-ramp palette colour (ramp v2: four saturated colours). */
989
+ type ScreenRampColour = 'magenta' | 'yellow' | 'green' | 'blue';
990
+ /** What the screen-ramp layer shows: a palette colour, `'dark'` (black, the dark-gap arm) or `null` (cleared). */
991
+ type ScreenRampPaint = ScreenRampColour | 'dark' | null;
962
992
  /**
963
- * The closed palette of the screen ramp (liveness v7 §4.4). Each name maps to one fixed sRGB value in `@sekyro/web`
964
- * (`screenRampColourValue`); the service verifies the clip against the same values.
965
- */
966
- type ScreenRampColour = 'rose' | 'peach' | 'sand' | 'mint' | 'sky' | 'lilac';
967
- /**
968
- * The screen-ramp challenge issued per session (liveness v7 §4.4, §4.5 item 1): three colours shown for 400 ms each,
969
- * starting at `onsetsMs[i]` on the clip's own timeline (the backend jitters each onset inside its slot). The layer
970
- * returns to transparent at 2,000 ms. The client renders exactly this and reports what it rendered
971
- * ({@link ScreenRampReport}); the backend forwards the issued challenge to the model service.
993
+ * The screen-ramp challenge issued per session (ramp v2; liveness v7 §4.4, §4.5 item 1): the client paints the whole
994
+ * screen `colours[i]` from `onsetsMs[i]` on the clip's own timeline for `holdMs` (black for the rest of the slot when
995
+ * that is shorter than the gap to the next onset), clears it at `endMs`, and records at least `clipMs`. The backend
996
+ * issues three distinct colours in 650 ms slots after an 800 to 850 ms settle, and a 3.0 s clip. The
997
+ * client renders exactly this and reports what it rendered ({@link ScreenRampReport}); the backend forwards the issued
998
+ * challenge to the model service, which reads the order of the colours the face took.
972
999
  */
973
1000
  interface ScreenRampChallenge {
974
1001
  /** Ties the report to the issued challenge (echoed in {@link ScreenRampReport.nonce}). */
975
1002
  nonce: string;
976
- colours: [ScreenRampColour, ScreenRampColour, ScreenRampColour];
977
- /** Whole ms on the clip timeline, ascending, each inside the 800 to 2,000 ms window. */
978
- onsetsMs: [number, number, number];
1003
+ /** One to eight palette colours (the backend issues five). */
1004
+ colours: ScreenRampColour[];
1005
+ /** Ms on the clip timeline, strictly ascending, one per colour. */
1006
+ onsetsMs: number[];
1007
+ /** How long each colour shows from its onset (ms). */
1008
+ holdMs: number;
1009
+ /** The layer clears here (ms on the clip timeline). */
1010
+ endMs: number;
1011
+ /** The clip records at least this long (ms, at most 8,000). */
1012
+ clipMs: number;
979
1013
  /** The palette the colours were drawn from (informational; the client renders `colours`). */
980
1014
  palette: ScreenRampColour[];
981
1015
  }
@@ -987,7 +1021,7 @@ interface ScreenRampRendered {
987
1021
  /** `LivenessCaptureInput.screenRamp`: what the SDK rendered against the issued {@link ScreenRampChallenge}. */
988
1022
  interface ScreenRampReport {
989
1023
  nonce: string;
990
- /** In render order, at most three entries. */
1024
+ /** In render order, one per painted colour (never the dark gap), at most one per issued colour. */
991
1025
  rendered: ScreenRampRendered[];
992
1026
  }
993
1027
  /**
@@ -1100,7 +1134,19 @@ interface HostedIntegrity {
1100
1134
  interface HostedSessionView {
1101
1135
  sessionId: string;
1102
1136
  status: SessionStatus;
1103
- outcome: SessionOutcome | null;
1137
+ /** `not_verified` only: why ({@link SessionReason}). */
1138
+ reason?: SessionReason;
1139
+ /**
1140
+ * The detailed code behind `reason`, when one exists (`spoof_detected`, `match_inconclusive`,
1141
+ * `device_cooldown`, ...). Also a stop the page shows on a session that stays open:
1142
+ * `platform_unsupported` (a required chip read this client cannot do) and
1143
+ * `starter_credit_claimed` (an owner check of a person who already earned the credit).
1144
+ */
1145
+ reasonCode?: string;
1146
+ /** Finished sessions: who or what closed it ({@link ClosedBy}). */
1147
+ closedBy?: ClosedBy;
1148
+ /** `not_verified` only: the step that decided it, when one did. */
1149
+ step?: SessionDecidingStep;
1104
1150
  /** ISO-8601 timestamp (Date on the server, string on the wire). */
1105
1151
  expiresAt: string;
1106
1152
  consentRecorded: boolean;
@@ -1154,13 +1200,6 @@ interface HostedSessionView {
1154
1200
  * the field — treat absent like `null`.
1155
1201
  */
1156
1202
  voice?: HostedVoiceView | null;
1157
- /**
1158
- * Why the session ended, when a profile-v2 policy stopped it: a
1159
- * {@link SessionFailureReason}, or the failed check's reason when it is a
1160
- * policy reason (eligibility, or `document_nni_mismatch`). Absent otherwise
1161
- * (and on older APIs).
1162
- */
1163
- failureReason?: PolicyFailureReason;
1164
1203
  /**
1165
1204
  * The document types the person may pick, resolved for issuer `MR`,
1166
1205
  * `carte_identite`/`passport` only (older pickers). Absent on older APIs —
@@ -1173,9 +1212,15 @@ interface HostedSessionView {
1173
1212
  */
1174
1213
  acceptedDocuments?: HostedAcceptedDocuments;
1175
1214
  /**
1176
- * ISO-8601 time from which this device may verify again — set with
1177
- * `failureReason: 'device_cooldown'` (profile v2 step 4). Absent otherwise
1178
- * (and on older APIs).
1215
+ * The person's country as detected from the IP address the session started
1216
+ * from (ISO 3166-1 alpha-2). The document country picker lists it first when
1217
+ * the session accepts a document from it. Absent when unknown (and on older
1218
+ * APIs).
1219
+ */
1220
+ detectedCountry?: string;
1221
+ /**
1222
+ * ISO-8601 time from which this device may verify again, set with
1223
+ * `reasonCode: 'device_cooldown'` (profile v2 step 4). Absent otherwise.
1179
1224
  */
1180
1225
  retryAfter?: string;
1181
1226
  /**
@@ -1281,6 +1326,11 @@ interface HostedSessionView {
1281
1326
  * older APIs. Offer "continue without a camera" only then, or on a `human` session.
1282
1327
  */
1283
1328
  cameraUnavailableHandled?: true;
1329
+ /**
1330
+ * Sandbox DX spec 2026-11-06 §8: present only on a simulated session (never Live, never bound to a tester), so the
1331
+ * flow can say that nothing is sent and offer to skip the camera steps. Absent otherwise and on older APIs.
1332
+ */
1333
+ simulation?: HostedSimulationView;
1284
1334
  /**
1285
1335
  * 2026-11-05: where the ID document step's photo may come from. Absent when the open document step is camera only
1286
1336
  * with no upload offered (and on older APIs): `{ source: "camera", uploadOffered: false }`.
@@ -1330,8 +1380,10 @@ interface SessionStepView {
1330
1380
  */
1331
1381
  simulated?: boolean;
1332
1382
  calibratedScore?: number;
1333
- /** The check failed after using all of its attempts. Absent on older APIs. */
1334
- attemptsExhausted?: boolean;
1383
+ /** What the last counted attempt said ({@link StepResult}); absent before the first one. */
1384
+ result?: StepResult;
1385
+ /** Counted attempts and the cap. */
1386
+ attempts?: PlanAttempts;
1335
1387
  /** portrait_icao only (SDK spec §4.9): the last attempt's per-criterion report. */
1336
1388
  report?: IcaoReportEntry[];
1337
1389
  }
@@ -1342,9 +1394,14 @@ interface SessionStepView {
1342
1394
  interface SessionView {
1343
1395
  id: string;
1344
1396
  status: SessionStatus;
1345
- outcome: SessionOutcome | null;
1346
- /** Profile-v2 policy stop reason; absent on ordinary failures and older APIs. */
1347
- failureReason?: PolicyFailureReason;
1397
+ /** `not_verified` only: why ({@link SessionReason}). */
1398
+ reason?: SessionReason;
1399
+ /** `not_verified` only: the detailed code behind `reason`, when one exists. */
1400
+ reasonCode?: string;
1401
+ /** Finished sessions: who or what closed it ({@link ClosedBy}). */
1402
+ closedBy?: ClosedBy;
1403
+ /** `not_verified` only: the step that decided it, when one did. */
1404
+ step?: SessionDecidingStep;
1348
1405
  steps: SessionStepView[];
1349
1406
  /** ISO-8601 timestamp (Date on the server, string on the wire). */
1350
1407
  expiresAt: string;
@@ -1438,10 +1495,8 @@ interface AttestationInput {
1438
1495
  interface LivenessInput {
1439
1496
  clipKey: string;
1440
1497
  attestation?: AttestationInput;
1441
- /** Declared capture channel — the liveness band is mobile-calibrated, so the
1442
- * backend clamps non-mobile verdicts to review (uncalibrated_capture_channel).
1443
- * Client-declared by design (not a security boundary); absent = legacy
1444
- * clients, treated as mobile server-side during the rollout window. */
1498
+ /** Declared capture channel, reported only (stored with the capture metadata): the server decides a desktop from
1499
+ * the request headers, never from this field. */
1445
1500
  captureChannel?: 'mobile' | 'desktop';
1446
1501
  /** Capture metadata (engine, dimensions, clip length, face-capture timing)
1447
1502
  * — the backend's allowlisted, non-PII `capture` block (session insights). */
@@ -1462,10 +1517,21 @@ interface LivenessCaptureInput {
1462
1517
  engine?: 'v1' | 'v3';
1463
1518
  width?: number;
1464
1519
  height?: number;
1520
+ /** The clip's duration (ms), read from its container when the SDK could. */
1465
1521
  clipMs?: number;
1522
+ /** Video frames in the clip. */
1523
+ clipFrames?: number;
1524
+ /** The clip's frame rate (frames over its duration). */
1525
+ fps?: number;
1526
+ /** Silent re-recordings of the clip (0 or 1). */
1527
+ clipRetakes?: number;
1528
+ /** The clip's codec, from the recorder's type. */
1529
+ codec?: string;
1466
1530
  cameraReadyMs?: number;
1467
1531
  faceAcquireMs?: number;
1468
1532
  captureMs?: number;
1533
+ /** Uploads settled → attestation token in hand (the Turnstile challenge on the web), ms. */
1534
+ attestationMs?: number;
1469
1535
  /** The camera the clip was filmed with (`environment` = back). */
1470
1536
  facingMode?: 'user' | 'environment';
1471
1537
  /**
@@ -1505,6 +1571,21 @@ interface FaceMatchInput {
1505
1571
  }
1506
1572
  /** Document side (docs.types.ts DocSide). */
1507
1573
  type DocSide = "recto" | "verso" | "single";
1574
+ /** The hosted view's `simulation` block (Sandbox DX spec 2026-11-06 §8): what a simulated session tells the flow. */
1575
+ interface HostedSimulationView {
1576
+ /** The code that passes the phone, email and national eID code screens: render it, nothing is delivered. */
1577
+ otpCode: string;
1578
+ /** The server takes {@link SimulatedCaptureInput} on the document, chip, liveness and portrait steps. */
1579
+ skipCapture: boolean;
1580
+ }
1581
+ /**
1582
+ * The input of a camera step skipped in a simulated session (`doc_ocr`, `nfc_chip`, `liveness`, `face_match`,
1583
+ * `portrait_icao`), with no media. Any other session answers `403 simulated_capture_forbidden`.
1584
+ */
1585
+ interface SimulatedCaptureInput {
1586
+ /** Always `true`. */
1587
+ simulatedCapture: true;
1588
+ }
1508
1589
  /** The hosted view's `documents` block (2026-11-05): where the ID document step's photo may come from. */
1509
1590
  interface HostedDocumentsView {
1510
1591
  /** The step's setting ({@link PhotoSource}). */
@@ -1613,8 +1694,8 @@ interface EmailOtpInput {
1613
1694
  }
1614
1695
  /**
1615
1696
  * portrait_icao executor input (SDK spec §4.9): the ICAO gate's frame
1616
- * (uploaded as media kind `image`). The server re-runs every criterion; only
1617
- * `gate.baselineEyeOpenness` (0–1, the user's own eye-openness baseline) is used.
1697
+ * (uploaded as media kind `image`). The server re-runs every criterion; only the
1698
+ * eye baselines (0–1, the user's own eye openness) are used.
1618
1699
  */
1619
1700
  interface PortraitIcaoInput {
1620
1701
  media: {
@@ -1622,6 +1703,9 @@ interface PortraitIcaoInput {
1622
1703
  };
1623
1704
  gate?: {
1624
1705
  baselineEyeOpenness?: number;
1706
+ /** The baseline of each eye, both or neither: the server then judges each eye against its own. */
1707
+ baselineEyeOpennessLeft?: number;
1708
+ baselineEyeOpennessRight?: number;
1625
1709
  /**
1626
1710
  * The device verdict on the submitted still, with the server's criterion names
1627
1711
  * (`framing` folds into `resolution`; unmeasured criteria are omitted, and
@@ -1639,9 +1723,13 @@ interface PortraitIcaoInput {
1639
1723
  * (presigned as a declared upload, no capture proof). Absent = `camera`.
1640
1724
  */
1641
1725
  source?: PhotoSourcePick;
1642
- /** The capture mode the portrait camera ran in (the step's, or the person's pick under `choice`). Camera only. */
1726
+ /**
1727
+ * Camera only: the capture mode the portrait camera ran in (the step's, or the person's pick under `choice`) and the
1728
+ * camera the photo was taken with. An `assisted` photo on the front camera is refused with `capture_front_camera`.
1729
+ */
1643
1730
  capture?: {
1644
1731
  mode: ResolvedCaptureMode;
1732
+ facingMode?: 'user' | 'environment';
1645
1733
  };
1646
1734
  }
1647
1735
  /**
@@ -1696,4 +1784,4 @@ interface SubmitCheckBody {
1696
1784
  forceOutcome?: "pass" | "fail" | "age_over" | "age_uncertain" | "age_under" | "age_unavailable";
1697
1785
  }
1698
1786
 
1699
- export { type LivenessCaptureInput as $, type AcceptedDocumentType as A, type HostedEmailOtpView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedFlowRef as G, type HostedAcceptedDocuments as H, type HostedIcaoPolicy as I, type HostedIntegrity as J, type HostedLivePhotoTuning as K, type HostedNativeCaptureTuning as L, type HostedOcrTuning as M, type HostedOtpView as N, type HostedPlanView as O, type HostedPortraitPendingFix as P, type HostedPortraitView as Q, type HostedSessionView as R, type HostedStepView as S, type HostedVoiceLocale as T, type HostedVoiceView as U, type IcaoCriterion as V, type IcaoReportEntry as W, type IdentityConfirmDecision as X, type IdentityMethod as Y, type IdentitySummarySource as Z, type IdentitySummaryView as _, type AttestationInput as a, type LivenessInput as a0, type LivenessReason as a1, type MatchReason as a2, type MediaKind as a3, type MethodChoiceView as a4, type NationalEidOption as a5, type NfcChipReason as a6, type NfcStepView as a7, type OtpChoiceView as a8, type PhoneCountryRule as a9, type SessionStepView as aA, type SessionView as aB, type StepSection as aC, type SubmitCheckBody as aD, type VerificationAssurance as aE, type VerificationLevel as aF, type ScreenRampColour as aG, type AgeEstimationReason as aH, type CameraUnavailableCause as aI, type CaptureIssueReport as aJ, type CaptureProvenance as aK, type HostedBranding as aL, type HostedBrandingColorKey as aM, type HostedLivenessCaptureTuning as aN, type IcaoCaptureTuning as aO, type RetakeHint as aP, type ScreenRampChallenge as aQ, type ScreenRampRendered as aR, type ScreenRampReport as aS, ICAO_FALLBACK as aT, type IcaoProfile as aU, type ResolvedIcaoTuning as aV, resolveIcaoTuning as aW, type PersonMask as aX, type BackgroundUniformity as aY, type PhoneFormat as aa, type PhoneOtpInput as ab, type PhoneOtpReason as ac, type PhotoSource as ad, type PhotoSourcePick as ae, type PlanAttempts as af, type PlanChoiceKind as ag, type PlanChoiceOption as ah, type PlanChoiceView as ai, type PlanSectionView as aj, type PlanStepView as ak, type PolicyFailureReason as al, type PopulationInput as am, type PopulationReason as an, type PortraitFix as ao, type PortraitFixReviewInput as ap, type PortraitIcaoInput as aq, type PortraitIcaoReason as ar, type PortraitOutputFormat as as, type PresignRequest as at, type PresignUploadResult as au, type RecordConsentResult as av, type ResolvedCaptureMode as aw, type SessionFailureReason as ax, type SessionOutcome as ay, type SessionStatus as az, type CaptureMode as b, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type CompleteMediaResult as i, type ConsentLocale as j, type ContactChannel as k, type DocDeviceRead as l, type DocOcrInput as m, type DocReason as n, type DocSide as o, type EidAuthInput as p, type EidReason as q, type EmailOtpInput as r, type EmailOtpReason as s, type FaceMatchReason as t, type HostedCaptureTuning as u, type HostedConsentView as v, type HostedDocumentCaptureTuning as w, type HostedDocumentScanTuning as x, type HostedDocumentsView as y, type HostedEidView as z };
1787
+ export { type IdentitySummarySource as $, type AcceptedDocumentType as A, type HostedEidView as B, type CaptureContext as C, type DecisionReason as D, type EidAfterPass as E, type FaceMatchInput as F, type HostedEmailOtpView as G, type HostedAcceptedDocuments as H, type HostedFlowRef as I, type HostedIcaoPolicy as J, type HostedIntegrity as K, type HostedLivePhotoTuning as L, type HostedNativeCaptureTuning as M, type HostedOcrTuning as N, type HostedOtpView as O, type HostedPlanView as P, type HostedPortraitPendingFix as Q, type HostedPortraitView as R, type HostedSessionView as S, type HostedSimulationView as T, type HostedStepView as U, type HostedVoiceLocale as V, type HostedVoiceView as W, type IcaoCriterion as X, type IcaoReportEntry as Y, type IdentityConfirmDecision as Z, type IdentityMethod as _, type AttestationInput as a, resolveIcaoTuning as a$, type IdentitySummaryView as a0, type LivenessCaptureInput as a1, type LivenessInput as a2, type LivenessReason as a3, type MatchReason as a4, type MediaKind as a5, type MethodChoiceView as a6, type NationalEidOption as a7, type NfcChipReason as a8, type NfcStepView as a9, type SessionReason as aA, type SessionStatus as aB, type SessionStepView as aC, type SessionView as aD, type SimulatedCaptureInput as aE, type StepResult as aF, type StepSection as aG, type SubmitCheckBody as aH, type VerificationAssurance as aI, type VerificationLevel as aJ, type ScreenRampColour as aK, type AgeEstimationReason as aL, type CameraUnavailableCause as aM, type CaptureIssueReport as aN, type CaptureProvenance as aO, type HostedBranding as aP, type HostedBrandingColorKey as aQ, type HostedLivenessCaptureTuning as aR, type IcaoCaptureTuning as aS, type RetakeHint as aT, type ScreenRampChallenge as aU, type ScreenRampPaint as aV, type ScreenRampRendered as aW, type ScreenRampReport as aX, ICAO_FALLBACK as aY, type IcaoProfile as aZ, type ResolvedIcaoTuning as a_, type OtpChoiceView as aa, type PhoneCountryRule as ab, type PhoneFormat as ac, type PhoneOtpInput as ad, type PhoneOtpReason as ae, type PhotoSource as af, type PhotoSourcePick as ag, type PlanAttempts as ah, type PlanChoiceKind as ai, type PlanChoiceOption as aj, type PlanChoiceView as ak, type PlanSectionView as al, type PlanStepView as am, type PopulationInput as an, type PopulationReason as ao, type PortraitFix as ap, type PortraitFixReviewInput as aq, type PortraitIcaoInput as ar, type PortraitIcaoReason as as, type PortraitOutputFormat as at, type PresignRequest as au, type PresignUploadResult as av, type RecordConsentResult as aw, type ResolvedCaptureMode as ax, type SessionDecidingStep as ay, type SessionFailureReason as az, type CaptureMode as b, type PersonMask as b0, type BackgroundUniformity as b1, type CaptureNoncesResult as c, type CaptureProof as d, type CheckInputByType as e, type CheckReason as f, type CheckState as g, type CheckType as h, type ClosedBy as i, type CompleteMediaResult as j, type ConsentLocale as k, type ContactChannel as l, type DocDeviceRead as m, type DocOcrInput as n, type DocReason as o, type DocSide as p, type EidAuthInput as q, type EidReason as r, type EmailOtpInput as s, type EmailOtpReason as t, type FaceMatchReason as u, type HostedCaptureTuning as v, type HostedConsentView as w, type HostedDocumentCaptureTuning as x, type HostedDocumentScanTuning as y, type HostedDocumentsView as z };