refactor(plugin-sdk): split interactive runtime helpers
This commit is contained in:
parent
8c436a470e
commit
c245c8b39d
@ -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";
|
||||
|
||||
@ -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(
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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>,
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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";
|
||||
|
||||
|
||||
@ -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";
|
||||
|
||||
@ -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"
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
"config-runtime",
|
||||
"reply-runtime",
|
||||
"channel-runtime",
|
||||
"interactive-runtime",
|
||||
"infra-runtime",
|
||||
"media-runtime",
|
||||
"media-understanding-runtime",
|
||||
|
||||
17
src/plugin-sdk/interactive-runtime.ts
Normal file
17
src/plugin-sdk/interactive-runtime.ts
Normal 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";
|
||||
Loading…
x
Reference in New Issue
Block a user