import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { h as DmPolicy } from "./types.base-Dkv2492C.js"; import { t as ChannelId } from "./channel-id.types-B_AcMzNT.js"; import { n as RuntimeEnv } from "./runtime-BPmgxFyD.js"; import { i as WizardPrompter } from "./prompts-BamwNu0a.js"; import { E as ChannelMeta, P as ChannelSetupInput, c as ChannelCapabilities } from "./types.core-BSyOg0vX.js"; import { H as ChannelSetupAdapter, g as ChannelConfigAdapter } from "./types.adapters-DatL0h_D.js"; //#region src/channels/plugins/setup-group-access.d.ts type ChannelAccessPolicy = "allowlist" | "open" | "disabled"; declare function promptChannelAccessConfig(params: { prompter: WizardPrompter; label: string; currentPolicy?: ChannelAccessPolicy; currentEntries?: string[]; placeholder?: string; allowOpen?: boolean; allowDisabled?: boolean; skipAllowlistEntries?: boolean; defaultPrompt?: boolean; updatePrompt?: boolean; }): Promise<{ policy: ChannelAccessPolicy; entries: string[]; } | null>; //#endregion //#region src/channels/plugins/setup-wizard-types.d.ts type ChannelSetupPlugin = { id: ChannelId; meta: ChannelMeta; capabilities: ChannelCapabilities; config: ChannelConfigAdapter; setup?: ChannelSetupAdapter; setupWizard?: ChannelSetupWizard | ChannelSetupWizardAdapter; }; type ChannelSetupWizardStatus = { configuredLabel: string; unconfiguredLabel: string; configuredHint?: string; unconfiguredHint?: string; configuredScore?: number; unconfiguredScore?: number; resolveConfigured: (params: { cfg: KlawConfig; accountId?: string; }) => boolean | Promise; resolveStatusLines?: (params: { cfg: KlawConfig; accountId?: string; configured: boolean; }) => string[] | Promise; resolveSelectionHint?: (params: { cfg: KlawConfig; accountId?: string; configured: boolean; }) => string | undefined | Promise; resolveQuickstartScore?: (params: { cfg: KlawConfig; accountId?: string; configured: boolean; }) => number | undefined | Promise; }; type ChannelSetupWizardCredentialState = { accountConfigured: boolean; hasConfiguredValue: boolean; resolvedValue?: string; envValue?: string; }; type ChannelSetupWizardCredentialValues = Partial>; type ChannelSetupWizardNote = { title: string; lines: string[]; shouldShow?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; }) => boolean | Promise; }; type ChannelSetupWizardEnvShortcut = { prompt: string; preferredEnvVar?: string; isAvailable: (params: { cfg: KlawConfig; accountId: string; }) => boolean; apply: (params: { cfg: KlawConfig; accountId: string; }) => KlawConfig | Promise; }; type ChannelSetupWizardCredential = { inputKey: keyof ChannelSetupInput; providerHint: string; credentialLabel: string; preferredEnvVar?: string; helpTitle?: string; helpLines?: string[]; envPrompt: string; keepPrompt: string; inputPrompt: string; allowEnv?: (params: { cfg: KlawConfig; accountId: string; }) => boolean; inspect: (params: { cfg: KlawConfig; accountId: string; }) => ChannelSetupWizardCredentialState; shouldPrompt?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; currentValue?: string; state: ChannelSetupWizardCredentialState; }) => boolean | Promise; applyUseEnv?: (params: { cfg: KlawConfig; accountId: string; }) => KlawConfig | Promise; applySet?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; value: unknown; resolvedValue: string; }) => KlawConfig | Promise; }; type ChannelSetupWizardTextInput = { inputKey: keyof ChannelSetupInput; message: string; placeholder?: string; required?: boolean; applyEmptyValue?: boolean; helpTitle?: string; helpLines?: string[]; confirmCurrentValue?: boolean; keepPrompt?: string | ((value: string) => string); currentValue?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; }) => string | undefined | Promise; initialValue?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; }) => string | undefined | Promise; shouldPrompt?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; currentValue?: string; }) => boolean | Promise; applyCurrentValue?: boolean; validate?: (params: { value: string; cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; }) => string | undefined; normalizeValue?: (params: { value: string; cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; }) => string; applySet?: (params: { cfg: KlawConfig; accountId: string; value: string; }) => KlawConfig | Promise; }; type ChannelSetupWizardAllowFromEntry = { input: string; resolved: boolean; id: string | null; }; type ChannelSetupWizardAllowFrom = { helpTitle?: string; helpLines?: string[]; credentialInputKey?: keyof ChannelSetupInput; message: string; placeholder: string; invalidWithoutCredentialNote: string; parseInputs?: (raw: string) => string[]; parseId: (raw: string) => string | null; resolveEntries: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; entries: string[]; }) => Promise; apply: (params: { cfg: KlawConfig; accountId: string; allowFrom: string[]; }) => KlawConfig | Promise; }; type ChannelSetupWizardGroupAccess = { label: string; placeholder: string; helpTitle?: string; helpLines?: string[]; skipAllowlistEntries?: boolean; currentPolicy: (params: { cfg: KlawConfig; accountId: string; }) => ChannelAccessPolicy; currentEntries: (params: { cfg: KlawConfig; accountId: string; }) => string[]; updatePrompt: (params: { cfg: KlawConfig; accountId: string; }) => boolean; setPolicy: (params: { cfg: KlawConfig; accountId: string; policy: ChannelAccessPolicy; }) => KlawConfig; resolveAllowlist?: (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; entries: string[]; prompter: Pick; }) => Promise; applyAllowlist?: (params: { cfg: KlawConfig; accountId: string; resolved: unknown; }) => KlawConfig; }; type ChannelSetupWizardPrepare = (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; runtime: ChannelSetupConfigureContext["runtime"]; prompter: WizardPrompter; options?: ChannelSetupConfigureContext["options"]; }) => { cfg?: KlawConfig; credentialValues?: ChannelSetupWizardCredentialValues; } | void | Promise<{ cfg?: KlawConfig; credentialValues?: ChannelSetupWizardCredentialValues; } | void>; type ChannelSetupWizardFinalize = (params: { cfg: KlawConfig; accountId: string; credentialValues: ChannelSetupWizardCredentialValues; runtime: ChannelSetupConfigureContext["runtime"]; prompter: WizardPrompter; options?: ChannelSetupConfigureContext["options"]; forceAllowFrom: boolean; }) => { cfg?: KlawConfig; credentialValues?: ChannelSetupWizardCredentialValues; } | void | Promise<{ cfg?: KlawConfig; credentialValues?: ChannelSetupWizardCredentialValues; } | void>; type ChannelSetupWizard = { channel: string; status: ChannelSetupWizardStatus; introNote?: ChannelSetupWizardNote; envShortcut?: ChannelSetupWizardEnvShortcut; resolveAccountIdForConfigure?: (params: { cfg: KlawConfig; prompter: WizardPrompter; options?: ChannelSetupConfigureContext["options"]; accountOverride?: string; shouldPromptAccountIds: boolean; listAccountIds: ChannelSetupPlugin["config"]["listAccountIds"]; defaultAccountId: string; }) => string | Promise; resolveShouldPromptAccountIds?: (params: { cfg: KlawConfig; options?: ChannelSetupConfigureContext["options"]; shouldPromptAccountIds: boolean; }) => boolean; prepare?: ChannelSetupWizardPrepare; stepOrder?: "credentials-first" | "text-first"; credentials: ChannelSetupWizardCredential[]; textInputs?: ChannelSetupWizardTextInput[]; finalize?: ChannelSetupWizardFinalize; completionNote?: ChannelSetupWizardNote; dmPolicy?: ChannelSetupDmPolicy; allowFrom?: ChannelSetupWizardAllowFrom; groupAccess?: ChannelSetupWizardGroupAccess; disable?: (cfg: KlawConfig) => KlawConfig; onAccountRecorded?: ChannelSetupWizardAdapter["onAccountRecorded"]; }; type SetupChannelsOptions = { allowDisable?: boolean; allowSignalInstall?: boolean; onSelection?: (selection: ChannelId[]) => void; onPostWriteHook?: (hook: ChannelOnboardingPostWriteHook) => void; accountIds?: Partial>; onAccountId?: (channel: ChannelId, accountId: string) => void; onResolvedPlugin?: (channel: ChannelId, plugin: ChannelSetupPlugin) => void; promptAccountIds?: boolean; forceAllowFromChannels?: ChannelId[]; deferStatusUntilSelection?: boolean; skipStatusNote?: boolean; skipDmPolicyPrompt?: boolean; skipConfirm?: boolean; quickstartDefaults?: boolean; initialSelection?: ChannelId[]; secretInputMode?: "plaintext" | "ref"; }; type PromptAccountIdParams = { cfg: KlawConfig; prompter: WizardPrompter; label: string; currentId?: string; listAccountIds: (cfg: KlawConfig) => string[]; defaultAccountId: string; }; type PromptAccountId = (params: PromptAccountIdParams) => Promise; type ChannelSetupStatus = { channel: ChannelId; configured: boolean; statusLines: string[]; selectionHint?: string; quickstartScore?: number; }; type ChannelSetupStatusContext = { cfg: KlawConfig; options?: SetupChannelsOptions; accountOverrides: Partial>; }; type ChannelSetupConfigureContext = { cfg: KlawConfig; runtime: RuntimeEnv; prompter: WizardPrompter; options?: SetupChannelsOptions; accountOverrides: Partial>; shouldPromptAccountIds: boolean; forceAllowFrom: boolean; }; type ChannelOnboardingPostWriteContext = { previousCfg: KlawConfig; cfg: KlawConfig; accountId: string; runtime: RuntimeEnv; }; type ChannelOnboardingPostWriteHook = { channel: ChannelId; accountId: string; run: (ctx: { cfg: KlawConfig; runtime: RuntimeEnv; }) => Promise | void; }; type ChannelSetupResult = { cfg: KlawConfig; accountId?: string; }; type ChannelSetupConfiguredResult = ChannelSetupResult | "skip"; type ChannelSetupInteractiveContext = ChannelSetupConfigureContext & { configured: boolean; label: string; }; type ChannelSetupDmPolicy = { label: string; channel: ChannelId; policyKey: string; allowFromKey: string; resolveConfigKeys?: (cfg: KlawConfig, accountId?: string) => { policyKey: string; allowFromKey: string; }; getCurrent: (cfg: KlawConfig, accountId?: string) => DmPolicy; setPolicy: (cfg: KlawConfig, policy: DmPolicy, accountId?: string) => KlawConfig; promptAllowFrom?: (params: { cfg: KlawConfig; prompter: WizardPrompter; accountId?: string; }) => Promise; }; type ChannelSetupWizardAdapter = { channel: ChannelId; getStatus: (ctx: ChannelSetupStatusContext) => Promise; configure: (ctx: ChannelSetupConfigureContext) => Promise; configureInteractive?: (ctx: ChannelSetupInteractiveContext) => Promise; configureWhenConfigured?: (ctx: ChannelSetupInteractiveContext) => Promise; afterConfigWritten?: (ctx: ChannelOnboardingPostWriteContext) => Promise | void; dmPolicy?: ChannelSetupDmPolicy; onAccountRecorded?: (accountId: string, options?: SetupChannelsOptions) => void; disable?: (cfg: KlawConfig) => KlawConfig; }; //#endregion export { ChannelSetupStatus as a, ChannelSetupWizardAdapter as c, ChannelSetupWizardStatus as d, ChannelSetupWizardTextInput as f, ChannelSetupResult as i, ChannelSetupWizardAllowFromEntry as l, promptChannelAccessConfig as m, ChannelSetupDmPolicy as n, ChannelSetupStatusContext as o, PromptAccountId as p, ChannelSetupPlugin as r, ChannelSetupWizard as s, ChannelSetupConfigureContext as t, ChannelSetupWizardCredentialValues as u };