MCPcopy Index your code
hub / github.com/anomalyco/opencode / adapt

Function adapt

packages/opencode/test/session/llm.test.ts:178–183  ·  view source on GitHub ↗
(events: ReadonlyArray<AISDKAdapterEvent>)

Source from the content-addressed store, hash-verified

176 type AISDKAdapterEvent = Parameters<typeof LLMAISDK.toLLMEvents>[1]
177
178 const adapt = (events: ReadonlyArray<AISDKAdapterEvent>) => {
179 const state = LLMAISDK.adapterState()
180 return Effect.runPromise(
181 Effect.forEach(events, (event) => LLMAISDK.toLLMEvents(state, event)).pipe(Effect.map((items) => items.flat())),
182 )
183 }
184 // oxlint-disable-next-line typescript-eslint/no-unsafe-type-assertion -- tests defensive adapter branches outside AI SDK's current typed surface
185 const uncheckedAdapterEvent = (input: unknown) => input as AISDKAdapterEvent
186

Callers 1

llm.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected