@hyperframes/producer 0.9.36 → 0.9.38

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.
@@ -109,6 +109,7 @@ export interface RunDistributedSimulatedInput {
109
109
  maxParallelChunks?: number;
110
110
  /** Forwarded to `plan()` and re-applied by `renderChunk()` at boot. */
111
111
  variables?: Record<string, unknown>;
112
+ allowOutsideProjectAssets?: boolean;
112
113
  }
113
114
  /**
114
115
  * Run the distributed pipeline against a single fixture as if a fan-out
@@ -82,6 +82,8 @@ type TestMetadata = {
82
82
  * `--mode=in-process`. Default is the plan's own default (16).
83
83
  */
84
84
  maxParallelChunks?: number;
85
+ /** Render as a trusted local caller (CLI, Studio) that may import files outside `src/`. */
86
+ allowOutsideProjectAssets?: boolean;
85
87
  };
86
88
  };
87
89
  type TestSuite = {
@@ -71,6 +71,7 @@ export declare function serializeRenderRequest(request: RenderRequest): string;
71
71
  export declare function createRenderRequest(input: CreateRenderRequestInput): RenderRequest;
72
72
  export declare function renderConfigFromRequest(request: RenderRequest, runtime?: {
73
73
  logger?: ProducerLogger;
74
+ allowOutsideProjectAssets?: boolean;
74
75
  }): RenderConfig;
75
76
  export declare function distributedConfigFromRequest(request: RenderRequest, runtime?: {
76
77
  logger?: ProducerLogger;
@@ -18,6 +18,7 @@ export interface PrepareAnimatedGifInputsOptions {
18
18
  sourceAssets?: Map<string, string>;
19
19
  timeoutMs?: number;
20
20
  transcode?: (input: AnimatedGifTranscodeRequest) => Promise<void>;
21
+ assetRoot?: string;
21
22
  }
22
23
  export interface AnimatedGifTranscodeRequest {
23
24
  inputPath: string;
@@ -35,7 +36,7 @@ export declare function splitUrlSuffix(src: string): {
35
36
  suffix: string;
36
37
  };
37
38
  export declare function normalizeRelPath(path: string): string;
38
- export declare function resolveLocalImageSourcePath(src: string, options: Pick<PrepareAnimatedGifInputsOptions, "projectDir" | "downloadDir" | "sourceAssets">): string | null;
39
+ export declare function resolveLocalImageSourcePath(src: string, options: Pick<PrepareAnimatedGifInputsOptions, "projectDir" | "downloadDir" | "sourceAssets" | "assetRoot">): string | null;
39
40
  export declare function buildAnimatedGifTranscodeArgs(input: {
40
41
  inputPath: string;
41
42
  outputPath: string;
@@ -1,4 +1,5 @@
1
1
  import { type AudioElement, type ImageElement, type MediaProbeProfile, type VideoElement } from "@hyperframes/engine";
2
+ import type { ProducerLogger } from "../logger.js";
2
3
  export declare const ASSET_MEDIA_TYPE_MISMATCH: "ASSET_MEDIA_TYPE_MISMATCH";
3
4
  export type AssetElementMediaType = "audio" | "image" | "video";
4
5
  export type DetectedAssetMediaType = AssetElementMediaType | "unknown";
@@ -22,6 +23,17 @@ interface CompositionMediaAssets {
22
23
  audios: readonly AudioElement[];
23
24
  images: readonly ImageElement[];
24
25
  }
26
+ /** Treats local media outside the project, compiled and download dirs as missing: no probe or extraction opens it. */
27
+ export declare function dropMediaOutsideProject(input: {
28
+ projectDir: string;
29
+ workDir: string;
30
+ composition: {
31
+ videos: VideoElement[];
32
+ audios: AudioElement[];
33
+ images: ImageElement[];
34
+ };
35
+ log: ProducerLogger;
36
+ }): void;
25
37
  /**
26
38
  * Fail early when a successfully-probed local asset cannot satisfy the HTML
27
39
  * element that owns it. Missing, corrupt, remote-at-runtime, and unprobeable
@@ -229,6 +229,8 @@ export interface BuildLocalExecutionPlanOptions {
229
229
  readonly sliceChunkAudio?: boolean;
230
230
  /** Leave the audio to {@link buildPlanAudio}; chunks render video only. mp4 without `cfr` only. */
231
231
  readonly deferAudio?: boolean;
232
+ /** Trusted local callers only; see CompileForRenderOptions. Never read from config. */
233
+ readonly allowOutsideProjectAssets?: boolean;
232
234
  }
233
235
  export interface RemoteProjectFile {
234
236
  readonly url: string;
@@ -448,4 +450,4 @@ export declare function buildPlanAudio(projectDir: string, config: DistributedRe
448
450
  * @deprecated Use `planV2()` or `planV2WithPublisher()` for new integrations.
449
451
  * This wrapper, its layout, and its result shape remain supported.
450
452
  */
451
- export declare function plan(projectDir: string, config: DistributedRenderConfig, planDir: string, options?: Pick<BuildLocalExecutionPlanOptions, "chunksCarryAudio">): Promise<PlanResult>;
453
+ export declare function plan(projectDir: string, config: DistributedRenderConfig, planDir: string, options?: Pick<BuildLocalExecutionPlanOptions, "chunksCarryAudio" | "allowOutsideProjectAssets">): Promise<PlanResult>;
@@ -17,4 +17,6 @@ export declare function spanFrameRange(startSeconds: number, endSeconds: number
17
17
  export declare function renderSpan(projectDir: string, config: DistributedRenderConfig, span: {
18
18
  startSeconds: number;
19
19
  endSeconds?: number;
20
- }, outputPath: string): Promise<RenderSpanResult>;
20
+ }, outputPath: string, options?: {
21
+ allowOutsideProjectAssets?: boolean;
22
+ }): Promise<RenderSpanResult>;
@@ -144,6 +144,7 @@ export interface SyntheticRenderJobInput {
144
144
  variables?: RenderConfig["variables"];
145
145
  strictVariables?: RenderConfig["strictVariables"];
146
146
  pageMotionBlur?: RenderConfig["pageMotionBlur"];
147
+ allowOutsideProjectAssets?: boolean;
147
148
  }
148
149
  /**
149
150
  * Synthesize a `RenderJob` from a distributed-render config. The distributed
@@ -140,6 +140,8 @@ export interface FileServerOptions {
140
140
  fps?: Fps;
141
141
  /** Strip embedded runtime scripts from HTML before injection. Default: true. */
142
142
  stripEmbeddedRuntime?: boolean;
143
+ /** Serve project symlinks that lead outside projectDir, as local preview does. Default: false. */
144
+ allowOutsideProjectAssets?: boolean;
143
145
  }
144
146
  export interface FileServerHandle {
145
147
  url: string;
@@ -26,6 +26,7 @@ export interface PrepareHeifImageInputsOptions {
26
26
  sourceAssets?: Map<string, string>;
27
27
  timeoutMs?: number;
28
28
  transcode?: (input: HeifTranscodeRequest) => Promise<void>;
29
+ assetRoot?: string;
29
30
  /** Leaves an image whose conversion failed as authored and reports it, instead of throwing. */
30
31
  onFailure?: (error: HeifImageConversionError | HeifToolUnavailableError) => void;
31
32
  }
@@ -188,6 +188,8 @@ export interface CompileForRenderOptions {
188
188
  */
189
189
  variables?: Record<string, unknown>;
190
190
  pageMotionBlur?: "off";
191
+ /** Trusted local renders only (CLI, Studio): import files markup reaches outside projectDir. */
192
+ allowOutsideProjectAssets?: boolean;
191
193
  }
192
194
  /**
193
195
  * Compile an HTML composition project into a single self-contained HTML string
@@ -244,4 +246,4 @@ export declare function resolveCompositionDurations(page: Page, unresolved: Unre
244
246
  * Re-compile after composition durations are resolved.
245
247
  * Injects durations into the HTML and re-parses sub-composition media with proper bounds.
246
248
  */
247
- export declare function recompileWithResolutions(compiled: CompiledComposition, resolutions: ResolvedDuration[], projectDir: string, downloadDir: string): Promise<CompiledComposition>;
249
+ export declare function recompileWithResolutions(compiled: CompiledComposition, resolutions: ResolvedDuration[], projectDir: string, downloadDir: string, assetRoot?: string): Promise<CompiledComposition>;
@@ -112,5 +112,6 @@ export declare function resolveEntryHtmlPath(input: {
112
112
  workDir: string;
113
113
  entryFile: string;
114
114
  log: ProducerLogger;
115
+ assetRoot?: string;
115
116
  }): string;
116
117
  export declare function runCompileStage(input: CompileStageInput): Promise<CompileStageResult>;
@@ -1,4 +1,5 @@
1
1
  import { type CanvasResolution, type Fps, type FpsInput, type HfVfxCapture } from "@hyperframes/core";
2
+ import type { CompileForRenderOptions } from "./htmlCompiler.js";
2
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
4
  import { type ReferenceBackgroundResult } from "@hyperframes/engine";
4
5
  import { type ProducerLogger } from "../logger.js";
@@ -94,6 +95,7 @@ export interface RenderConfig {
94
95
  strictness?: RenderStrictness;
95
96
  /** Entry HTML file relative to projectDir. Defaults to "index.html". */
96
97
  entryFile?: string;
98
+ allowOutsideProjectAssets?: CompileForRenderOptions["allowOutsideProjectAssets"];
97
99
  /** Full producer config. When provided, env vars are not read. */
98
100
  producerConfig?: EngineConfig;
99
101
  /** Custom logger. Defaults to console-based defaultLogger. */
@@ -26,6 +26,8 @@ type IsPathInsideOptions = {
26
26
  * Equality counts as "inside" (a directory contains itself).
27
27
  */
28
28
  export declare function isPathInside(childPath: string, parentPath: string, options?: IsPathInsideOptions): boolean;
29
+ /** True when `assetRoot` is set and `path`, symlinks resolved, leaves it. */
30
+ export declare function escapesAssetRoot(path: string, assetRoot: string | undefined): boolean;
29
31
  /**
30
32
  * Build a safe, cross-platform relative key for an absolute asset path
31
33
  * that lives outside the project directory.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperframes/producer",
3
- "version": "0.9.36",
3
+ "version": "0.9.38",
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.11.0",
37
37
  "puppeteer-core": "^25.11.0",
38
- "@hyperframes/core": "0.9.36",
39
- "@hyperframes/parsers": "0.9.36",
40
- "@hyperframes/studio-server": "0.9.36",
41
- "@hyperframes/engine": "0.9.36",
42
- "@hyperframes/lint": "0.9.36"
38
+ "@hyperframes/core": "0.9.38",
39
+ "@hyperframes/engine": "0.9.38",
40
+ "@hyperframes/lint": "0.9.38",
41
+ "@hyperframes/parsers": "0.9.38",
42
+ "@hyperframes/studio-server": "0.9.38"
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.9.36"
51
+ "@hyperframes/aws-lambda": "0.9.38"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22"