Restore Slack local file upload parity with CVE-era local media allowlist enforcement by threading `mediaLocalRoots` through the Slack send call chain. - pass `ctx.mediaLocalRoots` from Slack channel action adapter into `handleSlackAction` - add and forward `mediaLocalRoots` in Slack action context/send path - pass `mediaLocalRoots` into `sendMessageSlack` for upload allowlist enforcement - add changelog entry with attribution for this behavior fix Co-authored-by: 2233admin <1497479966@qq.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import { handleSlackAction, type SlackActionContext } from "../../agents/tools/slack-actions.js";
|
|
import { handleSlackMessageAction } from "../../plugin-sdk/slack-message-actions.js";
|
|
import { extractSlackToolSend, listSlackMessageActions } from "../../slack/message-actions.js";
|
|
import { resolveSlackChannelId } from "../../slack/targets.js";
|
|
import type { ChannelMessageActionAdapter } from "./types.js";
|
|
|
|
export function createSlackActions(providerId: string): ChannelMessageActionAdapter {
|
|
return {
|
|
listActions: ({ cfg }) => listSlackMessageActions(cfg),
|
|
extractToolSend: ({ args }) => extractSlackToolSend(args),
|
|
handleAction: async (ctx) => {
|
|
return await handleSlackMessageAction({
|
|
providerId,
|
|
ctx,
|
|
normalizeChannelId: resolveSlackChannelId,
|
|
includeReadThreadId: true,
|
|
invoke: async (action, cfg, toolContext) =>
|
|
await handleSlackAction(action, cfg, {
|
|
...(toolContext as SlackActionContext | undefined),
|
|
mediaLocalRoots: ctx.mediaLocalRoots,
|
|
}),
|
|
});
|
|
},
|
|
};
|
|
}
|