import { F as ChannelStatusIssue, m as ChannelGroupContext, r as ChannelAccountSnapshot, y as ChannelMessageActionAdapter } from "./types.core-BmfAaoNc.js";
import { i as NodmixConfig } from "./types.nodmix-B9QJSty6.js";
import { n as ChannelPlugin, t as ChannelMessageActionName } from "./types.public-CKhKa3eB.js";
import { n as normalizeAccountId, t as DEFAULT_ACCOUNT_ID } from "./account-id-Dh6XMgGH.js";
import { C as NodmixPluginApi, Qn as PluginRuntime } from "./types-CLo6hM78.js";
import { r as buildChannelConfigSchema } from "./config-schema-DUddICQM.js";
import { r as DiscordConfigSchema } from "./bundled-channel-config-schema-edo71HIV.js";
import { r as emptyPluginConfigSchema } from "./config-schema-B6Srley6.js";
import { s as migrateBaseNameToDefaultAccount, t as applyAccountNameToChannelSection } from "./setup-helpers-CvFozu4p.js";
import { t as PAIRING_APPROVED_MESSAGE } from "./pairing-message-CyZgBOdK.js";
import { t as getChatChannelMeta } from "./channel-plugin-common-CIhdCQ_M.js";
import { n as resolveConfiguredFromCredentialStatuses, t as projectCredentialSnapshotFields } from "./channel-status-uTHLyJJF.js";
import { o as buildTokenChannelStatusSummary, r as buildComputedAccountStatusSnapshot } from "./status-helpers-B6V6P73f.js";
//#region src/plugin-sdk/discord.d.ts
type DiscordAccountConfig = NonNullable<NonNullable<NodmixConfig["channels"]>["discord"]>;
type DiscordComponentMessageSpec = {
  text?: string;
  reusable?: boolean;
  container?: {
    accentColor?: string | number;
    spoiler?: boolean;
  };
  blocks?: unknown[];
  modal?: unknown;
};
type DiscordComponentBuildResult = {
  components: unknown[];
  entries: unknown[];
  modals: unknown[];
};
type DiscordComponentSendOpts = {
  cfg?: NodmixConfig;
  accountId?: string;
  replyTo?: string;
  files?: unknown;
  mediaReadFile?: (filePath: string) => Promise<Buffer>;
  filename?: string;
  textLimit?: number;
  maxLinesPerMessage?: number;
  tableMode?: unknown;
  chunkMode?: unknown;
  [key: string]: unknown;
};
type DiscordComponentSendResult = {
  id?: string;
  channel_id?: string;
  [key: string]: unknown;
};
type ResolvedDiscordAccount = {
  accountId: string;
  enabled: boolean;
  name?: string;
  token: string;
  tokenSource: "env" | "config" | "none";
  config: DiscordAccountConfig;
};
type DiscordOutboundTargetResolution = {
  ok: true;
  to: string;
} | {
  ok: false;
  error: Error;
};
type ThreadBindingTargetKind = "subagent" | "acp";
type ThreadBindingRecord = {
  accountId: string;
  threadId: string;
  channelId?: string;
  targetKind: ThreadBindingTargetKind;
  targetSessionKey: string;
  [key: string]: unknown;
};
type DirectoryConfigParams = {
  cfg: NodmixConfig;
  accountId?: string | null;
};
type BuildDiscordComponentMessage = (params: {
  spec: DiscordComponentMessageSpec;
  fallbackText?: string;
  sessionKey?: string;
  agentId?: string;
  accountId?: string;
}) => DiscordComponentBuildResult;
type EditDiscordComponentMessage = (to: string, messageId: string, spec: DiscordComponentMessageSpec, opts: DiscordComponentSendOpts) => Promise<DiscordComponentSendResult>;
type RegisterBuiltDiscordComponentMessage = (params: {
  buildResult: DiscordComponentBuildResult;
  messageId: string;
}) => void;
type DiscordApiFacadeModule = {
  collectDiscordStatusIssues: (accounts: ChannelAccountSnapshot[]) => ChannelStatusIssue[];
  buildDiscordComponentMessage: BuildDiscordComponentMessage;
  discordOnboardingAdapter?: NonNullable<ChannelPlugin<ResolvedDiscordAccount>["setup"]>;
  inspectDiscordAccount: (params: {
    cfg: NodmixConfig;
    accountId?: string | null;
  }) => unknown;
  listDiscordAccountIds: (cfg: NodmixConfig) => string[];
  listDiscordDirectoryGroupsFromConfig: (params: DirectoryConfigParams) => unknown[] | Promise<unknown[]>;
  listDiscordDirectoryPeersFromConfig: (params: DirectoryConfigParams) => unknown[] | Promise<unknown[]>;
  looksLikeDiscordTargetId: (raw: string) => boolean;
  normalizeDiscordMessagingTarget: (raw: string) => string | undefined;
  normalizeDiscordOutboundTarget: (to?: string) => DiscordOutboundTargetResolution;
  resolveDefaultDiscordAccountId: (cfg: NodmixConfig) => string;
  resolveDiscordAccount: (params: {
    cfg: NodmixConfig;
    accountId?: string | null;
  }) => ResolvedDiscordAccount;
  resolveDiscordGroupRequireMention: (params: ChannelGroupContext) => boolean | undefined;
  resolveDiscordGroupToolPolicy: (params: ChannelGroupContext) => unknown;
};
type DiscordRuntimeFacadeModule = {
  editDiscordComponentMessage: EditDiscordComponentMessage;
  registerBuiltDiscordComponentMessage: RegisterBuiltDiscordComponentMessage;
  autoBindSpawnedDiscordSubagent: (params: {
    cfg: NodmixConfig;
    accountId?: string;
    channel?: string;
    to?: string;
    threadId?: string | number;
    childSessionKey: string;
    agentId: string;
    label?: string;
    boundBy?: string;
  }) => Promise<ThreadBindingRecord | null>;
  collectDiscordAuditChannelIds: (params: {
    cfg: NodmixConfig;
    accountId?: string | null;
  }) => unknown;
  listThreadBindingsBySessionKey: (params: {
    targetSessionKey: string;
    accountId?: string;
    targetKind?: ThreadBindingTargetKind;
  }) => ThreadBindingRecord[];
  unbindThreadBindingsBySessionKey: (params: {
    targetSessionKey: string;
    accountId?: string;
    targetKind?: ThreadBindingTargetKind;
    reason?: string;
    sendFarewell?: boolean;
    farewellText?: string;
  }) => ThreadBindingRecord[];
};
declare const discordOnboardingAdapter: {};
declare function collectDiscordStatusIssues(accounts: ChannelAccountSnapshot[]): ChannelStatusIssue[];
declare const buildDiscordComponentMessage: DiscordApiFacadeModule["buildDiscordComponentMessage"];
declare function inspectDiscordAccount(params: {
  cfg: NodmixConfig;
  accountId?: string | null;
}): unknown;
declare function listDiscordAccountIds(cfg: NodmixConfig): string[];
declare function listDiscordDirectoryGroupsFromConfig(params: DirectoryConfigParams): unknown[] | Promise<unknown[]>;
declare function listDiscordDirectoryPeersFromConfig(params: DirectoryConfigParams): unknown[] | Promise<unknown[]>;
declare function looksLikeDiscordTargetId(raw: string): boolean;
declare function normalizeDiscordMessagingTarget(raw: string): string | undefined;
declare function normalizeDiscordOutboundTarget(to?: string): DiscordOutboundTargetResolution;
declare function resolveDefaultDiscordAccountId(cfg: NodmixConfig): string;
declare function resolveDiscordAccount(params: {
  cfg: NodmixConfig;
  accountId?: string | null;
}): ResolvedDiscordAccount;
declare function resolveDiscordGroupRequireMention(params: ChannelGroupContext): boolean | undefined;
declare function resolveDiscordGroupToolPolicy(params: ChannelGroupContext): unknown;
declare function collectDiscordAuditChannelIds(params: {
  cfg: NodmixConfig;
  accountId?: string | null;
}): unknown;
declare const editDiscordComponentMessage: DiscordRuntimeFacadeModule["editDiscordComponentMessage"];
declare const registerBuiltDiscordComponentMessage: DiscordRuntimeFacadeModule["registerBuiltDiscordComponentMessage"];
declare function autoBindSpawnedDiscordSubagent(params: {
  cfg?: NodmixConfig;
  accountId?: string;
  channel?: string;
  to?: string;
  threadId?: string | number;
  childSessionKey: string;
  agentId: string;
  label?: string;
  boundBy?: string;
}): Promise<ThreadBindingRecord | null>;
declare function listThreadBindingsBySessionKey(params: {
  targetSessionKey: string;
  accountId?: string;
  targetKind?: ThreadBindingTargetKind;
}): ThreadBindingRecord[];
declare function unbindThreadBindingsBySessionKey(params: {
  targetSessionKey: string;
  accountId?: string;
  targetKind?: ThreadBindingTargetKind;
  reason?: string;
  sendFarewell?: boolean;
  farewellText?: string;
}): ThreadBindingRecord[];
//#endregion
export { type ChannelMessageActionAdapter, type ChannelMessageActionName, type ChannelPlugin, DEFAULT_ACCOUNT_ID, DiscordAccountConfig, DiscordComponentBuildResult, DiscordComponentMessageSpec, DiscordComponentSendOpts, DiscordComponentSendResult, DiscordConfigSchema, DiscordOutboundTargetResolution, type NodmixConfig, type NodmixPluginApi, PAIRING_APPROVED_MESSAGE, type PluginRuntime, ResolvedDiscordAccount, ThreadBindingRecord, ThreadBindingTargetKind, applyAccountNameToChannelSection, autoBindSpawnedDiscordSubagent, buildChannelConfigSchema, buildComputedAccountStatusSnapshot, buildDiscordComponentMessage, buildTokenChannelStatusSummary, collectDiscordAuditChannelIds, collectDiscordStatusIssues, discordOnboardingAdapter, editDiscordComponentMessage, emptyPluginConfigSchema, getChatChannelMeta, inspectDiscordAccount, listDiscordAccountIds, listDiscordDirectoryGroupsFromConfig, listDiscordDirectoryPeersFromConfig, listThreadBindingsBySessionKey, looksLikeDiscordTargetId, migrateBaseNameToDefaultAccount, normalizeAccountId, normalizeDiscordMessagingTarget, normalizeDiscordOutboundTarget, projectCredentialSnapshotFields, registerBuiltDiscordComponentMessage, resolveConfiguredFromCredentialStatuses, resolveDefaultDiscordAccountId, resolveDiscordAccount, resolveDiscordGroupRequireMention, resolveDiscordGroupToolPolicy, unbindThreadBindingsBySessionKey };