@hyperframes/producer 0.8.146 → 0.8.147

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
@@ -3360,12 +3360,13 @@ function buildRenderPerfSummary(input) {
3360
3360
  // src/services/render/stages/captureStreamingStage.ts
3361
3361
  var DEFAULT_CAPTURE_STALL_MS = 6e4;
3362
3362
  var DE_STALL_POLL_MS = 5e3;
3363
+ var STALL_ADVICE = "Chrome stopped answering. If another app is keeping the GPU or CPU busy (a 3D render, a game, another export), let it finish or render one job at a time, then retry.";
3363
3364
  var ParallelCaptureStallError = class extends Error {
3364
3365
  variant;
3365
3366
  constructor(args) {
3366
3367
  const phases = args.phaseSummary ? ` Last worker phases: ${args.phaseSummary}.` : "";
3367
3368
  super(
3368
- args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`
3369
+ (args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`) + ` ${STALL_ADVICE}`
3369
3370
  );
3370
3371
  this.name = "ParallelCaptureStallError";
3371
3372
  this.variant = args.variant;
@@ -3383,12 +3384,13 @@ function captureModeLabel(mode) {
3383
3384
  }
3384
3385
  var SequentialCaptureStallError = class extends Error {
3385
3386
  captureMode;
3386
- constructor(captureMode, stallTimeoutMs, frameIndex, totalFrames) {
3387
+ constructor(session, stallTimeoutMs, frameIndex, totalFrames) {
3388
+ const step = session.captureStep ? ` while ${session.captureStep}` : "";
3387
3389
  super(
3388
- `[Render] Sequential ${captureModeLabel(captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}).`
3390
+ `[Render] Sequential ${captureModeLabel(session.captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}${step}). ` + STALL_ADVICE
3389
3391
  );
3390
3392
  this.name = "SequentialCaptureStallError";
3391
- this.captureMode = captureMode;
3393
+ this.captureMode = session.captureMode;
3392
3394
  }
3393
3395
  };
3394
3396
  function raceAgainstStall(promise, deadlineMs, input, signal) {
@@ -3397,9 +3399,9 @@ function raceAgainstStall(promise, deadlineMs, input, signal) {
3397
3399
  () => {
3398
3400
  reject(
3399
3401
  signal?.aborted ? new Error(
3400
- `[Render] Sequential ${captureModeLabel(input.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3402
+ `[Render] Sequential ${captureModeLabel(input.session.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3401
3403
  ) : new SequentialCaptureStallError(
3402
- input.captureMode,
3404
+ input.session,
3403
3405
  input.stallTimeoutMs,
3404
3406
  input.frameIndex,
3405
3407
  input.totalFrames
@@ -3527,7 +3529,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3527
3529
  const captureWithStallGuard = (idx, promise) => raceAgainstStall(
3528
3530
  promise,
3529
3531
  stallTimeoutMs - (Date.now() - lastProgressAt),
3530
- { captureMode: session.captureMode, frameIndex: idx, totalFrames, stallTimeoutMs },
3532
+ { session, frameIndex: idx, totalFrames, stallTimeoutMs },
3531
3533
  abortSignal
3532
3534
  );
3533
3535
  const drainPrev = async () => {
@@ -3881,7 +3883,7 @@ async function runCaptureStreamingStage(input) {
3881
3883
  const { buffer } = await raceAgainstStall(
3882
3884
  captureFrameToBuffer(session, i, time),
3883
3885
  stallTimeoutMs - (Date.now() - lastProgressAt),
3884
- { captureMode: session.captureMode, frameIndex: i, totalFrames, stallTimeoutMs },
3886
+ { session, frameIndex: i, totalFrames, stallTimeoutMs },
3885
3887
  abortSignal
3886
3888
  );
3887
3889
  await reorderBuffer.waitForFrame(i);
@@ -3970,7 +3972,7 @@ async function captureSegmentFrames(ctx, segment, encoder) {
3970
3972
  ctx.captureFrame(ctx.session, i, time),
3971
3973
  ctx.stallTimeoutMs - (Date.now() - lastProgressAt),
3972
3974
  {
3973
- captureMode: ctx.session.captureMode,
3975
+ session: ctx.session,
3974
3976
  frameIndex: i,
3975
3977
  totalFrames: ctx.totalFrames,
3976
3978
  stallTimeoutMs: ctx.stallTimeoutMs
@@ -3379,12 +3379,13 @@ function buildRenderPerfSummary(input) {
3379
3379
  // src/services/render/stages/captureStreamingStage.ts
3380
3380
  var DEFAULT_CAPTURE_STALL_MS = 6e4;
3381
3381
  var DE_STALL_POLL_MS = 5e3;
3382
+ var STALL_ADVICE = "Chrome stopped answering. If another app is keeping the GPU or CPU busy (a 3D render, a game, another export), let it finish or render one job at a time, then retry.";
3382
3383
  var ParallelCaptureStallError = class extends Error {
3383
3384
  variant;
3384
3385
  constructor(args) {
3385
3386
  const phases = args.phaseSummary ? ` Last worker phases: ${args.phaseSummary}.` : "";
3386
3387
  super(
3387
- args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`
3388
+ (args.variant === "drain" ? `[Render] Parallel ${args.captureLabel} capture stalled: no frame progress for ${args.stallTimeoutMs}ms (stuck at ${args.lastCapturedFrames}/${args.totalFrames}).${phases}` : `[Render] Parallel ${args.captureLabel} capture stalled after ${args.stallTimeoutMs}ms with no frame progress (last frame ${args.lastCapturedFrames}/${args.totalFrames}); retrying on a fresh screenshot session.${phases}`) + ` ${STALL_ADVICE}`
3388
3389
  );
3389
3390
  this.name = "ParallelCaptureStallError";
3390
3391
  this.variant = args.variant;
@@ -3402,12 +3403,13 @@ function captureModeLabel(mode) {
3402
3403
  }
3403
3404
  var SequentialCaptureStallError = class extends Error {
3404
3405
  captureMode;
3405
- constructor(captureMode, stallTimeoutMs, frameIndex, totalFrames) {
3406
+ constructor(session, stallTimeoutMs, frameIndex, totalFrames) {
3407
+ const step = session.captureStep ? ` while ${session.captureStep}` : "";
3406
3408
  super(
3407
- `[Render] Sequential ${captureModeLabel(captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}).`
3409
+ `[Render] Sequential ${captureModeLabel(session.captureMode)} capture stalled: no frame progress for ${stallTimeoutMs}ms (stuck at frame ${frameIndex}/${totalFrames}${step}). ` + STALL_ADVICE
3408
3410
  );
3409
3411
  this.name = "SequentialCaptureStallError";
3410
- this.captureMode = captureMode;
3412
+ this.captureMode = session.captureMode;
3411
3413
  }
3412
3414
  };
3413
3415
  function raceAgainstStall(promise, deadlineMs, input, signal) {
@@ -3416,9 +3418,9 @@ function raceAgainstStall(promise, deadlineMs, input, signal) {
3416
3418
  () => {
3417
3419
  reject(
3418
3420
  signal?.aborted ? new Error(
3419
- `[Render] Sequential ${captureModeLabel(input.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3421
+ `[Render] Sequential ${captureModeLabel(input.session.captureMode)} capture aborted while a capture call was in flight (frame ${input.frameIndex}/${input.totalFrames}).`
3420
3422
  ) : new SequentialCaptureStallError(
3421
- input.captureMode,
3423
+ input.session,
3422
3424
  input.stallTimeoutMs,
3423
3425
  input.frameIndex,
3424
3426
  input.totalFrames
@@ -3546,7 +3548,7 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
3546
3548
  const captureWithStallGuard = (idx, promise) => raceAgainstStall(
3547
3549
  promise,
3548
3550
  stallTimeoutMs - (Date.now() - lastProgressAt),
3549
- { captureMode: session.captureMode, frameIndex: idx, totalFrames, stallTimeoutMs },
3551
+ { session, frameIndex: idx, totalFrames, stallTimeoutMs },
3550
3552
  abortSignal
3551
3553
  );
3552
3554
  const drainPrev = async () => {
@@ -3900,7 +3902,7 @@ async function runCaptureStreamingStage(input) {
3900
3902
  const { buffer } = await raceAgainstStall(
3901
3903
  captureFrameToBuffer(session, i, time),
3902
3904
  stallTimeoutMs - (Date.now() - lastProgressAt),
3903
- { captureMode: session.captureMode, frameIndex: i, totalFrames, stallTimeoutMs },
3905
+ { session, frameIndex: i, totalFrames, stallTimeoutMs },
3904
3906
  abortSignal
3905
3907
  );
3906
3908
  await reorderBuffer.waitForFrame(i);
@@ -3989,7 +3991,7 @@ async function captureSegmentFrames(ctx, segment, encoder) {
3989
3991
  ctx.captureFrame(ctx.session, i, time),
3990
3992
  ctx.stallTimeoutMs - (Date.now() - lastProgressAt),
3991
3993
  {
3992
- captureMode: ctx.session.captureMode,
3994
+ session: ctx.session,
3993
3995
  frameIndex: i,
3994
3996
  totalFrames: ctx.totalFrames,
3995
3997
  stallTimeoutMs: ctx.stallTimeoutMs
@@ -44,8 +44,9 @@ import type { ProducerLogger } from "../../../logger.js";
44
44
  import type { ProgressCallback, RenderJob } from "../../renderOrchestrator.js";
45
45
  import type { SdrStreamingCapturePlan } from "../capturePlan.js";
46
46
  export declare function resolveCaptureStallTimeoutMs(): number;
47
+ type StalledSession = Pick<CaptureSession, "captureMode" | "captureStep">;
47
48
  export declare function raceAgainstStall<T>(promise: Promise<T>, deadlineMs: number, input: {
48
- captureMode: CaptureSession["captureMode"];
49
+ session: StalledSession;
49
50
  frameIndex: number;
50
51
  totalFrames: number;
51
52
  stallTimeoutMs: number;
@@ -123,3 +124,4 @@ export type CaptureStreamingStageResult = {
123
124
  success: false;
124
125
  };
125
126
  export declare function runCaptureStreamingStage(input: CaptureStreamingStageInput): Promise<CaptureStreamingStageResult>;
127
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.8.146",
3
+ "version": "0.8.147",
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.2.1",
37
37
  "puppeteer-core": "^25.2.1",
38
- "@hyperframes/lint": "0.8.146",
39
- "@hyperframes/studio-server": "0.8.146",
40
- "@hyperframes/core": "0.8.146",
41
- "@hyperframes/parsers": "0.8.146",
42
- "@hyperframes/engine": "0.8.146"
38
+ "@hyperframes/engine": "0.8.147",
39
+ "@hyperframes/core": "0.8.147",
40
+ "@hyperframes/lint": "0.8.147",
41
+ "@hyperframes/parsers": "0.8.147",
42
+ "@hyperframes/studio-server": "0.8.147"
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.8.146"
51
+ "@hyperframes/aws-lambda": "0.8.147"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"