MCPcopy
hub / github.com/BuilderIO/agent-native / listRuns

Function listRuns

packages/core/src/progress/store.ts:213–229  ·  view source on GitHub ↗
(
  owner: string,
  options: ListRunsOptions = {},
)

Source from the content-addressed store, hash-verified

211}
212
213export async function listRuns(
214 owner: string,
215 options: ListRunsOptions = {},
216): Promise<AgentRun[]> {
217 await ensureTable();
218 const client = getDbExec();
219 const limit = normalizeLimit(options.limit);
220 let where = `owner = ?`;
221 const args: Array<string | number> = [owner];
222 if (options.activeOnly) where += ` AND status = 'running'`;
223 args.push(limit);
224 const { rows } = await client.execute({
225 sql: `SELECT * FROM progress_runs WHERE ${where} ORDER BY started_at DESC LIMIT ?`,
226 args,
227 });
228 return rows.map((r) => parseRow(r as Record<string, unknown>));
229}
230
231export async function deleteRun(id: string, owner: string): Promise<boolean> {
232 await ensureTable();

Callers 3

store.spec.tsFile · 0.85
createProgressHandlerFunction · 0.85

Calls 5

getDbExecFunction · 0.85
ensureTableFunction · 0.70
normalizeLimitFunction · 0.70
parseRowFunction · 0.70
executeMethod · 0.65

Tested by

no test coverage detected