Refresh HiveGrid Cloud reference snapshot
This commit is contained in:
1 parent
5e99e14772
commit
7f88026f79
5955 files changed
+1177325
-188362
No files matched your search
@@ -1,29 +1,20 @@
|
||||
import { createServer } from "node:http";
|
||||
|
||||
import { loadMcpRuntimeConfig } from "./config.js";
|
||||
import { writeJson } from "./http.js";
|
||||
import { hardenMcpHttpServer } from "./http-server.js";
|
||||
import { mcpLogger } from "./logger.js";
|
||||
import { handleMcpRequest } from "./transport.js";
|
||||
import { createMcpRequestHandler } from "./request-handler.js";
|
||||
import { assertRlsRuntimeReady } from "@hivegrid/db/rls-runtime-readiness.server";
|
||||
|
||||
const config = loadMcpRuntimeConfig();
|
||||
const rlsReadiness = await assertRlsRuntimeReady();
|
||||
if (!rlsReadiness.ready) {
|
||||
mcpLogger.warn({ diagnostics: rlsReadiness.diagnostics }, "RLS runtime is running in audit mode with failed checks");
|
||||
}
|
||||
|
||||
const server = createServer(async (req, res) => {
|
||||
try {
|
||||
const pathname = new URL(req.url ?? "/", "http://localhost").pathname;
|
||||
if (req.method === "GET" && pathname === "/healthz") {
|
||||
writeJson(res, 200, { status: "ok", service: "mcp", revision: config.revision });
|
||||
return;
|
||||
}
|
||||
if (req.method === "GET" && pathname === "/readyz") {
|
||||
writeJson(res, 200, { status: "ready", service: "mcp", revision: config.revision });
|
||||
return;
|
||||
}
|
||||
await handleMcpRequest(req, res, config);
|
||||
} catch (error) {
|
||||
mcpLogger.error({ err: error }, "MCP request failed");
|
||||
writeJson(res, 500, { error: { code: "internal_error", message: "HiveGrid MCP request failed." } });
|
||||
}
|
||||
});
|
||||
const server = hardenMcpHttpServer(
|
||||
createServer(createMcpRequestHandler(config)),
|
||||
);
|
||||
|
||||
server.listen(config.listen.port, config.listen.host, () => {
|
||||
mcpLogger.info({ port: config.listen.port, host: config.listen.host }, "MCP listening");
|
||||
|
||||
Reference in new issue
Block a user