chore: Enable "curly" rule to avoid single-statement if confusion/errors.

This commit is contained in:
cpojer
2026-01-31 16:19:20 +09:00
parent 009b16fab8
commit 5ceff756e1
1266 changed files with 27871 additions and 9393 deletions

View File

@@ -11,7 +11,9 @@ const CORE_MESSAGING_TOOLS = new Set(["sessions_send", "message"]);
// Provider docking: any plugin with `actions` opts into messaging tool handling.
export function isMessagingTool(toolName: string): boolean {
if (CORE_MESSAGING_TOOLS.has(toolName)) return true;
if (CORE_MESSAGING_TOOLS.has(toolName)) {
return true;
}
const providerId = normalizeChannelId(toolName);
return Boolean(providerId && getChannelPlugin(providerId)?.actions);
}
@@ -21,13 +23,19 @@ export function isMessagingToolSendAction(
args: Record<string, unknown>,
): boolean {
const action = typeof args.action === "string" ? args.action.trim() : "";
if (toolName === "sessions_send") return true;
if (toolName === "sessions_send") {
return true;
}
if (toolName === "message") {
return action === "send" || action === "thread-reply";
}
const providerId = normalizeChannelId(toolName);
if (!providerId) return false;
if (!providerId) {
return false;
}
const plugin = getChannelPlugin(providerId);
if (!plugin?.actions?.extractToolSend) return false;
if (!plugin?.actions?.extractToolSend) {
return false;
}
return Boolean(plugin.actions.extractToolSend({ args })?.to);
}