@hyperframes/producer 0.9.52 → 0.9.53
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/README.md +18 -0
- package/dist/distributed.js +133 -69
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/index.js +313 -97
- package/dist/public-server.js +313 -97
- package/dist/server.d.ts +18 -1
- package/dist/services/htmlCompiler.d.ts +11 -0
- package/dist/services/hyperframeLint.d.ts +1 -1
- package/dist/services/render/shared.d.ts +1 -0
- package/dist/services/render/stages/audioStage.d.ts +1 -1
- package/dist/services/render/stages/compileStage.d.ts +1 -1
- package/dist/services/render/stages/extractVideosStage.d.ts +13 -6
- package/dist/services/renderOrchestrator.d.ts +6 -1
- package/package.json +7 -7
package/dist/server.d.ts
CHANGED
|
@@ -31,10 +31,22 @@ export interface HandlerOptions {
|
|
|
31
31
|
artifactTtlMs?: number;
|
|
32
32
|
/** Max renders that execute simultaneously. Queued requests wait FIFO. Default: 2. */
|
|
33
33
|
maxConcurrentRenders?: number;
|
|
34
|
+
/** Extra browser-facing host names (e.g. a proxy's); merged with PRODUCER_ALLOWED_HOSTS. */
|
|
35
|
+
allowedHosts?: readonly string[];
|
|
36
|
+
/** Confine request paths and debug as below. Default: true in `createProducerApp`, false in `createRenderHandlers`. */
|
|
37
|
+
confineRequests?: boolean;
|
|
38
|
+
/** With `confineRequests`: where every `projectDir` must resolve. Defaults to PRODUCER_PROJECTS_DIR or the working directory. */
|
|
39
|
+
projectsDir?: string;
|
|
40
|
+
/** With `confineRequests`: let requests set `debug: true`, which keeps work dirs on disk. Defaults to PRODUCER_ALLOW_DEBUG=1. */
|
|
41
|
+
allowDebug?: boolean;
|
|
42
|
+
/** Bearer token `createProducerApp` requires on every route but /health. Defaults to PRODUCER_AUTH_TOKEN. */
|
|
43
|
+
authToken?: string;
|
|
34
44
|
}
|
|
35
45
|
export interface ServerOptions extends HandlerOptions {
|
|
36
46
|
/** Port to listen on. Default: 9847. */
|
|
37
47
|
port?: number;
|
|
48
|
+
/** Address to listen on. Default: PRODUCER_HOST or 127.0.0.1. A non-loopback address requires `authToken`. */
|
|
49
|
+
hostname?: string;
|
|
38
50
|
}
|
|
39
51
|
interface RenderInput {
|
|
40
52
|
projectDir: string;
|
|
@@ -104,7 +116,12 @@ type PrepareRenderResult = {
|
|
|
104
116
|
} | {
|
|
105
117
|
error: string;
|
|
106
118
|
};
|
|
107
|
-
|
|
119
|
+
/** What a request may reach on disk; see `HandlerOptions.projectsDir` and `allowDebug`. */
|
|
120
|
+
export interface RenderRequestPolicy {
|
|
121
|
+
projectsDir: string;
|
|
122
|
+
allowDebug: boolean;
|
|
123
|
+
}
|
|
124
|
+
export declare function prepareRenderBody(body: Record<string, unknown>, policy?: RenderRequestPolicy): Promise<PrepareRenderResult>;
|
|
108
125
|
export interface RenderHandlers {
|
|
109
126
|
render: (c: Context) => Promise<Response>;
|
|
110
127
|
renderStream: (c: Context) => Response | Promise<Response>;
|
|
@@ -135,6 +135,17 @@ export declare function localizeRemoteBackgroundImages(html: string, downloadDir
|
|
|
135
135
|
html: string;
|
|
136
136
|
remoteMediaAssets: Map<string, string>;
|
|
137
137
|
}>;
|
|
138
|
+
/**
|
|
139
|
+
* Extract all `@font-face { ... }` blocks from a CSS string, preserving the
|
|
140
|
+
* full rule text (including the `@font-face` keyword and braces).
|
|
141
|
+
*
|
|
142
|
+
* Uses a depth-tracking scan instead of `[^}]*` so blocks with nested
|
|
143
|
+
* descriptor values that happen to contain `}` (rare but valid in
|
|
144
|
+
* `format(...)` hints with custom idents) are captured correctly.
|
|
145
|
+
*
|
|
146
|
+
* @internal exported for unit testing only
|
|
147
|
+
*/
|
|
148
|
+
export declare function extractFontFaceBlocks(css: string): string[];
|
|
138
149
|
/** @internal exported for unit testing only */
|
|
139
150
|
export declare function localizeRemoteFontFaces(html: string, downloadDir: string): Promise<{
|
|
140
151
|
html: string;
|
|
@@ -4,7 +4,7 @@ export interface PreparedHyperframeLintInput {
|
|
|
4
4
|
html: string;
|
|
5
5
|
source: "projectDir" | "files" | "html";
|
|
6
6
|
}
|
|
7
|
-
export declare function prepareHyperframeLintBody(body: Record<string, unknown
|
|
7
|
+
export declare function prepareHyperframeLintBody(body: Record<string, unknown>, isAllowedEntry?: (absolutePath: string) => boolean): {
|
|
8
8
|
prepared: PreparedHyperframeLintInput;
|
|
9
9
|
} | {
|
|
10
10
|
error: string;
|
|
@@ -30,6 +30,7 @@ export interface CompositionMetadata {
|
|
|
30
30
|
* slightly different `end` / `mediaStart` / `volume` than the compiled
|
|
31
31
|
* HTML and we want to ignore sub-millisecond float noise.
|
|
32
32
|
*/
|
|
33
|
+
export declare function audioWorkDir(workDir: string): string;
|
|
33
34
|
export declare const BROWSER_MEDIA_EPSILON = 0.0001;
|
|
34
35
|
/**
|
|
35
36
|
* Resolve the browser/runtime end for a media element.
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import type { Fps } from "@hyperframes/core";
|
|
20
20
|
import { type AudioProcessingFailure, type MixResult } from "@hyperframes/engine";
|
|
21
|
-
import type
|
|
21
|
+
import { type CompositionMetadata } from "../shared.js";
|
|
22
22
|
import type { ProducerLogger } from "../../../logger.js";
|
|
23
23
|
export interface AudioStageInput {
|
|
24
24
|
projectDir: string;
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
* fires only when the composition hint is the deciding factor —
|
|
35
35
|
* same behavior as before this PR.
|
|
36
36
|
*/
|
|
37
|
-
import type
|
|
37
|
+
import { type EngineConfig } from "@hyperframes/engine";
|
|
38
38
|
import type { CompiledComposition } from "../../htmlCompiler.js";
|
|
39
39
|
import type { ProducerLogger } from "../../../logger.js";
|
|
40
40
|
import { type CompositionMetadata } from "../shared.js";
|
|
@@ -55,6 +55,7 @@ export interface ExtractVideosStageInput {
|
|
|
55
55
|
shownBoxes?: ReadonlyMap<string, ShownBox>;
|
|
56
56
|
skipFrameExtractionIds?: readonly string[];
|
|
57
57
|
urlByAbsentLocalPath?: ReadonlyMap<string, string>;
|
|
58
|
+
audioDownloadDir?: string;
|
|
58
59
|
onProgress?: ProgressCallback;
|
|
59
60
|
}
|
|
60
61
|
export interface ExtractVideosStageResult {
|
|
@@ -137,13 +138,19 @@ export declare function appendAutoDetectedVideoAudio(composition: Pick<Compositi
|
|
|
137
138
|
hasAudio: boolean;
|
|
138
139
|
};
|
|
139
140
|
}>): void;
|
|
140
|
-
|
|
141
|
-
* The audio-only form of the extract stage: which videos carry sound takes a probe per source, not their frames.
|
|
142
|
-
* Each video is moved to its extraction window first, as extraction does, so its sound lands where its picture does.
|
|
143
|
-
*/
|
|
144
|
-
export declare function appendVideoAudioFromProbe(input: {
|
|
141
|
+
interface VideoAudioProbeInput {
|
|
145
142
|
projectDir: string;
|
|
146
143
|
compiledDir: string;
|
|
147
144
|
composition: CompositionMetadata;
|
|
148
145
|
urlByAbsentLocalPath?: ReadonlyMap<string, string>;
|
|
149
|
-
|
|
146
|
+
/** Where a composition URL is downloaded before probing on a render service: the mixer's work folder, so the mix reuses it. */
|
|
147
|
+
downloadDir?: string;
|
|
148
|
+
signal?: AbortSignal;
|
|
149
|
+
log?: ProducerLogger;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* The audio-only form of the extract stage: which videos carry sound takes a probe per source, not their frames.
|
|
153
|
+
* Each video is moved to its extraction window first, as extraction does, so its sound lands where its picture does.
|
|
154
|
+
*/
|
|
155
|
+
export declare function appendVideoAudioFromProbe(input: VideoAudioProbeInput): Promise<void>;
|
|
156
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type CanvasResolution, type Fps, type FpsInput, type HfVfxCapture } from "@hyperframes/core";
|
|
2
2
|
import type { CompileForRenderOptions } from "./htmlCompiler.js";
|
|
3
|
-
import { type EngineConfig, type ExtractionPhaseBreakdown, type VideoFrameFormat, type CaptureOptions, type CaptureVideoMetadataHint, type CaptureSession, type BeforeCaptureHook, type ProresProfile, type ParallelProgress, type WorkerTask, type CapturePerfSummary, type CaptureWarning, type SubTimelineWaitOutcome, type WorkerSizing, type StaticVerificationOutcome, explainDrawElementDisabled, type CaptureFailureKind, displaySize, type ChromaSubsampling, type MotionBlurOptions, type PageMotionBlurSummary } from "@hyperframes/engine";
|
|
3
|
+
import { type EngineConfig, type ExtractionPhaseBreakdown, type VideoFrameFormat, closeCaptureSession, initializeSession, type CaptureOptions, type CaptureVideoMetadataHint, type CaptureSession, type BeforeCaptureHook, type ProresProfile, type ParallelProgress, type WorkerTask, type CapturePerfSummary, type CaptureWarning, type SubTimelineWaitOutcome, type WorkerSizing, type StaticVerificationOutcome, explainDrawElementDisabled, type CaptureFailureKind, displaySize, type ChromaSubsampling, type MotionBlurOptions, type PageMotionBlurSummary } from "@hyperframes/engine";
|
|
4
4
|
import { type ReferenceBackgroundResult } from "@hyperframes/engine";
|
|
5
5
|
import { type ProducerLogger } from "../logger.js";
|
|
6
6
|
import { type RenderOutputFormat } from "./render/renderFormat.js";
|
|
@@ -1306,6 +1306,11 @@ export declare function shouldDiscardProbeSessionForPageSideCompositing(args: {
|
|
|
1306
1306
|
hasProbeSession: boolean;
|
|
1307
1307
|
usePageSideCompositing: boolean;
|
|
1308
1308
|
}): boolean;
|
|
1309
|
+
/** Loads the page with the page-side stub and reports whether its shader-transitions build installed the compositor. */
|
|
1310
|
+
export declare function pageInstallsShaderCompositor(open: () => Promise<CaptureSession>, session?: {
|
|
1311
|
+
initializeSession: typeof initializeSession;
|
|
1312
|
+
closeCaptureSession: typeof closeCaptureSession;
|
|
1313
|
+
}): Promise<boolean>;
|
|
1309
1314
|
/** Where `--debug` renders keep their work dirs, one per job id. */
|
|
1310
1315
|
export declare function resolveRenderDebugDir(): string;
|
|
1311
1316
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.53",
|
|
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.
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/
|
|
41
|
-
"@hyperframes/
|
|
42
|
-
"@hyperframes/
|
|
38
|
+
"@hyperframes/core": "0.9.53",
|
|
39
|
+
"@hyperframes/parsers": "0.9.53",
|
|
40
|
+
"@hyperframes/studio-server": "0.9.53",
|
|
41
|
+
"@hyperframes/engine": "0.9.53",
|
|
42
|
+
"@hyperframes/lint": "0.9.53"
|
|
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.
|
|
51
|
+
"@hyperframes/aws-lambda": "0.9.53"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22"
|