()
| 946 | } |
| 947 | |
| 948 | private nextGeneratedAgentId(): string { |
| 949 | while (true) { |
| 950 | const id = `agent-${this.agentIdCounter++}`; |
| 951 | if (this.agents.has(id)) continue; |
| 952 | if (this.metadata.agents[id] !== undefined) continue; |
| 953 | return id; |
| 954 | } |
| 955 | } |
| 956 | |
| 957 | private requireMainAgent(): Agent { |
| 958 | const agent = this.getReadyAgent('main'); |