@onmark/cli 0.1.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.
Files changed (77) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +202 -0
  3. package/onmark-release.json +388 -0
  4. package/package.json +52 -0
  5. package/packages/authoring/dist/src/index.d.ts +3 -0
  6. package/packages/authoring/dist/src/index.js +4 -0
  7. package/packages/authoring/dist/src/motion.d.ts +23 -0
  8. package/packages/authoring/dist/src/motion.js +81 -0
  9. package/packages/authoring/dist/src/presentation.d.ts +12 -0
  10. package/packages/authoring/dist/src/presentation.js +226 -0
  11. package/packages/authoring/dist/src/resource.d.ts +32 -0
  12. package/packages/authoring/dist/src/resource.js +86 -0
  13. package/packages/authoring/dist/src/types.d.ts +1 -0
  14. package/packages/authoring/dist/src/types.js +2 -0
  15. package/packages/bundler/dist/src/authored_html.d.ts +41 -0
  16. package/packages/bundler/dist/src/authored_html.js +387 -0
  17. package/packages/bundler/dist/src/command.d.ts +2 -0
  18. package/packages/bundler/dist/src/command.js +138 -0
  19. package/packages/bundler/dist/src/generated/bundle-manifest.d.ts +65 -0
  20. package/packages/bundler/dist/src/generated/bundle-manifest.js +18 -0
  21. package/packages/bundler/dist/src/html_image.d.ts +20 -0
  22. package/packages/bundler/dist/src/html_image.js +337 -0
  23. package/packages/bundler/dist/src/image_admission.d.ts +2 -0
  24. package/packages/bundler/dist/src/image_admission.js +217 -0
  25. package/packages/bundler/dist/src/index.d.ts +2 -0
  26. package/packages/bundler/dist/src/index.js +3 -0
  27. package/packages/bundler/dist/src/presentation.d.ts +41 -0
  28. package/packages/bundler/dist/src/presentation.js +492 -0
  29. package/packages/launcher/dist/desktop-release.json +21 -0
  30. package/packages/launcher/dist/src/browser-command.d.ts +2 -0
  31. package/packages/launcher/dist/src/browser-command.js +43 -0
  32. package/packages/launcher/dist/src/browser.d.ts +14 -0
  33. package/packages/launcher/dist/src/browser.js +280 -0
  34. package/packages/launcher/dist/src/cache.d.ts +8 -0
  35. package/packages/launcher/dist/src/cache.js +21 -0
  36. package/packages/launcher/dist/src/capture-environment.d.ts +15 -0
  37. package/packages/launcher/dist/src/capture-environment.js +145 -0
  38. package/packages/launcher/dist/src/command.d.ts +2 -0
  39. package/packages/launcher/dist/src/command.js +58 -0
  40. package/packages/launcher/dist/src/native.d.ts +20 -0
  41. package/packages/launcher/dist/src/native.js +31 -0
  42. package/packages/launcher/dist/src/platform.d.ts +13 -0
  43. package/packages/launcher/dist/src/platform.js +29 -0
  44. package/packages/launcher/dist/src/release.d.ts +16 -0
  45. package/packages/launcher/dist/src/release.js +49 -0
  46. package/packages/motion-gsap/dist/src/index.d.ts +16 -0
  47. package/packages/motion-gsap/dist/src/index.js +139 -0
  48. package/packages/runtime/dist/src/clock.d.ts +10 -0
  49. package/packages/runtime/dist/src/clock.js +19 -0
  50. package/packages/runtime/dist/src/generated/browser-request.d.ts +143 -0
  51. package/packages/runtime/dist/src/generated/browser-request.js +2 -0
  52. package/packages/runtime/dist/src/generated/browser-response.d.ts +58 -0
  53. package/packages/runtime/dist/src/generated/browser-response.js +2 -0
  54. package/packages/runtime/dist/src/generated/bundle-layout.d.ts +7 -0
  55. package/packages/runtime/dist/src/generated/bundle-layout.js +14 -0
  56. package/packages/runtime/dist/src/generated/codec.d.ts +8 -0
  57. package/packages/runtime/dist/src/generated/codec.js +22 -0
  58. package/packages/runtime/dist/src/generated/runtime-contract.d.ts +7 -0
  59. package/packages/runtime/dist/src/generated/runtime-contract.js +8 -0
  60. package/packages/runtime/dist/src/generated/validators.d.ts +13 -0
  61. package/packages/runtime/dist/src/generated/validators.js +3327 -0
  62. package/packages/runtime/dist/src/host.d.ts +11 -0
  63. package/packages/runtime/dist/src/host.js +25 -0
  64. package/packages/runtime/dist/src/index.d.ts +13 -0
  65. package/packages/runtime/dist/src/index.js +12 -0
  66. package/packages/runtime/dist/src/media.d.ts +13 -0
  67. package/packages/runtime/dist/src/media.js +28 -0
  68. package/packages/runtime/dist/src/presentation.d.ts +66 -0
  69. package/packages/runtime/dist/src/presentation.js +379 -0
  70. package/packages/runtime/dist/src/resource.d.ts +23 -0
  71. package/packages/runtime/dist/src/resource.js +150 -0
  72. package/packages/runtime/dist/src/session.d.ts +43 -0
  73. package/packages/runtime/dist/src/session.js +450 -0
  74. package/packages/runtime/dist/src/types.d.ts +6 -0
  75. package/packages/runtime/dist/src/types.js +2 -0
  76. package/packages/runtime/dist/src/video.d.ts +40 -0
  77. package/packages/runtime/dist/src/video.js +343 -0
@@ -0,0 +1,49 @@
1
+ // Desktop release metadata is the single source for supported platform artifacts.
2
+ import { Browser, BrowserPlatform } from "@puppeteer/browsers";
3
+ import manifest from "../desktop-release.json" with { type: "json" };
4
+ export const BROWSER_BUILD = manifest.browserBuild;
5
+ export class UnsupportedReleaseTargetError extends Error {
6
+ constructor(host) {
7
+ super(`Onmark has no release artifact for ${host.platform}-${host.arch}`);
8
+ this.name = "UnsupportedReleaseTargetError";
9
+ }
10
+ }
11
+ export function desktopTarget(host) {
12
+ const name = releaseTarget(host);
13
+ const value = manifest.targets[name];
14
+ return Object.freeze({
15
+ browser: browser(value.browser),
16
+ browserPlatform: browserPlatform(value.browserPlatform),
17
+ packageName: `@onmark/cli-${name}`,
18
+ sha256: value.sha256,
19
+ });
20
+ }
21
+ function releaseTarget(host) {
22
+ const target = `${host.platform}-${host.arch}`;
23
+ if (target in manifest.targets) {
24
+ return target;
25
+ }
26
+ throw new UnsupportedReleaseTargetError(host);
27
+ }
28
+ function browser(value) {
29
+ switch (value) {
30
+ case Browser.CHROME:
31
+ return Browser.CHROME;
32
+ case Browser.CHROMEHEADLESSSHELL:
33
+ return Browser.CHROMEHEADLESSSHELL;
34
+ default:
35
+ throw new Error(`desktop release declares unsupported browser ${value}`);
36
+ }
37
+ }
38
+ function browserPlatform(value) {
39
+ switch (value) {
40
+ case BrowserPlatform.LINUX:
41
+ return BrowserPlatform.LINUX;
42
+ case BrowserPlatform.MAC_ARM:
43
+ return BrowserPlatform.MAC_ARM;
44
+ case BrowserPlatform.WIN64:
45
+ return BrowserPlatform.WIN64;
46
+ default:
47
+ throw new Error(`desktop release declares unsupported browser platform ${value}`);
48
+ }
49
+ }
@@ -0,0 +1,16 @@
1
+ import { gsap } from "gsap";
2
+ import type { PresentationExtension, PresentationTargetKind } from "../../../authoring/dist/src/index.js";
3
+ /** Local GSAP authoring facts for one semantic screenplay element. */
4
+ export interface GsapMotionContext {
5
+ readonly durationSeconds: number;
6
+ readonly element: HTMLElement;
7
+ readonly timeline: ReturnType<typeof gsap.timeline>;
8
+ }
9
+ /** Adds local animation to one Onmark-owned paused timeline. */
10
+ export type GsapMotionHandler = (context: GsapMotionContext) => void;
11
+ /** Semantic handlers and optional selector handlers for local motion. */
12
+ export type GsapMotionDefinition = Readonly<Partial<Record<PresentationTargetKind, GsapMotionHandler>> & {
13
+ readonly selectors?: Readonly<Record<string, GsapMotionHandler>>;
14
+ }>;
15
+ /** Creates exact-frame GSAP effects without exposing runtime lifecycle code. */
16
+ export declare function gsapMotion(definition: GsapMotionDefinition): PresentationExtension;
@@ -0,0 +1,139 @@
1
+ // Exact-frame GSAP integration over Onmark's vendor-neutral extension contract.
2
+ // Authors describe local motion; this adapter owns paused playheads and cleanup.
3
+ import { gsap } from "gsap";
4
+ /** Creates exact-frame GSAP effects without exposing runtime lifecycle code. */
5
+ export function gsapMotion(definition) {
6
+ const rules = ownRules(definition);
7
+ return Object.freeze({
8
+ bind(context) {
9
+ return {
10
+ effects: bindGsapEffects(rules, context),
11
+ resources: [],
12
+ };
13
+ },
14
+ });
15
+ }
16
+ // ── Element motion ──
17
+ function bindGsapEffects(rules, context) {
18
+ const effects = [];
19
+ try {
20
+ for (const target of context.targets) {
21
+ const handlers = matchingHandlers(rules, target);
22
+ if (handlers.length === 0) {
23
+ continue;
24
+ }
25
+ effects.push(bindGsapEffect(handlers, target, context));
26
+ }
27
+ }
28
+ catch (error) {
29
+ const cleanupFailure = releaseGsapEffects(effects);
30
+ if (cleanupFailure !== undefined) {
31
+ throw new AggregateError([error, cleanupFailure], "GSAP motion binding failed and cleanup was incomplete");
32
+ }
33
+ throw error;
34
+ }
35
+ return Object.freeze(effects);
36
+ }
37
+ function bindGsapEffect(handlers, target, context) {
38
+ const durationSeconds = intervalSeconds(target, context);
39
+ const timeline = gsap.timeline({ paused: true });
40
+ try {
41
+ const motion = Object.freeze({
42
+ durationSeconds,
43
+ element: target.element,
44
+ timeline,
45
+ });
46
+ for (const handler of handlers) {
47
+ handler(motion);
48
+ }
49
+ requireLocalTimeline(timeline, durationSeconds, target.kind);
50
+ // Add the full compiler-owned domain only after author construction. A
51
+ // leading sentinel would move GSAP's default append position to the end.
52
+ const sentinel = { value: 0 };
53
+ timeline.to(sentinel, { duration: durationSeconds, ease: "none", value: 0 }, 0);
54
+ }
55
+ catch (error) {
56
+ try {
57
+ timeline.kill();
58
+ }
59
+ catch (cleanupFailure) {
60
+ throw new AggregateError([error, cleanupFailure], "GSAP motion binding failed and cleanup was incomplete");
61
+ }
62
+ throw error;
63
+ }
64
+ return {
65
+ apply(frame) {
66
+ if (frame.index < target.interval.start ||
67
+ frame.index >= target.interval.end) {
68
+ return;
69
+ }
70
+ // A fresh GSAP timeline already reports time zero, and `time(0)` is a
71
+ // no-op. Force rendering so a first-frame `.set()` and a repeated exact
72
+ // frame both restore the authored state.
73
+ timeline.render(localSeconds(frame, target, context), true, true);
74
+ },
75
+ dispose() {
76
+ timeline.kill();
77
+ },
78
+ };
79
+ }
80
+ function ownRules(definition) {
81
+ const kinds = Object.freeze({
82
+ film: definition.film,
83
+ scene: definition.scene,
84
+ shot: definition.shot,
85
+ video: definition.video,
86
+ title: definition.title,
87
+ callToAction: definition.callToAction,
88
+ caption: definition.caption,
89
+ });
90
+ const selectors = Object.freeze(Object.entries(definition.selectors ?? {}).map(ownSelector));
91
+ return Object.freeze({ kinds, selectors });
92
+ }
93
+ function ownSelector([selector, animate]) {
94
+ if (selector.trim().length === 0) {
95
+ throw new RangeError("GSAP motion selector cannot be blank");
96
+ }
97
+ return Object.freeze({ animate, selector });
98
+ }
99
+ function matchingHandlers(rules, target) {
100
+ const handlers = [];
101
+ const kind = rules.kinds[target.kind];
102
+ if (kind !== undefined) {
103
+ handlers.push(kind);
104
+ }
105
+ for (const rule of rules.selectors) {
106
+ if (target.element.matches(rule.selector)) {
107
+ handlers.push(rule.animate);
108
+ }
109
+ }
110
+ return handlers;
111
+ }
112
+ // ── Exact-frame playheads ──
113
+ function intervalSeconds(target, context) {
114
+ const frames = target.interval.end - target.interval.start;
115
+ return (frames / context.frameRate.numerator) * context.frameRate.denominator;
116
+ }
117
+ function localSeconds(frame, target, context) {
118
+ const durationFrames = target.interval.end - target.interval.start;
119
+ const localFrame = Math.max(0, Math.min(frame.index - target.interval.start, durationFrames));
120
+ return ((localFrame / context.frameRate.numerator) * context.frameRate.denominator);
121
+ }
122
+ function requireLocalTimeline(timeline, durationSeconds, label) {
123
+ if (timeline.duration() <= durationSeconds) {
124
+ return;
125
+ }
126
+ throw new RangeError(`${label} motion exceeds its compiler-owned interval of ${durationSeconds} seconds`);
127
+ }
128
+ function releaseGsapEffects(effects) {
129
+ let failure;
130
+ for (const effect of effects.toReversed()) {
131
+ try {
132
+ effect.dispose();
133
+ }
134
+ catch (error) {
135
+ failure ??= error;
136
+ }
137
+ }
138
+ return failure;
139
+ }
@@ -0,0 +1,10 @@
1
+ import type { WireFrameRate } from "./generated/browser-request.js";
2
+ /** One exact frame together with its browser-facing time projection. */
3
+ export interface RuntimeFrame {
4
+ /** Absolute frame identity selected by the native executor. */
5
+ readonly index: number;
6
+ /** Seconds derived from the exact rational rate for browser APIs. */
7
+ readonly timeSeconds: number;
8
+ }
9
+ /** Projects one exact frame through the Rust-owned rational frame rate. */
10
+ export declare function runtimeFrameAt(index: number, frameRate: WireFrameRate): RuntimeFrame;
@@ -0,0 +1,19 @@
1
+ // Deterministic projection from exact protocol frames to browser API time.
2
+ // Integral frame identity remains authoritative; floating seconds are an edge value only.
3
+ /** Projects one exact frame through the Rust-owned rational frame rate. */
4
+ export function runtimeFrameAt(index, frameRate) {
5
+ safeInteger(index, "frame index", { allowZero: true });
6
+ safeInteger(frameRate.numerator, "frame-rate numerator");
7
+ safeInteger(frameRate.denominator, "frame-rate denominator");
8
+ // Divide before multiplying so exact wire integers are not first combined
9
+ // into an integer beyond JavaScript's safe range. The resulting Number is
10
+ // used only at browser APIs; scheduling and identity continue to use index.
11
+ const timeSeconds = (index / frameRate.numerator) * frameRate.denominator;
12
+ return Object.freeze({ index, timeSeconds });
13
+ }
14
+ function safeInteger(value, role, options = {}) {
15
+ const minimum = options.allowZero === true ? 0 : 1;
16
+ if (!Number.isSafeInteger(value) || value < minimum) {
17
+ throw new TypeError(`${role} must be a safe integer at least ${minimum}`);
18
+ }
19
+ }
@@ -0,0 +1,143 @@
1
+ /**
2
+ * Closed commands understood by the browser runtime.
3
+ */
4
+ export type BrowserCommand = {
5
+ plan: BrowserPlan;
6
+ type: "load";
7
+ } | {
8
+ /**
9
+ * Exact frame integer accepted by JavaScript without rounding.
10
+ */
11
+ evaluationStart: number;
12
+ type: "prepare";
13
+ } | {
14
+ /**
15
+ * Exact frame integer accepted by JavaScript without rounding.
16
+ */
17
+ frame: number;
18
+ type: "seek";
19
+ } | {
20
+ /**
21
+ * Exact frame integer accepted by JavaScript without rounding.
22
+ */
23
+ frame: number;
24
+ type: "confirm";
25
+ } | {
26
+ type: "dispose";
27
+ };
28
+ /**
29
+ * Exact frame integer accepted by JavaScript without rounding.
30
+ */
31
+ export type WireFrame = number;
32
+ /**
33
+ * Browser identity for one Timeline element or imported caption.
34
+ *
35
+ * IDs form dense renderable-semantic preorder within one Browser Plan.
36
+ *
37
+ * Authored IDs, rather than this unit-local key, retain cross-projection
38
+ * semantic identity.
39
+ */
40
+ export type BrowserNodeId = number;
41
+ /**
42
+ * Closed overlay roles understood by the browser presentation.
43
+ */
44
+ export type BrowserOverlayKind = "title" | "callToAction" | "caption";
45
+ /**
46
+ * Correlation identity shared by one request and its response events.
47
+ */
48
+ export type RequestId = number;
49
+ /**
50
+ * Version of the native-to-browser message contract.
51
+ */
52
+ export type ProtocolVersion = 1;
53
+ /**
54
+ * One versioned command sent from the native executor to the browser.
55
+ */
56
+ export interface BrowserRequest {
57
+ command: BrowserCommand;
58
+ requestId: RequestId;
59
+ version: ProtocolVersion;
60
+ }
61
+ /**
62
+ * Solved frame facts consumed by the runtime clock.
63
+ */
64
+ export interface BrowserPlan {
65
+ evaluation: WireInterval;
66
+ film: BrowserNode;
67
+ frameRate: WireFrameRate;
68
+ output: WireInterval;
69
+ /**
70
+ * @maxItems 10000
71
+ */
72
+ overlays: BrowserOverlay[];
73
+ /**
74
+ * @maxItems 10000
75
+ */
76
+ scenes: BrowserScene[];
77
+ /**
78
+ * @maxItems 10000
79
+ */
80
+ shots: BrowserShot[];
81
+ timeline: WireInterval;
82
+ timelineVersion: 1;
83
+ /**
84
+ * @maxItems 10000
85
+ */
86
+ videos: BrowserVideo[];
87
+ }
88
+ /**
89
+ * One half-open browser frame interval.
90
+ */
91
+ export interface WireInterval {
92
+ end: WireFrame;
93
+ start: WireFrame;
94
+ }
95
+ /**
96
+ * Browser-facing identity retained from one Timeline element.
97
+ */
98
+ export interface BrowserNode {
99
+ authoredId?: string | null;
100
+ nodeId: BrowserNodeId;
101
+ }
102
+ /**
103
+ * Exact rational frame rate represented with browser-safe integers.
104
+ */
105
+ export interface WireFrameRate {
106
+ denominator: number;
107
+ numerator: number;
108
+ }
109
+ /**
110
+ * One solved overlay placement consumed by the browser presentation.
111
+ */
112
+ export interface BrowserOverlay {
113
+ interval: WireInterval;
114
+ kind: BrowserOverlayKind;
115
+ node: BrowserNode;
116
+ shotId?: BrowserNodeId | null;
117
+ text: string;
118
+ }
119
+ /**
120
+ * One scene container intersecting this unit, with its complete Timeline interval.
121
+ */
122
+ export interface BrowserScene {
123
+ interval: WireInterval;
124
+ node: BrowserNode;
125
+ }
126
+ /**
127
+ * One shot container intersecting this unit, with its complete Timeline interval.
128
+ */
129
+ export interface BrowserShot {
130
+ interval: WireInterval;
131
+ node: BrowserNode;
132
+ sceneId: BrowserNodeId;
133
+ }
134
+ /**
135
+ * One primary video placement consumed by the browser presentation adapter.
136
+ */
137
+ export interface BrowserVideo {
138
+ assetId: string;
139
+ interval: WireInterval;
140
+ node: BrowserNode;
141
+ shotId: BrowserNodeId;
142
+ sourceFrameRate: WireFrameRate;
143
+ }
@@ -0,0 +1,2 @@
1
+ // Generated by `cargo xtask schema`; edit Rust protocol types instead.
2
+ export {};
@@ -0,0 +1,58 @@
1
+ /**
2
+ * Closed events emitted by the browser runtime.
3
+ */
4
+ export type BrowserEvent = {
5
+ type: "loaded";
6
+ } | {
7
+ /**
8
+ * Frame at which preparation completed.
9
+ */
10
+ evaluationStart: number;
11
+ type: "prepared";
12
+ } | {
13
+ /**
14
+ * Exact frame represented by staged browser state.
15
+ */
16
+ frame: number;
17
+ type: "frameStaged";
18
+ } | {
19
+ /**
20
+ * Exact frame confirmed by browser media state.
21
+ */
22
+ frame: number;
23
+ type: "frameReady";
24
+ } | {
25
+ /**
26
+ * Stable machine-readable failure category.
27
+ */
28
+ code: "protocolMismatch" | "invalidRequest" | "loadFailed" | "prepareFailed" | "seekFailed" | "confirmFailed" | "readinessTimeout" | "internal";
29
+ /**
30
+ * Direct explanation in browser/runtime terms.
31
+ */
32
+ message: string;
33
+ /**
34
+ * Resources that prevented readiness, in caller-owned deterministic order.
35
+ *
36
+ * @maxItems 256
37
+ */
38
+ pendingResources: string[];
39
+ type: "failed";
40
+ } | {
41
+ type: "disposed";
42
+ };
43
+ /**
44
+ * Correlation identity shared by one request and its response events.
45
+ */
46
+ export type RequestId = number;
47
+ /**
48
+ * Version of the native-to-browser message contract.
49
+ */
50
+ export type ProtocolVersion = 1;
51
+ /**
52
+ * One versioned event returned by the browser runtime.
53
+ */
54
+ export interface BrowserResponse {
55
+ event: BrowserEvent;
56
+ requestId: RequestId;
57
+ version: ProtocolVersion;
58
+ }
@@ -0,0 +1,2 @@
1
+ // Generated by `cargo xtask schema`; edit Rust protocol types instead.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const BUNDLE_ASSET_DIRECTORY: "assets/sha256";
2
+ export declare const PRESENTATION_TEMPORAL_CAPABILITIES: readonly ["sequential", "randomAccess"];
3
+ export type PresentationTemporalCapability = (typeof PRESENTATION_TEMPORAL_CAPABILITIES)[number];
4
+ export declare const PRESENTATION_VISUAL_CAPABILITIES: readonly ["browserComposite", "separableOverlay"];
5
+ export type PresentationVisualCapability = (typeof PRESENTATION_VISUAL_CAPABILITIES)[number];
6
+ export declare const PRESENTATION_FRAME_BEHAVIORS: readonly ["perFrame", "placementBounded"];
7
+ export type PresentationFrameBehavior = (typeof PRESENTATION_FRAME_BEHAVIORS)[number];
@@ -0,0 +1,14 @@
1
+ // Generated by `cargo xtask schema`; edit Rust protocol types instead.
2
+ export const BUNDLE_ASSET_DIRECTORY = "assets/sha256";
3
+ export const PRESENTATION_TEMPORAL_CAPABILITIES = Object.freeze([
4
+ "sequential",
5
+ "randomAccess",
6
+ ]);
7
+ export const PRESENTATION_VISUAL_CAPABILITIES = Object.freeze([
8
+ "browserComposite",
9
+ "separableOverlay",
10
+ ]);
11
+ export const PRESENTATION_FRAME_BEHAVIORS = Object.freeze([
12
+ "perFrame",
13
+ "placementBounded",
14
+ ]);
@@ -0,0 +1,8 @@
1
+ import type { BrowserRequest } from "./browser-request.js";
2
+ import type { BrowserResponse } from "./browser-response.js";
3
+ export declare class ProtocolDecodeError extends Error {
4
+ readonly issues: readonly string[];
5
+ constructor(message: string, issues: readonly string[]);
6
+ }
7
+ export declare function decodeBrowserRequest(value: unknown): BrowserRequest;
8
+ export declare function decodeBrowserResponse(value: unknown): BrowserResponse;
@@ -0,0 +1,22 @@
1
+ import { validateBrowserRequest, validateBrowserResponse, } from "./validators.js";
2
+ export class ProtocolDecodeError extends Error {
3
+ issues;
4
+ constructor(message, issues) {
5
+ super(message);
6
+ this.name = "ProtocolDecodeError";
7
+ this.issues = issues;
8
+ }
9
+ }
10
+ export function decodeBrowserRequest(value) {
11
+ return decode(value, validateBrowserRequest, "browser request");
12
+ }
13
+ export function decodeBrowserResponse(value) {
14
+ return decode(value, validateBrowserResponse, "browser response");
15
+ }
16
+ function decode(value, validator, role) {
17
+ if (validator(value)) {
18
+ return value;
19
+ }
20
+ const issues = (validator.errors ?? []).map((error) => `${error.instancePath || "/"}: ${error.message ?? error.keyword}`);
21
+ throw new ProtocolDecodeError(`invalid ${role}`, issues);
22
+ }
@@ -0,0 +1,7 @@
1
+ export declare const RUNTIME_HOST_NAME: "__ONMARK_RUNTIME__";
2
+ export declare const MAX_BROWSER_VIDEOS: 10000;
3
+ export declare const MAX_BROWSER_OVERLAYS: 10000;
4
+ export declare const MAX_BROWSER_OVERLAY_TEXT_CHARACTERS: 65536;
5
+ export declare const MAX_FAILURE_MESSAGE_CHARACTERS: 4096;
6
+ export declare const MAX_PENDING_RESOURCES: 256;
7
+ export declare const MAX_PENDING_RESOURCE_CHARACTERS: 1024;
@@ -0,0 +1,8 @@
1
+ // Generated by `cargo xtask schema`; edit Rust protocol types instead.
2
+ export const RUNTIME_HOST_NAME = "__ONMARK_RUNTIME__";
3
+ export const MAX_BROWSER_VIDEOS = 10000;
4
+ export const MAX_BROWSER_OVERLAYS = 10000;
5
+ export const MAX_BROWSER_OVERLAY_TEXT_CHARACTERS = 65536;
6
+ export const MAX_FAILURE_MESSAGE_CHARACTERS = 4096;
7
+ export const MAX_PENDING_RESOURCES = 256;
8
+ export const MAX_PENDING_RESOURCE_CHARACTERS = 1024;
@@ -0,0 +1,13 @@
1
+ export declare const validateBrowserRequest: typeof validate20;
2
+ declare function validate20(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
3
+ dynamicAnchors?: {} | undefined;
4
+ instancePath?: string | undefined;
5
+ rootData?: any;
6
+ }): boolean;
7
+ export declare const validateBrowserResponse: typeof validate47;
8
+ declare function validate47(data: any, { instancePath, parentData, parentDataProperty, rootData, dynamicAnchors }?: {
9
+ dynamicAnchors?: {} | undefined;
10
+ instancePath?: string | undefined;
11
+ rootData?: any;
12
+ }): boolean;
13
+ export {};