@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.
@@ -5254,8 +5254,15 @@ function hasRuntimeMediaChanges(html) {
5254
5254
  }
5255
5255
  return false;
5256
5256
  }
5257
+ function checksVariablesInBrowser(config) {
5258
+ return config.strictVariables === true && Object.keys(config.variables ?? {}).length > 0;
5259
+ }
5260
+ function strictVariablesAttestation(config, probeSession) {
5261
+ if (config.strictVariables !== true) return void 0;
5262
+ return !checksVariablesInBrowser(config) || probeSession?.strictVariablesChecked === true;
5263
+ }
5257
5264
  function probeRequiresBrowser(args) {
5258
- return args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
5265
+ return args.requiresVariablesCheck === true || args.durationSeconds <= 0 || args.unresolvedCompositionCount > 0 || args.hasAutoStart || args.hasScriptedAudio || args.hasVariableMedia || args.hasInsertedMedia;
5259
5266
  }
5260
5267
  function reportedLengthSource(source) {
5261
5268
  if (!source) return null;
@@ -5303,7 +5310,8 @@ async function runProbeStage(input) {
5303
5310
  hasAutoStart,
5304
5311
  hasScriptedAudio,
5305
5312
  hasVariableMedia,
5306
- hasInsertedMedia
5313
+ hasInsertedMedia,
5314
+ requiresVariablesCheck: checksVariablesInBrowser(job.config)
5307
5315
  });
5308
5316
  try {
5309
5317
  if (needsBrowser) {
@@ -5337,6 +5345,7 @@ async function runProbeStage(input) {
5337
5345
  job.config.quality
5338
5346
  ),
5339
5347
  variables: job.config.variables,
5348
+ strictVariables: job.config.strictVariables,
5340
5349
  deviceScaleFactor,
5341
5350
  motionBlur,
5342
5351
  pageMotionBlur: job.config.pageMotionBlur,
@@ -5742,6 +5751,7 @@ async function runProbeStage(input) {
5742
5751
  }
5743
5752
  }
5744
5753
  return {
5754
+ strictVariablesChecked: strictVariablesAttestation(job.config, probeSession),
5745
5755
  compiled,
5746
5756
  fileServer,
5747
5757
  probeSession,
@@ -8502,6 +8512,7 @@ function buildSyntheticRenderJob(input) {
8502
8512
  strictness: input.strictness,
8503
8513
  producerConfig: input.producerConfig,
8504
8514
  variables: input.variables,
8515
+ strictVariables: input.strictVariables,
8505
8516
  pageMotionBlur: input.pageMotionBlur
8506
8517
  };
8507
8518
  return createRenderJob(renderConfig);
@@ -10365,6 +10376,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
10365
10376
  logger: config.logger,
10366
10377
  producerConfig: cfg,
10367
10378
  variables: config.variables,
10379
+ strictVariables: config.strictVariables,
10368
10380
  pageMotionBlur: config.pageMotionBlur
10369
10381
  });
10370
10382
  const entryFile = config.entryFile ?? "index.html";
@@ -10477,6 +10489,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
10477
10489
  logPlanStage(log, "reference_background", stageStarted);
10478
10490
  }
10479
10491
  compiled = probeResult.compiled;
10492
+ job.strictVariablesChecked = probeResult.strictVariablesChecked;
10480
10493
  job.duration = probeResult.duration;
10481
10494
  job.totalFrames = probeResult.totalFrames;
10482
10495
  const totalFrames = probeResult.totalFrames;
@@ -10824,7 +10837,8 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
10824
10837
  height,
10825
10838
  format: config.format,
10826
10839
  ffmpegVersion,
10827
- producerVersion
10840
+ producerVersion,
10841
+ ...job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked }
10828
10842
  };
10829
10843
  }
10830
10844
  async function buildPlanAudio(projectDir, config, workRoot, outputPath, options = {}) {
@@ -11434,7 +11448,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
11434
11448
  const stagingRoot = createStagingDir6(options.stagingParentDir ?? tmpdir(), ".execution-plan-");
11435
11449
  const digests = /* @__PURE__ */ new Map();
11436
11450
  try {
11437
- await buildLocalExecutionPlan(projectDir, config, stagingRoot, {
11451
+ const planned = await buildLocalExecutionPlan(projectDir, config, stagingRoot, {
11438
11452
  executionPlanSizeLimitBytes: Number.MAX_SAFE_INTEGER,
11439
11453
  deferVideoExtraction: true,
11440
11454
  remoteFiles: options.remoteFiles,
@@ -11450,6 +11464,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
11450
11464
  sliceChunkAudio: true,
11451
11465
  deferAudio: options.deferAudio
11452
11466
  });
11467
+ options.onPlanned?.({ strictVariablesChecked: planned.strictVariablesChecked });
11453
11468
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
11454
11469
  } catch (error) {
11455
11470
  try {
@@ -13033,6 +13048,9 @@ function validateDistributedRenderConfig(config) {
13033
13048
  if (config.variables !== void 0) {
13034
13049
  validateVariablesPayload(config.variables);
13035
13050
  }
13051
+ if (config.strictVariables !== void 0 && typeof config.strictVariables !== "boolean") {
13052
+ throw new InvalidConfigError("config.strictVariables", "must be a boolean");
13053
+ }
13036
13054
  if (config.engineConfig !== void 0) {
13037
13055
  try {
13038
13056
  validateEngineConfigSnapshot(config.engineConfig);
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": "0.1.0",
3
3
  "buildId": "dev",
4
- "sha256": "43e6217729301c467e1ae43d8cc1ec8ad1c0c9c1d483e0c60227b8348ff7ba7e",
4
+ "sha256": "0026fcce8802ced3aac18b83db5e22594fead81c85f85013a7570461d988021f",
5
5
  "artifacts": {
6
6
  "iife": "hyperframe.runtime.iife.js",
7
7
  "esm": "hyperframe.runtime.mjs"