@hyperframes/producer 0.9.103 → 0.9.106
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 +15 -24
- package/dist/distributed.js +35 -44
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +69 -69
- package/dist/index.js +45 -54
- package/dist/public-server.js +34 -43
- package/dist/utils/paths.d.ts +2 -6
- package/package.json +8 -8
package/dist/compileWorker.js
CHANGED
|
@@ -27,9 +27,10 @@ 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
|
+
import { compositionRootSize } from "@hyperframes/parsers";
|
|
33
34
|
|
|
34
35
|
// src/services/bundledScripts.ts
|
|
35
36
|
import { existsSync, readFileSync } from "node:fs";
|
|
@@ -308,15 +309,12 @@ import {
|
|
|
308
309
|
relative as nodeRelative,
|
|
309
310
|
isAbsolute as nodeIsAbsolute
|
|
310
311
|
} from "node:path";
|
|
311
|
-
import { statSync } from "node:fs";
|
|
312
312
|
import { fileURLToPath } from "node:url";
|
|
313
313
|
import { isPrivateFileUnder, isSafePath, isStudioPrivatePath } from "@hyperframes/core/safe-path";
|
|
314
314
|
import {
|
|
315
|
-
isCopiedOutsideFileType,
|
|
316
|
-
isPrivateOutsideFile,
|
|
317
|
-
isUploadedOutsideFileType,
|
|
318
315
|
leftOutWarning,
|
|
319
|
-
linksOutside
|
|
316
|
+
linksOutside,
|
|
317
|
+
outsideLinkRefusal
|
|
320
318
|
} from "@hyperframes/studio-server/outside-file";
|
|
321
319
|
import { realFilePath } from "@hyperframes/studio-server/safe-path";
|
|
322
320
|
var DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
@@ -337,15 +335,9 @@ function escapesAssetRoot(path, assetRoot) {
|
|
|
337
335
|
return assetRoot !== void 0 && !isSafePath(assetRoot, path);
|
|
338
336
|
}
|
|
339
337
|
function outsideAssetRefusal(projectDir2, path, policy = {}) {
|
|
340
|
-
if (
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
}
|
|
344
|
-
if (isPrivateOutsideFile(projectDir2, path)) return "blocklisted";
|
|
345
|
-
const folder = statSync(path, { throwIfNoEntry: false })?.isDirectory();
|
|
346
|
-
if (folder || isUploadedOutsideFileType(path)) return null;
|
|
347
|
-
if (!isCopiedOutsideFileType(path)) return "file_type";
|
|
348
|
-
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;
|
|
349
341
|
}
|
|
350
342
|
var leftOutOfRender = (file, reference, reason) => leftOutWarning(file, reference, reason, "render");
|
|
351
343
|
function refusesOutsideLink(projectDir2, path, warn, policy = {}) {
|
|
@@ -559,7 +551,7 @@ import {
|
|
|
559
551
|
|
|
560
552
|
// src/services/animatedGifPrep.ts
|
|
561
553
|
import { createHash, randomUUID } from "node:crypto";
|
|
562
|
-
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";
|
|
563
555
|
import { dirname, isAbsolute, join as join3, resolve } from "node:path";
|
|
564
556
|
import { parseHTML as parseHTML2 } from "@hyperframes/parsers/linkedom";
|
|
565
557
|
import { parseAnimatedGifMetadata } from "@hyperframes/core";
|
|
@@ -645,7 +637,7 @@ function resolveLocalImageSourcePath(src, options2) {
|
|
|
645
637
|
}
|
|
646
638
|
function isUsableFile(path) {
|
|
647
639
|
try {
|
|
648
|
-
const stat =
|
|
640
|
+
const stat = statSync(path);
|
|
649
641
|
return stat.isFile() && stat.size > 0;
|
|
650
642
|
} catch {
|
|
651
643
|
return false;
|
|
@@ -795,7 +787,7 @@ async function ensurePreparedWebm(input) {
|
|
|
795
787
|
if (!isUsableFile(tmpPath)) {
|
|
796
788
|
throw new Error("Animated GIF transcode produced an empty output");
|
|
797
789
|
}
|
|
798
|
-
if (
|
|
790
|
+
if (statSync(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP) {
|
|
799
791
|
throw new Error("Animated GIF transcode reached its output size limit");
|
|
800
792
|
}
|
|
801
793
|
if (!isUsableFile(input.cachePath)) {
|
|
@@ -931,7 +923,7 @@ import {
|
|
|
931
923
|
readFileSync as readFileSync3,
|
|
932
924
|
readSync,
|
|
933
925
|
rmSync as rmSync2,
|
|
934
|
-
statSync as
|
|
926
|
+
statSync as statSync2,
|
|
935
927
|
writeFileSync
|
|
936
928
|
} from "node:fs";
|
|
937
929
|
import { dirname as dirname2, join as join4, resolve as resolve2 } from "node:path";
|
|
@@ -1187,7 +1179,7 @@ function resolveImageSource(src, options2) {
|
|
|
1187
1179
|
}
|
|
1188
1180
|
function isUsableFile2(path) {
|
|
1189
1181
|
try {
|
|
1190
|
-
return
|
|
1182
|
+
return statSync2(path).size > 0;
|
|
1191
1183
|
} catch {
|
|
1192
1184
|
return false;
|
|
1193
1185
|
}
|
|
@@ -1208,7 +1200,7 @@ async function ensurePreparedJpeg(source, cachePath, outputPath, options2) {
|
|
|
1208
1200
|
signal: options2.signal
|
|
1209
1201
|
});
|
|
1210
1202
|
if (!isUsableFile2(tmpPath)) throw new Error("conversion produced an empty file");
|
|
1211
|
-
if (
|
|
1203
|
+
if (statSync2(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP2) {
|
|
1212
1204
|
throw new Error("conversion reached its output size limit");
|
|
1213
1205
|
}
|
|
1214
1206
|
renameWithRetry2(tmpPath, cachePath);
|
|
@@ -2819,7 +2811,7 @@ async function localFontDataUri(localPath, projectDir2, assetRoot, dataUriByAbso
|
|
|
2819
2811
|
if (dataUriByAbsolutePath.has(absPath)) return dataUriByAbsolutePath.get(absPath);
|
|
2820
2812
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
2821
2813
|
try {
|
|
2822
|
-
if (!reserve(Math.ceil(
|
|
2814
|
+
if (!reserve(Math.ceil(statSync3(absPath).size / 3) * 4 + 64)) {
|
|
2823
2815
|
dataUriByAbsolutePath.set(absPath, void 0);
|
|
2824
2816
|
return void 0;
|
|
2825
2817
|
}
|
|
@@ -3204,8 +3196,7 @@ async function compileWithAssets(projectDir2, htmlPath2, downloadDir2, options2,
|
|
|
3204
3196
|
}
|
|
3205
3197
|
const { document: document2 } = parseHTML4(html);
|
|
3206
3198
|
const rootEl = document2.querySelector("[data-composition-id]");
|
|
3207
|
-
const width
|
|
3208
|
-
const height = rootEl ? parseInt(rootEl.getAttribute("data-height") || "1920", 10) : 1920;
|
|
3199
|
+
const { width, height } = compositionRootSize(rootEl);
|
|
3209
3200
|
const staticDuration = rootEl ? parseStrictFiniteTimingNumber(rootEl.getAttribute("data-duration")) ?? parseStrictFiniteTimingNumber(rootEl.getAttribute("data-composition-duration")) ?? 0 : 0;
|
|
3210
3201
|
return {
|
|
3211
3202
|
html,
|
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
|
|
@@ -396,7 +387,7 @@ import {
|
|
|
396
387
|
import {
|
|
397
388
|
existsSync as existsSync2,
|
|
398
389
|
realpathSync,
|
|
399
|
-
statSync
|
|
390
|
+
statSync,
|
|
400
391
|
createReadStream,
|
|
401
392
|
openSync,
|
|
402
393
|
fstatSync,
|
|
@@ -1034,7 +1025,7 @@ function openRegularFile(filePath) {
|
|
|
1034
1025
|
} catch (error) {
|
|
1035
1026
|
if (error instanceof Error && "code" in error && NO_FILE_AT_NAME.has(String(error.code)))
|
|
1036
1027
|
return null;
|
|
1037
|
-
if (!
|
|
1028
|
+
if (!statSync(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
1038
1029
|
throw error;
|
|
1039
1030
|
}
|
|
1040
1031
|
let accepted = false;
|
|
@@ -2543,9 +2534,10 @@ import {
|
|
|
2543
2534
|
stylesheetLinkMatches
|
|
2544
2535
|
} from "@hyperframes/parsers/css-url-scans";
|
|
2545
2536
|
import { createHash as createHash5 } from "node:crypto";
|
|
2546
|
-
import { createReadStream as createReadStream2, existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync5, statSync as
|
|
2537
|
+
import { createReadStream as createReadStream2, existsSync as existsSync7, mkdirSync as mkdirSync4, readFileSync as readFileSync5, statSync as statSync4 } from "fs";
|
|
2547
2538
|
import { join as join9, dirname as dirname7, resolve as resolve6, basename as basename3, relative as relative2, sep as sep3 } from "path";
|
|
2548
2539
|
import { parseHTML as parseHTML5 } from "@hyperframes/parsers/linkedom";
|
|
2540
|
+
import { compositionRootSize } from "@hyperframes/parsers";
|
|
2549
2541
|
|
|
2550
2542
|
// src/services/bundledScripts.ts
|
|
2551
2543
|
import { existsSync as existsSync4, readFileSync as readFileSync2 } from "node:fs";
|
|
@@ -2831,7 +2823,7 @@ import {
|
|
|
2831
2823
|
|
|
2832
2824
|
// src/services/animatedGifPrep.ts
|
|
2833
2825
|
import { createHash as createHash3, randomUUID } from "node:crypto";
|
|
2834
|
-
import { copyFileSync as copyFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync as rmSync2, statSync as
|
|
2826
|
+
import { copyFileSync as copyFileSync2, existsSync as existsSync5, mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync as rmSync2, statSync as statSync2 } from "node:fs";
|
|
2835
2827
|
import { dirname as dirname4, isAbsolute as isAbsolute2, join as join6, resolve as resolve4 } from "node:path";
|
|
2836
2828
|
import { parseHTML as parseHTML3 } from "@hyperframes/parsers/linkedom";
|
|
2837
2829
|
import { parseAnimatedGifMetadata } from "@hyperframes/core";
|
|
@@ -2894,7 +2886,7 @@ function resolveLocalImageSourcePath(src, options) {
|
|
|
2894
2886
|
}
|
|
2895
2887
|
function isUsableFile(path) {
|
|
2896
2888
|
try {
|
|
2897
|
-
const stat =
|
|
2889
|
+
const stat = statSync2(path);
|
|
2898
2890
|
return stat.isFile() && stat.size > 0;
|
|
2899
2891
|
} catch {
|
|
2900
2892
|
return false;
|
|
@@ -3044,7 +3036,7 @@ async function ensurePreparedWebm(input) {
|
|
|
3044
3036
|
if (!isUsableFile(tmpPath)) {
|
|
3045
3037
|
throw new Error("Animated GIF transcode produced an empty output");
|
|
3046
3038
|
}
|
|
3047
|
-
if (
|
|
3039
|
+
if (statSync2(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP) {
|
|
3048
3040
|
throw new Error("Animated GIF transcode reached its output size limit");
|
|
3049
3041
|
}
|
|
3050
3042
|
if (!isUsableFile(input.cachePath)) {
|
|
@@ -3180,7 +3172,7 @@ import {
|
|
|
3180
3172
|
readFileSync as readFileSync4,
|
|
3181
3173
|
readSync,
|
|
3182
3174
|
rmSync as rmSync3,
|
|
3183
|
-
statSync as
|
|
3175
|
+
statSync as statSync3,
|
|
3184
3176
|
writeFileSync as writeFileSync2
|
|
3185
3177
|
} from "node:fs";
|
|
3186
3178
|
import { dirname as dirname5, join as join7, resolve as resolve5 } from "node:path";
|
|
@@ -3436,7 +3428,7 @@ function resolveImageSource(src, options) {
|
|
|
3436
3428
|
}
|
|
3437
3429
|
function isUsableFile2(path) {
|
|
3438
3430
|
try {
|
|
3439
|
-
return
|
|
3431
|
+
return statSync3(path).size > 0;
|
|
3440
3432
|
} catch {
|
|
3441
3433
|
return false;
|
|
3442
3434
|
}
|
|
@@ -3457,7 +3449,7 @@ async function ensurePreparedJpeg(source, cachePath, outputPath, options) {
|
|
|
3457
3449
|
signal: options.signal
|
|
3458
3450
|
});
|
|
3459
3451
|
if (!isUsableFile2(tmpPath)) throw new Error("conversion produced an empty file");
|
|
3460
|
-
if (
|
|
3452
|
+
if (statSync3(tmpPath).size >= FFMPEG_SELF_OUTPUT_BYTES_CAP2) {
|
|
3461
3453
|
throw new Error("conversion reached its output size limit");
|
|
3462
3454
|
}
|
|
3463
3455
|
renameWithRetry3(tmpPath, cachePath);
|
|
@@ -5132,7 +5124,7 @@ async function localFontDataUri(localPath, projectDir, assetRoot, dataUriByAbsol
|
|
|
5132
5124
|
if (dataUriByAbsolutePath.has(absPath)) return dataUriByAbsolutePath.get(absPath);
|
|
5133
5125
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
5134
5126
|
try {
|
|
5135
|
-
if (!reserve(Math.ceil(
|
|
5127
|
+
if (!reserve(Math.ceil(statSync4(absPath).size / 3) * 4 + 64)) {
|
|
5136
5128
|
dataUriByAbsolutePath.set(absPath, void 0);
|
|
5137
5129
|
return void 0;
|
|
5138
5130
|
}
|
|
@@ -5517,8 +5509,7 @@ async function compileWithAssets(projectDir, htmlPath, downloadDir, options, ass
|
|
|
5517
5509
|
}
|
|
5518
5510
|
const { document: document2 } = parseHTML5(html);
|
|
5519
5511
|
const rootEl = document2.querySelector("[data-composition-id]");
|
|
5520
|
-
const width
|
|
5521
|
-
const height = rootEl ? parseInt(rootEl.getAttribute("data-height") || "1920", 10) : 1920;
|
|
5512
|
+
const { width, height } = compositionRootSize(rootEl);
|
|
5522
5513
|
const staticDuration = rootEl ? parseStrictFiniteTimingNumber(rootEl.getAttribute("data-duration")) ?? parseStrictFiniteTimingNumber(rootEl.getAttribute("data-composition-duration")) ?? 0 : 0;
|
|
5523
5514
|
return {
|
|
5524
5515
|
html,
|
|
@@ -9104,7 +9095,7 @@ import {
|
|
|
9104
9095
|
readdirSync as readdirSync2,
|
|
9105
9096
|
readFileSync as readFileSync6,
|
|
9106
9097
|
rmSync as rmSync5,
|
|
9107
|
-
statSync as
|
|
9098
|
+
statSync as statSync5,
|
|
9108
9099
|
writeFileSync as writeFileSync5
|
|
9109
9100
|
} from "node:fs";
|
|
9110
9101
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
@@ -9233,7 +9224,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
|
|
|
9233
9224
|
const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
|
|
9234
9225
|
if (failure) return failure;
|
|
9235
9226
|
}
|
|
9236
|
-
const fileSize = existsSync14(outputPath) ?
|
|
9227
|
+
const fileSize = existsSync14(outputPath) ? statSync5(outputPath).size : 0;
|
|
9237
9228
|
return {
|
|
9238
9229
|
success: true,
|
|
9239
9230
|
outputPath,
|
|
@@ -9495,7 +9486,7 @@ function sampleDirectoryBytes(dir) {
|
|
|
9495
9486
|
for (const name of entries) {
|
|
9496
9487
|
const full = join20(current, name);
|
|
9497
9488
|
try {
|
|
9498
|
-
const st =
|
|
9489
|
+
const st = statSync6(full);
|
|
9499
9490
|
if (st.isDirectory()) {
|
|
9500
9491
|
stack.push(full);
|
|
9501
9492
|
} else if (st.isFile()) {
|
|
@@ -9576,7 +9567,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
|
|
|
9576
9567
|
let rangeStart = null;
|
|
9577
9568
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
9578
9569
|
const framePath = join20(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
9579
|
-
const missing = !existsSync15(framePath) ||
|
|
9570
|
+
const missing = !existsSync15(framePath) || statSync6(framePath).size <= 8;
|
|
9580
9571
|
if (missing && rangeStart === null) {
|
|
9581
9572
|
rangeStart = frameIndex;
|
|
9582
9573
|
} else if (!missing && rangeStart !== null) {
|
|
@@ -12566,7 +12557,7 @@ import {
|
|
|
12566
12557
|
readFileSync as readFileSync10,
|
|
12567
12558
|
readdirSync as readdirSync7,
|
|
12568
12559
|
rmSync as rmSync10,
|
|
12569
|
-
statSync as
|
|
12560
|
+
statSync as statSync8,
|
|
12570
12561
|
writeFileSync as writeFileSync11
|
|
12571
12562
|
} from "node:fs";
|
|
12572
12563
|
import { tmpdir } from "node:os";
|
|
@@ -12585,7 +12576,7 @@ import {
|
|
|
12585
12576
|
linkSync as linkSync2,
|
|
12586
12577
|
mkdirSync as mkdirSync12,
|
|
12587
12578
|
rmSync as rmSync9,
|
|
12588
|
-
statSync as
|
|
12579
|
+
statSync as statSync7,
|
|
12589
12580
|
writeFileSync as writeFileSync10
|
|
12590
12581
|
} from "node:fs";
|
|
12591
12582
|
import { renameWithRetry as renameWithRetry8 } from "@hyperframes/engine";
|
|
@@ -12655,7 +12646,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
12655
12646
|
}
|
|
12656
12647
|
async putBlob(blob) {
|
|
12657
12648
|
const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
|
|
12658
|
-
const sourceSize =
|
|
12649
|
+
const sourceSize = statSync7(blob.sourcePath).size;
|
|
12659
12650
|
if (sourceSize !== blob.sizeBytes) {
|
|
12660
12651
|
throw new PlanV2IntegrityError(
|
|
12661
12652
|
`published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
|
|
@@ -12969,7 +12960,7 @@ function publishBlobFor(absolutePath, digests) {
|
|
|
12969
12960
|
return {
|
|
12970
12961
|
sourcePath: absolutePath,
|
|
12971
12962
|
sha256: planFileSha256(absolutePath, digests),
|
|
12972
|
-
sizeBytes:
|
|
12963
|
+
sizeBytes: statSync8(absolutePath).size
|
|
12973
12964
|
};
|
|
12974
12965
|
}
|
|
12975
12966
|
async function putBlobs(publisher, blobs) {
|
|
@@ -13340,7 +13331,7 @@ function verifyBlob(planV2Dir, artifact) {
|
|
|
13340
13331
|
if (!existsSync22(sourcePath)) {
|
|
13341
13332
|
throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
|
|
13342
13333
|
}
|
|
13343
|
-
const stats =
|
|
13334
|
+
const stats = statSync8(sourcePath);
|
|
13344
13335
|
if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
|
|
13345
13336
|
throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
|
|
13346
13337
|
}
|
|
@@ -13433,7 +13424,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
|
13433
13424
|
for (const artifact of required) {
|
|
13434
13425
|
if (Object.hasOwn(remoteSources, artifact.path)) continue;
|
|
13435
13426
|
const path = join32(planDir, ...artifact.path.split("/"));
|
|
13436
|
-
if (!existsSync22(path) ||
|
|
13427
|
+
if (!existsSync22(path) || statSync8(path).size !== artifact.sizeBytes) {
|
|
13437
13428
|
throw new PlanV2IntegrityError(
|
|
13438
13429
|
`materialized artifact missing or truncated: ${artifact.path}`
|
|
13439
13430
|
);
|
|
@@ -13462,7 +13453,7 @@ import {
|
|
|
13462
13453
|
readFileSync as readFileSync11,
|
|
13463
13454
|
readdirSync as readdirSync8,
|
|
13464
13455
|
rmSync as rmSync11,
|
|
13465
|
-
statSync as
|
|
13456
|
+
statSync as statSync9
|
|
13466
13457
|
} from "node:fs";
|
|
13467
13458
|
import { localContainerInputArgs as localContainerInputArgs2 } from "@hyperframes/parsers/ff-binaries";
|
|
13468
13459
|
import { basename as basename6, dirname as dirname17, join as join33 } from "node:path";
|
|
@@ -13509,7 +13500,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
13509
13500
|
outputPath,
|
|
13510
13501
|
durationMs: Date.now() - start,
|
|
13511
13502
|
framesEncoded: plan.totalFrames,
|
|
13512
|
-
fileSize:
|
|
13503
|
+
fileSize: statSync9(outputPath).size
|
|
13513
13504
|
};
|
|
13514
13505
|
}
|
|
13515
13506
|
const format = plan.dimensions.format;
|
|
@@ -13556,7 +13547,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
13556
13547
|
});
|
|
13557
13548
|
}
|
|
13558
13549
|
}
|
|
13559
|
-
const fileSize = existsSync23(outputPath) ?
|
|
13550
|
+
const fileSize = existsSync23(outputPath) ? statSync9(outputPath).size : 0;
|
|
13560
13551
|
return {
|
|
13561
13552
|
...referenceBackgroundResult6(plan[REFERENCE_BACKGROUND_FIELD4]),
|
|
13562
13553
|
outputPath,
|
|
@@ -13755,7 +13746,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
13755
13746
|
mkdirSync14(outputPath, { recursive: true });
|
|
13756
13747
|
let globalIdx = 0;
|
|
13757
13748
|
for (const chunkDir of chunkPaths) {
|
|
13758
|
-
if (!
|
|
13749
|
+
if (!statSync9(chunkDir).isDirectory()) {
|
|
13759
13750
|
throw new Error(
|
|
13760
13751
|
`[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
|
|
13761
13752
|
);
|
|
@@ -13782,7 +13773,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
13782
13773
|
let fileSize = 0;
|
|
13783
13774
|
for (const name of readdirSync8(outputPath)) {
|
|
13784
13775
|
try {
|
|
13785
|
-
fileSize +=
|
|
13776
|
+
fileSize += statSync9(join33(outputPath, name)).size;
|
|
13786
13777
|
} catch {
|
|
13787
13778
|
}
|
|
13788
13779
|
}
|
|
@@ -14844,7 +14835,7 @@ function validateIntDimension(field, value) {
|
|
|
14844
14835
|
}
|
|
14845
14836
|
|
|
14846
14837
|
// src/services/distributed/projectHash.ts
|
|
14847
|
-
import { closeSync as closeSync5, openSync as openSync5, readdirSync as readdirSync10, readSync as readSync4, realpathSync as realpathSync2, statSync as
|
|
14838
|
+
import { closeSync as closeSync5, openSync as openSync5, readdirSync as readdirSync10, readSync as readSync4, realpathSync as realpathSync2, statSync as statSync10 } from "node:fs";
|
|
14848
14839
|
import { createHash as createHash10 } from "node:crypto";
|
|
14849
14840
|
import { join as join36, sep as sep6 } from "node:path";
|
|
14850
14841
|
import { isPrivateFileUnder as isPrivateFileUnder4, isStudioPrivatePath as isStudioPrivatePath4 } from "@hyperframes/core/safe-path";
|
|
@@ -14853,7 +14844,7 @@ var READ_CHUNK_BYTES = 256 * 1024;
|
|
|
14853
14844
|
var isPrivateSitePath = (relPath) => isStudioPrivatePath4(relPath);
|
|
14854
14845
|
function statEntry(full, relPath) {
|
|
14855
14846
|
try {
|
|
14856
|
-
return
|
|
14847
|
+
return statSync10(full);
|
|
14857
14848
|
} catch (err) {
|
|
14858
14849
|
throw new Error(`[listSiteFiles] cannot read ${relPath} (dangling symlink?)`, { cause: err });
|
|
14859
14850
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"buildId": "dev",
|
|
4
|
-
"sha256": "
|
|
4
|
+
"sha256": "380fcd392d15e1bfcdcc4d990cef42657bc58071aad326a92d379fe0af52a663",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"iife": "hyperframe.runtime.iife.js",
|
|
7
7
|
"esm": "hyperframe.runtime.mjs"
|