Add ConversationEventMap and event-name mapping - #743
Draft
kraenhansen wants to merge 1 commit into
Draft
Conversation
Move Callbacks and CALLBACK_KEYS from types.ts to a new events.ts module that combines generated events with hand-written internal and extra events into a unified ConversationEventMap. Add CALLBACK_KEY_TO_EVENT_NAME mapping for wiring callbacks to event names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
kraenhansen
marked this pull request as draft
May 7, 2026 14:22
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.
Summary
packages/client/src/events.tscombining generated events (GeneratedEventMap) with hand-written internal and extra events into a unifiedConversationEventMapCallbacks,CALLBACK_KEYSfromtypes.tstoevents.tsand addCALLBACK_KEY_TO_EVENT_NAMEmapping tablevad-scoreinConversationEventMapfor backward-compatible{ vadScore }payload shapeConversationEventMapfrom the client packagePart of #738 (PR 3/6).
Test plan
pnpm turbo build check-types lintpasses for all packages (30/30 tasks)@elevenlabs/react,@elevenlabs/react-native, widget packages) build successfully🤖 Generated with Claude Code
Note
Low Risk
Primarily TypeScript type/export reshaping with a new mapping constant; runtime behavior is largely unchanged aside from consumers relying on old import locations.
Overview
Introduces a new
events.tsmodule that defines a unifiedConversationEventMapby combining generated wire events with internal/extra conversation events, including a backward-compatible override for thevad-scorepayload shape.Moves
CallbacksandCALLBACK_KEYSout oftypes.tsintoevents.ts, and adds aCALLBACK_KEY_TO_EVENT_NAMEtable to map callback property names (e.g.onMCPToolCall) to their corresponding emitted event names.Updates exports so
BaseConversation/packageindex.tsnow re-exportCallbacks,CALLBACK_KEYS, and the newConversationEventMapfromevents.ts, and trimstypes.tsto core shared types only.Reviewed by Cursor Bugbot for commit b5b5b87. Bugbot is set up for automated code reviews on this repo. Configure here.