Slack: import directory helpers (#49930)

import the config-backed Slack directory helpers into the Slack channel plugin so directory.listPeers and directory.listGroups no longer throw at runtime, and add a regression test covering configured DM peer listing
This commit is contained in:
scoootscooob
2026-03-18 10:24:17 -07:00
committed by GitHub
parent ff326e90c3
commit b49946a67e
2 changed files with 26 additions and 0 deletions

View File

@@ -171,6 +171,28 @@ describe("slackPlugin outbound", () => {
});
});
describe("slackPlugin directory", () => {
it("lists configured peers without throwing a ReferenceError", async () => {
const listPeers = slackPlugin.directory?.listPeers;
expect(listPeers).toBeDefined();
await expect(
listPeers!({
cfg: {
channels: {
slack: {
dms: {
U123: {},
},
},
},
},
runtime: undefined,
}),
).resolves.toEqual([{ id: "user:u123", kind: "user" }]);
});
});
describe("slackPlugin agentPrompt", () => {
it("tells agents interactive replies are disabled by default", () => {
const hints = slackPlugin.agentPrompt?.messageToolHints?.({

View File

@@ -26,6 +26,10 @@ import type { SlackActionContext } from "./action-runtime.js";
import { parseSlackBlocksInput } from "./blocks-input.js";
import { createSlackActions } from "./channel-actions.js";
import { createSlackWebClient } from "./client.js";
import {
listSlackDirectoryGroupsFromConfig,
listSlackDirectoryPeersFromConfig,
} from "./directory-config.js";
import { resolveSlackGroupRequireMention, resolveSlackGroupToolPolicy } from "./group-policy.js";
import { isSlackInteractiveRepliesEnabled } from "./interactive-replies.js";
import { normalizeAllowListLower } from "./monitor/allow-list.js";