@hyperframes/producer 0.9.55 → 0.9.58
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.d.ts +1 -1
- package/dist/distributed.js +316 -119
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +76 -76
- package/dist/index.js +456 -123
- package/dist/logger.d.ts +1 -1
- package/dist/public-server.js +448 -120
- package/dist/services/assetMediaType.d.ts +1 -1
- package/dist/services/distributed/projectHash.d.ts +8 -2
- package/dist/services/htmlTagScans.d.ts +57 -0
- package/dist/services/render/stages/captureHdrResources.d.ts +19 -4
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -29,7 +29,296 @@ import {
|
|
|
29
29
|
toFps as toFps2
|
|
30
30
|
} from "@hyperframes/core";
|
|
31
31
|
import { HF_AUDIO_GROUP_TAG } from "@hyperframes/core/audio-groups";
|
|
32
|
-
|
|
32
|
+
|
|
33
|
+
// src/services/htmlTagScans.ts
|
|
34
|
+
function forwardFinder(text, pattern) {
|
|
35
|
+
let start = -1;
|
|
36
|
+
let found = null;
|
|
37
|
+
return (from) => {
|
|
38
|
+
if (start < 0 || from < start || found !== null && from > found.index) {
|
|
39
|
+
start = from;
|
|
40
|
+
pattern.lastIndex = from;
|
|
41
|
+
found = pattern.exec(text);
|
|
42
|
+
}
|
|
43
|
+
return found;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
function indexFinder(text, pattern) {
|
|
47
|
+
const find = forwardFinder(text, pattern);
|
|
48
|
+
return (from) => find(from)?.index ?? -1;
|
|
49
|
+
}
|
|
50
|
+
var isLetter = (code) => code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
51
|
+
var isDigit = (code) => code >= 48 && code <= 57;
|
|
52
|
+
var isNameChar = (code) => isLetter(code) || isDigit(code) || code === 45;
|
|
53
|
+
var isWordChar = (code) => isLetter(code) || isDigit(code) || code === 95;
|
|
54
|
+
function nameRunEnd(text, from) {
|
|
55
|
+
let end = from;
|
|
56
|
+
while (isNameChar(text.charCodeAt(end))) end++;
|
|
57
|
+
return end;
|
|
58
|
+
}
|
|
59
|
+
function tagNameEnd(text, open2) {
|
|
60
|
+
for (let end = nameRunEnd(text, open2 + 2); end >= open2 + 2; end--) {
|
|
61
|
+
if (isWordChar(text.charCodeAt(end - 1)) !== isWordChar(text.charCodeAt(end))) return end;
|
|
62
|
+
}
|
|
63
|
+
return -1;
|
|
64
|
+
}
|
|
65
|
+
function* inlineScriptBlocks(html) {
|
|
66
|
+
const opener = /<script\b/gi;
|
|
67
|
+
const closer = /<\/script>/gi;
|
|
68
|
+
for (let open2 = opener.exec(html); open2; open2 = opener.exec(html)) {
|
|
69
|
+
const attrsStart = open2.index + open2[0].length;
|
|
70
|
+
const gt = html.indexOf(">", attrsStart);
|
|
71
|
+
if (gt < 0) return;
|
|
72
|
+
closer.lastIndex = gt + 1;
|
|
73
|
+
const close = closer.exec(html);
|
|
74
|
+
if (!close) return;
|
|
75
|
+
yield { attrs: html.slice(attrsStart, gt), body: html.slice(gt + 1, close.index) };
|
|
76
|
+
opener.lastIndex = close.index + close[0].length;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function removeDelimitedRuns(source, start, end) {
|
|
80
|
+
let out = "";
|
|
81
|
+
let kept = 0;
|
|
82
|
+
for (let open2 = source.indexOf(start); open2 >= 0; open2 = source.indexOf(start, kept)) {
|
|
83
|
+
const close = source.indexOf(end, open2 + start.length);
|
|
84
|
+
if (close < 0) break;
|
|
85
|
+
out += source.slice(kept, open2);
|
|
86
|
+
kept = close + end.length;
|
|
87
|
+
}
|
|
88
|
+
return out + source.slice(kept);
|
|
89
|
+
}
|
|
90
|
+
function gsapDistFile(value) {
|
|
91
|
+
let dist = -1;
|
|
92
|
+
const distPattern = /\/dist\//gi;
|
|
93
|
+
for (let m = distPattern.exec(value); m; m = distPattern.exec(value)) {
|
|
94
|
+
if (m.index + 6 < value.length) dist = m.index;
|
|
95
|
+
distPattern.lastIndex = m.index + 1;
|
|
96
|
+
}
|
|
97
|
+
const gsap = dist < 0 ? null : /gsap/i.exec(value);
|
|
98
|
+
return gsap && gsap.index + 4 <= dist ? value.slice(dist + 6) : void 0;
|
|
99
|
+
}
|
|
100
|
+
function lastGsapMatch(html, finders, tagStart, gt) {
|
|
101
|
+
const { nextSrc, nextQuote, nextGt } = finders;
|
|
102
|
+
let match;
|
|
103
|
+
for (let src = nextSrc(tagStart); src && src.index < gt; src = nextSrc(src.index + 1)) {
|
|
104
|
+
const valueStart = src.index + 5;
|
|
105
|
+
const close = nextQuote(valueStart);
|
|
106
|
+
const end = close < 0 ? -1 : nextGt(close + 1);
|
|
107
|
+
if (end < 0) return { match, laterTagsFail: true };
|
|
108
|
+
const file = gsapDistFile(html.slice(valueStart, close));
|
|
109
|
+
if (file !== void 0) match = { valueStart, close, end, file };
|
|
110
|
+
}
|
|
111
|
+
return { match, laterTagsFail: false };
|
|
112
|
+
}
|
|
113
|
+
function replaceGsapDistScripts(html, replace) {
|
|
114
|
+
const opener = /<script\b/gi;
|
|
115
|
+
const finders = {
|
|
116
|
+
nextSrc: forwardFinder(html, /\bsrc=["']/gi),
|
|
117
|
+
nextQuote: indexFinder(html, /["']/g),
|
|
118
|
+
nextGt: indexFinder(html, />/g)
|
|
119
|
+
};
|
|
120
|
+
let out = "";
|
|
121
|
+
let kept = 0;
|
|
122
|
+
for (let open2 = opener.exec(html); open2; open2 = opener.exec(html)) {
|
|
123
|
+
const gt = finders.nextGt(open2.index);
|
|
124
|
+
if (gt < 0) break;
|
|
125
|
+
const { match, laterTagsFail } = lastGsapMatch(html, finders, open2.index, gt);
|
|
126
|
+
if (match) {
|
|
127
|
+
const { valueStart, close, end, file } = match;
|
|
128
|
+
const full = html.slice(open2.index, end + 1);
|
|
129
|
+
const src = html.slice(valueStart, close);
|
|
130
|
+
out += html.slice(kept, open2.index);
|
|
131
|
+
out += replace(
|
|
132
|
+
full,
|
|
133
|
+
html.slice(open2.index, valueStart),
|
|
134
|
+
src,
|
|
135
|
+
file,
|
|
136
|
+
html.slice(close, end + 1)
|
|
137
|
+
);
|
|
138
|
+
kept = end + 1;
|
|
139
|
+
}
|
|
140
|
+
if (laterTagsFail) break;
|
|
141
|
+
opener.lastIndex = match ? kept : gt;
|
|
142
|
+
}
|
|
143
|
+
return out + html.slice(kept);
|
|
144
|
+
}
|
|
145
|
+
function removeSpanPerTag(html, opener, spanIn) {
|
|
146
|
+
const nextGt = indexFinder(html, />/g);
|
|
147
|
+
let out = "";
|
|
148
|
+
let kept = 0;
|
|
149
|
+
for (let open2 = opener.exec(html); open2; open2 = opener.exec(html)) {
|
|
150
|
+
const attrsStart = open2.index + open2[0].length;
|
|
151
|
+
const gt = nextGt(attrsStart);
|
|
152
|
+
const span = spanIn(attrsStart, gt < 0 ? html.length : gt);
|
|
153
|
+
if (span) {
|
|
154
|
+
out += html.slice(kept, span[0]);
|
|
155
|
+
kept = span[1];
|
|
156
|
+
} else if (gt < 0) break;
|
|
157
|
+
opener.lastIndex = span ? kept : gt;
|
|
158
|
+
}
|
|
159
|
+
return out + html.slice(kept);
|
|
160
|
+
}
|
|
161
|
+
function stripCrossoriginAttr(html, tagName) {
|
|
162
|
+
const nextQuote = indexFinder(html, /["']/g);
|
|
163
|
+
const nextAttr = forwardFinder(html, /\scrossorigin/gi);
|
|
164
|
+
return removeSpanPerTag(html, new RegExp(`<${tagName}\\b`, "gi"), (attrsStart, tagEnd) => {
|
|
165
|
+
let last = -1;
|
|
166
|
+
for (let at = nextAttr(attrsStart); at && at.index < tagEnd; at = nextAttr(at.index + 12)) {
|
|
167
|
+
last = at.index;
|
|
168
|
+
}
|
|
169
|
+
if (last < 0) return void 0;
|
|
170
|
+
const nameEnd = last + 12;
|
|
171
|
+
const quote = html[nameEnd + 1];
|
|
172
|
+
const quoted = html[nameEnd] === "=" && (quote === '"' || quote === "'");
|
|
173
|
+
const close = quoted ? nextQuote(nameEnd + 2) : -1;
|
|
174
|
+
return [last, close < 0 ? nameEnd : close + 1];
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
function stripPreloadNone(html) {
|
|
178
|
+
const nextAttr = forwardFinder(html, /(?<!\s)\s+preload\s*=\s*["']none["']/gi);
|
|
179
|
+
return removeSpanPerTag(html, /<(?:video|audio)\b/gi, (attrsStart, tagEnd) => {
|
|
180
|
+
const attr = nextAttr(attrsStart);
|
|
181
|
+
return attr && attr.index < tagEnd ? [attr.index, attr.index + attr[0].length] : void 0;
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
var REMOTE_SRC_TAGS = {
|
|
185
|
+
media: { opener: "<(?:video|audio)\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
|
|
186
|
+
source: { opener: "<source\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
|
|
187
|
+
img: { opener: "<img\\b", attr: /(?<![\w-])src\s*=\s*["'](https?:\/\/)/gi }
|
|
188
|
+
};
|
|
189
|
+
function remoteSrcUrls(html, tag) {
|
|
190
|
+
const opener = new RegExp(REMOTE_SRC_TAGS[tag].opener, "gi");
|
|
191
|
+
const nextAttr = forwardFinder(html, new RegExp(REMOTE_SRC_TAGS[tag].attr));
|
|
192
|
+
const nextGt = indexFinder(html, />/g);
|
|
193
|
+
const nextQuote = indexFinder(html, /["']/g);
|
|
194
|
+
const urls = [];
|
|
195
|
+
for (let open2 = opener.exec(html); open2; open2 = opener.exec(html)) {
|
|
196
|
+
const attrsStart = open2.index + open2[0].length;
|
|
197
|
+
const gt = nextGt(attrsStart);
|
|
198
|
+
if (gt < 0) break;
|
|
199
|
+
let resumeAt = gt;
|
|
200
|
+
for (let attr = nextAttr(attrsStart); attr && attr.index < gt; attr = nextAttr(attr.index + 1)) {
|
|
201
|
+
const urlRest = attr.index + attr[0].length;
|
|
202
|
+
const close = nextQuote(urlRest);
|
|
203
|
+
if (close < 0) return urls;
|
|
204
|
+
if (close === urlRest) continue;
|
|
205
|
+
const end = nextGt(close + 1);
|
|
206
|
+
if (end < 0) return urls;
|
|
207
|
+
urls.push(html.slice(urlRest - attr[1].length, close));
|
|
208
|
+
resumeAt = end + 1;
|
|
209
|
+
break;
|
|
210
|
+
}
|
|
211
|
+
opener.lastIndex = resumeAt;
|
|
212
|
+
}
|
|
213
|
+
return urls;
|
|
214
|
+
}
|
|
215
|
+
function removeScriptAndStyleBlocks(markup) {
|
|
216
|
+
const opener = /<(script|style)\b/gi;
|
|
217
|
+
const nextGt = indexFinder(markup, />/g);
|
|
218
|
+
const closers = {
|
|
219
|
+
script: forwardFinder(markup, /<\/script>/gi),
|
|
220
|
+
style: forwardFinder(markup, /<\/style>/gi)
|
|
221
|
+
};
|
|
222
|
+
let out = "";
|
|
223
|
+
let kept = 0;
|
|
224
|
+
for (let open2 = opener.exec(markup); open2; open2 = opener.exec(markup)) {
|
|
225
|
+
const gt = nextGt(open2.index + open2[0].length);
|
|
226
|
+
if (gt < 0) break;
|
|
227
|
+
const close = closers[open2[1].toLowerCase()](gt + 1);
|
|
228
|
+
if (!close) continue;
|
|
229
|
+
out += markup.slice(kept, open2.index);
|
|
230
|
+
kept = close.index + close[0].length;
|
|
231
|
+
opener.lastIndex = kept;
|
|
232
|
+
}
|
|
233
|
+
return out + markup.slice(kept);
|
|
234
|
+
}
|
|
235
|
+
var VOID_TAG = /(img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b/iy;
|
|
236
|
+
function countedTagAt(markup, open2, nextGt) {
|
|
237
|
+
const first = markup.charCodeAt(open2 + 1);
|
|
238
|
+
if (first === 47 && isLetter(markup.charCodeAt(open2 + 2))) {
|
|
239
|
+
const end = nameRunEnd(markup, open2 + 3);
|
|
240
|
+
return { name: markup.slice(open2 + 2, end), end };
|
|
241
|
+
}
|
|
242
|
+
if (!isLetter(first)) return void 0;
|
|
243
|
+
VOID_TAG.lastIndex = open2 + 1;
|
|
244
|
+
const known = VOID_TAG.exec(markup);
|
|
245
|
+
if (known) return { name: known[1], end: open2 + 1 + known[0].length };
|
|
246
|
+
const nameEnd = tagNameEnd(markup, open2);
|
|
247
|
+
const gt = nameEnd < 0 ? -1 : nextGt(open2);
|
|
248
|
+
if (gt < 0 || markup.charCodeAt(gt - 1) !== 47) return void 0;
|
|
249
|
+
return { name: markup.slice(open2 + 1, nameEnd), end: gt + 1 };
|
|
250
|
+
}
|
|
251
|
+
function* countedTagNames(markup) {
|
|
252
|
+
const nextGt = indexFinder(markup, />/g);
|
|
253
|
+
for (let open2 = markup.indexOf("<"); open2 >= 0; ) {
|
|
254
|
+
const tag = countedTagAt(markup, open2, nextGt);
|
|
255
|
+
if (tag) yield tag.name;
|
|
256
|
+
open2 = markup.indexOf("<", tag ? tag.end : open2 + 1);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function countTagsWithAttr(markup, tagName, attr) {
|
|
260
|
+
const opener = new RegExp(`<${tagName}\\b`, "gi");
|
|
261
|
+
const nextGt = indexFinder(markup, />/g);
|
|
262
|
+
const nextAttr = forwardFinder(markup, new RegExp(attr, "gi"));
|
|
263
|
+
let count = 0;
|
|
264
|
+
for (let open2 = opener.exec(markup); open2; open2 = opener.exec(markup)) {
|
|
265
|
+
const attrsStart = open2.index + open2[0].length;
|
|
266
|
+
const gt = nextGt(attrsStart);
|
|
267
|
+
if (gt < 0) break;
|
|
268
|
+
const found = nextAttr(attrsStart);
|
|
269
|
+
const inTag = found !== null && found.index < gt;
|
|
270
|
+
if (inTag) count++;
|
|
271
|
+
opener.lastIndex = inTag ? gt + 1 : gt;
|
|
272
|
+
}
|
|
273
|
+
return count;
|
|
274
|
+
}
|
|
275
|
+
function lastQuotedValueCloses(nextAttr, nextQuote, from, tagEnd) {
|
|
276
|
+
let close = -1;
|
|
277
|
+
let earlierClose = -1;
|
|
278
|
+
for (let attr = nextAttr(from); attr && attr.index < tagEnd; attr = nextAttr(attr.index + 1)) {
|
|
279
|
+
const quote = nextQuote(attr.index + attr[0].length);
|
|
280
|
+
if (quote < 0) return { close, earlierClose, unclosed: true };
|
|
281
|
+
earlierClose = close;
|
|
282
|
+
close = quote;
|
|
283
|
+
}
|
|
284
|
+
return { close, earlierClose, unclosed: false };
|
|
285
|
+
}
|
|
286
|
+
function* tagsWithQuotedAttr(html, name) {
|
|
287
|
+
const opener = /<[a-zA-Z]/g;
|
|
288
|
+
const nextGt = indexFinder(html, />/g);
|
|
289
|
+
const nextQuote = indexFinder(html, /["']/g);
|
|
290
|
+
const nextAttr = forwardFinder(html, new RegExp(`\\b${name}=["']`, "gi"));
|
|
291
|
+
for (let open2 = opener.exec(html); open2; open2 = opener.exec(html)) {
|
|
292
|
+
if (tagNameEnd(html, open2.index) < 0) continue;
|
|
293
|
+
const gt = nextGt(open2.index);
|
|
294
|
+
const tagEnd = gt < 0 ? html.length : gt;
|
|
295
|
+
const { close, earlierClose, unclosed } = lastQuotedValueCloses(
|
|
296
|
+
nextAttr,
|
|
297
|
+
nextQuote,
|
|
298
|
+
open2.index + 2,
|
|
299
|
+
tagEnd
|
|
300
|
+
);
|
|
301
|
+
if (close >= 0) yield { start: open2.index, close, earlierClose };
|
|
302
|
+
if (unclosed || close < 0 && gt < 0) return;
|
|
303
|
+
opener.lastIndex = close >= 0 ? close + 1 : gt;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
function countCompositionSrcMounts(markup) {
|
|
307
|
+
let count = 0;
|
|
308
|
+
for (const _ of tagsWithQuotedAttr(markup, "data-composition-src")) count++;
|
|
309
|
+
return count;
|
|
310
|
+
}
|
|
311
|
+
function firstCompositionIdTag(html) {
|
|
312
|
+
for (const { start, close, earlierClose } of tagsWithQuotedAttr(html, "data-composition-id")) {
|
|
313
|
+
let end = html.indexOf(">", close + 1);
|
|
314
|
+
if (end < 0 && earlierClose >= 0) end = html.indexOf(">", earlierClose + 1);
|
|
315
|
+
return end < 0 ? void 0 : html.slice(start, end + 1);
|
|
316
|
+
}
|
|
317
|
+
return void 0;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
// src/services/renderOrchestrator.ts
|
|
321
|
+
import { matchHtmlBodyCssHeightFirst, matchHtmlBodyCssWidthFirst } from "@hyperframes/parsers";
|
|
33
322
|
import {
|
|
34
323
|
extractMediaMetadata as extractMediaMetadata5,
|
|
35
324
|
resolveConfig as resolveConfig2,
|
|
@@ -93,7 +382,7 @@ import { join as join2, extname, resolve as resolve2, sep as sep2 } from "node:p
|
|
|
93
382
|
import { injectScriptsAtHeadStart, injectScriptsIntoHtml } from "@hyperframes/core/compiler";
|
|
94
383
|
import { injectTagsAtHeadStart } from "@hyperframes/core/compiler/html-document";
|
|
95
384
|
import { PREVIEW_FOR_ANOTHER_SITE_META } from "@hyperframes/core/studio-preview-mark";
|
|
96
|
-
import { fpsToNumber } from "@hyperframes/core";
|
|
385
|
+
import { fpsToNumber, terminalText as terminalText2 } from "@hyperframes/core";
|
|
97
386
|
import { isPrivateFileUnder, isStudioPrivatePath } from "@hyperframes/core/safe-path";
|
|
98
387
|
import { stripSdrPngColourTags } from "@hyperframes/core/compiler/png-colour-tags";
|
|
99
388
|
import { openRangeEnd } from "@hyperframes/studio-server/media-range";
|
|
@@ -184,6 +473,7 @@ function getHfEarlyStub() {
|
|
|
184
473
|
}
|
|
185
474
|
|
|
186
475
|
// src/logger.ts
|
|
476
|
+
import { terminalText } from "@hyperframes/core";
|
|
187
477
|
var LOG_LEVEL_PRIORITY = {
|
|
188
478
|
error: 0,
|
|
189
479
|
warn: 1,
|
|
@@ -193,26 +483,26 @@ var LOG_LEVEL_PRIORITY = {
|
|
|
193
483
|
function createConsoleLogger(level = "info") {
|
|
194
484
|
const threshold = LOG_LEVEL_PRIORITY[level];
|
|
195
485
|
const shouldLog = (msgLevel) => LOG_LEVEL_PRIORITY[msgLevel] <= threshold;
|
|
196
|
-
const formatMeta = (meta) => meta ? ` ${JSON.stringify(meta)}` : "";
|
|
486
|
+
const formatMeta = (meta) => meta ? ` ${terminalText(JSON.stringify(meta))}` : "";
|
|
197
487
|
return {
|
|
198
488
|
error(message, meta) {
|
|
199
489
|
if (shouldLog("error")) {
|
|
200
|
-
console.error(`[ERROR] ${message}${formatMeta(meta)}`);
|
|
490
|
+
console.error(`[ERROR] ${terminalText(message)}${formatMeta(meta)}`);
|
|
201
491
|
}
|
|
202
492
|
},
|
|
203
493
|
warn(message, meta) {
|
|
204
494
|
if (shouldLog("warn")) {
|
|
205
|
-
console.warn(`[WARN] ${message}${formatMeta(meta)}`);
|
|
495
|
+
console.warn(`[WARN] ${terminalText(message)}${formatMeta(meta)}`);
|
|
206
496
|
}
|
|
207
497
|
},
|
|
208
498
|
info(message, meta) {
|
|
209
499
|
if (shouldLog("info")) {
|
|
210
|
-
console.error(`[INFO] ${message}${formatMeta(meta)}`);
|
|
500
|
+
console.error(`[INFO] ${terminalText(message)}${formatMeta(meta)}`);
|
|
211
501
|
}
|
|
212
502
|
},
|
|
213
503
|
debug(message, meta) {
|
|
214
504
|
if (shouldLog("debug")) {
|
|
215
|
-
console.error(`[DEBUG] ${message}${formatMeta(meta)}`);
|
|
505
|
+
console.error(`[DEBUG] ${terminalText(message)}${formatMeta(meta)}`);
|
|
216
506
|
}
|
|
217
507
|
},
|
|
218
508
|
isLevelEnabled(msgLevel) {
|
|
@@ -861,7 +1151,7 @@ function createFileServer(options) {
|
|
|
861
1151
|
const headScripts = options.headScripts ?? [getVerifiedHyperframeRuntimeSource()];
|
|
862
1152
|
const bodyScripts = options.bodyScripts ?? [buildRenderModeScript(options.fps), HF_BRIDGE_SCRIPT];
|
|
863
1153
|
const app = new Hono();
|
|
864
|
-
const warnLeftOut = (line) => console.warn(`[FileServer] ${line}`);
|
|
1154
|
+
const warnLeftOut = (line) => console.warn(`[FileServer] ${terminalText2(line)}`);
|
|
865
1155
|
let listeningPort = -1;
|
|
866
1156
|
app.use(async function loadEachFileOnlyAsItsNamedType(c, next) {
|
|
867
1157
|
await next();
|
|
@@ -885,7 +1175,7 @@ function createFileServer(options) {
|
|
|
885
1175
|
}
|
|
886
1176
|
if (!file) {
|
|
887
1177
|
if (!/favicon\.ico$/i.test(requestPath)) {
|
|
888
|
-
console.warn(`[FileServer] 404 Not Found: ${requestPath}`);
|
|
1178
|
+
console.warn(`[FileServer] 404 Not Found: ${terminalText2(requestPath)}`);
|
|
889
1179
|
}
|
|
890
1180
|
return c.text("Not found", 404);
|
|
891
1181
|
}
|
|
@@ -1126,7 +1416,8 @@ import {
|
|
|
1126
1416
|
import { basename as basename2, dirname as dirname2, isAbsolute, join as join3, relative, resolve as resolve3 } from "node:path";
|
|
1127
1417
|
import {
|
|
1128
1418
|
CANVAS_DIMENSIONS,
|
|
1129
|
-
checkOutputResolutionCompatibility
|
|
1419
|
+
checkOutputResolutionCompatibility,
|
|
1420
|
+
terminalText as terminalText3
|
|
1130
1421
|
} from "@hyperframes/core";
|
|
1131
1422
|
import {
|
|
1132
1423
|
mediaIdPathSegment
|
|
@@ -1171,7 +1462,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
1171
1462
|
for (const [srcPath, html] of compiled.subCompositions) {
|
|
1172
1463
|
const outPath = join3(compileDir, srcPath);
|
|
1173
1464
|
if (!isPathInside(outPath, compileDir)) {
|
|
1174
|
-
console.warn(`[Render] Skipping sub-composition with unsafe path: ${srcPath}`);
|
|
1465
|
+
console.warn(`[Render] Skipping sub-composition with unsafe path: ${terminalText3(srcPath)}`);
|
|
1175
1466
|
continue;
|
|
1176
1467
|
}
|
|
1177
1468
|
mkdirSync(dirname2(outPath), { recursive: true });
|
|
@@ -1180,7 +1471,9 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
1180
1471
|
for (const [relativePath, absolutePath] of compiled.externalAssets) {
|
|
1181
1472
|
const outPath = resolve3(join3(compileDir, relativePath));
|
|
1182
1473
|
if (!isPathInside(outPath, compileDir)) {
|
|
1183
|
-
console.warn(
|
|
1474
|
+
console.warn(
|
|
1475
|
+
`[Render] Skipping external asset with unsafe path: ${terminalText3(relativePath)}`
|
|
1476
|
+
);
|
|
1184
1477
|
continue;
|
|
1185
1478
|
}
|
|
1186
1479
|
mkdirSync(dirname2(outPath), { recursive: true });
|
|
@@ -3080,6 +3373,7 @@ import {
|
|
|
3080
3373
|
resolveProjectRelativeSrc,
|
|
3081
3374
|
resolveVideoExtractionWindow,
|
|
3082
3375
|
runFfmpeg,
|
|
3376
|
+
urlInputArgs,
|
|
3083
3377
|
videoStartOnMediaTimeline
|
|
3084
3378
|
} from "@hyperframes/engine";
|
|
3085
3379
|
import { fpsToFfmpegArg, fpsToNumber as fpsToNumber3 } from "@hyperframes/core";
|
|
@@ -3372,7 +3666,15 @@ function hdrWindowFrames(frameSize, windowBytes) {
|
|
|
3372
3666
|
return Math.max(8, Math.floor(windowBytes / frameSize));
|
|
3373
3667
|
}
|
|
3374
3668
|
async function probeFirstTick(srcPath, mediaStart, fps, runFfmpegImpl, abortSignal) {
|
|
3375
|
-
const args = [
|
|
3669
|
+
const args = [
|
|
3670
|
+
...urlInputArgs(srcPath),
|
|
3671
|
+
"-ss",
|
|
3672
|
+
String(mediaStart),
|
|
3673
|
+
"-i",
|
|
3674
|
+
srcPath,
|
|
3675
|
+
"-frames:v",
|
|
3676
|
+
"1"
|
|
3677
|
+
];
|
|
3376
3678
|
const result = await runFfmpegImpl([...args, ...["-vf", "showinfo", "-f", "null", "-"]], {
|
|
3377
3679
|
signal: abortSignal
|
|
3378
3680
|
});
|
|
@@ -3446,6 +3748,7 @@ async function extractHdrVideoFrames(args) {
|
|
|
3446
3748
|
// Decode before seeking for the one-frame path. Input-side seeking can
|
|
3447
3749
|
// return zero frames for valid unindexed/negative-base transports.
|
|
3448
3750
|
[
|
|
3751
|
+
...urlInputArgs(srcPath),
|
|
3449
3752
|
"-i",
|
|
3450
3753
|
srcPath,
|
|
3451
3754
|
"-ss",
|
|
@@ -3530,6 +3833,7 @@ function hdrWindowFfmpegArgs(a) {
|
|
|
3530
3833
|
const filters = [`fps=${a.fpsArg}:start_time=${(a.firstTick / a.fps).toFixed(6)}`, a.scale];
|
|
3531
3834
|
if (trim > 0) filters.push(`trim=start_frame=${trim}`);
|
|
3532
3835
|
return [
|
|
3836
|
+
...urlInputArgs(a.srcPath),
|
|
3533
3837
|
...["-ss", (a.ffmpegSeek + seekFrame / a.fps).toFixed(6), "-i", a.srcPath],
|
|
3534
3838
|
...["-vf", filters.join(","), "-frames:v", String(a.frames), "-fps_mode", "passthrough"]
|
|
3535
3839
|
];
|
|
@@ -3543,50 +3847,71 @@ function holdFirstFrameUntilStreamStarts(windows, firstTick) {
|
|
|
3543
3847
|
close: () => windows.close()
|
|
3544
3848
|
};
|
|
3545
3849
|
}
|
|
3850
|
+
function fitHdrImageLayoutToFrame(layout, frameWidth, frameHeight) {
|
|
3851
|
+
const scale = Math.min(1, frameWidth / layout.width, frameHeight / layout.height);
|
|
3852
|
+
if (scale === 1) return layout;
|
|
3853
|
+
return {
|
|
3854
|
+
width: Math.max(1, Math.floor(layout.width * scale)),
|
|
3855
|
+
height: Math.max(1, Math.floor(layout.height * scale))
|
|
3856
|
+
};
|
|
3857
|
+
}
|
|
3546
3858
|
function decodeHdrImageBuffers(args) {
|
|
3547
|
-
const { log, hdrImageSrcPaths, prep, hdrDiagnostics } = args;
|
|
3859
|
+
const { log, hdrImageSrcPaths, prep, hdrDiagnostics, width, height } = args;
|
|
3860
|
+
const budgetBytes = resolveHdrExtractionBudgetBytes(process.env[HDR_EXTRACTION_MAX_BYTES_ENV]);
|
|
3861
|
+
const releases = [];
|
|
3862
|
+
const releaseReservation = () => {
|
|
3863
|
+
for (const release of releases.splice(0)) release();
|
|
3864
|
+
};
|
|
3548
3865
|
const out = /* @__PURE__ */ new Map();
|
|
3549
3866
|
for (const [imageId, srcPath] of hdrImageSrcPaths) {
|
|
3550
3867
|
try {
|
|
3551
3868
|
const decoded = decodePngToRgb48le(readFileSync3(srcPath));
|
|
3869
|
+
const releaseDecoded = reserveHdrExtractionBytes(decoded.data.length, budgetBytes);
|
|
3552
3870
|
const layout = prep.hdrExtractionDims.get(imageId);
|
|
3553
|
-
|
|
3554
|
-
|
|
3555
|
-
|
|
3871
|
+
if (!layout || layout.width === decoded.width && layout.height === decoded.height) {
|
|
3872
|
+
releases.push(releaseDecoded);
|
|
3873
|
+
out.set(imageId, decoded);
|
|
3874
|
+
continue;
|
|
3875
|
+
}
|
|
3876
|
+
const target = fitHdrImageLayoutToFrame(layout, width, height);
|
|
3877
|
+
if (target !== layout) {
|
|
3878
|
+
log.warn("HDR image layout box is larger than the output frame; drawing it smaller", {
|
|
3879
|
+
imageId,
|
|
3880
|
+
layout: `${layout.width}x${layout.height}`,
|
|
3881
|
+
drawn: `${target.width}x${target.height}`
|
|
3882
|
+
});
|
|
3883
|
+
}
|
|
3884
|
+
try {
|
|
3885
|
+
releases.push(reserveHdrExtractionBytes(target.width * target.height * 6, budgetBytes));
|
|
3886
|
+
const fitInfo = prep.hdrImageFitInfo.get(imageId);
|
|
3556
3887
|
const resampled = resampleRgb48leObjectFit(
|
|
3557
3888
|
decoded.data,
|
|
3558
3889
|
decoded.width,
|
|
3559
3890
|
decoded.height,
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
fit,
|
|
3891
|
+
target.width,
|
|
3892
|
+
target.height,
|
|
3893
|
+
normalizeObjectFit(fitInfo?.fit),
|
|
3563
3894
|
fitInfo?.position
|
|
3564
3895
|
);
|
|
3565
|
-
out.set(imageId, {
|
|
3566
|
-
|
|
3567
|
-
|
|
3568
|
-
height: layout.height
|
|
3569
|
-
});
|
|
3570
|
-
} else {
|
|
3571
|
-
out.set(imageId, {
|
|
3572
|
-
data: Buffer.from(decoded.data),
|
|
3573
|
-
width: decoded.width,
|
|
3574
|
-
height: decoded.height
|
|
3575
|
-
});
|
|
3896
|
+
out.set(imageId, { data: resampled, width: target.width, height: target.height });
|
|
3897
|
+
} finally {
|
|
3898
|
+
releaseDecoded();
|
|
3576
3899
|
}
|
|
3577
3900
|
} catch (err) {
|
|
3901
|
+
releaseReservation();
|
|
3578
3902
|
hdrDiagnostics.imageDecodeFailures += 1;
|
|
3903
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
3579
3904
|
log.error("HDR image decode failed; aborting render", {
|
|
3580
3905
|
imageId,
|
|
3581
3906
|
srcPath,
|
|
3582
|
-
error:
|
|
3907
|
+
error: message
|
|
3583
3908
|
});
|
|
3584
3909
|
throw new Error(
|
|
3585
|
-
`HDR image decode failed for image "${imageId}". Aborting render to avoid shipping missing HDR image layers.`
|
|
3910
|
+
`HDR image decode failed for image "${imageId}": ${message}. Aborting render to avoid shipping missing HDR image layers.`
|
|
3586
3911
|
);
|
|
3587
3912
|
}
|
|
3588
3913
|
}
|
|
3589
|
-
return out;
|
|
3914
|
+
return { buffers: out, releaseReservation };
|
|
3590
3915
|
}
|
|
3591
3916
|
|
|
3592
3917
|
// src/services/render/stages/captureHdrFrameShared.ts
|
|
@@ -6584,7 +6909,8 @@ import {
|
|
|
6584
6909
|
rewriteAssetPath,
|
|
6585
6910
|
rewriteAssetPaths,
|
|
6586
6911
|
rewriteCssAssetUrls,
|
|
6587
|
-
rewriteInlineStyleAssetUrls
|
|
6912
|
+
rewriteInlineStyleAssetUrls,
|
|
6913
|
+
terminalText as terminalText4
|
|
6588
6914
|
} from "@hyperframes/core";
|
|
6589
6915
|
import { MAX_AUDIO_GAIN } from "@hyperframes/core/audio-gain";
|
|
6590
6916
|
import { CAPTURE_CANVAS_SELECTOR } from "@hyperframes/core/html-in-canvas";
|
|
@@ -6795,6 +7121,7 @@ function placeAudio(audio, window2) {
|
|
|
6795
7121
|
import {
|
|
6796
7122
|
analyzeKeyframeIntervals,
|
|
6797
7123
|
assertMediaPayload,
|
|
7124
|
+
isPrivateUnderAssetRoots as isPrivateUnderAssetRoots3,
|
|
6798
7125
|
NotMediaPayloadError as NotMediaPayloadError2,
|
|
6799
7126
|
parseMasterFxChain,
|
|
6800
7127
|
probeMediaProfile as probeMediaProfile2
|
|
@@ -6822,7 +7149,13 @@ import { copyFileSync as copyFileSync2, existsSync as existsSync9, mkdirSync as
|
|
|
6822
7149
|
import { dirname as dirname6, isAbsolute as isAbsolute2, join as join16, resolve as resolve5 } from "node:path";
|
|
6823
7150
|
import { parseHTML as parseHTML3 } from "linkedom";
|
|
6824
7151
|
import { parseAnimatedGifMetadata } from "@hyperframes/core";
|
|
6825
|
-
import {
|
|
7152
|
+
import {
|
|
7153
|
+
DEFAULT_VP9_CPU_USED,
|
|
7154
|
+
isPrivateUnderAssetRoots,
|
|
7155
|
+
runFfmpeg as runFfmpeg2,
|
|
7156
|
+
renameWithRetry as renameWithRetry3,
|
|
7157
|
+
urlInputArgs as urlInputArgs2
|
|
7158
|
+
} from "@hyperframes/engine";
|
|
6826
7159
|
import { namesAnotherNetworkRoot } from "@hyperframes/parsers/asset-resolution";
|
|
6827
7160
|
var PREPARED_GIF_SUBDIR = "_animated_gif";
|
|
6828
7161
|
var CACHE_SCHEMA = "hfgif-v1";
|
|
@@ -6860,14 +7193,13 @@ function resolveLocalImageSourcePath(src, options) {
|
|
|
6860
7193
|
const mapped = options.sourceAssets?.get(trimmed) ?? options.sourceAssets?.get(basePath) ?? options.sourceAssets?.get(normalizedBase);
|
|
6861
7194
|
if (mapped && existsSync9(mapped)) return mapped;
|
|
6862
7195
|
if (isHttpUrl(trimmed)) return null;
|
|
6863
|
-
const protocolRelativeUrlOnShare = basePath.startsWith("/") && namesAnotherNetworkRoot(options.projectDir, basePath);
|
|
6864
7196
|
const projectRelative = basePath.startsWith("/") ? basePath.slice(1) : basePath;
|
|
6865
7197
|
const candidates = [
|
|
6866
|
-
|
|
7198
|
+
isAbsolute2(basePath) ? basePath : resolve5(options.projectDir, projectRelative),
|
|
6867
7199
|
resolve5(options.downloadDir, normalizedBase)
|
|
6868
7200
|
];
|
|
6869
|
-
const allowed = (candidate) => !escapesAssetRoot(candidate, options.assetRoot) && outsideAssetRefusal(options.projectDir, candidate) !== "blocklisted" || !escapesAssetRoot(candidate, options.downloadDir);
|
|
6870
|
-
return candidates.find((candidate) =>
|
|
7201
|
+
const allowed = (candidate) => !namesAnotherNetworkRoot(options.projectDir, candidate) && !isPrivateUnderAssetRoots(candidate, [options.projectDir, options.downloadDir]) && (!escapesAssetRoot(candidate, options.assetRoot) && outsideAssetRefusal(options.projectDir, candidate) !== "blocklisted" || !escapesAssetRoot(candidate, options.downloadDir));
|
|
7202
|
+
return candidates.find((candidate) => allowed(candidate) && existsSync9(candidate)) ?? null;
|
|
6871
7203
|
}
|
|
6872
7204
|
function isUsableFile(path) {
|
|
6873
7205
|
try {
|
|
@@ -6935,6 +7267,7 @@ function buildAnimatedGifTranscodeArgs(input) {
|
|
|
6935
7267
|
args.push(
|
|
6936
7268
|
"-ignore_loop",
|
|
6937
7269
|
"1",
|
|
7270
|
+
...urlInputArgs2(input.inputPath),
|
|
6938
7271
|
"-i",
|
|
6939
7272
|
input.inputPath,
|
|
6940
7273
|
"-an",
|
|
@@ -7140,7 +7473,7 @@ import {
|
|
|
7140
7473
|
} from "node:fs";
|
|
7141
7474
|
import { dirname as dirname7, join as join17, resolve as resolve6 } from "node:path";
|
|
7142
7475
|
import { parseHTML as parseHTML4 } from "linkedom";
|
|
7143
|
-
import { renameWithRetry as renameWithRetry4, runFfmpeg as runFfmpeg3, runFfprobe } from "@hyperframes/engine";
|
|
7476
|
+
import { renameWithRetry as renameWithRetry4, runFfmpeg as runFfmpeg3, runFfprobe, urlInputArgs as urlInputArgs3 } from "@hyperframes/engine";
|
|
7144
7477
|
|
|
7145
7478
|
// src/services/heifRotation.ts
|
|
7146
7479
|
function* boxes(buf, start, end) {
|
|
@@ -7339,6 +7672,7 @@ async function convertHeifToJpeg(request) {
|
|
|
7339
7672
|
"-hide_banner",
|
|
7340
7673
|
"-loglevel",
|
|
7341
7674
|
"error",
|
|
7675
|
+
...urlInputArgs3(request.inputPath),
|
|
7342
7676
|
"-i",
|
|
7343
7677
|
request.inputPath,
|
|
7344
7678
|
...mapArgs,
|
|
@@ -7462,7 +7796,9 @@ import {
|
|
|
7462
7796
|
fingerprintElementId,
|
|
7463
7797
|
isHttpUrl as isHttpUrl2,
|
|
7464
7798
|
isInsideAssetRoots,
|
|
7799
|
+
isNotImagePayload,
|
|
7465
7800
|
isNotMediaPayload,
|
|
7801
|
+
isPrivateUnderAssetRoots as isPrivateUnderAssetRoots2,
|
|
7466
7802
|
playlistLeavesItsFolder,
|
|
7467
7803
|
NotMediaPayloadError,
|
|
7468
7804
|
probeMediaProfile,
|
|
@@ -7517,6 +7853,10 @@ function dropMediaOutsideProject(input) {
|
|
|
7517
7853
|
const staysInside = ({ id, src }) => {
|
|
7518
7854
|
if (!src || isHttpUrl2(src)) return true;
|
|
7519
7855
|
const path = resolveProjectRelativeSrc3(src, projectDir, compiledDir);
|
|
7856
|
+
if (isPrivateUnderAssetRoots2(path, roots)) {
|
|
7857
|
+
log.warn(`[Render] Media "${id}" source is missing: it is a private project file`, { src });
|
|
7858
|
+
return false;
|
|
7859
|
+
}
|
|
7520
7860
|
if (isInsideAssetRoots(path, roots)) return true;
|
|
7521
7861
|
if (input.allowOutsideProjectAssets) {
|
|
7522
7862
|
const refusal = outsideAssetRefusal(projectDir, path);
|
|
@@ -7533,6 +7873,8 @@ function dropMediaOutsideProject(input) {
|
|
|
7533
7873
|
async function notMediaReferences(path, references) {
|
|
7534
7874
|
const videos = references.filter((ref) => ref.expected === "video");
|
|
7535
7875
|
if (videos.length > 0 && await isNotMediaPayload(path)) return videos;
|
|
7876
|
+
const images = references.filter((ref) => ref.expected === "image");
|
|
7877
|
+
if (images.length > 0 && await isNotImagePayload(path)) return images;
|
|
7536
7878
|
return await playlistLeavesItsFolder(path) ? references : [];
|
|
7537
7879
|
}
|
|
7538
7880
|
async function preflightCompositionAssetMediaTypes(input) {
|
|
@@ -7729,20 +8071,13 @@ function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @
|
|
|
7729
8071
|
throw new EmptyCompositionError(problems);
|
|
7730
8072
|
}
|
|
7731
8073
|
}
|
|
7732
|
-
var INLINE_SCRIPT_PATTERN = /<script\b([^>]*)>([\s\S]*?)<\/script>/gi;
|
|
7733
8074
|
var COMPILER_MOUNT_BLOCK_START = "/* __HF_COMPILER_MOUNT_START__ */";
|
|
7734
8075
|
var COMPILER_MOUNT_BLOCK_END = "/* __HF_COMPILER_MOUNT_END__ */";
|
|
7735
8076
|
function stripJsComments(source) {
|
|
7736
|
-
return source.replace(/\/\/.*$/gm, "")
|
|
8077
|
+
return removeDelimitedRuns(source.replace(/\/\/.*$/gm, ""), "/*", "*/");
|
|
7737
8078
|
}
|
|
7738
8079
|
function stripCompilerMountBootstrap(source) {
|
|
7739
|
-
return source
|
|
7740
|
-
new RegExp(
|
|
7741
|
-
`${COMPILER_MOUNT_BLOCK_START.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}[\\s\\S]*?${COMPILER_MOUNT_BLOCK_END.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}`,
|
|
7742
|
-
"g"
|
|
7743
|
-
),
|
|
7744
|
-
""
|
|
7745
|
-
);
|
|
8080
|
+
return removeDelimitedRuns(source, COMPILER_MOUNT_BLOCK_START, COMPILER_MOUNT_BLOCK_END);
|
|
7746
8081
|
}
|
|
7747
8082
|
function runtimeRoot(document2) {
|
|
7748
8083
|
return document2.querySelector('[data-composition-id][data-root="true"]') ?? document2.querySelector("[data-composition-id]");
|
|
@@ -7767,12 +8102,9 @@ function detectRenderModeHints(html, pageMotionBlur) {
|
|
|
7767
8102
|
message: "Detected <iframe> in the composition DOM. Nested iframe animation is routed through screenshot capture mode for compatibility."
|
|
7768
8103
|
});
|
|
7769
8104
|
}
|
|
7770
|
-
|
|
7771
|
-
const scriptPattern = new RegExp(INLINE_SCRIPT_PATTERN.source, INLINE_SCRIPT_PATTERN.flags);
|
|
7772
|
-
while ((scriptMatch = scriptPattern.exec(html)) !== null) {
|
|
7773
|
-
const attrs = scriptMatch[1] || "";
|
|
8105
|
+
for (const { attrs, body } of inlineScriptBlocks(html)) {
|
|
7774
8106
|
if (/\bsrc\s*=/i.test(attrs)) continue;
|
|
7775
|
-
const content = stripJsComments(stripCompilerMountBootstrap(
|
|
8107
|
+
const content = stripJsComments(stripCompilerMountBootstrap(body));
|
|
7776
8108
|
if (!/requestAnimationFrame\s*\(/.test(content)) continue;
|
|
7777
8109
|
reasons.push({
|
|
7778
8110
|
code: "requestAnimationFrame",
|
|
@@ -7824,17 +8156,14 @@ function detectAncestorBackgroundImage(html) {
|
|
|
7824
8156
|
}
|
|
7825
8157
|
var SHADER_TRANSITION_USAGE_PATTERN = /\b(?:(?:window|globalThis)\s*\.\s*)?HyperShader\s*\.\s*init\s*\(|\b__hf\s*\.\s*transitions\s*=/;
|
|
7826
8158
|
function detectShaderTransitionUsage(html) {
|
|
7827
|
-
|
|
7828
|
-
const scriptPattern = new RegExp(INLINE_SCRIPT_PATTERN.source, INLINE_SCRIPT_PATTERN.flags);
|
|
7829
|
-
while ((scriptMatch = scriptPattern.exec(html)) !== null) {
|
|
7830
|
-
const attrs = scriptMatch[1] || "";
|
|
8159
|
+
for (const { attrs, body } of inlineScriptBlocks(html)) {
|
|
7831
8160
|
if (/\bsrc\s*=/i.test(attrs)) continue;
|
|
7832
|
-
const content = stripJsComments(stripCompilerMountBootstrap(
|
|
8161
|
+
const content = stripJsComments(stripCompilerMountBootstrap(body));
|
|
7833
8162
|
if (SHADER_TRANSITION_USAGE_PATTERN.test(content)) return true;
|
|
7834
8163
|
}
|
|
7835
8164
|
return false;
|
|
7836
8165
|
}
|
|
7837
|
-
async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
8166
|
+
async function resolveMediaDuration(src, mediaStart, playbackRate, projectDir, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
7838
8167
|
let filePath = src;
|
|
7839
8168
|
if (isHttpUrl(src)) {
|
|
7840
8169
|
const remoteDir = join19(downloadDir, REMOTE_MEDIA_SUBDIR);
|
|
@@ -7849,7 +8178,9 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
|
|
|
7849
8178
|
} else {
|
|
7850
8179
|
filePath = decodedUrlPath(src);
|
|
7851
8180
|
if (!filePath.startsWith("/")) filePath = join19(baseDir, filePath);
|
|
7852
|
-
if (escapesAssetRoot(filePath, assetRoot)
|
|
8181
|
+
if (escapesAssetRoot(filePath, assetRoot) || isPrivateUnderAssetRoots3(filePath, [projectDir, downloadDir])) {
|
|
8182
|
+
return { duration: null, resolvedPath: filePath };
|
|
8183
|
+
}
|
|
7853
8184
|
filePath = urlByAbsentLocalPath?.get(filePath) ?? filePath;
|
|
7854
8185
|
if (!isHttpUrl(filePath) && namesAnotherNetworkRoot2(baseDir, filePath)) {
|
|
7855
8186
|
return { duration: null, resolvedPath: filePath };
|
|
@@ -7925,7 +8256,7 @@ function markInferredVariableMediaDurations(html, unresolvedMedia) {
|
|
|
7925
8256
|
}
|
|
7926
8257
|
return changed ? document2.toString() : html;
|
|
7927
8258
|
}
|
|
7928
|
-
async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
8259
|
+
async function compileHtmlFile(html, projectDir, baseDir, downloadDir, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
7929
8260
|
const { html: staticCompiled, unresolved } = compileTimingAttrs(html);
|
|
7930
8261
|
const mediaUnresolved = unresolved.filter(
|
|
7931
8262
|
(el) => (el.tagName === "video" || el.tagName === "audio") && el.src
|
|
@@ -7937,6 +8268,7 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7937
8268
|
el.src,
|
|
7938
8269
|
el.mediaStart,
|
|
7939
8270
|
el.playbackRate,
|
|
8271
|
+
projectDir,
|
|
7940
8272
|
baseDir,
|
|
7941
8273
|
downloadDir,
|
|
7942
8274
|
el.tagName,
|
|
@@ -7961,6 +8293,7 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7961
8293
|
el.src,
|
|
7962
8294
|
el.mediaStart,
|
|
7963
8295
|
el.playbackRate,
|
|
8296
|
+
projectDir,
|
|
7964
8297
|
baseDir,
|
|
7965
8298
|
downloadDir,
|
|
7966
8299
|
el.tagName,
|
|
@@ -7985,9 +8318,9 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7985
8318
|
if (clampList.length > 0) {
|
|
7986
8319
|
compiledHtml = clampDurations(compiledHtml, clampList);
|
|
7987
8320
|
}
|
|
7988
|
-
compiledHtml = compiledHtml
|
|
7989
|
-
compiledHtml = compiledHtml
|
|
7990
|
-
compiledHtml = compiledHtml
|
|
8321
|
+
compiledHtml = stripCrossoriginAttr(compiledHtml, "video");
|
|
8322
|
+
compiledHtml = stripCrossoriginAttr(compiledHtml, "img");
|
|
8323
|
+
compiledHtml = stripCrossoriginAttr(compiledHtml, "audio");
|
|
7991
8324
|
return { html: compiledHtml, unresolvedCompositions };
|
|
7992
8325
|
}
|
|
7993
8326
|
async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot) {
|
|
@@ -8016,6 +8349,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
8016
8349
|
workItems.map(async (item) => {
|
|
8017
8350
|
const { html: compiledSub } = await compileHtmlFile(
|
|
8018
8351
|
rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
|
|
8352
|
+
projectDir,
|
|
8019
8353
|
dirname9(item.filePath),
|
|
8020
8354
|
downloadDir,
|
|
8021
8355
|
void 0,
|
|
@@ -8218,7 +8552,9 @@ function inlineSubCompositions(html, subCompositions, projectDir, variableOverri
|
|
|
8218
8552
|
flattenInnerRoot: prepareFlattenedInnerRoot,
|
|
8219
8553
|
onMissingComposition: (srcPath, reason) => {
|
|
8220
8554
|
console.warn(
|
|
8221
|
-
|
|
8555
|
+
terminalText4(
|
|
8556
|
+
`[Compiler] Skipping sub-composition "${srcPath}": ${reason ?? "the file is missing or empty"}.`
|
|
8557
|
+
)
|
|
8222
8558
|
);
|
|
8223
8559
|
}
|
|
8224
8560
|
}
|
|
@@ -8421,8 +8757,9 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
|
|
|
8421
8757
|
if (isPathInside(absPath, absProjectDir)) {
|
|
8422
8758
|
return null;
|
|
8423
8759
|
}
|
|
8424
|
-
|
|
8425
|
-
|
|
8760
|
+
const onShare = namesAnotherNetworkRoot2(absProjectDir, absPath);
|
|
8761
|
+
if (!onShare && !existsSync11(absPath)) return null;
|
|
8762
|
+
const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath);
|
|
8426
8763
|
if (refusal) {
|
|
8427
8764
|
if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`);
|
|
8428
8765
|
leftOut.add(trimmed);
|
|
@@ -8472,9 +8809,6 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
|
|
|
8472
8809
|
};
|
|
8473
8810
|
}
|
|
8474
8811
|
var REMOTE_MEDIA_SUBDIR = "_remote_media";
|
|
8475
|
-
var REMOTE_MEDIA_TAG_RE = /<(?:video|audio)\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
|
|
8476
|
-
var REMOTE_SOURCE_TAG_RE = /<source\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
|
|
8477
|
-
var REMOTE_IMG_TAG_RE = /<img\b[^>]*?(?<![\w-])src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
|
|
8478
8812
|
async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
|
|
8479
8813
|
if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
|
|
8480
8814
|
if (!existsSync11(remoteDir)) mkdirSync9(remoteDir, { recursive: true });
|
|
@@ -8513,14 +8847,7 @@ async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLab
|
|
|
8513
8847
|
return { html: result, remoteMediaAssets };
|
|
8514
8848
|
}
|
|
8515
8849
|
async function localizeRemoteMediaSources(html, downloadDir) {
|
|
8516
|
-
const urlSet = /* @__PURE__ */ new Set();
|
|
8517
|
-
for (const tagRe of [REMOTE_MEDIA_TAG_RE, REMOTE_SOURCE_TAG_RE]) {
|
|
8518
|
-
const re = new RegExp(tagRe.source, tagRe.flags);
|
|
8519
|
-
let m;
|
|
8520
|
-
while ((m = re.exec(html)) !== null) {
|
|
8521
|
-
if (m[1]) urlSet.add(m[1]);
|
|
8522
|
-
}
|
|
8523
|
-
}
|
|
8850
|
+
const urlSet = /* @__PURE__ */ new Set([...remoteSrcUrls(html, "media"), ...remoteSrcUrls(html, "source")]);
|
|
8524
8851
|
const localized = await downloadAndRewriteUrls(
|
|
8525
8852
|
urlSet,
|
|
8526
8853
|
html,
|
|
@@ -8543,12 +8870,7 @@ function dropBindingOnLocalizedMedia(html) {
|
|
|
8543
8870
|
return changed ? document2.toString() : html;
|
|
8544
8871
|
}
|
|
8545
8872
|
async function localizeRemoteImageSources(html, downloadDir) {
|
|
8546
|
-
const urlSet =
|
|
8547
|
-
const re = new RegExp(REMOTE_IMG_TAG_RE.source, REMOTE_IMG_TAG_RE.flags);
|
|
8548
|
-
let m;
|
|
8549
|
-
while ((m = re.exec(html)) !== null) {
|
|
8550
|
-
if (m[1]) urlSet.add(m[1]);
|
|
8551
|
-
}
|
|
8873
|
+
const urlSet = new Set(remoteSrcUrls(html, "img"));
|
|
8552
8874
|
return downloadAndRewriteUrls(
|
|
8553
8875
|
urlSet,
|
|
8554
8876
|
html,
|
|
@@ -8761,6 +9083,7 @@ async function embedLocalFontFaces(html, projectDir, assetRoot, log = defaultLog
|
|
|
8761
9083
|
embeddedPaths.add(localPath);
|
|
8762
9084
|
continue;
|
|
8763
9085
|
}
|
|
9086
|
+
if (isPrivateCompositionFile(projectDir, absPath)) continue;
|
|
8764
9087
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
8765
9088
|
try {
|
|
8766
9089
|
if (fileBackedAbsolutePaths.has(absPath)) {
|
|
@@ -8812,16 +9135,13 @@ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
|
|
|
8812
9135
|
const file = resolve7(projectDir, path);
|
|
8813
9136
|
return !namesAnotherNetworkRoot2(projectDir, file) && existsSync11(file);
|
|
8814
9137
|
};
|
|
8815
|
-
return html
|
|
8816
|
-
|
|
8817
|
-
(
|
|
8818
|
-
|
|
8819
|
-
|
|
8820
|
-
|
|
8821
|
-
|
|
8822
|
-
return `${prefix}${gsapDist}${file}${suffix}`;
|
|
8823
|
-
}
|
|
8824
|
-
);
|
|
9138
|
+
return replaceGsapDistScripts(html, (full, prefix, src, file, suffix) => {
|
|
9139
|
+
if (/^https?:\/\//i.test(src)) return full;
|
|
9140
|
+
if (exists(compSrcPath ? rewriteAssetPath(compSrcPath, src, exists) : src)) return full;
|
|
9141
|
+
gsapDist ??= renderGsapDist();
|
|
9142
|
+
defaultLogger.debug(`[Compiler] Rewriting missing gsap script: ${src} \u2192 ${gsapDist}${file}`);
|
|
9143
|
+
return `${prefix}${gsapDist}${file}${suffix}`;
|
|
9144
|
+
});
|
|
8825
9145
|
}
|
|
8826
9146
|
function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
8827
9147
|
if (!isPathInside(htmlPath, projectDir)) return html;
|
|
@@ -8885,6 +9205,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8885
9205
|
const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
|
|
8886
9206
|
rawHtml,
|
|
8887
9207
|
projectDir,
|
|
9208
|
+
projectDir,
|
|
8888
9209
|
downloadDir,
|
|
8889
9210
|
options.log,
|
|
8890
9211
|
options.urlByAbsentLocalPath,
|
|
@@ -8908,10 +9229,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8908
9229
|
options.variables ?? {},
|
|
8909
9230
|
assetRoot
|
|
8910
9231
|
);
|
|
8911
|
-
const sanitizedHtml = inlinedHtml
|
|
8912
|
-
/(<(?:video|audio)\b[^>]*?)\s+preload\s*=\s*["']none["']/gi,
|
|
8913
|
-
"$1"
|
|
8914
|
-
);
|
|
9232
|
+
const sanitizedHtml = stripPreloadNone(inlinedHtml);
|
|
8915
9233
|
const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
|
|
8916
9234
|
const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
|
|
8917
9235
|
const usesThreeDTransforms = detectThreeDTransformUsage(sanitizedHtml);
|
|
@@ -9020,7 +9338,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
9020
9338
|
for (const video of videos) {
|
|
9021
9339
|
if (isHttpUrl(video.src)) continue;
|
|
9022
9340
|
const videoPath = resolve7(projectDir, video.src);
|
|
9023
|
-
if (advised.has(videoPath) || namesAnotherNetworkRoot2(projectDir, videoPath) || !existsSync11(videoPath) || escapesAssetRoot(videoPath, assetRoot))
|
|
9341
|
+
if (advised.has(videoPath) || namesAnotherNetworkRoot2(projectDir, videoPath) || !existsSync11(videoPath) || escapesAssetRoot(videoPath, assetRoot) || isPrivateUnderAssetRoots3(videoPath, [projectDir, downloadDir]))
|
|
9024
9342
|
continue;
|
|
9025
9343
|
advised.add(videoPath);
|
|
9026
9344
|
const reencode = `ffmpeg -i "${video.src}" -c:v libx264 -r 30 -g 30 -keyint_min 30 -movflags +faststart -c:a copy output.mp4`;
|
|
@@ -9650,7 +9968,8 @@ import {
|
|
|
9650
9968
|
readMediaStart as readMediaStart2,
|
|
9651
9969
|
shiftRateLane as shiftRateLane2,
|
|
9652
9970
|
sourceTimeAt as sourceTimeAt3,
|
|
9653
|
-
timeAtSourceTime
|
|
9971
|
+
timeAtSourceTime,
|
|
9972
|
+
terminalText as terminalText5
|
|
9654
9973
|
} from "@hyperframes/core";
|
|
9655
9974
|
import { parseHostVariableValues as parseHostVariableValues2, readDeclaredDefaults as readDeclaredDefaults2 } from "@hyperframes/core/compiler";
|
|
9656
9975
|
import { extractMediaSrcMutations } from "@hyperframes/parsers";
|
|
@@ -10283,7 +10602,7 @@ async function runProbeStage(input) {
|
|
|
10283
10602
|
failures: failedRequests.slice(0, 10)
|
|
10284
10603
|
});
|
|
10285
10604
|
for (const line of failedRequests.slice(0, 5)) {
|
|
10286
|
-
console.warn(`[Render] Asset load failure: ${line}`);
|
|
10605
|
+
console.warn(`[Render] Asset load failure: ${terminalText5(line)}`);
|
|
10287
10606
|
}
|
|
10288
10607
|
}
|
|
10289
10608
|
}
|
|
@@ -10396,7 +10715,7 @@ import {
|
|
|
10396
10715
|
resolveFinalFrameExtractionWindow as resolveFinalFrameExtractionWindow2,
|
|
10397
10716
|
resolveVideoExtractionWindow as resolveVideoExtractionWindow2,
|
|
10398
10717
|
isHttpUrl as isHttpUrl3,
|
|
10399
|
-
|
|
10718
|
+
assetRootsRefusal,
|
|
10400
10719
|
assertPublicHttpsUrl,
|
|
10401
10720
|
downloadToTemp as downloadToTemp2,
|
|
10402
10721
|
resolveRestrictPageNetwork,
|
|
@@ -10834,7 +11153,7 @@ function isPublicHttpsUrl(url) {
|
|
|
10834
11153
|
}
|
|
10835
11154
|
}
|
|
10836
11155
|
function opensLocally(path, assetRoots) {
|
|
10837
|
-
return existsSync13(path) && (!assetRoots ||
|
|
11156
|
+
return existsSync13(path) && (!assetRoots || assetRootsRefusal(path, assetRoots) === null);
|
|
10838
11157
|
}
|
|
10839
11158
|
function localProbeSource(src, input) {
|
|
10840
11159
|
const path = resolveProjectRelativeSrc4(src, input.projectDir, input.compiledDir);
|
|
@@ -12816,6 +13135,7 @@ async function runCaptureHdrStage(input) {
|
|
|
12816
13135
|
let hdrEncoderClosed = false;
|
|
12817
13136
|
let domSessionClosed = false;
|
|
12818
13137
|
let releaseHdrExtractionReservation = null;
|
|
13138
|
+
let releaseHdrImageReservation = null;
|
|
12819
13139
|
const hdrVideoFrameSources = /* @__PURE__ */ new Map();
|
|
12820
13140
|
try {
|
|
12821
13141
|
await initializeSession7(domSession);
|
|
@@ -12897,12 +13217,16 @@ async function runCaptureHdrStage(input) {
|
|
|
12897
13217
|
});
|
|
12898
13218
|
releaseHdrExtractionReservation = extracted.releaseReservation;
|
|
12899
13219
|
for (const [id, source] of extracted.sources) hdrVideoFrameSources.set(id, source);
|
|
12900
|
-
const
|
|
13220
|
+
const decodedImages = decodeHdrImageBuffers({
|
|
12901
13221
|
log,
|
|
12902
13222
|
hdrImageSrcPaths,
|
|
12903
13223
|
prep,
|
|
12904
|
-
hdrDiagnostics
|
|
13224
|
+
hdrDiagnostics,
|
|
13225
|
+
width,
|
|
13226
|
+
height
|
|
12905
13227
|
});
|
|
13228
|
+
releaseHdrImageReservation = decodedImages.releaseReservation;
|
|
13229
|
+
const hdrImageBuffers = decodedImages.buffers;
|
|
12906
13230
|
assertNotAborted();
|
|
12907
13231
|
try {
|
|
12908
13232
|
const cleanedUpVideos = /* @__PURE__ */ new Set();
|
|
@@ -13055,6 +13379,8 @@ async function runCaptureHdrStage(input) {
|
|
|
13055
13379
|
hdrVideoFrameSources.clear();
|
|
13056
13380
|
releaseHdrExtractionReservation?.();
|
|
13057
13381
|
releaseHdrExtractionReservation = null;
|
|
13382
|
+
releaseHdrImageReservation?.();
|
|
13383
|
+
releaseHdrImageReservation = null;
|
|
13058
13384
|
}
|
|
13059
13385
|
return {
|
|
13060
13386
|
lastBrowserConsole,
|
|
@@ -14128,8 +14454,8 @@ function envInt(name, fallback) {
|
|
|
14128
14454
|
return Number.isInteger(parsed) ? parsed : fallback;
|
|
14129
14455
|
}
|
|
14130
14456
|
var MAX_REPORTED_ELEMENT_TAGS = 50;
|
|
14457
|
+
var MAX_SCRIPT_STYLE_STRIP_PASSES = 8;
|
|
14131
14458
|
var VFX_CAPTURE_RANK = { none: 0, self: 1, backdrop: 2 };
|
|
14132
|
-
var ROOT_COMPOSITION_TAG_RE = /<[a-zA-Z][-a-zA-Z0-9]*\b[^>]*\bdata-composition-id=["'][^"']*["'][^>]*>/i;
|
|
14133
14459
|
function bucketPxDelta(delta) {
|
|
14134
14460
|
if (delta === 0) return "0";
|
|
14135
14461
|
if (delta <= 10) return "1-10";
|
|
@@ -14137,12 +14463,12 @@ function bucketPxDelta(delta) {
|
|
|
14137
14463
|
return "51+";
|
|
14138
14464
|
}
|
|
14139
14465
|
function detectRootBodySizeMismatch(html) {
|
|
14140
|
-
const rootTag = html
|
|
14466
|
+
const rootTag = firstCompositionIdTag(html);
|
|
14141
14467
|
const dataWidth = rootTag && Number(rootTag.match(/\bdata-width=["'](\d+)["']/i)?.[1]);
|
|
14142
14468
|
const dataHeight = rootTag && Number(rootTag.match(/\bdata-height=["'](\d+)["']/i)?.[1]);
|
|
14143
14469
|
if (!dataWidth || !dataHeight) return {};
|
|
14144
|
-
const widthFirst = html
|
|
14145
|
-
const heightFirst = widthFirst ? void 0 : html
|
|
14470
|
+
const widthFirst = matchHtmlBodyCssWidthFirst(html);
|
|
14471
|
+
const heightFirst = widthFirst ? void 0 : matchHtmlBodyCssHeightFirst(html);
|
|
14146
14472
|
const [cssWidth, cssHeight] = widthFirst ? [Number(widthFirst[2]), Number(widthFirst[4])] : heightFirst ? [Number(heightFirst[4]), Number(heightFirst[2])] : [void 0, void 0];
|
|
14147
14473
|
if (!cssWidth || !cssHeight) return {};
|
|
14148
14474
|
const delta = Math.max(Math.abs(dataWidth - cssWidth), Math.abs(dataHeight - cssHeight));
|
|
@@ -14150,17 +14476,15 @@ function detectRootBodySizeMismatch(html) {
|
|
|
14150
14476
|
}
|
|
14151
14477
|
function scanElementTags(html) {
|
|
14152
14478
|
let markup = html;
|
|
14153
|
-
for (let previous = ""; markup !== previous; ) {
|
|
14479
|
+
for (let previous = "", pass = 0; markup !== previous && pass < MAX_SCRIPT_STYLE_STRIP_PASSES; pass++) {
|
|
14154
14480
|
previous = markup;
|
|
14155
|
-
markup = markup
|
|
14481
|
+
markup = removeScriptAndStyleBlocks(markup);
|
|
14156
14482
|
}
|
|
14157
14483
|
let total = 0;
|
|
14158
14484
|
const counts = /* @__PURE__ */ new Map();
|
|
14159
|
-
for (const
|
|
14160
|
-
/<\/([a-zA-Z][-a-zA-Z0-9]*)|<(img|br|hr|input|source|track|area|base|col|embed|link|meta|param|wbr)\b|<([a-zA-Z][-a-zA-Z0-9]*)\b[^>]*\/>/gi
|
|
14161
|
-
)) {
|
|
14485
|
+
for (const name of countedTagNames(markup)) {
|
|
14162
14486
|
total++;
|
|
14163
|
-
const tag =
|
|
14487
|
+
const tag = name.toLowerCase();
|
|
14164
14488
|
counts.set(tag, (counts.get(tag) ?? 0) + 1);
|
|
14165
14489
|
}
|
|
14166
14490
|
const ranked = [...counts.entries()].sort((a, b) => b[1] - a[1]);
|
|
@@ -14169,12 +14493,16 @@ function scanElementTags(html) {
|
|
|
14169
14493
|
);
|
|
14170
14494
|
const otherCount = ranked.slice(MAX_REPORTED_ELEMENT_TAGS).reduce((sum2, [, count]) => sum2 + count, 0);
|
|
14171
14495
|
if (otherCount > 0) byTag.other = (byTag.other ?? 0) + otherCount;
|
|
14172
|
-
const arollVideoCount = markup
|
|
14173
|
-
const heygenVideoCount =
|
|
14496
|
+
const arollVideoCount = countTagsWithAttr(markup, "video", `\\bdata-aroll=["']true["']`);
|
|
14497
|
+
const heygenVideoCount = countTagsWithAttr(
|
|
14498
|
+
markup,
|
|
14499
|
+
"video",
|
|
14500
|
+
`\\bdata-media-source=["']heygen["']`
|
|
14501
|
+
);
|
|
14174
14502
|
const audioCount = counts.get("audio") ?? 0;
|
|
14175
14503
|
const imageCount = counts.get("img") ?? 0;
|
|
14176
14504
|
const audioGroupCount = counts.get(HF_AUDIO_GROUP_TAG) ?? 0;
|
|
14177
|
-
const subCompositionCount = markup
|
|
14505
|
+
const subCompositionCount = countCompositionSrcMounts(markup);
|
|
14178
14506
|
let colorGradingCount = 0;
|
|
14179
14507
|
let hasLut = false;
|
|
14180
14508
|
for (const m of markup.matchAll(
|
|
@@ -18845,9 +19173,12 @@ function resolveDistributedEngineConfig(config) {
|
|
|
18845
19173
|
forceScreenshotExplicitlyOptedOut: true
|
|
18846
19174
|
};
|
|
18847
19175
|
}
|
|
19176
|
+
function leavesRoot(rel) {
|
|
19177
|
+
return rel === ".." || rel.startsWith(`..${sep4}`) || isAbsolute3(rel);
|
|
19178
|
+
}
|
|
18848
19179
|
function pathInside(root, path) {
|
|
18849
19180
|
const rel = relative6(root, path);
|
|
18850
|
-
return rel === "" ||
|
|
19181
|
+
return rel === "" || leavesRoot(rel) ? null : rel;
|
|
18851
19182
|
}
|
|
18852
19183
|
function stableSourcePath(roots, srcPath) {
|
|
18853
19184
|
for (const [root, prefix] of roots) {
|
|
@@ -18941,7 +19272,8 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
18941
19272
|
dereference: true,
|
|
18942
19273
|
filter: (src) => {
|
|
18943
19274
|
const rel = relative6(projectDir, src);
|
|
18944
|
-
if (rel === ""
|
|
19275
|
+
if (rel === "") return true;
|
|
19276
|
+
if (leavesRoot(rel)) return false;
|
|
18945
19277
|
if (job.config.allowOutsideProjectAssets) {
|
|
18946
19278
|
if (refusesOutsideLink(projectDir, src, (line) => log.warn(`[Plan] ${line}`))) return false;
|
|
18947
19279
|
} else if (!isSafePath2(projectDir, src)) return false;
|
|
@@ -23180,10 +23512,11 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
|
|
|
23180
23512
|
}
|
|
23181
23513
|
|
|
23182
23514
|
// src/services/distributed/projectHash.ts
|
|
23515
|
+
import { isPrivateFileUnder as isPrivateFileUnder3, isStudioPrivatePath as isStudioPrivatePath3 } from "@hyperframes/core/safe-path";
|
|
23183
23516
|
var READ_CHUNK_BYTES = 256 * 1024;
|
|
23184
23517
|
|
|
23185
23518
|
// src/services/distributed/audioSidecar.ts
|
|
23186
|
-
import { extractAudioMetadata as extractAudioMetadata4, runFfmpeg as runFfmpeg9 } from "@hyperframes/engine";
|
|
23519
|
+
import { extractAudioMetadata as extractAudioMetadata4, runFfmpeg as runFfmpeg9, urlInputArgs as urlInputArgs4 } from "@hyperframes/engine";
|
|
23187
23520
|
var AUDIO_SIDECAR_MIN_BYTES = 32 * 1024 * 1024;
|
|
23188
23521
|
|
|
23189
23522
|
// src/services/distributed/probeFacts.ts
|