suby
suby/json-render에서 master으로 푸시함
c9b6cdae5d feat(render): real Image src + Pressable, self-contained Lightbox & Modal
- Image: optional `src` renders a real <img> (object-cover), placeholder when absent
- Pressable: clickable container emitting a press event
- Lightbox: self-contained gallery + fullscreen overlay (own useState; prev/next/Esc/backdrop) — no setState action
- Modal: self-contained trigger button + centered popup rendering children (own useState; Esc/backdrop/x)
- catalog + playground rules steer generation toward Lightbox/Modal and real picsum images instead of broken Dialog+setState
Session-Id: 481d7b9c
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
e2d00faeaa Add harness-chat example (#302)
* Add harness-chat example: json-render as the UI for agent harnesses
A Claude Code agent runs in a Vercel Sandbox via AI SDK 7's experimental HarnessAgent and reports its work (steps, file changes, terminal output, test results) as a streamed json-render spec. Because HarnessAgent.stream() returns a standard StreamTextResult, the existing pipeJsonRender -> useJsonRenderMessage pipeline works unchanged.
The example pins matching AI SDK 7 canary packages so the harness adapter, React hooks, and Vercel sandbox transport resolve together.
* harness-chat: fix dev-runtime issues found in live run
- allowedDevOrigins for the portless proxy origin (Next 16 silently fails to hydrate on non-allowlisted cross-origin dev requests)
- serverExternalPackages for the harness adapter, which loads its sandbox bridge via new URL(..., import.meta.url) and cannot be bundled
- README: document CLI-login (TTY) vs OIDC sandbox auth paths
* harness-chat: agent picker, charts, and design polish
- Add a UI agent selector (Claude Code / Codex / Pi) with per-agent harness sessions and monochrome brand marks
- Add monochrome bar/line chart components to the catalog and registry
- Polish the chat shell: minimalist Geist/Geist-Mono design, tool-call icons + containers, inline-code shading, and a working text shimmer
* harness-chat: add mermaid diagrams to README
- Replace the ASCII data-flow sketch with a mermaid flowchart and a sequence diagram of a turn
- Update prose/setup to reflect the three-agent selector (Claude Code / Codex / Pi)
* Fix harness chat reset and signed charts
4e4dc46a37 Fix/autofix dangling children (#300)
* autoFixSpec prunes children references to undefined elements
Dangling references are the dominant remaining first-attempt validation
failure in benchmarks, and models frequently fail to repair them even given
the exact error (observed: three repair turns, same dangling footer each
time). The renderer already skips missing children at runtime, so pruning
yields the identical rendered output while letting the spec validate. Each
removal is reported in fixes.
* Classify autoFixSpec fixes as lossy or lossless
Pruning a dangling child reference changes what renders; relocating a
misplaced field does not. Callers with a repair loop need to tell these
apart: accept lossless fixes silently, prefer re-prompting over lossy fixes,
and keep the lossy-fixed spec as a last resort. Adds fixDetails alongside the
existing fixes strings (additive, no signature break).
* Validate visible conditions in validateSpec; document filtered-list pattern
Malformed visible conditions (e.g. mixing $state and $item in one object)
silently evaluate to hidden at runtime: evaluateCondition dispatches on the
first recognized key and non-strict parsing strips the rest, so whole regions
of UI disappear with a valid-looking spec. Benchmarked worst case: a kanban
board that rendered zero task cards.
- core: VisibilityConditionStrictSchema (strict objects, exported)
- core: validateSpec rejects malformed visible with a repairable message
listing the valid forms (code: invalid_visible)
- framework prompts: FILTERED LISTS rule showing the repeat + per-item
visible pattern models keep reaching for and inventing syntax around
* Support filtered lists: repeat + $item visible on the same element
Models across vendors consistently write {repeat, visible: {$item: ...}} on
one container to mean a filtered list (kanban columns, status sections).
Previously $item had no meaning outside the repeat scope, the condition
evaluated false, and the whole region silently disappeared — the worst
visual failures in benchmarks were boards rendering zero cards this way.
Outside a repeat scope that spelling was always broken, so claiming it is
backward compatible: the renderer now applies such a condition per item,
preserving original indices for item state paths. Container-level $state
conditions and per-child $item conditions behave as before.
- core: conditionUsesItemScope helper (exported)
- react: RepeatChildren filters items by the container's $item condition
- framework prompts: FILTERED LISTS rule teaches the container spelling
- react: repeat-filter test suite (filtering, no-filter, $state container
visibility, per-child $item)
Other framework renderers (vue, svelte, solid, react-native) still evaluate
the container condition outside scope and should adopt the same semantics.
* Validate repeat containers: require children and matching state arrays
Two silent empty-region failures seen repeatedly in benchmarks, both passing
validation today: a repeat element with no children (nothing to clone per
item) and a repeat statePath pointing at a missing or non-array state value.
Both now fail validateSpec with repairable messages (repeat_without_children,
repeat_state_mismatch). State checks only run when the spec provides state;
runtime-fed state is unaffected.
* Address review: lossy-aware hook repair, react-only filtered-list rule, reuse getByPath
- ink/react-native useUIStream repair loops no longer accept lossy autofixes
unconditionally: lossless relocations apply immediately, pruned content
holds back while retries remain (so validation fails and the model repairs
the missing elements) and applies only as a last resort.
- FILTERED LISTS prompt rule removed from schemas whose renderers do not
implement the per-item filter yet (everything except react). Renderer
parity tracked as follow-up.
- repeat_state_mismatch validation reuses getByPath instead of a local JSON
Pointer lookup that skipped ~0/~1 unescaping.
* Address review: split mixed repeat visibility, apply lossless fixes eagerly
- splitRepeatVisibility (core, exported): AND-composed conditions on a repeat
container partition into a container gate ($state conjuncts, hides the
shell) and a per-item filter ($item/$index conjuncts). Mixed $or cannot
partition soundly and stays fully per-item, documented.
- react renderer uses the split, so {$and: [{$state gate}, {$item filter}]}
hides the empty shell when the gate is false instead of rendering a husk.
- autoFixSpec gains { lossy?: boolean } (default true, additive): ink and
react-native repair loops now apply lossless relocations immediately and
withhold only the pruning until retries are exhausted, matching the stated
intent.
* Address review: RN final-validation error path, repeat prune guard, docs
- react-native useUIStream mirrors ink: when retries are exhausted and the
spec still fails validation, report through onError instead of silently
calling onComplete with an invalid spec.
- autoFixSpec never prunes a repeat container to zero children; that would
trade missing_child for repeat_without_children and leave the last-resort
spec unrenderable. The dangling template reference stays visible to repair.
- Docs for the new surface: core README + skill (validateSpec issue codes,
fixDetails, lossy option), react README + skill and web visibility docs
(filtered-list pattern, mixed-condition splitting, framework support note).
c731a9c607 Fix visible validation depending on consumer zod version (#299)
* Fix visible validation depending on consumer zod version; strengthen children prompt rule
catalog.validate() behavior changed under consumers' zod resolution: z.any()
object keys are optional on zod 4.3 but nonoptional on zod 4.4+, so a spec
omitting an element's visible field validates on 4.3 and fails on 4.4. The
core test suite (zod 4.3.6) asserts the optional behavior, so optional is the
intent; pin it explicitly with .optional() so all zod 4.x agree.
children stays required (long-standing, zod-version-independent contract;
relaxing it would change InferSpec types for consumers). Instead the default
prompt rules now state explicitly that every element must include a children
array, with [] for leaves, which benchmarking shows models otherwise omit on
roughly a third of first attempts.
- core: InferSpecObject honors SchemaType.optional at the type level (additive;
no schema used optional before)
- all framework schemas: visible marked ...s.optional()
- framework prompt defaultRules: REQUIRED FIELDS rule for children
- core: regression tests locking visible-optional and children-required
* Fix Next schema optional fields
91833e9225 Require pnpm release age and Node 24 (#293)
* Require pnpm release age and Node 24
- Set pnpm minimumReleaseAge to 2880 minutes and enforce engine checks.
- Pin the workspace to pnpm 11 and require Node 24+ via package metadata.
- Teach CI and release workflows to use the checked-in .node-version.
* Approve pnpm build scripts for CI
- Add the pnpm 11 build-script allowlist needed for frozen CI installs.
- Allow only the dependency install scripts already required by the current lockfile.
* Deny dependency build scripts
- Match the agent-browser pnpm 11 policy by explicitly denying known dependency build scripts.
- Keep minimumReleaseAge enforcement without approving postinstall script execution.
3 주 전