refactor: clean extension api boundaries

This commit is contained in:
Peter Steinberger 2026-03-17 09:33:17 -07:00
parent 4d8106eece
commit 4b125762f6
No known key found for this signature in database
147 changed files with 699 additions and 364 deletions

View File

@ -0,0 +1 @@
export { bluebubblesPlugin } from "./src/channel.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { bluebubblesPlugin } from "./src/channel.js";
import { setBlueBubblesRuntime } from "./src/runtime.js";
export { bluebubblesPlugin } from "./src/channel.js";
export { setBlueBubblesRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "bluebubbles",
name: "BlueBubbles",

13
extensions/discord/api.ts Normal file
View File

@ -0,0 +1,13 @@
export * from "./runtime-api.js";
export * from "./src/account-inspect.js";
export * from "./src/accounts.js";
export * from "./src/actions/handle-action.guild-admin.js";
export * from "./src/actions/handle-action.js";
export * from "./src/components.js";
export * from "./src/normalize.js";
export * from "./src/pluralkit.js";
export * from "./src/session-key-normalization.js";
export * from "./src/status-issues.js";
export * from "./src/targets.js";
export type { DiscordSendComponents, DiscordSendEmbeds } from "./src/send.shared.js";
export type { DiscordSendResult } from "./src/send.types.js";

View File

@ -3,6 +3,9 @@ import { discordPlugin } from "./src/channel.js";
import { setDiscordRuntime } from "./src/runtime.js";
import { registerDiscordSubagentHooks } from "./src/subagent-hooks.js";
export { discordPlugin } from "./src/channel.js";
export { setDiscordRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "discord",
name: "Discord",

View File

@ -0,0 +1,14 @@
export * from "./src/audit.js";
export * from "./src/channel-actions.js";
export * from "./src/directory-live.js";
export * from "./src/monitor.js";
export * from "./src/monitor/gateway-plugin.js";
export * from "./src/monitor/gateway-registry.js";
export * from "./src/monitor/presence-cache.js";
export * from "./src/monitor/thread-bindings.js";
export * from "./src/monitor/thread-bindings.manager.js";
export * from "./src/monitor/timeouts.js";
export * from "./src/probe.js";
export * from "./src/resolve-channels.js";
export * from "./src/resolve-users.js";
export * from "./src/send.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { discordSetupPlugin } from "./src/channel.setup.js";
export { discordSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(discordSetupPlugin);

View File

@ -55,7 +55,7 @@ import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
import { chunkItems } from "openclaw/plugin-sdk/text-runtime";
import { withTimeout } from "openclaw/plugin-sdk/text-runtime";
import { loadWebMedia } from "../../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import { resolveDiscordMaxLinesPerMessage } from "../accounts.js";
import { chunkDiscordTextWithMode } from "../chunk.js";
import {

View File

@ -7,7 +7,7 @@ import {
import { ChannelType, Routes } from "discord-api-types/v10";
import { loadConfig, type OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
import { recordChannelActivity } from "openclaw/plugin-sdk/infra-runtime";
import { loadWebMedia } from "../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import { resolveDiscordAccount } from "./accounts.js";
import { registerDiscordComponentEntries } from "./components-registry.js";
import {

View File

@ -1,5 +1,5 @@
import { Routes } from "discord-api-types/v10";
import { loadWebMediaRaw } from "../../whatsapp/src/media.js";
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
import { normalizeEmojiName, resolveDiscordRest } from "./send.shared.js";
import type { DiscordEmojiUpload, DiscordReactOpts, DiscordStickerUpload } from "./send.types.js";
import { DISCORD_MAX_EMOJI_BYTES, DISCORD_MAX_STICKER_BYTES } from "./send.types.js";

View File

@ -14,7 +14,7 @@ import { unlinkIfExists } from "openclaw/plugin-sdk/media-runtime";
import type { PollInput } from "openclaw/plugin-sdk/media-runtime";
import { resolveChunkMode } from "openclaw/plugin-sdk/reply-runtime";
import { convertMarkdownTables } from "openclaw/plugin-sdk/text-runtime";
import { loadWebMediaRaw } from "../../whatsapp/src/media.js";
import { loadWebMediaRaw } from "openclaw/plugin-sdk/web-media";
import { resolveDiscordAccount } from "./accounts.js";
import { rewriteDiscordKnownMentions } from "./mentions.js";
import {

View File

@ -18,7 +18,7 @@ import {
type PollInput,
} from "openclaw/plugin-sdk/media-runtime";
import type { ChunkMode } from "openclaw/plugin-sdk/reply-runtime";
import { loadWebMedia } from "../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import { resolveDiscordAccount } from "./accounts.js";
import { chunkDiscordTextWithMode } from "./chunk.js";
import { createDiscordClient, resolveDiscordRest } from "./client.js";

View File

@ -17,6 +17,7 @@ import {
type ChannelSetupDmPolicy,
type ChannelSetupWizard,
} from "openclaw/plugin-sdk/setup";
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { inspectDiscordAccount } from "./account-inspect.js";
import { listDiscordAccountIds, resolveDiscordAccount } from "./accounts.js";

View File

@ -6,6 +6,7 @@ import {
type WizardPrompter,
} from "openclaw/plugin-sdk/setup";
import { type ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { resolveDefaultDiscordAccountId, resolveDiscordAccount } from "./accounts.js";
import { normalizeDiscordSlug } from "./monitor/allow-list.js";
import {

View File

@ -3,7 +3,12 @@ import {
createScopedAccountConfigAccessors,
createScopedChannelConfigBase,
} from "openclaw/plugin-sdk/channel-config-helpers";
import { getChatChannelMeta, type ChannelPlugin } from "openclaw/plugin-sdk/core";
import {
buildChannelConfigSchema,
DiscordConfigSchema,
getChatChannelMeta,
type ChannelPlugin,
} from "openclaw/plugin-sdk/discord-core";
import { inspectDiscordAccount } from "./account-inspect.js";
import {
listDiscordAccountIds,
@ -40,7 +45,6 @@ export const discordConfigBase = createScopedChannelConfigBase<ResolvedDiscordAc
});
export function createDiscordPluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedDiscordAccount>, "configSchema">["configSchema"];
setup: NonNullable<ChannelPlugin<ResolvedDiscordAccount>["setup"]>;
}): Pick<
ChannelPlugin<ResolvedDiscordAccount>,
@ -72,7 +76,7 @@ export function createDiscordPluginBase(params: {
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
},
reload: { configPrefixes: ["channels.discord"] },
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(DiscordConfigSchema),
config: {
...discordConfigBase,
isConfigured: (account) => Boolean(account.token?.trim()),

4
extensions/feishu/api.ts Normal file
View File

@ -0,0 +1,4 @@
export * from "./src/conversation-id.js";
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";
export * from "./src/thread-bindings.js";

View File

@ -9,6 +9,8 @@ import { setFeishuRuntime } from "./src/runtime.js";
import { registerFeishuSubagentHooks } from "./src/subagent-hooks.js";
import { registerFeishuWikiTools } from "./src/wiki.js";
export { feishuPlugin } from "./src/channel.js";
export { setFeishuRuntime } from "./src/runtime.js";
export { monitorFeishuProvider } from "./src/monitor.js";
export {
sendMessageFeishu,

View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { googlechatPlugin } from "./src/channel.js";
import { setGoogleChatRuntime } from "./src/runtime.js";
export { googlechatPlugin } from "./src/channel.js";
export { setGoogleChatRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "googlechat",
name: "Google Chat",

View File

@ -0,0 +1,4 @@
export * from "./runtime-api.js";
export * from "./src/accounts.js";
export * from "./src/target-parsing-helpers.js";
export * from "./src/targets.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { imessagePlugin } from "./src/channel.js";
import { setIMessageRuntime } from "./src/runtime.js";
export { imessagePlugin } from "./src/channel.js";
export { setIMessageRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "imessage",
name: "iMessage",

View File

@ -0,0 +1,3 @@
export * from "./src/monitor.js";
export * from "./src/probe.js";
export * from "./src/send.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { imessageSetupPlugin } from "./src/channel.setup.js";
export { imessageSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(imessageSetupPlugin);

View File

@ -14,6 +14,7 @@ import type {
ChannelSetupWizard,
ChannelSetupWizardTextInput,
} from "openclaw/plugin-sdk/setup";
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import {
listIMessageAccountIds,
resolveDefaultIMessageAccountId,

View File

@ -1,5 +1,5 @@
import { detectBinary } from "openclaw/plugin-sdk/imessage";
import { setSetupChannelEnabled, type ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
import { detectBinary } from "openclaw/plugin-sdk/setup-tools";
import { listIMessageAccountIds, resolveIMessageAccount } from "./accounts.js";
import {
createIMessageCliPathTextInput,

View File

@ -1,19 +1,19 @@
import {
formatTrimmedAllowFromEntries,
resolveIMessageConfigAllowFrom,
resolveIMessageConfigDefaultTo,
} from "openclaw/plugin-sdk/channel-config-helpers";
import {
buildAccountScopedDmSecurityPolicy,
collectAllowlistProviderRestrictSendersWarnings,
} from "openclaw/plugin-sdk/channel-policy";
import {
buildChannelConfigSchema,
DEFAULT_ACCOUNT_ID,
deleteAccountFromConfigSection,
formatTrimmedAllowFromEntries,
getChatChannelMeta,
IMessageConfigSchema,
resolveIMessageConfigAllowFrom,
resolveIMessageConfigDefaultTo,
setAccountEnabledInConfigSection,
type ChannelPlugin,
} from "openclaw/plugin-sdk/core";
} from "openclaw/plugin-sdk/imessage-core";
import {
listIMessageAccountIds,
resolveDefaultIMessageAccountId,
@ -33,7 +33,6 @@ export const imessageSetupWizard = createIMessageSetupWizardProxy(async () => ({
}));
export function createIMessagePluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedIMessageAccount>, "configSchema">["configSchema"];
setupWizard?: NonNullable<ChannelPlugin<ResolvedIMessageAccount>["setupWizard"]>;
setup: NonNullable<ChannelPlugin<ResolvedIMessageAccount>["setup"]>;
}): Pick<
@ -61,7 +60,7 @@ export function createIMessagePluginBase(params: {
media: true,
},
reload: { configPrefixes: ["channels.imessage"] },
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(IMessageConfigSchema),
config: {
listAccountIds: (cfg) => listIMessageAccountIds(cfg),
resolveAccount: (cfg, accountId) => resolveIMessageAccount({ cfg, accountId }),

2
extensions/irc/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./src/accounts.js";
export * from "./src/setup-surface.js";

View File

@ -3,6 +3,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { ircPlugin } from "./src/channel.js";
import { setIrcRuntime } from "./src/runtime.js";
export { ircPlugin } from "./src/channel.js";
export { setIrcRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "irc",
name: "IRC",

2
extensions/line/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -3,6 +3,9 @@ import { registerLineCardCommand } from "./src/card-command.js";
import { linePlugin } from "./src/channel.js";
import { setLineRuntime } from "./src/runtime.js";
export { linePlugin } from "./src/channel.js";
export { setLineRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "line",
name: "LINE",

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { lineSetupPlugin } from "./src/channel.setup.js";
export { lineSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(lineSetupPlugin);

2
extensions/matrix/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { matrixPlugin } from "./src/channel.js";
import { setMatrixRuntime } from "./src/runtime.js";
export { matrixPlugin } from "./src/channel.js";
export { setMatrixRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "matrix",
name: "Matrix",

View File

@ -0,0 +1 @@
export { mattermostPlugin } from "./src/channel.js";

View File

@ -3,6 +3,9 @@ import { mattermostPlugin } from "./src/channel.js";
import { registerSlashCommandRoute } from "./src/mattermost/slash-state.js";
import { setMattermostRuntime } from "./src/runtime.js";
export { mattermostPlugin } from "./src/channel.js";
export { setMattermostRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "mattermost",
name: "Mattermost",

View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { msteamsPlugin } from "./src/channel.js";
import { setMSTeamsRuntime } from "./src/runtime.js";
export { msteamsPlugin } from "./src/channel.js";
export { setMSTeamsRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "msteams",
name: "Microsoft Teams",

View File

@ -0,0 +1 @@
export { nextcloudTalkPlugin } from "./src/channel.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { nextcloudTalkPlugin } from "./src/channel.js";
import { setNextcloudTalkRuntime } from "./src/runtime.js";
export { nextcloudTalkPlugin } from "./src/channel.js";
export { setNextcloudTalkRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "nextcloud-talk",
name: "Nextcloud Talk",

1
extensions/nostr/api.ts Normal file
View File

@ -0,0 +1 @@
export * from "./src/setup-surface.js";

View File

@ -5,6 +5,9 @@ import { createNostrProfileHttpHandler } from "./src/nostr-profile-http.js";
import { getNostrRuntime, setNostrRuntime } from "./src/runtime.js";
import { resolveNostrAccount } from "./src/types.js";
export { nostrPlugin } from "./src/channel.js";
export { setNostrRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "nostr",
name: "Nostr",

2
extensions/signal/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./runtime-api.js";
export * from "./src/accounts.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { signalPlugin } from "./src/channel.js";
import { setSignalRuntime } from "./src/runtime.js";
export { signalPlugin } from "./src/channel.js";
export { setSignalRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "signal",
name: "Signal",

View File

@ -0,0 +1 @@
export * from "./src/index.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { signalSetupPlugin } from "./src/channel.setup.js";
export { signalSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(signalSetupPlugin);

View File

@ -14,7 +14,7 @@ import type {
ChannelSetupWizard,
ChannelSetupWizardTextInput,
} from "openclaw/plugin-sdk/setup";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/signal";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import {
listSignalAccountIds,
resolveDefaultSignalAccountId,

View File

@ -1,5 +1,5 @@
import { setSetupChannelEnabled, type ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
import { detectBinary, installSignalCli } from "openclaw/plugin-sdk/signal";
import { detectBinary, installSignalCli } from "openclaw/plugin-sdk/setup-tools";
import { listSignalAccountIds, resolveSignalAccount } from "./accounts.js";
import {
createSignalCliPathTextInput,

View File

@ -4,13 +4,15 @@ import {
collectAllowlistProviderRestrictSendersWarnings,
} from "openclaw/plugin-sdk/channel-policy";
import {
buildChannelConfigSchema,
DEFAULT_ACCOUNT_ID,
deleteAccountFromConfigSection,
getChatChannelMeta,
normalizeE164,
setAccountEnabledInConfigSection,
SignalConfigSchema,
type ChannelPlugin,
} from "openclaw/plugin-sdk/core";
import { normalizeE164 } from "openclaw/plugin-sdk/setup";
} from "openclaw/plugin-sdk/signal-core";
import {
listSignalAccountIds,
resolveDefaultSignalAccountId,
@ -42,7 +44,6 @@ export const signalConfigAccessors = createScopedAccountConfigAccessors({
});
export function createSignalPluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedSignalAccount>, "configSchema">["configSchema"];
setupWizard?: NonNullable<ChannelPlugin<ResolvedSignalAccount>["setupWizard"]>;
setup: NonNullable<ChannelPlugin<ResolvedSignalAccount>["setup"]>;
}): Pick<
@ -73,7 +74,7 @@ export function createSignalPluginBase(params: {
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
},
reload: { configPrefixes: ["channels.signal"] },
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(SignalConfigSchema),
config: {
listAccountIds: (cfg) => listSignalAccountIds(cfg),
resolveAccount: (cfg, accountId) => resolveSignalAccount({ cfg, accountId }),

12
extensions/slack/api.ts Normal file
View File

@ -0,0 +1,12 @@
export * from "./runtime-api.js";
export * from "./src/account-inspect.js";
export * from "./src/accounts.js";
export * from "./src/actions.js";
export * from "./src/blocks-input.js";
export * from "./src/blocks-render.js";
export * from "./src/http/index.js";
export * from "./src/interactive-replies.js";
export * from "./src/message-actions.js";
export * from "./src/sent-thread-cache.js";
export * from "./src/targets.js";
export * from "./src/threading-tool-context.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { slackPlugin } from "./src/channel.js";
import { setSlackRuntime } from "./src/runtime.js";
export { slackPlugin } from "./src/channel.js";
export { setSlackRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "slack",
name: "Slack",

View File

@ -0,0 +1,4 @@
export * from "./src/directory-live.js";
export * from "./src/index.js";
export * from "./src/resolve-channels.js";
export * from "./src/resolve-users.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { slackSetupPlugin } from "./src/channel.setup.js";
export { slackSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(slackSetupPlugin);

View File

@ -12,7 +12,7 @@ import {
} from "openclaw/plugin-sdk/reply-runtime";
import { isSilentReplyText } from "openclaw/plugin-sdk/reply-runtime";
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import { loadWebMedia } from "../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import type { SlackTokenSource } from "./accounts.js";
import { resolveSlackAccount } from "./accounts.js";
import { buildSlackBlocksFallbackText } from "./blocks-fallback.js";

View File

@ -18,7 +18,7 @@ import {
type ChannelSetupWizard,
type ChannelSetupWizardAllowFromEntry,
} from "openclaw/plugin-sdk/setup";
import { formatDocsLink } from "openclaw/plugin-sdk/slack";
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { inspectSlackAccount } from "./account-inspect.js";
import { listSlackAccountIds, resolveSlackAccount, type ResolvedSlackAccount } from "./accounts.js";
import {

View File

@ -11,7 +11,7 @@ import type {
ChannelSetupWizard,
ChannelSetupWizardAllowFromEntry,
} from "openclaw/plugin-sdk/setup";
import { formatDocsLink } from "openclaw/plugin-sdk/slack";
import { formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { resolveDefaultSlackAccountId, resolveSlackAccount } from "./accounts.js";
import { resolveSlackChannelAllowlist } from "./resolve-channels.js";
import { resolveSlackUserAllowlist } from "./resolve-users.js";

View File

@ -3,13 +3,18 @@ import {
createScopedAccountConfigAccessors,
createScopedChannelConfigBase,
} from "openclaw/plugin-sdk/channel-config-helpers";
import { getChatChannelMeta, type ChannelPlugin } from "openclaw/plugin-sdk/core";
import {
formatDocsLink,
hasConfiguredSecretInput,
patchChannelConfigForAccount,
type OpenClawConfig,
} from "openclaw/plugin-sdk/setup";
import {
buildChannelConfigSchema,
getChatChannelMeta,
SlackConfigSchema,
type ChannelPlugin,
type OpenClawConfig,
} from "openclaw/plugin-sdk/slack-core";
import { inspectSlackAccount } from "./account-inspect.js";
import {
listSlackAccountIds,
@ -156,7 +161,6 @@ export const slackConfigBase = createScopedChannelConfigBase({
});
export function createSlackPluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedSlackAccount>, "configSchema">["configSchema"];
setupWizard: NonNullable<ChannelPlugin<ResolvedSlackAccount>["setupWizard"]>;
setup: NonNullable<ChannelPlugin<ResolvedSlackAccount>["setup"]>;
}): Pick<
@ -201,7 +205,7 @@ export function createSlackPluginBase(params: {
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
},
reload: { configPrefixes: ["channels.slack"] },
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(SlackConfigSchema),
config: {
...slackConfigBase,
isConfigured: (account) => isSlackPluginAccountConfigured(account),

View File

@ -0,0 +1 @@
export * from "./src/setup-surface.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { synologyChatPlugin } from "./src/channel.js";
import { setSynologyRuntime } from "./src/runtime.js";
export { synologyChatPlugin } from "./src/channel.js";
export { setSynologyRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "synology-chat",
name: "Synology Chat",

View File

@ -0,0 +1,18 @@
export * from "./runtime-api.js";
export * from "./src/account-inspect.js";
export * from "./src/accounts.js";
export * from "./src/allow-from.js";
export * from "./src/api-fetch.js";
export * from "./src/exec-approvals.js";
export * from "./src/inline-buttons.js";
export * from "./src/model-buttons.js";
export * from "./src/normalize.js";
export * from "./src/outbound-adapter.js";
export * from "./src/outbound-params.js";
export * from "./src/reaction-level.js";
export * from "./src/sticker-cache.js";
export * from "./src/status-issues.js";
export * from "./src/targets.js";
export * from "./src/update-offset-store.js";
export type { TelegramButtonStyle, TelegramInlineButtons } from "./src/button-types.js";
export type { StickerMetadata } from "./src/bot/types.js";

View File

@ -3,6 +3,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { telegramPlugin } from "./src/channel.js";
import { setTelegramRuntime } from "./src/runtime.js";
export { telegramPlugin } from "./src/channel.js";
export { setTelegramRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "telegram",
name: "Telegram",

View File

@ -0,0 +1,7 @@
export * from "./src/audit.js";
export * from "./src/channel-actions.js";
export * from "./src/monitor.js";
export * from "./src/probe.js";
export * from "./src/send.js";
export * from "./src/thread-bindings.js";
export * from "./src/token.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { telegramSetupPlugin } from "./src/channel.setup.js";
export { telegramSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(telegramSetupPlugin);

View File

@ -20,7 +20,7 @@ export function getLoadWebMediaMock(): AnyMock {
return loadWebMedia;
}
vi.mock("../../whatsapp/src/media.js", () => ({
vi.mock("openclaw/plugin-sdk/web-media", () => ({
loadWebMedia,
}));

View File

@ -17,7 +17,7 @@ import { chunkMarkdownTextWithMode, type ChunkMode } from "openclaw/plugin-sdk/r
import type { ReplyPayload } from "openclaw/plugin-sdk/reply-runtime";
import { danger, logVerbose } from "openclaw/plugin-sdk/runtime-env";
import type { RuntimeEnv } from "openclaw/plugin-sdk/runtime-env";
import { loadWebMedia } from "../../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import type { TelegramInlineButtons } from "../button-types.js";
import { splitTelegramCaption } from "../caption.js";
import {

View File

@ -44,7 +44,7 @@ type TelegramSendTestMocks = {
maybePersistResolvedTelegramTarget: MockFn;
};
vi.mock("../../whatsapp/src/media.js", () => ({
vi.mock("openclaw/plugin-sdk/web-media", () => ({
loadWebMedia,
}));

View File

@ -19,7 +19,7 @@ import { normalizePollInput, type PollInput } from "openclaw/plugin-sdk/media-ru
import { logVerbose } from "openclaw/plugin-sdk/runtime-env";
import { createSubsystemLogger } from "openclaw/plugin-sdk/runtime-env";
import { redactSensitiveText } from "openclaw/plugin-sdk/text-runtime";
import { loadWebMedia } from "../../whatsapp/src/media.js";
import { loadWebMedia } from "openclaw/plugin-sdk/web-media";
import { type ResolvedTelegramAccount, resolveTelegramAccount } from "./accounts.js";
import { withTelegramApiErrorLogging } from "./api-logging.js";
import { buildTelegramThreadParams, buildTypingThreadParams } from "./bot/helpers.js";

View File

@ -8,7 +8,7 @@ import {
type WizardPrompter,
} from "openclaw/plugin-sdk/setup";
import type { ChannelSetupAdapter, ChannelSetupDmPolicy } from "openclaw/plugin-sdk/setup";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/telegram";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { resolveDefaultTelegramAccountId, resolveTelegramAccount } from "./accounts.js";
import { fetchTelegramChatId } from "./api-fetch.js";

View File

@ -1,14 +1,16 @@
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
import {
createScopedChannelConfigBase,
createScopedAccountConfigAccessors,
createScopedChannelConfigBase,
} from "openclaw/plugin-sdk/channel-config-helpers";
import {
buildChannelConfigSchema,
getChatChannelMeta,
normalizeAccountId,
type OpenClawConfig,
TelegramConfigSchema,
type ChannelPlugin,
} from "openclaw/plugin-sdk/core";
type OpenClawConfig,
} from "openclaw/plugin-sdk/telegram-core";
import { inspectTelegramAccount } from "./account-inspect.js";
import {
listTelegramAccountIds,
@ -71,7 +73,6 @@ export const telegramConfigBase = createScopedChannelConfigBase<ResolvedTelegram
});
export function createTelegramPluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedTelegramAccount>, "configSchema">["configSchema"];
setupWizard: NonNullable<ChannelPlugin<ResolvedTelegramAccount>["setupWizard"]>;
setup: NonNullable<ChannelPlugin<ResolvedTelegramAccount>["setup"]>;
}): Pick<
@ -95,7 +96,7 @@ export function createTelegramPluginBase(params: {
blockStreaming: true,
},
reload: { configPrefixes: ["channels.telegram"] },
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(TelegramConfigSchema),
config: {
...telegramConfigBase,
isConfigured: (account, cfg) => {

2
extensions/tlon/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -6,6 +6,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { tlonPlugin } from "./src/channel.js";
import { setTlonRuntime } from "./src/runtime.js";
export { tlonPlugin } from "./src/channel.js";
export { setTlonRuntime } from "./src/runtime.js";
const __dirname = dirname(fileURLToPath(import.meta.url));
const ALLOWED_TLON_COMMANDS = new Set([

1
extensions/twitch/api.ts Normal file
View File

@ -0,0 +1 @@
export * from "./src/setup-surface.js";

View File

@ -0,0 +1,2 @@
export * from "./runtime-api.js";
export * from "./src/accounts.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { whatsappPlugin } from "./src/channel.js";
import { setWhatsAppRuntime } from "./src/runtime.js";
export { whatsappPlugin } from "./src/channel.js";
export { setWhatsAppRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "whatsapp",
name: "WhatsApp",

View File

@ -0,0 +1 @@
export * from "./src/login-qr.js";

View File

@ -0,0 +1,9 @@
export * from "./src/active-listener.js";
export * from "./src/agent-tools-login.js";
export * from "./src/auth-store.js";
export * from "./src/auto-reply.js";
export * from "./src/inbound.js";
export * from "./src/login.js";
export * from "./src/media.js";
export * from "./src/send.js";
export * from "./src/session.js";

View File

@ -1,4 +1,6 @@
import { defineSetupPluginEntry } from "openclaw/plugin-sdk/core";
import { whatsappSetupPlugin } from "./src/channel.setup.js";
export { whatsappSetupPlugin } from "./src/channel.setup.js";
export default defineSetupPluginEntry(whatsappSetupPlugin);

View File

@ -7,10 +7,6 @@ import {
readWebSelfId as readWebSelfIdImpl,
webAuthExists as webAuthExistsImpl,
} from "./auth-store.js";
import {
startWebLoginWithQr as startWebLoginWithQrImpl,
waitForWebLogin as waitForWebLoginImpl,
} from "./login-qr.js";
import { loginWeb as loginWebImpl } from "./login.js";
import { whatsappSetupWizard as whatsappSetupWizardImpl } from "./setup-surface.js";
@ -26,6 +22,13 @@ type WaitForWebLogin = typeof import("./login-qr.js").waitForWebLogin;
type WhatsAppSetupWizard = typeof import("./setup-surface.js").whatsappSetupWizard;
type MonitorWebChannel = typeof import("openclaw/plugin-sdk/whatsapp").monitorWebChannel;
let loginQrPromise: Promise<typeof import("./login-qr.js")> | null = null;
function loadWhatsAppLoginQr() {
loginQrPromise ??= import("./login-qr.js");
return loginQrPromise;
}
export function getActiveWebListener(
...args: Parameters<GetActiveWebListener>
): ReturnType<GetActiveWebListener> {
@ -56,14 +59,18 @@ export function loginWeb(...args: Parameters<LoginWeb>): ReturnType<LoginWeb> {
return loginWebImpl(...args);
}
export function startWebLoginWithQr(
export async function startWebLoginWithQr(
...args: Parameters<StartWebLoginWithQr>
): ReturnType<StartWebLoginWithQr> {
return startWebLoginWithQrImpl(...args);
const { startWebLoginWithQr } = await loadWhatsAppLoginQr();
return await startWebLoginWithQr(...args);
}
export function waitForWebLogin(...args: Parameters<WaitForWebLogin>): ReturnType<WaitForWebLogin> {
return waitForWebLoginImpl(...args);
export async function waitForWebLogin(
...args: Parameters<WaitForWebLogin>
): ReturnType<WaitForWebLogin> {
const { waitForWebLogin } = await loadWhatsAppLoginQr();
return await waitForWebLogin(...args);
}
export const whatsappSetupWizard: WhatsAppSetupWizard = { ...whatsappSetupWizardImpl };

View File

@ -11,7 +11,7 @@ import {
type OpenClawConfig,
} from "openclaw/plugin-sdk/setup";
import type { ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/whatsapp";
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/setup-tools";
import { listWhatsAppAccountIds, resolveWhatsAppAuthDir } from "./accounts.js";
import { loginWeb } from "./login.js";
import { whatsappSetupAdapter } from "./setup-core.js";

View File

@ -1,19 +1,22 @@
import {
formatWhatsAppConfigAllowFromEntries,
resolveWhatsAppConfigAllowFrom,
resolveWhatsAppConfigDefaultTo,
} from "openclaw/plugin-sdk/channel-config-helpers";
import {
buildAccountScopedDmSecurityPolicy,
collectAllowlistProviderGroupPolicyWarnings,
collectOpenGroupPolicyRouteAllowlistWarnings,
} from "openclaw/plugin-sdk/channel-policy";
import {
buildChannelConfigSchema,
DEFAULT_ACCOUNT_ID,
formatWhatsAppConfigAllowFromEntries,
getChatChannelMeta,
normalizeE164,
resolveWhatsAppConfigAllowFrom,
resolveWhatsAppConfigDefaultTo,
resolveWhatsAppGroupIntroHint,
resolveWhatsAppGroupRequireMention,
resolveWhatsAppGroupToolPolicy,
WhatsAppConfigSchema,
type ChannelPlugin,
} from "openclaw/plugin-sdk/core";
import { normalizeE164 } from "openclaw/plugin-sdk/setup";
} from "openclaw/plugin-sdk/whatsapp-core";
import {
listWhatsAppAccountIds,
resolveDefaultWhatsAppAccountId,
@ -76,8 +79,6 @@ export function createWhatsAppSetupWizardProxy(
}
export function createWhatsAppPluginBase(params: {
configSchema: Pick<ChannelPlugin<ResolvedWhatsAppAccount>, "configSchema">["configSchema"];
groups: Pick<ChannelPlugin<ResolvedWhatsAppAccount>, "groups">["groups"];
setupWizard: NonNullable<ChannelPlugin<ResolvedWhatsAppAccount>["setupWizard"]>;
setup: NonNullable<ChannelPlugin<ResolvedWhatsAppAccount>["setup"]>;
isConfigured: NonNullable<ChannelPlugin<ResolvedWhatsAppAccount>["config"]>["isConfigured"];
@ -113,7 +114,7 @@ export function createWhatsAppPluginBase(params: {
},
reload: { configPrefixes: ["web"], noopPrefixes: ["channels.whatsapp"] },
gatewayMethods: ["web.login.start", "web.login.wait"],
configSchema: params.configSchema,
configSchema: buildChannelConfigSchema(WhatsAppConfigSchema),
config: {
listAccountIds: (cfg) => listWhatsAppAccountIds(cfg),
resolveAccount: (cfg, accountId) => resolveWhatsAppAccount({ cfg, accountId }),
@ -212,6 +213,10 @@ export function createWhatsAppPluginBase(params: {
},
},
setup: params.setup,
groups: params.groups,
groups: {
resolveRequireMention: resolveWhatsAppGroupRequireMention,
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
resolveGroupIntroHint: resolveWhatsAppGroupIntroHint,
},
};
}

2
extensions/zalo/api.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -2,6 +2,9 @@ import { defineChannelPluginEntry } from "openclaw/plugin-sdk/core";
import { zaloPlugin } from "./src/channel.js";
import { setZaloRuntime } from "./src/runtime.js";
export { zaloPlugin } from "./src/channel.js";
export { setZaloRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "zalo",
name: "Zalo",

View File

@ -0,0 +1,2 @@
export * from "./src/setup-core.js";
export * from "./src/setup-surface.js";

View File

@ -4,6 +4,9 @@ import { zalouserPlugin } from "./src/channel.js";
import { setZalouserRuntime } from "./src/runtime.js";
import { ZalouserToolSchema, executeZalouserTool } from "./src/tool.js";
export { zalouserPlugin } from "./src/channel.js";
export { setZalouserRuntime } from "./src/runtime.js";
export default defineChannelPluginEntry({
id: "zalouser",
name: "Zalo Personal",

View File

@ -82,6 +82,10 @@
"types": "./dist/plugin-sdk/setup.d.ts",
"default": "./dist/plugin-sdk/setup.js"
},
"./plugin-sdk/setup-tools": {
"types": "./dist/plugin-sdk/setup-tools.d.ts",
"default": "./dist/plugin-sdk/setup-tools.js"
},
"./plugin-sdk/config-runtime": {
"types": "./dist/plugin-sdk/config-runtime.d.ts",
"default": "./dist/plugin-sdk/config-runtime.js"
@ -158,26 +162,50 @@
"types": "./dist/plugin-sdk/telegram.d.ts",
"default": "./dist/plugin-sdk/telegram.js"
},
"./plugin-sdk/telegram-core": {
"types": "./dist/plugin-sdk/telegram-core.d.ts",
"default": "./dist/plugin-sdk/telegram-core.js"
},
"./plugin-sdk/discord": {
"types": "./dist/plugin-sdk/discord.d.ts",
"default": "./dist/plugin-sdk/discord.js"
},
"./plugin-sdk/discord-core": {
"types": "./dist/plugin-sdk/discord-core.d.ts",
"default": "./dist/plugin-sdk/discord-core.js"
},
"./plugin-sdk/slack": {
"types": "./dist/plugin-sdk/slack.d.ts",
"default": "./dist/plugin-sdk/slack.js"
},
"./plugin-sdk/slack-core": {
"types": "./dist/plugin-sdk/slack-core.d.ts",
"default": "./dist/plugin-sdk/slack-core.js"
},
"./plugin-sdk/signal": {
"types": "./dist/plugin-sdk/signal.d.ts",
"default": "./dist/plugin-sdk/signal.js"
},
"./plugin-sdk/signal-core": {
"types": "./dist/plugin-sdk/signal-core.d.ts",
"default": "./dist/plugin-sdk/signal-core.js"
},
"./plugin-sdk/imessage": {
"types": "./dist/plugin-sdk/imessage.d.ts",
"default": "./dist/plugin-sdk/imessage.js"
},
"./plugin-sdk/imessage-core": {
"types": "./dist/plugin-sdk/imessage-core.d.ts",
"default": "./dist/plugin-sdk/imessage-core.js"
},
"./plugin-sdk/whatsapp": {
"types": "./dist/plugin-sdk/whatsapp.d.ts",
"default": "./dist/plugin-sdk/whatsapp.js"
},
"./plugin-sdk/whatsapp-core": {
"types": "./dist/plugin-sdk/whatsapp-core.d.ts",
"default": "./dist/plugin-sdk/whatsapp-core.js"
},
"./plugin-sdk/line": {
"types": "./dist/plugin-sdk/line.d.ts",
"default": "./dist/plugin-sdk/line.js"
@ -426,6 +454,10 @@
"types": "./dist/plugin-sdk/runtime-store.d.ts",
"default": "./dist/plugin-sdk/runtime-store.js"
},
"./plugin-sdk/web-media": {
"types": "./dist/plugin-sdk/web-media.d.ts",
"default": "./dist/plugin-sdk/web-media.js"
},
"./plugin-sdk/speech": {
"types": "./dist/plugin-sdk/speech.d.ts",
"default": "./dist/plugin-sdk/speech.js"

View File

@ -10,6 +10,7 @@
"runtime",
"runtime-env",
"setup",
"setup-tools",
"config-runtime",
"reply-runtime",
"channel-runtime",
@ -29,11 +30,17 @@
"acp-runtime",
"zai",
"telegram",
"telegram-core",
"discord",
"discord-core",
"slack",
"slack-core",
"signal",
"signal-core",
"imessage",
"imessage-core",
"whatsapp",
"whatsapp-core",
"line",
"msteams",
"acpx",
@ -96,6 +103,7 @@
"google",
"request-url",
"runtime-store",
"web-media",
"speech",
"state-paths",
"tool-send"

View File

@ -101,7 +101,7 @@ export function getWebSessionMocks(): AnyMocks {
return webSessionMocks;
}
vi.mock("../../extensions/whatsapp/src/session.js", () => webSessionMocks);
vi.mock("../../extensions/whatsapp/api.js", () => webSessionMocks);
export const MAIN_SESSION_KEY = "agent:main:main";

View File

@ -10,7 +10,7 @@ export function installSubagentsCommandCoreMocks() {
});
// Prevent transitive import chain from reaching discord/monitor which needs https-proxy-agent.
vi.mock("../../../extensions/discord/src/monitor/gateway-plugin.js", () => ({
vi.mock("../../../extensions/discord/runtime-api.js", () => ({
createDiscordGatewayPlugin: () => ({}),
}));
}

View File

@ -1 +1 @@
export * from "../../../../../extensions/discord/src/actions/handle-action.guild-admin.js";
export * from "../../../../../extensions/discord/api.js";

View File

@ -1 +1 @@
export * from "../../../../../extensions/discord/src/actions/handle-action.js";
export * from "../../../../../extensions/discord/api.js";

View File

@ -1,33 +1,30 @@
import { bluebubblesPlugin } from "../../../extensions/bluebubbles/src/channel.js";
import { discordPlugin } from "../../../extensions/discord/src/channel.js";
import { discordSetupPlugin } from "../../../extensions/discord/src/channel.setup.js";
import { setDiscordRuntime } from "../../../extensions/discord/src/runtime.js";
import { feishuPlugin } from "../../../extensions/feishu/src/channel.js";
import { googlechatPlugin } from "../../../extensions/googlechat/src/channel.js";
import { imessagePlugin } from "../../../extensions/imessage/src/channel.js";
import { imessageSetupPlugin } from "../../../extensions/imessage/src/channel.setup.js";
import { ircPlugin } from "../../../extensions/irc/src/channel.js";
import { linePlugin } from "../../../extensions/line/src/channel.js";
import { lineSetupPlugin } from "../../../extensions/line/src/channel.setup.js";
import { setLineRuntime } from "../../../extensions/line/src/runtime.js";
import { matrixPlugin } from "../../../extensions/matrix/src/channel.js";
import { mattermostPlugin } from "../../../extensions/mattermost/src/channel.js";
import { msteamsPlugin } from "../../../extensions/msteams/src/channel.js";
import { nextcloudTalkPlugin } from "../../../extensions/nextcloud-talk/src/channel.js";
import { nostrPlugin } from "../../../extensions/nostr/src/channel.js";
import { signalPlugin } from "../../../extensions/signal/src/channel.js";
import { signalSetupPlugin } from "../../../extensions/signal/src/channel.setup.js";
import { slackPlugin } from "../../../extensions/slack/src/channel.js";
import { slackSetupPlugin } from "../../../extensions/slack/src/channel.setup.js";
import { synologyChatPlugin } from "../../../extensions/synology-chat/src/channel.js";
import { telegramPlugin } from "../../../extensions/telegram/src/channel.js";
import { telegramSetupPlugin } from "../../../extensions/telegram/src/channel.setup.js";
import { setTelegramRuntime } from "../../../extensions/telegram/src/runtime.js";
import { tlonPlugin } from "../../../extensions/tlon/src/channel.js";
import { whatsappPlugin } from "../../../extensions/whatsapp/src/channel.js";
import { whatsappSetupPlugin } from "../../../extensions/whatsapp/src/channel.setup.js";
import { zaloPlugin } from "../../../extensions/zalo/src/channel.js";
import { zalouserPlugin } from "../../../extensions/zalouser/src/channel.js";
import { bluebubblesPlugin } from "../../../extensions/bluebubbles/index.js";
import { discordPlugin, setDiscordRuntime } from "../../../extensions/discord/index.js";
import { discordSetupPlugin } from "../../../extensions/discord/setup-entry.js";
import { feishuPlugin } from "../../../extensions/feishu/index.js";
import { googlechatPlugin } from "../../../extensions/googlechat/index.js";
import { imessagePlugin } from "../../../extensions/imessage/index.js";
import { imessageSetupPlugin } from "../../../extensions/imessage/setup-entry.js";
import { ircPlugin } from "../../../extensions/irc/index.js";
import { linePlugin, setLineRuntime } from "../../../extensions/line/index.js";
import { lineSetupPlugin } from "../../../extensions/line/setup-entry.js";
import { matrixPlugin } from "../../../extensions/matrix/index.js";
import { mattermostPlugin } from "../../../extensions/mattermost/index.js";
import { msteamsPlugin } from "../../../extensions/msteams/index.js";
import { nextcloudTalkPlugin } from "../../../extensions/nextcloud-talk/index.js";
import { nostrPlugin } from "../../../extensions/nostr/index.js";
import { signalPlugin } from "../../../extensions/signal/index.js";
import { signalSetupPlugin } from "../../../extensions/signal/setup-entry.js";
import { slackPlugin } from "../../../extensions/slack/index.js";
import { slackSetupPlugin } from "../../../extensions/slack/setup-entry.js";
import { synologyChatPlugin } from "../../../extensions/synology-chat/index.js";
import { telegramPlugin, setTelegramRuntime } from "../../../extensions/telegram/index.js";
import { telegramSetupPlugin } from "../../../extensions/telegram/setup-entry.js";
import { tlonPlugin } from "../../../extensions/tlon/index.js";
import { whatsappPlugin } from "../../../extensions/whatsapp/index.js";
import { whatsappSetupPlugin } from "../../../extensions/whatsapp/setup-entry.js";
import { zaloPlugin } from "../../../extensions/zalo/index.js";
import { zalouserPlugin } from "../../../extensions/zalouser/index.js";
import type { ChannelId, ChannelPlugin } from "./types.js";
export const bundledChannelPlugins = [

View File

@ -2,10 +2,10 @@ import { expect, vi } from "vitest";
import {
__testing as discordThreadBindingTesting,
createThreadBindingManager as createDiscordThreadBindingManager,
} from "../../../../extensions/discord/src/monitor/thread-bindings.manager.js";
import { createFeishuThreadBindingManager } from "../../../../extensions/feishu/src/thread-bindings.js";
import { setMatrixRuntime } from "../../../../extensions/matrix/src/runtime.js";
import { createTelegramThreadBindingManager } from "../../../../extensions/telegram/src/thread-bindings.js";
} from "../../../../extensions/discord/api.js";
import { createFeishuThreadBindingManager } from "../../../../extensions/feishu/api.js";
import { setMatrixRuntime } from "../../../../extensions/matrix/api.js";
import { createTelegramThreadBindingManager } from "../../../../extensions/telegram/api.js";
import type { OpenClawConfig } from "../../../config/config.js";
import {
getSessionBindingService,

View File

@ -1,5 +1,5 @@
import { parseDiscordTarget } from "../../../extensions/discord/src/targets.js";
import { parseTelegramTarget } from "../../../extensions/telegram/src/targets.js";
import { parseDiscordTarget } from "../../../extensions/discord/api.js";
import { parseTelegramTarget } from "../../../extensions/telegram/api.js";
import type { ChatType } from "../chat-type.js";
import { normalizeChatChannelId } from "../registry.js";
import { getChannelPlugin, normalizeChannelId } from "./registry.js";

View File

@ -24,9 +24,8 @@ vi.mock("../config/config.js", async (importOriginal) => {
};
});
vi.mock("../../extensions/telegram/src/update-offset-store.js", async (importOriginal) => {
const actual =
await importOriginal<typeof import("../../extensions/telegram/src/update-offset-store.js")>();
vi.mock("../../extensions/telegram/api.js", async (importOriginal) => {
const actual = await importOriginal<typeof import("../../extensions/telegram/api.js")>();
return {
...actual,
deleteTelegramUpdateOffset: offsetMocks.deleteTelegramUpdateOffset,

View File

@ -258,7 +258,7 @@ vi.mock("../pairing/pairing-store.js", () => ({
upsertChannelPairingRequest: vi.fn().mockResolvedValue({ code: "000000", created: false }),
}));
vi.mock("../../extensions/telegram/src/token.js", () => ({
vi.mock("../../extensions/telegram/api.js", () => ({
resolveTelegramToken: vi.fn(() => ({ token: "", source: "none" })),
}));

View File

@ -1,5 +1,5 @@
import { vi } from "vitest";
import { parseTelegramTarget } from "../../extensions/telegram/src/targets.js";
import { parseTelegramTarget } from "../../extensions/telegram/api.js";
import { signalOutbound, telegramOutbound } from "../../test/channel-outbounds.js";
import { loadModelCatalog } from "../agents/model-catalog.js";
import { runEmbeddedPiAgent } from "../agents/pi-embedded.js";

View File

@ -574,7 +574,7 @@ vi.mock("../commands/health.js", () => ({
vi.mock("../commands/status.js", () => ({
getStatusSummary: vi.fn().mockResolvedValue({ ok: true }),
}));
vi.mock("../../extensions/whatsapp/src/send.js", () => ({
vi.mock("../../extensions/whatsapp/api.js", () => ({
sendMessageWhatsApp: (...args: unknown[]) =>
(hoisted.sendWhatsAppMock as (...args: unknown[]) => unknown)(...args),
sendPollWhatsApp: (...args: unknown[]) =>

View File

@ -1,10 +1,7 @@
import { beforeEach } from "vitest";
import { slackPlugin } from "../../extensions/slack/src/channel.js";
import { setSlackRuntime } from "../../extensions/slack/src/runtime.js";
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
import { setTelegramRuntime } from "../../extensions/telegram/src/runtime.js";
import { whatsappPlugin } from "../../extensions/whatsapp/src/channel.js";
import { setWhatsAppRuntime } from "../../extensions/whatsapp/src/runtime.js";
import { slackPlugin, setSlackRuntime } from "../../extensions/slack/index.js";
import { telegramPlugin, setTelegramRuntime } from "../../extensions/telegram/index.js";
import { whatsappPlugin, setWhatsAppRuntime } from "../../extensions/whatsapp/index.js";
import type { ChannelPlugin } from "../channels/plugins/types.plugin.js";
import { setActivePluginRegistry } from "../plugins/runtime.js";
import { createPluginRuntime } from "../plugins/runtime/index.js";

View File

@ -2,8 +2,7 @@ import fs from "node:fs/promises";
import os from "node:os";
import path from "node:path";
import { vi } from "vitest";
import { telegramPlugin } from "../../extensions/telegram/src/channel.js";
import { setTelegramRuntime } from "../../extensions/telegram/src/runtime.js";
import { telegramPlugin, setTelegramRuntime } from "../../extensions/telegram/index.js";
import * as replyModule from "../auto-reply/reply.js";
import type { OpenClawConfig } from "../config/config.js";
import { resolveMainSessionKey } from "../config/sessions.js";

View File

@ -1,7 +1,5 @@
import { slackPlugin } from "../../../extensions/slack/src/channel.js";
import { setSlackRuntime } from "../../../extensions/slack/src/runtime.js";
import { telegramPlugin } from "../../../extensions/telegram/src/channel.js";
import { setTelegramRuntime } from "../../../extensions/telegram/src/runtime.js";
import { slackPlugin, setSlackRuntime } from "../../../extensions/slack/index.js";
import { telegramPlugin, setTelegramRuntime } from "../../../extensions/telegram/index.js";
import type { OpenClawConfig } from "../../config/config.js";
import { setActivePluginRegistry } from "../../plugins/runtime.js";
import { createPluginRuntime } from "../../plugins/runtime/index.js";

View File

@ -1,6 +1,6 @@
import { afterEach, beforeEach, describe, expect, it } from "vitest";
import { telegramPlugin } from "../../../extensions/telegram/src/channel.js";
import { whatsappPlugin } from "../../../extensions/whatsapp/src/channel.js";
import { telegramPlugin } from "../../../extensions/telegram/index.js";
import { whatsappPlugin } from "../../../extensions/whatsapp/index.js";
import { setActivePluginRegistry } from "../../plugins/runtime.js";
import { createTestRegistry } from "../../test-utils/channel-plugins.js";
import { resolveOutboundTarget } from "./targets.js";

View File

@ -13,19 +13,13 @@ export { normalizeE164, pathExists, resolveUserPath } from "../utils.js";
export {
resolveDiscordAccount,
type ResolvedDiscordAccount,
} from "../../extensions/discord/src/accounts.js";
export {
resolveSlackAccount,
type ResolvedSlackAccount,
} from "../../extensions/slack/src/accounts.js";
} from "../../extensions/discord/api.js";
export { resolveSlackAccount, type ResolvedSlackAccount } from "../../extensions/slack/api.js";
export {
resolveTelegramAccount,
type ResolvedTelegramAccount,
} from "../../extensions/telegram/src/accounts.js";
export {
resolveSignalAccount,
type ResolvedSignalAccount,
} from "../../extensions/signal/src/accounts.js";
} from "../../extensions/telegram/api.js";
export { resolveSignalAccount, type ResolvedSignalAccount } from "../../extensions/signal/api.js";
/** Resolve an account by id, then fall back to the default account when the primary lacks credentials. */
export function resolveAccountWithDefaultFallback<TAccount>(params: {

Some files were not shown because too many files have changed in this diff Show More