Repository navigation
docs(plugins): document the full bb.sdk area surface - #1200
Conversation
The plugin-authoring skill documented threads.spawn, threads.send, and threads.get, but never threads.list or threads.update, and it left nine bb.sdk areas out entirely. Issue #1191 reports the resulting conclusion: a plugin author read the skill and filed a request for thread list and update APIs that have shipped since June. Add an area map to the bb.sdk section covering all 14 areas, their sub-areas, and every method name. Add a threads read/edit example, and note that thread.created fires before the first message lands, so a plugin should react on thread.active and read threads.timeline. Handlers are fire-and-forget, so threads.update from one cannot delay a turn. Also add the missing api_to_audit.md entry for experimental_useSidebarThreadSplit, which AGENTS.md requires. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
I am SlopCop. I am reviewing this pull request for security, code quality, performance, architecture, duplication, and practical test coverage.
| sidebar panel or a spawned thread to reach them: | ||
|
|
||
| ```ts | ||
| const { threads } = await bb.sdk.threads.list({ projectId, limit: 50 }); |
There was a problem hiding this comment.
🚨 slopcop/review — This example uses the wrong response shape.
threads.list returns a ThreadListResponse, which is a plain array. This code sets threads to undefined. Use const threads = await bb.sdk.threads.list({ projectId, limit: 50 });.
| a sidebar of many distinct worktrees does not stampede the git host; and | ||
| returning `null` for "lookup failed" (rather than an error) is the right | ||
| failure for a row that should simply show nothing. | ||
| 9. **`experimental_useSidebarThreadSplit`.** Gives a custom row the built-in |
There was a problem hiding this comment.
🚨 slopcop/review — This audit entry duplicates an existing audit section.
docs/plugin-sidebar-thread-list.md already has the same hook and three matching audit points. It also has two extra points. Choose one source and link to it, or keep both lists complete and linked.
| that need the singleton personal project use | ||
| `bb.sdk.projects.list({ includePersonal: true })`. | ||
|
|
||
| **Area map.** Every area below is reachable from `bb.sdk`. This lists the |
There was a problem hiding this comment.
🚨 slopcop/review — The new SDK map has no drift check.
plugin-authoring-docs.test.ts checks top-level plugin API names, but it treats sdk as one opaque name. Add a generated map or a test for all SDK areas and methods. This prevents the same stale-document problem from returning.
SawyerHood
left a comment
There was a problem hiding this comment.
🚨 SLOP COP 🚨 · review
ELI5: This PR adds a map of tools for plugin authors. One example says a list comes inside a box. The API gives the list directly.
Findings
- High — incorrect example.
threads.listreturns an array. The new example destructures{ threads }, so it getsundefined. Useconst threads = await bb.sdk.threads.list({ projectId, limit: 50 });. - Medium — duplicate audit text.
docs/plugin-sidebar-thread-list.mdalready auditsexperimental_useSidebarThreadSplit. The two lists overlap and omit different points. Keep one source, or link and synchronize both sources. - Medium — no drift guard. The SDK map copies about 200 method names from the type contract. The existing documentation test treats
sdkas one name. Add a generated map or a test for all areas and methods.
Checks
- The security review found no security or trust-boundary issue.
- The performance review found no runtime or operational issue.
- The area map matches all 14 areas, all 8 sub-areas, and all current methods.
- The thread filters, update fields, event timing, and fire-and-forget claims match the source.
- A browser test does not apply because both changed files are Markdown documentation.
- All current GitHub checks pass.
Please fix the array example before merge. The two maintenance findings can prevent this documentation from becoming stale again.
Refs get-bb#1191. ## Why Issue get-bb#1191 asks for `bb.sdk.threads.list()` and `bb.sdk.threads.update({ title })`. Both shipped on 2026-06-04, two months before the issue. The problem is discoverability: the plugin-authoring skill documents `threads.spawn`, `threads.send`, and `threads.get`, but never `list` or `update` — and it leaves nine `bb.sdk` areas out entirely. A plugin author who reads the skill concludes the APIs do not exist. ## What changed **`SKILL.md` — an SDK area map.** The skill covered `threads`, `projects`, `files`, `terminals`, and `subscribe`. It never mentioned `hosts`, `providers`, `skills`, `plugins`, `theme`, `status`, `system`, `threadSections`, or `guide`. The new table lists all 14 areas, their 8 sub-areas, and every method name, with a pointer to `types/bb-plugin-sdk.d.ts` for exact signatures. **`SKILL.md` — thread read/edit and event timing.** A worked example for `threads.list` / `get` / `timeline` / `update`, plus the third point the issue raised: `thread.created` fires on row creation, before the first user message lands, so a plugin should listen on `thread.active` and read messages with `threads.timeline`. Handlers dispatch fire-and-forget through `setImmediate` after the transition settles, so `threads.update` from a handler cannot delay or interrupt a turn. **`api_to_audit.md` — one missing entry.** `AGENTS.md` requires every `experimental_` member to have an audit entry. `experimental_useSidebarThreadSplit` had none. The new entry lists three things to audit before the prefix drops. ## Verification I swept four surfaces by script rather than by eye: | Surface | Result | | --- | --- | | `bb.sdk` areas (15) | 9 undocumented → now covered | | Backend `BbPluginApi` members (17) and their methods | already complete | | Frontend slots (11) and hooks/components (17) | already complete | | `experimental_` members vs `api_to_audit.md` | 1 missing → added | The area map is checked against the 22 source interfaces: no invented method names, no missing ones. Documentation only — no code or wire changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
Refs #1191.
Why
Issue #1191 asks for
bb.sdk.threads.list()andbb.sdk.threads.update({ title }). Both shipped on 2026-06-04, two months before the issue. The problem is discoverability: the plugin-authoring skill documentsthreads.spawn,threads.send, andthreads.get, but neverlistorupdate— and it leaves ninebb.sdkareas out entirely. A plugin author who reads the skill concludes the APIs do not exist.What changed
SKILL.md— an SDK area map. The skill coveredthreads,projects,files,terminals, andsubscribe. It never mentionedhosts,providers,skills,plugins,theme,status,system,threadSections, orguide. The new table lists all 14 areas, their 8 sub-areas, and every method name, with a pointer totypes/bb-plugin-sdk.d.tsfor exact signatures.SKILL.md— thread read/edit and event timing. A worked example forthreads.list/get/timeline/update, plus the third point the issue raised:thread.createdfires on row creation, before the first user message lands, so a plugin should listen onthread.activeand read messages withthreads.timeline. Handlers dispatch fire-and-forget throughsetImmediateafter the transition settles, sothreads.updatefrom a handler cannot delay or interrupt a turn.api_to_audit.md— one missing entry.AGENTS.mdrequires everyexperimental_member to have an audit entry.experimental_useSidebarThreadSplithad none. The new entry lists three things to audit before the prefix drops.Verification
I swept four surfaces by script rather than by eye:
bb.sdkareas (15)BbPluginApimembers (17) and their methodsexperimental_members vsapi_to_audit.mdThe area map is checked against the 22 source interfaces: no invented method names, no missing ones. Documentation only — no code or wire changes.
🤖 Generated with Claude Code