mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-22 23:41:07 +00:00
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:
@@ -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?.({
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user