MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / list

Function list

ui/src/api/headless.ts:45–57  ·  view source on GitHub ↗

List headless runs across all workspaces, newest-first.

(
    opts: { wsId?: string; status?: HeadlessTaskStatus; limit?: number } = {},
  )

Source from the content-addressed store, hash-verified

43export const headlessApi = {
44 /** List headless runs across all workspaces, newest-first. */
45 async list(
46 opts: { wsId?: string; status?: HeadlessTaskStatus; limit?: number } = {},
47 ): Promise<HeadlessTaskRecord[]> {
48 const q = new URLSearchParams()
49 if (opts.wsId) q.set('wsId', opts.wsId)
50 if (opts.status) q.set('status', opts.status)
51 if (opts.limit) q.set('limit', String(opts.limit))
52 const qs = q.toString()
53 const { tasks } = await fetchJson<{ tasks: HeadlessTaskRecord[] }>(
54 `/api/headless${qs ? `?${qs}` : ''}`,
55 )
56 return tasks
57 },
58
59 /** Tail of a run's on-disk stdout/stderr log (poll while running). */
60 async output(taskId: string, opts: { tailBytes?: number } = {}): Promise<HeadlessOutput> {

Callers

nothing calls this directly

Calls 2

setMethod · 0.65
toStringMethod · 0.45

Tested by

no test coverage detected