import type { BotConfig } from "../../config/config.js"; import type { DmPolicy } from "../../config/types.js"; import type { RuntimeEnv } from "../../runtime.js"; import type { WizardPrompter } from "../../wizard/prompts.js"; import type { ChannelId } from "./types.js"; export type SetupChannelsOptions = { allowDisable?: boolean; allowSignalInstall?: boolean; onSelection?: (selection: ChannelId[]) => void; accountIds?: Partial>; onAccountId?: (channel: ChannelId, accountId: string) => void; promptAccountIds?: boolean; whatsappAccountId?: string; promptWhatsAppAccountId?: boolean; onWhatsAppAccountId?: (accountId: string) => void; forceAllowFromChannels?: ChannelId[]; skipStatusNote?: boolean; skipDmPolicyPrompt?: boolean; skipConfirm?: boolean; quickstartDefaults?: boolean; initialSelection?: ChannelId[]; secretInputMode?: "plaintext" | "ref"; }; export type PromptAccountIdParams = { cfg: BotConfig; prompter: WizardPrompter; label: string; currentId?: string; listAccountIds: (cfg: BotConfig) => string[]; defaultAccountId: string; }; export type PromptAccountId = (params: PromptAccountIdParams) => Promise; export type ChannelOnboardingStatus = { channel: ChannelId; configured: boolean; statusLines: string[]; selectionHint?: string; quickstartScore?: number; }; export type ChannelOnboardingStatusContext = { cfg: BotConfig; options?: SetupChannelsOptions; accountOverrides: Partial>; }; export type ChannelOnboardingConfigureContext = { cfg: BotConfig; runtime: RuntimeEnv; prompter: WizardPrompter; options?: SetupChannelsOptions; accountOverrides: Partial>; shouldPromptAccountIds: boolean; forceAllowFrom: boolean; }; export type ChannelOnboardingResult = { cfg: BotConfig; accountId?: string; }; export type ChannelOnboardingConfiguredResult = ChannelOnboardingResult | "skip"; export type ChannelOnboardingInteractiveContext = ChannelOnboardingConfigureContext & { configured: boolean; label: string; }; export type ChannelOnboardingDmPolicy = { label: string; channel: ChannelId; policyKey: string; allowFromKey: string; getCurrent: (cfg: BotConfig) => DmPolicy; setPolicy: (cfg: BotConfig, policy: DmPolicy) => BotConfig; promptAllowFrom?: (params: { cfg: BotConfig; prompter: WizardPrompter; accountId?: string; }) => Promise; }; export type ChannelOnboardingAdapter = { channel: ChannelId; getStatus: (ctx: ChannelOnboardingStatusContext) => Promise; configure: (ctx: ChannelOnboardingConfigureContext) => Promise; configureInteractive?: (ctx: ChannelOnboardingInteractiveContext) => Promise; configureWhenConfigured?: (ctx: ChannelOnboardingInteractiveContext) => Promise; dmPolicy?: ChannelOnboardingDmPolicy; onAccountRecorded?: (accountId: string, options?: SetupChannelsOptions) => void; disable?: (cfg: BotConfig) => BotConfig; };