import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { N as ChannelSecurityDmPolicy } from "./types.core-BSyOg0vX.js"; import { G as ConfigWriteScopeLike, K as ConfigWriteTargetLike, W as ConfigWriteAuthorizationResultLike, g as ChannelConfigAdapter } from "./types.adapters-DatL0h_D.js"; //#region src/plugin-sdk/channel-config-helpers.d.ts type ConfigWriteScope = ConfigWriteScopeLike; type ConfigWriteTarget = ConfigWriteTargetLike; type ConfigWriteAuthorizationResult = ConfigWriteAuthorizationResultLike; type ChannelCrudConfigAdapter = Pick, "listAccountIds" | "resolveAccount" | "inspectAccount" | "defaultAccountId" | "setAccountEnabled" | "deleteAccount">; type ChannelConfigAdapterWithAccessors = Pick, "listAccountIds" | "resolveAccount" | "inspectAccount" | "defaultAccountId" | "setAccountEnabled" | "deleteAccount" | "resolveAllowFrom" | "formatAllowFrom" | "resolveDefaultTo">; declare function resolveChannelConfigWrites(params: { cfg: KlawConfig; channelId?: string | null; accountId?: string | null; }): boolean; declare function authorizeConfigWrite(params: { cfg: KlawConfig; origin?: ConfigWriteScope; target?: ConfigWriteTarget; allowBypass?: boolean; }): ConfigWriteAuthorizationResult; declare function canBypassConfigWritePolicy(params: { channel?: string | null; gatewayClientScopes?: string[] | null; }): boolean; declare function formatConfigWriteDeniedMessage(params: { result: Exclude; fallbackChannelId?: string | null; }): string; type ChannelConfigAccessorParams = { cfg: Config; accountId?: string | null; }; type MultiAccountChannelConfigAdapterParams = { sectionKey: string; listAccountIds: (cfg: Config) => string[]; resolveAccount: (cfg: Config, accountId?: string | null) => ResolvedAccount; resolveAccessorAccount?: (params: ChannelConfigAccessorParams) => AccessorAccount; defaultAccountId: (cfg: Config) => string; inspectAccount?: (cfg: Config, accountId?: string | null) => unknown; clearBaseFields: string[]; resolveAllowFrom: (account: AccessorAccount) => Array | null | undefined; formatAllowFrom: (allowFrom: Array) => string[]; resolveDefaultTo?: (account: AccessorAccount) => string | number | null | undefined; }; type NamedAccountChannelConfigBaseParams = { sectionKey: string; listAccountIds: (cfg: Config) => string[]; resolveAccount: (cfg: Config, accountId?: string | null) => ResolvedAccount; defaultAccountId: (cfg: Config) => string; inspectAccount?: (cfg: Config, accountId?: string | null) => unknown; clearBaseFields: string[]; }; /** Coerce mixed allowlist config values into plain strings without trimming or deduping. */ declare function mapAllowFromEntries(allowFrom: Array | null | undefined): string[]; /** Normalize user-facing allowlist entries the same way config and doctor flows expect. */ declare function formatTrimmedAllowFromEntries(allowFrom: Array): string[]; /** Collapse nullable config scalars into a trimmed optional string. */ declare function resolveOptionalConfigString(value: string | number | null | undefined): string | undefined; /** Adapt `{ cfg, accountId }` accessors to callback sites that pass positional args. */ declare function adaptScopedAccountAccessor(accessor: (params: { cfg: Config; accountId?: string | null; }) => Result): (cfg: Config, accountId?: string | null) => Result; /** Build the shared allowlist/default target adapter surface for account-scoped channel configs. */ declare function createScopedAccountConfigAccessors(params: { resolveAccount: (params: { cfg: Config; accountId?: string | null; }) => ResolvedAccount; resolveAllowFrom: (account: ResolvedAccount) => Array | null | undefined; formatAllowFrom: (allowFrom: Array) => string[]; resolveDefaultTo?: (account: ResolvedAccount) => string | number | null | undefined; }): Pick, "resolveAllowFrom" | "formatAllowFrom" | "resolveDefaultTo">; /** Build the common CRUD/config helpers for channels that store multiple named accounts. */ declare function createScopedChannelConfigBase(params: NamedAccountChannelConfigBaseParams & { allowTopLevel?: boolean; }): ChannelCrudConfigAdapter; /** Build the full shared config adapter for account-scoped channels with allowlist/default target accessors. */ declare function createScopedChannelConfigAdapter(params: MultiAccountChannelConfigAdapterParams & { allowTopLevel?: boolean; }): ChannelConfigAdapterWithAccessors; /** Build CRUD/config helpers for top-level single-account channels. */ declare function createTopLevelChannelConfigBase(params: { sectionKey: string; resolveAccount: (cfg: Config) => ResolvedAccount; listAccountIds?: (cfg: Config) => string[]; defaultAccountId?: (cfg: Config) => string; inspectAccount?: (cfg: Config) => unknown; deleteMode?: "remove-section" | "clear-fields"; clearBaseFields?: string[]; }): Pick, "listAccountIds" | "resolveAccount" | "inspectAccount" | "defaultAccountId" | "setAccountEnabled" | "deleteAccount">; /** Build the full shared config adapter for top-level single-account channels with allowlist/default target accessors. */ declare function createTopLevelChannelConfigAdapter(params: { sectionKey: string; resolveAccount: (cfg: Config) => ResolvedAccount; resolveAccessorAccount?: (params: { cfg: Config; accountId?: string | null; }) => AccessorAccount; listAccountIds?: (cfg: Config) => string[]; defaultAccountId?: (cfg: Config) => string; inspectAccount?: (cfg: Config) => unknown; deleteMode?: "remove-section" | "clear-fields"; clearBaseFields?: string[]; resolveAllowFrom: (account: AccessorAccount) => Array | null | undefined; formatAllowFrom: (allowFrom: Array) => string[]; resolveDefaultTo?: (account: AccessorAccount) => string | number | null | undefined; }): ChannelConfigAdapterWithAccessors; /** Build CRUD/config helpers for channels where the default account lives at channel root and named accounts live under `accounts`. */ declare function createHybridChannelConfigBase(params: NamedAccountChannelConfigBaseParams & { preserveSectionOnDefaultDelete?: boolean; }): ChannelCrudConfigAdapter; /** Build the full shared config adapter for hybrid channels with allowlist/default target accessors. */ declare function createHybridChannelConfigAdapter(params: MultiAccountChannelConfigAdapterParams & { preserveSectionOnDefaultDelete?: boolean; }): ChannelConfigAdapterWithAccessors; /** Convert account-specific DM security fields into the shared runtime policy resolver shape. */ declare function createScopedDmSecurityResolver(params: { channelKey: string; resolvePolicy: (account: ResolvedAccount) => string | null | undefined; resolveAllowFrom: (account: ResolvedAccount) => Array | null | undefined; resolveAccess?: (params: { cfg: KlawConfig; accountId?: string | null; account: ResolvedAccount; }) => { dmPolicy?: string | null; allowFrom?: Array | null; }; resolveFallbackAccountId?: (account: ResolvedAccount) => string | null | undefined; defaultPolicy?: string; allowFromPathSuffix?: string; policyPathSuffix?: string; approveChannelId?: string; approveHint?: string; normalizeEntry?: (raw: string) => string; inheritSharedDefaultsFromDefaultAccount?: boolean; }): ({ cfg, accountId, account }: { cfg: KlawConfig; accountId?: string | null; account: ResolvedAccount; }) => ChannelSecurityDmPolicy; //#endregion export { mapAllowFromEntries as _, authorizeConfigWrite as a, createHybridChannelConfigBase as c, createScopedChannelConfigBase as d, createScopedDmSecurityResolver as f, formatTrimmedAllowFromEntries as g, formatConfigWriteDeniedMessage as h, adaptScopedAccountAccessor as i, createScopedAccountConfigAccessors as l, createTopLevelChannelConfigBase as m, ConfigWriteScope as n, canBypassConfigWritePolicy as o, createTopLevelChannelConfigAdapter as p, ConfigWriteTarget as r, createHybridChannelConfigAdapter as s, ConfigWriteAuthorizationResult as t, createScopedChannelConfigAdapter as u, resolveChannelConfigWrites as v, resolveOptionalConfigString as y };