fix: format verbose tool output by channel

This commit is contained in:
Peter Steinberger
2026-01-17 10:17:57 +00:00
parent 4ca38286d8
commit 31e8ecca10
12 changed files with 86 additions and 7 deletions

View File

@@ -17,6 +17,15 @@ import { getActivePluginRegistry } from "../plugins/runtime.js";
export const INTERNAL_MESSAGE_CHANNEL = "webchat" as const;
export type InternalMessageChannel = typeof INTERNAL_MESSAGE_CHANNEL;
const MARKDOWN_CAPABLE_CHANNELS = new Set<string>([
"slack",
"telegram",
"signal",
"discord",
"tui",
INTERNAL_MESSAGE_CHANNEL,
]);
export { GATEWAY_CLIENT_NAMES, GATEWAY_CLIENT_MODES };
export type { GatewayClientName, GatewayClientMode };
export { normalizeGatewayClientName, normalizeGatewayClientMode };
@@ -112,3 +121,9 @@ export function resolveMessageChannel(
): string | undefined {
return normalizeMessageChannel(primary) ?? normalizeMessageChannel(fallback);
}
export function isMarkdownCapableMessageChannel(raw?: string | null): boolean {
const channel = normalizeMessageChannel(raw);
if (!channel) return false;
return MARKDOWN_CAPABLE_CHANNELS.has(channel);
}