@hyperframes/producer 0.9.106 → 0.10.0
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 +1 -1
- package/dist/distributed.js +70 -20
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +58 -58
- package/dist/index.js +93 -118
- package/dist/public-server.js +38 -107
- package/dist/services/distributed/renderChunk.d.ts +22 -1
- package/dist/services/render/stages/captureStage.d.ts +3 -1
- package/dist/services/render/stages/extractVideosStage.d.ts +2 -1
- package/dist/services/renderOrchestrator.d.ts +3 -1
- package/package.json +9 -9
package/dist/public-server.js
CHANGED
|
@@ -397,6 +397,7 @@ import {
|
|
|
397
397
|
getDrawElementVerificationDetails,
|
|
398
398
|
augmentProtocolTimeoutError,
|
|
399
399
|
augmentPageNavigationTimeoutError,
|
|
400
|
+
createCacheLease,
|
|
400
401
|
displaySize
|
|
401
402
|
} from "@hyperframes/engine";
|
|
402
403
|
import {
|
|
@@ -433,11 +434,8 @@ import { promisify } from "node:util";
|
|
|
433
434
|
import { Readable } from "node:stream";
|
|
434
435
|
import { join as join2, extname, resolve as resolve2, sep as sep2 } from "node:path";
|
|
435
436
|
import { injectScriptsAtHeadStart, injectScriptsIntoHtml } from "@hyperframes/core/compiler";
|
|
436
|
-
import {
|
|
437
|
-
import {
|
|
438
|
-
PREVIEW_FOR_ANOTHER_SITE_META,
|
|
439
|
-
serviceWorkerScriptFetch
|
|
440
|
-
} from "@hyperframes/core/studio-preview-mark";
|
|
437
|
+
import { markForAnotherSite } from "@hyperframes/core/compiler/html-document";
|
|
438
|
+
import { serviceWorkerScriptFetch } from "@hyperframes/core/studio-preview-mark";
|
|
441
439
|
import { fpsToNumber, terminalText as terminalText2 } from "@hyperframes/core";
|
|
442
440
|
import { isPrivateFileUnder as isPrivateFileUnder2, isStudioPrivatePath as isStudioPrivatePath2 } from "@hyperframes/core/safe-path";
|
|
443
441
|
import { stripSdrPngColourTags } from "@hyperframes/core/compiler/png-colour-tags";
|
|
@@ -1157,7 +1155,6 @@ var HF_BRIDGE_SCRIPT = `(function() {
|
|
|
1157
1155
|
if (bridge()) __realClearInterval(iv);
|
|
1158
1156
|
}, 50);
|
|
1159
1157
|
})();`;
|
|
1160
|
-
var OFFER_NO_FRAMING_SITE_AN_EDITING_PORT = `<meta name="${PREVIEW_FOR_ANOTHER_SITE_META}">`;
|
|
1161
1158
|
var RENDER_CAPTURE_MODE_SHIM = "globalThis.__HF_RENDER_CAPTURE_MODE = true;";
|
|
1162
1159
|
function closeFileServerSafely(fileServer, label, log = defaultLogger) {
|
|
1163
1160
|
try {
|
|
@@ -1256,7 +1253,7 @@ function createFileServer(options) {
|
|
|
1256
1253
|
html = injectScriptsAtHeadStart(html, preHeadScripts);
|
|
1257
1254
|
}
|
|
1258
1255
|
html = isIndex ? injectScriptsIntoHtml(html, headScripts, bodyScripts, stripEmbeddedRuntime) : html;
|
|
1259
|
-
html =
|
|
1256
|
+
html = markForAnotherSite(html);
|
|
1260
1257
|
return c.text(html, 200, { "Content-Type": contentType });
|
|
1261
1258
|
}
|
|
1262
1259
|
if (ext === ".png") {
|
|
@@ -2131,93 +2128,20 @@ import {
|
|
|
2131
2128
|
mkdirSync as mkdirSync2,
|
|
2132
2129
|
readFileSync as readFileSync2,
|
|
2133
2130
|
readdirSync,
|
|
2134
|
-
readlinkSync as readlinkSync2,
|
|
2135
2131
|
rmSync as rmSync2,
|
|
2136
2132
|
writeFileSync as writeFileSync2
|
|
2137
2133
|
} from "node:fs";
|
|
2138
|
-
import {
|
|
2139
|
-
import {
|
|
2140
|
-
import { basename as basename4, dirname as dirname3, join as join5, win32 } from "node:path";
|
|
2134
|
+
import { basename as basename4, dirname as dirname3, join as join5 } from "node:path";
|
|
2135
|
+
import { ownerRecordState, processOwnerRecord } from "@hyperframes/engine";
|
|
2141
2136
|
import { RENDER_TEMP_DIR } from "@hyperframes/core/project-folders";
|
|
2142
2137
|
import { createStagingDir, toWin32LongPath } from "@hyperframes/core/atomic-file";
|
|
2143
2138
|
var OWNER_FILE = "owner.json";
|
|
2144
2139
|
var TRANSACTION_BACKUP = "backup";
|
|
2145
|
-
var machineIdRead;
|
|
2146
|
-
function machineId() {
|
|
2147
|
-
const read2 = (file, args, pattern) => {
|
|
2148
|
-
try {
|
|
2149
|
-
const out = execFileSync(file, args, {
|
|
2150
|
-
encoding: "utf-8",
|
|
2151
|
-
timeout: 2e3,
|
|
2152
|
-
windowsHide: true
|
|
2153
|
-
});
|
|
2154
|
-
return pattern.exec(out)?.[1];
|
|
2155
|
-
} catch {
|
|
2156
|
-
return void 0;
|
|
2157
|
-
}
|
|
2158
|
-
};
|
|
2159
|
-
if (machineIdRead?.platform === process.platform) return machineIdRead.id;
|
|
2160
|
-
const systemRoot = process.env.SystemRoot;
|
|
2161
|
-
machineIdRead = {
|
|
2162
|
-
platform: process.platform,
|
|
2163
|
-
id: process.platform === "darwin" ? read2(
|
|
2164
|
-
"/usr/sbin/ioreg",
|
|
2165
|
-
["-rd1", "-c", "IOPlatformExpertDevice"],
|
|
2166
|
-
/"IOPlatformUUID" = "([^"]+)"/
|
|
2167
|
-
) : process.platform === "win32" && systemRoot && /^[A-Za-z]:\\/.test(systemRoot) ? read2(
|
|
2168
|
-
win32.join(systemRoot, "System32", "reg.exe"),
|
|
2169
|
-
["query", "HKLM\\SOFTWARE\\Microsoft\\Cryptography", "/v", "MachineGuid"],
|
|
2170
|
-
/MachineGuid\s+REG_SZ\s+(\S+)/
|
|
2171
|
-
) : void 0
|
|
2172
|
-
};
|
|
2173
|
-
return machineIdRead.id;
|
|
2174
|
-
}
|
|
2175
|
-
function pidScope() {
|
|
2176
|
-
const attempt = (read2) => {
|
|
2177
|
-
try {
|
|
2178
|
-
return read2();
|
|
2179
|
-
} catch {
|
|
2180
|
-
return void 0;
|
|
2181
|
-
}
|
|
2182
|
-
};
|
|
2183
|
-
const bootId = attempt(() => readFileSync2("/proc/sys/kernel/random/boot_id", "utf-8").trim());
|
|
2184
|
-
return {
|
|
2185
|
-
host: hostname(),
|
|
2186
|
-
// Without /proc (macOS, Windows) the boot time in seconds stands in for the boot id, on this machine's own id.
|
|
2187
|
-
boot: bootId ?? attempt(() => `s:${Math.round(Date.now() / 1e3 - uptime())}`),
|
|
2188
|
-
pidns: attempt(() => readlinkSync2("/proc/self/ns/pid")),
|
|
2189
|
-
machine: bootId === void 0 ? machineId() : void 0
|
|
2190
|
-
};
|
|
2191
|
-
}
|
|
2192
2140
|
function createOwnedRenderDir(prefix) {
|
|
2193
2141
|
const dir = createStagingDir(dirname3(prefix), basename4(prefix));
|
|
2194
|
-
|
|
2195
|
-
writeFileSync2(toWin32LongPath(join5(dir, OWNER_FILE)), JSON.stringify(owner));
|
|
2142
|
+
writeFileSync2(toWin32LongPath(join5(dir, OWNER_FILE)), JSON.stringify(processOwnerRecord()));
|
|
2196
2143
|
return dir;
|
|
2197
2144
|
}
|
|
2198
|
-
function alive(pid) {
|
|
2199
|
-
try {
|
|
2200
|
-
process.kill(pid, 0);
|
|
2201
|
-
return true;
|
|
2202
|
-
} catch (error) {
|
|
2203
|
-
return error.code === "EPERM";
|
|
2204
|
-
}
|
|
2205
|
-
}
|
|
2206
|
-
function knownPidScope() {
|
|
2207
|
-
const scope = pidScope();
|
|
2208
|
-
const unknown = scope.boot === void 0 || process.platform === "linux" && scope.pidns === void 0 || scope.boot.startsWith("s:") && scope.machine === void 0;
|
|
2209
|
-
return unknown ? void 0 : scope;
|
|
2210
|
-
}
|
|
2211
|
-
function sameBoot(stamped, current) {
|
|
2212
|
-
if (stamped === current) return true;
|
|
2213
|
-
const seconds = (boot) => typeof boot === "string" ? /^s:(\d+)$/.exec(boot)?.[1] : void 0;
|
|
2214
|
-
const [a, b] = [seconds(stamped), seconds(current)];
|
|
2215
|
-
return a !== void 0 && b !== void 0 && Math.abs(Number(a) - Number(b)) <= 2;
|
|
2216
|
-
}
|
|
2217
|
-
function inThisPidScope(owner) {
|
|
2218
|
-
const scope = knownPidScope();
|
|
2219
|
-
return scope !== void 0 && owner.host === scope.host && sameBoot(owner.boot, scope.boot) && owner.pidns === scope.pidns && owner.machine === scope.machine;
|
|
2220
|
-
}
|
|
2221
2145
|
function ownerState(dir) {
|
|
2222
2146
|
let owner;
|
|
2223
2147
|
try {
|
|
@@ -2225,11 +2149,7 @@ function ownerState(dir) {
|
|
|
2225
2149
|
} catch (error) {
|
|
2226
2150
|
return error.code === "ENOENT" ? "none" : "unknown";
|
|
2227
2151
|
}
|
|
2228
|
-
|
|
2229
|
-
if (!inThisPidScope(owner) || typeof pid !== "number" || !Number.isInteger(pid) || pid <= 0) {
|
|
2230
|
-
return "unknown";
|
|
2231
|
-
}
|
|
2232
|
-
return alive(pid) ? "live" : "gone";
|
|
2152
|
+
return ownerRecordState(owner);
|
|
2233
2153
|
}
|
|
2234
2154
|
function newestWriteMs(path) {
|
|
2235
2155
|
const stat = lstatSync2(path);
|
|
@@ -11776,14 +11696,14 @@ async function runProbeStage(input) {
|
|
|
11776
11696
|
probeSession.beginFrameTimeTicks,
|
|
11777
11697
|
probeSession.beginFrameIntervalMs
|
|
11778
11698
|
);
|
|
11779
|
-
const
|
|
11699
|
+
const alive = await probeBeginFrameLiveness(
|
|
11780
11700
|
probeSession.page,
|
|
11781
11701
|
probeTimeoutMs,
|
|
11782
11702
|
probeTick,
|
|
11783
11703
|
probeSession.beginFrameIntervalMs
|
|
11784
11704
|
);
|
|
11785
11705
|
assertNotAborted();
|
|
11786
|
-
if (
|
|
11706
|
+
if (alive) {
|
|
11787
11707
|
log.info("BeginFrame liveness probe passed", {
|
|
11788
11708
|
probeMs: Date.now() - livenessStart
|
|
11789
11709
|
});
|
|
@@ -12460,7 +12380,8 @@ async function runExtractVideosStage(input) {
|
|
|
12460
12380
|
shownBoxes,
|
|
12461
12381
|
urlByAbsentLocalPath,
|
|
12462
12382
|
audioDownloadDir,
|
|
12463
|
-
skipFrameExtractionIds = []
|
|
12383
|
+
skipFrameExtractionIds = [],
|
|
12384
|
+
cacheLease
|
|
12464
12385
|
} = input;
|
|
12465
12386
|
const stage2Start = Date.now();
|
|
12466
12387
|
const assetRoots = job.config.allowOutsideProjectAssets ? void 0 : mediaAssetRoots(projectDir, compiledDir);
|
|
@@ -12580,6 +12501,7 @@ async function runExtractVideosStage(input) {
|
|
|
12580
12501
|
contentKeyedDirs: [join26(compiledDir, REMOTE_MEDIA_SUBDIR)],
|
|
12581
12502
|
urlByAbsentLocalPath,
|
|
12582
12503
|
assetRoots,
|
|
12504
|
+
cacheLease,
|
|
12583
12505
|
onProgress: ({ planned = 0, done = 0 }) => {
|
|
12584
12506
|
framesPlanned += planned;
|
|
12585
12507
|
framesDone += done;
|
|
@@ -13728,6 +13650,8 @@ async function runCaptureStage(input) {
|
|
|
13728
13650
|
pageErrorLines: workerPageErrors,
|
|
13729
13651
|
openAttempt: input.openAttempt,
|
|
13730
13652
|
verifyFirstSession: input.verifyFirstSession,
|
|
13653
|
+
prepareSession: input.prepareSession,
|
|
13654
|
+
onSessionUnprepared: input.onSessionUnprepared,
|
|
13731
13655
|
onProgress: (progress) => {
|
|
13732
13656
|
if (progress.latestWorkerPhase) {
|
|
13733
13657
|
if (progress.capturedFrames === 0) reportWorkerStartup(job, progress, onProgress);
|
|
@@ -15896,7 +15820,11 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
|
|
|
15896
15820
|
} : void 0,
|
|
15897
15821
|
void 0,
|
|
15898
15822
|
options.cfg,
|
|
15899
|
-
{
|
|
15823
|
+
{
|
|
15824
|
+
verifyFirstSession: options.verifyFirstSession,
|
|
15825
|
+
prepareSession: options.prepareSession,
|
|
15826
|
+
onSessionUnprepared: options.onSessionUnprepared
|
|
15827
|
+
}
|
|
15900
15828
|
);
|
|
15901
15829
|
pushWorkerDedupPerfs(workerResults, options.dedupPerfs);
|
|
15902
15830
|
if (options.pageErrorLines) pushWorkerPageErrors(workerResults, options.pageErrorLines);
|
|
@@ -16939,6 +16867,8 @@ async function executeRenderPipeline(input) {
|
|
|
16939
16867
|
reason
|
|
16940
16868
|
});
|
|
16941
16869
|
}
|
|
16870
|
+
const cacheLease = createCacheLease();
|
|
16871
|
+
execution.defer("release extraction cache lease", () => cacheLease.release());
|
|
16942
16872
|
const extractResult = await observeRenderStage(
|
|
16943
16873
|
observability,
|
|
16944
16874
|
"video_extract",
|
|
@@ -16956,6 +16886,7 @@ async function executeRenderPipeline(input) {
|
|
|
16956
16886
|
assertNotAborted,
|
|
16957
16887
|
// Local staging can use links; distributed plan() alone requires real copies.
|
|
16958
16888
|
materializeSymlinks: false,
|
|
16889
|
+
cacheLease,
|
|
16959
16890
|
deferRangeExtraction: windowVideoFrames ? true : void 0,
|
|
16960
16891
|
shownBoxes,
|
|
16961
16892
|
onProgress
|
|
@@ -20351,18 +20282,18 @@ function hostnameOf(host) {
|
|
|
20351
20282
|
return null;
|
|
20352
20283
|
}
|
|
20353
20284
|
}
|
|
20354
|
-
function isAllowedBrowserHostname(
|
|
20355
|
-
if (!
|
|
20356
|
-
if (
|
|
20357
|
-
if (isIP(
|
|
20358
|
-
return allowed.has(
|
|
20285
|
+
function isAllowedBrowserHostname(hostname, allowed) {
|
|
20286
|
+
if (!hostname) return false;
|
|
20287
|
+
if (hostname === "localhost" || hostname.endsWith(".localhost")) return true;
|
|
20288
|
+
if (isIP(hostname.replace(/^\[|\]$/g, "")) !== 0) return true;
|
|
20289
|
+
return allowed.has(hostname);
|
|
20359
20290
|
}
|
|
20360
20291
|
function allowedHostnames(options) {
|
|
20361
20292
|
const fromEnv = (process.env.PRODUCER_ALLOWED_HOSTS ?? "").split(",");
|
|
20362
20293
|
const names = /* @__PURE__ */ new Set();
|
|
20363
20294
|
for (const entry of [...options.allowedHosts ?? [], ...fromEnv]) {
|
|
20364
|
-
const
|
|
20365
|
-
if (
|
|
20295
|
+
const hostname = entry.trim() ? hostnameOf(entry.trim()) : null;
|
|
20296
|
+
if (hostname) names.add(hostname);
|
|
20366
20297
|
}
|
|
20367
20298
|
return names;
|
|
20368
20299
|
}
|
|
@@ -20376,8 +20307,8 @@ function hasBearerToken(c, token) {
|
|
|
20376
20307
|
digest(`Bearer ${token}`)
|
|
20377
20308
|
);
|
|
20378
20309
|
}
|
|
20379
|
-
function isLoopbackHostname(
|
|
20380
|
-
const host =
|
|
20310
|
+
function isLoopbackHostname(hostname) {
|
|
20311
|
+
const host = hostname.replace(/^\[|\]$/g, "").toLowerCase();
|
|
20381
20312
|
return host === "localhost" || host === "::1" || isIP(host) === 4 && host.startsWith("127.");
|
|
20382
20313
|
}
|
|
20383
20314
|
function isDisallowedBrowserHost(c, allowed) {
|
|
@@ -20446,12 +20377,12 @@ function onEscapedRejection(reason, log) {
|
|
|
20446
20377
|
});
|
|
20447
20378
|
scope?.fail(err);
|
|
20448
20379
|
}
|
|
20449
|
-
function serverAuth(options,
|
|
20380
|
+
function serverAuth(options, hostname, port) {
|
|
20450
20381
|
const configured = resolveAuthToken(options);
|
|
20451
20382
|
if (configured) return { token: configured };
|
|
20452
|
-
if (!isLoopbackHostname(
|
|
20383
|
+
if (!isLoopbackHostname(hostname)) {
|
|
20453
20384
|
throw new Error(
|
|
20454
|
-
`Refusing to listen on ${
|
|
20385
|
+
`Refusing to listen on ${hostname} without an auth token. Set authToken or PRODUCER_AUTH_TOKEN, or listen on a loopback address.`
|
|
20455
20386
|
);
|
|
20456
20387
|
}
|
|
20457
20388
|
const file = resolve12(
|
|
@@ -20466,11 +20397,11 @@ function serverAuth(options, hostname2, port) {
|
|
|
20466
20397
|
}
|
|
20467
20398
|
function startServer(options = {}) {
|
|
20468
20399
|
const port = options.port ?? parseInt(process.env.PRODUCER_PORT ?? "9847", 10);
|
|
20469
|
-
const
|
|
20400
|
+
const hostname = options.hostname || process.env.PRODUCER_HOST || "127.0.0.1";
|
|
20470
20401
|
const log = options.logger ?? defaultLogger;
|
|
20471
|
-
const auth = serverAuth(options,
|
|
20402
|
+
const auth = serverAuth(options, hostname, port);
|
|
20472
20403
|
const app = createProducerApp({ ...options, authToken: auth.token });
|
|
20473
|
-
const server = serve2({ fetch: app.fetch, port, hostname
|
|
20404
|
+
const server = serve2({ fetch: app.fetch, port, hostname }, (info) => {
|
|
20474
20405
|
const address = info.family === "IPv6" ? `[${info.address}]` : info.address;
|
|
20475
20406
|
log.info(`Listening on http://${address}:${info.port}`);
|
|
20476
20407
|
if (auth.generatedFile) {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
* Every other determinism toggle above is opt-in — only this primitive enables them.
|
|
33
33
|
* In-process renders (`executeRenderJob`) leave them off.
|
|
34
34
|
*/
|
|
35
|
-
import { assertSwiftShader, type CaptureOptions, type CaptureMode, type CapturePerfSummary, type CaptureSession, closeCaptureSession, createCaptureSession, type EngineConfig, initializeSession, probeBeginFrameLiveness, readWebGlVendorInfoFromCanvas } from "@hyperframes/engine";
|
|
35
|
+
import { assertSwiftShader, type CaptureOptions, type CaptureMode, type CapturePerfSummary, type CaptureSession, closeCaptureSession, createCaptureSession, type EngineConfig, initializeSession, type ShownBoxPart, probeBeginFrameLiveness, readWebGlVendorInfoFromCanvas, type ShownBox } from "@hyperframes/engine";
|
|
36
36
|
import { type ChunkSliceJson, type LockedRenderConfig } from "../render/stages/freezePlan.js";
|
|
37
37
|
import { type PlanVideosJson } from "./shared.js";
|
|
38
38
|
export { CHUNK_FRAME_RANGE_INVALID, CHUNK_INDEX_OUT_OF_RANGE, createChunkVideoFrameInjectorFactory, extractDeferredVideoFramesForChunk, FFMPEG_VERSION_MISMATCH, INVALID_VIDEO_METADATA, MISSING_PLAN_ARTIFACT, MISSING_RUNTIME_ENV_SNAPSHOT, PLAN_HASH_MISMATCH, rebuildExtractedFramesFromPlanDir, RenderChunkValidationError, } from "./chunkFrames.js";
|
|
@@ -166,6 +166,27 @@ export declare function runCaptureWithScreenshotFallback<T>(input: {
|
|
|
166
166
|
* and frame zero. `true` means the entire chunk should use screenshot mode.
|
|
167
167
|
*/
|
|
168
168
|
export declare function beginFrameSessionNeedsScreenshotFallback(session: Pick<CaptureSession, "page" | "launchCaptureMode" | "beginFrameTimeTicks" | "beginFrameIntervalMs">, probe?: typeof probeBeginFrameLiveness): Promise<boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* Joins the shares of the box-measuring pass that a chunk's capture workers each run on their own page.
|
|
171
|
+
* `onDone` gets the merged boxes once every worker of one pool has reported, or none when the chunk extracts
|
|
172
|
+
* at full size. It runs once; later shares are dropped.
|
|
173
|
+
*/
|
|
174
|
+
export declare function createSharedBoxMeasure(onDone: (boxes: Map<string, ShownBox> | undefined, pass?: {
|
|
175
|
+
workers: number;
|
|
176
|
+
frames: number;
|
|
177
|
+
durationMs: number;
|
|
178
|
+
slowestShareMs: number;
|
|
179
|
+
}) => void): {
|
|
180
|
+
add: (worker: {
|
|
181
|
+
workerId: number;
|
|
182
|
+
workerCount: number;
|
|
183
|
+
}, part: ShownBoxPart, cost: {
|
|
184
|
+
frames: number;
|
|
185
|
+
durationMs: number;
|
|
186
|
+
}) => void;
|
|
187
|
+
fullSize: () => void;
|
|
188
|
+
settled: () => boolean;
|
|
189
|
+
};
|
|
169
190
|
/**
|
|
170
191
|
* Re-export the runtime-env apply helper so adapters that import only
|
|
171
192
|
* this subpath can prime `process.env` before instantiating their own
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
* `renderOrchestrator.ts`, which imports the stage (a cycle that resolves at module init). The
|
|
31
31
|
* capture helpers should move to a shared module so stages stop reaching back into the orchestrator.
|
|
32
32
|
*/
|
|
33
|
-
import { type BeforeCaptureHook, type CaptureOptions, type CapturePerfSummary, type CaptureSession, type EngineConfig, type LandedFrame } from "@hyperframes/engine";
|
|
33
|
+
import { type BeforeCaptureHook, type CaptureOptions, type CapturePerfSummary, type CaptureSession, type EngineConfig, type LandedFrame, type ParallelCaptureHooks } from "@hyperframes/engine";
|
|
34
34
|
import type { FileServerHandle } from "../../fileServer.js";
|
|
35
35
|
import type { ProducerLogger } from "../../../logger.js";
|
|
36
36
|
import { type CaptureAttemptSummary, type ProgressCallback, type RenderConfig, type RenderJob } from "../../renderOrchestrator.js";
|
|
@@ -89,6 +89,8 @@ export interface CaptureStageInput {
|
|
|
89
89
|
/** Each capture attempt opens one, so a stalled attempt is retried by the ladders below. */
|
|
90
90
|
openAttempt?: OpenStallAttempt;
|
|
91
91
|
verifyFirstSession?: (session: CaptureSession) => Promise<void>;
|
|
92
|
+
prepareSession?: ParallelCaptureHooks["prepareSession"];
|
|
93
|
+
onSessionUnprepared?: ParallelCaptureHooks["onSessionUnprepared"];
|
|
92
94
|
}
|
|
93
95
|
export interface CaptureStageResult {
|
|
94
96
|
/** Final worker count after any adaptive retry. */
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
* machines (symlinks don't survive S3 / GCS round-trips). Default
|
|
28
28
|
* `false` preserves the in-process renderer's symlink behavior.
|
|
29
29
|
*/
|
|
30
|
-
import { type CaptureVideoMetadataHint, type EngineConfig, type ExtractionResult, type FrameLookupTable, type HdrTransfer, type VideoExtractionFailureKind, type VideoColorSpace, classifyVideoExtractionError, extractAllVideoFrames, type ShownBox } from "@hyperframes/engine";
|
|
30
|
+
import { type CacheLease, type CaptureVideoMetadataHint, type EngineConfig, type ExtractionResult, type FrameLookupTable, type HdrTransfer, type VideoExtractionFailureKind, type VideoColorSpace, classifyVideoExtractionError, extractAllVideoFrames, type ShownBox } from "@hyperframes/engine";
|
|
31
31
|
import { type RenderJob } from "../../renderOrchestrator.js";
|
|
32
32
|
import { type CompositionMetadata } from "../shared.js";
|
|
33
33
|
import type { ProgressCallback } from "../../renderOrchestrator.js";
|
|
@@ -57,6 +57,7 @@ export interface ExtractVideosStageInput {
|
|
|
57
57
|
urlByAbsentLocalPath?: ReadonlyMap<string, string>;
|
|
58
58
|
audioDownloadDir?: string;
|
|
59
59
|
onProgress?: ProgressCallback;
|
|
60
|
+
cacheLease?: CacheLease;
|
|
60
61
|
}
|
|
61
62
|
export interface ExtractVideosStageResult {
|
|
62
63
|
/** Result of `extractAllVideoFrames`, or `null` if the composition has no videos. */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ExpectedOutputDimensions } from "./render/outputDimensions.js";
|
|
2
2
|
import { type CanvasResolution, type Fps, type FpsInput, type HfVfxCapture } from "@hyperframes/core";
|
|
3
3
|
import type { CompileForRenderOptions } from "./htmlCompiler.js";
|
|
4
|
-
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
|
+
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, type ParallelCaptureHooks } from "@hyperframes/engine";
|
|
5
5
|
import { type ReferenceBackgroundResult } from "@hyperframes/engine";
|
|
6
6
|
import { type ProducerLogger } from "../logger.js";
|
|
7
7
|
import { type RenderOutputFormat } from "./render/renderFormat.js";
|
|
@@ -648,6 +648,8 @@ export declare function executeDiskCaptureWithAdaptiveRetry(options: {
|
|
|
648
648
|
pageErrorLines?: string[];
|
|
649
649
|
openAttempt?: OpenStallAttempt;
|
|
650
650
|
verifyFirstSession?: (session: CaptureSession) => Promise<void>;
|
|
651
|
+
prepareSession?: ParallelCaptureHooks["prepareSession"];
|
|
652
|
+
onSessionUnprepared?: ParallelCaptureHooks["onSessionUnprepared"];
|
|
651
653
|
}): Promise<CaptureAttemptSummary[]>;
|
|
652
654
|
export type RenderConfigInput = Omit<RenderConfig, "fps"> & {
|
|
653
655
|
fps: FpsInput;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hyperframes/producer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "HTML-to-video rendering engine using Chrome's BeginFrame API",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
"postcss": "^8.4.0",
|
|
36
36
|
"puppeteer": "~25.13.0",
|
|
37
37
|
"puppeteer-core": "^25.13.0",
|
|
38
|
-
"@hyperframes/
|
|
39
|
-
"@hyperframes/
|
|
40
|
-
"@hyperframes/lint": "0.
|
|
41
|
-
"@hyperframes/parsers": "0.
|
|
42
|
-
"@hyperframes/share": "0.
|
|
43
|
-
"@hyperframes/studio-server": "0.
|
|
38
|
+
"@hyperframes/engine": "0.10.0",
|
|
39
|
+
"@hyperframes/core": "0.10.0",
|
|
40
|
+
"@hyperframes/lint": "0.10.0",
|
|
41
|
+
"@hyperframes/parsers": "0.10.0",
|
|
42
|
+
"@hyperframes/share": "0.10.0",
|
|
43
|
+
"@hyperframes/studio-server": "0.10.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@types/node": "^25.0.10",
|
|
@@ -49,10 +49,10 @@
|
|
|
49
49
|
"tsx": "^4.21.0",
|
|
50
50
|
"typescript": "^5.7.2",
|
|
51
51
|
"vitest": "^4.1.12",
|
|
52
|
-
"@hyperframes/aws-lambda": "0.
|
|
52
|
+
"@hyperframes/aws-lambda": "0.10.0"
|
|
53
53
|
},
|
|
54
54
|
"engines": {
|
|
55
|
-
"node": ">=22"
|
|
55
|
+
"node": ">=22.19.0"
|
|
56
56
|
},
|
|
57
57
|
"scripts": {
|
|
58
58
|
"build": "bun run build:hf-early-stub && bun run --cwd ../.. build:hyperframes-runtime:modular && node build.mjs",
|