Notes
Artifact types
- Markdown: rendered note
- Known component:
ArtifactDemoPill - Unknown component: fallback inspector card
- Global:
window.personaArtifactDemo
How it works
Enable artifacts on the widget config:
The buttons here replay the exact artifact_start / artifact_delta / artifact_complete wire frames a real Runtype agent emits, streamed through controller.connectStream(...).
That is what makes the in-chat reference card appear and stream from "Generating…" to done with a Download button, while the side pane fills at the same time. A live agent produces the same frames.
Components must be registered via componentRegistry.register(name, renderer).
Display modes
Where artifact bodies render is controlled by features.artifacts.display:
Each mode names where the artifact body renders. panel (the default) shows the reference card in the transcript and auto-opens the side pane as the artifact streams. collapsed (formerly card, still accepted) shows only the card; the pane opens when you click it. inline renders the full artifact preview directly in the transcript, rendered markdown, sandboxed file iframes, or registry components, with no pane involved. The switcher in the rail applies the mode live via handle.update(config); it takes effect on the next streamed artifact.
Streaming body (inline)
When display: "inline", features.artifacts.inlineBody tunes how the body streams and settles:
A numeric height reserves a fixed, internally scrolled window for the streaming source and pins the completed iframe to the same height, so the streaming to complete swap causes no layout shift. "auto" grows with content instead. streamingView: "status" shows a quiet generating placeholder in place of the streaming code, and transition: "auto" cross-fades the completion swap where the View Transitions API is supported. These only affect display: "inline". The controls in the rail apply them live via handle.update(config), landing on the next streamed artifact.
Status loading animation
The streaming "Generating…" status animates on the reference card, the inline chrome, and the inline status body, and the text itself is replaceable via features.artifacts.statusLabel (a string, or a function receiving live stream context for dynamic labels). Configure the animation on features.artifacts:
The default is shimmer. Character-by-character modes (shimmer, shimmer-color, rainbow) stagger a per-character animation; pulse fades the whole status; none disables it. All modes honor prefers-reduced-motion. The controls in the rail update these values live via handle.update(config), so the running widget re-renders without losing the transcript.