hyperframes 0.7.50 → 0.7.51
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 +180 -140
- package/dist/studio/assets/{index-CdhJLcJc.js → index-3b1A9DtP.js} +1 -1
- package/dist/studio/assets/{index-CWraNKMN.js → index-BiJK2Lfo.js} +3 -3
- package/dist/studio/assets/{index-VhK_L4WR.js → index-ZwnuKogK.js} +1 -1
- package/dist/studio/index.html +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.7.
|
|
53
|
+
VERSION = true ? "0.7.51" : "0.0.0-dev";
|
|
54
54
|
}
|
|
55
55
|
});
|
|
56
56
|
|
|
@@ -60174,7 +60174,8 @@ function readConfig() {
|
|
|
60174
60174
|
lastSkillsCheck: parsed.lastSkillsCheck,
|
|
60175
60175
|
skillsUpdateAvailable: parsed.skillsUpdateAvailable,
|
|
60176
60176
|
skillsOutdatedCount: parsed.skillsOutdatedCount,
|
|
60177
|
-
skillsMissingCount: parsed.skillsMissingCount
|
|
60177
|
+
skillsMissingCount: parsed.skillsMissingCount,
|
|
60178
|
+
skillsRemovedCount: parsed.skillsRemovedCount
|
|
60178
60179
|
};
|
|
60179
60180
|
cachedConfig = config;
|
|
60180
60181
|
return { ...config };
|
|
@@ -83058,7 +83059,14 @@ var init_updateCheck = __esm({
|
|
|
83058
83059
|
// src/utils/skillsManifest.ts
|
|
83059
83060
|
import { execFile } from "child_process";
|
|
83060
83061
|
import { createHash as createHash3 } from "crypto";
|
|
83061
|
-
import {
|
|
83062
|
+
import {
|
|
83063
|
+
existsSync as existsSync23,
|
|
83064
|
+
readdirSync as readdirSync9,
|
|
83065
|
+
readFileSync as readFileSync16,
|
|
83066
|
+
renameSync as renameSync4,
|
|
83067
|
+
statSync as statSync6,
|
|
83068
|
+
writeFileSync as writeFileSync11
|
|
83069
|
+
} from "fs";
|
|
83062
83070
|
import { homedir as homedir6 } from "os";
|
|
83063
83071
|
import { isAbsolute as isAbsolute7, join as join23, relative as relative5, resolve as resolve13, sep as sep4 } from "path";
|
|
83064
83072
|
import { promisify } from "util";
|
|
@@ -83240,6 +83248,19 @@ function detectRemoved(root, latest, opts) {
|
|
|
83240
83248
|
const removed = skillsAttributedToSource(lock, latest.source).filter((name) => !(name in latest.skills)).sort().map((name) => ({ name, status: "removed" }));
|
|
83241
83249
|
return { removed, lockMissing: lock === null };
|
|
83242
83250
|
}
|
|
83251
|
+
function pruneOrphanedLockEntries(names, scope, opts = {}) {
|
|
83252
|
+
const path2 = lockPathForScope(scope, opts);
|
|
83253
|
+
const lock = readSkillLock(path2);
|
|
83254
|
+
if (!lock?.skills) return [];
|
|
83255
|
+
const pruned = names.filter((name) => name in lock.skills);
|
|
83256
|
+
if (pruned.length === 0) return [];
|
|
83257
|
+
for (const name of pruned) delete lock.skills[name];
|
|
83258
|
+
const mode = statSync6(path2).mode & 511;
|
|
83259
|
+
const tmp = `${path2}.tmp`;
|
|
83260
|
+
writeFileSync11(tmp, JSON.stringify(lock, null, 2), { mode });
|
|
83261
|
+
renameSync4(tmp, path2);
|
|
83262
|
+
return pruned;
|
|
83263
|
+
}
|
|
83243
83264
|
function findRepoManifest(cwd = process.cwd()) {
|
|
83244
83265
|
let dir = cwd;
|
|
83245
83266
|
for (let i2 = 0; i2 < 16; i2++) {
|
|
@@ -83303,18 +83324,18 @@ async function fetchRemoteManifest(source) {
|
|
|
83303
83324
|
}
|
|
83304
83325
|
return fetchManifest(`https://raw.githubusercontent.com/${repoSlug2}/main/${MANIFEST_FILE}`);
|
|
83305
83326
|
}
|
|
83306
|
-
async function resolveLatestManifest(source, cwd = process.cwd()) {
|
|
83327
|
+
async function resolveLatestManifest(source, cwd = process.cwd(), opts = {}) {
|
|
83307
83328
|
if (source && (source.startsWith(".") || isAbsolute7(source))) {
|
|
83308
83329
|
return resolveLocalManifest(source);
|
|
83309
83330
|
}
|
|
83310
|
-
if (!source) {
|
|
83331
|
+
if (!source && !opts.canonical) {
|
|
83311
83332
|
const repoManifest = findRepoManifest(cwd);
|
|
83312
83333
|
if (repoManifest) return JSON.parse(readFileSync16(repoManifest, "utf8"));
|
|
83313
83334
|
}
|
|
83314
83335
|
return fetchRemoteManifest(source);
|
|
83315
83336
|
}
|
|
83316
83337
|
async function checkSkills(opts = {}) {
|
|
83317
|
-
const latest = await resolveLatestManifest(opts.source, opts.cwd);
|
|
83338
|
+
const latest = await resolveLatestManifest(opts.source, opts.cwd, { canonical: opts.canonical });
|
|
83318
83339
|
const skillNames = Object.keys(latest.skills);
|
|
83319
83340
|
const root = locateInstall(skillNames, { dir: opts.dir, cwd: opts.cwd, home: opts.home });
|
|
83320
83341
|
const installed = root ? hashInstalled(root, skillNames) : {};
|
|
@@ -83653,8 +83674,15 @@ async function updateSkills(opts = {}) {
|
|
|
83653
83674
|
const strict = opts.strict ?? false;
|
|
83654
83675
|
let check = null;
|
|
83655
83676
|
try {
|
|
83656
|
-
check = await checkSkills({ cwd: opts.cwd });
|
|
83657
|
-
} catch {
|
|
83677
|
+
check = await checkSkills({ cwd: opts.cwd, canonical: true });
|
|
83678
|
+
} catch (err) {
|
|
83679
|
+
if (err instanceof Error && err.message.startsWith("Malformed skills manifest")) {
|
|
83680
|
+
R2.warn(
|
|
83681
|
+
c.warn(
|
|
83682
|
+
"Canonical skills manifest was malformed \u2014 falling back to presence-only mode (an upstream/CDN issue, not your network)."
|
|
83683
|
+
)
|
|
83684
|
+
);
|
|
83685
|
+
}
|
|
83658
83686
|
check = null;
|
|
83659
83687
|
}
|
|
83660
83688
|
if (!check) return updateSkillsOffline(requested, { strict, cwd: opts.cwd });
|
|
@@ -83929,6 +83957,15 @@ var init_skills = __esm({
|
|
|
83929
83957
|
c.dim(`Removing ${removed.length} skill(s) no longer published: ${removed.join(", ")}`)
|
|
83930
83958
|
);
|
|
83931
83959
|
await runSkillsRemove(removed, { global: scope === "global" });
|
|
83960
|
+
const scopeForPrune = scope ?? "global";
|
|
83961
|
+
const stillOrphaned = pruneOrphanedLockEntries(removed, scopeForPrune);
|
|
83962
|
+
if (stillOrphaned.length) {
|
|
83963
|
+
console.log(
|
|
83964
|
+
c.dim(
|
|
83965
|
+
`Reconciled ${stillOrphaned.length} orphaned lock entr${stillOrphaned.length === 1 ? "y" : "ies"} with no on-disk bundle: ${stillOrphaned.join(", ")}`
|
|
83966
|
+
)
|
|
83967
|
+
);
|
|
83968
|
+
}
|
|
83932
83969
|
}
|
|
83933
83970
|
} catch (err) {
|
|
83934
83971
|
R2.warn(c.warn(`Skipped removed-skill cleanup: ${err.message}`));
|
|
@@ -94803,12 +94840,12 @@ import {
|
|
|
94803
94840
|
unlinkSync as unlinkSync22,
|
|
94804
94841
|
rmSync as rmSync22,
|
|
94805
94842
|
statSync as statSync8,
|
|
94806
|
-
renameSync as
|
|
94843
|
+
renameSync as renameSync5,
|
|
94807
94844
|
readdirSync as readdirSync32
|
|
94808
94845
|
} from "fs";
|
|
94809
94846
|
import { resolve as resolve22, dirname as dirname12, join as join62 } from "path";
|
|
94810
94847
|
import { spawn as spawn9 } from "child_process";
|
|
94811
|
-
import { existsSync as existsSync210, writeFileSync as
|
|
94848
|
+
import { existsSync as existsSync210, writeFileSync as writeFileSync12, mkdirSync as mkdirSync14 } from "fs";
|
|
94812
94849
|
import { join as join32, resolve as resolve19 } from "path";
|
|
94813
94850
|
import { spawnSync } from "child_process";
|
|
94814
94851
|
import { mkdtempSync as mkdtempSync2, rmSync as rmSync6, writeFileSync as writeFileSync22 } from "fs";
|
|
@@ -95041,7 +95078,7 @@ async function generateWaveformCache(projectDir, assetPath) {
|
|
|
95041
95078
|
if (existsSync210(cachePath2)) return;
|
|
95042
95079
|
const peaks = await decodeAudioPeaks(audioPath);
|
|
95043
95080
|
mkdirSync14(cacheDir, { recursive: true });
|
|
95044
|
-
|
|
95081
|
+
writeFileSync12(cachePath2, JSON.stringify(peaks));
|
|
95045
95082
|
}
|
|
95046
95083
|
function validateUploadedMedia(filePath, runner = spawnSync) {
|
|
95047
95084
|
const isVideo2 = VIDEO_EXT.test(filePath);
|
|
@@ -96790,7 +96827,7 @@ function registerFileRoutes(api, adapter2) {
|
|
|
96790
96827
|
return c3.json({ error: "already exists" }, 409);
|
|
96791
96828
|
}
|
|
96792
96829
|
ensureDir(newAbs);
|
|
96793
|
-
|
|
96830
|
+
renameSync5(res.absPath, newAbs);
|
|
96794
96831
|
const updatedFiles = updateReferences(res.project.dir, res.filePath, body.newPath);
|
|
96795
96832
|
return c3.json({ ok: true, path: body.newPath, updatedReferences: updatedFiles });
|
|
96796
96833
|
});
|
|
@@ -100314,12 +100351,12 @@ import {
|
|
|
100314
100351
|
mkdirSync as mkdirSync15,
|
|
100315
100352
|
rmSync as rmSync7,
|
|
100316
100353
|
symlinkSync as symlinkSync2,
|
|
100317
|
-
writeFileSync as
|
|
100354
|
+
writeFileSync as writeFileSync13
|
|
100318
100355
|
} from "fs";
|
|
100319
100356
|
import { basename as basename5, dirname as dirname14, isAbsolute as isAbsolute10, join as join31, relative as relative8, resolve as resolve23 } from "path";
|
|
100320
100357
|
function writeFileExclusiveSync(path2, data2) {
|
|
100321
100358
|
try {
|
|
100322
|
-
|
|
100359
|
+
writeFileSync13(path2, data2, { flag: "wx", mode: 384 });
|
|
100323
100360
|
} catch (error) {
|
|
100324
100361
|
if (error && typeof error === "object" && "code" in error && error.code === "EEXIST") {
|
|
100325
100362
|
return;
|
|
@@ -100346,11 +100383,11 @@ function resolveDeviceScaleFactor(input2) {
|
|
|
100346
100383
|
function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
100347
100384
|
const compileDir = join31(workDir, "compiled");
|
|
100348
100385
|
mkdirSync15(compileDir, { recursive: true });
|
|
100349
|
-
|
|
100386
|
+
writeFileSync13(join31(compileDir, "index.html"), compiled.html, "utf-8");
|
|
100350
100387
|
for (const [srcPath, html] of compiled.subCompositions) {
|
|
100351
100388
|
const outPath = join31(compileDir, srcPath);
|
|
100352
100389
|
mkdirSync15(dirname14(outPath), { recursive: true });
|
|
100353
|
-
|
|
100390
|
+
writeFileSync13(outPath, html, "utf-8");
|
|
100354
100391
|
}
|
|
100355
100392
|
for (const [relativePath, absolutePath] of compiled.externalAssets) {
|
|
100356
100393
|
const outPath = resolve23(join31(compileDir, relativePath));
|
|
@@ -100384,7 +100421,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
100384
100421
|
renderModeHints: compiled.renderModeHints,
|
|
100385
100422
|
hasShaderTransitions: compiled.hasShaderTransitions
|
|
100386
100423
|
};
|
|
100387
|
-
|
|
100424
|
+
writeFileSync13(join31(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
|
|
100388
100425
|
}
|
|
100389
100426
|
}
|
|
100390
100427
|
function applyRenderModeHints(alreadyForced, compiled, log2 = defaultLogger) {
|
|
@@ -104705,7 +104742,7 @@ __export(deterministicFonts_exports, {
|
|
|
104705
104742
|
resolveFontFamilyDeclarationFamilies: () => resolveFontFamilyDeclarationFamilies
|
|
104706
104743
|
});
|
|
104707
104744
|
import { createHash as createHash8 } from "crypto";
|
|
104708
|
-
import { existsSync as existsSync35, mkdirSync as mkdirSync16, readFileSync as readFileSync21, writeFileSync as
|
|
104745
|
+
import { existsSync as existsSync35, mkdirSync as mkdirSync16, readFileSync as readFileSync21, writeFileSync as writeFileSync14 } from "fs";
|
|
104709
104746
|
import { homedir as homedir10, tmpdir as tmpdir4 } from "os";
|
|
104710
104747
|
import { join as join34 } from "path";
|
|
104711
104748
|
import postcss4 from "postcss";
|
|
@@ -105061,7 +105098,7 @@ async function ensureWoff2DataUri(cachePath2, woff2Url, familyName, weight, styl
|
|
|
105061
105098
|
}
|
|
105062
105099
|
return null;
|
|
105063
105100
|
}
|
|
105064
|
-
|
|
105101
|
+
writeFileSync14(cachePath2, Buffer.from(await fontRes.arrayBuffer()), { flag: "wx", mode: 420 });
|
|
105065
105102
|
} catch (err) {
|
|
105066
105103
|
if (err instanceof FontFetchError) throw err;
|
|
105067
105104
|
if (err.code === "EEXIST") {
|
|
@@ -105307,7 +105344,7 @@ import {
|
|
|
105307
105344
|
existsSync as existsSync36,
|
|
105308
105345
|
mkdirSync as mkdirSync17,
|
|
105309
105346
|
readFileSync as readFileSync23,
|
|
105310
|
-
renameSync as
|
|
105347
|
+
renameSync as renameSync6,
|
|
105311
105348
|
rmSync as rmSync9,
|
|
105312
105349
|
statSync as statSync10
|
|
105313
105350
|
} from "fs";
|
|
@@ -105497,7 +105534,7 @@ async function ensurePreparedWebm(input2) {
|
|
|
105497
105534
|
throw new Error("Animated GIF transcode produced an empty output");
|
|
105498
105535
|
}
|
|
105499
105536
|
if (!isUsableFile(input2.cachePath)) {
|
|
105500
|
-
|
|
105537
|
+
renameSync6(tmpPath, input2.cachePath);
|
|
105501
105538
|
} else {
|
|
105502
105539
|
rmSync9(tmpPath, { force: true });
|
|
105503
105540
|
}
|
|
@@ -110781,7 +110818,7 @@ import {
|
|
|
110781
110818
|
readdirSync as readdirSync14,
|
|
110782
110819
|
rmSync as rmSync12,
|
|
110783
110820
|
statSync as statSync12,
|
|
110784
|
-
writeFileSync as
|
|
110821
|
+
writeFileSync as writeFileSync15,
|
|
110785
110822
|
copyFileSync as copyFileSync6,
|
|
110786
110823
|
appendFileSync
|
|
110787
110824
|
} from "fs";
|
|
@@ -111309,7 +111346,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
111309
111346
|
`Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
|
|
111310
111347
|
);
|
|
111311
111348
|
}
|
|
111312
|
-
|
|
111349
|
+
writeFileSync15(wrapperPath, standaloneHtml, "utf-8");
|
|
111313
111350
|
htmlPath = wrapperPath;
|
|
111314
111351
|
log2.info("Extracted standalone entry from index.html host context", {
|
|
111315
111352
|
entryFile
|
|
@@ -112128,7 +112165,7 @@ async function executeRenderJob(job, projectDir, outputPath, onProgress, abortSi
|
|
|
112128
112165
|
job.perfSummary = perfSummary;
|
|
112129
112166
|
if (job.config.debug) {
|
|
112130
112167
|
try {
|
|
112131
|
-
|
|
112168
|
+
writeFileSync15(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
|
|
112132
112169
|
} catch (err) {
|
|
112133
112170
|
log2.debug("Failed to write perf summary", {
|
|
112134
112171
|
perfOutputPath,
|
|
@@ -112534,7 +112571,7 @@ import {
|
|
|
112534
112571
|
mkdirSync as mkdirSync24,
|
|
112535
112572
|
statSync as statSync14,
|
|
112536
112573
|
mkdtempSync as mkdtempSync5,
|
|
112537
|
-
writeFileSync as
|
|
112574
|
+
writeFileSync as writeFileSync16,
|
|
112538
112575
|
rmSync as rmSync13,
|
|
112539
112576
|
createReadStream as createReadStream2
|
|
112540
112577
|
} from "fs";
|
|
@@ -112659,7 +112696,7 @@ async function prepareRenderBody(body) {
|
|
|
112659
112696
|
}
|
|
112660
112697
|
const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir6();
|
|
112661
112698
|
const tempProjectDir = mkdtempSync5(join55(tempRoot, "producer-project-"));
|
|
112662
|
-
|
|
112699
|
+
writeFileSync16(join55(tempProjectDir, "index.html"), htmlContent, "utf-8");
|
|
112663
112700
|
return {
|
|
112664
112701
|
prepared: {
|
|
112665
112702
|
input: {
|
|
@@ -113139,7 +113176,7 @@ var init_planHash = __esm({
|
|
|
113139
113176
|
});
|
|
113140
113177
|
|
|
113141
113178
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
113142
|
-
import { existsSync as existsSync47, mkdirSync as mkdirSync25, readFileSync as readFileSync28, readdirSync as readdirSync15, writeFileSync as
|
|
113179
|
+
import { existsSync as existsSync47, mkdirSync as mkdirSync25, readFileSync as readFileSync28, readdirSync as readdirSync15, writeFileSync as writeFileSync17 } from "fs";
|
|
113143
113180
|
import { join as join56, relative as relative9, resolve as resolve29 } from "path";
|
|
113144
113181
|
function stripUndefined(value) {
|
|
113145
113182
|
if (Array.isArray(value)) return value.map(stripUndefined);
|
|
@@ -113236,7 +113273,7 @@ async function freezePlan(input2) {
|
|
|
113236
113273
|
}
|
|
113237
113274
|
const metaDir = join56(planDir, "meta");
|
|
113238
113275
|
if (!existsSync47(metaDir)) mkdirSync25(metaDir, { recursive: true });
|
|
113239
|
-
|
|
113276
|
+
writeFileSync17(
|
|
113240
113277
|
join56(metaDir, "composition.json"),
|
|
113241
113278
|
`${JSON.stringify(composition, null, 2)}
|
|
113242
113279
|
`,
|
|
@@ -113244,8 +113281,8 @@ async function freezePlan(input2) {
|
|
|
113244
113281
|
);
|
|
113245
113282
|
const encoderForCanonical = stripUndefined(encoder);
|
|
113246
113283
|
const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
|
|
113247
|
-
|
|
113248
|
-
|
|
113284
|
+
writeFileSync17(join56(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
|
|
113285
|
+
writeFileSync17(join56(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
|
|
113249
113286
|
`, "utf-8");
|
|
113250
113287
|
const { compositionHtml, assets } = collectPlanAssetShas(planDir);
|
|
113251
113288
|
const planHash = computePlanHash({
|
|
@@ -113269,7 +113306,7 @@ async function freezePlan(input2) {
|
|
|
113269
113306
|
hasAudio
|
|
113270
113307
|
};
|
|
113271
113308
|
const planJsonPath = join56(planDir, "plan.json");
|
|
113272
|
-
|
|
113309
|
+
writeFileSync17(planJsonPath, `${JSON.stringify(planJson, null, 2)}
|
|
113273
113310
|
`, "utf-8");
|
|
113274
113311
|
return { planJsonPath, planHash };
|
|
113275
113312
|
}
|
|
@@ -113467,10 +113504,10 @@ import {
|
|
|
113467
113504
|
existsSync as existsSync49,
|
|
113468
113505
|
mkdirSync as mkdirSync26,
|
|
113469
113506
|
readdirSync as readdirSync16,
|
|
113470
|
-
renameSync as
|
|
113507
|
+
renameSync as renameSync7,
|
|
113471
113508
|
rmSync as rmSync14,
|
|
113472
113509
|
statSync as statSync15,
|
|
113473
|
-
writeFileSync as
|
|
113510
|
+
writeFileSync as writeFileSync18
|
|
113474
113511
|
} from "fs";
|
|
113475
113512
|
import { join as join58, relative as relative10, sep as sep6 } from "path";
|
|
113476
113513
|
function formatBytes2(bytes) {
|
|
@@ -113773,12 +113810,12 @@ async function plan(projectDir, config, planDir) {
|
|
|
113773
113810
|
const videoFramesDst = join58(planDir, "video-frames");
|
|
113774
113811
|
if (existsSync49(videoFramesDst)) rmSync14(videoFramesDst, { recursive: true, force: true });
|
|
113775
113812
|
if (existsSync49(stagedVideoFrames)) {
|
|
113776
|
-
|
|
113813
|
+
renameSync7(stagedVideoFrames, videoFramesDst);
|
|
113777
113814
|
} else {
|
|
113778
113815
|
mkdirSync26(videoFramesDst, { recursive: true });
|
|
113779
113816
|
}
|
|
113780
113817
|
if (existsSync49(finalCompiledDir)) rmSync14(finalCompiledDir, { recursive: true, force: true });
|
|
113781
|
-
|
|
113818
|
+
renameSync7(compiledDir, finalCompiledDir);
|
|
113782
113819
|
const planVideosJson = {
|
|
113783
113820
|
videos: composition.videos,
|
|
113784
113821
|
extracted: (extractResult.extractionResult?.extracted ?? []).map((ext) => ({
|
|
@@ -113791,14 +113828,14 @@ async function plan(projectDir, config, planDir) {
|
|
|
113791
113828
|
}))
|
|
113792
113829
|
};
|
|
113793
113830
|
mkdirSync26(join58(planDir, "meta"), { recursive: true });
|
|
113794
|
-
|
|
113831
|
+
writeFileSync18(
|
|
113795
113832
|
join58(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
|
|
113796
113833
|
JSON.stringify(planVideosJson, null, 2),
|
|
113797
113834
|
"utf-8"
|
|
113798
113835
|
);
|
|
113799
113836
|
const planAudioPath = join58(planDir, "audio.aac");
|
|
113800
113837
|
if (audioResult.hasAudio && existsSync49(audioResult.audioOutputPath)) {
|
|
113801
|
-
|
|
113838
|
+
renameSync7(audioResult.audioOutputPath, planAudioPath);
|
|
113802
113839
|
}
|
|
113803
113840
|
const maxParallel = config.maxParallelChunks ?? DEFAULT_MAX_PARALLEL_CHUNKS;
|
|
113804
113841
|
const { chunkCount, effectiveChunkSize } = resolveChunkPlan(
|
|
@@ -113941,7 +113978,7 @@ var init_plan = __esm({
|
|
|
113941
113978
|
|
|
113942
113979
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
113943
113980
|
import { randomBytes as randomBytes2 } from "crypto";
|
|
113944
|
-
import { existsSync as existsSync50, mkdirSync as mkdirSync27, readFileSync as readFileSync30, readdirSync as readdirSync17, rmSync as rmSync15, writeFileSync as
|
|
113981
|
+
import { existsSync as existsSync50, mkdirSync as mkdirSync27, readFileSync as readFileSync30, readdirSync as readdirSync17, rmSync as rmSync15, writeFileSync as writeFileSync19 } from "fs";
|
|
113945
113982
|
import { extname as extname10, join as join59 } from "path";
|
|
113946
113983
|
function rebuildExtractedFramesFromPlanDir(planDir, videos) {
|
|
113947
113984
|
const result = [];
|
|
@@ -114265,7 +114302,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath) {
|
|
|
114265
114302
|
producerVersion: plan2.producerVersion,
|
|
114266
114303
|
ffmpegVersion
|
|
114267
114304
|
};
|
|
114268
|
-
|
|
114305
|
+
writeFileSync19(perfPath, `${JSON.stringify(perfPayload2, null, 2)}
|
|
114269
114306
|
`, "utf-8");
|
|
114270
114307
|
try {
|
|
114271
114308
|
rmSync15(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
|
|
@@ -114635,7 +114672,7 @@ import {
|
|
|
114635
114672
|
readdirSync as readdirSync18,
|
|
114636
114673
|
rmSync as rmSync17,
|
|
114637
114674
|
statSync as statSync16,
|
|
114638
|
-
writeFileSync as
|
|
114675
|
+
writeFileSync as writeFileSync20
|
|
114639
114676
|
} from "fs";
|
|
114640
114677
|
import { dirname as dirname24, join as join60 } from "path";
|
|
114641
114678
|
async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
@@ -114689,7 +114726,7 @@ async function assemble(planDir, chunkPaths, audioPath, outputPath, options) {
|
|
|
114689
114726
|
} else {
|
|
114690
114727
|
const concatListPath = join60(workDir, "concat-list.txt");
|
|
114691
114728
|
const concatBody = chunkPaths.map((path2) => `file '${path2.replace(/'/g, "'\\''")}'`).join("\n");
|
|
114692
|
-
|
|
114729
|
+
writeFileSync20(concatListPath, `${concatBody}
|
|
114693
114730
|
`, "utf-8");
|
|
114694
114731
|
const concatArgs = [
|
|
114695
114732
|
"-r",
|
|
@@ -115966,7 +116003,7 @@ __export(studioServer_exports, {
|
|
|
115966
116003
|
});
|
|
115967
116004
|
import { Hono as Hono5 } from "hono";
|
|
115968
116005
|
import { streamSSE as streamSSE4 } from "hono/streaming";
|
|
115969
|
-
import { existsSync as existsSync55, readFileSync as readFileSync34, writeFileSync as
|
|
116006
|
+
import { existsSync as existsSync55, readFileSync as readFileSync34, writeFileSync as writeFileSync21, statSync as statSync18, unlinkSync as unlinkSync4 } from "fs";
|
|
115970
116007
|
import { resolve as resolve30, join as join65, basename as basename8 } from "path";
|
|
115971
116008
|
async function loadStudioProducer() {
|
|
115972
116009
|
return isDevMode() ? await Promise.resolve().then(() => (init_src2(), src_exports2)) : await Promise.resolve().then(() => (init_src2(), src_exports2));
|
|
@@ -116143,7 +116180,7 @@ function rewriteWrittenToHostViewport(projectDir, written) {
|
|
|
116143
116180
|
return match;
|
|
116144
116181
|
}
|
|
116145
116182
|
);
|
|
116146
|
-
|
|
116183
|
+
writeFileSync21(absPath, content, "utf-8");
|
|
116147
116184
|
}
|
|
116148
116185
|
}
|
|
116149
116186
|
function createStudioServer(options) {
|
|
@@ -116268,7 +116305,7 @@ function createStudioServer(options) {
|
|
|
116268
116305
|
state.status = "complete";
|
|
116269
116306
|
state.progress = 100;
|
|
116270
116307
|
const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
|
|
116271
|
-
|
|
116308
|
+
writeFileSync21(
|
|
116272
116309
|
metaPath,
|
|
116273
116310
|
JSON.stringify({ status: "complete", durationMs: Date.now() - startTime })
|
|
116274
116311
|
);
|
|
@@ -116283,7 +116320,7 @@ function createStudioServer(options) {
|
|
|
116283
116320
|
emitStudioRenderError(opts, Date.now() - startTime, state.stage, err, renderJob);
|
|
116284
116321
|
try {
|
|
116285
116322
|
const metaPath = opts.outputPath.replace(/\.(mp4|webm|mov)$/, ".meta.json");
|
|
116286
|
-
|
|
116323
|
+
writeFileSync21(metaPath, JSON.stringify({ status: "failed" }));
|
|
116287
116324
|
} catch {
|
|
116288
116325
|
}
|
|
116289
116326
|
}
|
|
@@ -117334,7 +117371,7 @@ import {
|
|
|
117334
117371
|
mkdirSync as mkdirSync33,
|
|
117335
117372
|
copyFileSync as copyFileSync7,
|
|
117336
117373
|
cpSync as cpSync5,
|
|
117337
|
-
writeFileSync as
|
|
117374
|
+
writeFileSync as writeFileSync23,
|
|
117338
117375
|
readFileSync as readFileSync35,
|
|
117339
117376
|
readdirSync as readdirSync21
|
|
117340
117377
|
} from "fs";
|
|
@@ -117451,7 +117488,7 @@ function buildPackageScripts() {
|
|
|
117451
117488
|
function writeDefaultPackageJson(destDir, projectName) {
|
|
117452
117489
|
const packageJsonPath = resolve33(destDir, "package.json");
|
|
117453
117490
|
if (existsSync57(packageJsonPath)) return;
|
|
117454
|
-
|
|
117491
|
+
writeFileSync23(
|
|
117455
117492
|
packageJsonPath,
|
|
117456
117493
|
`${JSON.stringify(
|
|
117457
117494
|
{
|
|
@@ -117513,7 +117550,7 @@ ${html}`;
|
|
|
117513
117550
|
function writeTailwindSupport(destDir) {
|
|
117514
117551
|
for (const file of listHtmlFiles(destDir)) {
|
|
117515
117552
|
const html = readFileSync35(file, "utf-8");
|
|
117516
|
-
|
|
117553
|
+
writeFileSync23(file, injectTailwindBrowserScript(html), "utf-8");
|
|
117517
117554
|
}
|
|
117518
117555
|
}
|
|
117519
117556
|
function patchVideoSrc(dir, videoFilename, durationSeconds) {
|
|
@@ -117530,7 +117567,7 @@ function patchVideoSrc(dir, videoFilename, durationSeconds) {
|
|
|
117530
117567
|
}
|
|
117531
117568
|
const dur = durationSeconds ? String(Math.round(durationSeconds * 100) / 100) : "10";
|
|
117532
117569
|
content = content.replaceAll("__VIDEO_DURATION__", dur);
|
|
117533
|
-
|
|
117570
|
+
writeFileSync23(file, content, "utf-8");
|
|
117534
117571
|
}
|
|
117535
117572
|
}
|
|
117536
117573
|
async function patchTranscript(dir, transcriptPath) {
|
|
@@ -117666,7 +117703,7 @@ function applyResolutionPreset(destDir, resolution) {
|
|
|
117666
117703
|
html = html.replace(viewportRe, `$1width=${width}, height=${height}`);
|
|
117667
117704
|
changed = true;
|
|
117668
117705
|
}
|
|
117669
|
-
if (changed)
|
|
117706
|
+
if (changed) writeFileSync23(file, html, "utf-8");
|
|
117670
117707
|
}
|
|
117671
117708
|
}
|
|
117672
117709
|
async function scaffoldProject(destDir, name, templateId, localVideoName, durationSeconds, tailwind = false, resolution) {
|
|
@@ -117680,7 +117717,7 @@ async function scaffoldProject(destDir, name, templateId, localVideoName, durati
|
|
|
117680
117717
|
patchVideoSrc(destDir, localVideoName, durationSeconds);
|
|
117681
117718
|
if (tailwind) writeTailwindSupport(destDir);
|
|
117682
117719
|
if (resolution) applyResolutionPreset(destDir, resolution);
|
|
117683
|
-
|
|
117720
|
+
writeFileSync23(
|
|
117684
117721
|
resolve33(destDir, "meta.json"),
|
|
117685
117722
|
JSON.stringify(
|
|
117686
117723
|
{
|
|
@@ -120489,7 +120526,7 @@ __export(batchRender_exports, {
|
|
|
120489
120526
|
resolveOutputTemplate: () => resolveOutputTemplate,
|
|
120490
120527
|
runBatchRender: () => runBatchRender
|
|
120491
120528
|
});
|
|
120492
|
-
import { mkdirSync as mkdirSync34, readFileSync as readFileSync43, writeFileSync as
|
|
120529
|
+
import { mkdirSync as mkdirSync34, readFileSync as readFileSync43, writeFileSync as writeFileSync24 } from "fs";
|
|
120493
120530
|
import { dirname as dirname29, join as join71, resolve as resolve43, sep as sep8 } from "path";
|
|
120494
120531
|
function isRecord5(value) {
|
|
120495
120532
|
return value !== null && typeof value === "object" && !Array.isArray(value);
|
|
@@ -120675,7 +120712,7 @@ function summarizeManifest(manifest) {
|
|
|
120675
120712
|
function writeManifest(manifest) {
|
|
120676
120713
|
summarizeManifest(manifest);
|
|
120677
120714
|
mkdirSync34(dirname29(manifest.manifestPath), { recursive: true });
|
|
120678
|
-
|
|
120715
|
+
writeFileSync24(manifest.manifestPath, JSON.stringify(manifest, null, 2) + "\n", "utf8");
|
|
120679
120716
|
}
|
|
120680
120717
|
function emitJsonEvent(event, json) {
|
|
120681
120718
|
if (json) console.log(JSON.stringify(event));
|
|
@@ -120837,7 +120874,7 @@ __export(render_exports, {
|
|
|
120837
120874
|
renderLocal: () => renderLocal,
|
|
120838
120875
|
resolveBrowserGpuForCli: () => resolveBrowserGpuForCli
|
|
120839
120876
|
});
|
|
120840
|
-
import { mkdirSync as mkdirSync35, readdirSync as readdirSync24, readFileSync as readFileSync44, statSync as statSync20, writeFileSync as
|
|
120877
|
+
import { mkdirSync as mkdirSync35, readdirSync as readdirSync24, readFileSync as readFileSync44, statSync as statSync20, writeFileSync as writeFileSync25, rmSync as rmSync19 } from "fs";
|
|
120841
120878
|
import { cpus as cpus4, freemem as freemem5, tmpdir as tmpdir7 } from "os";
|
|
120842
120879
|
import { resolve as resolve44, dirname as dirname30, join as join73, basename as basename12 } from "path";
|
|
120843
120880
|
import { execFileSync as execFileSync10, spawn as spawn15 } from "child_process";
|
|
@@ -120933,7 +120970,7 @@ function ensureDockerImage(version2, platform10, quiet) {
|
|
|
120933
120970
|
const dockerfilePath = resolveDockerfilePath();
|
|
120934
120971
|
const tmpDir = join73(tmpdir7(), `hyperframes-docker-${Date.now()}`);
|
|
120935
120972
|
mkdirSync35(tmpDir, { recursive: true });
|
|
120936
|
-
|
|
120973
|
+
writeFileSync25(join73(tmpDir, "Dockerfile"), readFileSync44(dockerfilePath));
|
|
120937
120974
|
const targetArch = platform10 === "linux/arm64" ? "arm64" : "amd64";
|
|
120938
120975
|
try {
|
|
120939
120976
|
execFileSync10(
|
|
@@ -124070,7 +124107,7 @@ __export(checkBrowser_exports, {
|
|
|
124070
124107
|
captureOverviewShot: () => captureOverviewShot,
|
|
124071
124108
|
runBrowserCheck: () => runBrowserCheck
|
|
124072
124109
|
});
|
|
124073
|
-
import { mkdirSync as mkdirSync36, writeFileSync as
|
|
124110
|
+
import { mkdirSync as mkdirSync36, writeFileSync as writeFileSync26 } from "fs";
|
|
124074
124111
|
import { join as join77 } from "path";
|
|
124075
124112
|
async function runBrowserCheck(project, options, motion, runGrid) {
|
|
124076
124113
|
const { bundleToSingleHtml: bundleToSingleHtml2 } = await Promise.resolve().then(() => (init_compiler(), compiler_exports));
|
|
@@ -124136,7 +124173,7 @@ async function captureFindingCrops(project, options, requests) {
|
|
|
124136
124173
|
}));
|
|
124137
124174
|
const region = padCropRegion(request.bbox, canvas, DEFAULT_ZOOM_PADDING_PX);
|
|
124138
124175
|
const buffer = await captureRegionCrop(page, region, DEFAULT_ZOOM_SCALE);
|
|
124139
|
-
|
|
124176
|
+
writeFileSync26(join77(snapshotDir, request.filename), buffer);
|
|
124140
124177
|
written.push(join77("snapshots", request.filename));
|
|
124141
124178
|
}
|
|
124142
124179
|
return written;
|
|
@@ -124809,7 +124846,7 @@ var init_checkBrowser = __esm({
|
|
|
124809
124846
|
});
|
|
124810
124847
|
|
|
124811
124848
|
// src/utils/checkPipeline.ts
|
|
124812
|
-
import { mkdirSync as mkdirSync37, writeFileSync as
|
|
124849
|
+
import { mkdirSync as mkdirSync37, writeFileSync as writeFileSync27 } from "fs";
|
|
124813
124850
|
import { join as join78, relative as relative15 } from "path";
|
|
124814
124851
|
function selectContrastTimes(grid) {
|
|
124815
124852
|
if (grid.length <= 5) return [...grid];
|
|
@@ -125410,7 +125447,7 @@ async function writeSnapshot(projectDir, index, time, pngBase64) {
|
|
|
125410
125447
|
mkdirSync37(snapshotDir, { recursive: true });
|
|
125411
125448
|
const filename = `frame-${String(index).padStart(2, "0")}-at-${time.toFixed(1)}s.png`;
|
|
125412
125449
|
const path2 = join78(snapshotDir, filename);
|
|
125413
|
-
|
|
125450
|
+
writeFileSync27(path2, Buffer.from(pngBase64, "base64"));
|
|
125414
125451
|
return join78("snapshots", filename);
|
|
125415
125452
|
}
|
|
125416
125453
|
async function captureFindingCrops2(project, options, requests) {
|
|
@@ -126034,7 +126071,7 @@ __export(beats_exports, {
|
|
|
126034
126071
|
default: () => beats_default,
|
|
126035
126072
|
examples: () => examples13
|
|
126036
126073
|
});
|
|
126037
|
-
import { existsSync as existsSync71, readFileSync as readFileSync49, mkdirSync as mkdirSync38, writeFileSync as
|
|
126074
|
+
import { existsSync as existsSync71, readFileSync as readFileSync49, mkdirSync as mkdirSync38, writeFileSync as writeFileSync28 } from "fs";
|
|
126038
126075
|
import { resolve as resolve46, join as join80, dirname as dirname34 } from "path";
|
|
126039
126076
|
function fail(message) {
|
|
126040
126077
|
console.error(c.error(message));
|
|
@@ -126107,7 +126144,7 @@ var init_beats2 = __esm({
|
|
|
126107
126144
|
}
|
|
126108
126145
|
const outPath = join80(project.dir, "beats", `${rel}.json`);
|
|
126109
126146
|
mkdirSync38(dirname34(outPath), { recursive: true });
|
|
126110
|
-
|
|
126147
|
+
writeFileSync28(outPath, serializeBeats(result.beatTimes, result.beatStrengths, rel));
|
|
126111
126148
|
report(`beats/${rel}.json`, result, Boolean(args.json));
|
|
126112
126149
|
}
|
|
126113
126150
|
});
|
|
@@ -127818,7 +127855,7 @@ var motionShot_exports = {};
|
|
|
127818
127855
|
__export(motionShot_exports, {
|
|
127819
127856
|
captureMotionPathShot: () => captureMotionPathShot
|
|
127820
127857
|
});
|
|
127821
|
-
import { writeFileSync as
|
|
127858
|
+
import { writeFileSync as writeFileSync29 } from "fs";
|
|
127822
127859
|
function applyOrbitCamera(selectors, cam) {
|
|
127823
127860
|
const first = document.querySelector(selectors[0] ?? "");
|
|
127824
127861
|
const root = first?.closest("[data-composition-id]") ?? document.querySelector("#stage") ?? document.body.firstElementChild ?? document.body;
|
|
@@ -128123,7 +128160,7 @@ async function captureGhostOnionSkin(page, requests, times, size, camera, outPat
|
|
|
128123
128160
|
);
|
|
128124
128161
|
const b64 = String(dataUrl).replace(/^data:image\/png;base64,/, "");
|
|
128125
128162
|
if (!b64) throw new Error("ghost composite returned no data");
|
|
128126
|
-
|
|
128163
|
+
writeFileSync29(outPath, Buffer.from(b64, "base64"));
|
|
128127
128164
|
return outPath;
|
|
128128
128165
|
}
|
|
128129
128166
|
async function captureMarkerOnionSkin(page, requests, times, size, camera, frame, outPath) {
|
|
@@ -128193,7 +128230,7 @@ async function captureMarkerOnionSkin(page, requests, times, size, camera, frame
|
|
|
128193
128230
|
await new Promise((r2) => setTimeout(r2, 60));
|
|
128194
128231
|
const buf = await page.screenshot({ type: "png" });
|
|
128195
128232
|
if (!buf) throw new Error("screenshot returned no data");
|
|
128196
|
-
|
|
128233
|
+
writeFileSync29(outPath, buf);
|
|
128197
128234
|
return outPath;
|
|
128198
128235
|
}
|
|
128199
128236
|
async function captureMotionPathShot(projectDir, requestsIn, outPath, opts = {}) {
|
|
@@ -129811,7 +129848,7 @@ var init_remove_background = __esm({
|
|
|
129811
129848
|
|
|
129812
129849
|
// src/whisper/parakeet.ts
|
|
129813
129850
|
import { execFileSync as execFileSync11 } from "child_process";
|
|
129814
|
-
import { existsSync as existsSync77, mkdtempSync as mkdtempSync7, readFileSync as readFileSync54, rmSync as rmSync21, writeFileSync as
|
|
129851
|
+
import { existsSync as existsSync77, mkdtempSync as mkdtempSync7, readFileSync as readFileSync54, rmSync as rmSync21, writeFileSync as writeFileSync30 } from "fs";
|
|
129815
129852
|
import { homedir as homedir13, tmpdir as tmpdir9 } from "os";
|
|
129816
129853
|
import { basename as basename15, extname as extname12, join as join84 } from "path";
|
|
129817
129854
|
function isRunnable(bin) {
|
|
@@ -129890,7 +129927,7 @@ function transcribeWithParakeet(inputPath, dir, options) {
|
|
|
129890
129927
|
if (!existsSync77(produced)) throw new Error("Parakeet did not produce output.");
|
|
129891
129928
|
const words = mergeTokensToWords(JSON.parse(readFileSync54(produced, "utf-8")));
|
|
129892
129929
|
const transcriptPath = join84(dir, "transcript.json");
|
|
129893
|
-
|
|
129930
|
+
writeFileSync30(transcriptPath, JSON.stringify(words, null, 2));
|
|
129894
129931
|
const durationSeconds = words.length > 0 ? words[words.length - 1].end : 0;
|
|
129895
129932
|
return { transcriptPath, wordCount: words.length, durationSeconds, speechOnsetSeconds: null };
|
|
129896
129933
|
} finally {
|
|
@@ -129912,7 +129949,7 @@ __export(transcribe_exports2, {
|
|
|
129912
129949
|
default: () => transcribe_default,
|
|
129913
129950
|
examples: () => examples21
|
|
129914
129951
|
});
|
|
129915
|
-
import { existsSync as existsSync78, writeFileSync as
|
|
129952
|
+
import { existsSync as existsSync78, writeFileSync as writeFileSync31 } from "fs";
|
|
129916
129953
|
import { resolve as resolve51, join as join85, extname as extname13, dirname as dirname37 } from "path";
|
|
129917
129954
|
function failWith(message, json) {
|
|
129918
129955
|
trackCommandFailure("transcribe", message);
|
|
@@ -129937,7 +129974,7 @@ async function importTranscript(inputPath, dir, json) {
|
|
|
129937
129974
|
const { words, format } = loadTranscript2(inputPath);
|
|
129938
129975
|
if (words.length === 0) exitNoWords(json);
|
|
129939
129976
|
const outPath = join85(dir, "transcript.json");
|
|
129940
|
-
|
|
129977
|
+
writeFileSync31(outPath, JSON.stringify(words, null, 2));
|
|
129941
129978
|
patchCaptionHtml2(dir, words);
|
|
129942
129979
|
if (json) {
|
|
129943
129980
|
console.log(
|
|
@@ -129956,7 +129993,7 @@ async function exportTranscript(inputPath, dir, to, output, json, preserveCues)
|
|
|
129956
129993
|
const preGrouped = preserveCues || format === "srt" || format === "vtt" || void 0;
|
|
129957
129994
|
const outPath = resolve51(output ?? join85(dir, `transcript.${to}`));
|
|
129958
129995
|
const content = to === "srt" ? formatSrt2(words, { preGrouped }) : formatVtt2(words, { preGrouped });
|
|
129959
|
-
|
|
129996
|
+
writeFileSync31(outPath, content);
|
|
129960
129997
|
if (json) {
|
|
129961
129998
|
console.log(
|
|
129962
129999
|
JSON.stringify({ ok: true, format: to, wordCount: words.length, outputPath: outPath })
|
|
@@ -130004,7 +130041,7 @@ async function transcribeAudio(inputPath, dir, opts) {
|
|
|
130004
130041
|
);
|
|
130005
130042
|
}
|
|
130006
130043
|
}
|
|
130007
|
-
|
|
130044
|
+
writeFileSync31(result.transcriptPath, JSON.stringify(words, null, 2));
|
|
130008
130045
|
patchCaptionHtml2(dir, words);
|
|
130009
130046
|
if (opts.json) {
|
|
130010
130047
|
console.log(
|
|
@@ -130340,13 +130377,13 @@ __export(synthesize_exports, {
|
|
|
130340
130377
|
synthesize: () => synthesize
|
|
130341
130378
|
});
|
|
130342
130379
|
import { execFileSync as execFileSync13 } from "child_process";
|
|
130343
|
-
import { existsSync as existsSync80, writeFileSync as
|
|
130380
|
+
import { existsSync as existsSync80, writeFileSync as writeFileSync33, mkdirSync as mkdirSync40, readdirSync as readdirSync27, unlinkSync as unlinkSync6 } from "fs";
|
|
130344
130381
|
import { join as join87, dirname as dirname38, basename as basename16 } from "path";
|
|
130345
130382
|
import { homedir as homedir15 } from "os";
|
|
130346
130383
|
function ensureSynthScript() {
|
|
130347
130384
|
if (!existsSync80(SCRIPT_PATH)) {
|
|
130348
130385
|
mkdirSync40(SCRIPT_DIR, { recursive: true });
|
|
130349
|
-
|
|
130386
|
+
writeFileSync33(SCRIPT_PATH, SYNTH_SCRIPT);
|
|
130350
130387
|
const currentName = basename16(SCRIPT_PATH);
|
|
130351
130388
|
try {
|
|
130352
130389
|
for (const entry of readdirSync27(SCRIPT_DIR)) {
|
|
@@ -131656,7 +131693,7 @@ __export(contactSheet_exports, {
|
|
|
131656
131693
|
createSvgContactSheet: () => createSvgContactSheet
|
|
131657
131694
|
});
|
|
131658
131695
|
import sharp from "sharp";
|
|
131659
|
-
import { readdirSync as readdirSync28, readFileSync as readFileSync57, writeFileSync as
|
|
131696
|
+
import { readdirSync as readdirSync28, readFileSync as readFileSync57, writeFileSync as writeFileSync34, unlinkSync as unlinkSync7, existsSync as existsSync84 } from "fs";
|
|
131660
131697
|
import { join as join89, extname as extname15, basename as basename17, dirname as dirname40 } from "path";
|
|
131661
131698
|
async function createContactSheet(imagePaths, outputPath, opts = {}) {
|
|
131662
131699
|
const {
|
|
@@ -131817,7 +131854,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir) {
|
|
|
131817
131854
|
fit: "contain",
|
|
131818
131855
|
background: { r: 245, g: 245, b: 245, alpha: 1 }
|
|
131819
131856
|
}).flatten({ background: { r: 245, g: 245, b: 245 } }).png().toBuffer();
|
|
131820
|
-
|
|
131857
|
+
writeFileSync34(tmpPath, thumb);
|
|
131821
131858
|
tmpPaths.push(tmpPath);
|
|
131822
131859
|
labels.push(svgFileNames[i2].replace(".svg", ""));
|
|
131823
131860
|
} catch {
|
|
@@ -171592,7 +171629,7 @@ __export(snapshot_exports, {
|
|
|
171592
171629
|
parseZoomScale: () => parseZoomScale,
|
|
171593
171630
|
tailFrameTime: () => tailFrameTime
|
|
171594
171631
|
});
|
|
171595
|
-
import { existsSync as existsSync85, mkdtempSync as mkdtempSync8, readFileSync as readFileSync58, mkdirSync as mkdirSync41, rmSync as rmSync23, writeFileSync as
|
|
171632
|
+
import { existsSync as existsSync85, mkdtempSync as mkdtempSync8, readFileSync as readFileSync58, mkdirSync as mkdirSync41, rmSync as rmSync23, writeFileSync as writeFileSync35 } from "fs";
|
|
171596
171633
|
import { tmpdir as tmpdir10 } from "os";
|
|
171597
171634
|
import { resolve as resolve55, join as join90, relative as relative16, isAbsolute as isAbsolute14, basename as basename20 } from "path";
|
|
171598
171635
|
function orbitStageSource() {
|
|
@@ -171854,7 +171891,7 @@ async function captureSnapshots(projectDir, opts) {
|
|
|
171854
171891
|
region,
|
|
171855
171892
|
opts.zoomScale ?? DEFAULT_ZOOM_SCALE
|
|
171856
171893
|
);
|
|
171857
|
-
|
|
171894
|
+
writeFileSync35(framePath, buffer);
|
|
171858
171895
|
} else {
|
|
171859
171896
|
await page.screenshot({ path: framePath, type: "png" });
|
|
171860
171897
|
}
|
|
@@ -172062,7 +172099,7 @@ ${c.success("\u25C7")} ${paths.length} snapshots saved to ${args.output ? snaps
|
|
|
172062
172099
|
}
|
|
172063
172100
|
}
|
|
172064
172101
|
const descPath = join90(snapshotDir, "descriptions.md");
|
|
172065
|
-
|
|
172102
|
+
writeFileSync35(descPath, descriptions.join("\n"));
|
|
172066
172103
|
console.log(` ${c.dim("descriptions.md")} (Gemini frame analysis)`);
|
|
172067
172104
|
}
|
|
172068
172105
|
} catch (descErr) {
|
|
@@ -172127,7 +172164,7 @@ import {
|
|
|
172127
172164
|
mkdtempSync as mkdtempSync9,
|
|
172128
172165
|
readFileSync as readFileSync59,
|
|
172129
172166
|
rmSync as rmSync24,
|
|
172130
|
-
writeFileSync as
|
|
172167
|
+
writeFileSync as writeFileSync36
|
|
172131
172168
|
} from "fs";
|
|
172132
172169
|
import { tmpdir as tmpdir11 } from "os";
|
|
172133
172170
|
import { basename as basename21, dirname as dirname41, extname as extname16, join as join91, resolve as resolve57 } from "path";
|
|
@@ -172389,7 +172426,7 @@ async function prepareGradeCompareTempProject(opts) {
|
|
|
172389
172426
|
const tempDir = mkdtempSync9(join91(tmpdir11(), "hf-grade-compare-"));
|
|
172390
172427
|
try {
|
|
172391
172428
|
const frameFileName2 = opts.frameFileName ?? frameFileNameForPath(opts.framePath);
|
|
172392
|
-
|
|
172429
|
+
writeFileSync36(join91(tempDir, frameFileName2), opts.frameBuffer);
|
|
172393
172430
|
let lutIndex = 0;
|
|
172394
172431
|
const stagedCells = opts.cells.map((cell) => {
|
|
172395
172432
|
const lutSrc = lutSrcFromGrading(cell.grading);
|
|
@@ -172421,7 +172458,7 @@ async function prepareGradeCompareTempProject(opts) {
|
|
|
172421
172458
|
frameWidth: opts.frameWidth,
|
|
172422
172459
|
frameHeight: opts.frameHeight
|
|
172423
172460
|
});
|
|
172424
|
-
|
|
172461
|
+
writeFileSync36(join91(tempDir, "index.html"), html);
|
|
172425
172462
|
return { tempDir, html, cells: stagedCells };
|
|
172426
172463
|
} catch (err) {
|
|
172427
172464
|
rmSync24(tempDir, { recursive: true, force: true });
|
|
@@ -172674,7 +172711,7 @@ __export(compare_exports, {
|
|
|
172674
172711
|
parseCompareArgs: () => parseCompareArgs,
|
|
172675
172712
|
prepareCompareVariantProjects: () => prepareCompareVariantProjects
|
|
172676
172713
|
});
|
|
172677
|
-
import { cpSync as cpSync6, existsSync as existsSync87, mkdirSync as mkdirSync44, mkdtempSync as mkdtempSync10, renameSync as
|
|
172714
|
+
import { cpSync as cpSync6, existsSync as existsSync87, mkdirSync as mkdirSync44, mkdtempSync as mkdtempSync10, renameSync as renameSync8, rmSync as rmSync25, statSync as statSync27 } from "fs";
|
|
172678
172715
|
import { tmpdir as tmpdir12 } from "os";
|
|
172679
172716
|
import { basename as basename23, dirname as dirname42, extname as extname17, join as join93 } from "path";
|
|
172680
172717
|
function defaultLabelForPath(input2) {
|
|
@@ -172786,7 +172823,7 @@ function stageHtmlVariant(variant) {
|
|
|
172786
172823
|
});
|
|
172787
172824
|
const sourceName = basename23(variant.inputPath);
|
|
172788
172825
|
if (sourceName !== "index.html") {
|
|
172789
|
-
|
|
172826
|
+
renameSync8(join93(stagedDir, sourceName), join93(stagedDir, "index.html"));
|
|
172790
172827
|
}
|
|
172791
172828
|
return {
|
|
172792
172829
|
...variant,
|
|
@@ -173005,7 +173042,7 @@ ${c.error("\u2717")} Compare failed: ${message}`);
|
|
|
173005
173042
|
});
|
|
173006
173043
|
|
|
173007
173044
|
// src/capture/assetDownloader.ts
|
|
173008
|
-
import { writeFileSync as
|
|
173045
|
+
import { writeFileSync as writeFileSync37, mkdirSync as mkdirSync45 } from "fs";
|
|
173009
173046
|
import { join as join94, extname as extname18 } from "path";
|
|
173010
173047
|
import { createHash as createHash12 } from "crypto";
|
|
173011
173048
|
function svgContentHashSlug(svgSource, isLogo) {
|
|
@@ -173033,7 +173070,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
173033
173070
|
const name = `${finalSlug}.svg`;
|
|
173034
173071
|
const localPath = `assets/svgs/${name}`;
|
|
173035
173072
|
try {
|
|
173036
|
-
|
|
173073
|
+
writeFileSync37(join94(outputDir, localPath), svg.outerHTML, "utf-8");
|
|
173037
173074
|
assets.push({ url: "", localPath, type: "svg" });
|
|
173038
173075
|
} catch {
|
|
173039
173076
|
}
|
|
@@ -173046,7 +173083,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
173046
173083
|
const localPath = `assets/${name}`;
|
|
173047
173084
|
const buffer = await fetchBuffer(icon.href);
|
|
173048
173085
|
if (buffer) {
|
|
173049
|
-
|
|
173086
|
+
writeFileSync37(join94(outputDir, localPath), buffer);
|
|
173050
173087
|
assets.push({ url: icon.href, localPath, type: "favicon" });
|
|
173051
173088
|
break;
|
|
173052
173089
|
}
|
|
@@ -173111,7 +173148,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
173111
173148
|
const name = `${slug}${ext}`;
|
|
173112
173149
|
usedNames.add(slug);
|
|
173113
173150
|
const localPath = `assets/${name}`;
|
|
173114
|
-
|
|
173151
|
+
writeFileSync37(join94(outputDir, localPath), buffer);
|
|
173115
173152
|
assets.push({ url, localPath, type: "image" });
|
|
173116
173153
|
imgIdx++;
|
|
173117
173154
|
} catch {
|
|
@@ -173124,7 +173161,7 @@ async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks)
|
|
|
173124
173161
|
const localPath = `assets/og-image${ext}`;
|
|
173125
173162
|
const buffer = await fetchBuffer(tokens.ogImage);
|
|
173126
173163
|
if (buffer && buffer.length > 5e3) {
|
|
173127
|
-
|
|
173164
|
+
writeFileSync37(join94(outputDir, localPath), buffer);
|
|
173128
173165
|
assets.push({ url: tokens.ogImage, localPath, type: "image" });
|
|
173129
173166
|
}
|
|
173130
173167
|
} catch {
|
|
@@ -173187,7 +173224,7 @@ async function downloadAndRewriteFonts(css, outputDir) {
|
|
|
173187
173224
|
const relativePath = `assets/fonts/${filename}`;
|
|
173188
173225
|
const buffer = await fetchBuffer(fontUrl);
|
|
173189
173226
|
if (buffer) {
|
|
173190
|
-
|
|
173227
|
+
writeFileSync37(localPath, buffer);
|
|
173191
173228
|
rewritten = rewritten.split(fontUrl).join(relativePath);
|
|
173192
173229
|
familyCounts.set(family, familyCount + 1);
|
|
173193
173230
|
count++;
|
|
@@ -174762,7 +174799,7 @@ var init_designStyleExtractor = __esm({
|
|
|
174762
174799
|
});
|
|
174763
174800
|
|
|
174764
174801
|
// src/capture/fontMetadataExtractor.ts
|
|
174765
|
-
import { readdirSync as readdirSync29, readFileSync as readFileSync61, writeFileSync as
|
|
174802
|
+
import { readdirSync as readdirSync29, readFileSync as readFileSync61, writeFileSync as writeFileSync38, existsSync as existsSync89 } from "fs";
|
|
174766
174803
|
import { join as join96 } from "path";
|
|
174767
174804
|
import * as fontkit from "fontkit";
|
|
174768
174805
|
function isFontCollection(value) {
|
|
@@ -174796,7 +174833,7 @@ function extractFontMetadata(fontsDir, outputPath) {
|
|
|
174796
174833
|
tool: "fontkit"
|
|
174797
174834
|
}
|
|
174798
174835
|
};
|
|
174799
|
-
|
|
174836
|
+
writeFileSync38(outputPath, JSON.stringify(manifest, null, 2), "utf-8");
|
|
174800
174837
|
return manifest;
|
|
174801
174838
|
}
|
|
174802
174839
|
function readSingleFont(fullPath, filename) {
|
|
@@ -175085,7 +175122,7 @@ var init_animationCataloger = __esm({
|
|
|
175085
175122
|
});
|
|
175086
175123
|
|
|
175087
175124
|
// src/capture/mediaCapture.ts
|
|
175088
|
-
import { mkdirSync as mkdirSync47, writeFileSync as
|
|
175125
|
+
import { mkdirSync as mkdirSync47, writeFileSync as writeFileSync39, readdirSync as readdirSync30, readFileSync as readFileSync63, statSync as statSync28 } from "fs";
|
|
175089
175126
|
import { join as join97, extname as extname19 } from "path";
|
|
175090
175127
|
async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
175091
175128
|
let savedCount = 0;
|
|
@@ -175118,7 +175155,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
175118
175155
|
const hash2 = buf.toString("base64").slice(0, 100);
|
|
175119
175156
|
if (savedHashes.has(hash2)) continue;
|
|
175120
175157
|
savedHashes.add(hash2);
|
|
175121
|
-
|
|
175158
|
+
writeFileSync39(join97(lottieDir, `animation-${savedCount}.lottie`), buf);
|
|
175122
175159
|
savedCount++;
|
|
175123
175160
|
continue;
|
|
175124
175161
|
}
|
|
@@ -175136,7 +175173,7 @@ async function saveLottieAnimations(discoveredLotties, lottieDir) {
|
|
|
175136
175173
|
} catch {
|
|
175137
175174
|
continue;
|
|
175138
175175
|
}
|
|
175139
|
-
|
|
175176
|
+
writeFileSync39(join97(lottieDir, `animation-${savedCount}.json`), jsonData, "utf-8");
|
|
175140
175177
|
savedCount++;
|
|
175141
175178
|
}
|
|
175142
175179
|
} catch {
|
|
@@ -175214,7 +175251,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir) {
|
|
|
175214
175251
|
}
|
|
175215
175252
|
}
|
|
175216
175253
|
if (manifest.length > 0) {
|
|
175217
|
-
|
|
175254
|
+
writeFileSync39(
|
|
175218
175255
|
join97(outputDir, "extracted", "lottie-manifest.json"),
|
|
175219
175256
|
JSON.stringify(manifest, null, 2),
|
|
175220
175257
|
"utf-8"
|
|
@@ -175250,7 +175287,7 @@ async function downloadVideoBody(srcUrl, filename, videosDir) {
|
|
|
175250
175287
|
}
|
|
175251
175288
|
if (total < 1024) return null;
|
|
175252
175289
|
const safe = /\.[a-z0-9]+$/i.test(filename) ? filename.replace(/[^\w.-]/g, "_") : `video${ext}`;
|
|
175253
|
-
|
|
175290
|
+
writeFileSync39(join97(videosDir, safe), Buffer.concat(chunks));
|
|
175254
175291
|
return `assets/videos/${safe}`;
|
|
175255
175292
|
} catch {
|
|
175256
175293
|
return null;
|
|
@@ -175368,7 +175405,7 @@ async function captureVideoManifest(page, outputDir, progress, opts) {
|
|
|
175368
175405
|
});
|
|
175369
175406
|
}
|
|
175370
175407
|
if (videoManifest.length > 0) {
|
|
175371
|
-
|
|
175408
|
+
writeFileSync39(
|
|
175372
175409
|
join97(outputDir, "extracted", "video-manifest.json"),
|
|
175373
175410
|
JSON.stringify(videoManifest, null, 2),
|
|
175374
175411
|
"utf-8"
|
|
@@ -175821,7 +175858,7 @@ var agentPromptGenerator_exports = {};
|
|
|
175821
175858
|
__export(agentPromptGenerator_exports, {
|
|
175822
175859
|
generateAgentPrompt: () => generateAgentPrompt
|
|
175823
175860
|
});
|
|
175824
|
-
import { writeFileSync as
|
|
175861
|
+
import { writeFileSync as writeFileSync40, readdirSync as readdirSync33, existsSync as existsSync91 } from "fs";
|
|
175825
175862
|
import { join as join99 } from "path";
|
|
175826
175863
|
function inferColorRole(hex) {
|
|
175827
175864
|
const r2 = parseInt(hex.slice(1, 3), 16) / 255;
|
|
@@ -175841,9 +175878,9 @@ function inferColorRole(hex) {
|
|
|
175841
175878
|
}
|
|
175842
175879
|
function generateAgentPrompt(outputDir, url, tokens, _animations, hasScreenshot, hasLottie, hasShaders, _catalogedAssets, _detectedLibraries) {
|
|
175843
175880
|
const prompt = buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShaders);
|
|
175844
|
-
|
|
175845
|
-
|
|
175846
|
-
|
|
175881
|
+
writeFileSync40(join99(outputDir, "AGENTS.md"), prompt, "utf-8");
|
|
175882
|
+
writeFileSync40(join99(outputDir, "CLAUDE.md"), prompt, "utf-8");
|
|
175883
|
+
writeFileSync40(join99(outputDir, ".cursorrules"), prompt, "utf-8");
|
|
175847
175884
|
}
|
|
175848
175885
|
function buildPrompt(outputDir, url, tokens, hasScreenshot, hasLottie, hasShaders) {
|
|
175849
175886
|
const title = tokens.title || new URL(url).hostname.replace(/^www\./, "");
|
|
@@ -175956,7 +175993,7 @@ var init_agentPromptGenerator = __esm({
|
|
|
175956
175993
|
});
|
|
175957
175994
|
|
|
175958
175995
|
// src/capture/scaffolding.ts
|
|
175959
|
-
import { existsSync as existsSync93, writeFileSync as
|
|
175996
|
+
import { existsSync as existsSync93, writeFileSync as writeFileSync41, readFileSync as readFileSync65 } from "fs";
|
|
175960
175997
|
import { join as join100, resolve as resolve59 } from "path";
|
|
175961
175998
|
function loadEnvFile(startDir) {
|
|
175962
175999
|
try {
|
|
@@ -175986,7 +176023,7 @@ async function generateProjectScaffold(outputDir, url, tokens, animationCatalog,
|
|
|
175986
176023
|
const metaPath = join100(outputDir, "meta.json");
|
|
175987
176024
|
if (!existsSync93(metaPath)) {
|
|
175988
176025
|
const hostname = new URL(url).hostname.replace(/^www\./, "");
|
|
175989
|
-
|
|
176026
|
+
writeFileSync41(
|
|
175990
176027
|
metaPath,
|
|
175991
176028
|
JSON.stringify({ id: hostname + "-video", name: tokens.title || hostname }, null, 2),
|
|
175992
176029
|
"utf-8"
|
|
@@ -176021,7 +176058,7 @@ var screenshotCapture_exports = {};
|
|
|
176021
176058
|
__export(screenshotCapture_exports, {
|
|
176022
176059
|
captureScrollScreenshots: () => captureScrollScreenshots
|
|
176023
176060
|
});
|
|
176024
|
-
import { writeFileSync as
|
|
176061
|
+
import { writeFileSync as writeFileSync43, mkdirSync as mkdirSync48 } from "fs";
|
|
176025
176062
|
import { join as join101 } from "path";
|
|
176026
176063
|
async function captureScrollScreenshots(page, outputDir) {
|
|
176027
176064
|
const screenshotsDir = join101(outputDir, "screenshots");
|
|
@@ -176118,7 +176155,7 @@ async function captureScrollScreenshots(page, outputDir) {
|
|
|
176118
176155
|
const filename = `scroll-${String(Math.min(pct, 100)).padStart(3, "0")}.png`;
|
|
176119
176156
|
const filePath = join101(screenshotsDir, filename);
|
|
176120
176157
|
const buffer = await page.screenshot({ type: "png" });
|
|
176121
|
-
|
|
176158
|
+
writeFileSync43(filePath, buffer);
|
|
176122
176159
|
filePaths.push(`screenshots/${filename}`);
|
|
176123
176160
|
}
|
|
176124
176161
|
await page.evaluate(`window.scrollTo(0, 0)`);
|
|
@@ -176465,7 +176502,7 @@ var capture_exports = {};
|
|
|
176465
176502
|
__export(capture_exports, {
|
|
176466
176503
|
captureWebsite: () => captureWebsite
|
|
176467
176504
|
});
|
|
176468
|
-
import { mkdirSync as mkdirSync49, writeFileSync as
|
|
176505
|
+
import { mkdirSync as mkdirSync49, writeFileSync as writeFileSync44, existsSync as existsSync94 } from "fs";
|
|
176469
176506
|
import { join as join103 } from "path";
|
|
176470
176507
|
async function captureWebsite(opts, onProgress) {
|
|
176471
176508
|
const {
|
|
@@ -176664,7 +176701,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
176664
176701
|
return true;
|
|
176665
176702
|
});
|
|
176666
176703
|
capturedShaders = unique;
|
|
176667
|
-
|
|
176704
|
+
writeFileSync44(
|
|
176668
176705
|
join103(outputDir, "extracted", "shaders.json"),
|
|
176669
176706
|
JSON.stringify(unique, null, 2),
|
|
176670
176707
|
"utf-8"
|
|
@@ -176679,7 +176716,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
176679
176716
|
...tokens,
|
|
176680
176717
|
svgs: tokens.svgs.map(({ outerHTML: _, ...rest }) => rest)
|
|
176681
176718
|
};
|
|
176682
|
-
|
|
176719
|
+
writeFileSync44(
|
|
176683
176720
|
join103(outputDir, "extracted", "tokens.json"),
|
|
176684
176721
|
JSON.stringify(tokensForDisk, null, 2),
|
|
176685
176722
|
"utf-8"
|
|
@@ -176687,7 +176724,7 @@ async function captureWebsite(opts, onProgress) {
|
|
|
176687
176724
|
progress("style", "Extracting design styles...");
|
|
176688
176725
|
try {
|
|
176689
176726
|
const designStyles = await extractDesignStyles(page1);
|
|
176690
|
-
|
|
176727
|
+
writeFileSync44(
|
|
176691
176728
|
join103(outputDir, "extracted", "design-styles.json"),
|
|
176692
176729
|
JSON.stringify(designStyles, null, 2),
|
|
176693
176730
|
"utf-8"
|
|
@@ -176794,7 +176831,7 @@ ${err.stack}` : normalizeErrorMessage(err);
|
|
|
176794
176831
|
scrollTriggeredElements: (animationCatalog.scrollTargets || []).length,
|
|
176795
176832
|
representativeAnimations: representativeAnims
|
|
176796
176833
|
};
|
|
176797
|
-
|
|
176834
|
+
writeFileSync44(
|
|
176798
176835
|
join103(outputDir, "extracted", "animations.json"),
|
|
176799
176836
|
JSON.stringify(leanCatalog, null, 2),
|
|
176800
176837
|
"utf-8"
|
|
@@ -176825,7 +176862,7 @@ ${err.stack}` : normalizeErrorMessage(err);
|
|
|
176825
176862
|
...tokens,
|
|
176826
176863
|
svgs: tokens.svgs.map(({ outerHTML: _, ...rest }) => rest)
|
|
176827
176864
|
};
|
|
176828
|
-
|
|
176865
|
+
writeFileSync44(
|
|
176829
176866
|
join103(outputDir, "extracted", "tokens.json"),
|
|
176830
176867
|
JSON.stringify(tokensForDisk2, null, 2),
|
|
176831
176868
|
"utf-8"
|
|
@@ -176842,12 +176879,12 @@ ${extracted.bodyHtml}
|
|
|
176842
176879
|
</body>
|
|
176843
176880
|
</html>
|
|
176844
176881
|
`;
|
|
176845
|
-
|
|
176882
|
+
writeFileSync44(join103(outputDir, "extracted", "page.html"), pageHtml, "utf-8");
|
|
176846
176883
|
} catch (err) {
|
|
176847
176884
|
warnings.push(`page.html write failed: ${err}`);
|
|
176848
176885
|
}
|
|
176849
176886
|
if (visibleTextContent) {
|
|
176850
|
-
|
|
176887
|
+
writeFileSync44(join103(outputDir, "extracted", "visible-text.txt"), visibleTextContent, "utf-8");
|
|
176851
176888
|
}
|
|
176852
176889
|
const geminiCaptions = await captionImagesWithGemini(outputDir, progress, warnings);
|
|
176853
176890
|
progress("design", "Generating asset descriptions...");
|
|
@@ -176856,7 +176893,7 @@ ${extracted.bodyHtml}
|
|
|
176856
176893
|
if (lines.length > 0) {
|
|
176857
176894
|
const hasGeminiKey = !!(process.env.GEMINI_API_KEY || process.env.GOOGLE_API_KEY);
|
|
176858
176895
|
const header = hasGeminiKey ? "# Asset Descriptions\n\nOne line per file. Read this instead of opening every image individually.\n\nTo find a specific brand or icon, **grep this file for the brand name in the description text** (e.g. `grep -i 'autodesk' asset-descriptions.md`). The Gemini Vision captions identify what's actually in each file \u2014 that's the agent's selector.\n\nThe `logo-<hash>.svg` filename prefix is a cheap structural hint (DOM said this SVG was inside a `<header>`, home-link `<a>`, or had an aria-label matching the page brand). It is NOT a content claim \u2014 many `logo-*` files are nav icons or decorative shapes. Trust the captions, not the filename prefix.\n\n" : "# Asset Descriptions\n\n\u26A0\uFE0F GEMINI_API_KEY not set \u2014 descriptions below are catalog-derived (alt text, headings, section context, filename) instead of Vision-generated. To get richer Vision descriptions on the next capture, set GEMINI_API_KEY (or GOOGLE_API_KEY) and re-run.\n\nThe `logo-<hash>.svg` filename prefix is a structural hint (DOM said this SVG was inside a `<header>`, home-link `<a>`, or had an aria-label matching the page brand). To pick the actual brand logo without Vision, open the `logo-*` candidates in a previewer or rasterize them with `sharp` before referencing \u2014 composing a fake logo ships off-brand in the final video.\n\n";
|
|
176859
|
-
|
|
176896
|
+
writeFileSync44(
|
|
176860
176897
|
join103(outputDir, "extracted", "asset-descriptions.md"),
|
|
176861
176898
|
header + lines.map((l) => "- " + l).join("\n") + "\n",
|
|
176862
176899
|
"utf-8"
|
|
@@ -177148,11 +177185,11 @@ var init_capture2 = __esm({
|
|
|
177148
177185
|
} catch (err) {
|
|
177149
177186
|
const errMsg = normalizeErrorMessage(err);
|
|
177150
177187
|
try {
|
|
177151
|
-
const { mkdirSync: mkdirSync60, writeFileSync:
|
|
177188
|
+
const { mkdirSync: mkdirSync60, writeFileSync: writeFileSync54 } = await import("fs");
|
|
177152
177189
|
mkdirSync60(outputDir, { recursive: true });
|
|
177153
177190
|
const isTimeout = /timeout|timed out/i.test(errMsg);
|
|
177154
177191
|
const reason = isTimeout ? "Page navigation timed out \u2014 the site may be blocking headless browsers or requires authentication." : `Capture failed: ${errMsg}`;
|
|
177155
|
-
|
|
177192
|
+
writeFileSync54(
|
|
177156
177193
|
`${outputDir}/BLOCKED.md`,
|
|
177157
177194
|
`# Capture Failed
|
|
177158
177195
|
|
|
@@ -177195,7 +177232,7 @@ __export(state_exports, {
|
|
|
177195
177232
|
stateFilePath: () => stateFilePath,
|
|
177196
177233
|
writeStackOutputs: () => writeStackOutputs
|
|
177197
177234
|
});
|
|
177198
|
-
import { existsSync as existsSync95, mkdirSync as mkdirSync50, readdirSync as readdirSync34, readFileSync as readFileSync66, rmSync as rmSync26, writeFileSync as
|
|
177235
|
+
import { existsSync as existsSync95, mkdirSync as mkdirSync50, readdirSync as readdirSync34, readFileSync as readFileSync66, rmSync as rmSync26, writeFileSync as writeFileSync45 } from "fs";
|
|
177199
177236
|
import { dirname as dirname43, join as join104 } from "path";
|
|
177200
177237
|
function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
177201
177238
|
return join104(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
|
|
@@ -177203,7 +177240,7 @@ function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
|
177203
177240
|
function writeStackOutputs(outputs, cwd = process.cwd()) {
|
|
177204
177241
|
const path2 = stateFilePath(outputs.stackName, cwd);
|
|
177205
177242
|
mkdirSync50(dirname43(path2), { recursive: true });
|
|
177206
|
-
|
|
177243
|
+
writeFileSync45(path2, JSON.stringify(outputs, null, 2) + "\n");
|
|
177207
177244
|
return path2;
|
|
177208
177245
|
}
|
|
177209
177246
|
function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
|
|
@@ -178756,7 +178793,7 @@ __export(cloudrun_exports, {
|
|
|
178756
178793
|
});
|
|
178757
178794
|
import { spawnSync as spawnSync7 } from "child_process";
|
|
178758
178795
|
import { createRequire as createRequire4 } from "module";
|
|
178759
|
-
import { existsSync as existsSync101, mkdirSync as mkdirSync51, readFileSync as readFileSync70, writeFileSync as
|
|
178796
|
+
import { existsSync as existsSync101, mkdirSync as mkdirSync51, readFileSync as readFileSync70, writeFileSync as writeFileSync46 } from "fs";
|
|
178760
178797
|
import { homedir as homedir16 } from "os";
|
|
178761
178798
|
import { dirname as dirname45, join as join110, resolve as resolve63 } from "path";
|
|
178762
178799
|
function stateDir() {
|
|
@@ -178767,7 +178804,7 @@ function statePath() {
|
|
|
178767
178804
|
}
|
|
178768
178805
|
function writeState(state) {
|
|
178769
178806
|
mkdirSync51(stateDir(), { recursive: true });
|
|
178770
|
-
|
|
178807
|
+
writeFileSync46(statePath(), JSON.stringify(state, null, 2));
|
|
178771
178808
|
}
|
|
178772
178809
|
function readState(args) {
|
|
178773
178810
|
const overrides = {
|
|
@@ -178930,7 +178967,7 @@ function findRepoRoot(tfDir) {
|
|
|
178930
178967
|
function writeCloudBuildConfig(image) {
|
|
178931
178968
|
const cfgPath = join110(stateDir(), "cloudrun-cloudbuild.yaml");
|
|
178932
178969
|
mkdirSync51(stateDir(), { recursive: true });
|
|
178933
|
-
|
|
178970
|
+
writeFileSync46(
|
|
178934
178971
|
cfgPath,
|
|
178935
178972
|
[
|
|
178936
178973
|
"steps:",
|
|
@@ -183030,7 +183067,7 @@ var init_parseFigmaRef = __esm({
|
|
|
183030
183067
|
});
|
|
183031
183068
|
|
|
183032
183069
|
// ../core/dist/figma/freeze.js
|
|
183033
|
-
import { copyFileSync as copyFileSync9, mkdirSync as mkdirSync54, rmSync as rmSync27, statSync as statSync30, writeFileSync as
|
|
183070
|
+
import { copyFileSync as copyFileSync9, mkdirSync as mkdirSync54, rmSync as rmSync27, statSync as statSync30, writeFileSync as writeFileSync47 } from "fs";
|
|
183034
183071
|
import { dirname as dirname48 } from "path";
|
|
183035
183072
|
function exceedsFreezeCap(byteLength) {
|
|
183036
183073
|
return byteLength > MAX_FREEZE_BYTES;
|
|
@@ -183042,12 +183079,12 @@ function freezeBytes(bytes, destPath) {
|
|
|
183042
183079
|
throw new Error(`freeze failed: ${bytes.length} bytes exceeds ${MAX_FREEZE_BYTES} cap`);
|
|
183043
183080
|
mkdirSync54(dirname48(destPath), { recursive: true });
|
|
183044
183081
|
try {
|
|
183045
|
-
|
|
183082
|
+
writeFileSync47(destPath, bytes, { flag: "wx" });
|
|
183046
183083
|
} catch (err) {
|
|
183047
183084
|
if (err.code !== "EEXIST")
|
|
183048
183085
|
throw err;
|
|
183049
183086
|
rmSync27(destPath);
|
|
183050
|
-
|
|
183087
|
+
writeFileSync47(destPath, bytes, { flag: "wx" });
|
|
183051
183088
|
}
|
|
183052
183089
|
return bytes.length;
|
|
183053
183090
|
}
|
|
@@ -183084,7 +183121,7 @@ var init_jsonl = __esm({
|
|
|
183084
183121
|
});
|
|
183085
183122
|
|
|
183086
183123
|
// ../core/dist/figma/manifest.js
|
|
183087
|
-
import { appendFileSync as appendFileSync2, existsSync as existsSync105, mkdirSync as mkdirSync55, readFileSync as readFileSync74, writeFileSync as
|
|
183124
|
+
import { appendFileSync as appendFileSync2, existsSync as existsSync105, mkdirSync as mkdirSync55, readFileSync as readFileSync74, writeFileSync as writeFileSync48 } from "fs";
|
|
183088
183125
|
import { join as join113 } from "path";
|
|
183089
183126
|
function mediaDir(projectDir) {
|
|
183090
183127
|
return join113(projectDir, ".media");
|
|
@@ -183138,7 +183175,7 @@ function updateRecord(projectDir, record) {
|
|
|
183138
183175
|
}
|
|
183139
183176
|
return line2;
|
|
183140
183177
|
});
|
|
183141
|
-
|
|
183178
|
+
writeFileSync48(p2, out.join("\n"));
|
|
183142
183179
|
}
|
|
183143
183180
|
function nextId(projectDir, type) {
|
|
183144
183181
|
const re2 = new RegExp(`^${type}_(\\d+)$`);
|
|
@@ -183179,7 +183216,7 @@ var init_manifest = __esm({
|
|
|
183179
183216
|
});
|
|
183180
183217
|
|
|
183181
183218
|
// ../core/dist/figma/mediaIndex.js
|
|
183182
|
-
import { mkdirSync as mkdirSync56, writeFileSync as
|
|
183219
|
+
import { mkdirSync as mkdirSync56, writeFileSync as writeFileSync49 } from "fs";
|
|
183183
183220
|
import { dirname as dirname49, join as join114 } from "path";
|
|
183184
183221
|
function isRow(value) {
|
|
183185
183222
|
return typeof value === "object" && value !== null;
|
|
@@ -183231,7 +183268,7 @@ function regenerateIndex(projectDir) {
|
|
|
183231
183268
|
const content = generateIndexContent(records);
|
|
183232
183269
|
const p2 = indexPath(projectDir);
|
|
183233
183270
|
mkdirSync56(dirname49(p2), { recursive: true });
|
|
183234
|
-
|
|
183271
|
+
writeFileSync49(p2, content);
|
|
183235
183272
|
return content;
|
|
183236
183273
|
}
|
|
183237
183274
|
var init_mediaIndex = __esm({
|
|
@@ -183296,7 +183333,7 @@ var init_sanitizeSvg = __esm({
|
|
|
183296
183333
|
});
|
|
183297
183334
|
|
|
183298
183335
|
// ../core/dist/figma/bindings.js
|
|
183299
|
-
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync57, writeFileSync as
|
|
183336
|
+
import { appendFileSync as appendFileSync3, mkdirSync as mkdirSync57, writeFileSync as writeFileSync50 } from "fs";
|
|
183300
183337
|
import { join as join115 } from "path";
|
|
183301
183338
|
function bindingsPath(projectDir) {
|
|
183302
183339
|
return join115(mediaDir(projectDir), BINDINGS_FILE);
|
|
@@ -183318,7 +183355,7 @@ function upsertBindings(projectDir, records) {
|
|
|
183318
183355
|
const survivors = readLines(projectDir).filter((line2) => !(isBindingRecord(line2) && incoming.has(line2.figmaId)));
|
|
183319
183356
|
mkdirSync57(mediaDir(projectDir), { recursive: true });
|
|
183320
183357
|
const lines = [...survivors, ...records].map((r2) => JSON.stringify(r2)).join("\n");
|
|
183321
|
-
|
|
183358
|
+
writeFileSync50(bindingsPath(projectDir), lines.length > 0 ? lines + "\n" : "");
|
|
183322
183359
|
}
|
|
183323
183360
|
var BINDINGS_FILE;
|
|
183324
183361
|
var init_bindings = __esm({
|
|
@@ -184102,7 +184139,7 @@ __export(tokens_exports, {
|
|
|
184102
184139
|
default: () => tokens_default,
|
|
184103
184140
|
runTokensImport: () => runTokensImport
|
|
184104
184141
|
});
|
|
184105
|
-
import { writeFileSync as
|
|
184142
|
+
import { writeFileSync as writeFileSync51 } from "fs";
|
|
184106
184143
|
import { join as join117 } from "path";
|
|
184107
184144
|
async function runTokensImport(refInput, deps) {
|
|
184108
184145
|
const { fileKey } = parseFigmaRef(refInput);
|
|
@@ -184117,7 +184154,7 @@ async function runTokensImport(refInput, deps) {
|
|
|
184117
184154
|
if (vars !== null) {
|
|
184118
184155
|
const out = tokensToVariables(vars, { fileKey, version: version2 });
|
|
184119
184156
|
upsertBindings(deps.projectDir, out.bindings);
|
|
184120
|
-
|
|
184157
|
+
writeFileSync51(sidecarPath, JSON.stringify(out.sidecar, null, 2) + "\n");
|
|
184121
184158
|
return { mode: "variables", entries: out.entries, sidecarPath };
|
|
184122
184159
|
}
|
|
184123
184160
|
const styles = await deps.client.styles(fileKey);
|
|
@@ -184131,7 +184168,7 @@ async function runTokensImport(refInput, deps) {
|
|
|
184131
184168
|
value: null
|
|
184132
184169
|
}))
|
|
184133
184170
|
};
|
|
184134
|
-
|
|
184171
|
+
writeFileSync51(sidecarPath, JSON.stringify(sidecar, null, 2) + "\n");
|
|
184135
184172
|
return { mode: "styles", entries: [], sidecarPath, styleCount: styles.length };
|
|
184136
184173
|
}
|
|
184137
184174
|
var tokens_default;
|
|
@@ -184181,7 +184218,7 @@ __export(component_exports, {
|
|
|
184181
184218
|
default: () => component_default,
|
|
184182
184219
|
runComponentImport: () => runComponentImport
|
|
184183
184220
|
});
|
|
184184
|
-
import { existsSync as existsSync107, mkdirSync as mkdirSync58, writeFileSync as
|
|
184221
|
+
import { existsSync as existsSync107, mkdirSync as mkdirSync58, writeFileSync as writeFileSync53 } from "fs";
|
|
184185
184222
|
import { join as join118, relative as relative19 } from "path";
|
|
184186
184223
|
function escapeAttr2(value) {
|
|
184187
184224
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
@@ -184206,7 +184243,7 @@ async function runComponentImport(refInput, deps) {
|
|
|
184206
184243
|
deps
|
|
184207
184244
|
);
|
|
184208
184245
|
const htmlFile = join118(componentDir, `${name}.html`);
|
|
184209
|
-
|
|
184246
|
+
writeFileSync53(htmlFile, html + "\n");
|
|
184210
184247
|
const registryItem = {
|
|
184211
184248
|
name,
|
|
184212
184249
|
type: "hyperframes:component",
|
|
@@ -184226,7 +184263,7 @@ async function runComponentImport(refInput, deps) {
|
|
|
184226
184263
|
}))
|
|
184227
184264
|
]
|
|
184228
184265
|
};
|
|
184229
|
-
|
|
184266
|
+
writeFileSync53(
|
|
184230
184267
|
join118(componentDir, "registry-item.json"),
|
|
184231
184268
|
JSON.stringify(registryItem, null, 2) + "\n"
|
|
184232
184269
|
);
|
|
@@ -184562,7 +184599,8 @@ function getSkillsUpdateMeta() {
|
|
|
184562
184599
|
return {
|
|
184563
184600
|
updateAvailable: config.skillsUpdateAvailable ?? false,
|
|
184564
184601
|
outdated: config.skillsOutdatedCount ?? 0,
|
|
184565
|
-
missing: config.skillsMissingCount ?? 0
|
|
184602
|
+
missing: config.skillsMissingCount ?? 0,
|
|
184603
|
+
removed: config.skillsRemovedCount ?? 0
|
|
184566
184604
|
};
|
|
184567
184605
|
}
|
|
184568
184606
|
function cacheFresh(lastSkillsCheck, now) {
|
|
@@ -184570,19 +184608,21 @@ function cacheFresh(lastSkillsCheck, now) {
|
|
|
184570
184608
|
return now - new Date(lastSkillsCheck).getTime() < CHECK_INTERVAL_MS2;
|
|
184571
184609
|
}
|
|
184572
184610
|
async function refreshSkillsCache() {
|
|
184573
|
-
const result = await checkSkills();
|
|
184611
|
+
const result = await checkSkills({ canonical: true });
|
|
184574
184612
|
if (result.location) {
|
|
184575
184613
|
const config = readConfig();
|
|
184576
184614
|
config.lastSkillsCheck = (/* @__PURE__ */ new Date()).toISOString();
|
|
184577
184615
|
config.skillsUpdateAvailable = result.updateAvailable;
|
|
184578
184616
|
config.skillsOutdatedCount = result.summary.outdated;
|
|
184579
184617
|
config.skillsMissingCount = result.summary.coreMissing;
|
|
184618
|
+
config.skillsRemovedCount = result.summary.removed;
|
|
184580
184619
|
writeConfig(config);
|
|
184581
184620
|
}
|
|
184582
184621
|
return {
|
|
184583
184622
|
updateAvailable: result.updateAvailable,
|
|
184584
184623
|
outdated: result.summary.outdated,
|
|
184585
|
-
missing: result.summary.coreMissing
|
|
184624
|
+
missing: result.summary.coreMissing,
|
|
184625
|
+
removed: result.summary.removed
|
|
184586
184626
|
};
|
|
184587
184627
|
}
|
|
184588
184628
|
async function checkSkillsForUpdate(force) {
|
|
@@ -184594,7 +184634,7 @@ async function checkSkillsForUpdate(force) {
|
|
|
184594
184634
|
}
|
|
184595
184635
|
}
|
|
184596
184636
|
function skillsNoticeText(meta) {
|
|
184597
|
-
const total = meta.outdated + meta.missing;
|
|
184637
|
+
const total = meta.outdated + meta.missing + meta.removed;
|
|
184598
184638
|
if (total < 1) return null;
|
|
184599
184639
|
const noun = total === 1 ? "skill" : "skills";
|
|
184600
184640
|
return `
|
|
@@ -185017,7 +185057,7 @@ if (!isHelp && command !== "telemetry" && command !== "events" && command !== "u
|
|
|
185017
185057
|
if (mod.shouldTrack()) mod.incrementCommandCount();
|
|
185018
185058
|
});
|
|
185019
185059
|
}
|
|
185020
|
-
if (!isHelp && !hasJsonFlag && command !== "upgrade" && command !== "events") {
|
|
185060
|
+
if (!isHelp && !hasJsonFlag && command !== "upgrade" && command !== "events" && command !== "skills") {
|
|
185021
185061
|
Promise.resolve().then(() => (init_autoUpdate(), autoUpdate_exports)).then((mod) => mod.reportCompletedUpdate()).catch(() => {
|
|
185022
185062
|
});
|
|
185023
185063
|
Promise.resolve().then(() => (init_updateCheck(), updateCheck_exports)).then(async (mod) => {
|