diff --git a/.claude/scripts/asset-pipeline/generate-single-asset.mjs b/.claude/scripts/asset-pipeline/generate-single-asset.mjs index 73d2208..9492260 100644 --- a/.claude/scripts/asset-pipeline/generate-single-asset.mjs +++ b/.claude/scripts/asset-pipeline/generate-single-asset.mjs @@ -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"]); @@ -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); diff --git a/.claude/scripts/asset-pipeline/gpt-image-2-edit.mjs b/.claude/scripts/asset-pipeline/gpt-image-2-edit.mjs index b7bbbcc..0942758 100644 --- a/.claude/scripts/asset-pipeline/gpt-image-2-edit.mjs +++ b/.claude/scripts/asset-pipeline/gpt-image-2-edit.mjs @@ -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"; @@ -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); diff --git a/.claude/scripts/asset-pipeline/hunyuan-3d.mjs b/.claude/scripts/asset-pipeline/hunyuan-3d.mjs index 6cb6523..fcda2a1 100644 --- a/.claude/scripts/asset-pipeline/hunyuan-3d.mjs +++ b/.claude/scripts/asset-pipeline/hunyuan-3d.mjs @@ -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"; @@ -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); diff --git a/.claude/scripts/asset-pipeline/image-edit.mjs b/.claude/scripts/asset-pipeline/image-edit.mjs index ef96808..735de40 100644 --- a/.claude/scripts/asset-pipeline/image-edit.mjs +++ b/.claude/scripts/asset-pipeline/image-edit.mjs @@ -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"]); @@ -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); diff --git a/.claude/scripts/asset-pipeline/meshy-3d.mjs b/.claude/scripts/asset-pipeline/meshy-3d.mjs index 5092fd6..cbdff07 100644 --- a/.claude/scripts/asset-pipeline/meshy-3d.mjs +++ b/.claude/scripts/asset-pipeline/meshy-3d.mjs @@ -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"; @@ -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); diff --git a/.claude/scripts/asset-pipeline/nano-banana-edit.mjs b/.claude/scripts/asset-pipeline/nano-banana-edit.mjs index ecfaf8c..ed55388 100644 --- a/.claude/scripts/asset-pipeline/nano-banana-edit.mjs +++ b/.claude/scripts/asset-pipeline/nano-banana-edit.mjs @@ -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"; @@ -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); diff --git a/.claude/scripts/fal/run-fal.mjs b/.claude/scripts/fal/run-fal.mjs index 2f8876c..7bc1a62 100644 --- a/.claude/scripts/fal/run-fal.mjs +++ b/.claude/scripts/fal/run-fal.mjs @@ -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; @@ -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); diff --git a/.claude/scripts/image-edit/generate-edit.mjs b/.claude/scripts/image-edit/generate-edit.mjs index a657564..6dd9f63 100644 --- a/.claude/scripts/image-edit/generate-edit.mjs +++ b/.claude/scripts/image-edit/generate-edit.mjs @@ -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; @@ -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); diff --git a/.claude/scripts/project/delete.mjs b/.claude/scripts/project/delete.mjs index bfe7dc9..1ba6117 100644 --- a/.claude/scripts/project/delete.mjs +++ b/.claude/scripts/project/delete.mjs @@ -6,6 +6,7 @@ import { parseArgs, pathExists } from "../asset-pipeline/fal-queue.mjs"; +import { pathToFileURL } from "node:url"; const ALLOWED_ROOTS = ["worlds", "input"]; @@ -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); diff --git a/.claude/scripts/project/download.mjs b/.claude/scripts/project/download.mjs index cf1947e..b0ca1bd 100644 --- a/.claude/scripts/project/download.mjs +++ b/.claude/scripts/project/download.mjs @@ -7,6 +7,7 @@ import { parseArgs, pathExists } from "../asset-pipeline/fal-queue.mjs"; +import { pathToFileURL } from "node:url"; const ALLOWED_ROOTS = ["worlds", "input"]; @@ -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); diff --git a/.claude/scripts/project/ensure-local-assets.mjs b/.claude/scripts/project/ensure-local-assets.mjs index 32f298b..ea8059b 100644 --- a/.claude/scripts/project/ensure-local-assets.mjs +++ b/.claude/scripts/project/ensure-local-assets.mjs @@ -15,6 +15,7 @@ import { artifactPath, parseIndexedName } from "../asset-pipeline/request-metadata.mjs"; +import { pathToFileURL } from "node:url"; const ALLOWED_ROOTS = ["worlds", "input"]; @@ -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); diff --git a/.claude/scripts/project/indexed-path.mjs b/.claude/scripts/project/indexed-path.mjs index f294494..217fb8d 100644 --- a/.claude/scripts/project/indexed-path.mjs +++ b/.claude/scripts/project/indexed-path.mjs @@ -10,6 +10,7 @@ import { nextIndex, requestPath } from "../asset-pipeline/request-metadata.mjs"; +import { pathToFileURL } from "node:url"; function usage() { return [ @@ -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); diff --git a/.claude/scripts/project/project-state.mjs b/.claude/scripts/project/project-state.mjs index 84e7cc0..576a909 100644 --- a/.claude/scripts/project/project-state.mjs +++ b/.claude/scripts/project/project-state.mjs @@ -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"]); @@ -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); diff --git a/.claude/scripts/sfx/fal-elevenlabs-sfx.mjs b/.claude/scripts/sfx/fal-elevenlabs-sfx.mjs index 832c779..c461515 100644 --- a/.claude/scripts/sfx/fal-elevenlabs-sfx.mjs +++ b/.claude/scripts/sfx/fal-elevenlabs-sfx.mjs @@ -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"; @@ -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); diff --git a/.claude/scripts/world/generate-world.mjs b/.claude/scripts/world/generate-world.mjs index d562ad0..a55f6c4 100644 --- a/.claude/scripts/world/generate-world.mjs +++ b/.claude/scripts/world/generate-world.mjs @@ -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"; @@ -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);