mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-29 10:50:58 +00:00
refactor: route slack interactions through channel runtime
This commit is contained in:
@@ -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";
|
||||
|
||||
@@ -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";
|
||||
|
||||
@@ -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(((
|
||||
|
||||
Reference in New Issue
Block a user