@hyperframes/producer 0.9.104 → 0.9.107
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/compileWorker.js +13 -22
- package/dist/distributed.js +38 -43
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/index.js +71 -151
- package/dist/public-server.js +60 -140
- package/dist/services/render/stages/extractVideosStage.d.ts +2 -1
- package/dist/utils/paths.d.ts +2 -6
- package/package.json +8 -8
package/dist/compileWorker.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
stylesheetLinkMatches
|
|
28
28
|
} from "@hyperframes/parsers/css-url-scans";
|
|
29
29
|
import { createHash as createHash3 } from "node:crypto";
|
|
30
|
-
import { createReadStream, existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, statSync as
|
|
30
|
+
import { createReadStream, existsSync as existsSync3, mkdirSync as mkdirSync3, readFileSync as readFileSync4, statSync as statSync3 } from "fs";
|
|
31
31
|
import { join as join5, dirname as dirname3, resolve as resolve3, basename as basename3, relative, sep as sep2 } from "path";
|
|
32
32
|
import { parseHTML as parseHTML4 } from "@hyperframes/parsers/linkedom";
|
|
33
33
|
import { compositionRootSize } from "@hyperframes/parsers";
|
|
@@ -309,15 +309,12 @@ import {
|
|
|
309
309
|
relative as nodeRelative,
|
|
310
310
|
isAbsolute as nodeIsAbsolute
|
|
311
311
|
} from "node:path";
|
|
312
|
-
import { statSync } from "node:fs";
|
|
313
312
|
import { fileURLToPath } from "node:url";
|
|
314
313
|
import { isPrivateFileUnder, isSafePath, isStudioPrivatePath } from "@hyperframes/core/safe-path";
|
|
315
314
|
import {
|
|
316
|
-
isCopiedOutsideFileType,
|
|
317
|
-
isPrivateOutsideFile,
|
|
318
|
-
isUploadedOutsideFileType,
|
|
319
315
|
leftOutWarning,
|
|
320
|
-
linksOutside
|
|
316
|
+
linksOutside,
|
|
317
|
+
outsideLinkRefusal
|
|
321
318
|
} from "@hyperframes/studio-server/outside-file";
|
|
322
319
|
import { realFilePath } from "@hyperframes/studio-server/safe-path";
|
|
323
320
|
var DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
@@ -338,15 +335,9 @@ function escapesAssetRoot(path, assetRoot) {
|
|
|
338
335
|
return assetRoot !== void 0 && !isSafePath(assetRoot, path);
|
|
339
336
|
}
|
|
340
337
|
function outsideAssetRefusal(projectDir2, path, policy = {}) {
|
|
341
|
-
if (
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
}
|
|
345
|
-
if (isPrivateOutsideFile(projectDir2, path)) return "blocklisted";
|
|
346
|
-
const folder = statSync(path, { throwIfNoEntry: false })?.isDirectory();
|
|
347
|
-
if (folder || isUploadedOutsideFileType(path)) return null;
|
|
348
|
-
if (!isCopiedOutsideFileType(path)) return "file_type";
|
|
349
|
-
return policy.includeScripts ? null : "script";
|
|
338
|
+
if (linksOutside(projectDir2, path)) return outsideLinkRefusal(projectDir2, path, policy);
|
|
339
|
+
const privateByAnotherSpelling = !isPathInside(path, projectDir2) && isPrivateFileUnder(projectDir2, path, isStudioPrivatePath);
|
|
340
|
+
return privateByAnotherSpelling ? "blocklisted" : null;
|
|
350
341
|
}
|
|
351
342
|
var leftOutOfRender = (file, reference, reason) => leftOutWarning(file, reference, reason, "render");
|
|
352
343
|
function refusesOutsideLink(projectDir2, path, warn, policy = {}) {
|
|
@@ -560,7 +551,7 @@ import {
|
|
|
560
551
|
|
|
561
552
|
// src/services/animatedGifPrep.ts
|
|
562
553
|
import { createHash, randomUUID } from "node:crypto";
|
|
563
|
-
import { copyFileSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, rmSync, statSync
|
|
554
|
+
import { copyFileSync, existsSync as existsSync2, mkdirSync, readFileSync as readFileSync2, rmSync, statSync } from "node:fs";
|
|
564
555
|
import { dirname, isAbsolute, join as join3, resolve } from "node:path";
|
|
565
556
|
import { parseHTML as parseHTML2 } from "@hyperframes/parsers/linkedom";
|
|
566
557
|
import { parseAnimatedGifMetadata } from "@hyperframes/core";
|
|
@@ -646,7 +637,7 @@ function resolveLocalImageSourcePath(src, options2) {
|
|
|
646
637
|
}
|
|
647
638
|
function isUsableFile(path) {
|
|
648
639
|
try {
|
|
649
|
-
const stat =
|
|
640
|
+
const stat = statSync(path);
|
|
650
641
|
return stat.isFile() && stat.size > 0;
|
|
651
642
|
} catch {
|
|
652
643
|
return false;
|
|
@@ -796,7 +787,7 @@ async function ensurePreparedWebm(input) {
|
|
|
796
787
|
if (!isUsableFile(tmpPath)) {
|
|
797
788
|
throw new Error("Animated GIF transcode produced an empty output");
|
|
798
789
|
}
|
|
799
|
-
if (
|
|
790
|
+
if (statSync(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP) {
|
|
800
791
|
throw new Error("Animated GIF transcode reached its output size limit");
|
|
801
792
|
}
|
|
802
793
|
if (!isUsableFile(input.cachePath)) {
|
|
@@ -932,7 +923,7 @@ import {
|
|
|
932
923
|
readFileSync as readFileSync3,
|
|
933
924
|
readSync,
|
|
934
925
|
rmSync as rmSync2,
|
|
935
|
-
statSync as
|
|
926
|
+
statSync as statSync2,
|
|
936
927
|
writeFileSync
|
|
937
928
|
} from "node:fs";
|
|
938
929
|
import { dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
|
|
@@ -1188,7 +1179,7 @@ function resolveImageSource(src, options2) {
|
|
|
1188
1179
|
}
|
|
1189
1180
|
function isUsableFile2(path) {
|
|
1190
1181
|
try {
|
|
1191
|
-
return
|
|
1182
|
+
return statSync2(path).size > 0;
|
|
1192
1183
|
} catch {
|
|
1193
1184
|
return false;
|
|
1194
1185
|
}
|
|
@@ -1209,7 +1200,7 @@ async function ensurePreparedJpeg(source, cachePath, outputPath, options2) {
|
|
|
1209
1200
|
signal: options2.signal
|
|
1210
1201
|
});
|
|
1211
1202
|
if (!isUsableFile2(tmpPath)) throw new Error("conversion produced an empty file");
|
|
1212
|
-
if (
|
|
1203
|
+
if (statSync2(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP2) {
|
|
1213
1204
|
throw new Error("conversion reached its output size limit");
|
|
1214
1205
|
}
|
|
1215
1206
|
renameWithRetry2(tmpPath, cachePath);
|
|
@@ -2820,7 +2811,7 @@ async function localFontDataUri(localPath, projectDir2, assetRoot, dataUriByAbso
|
|
|
2820
2811
|
if (dataUriByAbsolutePath.has(absPath)) return dataUriByAbsolutePath.get(absPath);
|
|
2821
2812
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
2822
2813
|
try {
|
|
2823
|
-
if (!reserve(Math.ceil(
|
|
2814
|
+
if (!reserve(Math.ceil(statSync3(absPath).size / 3) * 4 + 64)) {
|
|
2824
2815
|
dataUriByAbsolutePath.set(absPath, void 0);
|
|
2825
2816
|
return void 0;
|
|
2826
2817
|
}
|
package/dist/distributed.js
CHANGED
|
@@ -81,15 +81,12 @@ import {
|
|
|
81
81
|
relative as nodeRelative,
|
|
82
82
|
isAbsolute as nodeIsAbsolute
|
|
83
83
|
} from "node:path";
|
|
84
|
-
import { statSync } from "node:fs";
|
|
85
84
|
import { fileURLToPath } from "node:url";
|
|
86
85
|
import { isPrivateFileUnder, isSafePath, isStudioPrivatePath } from "@hyperframes/core/safe-path";
|
|
87
86
|
import {
|
|
88
|
-
isCopiedOutsideFileType,
|
|
89
|
-
isPrivateOutsideFile,
|
|
90
|
-
isUploadedOutsideFileType,
|
|
91
87
|
leftOutWarning,
|
|
92
|
-
linksOutside
|
|
88
|
+
linksOutside,
|
|
89
|
+
outsideLinkRefusal
|
|
93
90
|
} from "@hyperframes/studio-server/outside-file";
|
|
94
91
|
import { realFilePath } from "@hyperframes/studio-server/safe-path";
|
|
95
92
|
var DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
@@ -110,15 +107,9 @@ function escapesAssetRoot(path, assetRoot) {
|
|
|
110
107
|
return assetRoot !== void 0 && !isSafePath(assetRoot, path);
|
|
111
108
|
}
|
|
112
109
|
function outsideAssetRefusal(projectDir, path, policy = {}) {
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
}
|
|
117
|
-
if (isPrivateOutsideFile(projectDir, path)) return "blocklisted";
|
|
118
|
-
const folder = statSync(path, { throwIfNoEntry: false })?.isDirectory();
|
|
119
|
-
if (folder || isUploadedOutsideFileType(path)) return null;
|
|
120
|
-
if (!isCopiedOutsideFileType(path)) return "file_type";
|
|
121
|
-
return policy.includeScripts ? null : "script";
|
|
110
|
+
if (linksOutside(projectDir, path)) return outsideLinkRefusal(projectDir, path, policy);
|
|
111
|
+
const privateByAnotherSpelling = !isPathInside(path, projectDir) && isPrivateFileUnder(projectDir, path, isStudioPrivatePath);
|
|
112
|
+
return privateByAnotherSpelling ? "blocklisted" : null;
|
|
122
113
|
}
|
|
123
114
|
var leftOutOfRender = (file, reference, reason) => leftOutWarning(file, reference, reason, "render");
|
|
124
115
|
function refusesOutsideLink(projectDir, path, warn, policy = {}) {
|
|
@@ -152,7 +143,7 @@ import {
|
|
|
152
143
|
mkdirSync as mkdirSync7,
|
|
153
144
|
readdirSync as readdirSync3,
|
|
154
145
|
rmSync as rmSync6,
|
|
155
|
-
statSync as
|
|
146
|
+
statSync as statSync6,
|
|
156
147
|
writeFileSync as writeFileSync6,
|
|
157
148
|
copyFileSync as copyFileSync5,
|
|
158
149
|
appendFileSync
|
|
@@ -374,6 +365,7 @@ import {
|
|
|
374
365
|
getDrawElementVerificationDetails,
|
|
375
366
|
augmentProtocolTimeoutError,
|
|
376
367
|
augmentPageNavigationTimeoutError,
|
|
368
|
+
createCacheLease,
|
|
377
369
|
displaySize
|
|
378
370
|
} from "@hyperframes/engine";
|
|
379
371
|
import {
|
|
@@ -396,7 +388,7 @@ import {
|
|
|
396
388
|
import {
|
|
397
389
|
existsSync as existsSync2,
|
|
398
390
|
realpathSync,
|
|
399
|
-
statSync
|
|
391
|
+
statSync,
|
|
400
392
|
createReadStream,
|
|
401
393
|
openSync,
|
|
402
394
|
fstatSync,
|
|
@@ -1034,7 +1026,7 @@ function openRegularFile(filePath) {
|
|
|
1034
1026
|
} catch (error) {
|
|
1035
1027
|
if (error instanceof Error && "code" in error && NO_FILE_AT_NAME.has(String(error.code)))
|
|
1036
1028
|
return null;
|
|
1037
|
-
if (!
|
|
1029
|
+
if (!statSync(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
1038
1030
|
throw error;
|
|
1039
1031
|
}
|
|
1040
1032
|
let accepted = false;
|
|
@@ -1607,6 +1599,7 @@ import {
|
|
|
1607
1599
|
} from "@hyperframes/engine";
|
|
1608
1600
|
|
|
1609
1601
|
// src/services/render/renderDirOwner.ts
|
|
1602
|
+
import { ownerRecordState, processOwnerRecord } from "@hyperframes/engine";
|
|
1610
1603
|
import { RENDER_TEMP_DIR } from "@hyperframes/core/project-folders";
|
|
1611
1604
|
import { createStagingDir, toWin32LongPath } from "@hyperframes/core/atomic-file";
|
|
1612
1605
|
|
|
@@ -2543,7 +2536,7 @@ import {
|
|
|
2543
2536
|
stylesheetLinkMatches
|
|
2544
2537
|
} from "@hyperframes/parsers/css-url-scans";
|
|
2545
2538
|
import { createHash as createHash5 } from "node:crypto";
|
|
2546
|
-
import { createReadStream as createReadStream2, existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync5, statSync as
|
|
2539
|
+
import { createReadStream as createReadStream2, existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync5, statSync as statSync4 } from "fs";
|
|
2547
2540
|
import { join as join9, dirname as dirname7, resolve as resolve6, basename as basename3, relative as relative2, sep as sep3 } from "path";
|
|
2548
2541
|
import { parseHTML as parseHTML5 } from "@hyperframes/parsers/linkedom";
|
|
2549
2542
|
import { compositionRootSize } from "@hyperframes/parsers";
|
|
@@ -2832,7 +2825,7 @@ import {
|
|
|
2832
2825
|
|
|
2833
2826
|
// src/services/animatedGifPrep.ts
|
|
2834
2827
|
import { createHash as createHash3, randomUUID } from "node:crypto";
|
|
2835
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync as rmSync2, statSync as
|
|
2828
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync as rmSync2, statSync as statSync2 } from "node:fs";
|
|
2836
2829
|
import { dirname as dirname4, isAbsolute as isAbsolute2, join as join6, resolve as resolve4 } from "node:path";
|
|
2837
2830
|
import { parseHTML as parseHTML3 } from "@hyperframes/parsers/linkedom";
|
|
2838
2831
|
import { parseAnimatedGifMetadata } from "@hyperframes/core";
|
|
@@ -2895,7 +2888,7 @@ function resolveLocalImageSourcePath(src, options) {
|
|
|
2895
2888
|
}
|
|
2896
2889
|
function isUsableFile(path) {
|
|
2897
2890
|
try {
|
|
2898
|
-
const stat =
|
|
2891
|
+
const stat = statSync2(path);
|
|
2899
2892
|
return stat.isFile() && stat.size > 0;
|
|
2900
2893
|
} catch {
|
|
2901
2894
|
return false;
|
|
@@ -3045,7 +3038,7 @@ async function ensurePreparedWebm(input) {
|
|
|
3045
3038
|
if (!isUsableFile(tmpPath)) {
|
|
3046
3039
|
throw new Error("Animated GIF transcode produced an empty output");
|
|
3047
3040
|
}
|
|
3048
|
-
if (
|
|
3041
|
+
if (statSync2(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP) {
|
|
3049
3042
|
throw new Error("Animated GIF transcode reached its output size limit");
|
|
3050
3043
|
}
|
|
3051
3044
|
if (!isUsableFile(input.cachePath)) {
|
|
@@ -3181,7 +3174,7 @@ import {
|
|
|
3181
3174
|
readFileSync as readFileSync4,
|
|
3182
3175
|
readSync,
|
|
3183
3176
|
rmSync as rmSync3,
|
|
3184
|
-
statSync as
|
|
3177
|
+
statSync as statSync3,
|
|
3185
3178
|
writeFileSync as writeFileSync2
|
|
3186
3179
|
} from "node:fs";
|
|
3187
3180
|
import { dirname as dirname5, join as join7, resolve as resolve5 } from "node:path";
|
|
@@ -3437,7 +3430,7 @@ function resolveImageSource(src, options) {
|
|
|
3437
3430
|
}
|
|
3438
3431
|
function isUsableFile2(path) {
|
|
3439
3432
|
try {
|
|
3440
|
-
return
|
|
3433
|
+
return statSync3(path).size > 0;
|
|
3441
3434
|
} catch {
|
|
3442
3435
|
return false;
|
|
3443
3436
|
}
|
|
@@ -3458,7 +3451,7 @@ async function ensurePreparedJpeg(source, cachePath, outputPath, options) {
|
|
|
3458
3451
|
signal: options.signal
|
|
3459
3452
|
});
|
|
3460
3453
|
if (!isUsableFile2(tmpPath)) throw new Error("conversion produced an empty file");
|
|
3461
|
-
if (
|
|
3454
|
+
if (statSync3(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP2) {
|
|
3462
3455
|
throw new Error("conversion reached its output size limit");
|
|
3463
3456
|
}
|
|
3464
3457
|
renameWithRetry3(tmpPath, cachePath);
|
|
@@ -5133,7 +5126,7 @@ async function localFontDataUri(localPath, projectDir, assetRoot, dataUriByAbsol
|
|
|
5133
5126
|
if (dataUriByAbsolutePath.has(absPath)) return dataUriByAbsolutePath.get(absPath);
|
|
5134
5127
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
5135
5128
|
try {
|
|
5136
|
-
if (!reserve(Math.ceil(
|
|
5129
|
+
if (!reserve(Math.ceil(statSync4(absPath).size / 3) * 4 + 64)) {
|
|
5137
5130
|
dataUriByAbsolutePath.set(absPath, void 0);
|
|
5138
5131
|
return void 0;
|
|
5139
5132
|
}
|
|
@@ -7658,7 +7651,8 @@ async function runExtractVideosStage(input) {
|
|
|
7658
7651
|
shownBoxes,
|
|
7659
7652
|
urlByAbsentLocalPath,
|
|
7660
7653
|
audioDownloadDir,
|
|
7661
|
-
skipFrameExtractionIds = []
|
|
7654
|
+
skipFrameExtractionIds = [],
|
|
7655
|
+
cacheLease
|
|
7662
7656
|
} = input;
|
|
7663
7657
|
const stage2Start = Date.now();
|
|
7664
7658
|
const assetRoots = job.config.allowOutsideProjectAssets ? void 0 : mediaAssetRoots(projectDir, compiledDir);
|
|
@@ -7778,6 +7772,7 @@ async function runExtractVideosStage(input) {
|
|
|
7778
7772
|
contentKeyedDirs: [join14(compiledDir, REMOTE_MEDIA_SUBDIR)],
|
|
7779
7773
|
urlByAbsentLocalPath,
|
|
7780
7774
|
assetRoots,
|
|
7775
|
+
cacheLease,
|
|
7781
7776
|
onProgress: ({ planned = 0, done = 0 }) => {
|
|
7782
7777
|
framesPlanned += planned;
|
|
7783
7778
|
framesDone += done;
|
|
@@ -9104,7 +9099,7 @@ import {
|
|
|
9104
9099
|
readdirSync as readdirSync2,
|
|
9105
9100
|
readFileSync as readFileSync6,
|
|
9106
9101
|
rmSync as rmSync5,
|
|
9107
|
-
statSync as
|
|
9102
|
+
statSync as statSync5,
|
|
9108
9103
|
writeFileSync as writeFileSync5
|
|
9109
9104
|
} from "node:fs";
|
|
9110
9105
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
@@ -9233,7 +9228,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
|
|
|
9233
9228
|
const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
|
|
9234
9229
|
if (failure) return failure;
|
|
9235
9230
|
}
|
|
9236
|
-
const fileSize = existsSync14(outputPath) ?
|
|
9231
|
+
const fileSize = existsSync14(outputPath) ? statSync5(outputPath).size : 0;
|
|
9237
9232
|
return {
|
|
9238
9233
|
success: true,
|
|
9239
9234
|
outputPath,
|
|
@@ -9495,7 +9490,7 @@ function sampleDirectoryBytes(dir) {
|
|
|
9495
9490
|
for (const name of entries) {
|
|
9496
9491
|
const full = join20(current, name);
|
|
9497
9492
|
try {
|
|
9498
|
-
const st =
|
|
9493
|
+
const st = statSync6(full);
|
|
9499
9494
|
if (st.isDirectory()) {
|
|
9500
9495
|
stack.push(full);
|
|
9501
9496
|
} else if (st.isFile()) {
|
|
@@ -9576,7 +9571,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
|
|
|
9576
9571
|
let rangeStart = null;
|
|
9577
9572
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
9578
9573
|
const framePath = join20(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
9579
|
-
const missing = !existsSync15(framePath) ||
|
|
9574
|
+
const missing = !existsSync15(framePath) || statSync6(framePath).size <= 8;
|
|
9580
9575
|
if (missing && rangeStart === null) {
|
|
9581
9576
|
rangeStart = frameIndex;
|
|
9582
9577
|
} else if (!missing && rangeStart !== null) {
|
|
@@ -12566,7 +12561,7 @@ import {
|
|
|
12566
12561
|
readFileSync as readFileSync10,
|
|
12567
12562
|
readdirSync as readdirSync7,
|
|
12568
12563
|
rmSync as rmSync10,
|
|
12569
|
-
statSync as
|
|
12564
|
+
statSync as statSync8,
|
|
12570
12565
|
writeFileSync as writeFileSync11
|
|
12571
12566
|
} from "node:fs";
|
|
12572
12567
|
import { tmpdir } from "node:os";
|
|
@@ -12585,7 +12580,7 @@ import {
|
|
|
12585
12580
|
linkSync as linkSync2,
|
|
12586
12581
|
mkdirSync as mkdirSync12,
|
|
12587
12582
|
rmSync as rmSync9,
|
|
12588
|
-
statSync as
|
|
12583
|
+
statSync as statSync7,
|
|
12589
12584
|
writeFileSync as writeFileSync10
|
|
12590
12585
|
} from "node:fs";
|
|
12591
12586
|
import { renameWithRetry as renameWithRetry8 } from "@hyperframes/engine";
|
|
@@ -12655,7 +12650,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
12655
12650
|
}
|
|
12656
12651
|
async putBlob(blob) {
|
|
12657
12652
|
const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
|
|
12658
|
-
const sourceSize =
|
|
12653
|
+
const sourceSize = statSync7(blob.sourcePath).size;
|
|
12659
12654
|
if (sourceSize !== blob.sizeBytes) {
|
|
12660
12655
|
throw new PlanV2IntegrityError(
|
|
12661
12656
|
`published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
|
|
@@ -12969,7 +12964,7 @@ function publishBlobFor(absolutePath, digests) {
|
|
|
12969
12964
|
return {
|
|
12970
12965
|
sourcePath: absolutePath,
|
|
12971
12966
|
sha256: planFileSha256(absolutePath, digests),
|
|
12972
|
-
sizeBytes:
|
|
12967
|
+
sizeBytes: statSync8(absolutePath).size
|
|
12973
12968
|
};
|
|
12974
12969
|
}
|
|
12975
12970
|
async function putBlobs(publisher, blobs) {
|
|
@@ -13340,7 +13335,7 @@ function verifyBlob(planV2Dir, artifact) {
|
|
|
13340
13335
|
if (!existsSync22(sourcePath)) {
|
|
13341
13336
|
throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
|
|
13342
13337
|
}
|
|
13343
|
-
const stats =
|
|
13338
|
+
const stats = statSync8(sourcePath);
|
|
13344
13339
|
if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
|
|
13345
13340
|
throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
|
|
13346
13341
|
}
|
|
@@ -13433,7 +13428,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
|
13433
13428
|
for (const artifact of required) {
|
|
13434
13429
|
if (Object.hasOwn(remoteSources, artifact.path)) continue;
|
|
13435
13430
|
const path = join32(planDir, ...artifact.path.split("/"));
|
|
13436
|
-
if (!existsSync22(path) ||
|
|
13431
|
+
if (!existsSync22(path) || statSync8(path).size !== artifact.sizeBytes) {
|
|
13437
13432
|
throw new PlanV2IntegrityError(
|
|
13438
13433
|
`materialized artifact missing or truncated: ${artifact.path}`
|
|
13439
13434
|
);
|
|
@@ -13462,7 +13457,7 @@ import {
|
|
|
13462
13457
|
readFileSync as readFileSync11,
|
|
13463
13458
|
readdirSync as readdirSync8,
|
|
13464
13459
|
rmSync as rmSync11,
|
|
13465
|
-
statSync as
|
|
13460
|
+
statSync as statSync9
|
|
13466
13461
|
} from "node:fs";
|
|
13467
13462
|
import { localContainerInputArgs as localContainerInputArgs2 } from "@hyperframes/parsers/ff-binaries";
|
|
13468
13463
|
import { basename as basename6, dirname as dirname17, join as join33 } from "node:path";
|
|
@@ -13509,7 +13504,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
13509
13504
|
outputPath,
|
|
13510
13505
|
durationMs: Date.now() - start,
|
|
13511
13506
|
framesEncoded: plan.totalFrames,
|
|
13512
|
-
fileSize:
|
|
13507
|
+
fileSize: statSync9(outputPath).size
|
|
13513
13508
|
};
|
|
13514
13509
|
}
|
|
13515
13510
|
const format = plan.dimensions.format;
|
|
@@ -13556,7 +13551,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
13556
13551
|
});
|
|
13557
13552
|
}
|
|
13558
13553
|
}
|
|
13559
|
-
const fileSize = existsSync23(outputPath) ?
|
|
13554
|
+
const fileSize = existsSync23(outputPath) ? statSync9(outputPath).size : 0;
|
|
13560
13555
|
return {
|
|
13561
13556
|
...referenceBackgroundResult6(plan[REFERENCE_BACKGROUND_FIELD4]),
|
|
13562
13557
|
outputPath,
|
|
@@ -13755,7 +13750,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
13755
13750
|
mkdirSync14(outputPath, { recursive: true });
|
|
13756
13751
|
let globalIdx = 0;
|
|
13757
13752
|
for (const chunkDir of chunkPaths) {
|
|
13758
|
-
if (!
|
|
13753
|
+
if (!statSync9(chunkDir).isDirectory()) {
|
|
13759
13754
|
throw new Error(
|
|
13760
13755
|
`[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
|
|
13761
13756
|
);
|
|
@@ -13782,7 +13777,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
13782
13777
|
let fileSize = 0;
|
|
13783
13778
|
for (const name of readdirSync8(outputPath)) {
|
|
13784
13779
|
try {
|
|
13785
|
-
fileSize +=
|
|
13780
|
+
fileSize += statSync9(join33(outputPath, name)).size;
|
|
13786
13781
|
} catch {
|
|
13787
13782
|
}
|
|
13788
13783
|
}
|
|
@@ -14844,7 +14839,7 @@ function validateIntDimension(field, value) {
|
|
|
14844
14839
|
}
|
|
14845
14840
|
|
|
14846
14841
|
// src/services/distributed/projectHash.ts
|
|
14847
|
-
import { closeSync as closeSync5, openSync as openSync5, readdirSync as readdirSync10, readSync as readSync4, realpathSync as realpathSync2, statSync as
|
|
14842
|
+
import { closeSync as closeSync5, openSync as openSync5, readdirSync as readdirSync10, readSync as readSync4, realpathSync as realpathSync2, statSync as statSync10 } from "node:fs";
|
|
14848
14843
|
import { createHash as createHash10 } from "node:crypto";
|
|
14849
14844
|
import { join as join36, sep as sep6 } from "node:path";
|
|
14850
14845
|
import { isPrivateFileUnder as isPrivateFileUnder4, isStudioPrivatePath as isStudioPrivatePath4 } from "@hyperframes/core/safe-path";
|
|
@@ -14853,7 +14848,7 @@ var READ_CHUNK_BYTES = 256 * 1024;
|
|
|
14853
14848
|
var isPrivateSitePath = (relPath) => isStudioPrivatePath4(relPath);
|
|
14854
14849
|
function statEntry(full, relPath) {
|
|
14855
14850
|
try {
|
|
14856
|
-
return
|
|
14851
|
+
return statSync10(full);
|
|
14857
14852
|
} catch (err) {
|
|
14858
14853
|
throw new Error(`[listSiteFiles] cannot read ${relPath} (dangling symlink?)`, { cause: err });
|
|
14859
14854
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"buildId": "dev",
|
|
4
|
-
"sha256": "
|
|
4
|
+
"sha256": "82bb6f5b055041dbe4a42d8eae51c8d405236b4ae160e7c43bf13c2b6ea431af",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"iife": "hyperframe.runtime.iife.js",
|
|
7
7
|
"esm": "hyperframe.runtime.mjs"
|