-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathagent-graph.ts
More file actions
25 lines (20 loc) · 867 Bytes
/
Copy pathagent-graph.ts
File metadata and controls
25 lines (20 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { Component, computed, inject } from '@angular/core';
import { MatIconModule } from '@angular/material/icon';
import { AgentRegistry } from '../../core/agents/agent-registry.service';
@Component({
selector: 'app-agent-graph',
imports: [MatIconModule],
templateUrl: './agent-graph.html',
styleUrl: './agent-graph.scss',
})
export class AgentGraphComponent {
private readonly registry = inject(AgentRegistry);
protected readonly agents = this.registry.definitions;
protected readonly activeId = this.registry.activeAgentId;
protected readonly transitions = this.registry.transitions;
protected readonly hasHandedOff = computed(() => this.transitions().length > 0);
protected readonly lastTransition = computed(() => this.transitions().at(-1) ?? null);
protected isActive(id: string): boolean {
return this.activeId() === id;
}
}