Agent replay

Replays a recorded agent session: each call as the agent sent it and each result after its recorded latency, so the reader sees how agents use Loom.

Organism · stable · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)

Do and don't

Do: The replay

Rendered by replay.ts

Open example: Agent replay · Do: The replay Use the full-page example to follow page links.

Real server output.

Do: Paused by the reader

Rendered by replay.ts

Open example: Agent replay · Do: Paused by the reader Use the full-page example to follow page links.

Read at their own pace.

Don't: Called live

Rendered by replay.ts

Open example: Agent replay · Don't: Called live Use the full-page example to follow page links.

It is a recording.

Don't: Hiding the latency

Rendered by replay.ts

Open example: Agent replay · Don't: Hiding the latency Use the full-page example to follow page links.

The timing is part of the proof.

Rules

RuleWhyCheck
Agent replay is computed by Loom's code from a recorded session of a scripted agent against Loom's MCP server on Loom Base (data/mcp-demo.json), not drawn by hand.A showcase is proof only if the product's own code produced what it shows.Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift)
The caption says it is a recording of real output.Truthfulness about what ran and when.Automated: site-claims test (agent-replay claim)

API

PropTypeRequiredDefaultWhat it does
langen | jaNo"en"Root interface locale; changing it requires disposal and preparation. Existing source output and static explanatory copy remain English.
instanceKeystringNoOptional deterministic unique key for repeated static specimens; letter first, then letters, digits, underscore or hyphen, up to64 characters. Omit for the existing singleton anchors; duplicate explicit keys are unsupported.

Contract details

The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests

Identity

AspectValue
Idreplay
LayerOrganisms
Categoryshowcase
OwnerSite system lead
Statusstable
Version1.0.0
Sourceapps/showcase/site/system/organisms/replay.ts (private repository; the contract and the render function are this one module)
VersionDateChange
1.0.02026-10-26Agent replay: computed by Loom's code from a recorded session of a scripted agent against Loom's MCP server on Loom Base (data/mcp-demo.json).

Use when

  • Agents and MCP, Run, and its demo page. Why: Real server output shows the MCP server working.

Do not use when

  • To suggest a live model. Why: The agent is scripted; the replay is a recording.

Anatomy

PartWhat it is
rootdiv.demo-replay
copyThe honesty caption and note
terminalThe terminal with transcript turns
controlsPlay, pause and step

Made of: showcase-frame, code-block, playback-controls, caption.

Used in: pages directly.

Variants

VariantWhenWhy
fullOn its demo page and its section.The whole experience where the claim is made.

States

StateRendered or not applicable
defaultThe final, complete step (what readers without JavaScript see).
hoverIts controls show hover; the content does not change on hover.
focus-visibleEvery control shows the --focus ring.
activePlaying: the play control reads Pause and the steps advance.
disabledNot applicable: Controls are hidden, not disabled, when they cannot act.
loadingThe build-time specimen remains readable while its browser chunk loads. Managed bindings expose controls after validated initialization; unmanaged bindings retain their native startup behavior and unverified result.
emptyNot applicable: The data is part of the build; a showcase without data fails the build.
errorManaged bindings restore readable static content and hidden inert controls on caught chunk/initialization failure, then retry by remount. Unmanaged bindings catch chunk/throw failures, but a resolved initializer can mask internal data/DOM failure; its ready marker is not verified success. Unmanaged recovery requires a page reload. Enhancement failure is separate from business-data errors.
currentThe current step is named in words (aria-valuetext and the step label).
visitedNot applicable: Not a link.
expandedNot applicable: It does not open or close.

Tokens

PartToken
terminal.ground--term-bg
turn.loom--term-accent rule
ms.color--term-muted
--replay-margin-top-space-2var(--space-2)
--replay-gap-space-4var(--space-4)
--replay-font-type-labelvar(--type-label)
--replay-color-term-mutedvar(--term-muted)
--replay-padding-space-3var(--space-3)
--replay-padding-space-5var(--space-5)
--replay-color-term-accentvar(--term-accent)
--replay-background-term-fgvar(--term-fg)
--replay-border-radius-radiusvar(--radius)
--replay-color-ink-2var(--ink-2)
--replay-gap-space-3var(--space-3)
--replay-background-term-mutedvar(--term-muted)
--replay-font-size-fs-bodyvar(--fs-body)
--replay-background-term-accentvar(--term-accent)
--replay-border-left-term-accentvar(--term-accent)
--replay-margin-left-space-6var(--space-6)
--replay-background-term-bgvar(--term-bg)
--replay-color-term-fgvar(--term-fg)
--replay-border-on-dyevar(--on-dye)
--replay-border-field-inkvar(--field-ink)
--replay-gap-space-5var(--space-5)
--replay-padding-space-6var(--space-6)
--replay-border-bottom-term-fgvar(--term-fg)
--replay-border-term-mutedvar(--term-muted)
--replay-padding-space-2var(--space-2)
--replay-gap-space-6var(--space-6)
--replay-padding-space-7var(--space-7)
--replay-font-size-fs-smallvar(--fs-small)
--replay-gap-space-2var(--space-2)
--replay-padding-left-space-5var(--space-5)
--replay-min-block-size-space-10var(--space-10)
--replay-min-block-size-space-2var(--space-2)
--replay-border-top-inkvar(--ink)

Layout

AspectValue
breakpointsRequired review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px and controls fill the row on phones.
wrappingText wraps; code panes scroll inside their own focusable region.
textExpansionJapanese strings come from the i18n tables and wrap; engine output stays English.

Spacing and rhythm

AspectValue
internalInside the Showcase frame's padding, controls and caption at its foot.
externalFull width of its section.
rhythmOne showcase per section, after the section's claim (D-SITE-008).

Motion

AspectValue
movesTyping each call and revealing each result.
triggerPlay.
durationEach result after its recorded latency, shortened.
easingLinear typing.
interruptiblePause and step at any time.
reducedThe whole transcript shows at once.
whyLatency is part of the evidence: the server answers in milliseconds.

Runtime and reuse

  1. stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.

  2. stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.

  3. font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.

  4. data: /i18n/ja.json. Required for a Japanese root; English interface fallbacks are authored in source. Root language changes require disposal and fresh preparation.

  5. data: /data/mcp-demo.json. Required first-party native source data; fetch aborts with the mount and invalid consumed fields reject before DOM initialization.

  6. Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.

  7. Before DOM initialization the configured host awaits apps/showcase/site/demos/replay.ts#prepare for this root with a mount-owned AbortSignal. Preparation must throw on missing/invalid data; disposal/replacement aborts pending work, and a stale result cannot initialize or claim ready.

  8. Configured initializer: apps/showcase/site/demos/replay.ts#init. The host owns transactional static-markup restoration and runtime state.

  9. Consumer module (imports relative to the configured source root):
    import { createRuntimeHost } from "./src/workflows/runtime-host";
    import { SITE_RUNTIMES } from "./apps/showcase/site/runtime-registry";
    const definition = SITE_RUNTIMES.find(entry => entry.binding.id === "replay");
    if (!definition || definition.binding.lifecycle.kind !== "managed") throw new Error("Managed runtime binding unavailable");
    const host = createRuntimeHost([definition]);
    export function mountRuntime(container: ParentNode) { return host.mountAll(container); }
  10. After inserting the rendered markup, call mountRuntime(container) for the container holding [data-demo="replay"]. Retain the returned disposal function and call it before removing, replacing or remounting, including every Storybook args render. The configured host restores captured static markup/attributes on disposal or caught load/initialization failure; retry starts a fresh managed remount.

Accessibility passport

AspectValue
roleregion with a heading, or a figure
nameIts heading or caption
keyboardTab to the controls; Space plays or pauses; arrows move the steps; End shows the last step.
focusControls in reading order; focus never moves on its own.
screenReaderManual frame selection and pause announce their settled content. Explicit Play announces the final settled summary once; autoplay and system interruption/disposal stay silent. Legacy initializers outside the shared player remain explicitly unassessed.
contrastInk on surface 14:1; state dyes only as marks with words.
targetControls are 44 px.

Content

SlotLengthVoice
caption4 wordsRecording of real output

Good: “Recording of real output”

Bad: “Live agent”

Japanese: Server output is English; the note says so.

Icons and illustrations

None: this element uses no icon or illustration of its own.

Decisions and exceptions

Usage

470 uses across the built pages (measured by npm run site:system).

Tests

AspectValue
unittests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns
visualNot yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts
a11ytests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark
parityscripts/site/system/check.ts: Library examples are rendered by the same render function the site imports

Figma

not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.

Open in Storybook

Start with a conversation about your system.

We read your system, show you what we found, and agree with your team what to fix first.