| 279 | * Structure: ~/.claude/teams/{team_name}/inboxes/{agent_name}.json |
| 280 | */ |
| 281 | export function getInboxPath(agentName: string, teamName?: string): string { |
| 282 | const team = teamName || getTeamName() || 'default' |
| 283 | const safeTeam = sanitizePathComponent(team) |
| 284 | const safeAgentName = sanitizePathComponent(agentName) |
| 285 | const inboxDir = join(getTeamsDir(), safeTeam, 'inboxes') |
| 286 | const fullPath = join(inboxDir, `${safeAgentName}.json`) |
| 287 | logForDebugging( |
| 288 | `[TeammateMailbox] getInboxPath: agent=${agentName}, team=${team}, fullPath=${fullPath}`, |
| 289 | ) |
| 290 | return fullPath |
| 291 | } |
| 292 | |
| 293 | /** |
| 294 | * Ensure the inbox directory exists for a team |