refactor(plugin-sdk): split interactive runtime helpers

This commit is contained in:
Ayaan Zaidi 2026-03-18 11:27:07 +05:30
parent 8c436a470e
commit c245c8b39d
No known key found for this signature in database
10 changed files with 38 additions and 15 deletions

View File

@ -7,7 +7,7 @@ import {
import { readBooleanParam } from "openclaw/plugin-sdk/boolean-param";
import { resolveReactionMessageId } from "openclaw/plugin-sdk/channel-runtime";
import type { ChannelMessageActionContext } from "openclaw/plugin-sdk/channel-runtime";
import { normalizeInteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import { normalizeInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import { buildDiscordInteractiveComponents } from "../shared-interactive.js";
import { resolveDiscordChannelId } from "../targets.js";
import { tryHandleDiscordMessageActionGuildAdmin } from "./handle-action.guild-admin.js";

View File

@ -1,5 +1,8 @@
import { reduceInteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import type { InteractiveButtonStyle, InteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import { reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import type {
InteractiveButtonStyle,
InteractiveReply,
} from "openclaw/plugin-sdk/interactive-runtime";
import type { DiscordComponentButtonStyle, DiscordComponentMessageSpec } from "./components.js";
function resolveDiscordInteractiveButtonStyle(

View File

@ -1,6 +1,6 @@
import type { Block, KnownBlock } from "@slack/web-api";
import { reduceInteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import type { InteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import { reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import type { InteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import { truncateSlackText } from "./truncate.js";
export const SLACK_REPLY_BUTTON_ACTION_ID = "openclaw:reply_button";

View File

@ -1,11 +1,9 @@
import type { AgentToolResult } from "@mariozechner/pi-agent-core";
import {
normalizeInteractiveReply,
type ChannelMessageActionContext,
} from "openclaw/plugin-sdk/channel-runtime";
import type { ChannelMessageActionContext } from "openclaw/plugin-sdk/channel-runtime";
import { normalizeInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import { readNumberParam, readStringParam } from "../../../src/agents/tools/common.js";
import { parseSlackBlocksInput } from "./blocks-input.js";
import { buildSlackInteractiveBlocks } from "./blocks-render.js";
import { readNumberParam, readStringParam } from "./runtime-api.js";
type SlackActionInvoke = (
action: Record<string, unknown>,

View File

@ -5,11 +5,11 @@ import {
} from "openclaw/plugin-sdk/channel-runtime";
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/channel-runtime";
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
import type { OutboundIdentity } from "openclaw/plugin-sdk/infra-runtime";
import {
resolveInteractiveTextFallback,
type InteractiveReply,
} from "openclaw/plugin-sdk/channel-runtime";
import type { OutboundIdentity } from "openclaw/plugin-sdk/infra-runtime";
} from "openclaw/plugin-sdk/interactive-runtime";
import { getGlobalHookRunner } from "openclaw/plugin-sdk/plugin-runtime";
import { parseSlackBlocksInput } from "./blocks-input.js";
import { buildSlackInteractiveBlocks, type SlackBlock } from "./blocks-render.js";

View File

@ -1,9 +1,9 @@
import { reduceInteractiveReply } from "openclaw/plugin-sdk/channel-runtime";
import { reduceInteractiveReply } from "openclaw/plugin-sdk/interactive-runtime";
import {
normalizeInteractiveReply,
type InteractiveReply,
type InteractiveReplyButton,
} from "openclaw/plugin-sdk/channel-runtime";
} from "openclaw/plugin-sdk/interactive-runtime";
export type TelegramButtonStyle = "danger" | "success" | "primary";

View File

@ -4,7 +4,7 @@ import {
} from "openclaw/plugin-sdk/channel-runtime";
import type { ChannelOutboundAdapter } from "openclaw/plugin-sdk/channel-runtime";
import { resolveOutboundSendDep, type OutboundSendDeps } from "openclaw/plugin-sdk/channel-runtime";
import { resolveInteractiveTextFallback } from "openclaw/plugin-sdk/channel-runtime";
import { resolveInteractiveTextFallback } from "openclaw/plugin-sdk/interactive-runtime";
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
import type { TelegramInlineButtons } from "./button-types.js";
import { resolveTelegramInlineButtons } from "./button-types.js";

View File

@ -98,6 +98,10 @@
"types": "./dist/plugin-sdk/channel-runtime.d.ts",
"default": "./dist/plugin-sdk/channel-runtime.js"
},
"./plugin-sdk/interactive-runtime": {
"types": "./dist/plugin-sdk/interactive-runtime.d.ts",
"default": "./dist/plugin-sdk/interactive-runtime.js"
},
"./plugin-sdk/infra-runtime": {
"types": "./dist/plugin-sdk/infra-runtime.d.ts",
"default": "./dist/plugin-sdk/infra-runtime.js"

View File

@ -14,6 +14,7 @@
"config-runtime",
"reply-runtime",
"channel-runtime",
"interactive-runtime",
"infra-runtime",
"media-runtime",
"media-understanding-runtime",

View File

@ -0,0 +1,17 @@
export { reduceInteractiveReply } from "../channels/plugins/outbound/interactive.js";
export type {
InteractiveButtonStyle,
InteractiveReply,
InteractiveReplyBlock,
InteractiveReplyButton,
InteractiveReplyOption,
InteractiveReplySelectBlock,
InteractiveReplyTextBlock,
} from "../interactive/payload.js";
export {
hasInteractiveReplyBlocks,
hasReplyChannelData,
hasReplyContent,
normalizeInteractiveReply,
resolveInteractiveTextFallback,
} from "../interactive/payload.js";