mirror of
https://github.com/moltbot/moltbot.git
synced 2026-04-26 16:06:16 +00:00
test: stabilize full gate
This commit is contained in:
@@ -1,10 +1,15 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/discord";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
DiscordConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/discord";
|
||||
import { type ResolvedDiscordAccount } from "./accounts.js";
|
||||
import { discordSetupAdapter } from "./setup-core.js";
|
||||
import { createDiscordPluginBase } from "./shared.js";
|
||||
|
||||
export const discordSetupPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
||||
...createDiscordPluginBase({
|
||||
configSchema: buildChannelConfigSchema(DiscordConfigSchema),
|
||||
setup: discordSetupAdapter,
|
||||
}),
|
||||
};
|
||||
|
||||
@@ -13,8 +13,10 @@ import { normalizeMessageChannel } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { buildOutboundBaseSessionKey, normalizeOutboundThreadId } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
buildComputedAccountStatusSnapshot,
|
||||
buildChannelConfigSchema,
|
||||
buildTokenChannelStatusSummary,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
DiscordConfigSchema,
|
||||
getChatChannelMeta,
|
||||
listDiscordDirectoryGroupsFromConfig,
|
||||
listDiscordDirectoryPeersFromConfig,
|
||||
@@ -275,6 +277,7 @@ function resolveDiscordOutboundSessionRoute(params: {
|
||||
|
||||
export const discordPlugin: ChannelPlugin<ResolvedDiscordAccount> = {
|
||||
...createDiscordPluginBase({
|
||||
configSchema: buildChannelConfigSchema(DiscordConfigSchema),
|
||||
setup: discordSetupAdapter,
|
||||
}),
|
||||
pairing: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { DiscordGuildEntry } from "openclaw/plugin-sdk/config-runtime";
|
||||
import { formatDocsLink } from "openclaw/plugin-sdk/discord";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
createEnvPatchedAccountSetupAdapter,
|
||||
formatDocsLink,
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
parseMentionOrPrefixedId,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { formatDocsLink } from "openclaw/plugin-sdk/discord";
|
||||
import {
|
||||
formatDocsLink,
|
||||
type OpenClawConfig,
|
||||
promptLegacyChannelAllowFrom,
|
||||
resolveSetupAccountId,
|
||||
|
||||
@@ -3,12 +3,7 @@ import {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
DiscordConfigSchema,
|
||||
getChatChannelMeta,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/discord";
|
||||
import { getChatChannelMeta, type ChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
import { inspectDiscordAccount } from "./account-inspect.js";
|
||||
import {
|
||||
listDiscordAccountIds,
|
||||
@@ -45,6 +40,7 @@ export const discordConfigBase = createScopedChannelConfigBase<ResolvedDiscordAc
|
||||
});
|
||||
|
||||
export function createDiscordPluginBase(params: {
|
||||
configSchema: Pick<ChannelPlugin<ResolvedDiscordAccount>, "configSchema">["configSchema"];
|
||||
setup: NonNullable<ChannelPlugin<ResolvedDiscordAccount>["setup"]>;
|
||||
}): Pick<
|
||||
ChannelPlugin<ResolvedDiscordAccount>,
|
||||
@@ -76,7 +72,7 @@ export function createDiscordPluginBase(params: {
|
||||
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
||||
},
|
||||
reload: { configPrefixes: ["channels.discord"] },
|
||||
configSchema: buildChannelConfigSchema(DiscordConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
...discordConfigBase,
|
||||
isConfigured: (account) => Boolean(account.token?.trim()),
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/imessage";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
IMessageConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/imessage";
|
||||
import { type ResolvedIMessageAccount } from "./accounts.js";
|
||||
import { imessageSetupAdapter } from "./setup-core.js";
|
||||
import { createIMessagePluginBase, imessageSetupWizard } from "./shared.js";
|
||||
|
||||
export const imessageSetupPlugin: ChannelPlugin<ResolvedIMessageAccount> = {
|
||||
...createIMessagePluginBase({
|
||||
configSchema: buildChannelConfigSchema(IMessageConfigSchema),
|
||||
setupWizard: imessageSetupWizard,
|
||||
setup: imessageSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -6,9 +6,11 @@ import {
|
||||
import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { buildOutboundBaseSessionKey } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
collectStatusIssuesFromLastError,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatTrimmedAllowFromEntries,
|
||||
IMessageConfigSchema,
|
||||
looksLikeIMessageTargetId,
|
||||
normalizeIMessageMessagingTarget,
|
||||
resolveIMessageGroupRequireMention,
|
||||
@@ -102,6 +104,7 @@ function resolveIMessageOutboundSessionRoute(params: {
|
||||
|
||||
export const imessagePlugin: ChannelPlugin<ResolvedIMessageAccount> = {
|
||||
...createIMessagePluginBase({
|
||||
configSchema: buildChannelConfigSchema(IMessageConfigSchema),
|
||||
setupWizard: imessageSetupWizard,
|
||||
setup: imessageSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { formatDocsLink } from "openclaw/plugin-sdk/imessage";
|
||||
import {
|
||||
createPatchedAccountSetupAdapter,
|
||||
formatDocsLink,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
setChannelDmPolicyWithAllowFrom,
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import {
|
||||
detectBinary,
|
||||
setSetupChannelEnabled,
|
||||
type ChannelSetupWizard,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { detectBinary } from "openclaw/plugin-sdk/imessage";
|
||||
import { setSetupChannelEnabled, type ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
|
||||
import { listIMessageAccountIds, resolveIMessageAccount } from "./accounts.js";
|
||||
import {
|
||||
createIMessageCliPathTextInput,
|
||||
|
||||
@@ -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/imessage";
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
listIMessageAccountIds,
|
||||
resolveDefaultIMessageAccountId,
|
||||
@@ -33,6 +33,7 @@ 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<
|
||||
@@ -60,7 +61,7 @@ export function createIMessagePluginBase(params: {
|
||||
media: true,
|
||||
},
|
||||
reload: { configPrefixes: ["channels.imessage"] },
|
||||
configSchema: buildChannelConfigSchema(IMessageConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
listAccountIds: (cfg) => listIMessageAccountIds(cfg),
|
||||
resolveAccount: (cfg, accountId) => resolveIMessageAccount({ cfg, accountId }),
|
||||
|
||||
@@ -1,10 +1,15 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/signal";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
SignalConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/signal";
|
||||
import { type ResolvedSignalAccount } from "./accounts.js";
|
||||
import { signalSetupAdapter } from "./setup-core.js";
|
||||
import { createSignalPluginBase, signalSetupWizard } from "./shared.js";
|
||||
|
||||
export const signalSetupPlugin: ChannelPlugin<ResolvedSignalAccount> = {
|
||||
...createSignalPluginBase({
|
||||
configSchema: buildChannelConfigSchema(SignalConfigSchema),
|
||||
setupWizard: signalSetupWizard,
|
||||
setup: signalSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -11,6 +11,7 @@ import { type RoutePeer } from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
buildBaseAccountStatusSnapshot,
|
||||
buildBaseChannelStatusSummary,
|
||||
buildChannelConfigSchema,
|
||||
collectStatusIssuesFromLastError,
|
||||
createDefaultChannelRuntimeState,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
@@ -19,6 +20,7 @@ import {
|
||||
normalizeSignalMessagingTarget,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
resolveChannelMediaMaxBytes,
|
||||
SignalConfigSchema,
|
||||
type ChannelMessageActionAdapter,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/signal";
|
||||
@@ -277,6 +279,7 @@ async function sendFormattedSignalMedia(ctx: {
|
||||
|
||||
export const signalPlugin: ChannelPlugin<ResolvedSignalAccount> = {
|
||||
...createSignalPluginBase({
|
||||
configSchema: buildChannelConfigSchema(SignalConfigSchema),
|
||||
setupWizard: signalSetupWizard,
|
||||
setup: signalSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import {
|
||||
createPatchedAccountSetupAdapter,
|
||||
formatCliCommand,
|
||||
formatDocsLink,
|
||||
normalizeE164,
|
||||
parseSetupEntriesAllowingWildcard,
|
||||
promptParsedAllowFromForScopedChannel,
|
||||
@@ -16,6 +14,7 @@ import type {
|
||||
ChannelSetupWizard,
|
||||
ChannelSetupWizardTextInput,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { formatCliCommand, formatDocsLink } from "openclaw/plugin-sdk/signal";
|
||||
import {
|
||||
listSignalAccountIds,
|
||||
resolveDefaultSignalAccountId,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import {
|
||||
detectBinary,
|
||||
installSignalCli,
|
||||
setSetupChannelEnabled,
|
||||
type ChannelSetupWizard,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { setSetupChannelEnabled, type ChannelSetupWizard } from "openclaw/plugin-sdk/setup";
|
||||
import { detectBinary, installSignalCli } from "openclaw/plugin-sdk/signal";
|
||||
import { listSignalAccountIds, resolveSignalAccount } from "./accounts.js";
|
||||
import {
|
||||
createSignalCliPathTextInput,
|
||||
|
||||
@@ -4,15 +4,13 @@ import {
|
||||
collectAllowlistProviderRestrictSendersWarnings,
|
||||
} from "openclaw/plugin-sdk/channel-policy";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
deleteAccountFromConfigSection,
|
||||
getChatChannelMeta,
|
||||
normalizeE164,
|
||||
setAccountEnabledInConfigSection,
|
||||
SignalConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/signal";
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { normalizeE164 } from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
listSignalAccountIds,
|
||||
resolveDefaultSignalAccountId,
|
||||
@@ -44,6 +42,7 @@ 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<
|
||||
@@ -74,7 +73,7 @@ export function createSignalPluginBase(params: {
|
||||
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
||||
},
|
||||
reload: { configPrefixes: ["channels.signal"] },
|
||||
configSchema: buildChannelConfigSchema(SignalConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
listAccountIds: (cfg) => listSignalAccountIds(cfg),
|
||||
resolveAccount: (cfg, accountId) => resolveSignalAccount({ cfg, accountId }),
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/slack";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
SlackConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/slack";
|
||||
import { type ResolvedSlackAccount } from "./accounts.js";
|
||||
import { slackSetupAdapter } from "./setup-core.js";
|
||||
import { slackSetupWizard } from "./setup-surface.js";
|
||||
@@ -6,6 +10,7 @@ import { createSlackPluginBase } from "./shared.js";
|
||||
|
||||
export const slackSetupPlugin: ChannelPlugin<ResolvedSlackAccount> = {
|
||||
...createSlackPluginBase({
|
||||
configSchema: buildChannelConfigSchema(SlackConfigSchema),
|
||||
setupWizard: slackSetupWizard,
|
||||
setup: slackSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -11,6 +11,7 @@ import { resolveOutboundSendDep } from "openclaw/plugin-sdk/channel-runtime";
|
||||
import { buildOutboundBaseSessionKey, normalizeOutboundThreadId } from "openclaw/plugin-sdk/core";
|
||||
import { resolveThreadSessionKeys, type RoutePeer } from "openclaw/plugin-sdk/routing";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
buildComputedAccountStatusSnapshot,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
listSlackDirectoryGroupsFromConfig,
|
||||
@@ -22,6 +23,7 @@ import {
|
||||
resolveConfiguredFromRequiredCredentialStatuses,
|
||||
resolveSlackGroupRequireMention,
|
||||
resolveSlackGroupToolPolicy,
|
||||
SlackConfigSchema,
|
||||
createSlackActions,
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
@@ -307,6 +309,7 @@ async function resolveSlackAllowlistNames(params: {
|
||||
|
||||
export const slackPlugin: ChannelPlugin<ResolvedSlackAccount> = {
|
||||
...createSlackPluginBase({
|
||||
configSchema: buildChannelConfigSchema(SlackConfigSchema),
|
||||
setupWizard: slackSetupWizard,
|
||||
setup: slackSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -2,7 +2,6 @@ import {
|
||||
createAllowlistSetupWizardProxy,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
createEnvPatchedAccountSetupAdapter,
|
||||
formatDocsLink,
|
||||
hasConfiguredSecretInput,
|
||||
type OpenClawConfig,
|
||||
noteChannelLookupFailure,
|
||||
@@ -19,6 +18,7 @@ import {
|
||||
type ChannelSetupWizard,
|
||||
type ChannelSetupWizardAllowFromEntry,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { formatDocsLink } from "openclaw/plugin-sdk/slack";
|
||||
import { inspectSlackAccount } from "./account-inspect.js";
|
||||
import { listSlackAccountIds, resolveSlackAccount, type ResolvedSlackAccount } from "./accounts.js";
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {
|
||||
formatDocsLink,
|
||||
noteChannelLookupFailure,
|
||||
noteChannelLookupSummary,
|
||||
type OpenClawConfig,
|
||||
@@ -12,6 +11,7 @@ import type {
|
||||
ChannelSetupWizard,
|
||||
ChannelSetupWizardAllowFromEntry,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { formatDocsLink } from "openclaw/plugin-sdk/slack";
|
||||
import { resolveDefaultSlackAccountId, resolveSlackAccount } from "./accounts.js";
|
||||
import { resolveSlackChannelAllowlist } from "./resolve-channels.js";
|
||||
import { resolveSlackUserAllowlist } from "./resolve-users.js";
|
||||
|
||||
@@ -3,18 +3,13 @@ import {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { getChatChannelMeta, type ChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
import {
|
||||
formatDocsLink,
|
||||
hasConfiguredSecretInput,
|
||||
patchChannelConfigForAccount,
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
getChatChannelMeta,
|
||||
SlackConfigSchema,
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/slack";
|
||||
} from "openclaw/plugin-sdk/setup";
|
||||
import { inspectSlackAccount } from "./account-inspect.js";
|
||||
import {
|
||||
listSlackAccountIds,
|
||||
@@ -161,6 +156,7 @@ 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<
|
||||
@@ -205,7 +201,7 @@ export function createSlackPluginBase(params: {
|
||||
blockStreamingCoalesceDefaults: { minChars: 1500, idleMs: 1000 },
|
||||
},
|
||||
reload: { configPrefixes: ["channels.slack"] },
|
||||
configSchema: buildChannelConfigSchema(SlackConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
...slackConfigBase,
|
||||
isConfigured: (account) => isSlackPluginAccountConfigured(account),
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/telegram";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
TelegramConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/telegram";
|
||||
import { type ResolvedTelegramAccount } from "./accounts.js";
|
||||
import type { TelegramProbe } from "./probe.js";
|
||||
import { telegramSetupAdapter } from "./setup-core.js";
|
||||
@@ -7,6 +11,7 @@ import { createTelegramPluginBase } from "./shared.js";
|
||||
|
||||
export const telegramSetupPlugin: ChannelPlugin<ResolvedTelegramAccount, TelegramProbe> = {
|
||||
...createTelegramPluginBase({
|
||||
configSchema: buildChannelConfigSchema(TelegramConfigSchema),
|
||||
setupWizard: telegramSetupWizard,
|
||||
setup: telegramSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -12,6 +12,7 @@ import { buildExecApprovalPendingReplyPayload } from "openclaw/plugin-sdk/infra-
|
||||
import { resolveThreadSessionKeys, type RoutePeer } from "openclaw/plugin-sdk/routing";
|
||||
import { parseTelegramTopicConversation } from "openclaw/plugin-sdk/telegram";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
buildTokenChannelStatusSummary,
|
||||
clearAccountEntryFields,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
@@ -20,6 +21,7 @@ import {
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
TelegramConfigSchema,
|
||||
resolveTelegramGroupRequireMention,
|
||||
resolveTelegramGroupToolPolicy,
|
||||
type ChannelPlugin,
|
||||
@@ -296,6 +298,7 @@ function readTelegramAllowlistConfig(account: ResolvedTelegramAccount) {
|
||||
|
||||
export const telegramPlugin: ChannelPlugin<ResolvedTelegramAccount, TelegramProbe> = {
|
||||
...createTelegramPluginBase({
|
||||
configSchema: buildChannelConfigSchema(TelegramConfigSchema),
|
||||
setupWizard: telegramSetupWizard,
|
||||
setup: telegramSetupAdapter,
|
||||
}),
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
createEnvPatchedAccountSetupAdapter,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatCliCommand,
|
||||
formatDocsLink,
|
||||
patchChannelConfigForAccount,
|
||||
promptResolvedAllowFrom,
|
||||
splitSetupEntries,
|
||||
@@ -10,6 +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 { resolveDefaultTelegramAccountId, resolveTelegramAccount } from "./accounts.js";
|
||||
import { fetchTelegramChatId } from "./api-fetch.js";
|
||||
|
||||
|
||||
@@ -1,16 +1,14 @@
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import {
|
||||
createScopedAccountConfigAccessors,
|
||||
createScopedChannelConfigBase,
|
||||
createScopedAccountConfigAccessors,
|
||||
} from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
getChatChannelMeta,
|
||||
normalizeAccountId,
|
||||
TelegramConfigSchema,
|
||||
type ChannelPlugin,
|
||||
type OpenClawConfig,
|
||||
} from "openclaw/plugin-sdk/telegram";
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { inspectTelegramAccount } from "./account-inspect.js";
|
||||
import {
|
||||
listTelegramAccountIds,
|
||||
@@ -73,6 +71,7 @@ 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<
|
||||
@@ -96,7 +95,7 @@ export function createTelegramPluginBase(params: {
|
||||
blockStreaming: true,
|
||||
},
|
||||
reload: { configPrefixes: ["channels.telegram"] },
|
||||
configSchema: buildChannelConfigSchema(TelegramConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
...telegramConfigBase,
|
||||
isConfigured: (account, cfg) => {
|
||||
|
||||
@@ -1,4 +1,11 @@
|
||||
import { type ChannelPlugin } from "openclaw/plugin-sdk/whatsapp";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
resolveWhatsAppGroupIntroHint,
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
WhatsAppConfigSchema,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/whatsapp";
|
||||
import { type ResolvedWhatsAppAccount } from "./accounts.js";
|
||||
import { webAuthExists } from "./auth-store.js";
|
||||
import { whatsappSetupAdapter } from "./setup-core.js";
|
||||
@@ -6,6 +13,12 @@ import { createWhatsAppPluginBase, whatsappSetupWizardProxy } from "./shared.js"
|
||||
|
||||
export const whatsappSetupPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
...createWhatsAppPluginBase({
|
||||
configSchema: buildChannelConfigSchema(WhatsAppConfigSchema),
|
||||
groups: {
|
||||
resolveRequireMention: resolveWhatsAppGroupRequireMention,
|
||||
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
|
||||
resolveGroupIntroHint: resolveWhatsAppGroupIntroHint,
|
||||
},
|
||||
setupWizard: whatsappSetupWizardProxy,
|
||||
setup: whatsappSetupAdapter,
|
||||
isConfigured: async (account) => await webAuthExists(account.authDir),
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { buildAccountScopedAllowlistConfigEditor } from "openclaw/plugin-sdk/allowlist-config-edit";
|
||||
import {
|
||||
buildChannelConfigSchema,
|
||||
createActionGate,
|
||||
createWhatsAppOutboundBase,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
@@ -7,9 +8,13 @@ import {
|
||||
listWhatsAppDirectoryGroupsFromConfig,
|
||||
listWhatsAppDirectoryPeersFromConfig,
|
||||
readStringParam,
|
||||
resolveWhatsAppGroupIntroHint,
|
||||
resolveWhatsAppGroupRequireMention,
|
||||
resolveWhatsAppGroupToolPolicy,
|
||||
resolveWhatsAppOutboundTarget,
|
||||
resolveWhatsAppHeartbeatRecipients,
|
||||
resolveWhatsAppMentionStripRegexes,
|
||||
WhatsAppConfigSchema,
|
||||
type ChannelMessageActionName,
|
||||
type ChannelPlugin,
|
||||
} from "openclaw/plugin-sdk/whatsapp";
|
||||
@@ -44,6 +49,12 @@ function parseWhatsAppExplicitTarget(raw: string) {
|
||||
|
||||
export const whatsappPlugin: ChannelPlugin<ResolvedWhatsAppAccount> = {
|
||||
...createWhatsAppPluginBase({
|
||||
configSchema: buildChannelConfigSchema(WhatsAppConfigSchema),
|
||||
groups: {
|
||||
resolveRequireMention: resolveWhatsAppGroupRequireMention,
|
||||
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
|
||||
resolveGroupIntroHint: resolveWhatsAppGroupIntroHint,
|
||||
},
|
||||
setupWizard: whatsappSetupWizardProxy,
|
||||
setup: whatsappSetupAdapter,
|
||||
isConfigured: async (account) =>
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import path from "node:path";
|
||||
import {
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
formatCliCommand,
|
||||
formatDocsLink,
|
||||
normalizeAccountId,
|
||||
normalizeAllowFromEntries,
|
||||
normalizeE164,
|
||||
@@ -13,6 +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 { listWhatsAppAccountIds, resolveWhatsAppAuthDir } from "./accounts.js";
|
||||
import { loginWeb } from "./login.js";
|
||||
import { whatsappSetupAdapter } from "./setup-core.js";
|
||||
|
||||
@@ -1,22 +1,19 @@
|
||||
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/whatsapp";
|
||||
} from "openclaw/plugin-sdk/core";
|
||||
import { normalizeE164 } from "openclaw/plugin-sdk/setup";
|
||||
import {
|
||||
listWhatsAppAccountIds,
|
||||
resolveDefaultWhatsAppAccountId,
|
||||
@@ -79,6 +76,8 @@ 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"];
|
||||
@@ -114,7 +113,7 @@ export function createWhatsAppPluginBase(params: {
|
||||
},
|
||||
reload: { configPrefixes: ["web"], noopPrefixes: ["channels.whatsapp"] },
|
||||
gatewayMethods: ["web.login.start", "web.login.wait"],
|
||||
configSchema: buildChannelConfigSchema(WhatsAppConfigSchema),
|
||||
configSchema: params.configSchema,
|
||||
config: {
|
||||
listAccountIds: (cfg) => listWhatsAppAccountIds(cfg),
|
||||
resolveAccount: (cfg, accountId) => resolveWhatsAppAccount({ cfg, accountId }),
|
||||
@@ -213,10 +212,6 @@ export function createWhatsAppPluginBase(params: {
|
||||
},
|
||||
},
|
||||
setup: params.setup,
|
||||
groups: {
|
||||
resolveRequireMention: resolveWhatsAppGroupRequireMention,
|
||||
resolveToolPolicy: resolveWhatsAppGroupToolPolicy,
|
||||
resolveGroupIntroHint: resolveWhatsAppGroupIntroHint,
|
||||
},
|
||||
groups: params.groups,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user