import { i as OpenClawConfig } from "./types.openclaw-CpnoYlBx.js"; import { t as ChannelId } from "./channel-id.types-DjYEl-_2.js"; import { n as ChannelAllowlistAdapter } from "./types.adapters-BFws9krA.js"; //#region src/plugin-sdk/allowlist-config-edit.d.ts type AllowlistConfigPaths = { readPaths: string[][]; writePath: string[]; cleanupPaths?: string[][]; }; /** Named allowlist entries attached to a route-specific override. */ type AllowlistGroupOverride = { label: string; entries: string[]; }; /** Per-entry display-name lookup results for channel allowlist UIs. */ type AllowlistNameResolution = Array<{ input: string; resolved: boolean; name?: string | null; }>; type AllowlistNormalizer = (params: { cfg: OpenClawConfig; accountId?: string | null; values: Array; }) => string[]; type AllowlistAccountResolver = (params: { cfg: OpenClawConfig; accountId?: string | null; }) => ResolvedAccount; /** Resolve modern DM/group allowlist paths for account-scoped channel config writes. */ declare function resolveDmGroupAllowlistConfigPaths(scope: "dm" | "group"): AllowlistConfigPaths; /** Resolve DM-only paths that still read and clean up the old nested dm.allowFrom location. */ declare function resolveLegacyDmAllowlistConfigPaths(scope: "dm" | "group"): AllowlistConfigPaths | null; /** Coerce stored allowlist entries into presentable non-empty strings. */ declare function readConfiguredAllowlistEntries(entries: Array | null | undefined): string[]; /** Collect labeled allowlist overrides from a flat keyed record. */ declare function collectAllowlistOverridesFromRecord(params: { record: Record | null | undefined; label: (key: string, value: T) => string; resolveEntries: (value: T) => Array | null | undefined; }): AllowlistGroupOverride[]; /** Collect labeled allowlist overrides from an outer record with nested child records. */ declare function collectNestedAllowlistOverridesFromRecord(params: { record: Record | null | undefined; outerLabel: (key: string, value: Outer) => string; resolveOuterEntries: (value: Outer) => Array | null | undefined; resolveChildren: (value: Outer) => Record | null | undefined; innerLabel: (outerKey: string, innerKey: string, inner: Inner) => string; resolveInnerEntries: (value: Inner) => Array | null | undefined; }): AllowlistGroupOverride[]; /** Build an account-scoped flat override resolver from a keyed allowlist record. */ declare function createFlatAllowlistOverrideResolver(params: { resolveRecord: (account: ResolvedAccount) => Record | null | undefined; label: (key: string, value: Entry) => string; resolveEntries: (value: Entry) => Array | null | undefined; }): (account: ResolvedAccount) => AllowlistGroupOverride[]; /** Build an account-scoped nested override resolver from hierarchical allowlist records. */ declare function createNestedAllowlistOverrideResolver(params: { resolveRecord: (account: ResolvedAccount) => Record | null | undefined; outerLabel: (key: string, value: Outer) => string; resolveOuterEntries: (value: Outer) => Array | null | undefined; resolveChildren: (value: Outer) => Record | null | undefined; innerLabel: (outerKey: string, innerKey: string, inner: Inner) => string; resolveInnerEntries: (value: Inner) => Array | null | undefined; }): (account: ResolvedAccount) => AllowlistGroupOverride[]; /** Build the common account-scoped token-gated allowlist name resolver. */ declare function createAccountScopedAllowlistNameResolver(params: { resolveAccount: (params: { cfg: OpenClawConfig; accountId?: string | null; }) => ResolvedAccount; resolveToken: (account: ResolvedAccount) => string | null | undefined; resolveNames: (params: { token: string; entries: string[]; }) => Promise; }): NonNullable; /** Build the default account-scoped allowlist editor used by channel plugins with config-backed lists. */ declare function buildAccountScopedAllowlistConfigEditor(params: { channelId: ChannelId; normalize: AllowlistNormalizer; resolvePaths: (scope: "dm" | "group") => AllowlistConfigPaths | null; }): NonNullable; /** Build the common DM/group allowlist adapter used by channels that store both lists in config. */ declare function buildDmGroupAccountAllowlistAdapter(params: { channelId: ChannelId; resolveAccount: AllowlistAccountResolver; normalize: AllowlistNormalizer; resolveDmAllowFrom: (account: ResolvedAccount, context: { cfg: OpenClawConfig; accountId?: string | null; }) => Array | null | undefined; resolveGroupAllowFrom: (account: ResolvedAccount) => Array | null | undefined; resolveDmPolicy?: (account: ResolvedAccount) => string | null | undefined; resolveGroupPolicy?: (account: ResolvedAccount) => string | null | undefined; resolveGroupOverrides?: (account: ResolvedAccount) => AllowlistGroupOverride[] | undefined; }): Pick; /** Build the common DM-only allowlist adapter for channels with legacy dm.allowFrom fallback paths. */ declare function buildLegacyDmAccountAllowlistAdapter(params: { channelId: ChannelId; resolveAccount: AllowlistAccountResolver; normalize: AllowlistNormalizer; resolveDmAllowFrom: (account: ResolvedAccount, context: { cfg: OpenClawConfig; accountId?: string | null; }) => Array | null | undefined; resolveGroupPolicy?: (account: ResolvedAccount) => string | null | undefined; resolveGroupOverrides?: (account: ResolvedAccount) => AllowlistGroupOverride[] | undefined; }): Pick; //#endregion export { AllowlistGroupOverride, AllowlistNameResolution, buildAccountScopedAllowlistConfigEditor, buildDmGroupAccountAllowlistAdapter, buildLegacyDmAccountAllowlistAdapter, collectAllowlistOverridesFromRecord, collectNestedAllowlistOverridesFromRecord, createAccountScopedAllowlistNameResolver, createFlatAllowlistOverrideResolver, createNestedAllowlistOverrideResolver, readConfiguredAllowlistEntries, resolveDmGroupAllowlistConfigPaths, resolveLegacyDmAllowlistConfigPaths };