mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
fix(mcp): advertise primitive semantic literal seeds
This commit is contained in:
@@ -8,22 +8,16 @@ import {
|
||||
javaScriptSemanticEvidenceContextSchema,
|
||||
javaScriptSemanticUnknownSchema,
|
||||
} from "./javascriptSemanticGraphSchemas.js";
|
||||
import { jsonValueSchema } from "../jsonValue.js";
|
||||
import { digestSchema } from "../digests.js";
|
||||
import { prefixedDigestSchema } from "../digests.js";
|
||||
|
||||
const semanticNodeIdSchema = prefixedDigestSchema("jsrg_node");
|
||||
const literalValueSchema = jsonValueSchema.refine(
|
||||
(value) =>
|
||||
value === null ||
|
||||
typeof value === "string" ||
|
||||
typeof value === "number" ||
|
||||
typeof value === "boolean",
|
||||
"Literal seeds accept only JSON primitive values",
|
||||
);
|
||||
// Zod derivations drop the shared schema's JSON Schema projection override;
|
||||
// re-apply it so MCP catalog generation keeps projecting `{}`.
|
||||
literalValueSchema._zod.toJSONSchema = () => ({});
|
||||
const literalValueSchema = z.union([
|
||||
z.string(),
|
||||
z.number(),
|
||||
z.boolean(),
|
||||
z.null(),
|
||||
]);
|
||||
|
||||
const literalSeedSchema = z.strictObject({
|
||||
kind: z.literal("literal"),
|
||||
|
||||
Reference in New Issue
Block a user