@hyperframes/producer 0.9.61 → 0.9.63
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/distributed.js +24 -12
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/index.js +70 -43
- package/dist/public-server.js +67 -40
- package/dist/services/distributed/projectHash.d.ts +7 -8
- package/dist/services/render/stages/encodeStage.d.ts +4 -3
- package/package.json +7 -7
package/dist/distributed.js
CHANGED
|
@@ -143,7 +143,7 @@ function formatExportFrameName(index, ext) {
|
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
// src/services/renderOrchestrator.ts
|
|
146
|
-
import { audioFailureDiagnostics as audioFailureDiagnostics2 } from "@hyperframes/engine";
|
|
146
|
+
import { audioFailureDiagnostics as audioFailureDiagnostics2, usableCpuCount as usableCpuCount2 } from "@hyperframes/engine";
|
|
147
147
|
import {
|
|
148
148
|
existsSync as existsSync14,
|
|
149
149
|
mkdirSync as mkdirSync6,
|
|
@@ -399,7 +399,10 @@ import { Readable } from "node:stream";
|
|
|
399
399
|
import { join as join2, extname, resolve as resolve2, sep as sep2 } from "node:path";
|
|
400
400
|
import { injectScriptsAtHeadStart, injectScriptsIntoHtml } from "@hyperframes/core/compiler";
|
|
401
401
|
import { injectTagsAtHeadStart } from "@hyperframes/core/compiler/html-document";
|
|
402
|
-
import {
|
|
402
|
+
import {
|
|
403
|
+
PREVIEW_FOR_ANOTHER_SITE_META,
|
|
404
|
+
serviceWorkerScriptFetch
|
|
405
|
+
} from "@hyperframes/core/studio-preview-mark";
|
|
403
406
|
import { fpsToNumber, terminalText as terminalText2 } from "@hyperframes/core";
|
|
404
407
|
import { isPrivateFileUnder, isStudioPrivatePath } from "@hyperframes/core/safe-path";
|
|
405
408
|
import { stripSdrPngColourTags } from "@hyperframes/core/compiler/png-colour-tags";
|
|
@@ -1058,6 +1061,12 @@ function createFileServer(options) {
|
|
|
1058
1061
|
c.res.headers.set("X-Content-Type-Options", "nosniff");
|
|
1059
1062
|
});
|
|
1060
1063
|
answerOwnLoopbackHostOnly(app, () => listeningPort);
|
|
1064
|
+
app.use(async function refuseServiceWorkerScripts(c, next) {
|
|
1065
|
+
const serviceWorker = c.req.header("service-worker");
|
|
1066
|
+
if (!serviceWorkerScriptFetch({ serviceWorker, fetchDest: c.req.header("sec-fetch-dest") }))
|
|
1067
|
+
return next();
|
|
1068
|
+
return c.text("Forbidden", 403);
|
|
1069
|
+
});
|
|
1061
1070
|
app.get("/*", async (c) => {
|
|
1062
1071
|
let requestPath = c.req.path;
|
|
1063
1072
|
if (requestPath === "/") requestPath = "/index.html";
|
|
@@ -8390,7 +8399,7 @@ function encodeWhileCapturing(input, totalFrames, captureBudget) {
|
|
|
8390
8399
|
error: String(failure ?? result?.error)
|
|
8391
8400
|
}
|
|
8392
8401
|
);
|
|
8393
|
-
return runEncodeStage(input);
|
|
8402
|
+
return runEncodeStage({ ...input, hasAudio: false });
|
|
8394
8403
|
},
|
|
8395
8404
|
abort: async () => {
|
|
8396
8405
|
stop.abort();
|
|
@@ -12830,7 +12839,7 @@ import {
|
|
|
12830
12839
|
probeBeginFrameLiveness as probeBeginFrameLiveness2,
|
|
12831
12840
|
readWebGlVendorInfoFromCanvas,
|
|
12832
12841
|
resolveConfig as resolveConfig5,
|
|
12833
|
-
usableCpuCount as
|
|
12842
|
+
usableCpuCount as usableCpuCount3
|
|
12834
12843
|
} from "@hyperframes/engine";
|
|
12835
12844
|
import { readWebGlVendorInfoFromCanvas as readWebGlVendorInfoFromCanvas2 } from "@hyperframes/engine";
|
|
12836
12845
|
var LEGACY_DISTRIBUTED_VP9_CPU_USED = 2;
|
|
@@ -13360,9 +13369,9 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
13360
13369
|
const captureSession = session;
|
|
13361
13370
|
session = null;
|
|
13362
13371
|
verifyStarted = Date.now();
|
|
13363
|
-
overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount,
|
|
13372
|
+
overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, usableCpuCount3()) ? encodeWhileCapturing(encodeInput, framesInChunk, {
|
|
13364
13373
|
workerCount: chunkWorkerCount,
|
|
13365
|
-
cpuCount:
|
|
13374
|
+
cpuCount: usableCpuCount3()
|
|
13366
13375
|
}) : null;
|
|
13367
13376
|
await observeRenderStage(
|
|
13368
13377
|
new RenderObservabilityRecorder({ pipelineStartMs: start, log }),
|
|
@@ -13874,7 +13883,8 @@ function statEntry(full, relPath) {
|
|
|
13874
13883
|
throw new Error(`[listSiteFiles] cannot read ${relPath} (dangling symlink?)`, { cause: err });
|
|
13875
13884
|
}
|
|
13876
13885
|
}
|
|
13877
|
-
function listSiteFiles(projectDir, onPrivate, onOutside) {
|
|
13886
|
+
function listSiteFiles(projectDir, onPrivate, onOutside = () => {
|
|
13887
|
+
}) {
|
|
13878
13888
|
const files = [];
|
|
13879
13889
|
const root = realpathSync2(projectDir);
|
|
13880
13890
|
const ancestors = /* @__PURE__ */ new Set([root]);
|
|
@@ -13882,7 +13892,9 @@ function listSiteFiles(projectDir, onPrivate, onOutside) {
|
|
|
13882
13892
|
if (isPrivateFileUnder3(projectDir, full, isStudioPrivatePath3)) return void onPrivate?.(relPath);
|
|
13883
13893
|
const stat = statEntry(full, relPath);
|
|
13884
13894
|
if (!stat.isFile() && !stat.isDirectory()) return;
|
|
13885
|
-
if (onOutside && outsideFolder(root, realpathSync2(full)))
|
|
13895
|
+
if (onOutside !== "include" && outsideFolder(root, realpathSync2(full))) {
|
|
13896
|
+
return void onOutside(relPath);
|
|
13897
|
+
}
|
|
13886
13898
|
if (stat.isFile()) return void files.push(relPath);
|
|
13887
13899
|
const real = realpathSync2(full);
|
|
13888
13900
|
if (ancestors.has(real)) return;
|
|
@@ -13905,22 +13917,22 @@ var printablePath = (path) => [...path].map((ch) => {
|
|
|
13905
13917
|
const control = code < 32 && code !== 9 || code >= 127 && code <= 159;
|
|
13906
13918
|
return control ? `\\x${code.toString(16).padStart(2, "0")}` : ch;
|
|
13907
13919
|
}).join("");
|
|
13908
|
-
function listSiteFilesForUpload(projectDir, onNotice, includeOutsideFiles = false) {
|
|
13920
|
+
function listSiteFilesForUpload(projectDir, onNotice = (message) => console.warn(message), includeOutsideFiles = false) {
|
|
13909
13921
|
const leftOut = [];
|
|
13910
13922
|
const outside = [];
|
|
13911
13923
|
const files = listSiteFiles(
|
|
13912
13924
|
projectDir,
|
|
13913
13925
|
(path) => leftOut.push(path),
|
|
13914
|
-
includeOutsideFiles ?
|
|
13926
|
+
includeOutsideFiles ? "include" : (path) => outside.push(path)
|
|
13915
13927
|
);
|
|
13916
13928
|
if (leftOut.length > 0) {
|
|
13917
13929
|
const more = leftOut.length > 5 ? ` and ${leftOut.length - 5} more` : "";
|
|
13918
|
-
onNotice
|
|
13930
|
+
onNotice(
|
|
13919
13931
|
`[deploySite] left out private files no composition loads (env, Git, credentials, tool state): ${leftOut.slice(0, 5).map(printablePath).join(", ")}${more}`
|
|
13920
13932
|
);
|
|
13921
13933
|
}
|
|
13922
13934
|
if (outside.length > 0) {
|
|
13923
|
-
onNotice
|
|
13935
|
+
onNotice(
|
|
13924
13936
|
`[deploySite] left out files linked in from outside the project: ${outside.map(printablePath).join(", ")}. Pass --include-outside-files (includeOutsideFiles in the SDK) to upload them.`
|
|
13925
13937
|
);
|
|
13926
13938
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"buildId": "dev",
|
|
4
|
-
"sha256": "
|
|
4
|
+
"sha256": "aeaca1868c088c54bf1c22a2e0f4fb720ec491346c9310342eb3279e5e77ca03",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"iife": "hyperframe.runtime.iife.js",
|
|
7
7
|
"esm": "hyperframe.runtime.mjs"
|