@hyperframes/producer 0.9.91 → 0.9.93

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/server.d.ts CHANGED
@@ -40,7 +40,7 @@ export interface HandlerOptions {
40
40
  projectsDir?: string;
41
41
  /** With `confineRequests`: let requests set `debug: true`, which keeps work dirs on disk. Defaults to PRODUCER_ALLOW_DEBUG=1. */
42
42
  allowDebug?: boolean;
43
- /** Bearer token `createProducerApp` requires on every route but /health. Defaults to PRODUCER_AUTH_TOKEN. */
43
+ /** Bearer token required on every route but /health. Defaults to PRODUCER_AUTH_TOKEN; without one no caller is checked. */
44
44
  authToken?: string;
45
45
  }
46
46
  export interface ServerOptions extends HandlerOptions {
@@ -48,6 +48,8 @@ export interface ServerOptions extends HandlerOptions {
48
48
  port?: number;
49
49
  /** Address to listen on. Default: PRODUCER_HOST or 127.0.0.1. A non-loopback address requires `authToken`. */
50
50
  hostname?: string;
51
+ /** Where a token made for a run without `authToken` is written. Default: PRODUCER_AUTH_TOKEN_FILE or ~/.hyperframes/producer/<port>.token. */
52
+ authTokenFile?: string;
51
53
  }
52
54
  interface RenderInput {
53
55
  projectDir: string;
@@ -135,13 +137,16 @@ export interface RenderHandlers {
135
137
  /**
136
138
  * Create route handler functions for the producer server.
137
139
  *
138
- * These can be mounted on any Hono app at any path prefix.
140
+ * Mount them on any Hono app at any path prefix, behind your own authentication: they check no caller.
139
141
  */
140
142
  export declare function createRenderHandlers(options?: HandlerOptions): RenderHandlers;
141
143
  /**
142
144
  * Create a Hono app with clean public routes for OSS use.
143
145
  */
144
146
  export declare function createProducerApp(options?: HandlerOptions): Hono;
147
+ /** Runs a render so a rejection nobody handled inside it fails that render only. */
148
+ export declare function runInRenderScope<T>(requestId: string, abortController: AbortController, run: (signal: AbortSignal) => Promise<T>): Promise<T>;
149
+ export declare function onEscapedRejection(reason: unknown, log: ProducerLogger): void;
145
150
  /**
146
151
  * Start the producer HTTP server with graceful shutdown.
147
152
  */
@@ -21,6 +21,13 @@ import { type HdrPerfCollector } from "./render/hdrPerf.js";
21
21
  * shares the contract with composition runtime code.
22
22
  */
23
23
  export type HdrTransitionMeta = HfTransitionMeta;
24
+ /**
25
+ * The page's `window.__hf.transitions`, kept only where it is well formed:
26
+ * finite non-negative `time` and `duration` and string scene ids. A `shader`
27
+ * that is not a string or not a registered transition is dropped, which gives
28
+ * the crossfade the layered path already uses for a transition with no shader.
29
+ */
30
+ export declare function sanitizeTransitionMeta(raw: unknown, warn: (message: string, meta: Record<string, unknown>) => void): HdrTransitionMeta[];
24
31
  /** Pre-computed frame range for an active transition. */
25
32
  export interface TransitionRange extends HdrTransitionMeta {
26
33
  startFrame: number;
@@ -62,6 +62,10 @@ export declare function resolveRenderWorkerCount(totalFrames: number, requestedW
62
62
  onSizing?: (sizing: WorkerSizing) => void): number;
63
63
  export declare function createCaptureCalibrationConfig(cfg: EngineConfig): EngineConfig;
64
64
  export declare function estimateMeasuredCaptureCostMultiplier(samples: CaptureCalibrationSample[]): CaptureCostEstimate;
65
+ /** Auto mode chose the hardware GPU and calibration measured it slow: worth timing software too. */
66
+ export declare function shouldCalibrateSoftwareGpu(requestedMode: EngineConfig["browserGpuMode"], resolvedMode: "software" | "hardware", hardware: CaptureCostEstimate | undefined): boolean;
67
+ /** Auto mode keeps the hardware GPU unless software measured strictly faster. */
68
+ export declare function pickAutoGpuModeFromCalibration(hardware: CaptureCostEstimate, software: CaptureCostEstimate | undefined): "software" | "hardware";
65
69
  export declare function selectCaptureCalibrationFrames(totalFrames: number): number[];
66
70
  export declare function measureCaptureCostFromSession(session: CaptureSession, totalFrames: number, fps: number, log?: ProducerLogger): Promise<{
67
71
  estimate: CaptureCostEstimate;
@@ -490,6 +490,13 @@ export declare class RenderCancelledError extends Error {
490
490
  reason: "user_cancelled" | "timeout" | "aborted";
491
491
  constructor(message?: string, reason?: "user_cancelled" | "timeout" | "aborted");
492
492
  }
493
+ /**
494
+ * Aborts a render because a promise rejection nobody handled came from it. The
495
+ * render fails with the original error; it is not reported as a cancel.
496
+ */
497
+ export declare class EscapedRejectionError extends Error {
498
+ constructor(cause: Error);
499
+ }
493
500
  export declare function createRenderFileLogger(logPath: string, base?: ProducerLogger): ProducerLogger;
494
501
  export declare function collectVideoReadinessSkipIds(nativeHdrVideoIds: ReadonlySet<string>, extractedVideos: readonly ExtractedVideoReadinessInput[]): string[];
495
502
  interface ExtractedVideoReadinessInput {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.91",
3
+ "version": "0.9.93",
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.91",
39
- "@hyperframes/engine": "0.9.91",
40
- "@hyperframes/lint": "0.9.91",
41
- "@hyperframes/studio-server": "0.9.91",
42
- "@hyperframes/parsers": "0.9.91"
38
+ "@hyperframes/core": "0.9.93",
39
+ "@hyperframes/engine": "0.9.93",
40
+ "@hyperframes/parsers": "0.9.93",
41
+ "@hyperframes/lint": "0.9.93",
42
+ "@hyperframes/studio-server": "0.9.93"
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.91"
51
+ "@hyperframes/aws-lambda": "0.9.93"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"