Repository navigation
Register message time as a core contribution behind a public-SDK boundary - #7925
Merged
Merged
Conversation
Base automatically changed from
bb/core-contributions-boundary-prototype-candidates-thr_sd3apyw3f9
to
main
November 20, 2026 22:01
…dary Files in apps/app/src/core-contributions may import only what a plugin gets: public @get-bb/plugin-sdk entry points, @bb/shared-ui subpaths that packages/plugin-registry publishes, React and npm packages, and each other. The bb/core-contribution-imports lint rule enforces this and bans jotai, react-query and react-router, whose plugin copies cannot see bb's state. Message time moves into the folder; MessageTime and its formatters move to @bb/shared-ui/message-time as a registry item. For app source, a Vite resolver binds @get-bb/plugin-sdk/app to lib/core-plugin-sdk-app.ts, which re-exports the implementations plugins get, so core can call them before the plugin runtime installs after first paint. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…nding App source resolves @get-bb/plugin-sdk/app to src/lib/core-plugin-sdk-app.ts, which exports only the members core uses, while TypeScript checks imports against the full SDK. A member the binding lacks typechecked and was undefined under Vitest. bb/core-plugin-sdk-app-binding reads the binding's exports and rejects value imports, re-exports, namespace, default and dynamic imports that reach past them; type imports, tests, stories and src/test keep the runtime path and are exempt. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
ymichael
force-pushed
the
bb/core-contribution-boundary-thr_u28fqhpn8k
branch
from
November 23, 2026 18:16
b2fc8c7 to
4a3fede
Compare
ymichael
marked this pull request as ready for review
November 23, 2026 18:17
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
Core's plugin-shaped registrations (message time, thread actions, the parent-thread segment) can import anything in the app, so nothing shows that a plugin could build the same thing, and nothing stops core from using capabilities the SDK lacks.
What changed
bb/core-contribution-imports(scripts/oxlint-plugin.mjs, enabled in.oxlintrc.jsonforapps/app/src/core-contributions/**). Files there may import only public@get-bb/plugin-sdkentry points, the@bb/shared-uisubpaths thatpackages/plugin-registrypublishes, React and npm packages, and each other. It bansjotai,@tanstack/react-queryandreact-router, whose plugin copies cannot see bb's store, cache or router, and allows only a defaultdefinePluginAppexport.core-contributions/message-time.tsx.MessageTimeand its formatters move to@bb/shared-ui/message-time, a new registry item (r/message-time.json).vite-core-plugin-sdk-app.ts(app, Vitest and Ladle configs) resolves@get-bb/plugin-sdk/appfor app source tolib/core-plugin-sdk-app.ts, which re-exports the functionspluginSdkAppImplementationserves to plugins. The runtime facade installs after first paint, so core code calling an SDK member while rendering would otherwise throw.core-plugin-sdk-app.test.tspins each export to that object. Tests, stories andsrc/test/keep the runtime path. Thread actions and the parent segment switch their imports to@get-bb/plugin-sdk/app.undefinedunder Vitest. New lint rulebb/core-plugin-sdk-app-bindingreads the binding's exports and rejects app-source value imports, re-exports, and namespace, default and dynamic imports of@get-bb/plugin-sdk/appthat reach past them. Type imports, tests, stories andsrc/test/are exempt, matching the resolver.This lands as scaffolding with one resident. Thread actions and the parent-thread segment move into
core-contributions/in follow-ups as their SDK gaps close. Archive/Delete is already closed by #7961. Still open:appToast,showMutationErrorToast) and thread hrefs (getThreadLocationPath).NavLink), live thread data and focus handoff, and an inline mode forexperimental_ThreadTitleText.How you verified
jotai,@/components/ui/app-toastand@bb/domainimports to core's message-time registration passesoxlint(exit 0). After: each is reported, as is a named export;@bb/shared-ui/buttonand@bb/shared-ui/lib/utilsare allowed.experimental_useRpcfrom@get-bb/plugin-sdk/appin app source passedtscand wasundefinedin Vitest. After:packages/scripts/test/oxlint-core-plugin-sdk-app-binding.test.mjscovers unbound named imports, namespace, default, re-export,export *and dynamic imports (reported) and bound members, type-only imports and the root SDK entry (allowed).pnpm exec turbo run typecheck lint --filter='...[origin/main]': 94/94.turbo run test --filter=@bb/scripts --filter=@bb/plugin-registrypasses.@bb/appvitest oversrc/lib/core-plugin-sdk-app.test.ts,src/components/thread/timeline,src/lib/thread-actions,ThreadActionsMenu.test.tsxandsrc/components/promptbox/banner: 58 files, 684 tests passed.pnpm start:worktreeproduction build: message time ("10:08 AM") renders in the hover action row of a real thread.🤖 Generated with Claude Code