MCPcopy Create free account
hub / github.com/Noumena-Network/code / collectQuery

Function collectQuery

src/query.test.ts:161–179  ·  view source on GitHub ↗
(
  stream: AsyncGenerator<unknown, unknown>,
)

Source from the content-addressed store, hash-verified

159}
160
161async function collectQuery(
162 stream: AsyncGenerator<unknown, unknown>,
163): Promise<{
164 events: unknown[]
165 terminal: unknown
166}> {
167 const events: unknown[] = []
168
169 while (true) {
170 const next = await stream.next()
171 if (next.done) {
172 return {
173 events,
174 terminal: next.value,
175 }
176 }
177 events.push(next.value)
178 }
179}
180
181function expectMetaUserMessage(events: unknown[], content: string) {
182 const userMessage = (events as Array<Record<string, unknown>>).find(

Callers 1

query.test.tsFile · 0.85

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected