IntegrationsAI SDK
json-render
Store and validate UI specs that a model streams with json-render.
better-supabase/json-render handles the data-spec parts of
json-render. It is typed structurally and imports no package, so the
optional peer @json-render/core is only needed when you also use its catalog.
import {
collapseSpecParts,
specOfMessage,
validateSpec,
} from "better-supabase/json-render";applySpecPatch(spec, patch)applies a JSON Patch list and refuses__proto__,constructorandprototypekeys.collapseSpecParts(message)folds the streamed patches of a message into onedata-specpart. Use it asassistant({ parts: { compact: collapseSpecParts } }).specOfMessage(message)returns the final spec.validateSpec(catalog, spec)reportsroot_not_found,missing_childandorphaned_element, then asks your catalog (catalog.validate).specDocumentContentandparseSpecDocumentstore a spec as anai-filesdocument of kindspec(ai-filesSQL version 3).
Render the spec in React with @json-render/react; the Next.js example does.
Last updated on
Agents
Build a ToolLoopAgent from a stored agent with its tools, approvals and knowledge search, and check input and output with a moderation middleware.
MCP connectors
Authorize a user with an MCP server through OAuth with dynamic client registration in Vault, connect with the stored session and give the model the server's tools.