@hyperframes/producer 0.9.32 → 0.9.34

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.
@@ -47,6 +47,7 @@ export interface RenderRequestOptions {
47
47
  chromaSubsampling?: RenderConfig["chromaSubsampling"];
48
48
  pageMotionBlur?: RenderConfig["pageMotionBlur"];
49
49
  variables?: Record<string, unknown>;
50
+ strictVariables?: boolean;
50
51
  outputResolution?: CanvasResolution;
51
52
  outputResolutionAspectAgnostic?: boolean;
52
53
  engineConfig: EngineConfig;
package/dist/server.d.ts CHANGED
@@ -64,6 +64,8 @@ interface RenderInput {
64
64
  * composition's declared defaults, ignoring per-request overrides.
65
65
  */
66
66
  variables?: Record<string, unknown>;
67
+ /** Fails with `VARIABLES_INVALID` before any frame if `variables` mismatch the page's declarations. Default off. */
68
+ strictVariables?: boolean;
67
69
  /**
68
70
  * Output resolution preset (e.g. `landscape-4k`). Drives the same
69
71
  * `resolveDeviceScaleFactor` supersampling path the local CLI uses — Chrome
@@ -186,6 +186,8 @@ export interface DistributedRenderConfig extends Pick<RenderRequestOptions, "pag
186
186
  * rather than mid-plan; the producer-side throw is the fallback.
187
187
  */
188
188
  variables?: Record<string, unknown>;
189
+ /** Fails with `VARIABLES_INVALID` before any frame if `variables` mismatch the page's declarations. Default off. */
190
+ strictVariables?: boolean;
189
191
  }
190
192
  /** Shared local representation consumed by both distributed plan transports. */
191
193
  export interface LocalExecutionPlan extends Partial<ReferenceBackgroundResult> {
@@ -199,6 +201,8 @@ export interface LocalExecutionPlan extends Partial<ReferenceBackgroundResult> {
199
201
  format: DistributedFormat;
200
202
  ffmpegVersion: string;
201
203
  producerVersion: string;
204
+ /** Present when `strictVariables` was asked; true only if this producer honoured it. */
205
+ strictVariablesChecked?: boolean;
202
206
  }
203
207
  export interface BuildLocalExecutionPlanOptions {
204
208
  /**
@@ -255,6 +259,8 @@ export interface PlanResult extends Partial<ReferenceBackgroundResult> {
255
259
  format: DistributedFormat;
256
260
  ffmpegVersion: string;
257
261
  producerVersion: string;
262
+ /** Present when `strictVariables` was asked; true only if this producer honoured it. */
263
+ strictVariablesChecked?: boolean;
258
264
  }
259
265
  /** Applies the same audio correctness policy used by the in-process renderer. */
260
266
  export declare function applyDistributedAudioWarningPolicy(job: RenderJob, audioError: string, audioFailures?: readonly AudioProcessingFailure[], log?: ProducerLogger): void;
@@ -81,6 +81,9 @@ export interface PlanV2WithPublisherOptions {
81
81
  readonly remoteFiles?: BuildLocalExecutionPlanOptions["remoteFiles"];
82
82
  readonly chunksCarryAudio?: boolean;
83
83
  readonly deferAudio?: boolean;
84
+ readonly onPlanned?: (summary: {
85
+ readonly strictVariablesChecked?: boolean;
86
+ }) => void;
84
87
  }
85
88
  export interface PlanV2MaterializationResult {
86
89
  readonly planDir: string;
@@ -142,6 +142,7 @@ export interface SyntheticRenderJobInput {
142
142
  producerConfig?: RenderConfig["producerConfig"];
143
143
  /** Render-time overrides consumed by the plan browser probe. */
144
144
  variables?: RenderConfig["variables"];
145
+ strictVariables?: RenderConfig["strictVariables"];
145
146
  pageMotionBlur?: RenderConfig["pageMotionBlur"];
146
147
  }
147
148
  /**
@@ -341,6 +341,8 @@ export interface StageStallRule {
341
341
  tailMs?: number;
342
342
  detail?: () => string | undefined;
343
343
  attemptOpened?: () => void;
344
+ /** Bounded work that is not progress but not a stall either: a change keeps the current window open. */
345
+ activity?: () => number;
344
346
  }
345
347
  /**
346
348
  * Classified like the per-call protocol timeout it replaces, so the capture retry ladder retries it.
@@ -114,6 +114,9 @@ export declare function reportEncodeProgress(job: RenderJob, done: number, total
114
114
  /** Seconds of the final file written, 90% to 99%: only a complete file reaches 100. */
115
115
  export declare function reportAssembleProgress(job: RenderJob, done: number, total: number, onProgress: ProgressCallback | undefined): void;
116
116
  export declare function forgetWorkerPhases(job: object): void;
117
+ /** Counts a render's still-frame check screenshots; the capture stall watcher reads it as activity. */
118
+ export declare function noteStaticDedupActivity(job: object): void;
119
+ export declare function staticDedupActivity(job: object): number;
117
120
  export declare function describeWorkerPhases(job: object): string | undefined;
118
121
  /** Browser warm-up before the first frame, from the parallel workers' phase events. */
119
122
  export declare function reportWorkerStartup(job: RenderJob, progress: ParallelProgress, onProgress: ProgressCallback | undefined): void;
@@ -25,12 +25,12 @@
25
25
  * regex, the same first-10/first-5 slicing, and the same `console.warn`
26
26
  * prefix.
27
27
  */
28
- import { type CaptureOptions, type CaptureSession, type CompositionLengthSource, type EngineConfig, type SubTimelineWaitMemo } from "@hyperframes/engine";
28
+ import { type CaptureOptions, type CaptureSession, type CompositionLengthSource, type EngineConfig, type SubTimelineWaitMemo, type StaticDedupMemo } from "@hyperframes/engine";
29
29
  import type { CompiledComposition } from "../../htmlCompiler.js";
30
30
  import { type FileServerHandle } from "../../fileServer.js";
31
31
  import type { ProducerLogger } from "../../../logger.js";
32
32
  import { type CompositionMetadata } from "../shared.js";
33
- import type { RenderJob } from "../../renderOrchestrator.js";
33
+ import type { RenderConfig, RenderJob } from "../../renderOrchestrator.js";
34
34
  export interface ProbeStageInput {
35
35
  projectDir: string;
36
36
  workDir: string;
@@ -55,8 +55,10 @@ export interface ProbeStageInput {
55
55
  needsAlpha: boolean;
56
56
  deviceScaleFactor: number;
57
57
  subTimelineWaitMemo: SubTimelineWaitMemo;
58
+ staticDedupMemo?: StaticDedupMemo;
58
59
  }
59
60
  export interface ProbeStageResult {
61
+ strictVariablesChecked: boolean | undefined;
60
62
  /** May be reassigned from `recompileWithResolutions`. */
61
63
  compiled: CompiledComposition;
62
64
  /** Created when `needsBrowser` was true; `null` otherwise. */
@@ -94,18 +96,11 @@ export declare function hasAutoStartVideos(html: string): boolean;
94
96
  * element's variable has a value (the render's, its mount's `data-variable-values`, a declared default).
95
97
  */
96
98
  export declare function hasVariableBoundMedia(html: string, variables: Record<string, unknown> | undefined): boolean;
99
+ /** Reported `strictVariables`: undefined if not asked; true if checked or nothing needed checking; else false. */
100
+ export declare function strictVariablesAttestation(config: RenderConfig, probeSession: CaptureSession | null): boolean | undefined;
97
101
  /**
98
- * Does this render need a browser probe at all?
99
- *
100
- * Extracted as a pure predicate because whether a probe runs decides whether
101
- * a LIVE DOM element count is available downstream, and the short-comp
102
- * inversion band fails closed without one (see
103
- * `resolveCompositionElementCount` / `resolveDeShortBand`). Notably NONE of
104
- * these conditions fire for a known-duration, media-free composition that
105
- * builds thousands of `div`/`span` nodes in its own init script —
106
- * `hasRuntimeMediaChanges` matches only media creation/source changes — so
107
- * that shape is measured statically and must never reach the band's `applied`
108
- * cohort (review finding, R4).
102
+ * Does this render need a browser probe at all? A pure predicate, because a probe decides whether a LIVE DOM element
103
+ * count exists downstream, and the short-comp inversion band fails closed without one.
109
104
  */
110
105
  export declare function probeRequiresBrowser(args: {
111
106
  durationSeconds: number;
@@ -114,6 +109,7 @@ export declare function probeRequiresBrowser(args: {
114
109
  hasScriptedAudio: boolean;
115
110
  hasVariableMedia: boolean;
116
111
  hasInsertedMedia: boolean;
112
+ requiresVariablesCheck?: boolean;
117
113
  }): boolean;
118
114
  export type ReportedLengthSource = {
119
115
  from: Exclude<CompositionLengthSource["from"], "media">;
@@ -136,6 +136,7 @@ export interface RenderConfig {
136
136
  * `--variables-file <path>`. Must be a JSON-serializable plain object.
137
137
  */
138
138
  variables?: Record<string, unknown>;
139
+ strictVariables?: boolean;
139
140
  /**
140
141
  * Override the output resolution via Chrome `deviceScaleFactor` (DPR).
141
142
  * The composition's authored dimensions are unchanged. See
@@ -435,6 +436,7 @@ export interface RenderStageProgress {
435
436
  }
436
437
  export interface RenderJob extends Partial<ReferenceBackgroundResult> {
437
438
  id: string;
439
+ strictVariablesChecked?: boolean;
438
440
  config: RenderConfig;
439
441
  status: RenderStatus;
440
442
  progress: number;
@@ -51,6 +51,4 @@ export declare function toExternalAssetKey(absPath: string): string;
51
51
  export declare function formatCaptureFrameName(index: number, ext: string): string;
52
52
  export declare function formatExportFrameName(index: number, ext: string): string;
53
53
  export declare function resolveRenderPaths(projectDir: string, outputPath: string | null | undefined, rendersDir?: string): RenderPaths;
54
- /** The project file a data-composition-src names, as the preview reads it; null when it leaves the project. */
55
- export declare function resolveCompositionSrc(projectDir: string, src: string): string | null;
56
54
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.32",
3
+ "version": "0.9.34",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,11 +35,11 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "~25.11.0",
37
37
  "puppeteer-core": "^25.11.0",
38
- "@hyperframes/engine": "0.9.32",
39
- "@hyperframes/core": "0.9.32",
40
- "@hyperframes/parsers": "0.9.32",
41
- "@hyperframes/studio-server": "0.9.32",
42
- "@hyperframes/lint": "0.9.32"
38
+ "@hyperframes/core": "0.9.34",
39
+ "@hyperframes/lint": "0.9.34",
40
+ "@hyperframes/parsers": "0.9.34",
41
+ "@hyperframes/studio-server": "0.9.34",
42
+ "@hyperframes/engine": "0.9.34"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^25.0.10",
@@ -48,7 +48,7 @@
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^4.1.11",
51
- "@hyperframes/aws-lambda": "0.9.32"
51
+ "@hyperframes/aws-lambda": "0.9.34"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"