mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-29 18:36:23 +02:00
feat: add remove chat button and logic
This commit is contained in:
parent
c5c36ed0e4
commit
503693775a
6 changed files with 46 additions and 2 deletions
|
|
@ -12,6 +12,7 @@ export interface IRunsRepo {
|
|||
fetch(id: string): Promise<z.infer<typeof Run>>;
|
||||
list(cursor?: string): Promise<z.infer<typeof ListRunsResponse>>;
|
||||
appendEvents(runId: string, events: z.infer<typeof RunEvent>[]): Promise<void>;
|
||||
delete(id: string): Promise<void>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -236,4 +237,9 @@ export class FSRunsRepo implements IRunsRepo {
|
|||
...(nextCursor ? { nextCursor } : {}),
|
||||
};
|
||||
}
|
||||
|
||||
async delete(id: string): Promise<void> {
|
||||
const filePath = path.join(WorkDir, 'runs', `${id}.jsonl`);
|
||||
await fsp.unlink(filePath);
|
||||
}
|
||||
}
|
||||
|
|
@ -65,6 +65,11 @@ export async function stop(runId: string, force: boolean = false): Promise<void>
|
|||
// This avoids duplicate events and ensures proper sequencing.
|
||||
}
|
||||
|
||||
export async function deleteRun(runId: string): Promise<void> {
|
||||
const repo = container.resolve<IRunsRepo>('runsRepo');
|
||||
await repo.delete(runId);
|
||||
}
|
||||
|
||||
export async function fetchRun(runId: string): Promise<z.infer<typeof Run>> {
|
||||
const repo = container.resolve<IRunsRepo>('runsRepo');
|
||||
return repo.fetch(runId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue