Skip to content

feat: streaming generative UI with partial JSON parser#69

Merged
blove merged 13 commits into
mainfrom
claude/compassionate-lamarr
Apr 8, 2026
Merged

feat: streaming generative UI with partial JSON parser#69
blove merged 13 commits into
mainfrom
claude/compassionate-lamarr

Conversation

@blove
Copy link
Copy Markdown
Contributor

@blove blove commented Apr 8, 2026

Summary

  • New @cacheplane/partial-json library — tree-based streaming JSON parser that processes characters one at a time into a live parse tree with stable node identities, plus materialization with structural sharing (unchanged subtrees keep the same object reference)
  • Render lib memoizationRenderElementComponent.element() now uses Object.is equality so downstream computeds skip re-evaluation when the element reference is unchanged during streaming
  • Chat streaming infrastructureParseTreeStore bridges the parse tree to Angular Spec signals, ContentClassifier auto-detects content type (markdown vs json-render) from the token stream
  • Chat component integration — AI messages now route through the classifier: markdown renders as before, JSON-render specs render via <chat-generative-ui> with live streaming updates

Test plan

  • All 44 @cacheplane/partial-json tests pass (parser + materialization)
  • All render lib tests pass including memoization verification
  • All chat lib tests pass including classification integration (24 new tests)
  • Existing markdown-only messages render identically (fast path — no parser instantiated)
  • JSON spec messages auto-detect and render via <render-spec>

blove and others added 13 commits April 8, 2026 12:44
…es (#14)

Cockpit is an integrated developer reference surface for @cacheplane/stream-resource.
It embeds running Angular examples, shows syntax-highlighted source code, renders
tutorial documentation, and displays auto-generated API references for each capability.

Shared libraries:
- @cacheplane/design-tokens: colors, glass, gradient, glow, typography tokens
- @cacheplane/ui-react: GlassPanel, GlassButton, Callout, Steps, Tabs, Card, CodeGroup, NavLink
- @cacheplane/chat: Angular chat component library (cp-chat, cp-chat-message, cp-chat-input)

14 capability examples (Angular + Python + docs + e2e each):
- LangGraph: streaming, persistence, interrupts, memory, durable-execution, subgraphs, time-travel, deployment-runtime
- Deep Agents: planning, filesystem, subagents, memory, skills, sandboxes

Unified harness:
- Capability registry as single source of truth
- Serve orchestrator with --capability and --all modes
- Per-capability Nx serve targets
- CI build job for all Angular apps
- LangGraph deployment matrix for all 14 backends
- Smoke e2e test suite (28 tests: 14 UI render + 14 send/receive)

Light glassmorphism theme matching the website design with frosted glass panels,
warm-to-cool gradient backgrounds, and EB Garamond/Inter/JetBrains Mono typography.
- stream-resource.dev → cacheplane.ai
- cockpit.stream-resource.dev → cockpit.cacheplane.ai
- examples.stream-resource.dev → examples.cacheplane.ai
- Updated across all source code, CI workflows, docs, emails, templates
- 83 references migrated

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Design spec for auto-detecting and rendering generative UI content
(json-render, A2UI, markdown) in the chat component. Includes:
- Custom tree-based partial JSON parser library design
- Content classifier service with progressive detection
- Render lib element-level memoization for streaming efficiency
- ParseTreeStore bridge with structural sharing
- End-to-end spike plan for validation before implementation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
State-machine parser that processes JSON one character at a time, emitting
node-created/value-updated/node-completed events as the tree grows. Supports
strings, numbers, booleans, null, objects, arrays, escape sequences, unicode,
nested structures, stable node identities, and JSON Pointer path lookup.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
When the spec signal updates (e.g., from streaming tokens), unchanged
elements keep the same object reference via structural sharing. The
computed() equality check now uses Object.is so downstream computeds
(componentClass, visible, resolvedInputs) skip re-evaluation for
elements whose reference didn't change.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…tion

Bridges @cacheplane/partial-json parser with Angular signals, providing
incremental spec materialization with structural sharing and per-element
accumulation state tracking (hasType, hasProps, hasChildren, streaming).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Classifies incoming message content as markdown, json-render, or a2ui
based on first non-whitespace character. Internally creates a
ParseTreeStore for JSON content, computing deltas from full snapshots
and exposing spec/elementStates/streaming signals. Type can upgrade
(undetermined -> markdown/json-render) but never downgrade.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cacheplane Ready Ready Preview, Comment Apr 8, 2026 8:17pm

Request Review

@blove blove merged commit afdf44c into main Apr 8, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant