Skip to content

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

Open
brsbl wants to merge 19 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 19 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 plugin API documentation was split across generated web pages and implementation details, so plugin authors had no single product-native map showing where each capability appears. The Plugin Guide v1 establishes the in-app guide as that documentation surface while preserving existing plugin contracts.

What changed

This is layer 1 of the planned three-layer stack. It is based on current main, contains no inspector mode, and can merge independently before the additive Core inspection APIs and the inspector consumer.

  • Adds and registers the built-in bb Plugin Guide (plugins/plugin-api-docs) backed by packages/plugin-api-map, with annotated product diagrams, capability cards, cross-references, and shipped-plugin usage links.
  • Keeps the guide anatomy faithful to the product: Code & diff renderers marker 11 is in the conversation timeline renderer, while marker 10 remains the separate file viewer. The command-palette action surface is also represented.
  • Adds API-map synchronization tests so new plugin SDK surface members require matching Guide coverage.
  • Removes the superseded generated web documentation route and generated API model.
  • Preserves client-side plugin route navigation, split plugin-detail rendering, and CSS-before-registration activation ordering.
  • Adds the optional experimental SDK member experimental_pluginCustomizations?: "all" | "none". Omission and "all" preserve the shipped composed experience; "none" renders bb's composer without globally registered plugin banners, actions, + menu rows, draft highlighting, or draft observers. This lets any embedded composer consumer isolate its example or workflow while retaining bb's real composer.
  • Bumps @get-bb/plugin-sdk from the released 0.4.14 baseline to 0.4.15 for that additive API, with a persisted 0.4.14 scaffold upgrade regression proving an installed plugin remains running and API-compatible after the host upgrade.
  • Keeps the Plugin Guide engine floor capability-based at bbPluginSdk >=0.4.3; the Guide does not claim the unpublished 0.4.15 integration target. No existing field changes meaning, and there is no unrelated engine-floor, daemon-protocol, or permissions-model change.

How you verified

Exact pushed head: d0e24849a7cde08733fc711daec4c3184f31dc49, based on main at c3b588c8fa62dc817b52773fe8fb0303e6321d05.

  • Frozen-lockfile install — PASS
  • Committed-diff SDK version guard — PASS
  • npm publication guard — PASS; @get-bb/plugin-sdk@0.4.15 remains unpublished
  • @get-bb/plugin-sdk tests — 129/129
  • Server plugin-service and SDK-compatibility tests — 33/33, including the persisted 0.4.14 scaffold upgrade regression
  • Turbo typechecks for @bb/domain, @bb/server, @get-bb/plugin-sdk, and the Plugin Guide — PASS
  • Production Plugin Guide build — PASS
  • git diff --check origin/main...HEAD — PASS
  • Exact-head GitHub CI and Version Lockstep — all required checks passed; skipped matrix entries are expected
  • Exact-head desktop QA confirmed the canonical Guide route, sidebar registration, marker ownership (11 timeline renderer; 10 file viewer), and command-palette surface
  • Native visual QA passed at 768×900, matched 1280×900, and the host maximum 1710×1073; five narrow/large resize cycles produced no clipping, gaps, drift, or ownership changes
  • No additional code review was run because the stack's one cumulative review budget is already consumed

Native before and after

Both captures come from scripts/bb-dev-app current --desktop at the exact compared revisions. They use isolated empty dev data, the same canonical route /plugins/plugin-api-docs/plugin-api, the initial unscrolled state, light theme, and identical native window bounds: 1280×900 pt at x=80/y=80 (2560×1800 Retina output).

Before — main at c3b588c8fa62dc817b52773fe8fb0303e6321d05

The canonical Guide route has no registered panel.

Before: Plugin Guide route unavailable on exact main

After — exact PR head d0e24849a7cde08733fc711daec4c3184f31dc49

The built-in Guide is registered and its first product-map surface places Code & diff renderers in the timeline, separate from the file viewer.

After: Plugin Guide rendered from exact PR head

No linked issue.

BB-Thread-ID: thr_7dczktandc

BB-Thread-ID: thr_7f4g7pd89a

AGENT GENERATED: by GPT-5.6-Sol

brsbl and others added 19 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
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