added a simple mcp ui in tests

This commit is contained in:
dswbx
2025-08-14 16:49:31 +02:00
parent 9ac5fa03c6
commit 63254de13a
16 changed files with 436 additions and 63 deletions

View File

@@ -1,6 +1,7 @@
import type { JSONSchema } from "json-schema-to-ts";
import { useBknd } from "ui/client/bknd";
import { Button } from "ui/components/buttons/Button";
import { s } from "bknd/utils";
import {
AnyOf,
AnyOfField,
@@ -73,7 +74,31 @@ export default function JsonSchemaForm3() {
return (
<Scrollable>
<div className="flex flex-col p-3">
<Form schema={_schema.auth.toJSON()} options={formOptions} />
{/* <Form schema={_schema.auth.toJSON()} options={formOptions} /> */}
<Form
options={{
anyOfNoneSelectedMode: "first",
debug: true,
}}
initialValues={{ isd: "1", nested2: { name: "hello" } }}
schema={s
.object({
isd: s
.anyOf([s.string({ title: "String" }), s.number({ title: "Number" })])
.optional(),
email: s.string({ format: "email" }).optional(),
nested: s
.object({
name: s.string(),
})
.optional(),
nested2: s
.anyOf([s.object({ name: s.string() }), s.object({ age: s.number() })])
.optional(),
})
.toJSON()}
/>
{/*<Form
onChange={(data) => console.log("change", data)}