Skip to content

Plugin Guide v1: in-app plugin API docs with SDK-synced surface map - #2248

Open
brsbl wants to merge 40 commits into
mainfrom
bb/build-bb-plugin-api-docs-thr_7dczktandc
Open

Plugin Guide v1: in-app plugin API docs with SDK-synced surface map#2248
brsbl wants to merge 40 commits into
mainfrom
bb/build-bb-plugin-api-docs-thr_7dczktandc

Conversation

@brsbl

@brsbl brsbl commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

What was wrong

bb's public Plugin SDK was discoverable only through declarations and scattered implementation details. Plugin authors had no product-native map of extension points, no compact way to hand one of those surfaces to an agent, and no enforced maintenance path when the public SDK changed.

What changed

  • Adds the built-in bb Plugin Guide (plugins/plugin-api-docs) backed by the shared packages/plugin-api-map package.
  • Documents each plugin surface with an annotated, interactive bb UI model, capability card, authoritative SDK symbols, cross-references, and first-party usage.
  • Gives command-palette actions their own page. The app-window page is larger and less cramped; its timeline and loading skeleton share taller, looser geometry.
  • Makes annotations sequential on every page and adds Previous/Next controls to each open card.
  • Makes app-window annotations 9, 10, and 11 behave like the entry points they describe: a thread-panel tab, a real retry-notes.md custom-viewer tab, and a realistic custom Diff tab. Their badges occupy a reserved upper lane and do not clip or cover the tabs.
  • Shows the message-action hover row and its selection-toolbar state, including a distinct Stripe mock selection. Moves the composer typeahead fixture just enough to clear its annotations.
  • Adds compact Copy for agent actions. Each card writes one structured, plugin-owned surface reference using bb's existing private clipboard/composer-mention contract; multiple copied references paste as distinct, composable pills.
  • Adds a committed public-SDK inventory plus api-sync.test.ts, so CI fails when a public plugin export, app.slots.* method, or BbPluginApi property changes without a corresponding Guide surface.
  • Ships the plugin-guide-maintenance skill with the plugin. It covers identifying SDK drift, updating the surface card and minimal agent pointers, regenerating the inventory, running focused tests/typechecks, building, and real-UI verification.
  • Keeps compatibility aligned with main: @get-bb/plugin-sdk, PLUGIN_SDK_VERSION, and the Guide bundle are all 0.4.17; the Guide engine floor remains capability-based at >=0.4.3. This PR adds neither a public Plugin API nor a compatibility-version bump. The proposed experimental_pluginCustomizations and experimental_copyMention APIs are not present.
  • Contains no Inspector or Moss changes and no host-daemon protocol change.

How you verified

Final pushed candidate: c83b3264ba8c623eef04a4443aef05e103ace4b1; current main / merge base: 42d2c1bec2e9830bd8e2b8f5f355ebffda37bded.

  • Plugin Guide/API-map tests — 52/52 PASS.
  • Focused app clipboard/composer tests — 137/137 PASS.
  • Server plugin/compatibility tests on Node 22 — 29/29 PASS, including the persisted 0.4.8 scaffold upgrade regression against 0.4.17.
  • Turbo typechecks — PASS for @bb/plugin-api-map, bb-plugin-plugin-api-docs, @bb/app, and @get-bb/plugin-sdk.
  • Production Plugin Guide build/reload — PASS; live bundle metadata reports SDK 0.4.17 and a compatible engine floor.
  • git diff --check origin/main...HEAD — PASS. No Inspector/Moss paths; no experimental_pluginCustomizations, experimental_copyMention, or 0.4.18 references.
  • Exact-head Google Chrome for Testing 151.0.7922.71 — PASS: 9/10/11 each have a measured 4px target gap; file and diff bodies render; all 13 app-window annotations advance in order; the command-palette page renders; two card references paste into bb's real new-thread composer as distinct pills.
  • Exact-head Safari 26.5.2 — PASS: hard reload, horizontally panned wide app mockup, 9/10/11 geometry and tab bodies, all 13 annotation transitions, client navigation to the settled command-palette page, and keyboard activation of Copy for agent.
  • Exact-head CI — PASS: CI run and version/SDK gates.
  • No additional code review was run: the PR's one allowed review budget is exhausted.

Structured Chrome evidence · Structured Safari evidence

Before and exact-head after

Before — prior candidate: annotation badges cover the right-panel entry points

Before: right-panel annotation badges obscure their entry points

After — exact final candidate: annotations 9, 10, and 11 sit above clear, realistic tabs

After: exact-head app tabs

Exact-head custom file viewer

Exact-head retry-notes.md custom viewer

Exact-head custom diff renderer

Exact-head realistic custom diff

Exact-head command-palette page

Exact-head command palette page

Exact-head composed composer references

Two distinct Plugin Guide surface pills

No linked issue.

BB-Thread-ID: thr_7dczktandc

BB-Thread-ID: thr_7f4g7pd89a

AGENT GENERATED: by GPT-5.6-Sol

brsbl and others added 28 commits August 19, 2026 02:38
Documents the bb plugin API as an annotated map of the product plus the
generated reference behind it.

- apps/web/scripts/generate-plugin-api-docs.mjs parses the SDK's committed
  bundled declarations into a committed model; --check fails when stale.
- packages/plugin-api-map holds the surface inventory, the bb UI skeletons,
  and the annotation cards, shared so the docs page and the in-app plugin
  cannot disagree about what bb can be extended with.
- plugins/plugin-api-docs renders that map inside bb as a nav panel, with the
  host's real composer embedded in the composer and home diagrams.
- The docs page leads with the reference; the diagram sits below it as a
  supporting explainer.
- An anatomy manifest pins the skeletons to the real app component order, and
  apps/app's docs-anatomy-manifest test fails when the app reorders.
- apps/web route changes animate through the View Transition API, content
  only, with reduced motion falling back to an instant swap.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
These changes were already uncommitted in this worktree when the plugin API
docs work began and are unrelated to it: blog rendering, landing analytics
and endpoints, connect/auth routes, server token handling, and small web UI
primitive tweaks. Committed separately so they can be reviewed or dropped on
their own.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
The bb Plugin Guide (plugins/plugin-api-docs, rendering
packages/plugin-api-map) becomes bb's only plugin API documentation:
six slides — annotated skeletons of the app window, composer, home,
settings, and Extensions plugin pages, plus a backend capability grid —
with a reviewed card per surface, cross-references, and "Used by" links.
packages/plugin-api-map/test/api-sync.test.ts fails the build when the
map and the SDK drift apart; the apps/web docs route, generated API
model, and generator are deleted in its favor.

Host and SDK changes the guide rides on, all additive:
- experimental_suppressPluginUi on experimental_NewThreadComposer,
  plumbed through the new-thread prompt box path, so an embedded
  composer can render without other plugins' composer UI (a prompt
  improver's action was landing inside the diagrams and rewriting the
  persisted example draft).
- Route anchors inside plugin UI navigate client-side; links to a
  plugin's Extensions page open it beside the current pane.
- New plugin-detail pane kind so a plugin's Extensions page can live in
  a split; ordinary navigation to it stays full-window.
- Plugin CSS is awaited before registrations publish, removing the
  unstyled first-paint flash on plugin load and reload.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…-ready-thr_kg7xb7qipg

# Conflicts:
#	apps/web/src/styles.css
…l-fixes-thr_7f4g7pd89a

# Conflicts:
#	apps/app/package.json
#	pnpm-lock.yaml
brsbl added a commit that referenced this pull request Aug 24, 2026
brsbl added a commit that referenced this pull request Aug 24, 2026
brsbl added a commit that referenced this pull request Aug 24, 2026
brsbl added a commit that referenced this pull request Aug 25, 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