Something went wrong. Try again.
small gleam coding and (not yet) persistent agent daemon with a detachable cli
Something went wrong. Try again.
JavaScript
1234567891011121314151617181920212223242526#!/usr/bin/env nodeimport { existsSync } from "node:fs"import { fileURLToPath } from "node:url"import { dirname, join } from "node:path"import { spawnSync } from "node:child_process"
const dir = dirname(fileURLToPath(import.meta.url))const goBinary = join(dir, "albedo")
const isTsTest = process.env.ALBEDO_USE_TS === "1" || process.execArgv.some(arg => arg.includes("terminal.mjs"))
if (existsSync(goBinary) && !isTsTest) { const result = spawnSync(goBinary, process.argv.slice(2), { stdio: "inherit" }) process.exit(result.status ?? 0)}
import { register } from "tsx/esm/api"register({ tsconfig: fileURLToPath(new URL("../tsconfig.json", import.meta.url)) })// Load React's production renderer without changing the environment inherited by// the daemon or tools. NODE_ENV=development remains an explicit debugging option.const nodeEnv = process.env.NODE_ENVprocess.env.NODE_ENV ??= "production"const { main } = await import("../src/bin.ts")if (nodeEnv === undefined) delete process.env.NODE_ENVawait main()