mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-02 10:50:27 +00:00
refactor(discord): narrow channel runtime imports
This commit is contained in:
11
extensions/discord/src/channel-api.ts
Normal file
11
extensions/discord/src/channel-api.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
export { DEFAULT_ACCOUNT_ID } from "openclaw/plugin-sdk/account-id";
|
||||
export {
|
||||
buildTokenChannelStatusSummary,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
} from "openclaw/plugin-sdk/channel-status";
|
||||
export { createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
export { getChatChannelMeta } from "openclaw/plugin-sdk/core";
|
||||
export type { ChannelPlugin } from "openclaw/plugin-sdk/core";
|
||||
export type { OpenClawConfig } from "openclaw/plugin-sdk/config-runtime";
|
||||
@@ -1,5 +1,5 @@
|
||||
import { type ResolvedDiscordAccount } from "./accounts.js";
|
||||
import { type ChannelPlugin } from "./runtime-api.js";
|
||||
import { type ChannelPlugin } from "./channel-api.js";
|
||||
import { discordSetupAdapter } from "./setup-core.js";
|
||||
import { createDiscordPluginBase } from "./shared.js";
|
||||
|
||||
|
||||
@@ -35,6 +35,16 @@ import {
|
||||
} from "./accounts.js";
|
||||
import { getDiscordApprovalCapability } from "./approval-native.js";
|
||||
import { discordMessageActions as discordMessageActionsImpl } from "./channel-actions.js";
|
||||
import {
|
||||
buildTokenChannelStatusSummary,
|
||||
type ChannelPlugin,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
getChatChannelMeta,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
type OpenClawConfig,
|
||||
} from "./channel-api.js";
|
||||
import { shouldSuppressLocalDiscordExecApprovalPrompt } from "./exec-approvals.js";
|
||||
import {
|
||||
resolveDiscordGroupRequireMention,
|
||||
@@ -52,16 +62,6 @@ import {
|
||||
} from "./normalize.js";
|
||||
import { resolveDiscordOutboundSessionRoute } from "./outbound-session-route.js";
|
||||
import type { DiscordProbe } from "./probe.js";
|
||||
import {
|
||||
buildTokenChannelStatusSummary,
|
||||
type ChannelPlugin,
|
||||
DEFAULT_ACCOUNT_ID,
|
||||
getChatChannelMeta,
|
||||
PAIRING_APPROVED_MESSAGE,
|
||||
projectCredentialSnapshotFields,
|
||||
resolveConfiguredFromCredentialStatuses,
|
||||
type OpenClawConfig,
|
||||
} from "./runtime-api.js";
|
||||
import { getDiscordRuntime } from "./runtime.js";
|
||||
import { collectDiscordSecurityAuditFindings } from "./security-audit.js";
|
||||
import { normalizeExplicitDiscordSessionKey } from "./session-key-normalization.js";
|
||||
@@ -125,7 +125,9 @@ function loadDiscordCarbonModule() {
|
||||
return discordCarbonModuleCache;
|
||||
}
|
||||
|
||||
const meta = getChatChannelMeta("discord");
|
||||
const meta = {
|
||||
...getChatChannelMeta("discord"),
|
||||
};
|
||||
const REQUIRED_DISCORD_PERMISSIONS = ["ViewChannel", "SendMessages"] as const;
|
||||
const DISCORD_ACCOUNT_STARTUP_STAGGER_MS = 10_000;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import { describeAccountSnapshot } from "openclaw/plugin-sdk/account-helpers";
|
||||
import { formatAllowFromLowercase } from "openclaw/plugin-sdk/allow-from";
|
||||
import { adaptScopedAccountAccessor } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { createScopedChannelConfigAdapter } from "openclaw/plugin-sdk/channel-config-helpers";
|
||||
import { createChannelPluginBase } from "openclaw/plugin-sdk/core";
|
||||
import { inspectDiscordAccount } from "./account-inspect.js";
|
||||
import {
|
||||
@@ -9,13 +10,9 @@ import {
|
||||
resolveDiscordAccount,
|
||||
type ResolvedDiscordAccount,
|
||||
} from "./accounts.js";
|
||||
import { getChatChannelMeta, type ChannelPlugin } from "./channel-api.js";
|
||||
import { DiscordChannelConfigSchema } from "./config-schema.js";
|
||||
import { discordDoctor } from "./doctor.js";
|
||||
import {
|
||||
createScopedChannelConfigAdapter,
|
||||
getChatChannelMeta,
|
||||
type ChannelPlugin,
|
||||
} from "./runtime-api.js";
|
||||
import { createDiscordSetupWizardProxy } from "./setup-core.js";
|
||||
|
||||
export const DISCORD_CHANNEL = "discord" as const;
|
||||
|
||||
Reference in New Issue
Block a user