import type { BotConfig } from "../../../config/config.js"; import type { DmPolicy, GroupPolicy } from "../../../config/types.js"; import type { SecretInput } from "../../../config/types.secrets.js"; import type { WizardPrompter } from "../../../wizard/prompts.js"; import type { PromptAccountId } from "../onboarding-types.js"; export declare const promptAccountId: PromptAccountId; export declare function addWildcardAllowFrom(allowFrom?: Array | null): string[]; export declare function mergeAllowFromEntries(current: Array | null | undefined, additions: Array): string[]; export declare function splitOnboardingEntries(raw: string): string[]; type ParsedOnboardingEntry = { value: string; } | { error: string; }; export declare function parseOnboardingEntriesWithParser(raw: string, parseEntry: (entry: string) => ParsedOnboardingEntry): { entries: string[]; error?: string; }; export declare function parseOnboardingEntriesAllowingWildcard(raw: string, parseEntry: (entry: string) => ParsedOnboardingEntry): { entries: string[]; error?: string; }; export declare function parseMentionOrPrefixedId(params: { value: string; mentionPattern: RegExp; prefixPattern?: RegExp; idPattern: RegExp; normalizeId?: (id: string) => string; }): string | null; export declare function normalizeAllowFromEntries(entries: Array, normalizeEntry?: (value: string) => string | null | undefined): string[]; export declare function resolveOnboardingAccountId(params: { accountId?: string; defaultAccountId: string; }): string; export declare function resolveAccountIdForConfigure(params: { cfg: BotConfig; prompter: WizardPrompter; label: string; accountOverride?: string; shouldPromptAccountIds: boolean; listAccountIds: (cfg: BotConfig) => string[]; defaultAccountId: string; }): Promise; export declare function setAccountAllowFromForChannel(params: { cfg: BotConfig; channel: "imessage" | "signal"; accountId: string; allowFrom: string[]; }): BotConfig; export declare function setChannelDmPolicyWithAllowFrom(params: { cfg: BotConfig; channel: "imessage" | "signal" | "telegram"; dmPolicy: DmPolicy; }): BotConfig; export declare function setLegacyChannelDmPolicyWithAllowFrom(params: { cfg: BotConfig; channel: LegacyDmChannel; dmPolicy: DmPolicy; }): BotConfig; export declare function setLegacyChannelAllowFrom(params: { cfg: BotConfig; channel: LegacyDmChannel; allowFrom: string[]; }): BotConfig; export declare function setAccountGroupPolicyForChannel(params: { cfg: BotConfig; channel: "discord" | "slack"; accountId: string; groupPolicy: GroupPolicy; }): BotConfig; type AccountScopedChannel = "discord" | "slack" | "telegram" | "imessage" | "signal"; type LegacyDmChannel = "discord" | "slack"; export declare function patchLegacyDmChannelConfig(params: { cfg: BotConfig; channel: LegacyDmChannel; patch: Record; }): BotConfig; export declare function setOnboardingChannelEnabled(cfg: BotConfig, channel: AccountScopedChannel, enabled: boolean): BotConfig; export declare function patchChannelConfigForAccount(params: { cfg: BotConfig; channel: AccountScopedChannel; accountId: string; patch: Record; }): BotConfig; export declare function applySingleTokenPromptResult(params: { cfg: BotConfig; channel: "discord" | "telegram"; accountId: string; tokenPatchKey: "token" | "botToken"; tokenResult: { useEnv: boolean; token: SecretInput | null; }; }): BotConfig; export declare function promptSingleChannelToken(params: { prompter: Pick; accountConfigured: boolean; canUseEnv: boolean; hasConfigToken: boolean; envPrompt: string; keepPrompt: string; inputPrompt: string; }): Promise<{ useEnv: boolean; token: string | null; }>; export type SingleChannelSecretInputPromptResult = { action: "keep"; } | { action: "use-env"; } | { action: "set"; value: SecretInput; resolvedValue: string; }; export declare function promptSingleChannelSecretInput(params: { cfg: BotConfig; prompter: Pick; providerHint: string; credentialLabel: string; secretInputMode?: "plaintext" | "ref"; accountConfigured: boolean; canUseEnv: boolean; hasConfigToken: boolean; envPrompt: string; keepPrompt: string; inputPrompt: string; preferredEnvVar?: string; }): Promise; type ParsedAllowFromResult = { entries: string[]; error?: string; }; export declare function promptParsedAllowFromForScopedChannel(params: { cfg: BotConfig; channel: "imessage" | "signal"; accountId?: string; defaultAccountId: string; prompter: Pick; noteTitle: string; noteLines: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom: (params: { cfg: BotConfig; accountId: string; }) => Array; }): Promise; export declare function noteChannelLookupSummary(params: { prompter: Pick; label: string; resolvedSections: Array<{ title: string; values: string[]; }>; unresolved?: string[]; }): Promise; export declare function noteChannelLookupFailure(params: { prompter: Pick; label: string; error: unknown; }): Promise; type AllowFromResolution = { input: string; resolved: boolean; id?: string | null; }; export declare function promptResolvedAllowFrom(params: { prompter: WizardPrompter; existing: Array; token?: string | null; message: string; placeholder: string; label: string; parseInputs: (value: string) => string[]; parseId: (value: string) => string | null; invalidWithoutTokenNote: string; resolveEntries: (params: { token: string; entries: string[]; }) => Promise; }): Promise; export declare function promptLegacyChannelAllowFrom(params: { cfg: BotConfig; channel: LegacyDmChannel; prompter: WizardPrompter; existing: Array; token?: string | null; noteTitle: string; noteLines: string[]; message: string; placeholder: string; parseId: (value: string) => string | null; invalidWithoutTokenNote: string; resolveEntries: (params: { token: string; entries: string[]; }) => Promise; }): Promise; export {};