Repository navigation
Make the Modal sandbox plugin forkable - #4196
Merged
SawyerHood merged 1 commit intoSep 23, 2026
Merged
Conversation
This was referenced Sep 23, 2026
SawyerHood
force-pushed
the
bb/forkable-15-environment-plugins
branch
from
September 23, 2026 17:51
2ac0093 to
429513e
Compare
SawyerHood
force-pushed
the
bb/forkable-15-environment-plugins
branch
2 times, most recently
from
September 23, 2026 20:40
b875adf to
c79b2c6
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
SawyerHood
force-pushed
the
bb/forkable-15-environment-plugins
branch
from
September 23, 2026 21:31
c79b2c6 to
9c4eeda
Compare
SawyerHood
changed the base branch from
bb/forkable-14-environment-host-helpers
to
bb/forkable-13-plugin-guide
September 23, 2026 21:40
environment-modal-sandbox's app imported seven @bb/shared-ui modules, so a copy could not install. They now come from the component registry through @/: button, coarse-pointer-sizing, dropdown-menu, icon, input, option-display, and lib/utils. The tsconfig maps @/ the way thread-list's does, and vitest follows it. The tsconfig also mapped @get-bb/plugin-sdk and its testing entry onto the bundled .d.ts files. The package's types condition already points there, and once vitest follows tsconfig paths the mapping made it load the declaration files as the SDK at runtime, so those two entries are gone. A copy's tests failed too: - The vitest config imported the repository's vitest.shared.ts. It now uses defineConfig directly. - The fork installs without npm's peer resolution, so the SDK test harness's cron-parser, hono, and better-sqlite3 types were missing, and the registry's responsive overlay needs the react-dom types. The plugin declares them. The lint script now ignores node_modules and dist like the other listed plugins, and the turbo tasks take the registry flavors as inputs and build the SDK before tests. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-15-environment-plugins
branch
from
September 23, 2026 22:10
9c4eeda to
580a6be
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Fourteenth PR in the forkable built-ins stack; it builds on #4196. ask-user-question and secrets render bb's in-thread forms (the `pendingInteraction` slot). A copy of either couldn't build on its own: - Both imported `@bb/shared-ui` and `@bb/plugin-interaction-contracts`, a workspace package holding their payload and response schemas. - ask-user-question rendered shared-ui's question form, which reaches the host's answer shortcuts through a module only `bb plugin build` can swap. - Their tsconfigs mapped the SDK onto its bundled `.d.ts` files, and their vitest configs used `vitest.shared.ts`. ## What changed - **Contracts:** each plugin owns its contract (`src/contracts.ts`, `src/secret-request.ts`) with its half of the old tests. Nothing else imported `@bb/plugin-interaction-contracts`, so it is deleted. - **UI:** components come through the registry alias. ask-user-question uses the registry's `question-form`, whose `question-form-host` flavor calls `experimental_useQuestionFormHost` (#4181), so its `engines.bbPluginSdk` is `>=0.5.22`. The built-in bundle still takes the question form host from the app's runtime, so it keeps bb's answer shortcuts and a single React context. - **Config:** - The SDK path entries are gone; the package's `types` condition already points tsc at the same files. - ask-user-question's tsconfig maps only `@/*` and the icon flavor. It never imports `question-form-host` itself, so it doesn't map it. - `app.test.tsx` and the vitest configs join the tsconfig `include`. - Each plugin declares its test peers and gets a lint script and turbo entries. - **Stories:** ask-user-question's Ladle story rendered through app source, so it moves into `apps/app` beside the other pending-interaction stories, with `origin="plugin"` replacing a stale prop. Both stories load their plugin through `import.meta.glob` (`apps/app/.ladle/plugin-app-module.ts`), which keeps the plugins' `@/` imports out of `@bb/app`'s type program. - **Docs:** `docs/forkable-plugins.md` records both rules: a listed plugin maps nothing onto `@get-bb/plugin-sdk`, and Ladle stories load a listed plugin with `import.meta.glob`. ## How you verified - `pnpm exec turbo run typecheck test lint` for both plugins. - `pnpm check:plugin-forks` passes for both. In a kept copy, `app.js` calls `experimental_useQuestionFormHost` and never calls `createContext`. - `@bb/app` typecheck and tests, `@bb/scripts`, `bb-plugin-plugin-api-docs`, and the server's built-in plugin tests. - Both Ladle stories render in the dev server with no console errors. - **Bundle identity:** `app.css` is byte-identical. `app.js` differs only in module paths and in dropping the other plugin's schemas, which the shared package's index had pulled into both bundles. Both bundles take the question form host from `runtime.questionFormHost`. 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED Co-authored-by: Claude Opus 5.5 (1M context) <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Human comments
What was wrong
Thirteenth PR in the forkable built-ins stack; it builds on #4194.
plugins/environment-modal-sandboxcouldn't be copied out of the repository:@bb/shared-uimodules.vitest.shared.ts.@get-bb/plugin-sdkand its testing entry onto the bundled.d.tsfiles. Once vitest follows tsconfig paths, that loads the declaration files as the SDK at runtime.cron-parser,hono, andbetter-sqlite3types, and the react-dom types the registry's responsive overlay needs, were undeclared.The Worktree and Project checkout plugins stay as they are: they share host helpers with the daemon through
bb-environment-provider-host, and isolating them would mean copying those helpers into each plugin.What changed
lib/utilscome from the registry through@/, with thread-list's tsconfig paths.typescondition already points tsc at the same files. The vitest config usesdefineConfig, and the plugin declares its test peers.node_modulesanddistlike the other listed plugins, and the turbo tasks take the registry flavors as inputs and build the SDK before tests.scripts/forkable-plugins.json.How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-environment-modal-sandbox.pnpm check:plugin-forks plugins/environment-modal-sandboxpasses in a copy.turbo run typecheck lintat the top of the stack.🤖 Generated with Claude Code