UNPKG

@receiz/mcp-server

Version:

MCP server for agents building and verifying Receiz proof-native applications through the canonical Receiz SDK rails.

25 lines • 1.26 kB
import { realpath } from "node:fs/promises"; import { isAbsolute, relative, resolve } from "node:path"; // Exact repository-inspection/application bindings in index.ts. Seal/source // tools already use their canonical workspace-bound readers. const repositoryTools = new Set([ "receiz_project_inspect", "receiz_app_plan", "receiz_app_apply", "receiz_app_check", "receiz_app_upgrade", "receiz_app_explain", "receiz_app_repair", "receiz_release_qualify", ]); export async function bindDeviceRelayWorkspace(request, workspace) { const pinned = structuredClone(request); const message = pinned; if (message.method !== "tools/call" || !repositoryTools.has(message.params?.name ?? "")) return pinned; const args = message.params?.arguments; if (!args || typeof args.root !== "string") throw Error("RECEIZ_DEVICE_WORKSPACE_ROOT_REQUIRED"); const base = await realpath(workspace); const target = await realpath(resolve(base, args.root)); const rel = relative(base, target); if (rel === ".." || rel.startsWith("../") || rel.startsWith("..\\") || isAbsolute(rel)) throw Error("RECEIZ_DEVICE_WORKSPACE_REQUIRED"); args.root = target; return pinned; } //# sourceMappingURL=deviceWorkspace.js.map