core
Skill18k starsChanged 2 months agoApache-2.0View on GitHub
Core package for defining schemas, catalogs, and AI prompt generation for json-render. Use when working with @json-render/core, defining schemas, creating catalogs, or building JSON specs for UI/video generation.
- Reads credentials
17 other projects use a version of this, 1 of them edited.
Trending
More talk lately.about the whole repository
Most recently taken up by
- vercel-labs/issue-graphtheir own version, first seen Sep 27, 2026
- vercel-labs/agent-browsertheir own version, first seen Sep 16, 2026
- fishzjp/qa-skillstheir own version, first seen Sep 7, 2026
- vercel-labs/nativetheir own version, first seen Aug 18, 2026
- prantosmss/workflow-janitortheir own version, first seen Aug 6, 2026
- flll/grow-your-own-skillstheir own version, first seen Jul 5, 2026
Who's talking about vercel-labs/json-render
- @sungkim.bsky.social“AI Chat in TUI or Generative TUI? Vercel's json-render: The Generative UI framework. Generate dynamic, …”Bluesky · Mar 24, 2026 · 9 likes
- devframes/devframe“Proposal: terminal UI (TUI) target that renders json-render views”GitHub · Sep 30, 2026 · 2 reactions
- mangeshraut712/Vitals.AI“chore(deps): bump the npm-dependencies group with 31 updates”GitHub · Jul 27, 2026 · 2 reactions
- @github-trending-js.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel-labs / json-render ⭐ 15,422 (+127) 🗒 TypeScript The Generative …”Bluesky · Jun 17, 2026 · 2 likes
- mangeshraut712/Vitals.AI“chore(deps): bump the npm-dependencies group across 1 directory with 31 updates”GitHub · May 18, 2026 · 2 reactions
The biggest 5 of 69 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 69
Talked about on GitHub, Bluesky and Hacker News (69 times).
On GitHub · 50
- Sep 30, 2026Proposal: terminal UI (TUI) target that renders json-render views — devframes/devframe2 reactions · 2 comments
- Jul 27, 2026chore(deps): bump the npm-dependencies group with 31 updates — mangeshraut712/Vitals.AI2 reactions · 3 comments
- May 18, 2026chore(deps): bump the npm-dependencies group across 1 directory with 31 updates — mangeshraut712/Vitals.AI2 reactions · 4 comments
- May 11, 2026chore(deps): bump the npm-dependencies group across 1 directory with 30 updates — mangeshraut712/Vitals.AI2 reactions · 2 comments
- May 4, 2026chore(deps): bump the npm-dependencies group across 1 directory with 30 updates — mangeshraut712/Vitals.AI2 reactions · 3 comments
45 more on GitHub
- Apr 20, 2026chore(deps): bump the npm-dependencies group across 1 directory with 29 updates — mangeshraut712/Vitals.AI2 reactions · 3 comments
- Apr 6, 2026chore(deps): bump the npm-dependencies group across 1 directory with 28 updates — mangeshraut712/Vitals.AI2 reactions · 3 comments
- Oct 11, 2026[TEMPO-B06-02] Pin json-render and define the Tempo block catalog — Levidavidspublic/tempo-rhythm1 reaction · 4 comments
- Oct 11, 2026[TEMPO-B06-P02] json-render and shared UI dependency preparation — Levidavidspublic/tempo-rhythm1 reaction · 2 comments
- Oct 9, 2026chore(deps): bump the bun-minor-patch group with 67 updates — miurla/morphic1 reaction · 3 comments
- Jul 28, 2026[Bug]: Skills with same name overwrite each other — vercel-labs/skills1 reaction · 1 comment
- Jul 13, 2026A2UI 生态日报 2026-07-13 — linqinghao/big_model_radar1 reaction
- May 7, 2026chore: bump the production-dependencies group across 1 directory with 15 updates — mengxi-ream/read-frog1 reaction · 1 comment
- Apr 3, 2026chore: bump the production-dependencies group across 1 directory with 12 updates — mengxi-ream/read-frog1 reaction · 2 comments
- Mar 23, 2026chore: bump the production-dependencies group with 5 updates — mengxi-ream/read-frog1 reaction · 1 comment
- Mar 20, 2026Add generative-UI example leveraging json-render — alpic-ai/skybridge1 reaction
- Feb 26, 2026Json renderer — nuxt/ui1 reaction · 2 comments
- Nov 2, 2026chore(deps): bump @json-render/core from 0.21.1 to 0.21.3 — jacobhausler/hermes-rich-ui0 reactions · 2 comments
- Nov 2, 2026chore(deps): bump @json-render/react from 0.21.1 to 0.21.3 — jacobhausler/hermes-rich-ui0 reactions · 1 comment
- Nov 2, 2026🎨 Generative UI Ecosystem Digest 2026-11-02 — linqinghao/agents-radar0 reactions
- Nov 2, 2026🎨 生成式 UI 生态日报 2026-11-02 — linqinghao/agents-radar0 reactions
- Nov 1, 2026chore(deps): bump the bun group in /apps/desktop with 9 updates — tasker-systems/temper-contrib0 reactions · 1 comment
- Nov 1, 2026🎨 生成式 UI 生态日报 2026-11-01 — linqinghao/agents-radar0 reactions
- Nov 1, 2026🎨 Generative UI Ecosystem Digest 2026-11-01 — linqinghao/agents-radar0 reactions
- Nov 1, 2026build(deps-dev): bump the dev-dependencies group with 4 updates — sidorares/react-x11-components0 reactions
- Oct 31, 2026chore: bump the production-dependencies group across 1 directory with 40 updates — ajthejet3-sketch/leisurelearning0 reactions
- Oct 31, 2026🎨 Generative UI Ecosystem Digest 2026-10-31 — linqinghao/agents-radar0 reactions
- Oct 30, 2026🎨 Generative UI Ecosystem Digest 2026-10-30 — linqinghao/agents-radar0 reactions
- Oct 29, 2026chore(deps): bump @json-render/shadcn from 0.21.1 to 0.21.3 — owieth/dynamic-charts-by-prompt0 reactions
- Oct 29, 2026chore(deps): bump the npm-minor group with 3 updates — Avijit-Kumar-GIT/fella0 reactions
- Oct 29, 2026🎨 Generative UI Ecosystem Digest 2026-10-29 — linqinghao/agents-radar0 reactions
- Oct 28, 2026🎨 Generative UI Ecosystem Digest 2026-10-28 — linqinghao/agents-radar0 reactions
- Oct 28, 2026🎨 生成式 UI 生态日报 2026-10-28 — linqinghao/agents-radar0 reactions
- Oct 28, 2026build(deps): bump @json-render/react from 0.21.2 to 0.21.3 — SatohaCC/medi-chat0 reactions · 1 comment
- Oct 28, 2026build(deps): bump @json-render/core from 0.21.2 to 0.21.3 — SatohaCC/medi-chat0 reactions · 1 comment
- Oct 27, 2026chore: bump the production-dependencies group across 1 directory with 39 updates — B416-JAFLY/leafling-local0 reactions
- Oct 27, 2026build(deps): Bump the npm-minor-and-patch group with 2 updates — MysterionRise/code-guesser0 reactions
- Oct 27, 2026🎨 Generative UI Ecosystem Digest 2026-10-27 — linqinghao/agents-radar0 reactions
- Oct 27, 2026build(deps): bump @json-render/core from 0.21.1 to 0.21.2 — SatohaCC/medi-chat0 reactions · 1 comment
- Oct 27, 2026build(deps): bump @json-render/react from 0.21.1 to 0.21.2 — SatohaCC/medi-chat0 reactions · 1 comment
- Oct 26, 2026🎨 Generative UI Ecosystem Digest 2026-10-26 — linqinghao/agents-radar0 reactions
- Oct 25, 2026🎨 Generative UI Ecosystem Digest 2026-10-25 — linqinghao/agents-radar0 reactions
- Oct 23, 2026chore: bump the production-dependencies group across 1 directory with 44 updates — SYZBZ/translation-kitten0 reactions
- Oct 22, 2026chore(deps): bump @json-render/shadcn from 0.21.0 to 0.21.1 — owieth/dynamic-charts-by-prompt0 reactions
- Oct 19, 2026chore(deps): bump @json-render/core from 0.21.0 to 0.21.1 — jacobhausler/hermes-rich-ui0 reactions · 3 comments
- Oct 19, 2026[TEMPO-KA-45] Tempo blocks in pages and in coach cards are drawn by one json-render renderer, after a short written comparison with OpenUI — Levidavidspublic/tempo-rhythm0 reactions
- Oct 19, 2026build(deps): bump the root-deps group across 1 directory with 70 updates — vaddisrinivas/utopia0 reactions
- Oct 18, 2026🎨 Generative UI Ecosystem Digest 2026-10-18 — linqinghao/agents-radar0 reactions
- Oct 17, 2026deps(canvas): bump @json-render/react from 0.21.0 to 0.21.1 in /extensions/canvas — miloszkolber/oc_build0 reactions
- Oct 17, 2026deps(canvas): bump @json-render/core from 0.21.0 to 0.21.1 in /extensions/canvas — miloszkolber/oc_build0 reactions
On Bluesky · 17
- Mar 24, 2026AI Chat in TUI or Generative TUI? Vercel's json-render: The Generative UI framework. Generate dynamic, personalized UIs from prompts… — @sungkim.bsky.social9 likes and reposts
- Jun 17, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel-labs / json-render ⭐ 15,422 (+127) 🗒 TypeScript The Generative UI framework — @github-trending-js.bsky.social2 likes and reposts
- May 13, 2026そういえばAgentに吐かせるべきはMarkdownかHTMLか論争、json-renderみたいに出すコンポーネントが絞られてたら多少マシかも github.com/vercel-labs/... — @ras0q.com2 likes and reposts
- May 9, 2026📦 vercel-labs / json-render ⭐ 14,661 (+42) 🗒 TypeScript The Generative UI framework — @github-trending-js.bsky.social2 likes and reposts
- Mar 26, 2026PDF generation is pretty straightforward with github.com/vercel-labs/... I'm building a thing like a thing I once built for templated… — @rager.tech2 likes and reposts · 1 reply
12 more on Bluesky
- Jan 17, 2026Saw this framework for controlled UI rendering from AI Seems interesting Any insights on such frameworks ? github.com/vercel-labs/... #AI… — @muralirk.bsky.social2 likes and reposts
- Oct 27, 2026oh, isn't json-render something like this? — @evadeva.bsky.social1 likes and repost
- Sep 23, 2026vercel-labs/json-render (17k+ stars, 8 months old, trending again) doesn't let a model write UI code. It emits JSON constrained to a… — @maybeworthbuilding.bsky.social1 likes and repost
- Sep 20, 2026🎉 Celebrating! 🎉 (500+ new stars) 📦 vercel-labs / json-render ⭐ 16,989 (+585) 🗒 TypeScript The Generative UI framework — @github-trending.bsky.social1 likes and repost · 1 reply
- Sep 19, 2026"Your LLM only renders with the components and schemas you approve" cool why don‘t we have programmable documents as a *human-usable*… — @sevoris.bsky.social1 likes and repost
- Sep 19, 2026🚀 Skyrocketing! 🚀 (200+ new stars) 📦 vercel-labs / json-render ⭐ 16,700 (+468) 🗒 TypeScript The Generative UI framework — @github-trending-js.bsky.social1 likes and repost · 1 reply
- Apr 27, 2026github.com/vercel-labs/jso... GitHub - vercel-labs/json-render: The Generative UI framework — @technews4869.bsky.social1 likes and repost
- Mar 28, 2026🔥 Hot Repo! 🔥 (100+ new stars) 📦 vercel-labs / json-render ⭐ 13,582 (+103) 🗒 TypeScript The Generative UI framework — @github-trending-js.bsky.social1 likes and repost
- Feb 22, 2026https://github.com/vercel-labs/json-render — @tom-doerr.bsky.social1 likes and repost
- Jan 25, 2026Vercel Labs' AI → JSON → UI pipeline - declarative interfaces generated from AI responses! https://github.com/vercel-labs/json-render — @u11g.com1 likes and repost
- Jan 24, 2026github.com/vercel-labs... — @michabbb.bsky.social1 likes and repost
- Jan 15, 2026Generative UI github.com/vercel-labs/... — @kasperjunge.bsky.social1 likes and repost · 1 reply
On Hacker News · 2
- Jan 21, 2026Benchmark Comparison: JSONL vs. TOON output for JSON-render efficiencysays it tested it2 points
- Jan 15, 2026json-render2 points · 2 comments
Other versions17 projects use a version of this.
Word for word · 0
None found.
Edited · 1
- saya-ashen/Chrona★ 298% same
Wrote their own version · 16
- vercel-labs/agent-browser★ 44ksame name
- microsoft/data-formulator★ 18ksame name
- microsoft/RD-Agent★ 15ksame name
- vercel-labs/native★ 7.7ksame name
- vercel-labs/issue-graph★ 124same name
- fishzjp/qa-skills★ 35same name
- modeled-information-format/mnemonic★ 23same name
- CarbeneAI/Forge★ 9same name
- kongshan001/cocos-engine-claude-skills★ 6same name
- ajayjohn/tars-work-assistant★ 4same name
6 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository31 other files it gives its agents.
- AGENTS.mdAGENTS.md
- codegenSkill
- devtools-reactSkill
- devtoolsSkill
- devtools-solidSkill
- devtools-svelteSkill
- devtools-vueSkill
- directivesSkill
- imageSkill
- inkSkill
- jotaiSkill
- mcpSkill
- nextSkill
- react-emailSkill
- react-nativeSkill
- react-pdfSkill
- reactSkill
- react-three-fiberSkill
- reduxSkill
- remotion-best-practicesSkill
- remotionSkill
- shadcnSkill
- shadcn-svelteSkill
- skill-creatorSkill
- solidSkill
- svelteSkill
- tanstack-startSkill
- vueSkill
- xstateSkill
- yamlSkill
- zustandSkill
The file
We split this skill into the rules it gives an agent
2 rules. 0 are common, 0 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 13 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 21
Run the Gateway evaluator server-side with { model: "typesafe-ai/jev", apiKey: process.env.AI_GATEWAY_API_KEY!
- Very specific: line 22
Call experimental_composeSpec({ catalog, candidates, prompt, evaluate, initialState, signal }).
“Common” is measured: kept by at least 6 in 10 of the 13 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
@json-render/core
Core package for schema definition, catalog creation, and spec streaming.
Key Concepts
- Schema: Defines the structure of specs and catalogs (use
defineSchema) - Catalog: Maps component/action names to their definitions (use
defineCatalog) - Spec: JSON output from AI that conforms to the schema
- SpecStream: JSONL streaming format for progressive spec building
Experimental Decision-Model Composition
For decision-model composition, import experimental_composeSpec and experimental_createEvaluator from @json-render/core. These APIs are unreleased; use a source build until published, then pin exact versions. Experimental exports and Experimental_ types can change in any release.
- Run the Gateway evaluator server-side with
{ model: "typesafe-ai/jev", apiKey: process.env.AI_GATEWAY_API_KEY! }. A plain model identifier is required; Jev is the current example; do not import a provider constructor. - Call
experimental_composeSpec({ catalog, candidates, prompt, evaluate, initialState, signal }). It is an async generator; streamstep.specsnapshots to your existing renderer and inspectcomplete.stopReason(finish,limit,unavailable). Errors and cancellation throw; retain the last snapshot as partial UI. - New trees default to
strategy: "batch": one evaluation selects root/membership, then a second arranges the selected elements when needed. The first snapshot contains selected content in catalog order under the root's default/first slot. Resource variants share one exclusive question; repeated counts include the root. Root selection takes precedence over conflicting speculative membership for that recipe/resource. Equal sibling positions retain catalog order. Combined layouts are validated before publication; cycles or excessive depth throw.maxElementscaps batched creation (default 32). Limit-truncated selections or a missing required layout call returnlimit. Usestrategy: "sequential"for legacynext/parentadapters or sequential creation. Edits stay sequential. - Batched trace steps use
choice: "select" | "layout"and ananswersrecord. Count each trace as one evaluation, including its tokens and latency once. Custom evaluators must answer every offered question; names/choices are opaque and includeroot/select_*, thenparent_*/order_*for batches. - For follow-up edits, pass the selected version as
initialSpec. It is cloned and validated; the evaluator may add, replace, remove non-root subtrees, or move/reorder them. Unchanged IDs, bindings, and state are preserved. OptionalelementDescriptionsshares identifying descriptions without exposing raw props/state.initialStateoverrides the seed state. Seeds must be valid trees within the catalog, expression subset, and depth limit. Matching recipes consume usage/resource limits; removals/replacements release them. Replacements/moves use two evaluations (select target, then recipe/destination), each counted against the budget. Treat operation and position keys as opaque. - Supply atomic candidates with
{ id, description, element: { type, props, on?, visible? }, root?, maxUses?, resource? }. Catalog alone is insufficient: the app must supply values and binding recipes. Jev chooses elements and parent slots, never free-form text or code. It never executes actions. - Candidates are configured component instances, not page templates. Build them from current app records/operations or bind props to
initialState; offer explicit alternatives for chart types, field configurations, and layout variants. The model chooses grouping and order within those options. Name required sections in prompts; structural validity does not imply semantic completeness. - V1 supports flat Spec catalogs, named slots, literals,
$state,$bindState, and state visibility. No prebuilt children, repeat/watch, computed/template/conditional props, or custom directives. Success/error callbacks must reference allowed actions. Events must be declared in the component catalog. - Props and action params are validated against initial state without applying schema transforms/defaults. Supply valid initial values and validate/authorize action calls at runtime. Built-ins without parameter schemas get name validation only.
rootdefaults true,maxUsesdefaults one, sharedresourcevalues make alternatives mutually exclusive. Defaults: 32 evaluations (terminal calls included; no extra finish call for batches), depth eight, 10-second Gateway timeout per call. Supply an overall abort signal.- Candidate descriptions, prompt, instructions, topology, and explicit
contextare sent to the evaluator. Initial state and raw props/binding values are not sent automatically. - For custom providers implement
Experimental_CompositionEvaluator: accept{ state, questions, signal }, return{ answers: { [question]: { choice, confidence? } }, usage?: { inputTokens? } }. Only return offered criteria keys.
See packages/core/README.md and /docs/jev for app integration and source-build instructions. The web playground is an example consumer, not a dependency of the API.
Defining a Schema
import { defineSchema } from "@json-render/core";
export const schema = defineSchema((s) => ({
spec: s.object({
// Define spec structure
}),
catalog: s.object({
components: s.map({
props: s.zod(),
description: s.string(),
}),
}),
}), {
promptTemplate: myPromptTemplate, // Optional custom AI prompt
});Creating a Catalog
import { defineCatalog } from "@json-render/core";
import { schema } from "./schema";
import { z } from "zod";
export const catalog = defineCatalog(schema, {
components: {
Button: {
props: z.object({
label: z.string(),
variant: z.enum(["primary", "secondary"]).nullable(),
}),
description: "Clickable button component",
},
},
});Generating AI Prompts
const systemPrompt = catalog.prompt(); // Uses schema's promptTemplate
const systemPrompt = catalog.prompt({ customRules: ["Rule 1", "Rule 2"] });SpecStream Utilities
For streaming AI responses (JSONL patches):
import { createSpecStreamCompiler } from "@json-render/core";
const compiler = createSpecStreamCompiler<MySpec>();
// Process streaming chunks
const { result, newPatches } = compiler.push(chunk);
// Get final result
const finalSpec = compiler.getResult();Form Values in Action Handlers
Use findFormValue("email", params, state) to read a direct parameter, a dotted parameter key (such as "form.email"), a matching flat state key, or a slash-delimited path (such as "/form/email") in nested state. Parameter values are literal, so emails and URLs containing dots are preserved. For action bindings that read nested state, use { $state: "/form/email" }; the resolver passes that value to the handler. A bare "email" field name does not search nested state.form.email.
Dynamic Prop Expressions
Any prop value can be a dynamic expression resolved at render time:
{ "$state": "/state/key" }- reads a value from the state model (one-way read){ "$bindState": "/path" }- two-way binding: reads from state and enables write-back. Use on the natural value prop (value, checked, pressed, etc.) of form components.{ "$bindItem": "field" }- two-way binding to a repeat item field. Use inside repeat scopes.{ "$cond": <condition>, "$then": <value>, "$else": <value> }- evaluates a visibility condition and picks a branch{ "$template": "Hello, ${/user/name}!" }- interpolates${/path}references with state values{ "$computed": "fnName", "args": { "key": <expression> } }- calls a registered function with resolved args
$cond uses the same syntax as visibility conditions ($state, eq, neq, not, arrays for AND). $then and $else can themselves be expressions (recursive).
Components do not use a statePath prop for two-way binding. Instead, use { "$bindState": "/path" } on the natural value prop (e.g. value, checked, pressed).
{
"color": {
"$cond": { "$state": "/activeTab", "eq": "home" },
"$then": "#007AFF",
"$else": "#8E8E93"
},
"label": { "$template": "Welcome, ${/user/name}!" },
"fullName": {
"$computed": "fullName",
"args": {
"first": { "$state": "/form/firstName" },
"last": { "$state": "/form/lastName" }
}
}
}import { resolvePropValue, resolveElementProps } from "@json-render/core";
const resolved = resolveElementProps(element.props, { stateModel: myState });State Watchers
Elements can declare a watch field (top-level, sibling of type/props/children) to trigger actions when state values change:
{
"type": "Select",
"props": { "value": { "$bindState": "/form/country" }, "options": ["US", "Canada"] },
"watch": {
"/form/country": { "action": "loadCities", "params": { "country": { "$state": "/form/country" } } }
},
"children": []
}Watchers only fire on value changes, not on initial render.
Validation
Built-in validation functions: required, email, url, numeric, minLength, maxLength, min, max, pattern, matches, equalTo, lessThan, greaterThan, requiredIf.
Cross-field validation uses $state expressions in args:
import { check } from "@json-render/core";
check.required("Field is required");
check.matches("/form/password", "Passwords must match");
check.lessThan("/form/endDate", "Must be before end date");
check.greaterThan("/form/startDate", "Must be after start date");
check.requiredIf("/form/enableNotifications", "Required when enabled");User Prompt Builder
Build structured user prompts with optional spec refinement and state context:
import { buildUserPrompt } from "@json-render/core";
// Fresh generation
buildUserPrompt({ prompt: "create a todo app" });
// Refinement with edit modes (default: patch-only)
buildUserPrompt({ prompt: "add a toggle", currentSpec: spec, editModes: ["patch", "merge"] });
// With runtime state
buildUserPrompt({ prompt: "show data", state: { todos: [] } });Available edit modes: "patch" (RFC 6902 JSON Patch), "merge" (RFC 7396 Merge Patch), "diff" (unified diff).
Spec Validation
Validate spec structure and auto-fix common issues:
import { validateSpec, autoFixSpec } from "@json-render/core";
const { valid, issues } = validateSpec(spec);
// issues include: missing_child, invalid_visible (malformed conditions),
// repeat_without_children, repeat_item_outside_scope, repeat_state_mismatch
const { spec: fixed, fixDetails } = autoFixSpec(spec);
// fixDetails entries are { message, lossy }. Lossless fixes relocate
// misplaced fields; lossy fixes prune dangling children references.
// In a repair loop, withhold lossy fixes until retries are exhausted:
const attempt = autoFixSpec(spec, { lossy: retriesExhausted });Visibility Conditions
Control element visibility with state-based conditions. VisibilityContext is { stateModel: StateModel }.
import { visibility } from "@json-render/core";
// Syntax
{ "$state": "/path" } // truthiness
{ "$state": "/path", "not": true } // falsy
{ "$state": "/path", "eq": value } // equality
[ cond1, cond2 ] // implicit AND
// Helpers
visibility.when("/path") // { $state: "/path" }
visibility.unless("/path") // { $state: "/path", not: true }
visibility.eq("/path", val) // { $state: "/path", eq: val }
visibility.and(cond1, cond2) // { $and: [cond1, cond2] }
visibility.or(cond1, cond2) // { $or: [cond1, cond2] }
visibility.always // true
visibility.never // falseBuilt-in Actions in Schema
Schemas can declare builtInActions -- actions that are always available at runtime and auto-injected into prompts:
const schema = defineSchema(builder, {
builtInActions: [
{ name: "setState", description: "Update a value in the state model" },
],
});These appear in prompts as [built-in] and don't require handlers in defineRegistry.
StateStore
The StateStore interface allows external state management libraries (Redux, Zustand, XState, etc.) to be plugged into json-render renderers. The createStateStore factory creates a simple in-memory implementation:
import { createStateStore, type StateStore } from "@json-render/core";
const store = createStateStore({ count: 0 });
store.get("/count"); // 0
store.set("/count", 1); // updates and notifies subscribers
store.update({ "/a": 1, "/b": 2 }); // batch update
store.subscribe(() => {
console.log(store.getSnapshot()); // { count: 1 }
});The StateStore interface: get(path), set(path, value), update(updates), getSnapshot(), subscribe(listener).
Key Exports
| Export | Purpose |
defineSchema | Create a new schema |
defineCatalog | Create a catalog from schema |
createStateStore | Create a framework-agnostic in-memory StateStore |
resolvePropValue | Resolve a single prop expression against data |
resolveElementProps | Resolve all prop expressions in an element |
buildUserPrompt | Build user prompts with refinement and state context |
buildEditUserPrompt | Build user prompt for editing existing specs |
buildEditInstructions | Generate prompt section for available edit modes |
isNonEmptySpec | Check if spec has root and at least one element |
deepMergeSpec | RFC 7396 deep merge (null deletes, arrays replace, objects recurse) |
diffToPatches | Generate RFC 6902 JSON Patch operations from object diff |
EditMode | Type: "patch" | "merge" | "diff" |
validateSpec | Validate spec structure |
autoFixSpec | Auto-fix common spec issues; classifies fixes lossy/lossless, { lossy: false } withholds pruning |
createSpecStreamCompiler | Stream JSONL patches into spec |
createJsonRenderTransform | TransformStream separating text from JSONL in mixed streams |
parseSpecStreamLine | Parse single JSONL line |
applySpecStreamPatch | Apply patch to object |
StateStore | Interface for plugging in external state management |
ComputedFunction | Function signature for $computed expressions |
check | TypeScript helpers for creating validation checks |
BuiltInAction | Type for built-in action definitions (name + description) |
ActionBinding | Action binding type (includes preventDefault field) |
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

