Skip to content

Add native interactive answers in chat - #392

Closed
brsbl wants to merge 31 commits into
mainfrom
bb/bb-plugin-for-x-thr_e8stp72iet
Closed

brsbl wants to merge 31 commits into
mainfrom
bb/bb-plugin-for-x-thr_e8stp72iet

Conversation

@brsbl

@brsbl brsbl commented Oct 7, 2026 •

Copy link
Copy Markdown
Owner

Agents can answer inside bb messages with interactive interfaces: native calculators and charts, or sandboxed HTML answers such as illustrated assembly guides, maps with photos, and visual previews. Interacting updates the answer immediately, without another agent turn.

  • Native documents: sliders, choices, live metrics, charts, tables, and explanations from one agent tool, with bounded arithmetic and no code.
  • HTML answers: body markup with inline styles and scripts, rendered like inline-vis previews in a sandbox="allow-scripts" opaque-origin frame. The card sizes itself to its content, follows bb's light and dark theme tokens and Inter type, re-themes live when you switch themes, and opens web links in a new tab only after a click.
  • Fidelity guidance: the agent skill and guide give measured rules (anatomy, type scale and ink levels, spacing, illustration, motion, a 3D tier for rooms, products, and sites, and a render-and-check step) so a fresh agent produces finished-looking cards on the first try.
  • Working with the agent: answer state lives with the answer on the bb server, so inputs follow you across devices and open copies update live. Agents can read, follow, and drive an open answer with bb interactive-answers state, watch, actions, and do; the card shows "Agent · " whenever they act. An answer can also attach data to your next message as a pill (window.answer.send), such as a phrase recorded on a synth, and the agent receives it marked as untrusted data.

Validation

  • Remote CI on 342188e6a: see checks below.
  • Chrome for Testing through BB's Browser Automation plugin, isolated local bb dev web app with five example answers published through the real plugin CLI: each card's default and interaction states in light and dark at desktop and mobile widths, all captured below.
  • A held-out agent given only the new skill rebuilt the wall-color card and matched the launch layout; the same task with the previous wording produced a dashboard.

Screenshots

Before: 1edbb8e03 (merge base on main; the plugin does not exist, so the threads show the unrendered ::interactive-answer directive) · After: 342188e6a · Captured at 2× (desktop 2880×1800 for 1440×900 CSS). Mobile is 760×1646 for 390×844 CSS (1.95×): the sandboxed answer frame ignores device-scale emulation, so density comes from page zoom, and bb switches to its desktop layout above 768 device pixels. Same fixtures, routes, theme, and viewport in each pair.

Screen / state Viewport · theme Before After
Bike assembly / Default Desktop · 1440×900 · Light Before: Bike assembly, plugin absent, desktop light After: Bike assembly, default, desktop light
Bike assembly / Default Desktop · 1440×900 · Dark Before: Bike assembly, plugin absent, desktop dark After: Bike assembly, default, desktop dark
Bike assembly / Default Mobile · 390×844 · Light Before: Bike assembly, plugin absent, mobile light After: Bike assembly, default, mobile light
Bike assembly / Default Mobile · 390×844 · Dark Before: Bike assembly, plugin absent, mobile dark After: Bike assembly, default, mobile dark
Bike assembly / Exploded view Desktop · 1440×900 · Light Before: Bike assembly, plugin absent, desktop light After: Bike assembly, exploded view, desktop light
Bike assembly / Exploded view Desktop · 1440×900 · Dark Before: Bike assembly, plugin absent, desktop dark After: Bike assembly, exploded view, desktop dark
Bike assembly / Exploded view Mobile · 390×844 · Light Before: Bike assembly, plugin absent, mobile light After: Bike assembly, exploded view, mobile light
Bike assembly / Exploded view Mobile · 390×844 · Dark Before: Bike assembly, plugin absent, mobile dark After: Bike assembly, exploded view, mobile dark
San Francisco map / Default Desktop · 1440×900 · Light Before: San Francisco map, plugin absent, desktop light After: San Francisco map, default, desktop light
San Francisco map / Default Desktop · 1440×900 · Dark Before: San Francisco map, plugin absent, desktop dark After: San Francisco map, default, desktop dark
San Francisco map / Default Mobile · 390×844 · Light Before: San Francisco map, plugin absent, mobile light After: San Francisco map, default, mobile light
San Francisco map / Default Mobile · 390×844 · Dark Before: San Francisco map, plugin absent, mobile dark After: San Francisco map, default, mobile dark
San Francisco map / Haight-Ashbury selected Desktop · 1440×900 · Light Before: San Francisco map, plugin absent, desktop light After: San Francisco map, haight-ashbury selected, desktop light
San Francisco map / Haight-Ashbury selected Desktop · 1440×900 · Dark Before: San Francisco map, plugin absent, desktop dark After: San Francisco map, haight-ashbury selected, desktop dark
San Francisco map / Haight-Ashbury selected Mobile · 390×844 · Light Before: San Francisco map, plugin absent, mobile light After: San Francisco map, haight-ashbury selected, mobile light
San Francisco map / Haight-Ashbury selected Mobile · 390×844 · Dark Before: San Francisco map, plugin absent, mobile dark After: San Francisco map, haight-ashbury selected, mobile dark
Wall color preview / Default Desktop · 1440×900 · Light Before: Wall color preview, plugin absent, desktop light After: Wall color preview, default, desktop light
Wall color preview / Default Desktop · 1440×900 · Dark Before: Wall color preview, plugin absent, desktop dark After: Wall color preview, default, desktop dark
Wall color preview / Default Mobile · 390×844 · Light Before: Wall color preview, plugin absent, mobile light After: Wall color preview, default, mobile light
Wall color preview / Default Mobile · 390×844 · Dark Before: Wall color preview, plugin absent, mobile dark After: Wall color preview, default, mobile dark
Wall color preview / Eucalyptus selected Desktop · 1440×900 · Light Before: Wall color preview, plugin absent, desktop light After: Wall color preview, eucalyptus selected, desktop light
Wall color preview / Eucalyptus selected Desktop · 1440×900 · Dark Before: Wall color preview, plugin absent, desktop dark After: Wall color preview, eucalyptus selected, desktop dark
Wall color preview / Eucalyptus selected Mobile · 390×844 · Light Before: Wall color preview, plugin absent, mobile light After: Wall color preview, eucalyptus selected, mobile light
Wall color preview / Eucalyptus selected Mobile · 390×844 · Dark Before: Wall color preview, plugin absent, mobile dark After: Wall color preview, eucalyptus selected, mobile dark
3D wall color room / Default Desktop · 1440×900 · Light Before: 3D wall color room, plugin absent, desktop light After: 3D wall color room, default, desktop light
3D wall color room / Default Desktop · 1440×900 · Dark Before: 3D wall color room, plugin absent, desktop dark After: 3D wall color room, default, desktop dark
3D wall color room / Default Mobile · 390×844 · Light Before: 3D wall color room, plugin absent, mobile light After: 3D wall color room, default, mobile light
3D wall color room / Default Mobile · 390×844 · Dark Before: 3D wall color room, plugin absent, mobile dark After: 3D wall color room, default, mobile dark
3D wall color room / Eucalyptus at golden hour Desktop · 1440×900 · Light Before: 3D wall color room, plugin absent, desktop light After: 3D wall color room, eucalyptus at golden hour, desktop light
3D wall color room / Eucalyptus at golden hour Desktop · 1440×900 · Dark Before: 3D wall color room, plugin absent, desktop dark After: 3D wall color room, eucalyptus at golden hour, desktop dark
3D wall color room / Eucalyptus at golden hour Mobile · 390×844 · Light Before: 3D wall color room, plugin absent, mobile light After: 3D wall color room, eucalyptus at golden hour, mobile light
3D wall color room / Eucalyptus at golden hour Mobile · 390×844 · Dark Before: 3D wall color room, plugin absent, mobile dark After: 3D wall color room, eucalyptus at golden hour, mobile dark
Origami fox / Default Desktop · 1440×900 · Light Before: Origami fox, plugin absent, desktop light After: Origami fox, default, desktop light
Origami fox / Default Desktop · 1440×900 · Dark Before: Origami fox, plugin absent, desktop dark After: Origami fox, default, desktop dark
Origami fox / Default Mobile · 390×844 · Light Before: Origami fox, plugin absent, mobile light After: Origami fox, default, mobile light
Origami fox / Default Mobile · 390×844 · Dark Before: Origami fox, plugin absent, mobile dark After: Origami fox, default, mobile dark
Origami fox / Step 2 Desktop · 1440×900 · Light Before: Origami fox, plugin absent, desktop light After: Origami fox, step 2, desktop light
Origami fox / Step 2 Desktop · 1440×900 · Dark Before: Origami fox, plugin absent, desktop dark After: Origami fox, step 2, desktop dark
Origami fox / Step 2 Mobile · 390×844 · Light Before: Origami fox, plugin absent, mobile light After: Origami fox, step 2, mobile light
Origami fox / Step 2 Mobile · 390×844 · Dark Before: Origami fox, plugin absent, mobile dark After: Origami fox, step 2, mobile dark
Garden plan / Default Desktop · 1440×900 · Light Before: Garden plan, plugin absent, desktop light After: Garden plan, default, desktop light
Garden plan / Default Desktop · 1440×900 · Dark Before: Garden plan, plugin absent, desktop dark After: Garden plan, default, desktop dark
Garden plan / Default Mobile · 390×844 · Light Before: Garden plan, plugin absent, mobile light After: Garden plan, default, mobile light
Garden plan / Default Mobile · 390×844 · Dark Before: Garden plan, plugin absent, mobile dark After: Garden plan, default, mobile dark
Garden plan / Snap peas selected Desktop · 1440×900 · Light Before: Garden plan, plugin absent, desktop light After: Garden plan, snap peas selected, desktop light
Garden plan / Snap peas selected Desktop · 1440×900 · Dark Before: Garden plan, plugin absent, desktop dark After: Garden plan, snap peas selected, desktop dark
Garden plan / Snap peas selected Mobile · 390×844 · Light Before: Garden plan, plugin absent, mobile light After: Garden plan, snap peas selected, mobile light
Garden plan / Snap peas selected Mobile · 390×844 · Dark Before: Garden plan, plugin absent, mobile dark After: Garden plan, snap peas selected, mobile dark

Agent indicator

The tag that appears while an agent acts on an answer used to float over the card's bottom-right corner and cover its controls. It now sits on the card's top edge, in space the card reserves, with an outline around the whole card, and names what the agent did. Captured in the isolated dev app at 2×, synth answer, agent running preset "Big lead".

Before (a9106eaa1) After (70477277f)
Before: "Agent · preset" pill covers the Arpeggiate button After: "Agent · preset Big lead" tag on the card's top edge, card outlined

User QA and code review remain pending; this PR is a draft.

BB-Thread: Interactive Answers plugin

BB-Thread-ID: thr_e8stp72iet

🤖 Generated with Claude Code

brsbl and others added 28 commits October 7, 2026 15:53
Agents can now publish an HTML answer ({title, html, width}) alongside native
documents. It renders like bb's inline-vis previews, in a sandbox="allow-scripts"
opaque-origin frame, but chromeless inside a bb card that sizes itself to the
content. A shared kit supplies bb's theme tokens, Inter, a few controls, and a
window.answer bridge that saves state per answer and follows theme changes.

The five demos/ answers redraw the GPT-6 launch cards: bike assembly with an
exploded schematic, a MapLibre San Francisco route with photos, a wall-color
preview, a 12-step origami fox, and a container-garden plan. They replace the
low-fidelity diagram examples.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured our five cards against the GPT-6 launch frames and turned the gaps
into rules: card anatomy, a fixed type scale with three ink levels, spacing
and radii, visual-choice tiles, illustration and photo/map guidance, motion
timings, and a render-and-check step before publishing. The kit gains the
matching tokens (--ia-ink/body/meta, --ia-stage, --ia-hairline) and classes
(.ia-h, .ia-item-title, .ia-body, .ia-meta, .ia-stage, .ia-photos), pads
.ia-panel, and lets .ia-btn-primary stand alone. Cards get a 24px radius.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
demos/room-3d.html renders the wall-color preview as a Three.js scene inside
the sandboxed answer: CC0 Poly Haven furniture and textures, sun and window
light with soft shadows, GTAO, gentle bloom, a depth-of-field toggle, and
Afternoon/Golden/Blue/Night presets in frosted-glass controls. The skill and
guide now describe when to use 3D, the rendering and lighting recipe, asset
sources and their gotchas, a per-preset check list, and what cannot be matched
without scene-specific Blender assets.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Measured from the thread click, answer frames size in 0.2–0.4 s, but the
cards' own entrances ran 1.3–2.7 s (garden also waited up to 1.2 s for photos
before starting), and the 3D room hid behind a shimmer until all 49 assets
had downloaded (~1.6 s). The kit entrance is now 380 ms with a 45 ms stagger,
each demo's entrance sequence is roughly halved, garden starts without waiting
for photos, and the 3D room draws its shell on the first frame while
furniture and textures fade in as they arrive (ready at ~0.5 s). The skill
states the timing budget.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…e app

The bb mobile app wraps the web app in a WebView that only allows frame
navigations to the bb server, so srcdoc answers (about:srcdoc) were blocked
and stayed blank. HTML answers now load from GET /api/v1/plugins/
interactive-answers/http/frame, scoped to the thread. The response carries
Content-Security-Policy: sandbox allow-scripts, so the page keeps an opaque
origin even if the URL is opened directly. Saved state and theme travel in
the URL fragment, which never reaches the server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
iOS mutes Web Audio in silent mode. The frame bridge now wraps AudioContext so
starting audio (always from a tap) sets navigator.audioSession to playback, and
on older iOS starts a silent looping clip, which puts the page in a playback
session.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Answer state now lives on the bb server instead of each browser, so inputs
follow the user across devices, open copies update live, and the agent can
see them. New CLI commands: `state` (read or --set), `watch` (event log as
JSON lines, long-polls with --wait), `actions` (open copies and what they
expose), and `do` (run an action in the most recently used open copy and
print its result).

HTML answers get window.answer.onState, expose, and emit; native documents
expose `set` and `reset`. The card shows "Agent · <action>" whenever the
agent acts. State saved in this browser by earlier versions is carried over
once.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
window.answer.send(label, data), called from a click, saves the data with
the answer and attaches it to the user's next message as a composer pill.
A mention provider resolves the pill at send time, so the agent receives
the data together with what the user asked for. Instruments use it for
Record and Send to agent instead of watching for pauses.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Theme plugins change bb's palette by replacing a stylesheet rather than a
root attribute, so open HTML answers kept the old colors. Watch head style
changes and the color scheme too, and post a theme only when it changed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The fidelity rules live in the skill, so the plugin no longer ships example
answers. The 3D tier now describes lighting and structure for products and
sites as well as rooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The frame route always passed null state into the bridge, so remove that
parameter and the escaping and test that only guarded it. Drop the
browser-state migration from pre-release builds, unused exports and
defaults, and the orphaned footer style.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl

brsbl commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Superseded by get-bb/bb#5293, which ships Interactive Answers as a bundled bb plugin that is not installed by default (install from Plugins or bb plugin install interactive-answers). The demos and 3D assets stay here only.

AGENT GENERATED

Attachments a user sends from an answer were stored in the capped activity
log, so a pill could expire before its message was sent. Exclude them from
pruning.

The agent indicator floated over the bottom-right of the card and covered
controls. It is now a tag on the card's top edge, in space the card reserves,
with an outline around the whole card, and it names what the agent did, for
example "Agent · set people".

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl

brsbl commented Oct 9, 2026

Copy link
Copy Markdown
Owner Author

Closing as superseded by get-bb/bb#5293, which ships Interactive Answers as a bundled bb plugin and already includes everything from this branch (through 7047727). Per brsbl, it ships bundled-only, so there is no community marketplace listing.

@brsbl brsbl closed this Oct 9, 2026
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