Slack: add some fixes and connect it all up

This commit is contained in:
Shadow
2026-01-04 01:53:15 -06:00
parent 02d7e286ea
commit 8c38a7fee8
45 changed files with 1568 additions and 89 deletions

View File

@@ -441,6 +441,12 @@ function shouldIncludeDiscordTool(surface?: string): boolean {
return normalized === "discord" || normalized.startsWith("discord:");
}
function shouldIncludeSlackTool(surface?: string): boolean {
const normalized = normalizeSurface(surface);
if (!normalized) return false;
return normalized === "slack" || normalized.startsWith("slack:");
}
export function createClawdisCodingTools(options?: {
bash?: BashToolDefaults & ProcessToolDefaults;
surface?: string;
@@ -494,9 +500,12 @@ export function createClawdisCodingTools(options?: {
}),
];
const allowDiscord = shouldIncludeDiscordTool(options?.surface);
const filtered = allowDiscord
? tools
: tools.filter((tool) => tool.name !== "discord");
const allowSlack = shouldIncludeSlackTool(options?.surface);
const filtered = tools.filter((tool) => {
if (tool.name === "discord") return allowDiscord;
if (tool.name === "slack") return allowSlack;
return true;
});
const sandboxed = sandbox
? filterToolsByPolicy(filtered, sandbox.tools)
: filtered;