initialized mcp support

This commit is contained in:
dswbx
2025-08-02 16:33:05 +02:00
parent bd48bb7a18
commit ffbb61d58a
19 changed files with 468 additions and 68 deletions

View File

@@ -0,0 +1,36 @@
import { describe, it, expect } from "bun:test";
import { excludePropertyTypes, rescursiveClean } from "./utils";
import { s } from "../../core/utils/schema";
describe("rescursiveOptional", () => {
it("should make all properties optional", () => {
const schema = s.strictObject({
a: s.string(),
b: s.number(),
nested: s.strictObject({
c: s.string().optional(),
d: s.number(),
nested2: s.record(s.string()),
}),
});
//console.log(schema.toJSON());
console.log(
rescursiveClean(schema, {
removeRequired: true,
removeDefault: true,
}).toJSON(),
);
/* const result = rescursiveOptional(schema);
expect(result.properties.a.optional).toBe(true); */
});
it("should exclude properties", () => {
const schema = s.strictObject({
a: s.string(),
b: s.number(),
});
console.log(excludePropertyTypes(schema, [s.StringSchema]));
});
});