( agentId: string, )
| 46 | * Returns null if the ID doesn't contain the @ separator. |
| 47 | */ |
| 48 | export function parseAgentId( |
| 49 | agentId: string, |
| 50 | ): { agentName: string; teamName: string } | null { |
| 51 | const atIndex = agentId.indexOf('@') |
| 52 | if (atIndex === -1) { |
| 53 | return null |
| 54 | } |
| 55 | return { |
| 56 | agentName: agentId.slice(0, atIndex), |
| 57 | teamName: agentId.slice(atIndex + 1), |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | /** |
| 62 | * Formats a request ID in the format `{requestType}-{timestamp}@{agentId}`. |
no outgoing calls
no test coverage detected