[stacked on #2193] Export the canonical event types by name from the provider-bridge testing kit - #2194
Closed
SawyerHood wants to merge 1 commit into
Closed
Conversation
…ting kit A bridge's tests assert on what the assembler built, but the kit exported no name for it: the echo canary spelled the event type as ReturnType<BridgeDeltaEventCollector["assembleMessage"]>[number] and narrowed item events from that. @get-bb/plugin-sdk/provider-bridge/testing now re-exports ThreadEvent, ThreadEventItem, ThreadEventItemPresentation (with its label, icon and tint parts) and the named item kinds from @bb/domain as types, inlined into the bundled declarations like PromptInput on the root entry. Types only: a bridge never constructs an event, so no experimental_ value ships with them; docs/api_to_audit.md gets the audit entry. The bundled-types test pins that the names arrive inlined, and the echo stream test uses them. Co-Authored-By: Claude <noreply@anthropic.com>
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.
Stacked on #2193 (publish the parity harness). Layer 2 of 3 of the provider-gaps stack (#2193 → #2194 → #2195). Closes gap G-B from #2189.
What was wrong
A bridge's tests assert on what the runtime's assembler built from the bridge's
thread/deltastream, but@get-bb/plugin-sdk/provider-bridge/testingexported no name for that event. The echo canary spelled it asReturnType<BridgeDeltaEventCollector["assembleMessage"]>[number]and narrowed item events from that. The@get-bb/plugin-sdk/provider-bridgeentry deliberately does not re-export the event vocabulary (a bridge never constructs aThreadEvent), which is right for the authoring surface and wrong for the testing one.What changed
packages/plugin-sdk/src/provider-bridge-testing.tsre-exports, as types, from@bb/domain:ThreadEvent,ThreadEventItem,ThreadEventItemPresentation(+ThreadEventItemPresentationLabel/Icon/Tint), and the named item kindsThreadEventDelegationItem,ThreadEventExtensionItem,ThreadEventFileReadItem,ThreadEventSearchItem,ThreadEventPlanStepsItem,ThreadEventWebSearchItem,ThreadEventWebFetchItem,ThreadEventBackgroundTaskItem.rollup-plugin-dtsinlines them intobundled-types/bb-plugin-sdk-provider-bridge-testing.d.ts, the same way the root entry shipsPromptInput.Types only, no
experimental_value (AGENTS.md prefixes values; types in this entry are unprefixed by convention).docs/api_to_audit.mdgets audit item 7 on the testing-kit entry: the persisted vocabulary now has a second public home, and the kit may want to pin a grammar version before stabilizing.packages/plugin-sdk/src/__tests__/bundled-types.test.tspins that the names arrive inlined (nofrom '@bb/…', each name declared and in theexport type {}list).examples/plugins/echo-provider/provider-bridge.stream.test.tsusesThreadEventand drops theReturnTypeworkaround.No wire change;
HOST_DAEMON_PROTOCOL_VERSIONuntouched.How you verified
pnpm exec turbo run typecheck test --filter=@get-bb/plugin-sdk: 16 files, 128 tests pass (the new bundled-types assertion included; it fails on the previous commit because the names are absent from the.d.ts).pnpm exec turbo run typecheck test --filter=bb-plugin-echo-provider: 5 files, 21 tests pass with the named type.