MCPcopy
hub / github.com/TanStack/ai / createRunTrackingAdapter

Function createRunTrackingAdapter

packages/ai-client/tests/devtools.test.ts:134–154  ·  view source on GitHub ↗
(
    chunkSets: Array<Array<StreamChunk>>,
    runContexts: Array<RunAgentInputContext>,
  )

Source from the content-addressed store, hash-verified

132 }
133
134 function createRunTrackingAdapter(
135 chunkSets: Array<Array<StreamChunk>>,
136 runContexts: Array<RunAgentInputContext>,
137 ): ConnectConnectionAdapter {
138 let connectCount = 0
139 return {
140 async *connect(_messages, _data, abortSignal, runContext) {
141 if (runContext) {
142 runContexts.push(runContext)
143 }
144 const chunks = chunkSets[connectCount] ?? []
145 connectCount++
146 for (const chunk of chunks) {
147 if (abortSignal?.aborted) {
148 return
149 }
150 yield chunk
151 }
152 },
153 }
154 }
155
156 function textContentChunk(args: {
157 messageId: string

Callers 1

devtools.test.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected