mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-05 05:12:38 +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);
|
||||
|
|
|
|||
|
|
@ -173,6 +173,12 @@ const ipcSchemas = {
|
|||
}),
|
||||
res: ListRunsResponse,
|
||||
},
|
||||
'runs:delete': {
|
||||
req: z.object({
|
||||
runId: z.string(),
|
||||
}),
|
||||
res: z.object({ success: z.boolean() }),
|
||||
},
|
||||
'runs:events': {
|
||||
req: z.null(),
|
||||
res: z.null(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue