Skip to content

Add Playgrounds - #405

Merged
brsbl merged 28 commits into
bb/plugin-sdk-pin-thr_x6wkp5kcx3from
bb/playgrounds-thr_x6wkp5kcx3
Oct 12, 2026
Merged

brsbl merged 28 commits into
bb/plugin-sdk-pin-thr_x6wkp5kcx3from
bb/playgrounds-thr_x6wkp5kcx3

Conversation

@brsbl

@brsbl brsbl commented Oct 10, 2026 •

Copy link
Copy Markdown
Owner

What was wrong

Playgrounds (formerly Interactive Answers) was being added to bb as a bundled plugin (get-bb/bb #5293, #5314). It won't ship with bb; it belongs in this repo as a regular plugin people install themselves.

What changed

Adds plugins/playgrounds (plugin id playgrounds), with everything from #5293/#5314 except bb-core registration:

  • Playgrounds: native and sandboxed HTML playgrounds with live shared inputs. Agents read and drive them with state/watch/actions/do, and script output is wrapped as untrusted data.
  • Security: a strict frame CSP with no network access. Links and composer pills work only right after a click inside the playground.
  • Forks and side chats: a fork gets its own copy, with each playground's content stored once. Side chats share their thread's playground.
  • Review fixes from #5314: rate limits, command routing to the copy that offers the action, and latest-first watch.
  • Names: tool playground, CLI bb playgrounds, directive ::playground{id}, skill playgrounds.
  • SDK pin: pins plugin SDK 0.6.37 in vendor/, using the mechanism from Let a plugin pin its own plugin SDK #415. zod 4.6.5 is nested under the plugin, so other plugins build identically. Requires bb 0.46 or newer.
  • Frame URL: the prefix comes from a server RPC (bb.pluginId), because the shared builder doesn't export experimental_usePluginId.
  • Credit: OpenAI's Intelligent UI in the README and overview.
  • Interactive Answers cards keep working: cards saved before the rename call window.answer and use --ia-* tokens and .ia-* classes. The frame aliases window.answer and serves the same kit under the old names when a card uses them. The original Pocket synth renders unchanged.
  • Native number fields: units such as GB no longer break across two lines.
  • Install: bb plugin install git:https://github.com/brsbl/bb-plugins.git@plugin/playgrounds --yes. The README tells users of the old Interactive Answers copy to uninstall it first.

The private library and the Anatomy authoring skill are later layers of this stack.

How you verified

  • Remote CI on this branch.
  • bb dev app (get-bb/bb main), with this branch's plugin installed from source, in headless Chrome for Testing at 1440×900, 2×:
    • Real Codex threads published native and HTML playgrounds.
    • Inputs recalculated and persisted.
    • The HTML frame loaded from the server-provided prefix.
    • This head shows no Save control and no library page.
  • Earlier QA in get-bb/bb, on the same plugin code: fork copies stayed independent, deleting the original left the fork intact, side chats shared their thread's playground, and the CSP blocked outside requests.
  • Evals at 7bc8d6aa7 (dev app, Codex 6-Astra Medium, each thread in a clean workspace):
    • Single prompts, each run twice: savings, bill split, phone plans, bike-tire guide, paint preview. Every run read the guide and published a card.
    • Live state: after I changed an input in the card, the agent read the new value.
    • Collab controls: a drum machine where the agent added a hi-hat through do; tic-tac-toe where the agent answered my move with do play; a synth the agent played after I enabled sound.
  • Slop Cop:
    • Three reviews on get-bb/bb found P1s, all fixed with regression tests.
    • A further review on the copy-on-fork and rename scope found no P0 or P1.
    • The review of the bb-plugins port at d11ab1dc7 found no P0 or P1.

Screenshot

New plugin, so there is no before state.

State Screenshot
A playground in a thread, this head A bill-splitter playground rendering in a bb thread

Follow-ups (P2, not in this PR)

  • Frame URL failure: if the frame-URL RPC fails once, a mounted HTML card stays blank instead of retrying.
  • zod pin: declare zod ^4.6.5 so the nested copy can't be re-hoisted.
  • Release provenance: it would record the shared SDK if Playgrounds gets versioned releases.

BB-Thread: Interactive Answers as a built-in plugin

AGENT GENERATED

🤖 Generated with Claude Code

brsbl and others added 2 commits October 10, 2026 07:56
Vendor @get-bb/plugin-sdk 0.6.37 from the npm registry and bundle
packages/plugin-build from get-bb/bb 4c87fdec7b (the commit that published
SDK 0.6.37, bb-app 0.46.0) as bb plugin build 0.46.0. Rebuild the tracked
plugin artifacts, regenerate the lockfile, and run the persisted-scaffold
compatibility job against bb 0.46.0.

Bump the marketplace plugins whose release bundles change with the new
builder, since published version tags never move: Ambient 0.1.13, Context
Katamari 0.1.6, Thread Organizer 0.1.15.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Ports Playgrounds from get-bb/bb #5293/#5314 as a regular plugin (id
playgrounds): native and sandboxed HTML playgrounds with shared live state,
agent read/drive commands, a strict frame CSP, copy-on-fork with content
stored once, and side chats sharing their thread's playground.

Adds a private library: Save to library under any playground keeps it with
its inputs; the Playgrounds page reopens, renames, and removes saved
playgrounds; publish --saved and an @-mention provider bring one back into a
thread. Nothing is shared between users.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl added this pull request to stack #406 October 10, 2026 15:03
brsbl and others added 5 commits October 10, 2026 08:04
The repo-wide SDK 0.6.37 upgrade (reverted above) broke the types of 13
plugins that use composer APIs SDK 0.6 no longer exports. Keep every other
plugin on the shared SDK 0.5.9 and bb plugin build 0.43.4, and let a plugin
pin its own SDK: vendor/get-bb-plugin-sdk-<version>.tgz plus
vendor/sdk-provenance.json. check-repository verifies the pinned archive's
digest and the plugin's SDK floor against its own pin, and artifact
validation checks the floor the same way.

Playgrounds gets its frame URL prefix from the server (bb.pluginId) instead
of experimental_usePluginId, which the shared builder's runtime shim does not
export, and needs bb 0.46 or newer.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl removed this pull request from stack #406 October 10, 2026 16:08
@brsbl
brsbl changed the base branch from bb/sdk-0.6.37-thr_x6wkp5kcx3 to main October 10, 2026 16:08
brsbl and others added 3 commits October 10, 2026 09:12
SDK 0.6.37 needs zod 4.6, which npm hoisted over the repository's zod 4.4.3
and changed other plugins' committed bundles. Nest zod 4.6.5 under
Playgrounds so every other plugin keeps building identically. Include docs/
in the package files so the catalog screenshots ship.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl brsbl changed the title Add Playgrounds with a private library Add Playgrounds with a private library and Anatomy lessons Oct 10, 2026
@brsbl brsbl changed the title Add Playgrounds with a private library and Anatomy lessons Add Playgrounds with a private library and Anatomy design instruments Oct 10, 2026
brsbl and others added 3 commits October 10, 2026 11:21
Playgrounds stands on its own; the Anatomy authoring skill, drawing kit, and
explainers return in the next layer of the stack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
brsbl and others added 2 commits October 10, 2026 12:21
Playgrounds stands on its own; Save to library, the Playgrounds page,
publish --saved, the saved-playground mention, and their tests and docs
return in the next layer of the stack.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl removed this pull request from stack #414 October 10, 2026 19:29
@brsbl
brsbl changed the base branch from main to bb/plugin-sdk-pin-thr_x6wkp5kcx3 October 10, 2026 19:30
@brsbl
brsbl added this pull request to stack #417 October 10, 2026 19:30
@brsbl brsbl changed the title Add Playgrounds with a private library and Anatomy design instruments Add Playgrounds Oct 10, 2026
brsbl and others added 5 commits October 10, 2026 12:42
The card design guidelines move into the authoring-skills layer, where they
join Anatomy as one authoring system.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Input saves wait up to 300 ms (plus 100 ms for HTML frames), so reloading
right after an edit dropped it. On pagehide, flush the frame's batched state
and send any pending save as a keepalive request to the plugin's RPC route.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…its wrapping

Cards saved before the rename call window.answer and use --ia-* tokens and .ia-*
classes. The frame now aliases window.answer to window.playground and, when a
card names the old kit, includes the same kit under those names. Native number
fields no longer break a unit such as GB across two lines.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@brsbl
brsbl marked this pull request as ready for review October 12, 2026 21:32
@brsbl
brsbl merged commit f54c123 into main Oct 12, 2026
36 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