feat: add approval checkpoints backend

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-24 19:48:58 +01:00
co-authored by Copilot
parent e7dfb66038
commit 2aa8d73b2d
28 changed files with 1471 additions and 23 deletions
+2
View File
@@ -59,6 +59,8 @@ function EventIcon({ kind, status }: { kind: RunTimelineEventRecord['kind']; sta
return <ArrowRight className={`${base} text-amber-400`} />;
case 'tool-call':
return <Wrench className={`${base} text-violet-400`} />;
case 'approval':
return <AlertTriangle className={`${base} ${status === 'running' ? 'text-amber-400 animate-pulse' : status === 'error' ? 'text-red-400' : 'text-emerald-400'}`} />;
case 'message':
return <MessageSquare className={`${base} ${status === 'running' ? 'text-blue-400 animate-pulse' : status === 'error' ? 'text-red-400' : 'text-emerald-400'}`} />;
case 'run-completed':
+12 -3
View File
@@ -78,6 +78,14 @@ export function formatEventLabel(event: RunTimelineEventRecord): string {
return event.toolName
? `${event.agentName ?? 'Agent'} used ${event.toolName}`
: `${event.agentName ?? 'Agent'} tool call`;
case 'approval':
if (event.status === 'completed') {
return event.approvalTitle ? `${event.approvalTitle} approved` : 'Approval granted';
}
if (event.status === 'error') {
return event.approvalTitle ? `${event.approvalTitle} rejected` : 'Approval rejected';
}
return event.approvalTitle ?? 'Approval requested';
case 'message':
return event.agentName ?? 'Response';
case 'run-completed':
@@ -132,9 +140,10 @@ const eventKindOrder: Record<RunTimelineEventKind, number> = {
'thinking': 1,
'handoff': 2,
'tool-call': 3,
'message': 4,
'run-completed': 5,
'run-failed': 5,
'approval': 4,
'message': 5,
'run-completed': 6,
'run-failed': 6,
};
export function isTerminalEvent(kind: RunTimelineEventKind): boolean {