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

Method fsList

packages/ai-sandbox-sprites/src/client.ts:275–293  ·  view source on GitHub ↗
(name: string, path: string)

Source from the content-addressed store, hash-verified

273 }
274
275 async fsList(name: string, path: string): Promise<Array<SpriteFsEntry>> {
276 const url = this.spritePath(
277 name,
278 `/fs/list?path=${encodeURIComponent(path)}`,
279 )
280 const response = await fetch(url, {
281 method: 'GET',
282 headers: this.headers(),
283 })
284 if (!response.ok) await this.fail('GET', url, response)
285 const body = (await response.json()) as {
286 entries?: Array<{ name?: unknown; path?: unknown; isDir?: unknown }>
287 }
288 return (body.entries ?? []).map((entry) => ({
289 name: String(entry.name ?? ''),
290 path: String(entry.path ?? ''),
291 type: entry.isDir === true ? ('dir' as const) : ('file' as const),
292 }))
293 }
294
295 async listCheckpoints(
296 name: string,

Callers 1

constructorMethod · 0.80

Calls 5

spritePathMethod · 0.95
headersMethod · 0.95
failMethod · 0.95
jsonMethod · 0.80
fetchFunction · 0.50

Tested by

no test coverage detected