singularity-forge/web/app/api/dev-mode/route.ts
ace-pm 35dc87ef53 chore: sync workspace state after rebrand
- Rebrand commits already in history (gsd → forge)
- Sync pre-existing doc, docker, and CI config updates
- All rebrand artifacts verified in place:
  * Native crates: forge-engine, forge-ast, forge-grep
  * Log prefixes: [forge] across 22+ files
  * Binary: ~/bin/sf-run
  * Workspace scopes: @sf-run/*, @singularity-forge/*
  * Nix flake: Rust toolchain ready

System ready for: nix develop && bun run build:native

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-15 14:54:20 +02:00

25 lines
880 B
TypeScript

import { existsSync } from "node:fs";
import { join } from "node:path";
export const runtime = "nodejs";
export const dynamic = "force-dynamic";
export function GET(): Response {
const hostKind = process.env.SF_WEB_HOST_KIND ?? "unknown";
const packageRoot = process.env.SF_WEB_PACKAGE_ROOT ?? "";
const isSourceDev = hostKind === "source-dev";
// When running via `npm run gsd:web` from the monorepo, the host resolves
// as packaged-standalone (because the build exists), but the source web/
// directory is still present at the package root. A truly published package
// won't have web/app/ next to dist/.
const isMonorepoDev =
!isSourceDev &&
packageRoot.length > 0 &&
existsSync(join(packageRoot, "web", "app"));
return Response.json(
{ isDevMode: isSourceDev || isMonorepoDev },
{ headers: { "Cache-Control": "no-store" } },
);
}