Repository navigation
Make the Automations plugin forkable - #4199
Merged
SawyerHood merged 1 commit intoSep 23, 2026
Merged
Conversation
SawyerHood
force-pushed
the
bb/forkable-17-automations
branch
2 times, most recently
from
September 23, 2026 20:40
cd917c5 to
b100690
Compare
SawyerHood
marked this pull request as ready for review
September 23, 2026 21:07
SawyerHood
force-pushed
the
bb/forkable-17-automations
branch
from
September 23, 2026 21:31
b100690 to
d5620e0
Compare
plugins/automations imported fourteen @bb/shared-ui components and helpers, shared-ui's automation edit prompt, and @bb/domain's run-state presentation, so a copy of its directory could not install. It now imports every component through the registry alias (@/components/ui/button, @/lib/utils, and so on; all are registry items) with thread-list's tsconfig paths. The run-state labels and icons and the edit prompt builder, which only the plugin used, move into it: detail-view names the four run states itself, and lib/edit-prompt.ts builds the "Edit the bb automation" prompt, with its test. shared-ui drops buildAutomationEditThreadPrompt, and @bb/domain drops RUN_STATE_PRESENTATION, whose only other reader was UPDATE_STATE_PRESENTATION's three icon names, now written out. The plugin's own @/src/rpc-types import becomes relative, since @/ now means the registry. Its tsconfig no longer maps @get-bb/plugin-sdk onto bundled-types: the SDK's exports already resolve its types there, a fork resolves the published package the same way, and the mapping made bb plugin build warn about a legacy vendored SDK layout. The include list names every root module that imports @/, because Vite applies tsconfig paths only to included files; the fork check caught what the in-repo run did not. The vitest config uses defineConfig, and the package declares @testing-library/dom, @types/react-dom, and hono for the SDK test harness. It drops @bb/domain and its exports map, which only the app used. The app typechecked and tested the plugin's views by importing bb-plugin-automations/detail-view and overview-view, which pulls the plugin's @/ imports into @bb/app's program, where @/ means the app. Those tests now live in the plugin: automation-overview.test.tsx as src/overview-view.test.tsx, and the automation half of detail-page-recipes.test.tsx as src/detail-view.test.tsx, rendering through the SDK test runtime. Their one host assertion, that a registered provider icon replaces the fallback, moves to the app's ProviderIcon tests; the plugin test checks that the prompt footer asks the host for the personal-workspace environment icon. The Automations Ladle stories and the gallery's Automations control table move to plugins/automations/automations.stories.tsx, which Ladle lists like the other plugin-hosted stories and resolves through the forkable paths plugin, and the plugin's tsconfig includes it so tsc checks it. The story imports nothing outside the plugin: it lays out its own rows, and it asks for the host model picker's catalog through its Ladle meta (modelPickerCatalog, with the reused environment's id). Ladle's global provider reads that and wraps the story in the app's ModelPickerStoryQueryProvider, which now seeds the catalog for primary routing plus the listed environments. The app no longer depends on the plugin. frontend-imports.test.ts, which keeps zod out of the app bundle, resolves @/ through the plugin's own tsconfig paths instead of workspace package links, so it runs in a copy too. The lint script surfaced a comment in startup reconciliation, now a pending-thread case in its test, and a deliberate field-level dependency list in AgentAutomationDefinition, now marked for the linter. The built bundle is unchanged apart from module order and names: app.css is byte-identical, and app.js drops the unused update-state table it carried from @bb/domain. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
SawyerHood
force-pushed
the
bb/forkable-17-automations
branch
from
September 23, 2026 22:10
d5620e0 to
a3b5666
Compare
SawyerHood
added a commit
that referenced
this pull request
Sep 23, 2026
## Human comments ## What was wrong First of four agent-provider PRs at the top of the forkable built-ins stack; it builds on #4199. `plugins/provider-acp` imports only the public SDK, but a copy of its directory failed its tests: - its vitest config used `vitest.shared.ts`; - the SDK test harness's optional peers (`better-sqlite3`, `cron-parser`, `hono`) weren't declared, and the fork installs without peer resolution. ## What changed - **Config:** `defineConfig`, declared test peers, a lint script, and a turbo test entry that depends on the SDK build. The tsconfig covers `server.test.ts`. - **Removed test:** `public-sdk-only.test.ts` is gone. The lint rule and the fork check enforce the same boundary, and its dev-dependency assertion fails in a copy. The README now points at those checks. ## How you verified - `pnpm exec turbo run typecheck test lint --filter=bb-plugin-provider-acp`. Its `omp` native-roots test needs a TMPDIR with no `.agents` directory above it, as on `main`. - `pnpm check:plugin-forks plugins/provider-acp` passes in a copy. - `@bb/provider-parity` (the parity replays of the acp-cursor recordings) and the native-roots golden tests. 🤖 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
Fifteenth PR in the forkable built-ins stack; it builds on #4197. A copy of
plugins/automationscouldn't install. It imported:@bb/shared-uicomponents;@bb/domain's run-state presentation.Its own
@/src/rpc-typesalias clashed with the registry alias, and its tsconfig mapped the SDK onto bundled.d.tsfiles.The app also typechecked and tested the plugin's views by importing
bb-plugin-automations/detail-viewandoverview-view, which pulls the plugin's@/imports into@bb/app's type program. Two Ladle stories did the same.What changed
@/import becomes relative.detail-view.tsx) and the edit-prompt builder (lib/edit-prompt.ts, with its test), which only the plugin used. shared-ui dropsbuildAutomationEditThreadPrompt, and@bb/domaindropsRUN_STATE_PRESENTATION; its only other reader wasUPDATE_STATE_PRESENTATION's three icon names, now written out.includenames every root module that imports@/, because Vite applies tsconfig paths only to included files. The fork check caught this; the in-repo run did not. It also includesautomations.stories.tsx, so tsc checks the story.defineConfigand declare their peers.@bb/domainand theexportsmap only the app used.ProviderIcon.test.tsxcase inapps/app.plugins/automations/automations.stories.tsx. The story imports nothing outside the plugin: it lays out its own rows, and it requests the model picker catalog through its Ladlemeta(modelPickerCatalog).ModelPickerStoryQueryProvider.apps/appno longer depends on the plugin.frontend-imports.test.tskeeps zod out of the app bundle, and it now resolves@/through the plugin's own tsconfig, so it runs in a copy.docs/forkable-plugins.mdadds theincluderule, that tests of a plugin's own components live in the plugin, and how a plugin-hosted Ladle story asks for app data through itsmeta.How you verified
pnpm exec turbo run typecheck test lint --filter=bb-plugin-automations;@bb/domain,@bb/shared-ui, and@bb/scripts;@bb/appand@bb/integration-teststypecheck; the legacy automations round-trip integration test.pnpm check:plugin-forks plugins/automationspasses in a copy.pendinglikeerrorfails the new reconcile case, and changingProviderIcon'sname={glyph ?? fallback}toname={glyph ?? "Code"}fails the new fallback case.app.cssis byte-identical;app.jsdrops the unused update-state table.🤖 Generated with Claude Code