singularity-forge/web/app/api/steer/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

39 lines
1.1 KiB
TypeScript

import { existsSync, readFileSync } from "node:fs"
import { join } from "node:path"
import { resolveBridgeRuntimeConfig, requireProjectCwd } from "../../../../src/web/bridge-service.ts"
import type { SteerData } from "../../../lib/remaining-command-types.ts"
export const runtime = "nodejs"
export const dynamic = "force-dynamic"
export async function GET(request: Request): Promise<Response> {
try {
const projectCwd = requireProjectCwd(request);
const config = resolveBridgeRuntimeConfig(undefined, projectCwd)
const overridesPath = join(config.projectCwd, ".sf", "OVERRIDES.md")
let overridesContent: string | null = null
if (existsSync(overridesPath)) {
overridesContent = readFileSync(overridesPath, "utf-8")
}
const payload: SteerData = { overridesContent }
return Response.json(payload, {
headers: {
"Cache-Control": "no-store",
},
})
} catch (error) {
const message = error instanceof Error ? error.message : String(error)
return Response.json(
{ error: message },
{
status: 500,
headers: {
"Cache-Control": "no-store",
},
},
)
}
}