openclaw / src /commands /agents.binding-format.ts
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
76289e7 verified
Raw History Blame Contribute Delete
738 Bytes
// 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(" ");
}