mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 00:52:05 +00:00
fix(ci): restore extension runtime seams
This commit is contained in:
@@ -66,7 +66,7 @@ import {
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
} from "./runtime-api.js";
|
||||
import { getSlackRuntime } from "./runtime.js";
|
||||
import { getOptionalSlackRuntime, getSlackRuntime } from "./runtime.js";
|
||||
import { fetchSlackScopes } from "./scopes.js";
|
||||
import { sendMessageSlack } from "./send.js";
|
||||
import { slackSetupAdapter } from "./setup-core.js";
|
||||
@@ -96,6 +96,10 @@ function resolveSlackProbe() {
|
||||
return probeSlack;
|
||||
}
|
||||
|
||||
function resolveSlackHandleAction() {
|
||||
return getOptionalSlackRuntime()?.channel?.slack?.handleSlackAction ?? handleSlackAction;
|
||||
}
|
||||
|
||||
// Select the appropriate Slack token for read/write operations.
|
||||
function getTokenForOperation(
|
||||
account: ResolvedSlackAccount,
|
||||
@@ -364,7 +368,7 @@ export const slackPlugin: ChannelPlugin<ResolvedSlackAccount, SlackProbe> = crea
|
||||
},
|
||||
actions: createSlackActions(SLACK_CHANNEL, {
|
||||
invoke: async (action, cfg, toolContext) =>
|
||||
await handleSlackAction(
|
||||
await resolveSlackHandleAction()(
|
||||
action,
|
||||
cfg as OpenClawConfig,
|
||||
toolContext as SlackActionContext | undefined,
|
||||
|
||||
@@ -1,9 +1,20 @@
|
||||
import type { PluginRuntime } from "openclaw/plugin-sdk/core";
|
||||
import { createPluginRuntimeStore } from "openclaw/plugin-sdk/runtime-store";
|
||||
|
||||
type SlackChannelRuntime = {
|
||||
handleSlackAction?: typeof import("./action-runtime.js").handleSlackAction;
|
||||
};
|
||||
|
||||
export type SlackRuntime = PluginRuntime & {
|
||||
channel: PluginRuntime["channel"] & {
|
||||
slack?: SlackChannelRuntime;
|
||||
};
|
||||
};
|
||||
|
||||
const {
|
||||
setRuntime: setSlackRuntime,
|
||||
clearRuntime: clearSlackRuntime,
|
||||
tryGetRuntime: getOptionalSlackRuntime,
|
||||
getRuntime: getSlackRuntime,
|
||||
} = createPluginRuntimeStore<PluginRuntime>("Slack runtime not initialized");
|
||||
export { clearSlackRuntime, getSlackRuntime, setSlackRuntime };
|
||||
} = createPluginRuntimeStore<SlackRuntime>("Slack runtime not initialized");
|
||||
export { clearSlackRuntime, getOptionalSlackRuntime, getSlackRuntime, setSlackRuntime };
|
||||
|
||||
Reference in New Issue
Block a user