Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/generate-single-asset.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ import {
parseIndexedName,
requestPath
} from "./request-metadata.mjs";
import { pathToFileURL } from "node:url";

const IMAGE_EXTENSIONS = new Set([".avif", ".gif", ".jpeg", ".jpg", ".png", ".webp"]);
const MODEL_EXTENSIONS = new Set([".blend", ".fbx", ".glb", ".obj", ".stl", ".usdz"]);
Expand Down Expand Up @@ -628,7 +629,7 @@ async function main() {
console.log(JSON.stringify(result, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/gpt-image-2-edit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
writeJson
} from "./fal-queue.mjs";
import { buildRequestSummary, requestPath } from "./request-metadata.mjs";
import { pathToFileURL } from "node:url";

const ENDPOINT = "openai/gpt-image-2/edit";

Expand Down Expand Up @@ -105,7 +106,7 @@ async function main() {
console.log(JSON.stringify(summary, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/hunyuan-3d.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {
parseArgs,
} from "./fal-queue.mjs";
import { runFalImageTo3DProvider } from "./fal-3d-provider.mjs";
import { pathToFileURL } from "node:url";

export const HUNYUAN_3D_ENDPOINT = "fal-ai/hunyuan3d-v3/image-to-3d";
export const HUNYUAN_3D_PROVIDER = "hunyuan";
Expand Down Expand Up @@ -130,7 +131,7 @@ async function main() {
console.log(JSON.stringify(summary, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/image-edit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { runGptImage2Edit } from "./gpt-image-2-edit.mjs";
import { runNanoBananaEdit } from "./nano-banana-edit.mjs";
import { loadDotEnv, many, one, parseArgs } from "./fal-queue.mjs";
import { requestPath } from "./request-metadata.mjs";
import { pathToFileURL } from "node:url";

const PROVIDERS = new Set(["nano-banana", "gpt-image-2"]);

Expand Down Expand Up @@ -75,7 +76,7 @@ async function main() {
console.log(JSON.stringify(summary, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/meshy-3d.mjs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env node
import { one, parseArgs } from "./fal-queue.mjs";
import { runFalImageTo3DProvider } from "./fal-3d-provider.mjs";
import { pathToFileURL } from "node:url";

export const MESHY_3D_ENDPOINT = "fal-ai/meshy/v6/image-to-3d";
export const MESHY_3D_PROVIDER = "meshy";
Expand Down Expand Up @@ -143,7 +144,7 @@ async function main() {
console.log(JSON.stringify(summary, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/asset-pipeline/nano-banana-edit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import {
writeJson
} from "./fal-queue.mjs";
import { buildRequestSummary, requestPath } from "./request-metadata.mjs";
import { pathToFileURL } from "node:url";

const ENDPOINT = "fal-ai/nano-banana-2/edit";

Expand Down Expand Up @@ -108,7 +109,7 @@ async function main() {
console.log(JSON.stringify(summary, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/fal/run-fal.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
nextIndex,
requestPath
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

function parseJsonValue(value) {
if (typeof value !== "string") return value;
Expand Down Expand Up @@ -285,7 +286,7 @@ async function main() {
console.log(JSON.stringify(result, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/image-edit/generate-edit.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
requestMetadataFiles,
requestPath
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

async function readJsonIfExists(filePath) {
return (await pathExists(filePath)) ? readJson(filePath) : undefined;
Expand Down Expand Up @@ -210,7 +211,7 @@ async function main() {
console.log(JSON.stringify(result, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/project/delete.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
parseArgs,
pathExists
} from "../asset-pipeline/fal-queue.mjs";
import { pathToFileURL } from "node:url";

const ALLOWED_ROOTS = ["worlds", "input"];

Expand Down Expand Up @@ -55,7 +56,7 @@ async function main() {
console.log(JSON.stringify({ action: "deleted", path: relative, recursive }, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/project/download.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
parseArgs,
pathExists
} from "../asset-pipeline/fal-queue.mjs";
import { pathToFileURL } from "node:url";

const ALLOWED_ROOTS = ["worlds", "input"];

Expand Down Expand Up @@ -69,7 +70,7 @@ async function main() {
}, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/project/ensure-local-assets.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
artifactPath,
parseIndexedName
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

const ALLOWED_ROOTS = ["worlds", "input"];

Expand Down Expand Up @@ -165,7 +166,7 @@ async function main() {
}, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/project/indexed-path.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
nextIndex,
requestPath
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

function usage() {
return [
Expand Down Expand Up @@ -64,7 +65,7 @@ async function main() {
}, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/project/project-state.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
latestIndexed,
parseIndexedName
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

const PROJECT_DIRS = ["source", "output", "output/world", "output/sfx"];
const RESERVED_OUTPUT_DIRS = new Set(["world", "sfx"]);
Expand Down Expand Up @@ -257,7 +258,7 @@ async function main() {
console.log(JSON.stringify(state, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/sfx/fal-elevenlabs-sfx.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import {
requestMetadataFiles,
requestPath
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

const ENDPOINT = "fal-ai/elevenlabs/sound-effects/v2";
const DEFAULT_OUTPUT_FORMAT = "mp3_44100_128";
Expand Down Expand Up @@ -456,7 +457,7 @@ async function main() {
console.log(JSON.stringify(result, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down
3 changes: 2 additions & 1 deletion .claude/scripts/world/generate-world.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import {
parseIndexedName,
requestPath
} from "../asset-pipeline/request-metadata.mjs";
import { pathToFileURL } from "node:url";

const ENDPOINT = "https://api.worldlabs.ai/marble/v1";
const MODEL = "marble-1.1";
Expand Down Expand Up @@ -402,7 +403,7 @@ async function main() {
console.log(JSON.stringify(result, null, 2));
}

if (import.meta.url === `file://${process.argv[1]}`) {
if (import.meta.url === pathToFileURL(process.argv[1]).href) {
main().catch((error) => {
console.error(error.message);
process.exit(1);
Expand Down