@lesto/ui
v0.3.0
Published
Lesto's AI-native UI rendering engine core — validate a JSON UI tree and render it to React against a vetted component registry.
Readme
@lesto/ui
Lesto's AI-native UI rendering engine core — validate a JSON UI tree and render it to React against a vetted component registry.
Part of Lesto, the batteries-included, agent-native fullstack framework.
bun add @lesto/uiimport { Registry, treeJsonSchema, validateTree } from "@lesto/ui";
// A vetted component registry — the model can only emit what you allow.
const registry = new Registry().define({
name: "Box",
props: {},
children: true,
render: (_props, kids) => <div>{kids}</div>,
});
const schema = treeJsonSchema(registry); // constrain the model's JSON output
const tree = { type: "Box", children: ["hello"] }; // the AI emits plain JSON
const { valid, errors } = validateTree(registry, tree); // pure, React-freeThis barrel is isomorphic (React-free); the server renderer lives behind
@lesto/ui/server and the browser hydration runtime behind @lesto/ui/client.
