Compare commits

..
Author SHA1 Message Date
Chris Tate 22f33fc1be fixes 2026-02-13 17:49:39 -06:00
Chris Tate f70a3e7734 fixes 2026-02-13 17:46:45 -06:00
Chris Tate 8f11d980db fixes 2026-02-13 17:23:38 -06:00
Chris Tate 1b39312de2 fixes 2026-02-13 15:36:39 -06:00
Chris Tate 73f63f6210 fixes 2026-02-13 15:14:48 -06:00
Chris Tate 362a307e10 fixes 2026-02-13 15:03:28 -06:00
Chris Tate 9cf6069320 fixes 2026-02-13 14:54:03 -06:00
Chris Tate 9bf70b2678 fixes 2026-02-13 14:25:30 -06:00
Chris Tate 8110cd5490 fixes 2026-02-13 13:58:23 -06:00
Chris Tate 923b7b6c3d fixes 2026-02-13 13:49:28 -06:00
Chris Tate b7139e385c fixes 2026-02-13 13:16:29 -06:00
Chris Tate 3e47b054d1 fix lint 2026-02-13 13:05:31 -06:00
Chris Tate 6ca51f3293 fixes 2026-02-13 13:04:39 -06:00
Chris Tate fc454d4873 fixes 2026-02-13 12:51:27 -06:00
Chris Tate 1d331c9de2 fixes 2026-02-13 12:21:18 -06:00
Chris Tate 19c7452431 fixes 2026-02-13 12:02:54 -06:00
Chris Tate d3fb42f218 fixes 2026-02-13 11:33:01 -06:00
Chris Tate dcc147654f fixes 2026-02-13 11:26:21 -06:00
Chris Tate d99c378fae fixes 2026-02-13 11:17:49 -06:00
Chris Tate f48b2a0d05 fixes 2026-02-13 11:02:59 -06:00
Chris Tate 39468c18e5 fixes 2026-02-13 10:45:23 -06:00
Chris Tate 74d98e6172 fixes 2026-02-13 08:46:31 -06:00
Chris Tate 3cfae9ea0e fixes docs 2026-02-13 08:33:00 -06:00
Chris Tate 334ffa92c7 rename to chat 2026-02-13 08:19:06 -06:00
Chris Tate a27ab8d327 fixes 2026-02-13 08:15:17 -06:00
Chris Tate 406da8a701 fixes 2026-02-13 08:05:10 -06:00
Chris Tate ea53a3b116 tables 2026-02-13 07:51:59 -06:00
Chris Tate 3b2b6e5b19 fixes 2026-02-13 07:38:25 -06:00
Chris Tate 5620462f0c fixes 2026-02-13 00:33:33 -06:00
Chris Tate f973f0576a fixes 2026-02-13 00:13:39 -06:00
Chris Tate a9ef2831ce fixes 2026-02-12 23:58:11 -06:00
Chris Tate e0277c631f fixes 2026-02-12 23:40:48 -06:00
Chris Tate f6a7522754 fixes 2026-02-12 23:39:27 -06:00
Chris Tate ec1ad33687 fixes 2026-02-12 23:35:26 -06:00
Chris Tate 0a2cfcbf32 fixes 2026-02-12 23:31:35 -06:00
Chris Tate fd83ec189c fixes 2026-02-12 23:25:07 -06:00
Chris Tate 55710d9717 fixes 2026-02-12 23:23:32 -06:00
Chris Tate 4e17f4aa35 fixes 2026-02-12 23:15:55 -06:00
Chris Tate 048eb5e412 fixes 2026-02-12 23:04:30 -06:00
Chris Tate 08f50fbd52 fixes 2026-02-12 22:53:03 -06:00
Chris Tate b9edf0f537 fixes 2026-02-12 20:18:22 -06:00
Chris Tate c761b2b0ba fixes 2026-02-12 20:11:29 -06:00
Chris Tate f61afe3287 tools 2026-02-12 20:09:09 -06:00
Chris Tate b1cc53ff5c github 2026-02-12 20:02:23 -06:00
Chris Tate 2f210af7dc sortable 2026-02-12 18:39:19 -06:00
Chris Tate 0143297b6d fixes 2026-02-12 18:37:11 -06:00
Chris Tate 926299a2f1 data-spec 2026-02-12 18:08:15 -06:00
Chris Tate b42e740063 fixes 2026-02-12 17:48:56 -06:00
Chris Tate fd02356a5e fixes 2026-02-12 09:44:54 -06:00
Chris Tate 1c140e6ac2 fixes 2026-02-12 09:44:35 -06:00
Chris Tate 2f34bf2372 fixes 2026-02-12 09:42:42 -06:00
Chris Tate 8d7f740854 fixes 2026-02-12 09:40:30 -06:00
Chris Tate 023b01dfc2 fixes 2026-02-12 09:29:52 -06:00
Chris Tate dc81cabec5 fixes 2026-02-12 09:21:36 -06:00
Chris Tate b9f3f29729 fixes 2026-02-12 09:19:20 -06:00
Chris Tate 3214d95520 fixes 2026-02-12 09:15:05 -06:00
Chris Tate 2fbdbbbf14 fixes 2026-02-12 09:13:48 -06:00
Chris Tate a73267265e streamdown 2026-02-12 09:03:58 -06:00
Chris Tate 2b7a0fa686 fixes 2026-02-12 08:53:25 -06:00
Chris Tate 26f84b15c7 refactor 2026-02-12 08:46:34 -06:00
Chris Tate 651054aa5d fixes 2026-02-12 08:08:36 -06:00
Chris Tate 81704f2b33 move more to lib 2026-02-12 08:06:08 -06:00
Chris Tate cd0098cbfd chat 2026-02-12 01:28:00 -06:00
Chris Tate c0e8d8a390 ai sdk 2026-02-12 01:18:31 -06:00
12 changed files with 6 additions and 491 deletions
-140
View File
@@ -4,146 +4,6 @@ export const metadata = { title: "Changelog" }
Notable changes and updates to json-render.
## v0.6.0
February 2026
### New: Chat Mode (Inline GenUI)
json-render now supports two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets the AI respond conversationally with embedded UI specs, ideal for chatbots and copilot experiences.
```typescript
// Generate mode (default) — AI outputs only JSONL
const prompt = catalog.prompt();
// Chat mode — AI outputs text + JSONL inline
const chatPrompt = catalog.prompt({ mode: "chat" });
```
On the server, `pipeJsonRender()` separates text from JSONL patches in a mixed stream:
```typescript
import { pipeJsonRender } from "@json-render/core";
import { createUIMessageStream, createUIMessageStreamResponse } from "ai";
const stream = createUIMessageStream({
execute: async ({ writer }) => {
writer.merge(pipeJsonRender(result.toUIMessageStream()));
},
});
return createUIMessageStreamResponse({ stream });
```
On the client, `useJsonRenderMessage` extracts the spec and text from message parts:
```tsx
import { useJsonRenderMessage } from "@json-render/react";
function ChatMessage({ message }) {
const { spec, text, hasSpec } = useJsonRenderMessage(message.parts);
return (
<div>
{text && <Markdown>{text}</Markdown>}
{hasSpec && <Renderer spec={spec} registry={registry} />}
</div>
);
}
```
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state without custom `valuePath` props.
```json
{
"type": "Input",
"props": { "label": "Email", "value": { "$bindState": "/form/email" } }
}
```
```tsx
import { useBoundProp } from "@json-render/react";
Input: ({ props, bindings }) => {
const [value, setValue] = useBoundProp<string>(props.value, bindings?.value);
return <input value={value ?? ""} onChange={(e) => setValue(e.target.value)} />;
}
```
### New: Expression-Based Props and Visibility
All dynamic expressions now use structured `$state`, `$item`, and `$index` objects instead of string token rewriting. This is simpler, more explicit, and works for both props and visibility conditions.
**Props:**
```json
{ "title": { "$state": "/user/name" } }
{ "label": { "$item": "title" } }
{ "position": { "$index": true } }
```
**Visibility:**
```json
{ "$state": "/isAdmin" }
{ "$state": "/role", "eq": "admin" }
[{ "$state": "/isAdmin" }, { "$state": "/feature" }]
{ "$or": [{ "$state": "/roleA" }, { "$state": "/roleB" }] }
{ "$item": "isActive" }
{ "$index": true, "gt": 0 }
```
Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`.
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem`
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming inline UI generation.
### Improved: Renderer Performance
- `ElementRenderer` is now `React.memo`'d for better performance with repeat lists
- `emit` is always defined (never `undefined`)
- Repeat scope passes the actual item object, eliminating string token rewriting
### Improved: Utilities
- `applySpecPatch()` — typed wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### Breaking Changes
- `{ $path }` and `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }` in props
- Visibility: `{ path }` -> `{ $state }`, `{ and/or/not }` -> `{ $and/$or }` with `not` as operator flag
- `DynamicValue`: `{ path: string }` -> `{ $state: string }`
- `repeat.path` -> `repeat.statePath`
- Action params: `path` -> `statePath` in setState action
- `actionHandlers` -> `handlers` on `JSONUIProvider` / `ActionProvider`
- `AuthState` and `{ auth }` visibility conditions removed (model auth as regular state)
- Legacy catalog API removed: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`
- React exports removed: `createRendererFromCatalog`, `rewriteRepeatTokens`
- Codegen: `traverseTree` -> `traverseSpec`
See the [Migration Guide](/docs/migration) for detailed upgrade instructions.
---
## v0.5.0
February 2026
+1 -1
View File
@@ -2,7 +2,7 @@ export const metadata = { title: "Migration Guide" }
# Migration Guide
This guide covers breaking changes introduced in v0.6.0 and how to update your code.
This guide covers breaking changes introduced in v0.5.0 and how to update your code.
## State Provider
-70
View File
@@ -1,75 +1,5 @@
# @json-render/codegen
## 0.6.0
### Minor Changes
- 06b8745: Chat mode (inline GenUI), AI SDK integration, two-way binding, and expression-based visibility/props.
### New: Chat Mode (Inline GenUI)
Two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets AI respond conversationally with embedded UI specs — ideal for chatbots and copilot experiences.
- `catalog.prompt({ mode: "chat" })` generates a chat-aware system prompt
- `pipeJsonRender()` server-side transform separates text from JSONL patches in a mixed stream
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem` expressions
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state.
### New: Expression-Based Props and Visibility
Replaced string token rewriting with structured expression objects:
- Props: `{ $state: "/path" }`, `{ $item: "field" }`, `{ $index: true }`
- Visibility: `{ $state: "/path", eq: "value" }`, `{ $item: "active" }`, `{ $index: true, gt: 0 }`
- Logic: `{ $and: [...] }`, `{ $or: [...] }`, and implicit AND via arrays
- Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`
### New: Utilities
- `applySpecPatch()` — typed convenience wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat `{ root, elements }` format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming UI generation.
### Improved: Renderer
- `ElementRenderer` is now `React.memo`'d for better performance in repeat lists
- `emit` is always defined (never `undefined`) — no more optional chaining needed
- Action params are resolved through `resolveActionParam` supporting `$item`, `$index`, `$state`
- Repeat scope now passes the actual item object instead of requiring token rewriting
### Breaking Changes
- **Expressions renamed**: `{ $path }` / `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }`
- **Visibility conditions**: `{ path }` → `{ $state }`, `{ and/or/not }` → `{ $and/$or }` with `not` as operator flag
- **DynamicValue**: `{ path: string }` → `{ $state: string }`
- **Repeat field**: `repeat.path` → `repeat.statePath`
- **Action params**: `path` → `statePath` in setState action params
- **Provider props**: `actionHandlers` → `handlers` on `JSONUIProvider`/`ActionProvider`
- **Auth removed**: `AuthState` type and `{ auth }` visibility conditions removed — model auth as regular state
- **Legacy catalog removed**: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`, `ComponentDefinition`, `CatalogConfig`, `SystemPromptOptions` removed
- **React exports removed**: `createRendererFromCatalog`, `rewriteRepeatTokens`
- **Codegen**: `traverseTree` → `traverseSpec`, `SpecVisitor` → `TreeVisitor`
### Patch Changes
- Updated dependencies [06b8745]
- @json-render/core@0.6.0
## 0.5.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@json-render/codegen",
"version": "0.6.0",
"version": "0.5.2",
"license": "Apache-2.0",
"description": "Utilities for generating code from json-render UI trees",
"keywords": [
-65
View File
@@ -1,70 +1,5 @@
# @json-render/core
## 0.6.0
### Minor Changes
- 06b8745: Chat mode (inline GenUI), AI SDK integration, two-way binding, and expression-based visibility/props.
### New: Chat Mode (Inline GenUI)
Two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets AI respond conversationally with embedded UI specs — ideal for chatbots and copilot experiences.
- `catalog.prompt({ mode: "chat" })` generates a chat-aware system prompt
- `pipeJsonRender()` server-side transform separates text from JSONL patches in a mixed stream
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem` expressions
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state.
### New: Expression-Based Props and Visibility
Replaced string token rewriting with structured expression objects:
- Props: `{ $state: "/path" }`, `{ $item: "field" }`, `{ $index: true }`
- Visibility: `{ $state: "/path", eq: "value" }`, `{ $item: "active" }`, `{ $index: true, gt: 0 }`
- Logic: `{ $and: [...] }`, `{ $or: [...] }`, and implicit AND via arrays
- Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`
### New: Utilities
- `applySpecPatch()` — typed convenience wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat `{ root, elements }` format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming UI generation.
### Improved: Renderer
- `ElementRenderer` is now `React.memo`'d for better performance in repeat lists
- `emit` is always defined (never `undefined`) — no more optional chaining needed
- Action params are resolved through `resolveActionParam` supporting `$item`, `$index`, `$state`
- Repeat scope now passes the actual item object instead of requiring token rewriting
### Breaking Changes
- **Expressions renamed**: `{ $path }` / `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }`
- **Visibility conditions**: `{ path }` → `{ $state }`, `{ and/or/not }` → `{ $and/$or }` with `not` as operator flag
- **DynamicValue**: `{ path: string }` → `{ $state: string }`
- **Repeat field**: `repeat.path` → `repeat.statePath`
- **Action params**: `path` → `statePath` in setState action params
- **Provider props**: `actionHandlers` → `handlers` on `JSONUIProvider`/`ActionProvider`
- **Auth removed**: `AuthState` type and `{ auth }` visibility conditions removed — model auth as regular state
- **Legacy catalog removed**: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`, `ComponentDefinition`, `CatalogConfig`, `SystemPromptOptions` removed
- **React exports removed**: `createRendererFromCatalog`, `rewriteRepeatTokens`
- **Codegen**: `traverseTree` → `traverseSpec`, `SpecVisitor` → `TreeVisitor`
## 0.5.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@json-render/core",
"version": "0.6.0",
"version": "0.5.2",
"license": "Apache-2.0",
"description": "JSON becomes real things. Define your catalog, register your components, let AI generate.",
"keywords": [
-70
View File
@@ -1,75 +1,5 @@
# @json-render/react-native
## 0.6.0
### Minor Changes
- 06b8745: Chat mode (inline GenUI), AI SDK integration, two-way binding, and expression-based visibility/props.
### New: Chat Mode (Inline GenUI)
Two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets AI respond conversationally with embedded UI specs — ideal for chatbots and copilot experiences.
- `catalog.prompt({ mode: "chat" })` generates a chat-aware system prompt
- `pipeJsonRender()` server-side transform separates text from JSONL patches in a mixed stream
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem` expressions
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state.
### New: Expression-Based Props and Visibility
Replaced string token rewriting with structured expression objects:
- Props: `{ $state: "/path" }`, `{ $item: "field" }`, `{ $index: true }`
- Visibility: `{ $state: "/path", eq: "value" }`, `{ $item: "active" }`, `{ $index: true, gt: 0 }`
- Logic: `{ $and: [...] }`, `{ $or: [...] }`, and implicit AND via arrays
- Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`
### New: Utilities
- `applySpecPatch()` — typed convenience wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat `{ root, elements }` format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming UI generation.
### Improved: Renderer
- `ElementRenderer` is now `React.memo`'d for better performance in repeat lists
- `emit` is always defined (never `undefined`) — no more optional chaining needed
- Action params are resolved through `resolveActionParam` supporting `$item`, `$index`, `$state`
- Repeat scope now passes the actual item object instead of requiring token rewriting
### Breaking Changes
- **Expressions renamed**: `{ $path }` / `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }`
- **Visibility conditions**: `{ path }` → `{ $state }`, `{ and/or/not }` → `{ $and/$or }` with `not` as operator flag
- **DynamicValue**: `{ path: string }` → `{ $state: string }`
- **Repeat field**: `repeat.path` → `repeat.statePath`
- **Action params**: `path` → `statePath` in setState action params
- **Provider props**: `actionHandlers` → `handlers` on `JSONUIProvider`/`ActionProvider`
- **Auth removed**: `AuthState` type and `{ auth }` visibility conditions removed — model auth as regular state
- **Legacy catalog removed**: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`, `ComponentDefinition`, `CatalogConfig`, `SystemPromptOptions` removed
- **React exports removed**: `createRendererFromCatalog`, `rewriteRepeatTokens`
- **Codegen**: `traverseTree` → `traverseSpec`, `SpecVisitor` → `TreeVisitor`
### Patch Changes
- Updated dependencies [06b8745]
- @json-render/core@0.6.0
## 0.5.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@json-render/react-native",
"version": "0.6.0",
"version": "0.5.2",
"license": "Apache-2.0",
"description": "React Native renderer for @json-render/core. JSON becomes React Native components.",
"keywords": [
-70
View File
@@ -1,75 +1,5 @@
# @json-render/react
## 0.6.0
### Minor Changes
- 06b8745: Chat mode (inline GenUI), AI SDK integration, two-way binding, and expression-based visibility/props.
### New: Chat Mode (Inline GenUI)
Two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets AI respond conversationally with embedded UI specs — ideal for chatbots and copilot experiences.
- `catalog.prompt({ mode: "chat" })` generates a chat-aware system prompt
- `pipeJsonRender()` server-side transform separates text from JSONL patches in a mixed stream
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem` expressions
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state.
### New: Expression-Based Props and Visibility
Replaced string token rewriting with structured expression objects:
- Props: `{ $state: "/path" }`, `{ $item: "field" }`, `{ $index: true }`
- Visibility: `{ $state: "/path", eq: "value" }`, `{ $item: "active" }`, `{ $index: true, gt: 0 }`
- Logic: `{ $and: [...] }`, `{ $or: [...] }`, and implicit AND via arrays
- Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`
### New: Utilities
- `applySpecPatch()` — typed convenience wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat `{ root, elements }` format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming UI generation.
### Improved: Renderer
- `ElementRenderer` is now `React.memo`'d for better performance in repeat lists
- `emit` is always defined (never `undefined`) — no more optional chaining needed
- Action params are resolved through `resolveActionParam` supporting `$item`, `$index`, `$state`
- Repeat scope now passes the actual item object instead of requiring token rewriting
### Breaking Changes
- **Expressions renamed**: `{ $path }` / `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }`
- **Visibility conditions**: `{ path }` → `{ $state }`, `{ and/or/not }` → `{ $and/$or }` with `not` as operator flag
- **DynamicValue**: `{ path: string }` → `{ $state: string }`
- **Repeat field**: `repeat.path` → `repeat.statePath`
- **Action params**: `path` → `statePath` in setState action params
- **Provider props**: `actionHandlers` → `handlers` on `JSONUIProvider`/`ActionProvider`
- **Auth removed**: `AuthState` type and `{ auth }` visibility conditions removed — model auth as regular state
- **Legacy catalog removed**: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`, `ComponentDefinition`, `CatalogConfig`, `SystemPromptOptions` removed
- **React exports removed**: `createRendererFromCatalog`, `rewriteRepeatTokens`
- **Codegen**: `traverseTree` → `traverseSpec`, `SpecVisitor` → `TreeVisitor`
### Patch Changes
- Updated dependencies [06b8745]
- @json-render/core@0.6.0
## 0.5.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@json-render/react",
"version": "0.6.0",
"version": "0.5.2",
"license": "Apache-2.0",
"description": "React renderer for @json-render/core. JSON becomes React components.",
"keywords": [
-70
View File
@@ -1,75 +1,5 @@
# @json-render/remotion
## 0.6.0
### Minor Changes
- 06b8745: Chat mode (inline GenUI), AI SDK integration, two-way binding, and expression-based visibility/props.
### New: Chat Mode (Inline GenUI)
Two generation modes: **Generate** (JSONL-only, the default) and **Chat** (text + JSONL inline). Chat mode lets AI respond conversationally with embedded UI specs — ideal for chatbots and copilot experiences.
- `catalog.prompt({ mode: "chat" })` generates a chat-aware system prompt
- `pipeJsonRender()` server-side transform separates text from JSONL patches in a mixed stream
- `createJsonRenderTransform()` low-level TransformStream for custom pipelines
### New: AI SDK Integration
First-class Vercel AI SDK support with typed data parts and stream utilities.
- `SpecDataPart` type for `data-spec` stream parts (patch, flat, nested payloads)
- `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` constants for type-safe part filtering
- `createMixedStreamParser()` for parsing mixed text + JSONL streams
### New: React Chat Hooks
- `useChatUI()` — full chat hook with message history, streaming, and spec extraction
- `useJsonRenderMessage()` — extract spec + text from a message's parts array
- `buildSpecFromParts()` / `getTextFromParts()` — utilities for working with AI SDK message parts
- `useBoundProp()` — two-way binding hook for `$bindState` / `$bindItem` expressions
### New: Two-Way Binding
Props can now use `$bindState` and `$bindItem` expressions for two-way data binding. The renderer resolves bindings and passes a `bindings` map to components, enabling write-back to state.
### New: Expression-Based Props and Visibility
Replaced string token rewriting with structured expression objects:
- Props: `{ $state: "/path" }`, `{ $item: "field" }`, `{ $index: true }`
- Visibility: `{ $state: "/path", eq: "value" }`, `{ $item: "active" }`, `{ $index: true, gt: 0 }`
- Logic: `{ $and: [...] }`, `{ $or: [...] }`, and implicit AND via arrays
- Comparison operators: `eq`, `neq`, `gt`, `gte`, `lt`, `lte`, `not`
### New: Utilities
- `applySpecPatch()` — typed convenience wrapper for applying a single patch to a Spec
- `nestedToFlat()` — convert nested tree specs to flat `{ root, elements }` format
- `resolveBindings()` / `resolveActionParam()` — resolve binding paths and action params
### New: Chat Example
Full-featured chat example (`examples/chat`) with AI agent, tool calls (crypto, GitHub, Hacker News, weather, search), theme toggle, and streaming UI generation.
### Improved: Renderer
- `ElementRenderer` is now `React.memo`'d for better performance in repeat lists
- `emit` is always defined (never `undefined`) — no more optional chaining needed
- Action params are resolved through `resolveActionParam` supporting `$item`, `$index`, `$state`
- Repeat scope now passes the actual item object instead of requiring token rewriting
### Breaking Changes
- **Expressions renamed**: `{ $path }` / `{ path }` replaced by `{ $state }`, `{ $item }`, `{ $index }`
- **Visibility conditions**: `{ path }` → `{ $state }`, `{ and/or/not }` → `{ $and/$or }` with `not` as operator flag
- **DynamicValue**: `{ path: string }` → `{ $state: string }`
- **Repeat field**: `repeat.path` → `repeat.statePath`
- **Action params**: `path` → `statePath` in setState action params
- **Provider props**: `actionHandlers` → `handlers` on `JSONUIProvider`/`ActionProvider`
- **Auth removed**: `AuthState` type and `{ auth }` visibility conditions removed — model auth as regular state
- **Legacy catalog removed**: `createCatalog`, `generateCatalogPrompt`, `generateSystemPrompt`, `ComponentDefinition`, `CatalogConfig`, `SystemPromptOptions` removed
- **React exports removed**: `createRendererFromCatalog`, `rewriteRepeatTokens`
- **Codegen**: `traverseTree` → `traverseSpec`, `SpecVisitor` → `TreeVisitor`
### Patch Changes
- Updated dependencies [06b8745]
- @json-render/core@0.6.0
## 0.5.2
### Patch Changes
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@json-render/remotion",
"version": "0.6.0",
"version": "0.5.2",
"license": "Apache-2.0",
"description": "Remotion renderer for @json-render/core. JSON becomes video compositions.",
"keywords": [