Repository navigation
Make the chat-surface built-in plugins forkable - #4189
Merged
SawyerHood merged 1 commit intoSep 23, 2026
Merged
Conversation
This was referenced Sep 23, 2026
SawyerHood
force-pushed
the
bb/forkable-08-chat-surfaces
branch
2 times, most recently
from
September 23, 2026 17:53
5722563 to
aa7166b
Compare
SawyerHood
force-pushed
the
bb/forkable-08-chat-surfaces
branch
from
September 23, 2026 20:40
aa7166b to
18c06c2
Compare
Base automatically changed from
bb/forkable-07-app-builder-plugin-id
to
bb/forkable-06-monaco-editor
September 23, 2026 20:40
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
side-chat, inline-vis, agent-annotations, scheduled-send, and browser-automation imported shared-ui components by their workspace package name, which a copy cannot install. They now import them through the registry alias (`@/components/ui/*`, `@/lib/utils`) with thread-list's tsconfig mapping, and their vitest configs use defineConfig with tsconfig paths instead of vitest.shared.ts. Each declares the SDK test harness's optional peers its tests load, and gets a lint script and turbo entries that depend on the SDK build. browser-automation's tsconfig mapped the SDK onto its bundled types, where the package's `types` condition already points. Vitest follows tsconfig paths, so it resolved the SDK to declaration files; the mapping is gone. Its host bundle now includes the SDK's host entry rather than the build's fallback stub, as it does for every plugin without the mapping and for a copy; experimental_defineHostEntry is the same code. Its process test and smoke scripts ran tsx with `--conditions=source`, which points the SDK at source files the published package does not ship; they now load the built SDK. Linting surfaced scheduled-send's comments, now removed. In agent-annotations, a test component called a hook anonymously and now has a name; the submit subscription depends on `composer.experimental_onSubmitted` rather than `composer`, which changes with every keystroke, and is marked for the linter. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-08-chat-surfaces
branch
from
September 23, 2026 22:10
18c06c2 to
30a9ac3
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong Eighth PR in the forkable built-ins stack; it builds on #4189. Five built-ins that contribute Settings sections couldn't be copied out of the repository: keep-awake, concurrency-limit, memory, provider-usage, and account-pool. Beyond the shared-ui imports and `vitest.shared.ts`: - **SDK paths in tsconfig.** keep-awake, concurrency-limit, and account-pool mapped `@get-bb/plugin-sdk` onto its bundled `.d.ts` files, which vitest loads as the SDK once it follows tsconfig paths. - **App imports.** provider-usage imported `@bb/shared-ui/lib/usage-format`, which only it used. Its story imported the app's Ladle story card and read logo files from other plugins. - **Tests outside the repository:** account-pool's tests read `BB_ACCOUNT_POOL_PARENT_URL`/`_TOKEN` from the shell, which turbo strips but a copy's `npm test` doesn't. They also ran `tsx` without declaring it. ## What changed - **Registry and config:** - UI imports go through the registry alias, with thread-list's tsconfig paths, and the SDK path entries are gone. - Tests use `defineConfig` with tsconfig paths, and each plugin declares its test peers. - Each plugin gets a lint script and turbo entries. - **provider-usage:** - `usage-format.ts` moves into the plugin, and its shared-ui export is deleted. - Its story is self-contained: it lays out its own rows and inlines the two provider logos. - `apps/app/.ladle` applies the forkable-plugin path mapping, so Ladle resolves the plugin's `@/` imports the way the app's vitest config does. - **account-pool tests:** they unset the parent-pool variables and declare `tsx`. ## How you verified - `pnpm exec turbo run typecheck test lint` for the five plugins. - `pnpm check:plugin-forks`: all five pass in a copy. This run had the pool env vars set, which is what surfaced the test-environment leak. - `@bb/app` and `@bb/server` typecheck; `@bb/scripts`, `@bb/plugin-api-map`, and `@bb/shared-ui`; `prepare:bundled` for the five. - The Ladle stories render (headless Chromium, no console errors). - **Bundle identity:** keep-awake, concurrency-limit, and memory ship byte-identical `app.js`, `app.css`, and `host.js`. provider-usage's and account-pool's `app.js` differ from the base only in module paths and the registry icon (the same host component). 🤖 Generated with [Claude Code](https://claude.com/claude-code) > AGENT GENERATED
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
Seventh PR in the forkable built-ins stack; it builds on #4184. Five chat-surface built-ins couldn't be copied out of the repository:
They imported
@bb/shared-uiby package name and usedvitest.shared.ts. Their tests loaded SDK harness peers they didn't declare.What changed
defineConfigwith tsconfig paths. Each plugin declares its test peers, and gets a lint script and turbo entries that depend on the SDK build..d.tsfiles, which vitest would load as the SDK at runtime. The package'stypescondition already points tsc there.--conditions=source, which pointed at SDK source the published package doesn't ship.composer.experimental_onSubmittedrather than oncomposer, which changes on every keystroke. The linter directive marks that.How you verified
pnpm exec turbo run typecheck test lintfor the five plugins.pnpm check:plugin-forks: all five pass in a copy.@bb/apptypecheck, and@bb/plugin-api-mapand@bb/scriptstests.app.jsdiffers from the base only in module order, names, and the plugin's own icon. The icon now comes from the registry flavor (experimental_Icon), which the host binds to the same shared-uiIcon. scheduled-send'sapp.jsis byte-identical. browser-automation's host bundle now includes the SDK'sexperimental_defineHostEntryinstead of plugin-build's fallback stub; both are the same code.🤖 Generated with Claude Code