refactor: tighten plugin sdk channel surfaces

This commit is contained in:
Peter Steinberger
2026-03-19 00:46:29 +00:00
parent f19cb738af
commit 002cc07322
18 changed files with 72 additions and 72 deletions

View File

@@ -1,5 +1,5 @@
import { createChannelPairingChallengeIssuer } from "openclaw/plugin-sdk/channel-pairing";
import { formatAllowlistMatchMeta } from "openclaw/plugin-sdk/channel-runtime";
import { issuePairingChallenge } from "openclaw/plugin-sdk/conversation-runtime";
import { upsertChannelPairingRequest } from "openclaw/plugin-sdk/conversation-runtime";
import { resolveSlackAllowListMatch } from "./allow-list.js";
import type { SlackMonitorContext } from "./context.js";
@@ -37,11 +37,8 @@ export async function authorizeSlackDirectMessage(params: {
}
if (params.ctx.dmPolicy === "pairing") {
await issuePairingChallenge({
await createChannelPairingChallengeIssuer({
channel: "slack",
senderId: params.senderId,
senderIdLine: `Your Slack user id: ${params.senderId}`,
meta: { name: senderName },
upsertPairingRequest: async ({ id, meta }) =>
await upsertChannelPairingRequest({
channel: "slack",
@@ -49,6 +46,10 @@ export async function authorizeSlackDirectMessage(params: {
accountId: params.accountId,
meta,
}),
})({
senderId: params.senderId,
senderIdLine: `Your Slack user id: ${params.senderId}`,
meta: { name: senderName },
sendPairingReply: params.sendPairingReply,
onCreated: () => {
params.log(