@json-render/core 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -157,6 +157,14 @@ const spec = compileSpecStream<MySpec>(jsonlString);
|
|
|
157
157
|
| `defineSchema(builder, options?)` | Create a schema with spec/catalog structure |
|
|
158
158
|
| `SchemaBuilder` | Builder with `s.object()`, `s.array()`, `s.map()`, etc. |
|
|
159
159
|
|
|
160
|
+
Schema options:
|
|
161
|
+
|
|
162
|
+
| Option | Purpose |
|
|
163
|
+
|--------|---------|
|
|
164
|
+
| `promptTemplate` | Custom AI prompt generator |
|
|
165
|
+
| `defaultRules` | Default rules injected before custom rules in prompts |
|
|
166
|
+
| `builtInActions` | Actions always available at runtime, auto-injected into prompts (e.g. `setState`) |
|
|
167
|
+
|
|
160
168
|
### Catalog
|
|
161
169
|
|
|
162
170
|
| Export | Purpose |
|
|
@@ -196,12 +204,30 @@ const spec = compileSpecStream<MySpec>(jsonlString);
|
|
|
196
204
|
| `autoFixSpec(spec)` | Auto-fix common spec issues (returns corrected copy) |
|
|
197
205
|
| `formatSpecIssues(issues)` | Format validation issues as readable strings |
|
|
198
206
|
|
|
207
|
+
### Actions
|
|
208
|
+
|
|
209
|
+
| Export | Purpose |
|
|
210
|
+
|--------|---------|
|
|
211
|
+
| `ActionBinding` | Action binding with `action`, `params`, `confirm`, `preventDefault`, etc. |
|
|
212
|
+
| `BuiltInAction` | Built-in action definition with `name` and `description` |
|
|
213
|
+
|
|
214
|
+
### Chat Mode (Mixed Streams)
|
|
215
|
+
|
|
216
|
+
| Export | Purpose |
|
|
217
|
+
|--------|---------|
|
|
218
|
+
| `createJsonRenderTransform()` | TransformStream that separates text from JSONL patches in a mixed stream |
|
|
219
|
+
| `pipeJsonRender()` | Server-side helper to pipe a mixed stream through the transform |
|
|
220
|
+
| `SPEC_DATA_PART` / `SPEC_DATA_PART_TYPE` | Constants for filtering spec data parts |
|
|
221
|
+
|
|
222
|
+
The transform splits text blocks around spec data by emitting `text-end`/`text-start` pairs, ensuring the AI SDK creates separate text parts and preserving correct interleaving of prose and UI in `message.parts`.
|
|
223
|
+
|
|
199
224
|
### Types
|
|
200
225
|
|
|
201
226
|
| Export | Purpose |
|
|
202
227
|
|--------|---------|
|
|
203
228
|
| `Spec` | Base spec type |
|
|
204
229
|
| `Catalog` | Catalog type |
|
|
230
|
+
| `BuiltInAction` | Built-in action type (`name` + `description`) |
|
|
205
231
|
| `VisibilityCondition` | Visibility condition type (used by `$cond`) |
|
|
206
232
|
| `VisibilityContext` | Context for evaluating visibility and prop expressions |
|
|
207
233
|
| `SpecStreamLine` | Single patch operation |
|