refactor: route slack interactions through channel runtime

This commit is contained in:
Peter Steinberger
2026-03-28 05:01:50 +00:00
parent 16f8616d9d
commit ccf54f263a
3 changed files with 6 additions and 6 deletions

View File

@@ -1,11 +1,11 @@
import type { SlackActionMiddlewareArgs } from "@slack/bolt";
import type { Block, KnownBlock } from "@slack/web-api";
import { enqueueSystemEvent } from "openclaw/plugin-sdk/channel-runtime";
import {
buildPluginBindingResolvedText,
parsePluginBindingApprovalCustomId,
resolvePluginConversationBindingApproval,
} from "openclaw/plugin-sdk/conversation-runtime";
import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime";
import { dispatchPluginInteractiveHandler } from "openclaw/plugin-sdk/plugin-runtime";
import { SLACK_REPLY_BUTTON_ACTION_ID, SLACK_REPLY_SELECT_ACTION_ID } from "../../blocks-render.js";
import { authorizeSlackSystemEventSender } from "../auth.js";

View File

@@ -1,4 +1,4 @@
import { enqueueSystemEvent } from "openclaw/plugin-sdk/infra-runtime";
import { enqueueSystemEvent } from "openclaw/plugin-sdk/channel-runtime";
import { parseSlackModalPrivateMetadata } from "../../modal-metadata.js";
import { authorizeSlackSystemEventSender } from "../auth.js";
import type { SlackMonitorContext } from "../context.js";

View File

@@ -167,15 +167,15 @@ function createContext(overrides?: {
describe("registerSlackInteractionEvents", () => {
beforeAll(async () => {
vi.resetModules();
const infraRuntime = await import("openclaw/plugin-sdk/infra-runtime");
const channelRuntime = await import("openclaw/plugin-sdk/channel-runtime");
const pluginRuntime = await import("openclaw/plugin-sdk/plugin-runtime");
const conversationBinding = await import("../../../../../src/plugins/conversation-binding.js");
enqueueSystemEventSpy = vi
.spyOn(infraRuntime, "enqueueSystemEvent")
.mockImplementation(((...args: Parameters<typeof infraRuntime.enqueueSystemEvent>) =>
.spyOn(channelRuntime, "enqueueSystemEvent")
.mockImplementation(((...args: Parameters<typeof channelRuntime.enqueueSystemEvent>) =>
(enqueueSystemEventMock as (...innerArgs: unknown[]) => boolean)(
...args,
)) as typeof infraRuntime.enqueueSystemEvent);
)) as typeof channelRuntime.enqueueSystemEvent);
dispatchPluginInteractiveHandlerSpy = vi
.spyOn(pluginRuntime, "dispatchPluginInteractiveHandler")
.mockImplementation(((