mirror of
https://github.com/openclaw/openclaw.git
synced 2026-06-29 15:13:37 +00:00
22 lines
655 B
TypeScript
22 lines
655 B
TypeScript
// 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}`);
|
|
}
|
|
return parts.join(" ");
|
|
}
|