Skip to content

Reserve bb-- plugin ids and move provider-usage to bb--provider-usage - #4576

Merged
SawyerHood merged 3 commits into
mainfrom
bb/prefix-marketplace-ids-with-user-ids-thr_rv588cfmid
Sep 30, 2026
Merged

SawyerHood merged 3 commits into
mainfrom
bb/prefix-marketplace-ids-with-user-ids-thr_rv588cfmid

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Sep 30, 2026 •

Copy link
Copy Markdown
Collaborator

Human comments

What was wrong

The bundled Provider usage plugin used the id provider-usage, which is also the id of Braedon Saunders' community marketplace plugin. BB refuses any install that would shadow a bundled plugin id, so the community plugin could never be installed. Nothing stopped the next bundled plugin from colliding the same way.

What changed

  • Reserved bb-- ids. Every bundled plugin added from now on must use a bb-- id. builtin-registry.test.ts freezes the 39 existing unprefixed ids and fails if another unprefixed one appears. BB refuses non-bundled installs of bb-- ids from every source (npm, git, path, catalog) with a message asking the author to rename the package. The check runs only at install time, so already-installed plugins keep loading.
  • provider-usage becomes bb--provider-usage. The package is renamed to bb-plugin-bb--provider-usage. The directory and the install source stay plugins/provider-usage and builtin:provider-usage.
  • Migration 0135_rename_provider_usage_plugin_id moves the bundled install row to the new id, keeping its enabled and removed state, and rewrites the plugin:provider-usage/… keys in sidebar.footerOrder and sidebar.hiddenFooterItems. A user-installed provider-usage is left alone. The plugin never stored settings, KV, schedules or other server data, so nothing else needs to move.
  • The plugin's own RPC calls: the usage card and its background refresh build /api/v1/plugins/<id>/rpc/getUsage from their plugin id instead of hard-coding provider-usage.
  • Other references: the /settings/usage redirect, turbo task names, the lockfile, the first-party plugin table, and the docs examples.
  • Docs: the official plugin release process, the plugin authoring quickstart, and the submit-a-plugin reference describe the reservation.
  • Companion marketplace PR: Reject marketplace ids reserved for plugins bundled with BB marketplace#422 rejects bb-- ids and the frozen bundled ids in submissions.

Known effects:

  • Older bb versions still bundle provider-usage, so the community plugin stays uninstallable for them until they update. They get the existing "reserved by the bundled plugin" error.
  • Install counts key built-ins by plugin id, so older versions will count the built-in toward the community plugin's provider-usage until they update.
  • The usage card's selected machine is stored in the browser under the plugin id, so it resets once.

How you verified

  • turbo run test --filter=@bb/db -- test/migrate.test.ts: 59 pass, including two new cases (the bundled row and footer preferences move; a user-installed provider-usage stays).
  • turbo run test --filter=@bb/server on the plugin, catalog and submit-a-plugin suites: 257 pass. That includes the new bb-- refusal tests for path and npm installs, the frozen-id registry test, and the real bb--provider-usage built-in starting on a fresh database.
  • turbo run typecheck test lint --filter=bb-plugin-bb--provider-usage: 20 pass. The footer test mounts the plugin as bb--provider-usage and fails against the old hard-coded URL.
  • turbo run typecheck test for bb-plugin-bb--provider-usage, @bb/scripts, @bb/templates and bb-plugin-plugin-api-docs; turbo run typecheck for @bb/server, @bb/app and @bb/db.
  • turbo run build --filter=@bb/bundled-plugins: the bundled official catalog lists bb--provider-usage.
  • Not run: the migration against a copy of a real bb.db, or a dev-app session.

AGENT GENERATED

🤖 Generated with Claude Code

The bundled provider-usage plugin took the id of a community marketplace
plugin, so that plugin could never be installed. New bundled plugins now
use a bb-- id, BB refuses non-bundled installs of bb-- ids, and the
bundled provider usage plugin moves to bb--provider-usage. Migration
0135 carries the existing install row and the sidebar footer
preferences over to the new id.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-30T20:25:18.982662Z 697652d PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 697652d53c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

{
name: "provider-usage",
pluginId: "provider-usage",
pluginId: "bb--provider-usage",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Update usage RPC calls for the renamed plugin ID

After the builtin is registered as bb--provider-usage, every sidebar load and background refresh still posts to /api/v1/plugins/provider-usage/rpc/getUsage in plugins/provider-usage/app.tsx:128. The RPC handler is now mounted under the new plugin ID, so these requests return 404 and the default provider-usage footer remains unavailable; derive the endpoint from the active plugin ID or update this stale route and its tests.

AGENTS.md reference: AGENTS.md:L12-L12

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valid, thanks. Fixed in 46ac19c: the usage card and its background refresh now build the RPC URL from their plugin id, and the footer test mounts the plugin as bb--provider-usage (it fails against the old hard-coded URL).

AGENT GENERATED

SawyerHood and others added 2 commits September 30, 2026 20:32
The /settings/usage redirect now lands on bb--provider-usage. The pane
focus migration test rewound only 0134, so Drizzle skipped it once 0135
existed; it now rewinds every migration from 0134 on.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The usage card posted to a hard-coded /api/v1/plugins/provider-usage
route, which 404s now that the plugin is bb--provider-usage. The content
script and the footer card pass their plugin id into the request instead.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@SawyerHood
SawyerHood merged commit a08fb9e into main Sep 30, 2026
20 checks passed
@SawyerHood
SawyerHood deleted the bb/prefix-marketplace-ids-with-user-ids-thr_rv588cfmid branch September 30, 2026 21:14
ymichael added a commit that referenced this pull request Oct 2, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 5, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 5, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
SawyerHood added a commit that referenced this pull request Oct 5, 2026
## Human comments

## What was wrong

getbb.app/marketplace only listed community plugins. The plugins that
ship with bb (Memory, Tasks, Docs, Automations, Plugin Guide and others)
had no public page, so links like `/marketplace/memory` returned 404 and
search engines could not find them.

This carries #4608 forward on current `main` with a smaller diff and
three fixes.

## What changed

Every user-facing built-in plugin now has a marketplace page, and a "BB
Official" shelf leads `/marketplace`.

### Pages and shelf

- The "BB Official" shelf comes first, above New & notable. "View all"
expands it in place.
- Cards use the bb mark as the author avatar.
- Badges follow the shared install rule:
- Plugins installed with bb by default say "Built in" on cards and
"Included with bb" on detail pages.
- Opt-in official plugins (Tasks, GitHub, Docs, Memory and others) show
their install counts.
- Detail pages show the right setup step:
  - `bb plugin install <name>` for official plugins installed on request
  - `bb plugin enable <id>` for built-ins that are off by default
  - no command for built-ins that are always on
- "View source" links to `get-bb/bb/tree/main/plugins/<name>`.
- Internal and adapter plugins stay unlisted: account-pool,
agent-annotations, the environment-\* checkouts, plugin-api-tester and
the provider-\* adapters.
- Built-ins join the sitemap and get share cards.

### Ids and URLs

- A built-in's page URL is its plugin id, the same id install counts and
the app use.
- Built-in ids cannot clash with community ids: #4576 moved the one
clash to `bb--provider-usage`, and the marketplace registry rejects
reserved ids.
- `/marketplace/provider-usage` is the community Provider Usage plugin
(unchanged).
  - `/marketplace/bb--provider-usage` is the built-in.
- If a clash ever appears, the community page stays and the built-in is
left off the site.

### Data and build

- `apps/web` imports the bundled catalog that
`@bb/server#generate:bb-official-marketplace` already generates and
merges it into the community manifest after parsing.
- Only the bundled catalog may use a `{ bundled: { plugin } }` source. A
fetched community manifest with one is rejected, so a community entry
cannot present itself as built in.
- Local SVG icons are served as Vite asset URLs, including when Vite
inlines them as `data:` URLs.
- `@bb/web#build` depends on the catalog generator through `topo`.
`deploy-web.yml` also triggers on every generator input and on plugin
icons.

### Differences from #4608

- Removed the compact-slug rename (`/marketplace/providerusage`). It no
longer ran, because the ids no longer clash.
- bb account, bb cloud AI and bb connect rendered the generic puzzle
icon; they now have icons.
- The enable command uses the plugin id instead of the source name.
- The bundled-source check runs after the shared parse instead of
through a second copy of the manifest schema.
- Formatting-only hunks are reverted.

### Things to know

- Adding a bundled plugin that is opt-in or off by default fails
`bundled-marketplace.test.ts` until it is added to the lists in
`bundled-marketplace.ts`. The failure names the plugin.
- A listed built-in whose icon name has no entry in
`marketplace-icons.ts` fails the same test file.
- The deploy job uses a shallow clone, so built-ins have no publish
dates on getbb.app. They sort last under "New" and never show the "New"
badge.
- Provider usage and Modal Sandbox have no overview text yet, so their
Overview section is empty.

## How you verified

- `pnpm exec turbo run build typecheck test lint --filter=@bb/web`
passes on this branch (25 files, 170 tests).
- `bundled-marketplace.test.ts` covers the clash rule, the unlisted
filter, shelf order, category merging, icon fallback, a drift check
against the server's plugin registry, and a check that every listed
built-in has a web icon. Removing two icon entries made that last test
fail and name both plugins.
- `marketplace-v2.test.ts`: the community catalog rejects bundled
sources; the bundled catalog accepts them.
- `public-marketplace.test.tsx`: only default-installed bundled plugins
render "Built in"; an opt-in one renders its count.
- Browser checks in headless Chrome at 1280×900, against a local build
with a local R2 bucket holding a full 327-plugin community catalog and
the live install counts. These ran on a local branch that also carried
#4671; its `apps/web` differs from this PR by one shelf subtitle string.
- `/marketplace`: BB Official shelf first with 30 plugins; "View all"
expands to all 30 and the link disappears.
  - bb account, bb cloud AI and bb connect show their own icons.
- `/marketplace/bb--provider-usage` shows the built-in with "Included
with bb" and no command; `/marketplace/provider-usage` still shows the
community plugin with its install command; `/marketplace/providerusage`
is 404.
- `/marketplace/simple-notes` shows `bb plugin install docs`;
`/marketplace/workflows` shows `bb plugin enable workflows`;
`/marketplace/bb-guide` shows no command.
- Production build under `vite preview`: Plugin Guide and Modal Sandbox
render their SVG icons on the page and on the share card
(`/marketplace/og/<id>`); the sitemap lists the built-in pages; no
console errors.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

> AGENT GENERATED

---------

Co-authored-by: brsbl <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 6, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 6, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 7, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael added a commit that referenced this pull request Oct 7, 2026
Bundled plugins added after #4576 must use a bb-- id. Rename the package
to bb-plugin-bb--storage-retention so the plugin id is
bb--storage-retention; the directory and builtin:storage-retention
source stay. The plugin has not shipped, so no migration is needed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
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