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