Skip to content

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

Open
brsbl wants to merge 53 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 53 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 full-flow page: a selected plugin command sits over a dimmed realistic thread, ⇧⌘P remains visible as a replayable entry point, and running the action closes the palette and opens the plugin's selected Release checklist side-panel tab. The action row and numbered annotation remain distinct click targets. 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 compact Previous/Next controls to each open card's header.
  • 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.
  • Keeps the app-window fixture and every open annotation card above the fold in bb’s 980px desktop content region. On taller displays, the fixture’s blank-canvas minimum grows one-for-one from 500px to 650px and the timeline from 350px to 510px, then caps; width alone never triggers growth. Off-stage carousel pages no longer create page-level horizontal overflow, and a fitting desktop fixture no longer gets an unnecessary internal horizontal scrollbar; narrow fixtures still scroll together with their annotations.
  • Adds compact Copy for agent actions. Each card writes one short, editable sentence around a structured, plugin-owned surface reference using bb's existing private clipboard/composer-mention contract; multiple copied references paste as distinct, composable pills and complete sentences.
  • 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 current main: @get-bb/plugin-sdk and PLUGIN_SDK_VERSION are 0.4.18, advanced by Handle reserved plugin CLI name collisions #2411 for corrected CLI-collision JSDoc. This PR's cumulative diff adds no public Plugin API member and no compatibility-version bump; the Guide engine floor remains capability-based at >=0.4.3. 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: bd991315a73abd9cc5fb31bdb19e81b7f72d9f91; current main / merge base: ca0f85c44859a34f85840824de3ea9ffbccbcec8.

  • Plugin Guide/API-map tests — 72/72 PASS, including deterministic fixture fidelity, responsive ownership, annotation rules, command-palette interaction, API inventory drift, reference creation, clipboard framing, and multiple distinct pills.
  • Focused app tests — 50/50 PASS for UI-anatomy drift, structured mention clipboard serialization/paste, clipboard helpers, and plugin frontend reload behavior.
  • Server plugin/compatibility tests on Node 22 — 29/29 PASS, including a real persisted 0.4.8 scaffold upgrading under current 0.4.18.
  • Turbo typechecks — PASS for @bb/plugin-api-map, bb-plugin-plugin-api-docs, @bb/app, @bb/server, and @get-bb/plugin-sdk.
  • Frozen workspace install and production Plugin Guide build — PASS. The exact-branch web bundle reports SDK 0.4.18; the Nightly path build remains compatible with its shipped SDK 0.4.8.
  • git diff --check origin/main...HEAD — PASS. The cumulative diff contains no packages/plugin-sdk or SDK-version-source files, no Inspector/Moss paths, and no rejected experimental API identifiers.
  • Exact-head Google Chrome for Testing 151.0.7922.71 — PASS across all seven Guide pages at 390×844, 768×900, 1440×900, and 3440×1440, adjacent transition widths, and five complete page cycles. App-window height checkpoints pass at 2048×1028 (500px minimum), 2048×1100 (572px), 2048×1188 (650px cap), and 3440×1440 (cap retained); all 13 cards remain above the fold with zero page overflow at the compact reference.
  • Exact-head Safari 26.5.2 — PASS across all seven Guide pages at actual CSS viewports 2048×1028, 1440×948, 768×848, and 2048×1440 through first paint, hard reload, and five complete page cycles. The 572px intermediate minimum and 650px cap match Chrome, with the open card fully visible and zero page overflow.
  • Exact-head CI — 13 checks succeeded with two expected skips in CI, Mobile E2E, and both version/SDK gates.
  • No additional code review was run: the PR's one allowed review budget is exhausted. GitHub has no reviews, comments, or unresolved review threads.

Exact-head fluid Chrome evidence · Exact-head fluid Safari evidence

Before and exact-head after

Before — prior PR head 19ab9339bbd38cda4343620a4124c9ee0ac0ec1c: the app-window page overflows horizontally and vertically at the same 2048×1028 viewport

Before: app-window page with unnecessary overflow and clipped card

After — exact final candidate bd991315a73abd9cc5fb31bdb19e81b7f72d9f91: the compact reference still fits above the fold with no page overflow

After: exact-head compact app-window page

On a taller display — the fixture restores its roomy original size and stops at the cap

After: exact-head full-size capped app-window page

Safari 26.5.2 — the same exact-head full-size cap

Safari: exact-head full-size capped app-window page

Earlier feature evidence

These flows were captured at prior frozen candidate 19ab9339bbd38cda4343620a4124c9ee0ac0ec1c; the final viewport-only commit does not change their contracts or interactions.

Before — right-panel annotation badges obscure their entry points

Before: annotation badges obscure their tabs

Prior candidate 19ab9339bbd38cda4343620a4124c9ee0ac0ec1c: annotations remain clear of realistic tabs

After: exact-head app, file, and diff tabs

Safari 26.5.2 — prior candidate

Safari: exact-head app, file, and diff tabs

Before — the command palette sits on an empty canvas

Before: prior command-palette fixture

Prior candidate: realistic thread context, entry hint, selected plugin action, and annotation

After: exact-head command-palette page

Before — copied references paste as standalone pills

Before: standalone surface pills

Prior candidate: two distinct pills retain short editable framing copy

After: two framed composable surface pills

Safari 26.5.2 — structured framed paste

Safari: framed Plugin Guide surface pill

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