MCPcopy Create free account
hub / github.com/anomalyco/opencode / adapterState

Function adapterState

packages/opencode/src/session/llm/ai-sdk.ts:9–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

7type AISDKEvent = Result["fullStream"] extends AsyncIterable<infer T> ? T : never
8
9export function adapterState() {
10 return {
11 step: 0,
12 text: 0,
13 reasoning: 0,
14 currentTextID: undefined as string | undefined,
15 currentReasoningID: undefined as string | undefined,
16 toolNames: {} as Record<string, string>,
17 copilotTotalNanoAiu: undefined as number | undefined,
18 }
19}
20
21function finishReason(value: string | undefined): FinishReason {
22 return Schema.is(FinishReason)(value) ? value : "unknown"

Callers 1

toLLMEventsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected