Skip to content

Plugin marketplaces and manual compatible updates (v1) - #636

Merged
SawyerHood merged 81 commits into
mainfrom
bb/plugin-marketplace-updates-thr_8d4z3fbpyt
Jul 13, 2026
Merged

SawyerHood merged 81 commits into
mainfrom
bb/plugin-marketplace-updates-thr_8d4z3fbpyt

Conversation

@SawyerHood

@SawyerHood SawyerHood commented Jul 13, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Adds plugin marketplaces and manual, compatibility-aware updates on top of one plugin installation pipeline. Direct (npm:/git:/path:) installs and marketplace installs produce the same durable source intent, exact resolved artifact, validation, staged activation, and rollback behavior. A marketplace is a discovery/provenance layer — adding one installs nothing.

This started as a broader design (including opt-in automatic updates) and was deliberately scoped down to a manual-only v1 during review: the automation platform was cut, the safety core kept, and the engine decomposed into cohesive modules.

What's in v1

Contracts & persistence

  • Plugin SDK versioned (pre-1.0) with an optional engines.bbPluginSdk manifest range; bb plugin build stamps authoritative metadata (artifactFormatVersion, pluginId, pluginVersion, builtWith) into the server/app bundle sidecars.
  • Normalized persistence: source intent, exact resolution, provenance (builtin/direct/marketplace), immutable artifact records, and marketplace catalogs — one squashed migration.

Resolver & manual updates

  • Compatibility-aware npm/git candidate selection (reports blocked-but-newer incompatible releases; dev-build labeling).
  • bb plugin outdated and bb plugin update <id> / --all (manual, confirmed). Pinned-vs-tracking is derived from source intent (exact npm / git tag / commit / path = pinned; npm range/omitted / git branch = tracks compatible).

Safe activation

  • Immutable exact-resolution artifact cache with crash-safe staging → promotion → pointer swap.
  • Every managed activation snapshots the plugin's full state (SQLite + host kv/settings/schedules + secret files), then rolls back — restart-safe via a durable recovery journal — if the new version fails to load. A failed update surfaces as a "needs attention" state.
  • Reinstalling an already-installed managed plugin is refused (use bb plugin update) — the preflight runs before any build/artifact write, closing a bug where reinstall bypassed the rollback path.

Marketplaces

  • Catalog schema validation with realpath containment; last-known-good refresh that never runs plugin code; name@marketplace installs routed through the same resolver/artifact pipeline; search over cached catalogs. Removing a marketplace always keeps its plugins as direct installs.

Settings → Plugins UI

  • Three-layer disclosure: quiet installed list (one attention pill max), a per-plugin detail page (Updates & source card, source-details disclosure), and a one-step Add-plugin dialog with the full-trust confirmation. Browse and Marketplaces tabs.

Engine decomposition

  • plugin-service.ts split from one ~5.2k-line file into a 1.7k-line facade over cohesive modules (runtime, registration, managed-artifacts, activation, updates), byte-for-byte behavior-preserving.

Explicitly deferred (not in v1)

Automatic update checks/application, per-plugin/marketplace auto-apply policy, org kill-switch, update audit history, quarantine fingerprinting, patch/minor policy tiers, --latest intent-widening, ignore-version, install preview, and marketplace removal-dispositions. These were designed, built, then cut to keep v1 to one explainable promise: marketplaces discover sources; managed sources resolve to exact validated artifacts; one explicit update path activates them safely.

Tests

Per-package suites green via Turbo (@bb/db, @bb/server, @bb/app, @bb/cli, @bb/templates) — typecheck + tests. Coverage spans source parsing/normalization, semver selection, marketplace schema + path/symlink-traversal rejection, staging/promotion crash recovery, database snapshot/restore, restart-safe rollback, the reinstall preflight, and UI update-state rendering. The Settings surface was verified live in a running dev app.

🤖 Generated with Claude Code

SawyerHood and others added 30 commits July 12, 2026 11:21
…_2np2sq2vpw' into bb/plugin-marketplace-updates-thr_8d4z3fbpyt

# Conflicts:
#	apps/server/test/services/plugins/plugin-install.test.ts
Update discoverable surfaces for engines.bbPluginSdk, build-stamped
dist metadata, managed install validation, and reserved builtin ids.
…_2gpydrub3d' into bb/plugin-marketplace-updates-thr_8d4z3fbpyt
Surface bb plugin outdated / update (flags, tracking policies, full-trust
confirmation, dev-build engines.bb note) in the plugins guide, bb-cli and
bb-plugin-authoring skills, and configuration.md; regenerate guide templates.
The outdated/update commands are now documented in the guide, so the
exemption would permanently blind the test to future doc regressions.

Co-Authored-By: Claude Fable 5 <[email protected]>
SawyerHood and others added 18 commits July 12, 2026 21:02
The seven incremental migrations each regenerated a full-schema drizzle
snapshot (~3.4k lines apiece), adding ~24k lines of generated JSON for a
feature that only changes the schema once. Since none of these migrations
have shipped, collapse them into a single 0066 generated from the final
schema, preserving the one meaningful data statement (seeding auto_check
for official/managed marketplaces). Net: ~-21k lines, same end-state schema.

Co-Authored-By: Claude Fable 5 <[email protected]>
The server simplified plugin marketplaces to manual-only updates and
removed the auto-apply/update-policy/ignore-version/history/install-
preview/marketplace-auto-policy routes plus their fields. Align the app:

- AddPluginDialog: collapse the two-step preview flow to one step —
  source (or catalog entry) + full-trust confirmation, straight to
  POST /plugins/install; compatibility failures surface as the install
  error toast.
- PluginUpdatesCard: drop the Automatic-updates toggle, org/marketplace
  override notes, update-policy dropdown, Ignore action, and the
  Update-history disclosure. Keep the update banner, source line +
  details disclosure, last-checked + Check now, and blocked-version row.
- MarketplacesTab: drop the official badge, check-policy summary, and
  auto-policy menu; removal is now a simple confirm — DELETE takes no
  body and the toast names the plugins kept as direct installs.
- Delete PluginUpdateToasts (no background checks in v1); the
  rollback/lastFailure "Needs attention" pill stays on the row.
- Parsers: plugin rows lose autoApply/updatePolicy/ignoredVersion/
  quarantined and the envelope's autoApplyDisabled; MarketplaceView
  loses scope/autoCheck/autoApply/enabled; apply-update posts {} and
  its result loses dryRun; removeMarketplace parses convertedPluginIds.

Co-Authored-By: Claude Fable 5 <[email protected]>
The merged server always sends { enabled, plugins } with provenance,
sourceDisplay, and updateState on every row, and a lastFailure record
that carries version+at+detail together. The parser tolerated all of
those being absent and normalized to the quiet state — so a server
regression that dropped updateState or sent a partial lastFailure after
a rollback would silently suppress the Needs-attention pill and the
failure banner. Require the envelope fields and the mandated row fields
(half-shaped rows drop), require the full lastFailure record, and add
regression tests for each drift case.

Co-Authored-By: Claude Fable 5 <[email protected]>
… bb/plugin-marketplace-updates-thr_8d4z3fbpyt
Remove the last marketplace --version install wording from the bb-cli
skill, document reinstall-refused → use update, and keep skills,
configuration, and the plugins guide aligned with the manual-only model.
…_qcgfqjfybx' into bb/plugin-marketplace-updates-thr_8d4z3fbpyt
@SawyerHood SawyerHood changed the title Plugin marketplaces and compatible updates Plugin marketplaces and manual compatible updates (v1) Jul 13, 2026
SawyerHood and others added 7 commits July 13, 2026 08:16
…create-a-plugin

- Replace letter avatars with a placeholder-glyph tile on every plugin
  surface (installed rows, browse cards, marketplace rows, install dialog);
  installed rows use the manifest icon hint, falling back to the generic
  plugin glyph — never an initial.
- Fix the pink "Installed"/tint bug: mixing a chromatic token against the
  zero-chroma --canvas/--ink in oklch drags the hue through 0° (a 14% green
  mix computed to hue ~22°, salmon). Mix these tints in oklab so the hue
  survives.
- Header add button is now contextual: "Add marketplace" on the Marketplaces
  tab, "Add plugin" elsewhere; drop the duplicate button inside the tab.
- Add a "Create a plugin" entry point that opens the composer seeded to reach
  for the bb-plugin-authoring skill.
- Subtitle copy → "Customize bb to your liking with plugins."

Co-Authored-By: Claude Opus 4.8 <[email protected]>
Render the placeholder glyph bare (no rounded bg-muted box), keeping the
footprint className so it still aligns with sibling logo images.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
A plugin's identity — displayName, icon, and logo — was read only from the
live runtime object, so a disabled/incompatible/errored plugin fell back to
its raw id + generic glyph in the inventory (e.g. memory declares
bb.icon "Brain" but showed a bolt while disabled).

Add a static-identity cache (parsed manifest + logo snapshots) populated for
every installed plugin on each load attempt and pruned on remove, independent
of the runtime lifecycle. The inventory falls back to it for non-exposed
plugins, and the logo asset route serves from it too — so a disabled plugin
keeps its real name, icon, and logo. Logos are identity, not runtime; the
old "bytes only while loaded" gate on getLogoAsset is lifted (still gated by
shouldExposePluginId: experiment on + not removed).

Reworks the disabled-logo test to the new behavior and adds coverage for
identity surviving disable and being dropped on uninstall.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
- Add-plugin dialog: replace the loud warning-tinted callout with a quiet
  one-line muted note, and drop the Source/Provenance key-value grid that
  just restated the source field.
- Add an uninstall path: a "Remove plugin" section on a plugin's detail page
  (direct/marketplace only — builtins are disabled, not removed) with a
  source-aware confirm (path sources keep their local files; managed sources
  delete downloads), wired to DELETE /api/v1/plugins/:id and redirecting back
  to the list. Adds a removePlugin client + tests.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
"Update…" / "Remove…" (plugin + marketplace) and the "Select…" setting
placeholders lose the "…".

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@SawyerHood
SawyerHood merged commit e22c264 into main Jul 13, 2026
10 checks passed
@SawyerHood
SawyerHood deleted the bb/plugin-marketplace-updates-thr_8d4z3fbpyt branch July 13, 2026 19:42
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