@hyperframes/producer 0.9.96 → 0.9.97

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
@@ -23319,6 +23319,20 @@ function assertRequestOptionScalars(options) {
23319
23319
  throw new Error("Render request outputResolution is invalid");
23320
23320
  }
23321
23321
  }
23322
+ function isRenderRange(value) {
23323
+ if (!isPlainObject(value)) return false;
23324
+ const seconds = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
23325
+ const { startSeconds, endSeconds } = value;
23326
+ if (!seconds(startSeconds)) return false;
23327
+ return endSeconds === void 0 || seconds(endSeconds) && Number(endSeconds) > Number(startSeconds);
23328
+ }
23329
+ function assertRequestRange(options) {
23330
+ if (options.range !== void 0 && !isRenderRange(options.range)) {
23331
+ throw new Error(
23332
+ "Render request range must be { startSeconds, endSeconds? } in seconds, end after start"
23333
+ );
23334
+ }
23335
+ }
23322
23336
  function assertRequestOptionObjects(options) {
23323
23337
  validateEngineConfigSnapshot2(options.engineConfig);
23324
23338
  if (options.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(options.expectedOutputDimensions)) {
@@ -23345,6 +23359,7 @@ function assertRequestOptions(options) {
23345
23359
  }
23346
23360
  assertRequestOptionScalars(options);
23347
23361
  assertRequestOptionObjects(options);
23362
+ assertRequestRange(options);
23348
23363
  }
23349
23364
  function assertNonEmptyPath(value, field) {
23350
23365
  if (typeof value !== "string" || value.length === 0) {
@@ -23403,6 +23418,8 @@ function distributedConfigFromRequest(request, runtime = {}) {
23403
23418
  const options = request.options;
23404
23419
  const distributed = options.distributed;
23405
23420
  if (!distributed) throw new Error("Render request is missing distributed options");
23421
+ if (options.range)
23422
+ throw new Error("A distributed render takes its range from renderSpan, not the request");
23406
23423
  if (options.format === "gif" || options.format === "hls") {
23407
23424
  throw new Error(`Distributed render does not support ${options.format}`);
23408
23425
  }
@@ -19145,6 +19145,20 @@ function assertRequestOptionScalars(options) {
19145
19145
  throw new Error("Render request outputResolution is invalid");
19146
19146
  }
19147
19147
  }
19148
+ function isRenderRange(value) {
19149
+ if (!isPlainObject(value)) return false;
19150
+ const seconds = (v) => typeof v === "number" && Number.isFinite(v) && v >= 0;
19151
+ const { startSeconds, endSeconds } = value;
19152
+ if (!seconds(startSeconds)) return false;
19153
+ return endSeconds === void 0 || seconds(endSeconds) && Number(endSeconds) > Number(startSeconds);
19154
+ }
19155
+ function assertRequestRange(options) {
19156
+ if (options.range !== void 0 && !isRenderRange(options.range)) {
19157
+ throw new Error(
19158
+ "Render request range must be { startSeconds, endSeconds? } in seconds, end after start"
19159
+ );
19160
+ }
19161
+ }
19148
19162
  function assertRequestOptionObjects(options) {
19149
19163
  validateEngineConfigSnapshot2(options.engineConfig);
19150
19164
  if (options.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(options.expectedOutputDimensions)) {
@@ -19171,6 +19185,7 @@ function assertRequestOptions(options) {
19171
19185
  }
19172
19186
  assertRequestOptionScalars(options);
19173
19187
  assertRequestOptionObjects(options);
19188
+ assertRequestRange(options);
19174
19189
  }
19175
19190
  function assertNonEmptyPath(value, field) {
19176
19191
  if (typeof value !== "string" || value.length === 0) {
@@ -3,6 +3,7 @@ import { type EngineConfig, type ProresProfile, type VideoFrameFormat } from "@h
3
3
  import { type CanvasResolution, type Fps } from "@hyperframes/core";
4
4
  import type { ProducerLogger } from "./logger.js";
5
5
  import type { RenderConfig } from "./services/renderOrchestrator.js";
6
+ import type { RenderRange } from "./services/render/frameWindow.js";
6
7
  import type { DistributedRenderConfig } from "./services/distributed/plan.js";
7
8
  import { type SerializableDistributedRenderConfig } from "./services/distributed/renderConfigValidation.js";
8
9
  export declare const RENDER_REQUEST_VERSION: 1;
@@ -47,6 +48,7 @@ export interface RenderRequestOptions {
47
48
  hdrMode?: RenderConfig["hdrMode"];
48
49
  chromaSubsampling?: RenderConfig["chromaSubsampling"];
49
50
  pageMotionBlur?: RenderConfig["pageMotionBlur"];
51
+ range?: RenderRange;
50
52
  variables?: Record<string, unknown>;
51
53
  strictVariables?: boolean;
52
54
  expectedOutputDimensions?: ExpectedOutputDimensions;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.96",
3
+ "version": "0.9.97",
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.13.0",
37
37
  "puppeteer-core": "^25.13.0",
38
- "@hyperframes/core": "0.9.96",
39
- "@hyperframes/engine": "0.9.96",
40
- "@hyperframes/parsers": "0.9.96",
41
- "@hyperframes/lint": "0.9.96",
42
- "@hyperframes/studio-server": "0.9.96"
38
+ "@hyperframes/engine": "0.9.97",
39
+ "@hyperframes/parsers": "0.9.97",
40
+ "@hyperframes/core": "0.9.97",
41
+ "@hyperframes/studio-server": "0.9.97",
42
+ "@hyperframes/lint": "0.9.97"
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.12",
51
- "@hyperframes/aws-lambda": "0.9.96"
51
+ "@hyperframes/aws-lambda": "0.9.97"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"