|
649 | 649 |
|
650 | 650 | switch (eventType) { |
651 | 651 | case 'agent.created': |
652 | | - return 'Agent ' + (attrs['agent.id'] || '') + ' provisioned'; |
| 652 | + return (attrs['user.id'] || '') + ' → ' + (attrs['agent.id'] || ''); |
653 | 653 | case 'agent.terminated': |
654 | 654 | return 'Agent ' + (attrs['agent.id'] || '') + ' terminated'; |
655 | 655 | case 'request.allowed': |
656 | 656 | return (attrs['http.host'] || '') + ' -- allowed'; |
657 | 657 | case 'request.denied': |
658 | 658 | return (attrs['http.host'] || '') + ' -- denied' + (attrs['denial.reason'] ? ': ' + attrs['denial.reason'] : ''); |
| 659 | + case 'agent.prompted': |
| 660 | + return (attrs['user.id'] || 'user') + ' → ' + (attrs['agent.id'] || 'agent'); |
659 | 661 | default: |
660 | 662 | if (attrs['agent.id']) return eventType + ' for ' + attrs['agent.id']; |
661 | 663 | return eventType; |
|
711 | 713 | if (userId) Topology.removeUserNode(userId); |
712 | 714 | } |
713 | 715 |
|
714 | | - // User actions — light up the user→platform edge. |
715 | | - if (eventType === 'agent.requested' || eventType === 'prompt.sent' || eventType === 'permission.change_requested' || eventType === 'termination.requested') { |
| 716 | + // agent.prompted: user→platform then platform→agent sequentially |
| 717 | + if (eventType === 'agent.prompted') { |
716 | 718 | const userId = attrs['user.id'] || ''; |
717 | | - if (userId) { |
718 | | - Topology.highlightEdge(userId, Topology.EDGE_HIGHLIGHT_MS); |
719 | | - } |
| 719 | + if (userId) Topology.highlightEdge(userId, Topology.EDGE_HIGHLIGHT_MS); |
| 720 | + if (agentId) setTimeout(() => Topology.highlightEdge('platform-' + agentId, Topology.EDGE_HIGHLIGHT_MS), 400); |
720 | 721 | } |
721 | 722 |
|
722 | 723 | // Agent lifecycle. Light up the platform→agent edge: the platform is |
|
731 | 732 | Topology.removeAgentRuntimeNode(agentId); |
732 | 733 | } |
733 | 734 |
|
734 | | - // Prompt delivered: platform exec'd into the agent via the supervisor. |
735 | | - if (eventType === 'agent.prompted') { |
736 | | - if (agentId) Topology.highlightEdge('platform-' + agentId, Topology.EDGE_HIGHLIGHT_MS); |
737 | | - } |
738 | | - |
739 | 735 | // Gateway decisions |
740 | 736 | if (eventType === 'auth.allowed' || eventType === 'request.allowed' || eventType === 'request.denied' || eventType === 'permission.checked') { |
741 | 737 | const decision = { |
|
0 commit comments