mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 08:56:22 +02:00
add list runs endpoint
This commit is contained in:
parent
1822deadc1
commit
338cc3d2f9
2 changed files with 91 additions and 2 deletions
|
|
@ -12,9 +12,8 @@ import { ModelConfig, Provider } from "./models/models.js";
|
|||
import { IAgentsRepo } from "./agents/repo.js";
|
||||
import { Agent } from "./agents/agents.js";
|
||||
import { AskHumanResponsePayload, authorizePermission, createMessage, createRun, replyToHumanInputRequest, Run, stop, ToolPermissionAuthorizePayload } from './runs/runs.js';
|
||||
import { IRunsRepo, ListRunsResponse, CreateRunOptions } from './runs/repo.js';
|
||||
import { IRunsRepo, CreateRunOptions, ListRunsResponse } from './runs/repo.js';
|
||||
import { IBus } from './application/lib/bus.js';
|
||||
import { RunEvent } from './entities/run-events.js';
|
||||
|
||||
let id = 0;
|
||||
|
||||
|
|
@ -462,6 +461,31 @@ const routes = new Hono()
|
|||
return c.json(run);
|
||||
}
|
||||
)
|
||||
.get(
|
||||
'/runs',
|
||||
describeRoute({
|
||||
summary: 'List runs',
|
||||
description: 'List all runs',
|
||||
responses: {
|
||||
200: {
|
||||
description: 'Runs list',
|
||||
content: {
|
||||
'application/json': {
|
||||
schema: resolver(ListRunsResponse),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}),
|
||||
validator('query', z.object({
|
||||
cursor: z.string().optional(),
|
||||
})),
|
||||
async (c) => {
|
||||
const repo = container.resolve<IRunsRepo>('runsRepo');
|
||||
const runs = await repo.list(c.req.valid('query').cursor);
|
||||
return c.json(runs);
|
||||
}
|
||||
)
|
||||
.post(
|
||||
'/runs/:runId/messages/new',
|
||||
describeRoute({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue