singularity-forge/web/app/api/dev-mode/route.ts
ace-pm 6b0ac484ba refactor: update log prefixes and string values from gsd- to sf- namespace
Updates channel prefixes, log messages, comments, and configuration values
across daemon, mcp-server, and related packages to complete the rebrand from
gsd to sf-run naming.

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

25 lines
879 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 sf: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" } },
);
}