mirror of
https://github.com/davidkaya/aryx.git
synced 2026-08-03 18:38:35 +02:00
feat: add approval checkpoints backend
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -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':
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user