MCPcopy Index your code
hub / github.com/TanStack/ai / fetch

Function fetch

packages/ai-sandbox-cloudflare/src/coordinator.ts:190–204  ·  view source on GitHub ↗
(request: Request)

Source from the content-addressed store, hash-verified

188 // ===========================================================================
189
190 override async fetch(request: Request): Promise<Response> {
191 const url = new URL(request.url)
192 const parts = url.pathname.split('/').filter(Boolean)
193
194 if (parts[0] === 'runs' && typeof parts[1] === 'string') {
195 if (parts[2] === 'stream') return this.acceptStream(parts[1], request)
196 if (parts.length === 2 && request.method === 'GET') {
197 const record = await this.status(parts[1])
198 return record
199 ? this.jsonResponse(record)
200 : this.jsonResponse({ error: 'unknown run' }, 404)
201 }
202 }
203 return this.handleRoute(request, parts)
204 }
205
206 // ===========================================================================
207 // WebSocket streaming with hibernation + resumable cursor

Callers

nothing calls this directly

Calls 1

statusMethod · 0.45

Tested by

no test coverage detected