@hyperframes/producer 0.8.194 → 0.8.196

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
@@ -1248,6 +1248,8 @@ var OrderedRenderEventPublisher = class {
1248
1248
  this.sink = sink;
1249
1249
  this.log = log;
1250
1250
  }
1251
+ sink;
1252
+ log;
1251
1253
  tail = Promise.resolve();
1252
1254
  publish(job, message) {
1253
1255
  if (!this.sink) return;
@@ -1598,6 +1600,9 @@ var ArtifactTransaction = class {
1598
1600
  this.backupPath = join5(this.transactionDirectory, TRANSACTION_BACKUP);
1599
1601
  this.durationProbe = durationProbe;
1600
1602
  }
1603
+ kind;
1604
+ fileSystem;
1605
+ logger;
1601
1606
  destinationPath;
1602
1607
  stagingPath;
1603
1608
  transactionDirectory;
@@ -4987,6 +4992,7 @@ var RenderObservabilityRecorder = class {
4987
4992
  constructor(input) {
4988
4993
  this.input = input;
4989
4994
  }
4995
+ input;
4990
4996
  events = [];
4991
4997
  eventCount = 0;
4992
4998
  failedPhase;
@@ -5269,6 +5275,7 @@ import {
5269
5275
  readMediaStart,
5270
5276
  redactTelemetryString as redactTelemetryString2,
5271
5277
  resolveNaturalMediaTimelineDurationFromValues,
5278
+ rewriteAssetPath,
5272
5279
  rewriteAssetPaths,
5273
5280
  rewriteCssAssetUrls,
5274
5281
  rewriteInlineStyleAssetUrls
@@ -5276,7 +5283,7 @@ import {
5276
5283
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
5277
5284
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
5278
5285
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
5279
- import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
5286
+ import { gsapCdnDist, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
5280
5287
  import {
5281
5288
  assignBundledRuntimeCompositionIds,
5282
5289
  assignMediaRenderIds,
@@ -5798,6 +5805,7 @@ var Semaphore = class {
5798
5805
  constructor(maxConcurrent) {
5799
5806
  this.maxConcurrent = maxConcurrent;
5800
5807
  }
5808
+ maxConcurrent;
5801
5809
  queue = [];
5802
5810
  active = 0;
5803
5811
  async acquire() {
@@ -6309,7 +6317,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
6309
6317
  const results = await Promise.all(
6310
6318
  workItems.map(async (item) => {
6311
6319
  const { html: compiledSub } = await compileHtmlFile(
6312
- item.rawSubHtml,
6320
+ rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
6313
6321
  dirname6(item.filePath),
6314
6322
  downloadDir,
6315
6323
  void 0,
@@ -6483,7 +6491,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
6483
6491
  let compHtml = subCompositions.get(srcPath) || null;
6484
6492
  if (!compHtml) {
6485
6493
  const read = readProjectFile(resolve6(projectDir, srcPath));
6486
- if (read.kind === "file") compHtml = read.text;
6494
+ if (read.kind === "file") {
6495
+ compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
6496
+ }
6487
6497
  }
6488
6498
  return compHtml;
6489
6499
  },
@@ -7026,18 +7036,27 @@ async function embedLocalFontFaces(html, projectDir) {
7026
7036
  }
7027
7037
  return result;
7028
7038
  }
7029
- var GSAP_CDN_BASE = gsapCdnDist();
7030
- function rewriteUnresolvableGsapToCdn(html, projectDir) {
7039
+ function renderGsapDist() {
7040
+ try {
7041
+ return gsapCdnDist(void 0, normalizeGsapBaseUrl(process.env.HYPERFRAMES_GSAP_BASE_URL));
7042
+ } catch (cause) {
7043
+ throw new Error(
7044
+ "Invalid HYPERFRAMES_GSAP_BASE_URL: use an absolute HTTPS npm mirror root (plain HTTP only for localhost) without credentials, query, or fragment",
7045
+ { cause }
7046
+ );
7047
+ }
7048
+ }
7049
+ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
7050
+ let gsapDist;
7051
+ const exists = (path) => existsSync10(resolve6(projectDir, path));
7031
7052
  return html.replace(
7032
7053
  /(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
7033
7054
  (full, prefix, src, file, suffix) => {
7034
7055
  if (/^https?:\/\//i.test(src)) return full;
7035
- const absPath = resolve6(projectDir, src);
7036
- if (existsSync10(absPath)) return full;
7037
- defaultLogger.info(
7038
- `[Compiler] Rewriting missing gsap script to CDN: ${src} \u2192 ${GSAP_CDN_BASE}${file}`
7039
- );
7040
- return `${prefix}${GSAP_CDN_BASE}${file}${suffix}`;
7056
+ if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
7057
+ gsapDist ??= renderGsapDist();
7058
+ defaultLogger.info(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
7059
+ return `${prefix}${gsapDist}${file}${suffix}`;
7041
7060
  }
7042
7061
  );
7043
7062
  }
@@ -8530,6 +8549,10 @@ var VideoExtractionStageError = class extends Error {
8530
8549
  this.name = "VideoExtractionStageError";
8531
8550
  this.publicMetadata = { extractionFailure };
8532
8551
  }
8552
+ code;
8553
+ retryable;
8554
+ failures;
8555
+ extractionFailure;
8533
8556
  /**
8534
8557
  * Producer servers may expose this explicitly public, JSON-compatible data
8535
8558
  * without knowing its schema. Boundary adapters remain responsible for
@@ -11306,6 +11329,7 @@ var RenderQualityError = class extends Error {
11306
11329
  this.warnings = warnings;
11307
11330
  this.name = "RenderQualityError";
11308
11331
  }
11332
+ warnings;
11309
11333
  };
11310
11334
  function applyRenderWarningPolicy(job, captureWarnings, log = defaultLogger) {
11311
11335
  job.warnings ??= [];
@@ -19138,6 +19162,7 @@ var MixedCaptureModesError = class extends Error {
19138
19162
  this.modes = modes;
19139
19163
  this.name = "MixedCaptureModesError";
19140
19164
  }
19165
+ modes;
19141
19166
  };
19142
19167
  function observedChunkCaptureMode(perfs) {
19143
19168
  const modes = [...new Set(perfs.map((perf) => perf.captureMode))];
@@ -1268,6 +1268,8 @@ var OrderedRenderEventPublisher = class {
1268
1268
  this.sink = sink;
1269
1269
  this.log = log;
1270
1270
  }
1271
+ sink;
1272
+ log;
1271
1273
  tail = Promise.resolve();
1272
1274
  publish(job, message) {
1273
1275
  if (!this.sink) return;
@@ -1617,6 +1619,9 @@ var ArtifactTransaction = class {
1617
1619
  this.backupPath = join5(this.transactionDirectory, TRANSACTION_BACKUP);
1618
1620
  this.durationProbe = durationProbe;
1619
1621
  }
1622
+ kind;
1623
+ fileSystem;
1624
+ logger;
1620
1625
  destinationPath;
1621
1626
  stagingPath;
1622
1627
  transactionDirectory;
@@ -5006,6 +5011,7 @@ var RenderObservabilityRecorder = class {
5006
5011
  constructor(input) {
5007
5012
  this.input = input;
5008
5013
  }
5014
+ input;
5009
5015
  events = [];
5010
5016
  eventCount = 0;
5011
5017
  failedPhase;
@@ -5288,6 +5294,7 @@ import {
5288
5294
  readMediaStart,
5289
5295
  redactTelemetryString as redactTelemetryString2,
5290
5296
  resolveNaturalMediaTimelineDurationFromValues,
5297
+ rewriteAssetPath,
5291
5298
  rewriteAssetPaths,
5292
5299
  rewriteCssAssetUrls,
5293
5300
  rewriteInlineStyleAssetUrls
@@ -5295,7 +5302,7 @@ import {
5295
5302
  import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
5296
5303
  import { readPlaybackRate } from "@hyperframes/parsers/media-duration";
5297
5304
  import { resolveRateSpec } from "@hyperframes/core/speed-ramp";
5298
- import { gsapCdnDist } from "@hyperframes/core/gsap-cdn";
5305
+ import { gsapCdnDist, normalizeGsapBaseUrl } from "@hyperframes/core/gsap-cdn";
5299
5306
  import {
5300
5307
  assignBundledRuntimeCompositionIds,
5301
5308
  assignMediaRenderIds,
@@ -5817,6 +5824,7 @@ var Semaphore = class {
5817
5824
  constructor(maxConcurrent) {
5818
5825
  this.maxConcurrent = maxConcurrent;
5819
5826
  }
5827
+ maxConcurrent;
5820
5828
  queue = [];
5821
5829
  active = 0;
5822
5830
  async acquire() {
@@ -6328,7 +6336,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
6328
6336
  const results = await Promise.all(
6329
6337
  workItems.map(async (item) => {
6330
6338
  const { html: compiledSub } = await compileHtmlFile(
6331
- item.rawSubHtml,
6339
+ rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
6332
6340
  dirname6(item.filePath),
6333
6341
  downloadDir,
6334
6342
  void 0,
@@ -6502,7 +6510,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
6502
6510
  let compHtml = subCompositions.get(srcPath) || null;
6503
6511
  if (!compHtml) {
6504
6512
  const read = readProjectFile(resolve6(projectDir, srcPath));
6505
- if (read.kind === "file") compHtml = read.text;
6513
+ if (read.kind === "file") {
6514
+ compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
6515
+ }
6506
6516
  }
6507
6517
  return compHtml;
6508
6518
  },
@@ -7045,18 +7055,27 @@ async function embedLocalFontFaces(html, projectDir) {
7045
7055
  }
7046
7056
  return result;
7047
7057
  }
7048
- var GSAP_CDN_BASE = gsapCdnDist();
7049
- function rewriteUnresolvableGsapToCdn(html, projectDir) {
7058
+ function renderGsapDist() {
7059
+ try {
7060
+ return gsapCdnDist(void 0, normalizeGsapBaseUrl(process.env.HYPERFRAMES_GSAP_BASE_URL));
7061
+ } catch (cause) {
7062
+ throw new Error(
7063
+ "Invalid HYPERFRAMES_GSAP_BASE_URL: use an absolute HTTPS npm mirror root (plain HTTP only for localhost) without credentials, query, or fragment",
7064
+ { cause }
7065
+ );
7066
+ }
7067
+ }
7068
+ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
7069
+ let gsapDist;
7070
+ const exists = (path) => existsSync10(resolve6(projectDir, path));
7050
7071
  return html.replace(
7051
7072
  /(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
7052
7073
  (full, prefix, src, file, suffix) => {
7053
7074
  if (/^https?:\/\//i.test(src)) return full;
7054
- const absPath = resolve6(projectDir, src);
7055
- if (existsSync10(absPath)) return full;
7056
- defaultLogger.info(
7057
- `[Compiler] Rewriting missing gsap script to CDN: ${src} \u2192 ${GSAP_CDN_BASE}${file}`
7058
- );
7059
- return `${prefix}${GSAP_CDN_BASE}${file}${suffix}`;
7075
+ if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
7076
+ gsapDist ??= renderGsapDist();
7077
+ defaultLogger.info(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
7078
+ return `${prefix}${gsapDist}${file}${suffix}`;
7060
7079
  }
7061
7080
  );
7062
7081
  }
@@ -8518,6 +8537,10 @@ var VideoExtractionStageError = class extends Error {
8518
8537
  this.name = "VideoExtractionStageError";
8519
8538
  this.publicMetadata = { extractionFailure };
8520
8539
  }
8540
+ code;
8541
+ retryable;
8542
+ failures;
8543
+ extractionFailure;
8521
8544
  /**
8522
8545
  * Producer servers may expose this explicitly public, JSON-compatible data
8523
8546
  * without knowing its schema. Boundary adapters remain responsible for
@@ -11289,6 +11312,7 @@ var RenderQualityError = class extends Error {
11289
11312
  this.warnings = warnings;
11290
11313
  this.name = "RenderQualityError";
11291
11314
  }
11315
+ warnings;
11292
11316
  };
11293
11317
  function applyRenderWarningPolicy(job, captureWarnings, log = defaultLogger) {
11294
11318
  job.warnings ??= [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.8.194",
3
+ "version": "0.8.196",
4
4
  "description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
5
5
  "repository": {
6
6
  "type": "git",
@@ -35,20 +35,20 @@
35
35
  "postcss": "^8.4.0",
36
36
  "puppeteer": "^25.2.1",
37
37
  "puppeteer-core": "^25.2.1",
38
- "@hyperframes/core": "0.8.194",
39
- "@hyperframes/engine": "0.8.194",
40
- "@hyperframes/parsers": "0.8.194",
41
- "@hyperframes/lint": "0.8.194",
42
- "@hyperframes/studio-server": "0.8.194"
38
+ "@hyperframes/engine": "0.8.196",
39
+ "@hyperframes/parsers": "0.8.196",
40
+ "@hyperframes/core": "0.8.196",
41
+ "@hyperframes/lint": "0.8.196",
42
+ "@hyperframes/studio-server": "0.8.196"
43
43
  },
44
44
  "devDependencies": {
45
45
  "@types/node": "^25.0.10",
46
46
  "@webgpu/types": "^0.1.69",
47
- "esbuild": "^0.25.12",
47
+ "esbuild": "^0.28.2",
48
48
  "tsx": "^4.21.0",
49
49
  "typescript": "^5.7.2",
50
50
  "vitest": "^4.1.11",
51
- "@hyperframes/aws-lambda": "0.8.194"
51
+ "@hyperframes/aws-lambda": "0.8.196"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"