fix: format verbose tool output by channel
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user