hyperframes 0.8.72 → 0.8.73
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/cli.js +455 -385
- package/dist/fontLocalizeCli.js +93 -59
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/studio/assets/{hyperframes-player-jTC1EDAI.js → hyperframes-player-BUauoSsb.js} +1 -1
- package/dist/studio/assets/{index-DpVD1igA.js → index-CMFPPAGq.js} +1 -1
- package/dist/studio/assets/{index-HuYqM2Fi.js → index-DKInxDDv.js} +1 -1
- package/dist/studio/assets/{index-BqUGSWqN.js → index-DxIHGgGZ.js} +173 -173
- package/dist/studio/index.d.ts +14 -1
- package/dist/studio/index.html +1 -1
- package/dist/studio/index.js +48 -27
- package/dist/studio/index.js.map +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -50,7 +50,7 @@ var VERSION;
|
|
|
50
50
|
var init_version = __esm({
|
|
51
51
|
"src/version.ts"() {
|
|
52
52
|
"use strict";
|
|
53
|
-
VERSION = true ? "0.8.
|
|
53
|
+
VERSION = true ? "0.8.73" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -809,11 +809,11 @@ function __metadata(metadataKey, metadataValue) {
|
|
|
809
809
|
}
|
|
810
810
|
function __awaiter(thisArg, _arguments, P2, generator) {
|
|
811
811
|
function adopt(value) {
|
|
812
|
-
return value instanceof P2 ? value : new P2(function(
|
|
813
|
-
|
|
812
|
+
return value instanceof P2 ? value : new P2(function(resolve85) {
|
|
813
|
+
resolve85(value);
|
|
814
814
|
});
|
|
815
815
|
}
|
|
816
|
-
return new (P2 || (P2 = Promise))(function(
|
|
816
|
+
return new (P2 || (P2 = Promise))(function(resolve85, reject2) {
|
|
817
817
|
function fulfilled(value) {
|
|
818
818
|
try {
|
|
819
819
|
step(generator.next(value));
|
|
@@ -829,7 +829,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
|
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
function step(result) {
|
|
832
|
-
result.done ?
|
|
832
|
+
result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
833
833
|
}
|
|
834
834
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
835
835
|
});
|
|
@@ -1020,14 +1020,14 @@ function __asyncValues(o) {
|
|
|
1020
1020
|
}, i);
|
|
1021
1021
|
function verb(n3) {
|
|
1022
1022
|
i[n3] = o[n3] && function(v2) {
|
|
1023
|
-
return new Promise(function(
|
|
1024
|
-
v2 = o[n3](v2), settle(
|
|
1023
|
+
return new Promise(function(resolve85, reject2) {
|
|
1024
|
+
v2 = o[n3](v2), settle(resolve85, reject2, v2.done, v2.value);
|
|
1025
1025
|
});
|
|
1026
1026
|
};
|
|
1027
1027
|
}
|
|
1028
|
-
function settle(
|
|
1028
|
+
function settle(resolve85, reject2, d2, v2) {
|
|
1029
1029
|
Promise.resolve(v2).then(function(v3) {
|
|
1030
|
-
|
|
1030
|
+
resolve85({ value: v3, done: d2 });
|
|
1031
1031
|
}, reject2);
|
|
1032
1032
|
}
|
|
1033
1033
|
}
|
|
@@ -41872,8 +41872,8 @@ var init_custom_element_registry = __esm({
|
|
|
41872
41872
|
} : (element) => element.localName === localName2;
|
|
41873
41873
|
registry.set(localName2, { Class, check });
|
|
41874
41874
|
if (waiting.has(localName2)) {
|
|
41875
|
-
for (const
|
|
41876
|
-
|
|
41875
|
+
for (const resolve85 of waiting.get(localName2))
|
|
41876
|
+
resolve85(Class);
|
|
41877
41877
|
waiting.delete(localName2);
|
|
41878
41878
|
}
|
|
41879
41879
|
ownerDocument.querySelectorAll(
|
|
@@ -41913,13 +41913,13 @@ var init_custom_element_registry = __esm({
|
|
|
41913
41913
|
*/
|
|
41914
41914
|
whenDefined(localName2) {
|
|
41915
41915
|
const { registry, waiting } = this;
|
|
41916
|
-
return new Promise((
|
|
41916
|
+
return new Promise((resolve85) => {
|
|
41917
41917
|
if (registry.has(localName2))
|
|
41918
|
-
|
|
41918
|
+
resolve85(registry.get(localName2).Class);
|
|
41919
41919
|
else {
|
|
41920
41920
|
if (!waiting.has(localName2))
|
|
41921
41921
|
waiting.set(localName2, []);
|
|
41922
|
-
waiting.get(localName2).push(
|
|
41922
|
+
waiting.get(localName2).push(resolve85);
|
|
41923
41923
|
}
|
|
41924
41924
|
});
|
|
41925
41925
|
}
|
|
@@ -52294,14 +52294,14 @@ function inlineHelper(call, ctx) {
|
|
|
52294
52294
|
};
|
|
52295
52295
|
return expandBody(fn.body.body, bindings, prov, ctx);
|
|
52296
52296
|
}
|
|
52297
|
-
function assignStep(update2,
|
|
52298
|
-
if (update2.operator === "+=") return asNum(
|
|
52297
|
+
function assignStep(update2, resolve85) {
|
|
52298
|
+
if (update2.operator === "+=") return asNum(resolve85(update2.right));
|
|
52299
52299
|
if (update2.operator === "-=") {
|
|
52300
|
-
const s = asNum(
|
|
52300
|
+
const s = asNum(resolve85(update2.right));
|
|
52301
52301
|
return s === void 0 ? void 0 : -s;
|
|
52302
52302
|
}
|
|
52303
52303
|
if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
|
|
52304
|
-
return asNum(
|
|
52304
|
+
return asNum(resolve85(update2.right.right));
|
|
52305
52305
|
}
|
|
52306
52306
|
return void 0;
|
|
52307
52307
|
}
|
|
@@ -52310,10 +52310,10 @@ function updatedVarName(update2) {
|
|
|
52310
52310
|
if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
|
|
52311
52311
|
return null;
|
|
52312
52312
|
}
|
|
52313
|
-
function loopStep(update2, varName,
|
|
52313
|
+
function loopStep(update2, varName, resolve85) {
|
|
52314
52314
|
if (updatedVarName(update2) !== varName) return void 0;
|
|
52315
52315
|
if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
|
|
52316
|
-
return assignStep(update2,
|
|
52316
|
+
return assignStep(update2, resolve85);
|
|
52317
52317
|
}
|
|
52318
52318
|
function asNum(v2) {
|
|
52319
52319
|
return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
|
|
@@ -52330,13 +52330,13 @@ function forInitVar(init) {
|
|
|
52330
52330
|
const d2 = init.declarations[0];
|
|
52331
52331
|
return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
|
|
52332
52332
|
}
|
|
52333
|
-
function parseForHeader(stmt,
|
|
52333
|
+
function parseForHeader(stmt, resolve85) {
|
|
52334
52334
|
const iv = forInitVar(stmt.init);
|
|
52335
52335
|
const test = stmt.test;
|
|
52336
52336
|
if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
|
|
52337
|
-
const start = asNum(
|
|
52338
|
-
const end = asNum(
|
|
52339
|
-
const step = loopStep(stmt.update, iv.name,
|
|
52337
|
+
const start = asNum(resolve85(iv.initExpr));
|
|
52338
|
+
const end = asNum(resolve85(test.right));
|
|
52339
|
+
const step = loopStep(stmt.update, iv.name, resolve85);
|
|
52340
52340
|
if (start === void 0 || end === void 0 || !step) return null;
|
|
52341
52341
|
return { v: iv.name, start, end, op: test.operator, step };
|
|
52342
52342
|
}
|
|
@@ -52448,12 +52448,12 @@ function expandStatements(stmts, ctx) {
|
|
|
52448
52448
|
}
|
|
52449
52449
|
return out;
|
|
52450
52450
|
}
|
|
52451
|
-
function inlineComputedTimelines(ast, timelineVar,
|
|
52451
|
+
function inlineComputedTimelines(ast, timelineVar, resolve85) {
|
|
52452
52452
|
const helpers = collectInlinableHelpers(ast, timelineVar);
|
|
52453
52453
|
const ctx = {
|
|
52454
52454
|
helpers,
|
|
52455
52455
|
timelineVar,
|
|
52456
|
-
resolve:
|
|
52456
|
+
resolve: resolve85,
|
|
52457
52457
|
depth: 0,
|
|
52458
52458
|
site: { n: 0 },
|
|
52459
52459
|
order: { n: 0 },
|
|
@@ -67041,7 +67041,7 @@ var init_browserLeasePool = __esm({
|
|
|
67041
67041
|
for (const entry of entries2) this.requestClose(entry, false);
|
|
67042
67042
|
const settle = Promise.all(entries2.map((entry) => entry.closePromise));
|
|
67043
67043
|
const bound = new Promise(
|
|
67044
|
-
(
|
|
67044
|
+
(resolve85) => setTimeout(resolve85, _BrowserLeasePool.DRAIN_FORCE_CLOSE_MS).unref()
|
|
67045
67045
|
);
|
|
67046
67046
|
this.drainPromise = Promise.race([settle, bound]).then(() => {
|
|
67047
67047
|
for (const entry of entries2) if (this.entries.has(entry)) this.requestClose(entry, true);
|
|
@@ -67140,11 +67140,11 @@ var init_browserLeasePool = __esm({
|
|
|
67140
67140
|
await Promise.race([
|
|
67141
67141
|
this.options.close(result.browser).catch(() => {
|
|
67142
67142
|
}),
|
|
67143
|
-
new Promise((
|
|
67143
|
+
new Promise((resolve85) => {
|
|
67144
67144
|
entry.forceClose = () => {
|
|
67145
67145
|
entry.forceClose = void 0;
|
|
67146
67146
|
this.options.forceClose(result.browser);
|
|
67147
|
-
|
|
67147
|
+
resolve85();
|
|
67148
67148
|
};
|
|
67149
67149
|
})
|
|
67150
67150
|
]);
|
|
@@ -67715,7 +67715,7 @@ async function assertWebGpuAdapterAvailable(page, requiresWebGpu) {
|
|
|
67715
67715
|
try {
|
|
67716
67716
|
const adapter2 = await Promise.race([
|
|
67717
67717
|
navigator.gpu.requestAdapter(),
|
|
67718
|
-
new Promise((
|
|
67718
|
+
new Promise((resolve85) => setTimeout(() => resolve85(null), timeoutMs))
|
|
67719
67719
|
]);
|
|
67720
67720
|
return !!adapter2 && !adapter2.info.isFallbackAdapter;
|
|
67721
67721
|
} catch {
|
|
@@ -68748,8 +68748,8 @@ async function probeBeginFrameLiveness(page, timeoutMs, frameTimeTicks, interval
|
|
|
68748
68748
|
try {
|
|
68749
68749
|
return await Promise.race([
|
|
68750
68750
|
client.send("HeadlessExperimental.beginFrame", params).then(() => true).catch(() => false),
|
|
68751
|
-
new Promise((
|
|
68752
|
-
timer = setTimeout(() =>
|
|
68751
|
+
new Promise((resolve85) => {
|
|
68752
|
+
timer = setTimeout(() => resolve85(false), timeoutMs);
|
|
68753
68753
|
})
|
|
68754
68754
|
]);
|
|
68755
68755
|
} finally {
|
|
@@ -69529,7 +69529,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
|
|
|
69529
69529
|
);
|
|
69530
69530
|
}
|
|
69531
69531
|
const frameId = ++state.nextId;
|
|
69532
|
-
const encodeResult = new Promise((
|
|
69532
|
+
const encodeResult = new Promise((resolve85, reject2) => {
|
|
69533
69533
|
const timer = setTimeout(() => {
|
|
69534
69534
|
if (state.pending.delete(frameId)) {
|
|
69535
69535
|
reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
|
|
@@ -69538,7 +69538,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
|
|
|
69538
69538
|
state.pending.set(frameId, {
|
|
69539
69539
|
resolve: (b2) => {
|
|
69540
69540
|
clearTimeout(timer);
|
|
69541
|
-
|
|
69541
|
+
resolve85(b2);
|
|
69542
69542
|
},
|
|
69543
69543
|
reject: (e2) => {
|
|
69544
69544
|
clearTimeout(timer);
|
|
@@ -69694,7 +69694,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
|
|
|
69694
69694
|
for (let i = 0; i < times.length; i++) {
|
|
69695
69695
|
const frameId = ++state.nextId;
|
|
69696
69696
|
fids.push(frameId);
|
|
69697
|
-
const p2 = new Promise((
|
|
69697
|
+
const p2 = new Promise((resolve85, reject2) => {
|
|
69698
69698
|
const timer = setTimeout(() => {
|
|
69699
69699
|
if (state.pending.delete(frameId)) {
|
|
69700
69700
|
reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
|
|
@@ -69703,7 +69703,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
|
|
|
69703
69703
|
state.pending.set(frameId, {
|
|
69704
69704
|
resolve: (b2) => {
|
|
69705
69705
|
clearTimeout(timer);
|
|
69706
|
-
|
|
69706
|
+
resolve85(b2);
|
|
69707
69707
|
},
|
|
69708
69708
|
reject: (e2) => {
|
|
69709
69709
|
clearTimeout(timer);
|
|
@@ -69986,9 +69986,9 @@ async function initThreeDProjectionInPage() {
|
|
|
69986
69986
|
const toDataUrl = async (url) => {
|
|
69987
69987
|
const resp = await fetch(url);
|
|
69988
69988
|
const blob = await resp.blob();
|
|
69989
|
-
return new Promise((
|
|
69989
|
+
return new Promise((resolve85, reject2) => {
|
|
69990
69990
|
const r = new FileReader();
|
|
69991
|
-
r.onload = () =>
|
|
69991
|
+
r.onload = () => resolve85(String(r.result));
|
|
69992
69992
|
r.onerror = () => reject2(new Error(`FileReader failed for ${url}`));
|
|
69993
69993
|
r.readAsDataURL(blob);
|
|
69994
69994
|
});
|
|
@@ -71365,10 +71365,10 @@ async function waitForCloseWithTimeout(promise) {
|
|
|
71365
71365
|
() => void 0,
|
|
71366
71366
|
() => void 0
|
|
71367
71367
|
),
|
|
71368
|
-
new Promise((
|
|
71368
|
+
new Promise((resolve85) => {
|
|
71369
71369
|
timer = setTimeout(() => {
|
|
71370
71370
|
timedOut = true;
|
|
71371
|
-
|
|
71371
|
+
resolve85();
|
|
71372
71372
|
}, CAPTURE_SESSION_CLOSE_TIMEOUT_MS);
|
|
71373
71373
|
})
|
|
71374
71374
|
]);
|
|
@@ -71790,7 +71790,7 @@ async function pollHfReady(page, timeoutMs, intervalMs = 100) {
|
|
|
71790
71790
|
}
|
|
71791
71791
|
}
|
|
71792
71792
|
}
|
|
71793
|
-
await new Promise((
|
|
71793
|
+
await new Promise((resolve85) => setTimeout(resolve85, intervalMs));
|
|
71794
71794
|
}
|
|
71795
71795
|
const diag2 = await evaluateHfDiagnostic(page);
|
|
71796
71796
|
if (diag2.hasSeek && diag2.duration === 0) {
|
|
@@ -71831,7 +71831,7 @@ async function pollSubCompositionTimelines(page, timeoutMs, intervalMs = 150, ge
|
|
|
71831
71831
|
);
|
|
71832
71832
|
break;
|
|
71833
71833
|
}
|
|
71834
|
-
await new Promise((
|
|
71834
|
+
await new Promise((resolve85) => setTimeout(resolve85, intervalMs));
|
|
71835
71835
|
}
|
|
71836
71836
|
if (ready) {
|
|
71837
71837
|
await page.evaluate(`(function() {
|
|
@@ -71880,7 +71880,7 @@ async function pollVideosReady(page, skipIds, timeoutMs, intervalMs = 100) {
|
|
|
71880
71880
|
const deadline = Date.now() + timeoutMs;
|
|
71881
71881
|
while (Date.now() < deadline) {
|
|
71882
71882
|
if (await check()) return true;
|
|
71883
|
-
await new Promise((
|
|
71883
|
+
await new Promise((resolve85) => setTimeout(resolve85, intervalMs));
|
|
71884
71884
|
}
|
|
71885
71885
|
return check();
|
|
71886
71886
|
}
|
|
@@ -71903,7 +71903,7 @@ async function pollImagesReady(page, timeoutMs, intervalMs = 100) {
|
|
|
71903
71903
|
const deadline = Date.now() + timeoutMs;
|
|
71904
71904
|
while (Date.now() < deadline) {
|
|
71905
71905
|
if (await check()) return true;
|
|
71906
|
-
await new Promise((
|
|
71906
|
+
await new Promise((resolve85) => setTimeout(resolve85, intervalMs));
|
|
71907
71907
|
}
|
|
71908
71908
|
return check();
|
|
71909
71909
|
}
|
|
@@ -72031,7 +72031,7 @@ async function waitForOptionalTailwindReady(page, timeoutMs) {
|
|
|
72031
72031
|
page.evaluate(
|
|
72032
72032
|
`Promise.resolve(window.__tailwindReady).then(() => true, () => false)`
|
|
72033
72033
|
),
|
|
72034
|
-
new Promise((
|
|
72034
|
+
new Promise((resolve85) => setTimeout(() => resolve85(false), timeoutMs))
|
|
72035
72035
|
]);
|
|
72036
72036
|
if (!ready) {
|
|
72037
72037
|
throw new Error(
|
|
@@ -73626,7 +73626,7 @@ var init_frameCapture = __esm({
|
|
|
73626
73626
|
BROWSER_CONSOLE_BUFFER_SIZE = 200;
|
|
73627
73627
|
CAPTURE_SESSION_CLOSE_TIMEOUT_MS = 5e3;
|
|
73628
73628
|
LOCKED_WARMUP_TICKS = 60;
|
|
73629
|
-
realSleep = (ms) => new Promise((
|
|
73629
|
+
realSleep = (ms) => new Promise((resolve85) => setTimeout(resolve85, ms));
|
|
73630
73630
|
BEGIN_FRAME_CAPTURE_HEADROOM_INTERVALS = 10;
|
|
73631
73631
|
BEGIN_FRAME_COMMIT_LEAD_INTERVALS = 6;
|
|
73632
73632
|
BEGIN_FRAME_PROBE_LEAD_INTERVALS = 5;
|
|
@@ -73709,8 +73709,8 @@ var init_managedChildProcess = __esm({
|
|
|
73709
73709
|
this.options = options;
|
|
73710
73710
|
this.now = options.now ?? Date.now;
|
|
73711
73711
|
this.startedAtMs = this.now();
|
|
73712
|
-
this.outcomePromise = new Promise((
|
|
73713
|
-
this.resolveOutcome =
|
|
73712
|
+
this.outcomePromise = new Promise((resolve85) => {
|
|
73713
|
+
this.resolveOutcome = resolve85;
|
|
73714
73714
|
});
|
|
73715
73715
|
child.stderr?.on("data", this.onStderr);
|
|
73716
73716
|
child.once("spawn", this.onSpawn);
|
|
@@ -75604,12 +75604,12 @@ function createFrameReorderBuffer(startFrame, endFrame) {
|
|
|
75604
75604
|
let cursor = startFrame;
|
|
75605
75605
|
let aborted = null;
|
|
75606
75606
|
const pending = /* @__PURE__ */ new Map();
|
|
75607
|
-
const enqueueAt = (frame,
|
|
75607
|
+
const enqueueAt = (frame, resolve85, reject2) => {
|
|
75608
75608
|
const list = pending.get(frame);
|
|
75609
75609
|
if (list === void 0) {
|
|
75610
|
-
pending.set(frame, [{ resolve:
|
|
75610
|
+
pending.set(frame, [{ resolve: resolve85, reject: reject2 }]);
|
|
75611
75611
|
} else {
|
|
75612
|
-
list.push({ resolve:
|
|
75612
|
+
list.push({ resolve: resolve85, reject: reject2 });
|
|
75613
75613
|
}
|
|
75614
75614
|
};
|
|
75615
75615
|
const flushAt = (frame) => {
|
|
@@ -75618,31 +75618,31 @@ function createFrameReorderBuffer(startFrame, endFrame) {
|
|
|
75618
75618
|
pending.delete(frame);
|
|
75619
75619
|
for (const waiter of list) waiter.resolve();
|
|
75620
75620
|
};
|
|
75621
|
-
const waitForFrame = (frame) => new Promise((
|
|
75621
|
+
const waitForFrame = (frame) => new Promise((resolve85, reject2) => {
|
|
75622
75622
|
if (aborted) {
|
|
75623
75623
|
reject2(aborted);
|
|
75624
75624
|
return;
|
|
75625
75625
|
}
|
|
75626
75626
|
if (frame === cursor) {
|
|
75627
|
-
|
|
75627
|
+
resolve85();
|
|
75628
75628
|
return;
|
|
75629
75629
|
}
|
|
75630
|
-
enqueueAt(frame,
|
|
75630
|
+
enqueueAt(frame, resolve85, reject2);
|
|
75631
75631
|
});
|
|
75632
75632
|
const advanceTo = (frame) => {
|
|
75633
75633
|
cursor = frame;
|
|
75634
75634
|
flushAt(frame);
|
|
75635
75635
|
};
|
|
75636
|
-
const waitForAllDone = () => new Promise((
|
|
75636
|
+
const waitForAllDone = () => new Promise((resolve85, reject2) => {
|
|
75637
75637
|
if (aborted) {
|
|
75638
75638
|
reject2(aborted);
|
|
75639
75639
|
return;
|
|
75640
75640
|
}
|
|
75641
75641
|
if (cursor >= endFrame) {
|
|
75642
|
-
|
|
75642
|
+
resolve85();
|
|
75643
75643
|
return;
|
|
75644
75644
|
}
|
|
75645
|
-
enqueueAt(endFrame,
|
|
75645
|
+
enqueueAt(endFrame, resolve85, reject2);
|
|
75646
75646
|
});
|
|
75647
75647
|
const abort = (err) => {
|
|
75648
75648
|
if (aborted) return;
|
|
@@ -75932,8 +75932,8 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
|
|
|
75932
75932
|
close: async () => {
|
|
75933
75933
|
const stdin = ffmpeg.stdin;
|
|
75934
75934
|
if (stdin && !stdin.destroyed) {
|
|
75935
|
-
await new Promise((
|
|
75936
|
-
stdin.end(() =>
|
|
75935
|
+
await new Promise((resolve85) => {
|
|
75936
|
+
stdin.end(() => resolve85());
|
|
75937
75937
|
});
|
|
75938
75938
|
}
|
|
75939
75939
|
const outcome = await exitPromise;
|
|
@@ -76270,7 +76270,7 @@ function classifyDownloadFailure(error) {
|
|
|
76270
76270
|
return new UrlDownloadError(
|
|
76271
76271
|
"network",
|
|
76272
76272
|
true,
|
|
76273
|
-
|
|
76273
|
+
`Download failed due to a transient network error${describeCause(current2)}`
|
|
76274
76274
|
);
|
|
76275
76275
|
}
|
|
76276
76276
|
current2 = typeof current2 === "object" && current2 !== null && "cause" in current2 ? current2.cause : void 0;
|
|
@@ -76278,9 +76278,16 @@ function classifyDownloadFailure(error) {
|
|
|
76278
76278
|
return new UrlDownloadError(
|
|
76279
76279
|
"filesystem",
|
|
76280
76280
|
false,
|
|
76281
|
-
|
|
76281
|
+
`Download failed while writing the local artifact${describeCause(error)}`
|
|
76282
76282
|
);
|
|
76283
76283
|
}
|
|
76284
|
+
function describeCause(error) {
|
|
76285
|
+
const name = error instanceof Error && /^[A-Za-z]{1,40}$/.test(error.name) ? error.name : "";
|
|
76286
|
+
const rawCode = typeof error === "object" && error !== null && "code" in error ? error.code : void 0;
|
|
76287
|
+
const code = typeof rawCode === "string" && /^[A-Z0-9_]{1,40}$/.test(rawCode) ? rawCode : "";
|
|
76288
|
+
const tag = [name, code].filter(Boolean).join(" ");
|
|
76289
|
+
return tag ? ` (${tag})` : "";
|
|
76290
|
+
}
|
|
76284
76291
|
function isRetryableNetworkCause(error) {
|
|
76285
76292
|
const message = error instanceof Error ? error.message : String(error);
|
|
76286
76293
|
const code = typeof error === "object" && error !== null && "code" in error && typeof error.code === "string" ? error.code : "";
|
|
@@ -76357,10 +76364,10 @@ async function waitForCacheLock(signal) {
|
|
|
76357
76364
|
if (signal?.aborted) {
|
|
76358
76365
|
throw new UrlDownloadError("cancelled", false, "Download cancelled");
|
|
76359
76366
|
}
|
|
76360
|
-
await new Promise((
|
|
76367
|
+
await new Promise((resolve85, reject2) => {
|
|
76361
76368
|
const timeout = setTimeout(() => {
|
|
76362
76369
|
signal?.removeEventListener("abort", onAbort);
|
|
76363
|
-
|
|
76370
|
+
resolve85();
|
|
76364
76371
|
}, CACHE_LOCK_POLL_MS);
|
|
76365
76372
|
const onAbort = () => {
|
|
76366
76373
|
clearTimeout(timeout);
|
|
@@ -81520,7 +81527,7 @@ var require_processor = __commonJS({
|
|
|
81520
81527
|
if (options === void 0) {
|
|
81521
81528
|
options = {};
|
|
81522
81529
|
}
|
|
81523
|
-
return new Promise(function(
|
|
81530
|
+
return new Promise(function(resolve85, reject2) {
|
|
81524
81531
|
try {
|
|
81525
81532
|
var root_1 = _this._root(rule, options);
|
|
81526
81533
|
Promise.resolve(_this.func(root_1)).then(function(transform) {
|
|
@@ -81530,7 +81537,7 @@ var require_processor = __commonJS({
|
|
|
81530
81537
|
rule.selector = string;
|
|
81531
81538
|
}
|
|
81532
81539
|
return { transform, root: root_1, string };
|
|
81533
|
-
}).then(
|
|
81540
|
+
}).then(resolve85, reject2);
|
|
81534
81541
|
} catch (e2) {
|
|
81535
81542
|
reject2(e2);
|
|
81536
81543
|
return;
|
|
@@ -82223,14 +82230,14 @@ function inlineHelper2(call, ctx) {
|
|
|
82223
82230
|
};
|
|
82224
82231
|
return expandBody2(fn.body.body, bindings, prov, ctx);
|
|
82225
82232
|
}
|
|
82226
|
-
function assignStep2(update2,
|
|
82227
|
-
if (update2.operator === "+=") return asNum2(
|
|
82233
|
+
function assignStep2(update2, resolve85) {
|
|
82234
|
+
if (update2.operator === "+=") return asNum2(resolve85(update2.right));
|
|
82228
82235
|
if (update2.operator === "-=") {
|
|
82229
|
-
const s = asNum2(
|
|
82236
|
+
const s = asNum2(resolve85(update2.right));
|
|
82230
82237
|
return s === void 0 ? void 0 : -s;
|
|
82231
82238
|
}
|
|
82232
82239
|
if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
|
|
82233
|
-
return asNum2(
|
|
82240
|
+
return asNum2(resolve85(update2.right.right));
|
|
82234
82241
|
}
|
|
82235
82242
|
return void 0;
|
|
82236
82243
|
}
|
|
@@ -82239,10 +82246,10 @@ function updatedVarName2(update2) {
|
|
|
82239
82246
|
if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
|
|
82240
82247
|
return null;
|
|
82241
82248
|
}
|
|
82242
|
-
function loopStep2(update2, varName,
|
|
82249
|
+
function loopStep2(update2, varName, resolve85) {
|
|
82243
82250
|
if (updatedVarName2(update2) !== varName) return void 0;
|
|
82244
82251
|
if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
|
|
82245
|
-
return assignStep2(update2,
|
|
82252
|
+
return assignStep2(update2, resolve85);
|
|
82246
82253
|
}
|
|
82247
82254
|
function asNum2(v2) {
|
|
82248
82255
|
return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
|
|
@@ -82259,13 +82266,13 @@ function forInitVar2(init) {
|
|
|
82259
82266
|
const d2 = init.declarations[0];
|
|
82260
82267
|
return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
|
|
82261
82268
|
}
|
|
82262
|
-
function parseForHeader2(stmt,
|
|
82269
|
+
function parseForHeader2(stmt, resolve85) {
|
|
82263
82270
|
const iv = forInitVar2(stmt.init);
|
|
82264
82271
|
const test = stmt.test;
|
|
82265
82272
|
if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
|
|
82266
|
-
const start = asNum2(
|
|
82267
|
-
const end = asNum2(
|
|
82268
|
-
const step = loopStep2(stmt.update, iv.name,
|
|
82273
|
+
const start = asNum2(resolve85(iv.initExpr));
|
|
82274
|
+
const end = asNum2(resolve85(test.right));
|
|
82275
|
+
const step = loopStep2(stmt.update, iv.name, resolve85);
|
|
82269
82276
|
if (start === void 0 || end === void 0 || !step) return null;
|
|
82270
82277
|
return { v: iv.name, start, end, op: test.operator, step };
|
|
82271
82278
|
}
|
|
@@ -82377,12 +82384,12 @@ function expandStatements2(stmts, ctx) {
|
|
|
82377
82384
|
}
|
|
82378
82385
|
return out;
|
|
82379
82386
|
}
|
|
82380
|
-
function inlineComputedTimelines2(ast, timelineVar,
|
|
82387
|
+
function inlineComputedTimelines2(ast, timelineVar, resolve85) {
|
|
82381
82388
|
const helpers = collectInlinableHelpers2(ast, timelineVar);
|
|
82382
82389
|
const ctx = {
|
|
82383
82390
|
helpers,
|
|
82384
82391
|
timelineVar,
|
|
82385
|
-
resolve:
|
|
82392
|
+
resolve: resolve85,
|
|
82386
82393
|
depth: 0,
|
|
82387
82394
|
site: { n: 0 },
|
|
82388
82395
|
order: { n: 0 },
|
|
@@ -96168,7 +96175,7 @@ function shouldVerifyWorkerGpu(workerId, config) {
|
|
|
96168
96175
|
}
|
|
96169
96176
|
function withParallelWorkerDeadline(promise, diagnostic, timeoutMs, signal) {
|
|
96170
96177
|
if (signal?.aborted) return Promise.reject(new Error("Parallel worker cancelled"));
|
|
96171
|
-
return new Promise((
|
|
96178
|
+
return new Promise((resolve85, reject2) => {
|
|
96172
96179
|
let timer;
|
|
96173
96180
|
const cleanup = () => {
|
|
96174
96181
|
if (timer) clearTimeout(timer);
|
|
@@ -96193,7 +96200,7 @@ function withParallelWorkerDeadline(promise, diagnostic, timeoutMs, signal) {
|
|
|
96193
96200
|
promise.then(
|
|
96194
96201
|
(value) => {
|
|
96195
96202
|
cleanup();
|
|
96196
|
-
|
|
96203
|
+
resolve85(value);
|
|
96197
96204
|
},
|
|
96198
96205
|
(error) => {
|
|
96199
96206
|
cleanup();
|
|
@@ -96691,11 +96698,11 @@ function createFileServer(options) {
|
|
|
96691
96698
|
headers: { "Content-Type": contentType }
|
|
96692
96699
|
});
|
|
96693
96700
|
});
|
|
96694
|
-
return new Promise((
|
|
96701
|
+
return new Promise((resolve85) => {
|
|
96695
96702
|
const server = serve({ fetch: app.fetch, port }, (info) => {
|
|
96696
96703
|
const actualPort = info.port;
|
|
96697
96704
|
const url = `http://localhost:${actualPort}`;
|
|
96698
|
-
|
|
96705
|
+
resolve85({
|
|
96699
96706
|
url,
|
|
96700
96707
|
port: actualPort,
|
|
96701
96708
|
close: () => server.close()
|
|
@@ -104895,7 +104902,7 @@ var require_compile = __commonJS({
|
|
|
104895
104902
|
const schOrFunc = root.refs[ref2];
|
|
104896
104903
|
if (schOrFunc)
|
|
104897
104904
|
return schOrFunc;
|
|
104898
|
-
let _sch =
|
|
104905
|
+
let _sch = resolve85.call(this, root, ref2);
|
|
104899
104906
|
if (_sch === void 0) {
|
|
104900
104907
|
const schema = (_a3 = root.localRefs) === null || _a3 === void 0 ? void 0 : _a3[ref2];
|
|
104901
104908
|
const { schemaId } = this.opts;
|
|
@@ -104922,7 +104929,7 @@ var require_compile = __commonJS({
|
|
|
104922
104929
|
function sameSchemaEnv(s1, s2) {
|
|
104923
104930
|
return s1.schema === s2.schema && s1.root === s2.root && s1.baseId === s2.baseId;
|
|
104924
104931
|
}
|
|
104925
|
-
function
|
|
104932
|
+
function resolve85(root, ref2) {
|
|
104926
104933
|
let sch;
|
|
104927
104934
|
while (typeof (sch = this.refs[ref2]) == "string")
|
|
104928
104935
|
ref2 = sch;
|
|
@@ -105553,7 +105560,7 @@ var require_fast_uri = __commonJS({
|
|
|
105553
105560
|
}
|
|
105554
105561
|
return uri;
|
|
105555
105562
|
}
|
|
105556
|
-
function
|
|
105563
|
+
function resolve85(baseURI, relativeURI, options) {
|
|
105557
105564
|
const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
|
|
105558
105565
|
const resolved2 = resolveComponent(parse10(baseURI, schemelessOptions), parse10(relativeURI, schemelessOptions), schemelessOptions, true);
|
|
105559
105566
|
schemelessOptions.skipEscape = true;
|
|
@@ -105811,7 +105818,7 @@ var require_fast_uri = __commonJS({
|
|
|
105811
105818
|
var fastUri = {
|
|
105812
105819
|
SCHEMES,
|
|
105813
105820
|
normalize: normalize3,
|
|
105814
|
-
resolve:
|
|
105821
|
+
resolve: resolve85,
|
|
105815
105822
|
resolveComponent,
|
|
105816
105823
|
equal,
|
|
105817
105824
|
serialize,
|
|
@@ -109414,7 +109421,7 @@ async function fetchWithRetry(url, attempts = 3) {
|
|
|
109414
109421
|
} catch (err) {
|
|
109415
109422
|
lastErr = err;
|
|
109416
109423
|
if (attempt === attempts || !isRetryableTransport(err)) break;
|
|
109417
|
-
await new Promise((
|
|
109424
|
+
await new Promise((resolve85) => setTimeout(resolve85, 150 * attempt));
|
|
109418
109425
|
}
|
|
109419
109426
|
}
|
|
109420
109427
|
throw lastErr;
|
|
@@ -110206,7 +110213,7 @@ function processGroupIsAlive(pid) {
|
|
|
110206
110213
|
return processIsAlive(-pid);
|
|
110207
110214
|
}
|
|
110208
110215
|
function waitForDelay(delayMs) {
|
|
110209
|
-
return new Promise((
|
|
110216
|
+
return new Promise((resolve85) => setTimeout(resolve85, delayMs));
|
|
110210
110217
|
}
|
|
110211
110218
|
async function waitForProcessGroupExit(pid) {
|
|
110212
110219
|
while (processGroupIsAlive(pid)) await waitForDelay(20);
|
|
@@ -110215,14 +110222,14 @@ function windowsProcessTreeKillArgs(pid) {
|
|
|
110215
110222
|
return ["/PID", String(pid), "/T", "/F"];
|
|
110216
110223
|
}
|
|
110217
110224
|
function terminateWindowsProcessTree(pid, spawnProcess = (command2, args, options) => spawn6(command2, [...args], options)) {
|
|
110218
|
-
return new Promise((
|
|
110225
|
+
return new Promise((resolve85, reject2) => {
|
|
110219
110226
|
const killer = spawnProcess("taskkill", windowsProcessTreeKillArgs(pid), {
|
|
110220
110227
|
stdio: "ignore",
|
|
110221
110228
|
windowsHide: true
|
|
110222
110229
|
});
|
|
110223
110230
|
killer.once("error", reject2);
|
|
110224
110231
|
killer.once("close", (status) => {
|
|
110225
|
-
if (status === 0)
|
|
110232
|
+
if (status === 0) resolve85();
|
|
110226
110233
|
else reject2(new Error(`taskkill exited with status ${status ?? "unknown"}`));
|
|
110227
110234
|
});
|
|
110228
110235
|
});
|
|
@@ -110303,7 +110310,7 @@ import { fileURLToPath as fileURLToPath2 } from "url";
|
|
|
110303
110310
|
function runCancellableProcess(command2, args, options = {}) {
|
|
110304
110311
|
const signal = options.signal;
|
|
110305
110312
|
signal?.throwIfAborted();
|
|
110306
|
-
return new Promise((
|
|
110313
|
+
return new Promise((resolve85, reject2) => {
|
|
110307
110314
|
let child;
|
|
110308
110315
|
try {
|
|
110309
110316
|
const spawnOptions = {
|
|
@@ -110405,7 +110412,7 @@ function runCancellableProcess(command2, args, options = {}) {
|
|
|
110405
110412
|
return;
|
|
110406
110413
|
}
|
|
110407
110414
|
if (status === 0) {
|
|
110408
|
-
|
|
110415
|
+
resolve85({ stdout: stdout2, stderr });
|
|
110409
110416
|
return;
|
|
110410
110417
|
}
|
|
110411
110418
|
reject2(
|
|
@@ -110605,7 +110612,7 @@ function downloadFile(url, dest, options = {}) {
|
|
|
110605
110612
|
const tmp = `${dest}.${process.pid}.${randomUUID6()}.tmp`;
|
|
110606
110613
|
const timeoutMs = options.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS;
|
|
110607
110614
|
const maxBytes = options.maxBytes;
|
|
110608
|
-
return new Promise((
|
|
110615
|
+
return new Promise((resolve85, reject2) => {
|
|
110609
110616
|
const follow = (u, hops = 0) => {
|
|
110610
110617
|
let activeResponse;
|
|
110611
110618
|
let responsePipelineStarted = false;
|
|
@@ -110646,7 +110653,7 @@ function downloadFile(url, dest, options = {}) {
|
|
|
110646
110653
|
const transfer = maxBytes === void 0 ? pipeline2(res, file) : pipeline2(res, enforceByteLimit(maxBytes), file);
|
|
110647
110654
|
transfer.then(() => {
|
|
110648
110655
|
renameSync5(tmp, dest);
|
|
110649
|
-
|
|
110656
|
+
resolve85();
|
|
110650
110657
|
}).catch((err) => {
|
|
110651
110658
|
removePartialFile(tmp);
|
|
110652
110659
|
reject2(requestError ?? err);
|
|
@@ -112060,8 +112067,6 @@ function printStalePinNotice(cwd = process.cwd()) {
|
|
|
112060
112067
|
if (isDevMode()) return;
|
|
112061
112068
|
if (process.env["CI"] === "true" || process.env["CI"] === "1") return;
|
|
112062
112069
|
if (process.env["HYPERFRAMES_NO_UPDATE_CHECK"] === "1") return;
|
|
112063
|
-
const latest = getUpdateMeta().latestVersion;
|
|
112064
|
-
if (!latest || !isSafeVersion(latest)) return;
|
|
112065
112070
|
let scripts = {};
|
|
112066
112071
|
try {
|
|
112067
112072
|
const pkgPath = join32(cwd, "package.json");
|
|
@@ -112070,7 +112075,21 @@ function printStalePinNotice(cwd = process.cwd()) {
|
|
|
112070
112075
|
} catch {
|
|
112071
112076
|
return;
|
|
112072
112077
|
}
|
|
112073
|
-
const
|
|
112078
|
+
const pins = readPinnedHyperframesVersions(scripts);
|
|
112079
|
+
const newerPins = pins.filter((v2) => isNewerSemver(v2, VERSION)).sort(compareVersions2);
|
|
112080
|
+
if (newerPins.length > 0) {
|
|
112081
|
+
process.stderr.write(
|
|
112082
|
+
`
|
|
112083
|
+
This is hyperframes ${VERSION}, but this project pins hyperframes@${newerPins.join(", ")}.
|
|
112084
|
+
Run it through the project's npm scripts, or npx hyperframes@${newerPins.at(-1)}.
|
|
112085
|
+
|
|
112086
|
+
`
|
|
112087
|
+
);
|
|
112088
|
+
return;
|
|
112089
|
+
}
|
|
112090
|
+
const latest = getUpdateMeta().latestVersion;
|
|
112091
|
+
if (!latest || !isSafeVersion(latest)) return;
|
|
112092
|
+
const stale = pins.filter((v2) => {
|
|
112074
112093
|
try {
|
|
112075
112094
|
return compareVersions2(latest, v2) > 0;
|
|
112076
112095
|
} catch {
|
|
@@ -112825,7 +112844,7 @@ function hasGit2() {
|
|
|
112825
112844
|
}
|
|
112826
112845
|
function spawnNpx(args, opts = {}) {
|
|
112827
112846
|
const npx = buildNpxCommand(args);
|
|
112828
|
-
return new Promise((
|
|
112847
|
+
return new Promise((resolve85, reject2) => {
|
|
112829
112848
|
const child = spawn8(npx.command, npx.args, {
|
|
112830
112849
|
// Route the child's stdout to the parent's stderr (fd 2), keeping stdin
|
|
112831
112850
|
// inherited. `skills update --json` runs this installer before printing its
|
|
@@ -112854,7 +112873,7 @@ function spawnNpx(args, opts = {}) {
|
|
|
112854
112873
|
}
|
|
112855
112874
|
});
|
|
112856
112875
|
child.on("close", (code, signal) => {
|
|
112857
|
-
if (code === 0)
|
|
112876
|
+
if (code === 0) resolve85();
|
|
112858
112877
|
else if (signal === "SIGINT" || code === 130)
|
|
112859
112878
|
reject2(new CliResultSignal({ exitCode: 0, kind: "success", presented: true }));
|
|
112860
112879
|
else reject2(new Error(`npx ${args.join(" ")} exited with code ${code}`));
|
|
@@ -122868,7 +122887,10 @@ import { streamSSE } from "hono/streaming";
|
|
|
122868
122887
|
import { existsSync as existsSync62, readFileSync as readFileSync102, mkdirSync as mkdirSync42, unlinkSync as unlinkSync32, readdirSync as readdirSync52, statSync as statSync62 } from "fs";
|
|
122869
122888
|
import { join as join102 } from "path";
|
|
122870
122889
|
import {
|
|
122890
|
+
closeSync as closeSync32,
|
|
122871
122891
|
existsSync as existsSync72,
|
|
122892
|
+
fstatSync as fstatSync32,
|
|
122893
|
+
openSync as openSync32,
|
|
122872
122894
|
mkdirSync as mkdirSync52,
|
|
122873
122895
|
readFileSync as readFileSync122,
|
|
122874
122896
|
readdirSync as readdirSync62,
|
|
@@ -122882,8 +122904,8 @@ import { join as join112 } from "path";
|
|
|
122882
122904
|
import { createHash as createHash42, randomUUID as randomUUID42 } from "crypto";
|
|
122883
122905
|
import { readFileSync as readFileSync112 } from "fs";
|
|
122884
122906
|
import { existsSync as existsSync82, readFileSync as readFileSync132, statSync as statSync82 } from "fs";
|
|
122885
|
-
import { join as join122 } from "path";
|
|
122886
|
-
import { closeSync as
|
|
122907
|
+
import { join as join122, resolve as resolve52 } from "path";
|
|
122908
|
+
import { closeSync as closeSync42, constants as constants22, fstatSync as fstatSync42, openSync as openSync42, readSync as readSync2 } from "fs";
|
|
122887
122909
|
import { streamSSE as streamSSE2 } from "hono/streaming";
|
|
122888
122910
|
import { existsSync as existsSync92, mkdirSync as mkdirSync62 } from "fs";
|
|
122889
122911
|
import { basename as basename22, dirname as dirname42, extname as extname22, join as join132 } from "path";
|
|
@@ -123591,6 +123613,12 @@ function resolveGsapWriter(env) {
|
|
|
123591
123613
|
if (configured === "recast" || configured === "acorn") return configured;
|
|
123592
123614
|
throw new Error(`Invalid ${GSAP_WRITER_MIGRATION.flag}=${configured}; expected recast or acorn`);
|
|
123593
123615
|
}
|
|
123616
|
+
function requestSubPath(url, route) {
|
|
123617
|
+
const routeSegments = route.split("/");
|
|
123618
|
+
const segments = new URL(url).pathname.split("/");
|
|
123619
|
+
const start = segments.indexOf(routeSegments[0] ?? "");
|
|
123620
|
+
return decodeURIComponent(segments.slice(start + routeSegments.length).join("/"));
|
|
123621
|
+
}
|
|
123594
123622
|
async function loadGsapParser() {
|
|
123595
123623
|
return Promise.resolve().then(() => (init_gsapParser(), gsapParser_exports));
|
|
123596
123624
|
}
|
|
@@ -123612,7 +123640,7 @@ function isDanglingSymlinkInProject(projectDir, lexicalPath) {
|
|
|
123612
123640
|
return true;
|
|
123613
123641
|
}
|
|
123614
123642
|
}
|
|
123615
|
-
async function resolveProjectPath(c3, adapter2,
|
|
123643
|
+
async function resolveProjectPath(c3, adapter2, route, opts) {
|
|
123616
123644
|
const id = c3.req.param("id");
|
|
123617
123645
|
const project = await adapter2.resolveProject(id);
|
|
123618
123646
|
if (!project) {
|
|
@@ -123623,7 +123651,7 @@ async function resolveProjectPath(c3, adapter2, pathPrefix, opts) {
|
|
|
123623
123651
|
error: c3.json({ error: "not found", why: "project_dir_missing" }, 404)
|
|
123624
123652
|
};
|
|
123625
123653
|
}
|
|
123626
|
-
const filePath =
|
|
123654
|
+
const filePath = requestSubPath(c3.req.url, `projects/:id/${route}`);
|
|
123627
123655
|
if (filePath.includes("\0")) {
|
|
123628
123656
|
return { error: c3.json({ error: "forbidden", why: "nul" }, 403) };
|
|
123629
123657
|
}
|
|
@@ -123640,10 +123668,10 @@ async function resolveProjectPath(c3, adapter2, pathPrefix, opts) {
|
|
|
123640
123668
|
return { project, filePath, absPath };
|
|
123641
123669
|
}
|
|
123642
123670
|
function resolveProjectFile(c3, adapter2, opts) {
|
|
123643
|
-
return resolveProjectPath(c3, adapter2,
|
|
123671
|
+
return resolveProjectPath(c3, adapter2, "files", opts);
|
|
123644
123672
|
}
|
|
123645
123673
|
function resolveFileMutationContext(c3, adapter2, operation) {
|
|
123646
|
-
return resolveProjectPath(c3, adapter2,
|
|
123674
|
+
return resolveProjectPath(c3, adapter2, `file-mutations/${operation}`);
|
|
123647
123675
|
}
|
|
123648
123676
|
function isOptionalInteger(value) {
|
|
123649
123677
|
return value === void 0 || Number.isInteger(value);
|
|
@@ -125682,7 +125710,7 @@ function registerFileRoutes(api, adapter2) {
|
|
|
125682
125710
|
}
|
|
125683
125711
|
);
|
|
125684
125712
|
api.get("/projects/:id/gsap-animations/*", async (c3) => {
|
|
125685
|
-
const res = await resolveProjectPath(c3, adapter2,
|
|
125713
|
+
const res = await resolveProjectPath(c3, adapter2, "gsap-animations", {
|
|
125686
125714
|
mustExist: true
|
|
125687
125715
|
});
|
|
125688
125716
|
if ("error" in res) return res.error;
|
|
@@ -125705,7 +125733,7 @@ function registerFileRoutes(api, adapter2) {
|
|
|
125705
125733
|
return c3.json({ atomicOwnershipPairs: true });
|
|
125706
125734
|
});
|
|
125707
125735
|
api.post("/projects/:id/gsap-mutations/*", async (c3) => {
|
|
125708
|
-
const res = await resolveProjectPath(c3, adapter2,
|
|
125736
|
+
const res = await resolveProjectPath(c3, adapter2, "gsap-mutations", {
|
|
125709
125737
|
mustExist: true
|
|
125710
125738
|
});
|
|
125711
125739
|
if ("error" in res) return res.error;
|
|
@@ -125716,12 +125744,7 @@ function registerFileRoutes(api, adapter2) {
|
|
|
125716
125744
|
return applyGsapMutations(c3, res, [body]);
|
|
125717
125745
|
});
|
|
125718
125746
|
api.post("/projects/:id/gsap-mutations-batch/*", async (c3) => {
|
|
125719
|
-
const res = await resolveProjectPath(
|
|
125720
|
-
c3,
|
|
125721
|
-
adapter2,
|
|
125722
|
-
(id) => `/projects/${id}/gsap-mutations-batch/`,
|
|
125723
|
-
{ mustExist: true }
|
|
125724
|
-
);
|
|
125747
|
+
const res = await resolveProjectPath(c3, adapter2, "gsap-mutations-batch", { mustExist: true });
|
|
125725
125748
|
if ("error" in res) return res.error;
|
|
125726
125749
|
const body = await c3.req.json().catch(() => null);
|
|
125727
125750
|
if (!body || !Array.isArray(body.mutations) || body.mutations.length === 0) {
|
|
@@ -125734,12 +125757,7 @@ function registerFileRoutes(api, adapter2) {
|
|
|
125734
125757
|
return applyGsapMutations(c3, res, body.mutations);
|
|
125735
125758
|
});
|
|
125736
125759
|
api.post("/projects/:id/gsap-mutation-rollback/*", async (c3) => {
|
|
125737
|
-
const res = await resolveProjectPath(
|
|
125738
|
-
c3,
|
|
125739
|
-
adapter2,
|
|
125740
|
-
(id) => `/projects/${id}/gsap-mutation-rollback/`,
|
|
125741
|
-
{ mustExist: true }
|
|
125742
|
-
);
|
|
125760
|
+
const res = await resolveProjectPath(c3, adapter2, "gsap-mutation-rollback", { mustExist: true });
|
|
125743
125761
|
if ("error" in res) return res.error;
|
|
125744
125762
|
const body = await c3.req.json().catch(() => null);
|
|
125745
125763
|
if (!body || typeof body.expected !== "string" || typeof body.restore !== "string") {
|
|
@@ -126239,9 +126257,7 @@ ${runtimeTag}`;
|
|
|
126239
126257
|
const vars = previewVariablesFromRequest(c3.req.query("variables"));
|
|
126240
126258
|
if (vars.error !== void 0) return c3.json({ error: vars.error }, 400);
|
|
126241
126259
|
const previewVariables = vars.values;
|
|
126242
|
-
const compPath =
|
|
126243
|
-
c3.req.path.replace(`/projects/${project.id}/preview/comp/`, "").split("?")[0] ?? ""
|
|
126244
|
-
);
|
|
126260
|
+
const compPath = requestSubPath(c3.req.url, "projects/:id/preview/comp");
|
|
126245
126261
|
const compFile = resolveWithinProject(project.dir, compPath);
|
|
126246
126262
|
if (!compFile || !existsSync52(compFile) || !statSync52(compFile).isFile()) {
|
|
126247
126263
|
return c3.text("not found", 404);
|
|
@@ -126275,9 +126291,7 @@ ${runtimeTag}`;
|
|
|
126275
126291
|
api.get("/projects/:id/preview/*", async (c3) => {
|
|
126276
126292
|
const project = await adapter2.resolveProject(c3.req.param("id"));
|
|
126277
126293
|
if (!project) return c3.json({ error: "not found" }, 404);
|
|
126278
|
-
const subPath =
|
|
126279
|
-
c3.req.path.replace(`/projects/${project.id}/preview/`, "").split("?")[0] ?? ""
|
|
126280
|
-
);
|
|
126294
|
+
const subPath = requestSubPath(c3.req.url, "projects/:id/preview");
|
|
126281
126295
|
const candidate = resolve42(project.dir, subPath);
|
|
126282
126296
|
const file = isWithinProjectRoot(project.dir, candidate) ? candidate : null;
|
|
126283
126297
|
if (!file) {
|
|
@@ -126747,6 +126761,22 @@ function writeThumbnailAtomically(path, buffer) {
|
|
|
126747
126761
|
rmSync42(temporaryPath, { force: true });
|
|
126748
126762
|
}
|
|
126749
126763
|
}
|
|
126764
|
+
function readCompositionSource(file) {
|
|
126765
|
+
let fd;
|
|
126766
|
+
try {
|
|
126767
|
+
fd = openSync32(file, "r");
|
|
126768
|
+
} catch (err) {
|
|
126769
|
+
if (err.code === "ENOENT") return "missing";
|
|
126770
|
+
throw err;
|
|
126771
|
+
}
|
|
126772
|
+
try {
|
|
126773
|
+
const stat = fstatSync32(fd);
|
|
126774
|
+
if (!stat.isFile()) return "not-a-file";
|
|
126775
|
+
return { html: readFileSync122(fd, "utf-8"), mtimeMs: stat.mtimeMs };
|
|
126776
|
+
} finally {
|
|
126777
|
+
closeSync32(fd);
|
|
126778
|
+
}
|
|
126779
|
+
}
|
|
126750
126780
|
function registerThumbnailRoutes(api, adapter2) {
|
|
126751
126781
|
api.get("/projects/:id/thumbnail/*", async (c3) => {
|
|
126752
126782
|
if (!adapter2.generateThumbnail) {
|
|
@@ -126755,10 +126785,11 @@ function registerThumbnailRoutes(api, adapter2) {
|
|
|
126755
126785
|
const resolved2 = await resolveProjectAndSignature(adapter2, c3.req.param("id"));
|
|
126756
126786
|
if (!resolved2) return c3.json({ error: "not found" }, 404);
|
|
126757
126787
|
const { project, signature: projectSignature } = resolved2;
|
|
126758
|
-
let compPath =
|
|
126759
|
-
c3.req.path.replace(`/projects/${project.id}/thumbnail/`, "").split("?")[0] ?? ""
|
|
126760
|
-
);
|
|
126788
|
+
let compPath = requestSubPath(c3.req.url, "projects/:id/thumbnail");
|
|
126761
126789
|
if (compPath && !compPath.includes(".")) compPath += ".html";
|
|
126790
|
+
const htmlFile = resolveWithinProject(project.dir, compPath);
|
|
126791
|
+
const source = htmlFile ? readCompositionSource(htmlFile) : "not-a-file";
|
|
126792
|
+
if (source === "not-a-file") return c3.json({ error: "not found" }, 404);
|
|
126762
126793
|
const inputSignature = compositionInputSignature(project.dir, compPath, projectSignature);
|
|
126763
126794
|
const url = new URL(c3.req.url, `http://${c3.req.header("host") || "localhost"}`);
|
|
126764
126795
|
const rawSeekTime = url.searchParams.get("t");
|
|
@@ -126778,11 +126809,10 @@ function registerThumbnailRoutes(api, adapter2) {
|
|
|
126778
126809
|
let compH = vpHeight || 1080;
|
|
126779
126810
|
let sourceMtime = 0;
|
|
126780
126811
|
let sourceKey = "";
|
|
126781
|
-
|
|
126782
|
-
|
|
126783
|
-
const html = readFileSync122(htmlFile, "utf-8");
|
|
126812
|
+
if (source !== "missing") {
|
|
126813
|
+
const { html } = source;
|
|
126784
126814
|
sourceKey = `_${createHash42("sha1").update(html).digest("hex").slice(0, 16)}`;
|
|
126785
|
-
sourceMtime = Math.round(
|
|
126815
|
+
sourceMtime = Math.round(source.mtimeMs);
|
|
126786
126816
|
if (!vpWidth) {
|
|
126787
126817
|
const wMatch = html.match(/data-width=["'](\d+)["']/);
|
|
126788
126818
|
const hMatch = html.match(/data-height=["'](\d+)["']/);
|
|
@@ -126804,7 +126834,8 @@ function registerThumbnailRoutes(api, adapter2) {
|
|
|
126804
126834
|
motionKey = `_${createHash42("sha1").update(motionContent).digest("hex").slice(0, 16)}`;
|
|
126805
126835
|
sourceMtime = Math.max(sourceMtime, Math.round(statSync72(motionFile).mtimeMs));
|
|
126806
126836
|
}
|
|
126807
|
-
const
|
|
126837
|
+
const projectUrl = `http://${c3.req.header("host")}/api/projects/${encodeURIComponent(project.id)}`;
|
|
126838
|
+
const previewUrl = compPath === "index.html" ? `${projectUrl}/preview` : `${projectUrl}/preview/comp/${compPath.split("/").map(encodeURIComponent).join("/")}`;
|
|
126808
126839
|
const cacheDir = join112(project.dir, ".thumbnails");
|
|
126809
126840
|
const selectorKey = selector ? `_${selector.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 80)}_${selectorIndex ?? 0}` : "";
|
|
126810
126841
|
const urlVersionKey = urlVersion ? `_${urlVersion.replace(/[^a-zA-Z0-9_-]+/g, "_").slice(0, 32)}` : "";
|
|
@@ -126879,10 +126910,11 @@ function registerWaveformRoutes(api, adapter2) {
|
|
|
126879
126910
|
api.get("/projects/:id/waveform/*", async (c3) => {
|
|
126880
126911
|
const project = await adapter2.resolveProject(c3.req.param("id"));
|
|
126881
126912
|
if (!project) return c3.json({ error: "not found" }, 404);
|
|
126882
|
-
const assetPath =
|
|
126883
|
-
|
|
126884
|
-
)
|
|
126885
|
-
|
|
126913
|
+
const assetPath = requestSubPath(c3.req.url, "projects/:id/waveform");
|
|
126914
|
+
const audioPath = resolve52(project.dir, assetPath);
|
|
126915
|
+
if (!isWithinProjectRoot(project.dir, audioPath)) {
|
|
126916
|
+
return c3.json({ error: "file not found" }, 404);
|
|
126917
|
+
}
|
|
126886
126918
|
const stats = statSync82(audioPath, { throwIfNoEntry: false });
|
|
126887
126919
|
if (!stats) return c3.json({ error: "file not found" }, 404);
|
|
126888
126920
|
const cacheDir = join122(project.dir, ".waveform-cache");
|
|
@@ -126979,12 +127011,12 @@ function registerFontRoutes(api) {
|
|
|
126979
127011
|
if (!located) return c3.json({ error: "font not found" }, 404);
|
|
126980
127012
|
let fd;
|
|
126981
127013
|
try {
|
|
126982
|
-
fd =
|
|
127014
|
+
fd = openSync42(located.path, constants22.O_RDONLY | constants22.O_NOFOLLOW);
|
|
126983
127015
|
} catch {
|
|
126984
127016
|
return c3.json({ error: "font file not accessible" }, 404);
|
|
126985
127017
|
}
|
|
126986
127018
|
try {
|
|
126987
|
-
const stat =
|
|
127019
|
+
const stat = fstatSync42(fd);
|
|
126988
127020
|
if (stat.size > SYSTEM_FONT_SIZE_LIMIT) {
|
|
126989
127021
|
return c3.json({ error: "font file too large" }, 413);
|
|
126990
127022
|
}
|
|
@@ -127001,7 +127033,7 @@ function registerFontRoutes(api) {
|
|
|
127001
127033
|
} catch {
|
|
127002
127034
|
return c3.json({ error: "failed to read font file" }, 500);
|
|
127003
127035
|
} finally {
|
|
127004
|
-
|
|
127036
|
+
closeSync42(fd);
|
|
127005
127037
|
}
|
|
127006
127038
|
});
|
|
127007
127039
|
}
|
|
@@ -127488,6 +127520,7 @@ var init_dist9 = __esm({
|
|
|
127488
127520
|
init_hfIds();
|
|
127489
127521
|
init_dist2();
|
|
127490
127522
|
init_dist3();
|
|
127523
|
+
init_assetResolution();
|
|
127491
127524
|
init_systemFontLocator();
|
|
127492
127525
|
init_hfIds();
|
|
127493
127526
|
IGNORE_DIRS = /* @__PURE__ */ new Set([
|
|
@@ -127724,10 +127757,10 @@ var init_dist9 = __esm({
|
|
|
127724
127757
|
if (signal.aborted) return Promise.reject(new DOMException("Aborted", "AbortError"));
|
|
127725
127758
|
let entry = this.entries.get(key2);
|
|
127726
127759
|
if (!entry) {
|
|
127727
|
-
let
|
|
127760
|
+
let resolve610;
|
|
127728
127761
|
let reject2;
|
|
127729
127762
|
const promise = new Promise((resolvePromise, rejectPromise) => {
|
|
127730
|
-
|
|
127763
|
+
resolve610 = resolvePromise;
|
|
127731
127764
|
reject2 = rejectPromise;
|
|
127732
127765
|
});
|
|
127733
127766
|
entry = {
|
|
@@ -127737,7 +127770,7 @@ var init_dist9 = __esm({
|
|
|
127737
127770
|
state: "queued",
|
|
127738
127771
|
work,
|
|
127739
127772
|
promise,
|
|
127740
|
-
resolve:
|
|
127773
|
+
resolve: resolve610,
|
|
127741
127774
|
reject: reject2
|
|
127742
127775
|
};
|
|
127743
127776
|
this.entries.set(key2, entry);
|
|
@@ -127751,7 +127784,7 @@ var init_dist9 = __esm({
|
|
|
127751
127784
|
return /* @__PURE__ */ new Set([...this.entries.keys(), ...[...this.activeEntries].map((entry) => entry.key)]);
|
|
127752
127785
|
}
|
|
127753
127786
|
lease(entry, signal) {
|
|
127754
|
-
return new Promise((
|
|
127787
|
+
return new Promise((resolve610, reject2) => {
|
|
127755
127788
|
let released = false;
|
|
127756
127789
|
const release5 = () => {
|
|
127757
127790
|
if (released) return;
|
|
@@ -127775,7 +127808,7 @@ var init_dist9 = __esm({
|
|
|
127775
127808
|
entry.promise.then(
|
|
127776
127809
|
(value) => {
|
|
127777
127810
|
release5();
|
|
127778
|
-
|
|
127811
|
+
resolve610(value);
|
|
127779
127812
|
},
|
|
127780
127813
|
(reason) => {
|
|
127781
127814
|
release5();
|
|
@@ -128444,7 +128477,7 @@ function isErrno(err, code) {
|
|
|
128444
128477
|
return err.code === code;
|
|
128445
128478
|
}
|
|
128446
128479
|
function sleep(ms) {
|
|
128447
|
-
return new Promise((
|
|
128480
|
+
return new Promise((resolve85) => setTimeout(resolve85, ms));
|
|
128448
128481
|
}
|
|
128449
128482
|
function tryAcquireDirLock(lockDir) {
|
|
128450
128483
|
try {
|
|
@@ -130509,10 +130542,10 @@ function createFileServer2(options) {
|
|
|
130509
130542
|
if (!streamOwnsFd) closeSync9(fd);
|
|
130510
130543
|
}
|
|
130511
130544
|
});
|
|
130512
|
-
return new Promise((
|
|
130545
|
+
return new Promise((resolve85) => {
|
|
130513
130546
|
const connections = /* @__PURE__ */ new Set();
|
|
130514
130547
|
const server = serve2({ fetch: app.fetch, port, hostname: "127.0.0.1" }, (info) => {
|
|
130515
|
-
|
|
130548
|
+
resolve85({
|
|
130516
130549
|
url: `http://localhost:${info.port}`,
|
|
130517
130550
|
port: info.port,
|
|
130518
130551
|
addPreHeadScript: (script) => {
|
|
@@ -130892,6 +130925,34 @@ function updateJobStatus(job, status, stage, progress, onProgress) {
|
|
|
130892
130925
|
}
|
|
130893
130926
|
if (onProgress) void onProgress(job, stage);
|
|
130894
130927
|
}
|
|
130928
|
+
function reportThrottled(lastReportAt, job, stage, progress, onProgress, force) {
|
|
130929
|
+
const now = Date.now();
|
|
130930
|
+
const last = lastReportAt.get(job);
|
|
130931
|
+
const due = force || last === void 0 || now - last >= PROGRESS_REPORT_INTERVAL_MS;
|
|
130932
|
+
if (due) lastReportAt.set(job, now);
|
|
130933
|
+
updateJobStatus(job, "rendering", stage, progress, due ? onProgress : void 0);
|
|
130934
|
+
}
|
|
130935
|
+
function reportFrameProgress(job, stage, progress, onProgress, isLastFrame) {
|
|
130936
|
+
reportThrottled(lastFrameReportAt, job, stage, progress, onProgress, isLastFrame);
|
|
130937
|
+
}
|
|
130938
|
+
function reportWorkerStartup(job, progress, onProgress) {
|
|
130939
|
+
const phase = progress.latestWorkerPhase;
|
|
130940
|
+
if (!phase) return;
|
|
130941
|
+
const phases = workerPhasesByJob.get(job) ?? /* @__PURE__ */ new Map();
|
|
130942
|
+
workerPhasesByJob.set(job, phases);
|
|
130943
|
+
phases.set(phase.workerId, phase.phase);
|
|
130944
|
+
const ready = [...phases].filter(
|
|
130945
|
+
([id, p2]) => id < progress.activeWorkers && (p2 === "frame_capture" || p2 === "frame_encode")
|
|
130946
|
+
).length;
|
|
130947
|
+
reportThrottled(
|
|
130948
|
+
lastStartupReportAt,
|
|
130949
|
+
job,
|
|
130950
|
+
`Starting browsers (${ready}/${progress.activeWorkers} ready)`,
|
|
130951
|
+
job.progress,
|
|
130952
|
+
onProgress,
|
|
130953
|
+
false
|
|
130954
|
+
);
|
|
130955
|
+
}
|
|
130895
130956
|
function createMemorySampler(intervalMs = 250) {
|
|
130896
130957
|
let peakRss = 0;
|
|
130897
130958
|
let peakHeap = 0;
|
|
@@ -131001,7 +131062,7 @@ function materializeExtractedFramesForCompiledDir(extracted, compiledDir, option
|
|
|
131001
131062
|
ext.outputDir = linkPath;
|
|
131002
131063
|
}
|
|
131003
131064
|
}
|
|
131004
|
-
var BROWSER_MEDIA_EPSILON, materializePathModule, materializeFileSystem, warnedSymlinkFallback;
|
|
131065
|
+
var BROWSER_MEDIA_EPSILON, PROGRESS_REPORT_INTERVAL_MS, lastFrameReportAt, lastStartupReportAt, workerPhasesByJob, materializePathModule, materializeFileSystem, warnedSymlinkFallback;
|
|
131005
131066
|
var init_shared = __esm({
|
|
131006
131067
|
"../producer/src/services/render/shared.ts"() {
|
|
131007
131068
|
"use strict";
|
|
@@ -131009,6 +131070,10 @@ var init_shared = __esm({
|
|
|
131009
131070
|
init_logger();
|
|
131010
131071
|
init_paths();
|
|
131011
131072
|
BROWSER_MEDIA_EPSILON = 1e-4;
|
|
131073
|
+
PROGRESS_REPORT_INTERVAL_MS = 250;
|
|
131074
|
+
lastFrameReportAt = /* @__PURE__ */ new WeakMap();
|
|
131075
|
+
lastStartupReportAt = /* @__PURE__ */ new WeakMap();
|
|
131076
|
+
workerPhasesByJob = /* @__PURE__ */ new WeakMap();
|
|
131012
131077
|
materializePathModule = {
|
|
131013
131078
|
resolve: resolve29,
|
|
131014
131079
|
join: join46,
|
|
@@ -133143,7 +133208,7 @@ function captureModeLabel(mode) {
|
|
|
133143
133208
|
return "screenshot";
|
|
133144
133209
|
}
|
|
133145
133210
|
function raceAgainstStall(promise, deadlineMs, input2, signal) {
|
|
133146
|
-
return new Promise((
|
|
133211
|
+
return new Promise((resolve85, reject2) => {
|
|
133147
133212
|
const timer = setTimeout(
|
|
133148
133213
|
() => {
|
|
133149
133214
|
reject2(
|
|
@@ -133162,7 +133227,7 @@ function raceAgainstStall(promise, deadlineMs, input2, signal) {
|
|
|
133162
133227
|
promise.then(
|
|
133163
133228
|
(value) => {
|
|
133164
133229
|
clearTimeout(timer);
|
|
133165
|
-
|
|
133230
|
+
resolve85(value);
|
|
133166
133231
|
},
|
|
133167
133232
|
(error) => {
|
|
133168
133233
|
clearTimeout(timer);
|
|
@@ -133290,12 +133355,12 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
|
|
|
133290
133355
|
reorderBuffer.advanceTo(prev.idx + 1);
|
|
133291
133356
|
job.framesRendered = prev.idx + 1;
|
|
133292
133357
|
lastProgressAt = Date.now();
|
|
133293
|
-
|
|
133358
|
+
reportFrameProgress(
|
|
133294
133359
|
job,
|
|
133295
|
-
"rendering",
|
|
133296
133360
|
`Streaming frame ${prev.idx + 1}/${totalFrames}`,
|
|
133297
133361
|
Math.round(25 + (prev.idx + 1) / totalFrames * 55),
|
|
133298
|
-
onProgress
|
|
133362
|
+
onProgress,
|
|
133363
|
+
prev.idx + 1 === totalFrames
|
|
133299
133364
|
);
|
|
133300
133365
|
};
|
|
133301
133366
|
const batchNRaw = Number(process.env.HF_DE_BATCH ?? "4");
|
|
@@ -133309,12 +133374,12 @@ async function runWorkerEncodePipelineLoop(session, totalFrames, job, currentEnc
|
|
|
133309
133374
|
reorderBuffer.advanceTo(item.idx + 1);
|
|
133310
133375
|
job.framesRendered = item.idx + 1;
|
|
133311
133376
|
lastProgressAt = Date.now();
|
|
133312
|
-
|
|
133377
|
+
reportFrameProgress(
|
|
133313
133378
|
job,
|
|
133314
|
-
"rendering",
|
|
133315
133379
|
`Streaming frame ${item.idx + 1}/${totalFrames}`,
|
|
133316
133380
|
Math.round(25 + (item.idx + 1) / totalFrames * 55),
|
|
133317
|
-
onProgress
|
|
133381
|
+
onProgress,
|
|
133382
|
+
item.idx + 1 === totalFrames
|
|
133318
133383
|
);
|
|
133319
133384
|
}
|
|
133320
133385
|
};
|
|
@@ -133511,6 +133576,7 @@ async function runCaptureStreamingStage(input2) {
|
|
|
133511
133576
|
canvasDrawElement: phase.canvasDrawElement,
|
|
133512
133577
|
gpuBackend: phase.gpuBackend
|
|
133513
133578
|
});
|
|
133579
|
+
if (progress.capturedFrames === 0) reportWorkerStartup(job, progress, onProgress);
|
|
133514
133580
|
return;
|
|
133515
133581
|
}
|
|
133516
133582
|
if (progress.capturedFrames > lastCapturedFrames) {
|
|
@@ -133520,16 +133586,13 @@ async function runCaptureStreamingStage(input2) {
|
|
|
133520
133586
|
}
|
|
133521
133587
|
job.framesRendered = progress.capturedFrames;
|
|
133522
133588
|
const frameProgress = progress.capturedFrames / progress.totalFrames;
|
|
133523
|
-
|
|
133524
|
-
|
|
133525
|
-
|
|
133526
|
-
|
|
133527
|
-
|
|
133528
|
-
|
|
133529
|
-
|
|
133530
|
-
onProgress
|
|
133531
|
-
);
|
|
133532
|
-
}
|
|
133589
|
+
reportFrameProgress(
|
|
133590
|
+
job,
|
|
133591
|
+
`Streaming frame ${progress.capturedFrames}/${progress.totalFrames} (${workerCount} workers)`,
|
|
133592
|
+
Math.round(25 + frameProgress * 55),
|
|
133593
|
+
onProgress,
|
|
133594
|
+
progress.capturedFrames === progress.totalFrames
|
|
133595
|
+
);
|
|
133533
133596
|
},
|
|
133534
133597
|
onFrameBuffer,
|
|
133535
133598
|
// Interleaved DE workers each need their own browser PROCESS:
|
|
@@ -133641,12 +133704,12 @@ async function runCaptureStreamingStage(input2) {
|
|
|
133641
133704
|
lastProgressAt = Date.now();
|
|
133642
133705
|
const frameProgress = (i + 1) / totalFrames;
|
|
133643
133706
|
const progress = 25 + frameProgress * 55;
|
|
133644
|
-
|
|
133707
|
+
reportFrameProgress(
|
|
133645
133708
|
job,
|
|
133646
|
-
"rendering",
|
|
133647
133709
|
`Streaming frame ${i + 1}/${totalFrames}`,
|
|
133648
133710
|
Math.round(progress),
|
|
133649
|
-
onProgress
|
|
133711
|
+
onProgress,
|
|
133712
|
+
i + 1 === totalFrames
|
|
133650
133713
|
);
|
|
133651
133714
|
}
|
|
133652
133715
|
}
|
|
@@ -133754,12 +133817,12 @@ async function captureSegmentFrames(ctx, segment, encoder) {
|
|
|
133754
133817
|
ensureFrameWritten(await encoder.writeFrame(buffer), i, encoder);
|
|
133755
133818
|
ctx.job.framesRendered = i + 1;
|
|
133756
133819
|
lastProgressAt = Date.now();
|
|
133757
|
-
|
|
133820
|
+
reportFrameProgress(
|
|
133758
133821
|
ctx.job,
|
|
133759
|
-
"rendering",
|
|
133760
133822
|
`Streaming frame ${i + 1}/${ctx.totalFrames} (segment ${segment.index + 1}/${ctx.segmentCount}` + (ctx.skipped > 0 ? `, skipped ${ctx.skipped}` : "") + ")",
|
|
133761
133823
|
Math.round(25 + (i + 1) / ctx.totalFrames * 55),
|
|
133762
|
-
ctx.onProgress
|
|
133824
|
+
ctx.onProgress,
|
|
133825
|
+
i + 1 === ctx.totalFrames
|
|
133763
133826
|
);
|
|
133764
133827
|
}
|
|
133765
133828
|
}
|
|
@@ -135648,9 +135711,9 @@ var require_compress_binding = __commonJS({
|
|
|
135648
135711
|
});
|
|
135649
135712
|
} else {
|
|
135650
135713
|
if (readAsync) {
|
|
135651
|
-
return new Promise(function(
|
|
135714
|
+
return new Promise(function(resolve85, reject2) {
|
|
135652
135715
|
readAsync(wasmBinaryFile, function(response) {
|
|
135653
|
-
|
|
135716
|
+
resolve85(new Uint8Array(response));
|
|
135654
135717
|
}, reject2);
|
|
135655
135718
|
});
|
|
135656
135719
|
}
|
|
@@ -136684,8 +136747,8 @@ var require_compress = __commonJS({
|
|
|
136684
136747
|
"../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/compress.js"(exports, module) {
|
|
136685
136748
|
"use strict";
|
|
136686
136749
|
var em_module = require_compress_binding();
|
|
136687
|
-
var runtimeInit = new Promise((
|
|
136688
|
-
em_module.onRuntimeInitialized =
|
|
136750
|
+
var runtimeInit = new Promise((resolve85) => {
|
|
136751
|
+
em_module.onRuntimeInitialized = resolve85;
|
|
136689
136752
|
});
|
|
136690
136753
|
module.exports = async function compress2(buffer) {
|
|
136691
136754
|
await runtimeInit;
|
|
@@ -137204,9 +137267,9 @@ var require_decompress_binding = __commonJS({
|
|
|
137204
137267
|
});
|
|
137205
137268
|
} else {
|
|
137206
137269
|
if (readAsync) {
|
|
137207
|
-
return new Promise(function(
|
|
137270
|
+
return new Promise(function(resolve85, reject2) {
|
|
137208
137271
|
readAsync(wasmBinaryFile, function(response) {
|
|
137209
|
-
|
|
137272
|
+
resolve85(new Uint8Array(response));
|
|
137210
137273
|
}, reject2);
|
|
137211
137274
|
});
|
|
137212
137275
|
}
|
|
@@ -138221,8 +138284,8 @@ var require_decompress = __commonJS({
|
|
|
138221
138284
|
"../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/decompress.js"(exports, module) {
|
|
138222
138285
|
"use strict";
|
|
138223
138286
|
var em_module = require_decompress_binding();
|
|
138224
|
-
var runtimeInit = new Promise((
|
|
138225
|
-
em_module.onRuntimeInitialized =
|
|
138287
|
+
var runtimeInit = new Promise((resolve85) => {
|
|
138288
|
+
em_module.onRuntimeInitialized = resolve85;
|
|
138226
138289
|
});
|
|
138227
138290
|
module.exports = async function decompress(buffer) {
|
|
138228
138291
|
await runtimeInit;
|
|
@@ -138857,10 +138920,10 @@ function throwIfCallerAborted(signal) {
|
|
|
138857
138920
|
async function waitForFontFetchRetry(delayMs, signal) {
|
|
138858
138921
|
throwIfCallerAborted(signal);
|
|
138859
138922
|
if (delayMs <= 0) return;
|
|
138860
|
-
await new Promise((
|
|
138923
|
+
await new Promise((resolve85, reject2) => {
|
|
138861
138924
|
const timeout = setTimeout(() => {
|
|
138862
138925
|
signal?.removeEventListener("abort", onAbort);
|
|
138863
|
-
|
|
138926
|
+
resolve85();
|
|
138864
138927
|
}, delayMs);
|
|
138865
138928
|
const onAbort = () => {
|
|
138866
138929
|
clearTimeout(timeout);
|
|
@@ -138961,10 +139024,10 @@ function _clearGoogleFontCssCacheForTests() {
|
|
|
138961
139024
|
function raceAgainstAbort(promise, signal) {
|
|
138962
139025
|
if (!signal) return promise;
|
|
138963
139026
|
if (signal.aborted) return Promise.reject(callerAbortReason(signal));
|
|
138964
|
-
return new Promise((
|
|
139027
|
+
return new Promise((resolve85, reject2) => {
|
|
138965
139028
|
const onAbort = () => reject2(callerAbortReason(signal));
|
|
138966
139029
|
signal.addEventListener("abort", onAbort, { once: true });
|
|
138967
|
-
promise.then(
|
|
139030
|
+
promise.then(resolve85, reject2).finally(() => signal.removeEventListener("abort", onAbort));
|
|
138968
139031
|
});
|
|
138969
139032
|
}
|
|
138970
139033
|
function fetchGoogleFontCss(url, familyName, options) {
|
|
@@ -139721,10 +139784,10 @@ var init_semaphore = __esm({
|
|
|
139721
139784
|
this.active++;
|
|
139722
139785
|
return () => this.release();
|
|
139723
139786
|
}
|
|
139724
|
-
return new Promise((
|
|
139787
|
+
return new Promise((resolve85) => {
|
|
139725
139788
|
this.queue.push(() => {
|
|
139726
139789
|
this.active++;
|
|
139727
|
-
|
|
139790
|
+
resolve85(() => this.release());
|
|
139728
139791
|
});
|
|
139729
139792
|
});
|
|
139730
139793
|
}
|
|
@@ -142866,19 +142929,20 @@ async function runCaptureStage(input2) {
|
|
|
142866
142929
|
frameRangeStart: frameRange?.startFrame,
|
|
142867
142930
|
dedupPerfs,
|
|
142868
142931
|
onProgress: (progress) => {
|
|
142932
|
+
if (progress.latestWorkerPhase) {
|
|
142933
|
+
if (progress.capturedFrames === 0) reportWorkerStartup(job, progress, onProgress);
|
|
142934
|
+
return;
|
|
142935
|
+
}
|
|
142869
142936
|
job.framesRendered = progress.capturedFrames;
|
|
142870
142937
|
checkDiskProjection(progress.capturedFrames);
|
|
142871
142938
|
const frameProgress = progress.capturedFrames / progress.totalFrames;
|
|
142872
|
-
|
|
142873
|
-
|
|
142874
|
-
|
|
142875
|
-
|
|
142876
|
-
|
|
142877
|
-
|
|
142878
|
-
|
|
142879
|
-
onProgress
|
|
142880
|
-
);
|
|
142881
|
-
}
|
|
142939
|
+
reportFrameProgress(
|
|
142940
|
+
job,
|
|
142941
|
+
`Capturing frame ${progress.capturedFrames}/${progress.totalFrames} (${progress.activeWorkers} workers)`,
|
|
142942
|
+
Math.round(25 + frameProgress * 45),
|
|
142943
|
+
onProgress,
|
|
142944
|
+
progress.capturedFrames === progress.totalFrames
|
|
142945
|
+
);
|
|
142882
142946
|
},
|
|
142883
142947
|
cfg: captureCfg,
|
|
142884
142948
|
log: log2
|
|
@@ -143008,12 +143072,12 @@ async function captureSessionFrames(session, { input: input2, rangeStart, rangeE
|
|
|
143008
143072
|
const reportFrame = (fileIndex) => {
|
|
143009
143073
|
job.framesRendered = fileIndex + 1;
|
|
143010
143074
|
checkDiskProjection(fileIndex + 1);
|
|
143011
|
-
|
|
143075
|
+
reportFrameProgress(
|
|
143012
143076
|
job,
|
|
143013
|
-
"rendering",
|
|
143014
143077
|
`Capturing frame ${fileIndex + 1}/${rangeFrames}`,
|
|
143015
143078
|
Math.round(25 + (fileIndex + 1) / rangeFrames * 45),
|
|
143016
|
-
onProgress
|
|
143079
|
+
onProgress,
|
|
143080
|
+
fileIndex + 1 === rangeFrames
|
|
143017
143081
|
);
|
|
143018
143082
|
};
|
|
143019
143083
|
if (session.workerEncodeEnabled) {
|
|
@@ -143277,16 +143341,13 @@ async function runSequentialLayeredFrameLoop(input2) {
|
|
|
143277
143341
|
log: log2
|
|
143278
143342
|
});
|
|
143279
143343
|
job.framesRendered = i + 1;
|
|
143280
|
-
|
|
143281
|
-
|
|
143282
|
-
|
|
143283
|
-
|
|
143284
|
-
|
|
143285
|
-
|
|
143286
|
-
|
|
143287
|
-
onProgress
|
|
143288
|
-
);
|
|
143289
|
-
}
|
|
143344
|
+
reportFrameProgress(
|
|
143345
|
+
job,
|
|
143346
|
+
`Layered composite frame ${i + 1}/${job.totalFrames}`,
|
|
143347
|
+
Math.round(25 + (i + 1) / totalFrames * 55),
|
|
143348
|
+
onProgress,
|
|
143349
|
+
i + 1 === totalFrames
|
|
143350
|
+
);
|
|
143290
143351
|
}
|
|
143291
143352
|
}
|
|
143292
143353
|
var init_captureHdrSequentialLoop = __esm({
|
|
@@ -143463,8 +143524,8 @@ async function createShaderTransitionWorkerPool(opts) {
|
|
|
143463
143524
|
if (terminated) {
|
|
143464
143525
|
throw new Error("shader-blend pool already terminated");
|
|
143465
143526
|
}
|
|
143466
|
-
return new Promise((
|
|
143467
|
-
const task = traceEnabled ? { req, resolve:
|
|
143527
|
+
return new Promise((resolve85, reject2) => {
|
|
143528
|
+
const task = traceEnabled ? { req, resolve: resolve85, reject: reject2, enqueuedAtMs: Date.now(), traceId: ++nextTaskId } : { req, resolve: resolve85, reject: reject2 };
|
|
143468
143529
|
const idle = slots.find((s) => !s.busy && !s.dead);
|
|
143469
143530
|
if (idle) {
|
|
143470
143531
|
queue.unshift(task);
|
|
@@ -143591,16 +143652,13 @@ async function runHybridLayeredFrameLoop(input2) {
|
|
|
143591
143652
|
reorderBuffer.advanceTo(frameIdx + 1);
|
|
143592
143653
|
framesWritten += 1;
|
|
143593
143654
|
job.framesRendered = framesWritten;
|
|
143594
|
-
|
|
143595
|
-
|
|
143596
|
-
|
|
143597
|
-
|
|
143598
|
-
|
|
143599
|
-
|
|
143600
|
-
|
|
143601
|
-
onProgress
|
|
143602
|
-
);
|
|
143603
|
-
}
|
|
143655
|
+
reportFrameProgress(
|
|
143656
|
+
job,
|
|
143657
|
+
`Layered composite frame ${framesWritten}/${job.totalFrames}`,
|
|
143658
|
+
Math.round(25 + framesWritten / totalFrames * 55),
|
|
143659
|
+
onProgress,
|
|
143660
|
+
framesWritten === totalFrames
|
|
143661
|
+
);
|
|
143604
143662
|
};
|
|
143605
143663
|
const poolRef = shaderPool;
|
|
143606
143664
|
const workerTaskOf = async (w3) => {
|
|
@@ -146151,6 +146209,7 @@ async function executeRenderPipeline(input2) {
|
|
|
146151
146209
|
}
|
|
146152
146210
|
const framesDir = join73(workDir, "captured-frames");
|
|
146153
146211
|
if (!existsSync60(framesDir)) mkdirSync29(framesDir, { recursive: true });
|
|
146212
|
+
updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress);
|
|
146154
146213
|
const resolvedBrowserGpuMode = await resolveBrowserGpuMode(cfg.browserGpuMode, {
|
|
146155
146214
|
chromePath: resolveHeadlessShellPath(cfg),
|
|
146156
146215
|
browserTimeout: cfg.browserTimeout
|
|
@@ -146343,6 +146402,7 @@ async function executeRenderPipeline(input2) {
|
|
|
146343
146402
|
}
|
|
146344
146403
|
});
|
|
146345
146404
|
if (job.config.workers === void 0 && totalFrames >= 60 && !htmlInCanvasDetected && !cfg.lowMemoryMode && !deInversionEligible && !deParallelRouterEligible) {
|
|
146405
|
+
updateJobStatus(job, "rendering", "Measuring capture speed", 25, onProgress);
|
|
146346
146406
|
const outcome = await observeRenderStage(
|
|
146347
146407
|
observability,
|
|
146348
146408
|
"capture_calibration",
|
|
@@ -148195,12 +148255,12 @@ async function startHealthWorker(options = {}) {
|
|
|
148195
148255
|
stdout: false,
|
|
148196
148256
|
stderr: false
|
|
148197
148257
|
});
|
|
148198
|
-
await new Promise((
|
|
148258
|
+
await new Promise((resolve85, reject2) => {
|
|
148199
148259
|
const onMessage = (msg) => {
|
|
148200
148260
|
if (msg?.type === "listening") {
|
|
148201
148261
|
worker.off("error", onError);
|
|
148202
148262
|
worker.off("message", onMessage);
|
|
148203
|
-
|
|
148263
|
+
resolve85();
|
|
148204
148264
|
} else if (msg?.type === "listen-error") {
|
|
148205
148265
|
worker.off("error", onError);
|
|
148206
148266
|
worker.off("message", onMessage);
|
|
@@ -152157,14 +152217,14 @@ function loadInstalled(dir, name) {
|
|
|
152157
152217
|
function runNpm(args) {
|
|
152158
152218
|
const npm = buildNpmCommand(args);
|
|
152159
152219
|
const child = spawn14(npm.command, npm.args, { stdio: ["ignore", "pipe", "pipe"] });
|
|
152160
|
-
return new Promise((
|
|
152220
|
+
return new Promise((resolve85, reject2) => {
|
|
152161
152221
|
let output = "";
|
|
152162
152222
|
child.stdout.on("data", (chunk) => output += chunk);
|
|
152163
152223
|
child.stderr.on("data", (chunk) => output += chunk);
|
|
152164
152224
|
child.on("error", reject2);
|
|
152165
152225
|
child.on(
|
|
152166
152226
|
"close",
|
|
152167
|
-
(code) => code === 0 ?
|
|
152227
|
+
(code) => code === 0 ? resolve85() : reject2(new Error(output || `npm exited with code ${code}`))
|
|
152168
152228
|
);
|
|
152169
152229
|
});
|
|
152170
152230
|
}
|
|
@@ -152734,12 +152794,12 @@ async function runPipeline(options, session, media, format, bgFormat, ffmpegPath
|
|
|
152734
152794
|
const drains = [];
|
|
152735
152795
|
if (!fgWroteFully) {
|
|
152736
152796
|
drains.push(
|
|
152737
|
-
new Promise((
|
|
152797
|
+
new Promise((resolve85) => fg.proc.stdin.once("drain", () => resolve85()))
|
|
152738
152798
|
);
|
|
152739
152799
|
}
|
|
152740
152800
|
if (!bgWroteFully && bg) {
|
|
152741
152801
|
drains.push(
|
|
152742
|
-
new Promise((
|
|
152802
|
+
new Promise((resolve85) => bg.proc.stdin.once("drain", () => resolve85()))
|
|
152743
152803
|
);
|
|
152744
152804
|
}
|
|
152745
152805
|
await Promise.all(drains);
|
|
@@ -152772,11 +152832,11 @@ ${decoder.getStderr().slice(-400)}`
|
|
|
152772
152832
|
return processed;
|
|
152773
152833
|
}
|
|
152774
152834
|
function waitForExit(proc, label2, getStderr) {
|
|
152775
|
-
return new Promise((
|
|
152835
|
+
return new Promise((resolve85, reject2) => {
|
|
152776
152836
|
proc.on("error", reject2);
|
|
152777
152837
|
proc.on("exit", (code, signal) => {
|
|
152778
152838
|
if (code === 0 && !signal) {
|
|
152779
|
-
|
|
152839
|
+
resolve85();
|
|
152780
152840
|
return;
|
|
152781
152841
|
}
|
|
152782
152842
|
const cause = signal ? `killed by ${signal}` : `exited with code ${code}`;
|
|
@@ -153534,7 +153594,7 @@ function createStudioServer(options) {
|
|
|
153534
153594
|
]);
|
|
153535
153595
|
await Promise.race([
|
|
153536
153596
|
Promise.allSettled(renders.map(([, done]) => done)),
|
|
153537
|
-
new Promise((
|
|
153597
|
+
new Promise((resolve85) => setTimeout(resolve85, RENDER_SHUTDOWN_WAIT_MS).unref())
|
|
153538
153598
|
]);
|
|
153539
153599
|
await closeBrowsers;
|
|
153540
153600
|
};
|
|
@@ -157395,6 +157455,7 @@ __export(studio_api_exports, {
|
|
|
157395
157455
|
parseSourceDocument: () => parseSourceDocument,
|
|
157396
157456
|
patchElementInHtml: () => patchElementInHtml,
|
|
157397
157457
|
removeElementFromHtml: () => removeElementFromHtml2,
|
|
157458
|
+
requestSubPath: () => requestSubPath,
|
|
157398
157459
|
settledFileTag: () => settledFileTag,
|
|
157399
157460
|
splitElementInHtml: () => splitElementInHtml,
|
|
157400
157461
|
thumbnailDeviceScaleFactor: () => thumbnailDeviceScaleFactor,
|
|
@@ -157419,7 +157480,7 @@ import { resolve as resolve46 } from "path";
|
|
|
157419
157480
|
async function registerCompositionRoute(app, project, autoProxy) {
|
|
157420
157481
|
const { isSafePath: isSafePath2 } = await Promise.resolve().then(() => (init_studio_api(), studio_api_exports));
|
|
157421
157482
|
app.get("/composition/*", async (ctx) => {
|
|
157422
|
-
const reqPath = ctx.req.
|
|
157483
|
+
const reqPath = requestSubPath(ctx.req.url, "composition");
|
|
157423
157484
|
const filePath = resolve46(project.dir, reqPath);
|
|
157424
157485
|
if (!isSafePath2(project.dir, filePath)) return ctx.text("Forbidden", 403);
|
|
157425
157486
|
if (!existsSync84(filePath)) return ctx.text("Not found", 404);
|
|
@@ -157509,6 +157570,7 @@ var init_play = __esm({
|
|
|
157509
157570
|
"use strict";
|
|
157510
157571
|
init_commandResult();
|
|
157511
157572
|
init_dist();
|
|
157573
|
+
init_dist9();
|
|
157512
157574
|
init_dist8();
|
|
157513
157575
|
init_colors();
|
|
157514
157576
|
init_project();
|
|
@@ -157656,7 +157718,8 @@ var init_play = __esm({
|
|
|
157656
157718
|
var present_exports = {};
|
|
157657
157719
|
__export(present_exports, {
|
|
157658
157720
|
default: () => present_default,
|
|
157659
|
-
examples: () => examples7
|
|
157721
|
+
examples: () => examples7,
|
|
157722
|
+
registerPresentCompositionRoute: () => registerPresentCompositionRoute
|
|
157660
157723
|
});
|
|
157661
157724
|
import { existsSync as existsSync85, readFileSync as readFileSync55 } from "fs";
|
|
157662
157725
|
import { resolve as resolve47 } from "path";
|
|
@@ -157776,6 +157839,17 @@ ${islandJson}
|
|
|
157776
157839
|
function escHtml(value) {
|
|
157777
157840
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
157778
157841
|
}
|
|
157842
|
+
async function registerPresentCompositionRoute(app, project) {
|
|
157843
|
+
const { isSafePath: isSafePath2 } = await Promise.resolve().then(() => (init_studio_api(), studio_api_exports));
|
|
157844
|
+
app.get("/composition/*", (ctx) => {
|
|
157845
|
+
const reqPath = requestSubPath(ctx.req.url, "composition");
|
|
157846
|
+
const filePath = resolve47(project.dir, reqPath);
|
|
157847
|
+
if (!isSafePath2(project.dir, filePath)) return ctx.text("Forbidden", 403);
|
|
157848
|
+
if (!existsSync85(filePath)) return ctx.text("Not found", 404);
|
|
157849
|
+
if (filePath.endsWith(".html")) return ctx.html(readFileSync55(filePath, "utf-8"));
|
|
157850
|
+
return ctx.body(readFileSync55(filePath), 200, { "Content-Type": assetContentType(filePath) });
|
|
157851
|
+
});
|
|
157852
|
+
}
|
|
157779
157853
|
var examples7, present_default;
|
|
157780
157854
|
var init_present = __esm({
|
|
157781
157855
|
"src/commands/present.ts"() {
|
|
@@ -157785,6 +157859,7 @@ var init_present = __esm({
|
|
|
157785
157859
|
init_dist8();
|
|
157786
157860
|
init_colors();
|
|
157787
157861
|
init_project();
|
|
157862
|
+
init_dist9();
|
|
157788
157863
|
init_openBrowser();
|
|
157789
157864
|
init_compositionServer();
|
|
157790
157865
|
examples7 = [
|
|
@@ -157872,7 +157947,6 @@ var init_present = __esm({
|
|
|
157872
157947
|
}
|
|
157873
157948
|
const { Hono: Hono6 } = await import("hono");
|
|
157874
157949
|
const { createAdaptorServer } = await import("@hono/node-server");
|
|
157875
|
-
const { isSafePath: isSafePath2 } = await Promise.resolve().then(() => (init_studio_api(), studio_api_exports));
|
|
157876
157950
|
const app = new Hono6();
|
|
157877
157951
|
app.get(
|
|
157878
157952
|
"/player.js",
|
|
@@ -157888,14 +157962,7 @@ var init_present = __esm({
|
|
|
157888
157962
|
"Cache-Control": "no-cache"
|
|
157889
157963
|
})
|
|
157890
157964
|
);
|
|
157891
|
-
app
|
|
157892
|
-
const reqPath = ctx.req.path.replace("/composition/", "");
|
|
157893
|
-
const filePath = resolve47(project.dir, reqPath);
|
|
157894
|
-
if (!isSafePath2(project.dir, filePath)) return ctx.text("Forbidden", 403);
|
|
157895
|
-
if (!existsSync85(filePath)) return ctx.text("Not found", 404);
|
|
157896
|
-
if (filePath.endsWith(".html")) return ctx.html(readFileSync55(filePath, "utf-8"));
|
|
157897
|
-
return ctx.body(readFileSync55(filePath), 200, { "Content-Type": assetContentType(filePath) });
|
|
157898
|
-
});
|
|
157965
|
+
await registerPresentCompositionRoute(app, project);
|
|
157899
157966
|
app.get("/", (ctx) => ctx.html(buildPresentPage(project.name, islandJson)));
|
|
157900
157967
|
ge(c.bold("hyperframes present"));
|
|
157901
157968
|
const s = ft();
|
|
@@ -158537,8 +158604,8 @@ async function startLoopback(opts) {
|
|
|
158537
158604
|
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
158538
158605
|
let resolveResult;
|
|
158539
158606
|
let rejectResult;
|
|
158540
|
-
const result = new Promise((
|
|
158541
|
-
resolveResult =
|
|
158607
|
+
const result = new Promise((resolve85, reject2) => {
|
|
158608
|
+
resolveResult = resolve85;
|
|
158542
158609
|
rejectResult = reject2;
|
|
158543
158610
|
});
|
|
158544
158611
|
let redirectUri = "";
|
|
@@ -158554,7 +158621,7 @@ async function startLoopback(opts) {
|
|
|
158554
158621
|
closed = true;
|
|
158555
158622
|
clearTimeout(timer);
|
|
158556
158623
|
server.closeAllConnections?.();
|
|
158557
|
-
await new Promise((
|
|
158624
|
+
await new Promise((resolve85) => server.close(() => resolve85()));
|
|
158558
158625
|
};
|
|
158559
158626
|
const timer = setTimeout(() => {
|
|
158560
158627
|
rejectResult(new Error(`OAuth callback timed out after ${timeoutMs}ms`));
|
|
@@ -158565,11 +158632,11 @@ async function startLoopback(opts) {
|
|
|
158565
158632
|
return { result, redirectUri, close };
|
|
158566
158633
|
}
|
|
158567
158634
|
async function listen(server, port) {
|
|
158568
|
-
await new Promise((
|
|
158635
|
+
await new Promise((resolve85, reject2) => {
|
|
158569
158636
|
server.once("error", reject2);
|
|
158570
158637
|
server.listen(port, "127.0.0.1", () => {
|
|
158571
158638
|
server.off("error", reject2);
|
|
158572
|
-
|
|
158639
|
+
resolve85();
|
|
158573
158640
|
});
|
|
158574
158641
|
});
|
|
158575
158642
|
}
|
|
@@ -158756,7 +158823,7 @@ async function startDeviceAuthorizationFlow(opts = {}) {
|
|
|
158756
158823
|
const runtime = {
|
|
158757
158824
|
clientId: resolveClientId(),
|
|
158758
158825
|
fetchImpl: opts.fetchImpl ?? fetch,
|
|
158759
|
-
sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((
|
|
158826
|
+
sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve85) => setTimeout(resolve85, ms))),
|
|
158760
158827
|
now: opts.now ?? Date.now,
|
|
158761
158828
|
requestTimeoutMs: opts.requestTimeoutMs ?? DEVICE_REQUEST_TIMEOUT_MS
|
|
158762
158829
|
};
|
|
@@ -159450,7 +159517,7 @@ function isRequestTimeout(error) {
|
|
|
159450
159517
|
return error instanceof DOMException && (error.name === "TimeoutError" || error.name === "AbortError");
|
|
159451
159518
|
}
|
|
159452
159519
|
function waitBeforePublishRetry() {
|
|
159453
|
-
return new Promise((
|
|
159520
|
+
return new Promise((resolve85) => setTimeout(resolve85, PUBLISH_RETRY_DELAY_MS));
|
|
159454
159521
|
}
|
|
159455
159522
|
async function fetchForPublish(input2, createInit, failureStage, attempts = 1) {
|
|
159456
159523
|
if (attempts < 1) throw new RangeError("Publish fetch attempts must be at least 1");
|
|
@@ -160181,10 +160248,10 @@ var init_publish = __esm({
|
|
|
160181
160248
|
|
|
160182
160249
|
// src/utils/catalogUsage.ts
|
|
160183
160250
|
import { readFileSync as readFileSync58 } from "fs";
|
|
160184
|
-
import { isAbsolute as isAbsolute15, relative as relative26, resolve as
|
|
160251
|
+
import { isAbsolute as isAbsolute15, relative as relative26, resolve as resolve53 } from "path";
|
|
160185
160252
|
function reachableCompositions(projectDir, entryPath) {
|
|
160186
160253
|
const seen = /* @__PURE__ */ new Set();
|
|
160187
|
-
const queue = [
|
|
160254
|
+
const queue = [resolve53(entryPath)];
|
|
160188
160255
|
while (queue.length > 0 && seen.size < MAX_VISITED_FILES) {
|
|
160189
160256
|
const current2 = queue.shift();
|
|
160190
160257
|
if (seen.has(current2)) continue;
|
|
@@ -160197,14 +160264,14 @@ function reachableCompositions(projectDir, entryPath) {
|
|
|
160197
160264
|
}
|
|
160198
160265
|
if (html.length > MAX_HTML_BYTES) continue;
|
|
160199
160266
|
for (const src of collectSubCompositionSrcs(html)) {
|
|
160200
|
-
queue.push(
|
|
160267
|
+
queue.push(resolve53(projectDir, src));
|
|
160201
160268
|
}
|
|
160202
160269
|
}
|
|
160203
160270
|
return seen;
|
|
160204
160271
|
}
|
|
160205
160272
|
function isReached(projectDir, target, reachable) {
|
|
160206
160273
|
if (isAbsolute15(target)) return false;
|
|
160207
|
-
const abs =
|
|
160274
|
+
const abs = resolve53(projectDir, target);
|
|
160208
160275
|
if (relative26(projectDir, abs).startsWith("..")) return false;
|
|
160209
160276
|
return reachable.has(abs);
|
|
160210
160277
|
}
|
|
@@ -160250,7 +160317,7 @@ var init_catalogUsage = __esm({
|
|
|
160250
160317
|
|
|
160251
160318
|
// src/commands/render/plan.ts
|
|
160252
160319
|
import { statSync as statSync34 } from "fs";
|
|
160253
|
-
import { dirname as dirname46, join as join103, resolve as
|
|
160320
|
+
import { dirname as dirname46, join as join103, resolve as resolve54 } from "path";
|
|
160254
160321
|
function formatFpsParseError(input2, reason) {
|
|
160255
160322
|
switch (reason) {
|
|
160256
160323
|
case "empty":
|
|
@@ -160287,7 +160354,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
|
|
|
160287
160354
|
const hasExplicitComposition = hasExplicitCompositionArg(args.composition);
|
|
160288
160355
|
const project = resolveProject(args.dir, { requireIndex: !hasExplicitComposition });
|
|
160289
160356
|
const entryFile = resolveCompositionEntryArg(args.composition, project.dir, statSync34);
|
|
160290
|
-
const renderTarget = entryFile ?
|
|
160357
|
+
const renderTarget = entryFile ? resolve54(project.dir, entryFile) : project.indexPath;
|
|
160291
160358
|
const fpsArg = resolveDefaultFpsArg(args.fps, project.dir, project.indexPath, entryFile);
|
|
160292
160359
|
const fpsParse = parseFps(fpsArg ?? "30");
|
|
160293
160360
|
if (!fpsParse.ok) {
|
|
@@ -160412,7 +160479,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
|
|
|
160412
160479
|
const raw = args["frames-cache-dir"].trim();
|
|
160413
160480
|
const normalized3 = raw.toLowerCase();
|
|
160414
160481
|
const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized3);
|
|
160415
|
-
environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw :
|
|
160482
|
+
environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve54(raw);
|
|
160416
160483
|
}
|
|
160417
160484
|
if (args["max-concurrent-renders"] != null) {
|
|
160418
160485
|
const parsed = positiveInteger(
|
|
@@ -160450,11 +160517,11 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
|
|
|
160450
160517
|
"Invalid batch-concurrency",
|
|
160451
160518
|
`Got "${args["batch-concurrency"]}". Must be a positive integer.`
|
|
160452
160519
|
) : 1;
|
|
160453
|
-
const rendersDir =
|
|
160520
|
+
const rendersDir = resolve54("renders");
|
|
160454
160521
|
const ext = FORMAT_EXT[format];
|
|
160455
160522
|
const timestamp = formatRenderOutputTimestamp(now);
|
|
160456
160523
|
const batchOutputTemplate = args.output ? args.output : join103(rendersDir, `${project.name}_${timestamp}_{index}${ext}`);
|
|
160457
|
-
const outputPath = args.output ?
|
|
160524
|
+
const outputPath = args.output ? resolve54(args.output) : join103(rendersDir, `${project.name}_${timestamp}${ext}`);
|
|
160458
160525
|
const useDocker = args.docker ?? false;
|
|
160459
160526
|
const useGpu = args.gpu ?? false;
|
|
160460
160527
|
const browserGpuMode = resolveBrowserGpuForCli(useDocker, args["browser-gpu"]);
|
|
@@ -160680,8 +160747,8 @@ var init_present2 = __esm({
|
|
|
160680
160747
|
|
|
160681
160748
|
// src/utils/variables.ts
|
|
160682
160749
|
import { readFileSync as readFileSync60 } from "fs";
|
|
160683
|
-
import { resolve as
|
|
160684
|
-
function parseVariablesArg(inline, filePath, readFile6 = (p2) => readFileSync60(
|
|
160750
|
+
import { resolve as resolve55 } from "path";
|
|
160751
|
+
function parseVariablesArg(inline, filePath, readFile6 = (p2) => readFileSync60(resolve55(p2), "utf8")) {
|
|
160685
160752
|
if (inline != null && filePath != null) {
|
|
160686
160753
|
return { ok: false, error: { kind: "conflict" } };
|
|
160687
160754
|
}
|
|
@@ -160820,7 +160887,7 @@ __export(batchRender_exports, {
|
|
|
160820
160887
|
runBatchRender: () => runBatchRender
|
|
160821
160888
|
});
|
|
160822
160889
|
import { mkdirSync as mkdirSync46, readFileSync as readFileSync61, writeFileSync as writeFileSync35 } from "fs";
|
|
160823
|
-
import { dirname as dirname47, join as join104, resolve as
|
|
160890
|
+
import { dirname as dirname47, join as join104, resolve as resolve56, sep as sep16 } from "path";
|
|
160824
160891
|
function isRecord10(value) {
|
|
160825
160892
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
160826
160893
|
}
|
|
@@ -160881,7 +160948,7 @@ function isSameOrChildPath(path, parent) {
|
|
|
160881
160948
|
}
|
|
160882
160949
|
function commonOutputDirectory(outputPaths) {
|
|
160883
160950
|
const firstPath = outputPaths[0];
|
|
160884
|
-
if (!firstPath) return
|
|
160951
|
+
if (!firstPath) return resolve56("renders");
|
|
160885
160952
|
let common = dirname47(firstPath);
|
|
160886
160953
|
for (const outputPath of outputPaths.slice(1)) {
|
|
160887
160954
|
const dir = dirname47(outputPath);
|
|
@@ -160944,7 +161011,7 @@ function reportBatchVariableIssues(row, index, schema, quiet, json) {
|
|
|
160944
161011
|
return issues.length;
|
|
160945
161012
|
}
|
|
160946
161013
|
function prepareBatchRender(options) {
|
|
160947
|
-
const batchPath =
|
|
161014
|
+
const batchPath = resolve56(options.batchPath);
|
|
160948
161015
|
const read = options.readFile ?? ((path) => readFileSync61(path, "utf8"));
|
|
160949
161016
|
let raw;
|
|
160950
161017
|
try {
|
|
@@ -160959,7 +161026,7 @@ function prepareBatchRender(options) {
|
|
|
160959
161026
|
const rows = variableRows.map((variables, index) => ({
|
|
160960
161027
|
index,
|
|
160961
161028
|
variables,
|
|
160962
|
-
outputPath:
|
|
161029
|
+
outputPath: resolve56(resolveOutputTemplate(options.outputTemplate, variables, index))
|
|
160963
161030
|
}));
|
|
160964
161031
|
const manifestPath3 = join104(
|
|
160965
161032
|
commonOutputDirectory(rows.map((row) => row.outputPath)),
|
|
@@ -161647,18 +161714,18 @@ async function getDoctorSummary() {
|
|
|
161647
161714
|
}
|
|
161648
161715
|
}
|
|
161649
161716
|
function askQuestion(prompt) {
|
|
161650
|
-
return new Promise((
|
|
161717
|
+
return new Promise((resolve85) => {
|
|
161651
161718
|
const rl = readline.createInterface({
|
|
161652
161719
|
input: process.stdin,
|
|
161653
161720
|
output: process.stdout
|
|
161654
161721
|
});
|
|
161655
161722
|
rl.question(prompt, (answer) => {
|
|
161656
161723
|
rl.close();
|
|
161657
|
-
|
|
161724
|
+
resolve85(answer);
|
|
161658
161725
|
});
|
|
161659
161726
|
const timeout = setTimeout(() => {
|
|
161660
161727
|
rl.close();
|
|
161661
|
-
|
|
161728
|
+
resolve85("");
|
|
161662
161729
|
}, 1e4);
|
|
161663
161730
|
if (typeof timeout === "object" && timeout !== null && "unref" in timeout) {
|
|
161664
161731
|
timeout.unref();
|
|
@@ -161928,7 +161995,7 @@ __export(render_exports, {
|
|
|
161928
161995
|
});
|
|
161929
161996
|
import { mkdtempSync as mkdtempSync20, readdirSync as readdirSync35, readFileSync as readFileSync64, statSync as statSync35, writeFileSync as writeFileSync36, rmSync as rmSync34 } from "fs";
|
|
161930
161997
|
import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
|
|
161931
|
-
import { resolve as
|
|
161998
|
+
import { resolve as resolve57, dirname as dirname48, join as join105, basename as basename20 } from "path";
|
|
161932
161999
|
import { execFileSync as execFileSync12, spawn as spawn18 } from "child_process";
|
|
161933
162000
|
async function readCompositionDimensions(compositionHtml) {
|
|
161934
162001
|
try {
|
|
@@ -161962,8 +162029,8 @@ function dockerImageTag(version2) {
|
|
|
161962
162029
|
return `${DOCKER_IMAGE_PREFIX}:${version2}`;
|
|
161963
162030
|
}
|
|
161964
162031
|
function resolveDockerfilePath() {
|
|
161965
|
-
const builtPath =
|
|
161966
|
-
const devPath =
|
|
162032
|
+
const builtPath = resolve57(__dirname, "docker", "Dockerfile.render");
|
|
162033
|
+
const devPath = resolve57(__dirname, "..", "src", "docker", "Dockerfile.render");
|
|
161967
162034
|
for (const p2 of [builtPath, devPath]) {
|
|
161968
162035
|
try {
|
|
161969
162036
|
statSync35(p2);
|
|
@@ -162066,8 +162133,8 @@ async function renderDocker(projectDir, outputPath, options) {
|
|
|
162066
162133
|
const outputFilename = basename20(outputPath);
|
|
162067
162134
|
const dockerArgs = buildDockerRunArgs({
|
|
162068
162135
|
imageTag,
|
|
162069
|
-
projectDir:
|
|
162070
|
-
outputDir:
|
|
162136
|
+
projectDir: resolve57(projectDir),
|
|
162137
|
+
outputDir: resolve57(outputDir),
|
|
162071
162138
|
outputFilename,
|
|
162072
162139
|
platform: platform11,
|
|
162073
162140
|
options: {
|
|
@@ -162589,6 +162656,7 @@ function reportDeParallelRouterBreakerTrip(quiet) {
|
|
|
162589
162656
|
function normalizeStageCode(stage) {
|
|
162590
162657
|
const known = KNOWN_STAGE_CODES[stage];
|
|
162591
162658
|
if (known) return known;
|
|
162659
|
+
if (stage.startsWith("Starting browsers")) return "starting_browsers";
|
|
162592
162660
|
const slug = stage.trim().toLowerCase().replace(/[^a-z0-9]+/g, "_").replace(/^_+|_+$/g, "");
|
|
162593
162661
|
return slug || "unknown";
|
|
162594
162662
|
}
|
|
@@ -163430,7 +163498,7 @@ __export(staticProjectServer_exports, {
|
|
|
163430
163498
|
});
|
|
163431
163499
|
import { createServer as createServer2 } from "http";
|
|
163432
163500
|
import { createReadStream as createReadStream8, existsSync as existsSync90, statSync as statSync36 } from "fs";
|
|
163433
|
-
import { isAbsolute as isAbsolute16, relative as relative27, resolve as
|
|
163501
|
+
import { isAbsolute as isAbsolute16, relative as relative27, resolve as resolve58 } from "path";
|
|
163434
163502
|
function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
|
|
163435
163503
|
const size = statSync36(filePath).size;
|
|
163436
163504
|
const headers = {
|
|
@@ -163531,7 +163599,7 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
|
|
|
163531
163599
|
const proxyRequest = proxyParam !== null && isProxyVariantRequest(proxyParam) ? proxyParam : null;
|
|
163532
163600
|
const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
|
|
163533
163601
|
for (const root of roots) {
|
|
163534
|
-
const filePath =
|
|
163602
|
+
const filePath = resolve58(root, requestPath);
|
|
163535
163603
|
const rel = relative27(root, filePath);
|
|
163536
163604
|
if (rel.startsWith("..") || isAbsolute16(rel)) continue;
|
|
163537
163605
|
if (existsSync90(filePath)) {
|
|
@@ -164798,12 +164866,12 @@ async function getCompositionDuration3(page) {
|
|
|
164798
164866
|
}
|
|
164799
164867
|
function raceMediaReady(el, deadlineMs) {
|
|
164800
164868
|
if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
|
|
164801
|
-
return new Promise((
|
|
164869
|
+
return new Promise((resolve85) => {
|
|
164802
164870
|
const onReady = () => {
|
|
164803
164871
|
el.removeEventListener("loadedmetadata", onReady);
|
|
164804
164872
|
el.removeEventListener("error", onReady);
|
|
164805
164873
|
clearTimeout(timer);
|
|
164806
|
-
|
|
164874
|
+
resolve85();
|
|
164807
164875
|
};
|
|
164808
164876
|
el.addEventListener("loadedmetadata", onReady, { once: true });
|
|
164809
164877
|
el.addEventListener("error", onReady, { once: true });
|
|
@@ -164819,7 +164887,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
|
|
|
164819
164887
|
await Promise.all(
|
|
164820
164888
|
nodes.map((el) => {
|
|
164821
164889
|
if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
|
|
164822
|
-
return new Promise((
|
|
164890
|
+
return new Promise((resolve85) => {
|
|
164823
164891
|
const cleanup = () => {
|
|
164824
164892
|
el.removeEventListener("loadedmetadata", onReady);
|
|
164825
164893
|
el.removeEventListener("error", onReady);
|
|
@@ -164827,7 +164895,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
|
|
|
164827
164895
|
};
|
|
164828
164896
|
const onReady = () => {
|
|
164829
164897
|
cleanup();
|
|
164830
|
-
|
|
164898
|
+
resolve85();
|
|
164831
164899
|
};
|
|
164832
164900
|
el.addEventListener("loadedmetadata", onReady, { once: true });
|
|
164833
164901
|
el.addEventListener("error", onReady, { once: true });
|
|
@@ -165258,7 +165326,7 @@ __export(checkBrowser_exports, {
|
|
|
165258
165326
|
runBrowserCheck: () => runBrowserCheck
|
|
165259
165327
|
});
|
|
165260
165328
|
import { mkdirSync as mkdirSync49, writeFileSync as writeFileSync38 } from "fs";
|
|
165261
|
-
import { join as join110, resolve as
|
|
165329
|
+
import { join as join110, resolve as resolve59 } from "path";
|
|
165262
165330
|
async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride) {
|
|
165263
165331
|
if (!resolveAutoProxy(projectDir, autoProxyOverride)) return;
|
|
165264
165332
|
let codecMap;
|
|
@@ -165279,7 +165347,7 @@ async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride
|
|
|
165279
165347
|
hostileEntries.map(
|
|
165280
165348
|
([pathname, facts]) => resolveProxy(
|
|
165281
165349
|
projectDir,
|
|
165282
|
-
|
|
165350
|
+
resolve59(projectDir, pathname.replace(/^\/+/, "")),
|
|
165283
165351
|
proxyVariantFor(facts)
|
|
165284
165352
|
)
|
|
165285
165353
|
)
|
|
@@ -166233,6 +166301,7 @@ async function buildSampleGrid(driver, options) {
|
|
|
166233
166301
|
return {
|
|
166234
166302
|
duration,
|
|
166235
166303
|
layoutSamples,
|
|
166304
|
+
userPickedSamples: options.at?.length ? baseSamples : [],
|
|
166236
166305
|
captionSamples,
|
|
166237
166306
|
frameSamples,
|
|
166238
166307
|
transitionSamples: transitions.times,
|
|
@@ -166401,7 +166470,7 @@ async function collectGridSamples(driver, options, grid, motion) {
|
|
|
166401
166470
|
const layoutIssues = await driver.collectLayout(time, options.tolerance, options.layout);
|
|
166402
166471
|
collected.layoutIssues.push(...layoutIssues);
|
|
166403
166472
|
issuesAtTime.push(...layoutIssues);
|
|
166404
|
-
collected.geometrySignatures.push(await driver.collectLayoutGeometry());
|
|
166473
|
+
collected.geometrySignatures.push({ time, signature: await driver.collectLayoutGeometry() });
|
|
166405
166474
|
collected.rotationSamples.push(...await driver.collectRotationSample(time));
|
|
166406
166475
|
collected.indicatorFrames.push(await driver.collectOffPivotRotationSample(time));
|
|
166407
166476
|
}
|
|
@@ -166803,9 +166872,10 @@ async function runAuditGrid(driver, options, motion) {
|
|
|
166803
166872
|
);
|
|
166804
166873
|
motionIssues = [...motionIssues, ...await driver.anchorMotionIssues(evaluated)];
|
|
166805
166874
|
}
|
|
166875
|
+
const userPicked = new Set(grid.userPickedSamples);
|
|
166806
166876
|
const sweepFindings = detectSweepStatic(
|
|
166807
166877
|
grid.duration,
|
|
166808
|
-
collected.geometrySignatures,
|
|
166878
|
+
collected.geometrySignatures.filter((sample) => !userPicked.has(sample.time)).map((sample) => sample.signature),
|
|
166809
166879
|
motionIssues,
|
|
166810
166880
|
await driver.hasNoTimelineDeclaration()
|
|
166811
166881
|
);
|
|
@@ -167914,7 +167984,7 @@ __export(beats_exports, {
|
|
|
167914
167984
|
examples: () => examples13
|
|
167915
167985
|
});
|
|
167916
167986
|
import { existsSync as existsSync96, readFileSync as readFileSync70, mkdirSync as mkdirSync51, writeFileSync as writeFileSync40 } from "fs";
|
|
167917
|
-
import { resolve as
|
|
167987
|
+
import { resolve as resolve60, join as join114, dirname as dirname52 } from "path";
|
|
167918
167988
|
function fail(message) {
|
|
167919
167989
|
console.error(c.error(message));
|
|
167920
167990
|
failCommand();
|
|
@@ -167928,7 +167998,7 @@ function resolveMusicTarget(project) {
|
|
|
167928
167998
|
}
|
|
167929
167999
|
const rel = audioRelPathForSrc(src);
|
|
167930
168000
|
if (!rel) fail(`Cannot derive a beat-file path for music src: ${src}`);
|
|
167931
|
-
const audioPath =
|
|
168001
|
+
const audioPath = resolve60(project.dir, rel);
|
|
167932
168002
|
if (!existsSync96(audioPath)) fail(`Audio file not found: ${rel}`);
|
|
167933
168003
|
return { rel, audioPath };
|
|
167934
168004
|
}
|
|
@@ -168008,7 +168078,7 @@ __export(normalize_audio_exports, {
|
|
|
168008
168078
|
});
|
|
168009
168079
|
import { execFile as execFile9 } from "child_process";
|
|
168010
168080
|
import { existsSync as existsSync97, readFileSync as readFileSync71, renameSync as renameSync19, writeFileSync as writeFileSync41 } from "fs";
|
|
168011
|
-
import { isAbsolute as isAbsolute17, relative as relative29, resolve as
|
|
168081
|
+
import { isAbsolute as isAbsolute17, relative as relative29, resolve as resolve61 } from "path";
|
|
168012
168082
|
import { promisify as promisify8 } from "util";
|
|
168013
168083
|
function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
|
|
168014
168084
|
if (raw === void 0) return fallback;
|
|
@@ -168174,8 +168244,8 @@ function resolveLocalAudioPath(projectDir, src) {
|
|
|
168174
168244
|
if (!decoded || isAbsolute17(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
|
|
168175
168245
|
throw new Error(`Audio source must be a local project file: ${src}`);
|
|
168176
168246
|
}
|
|
168177
|
-
const root =
|
|
168178
|
-
const file =
|
|
168247
|
+
const root = resolve61(projectDir);
|
|
168248
|
+
const file = resolve61(root, decoded);
|
|
168179
168249
|
const rel = relative29(root, file);
|
|
168180
168250
|
if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
|
|
168181
168251
|
throw new Error(`Audio source must be a local project file: ${src}`);
|
|
@@ -168841,14 +168911,14 @@ function inlineHelper3(call, ctx) {
|
|
|
168841
168911
|
};
|
|
168842
168912
|
return expandBody3(fn.body.body, bindings, prov, ctx);
|
|
168843
168913
|
}
|
|
168844
|
-
function assignStep3(update2,
|
|
168845
|
-
if (update2.operator === "+=") return asNum3(
|
|
168914
|
+
function assignStep3(update2, resolve85) {
|
|
168915
|
+
if (update2.operator === "+=") return asNum3(resolve85(update2.right));
|
|
168846
168916
|
if (update2.operator === "-=") {
|
|
168847
|
-
const s = asNum3(
|
|
168917
|
+
const s = asNum3(resolve85(update2.right));
|
|
168848
168918
|
return s === void 0 ? void 0 : -s;
|
|
168849
168919
|
}
|
|
168850
168920
|
if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
|
|
168851
|
-
return asNum3(
|
|
168921
|
+
return asNum3(resolve85(update2.right.right));
|
|
168852
168922
|
}
|
|
168853
168923
|
return void 0;
|
|
168854
168924
|
}
|
|
@@ -168857,10 +168927,10 @@ function updatedVarName3(update2) {
|
|
|
168857
168927
|
if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
|
|
168858
168928
|
return null;
|
|
168859
168929
|
}
|
|
168860
|
-
function loopStep3(update2, varName,
|
|
168930
|
+
function loopStep3(update2, varName, resolve85) {
|
|
168861
168931
|
if (updatedVarName3(update2) !== varName) return void 0;
|
|
168862
168932
|
if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
|
|
168863
|
-
return assignStep3(update2,
|
|
168933
|
+
return assignStep3(update2, resolve85);
|
|
168864
168934
|
}
|
|
168865
168935
|
function asNum3(v2) {
|
|
168866
168936
|
return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
|
|
@@ -168877,13 +168947,13 @@ function forInitVar3(init) {
|
|
|
168877
168947
|
const d2 = init.declarations[0];
|
|
168878
168948
|
return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
|
|
168879
168949
|
}
|
|
168880
|
-
function parseForHeader3(stmt,
|
|
168950
|
+
function parseForHeader3(stmt, resolve85) {
|
|
168881
168951
|
const iv = forInitVar3(stmt.init);
|
|
168882
168952
|
const test = stmt.test;
|
|
168883
168953
|
if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
|
|
168884
|
-
const start = asNum3(
|
|
168885
|
-
const end = asNum3(
|
|
168886
|
-
const step = loopStep3(stmt.update, iv.name,
|
|
168954
|
+
const start = asNum3(resolve85(iv.initExpr));
|
|
168955
|
+
const end = asNum3(resolve85(test.right));
|
|
168956
|
+
const step = loopStep3(stmt.update, iv.name, resolve85);
|
|
168887
168957
|
if (start === void 0 || end === void 0 || !step) return null;
|
|
168888
168958
|
return { v: iv.name, start, end, op: test.operator, step };
|
|
168889
168959
|
}
|
|
@@ -168995,12 +169065,12 @@ function expandStatements3(stmts, ctx) {
|
|
|
168995
169065
|
}
|
|
168996
169066
|
return out;
|
|
168997
169067
|
}
|
|
168998
|
-
function inlineComputedTimelines3(ast, timelineVar,
|
|
169068
|
+
function inlineComputedTimelines3(ast, timelineVar, resolve85) {
|
|
168999
169069
|
const helpers = collectInlinableHelpers3(ast, timelineVar);
|
|
169000
169070
|
const ctx = {
|
|
169001
169071
|
helpers,
|
|
169002
169072
|
timelineVar,
|
|
169003
|
-
resolve:
|
|
169073
|
+
resolve: resolve85,
|
|
169004
169074
|
depth: 0,
|
|
169005
169075
|
site: { n: 0 },
|
|
169006
169076
|
order: { n: 0 },
|
|
@@ -170461,10 +170531,10 @@ __export(motionShot_exports, {
|
|
|
170461
170531
|
seekAllAdaptersInBrowser: () => seekAllAdaptersInBrowser
|
|
170462
170532
|
});
|
|
170463
170533
|
import { mkdirSync as mkdirSync53, statSync as statSync37, writeFileSync as writeFileSync43 } from "fs";
|
|
170464
|
-
import { dirname as dirname53, resolve as
|
|
170534
|
+
import { dirname as dirname53, resolve as resolve62 } from "path";
|
|
170465
170535
|
function pathsReferToSameFile(firstPath, secondPath) {
|
|
170466
|
-
const first =
|
|
170467
|
-
const second =
|
|
170536
|
+
const first = resolve62(firstPath);
|
|
170537
|
+
const second = resolve62(secondPath);
|
|
170468
170538
|
if (first === second) return true;
|
|
170469
170539
|
try {
|
|
170470
170540
|
const firstStat = statSync37(first);
|
|
@@ -170570,13 +170640,13 @@ function applyOrbitCamera(selectors, cam) {
|
|
|
170570
170640
|
lens.style.perspectiveOrigin = "50% 50%";
|
|
170571
170641
|
}
|
|
170572
170642
|
function compositeGhostFrames(frames, alphas, W2, H3, label2) {
|
|
170573
|
-
return new Promise((
|
|
170643
|
+
return new Promise((resolve85) => {
|
|
170574
170644
|
const cv = document.createElement("canvas");
|
|
170575
170645
|
cv.width = W2;
|
|
170576
170646
|
cv.height = H3;
|
|
170577
170647
|
const ctx = cv.getContext("2d");
|
|
170578
170648
|
if (!ctx) {
|
|
170579
|
-
|
|
170649
|
+
resolve85("");
|
|
170580
170650
|
return;
|
|
170581
170651
|
}
|
|
170582
170652
|
ctx.fillStyle = "#000";
|
|
@@ -170588,7 +170658,7 @@ function compositeGhostFrames(frames, alphas, W2, H3, label2) {
|
|
|
170588
170658
|
ctx.font = "600 22px ui-monospace, SFMono-Regular, Menlo, monospace";
|
|
170589
170659
|
ctx.fillStyle = "#86c2ff";
|
|
170590
170660
|
ctx.fillText(label2, 24, 38);
|
|
170591
|
-
|
|
170661
|
+
resolve85(cv.toDataURL("image/png"));
|
|
170592
170662
|
return;
|
|
170593
170663
|
}
|
|
170594
170664
|
const img = new Image();
|
|
@@ -170945,7 +171015,7 @@ async function captureMarkerOnionSkin(page, requests, times, size, camera, frame
|
|
|
170945
171015
|
return outPath;
|
|
170946
171016
|
}
|
|
170947
171017
|
async function captureMotionPathShot(projectDir, requestsIn, outPath, opts = {}) {
|
|
170948
|
-
ensureShotOutputDir(outPath,
|
|
171018
|
+
ensureShotOutputDir(outPath, resolve62(projectDir, opts.entryFile ?? "index.html"));
|
|
170949
171019
|
let requests = requestsIn;
|
|
170950
171020
|
const samples = Math.max(1, Math.min(60, opts.samples ?? 9));
|
|
170951
171021
|
const layout2 = opts.layout ?? "path";
|
|
@@ -171030,7 +171100,7 @@ __export(keyframes_exports, {
|
|
|
171030
171100
|
surfaceComposition: () => surfaceComposition
|
|
171031
171101
|
});
|
|
171032
171102
|
import { existsSync as existsSync98, readFileSync as readFileSync73, statSync as statSync38 } from "fs";
|
|
171033
|
-
import { resolve as
|
|
171103
|
+
import { resolve as resolve63, dirname as dirname54, basename as basename23, join as join115, relative as relative30, sep as sep17 } from "path";
|
|
171034
171104
|
function queryIncludingTemplates(html, selector) {
|
|
171035
171105
|
const doc = new DOMParser().parseFromString(html, "text/html");
|
|
171036
171106
|
const roots = [doc];
|
|
@@ -171400,7 +171470,7 @@ function collectCompositions(indexPath2) {
|
|
|
171400
171470
|
for (const div of Array.from(doc.querySelectorAll("[data-composition-src]"))) {
|
|
171401
171471
|
const src = div.getAttribute("data-composition-src");
|
|
171402
171472
|
if (!src) continue;
|
|
171403
|
-
const subPath =
|
|
171473
|
+
const subPath = resolve63(baseDir, src);
|
|
171404
171474
|
if (!existsSync98(subPath)) continue;
|
|
171405
171475
|
const id = div.getAttribute("data-composition-id") ?? src;
|
|
171406
171476
|
out.push(surfaceComposition(readFileSync73(subPath, "utf-8"), id, src));
|
|
@@ -171507,7 +171577,7 @@ async function runOnionShot(comps, allComps, projectDir, entryFile, args) {
|
|
|
171507
171577
|
console.log(c.dim(guardError));
|
|
171508
171578
|
return true;
|
|
171509
171579
|
}
|
|
171510
|
-
const saved = await captureMotionPathShot2(projectDir, requests,
|
|
171580
|
+
const saved = await captureMotionPathShot2(projectDir, requests, resolve63(args.shot), {
|
|
171511
171581
|
...onionShotOptions(args),
|
|
171512
171582
|
entryFile
|
|
171513
171583
|
});
|
|
@@ -171521,7 +171591,7 @@ function resolveScope(args) {
|
|
|
171521
171591
|
let projectDir;
|
|
171522
171592
|
let entryFile;
|
|
171523
171593
|
if (raw && raw.endsWith(".html") && existsSync98(raw) && statSync38(raw).isFile()) {
|
|
171524
|
-
const entryPath =
|
|
171594
|
+
const entryPath = resolve63(raw);
|
|
171525
171595
|
comps = [surfaceComposition(readFileSync73(entryPath, "utf-8"), basename23(entryPath), entryPath)];
|
|
171526
171596
|
projectName = basename23(entryPath);
|
|
171527
171597
|
projectDir = findProjectRoot(entryPath);
|
|
@@ -171851,7 +171921,7 @@ __export(compositions_exports, {
|
|
|
171851
171921
|
parseSubComposition: () => parseSubComposition
|
|
171852
171922
|
});
|
|
171853
171923
|
import { existsSync as existsSync99, readFileSync as readFileSync75 } from "fs";
|
|
171854
|
-
import { resolve as
|
|
171924
|
+
import { resolve as resolve64, dirname as dirname55 } from "path";
|
|
171855
171925
|
function countRenderableDescendants(root) {
|
|
171856
171926
|
return Array.from(root.querySelectorAll("*")).filter(
|
|
171857
171927
|
(el) => !NON_RENDERED_TAGS4.has(el.tagName.toLowerCase())
|
|
@@ -171885,7 +171955,7 @@ function parseCompositions(html, baseDir) {
|
|
|
171885
171955
|
const height = parseInt(div.getAttribute("data-height") ?? "1080", 10);
|
|
171886
171956
|
const compositionSrc = div.getAttribute("data-composition-src");
|
|
171887
171957
|
if (compositionSrc) {
|
|
171888
|
-
const subPath =
|
|
171958
|
+
const subPath = resolve64(baseDir, compositionSrc);
|
|
171889
171959
|
if (existsSync99(subPath)) {
|
|
171890
171960
|
const subHtml = readFileSync75(subPath, "utf-8");
|
|
171891
171961
|
const subInfo = parseSubComposition(subHtml, id, width, height);
|
|
@@ -172036,7 +172106,7 @@ var init_clipFacts = __esm({
|
|
|
172036
172106
|
|
|
172037
172107
|
// src/timeline/describeProject.ts
|
|
172038
172108
|
import { readFileSync as readFileSync76, realpathSync as realpathSync10, statSync as statSync40 } from "fs";
|
|
172039
|
-
import { basename as basename24, dirname as dirname56, isAbsolute as isAbsolute18, relative as relative31, resolve as
|
|
172109
|
+
import { basename as basename24, dirname as dirname56, isAbsolute as isAbsolute18, relative as relative31, resolve as resolve65, sep as sep18 } from "path";
|
|
172040
172110
|
function toNode2(el) {
|
|
172041
172111
|
const attrs2 = {};
|
|
172042
172112
|
for (const { name, value } of Array.from(el.attributes)) attrs2[name] = value;
|
|
@@ -172083,7 +172153,7 @@ async function probeSource(scope, el, tag) {
|
|
|
172083
172153
|
const src = el.getAttribute("src");
|
|
172084
172154
|
if (!src) return { ok: false, reason: "no src attribute" };
|
|
172085
172155
|
if (/^https?:\/\//i.test(src)) return { ok: false, reason: "remote source not probed" };
|
|
172086
|
-
const file = realFileInside(scope.projectDir,
|
|
172156
|
+
const file = realFileInside(scope.projectDir, resolve65(scope.dir, src));
|
|
172087
172157
|
if (!file) return { ok: false, reason: "source file not found" };
|
|
172088
172158
|
return scope.withProbeSlot(async () => {
|
|
172089
172159
|
try {
|
|
@@ -172189,7 +172259,7 @@ async function describeRow(scope, node, depth) {
|
|
|
172189
172259
|
return describeRowFields(scope, node, await resolveRowTiming(scope, node, depth));
|
|
172190
172260
|
}
|
|
172191
172261
|
async function readSubComposition(src, parent, origin) {
|
|
172192
|
-
const authored =
|
|
172262
|
+
const authored = resolve65(parent.dir, src);
|
|
172193
172263
|
const file = realFileInside(parent.projectDir, authored);
|
|
172194
172264
|
if (!file) return [];
|
|
172195
172265
|
const relativeFile = relative31(parent.projectDir, authored).split(sep18).join("/");
|
|
@@ -173357,7 +173427,7 @@ __export(benchmark_exports, {
|
|
|
173357
173427
|
examples: () => examples20
|
|
173358
173428
|
});
|
|
173359
173429
|
import { existsSync as existsSync100, statSync as statSync41 } from "fs";
|
|
173360
|
-
import { resolve as
|
|
173430
|
+
import { resolve as resolve66, join as join119 } from "path";
|
|
173361
173431
|
var examples20, FPS_30, FPS_60, DEFAULT_CONFIGS, benchmark_default;
|
|
173362
173432
|
var init_benchmark = __esm({
|
|
173363
173433
|
"src/commands/benchmark.ts"() {
|
|
@@ -173403,7 +173473,7 @@ var init_benchmark = __esm({
|
|
|
173403
173473
|
failCommand();
|
|
173404
173474
|
}
|
|
173405
173475
|
const jsonOutput = args.json ?? false;
|
|
173406
|
-
const benchDir =
|
|
173476
|
+
const benchDir = resolve66("renders", ".benchmark");
|
|
173407
173477
|
let producer = null;
|
|
173408
173478
|
try {
|
|
173409
173479
|
producer = await loadProducer();
|
|
@@ -173726,7 +173796,7 @@ __export(remove_background_exports, {
|
|
|
173726
173796
|
default: () => remove_background_default,
|
|
173727
173797
|
examples: () => examples22
|
|
173728
173798
|
});
|
|
173729
|
-
import { resolve as
|
|
173799
|
+
import { resolve as resolve67 } from "path";
|
|
173730
173800
|
import { existsSync as existsSync101 } from "fs";
|
|
173731
173801
|
async function showInfo(json) {
|
|
173732
173802
|
const { selectProviders: selectProviders2, listAvailableProviders: listAvailableProviders2, DEFAULT_MODEL: DEFAULT_MODEL5, MODEL_MEMORY_MB: MODEL_MEMORY_MB2, modelPath: modelPath2 } = await Promise.resolve().then(() => (init_manager3(), manager_exports3));
|
|
@@ -173870,10 +173940,10 @@ var init_remove_background = __esm({
|
|
|
173870
173940
|
);
|
|
173871
173941
|
failCommand();
|
|
173872
173942
|
}
|
|
173873
|
-
const inputPath =
|
|
173874
|
-
const outputPath =
|
|
173943
|
+
const inputPath = resolve67(args.input);
|
|
173944
|
+
const outputPath = resolve67(args.output);
|
|
173875
173945
|
const backgroundOutputArg = args["background-output"];
|
|
173876
|
-
const backgroundOutputPath = backgroundOutputArg ?
|
|
173946
|
+
const backgroundOutputPath = backgroundOutputArg ? resolve67(backgroundOutputArg) : void 0;
|
|
173877
173947
|
const { render: render3 } = await Promise.resolve().then(() => (init_pipeline(), pipeline_exports));
|
|
173878
173948
|
const spin = args.json ? null : ft();
|
|
173879
173949
|
spin?.start("Preparing background-removal pipeline...");
|
|
@@ -174040,7 +174110,7 @@ __export(transcribe_exports2, {
|
|
|
174040
174110
|
examples: () => examples23
|
|
174041
174111
|
});
|
|
174042
174112
|
import { existsSync as existsSync104, writeFileSync as writeFileSync45 } from "fs";
|
|
174043
|
-
import { resolve as
|
|
174113
|
+
import { resolve as resolve68, join as join121, extname as extname17, dirname as dirname57 } from "path";
|
|
174044
174114
|
function parseTimeoutMs(raw, json) {
|
|
174045
174115
|
const source = raw ?? process.env["HYPERFRAMES_TRANSCRIBE_TIMEOUT_MS"];
|
|
174046
174116
|
if (source == null || source === "") return void 0;
|
|
@@ -174094,7 +174164,7 @@ async function exportTranscript(inputPath, dir, to, output, json, preserveCues)
|
|
|
174094
174164
|
const { words, format } = loadTranscript2(inputPath);
|
|
174095
174165
|
if (words.length === 0) exitNoWords(json);
|
|
174096
174166
|
const preGrouped = preserveCues || format === "srt" || format === "vtt" || void 0;
|
|
174097
|
-
const outPath =
|
|
174167
|
+
const outPath = resolve68(output ?? join121(dir, `transcript.${to}`));
|
|
174098
174168
|
const content = to === "srt" ? formatSrt2(words, { preGrouped }) : formatVtt2(words, { preGrouped });
|
|
174099
174169
|
writeFileSync45(outPath, content);
|
|
174100
174170
|
if (json) {
|
|
@@ -174277,14 +174347,14 @@ var init_transcribe2 = __esm({
|
|
|
174277
174347
|
}
|
|
174278
174348
|
},
|
|
174279
174349
|
async run({ args }) {
|
|
174280
|
-
const inputPath =
|
|
174350
|
+
const inputPath = resolve68(args.input);
|
|
174281
174351
|
if (!existsSync104(inputPath)) {
|
|
174282
174352
|
const message = `File not found: ${args.input}`;
|
|
174283
174353
|
trackCommandFailure("transcribe", message);
|
|
174284
174354
|
console.error(c.error(message));
|
|
174285
174355
|
failCommand();
|
|
174286
174356
|
}
|
|
174287
|
-
const dir =
|
|
174357
|
+
const dir = resolve68(args.dir ?? dirname57(inputPath));
|
|
174288
174358
|
const ext = extname17(inputPath).toLowerCase();
|
|
174289
174359
|
const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
|
|
174290
174360
|
const to = parseExportFormat(args.to, args.json);
|
|
@@ -174674,7 +174744,7 @@ __export(tts_exports, {
|
|
|
174674
174744
|
examples: () => examples24
|
|
174675
174745
|
});
|
|
174676
174746
|
import { existsSync as existsSync107, readFileSync as readFileSync81 } from "fs";
|
|
174677
|
-
import { resolve as
|
|
174747
|
+
import { resolve as resolve69, extname as extname18 } from "path";
|
|
174678
174748
|
function listVoices(json) {
|
|
174679
174749
|
const rows = BUNDLED_VOICES.map((v2) => ({ ...v2, defaultLang: inferLangFromVoiceId(v2.id) }));
|
|
174680
174750
|
if (json) {
|
|
@@ -174789,7 +174859,7 @@ var init_tts = __esm({
|
|
|
174789
174859
|
failCommand();
|
|
174790
174860
|
}
|
|
174791
174861
|
let text2;
|
|
174792
|
-
const maybeFile =
|
|
174862
|
+
const maybeFile = resolve69(input2);
|
|
174793
174863
|
if (existsSync107(maybeFile) && extname18(maybeFile).toLowerCase() === ".txt") {
|
|
174794
174864
|
text2 = readFileSync81(maybeFile, "utf-8").trim();
|
|
174795
174865
|
if (!text2) {
|
|
@@ -174803,7 +174873,7 @@ var init_tts = __esm({
|
|
|
174803
174873
|
console.error(c.error("No text provided."));
|
|
174804
174874
|
failCommand();
|
|
174805
174875
|
}
|
|
174806
|
-
const output =
|
|
174876
|
+
const output = resolve69(args.output ?? "speech.wav");
|
|
174807
174877
|
const voice = args.voice ?? DEFAULT_VOICE;
|
|
174808
174878
|
const speed = args.speed ? parseFloat(args.speed) : 1;
|
|
174809
174879
|
if (isNaN(speed) || speed <= 0 || speed > 3) {
|
|
@@ -174884,13 +174954,13 @@ __export(docs_exports, {
|
|
|
174884
174954
|
examples: () => examples25
|
|
174885
174955
|
});
|
|
174886
174956
|
import { readFileSync as readFileSync83, existsSync as existsSync108 } from "fs";
|
|
174887
|
-
import { resolve as
|
|
174957
|
+
import { resolve as resolve70, dirname as dirname59, join as join125 } from "path";
|
|
174888
174958
|
import { fileURLToPath as fileURLToPath16 } from "url";
|
|
174889
174959
|
function docsDir() {
|
|
174890
174960
|
const thisFile = fileURLToPath16(import.meta.url);
|
|
174891
174961
|
const dir = dirname59(thisFile);
|
|
174892
|
-
const devPath =
|
|
174893
|
-
const builtPath =
|
|
174962
|
+
const devPath = resolve70(dir, "..", "docs");
|
|
174963
|
+
const builtPath = resolve70(dir, "docs");
|
|
174894
174964
|
return existsSync108(devPath) ? devPath : builtPath;
|
|
174895
174965
|
}
|
|
174896
174966
|
function formatInlineCode(line3) {
|
|
@@ -175409,7 +175479,7 @@ __export(upgrade_exports, {
|
|
|
175409
175479
|
});
|
|
175410
175480
|
import { execFileSync as execFileSync17 } from "child_process";
|
|
175411
175481
|
import { existsSync as existsSync110, readFileSync as readFileSync84, writeFileSync as writeFileSync46, renameSync as renameSync20, readdirSync as readdirSync39 } from "fs";
|
|
175412
|
-
import { resolve as
|
|
175482
|
+
import { resolve as resolve71 } from "path";
|
|
175413
175483
|
async function confirmUpgrade() {
|
|
175414
175484
|
const shouldUpgrade = await ue({ message: "Upgrade now?" });
|
|
175415
175485
|
return !q(shouldUpgrade) && shouldUpgrade === true;
|
|
@@ -175467,7 +175537,7 @@ function resolveProjectArgs(project, opts) {
|
|
|
175467
175537
|
return { dir: project, check: opts.check, json: opts.json };
|
|
175468
175538
|
}
|
|
175469
175539
|
async function upgradeProjectPins(dir, opts) {
|
|
175470
|
-
const pkgPath =
|
|
175540
|
+
const pkgPath = resolve71(dir, "package.json");
|
|
175471
175541
|
if (!existsSync110(pkgPath)) {
|
|
175472
175542
|
return { changed: false, from: [], to: "", path: pkgPath };
|
|
175473
175543
|
}
|
|
@@ -175477,7 +175547,7 @@ async function upgradeProjectPins(dir, opts) {
|
|
|
175477
175547
|
if (!isSafeVersion(latest)) return { changed: false, from: [], to: latest, path: pkgPath };
|
|
175478
175548
|
const rewrite = rewriteProjectPinnedScripts(scripts, latest);
|
|
175479
175549
|
const wrapperRewrites = readdirSync39(dir, { withFileTypes: true }).filter((entry) => entry.isFile() && entry.name.endsWith(".sh")).map((entry) => {
|
|
175480
|
-
const path =
|
|
175550
|
+
const path = resolve71(dir, entry.name);
|
|
175481
175551
|
return { path, rewrite: rewritePinnedHyperframesText(readFileSync84(path, "utf-8"), latest) };
|
|
175482
175552
|
});
|
|
175483
175553
|
if (rewrite.changed && !opts.check) {
|
|
@@ -175562,7 +175632,7 @@ var init_upgrade = __esm({
|
|
|
175562
175632
|
const checkOnly = args.check === true;
|
|
175563
175633
|
if (args.project !== void 0) {
|
|
175564
175634
|
const p2 = resolveProjectArgs(args.project, { check: checkOnly, json: useJson });
|
|
175565
|
-
const res = await upgradeProjectPins(
|
|
175635
|
+
const res = await upgradeProjectPins(resolve71(p2.dir), { json: p2.json, check: p2.check });
|
|
175566
175636
|
if (p2.json) {
|
|
175567
175637
|
console.log(JSON.stringify(withMeta(res), null, 2));
|
|
175568
175638
|
return;
|
|
@@ -175808,7 +175878,7 @@ __export(feedback_exports, {
|
|
|
175808
175878
|
examples: () => examples28
|
|
175809
175879
|
});
|
|
175810
175880
|
import { randomUUID as randomUUID14 } from "crypto";
|
|
175811
|
-
import { resolve as
|
|
175881
|
+
import { resolve as resolve72 } from "path";
|
|
175812
175882
|
import open from "open";
|
|
175813
175883
|
function normalizeComment(raw) {
|
|
175814
175884
|
return raw || void 0;
|
|
@@ -175881,7 +175951,7 @@ async function openAndPrintIssue(url) {
|
|
|
175881
175951
|
console.log();
|
|
175882
175952
|
}
|
|
175883
175953
|
async function fileGithubIssue(opts) {
|
|
175884
|
-
const dir =
|
|
175954
|
+
const dir = resolve72(opts.rawDir ?? ".");
|
|
175885
175955
|
if (!await confirmFileIssue(dir, opts.yes)) return;
|
|
175886
175956
|
const repoPublicUrl = await publishRepro(dir);
|
|
175887
175957
|
const url = buildIssueUrl({
|
|
@@ -176462,7 +176532,7 @@ __export(snapshot_exports, {
|
|
|
176462
176532
|
});
|
|
176463
176533
|
import { existsSync as existsSync112, mkdtempSync as mkdtempSync25, readFileSync as readFileSync86, mkdirSync as mkdirSync56, rmSync as rmSync38, writeFileSync as writeFileSync48 } from "fs";
|
|
176464
176534
|
import { tmpdir as tmpdir16 } from "os";
|
|
176465
|
-
import { resolve as
|
|
176535
|
+
import { resolve as resolve73, join as join128, relative as relative33, isAbsolute as isAbsolute19, basename as basename29, posix as posix6 } from "path";
|
|
176466
176536
|
function orbitStageSource() {
|
|
176467
176537
|
return `function(cam) {
|
|
176468
176538
|
var root = document.querySelector("[data-composition-id]")
|
|
@@ -176722,7 +176792,7 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
176722
176792
|
try {
|
|
176723
176793
|
const url = new URL(v2.src);
|
|
176724
176794
|
const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
|
|
176725
|
-
const candidate =
|
|
176795
|
+
const candidate = resolve73(projectDir, decodedPath);
|
|
176726
176796
|
const rel2 = relative33(projectDir, candidate);
|
|
176727
176797
|
if (!rel2.startsWith("..") && !isAbsolute19(rel2) && existsSync112(candidate)) {
|
|
176728
176798
|
ffmpegInput = candidate;
|
|
@@ -176957,7 +177027,7 @@ var init_snapshot = __esm({
|
|
|
176957
177027
|
const camera = args.angle ? parseAngle(String(args.angle)) : void 0;
|
|
176958
177028
|
const zoomTarget = args.zoom ? parseZoomTarget(String(args.zoom)) : void 0;
|
|
176959
177029
|
const zoomScale = parseZoomScale(args["zoom-scale"]);
|
|
176960
|
-
const against = args.against ?
|
|
177030
|
+
const against = args.against ? resolve73(String(args.against)) : void 0;
|
|
176961
177031
|
if (against && !existsSync112(against)) {
|
|
176962
177032
|
console.log(`${c.error("\u2717")} --against video not found: ${against}`);
|
|
176963
177033
|
failCommand();
|
|
@@ -176966,7 +177036,7 @@ var init_snapshot = __esm({
|
|
|
176966
177036
|
const angleLabel = camera && (camera.yaw !== 0 || camera.pitch !== 0) ? ` ${c.dim(`(angle yaw ${camera.yaw}\xB0 pitch ${camera.pitch}\xB0)`)}` : "";
|
|
176967
177037
|
console.log(`${c.accent("\u25C6")} Capturing ${label2} from ${c.accent(project.name)}${angleLabel}`);
|
|
176968
177038
|
try {
|
|
176969
|
-
const snapshotDir = args.output ?
|
|
177039
|
+
const snapshotDir = args.output ? resolve73(String(args.output)) : join128(project.dir, "snapshots");
|
|
176970
177040
|
const paths = await captureSnapshots(project.dir, {
|
|
176971
177041
|
frames,
|
|
176972
177042
|
timeout,
|
|
@@ -177106,14 +177176,14 @@ var init_sourceMutation = __esm({
|
|
|
177106
177176
|
});
|
|
177107
177177
|
|
|
177108
177178
|
// src/utils/pathArgs.ts
|
|
177109
|
-
import { isAbsolute as isAbsolute20, relative as relative34, resolve as
|
|
177179
|
+
import { isAbsolute as isAbsolute20, relative as relative34, resolve as resolve74 } from "path";
|
|
177110
177180
|
function readOptionalString(value) {
|
|
177111
177181
|
if (typeof value !== "string") return void 0;
|
|
177112
177182
|
const trimmed = value.trim();
|
|
177113
177183
|
return trimmed ? trimmed : void 0;
|
|
177114
177184
|
}
|
|
177115
177185
|
function resolveFromBase(baseDir, input2) {
|
|
177116
|
-
return isAbsolute20(input2) ? input2 :
|
|
177186
|
+
return isAbsolute20(input2) ? input2 : resolve74(baseDir, input2);
|
|
177117
177187
|
}
|
|
177118
177188
|
function displayPathFromBase(baseDir, filePath) {
|
|
177119
177189
|
const rel = relative34(baseDir, filePath);
|
|
@@ -177411,7 +177481,7 @@ __export(media_treatment_exports, {
|
|
|
177411
177481
|
resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
|
|
177412
177482
|
});
|
|
177413
177483
|
import { existsSync as existsSync113, readFileSync as readFileSync87, writeFileSync as writeFileSync49 } from "fs";
|
|
177414
|
-
import { join as join129, relative as relative35, resolve as
|
|
177484
|
+
import { join as join129, relative as relative35, resolve as resolve75 } from "path";
|
|
177415
177485
|
function getMediaTreatmentCapabilityOverview() {
|
|
177416
177486
|
const capabilities = getHfColorGradingCapabilities();
|
|
177417
177487
|
const family = (id, label2, description) => ({
|
|
@@ -177838,7 +177908,7 @@ function runCapabilityQuery(args) {
|
|
|
177838
177908
|
function resolveMutationFile(args) {
|
|
177839
177909
|
const project = resolveProject(readOptionalString(args.project));
|
|
177840
177910
|
const fileArg = readOptionalString(args.file) ?? "index.html";
|
|
177841
|
-
const filePath =
|
|
177911
|
+
const filePath = resolve75(project.dir, fileArg);
|
|
177842
177912
|
if (!isPathInside(filePath, project.dir) || !filePath.toLowerCase().endsWith(".html")) {
|
|
177843
177913
|
throw new Error("--file must be an HTML file inside the project");
|
|
177844
177914
|
}
|
|
@@ -178073,7 +178143,7 @@ import {
|
|
|
178073
178143
|
writeFileSync as writeFileSync50
|
|
178074
178144
|
} from "fs";
|
|
178075
178145
|
import { tmpdir as tmpdir17 } from "os";
|
|
178076
|
-
import { basename as basename31, dirname as dirname63, extname as extname21, join as join130, resolve as
|
|
178146
|
+
import { basename as basename31, dirname as dirname63, extname as extname21, join as join130, resolve as resolve76 } from "path";
|
|
178077
178147
|
import sharp2 from "sharp";
|
|
178078
178148
|
function isRecord15(value) {
|
|
178079
178149
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
@@ -178205,7 +178275,7 @@ function parseGradeCompareArgs(args) {
|
|
|
178205
178275
|
if (Boolean(gradesArg) === Boolean(lutsArg)) {
|
|
178206
178276
|
throw new Error("Exactly one of --grades or --luts is required");
|
|
178207
178277
|
}
|
|
178208
|
-
const projectDir =
|
|
178278
|
+
const projectDir = resolve76(readOptionalString(args.project) ?? process.cwd());
|
|
178209
178279
|
const framePath = resolveFromBase(projectDir, frameArg);
|
|
178210
178280
|
const outPath = resolveFromBase(projectDir, readOptionalString(args.out) ?? "grade-compare.png");
|
|
178211
178281
|
return {
|
|
@@ -178966,8 +179036,8 @@ function createCaptureWatchdog(deadlineMs) {
|
|
|
178966
179036
|
let timer;
|
|
178967
179037
|
let resolveDeadline = () => {
|
|
178968
179038
|
};
|
|
178969
|
-
const promise = new Promise((
|
|
178970
|
-
resolveDeadline =
|
|
179039
|
+
const promise = new Promise((resolve85) => {
|
|
179040
|
+
resolveDeadline = resolve85;
|
|
178971
179041
|
});
|
|
178972
179042
|
if (deadlineMs !== void 0) {
|
|
178973
179043
|
timer = setTimeout(() => {
|
|
@@ -179879,7 +179949,7 @@ __export(video_exports, {
|
|
|
179879
179949
|
safeFilename: () => safeFilename
|
|
179880
179950
|
});
|
|
179881
179951
|
import { createWriteStream as createWriteStream3, existsSync as existsSync116, mkdirSync as mkdirSync60, readFileSync as readFileSync89, unlinkSync as unlinkSync11 } from "fs";
|
|
179882
|
-
import { resolve as
|
|
179952
|
+
import { resolve as resolve77, join as join134, basename as basename33 } from "path";
|
|
179883
179953
|
async function streamToFile(url, destPath) {
|
|
179884
179954
|
const r = await safeFetch(url, {
|
|
179885
179955
|
signal: AbortSignal.timeout(12e4),
|
|
@@ -179997,7 +180067,7 @@ function pickManifestEntry(manifest, args) {
|
|
|
179997
180067
|
};
|
|
179998
180068
|
}
|
|
179999
180069
|
async function runVideoMode(args) {
|
|
180000
|
-
const projectDir =
|
|
180070
|
+
const projectDir = resolve77(args.project);
|
|
180001
180071
|
const directPath = join134(projectDir, "extracted", "video-manifest.json");
|
|
180002
180072
|
const w2hPath = join134(projectDir, "capture", "extracted", "video-manifest.json");
|
|
180003
180073
|
const manifestPath3 = existsSync116(directPath) ? directPath : w2hPath;
|
|
@@ -180565,7 +180635,7 @@ async function lazyScrollForCapture(page, budgetMs, opts = {}) {
|
|
|
180565
180635
|
return { steps: 0, timedOut: false, degraded: false };
|
|
180566
180636
|
}
|
|
180567
180637
|
const stepDelayMs = opts.stepDelayMs ?? LAZY_SCROLL_STEP_DELAY_MS;
|
|
180568
|
-
const sleep4 = opts.sleep ?? ((ms) => new Promise((
|
|
180638
|
+
const sleep4 = opts.sleep ?? ((ms) => new Promise((resolve85) => setTimeout(resolve85, ms)));
|
|
180569
180639
|
const deadline = Date.now() + budgetMs;
|
|
180570
180640
|
let steps = 0;
|
|
180571
180641
|
let timedOut = false;
|
|
@@ -180929,12 +180999,12 @@ var init_agentPromptGenerator = __esm({
|
|
|
180929
180999
|
|
|
180930
181000
|
// src/capture/scaffolding.ts
|
|
180931
181001
|
import { existsSync as existsSync118, readFileSync as readFileSync90 } from "fs";
|
|
180932
|
-
import { join as join137, resolve as
|
|
181002
|
+
import { join as join137, resolve as resolve78 } from "path";
|
|
180933
181003
|
function loadEnvFile(startDir) {
|
|
180934
181004
|
try {
|
|
180935
|
-
let dir =
|
|
181005
|
+
let dir = resolve78(startDir);
|
|
180936
181006
|
for (let i = 0; i < 5; i++) {
|
|
180937
|
-
const envPath =
|
|
181007
|
+
const envPath = resolve78(dir, ".env");
|
|
180938
181008
|
try {
|
|
180939
181009
|
const envContent = readFileSync90(envPath, "utf-8");
|
|
180940
181010
|
for (const line3 of envContent.split("\n")) {
|
|
@@ -180948,7 +181018,7 @@ function loadEnvFile(startDir) {
|
|
|
180948
181018
|
}
|
|
180949
181019
|
break;
|
|
180950
181020
|
} catch {
|
|
180951
|
-
dir =
|
|
181021
|
+
dir = resolve78(dir, "..");
|
|
180952
181022
|
}
|
|
180953
181023
|
}
|
|
180954
181024
|
} catch {
|
|
@@ -181140,7 +181210,7 @@ async function navigatePage(context) {
|
|
|
181140
181210
|
);
|
|
181141
181211
|
}
|
|
181142
181212
|
context.postNavigationDeadline = Date.now() + context.budgetMs;
|
|
181143
|
-
await new Promise((
|
|
181213
|
+
await new Promise((resolve85) => setTimeout(resolve85, context.settleTime));
|
|
181144
181214
|
return navigation;
|
|
181145
181215
|
}
|
|
181146
181216
|
async function checkPageContent(context) {
|
|
@@ -185056,7 +185126,7 @@ __export(capture_exports2, {
|
|
|
185056
185126
|
default: () => capture_default,
|
|
185057
185127
|
examples: () => examples34
|
|
185058
185128
|
});
|
|
185059
|
-
import { resolve as
|
|
185129
|
+
import { resolve as resolve79 } from "path";
|
|
185060
185130
|
function emitCapturePhase(event) {
|
|
185061
185131
|
diag.notice(`${CAPTURE_PHASE_PREFIX}${JSON.stringify(event)}`);
|
|
185062
185132
|
}
|
|
@@ -185181,13 +185251,13 @@ var init_capture2 = __esm({
|
|
|
185181
185251
|
const captureBudgetMs = parseCaptureBudget(args["capture-budget"]);
|
|
185182
185252
|
const isDefaultOutput = !args.output;
|
|
185183
185253
|
let outputName = args.output ?? "capture";
|
|
185184
|
-
let outputDir =
|
|
185254
|
+
let outputDir = resolve79(outputName);
|
|
185185
185255
|
if (isDefaultOutput) {
|
|
185186
185256
|
const { existsSync: existsSync136 } = await import("fs");
|
|
185187
185257
|
let n3 = 2;
|
|
185188
185258
|
while (existsSync136(outputDir) && n3 < 100) {
|
|
185189
185259
|
outputName = `capture-${n3}`;
|
|
185190
|
-
outputDir =
|
|
185260
|
+
outputDir = resolve79(outputName);
|
|
185191
185261
|
n3++;
|
|
185192
185262
|
}
|
|
185193
185263
|
if (existsSync136(outputDir)) {
|
|
@@ -185543,16 +185613,16 @@ var init_sam = __esm({
|
|
|
185543
185613
|
|
|
185544
185614
|
// src/commands/lambda/repoRoot.ts
|
|
185545
185615
|
import { existsSync as existsSync125 } from "fs";
|
|
185546
|
-
import { dirname as dirname66, resolve as
|
|
185616
|
+
import { dirname as dirname66, resolve as resolve80 } from "path";
|
|
185547
185617
|
import { fileURLToPath as fileURLToPath17 } from "url";
|
|
185548
185618
|
function repoRoot() {
|
|
185549
185619
|
const override = process.env.HYPERFRAMES_REPO_ROOT;
|
|
185550
|
-
if (override && existsSync125(
|
|
185620
|
+
if (override && existsSync125(resolve80(override, "packages", "aws-lambda", "package.json"))) {
|
|
185551
185621
|
return override;
|
|
185552
185622
|
}
|
|
185553
185623
|
let dir = dirname66(fileURLToPath17(import.meta.url));
|
|
185554
185624
|
for (let depth = 0; depth < 12; depth++) {
|
|
185555
|
-
if (existsSync125(
|
|
185625
|
+
if (existsSync125(resolve80(dir, "packages", "aws-lambda", "package.json"))) {
|
|
185556
185626
|
return dir;
|
|
185557
185627
|
}
|
|
185558
185628
|
const parent = dirname66(dir);
|
|
@@ -185576,7 +185646,7 @@ __export(deploy_exports, {
|
|
|
185576
185646
|
});
|
|
185577
185647
|
import { spawnSync as spawnSync6 } from "child_process";
|
|
185578
185648
|
import { existsSync as existsSync126 } from "fs";
|
|
185579
|
-
import { join as join150, resolve as
|
|
185649
|
+
import { join as join150, resolve as resolve81 } from "path";
|
|
185580
185650
|
async function runDeploy(args = {}) {
|
|
185581
185651
|
const resolved2 = {
|
|
185582
185652
|
stackName: args.stackName ?? DEFAULT_STACK_NAME,
|
|
@@ -185630,7 +185700,7 @@ async function runDeploy(args = {}) {
|
|
|
185630
185700
|
console.log(` ${c.dim("Bucket:")} ${outputs.bucketName}`);
|
|
185631
185701
|
console.log(` ${c.dim("State machine:")} ${outputs.stateMachineArn}`);
|
|
185632
185702
|
console.log(` ${c.dim("Function:")} ${outputs.functionName}`);
|
|
185633
|
-
console.log(` ${c.dim("State file:")} ${
|
|
185703
|
+
console.log(` ${c.dim("State file:")} ${resolve81(statePath2)}`);
|
|
185634
185704
|
console.log();
|
|
185635
185705
|
console.log(c.dim(`Render with: hyperframes lambda render <project-dir>`));
|
|
185636
185706
|
}
|
|
@@ -186966,7 +187036,7 @@ __export(cloudrun_exports, {
|
|
|
186966
187036
|
import { spawnSync as spawnSync7 } from "child_process";
|
|
186967
187037
|
import { existsSync as existsSync129, mkdirSync as mkdirSync68, readFileSync as readFileSync99, writeFileSync as writeFileSync53 } from "fs";
|
|
186968
187038
|
import { homedir as homedir24 } from "os";
|
|
186969
|
-
import { join as join154, resolve as
|
|
187039
|
+
import { join as join154, resolve as resolve82 } from "path";
|
|
186970
187040
|
function loadCloudRunAdapter() {
|
|
186971
187041
|
cloudRunAdapterPromise ??= Promise.all([
|
|
186972
187042
|
import("@hyperframes/gcp-cloud-run/sdk"),
|
|
@@ -187144,7 +187214,7 @@ function machineVars(args, project, region, image) {
|
|
|
187144
187214
|
return vars;
|
|
187145
187215
|
}
|
|
187146
187216
|
function findRepoRoot(tfDir) {
|
|
187147
|
-
const candidate =
|
|
187217
|
+
const candidate = resolve82(tfDir, "..", "..", "..");
|
|
187148
187218
|
if (existsSync129(join154(candidate, "packages", "gcp-cloud-run", "Dockerfile"))) return candidate;
|
|
187149
187219
|
return null;
|
|
187150
187220
|
}
|
|
@@ -187179,7 +187249,7 @@ async function runSites(args) {
|
|
|
187179
187249
|
const state = readState2(args);
|
|
187180
187250
|
const { deploySite } = await loadCloudRunAdapter();
|
|
187181
187251
|
const handle = await deploySite({
|
|
187182
|
-
projectDir:
|
|
187252
|
+
projectDir: resolve82(projectDir),
|
|
187183
187253
|
bucketName: state.bucketName,
|
|
187184
187254
|
siteId: args["site-id"]
|
|
187185
187255
|
});
|
|
@@ -187214,11 +187284,11 @@ async function runRender2(args) {
|
|
|
187214
187284
|
}
|
|
187215
187285
|
const fps = resolveCloudRunFps(args, projectDir, "render");
|
|
187216
187286
|
const state = readState2(args);
|
|
187217
|
-
const variables = resolveAndValidateVariables(args,
|
|
187287
|
+
const variables = resolveAndValidateVariables(args, resolve82(projectDir));
|
|
187218
187288
|
const config = buildRenderConfig(args, fps, width, height, variables);
|
|
187219
187289
|
const { renderToCloudRun, getRenderProgress } = await loadCloudRunAdapter();
|
|
187220
187290
|
const handle = await renderToCloudRun({
|
|
187221
|
-
projectDir:
|
|
187291
|
+
projectDir: resolve82(projectDir),
|
|
187222
187292
|
config,
|
|
187223
187293
|
bucketName: state.bucketName,
|
|
187224
187294
|
projectId: state.projectId,
|
|
@@ -187294,11 +187364,11 @@ async function runRenderBatch2(args) {
|
|
|
187294
187364
|
failCommand();
|
|
187295
187365
|
}
|
|
187296
187366
|
const fps = resolveCloudRunFps(args, projectDir, "render-batch");
|
|
187297
|
-
if (!existsSync129(
|
|
187367
|
+
if (!existsSync129(resolve82(batchPath))) {
|
|
187298
187368
|
console.error(`[cloudrun render-batch] batch file not found: ${batchPath}`);
|
|
187299
187369
|
failCommand();
|
|
187300
187370
|
}
|
|
187301
|
-
const entries2 = parseBatchFile2(
|
|
187371
|
+
const entries2 = parseBatchFile2(resolve82(batchPath));
|
|
187302
187372
|
if (entries2.length === 0) {
|
|
187303
187373
|
console.error("[cloudrun render-batch] batch file has no entries.");
|
|
187304
187374
|
failCommand();
|
|
@@ -187317,7 +187387,7 @@ async function runRenderBatch2(args) {
|
|
|
187317
187387
|
const maxConcurrent = parsePositiveInt2(args["max-concurrent"], "--max-concurrent") ?? DEFAULT_BATCH_MAX_CONCURRENT;
|
|
187318
187388
|
const { deploySite, renderToCloudRun } = await loadCloudRunAdapter();
|
|
187319
187389
|
const siteHandle = await deploySite({
|
|
187320
|
-
projectDir:
|
|
187390
|
+
projectDir: resolve82(projectDir),
|
|
187321
187391
|
bucketName: state.bucketName,
|
|
187322
187392
|
siteId: args["site-id"]
|
|
187323
187393
|
});
|
|
@@ -187770,14 +187840,14 @@ function signalAbortError(signal) {
|
|
|
187770
187840
|
return reason instanceof Error ? reason : new Error("Poll aborted");
|
|
187771
187841
|
}
|
|
187772
187842
|
function defaultAbortableSleep(signal) {
|
|
187773
|
-
return (ms) => new Promise((
|
|
187843
|
+
return (ms) => new Promise((resolve85, reject2) => {
|
|
187774
187844
|
const onAbort = () => {
|
|
187775
187845
|
clearTimeout(timer);
|
|
187776
187846
|
reject2(signalAbortError(signal));
|
|
187777
187847
|
};
|
|
187778
187848
|
const timer = setTimeout(() => {
|
|
187779
187849
|
signal?.removeEventListener("abort", onAbort);
|
|
187780
|
-
|
|
187850
|
+
resolve85();
|
|
187781
187851
|
}, ms);
|
|
187782
187852
|
signal?.addEventListener("abort", onAbort, { once: true });
|
|
187783
187853
|
});
|
|
@@ -187814,7 +187884,7 @@ import {
|
|
|
187814
187884
|
rmSync as rmSync43,
|
|
187815
187885
|
statSync as statSync46
|
|
187816
187886
|
} from "fs";
|
|
187817
|
-
import { dirname as dirname67, join as join155, resolve as
|
|
187887
|
+
import { dirname as dirname67, join as join155, resolve as resolve83 } from "path";
|
|
187818
187888
|
import { pipeline as pipeline3 } from "stream/promises";
|
|
187819
187889
|
async function downloadToFile(url, destPath, options = {}) {
|
|
187820
187890
|
const fetchImpl = options.fetchImpl ?? fetch;
|
|
@@ -187864,10 +187934,10 @@ async function downloadToFile(url, destPath, options = {}) {
|
|
|
187864
187934
|
return { path: destPath, bytes };
|
|
187865
187935
|
}
|
|
187866
187936
|
function resolveDownloadDestination(destPath) {
|
|
187867
|
-
let destination =
|
|
187937
|
+
let destination = resolve83(destPath);
|
|
187868
187938
|
for (let hops = 0; hops < 40; hops++) {
|
|
187869
187939
|
if (!lstatSync12(destination, { throwIfNoEntry: false })?.isSymbolicLink()) return destination;
|
|
187870
|
-
destination =
|
|
187940
|
+
destination = resolve83(dirname67(destination), readlinkSync3(destination));
|
|
187871
187941
|
}
|
|
187872
187942
|
throw new Error(`Too many symbolic links in download destination: ${destPath}`);
|
|
187873
187943
|
}
|
|
@@ -189658,7 +189728,7 @@ async function collectApiKey(inline) {
|
|
|
189658
189728
|
return await promptForKey();
|
|
189659
189729
|
}
|
|
189660
189730
|
async function readAllWithTimeout(stream, timeoutMs) {
|
|
189661
|
-
return await new Promise((
|
|
189731
|
+
return await new Promise((resolve85, reject2) => {
|
|
189662
189732
|
const chunks = [];
|
|
189663
189733
|
const timer = setTimeout(() => {
|
|
189664
189734
|
reject2(new Error(`Timed out waiting for stdin (${timeoutMs}ms). Pipe the key explicitly.`));
|
|
@@ -189668,7 +189738,7 @@ async function readAllWithTimeout(stream, timeoutMs) {
|
|
|
189668
189738
|
});
|
|
189669
189739
|
stream.on("end", () => {
|
|
189670
189740
|
clearTimeout(timer);
|
|
189671
|
-
|
|
189741
|
+
resolve85(Buffer.concat(chunks).toString("utf8"));
|
|
189672
189742
|
});
|
|
189673
189743
|
stream.on("error", (err) => {
|
|
189674
189744
|
clearTimeout(timer);
|
|
@@ -190059,8 +190129,8 @@ async function confirmInteractive(prompt) {
|
|
|
190059
190129
|
if (!process.stdin.isTTY) return false;
|
|
190060
190130
|
const { createInterface: createInterface3 } = await import("readline");
|
|
190061
190131
|
const rl = createInterface3({ input: process.stdin, output: process.stdout });
|
|
190062
|
-
const answer = await new Promise((
|
|
190063
|
-
rl.question(prompt, (line3) =>
|
|
190132
|
+
const answer = await new Promise((resolve85) => {
|
|
190133
|
+
rl.question(prompt, (line3) => resolve85(line3));
|
|
190064
190134
|
});
|
|
190065
190135
|
rl.close();
|
|
190066
190136
|
return /^y(es)?$/i.test(answer.trim());
|
|
@@ -192502,7 +192572,7 @@ var init_help = __esm({
|
|
|
192502
192572
|
init_version();
|
|
192503
192573
|
init_dist();
|
|
192504
192574
|
init_runId();
|
|
192505
|
-
import { dirname as dirname70, join as join163, resolve as
|
|
192575
|
+
import { dirname as dirname70, join as join163, resolve as resolve84 } from "path";
|
|
192506
192576
|
import { fileURLToPath as fileURLToPath18 } from "url";
|
|
192507
192577
|
import { existsSync as existsSync135 } from "fs";
|
|
192508
192578
|
|
|
@@ -192636,8 +192706,8 @@ if (rootVersionRequested) {
|
|
|
192636
192706
|
}
|
|
192637
192707
|
try {
|
|
192638
192708
|
const { readFileSync: readFileSync104 } = await import("fs");
|
|
192639
|
-
const { resolve:
|
|
192640
|
-
const envPath =
|
|
192709
|
+
const { resolve: resolve85 } = await import("path");
|
|
192710
|
+
const envPath = resolve85(process.cwd(), ".env");
|
|
192641
192711
|
const envContent = readFileSync104(envPath, "utf-8");
|
|
192642
192712
|
for (const rawLine of envContent.split("\n")) {
|
|
192643
192713
|
let line3 = rawLine.trim();
|
|
@@ -192663,7 +192733,7 @@ try {
|
|
|
192663
192733
|
var isHelp = process.argv.includes("--help") || process.argv.includes("-h");
|
|
192664
192734
|
async function assertStudioWorkspaceBuilt() {
|
|
192665
192735
|
if (!isDevMode()) return;
|
|
192666
|
-
const repoRoot2 =
|
|
192736
|
+
const repoRoot2 = resolve84(dirname70(fileURLToPath18(import.meta.url)), "..", "..", "..");
|
|
192667
192737
|
const { checkStudioWorkspaceBuild: checkStudioWorkspaceBuild2, formatWorkspaceBuildProblems: formatWorkspaceBuildProblems2 } = await Promise.resolve().then(() => (init_workspaceBuildCheck(), workspaceBuildCheck_exports));
|
|
192668
192738
|
const problems = checkStudioWorkspaceBuild2(repoRoot2);
|
|
192669
192739
|
if (problems.length === 0) return;
|