cyborg-hunter 0.9.0 → 0.9.2

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 (40) hide show
  1. package/CHANGELOG.md +71 -0
  2. package/CITATION.cff +2 -2
  3. package/README.md +9 -6
  4. package/dist/ch.js +41 -0
  5. package/dist/cyborg-hunter-replay.js +3 -3
  6. package/dist/cyborg-hunter.esm.js +1 -1
  7. package/dist/cyborg-hunter.min.js +2 -2
  8. package/dist/extension-cyborg-hunter.js +1 -1
  9. package/dist/extension-guard-friction.js +1 -1
  10. package/dist/extension-guard-honeypot.js +1 -1
  11. package/package.json +10 -5
  12. package/src/cli/preview-entry.js +6 -0
  13. package/src/cli/renderers/font-face-css.js +16 -0
  14. package/src/cli/renderers/fonts/FONTS_MANIFEST.json +69 -0
  15. package/src/cli/renderers/fonts/majormonodisplay/OFL.txt +93 -0
  16. package/src/cli/renderers/fonts/majormonodisplay/majormonodisplay-400.woff2 +0 -0
  17. package/src/cli/renderers/fonts/recursive/OFL.txt +93 -0
  18. package/src/cli/renderers/fonts/recursive/recursive-300-1000.woff2 +0 -0
  19. package/src/cli/renderers/fonts/sofiasans/OFL.txt +93 -0
  20. package/src/cli/renderers/fonts/sofiasans/sofiasans-1-1000.woff2 +0 -0
  21. package/src/cli/renderers/fonts/sora/OFL.txt +93 -0
  22. package/src/cli/renderers/fonts/sora/sora-100-800.woff2 +0 -0
  23. package/src/cli/renderers/fonts/spacegrotesk/OFL.txt +93 -0
  24. package/src/cli/renderers/fonts/spacegrotesk/spacegrotesk-300-700.woff2 +0 -0
  25. package/src/cli/renderers/fonts/tomorrow/OFL.txt +93 -0
  26. package/src/cli/renderers/fonts/tomorrow/tomorrow-400.woff2 +0 -0
  27. package/src/cli/renderers/html-index-core.js +98 -96
  28. package/src/cli/renderers/html-index.js +7 -2
  29. package/src/cli/renderers/replay-client-source.js +2 -2
  30. package/src/cli/renderers/replay-styles.js +61 -0
  31. package/src/cli/renderers/replay-viewer.client.js +8 -6
  32. package/src/cli/renderers/report-fonts.js +24 -0
  33. package/src/jspsych/extension-cyborg-hunter-replay.js +1 -1
  34. package/src/jspsych/extension-cyborg-hunter.js +1 -1
  35. package/src/jspsych/extension-guard-friction.js +1 -1
  36. package/src/jspsych/extension-guard-honeypot.js +1 -1
  37. package/src/replay/dom-instantiate.js +10 -1
  38. package/src/replay/index.js +4 -2
  39. package/src/shared/constants.js +1 -1
  40. package/src/shared/schema-v2-validator.js +14 -9
@@ -1,6 +1,11 @@
1
+ // GENERATED from packages/sessionrecording-conformance/src/validator.js — do not edit; run npm run sync:conformance
2
+ //
3
+ // The conformance package is the source of truth. CH ships this copy so the
4
+ // published tarball can validate without resolving a workspace package.
5
+
1
6
  // SessionRecording v2 validator — dual profiles per spec §11.
2
- // Zero dependencies. Lifted from tests/replay/schema-v2/ into shipped code (A3 fix
3
- // round): ingest strict-validates converted recordings in-process (spec §11 A2 —
7
+ // Zero dependencies. Lifted from tests/replay/schema-v2/ into shipped code:
8
+ // ingest strict-validates converted recordings in-process (spec §11 A2 —
4
9
  // warn, never refuse), so the validator is a runtime dependency of the CLI.
5
10
 
6
11
  // Gzip magic bytes (RFC 1952): 0x1f 0x8b.
@@ -50,8 +55,8 @@ export function validateTolerant(input) {
50
55
  }
51
56
  if (errors.length) return { ok: false, recording: null, errors, warnings };
52
57
  for (const k of ADVISORY_TOP) if (!(k in obj)) warnings.push(`missing advisory field: ${k}`);
53
- // WARN ON MALFORMED KNOWN FIELDS — WARN, NEVER COERCE (T7 settles this; it
54
- // was parked from two reviews). Before this, a present-but-malformed known
58
+ // WARN ON MALFORMED KNOWN FIELDS — WARN, NEVER COERCE (settled here after
59
+ // being parked from two reviews). Before this, a present-but-malformed known
55
60
  // field (`stylesheets: null`, `truncated: "yes"`) passed through in total
56
61
  // silence: defaults fill ABSENT keys only, and the analyst opening the file
57
62
  // got no signal at all. Coercing is the wrong repair — overwriting
@@ -253,8 +258,8 @@ export function validateStrict(input) {
253
258
  errors.push('end_reason must be "finished" | "aborted" | "unload" | null');
254
259
  }
255
260
  if (typeof r.truncated !== 'boolean') errors.push('truncated must be a boolean');
256
- // `host` appeared ONCE in this file before T7 — in TOP_DEFAULTS — so
257
- // `host: {name: 42}` was strict-valid (T3 Task-7).
261
+ // `host` used to appear ONCE in this file — in TOP_DEFAULTS — so
262
+ // `host: {name: 42}` was strict-valid.
258
263
  if (r.host !== null && !(isPlainObject(r.host)
259
264
  && typeof r.host.name === 'string' && typeof r.host.version === 'string')) {
260
265
  errors.push('host must be {name, version} strings or null');
@@ -383,7 +388,7 @@ export const REDACTABLE_TYPES = new Set([
383
388
  'clipboard.copy', 'clipboard.cut', 'clipboard.paste', 'clipboard.drop',
384
389
  ]);
385
390
 
386
- // ── §5.3 clipboard: REQUIRED-BUT-NULLABLE, settled here (T7) ───────────────
391
+ // ── §5.3 clipboard: REQUIRED-BUT-NULLABLE, settled here ────────────────────
387
392
  // The parked question was whether §5.3's four fields are required-but-nullable
388
393
  // or typed-only-if-present. Settled as REQUIRED, for one reason that is not
389
394
  // about strictness for its own sake: §5.3 defines its TWO PRODUCER MODES by
@@ -484,8 +489,8 @@ function checkSegmentsStrict(r, errors) {
484
489
  if (s.initial_dom != null && !isKeyframe) {
485
490
  errors.push(`${at}.initial_dom must be a DomNode object or null`);
486
491
  }
487
- // The keyframe tree itself, recursively (spec §4). Until T7 the validator
488
- // stopped at "is an object": a keyframe whose children were strings, or
492
+ // The keyframe tree itself, recursively (spec §4). The validator used to
493
+ // stop at "is an object": a keyframe whose children were strings, or
489
494
  // whose ids were absent, was strict-valid and only failed inside a player.
490
495
  if (isKeyframe) checkDomNode(s.initial_dom, `${at}.initial_dom`, errors, 1);
491
496
  if (isKeyframe) sawKeyframe = true;