Skip to content

Changed: Update vendored types for eve 0.47.3 - #2448

Draft
David Elner (delner) wants to merge 1 commit into
mainfrom
fix/eve-vendored-types-modern-eve
Draft

Changed: Update vendored types for eve 0.47.3#2448
David Elner (delner) wants to merge 1 commit into
mainfrom
fix/eve-vendored-types-modern-eve

Conversation

@delner

Copy link
Copy Markdown
Contributor

Problem

Consumers on current Eve cannot compile against braintrustEveHook or braintrustEveInstrumentation without an as never cast. Four vendored types in js/src/vendor-sdk-types/eve.ts have drifted from Eve's:

Vendored type Drift
EveHookDefinition.events Eve's HookEventMap is a closed map it grows over time (0.52 exposes 33+ events). Our "*" handler was typed against a narrower union, so Eve's event type is no longer assignable.
EveInstrumentationDefinition.events Eve dropped the index signature and now requires step.started to return a result rather than void.
EveInstrumentationModelInput.messages Eve uses the AI SDK's ModelMessage, which we hand-duplicated. The copy drifted from ai@7.
EveProviderState.get() Eve returns an interface-based JSON union that is not structurally assignable to ours.

The old types fail identically on 0.37.1, the version the e2e scenario already pinned and passed, because nothing in the repo typechecks the vendored types. Runtime was never affected, which is why the drift went unnoticed.

Why this fixes it

The boundary types Eve hands us are now typed loosely and narrowed defensively at the point of use, so they no longer track ai's shape and cannot silently re-drift. The detailed part types stay as our capture contract rather than as a claim about Eve's types, matching the existing AISDKMessage pattern in ai-sdk-common.ts. Both as never casts become unnecessary.

Validation

Compiles clean against 0.22.1, 0.37.1, 0.47.6, 0.48.0, 0.50.0, 0.52.1, 0.52.2. Typecheck and the 27 Eve unit tests pass. No runtime behaviour change: the only substantive one, filtering unrecognized messages at capture, mirrors the allowlist isCapturedModelInput already applies on read back, so a malformed message now drops itself instead of discarding the whole captured input.

Known gap, not addressed here

Nothing typechecks the vendored types: js/ has no eve dependency and the e2e harness has no tsc step, so this contract stays unenforced and can drift again. Closing it needs its own change and is deliberately not faked here with scenario code that merely looks checked.

@delner David Elner (delner) self-assigned this Sep 9, 2026
@delner David Elner (delner) added the javascript Pull requests that update javascript code label Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant