List 列出所有 Agent ID
(prefix string)
| 76 | |
| 77 | // List 列出所有 Agent ID |
| 78 | func (p *Pool) List(prefix string) []string { |
| 79 | p.mu.RLock() |
| 80 | defer p.mu.RUnlock() |
| 81 | |
| 82 | ids := make([]string, 0, len(p.agents)) |
| 83 | for id := range p.agents { |
| 84 | if prefix == "" || strings.HasPrefix(id, prefix) { |
| 85 | ids = append(ids, id) |
| 86 | } |
| 87 | } |
| 88 | return ids |
| 89 | } |
| 90 | |
| 91 | // Status 获取 Agent 状态 |
| 92 | func (p *Pool) Status(agentID string) (*types.AgentStatus, error) { |
no outgoing calls