@onmark/cli 0.2.1 → 0.2.3

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.
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "@onmark/cli",
4
- "version": "0.2.1",
5
- "sourceRevision": "16c647302c4e84f51c2f7089ed2066929d1aab33",
4
+ "version": "0.2.3",
5
+ "sourceRevision": "05e6928b6f019f459ff09d9be0d3678730964939",
6
6
  "files": [
7
7
  {
8
8
  "path": "LICENSE",
@@ -17,7 +17,7 @@
17
17
  {
18
18
  "path": "package.json",
19
19
  "bytes": 1406,
20
- "sha256": "07eb4e64c54265581dc0b17ac5ca03b7bf1e6182dfaf15226bbfbaca9c758ef3"
20
+ "sha256": "976737f57bbccb7f6fa0f48f1eeea5bff57ca509091b18e944fc4873dfb48f73"
21
21
  },
22
22
  {
23
23
  "path": "packages/authoring/dist/src/frame-motion.d.ts",
@@ -106,8 +106,8 @@
106
106
  },
107
107
  {
108
108
  "path": "packages/bundler/dist/src/authored_html.js",
109
- "bytes": 13942,
110
- "sha256": "5c58e2bb952df7657fcdcbcb3bf5abf9831485aaca2c492ba2518b4948dd6027"
109
+ "bytes": 14049,
110
+ "sha256": "17af4b808b9199fb7b29b7992d63a4b90b196bc84eeb004e1effda3ec5c24f2c"
111
111
  },
112
112
  {
113
113
  "path": "packages/bundler/dist/src/command.d.ts",
@@ -276,8 +276,8 @@
276
276
  },
277
277
  {
278
278
  "path": "packages/runtime/dist/src/generated/browser-request.d.ts",
279
- "bytes": 3353,
280
- "sha256": "1dea1c9bafb7be477b2d86ecaf30b26e7ee64e25203d3a31d8975ecfbcb9c1d5"
279
+ "bytes": 3792,
280
+ "sha256": "f5144cdb3b9e1d3c58fbedafbd1b1509b7404abf52866221ab8bc9651b514b97"
281
281
  },
282
282
  {
283
283
  "path": "packages/runtime/dist/src/generated/browser-request.js",
@@ -287,7 +287,7 @@
287
287
  {
288
288
  "path": "packages/runtime/dist/src/generated/browser-response.d.ts",
289
289
  "bytes": 1368,
290
- "sha256": "ec32071435ada70f7837db7855fee95fecf79433e62aeb1736f35a0b868825bc"
290
+ "sha256": "15a67fcc4e7ec01e4ae8c2a1178893c24558656b9623737acae02a5af951139e"
291
291
  },
292
292
  {
293
293
  "path": "packages/runtime/dist/src/generated/browser-response.js",
@@ -327,12 +327,12 @@
327
327
  {
328
328
  "path": "packages/runtime/dist/src/generated/validators.d.ts",
329
329
  "bytes": 594,
330
- "sha256": "c9e92297fdc9cc1f2c79ec3a7972a0e7d76b496f52a1dd8a1c4889fde34b366b"
330
+ "sha256": "e86ba82ec30adb5f5df0470854a84000e7c0aca3bd55374e68c0cc70e22121f9"
331
331
  },
332
332
  {
333
333
  "path": "packages/runtime/dist/src/generated/validators.js",
334
- "bytes": 179613,
335
- "sha256": "1a80bd7d7995a4b9da29f697b86c41d36dd2bb6996288aa94fd99e3185e37e2c"
334
+ "bytes": 199436,
335
+ "sha256": "ee8e1cd7a1466ce3bbab4b8e32c9fb150f928a3acc4f2932d4fa5600f35c1ca0"
336
336
  },
337
337
  {
338
338
  "path": "packages/runtime/dist/src/host.d.ts",
@@ -356,13 +356,13 @@
356
356
  },
357
357
  {
358
358
  "path": "packages/runtime/dist/src/media.d.ts",
359
- "bytes": 688,
360
- "sha256": "260fdabfa1f0787faf81dbaf3ab6a60ff6e60a119a85bc4e0f014c4f9d1fbde5"
359
+ "bytes": 1087,
360
+ "sha256": "eb65fe99e616f1ba322d263c8330631b991a3a8a065c491f20a7f765cfb5d468"
361
361
  },
362
362
  {
363
363
  "path": "packages/runtime/dist/src/media.js",
364
- "bytes": 1385,
365
- "sha256": "4d0a3e4a6c2399e915d208284057d0d36bc913e2c4a456a4a7403ecf6cd58b98"
364
+ "bytes": 4577,
365
+ "sha256": "419dabdda169db230489d4e1ad51d6b3e256513af2182a9f917a294e13bec1c5"
366
366
  },
367
367
  {
368
368
  "path": "packages/runtime/dist/src/presentation.d.ts",
@@ -391,8 +391,8 @@
391
391
  },
392
392
  {
393
393
  "path": "packages/runtime/dist/src/session.js",
394
- "bytes": 17136,
395
- "sha256": "199a3289f50bfdd282d0ef2c83f7bd03ba53a8a2f373fefd8e081b38b18757a7"
394
+ "bytes": 17621,
395
+ "sha256": "a1164d20ed35de96db6cfc3d745663c9364c92789b082faa4d8b76f6a5dc09e7"
396
396
  },
397
397
  {
398
398
  "path": "packages/runtime/dist/src/types.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onmark/cli",
3
- "version": "0.2.1",
3
+ "version": "0.2.3",
4
4
  "description": "Screenplay-first deterministic browser video compiler",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -45,8 +45,8 @@
45
45
  "yauzl": "3.4.0"
46
46
  },
47
47
  "optionalDependencies": {
48
- "@onmark/cli-darwin-arm64": "0.2.1",
49
- "@onmark/cli-linux-x64": "0.2.1",
50
- "@onmark/cli-win32-x64": "0.2.1"
48
+ "@onmark/cli-darwin-arm64": "0.2.3",
49
+ "@onmark/cli-linux-x64": "0.2.3",
50
+ "@onmark/cli-win32-x64": "0.2.3"
51
51
  }
52
52
  }
@@ -330,7 +330,10 @@ function isCompilerOnlyAttribute(tagName, attributeName) {
330
330
  case "om-shot":
331
331
  return attributeName === "duration";
332
332
  case "video":
333
- return attributeName === "delay" || attributeName === "src";
333
+ return (attributeName === "delay" ||
334
+ attributeName === "speed" ||
335
+ attributeName === "src" ||
336
+ attributeName === "trim");
334
337
  default:
335
338
  return false;
336
339
  }
@@ -49,7 +49,7 @@ export type RequestId = number;
49
49
  /**
50
50
  * Version of the native-to-browser message contract.
51
51
  */
52
- export type ProtocolVersion = 1;
52
+ export type ProtocolVersion = 2;
53
53
  /**
54
54
  * One versioned command sent from the native executor to the browser.
55
55
  */
@@ -79,7 +79,7 @@ export interface BrowserPlan {
79
79
  */
80
80
  shots: BrowserShot[];
81
81
  timeline: WireInterval;
82
- timelineVersion: 1;
82
+ timelineVersion: 2;
83
83
  /**
84
84
  * @maxItems 10000
85
85
  */
@@ -139,5 +139,22 @@ export interface BrowserVideo {
139
139
  interval: WireInterval;
140
140
  node: BrowserNode;
141
141
  shotId: BrowserNodeId;
142
+ source: BrowserVideoSource;
142
143
  sourceFrameRate: WireFrameRate;
143
144
  }
145
+ /**
146
+ * Exact source-time mapping for one browser video placement.
147
+ */
148
+ export interface BrowserVideoSource {
149
+ endNanoseconds: string;
150
+ naturalEndNanoseconds: string;
151
+ playbackRate: WirePlaybackRate;
152
+ startNanoseconds: string;
153
+ }
154
+ /**
155
+ * Exact canonical playback ratio represented with browser-safe integers.
156
+ */
157
+ export interface WirePlaybackRate {
158
+ denominator: number;
159
+ numerator: number;
160
+ }
@@ -47,7 +47,7 @@ export type RequestId = number;
47
47
  /**
48
48
  * Version of the native-to-browser message contract.
49
49
  */
50
- export type ProtocolVersion = 1;
50
+ export type ProtocolVersion = 2;
51
51
  /**
52
52
  * One versioned event returned by the browser runtime.
53
53
  */
@@ -4,8 +4,8 @@ declare function validate20(data: any, { instancePath, parentData, parentDataPro
4
4
  instancePath?: string | undefined;
5
5
  rootData?: any;
6
6
  }): boolean;
7
- export declare const validateBrowserResponse: typeof validate47;
8
- declare function validate47(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
7
+ export declare const validateBrowserResponse: typeof validate49;
8
+ declare function validate49(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
9
9
  dynamicAnchors?: {} | undefined;
10
10
  instancePath?: string | undefined;
11
11
  rootData?: any;
@@ -1,12 +1,12 @@
1
1
  // Generated by `cargo xtask schema`; do not edit.
2
2
  "use strict";
3
3
  export const validateBrowserRequest = validate20;
4
- const schema31 = { "$defs": { "BrowserCommand": { "description": "Closed commands understood by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "Install one immutable browser plan.", "properties": { "plan": { "$ref": "#/$defs/BrowserPlan", "description": "Solved frame facts consumed by the runtime clock." }, "type": { "const": "load", "type": "string" } }, "required": ["type", "plan"], "type": "object" }, { "additionalProperties": false, "description": "Stabilize resources at the evaluation start frame.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "First frame that may be evaluated by this unit." }, "type": { "const": "prepare", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "Evaluate one exact absolute frame.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame selected by the native executor." }, "type": { "const": "seek", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Confirm staged media reached the compositor before accepting capture.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame whose staged media must be compositor-confirmed." }, "type": { "const": "confirm", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Release page-owned resources for this session.", "properties": { "type": { "const": "dispose", "type": "string" } }, "required": ["type"], "type": "object" }] }, "BrowserNode": { "additionalProperties": false, "description": "Browser-facing identity retained from one Timeline element.", "properties": { "authoredId": { "type": ["string", "null"] }, "nodeId": { "$ref": "#/$defs/BrowserNodeId" } }, "required": ["nodeId"], "type": "object" }, "BrowserNodeId": { "description": "Browser identity for one Timeline element or imported caption.\n\nIDs form dense renderable-semantic preorder within one Browser Plan.\n\nAuthored IDs, rather than this unit-local key, retain cross-projection\nsemantic identity.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "BrowserOverlay": { "additionalProperties": false, "description": "One solved overlay placement consumed by the browser presentation.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "kind": { "$ref": "#/$defs/BrowserOverlayKind" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "anyOf": [{ "$ref": "#/$defs/BrowserNodeId" }, { "type": "null" }] }, "text": { "maxLength": 65536, "type": "string" } }, "required": ["node", "kind", "text", "interval"], "type": "object" }, "BrowserOverlayKind": { "description": "Closed overlay roles understood by the browser presentation.", "oneOf": [{ "const": "title", "description": "Authored title content.", "type": "string" }, { "const": "callToAction", "description": "Authored call-to-action content.", "type": "string" }, { "const": "caption", "description": "Imported caption text.", "type": "string" }] }, "BrowserPlan": { "additionalProperties": false, "description": "Timeline facts consumed by the browser clock and presentation.", "properties": { "evaluation": { "$ref": "#/$defs/WireInterval" }, "film": { "$ref": "#/$defs/BrowserNode" }, "frameRate": { "$ref": "#/$defs/WireFrameRate" }, "output": { "$ref": "#/$defs/WireInterval" }, "overlays": { "items": { "$ref": "#/$defs/BrowserOverlay" }, "maxItems": 10000, "type": "array" }, "scenes": { "items": { "$ref": "#/$defs/BrowserScene" }, "maxItems": 10000, "type": "array" }, "shots": { "items": { "$ref": "#/$defs/BrowserShot" }, "maxItems": 10000, "type": "array" }, "timeline": { "$ref": "#/$defs/WireInterval" }, "timelineVersion": { "const": 1, "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "videos": { "items": { "$ref": "#/$defs/BrowserVideo" }, "maxItems": 10000, "type": "array" } }, "required": ["timelineVersion", "frameRate", "timeline", "evaluation", "output", "film", "scenes", "shots", "videos", "overlays"], "type": "object" }, "BrowserScene": { "additionalProperties": false, "description": "One scene container intersecting this unit, with its complete Timeline interval.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" } }, "required": ["node", "interval"], "type": "object" }, "BrowserShot": { "additionalProperties": false, "description": "One shot container intersecting this unit, with its complete Timeline interval.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "sceneId": { "$ref": "#/$defs/BrowserNodeId" } }, "required": ["node", "sceneId", "interval"], "type": "object" }, "BrowserVideo": { "additionalProperties": false, "description": "One primary video placement consumed by the browser presentation adapter.", "properties": { "assetId": { "pattern": "^sha256:[0-9a-f]{64}$", "type": "string" }, "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "$ref": "#/$defs/BrowserNodeId" }, "sourceFrameRate": { "$ref": "#/$defs/WireFrameRate" } }, "required": ["node", "shotId", "assetId", "interval", "sourceFrameRate"], "type": "object" }, "ProtocolVersion": { "const": 1, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "RequestId": { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "WireFrame": { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" }, "WireFrameRate": { "additionalProperties": false, "description": "Exact rational frame rate represented with browser-safe integers.", "properties": { "denominator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" }, "numerator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" } }, "required": ["numerator", "denominator"], "type": "object" }, "WireInterval": { "additionalProperties": false, "description": "One half-open browser frame interval.", "properties": { "end": { "$ref": "#/$defs/WireFrame" }, "start": { "$ref": "#/$defs/WireFrame" } }, "required": ["start", "end"], "type": "object" } }, "$id": "https://onmark.dev/schemas/browser-request-v1.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "One versioned command sent from the native executor to the browser.", "properties": { "command": { "$ref": "#/$defs/BrowserCommand" }, "requestId": { "$ref": "#/$defs/RequestId" }, "version": { "$ref": "#/$defs/ProtocolVersion" } }, "required": ["version", "requestId", "command"], "title": "BrowserRequest", "type": "object", "x-onmark-runtime-host": "__ONMARK_RUNTIME__" };
5
- const schema52 = { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" };
6
- const schema53 = { "const": 1, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" };
4
+ const schema31 = { "$defs": { "BrowserCommand": { "description": "Closed commands understood by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "Install one immutable browser plan.", "properties": { "plan": { "$ref": "#/$defs/BrowserPlan", "description": "Solved frame facts consumed by the runtime clock." }, "type": { "const": "load", "type": "string" } }, "required": ["type", "plan"], "type": "object" }, { "additionalProperties": false, "description": "Stabilize resources at the evaluation start frame.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "First frame that may be evaluated by this unit." }, "type": { "const": "prepare", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "Evaluate one exact absolute frame.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame selected by the native executor." }, "type": { "const": "seek", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Confirm staged media reached the compositor before accepting capture.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame whose staged media must be compositor-confirmed." }, "type": { "const": "confirm", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Release page-owned resources for this session.", "properties": { "type": { "const": "dispose", "type": "string" } }, "required": ["type"], "type": "object" }] }, "BrowserNode": { "additionalProperties": false, "description": "Browser-facing identity retained from one Timeline element.", "properties": { "authoredId": { "type": ["string", "null"] }, "nodeId": { "$ref": "#/$defs/BrowserNodeId" } }, "required": ["nodeId"], "type": "object" }, "BrowserNodeId": { "description": "Browser identity for one Timeline element or imported caption.\n\nIDs form dense renderable-semantic preorder within one Browser Plan.\n\nAuthored IDs, rather than this unit-local key, retain cross-projection\nsemantic identity.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "BrowserOverlay": { "additionalProperties": false, "description": "One solved overlay placement consumed by the browser presentation.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "kind": { "$ref": "#/$defs/BrowserOverlayKind" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "anyOf": [{ "$ref": "#/$defs/BrowserNodeId" }, { "type": "null" }] }, "text": { "maxLength": 65536, "type": "string" } }, "required": ["node", "kind", "text", "interval"], "type": "object" }, "BrowserOverlayKind": { "description": "Closed overlay roles understood by the browser presentation.", "oneOf": [{ "const": "title", "description": "Authored title content.", "type": "string" }, { "const": "callToAction", "description": "Authored call-to-action content.", "type": "string" }, { "const": "caption", "description": "Imported caption text.", "type": "string" }] }, "BrowserPlan": { "additionalProperties": false, "description": "Timeline facts consumed by the browser clock and presentation.", "properties": { "evaluation": { "$ref": "#/$defs/WireInterval" }, "film": { "$ref": "#/$defs/BrowserNode" }, "frameRate": { "$ref": "#/$defs/WireFrameRate" }, "output": { "$ref": "#/$defs/WireInterval" }, "overlays": { "items": { "$ref": "#/$defs/BrowserOverlay" }, "maxItems": 10000, "type": "array" }, "scenes": { "items": { "$ref": "#/$defs/BrowserScene" }, "maxItems": 10000, "type": "array" }, "shots": { "items": { "$ref": "#/$defs/BrowserShot" }, "maxItems": 10000, "type": "array" }, "timeline": { "$ref": "#/$defs/WireInterval" }, "timelineVersion": { "const": 2, "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "videos": { "items": { "$ref": "#/$defs/BrowserVideo" }, "maxItems": 10000, "type": "array" } }, "required": ["timelineVersion", "frameRate", "timeline", "evaluation", "output", "film", "scenes", "shots", "videos", "overlays"], "type": "object" }, "BrowserScene": { "additionalProperties": false, "description": "One scene container intersecting this unit, with its complete Timeline interval.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" } }, "required": ["node", "interval"], "type": "object" }, "BrowserShot": { "additionalProperties": false, "description": "One shot container intersecting this unit, with its complete Timeline interval.", "properties": { "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "sceneId": { "$ref": "#/$defs/BrowserNodeId" } }, "required": ["node", "sceneId", "interval"], "type": "object" }, "BrowserVideo": { "additionalProperties": false, "description": "One primary video placement consumed by the browser presentation adapter.", "properties": { "assetId": { "pattern": "^sha256:[0-9a-f]{64}$", "type": "string" }, "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "$ref": "#/$defs/BrowserNodeId" }, "source": { "$ref": "#/$defs/BrowserVideoSource" }, "sourceFrameRate": { "$ref": "#/$defs/WireFrameRate" } }, "required": ["node", "shotId", "assetId", "interval", "sourceFrameRate", "source"], "type": "object" }, "BrowserVideoSource": { "additionalProperties": false, "description": "Exact source-time mapping for one browser video placement.", "properties": { "endNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" }, "naturalEndNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" }, "playbackRate": { "$ref": "#/$defs/WirePlaybackRate" }, "startNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" } }, "required": ["startNanoseconds", "endNanoseconds", "naturalEndNanoseconds", "playbackRate"], "type": "object" }, "ProtocolVersion": { "const": 2, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "RequestId": { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "WireFrame": { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" }, "WireFrameRate": { "additionalProperties": false, "description": "Exact rational frame rate represented with browser-safe integers.", "properties": { "denominator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" }, "numerator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" } }, "required": ["numerator", "denominator"], "type": "object" }, "WireInterval": { "additionalProperties": false, "description": "One half-open browser frame interval.", "properties": { "end": { "$ref": "#/$defs/WireFrame" }, "start": { "$ref": "#/$defs/WireFrame" } }, "required": ["start", "end"], "type": "object" }, "WirePlaybackRate": { "additionalProperties": false, "description": "Exact canonical playback ratio represented with browser-safe integers.", "properties": { "denominator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" }, "numerator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" } }, "required": ["numerator", "denominator"], "type": "object" } }, "$id": "https://onmark.dev/schemas/browser-request-v2.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "One versioned command sent from the native executor to the browser.", "properties": { "command": { "$ref": "#/$defs/BrowserCommand" }, "requestId": { "$ref": "#/$defs/RequestId" }, "version": { "$ref": "#/$defs/ProtocolVersion" } }, "required": ["version", "requestId", "command"], "title": "BrowserRequest", "type": "object", "x-onmark-runtime-host": "__ONMARK_RUNTIME__" };
5
+ const schema54 = { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" };
6
+ const schema55 = { "const": 2, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" };
7
7
  const schema32 = { "description": "Closed commands understood by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "Install one immutable browser plan.", "properties": { "plan": { "$ref": "#/$defs/BrowserPlan", "description": "Solved frame facts consumed by the runtime clock." }, "type": { "const": "load", "type": "string" } }, "required": ["type", "plan"], "type": "object" }, { "additionalProperties": false, "description": "Stabilize resources at the evaluation start frame.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "First frame that may be evaluated by this unit." }, "type": { "const": "prepare", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "Evaluate one exact absolute frame.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame selected by the native executor." }, "type": { "const": "seek", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Confirm staged media reached the compositor before accepting capture.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Frame whose staged media must be compositor-confirmed." }, "type": { "const": "confirm", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "Release page-owned resources for this session.", "properties": { "type": { "const": "dispose", "type": "string" } }, "required": ["type"], "type": "object" }] };
8
8
  const schema35 = { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" };
9
- const schema33 = { "additionalProperties": false, "description": "Timeline facts consumed by the browser clock and presentation.", "properties": { "evaluation": { "$ref": "#/$defs/WireInterval" }, "film": { "$ref": "#/$defs/BrowserNode" }, "frameRate": { "$ref": "#/$defs/WireFrameRate" }, "output": { "$ref": "#/$defs/WireInterval" }, "overlays": { "items": { "$ref": "#/$defs/BrowserOverlay" }, "maxItems": 10000, "type": "array" }, "scenes": { "items": { "$ref": "#/$defs/BrowserScene" }, "maxItems": 10000, "type": "array" }, "shots": { "items": { "$ref": "#/$defs/BrowserShot" }, "maxItems": 10000, "type": "array" }, "timeline": { "$ref": "#/$defs/WireInterval" }, "timelineVersion": { "const": 1, "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "videos": { "items": { "$ref": "#/$defs/BrowserVideo" }, "maxItems": 10000, "type": "array" } }, "required": ["timelineVersion", "frameRate", "timeline", "evaluation", "output", "film", "scenes", "shots", "videos", "overlays"], "type": "object" };
9
+ const schema33 = { "additionalProperties": false, "description": "Timeline facts consumed by the browser clock and presentation.", "properties": { "evaluation": { "$ref": "#/$defs/WireInterval" }, "film": { "$ref": "#/$defs/BrowserNode" }, "frameRate": { "$ref": "#/$defs/WireFrameRate" }, "output": { "$ref": "#/$defs/WireInterval" }, "overlays": { "items": { "$ref": "#/$defs/BrowserOverlay" }, "maxItems": 10000, "type": "array" }, "scenes": { "items": { "$ref": "#/$defs/BrowserScene" }, "maxItems": 10000, "type": "array" }, "shots": { "items": { "$ref": "#/$defs/BrowserShot" }, "maxItems": 10000, "type": "array" }, "timeline": { "$ref": "#/$defs/WireInterval" }, "timelineVersion": { "const": 2, "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "videos": { "items": { "$ref": "#/$defs/BrowserVideo" }, "maxItems": 10000, "type": "array" } }, "required": ["timelineVersion", "frameRate", "timeline", "evaluation", "output", "film", "scenes", "shots", "videos", "overlays"], "type": "object" };
10
10
  const schema39 = { "additionalProperties": false, "description": "Exact rational frame rate represented with browser-safe integers.", "properties": { "denominator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" }, "numerator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" } }, "required": ["numerator", "denominator"], "type": "object" };
11
11
  const func1 = Object.prototype.hasOwnProperty;
12
12
  const schema34 = { "additionalProperties": false, "description": "One half-open browser frame interval.", "properties": { "end": { "$ref": "#/$defs/WireFrame" }, "start": { "$ref": "#/$defs/WireFrame" } }, "required": ["start", "end"], "type": "object" };
@@ -733,8 +733,341 @@ function validate36(data, { instancePath = "", parentData, parentDataProperty, r
733
733
  return errors === 0;
734
734
  }
735
735
  validate36.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
736
- const schema46 = { "additionalProperties": false, "description": "One primary video placement consumed by the browser presentation adapter.", "properties": { "assetId": { "pattern": "^sha256:[0-9a-f]{64}$", "type": "string" }, "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "$ref": "#/$defs/BrowserNodeId" }, "sourceFrameRate": { "$ref": "#/$defs/WireFrameRate" } }, "required": ["node", "shotId", "assetId", "interval", "sourceFrameRate"], "type": "object" };
736
+ const schema46 = { "additionalProperties": false, "description": "One primary video placement consumed by the browser presentation adapter.", "properties": { "assetId": { "pattern": "^sha256:[0-9a-f]{64}$", "type": "string" }, "interval": { "$ref": "#/$defs/WireInterval" }, "node": { "$ref": "#/$defs/BrowserNode" }, "shotId": { "$ref": "#/$defs/BrowserNodeId" }, "source": { "$ref": "#/$defs/BrowserVideoSource" }, "sourceFrameRate": { "$ref": "#/$defs/WireFrameRate" } }, "required": ["node", "shotId", "assetId", "interval", "sourceFrameRate", "source"], "type": "object" };
737
737
  const pattern4 = new RegExp("^sha256:[0-9a-f]{64}$", "u");
738
+ const schema48 = { "additionalProperties": false, "description": "Exact source-time mapping for one browser video placement.", "properties": { "endNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" }, "naturalEndNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" }, "playbackRate": { "$ref": "#/$defs/WirePlaybackRate" }, "startNanoseconds": { "maxLength": 20, "minLength": 1, "pattern": "^(0|[1-9][0-9]*)$", "type": "string" } }, "required": ["startNanoseconds", "endNanoseconds", "naturalEndNanoseconds", "playbackRate"], "type": "object" };
739
+ const schema49 = { "additionalProperties": false, "description": "Exact canonical playback ratio represented with browser-safe integers.", "properties": { "denominator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" }, "numerator": { "format": "uint32", "maximum": 4294967295, "minimum": 1, "type": "integer" } }, "required": ["numerator", "denominator"], "type": "object" };
740
+ const pattern5 = new RegExp("^(0|[1-9][0-9]*)$", "u");
741
+ function validate44(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
742
+ let vErrors = null;
743
+ let errors = 0;
744
+ const evaluated0 = validate44.evaluated;
745
+ if (evaluated0.dynamicProps) {
746
+ evaluated0.props = undefined;
747
+ }
748
+ if (evaluated0.dynamicItems) {
749
+ evaluated0.items = undefined;
750
+ }
751
+ if (data && typeof data == "object" && !Array.isArray(data)) {
752
+ if (data.startNanoseconds === undefined) {
753
+ const err0 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "startNanoseconds" }, message: "must have required property '" + "startNanoseconds" + "'" };
754
+ if (vErrors === null) {
755
+ vErrors = [err0];
756
+ }
757
+ else {
758
+ vErrors.push(err0);
759
+ }
760
+ errors++;
761
+ }
762
+ if (data.endNanoseconds === undefined) {
763
+ const err1 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "endNanoseconds" }, message: "must have required property '" + "endNanoseconds" + "'" };
764
+ if (vErrors === null) {
765
+ vErrors = [err1];
766
+ }
767
+ else {
768
+ vErrors.push(err1);
769
+ }
770
+ errors++;
771
+ }
772
+ if (data.naturalEndNanoseconds === undefined) {
773
+ const err2 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "naturalEndNanoseconds" }, message: "must have required property '" + "naturalEndNanoseconds" + "'" };
774
+ if (vErrors === null) {
775
+ vErrors = [err2];
776
+ }
777
+ else {
778
+ vErrors.push(err2);
779
+ }
780
+ errors++;
781
+ }
782
+ if (data.playbackRate === undefined) {
783
+ const err3 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "playbackRate" }, message: "must have required property '" + "playbackRate" + "'" };
784
+ if (vErrors === null) {
785
+ vErrors = [err3];
786
+ }
787
+ else {
788
+ vErrors.push(err3);
789
+ }
790
+ errors++;
791
+ }
792
+ for (const key0 in data) {
793
+ if (!((((key0 === "endNanoseconds") || (key0 === "naturalEndNanoseconds")) || (key0 === "playbackRate")) || (key0 === "startNanoseconds"))) {
794
+ const err4 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
795
+ if (vErrors === null) {
796
+ vErrors = [err4];
797
+ }
798
+ else {
799
+ vErrors.push(err4);
800
+ }
801
+ errors++;
802
+ }
803
+ }
804
+ if (data.endNanoseconds !== undefined) {
805
+ let data0 = data.endNanoseconds;
806
+ if (typeof data0 === "string") {
807
+ if (func2(data0) > 20) {
808
+ const err5 = { instancePath: instancePath + "/endNanoseconds", schemaPath: "#/properties/endNanoseconds/maxLength", keyword: "maxLength", params: { limit: 20 }, message: "must NOT have more than 20 characters" };
809
+ if (vErrors === null) {
810
+ vErrors = [err5];
811
+ }
812
+ else {
813
+ vErrors.push(err5);
814
+ }
815
+ errors++;
816
+ }
817
+ if (func2(data0) < 1) {
818
+ const err6 = { instancePath: instancePath + "/endNanoseconds", schemaPath: "#/properties/endNanoseconds/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
819
+ if (vErrors === null) {
820
+ vErrors = [err6];
821
+ }
822
+ else {
823
+ vErrors.push(err6);
824
+ }
825
+ errors++;
826
+ }
827
+ if (!pattern5.test(data0)) {
828
+ const err7 = { instancePath: instancePath + "/endNanoseconds", schemaPath: "#/properties/endNanoseconds/pattern", keyword: "pattern", params: { pattern: "^(0|[1-9][0-9]*)$" }, message: "must match pattern \"" + "^(0|[1-9][0-9]*)$" + "\"" };
829
+ if (vErrors === null) {
830
+ vErrors = [err7];
831
+ }
832
+ else {
833
+ vErrors.push(err7);
834
+ }
835
+ errors++;
836
+ }
837
+ }
838
+ else {
839
+ const err8 = { instancePath: instancePath + "/endNanoseconds", schemaPath: "#/properties/endNanoseconds/type", keyword: "type", params: { type: "string" }, message: "must be string" };
840
+ if (vErrors === null) {
841
+ vErrors = [err8];
842
+ }
843
+ else {
844
+ vErrors.push(err8);
845
+ }
846
+ errors++;
847
+ }
848
+ }
849
+ if (data.naturalEndNanoseconds !== undefined) {
850
+ let data1 = data.naturalEndNanoseconds;
851
+ if (typeof data1 === "string") {
852
+ if (func2(data1) > 20) {
853
+ const err9 = { instancePath: instancePath + "/naturalEndNanoseconds", schemaPath: "#/properties/naturalEndNanoseconds/maxLength", keyword: "maxLength", params: { limit: 20 }, message: "must NOT have more than 20 characters" };
854
+ if (vErrors === null) {
855
+ vErrors = [err9];
856
+ }
857
+ else {
858
+ vErrors.push(err9);
859
+ }
860
+ errors++;
861
+ }
862
+ if (func2(data1) < 1) {
863
+ const err10 = { instancePath: instancePath + "/naturalEndNanoseconds", schemaPath: "#/properties/naturalEndNanoseconds/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
864
+ if (vErrors === null) {
865
+ vErrors = [err10];
866
+ }
867
+ else {
868
+ vErrors.push(err10);
869
+ }
870
+ errors++;
871
+ }
872
+ if (!pattern5.test(data1)) {
873
+ const err11 = { instancePath: instancePath + "/naturalEndNanoseconds", schemaPath: "#/properties/naturalEndNanoseconds/pattern", keyword: "pattern", params: { pattern: "^(0|[1-9][0-9]*)$" }, message: "must match pattern \"" + "^(0|[1-9][0-9]*)$" + "\"" };
874
+ if (vErrors === null) {
875
+ vErrors = [err11];
876
+ }
877
+ else {
878
+ vErrors.push(err11);
879
+ }
880
+ errors++;
881
+ }
882
+ }
883
+ else {
884
+ const err12 = { instancePath: instancePath + "/naturalEndNanoseconds", schemaPath: "#/properties/naturalEndNanoseconds/type", keyword: "type", params: { type: "string" }, message: "must be string" };
885
+ if (vErrors === null) {
886
+ vErrors = [err12];
887
+ }
888
+ else {
889
+ vErrors.push(err12);
890
+ }
891
+ errors++;
892
+ }
893
+ }
894
+ if (data.playbackRate !== undefined) {
895
+ let data2 = data.playbackRate;
896
+ if (data2 && typeof data2 == "object" && !Array.isArray(data2)) {
897
+ if (data2.numerator === undefined) {
898
+ const err13 = { instancePath: instancePath + "/playbackRate", schemaPath: "#/$defs/WirePlaybackRate/required", keyword: "required", params: { missingProperty: "numerator" }, message: "must have required property '" + "numerator" + "'" };
899
+ if (vErrors === null) {
900
+ vErrors = [err13];
901
+ }
902
+ else {
903
+ vErrors.push(err13);
904
+ }
905
+ errors++;
906
+ }
907
+ if (data2.denominator === undefined) {
908
+ const err14 = { instancePath: instancePath + "/playbackRate", schemaPath: "#/$defs/WirePlaybackRate/required", keyword: "required", params: { missingProperty: "denominator" }, message: "must have required property '" + "denominator" + "'" };
909
+ if (vErrors === null) {
910
+ vErrors = [err14];
911
+ }
912
+ else {
913
+ vErrors.push(err14);
914
+ }
915
+ errors++;
916
+ }
917
+ for (const key1 in data2) {
918
+ if (!((key1 === "denominator") || (key1 === "numerator"))) {
919
+ const err15 = { instancePath: instancePath + "/playbackRate", schemaPath: "#/$defs/WirePlaybackRate/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
920
+ if (vErrors === null) {
921
+ vErrors = [err15];
922
+ }
923
+ else {
924
+ vErrors.push(err15);
925
+ }
926
+ errors++;
927
+ }
928
+ }
929
+ if (data2.denominator !== undefined) {
930
+ let data3 = data2.denominator;
931
+ if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) {
932
+ const err16 = { instancePath: instancePath + "/playbackRate/denominator", schemaPath: "#/$defs/WirePlaybackRate/properties/denominator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
933
+ if (vErrors === null) {
934
+ vErrors = [err16];
935
+ }
936
+ else {
937
+ vErrors.push(err16);
938
+ }
939
+ errors++;
940
+ }
941
+ if ((typeof data3 == "number") && (isFinite(data3))) {
942
+ if (data3 > 4294967295 || isNaN(data3)) {
943
+ const err17 = { instancePath: instancePath + "/playbackRate/denominator", schemaPath: "#/$defs/WirePlaybackRate/properties/denominator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
944
+ if (vErrors === null) {
945
+ vErrors = [err17];
946
+ }
947
+ else {
948
+ vErrors.push(err17);
949
+ }
950
+ errors++;
951
+ }
952
+ if (data3 < 1 || isNaN(data3)) {
953
+ const err18 = { instancePath: instancePath + "/playbackRate/denominator", schemaPath: "#/$defs/WirePlaybackRate/properties/denominator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
954
+ if (vErrors === null) {
955
+ vErrors = [err18];
956
+ }
957
+ else {
958
+ vErrors.push(err18);
959
+ }
960
+ errors++;
961
+ }
962
+ }
963
+ }
964
+ if (data2.numerator !== undefined) {
965
+ let data4 = data2.numerator;
966
+ if (!(((typeof data4 == "number") && (!(data4 % 1) && !isNaN(data4))) && (isFinite(data4)))) {
967
+ const err19 = { instancePath: instancePath + "/playbackRate/numerator", schemaPath: "#/$defs/WirePlaybackRate/properties/numerator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
968
+ if (vErrors === null) {
969
+ vErrors = [err19];
970
+ }
971
+ else {
972
+ vErrors.push(err19);
973
+ }
974
+ errors++;
975
+ }
976
+ if ((typeof data4 == "number") && (isFinite(data4))) {
977
+ if (data4 > 4294967295 || isNaN(data4)) {
978
+ const err20 = { instancePath: instancePath + "/playbackRate/numerator", schemaPath: "#/$defs/WirePlaybackRate/properties/numerator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
979
+ if (vErrors === null) {
980
+ vErrors = [err20];
981
+ }
982
+ else {
983
+ vErrors.push(err20);
984
+ }
985
+ errors++;
986
+ }
987
+ if (data4 < 1 || isNaN(data4)) {
988
+ const err21 = { instancePath: instancePath + "/playbackRate/numerator", schemaPath: "#/$defs/WirePlaybackRate/properties/numerator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
989
+ if (vErrors === null) {
990
+ vErrors = [err21];
991
+ }
992
+ else {
993
+ vErrors.push(err21);
994
+ }
995
+ errors++;
996
+ }
997
+ }
998
+ }
999
+ }
1000
+ else {
1001
+ const err22 = { instancePath: instancePath + "/playbackRate", schemaPath: "#/$defs/WirePlaybackRate/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1002
+ if (vErrors === null) {
1003
+ vErrors = [err22];
1004
+ }
1005
+ else {
1006
+ vErrors.push(err22);
1007
+ }
1008
+ errors++;
1009
+ }
1010
+ }
1011
+ if (data.startNanoseconds !== undefined) {
1012
+ let data5 = data.startNanoseconds;
1013
+ if (typeof data5 === "string") {
1014
+ if (func2(data5) > 20) {
1015
+ const err23 = { instancePath: instancePath + "/startNanoseconds", schemaPath: "#/properties/startNanoseconds/maxLength", keyword: "maxLength", params: { limit: 20 }, message: "must NOT have more than 20 characters" };
1016
+ if (vErrors === null) {
1017
+ vErrors = [err23];
1018
+ }
1019
+ else {
1020
+ vErrors.push(err23);
1021
+ }
1022
+ errors++;
1023
+ }
1024
+ if (func2(data5) < 1) {
1025
+ const err24 = { instancePath: instancePath + "/startNanoseconds", schemaPath: "#/properties/startNanoseconds/minLength", keyword: "minLength", params: { limit: 1 }, message: "must NOT have fewer than 1 characters" };
1026
+ if (vErrors === null) {
1027
+ vErrors = [err24];
1028
+ }
1029
+ else {
1030
+ vErrors.push(err24);
1031
+ }
1032
+ errors++;
1033
+ }
1034
+ if (!pattern5.test(data5)) {
1035
+ const err25 = { instancePath: instancePath + "/startNanoseconds", schemaPath: "#/properties/startNanoseconds/pattern", keyword: "pattern", params: { pattern: "^(0|[1-9][0-9]*)$" }, message: "must match pattern \"" + "^(0|[1-9][0-9]*)$" + "\"" };
1036
+ if (vErrors === null) {
1037
+ vErrors = [err25];
1038
+ }
1039
+ else {
1040
+ vErrors.push(err25);
1041
+ }
1042
+ errors++;
1043
+ }
1044
+ }
1045
+ else {
1046
+ const err26 = { instancePath: instancePath + "/startNanoseconds", schemaPath: "#/properties/startNanoseconds/type", keyword: "type", params: { type: "string" }, message: "must be string" };
1047
+ if (vErrors === null) {
1048
+ vErrors = [err26];
1049
+ }
1050
+ else {
1051
+ vErrors.push(err26);
1052
+ }
1053
+ errors++;
1054
+ }
1055
+ }
1056
+ }
1057
+ else {
1058
+ const err27 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1059
+ if (vErrors === null) {
1060
+ vErrors = [err27];
1061
+ }
1062
+ else {
1063
+ vErrors.push(err27);
1064
+ }
1065
+ errors++;
1066
+ }
1067
+ validate44.errors = vErrors;
1068
+ return errors === 0;
1069
+ }
1070
+ validate44.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
738
1071
  function validate41(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
739
1072
  let vErrors = null;
740
1073
  let errors = 0;
@@ -796,14 +1129,24 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
796
1129
  }
797
1130
  errors++;
798
1131
  }
1132
+ if (data.source === undefined) {
1133
+ const err5 = { instancePath, schemaPath: "#/required", keyword: "required", params: { missingProperty: "source" }, message: "must have required property '" + "source" + "'" };
1134
+ if (vErrors === null) {
1135
+ vErrors = [err5];
1136
+ }
1137
+ else {
1138
+ vErrors.push(err5);
1139
+ }
1140
+ errors++;
1141
+ }
799
1142
  for (const key0 in data) {
800
- if (!(((((key0 === "assetId") || (key0 === "interval")) || (key0 === "node")) || (key0 === "shotId")) || (key0 === "sourceFrameRate"))) {
801
- const err5 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
1143
+ if (!((((((key0 === "assetId") || (key0 === "interval")) || (key0 === "node")) || (key0 === "shotId")) || (key0 === "source")) || (key0 === "sourceFrameRate"))) {
1144
+ const err6 = { instancePath, schemaPath: "#/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key0 }, message: "must NOT have additional properties" };
802
1145
  if (vErrors === null) {
803
- vErrors = [err5];
1146
+ vErrors = [err6];
804
1147
  }
805
1148
  else {
806
- vErrors.push(err5);
1149
+ vErrors.push(err6);
807
1150
  }
808
1151
  errors++;
809
1152
  }
@@ -812,23 +1155,23 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
812
1155
  let data0 = data.assetId;
813
1156
  if (typeof data0 === "string") {
814
1157
  if (!pattern4.test(data0)) {
815
- const err6 = { instancePath: instancePath + "/assetId", schemaPath: "#/properties/assetId/pattern", keyword: "pattern", params: { pattern: "^sha256:[0-9a-f]{64}$" }, message: "must match pattern \"" + "^sha256:[0-9a-f]{64}$" + "\"" };
1158
+ const err7 = { instancePath: instancePath + "/assetId", schemaPath: "#/properties/assetId/pattern", keyword: "pattern", params: { pattern: "^sha256:[0-9a-f]{64}$" }, message: "must match pattern \"" + "^sha256:[0-9a-f]{64}$" + "\"" };
816
1159
  if (vErrors === null) {
817
- vErrors = [err6];
1160
+ vErrors = [err7];
818
1161
  }
819
1162
  else {
820
- vErrors.push(err6);
1163
+ vErrors.push(err7);
821
1164
  }
822
1165
  errors++;
823
1166
  }
824
1167
  }
825
1168
  else {
826
- const err7 = { instancePath: instancePath + "/assetId", schemaPath: "#/properties/assetId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
1169
+ const err8 = { instancePath: instancePath + "/assetId", schemaPath: "#/properties/assetId/type", keyword: "type", params: { type: "string" }, message: "must be string" };
827
1170
  if (vErrors === null) {
828
- vErrors = [err7];
1171
+ vErrors = [err8];
829
1172
  }
830
1173
  else {
831
- vErrors.push(err7);
1174
+ vErrors.push(err8);
832
1175
  }
833
1176
  errors++;
834
1177
  }
@@ -848,138 +1191,144 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
848
1191
  if (data.shotId !== undefined) {
849
1192
  let data3 = data.shotId;
850
1193
  if (!(((typeof data3 == "number") && (!(data3 % 1) && !isNaN(data3))) && (isFinite(data3)))) {
851
- const err8 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
1194
+ const err9 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
852
1195
  if (vErrors === null) {
853
- vErrors = [err8];
1196
+ vErrors = [err9];
854
1197
  }
855
1198
  else {
856
- vErrors.push(err8);
1199
+ vErrors.push(err9);
857
1200
  }
858
1201
  errors++;
859
1202
  }
860
1203
  if ((typeof data3 == "number") && (isFinite(data3))) {
861
1204
  if (data3 > 4294967295 || isNaN(data3)) {
862
- const err9 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
1205
+ const err10 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
863
1206
  if (vErrors === null) {
864
- vErrors = [err9];
1207
+ vErrors = [err10];
865
1208
  }
866
1209
  else {
867
- vErrors.push(err9);
1210
+ vErrors.push(err10);
868
1211
  }
869
1212
  errors++;
870
1213
  }
871
1214
  if (data3 < 0 || isNaN(data3)) {
872
- const err10 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
1215
+ const err11 = { instancePath: instancePath + "/shotId", schemaPath: "#/$defs/BrowserNodeId/minimum", keyword: "minimum", params: { comparison: ">=", limit: 0 }, message: "must be >= 0" };
873
1216
  if (vErrors === null) {
874
- vErrors = [err10];
1217
+ vErrors = [err11];
875
1218
  }
876
1219
  else {
877
- vErrors.push(err10);
1220
+ vErrors.push(err11);
878
1221
  }
879
1222
  errors++;
880
1223
  }
881
1224
  }
882
1225
  }
1226
+ if (data.source !== undefined) {
1227
+ if (!(validate44(data.source, { instancePath: instancePath + "/source", parentData: data, parentDataProperty: "source", rootData, dynamicAnchors }))) {
1228
+ vErrors = vErrors === null ? validate44.errors : vErrors.concat(validate44.errors);
1229
+ errors = vErrors.length;
1230
+ }
1231
+ }
883
1232
  if (data.sourceFrameRate !== undefined) {
884
- let data4 = data.sourceFrameRate;
885
- if (data4 && typeof data4 == "object" && !Array.isArray(data4)) {
886
- if (data4.numerator === undefined) {
887
- const err11 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/required", keyword: "required", params: { missingProperty: "numerator" }, message: "must have required property '" + "numerator" + "'" };
1233
+ let data5 = data.sourceFrameRate;
1234
+ if (data5 && typeof data5 == "object" && !Array.isArray(data5)) {
1235
+ if (data5.numerator === undefined) {
1236
+ const err12 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/required", keyword: "required", params: { missingProperty: "numerator" }, message: "must have required property '" + "numerator" + "'" };
888
1237
  if (vErrors === null) {
889
- vErrors = [err11];
1238
+ vErrors = [err12];
890
1239
  }
891
1240
  else {
892
- vErrors.push(err11);
1241
+ vErrors.push(err12);
893
1242
  }
894
1243
  errors++;
895
1244
  }
896
- if (data4.denominator === undefined) {
897
- const err12 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/required", keyword: "required", params: { missingProperty: "denominator" }, message: "must have required property '" + "denominator" + "'" };
1245
+ if (data5.denominator === undefined) {
1246
+ const err13 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/required", keyword: "required", params: { missingProperty: "denominator" }, message: "must have required property '" + "denominator" + "'" };
898
1247
  if (vErrors === null) {
899
- vErrors = [err12];
1248
+ vErrors = [err13];
900
1249
  }
901
1250
  else {
902
- vErrors.push(err12);
1251
+ vErrors.push(err13);
903
1252
  }
904
1253
  errors++;
905
1254
  }
906
- for (const key1 in data4) {
1255
+ for (const key1 in data5) {
907
1256
  if (!((key1 === "denominator") || (key1 === "numerator"))) {
908
- const err13 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
1257
+ const err14 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/additionalProperties", keyword: "additionalProperties", params: { additionalProperty: key1 }, message: "must NOT have additional properties" };
909
1258
  if (vErrors === null) {
910
- vErrors = [err13];
1259
+ vErrors = [err14];
911
1260
  }
912
1261
  else {
913
- vErrors.push(err13);
1262
+ vErrors.push(err14);
914
1263
  }
915
1264
  errors++;
916
1265
  }
917
1266
  }
918
- if (data4.denominator !== undefined) {
919
- let data5 = data4.denominator;
920
- if (!(((typeof data5 == "number") && (!(data5 % 1) && !isNaN(data5))) && (isFinite(data5)))) {
921
- const err14 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
1267
+ if (data5.denominator !== undefined) {
1268
+ let data6 = data5.denominator;
1269
+ if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
1270
+ const err15 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
922
1271
  if (vErrors === null) {
923
- vErrors = [err14];
1272
+ vErrors = [err15];
924
1273
  }
925
1274
  else {
926
- vErrors.push(err14);
1275
+ vErrors.push(err15);
927
1276
  }
928
1277
  errors++;
929
1278
  }
930
- if ((typeof data5 == "number") && (isFinite(data5))) {
931
- if (data5 > 4294967295 || isNaN(data5)) {
932
- const err15 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
1279
+ if ((typeof data6 == "number") && (isFinite(data6))) {
1280
+ if (data6 > 4294967295 || isNaN(data6)) {
1281
+ const err16 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
933
1282
  if (vErrors === null) {
934
- vErrors = [err15];
1283
+ vErrors = [err16];
935
1284
  }
936
1285
  else {
937
- vErrors.push(err15);
1286
+ vErrors.push(err16);
938
1287
  }
939
1288
  errors++;
940
1289
  }
941
- if (data5 < 1 || isNaN(data5)) {
942
- const err16 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
1290
+ if (data6 < 1 || isNaN(data6)) {
1291
+ const err17 = { instancePath: instancePath + "/sourceFrameRate/denominator", schemaPath: "#/$defs/WireFrameRate/properties/denominator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
943
1292
  if (vErrors === null) {
944
- vErrors = [err16];
1293
+ vErrors = [err17];
945
1294
  }
946
1295
  else {
947
- vErrors.push(err16);
1296
+ vErrors.push(err17);
948
1297
  }
949
1298
  errors++;
950
1299
  }
951
1300
  }
952
1301
  }
953
- if (data4.numerator !== undefined) {
954
- let data6 = data4.numerator;
955
- if (!(((typeof data6 == "number") && (!(data6 % 1) && !isNaN(data6))) && (isFinite(data6)))) {
956
- const err17 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
1302
+ if (data5.numerator !== undefined) {
1303
+ let data7 = data5.numerator;
1304
+ if (!(((typeof data7 == "number") && (!(data7 % 1) && !isNaN(data7))) && (isFinite(data7)))) {
1305
+ const err18 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/type", keyword: "type", params: { type: "integer" }, message: "must be integer" };
957
1306
  if (vErrors === null) {
958
- vErrors = [err17];
1307
+ vErrors = [err18];
959
1308
  }
960
1309
  else {
961
- vErrors.push(err17);
1310
+ vErrors.push(err18);
962
1311
  }
963
1312
  errors++;
964
1313
  }
965
- if ((typeof data6 == "number") && (isFinite(data6))) {
966
- if (data6 > 4294967295 || isNaN(data6)) {
967
- const err18 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
1314
+ if ((typeof data7 == "number") && (isFinite(data7))) {
1315
+ if (data7 > 4294967295 || isNaN(data7)) {
1316
+ const err19 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/maximum", keyword: "maximum", params: { comparison: "<=", limit: 4294967295 }, message: "must be <= 4294967295" };
968
1317
  if (vErrors === null) {
969
- vErrors = [err18];
1318
+ vErrors = [err19];
970
1319
  }
971
1320
  else {
972
- vErrors.push(err18);
1321
+ vErrors.push(err19);
973
1322
  }
974
1323
  errors++;
975
1324
  }
976
- if (data6 < 1 || isNaN(data6)) {
977
- const err19 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
1325
+ if (data7 < 1 || isNaN(data7)) {
1326
+ const err20 = { instancePath: instancePath + "/sourceFrameRate/numerator", schemaPath: "#/$defs/WireFrameRate/properties/numerator/minimum", keyword: "minimum", params: { comparison: ">=", limit: 1 }, message: "must be >= 1" };
978
1327
  if (vErrors === null) {
979
- vErrors = [err19];
1328
+ vErrors = [err20];
980
1329
  }
981
1330
  else {
982
- vErrors.push(err19);
1331
+ vErrors.push(err20);
983
1332
  }
984
1333
  errors++;
985
1334
  }
@@ -987,24 +1336,24 @@ function validate41(data, { instancePath = "", parentData, parentDataProperty, r
987
1336
  }
988
1337
  }
989
1338
  else {
990
- const err20 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1339
+ const err21 = { instancePath: instancePath + "/sourceFrameRate", schemaPath: "#/$defs/WireFrameRate/type", keyword: "type", params: { type: "object" }, message: "must be object" };
991
1340
  if (vErrors === null) {
992
- vErrors = [err20];
1341
+ vErrors = [err21];
993
1342
  }
994
1343
  else {
995
- vErrors.push(err20);
1344
+ vErrors.push(err21);
996
1345
  }
997
1346
  errors++;
998
1347
  }
999
1348
  }
1000
1349
  }
1001
1350
  else {
1002
- const err21 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1351
+ const err22 = { instancePath, schemaPath: "#/type", keyword: "type", params: { type: "object" }, message: "must be object" };
1003
1352
  if (vErrors === null) {
1004
- vErrors = [err21];
1353
+ vErrors = [err22];
1005
1354
  }
1006
1355
  else {
1007
- vErrors.push(err21);
1356
+ vErrors.push(err22);
1008
1357
  }
1009
1358
  errors++;
1010
1359
  }
@@ -1384,8 +1733,8 @@ function validate22(data, { instancePath = "", parentData, parentDataProperty, r
1384
1733
  }
1385
1734
  errors++;
1386
1735
  }
1387
- if (1 !== data13) {
1388
- const err28 = { instancePath: instancePath + "/timelineVersion", schemaPath: "#/properties/timelineVersion/const", keyword: "const", params: { allowedValue: 1 }, message: "must be equal to constant" };
1736
+ if (2 !== data13) {
1737
+ const err28 = { instancePath: instancePath + "/timelineVersion", schemaPath: "#/properties/timelineVersion/const", keyword: "const", params: { allowedValue: 2 }, message: "must be equal to constant" };
1389
1738
  if (vErrors === null) {
1390
1739
  vErrors = [err28];
1391
1740
  }
@@ -2007,7 +2356,7 @@ function validate21(data, { instancePath = "", parentData, parentDataProperty, r
2007
2356
  }
2008
2357
  validate21.evaluated = { "dynamicProps": true, "dynamicItems": false };
2009
2358
  function validate20(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2010
- /*# sourceURL="https://onmark.dev/schemas/browser-request-v1.schema.json" */ ;
2359
+ /*# sourceURL="https://onmark.dev/schemas/browser-request-v2.schema.json" */ ;
2011
2360
  let vErrors = null;
2012
2361
  let errors = 0;
2013
2362
  const evaluated0 = validate20.evaluated;
@@ -2113,8 +2462,8 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
2113
2462
  }
2114
2463
  errors++;
2115
2464
  }
2116
- if (1 !== data2) {
2117
- const err8 = { instancePath: instancePath + "/version", schemaPath: "#/$defs/ProtocolVersion/const", keyword: "const", params: { allowedValue: 1 }, message: "must be equal to constant" };
2465
+ if (2 !== data2) {
2466
+ const err8 = { instancePath: instancePath + "/version", schemaPath: "#/$defs/ProtocolVersion/const", keyword: "const", params: { allowedValue: 2 }, message: "must be equal to constant" };
2118
2467
  if (vErrors === null) {
2119
2468
  vErrors = [err8];
2120
2469
  }
@@ -2161,18 +2510,18 @@ function validate20(data, { instancePath = "", parentData, parentDataProperty, r
2161
2510
  return errors === 0;
2162
2511
  }
2163
2512
  validate20.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
2164
- export const validateBrowserResponse = validate47;
2165
- const schema54 = { "$defs": { "BrowserEvent": { "description": "Closed events emitted by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "The immutable browser plan was accepted.", "properties": { "type": { "const": "loaded", "type": "string" } }, "required": ["type"], "type": "object" }, { "additionalProperties": false, "description": "Resources required at the evaluation start are stable.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "Frame at which preparation completed." }, "type": { "const": "prepared", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "One requested frame has been staged for the compositor.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame represented by staged browser state." }, "type": { "const": "frameStaged", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The captured payload's staged media passed compositor confirmation.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame confirmed by browser media state." }, "type": { "const": "frameReady", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The browser rejected a command or could not reach readiness.", "properties": { "code": { "$ref": "#/$defs/ProtocolFailureCode", "description": "Stable machine-readable failure category." }, "message": { "description": "Direct explanation in browser/runtime terms.", "maxLength": 4096, "pattern": "\\S", "type": "string" }, "pendingResources": { "description": "Resources that prevented readiness, in caller-owned deterministic order.", "items": { "maxLength": 1024, "pattern": "\\S", "type": "string" }, "maxItems": 256, "type": "array" }, "type": { "const": "failed", "type": "string" } }, "required": ["type", "code", "message", "pendingResources"], "type": "object" }, { "additionalProperties": false, "description": "The browser session released its resources.", "properties": { "type": { "const": "disposed", "type": "string" } }, "required": ["type"], "type": "object" }] }, "ProtocolFailureCode": { "description": "Stable browser protocol failure category.", "oneOf": [{ "const": "protocolMismatch", "description": "The envelope version is unsupported.", "type": "string" }, { "const": "invalidRequest", "description": "The command violates its wire contract.", "type": "string" }, { "const": "loadFailed", "description": "The immutable plan could not be installed.", "type": "string" }, { "const": "prepareFailed", "description": "Preparation could not stabilize required resources.", "type": "string" }, { "const": "seekFailed", "description": "The requested frame could not be evaluated.", "type": "string" }, { "const": "confirmFailed", "description": "The staged frame could not be confirmed after compositor capture.", "type": "string" }, { "const": "readinessTimeout", "description": "One or more resources missed the readiness deadline.", "type": "string" }, { "const": "internal", "description": "The runtime violated an internal invariant.", "type": "string" }] }, "ProtocolVersion": { "const": 1, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "RequestId": { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "WireFrame": { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" } }, "$id": "https://onmark.dev/schemas/browser-response-v1.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "One versioned event returned by the browser runtime.", "properties": { "event": { "$ref": "#/$defs/BrowserEvent" }, "requestId": { "$ref": "#/$defs/RequestId" }, "version": { "$ref": "#/$defs/ProtocolVersion" } }, "required": ["version", "requestId", "event"], "title": "BrowserResponse", "type": "object", "x-onmark-max-failure-message-characters": 4096, "x-onmark-max-pending-resource-characters": 1024, "x-onmark-max-pending-resources": 256 };
2166
- const schema60 = { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" };
2167
- const schema61 = { "const": 1, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" };
2168
- const schema55 = { "description": "Closed events emitted by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "The immutable browser plan was accepted.", "properties": { "type": { "const": "loaded", "type": "string" } }, "required": ["type"], "type": "object" }, { "additionalProperties": false, "description": "Resources required at the evaluation start are stable.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "Frame at which preparation completed." }, "type": { "const": "prepared", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "One requested frame has been staged for the compositor.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame represented by staged browser state." }, "type": { "const": "frameStaged", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The captured payload's staged media passed compositor confirmation.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame confirmed by browser media state." }, "type": { "const": "frameReady", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The browser rejected a command or could not reach readiness.", "properties": { "code": { "$ref": "#/$defs/ProtocolFailureCode", "description": "Stable machine-readable failure category." }, "message": { "description": "Direct explanation in browser/runtime terms.", "maxLength": 4096, "pattern": "\\S", "type": "string" }, "pendingResources": { "description": "Resources that prevented readiness, in caller-owned deterministic order.", "items": { "maxLength": 1024, "pattern": "\\S", "type": "string" }, "maxItems": 256, "type": "array" }, "type": { "const": "failed", "type": "string" } }, "required": ["type", "code", "message", "pendingResources"], "type": "object" }, { "additionalProperties": false, "description": "The browser session released its resources.", "properties": { "type": { "const": "disposed", "type": "string" } }, "required": ["type"], "type": "object" }] };
2169
- const schema56 = { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" };
2170
- const schema59 = { "description": "Stable browser protocol failure category.", "oneOf": [{ "const": "protocolMismatch", "description": "The envelope version is unsupported.", "type": "string" }, { "const": "invalidRequest", "description": "The command violates its wire contract.", "type": "string" }, { "const": "loadFailed", "description": "The immutable plan could not be installed.", "type": "string" }, { "const": "prepareFailed", "description": "Preparation could not stabilize required resources.", "type": "string" }, { "const": "seekFailed", "description": "The requested frame could not be evaluated.", "type": "string" }, { "const": "confirmFailed", "description": "The staged frame could not be confirmed after compositor capture.", "type": "string" }, { "const": "readinessTimeout", "description": "One or more resources missed the readiness deadline.", "type": "string" }, { "const": "internal", "description": "The runtime violated an internal invariant.", "type": "string" }] };
2171
- const pattern5 = new RegExp("\\S", "u");
2172
- function validate48(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2513
+ export const validateBrowserResponse = validate49;
2514
+ const schema56 = { "$defs": { "BrowserEvent": { "description": "Closed events emitted by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "The immutable browser plan was accepted.", "properties": { "type": { "const": "loaded", "type": "string" } }, "required": ["type"], "type": "object" }, { "additionalProperties": false, "description": "Resources required at the evaluation start are stable.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "Frame at which preparation completed." }, "type": { "const": "prepared", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "One requested frame has been staged for the compositor.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame represented by staged browser state." }, "type": { "const": "frameStaged", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The captured payload's staged media passed compositor confirmation.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame confirmed by browser media state." }, "type": { "const": "frameReady", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The browser rejected a command or could not reach readiness.", "properties": { "code": { "$ref": "#/$defs/ProtocolFailureCode", "description": "Stable machine-readable failure category." }, "message": { "description": "Direct explanation in browser/runtime terms.", "maxLength": 4096, "pattern": "\\S", "type": "string" }, "pendingResources": { "description": "Resources that prevented readiness, in caller-owned deterministic order.", "items": { "maxLength": 1024, "pattern": "\\S", "type": "string" }, "maxItems": 256, "type": "array" }, "type": { "const": "failed", "type": "string" } }, "required": ["type", "code", "message", "pendingResources"], "type": "object" }, { "additionalProperties": false, "description": "The browser session released its resources.", "properties": { "type": { "const": "disposed", "type": "string" } }, "required": ["type"], "type": "object" }] }, "ProtocolFailureCode": { "description": "Stable browser protocol failure category.", "oneOf": [{ "const": "protocolMismatch", "description": "The envelope version is unsupported.", "type": "string" }, { "const": "invalidRequest", "description": "The command violates its wire contract.", "type": "string" }, { "const": "loadFailed", "description": "The immutable plan could not be installed.", "type": "string" }, { "const": "prepareFailed", "description": "Preparation could not stabilize required resources.", "type": "string" }, { "const": "seekFailed", "description": "The requested frame could not be evaluated.", "type": "string" }, { "const": "confirmFailed", "description": "The staged frame could not be confirmed after compositor capture.", "type": "string" }, { "const": "readinessTimeout", "description": "One or more resources missed the readiness deadline.", "type": "string" }, { "const": "internal", "description": "The runtime violated an internal invariant.", "type": "string" }] }, "ProtocolVersion": { "const": 2, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" }, "RequestId": { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" }, "WireFrame": { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" } }, "$id": "https://onmark.dev/schemas/browser-response-v2.schema.json", "$schema": "https://json-schema.org/draft/2020-12/schema", "additionalProperties": false, "description": "One versioned event returned by the browser runtime.", "properties": { "event": { "$ref": "#/$defs/BrowserEvent" }, "requestId": { "$ref": "#/$defs/RequestId" }, "version": { "$ref": "#/$defs/ProtocolVersion" } }, "required": ["version", "requestId", "event"], "title": "BrowserResponse", "type": "object", "x-onmark-max-failure-message-characters": 4096, "x-onmark-max-pending-resource-characters": 1024, "x-onmark-max-pending-resources": 256 };
2515
+ const schema62 = { "description": "Correlation identity shared by one request and its response events.", "format": "uint32", "maximum": 4294967295, "minimum": 0, "type": "integer" };
2516
+ const schema63 = { "const": 2, "description": "Version of the native-to-browser message contract.", "format": "uint16", "maximum": 65535, "minimum": 0, "type": "integer" };
2517
+ const schema57 = { "description": "Closed events emitted by the browser runtime.", "oneOf": [{ "additionalProperties": false, "description": "The immutable browser plan was accepted.", "properties": { "type": { "const": "loaded", "type": "string" } }, "required": ["type"], "type": "object" }, { "additionalProperties": false, "description": "Resources required at the evaluation start are stable.", "properties": { "evaluationStart": { "$ref": "#/$defs/WireFrame", "description": "Frame at which preparation completed." }, "type": { "const": "prepared", "type": "string" } }, "required": ["type", "evaluationStart"], "type": "object" }, { "additionalProperties": false, "description": "One requested frame has been staged for the compositor.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame represented by staged browser state." }, "type": { "const": "frameStaged", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The captured payload's staged media passed compositor confirmation.", "properties": { "frame": { "$ref": "#/$defs/WireFrame", "description": "Exact frame confirmed by browser media state." }, "type": { "const": "frameReady", "type": "string" } }, "required": ["type", "frame"], "type": "object" }, { "additionalProperties": false, "description": "The browser rejected a command or could not reach readiness.", "properties": { "code": { "$ref": "#/$defs/ProtocolFailureCode", "description": "Stable machine-readable failure category." }, "message": { "description": "Direct explanation in browser/runtime terms.", "maxLength": 4096, "pattern": "\\S", "type": "string" }, "pendingResources": { "description": "Resources that prevented readiness, in caller-owned deterministic order.", "items": { "maxLength": 1024, "pattern": "\\S", "type": "string" }, "maxItems": 256, "type": "array" }, "type": { "const": "failed", "type": "string" } }, "required": ["type", "code", "message", "pendingResources"], "type": "object" }, { "additionalProperties": false, "description": "The browser session released its resources.", "properties": { "type": { "const": "disposed", "type": "string" } }, "required": ["type"], "type": "object" }] };
2518
+ const schema58 = { "description": "Exact frame integer accepted by JavaScript without rounding.", "format": "uint64", "maximum": 9007199254740991, "minimum": 0, "type": "integer" };
2519
+ const schema61 = { "description": "Stable browser protocol failure category.", "oneOf": [{ "const": "protocolMismatch", "description": "The envelope version is unsupported.", "type": "string" }, { "const": "invalidRequest", "description": "The command violates its wire contract.", "type": "string" }, { "const": "loadFailed", "description": "The immutable plan could not be installed.", "type": "string" }, { "const": "prepareFailed", "description": "Preparation could not stabilize required resources.", "type": "string" }, { "const": "seekFailed", "description": "The requested frame could not be evaluated.", "type": "string" }, { "const": "confirmFailed", "description": "The staged frame could not be confirmed after compositor capture.", "type": "string" }, { "const": "readinessTimeout", "description": "One or more resources missed the readiness deadline.", "type": "string" }, { "const": "internal", "description": "The runtime violated an internal invariant.", "type": "string" }] };
2520
+ const pattern8 = new RegExp("\\S", "u");
2521
+ function validate50(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
2173
2522
  let vErrors = null;
2174
2523
  let errors = 0;
2175
- const evaluated0 = validate48.evaluated;
2524
+ const evaluated0 = validate50.evaluated;
2176
2525
  if (evaluated0.dynamicProps) {
2177
2526
  evaluated0.props = undefined;
2178
2527
  }
@@ -2938,7 +3287,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
2938
3287
  }
2939
3288
  errors++;
2940
3289
  }
2941
- if (!pattern5.test(data8)) {
3290
+ if (!pattern8.test(data8)) {
2942
3291
  const err55 = { instancePath: instancePath + "/message", schemaPath: "#/oneOf/4/properties/message/pattern", keyword: "pattern", params: { pattern: "\\S" }, message: "must match pattern \"" + "\\S" + "\"" };
2943
3292
  if (vErrors === null) {
2944
3293
  vErrors = [err55];
@@ -2987,7 +3336,7 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
2987
3336
  }
2988
3337
  errors++;
2989
3338
  }
2990
- if (!pattern5.test(data10)) {
3339
+ if (!pattern8.test(data10)) {
2991
3340
  const err59 = { instancePath: instancePath + "/pendingResources/" + i0, schemaPath: "#/oneOf/4/properties/pendingResources/items/pattern", keyword: "pattern", params: { pattern: "\\S" }, message: "must match pattern \"" + "\\S" + "\"" };
2992
3341
  if (vErrors === null) {
2993
3342
  vErrors = [err59];
@@ -3165,16 +3514,16 @@ function validate48(data, { instancePath = "", parentData, parentDataProperty, r
3165
3514
  }
3166
3515
  }
3167
3516
  }
3168
- validate48.errors = vErrors;
3517
+ validate50.errors = vErrors;
3169
3518
  evaluated0.props = props0;
3170
3519
  return errors === 0;
3171
3520
  }
3172
- validate48.evaluated = { "dynamicProps": true, "dynamicItems": false };
3173
- function validate47(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3174
- /*# sourceURL="https://onmark.dev/schemas/browser-response-v1.schema.json" */ ;
3521
+ validate50.evaluated = { "dynamicProps": true, "dynamicItems": false };
3522
+ function validate49(data, { instancePath = "", parentData, parentDataProperty, rootData = data, dynamicAnchors = {} } = {}) {
3523
+ /*# sourceURL="https://onmark.dev/schemas/browser-response-v2.schema.json" */ ;
3175
3524
  let vErrors = null;
3176
3525
  let errors = 0;
3177
- const evaluated0 = validate47.evaluated;
3526
+ const evaluated0 = validate49.evaluated;
3178
3527
  if (evaluated0.dynamicProps) {
3179
3528
  evaluated0.props = undefined;
3180
3529
  }
@@ -3225,8 +3574,8 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
3225
3574
  }
3226
3575
  }
3227
3576
  if (data.event !== undefined) {
3228
- if (!(validate48(data.event, { instancePath: instancePath + "/event", parentData: data, parentDataProperty: "event", rootData, dynamicAnchors }))) {
3229
- vErrors = vErrors === null ? validate48.errors : vErrors.concat(validate48.errors);
3577
+ if (!(validate50(data.event, { instancePath: instancePath + "/event", parentData: data, parentDataProperty: "event", rootData, dynamicAnchors }))) {
3578
+ vErrors = vErrors === null ? validate50.errors : vErrors.concat(validate50.errors);
3230
3579
  errors = vErrors.length;
3231
3580
  }
3232
3581
  }
@@ -3277,8 +3626,8 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
3277
3626
  }
3278
3627
  errors++;
3279
3628
  }
3280
- if (1 !== data2) {
3281
- const err8 = { instancePath: instancePath + "/version", schemaPath: "#/$defs/ProtocolVersion/const", keyword: "const", params: { allowedValue: 1 }, message: "must be equal to constant" };
3629
+ if (2 !== data2) {
3630
+ const err8 = { instancePath: instancePath + "/version", schemaPath: "#/$defs/ProtocolVersion/const", keyword: "const", params: { allowedValue: 2 }, message: "must be equal to constant" };
3282
3631
  if (vErrors === null) {
3283
3632
  vErrors = [err8];
3284
3633
  }
@@ -3321,7 +3670,7 @@ function validate47(data, { instancePath = "", parentData, parentDataProperty, r
3321
3670
  }
3322
3671
  errors++;
3323
3672
  }
3324
- validate47.errors = vErrors;
3673
+ validate49.errors = vErrors;
3325
3674
  return errors === 0;
3326
3675
  }
3327
- validate47.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
3676
+ validate49.evaluated = { "props": true, "dynamicProps": false, "dynamicItems": false };
@@ -10,4 +10,11 @@ export interface VideoFrameSelection {
10
10
  }
11
11
  /** Selects the source frame visible at one output-frame midpoint. */
12
12
  export declare function videoFrameSelection(frame: RuntimeFrame, video: RuntimeVideo, outputFrameRate: FrameRate): VideoFrameSelection | undefined;
13
+ /** Checks protocol source facts without deriving any authored timeline. */
14
+ export declare function videoSourceMappingIsValid(video: RuntimeVideo, outputFrameRate: FrameRate): boolean;
15
+ /** Checks the canonical positive-rational spelling used by Rust wire values. */
16
+ export declare function exactRatioIsCanonical(rate: {
17
+ readonly numerator: number;
18
+ readonly denominator: number;
19
+ }): boolean;
13
20
  export {};
@@ -1,28 +1,90 @@
1
1
  // Browser-media projection from exact Rust-owned frame facts.
2
2
  // It selects source frames without becoming a second timeline solver.
3
+ const MAX_DURATION_NANOSECONDS = 18446744073709551615n;
4
+ const MAX_RATIO_PART = 4_294_967_295;
3
5
  /** Selects the source frame visible at one output-frame midpoint. */
4
6
  export function videoFrameSelection(frame, video, outputFrameRate) {
5
7
  if (frame.index < video.interval.start || frame.index >= video.interval.end) {
6
8
  return undefined;
7
9
  }
8
10
  const localFrame = frame.index - video.interval.start;
9
- const sourceFrame = sourceFrameAtMidpoint(localFrame, outputFrameRate, video.sourceFrameRate);
11
+ const sourceFrame = sourceFrameAtMidpoint(localFrame, outputFrameRate, video.sourceFrameRate, video.source);
10
12
  const sourceFrameDuration = video.sourceFrameRate.denominator / video.sourceFrameRate.numerator;
11
13
  return Object.freeze({
12
14
  mediaTimeSeconds: sourceFrame * sourceFrameDuration,
13
15
  seekTimeSeconds: (sourceFrame + 0.5) * sourceFrameDuration,
14
16
  });
15
17
  }
16
- function sourceFrameAtMidpoint(localFrame, outputFrameRate, sourceFrameRate) {
17
- const numerator = (2n * BigInt(localFrame) + 1n) *
18
- BigInt(outputFrameRate.denominator) *
19
- BigInt(sourceFrameRate.numerator);
20
- const denominator = 2n *
18
+ /** Checks protocol source facts without deriving any authored timeline. */
19
+ export function videoSourceMappingIsValid(video, outputFrameRate) {
20
+ const source = video.source;
21
+ const start = BigInt(source.startNanoseconds);
22
+ const end = BigInt(source.endNanoseconds);
23
+ const naturalEnd = BigInt(source.naturalEndNanoseconds);
24
+ if (start >= end ||
25
+ end > naturalEnd ||
26
+ naturalEnd > MAX_DURATION_NANOSECONDS) {
27
+ return false;
28
+ }
29
+ if (!exactRatioIsCanonical(video.sourceFrameRate) ||
30
+ !exactRatioIsCanonical(source.playbackRate)) {
31
+ return false;
32
+ }
33
+ const sourceDuration = end - start;
34
+ const numerator = sourceDuration *
21
35
  BigInt(outputFrameRate.numerator) *
22
- BigInt(sourceFrameRate.denominator);
23
- const sourceFrame = Number(numerator / denominator);
36
+ BigInt(source.playbackRate.denominator);
37
+ const denominator = 1000000000n *
38
+ BigInt(outputFrameRate.denominator) *
39
+ BigInt(source.playbackRate.numerator);
40
+ const expectedFrames = (numerator + denominator - 1n) / denominator;
41
+ const actualFrames = BigInt(video.interval.end - video.interval.start);
42
+ return actualFrames === expectedFrames;
43
+ }
44
+ function sourceFrameAtMidpoint(localFrame, outputFrameRate, sourceFrameRate, source) {
45
+ const midpoint = 2n * BigInt(localFrame) + 1n;
46
+ const outputNumerator = BigInt(outputFrameRate.numerator);
47
+ const outputDenominator = BigInt(outputFrameRate.denominator);
48
+ const sourceNumerator = BigInt(sourceFrameRate.numerator);
49
+ const sourceDenominator = BigInt(sourceFrameRate.denominator);
50
+ const speedNumerator = BigInt(source.playbackRate.numerator);
51
+ const speedDenominator = BigInt(source.playbackRate.denominator);
52
+ const startNanoseconds = BigInt(source.startNanoseconds);
53
+ const endNanoseconds = BigInt(source.endNanoseconds);
54
+ const nanosecondsPerSecond = 1000000000n;
55
+ // Rust owns the affine source-time mapping. This integer projection samples
56
+ // the output-frame midpoint without reconstructing a browser timeline.
57
+ const timeDenominator = 2n * outputNumerator * speedDenominator;
58
+ const sourceTimeNumerator = startNanoseconds * timeDenominator +
59
+ midpoint * outputDenominator * speedNumerator * nanosecondsPerSecond;
60
+ const frameNumerator = sourceTimeNumerator * sourceNumerator;
61
+ const denominator = timeDenominator * nanosecondsPerSecond * sourceDenominator;
62
+ const selectedFrame = frameNumerator / denominator;
63
+ const sourceEndNumerator = endNanoseconds * sourceNumerator;
64
+ const sourceFrameDenominator = nanosecondsPerSecond * sourceDenominator;
65
+ const exclusiveEndFrame = (sourceEndNumerator + sourceFrameDenominator - 1n) / sourceFrameDenominator;
66
+ // Ceil-rounded output may expose one midpoint beyond the trim edge. Keep
67
+ // that final sample inside the last source frame intersecting the interval.
68
+ const sourceFrame = Number(selectedFrame < exclusiveEndFrame ? selectedFrame : exclusiveEndFrame - 1n);
24
69
  if (!Number.isSafeInteger(sourceFrame)) {
25
70
  throw new RangeError("selected source frame exceeds JavaScript's exact integer range");
26
71
  }
27
72
  return sourceFrame;
28
73
  }
74
+ /** Checks the canonical positive-rational spelling used by Rust wire values. */
75
+ export function exactRatioIsCanonical(rate) {
76
+ if (!Number.isInteger(rate.numerator) ||
77
+ !Number.isInteger(rate.denominator) ||
78
+ rate.numerator < 1 ||
79
+ rate.denominator < 1 ||
80
+ rate.numerator > MAX_RATIO_PART ||
81
+ rate.denominator > MAX_RATIO_PART) {
82
+ return false;
83
+ }
84
+ let left = BigInt(rate.numerator);
85
+ let right = BigInt(rate.denominator);
86
+ while (right !== 0n) {
87
+ [left, right] = [right, left % right];
88
+ }
89
+ return left === 1n;
90
+ }
@@ -4,6 +4,7 @@
4
4
  import { decodeBrowserResponse } from "./generated/codec.js";
5
5
  import { MAX_FAILURE_MESSAGE_CHARACTERS, MAX_PENDING_RESOURCE_CHARACTERS, MAX_PENDING_RESOURCES, } from "./generated/runtime-contract.js";
6
6
  import { runtimeFrameAt } from "./clock.js";
7
+ import { exactRatioIsCanonical, videoSourceMappingIsValid } from "./media.js";
7
8
  /** Expected failure reported by a browser adapter. */
8
9
  export class RuntimeAdapterError extends Error {
9
10
  kind;
@@ -156,7 +157,7 @@ export class RuntimeSession {
156
157
  }
157
158
  }
158
159
  function response(requestId, event) {
159
- return decodeBrowserResponse({ version: 1, requestId, event });
160
+ return decodeBrowserResponse({ version: 2, requestId, event });
160
161
  }
161
162
  function invalidRequest(requestId, message) {
162
163
  return response(requestId, {
@@ -195,6 +196,9 @@ function readinessFailure(requestId, operationCode, error) {
195
196
  return operationFailure(requestId, operationCode, error);
196
197
  }
197
198
  function planViolation(plan) {
199
+ if (!exactRatioIsCanonical(plan.frameRate)) {
200
+ return "plan frame rate is not canonical";
201
+ }
198
202
  if (plan.timeline.start >= plan.timeline.end) {
199
203
  return "plan timeline interval is empty or reversed";
200
204
  }
@@ -267,6 +271,9 @@ function planViolation(plan) {
267
271
  if (!insideInterval(video.interval, shotInterval)) {
268
272
  return "plan video interval falls outside its shot";
269
273
  }
274
+ if (!videoSourceMappingIsValid(video, plan.frameRate)) {
275
+ return "plan video source mapping disagrees with its interval";
276
+ }
270
277
  }
271
278
  for (const overlay of plan.overlays) {
272
279
  const nodeViolation = claimNode(overlay.node, nodeIds, authoredIds);
@@ -400,6 +407,10 @@ function snapshotVideo(video) {
400
407
  assetId: video.assetId,
401
408
  interval: Object.freeze({ ...video.interval }),
402
409
  sourceFrameRate: Object.freeze({ ...video.sourceFrameRate }),
410
+ source: Object.freeze({
411
+ ...video.source,
412
+ playbackRate: Object.freeze({ ...video.source.playbackRate }),
413
+ }),
403
414
  });
404
415
  }
405
416
  function snapshotOverlay(overlay) {