feat(ai-sdk): neutral queue/broadcast adapter seam (configureAiQueue)#51
Merged
Merged
Conversation
… - drop @rudderjs/queue + @rudderjs/broadcast
This was referenced Jun 27, 2026
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.
What
Resolves the last
@rudderjs/*coupling in the@gemstack/ai-sdkengine.agent.queue('...').send()and.broadcast(channel)no longer dynamically import@rudderjs/queueor@rudderjs/broadcast. Instead, the host registers a neutral adapter once at startup, mirroring the existingcache-adapter.ts/storage-adapter.tsseams.New public API
configureAiQueue({ dispatch, broadcast })registers the adapters and returns a restore function (handy in tests):New exports from
@gemstack/ai-sdk:configureAiQueue(function)QueueDispatch,QueueBroadcast(types, in newqueue-adapter.ts)BroadcastOptions(type)Behavior of the defaults
When no adapter is registered, the defaults no longer try to import
@rudderjs/*. They fail loudly with a clear "configure it" message instead:agent.queue()throws: "agent.queue() needs a queue adapter. Register one at startup with configureAiQueue({ dispatch }).".broadcast()throws: ".broadcast() needs a broadcast adapter. Register one with configureAiQueue({ broadcast })."Scope
This is the engine half. A follow-up
@rudderjs/aiPR will callconfigureAiQueueinAiProvider.boot(wiring@rudderjs/queue'sdispatchand@rudderjs/broadcast'sbroadcast), so Rudder apps keep working with no app change. This PR does not touch the Rudder repo.Verification
pnpm --filter @gemstack/ai-sdk buildis clean.pnpm --filter @gemstack/ai-sdk testpasses (902 tests).grep -rn '@rudderjs' packages/ai-sdk/src(excluding tests) is now empty.Closes #48