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

Method listCheckpoints

packages/ai-sandbox-sprites/src/client.ts:295–320  ·  view source on GitHub ↗
(
    name: string,
    signal?: AbortSignal,
  )

Source from the content-addressed store, hash-verified

293 }
294
295 async listCheckpoints(
296 name: string,
297 signal?: AbortSignal,
298 ): Promise<Array<SpriteCheckpoint>> {
299 const url = this.spritePath(name, '/checkpoints')
300 const response = await fetch(url, {
301 method: 'GET',
302 headers: this.headers(),
303 ...(signal ? { signal } : {}),
304 })
305 if (!response.ok) await this.fail('GET', url, response)
306 const body = (await response.json()) as Array<{
307 id?: unknown
308 create_time?: unknown
309 comment?: unknown
310 is_auto?: unknown
311 }>
312 return body.map((entry) => ({
313 id: String(entry.id ?? ''),
314 ...(typeof entry.create_time === 'string'
315 ? { createTime: entry.create_time }
316 : {}),
317 ...(typeof entry.comment === 'string' ? { comment: entry.comment } : {}),
318 isAuto: entry.is_auto === true,
319 }))
320 }
321
322 /**
323 * Create a checkpoint and return its new version id (e.g. `v3`). The create

Callers 2

checkpointVersionsMethod · 0.95
sprites.test.tsFile · 0.45

Calls 5

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

Tested by

no test coverage detected