@hyperframes/producer 0.9.33 → 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.
package/dist/index.js CHANGED
@@ -9481,8 +9481,15 @@ function hasRuntimeMediaChanges(html) {
9481
9481
  }
9482
9482
  return false;
9483
9483
  }
9484
+ function checksVariablesInBrowser(config) {
9485
+ return config.strictVariables === true && Object.keys(config.variables ?? {}).length > 0;
9486
+ }
9487
+ function strictVariablesAttestation(config, probeSession) {
9488
+ if (config.strictVariables !== true) return void 0;
9489
+ return !checksVariablesInBrowser(config) || probeSession?.strictVariablesChecked === true;
9490
+ }
9484
9491
  function probeRequiresBrowser(args) {
9485
- return args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
9492
+ return args.requiresVariablesCheck === true || args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
9486
9493
  }
9487
9494
  function reportedLengthSource(source) {
9488
9495
  if (!source) return null;
@@ -9530,7 +9537,8 @@ async function runProbeStage(input) {
9530
9537
  hasAutoStart,
9531
9538
  hasScriptedAudio,
9532
9539
  hasVariableMedia,
9533
- hasInsertedMedia
9540
+ hasInsertedMedia,
9541
+ requiresVariablesCheck: checksVariablesInBrowser(job.config)
9534
9542
  });
9535
9543
  try {
9536
9544
  if (needsBrowser) {
@@ -9564,6 +9572,7 @@ async function runProbeStage(input) {
9564
9572
  job.config.quality
9565
9573
  ),
9566
9574
  variables: job.config.variables,
9575
+ strictVariables: job.config.strictVariables,
9567
9576
  deviceScaleFactor,
9568
9577
  motionBlur,
9569
9578
  pageMotionBlur: job.config.pageMotionBlur,
@@ -9969,6 +9978,7 @@ async function runProbeStage(input) {
9969
9978
  }
9970
9979
  }
9971
9980
  return {
9981
+ strictVariablesChecked: strictVariablesAttestation(job.config, probeSession),
9972
9982
  compiled,
9973
9983
  fileServer,
9974
9984
  probeSession,
@@ -14486,6 +14496,7 @@ async function executeRenderPipeline(input) {
14486
14496
  compositionHash = computeCompositionObservabilityHash(compiled.html);
14487
14497
  fileServer = probeResult.fileServer;
14488
14498
  probeSession = probeResult.probeSession;
14499
+ job.strictVariablesChecked = probeResult.strictVariablesChecked;
14489
14500
  lastBrowserConsole = probeResult.lastBrowserConsole;
14490
14501
  let resolvedCaptureBeyondViewport = probeSession?.options.captureBeyondViewport;
14491
14502
  if (resolvedCaptureBeyondViewport !== void 0) {
@@ -17017,6 +17028,7 @@ function buildSyntheticRenderJob(input) {
17017
17028
  strictness: input.strictness,
17018
17029
  producerConfig: input.producerConfig,
17019
17030
  variables: input.variables,
17031
+ strictVariables: input.strictVariables,
17020
17032
  pageMotionBlur: input.pageMotionBlur
17021
17033
  };
17022
17034
  return createRenderJob(renderConfig);
@@ -18490,6 +18502,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18490
18502
  logger: config.logger,
18491
18503
  producerConfig: cfg,
18492
18504
  variables: config.variables,
18505
+ strictVariables: config.strictVariables,
18493
18506
  pageMotionBlur: config.pageMotionBlur
18494
18507
  });
18495
18508
  const entryFile = config.entryFile ?? "index.html";
@@ -18602,6 +18615,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18602
18615
  logPlanStage(log, "reference_background", stageStarted);
18603
18616
  }
18604
18617
  compiled = probeResult.compiled;
18618
+ job.strictVariablesChecked = probeResult.strictVariablesChecked;
18605
18619
  job.duration = probeResult.duration;
18606
18620
  job.totalFrames = probeResult.totalFrames;
18607
18621
  const totalFrames = probeResult.totalFrames;
@@ -18949,7 +18963,8 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
18949
18963
  height,
18950
18964
  format: config.format,
18951
18965
  ffmpegVersion,
18952
- producerVersion
18966
+ producerVersion,
18967
+ ...job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked }
18953
18968
  };
18954
18969
  }
18955
18970
  async function plan(projectDir, config, planDir, options = {}) {
@@ -18966,7 +18981,8 @@ async function plan(projectDir, config, planDir, options = {}) {
18966
18981
  height: executionPlan.height,
18967
18982
  format: executionPlan.format,
18968
18983
  ffmpegVersion: executionPlan.ffmpegVersion,
18969
- producerVersion: executionPlan.producerVersion
18984
+ producerVersion: executionPlan.producerVersion,
18985
+ ...executionPlan.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: executionPlan.strictVariablesChecked }
18970
18986
  };
18971
18987
  }
18972
18988
 
@@ -19576,7 +19592,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19576
19592
  const stagingRoot = createStagingDir6(options.stagingParentDir ?? tmpdir3(), ".execution-plan-");
19577
19593
  const digests = /* @__PURE__ */ new Map();
19578
19594
  try {
19579
- await buildLocalExecutionPlan(projectDir, config, stagingRoot, {
19595
+ const planned = await buildLocalExecutionPlan(projectDir, config, stagingRoot, {
19580
19596
  executionPlanSizeLimitBytes: Number.MAX_SAFE_INTEGER,
19581
19597
  deferVideoExtraction: true,
19582
19598
  remoteFiles: options.remoteFiles,
@@ -19592,6 +19608,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19592
19608
  sliceChunkAudio: true,
19593
19609
  deferAudio: options.deferAudio
19594
19610
  });
19611
+ options.onPlanned?.({ strictVariablesChecked: planned.strictVariablesChecked });
19595
19612
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
19596
19613
  } catch (error) {
19597
19614
  try {
@@ -20667,7 +20684,8 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
20667
20684
  "ENCODER_INTERRUPTED",
20668
20685
  "RENDER_TOO_SLOW",
20669
20686
  "RENDER_STAGE_STALLED",
20670
- "PAGE_NEVER_READY"
20687
+ "PAGE_NEVER_READY",
20688
+ "VARIABLES_INVALID"
20671
20689
  ]);
20672
20690
  function extractSafeRenderErrorCode(error) {
20673
20691
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -20886,6 +20904,9 @@ function validateDistributedRenderConfig(config) {
20886
20904
  if (config.variables !== void 0) {
20887
20905
  validateVariablesPayload(config.variables);
20888
20906
  }
20907
+ if (config.strictVariables !== void 0 && typeof config.strictVariables !== "boolean") {
20908
+ throw new InvalidConfigError("config.strictVariables", "must be a boolean");
20909
+ }
20889
20910
  if (config.engineConfig !== void 0) {
20890
20911
  try {
20891
20912
  validateEngineConfigSnapshot(config.engineConfig);
@@ -21080,6 +21101,9 @@ function assertRequestOptionObjects(options) {
21080
21101
  if (options.variables !== void 0 && !isPlainObject(options.variables)) {
21081
21102
  throw new Error("Render request variables must be a JSON object");
21082
21103
  }
21104
+ if (options.strictVariables !== void 0 && typeof options.strictVariables !== "boolean") {
21105
+ throw new Error("Render request strictVariables must be a boolean");
21106
+ }
21083
21107
  if (options.distributed !== void 0) assertDistributedOptions(options.distributed);
21084
21108
  }
21085
21109
  function assertRequestOptions(options) {
@@ -21192,7 +21216,8 @@ function distributedConfigFromRequest(request, runtime = {}) {
21192
21216
  strictness: options.strictness,
21193
21217
  abortSignal: runtime.abortSignal,
21194
21218
  planDirSizeLimitBytes: distributed.planDirSizeLimitBytes,
21195
- variables: options.variables
21219
+ variables: options.variables,
21220
+ strictVariables: options.strictVariables
21196
21221
  };
21197
21222
  }
21198
21223
  function optionalProperty(key, value) {
@@ -21233,7 +21258,8 @@ function renderRequestFromDistributedConfig(input) {
21233
21258
  ...optionalProperty("hdrMode", config.hdrMode),
21234
21259
  ...optionalProperty("strictness", config.strictness),
21235
21260
  ...optionalProperty("entryFile", config.entryFile),
21236
- ...optionalProperty("variables", config.variables)
21261
+ ...optionalProperty("variables", config.variables),
21262
+ ...optionalProperty("strictVariables", config.strictVariables)
21237
21263
  };
21238
21264
  return createRenderRequest({
21239
21265
  projectDir: input.projectDir,
@@ -21517,6 +21543,9 @@ function extractSafeRenderErrorMetadata(error) {
21517
21543
  ...isPlainObject2(publicMetadata) ? { errorMetadata: publicMetadata } : {}
21518
21544
  };
21519
21545
  }
21546
+ function strictVariablesResult(job) {
21547
+ return job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked };
21548
+ }
21520
21549
  function parseServerFps(value) {
21521
21550
  if (typeof value !== "number" && typeof value !== "string") return DEFAULT_SERVER_FPS;
21522
21551
  const parsed = parseFps(value);
@@ -21575,7 +21604,7 @@ function parseRenderOptions(body) {
21575
21604
  bufferSize,
21576
21605
  chromaSubsampling
21577
21606
  } = encoder.ok ? encoder.options : {};
21578
- const { variables, outputResolution, outputResolutionAspectAgnostic } = parseRenderOverrides(body);
21607
+ const { variables, strictVariables, outputResolution, outputResolutionAspectAgnostic } = parseRenderOverrides(body);
21579
21608
  return {
21580
21609
  outputPath,
21581
21610
  fps,
@@ -21596,6 +21625,7 @@ function parseRenderOptions(body) {
21596
21625
  format,
21597
21626
  outputDynamicRange,
21598
21627
  variables,
21628
+ strictVariables,
21599
21629
  outputResolution,
21600
21630
  outputResolutionAspectAgnostic,
21601
21631
  videoFrameFormat
@@ -21606,10 +21636,11 @@ function isPlainObject2(value) {
21606
21636
  }
21607
21637
  function parseRenderOverrides(body) {
21608
21638
  const variables = isPlainObject2(body.variables) ? body.variables : void 0;
21639
+ const strictVariables = body.strictVariables === true ? true : void 0;
21609
21640
  const rawOutputResolution = typeof body.outputResolution === "string" ? body.outputResolution : void 0;
21610
21641
  const outputResolution = rawOutputResolution ? normalizeResolutionFlag(rawOutputResolution) : void 0;
21611
21642
  const outputResolutionAspectAgnostic = outputResolution ? isAspectAgnosticResolutionAlias(rawOutputResolution) : void 0;
21612
- return { variables, outputResolution, outputResolutionAspectAgnostic };
21643
+ return { variables, strictVariables, outputResolution, outputResolutionAspectAgnostic };
21613
21644
  }
21614
21645
  function buildRenderJobConfig(input, outputPath, log) {
21615
21646
  const request = createRenderRequest({
@@ -21633,6 +21664,7 @@ function buildRenderJobConfig(input, outputPath, log) {
21633
21664
  strictness: input.strictness,
21634
21665
  entryFile: input.entryFile,
21635
21666
  variables: input.variables,
21667
+ strictVariables: input.strictVariables,
21636
21668
  outputResolution: input.outputResolution,
21637
21669
  outputResolutionAspectAgnostic: input.outputResolutionAspectAgnostic,
21638
21670
  videoFrameFormat: input.videoFrameFormat,
@@ -21671,6 +21703,9 @@ function validateRenderOverrides(body) {
21671
21703
  if (body.variables !== void 0 && !isPlainObject2(body.variables)) {
21672
21704
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
21673
21705
  }
21706
+ if (body.strictVariables !== void 0 && typeof body.strictVariables !== "boolean") {
21707
+ return "strictVariables must be a boolean";
21708
+ }
21674
21709
  if (body.outputDynamicRange !== void 0 && parseServerOutputDynamicRange(body.outputDynamicRange) === void 0) {
21675
21710
  return 'outputDynamicRange must be one of: "auto", "hdr", "sdr"';
21676
21711
  }
@@ -21989,7 +22024,8 @@ function createRenderHandlers(options = {}) {
21989
22024
  videoDurationSeconds: job.duration ?? null,
21990
22025
  outcome: job.outcome ?? "completed",
21991
22026
  warnings: job.warnings,
21992
- perf: job.perfSummary ?? null
22027
+ perf: job.perfSummary ?? null,
22028
+ ...strictVariablesResult(job)
21993
22029
  });
21994
22030
  } catch (error) {
21995
22031
  const durationMs = Date.now() - t0;
@@ -22085,7 +22121,8 @@ function createRenderHandlers(options = {}) {
22085
22121
  outcome: job.outcome ?? "completed",
22086
22122
  warnings: job.warnings,
22087
22123
  perf: job.perfSummary ?? null,
22088
- producerVersion: readProducerVersion()
22124
+ producerVersion: readProducerVersion(),
22125
+ ...strictVariablesResult(job)
22089
22126
  })
22090
22127
  });
22091
22128
  } catch (error) {
@@ -9491,8 +9491,15 @@ function hasRuntimeMediaChanges(html) {
9491
9491
  }
9492
9492
  return false;
9493
9493
  }
9494
+ function checksVariablesInBrowser(config) {
9495
+ return config.strictVariables === true && Object.keys(config.variables ?? {}).length > 0;
9496
+ }
9497
+ function strictVariablesAttestation(config, probeSession) {
9498
+ if (config.strictVariables !== true) return void 0;
9499
+ return !checksVariablesInBrowser(config) || probeSession?.strictVariablesChecked === true;
9500
+ }
9494
9501
  function probeRequiresBrowser(args) {
9495
- return args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
9502
+ return args.requiresVariablesCheck === true || args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
9496
9503
  }
9497
9504
  function reportedLengthSource(source) {
9498
9505
  if (!source) return null;
@@ -9540,7 +9547,8 @@ async function runProbeStage(input) {
9540
9547
  hasAutoStart,
9541
9548
  hasScriptedAudio,
9542
9549
  hasVariableMedia,
9543
- hasInsertedMedia
9550
+ hasInsertedMedia,
9551
+ requiresVariablesCheck: checksVariablesInBrowser(job.config)
9544
9552
  });
9545
9553
  try {
9546
9554
  if (needsBrowser) {
@@ -9574,6 +9582,7 @@ async function runProbeStage(input) {
9574
9582
  job.config.quality
9575
9583
  ),
9576
9584
  variables: job.config.variables,
9585
+ strictVariables: job.config.strictVariables,
9577
9586
  deviceScaleFactor,
9578
9587
  motionBlur,
9579
9588
  pageMotionBlur: job.config.pageMotionBlur,
@@ -9979,6 +9988,7 @@ async function runProbeStage(input) {
9979
9988
  }
9980
9989
  }
9981
9990
  return {
9991
+ strictVariablesChecked: strictVariablesAttestation(job.config, probeSession),
9982
9992
  compiled,
9983
9993
  fileServer,
9984
9994
  probeSession,
@@ -14459,6 +14469,7 @@ async function executeRenderPipeline(input) {
14459
14469
  compositionHash = computeCompositionObservabilityHash(compiled.html);
14460
14470
  fileServer = probeResult.fileServer;
14461
14471
  probeSession = probeResult.probeSession;
14472
+ job.strictVariablesChecked = probeResult.strictVariablesChecked;
14462
14473
  lastBrowserConsole = probeResult.lastBrowserConsole;
14463
14474
  let resolvedCaptureBeyondViewport = probeSession?.options.captureBeyondViewport;
14464
14475
  if (resolvedCaptureBeyondViewport !== void 0) {
@@ -16843,6 +16854,9 @@ function assertRequestOptionObjects(options) {
16843
16854
  if (options.variables !== void 0 && !isPlainObject(options.variables)) {
16844
16855
  throw new Error("Render request variables must be a JSON object");
16845
16856
  }
16857
+ if (options.strictVariables !== void 0 && typeof options.strictVariables !== "boolean") {
16858
+ throw new Error("Render request strictVariables must be a boolean");
16859
+ }
16846
16860
  if (options.distributed !== void 0) assertDistributedOptions(options.distributed);
16847
16861
  }
16848
16862
  function assertRequestOptions(options) {
@@ -16917,7 +16931,8 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
16917
16931
  "ENCODER_INTERRUPTED",
16918
16932
  "RENDER_TOO_SLOW",
16919
16933
  "RENDER_STAGE_STALLED",
16920
- "PAGE_NEVER_READY"
16934
+ "PAGE_NEVER_READY",
16935
+ "VARIABLES_INVALID"
16921
16936
  ]);
16922
16937
  function extractSafeRenderErrorCode(error) {
16923
16938
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -16941,6 +16956,9 @@ function extractSafeRenderErrorMetadata(error) {
16941
16956
  ...isPlainObject2(publicMetadata) ? { errorMetadata: publicMetadata } : {}
16942
16957
  };
16943
16958
  }
16959
+ function strictVariablesResult(job) {
16960
+ return job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked };
16961
+ }
16944
16962
  function parseServerFps(value) {
16945
16963
  if (typeof value !== "number" && typeof value !== "string") return DEFAULT_SERVER_FPS;
16946
16964
  const parsed = parseFps(value);
@@ -16999,7 +17017,7 @@ function parseRenderOptions(body) {
16999
17017
  bufferSize,
17000
17018
  chromaSubsampling
17001
17019
  } = encoder.ok ? encoder.options : {};
17002
- const { variables, outputResolution, outputResolutionAspectAgnostic } = parseRenderOverrides(body);
17020
+ const { variables, strictVariables, outputResolution, outputResolutionAspectAgnostic } = parseRenderOverrides(body);
17003
17021
  return {
17004
17022
  outputPath,
17005
17023
  fps,
@@ -17020,6 +17038,7 @@ function parseRenderOptions(body) {
17020
17038
  format,
17021
17039
  outputDynamicRange,
17022
17040
  variables,
17041
+ strictVariables,
17023
17042
  outputResolution,
17024
17043
  outputResolutionAspectAgnostic,
17025
17044
  videoFrameFormat
@@ -17030,10 +17049,11 @@ function isPlainObject2(value) {
17030
17049
  }
17031
17050
  function parseRenderOverrides(body) {
17032
17051
  const variables = isPlainObject2(body.variables) ? body.variables : void 0;
17052
+ const strictVariables = body.strictVariables === true ? true : void 0;
17033
17053
  const rawOutputResolution = typeof body.outputResolution === "string" ? body.outputResolution : void 0;
17034
17054
  const outputResolution = rawOutputResolution ? normalizeResolutionFlag(rawOutputResolution) : void 0;
17035
17055
  const outputResolutionAspectAgnostic = outputResolution ? isAspectAgnosticResolutionAlias(rawOutputResolution) : void 0;
17036
- return { variables, outputResolution, outputResolutionAspectAgnostic };
17056
+ return { variables, strictVariables, outputResolution, outputResolutionAspectAgnostic };
17037
17057
  }
17038
17058
  function buildRenderJobConfig(input, outputPath, log) {
17039
17059
  const request = createRenderRequest({
@@ -17057,6 +17077,7 @@ function buildRenderJobConfig(input, outputPath, log) {
17057
17077
  strictness: input.strictness,
17058
17078
  entryFile: input.entryFile,
17059
17079
  variables: input.variables,
17080
+ strictVariables: input.strictVariables,
17060
17081
  outputResolution: input.outputResolution,
17061
17082
  outputResolutionAspectAgnostic: input.outputResolutionAspectAgnostic,
17062
17083
  videoFrameFormat: input.videoFrameFormat,
@@ -17095,6 +17116,9 @@ function validateRenderOverrides(body) {
17095
17116
  if (body.variables !== void 0 && !isPlainObject2(body.variables)) {
17096
17117
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
17097
17118
  }
17119
+ if (body.strictVariables !== void 0 && typeof body.strictVariables !== "boolean") {
17120
+ return "strictVariables must be a boolean";
17121
+ }
17098
17122
  if (body.outputDynamicRange !== void 0 && parseServerOutputDynamicRange(body.outputDynamicRange) === void 0) {
17099
17123
  return 'outputDynamicRange must be one of: "auto", "hdr", "sdr"';
17100
17124
  }
@@ -17413,7 +17437,8 @@ function createRenderHandlers(options = {}) {
17413
17437
  videoDurationSeconds: job.duration ?? null,
17414
17438
  outcome: job.outcome ?? "completed",
17415
17439
  warnings: job.warnings,
17416
- perf: job.perfSummary ?? null
17440
+ perf: job.perfSummary ?? null,
17441
+ ...strictVariablesResult(job)
17417
17442
  });
17418
17443
  } catch (error) {
17419
17444
  const durationMs = Date.now() - t0;
@@ -17509,7 +17534,8 @@ function createRenderHandlers(options = {}) {
17509
17534
  outcome: job.outcome ?? "completed",
17510
17535
  warnings: job.warnings,
17511
17536
  perf: job.perfSummary ?? null,
17512
- producerVersion: readProducerVersion()
17537
+ producerVersion: readProducerVersion(),
17538
+ ...strictVariablesResult(job)
17513
17539
  })
17514
17540
  });
17515
17541
  } catch (error) {
@@ -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
  /**
@@ -30,7 +30,7 @@ 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;
@@ -58,6 +58,7 @@ export interface ProbeStageInput {
58
58
  staticDedupMemo?: StaticDedupMemo;
59
59
  }
60
60
  export interface ProbeStageResult {
61
+ strictVariablesChecked: boolean | undefined;
61
62
  /** May be reassigned from `recompileWithResolutions`. */
62
63
  compiled: CompiledComposition;
63
64
  /** Created when `needsBrowser` was true; `null` otherwise. */
@@ -95,18 +96,11 @@ export declare function hasAutoStartVideos(html: string): boolean;
95
96
  * element's variable has a value (the render's, its mount's `data-variable-values`, a declared default).
96
97
  */
97
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;
98
101
  /**
99
- * Does this render need a browser probe at all?
100
- *
101
- * Extracted as a pure predicate because whether a probe runs decides whether
102
- * a LIVE DOM element count is available downstream, and the short-comp
103
- * inversion band fails closed without one (see
104
- * `resolveCompositionElementCount` / `resolveDeShortBand`). Notably NONE of
105
- * these conditions fire for a known-duration, media-free composition that
106
- * builds thousands of `div`/`span` nodes in its own init script —
107
- * `hasRuntimeMediaChanges` matches only media creation/source changes — so
108
- * that shape is measured statically and must never reach the band's `applied`
109
- * 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.
110
104
  */
111
105
  export declare function probeRequiresBrowser(args: {
112
106
  durationSeconds: number;
@@ -115,6 +109,7 @@ export declare function probeRequiresBrowser(args: {
115
109
  hasScriptedAudio: boolean;
116
110
  hasVariableMedia: boolean;
117
111
  hasInsertedMedia: boolean;
112
+ requiresVariablesCheck?: boolean;
118
113
  }): boolean;
119
114
  export type ReportedLengthSource = {
120
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.33",
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/lint": "0.9.33",
39
- "@hyperframes/parsers": "0.9.33",
40
- "@hyperframes/studio-server": "0.9.33",
41
- "@hyperframes/engine": "0.9.33",
42
- "@hyperframes/core": "0.9.33"
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.33"
51
+ "@hyperframes/aws-lambda": "0.9.34"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"