File size: 738 Bytes
76289e7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// Human-readable formatting for agent routing binding match criteria.
import type { AgentRouteBinding } from "../config/types.js";

/** Render one route binding as a compact CLI line fragment. */
export function describeBinding(binding: AgentRouteBinding): string {
  const match = binding.match;
  const parts = [match.channel];
  if (match.accountId) {
    parts.push(`accountId=${match.accountId}`);
  }
  if (match.peer) {
    parts.push(`peer=${match.peer.kind}:${match.peer.id}`);
  }
  if (match.guildId) {
    parts.push(`guild=${match.guildId}`);
  }
  if (match.teamId) {
    parts.push(`team=${match.teamId}`);
  }
  if (match.roles?.length) {
    parts.push(`roles=${match.roles.join(",")}`);
  }
  return parts.join(" ");
}