import { r as KlawConfig } from "./types.klaw-xKUw_Rz7.js"; import { l as SecretInput } from "./types.secrets-Cx0MFT2Y.js"; import { _ as GroupPolicy, h as DmPolicy } from "./types.base-Dkv2492C.js"; import { i as WizardPrompter } from "./prompts-BamwNu0a.js"; import { c as ChannelSetupWizardAdapter, d as ChannelSetupWizardStatus, f as ChannelSetupWizardTextInput, l as ChannelSetupWizardAllowFromEntry, n as ChannelSetupDmPolicy, p as PromptAccountId, r as ChannelSetupPlugin, s as ChannelSetupWizard, u as ChannelSetupWizardCredentialValues } from "./setup-wizard-types-BXYaJdHA.js"; //#region src/wizard/i18n/types.d.ts type WizardLocale = "en" | "zh-CN" | "zh-TW"; type WizardI18nParams = Record; //#endregion //#region src/wizard/i18n/index.d.ts type SetupTranslator = (key: string, params?: WizardI18nParams) => string; declare function createSetupTranslator(options?: { locale?: WizardLocale; keyPrefix?: string; }): SetupTranslator; //#endregion //#region src/channels/plugins/setup-wizard-helpers.d.ts declare const promptAccountId: PromptAccountId; declare function addWildcardAllowFrom(allowFrom?: ReadonlyArray | null): string[]; declare function mergeAllowFromEntries(current: Array | null | undefined, additions: Array): string[]; declare function splitSetupEntries(raw: string): string[]; type ParsedSetupEntry = { value: string; } | { error: string; }; declare function parseSetupEntriesWithParser(raw: string, parseEntry: (entry: string) => ParsedSetupEntry): { entries: string[]; error?: string; }; declare function parseSetupEntriesAllowingWildcard(raw: string, parseEntry: (entry: string) => ParsedSetupEntry): { entries: string[]; error?: string; }; declare function parseMentionOrPrefixedId(params: { value: string; mentionPattern: RegExp; prefixPattern?: RegExp; idPattern: RegExp; normalizeId?: (id: string) => string; }): string | null; declare function normalizeAllowFromEntries(entries: Array, normalizeEntry?: (value: string) => string | null | undefined): string[]; declare function createStandardChannelSetupStatus(params: { channelLabel: string; configuredLabel: string; unconfiguredLabel: string; configuredHint?: string; unconfiguredHint?: string; configuredScore?: number; unconfiguredScore?: number; includeStatusLine?: boolean; resolveConfigured: ChannelSetupWizardStatus["resolveConfigured"]; resolveExtraStatusLines?: (params: { cfg: KlawConfig; accountId?: string; configured: boolean; }) => string[] | Promise; }): ChannelSetupWizardStatus; declare function resolveSetupAccountId(params: { accountId?: string; defaultAccountId: string; }): string; declare function setAccountAllowFromForChannel(params: { cfg: KlawConfig; channel: string; accountId: string; allowFrom: string[]; }): KlawConfig; declare function patchTopLevelChannelConfigSection(params: { cfg: KlawConfig; channel: string; enabled?: boolean; clearFields?: string[]; patch: Record; }): KlawConfig; declare function patchNestedChannelConfigSection(params: { cfg: KlawConfig; channel: string; section: string; enabled?: boolean; clearFields?: string[]; patch: Record; }): KlawConfig; declare function setTopLevelChannelAllowFrom(params: { cfg: KlawConfig; channel: string; allowFrom: string[]; enabled?: boolean; }): KlawConfig; declare function setNestedChannelAllowFrom(params: { cfg: KlawConfig; channel: string; section: string; allowFrom: string[]; enabled?: boolean; }): KlawConfig; declare function setTopLevelChannelDmPolicyWithAllowFrom(params: { cfg: KlawConfig; channel: string; dmPolicy: DmPolicy; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; }): KlawConfig; declare function setNestedChannelDmPolicyWithAllowFrom(params: { cfg: KlawConfig; channel: string; section: string; dmPolicy: DmPolicy; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; enabled?: boolean; }): KlawConfig; declare function setTopLevelChannelGroupPolicy(params: { cfg: KlawConfig; channel: string; groupPolicy: GroupPolicy; enabled?: boolean; }): KlawConfig; declare function createTopLevelChannelDmPolicy(params: { label: string; channel: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: KlawConfig) => DmPolicy; promptAllowFrom?: ChannelSetupDmPolicy["promptAllowFrom"]; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; }): ChannelSetupDmPolicy; declare function createNestedChannelDmPolicy(params: { label: string; channel: string; section: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: KlawConfig) => DmPolicy; promptAllowFrom?: ChannelSetupDmPolicy["promptAllowFrom"]; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; enabled?: boolean; }): ChannelSetupDmPolicy; declare function createTopLevelChannelDmPolicySetter(params: { channel: string; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; }): (cfg: KlawConfig, dmPolicy: DmPolicy) => KlawConfig; declare function createNestedChannelDmPolicySetter(params: { channel: string; section: string; getAllowFrom?: (cfg: KlawConfig) => Array | undefined; enabled?: boolean; }): (cfg: KlawConfig, dmPolicy: DmPolicy) => KlawConfig; declare function createTopLevelChannelAllowFromSetter(params: { channel: string; enabled?: boolean; }): (cfg: KlawConfig, allowFrom: string[]) => KlawConfig; declare function createNestedChannelAllowFromSetter(params: { channel: string; section: string; enabled?: boolean; }): (cfg: KlawConfig, allowFrom: string[]) => KlawConfig; declare function createTopLevelChannelGroupPolicySetter(params: { channel: string; enabled?: boolean; }): (cfg: KlawConfig, groupPolicy: "open" | "allowlist" | "disabled") => KlawConfig; declare function setChannelDmPolicyWithAllowFrom(params: { cfg: KlawConfig; channel: string; dmPolicy: DmPolicy; }): KlawConfig; declare function setCompatChannelDmPolicyWithAllowFrom(params: { cfg: KlawConfig; channel: string; dmPolicy: DmPolicy; }): KlawConfig; declare function setAccountGroupPolicyForChannel(params: { cfg: KlawConfig; channel: string; accountId: string; groupPolicy: GroupPolicy; }): KlawConfig; declare function setAccountDmAllowFromForChannel(params: { cfg: KlawConfig; channel: string; accountId: string; allowFrom: string[]; }): KlawConfig; declare function createCompatChannelDmPolicy(params: { label: string; channel: string; promptAllowFrom?: ChannelSetupDmPolicy["promptAllowFrom"]; }): ChannelSetupDmPolicy; declare function resolveGroupAllowlistWithLookupNotes(params: { label: string; prompter: Pick; entries: string[]; fallback: TResolved; resolve: () => Promise; }): Promise; declare function createAccountScopedAllowFromSection(params: { channel: string; credentialInputKey?: NonNullable["credentialInputKey"]; helpTitle?: string; helpLines?: string[]; message: string; placeholder: string; invalidWithoutCredentialNote: string; parseId: NonNullable["parseId"]>; resolveEntries: NonNullable["resolveEntries"]>; }): NonNullable; declare function createAccountScopedGroupAccessSection(params: { channel: string; label: string; placeholder: string; helpTitle?: string; helpLines?: string[]; skipAllowlistEntries?: boolean; currentPolicy: NonNullable["currentPolicy"]; currentEntries: NonNullable["currentEntries"]; updatePrompt: NonNullable["updatePrompt"]; resolveAllowlist?: NonNullable["resolveAllowlist"]>; fallbackResolved: (entries: string[]) => TResolved; applyAllowlist: (params: { cfg: KlawConfig; accountId: string; resolved: TResolved; }) => KlawConfig; }): NonNullable; type AccountScopedChannel = string; type CompatDmChannel = string; declare function setSetupChannelEnabled(cfg: KlawConfig, channel: string, enabled: boolean): KlawConfig; declare function patchChannelConfigForAccount(params: { cfg: KlawConfig; channel: AccountScopedChannel; accountId: string; patch: Record; }): KlawConfig; declare function buildSingleChannelSecretPromptState(params: { accountConfigured: boolean; hasConfigToken: boolean; allowEnv: boolean; envValue?: string; }): { accountConfigured: boolean; hasConfigToken: boolean; canUseEnv: boolean; }; type SingleChannelSecretInputPromptResult = { action: "keep"; } | { action: "use-env"; } | { action: "set"; value: SecretInput; resolvedValue: string; }; declare function runSingleChannelSecretStep(params: { cfg: KlawConfig; prompter: Pick; providerHint: string; credentialLabel: string; secretInputMode?: "plaintext" | "ref"; accountConfigured: boolean; hasConfigToken: boolean; allowEnv: boolean; envValue?: string; envPrompt: string; keepPrompt: string; inputPrompt: string; preferredEnvVar?: string; onMissingConfigured?: () => Promise; applyUseEnv?: (cfg: KlawConfig) => KlawConfig | Promise; applySet?: (cfg: KlawConfig, value: SecretInput, resolvedValue: string) => KlawConfig | Promise; }): Promise<{ cfg: KlawConfig; action: SingleChannelSecretInputPromptResult["action"]; resolvedValue?: string; }>; declare function promptSingleChannelSecretInput(params: { cfg: KlawConfig; 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; }; declare function promptParsedAllowFromForAccount(params: { cfg: TConfig; accountId?: string; defaultAccountId: string; prompter: Pick; noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom: (params: { cfg: TConfig; accountId: string; }) => Array; mergeEntries?: (params: { existing: Array; parsed: string[]; }) => string[]; applyAllowFrom: (params: { cfg: TConfig; accountId: string; allowFrom: string[]; }) => TConfig | Promise; }): Promise; declare function createPromptParsedAllowFromForAccount(params: { defaultAccountId: string | ((cfg: TConfig) => string); noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom: (params: { cfg: TConfig; accountId: string; }) => Array; mergeEntries?: (params: { existing: Array; parsed: string[]; }) => string[]; applyAllowFrom: (params: { cfg: TConfig; accountId: string; allowFrom: string[]; }) => TConfig | Promise; }): NonNullable; declare function promptParsedAllowFromForScopedChannel(params: { cfg: KlawConfig; channel: string; accountId?: string; defaultAccountId: string; prompter: Pick; noteTitle: string; noteLines: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom: (params: { cfg: KlawConfig; accountId: string; }) => Array; }): Promise; declare function createTopLevelChannelParsedAllowFromPrompt(params: { channel: string; defaultAccountId: string | ((cfg: KlawConfig) => string); enabled?: boolean; noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom?: (cfg: KlawConfig) => Array; mergeEntries?: (params: { existing: Array; parsed: string[]; }) => string[]; }): NonNullable; declare function createNestedChannelParsedAllowFromPrompt(params: { channel: string; section: string; defaultAccountId: string | ((cfg: KlawConfig) => string); enabled?: boolean; noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom?: (cfg: KlawConfig) => Array; mergeEntries?: (params: { existing: Array; parsed: string[]; }) => string[]; }): NonNullable; declare function resolveParsedAllowFromEntries(params: { entries: string[]; parseId: (raw: string) => string | null; }): ChannelSetupWizardAllowFromEntry[]; declare function createAllowFromSection(params: { helpTitle?: string; helpLines?: string[]; credentialInputKey?: NonNullable["credentialInputKey"]; message: string; placeholder: string; invalidWithoutCredentialNote: string; parseInputs?: NonNullable["parseInputs"]>; parseId: NonNullable["parseId"]>; resolveEntries?: NonNullable["resolveEntries"]>; apply: NonNullable["apply"]>; }): NonNullable; declare function noteChannelLookupSummary(params: { prompter: Pick; label: string; resolvedSections: Array<{ title: string; values: string[]; }>; unresolved?: string[]; }): Promise; declare function noteChannelLookupFailure(params: { prompter: Pick; label: string; error: unknown; }): Promise; type AllowFromResolution = { input: string; resolved: boolean; id?: string | null; }; declare function resolveEntriesWithOptionalToken(params: { token?: string | null; entries: string[]; buildWithoutToken: (input: string) => TResult; resolveEntries: (params: { token: string; entries: string[]; }) => Promise; }): Promise; 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; declare function promptLegacyChannelAllowFrom(params: { cfg: KlawConfig; channel: CompatDmChannel; 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; declare function promptLegacyChannelAllowFromForAccount(params: { cfg: KlawConfig; channel: CompatDmChannel; prompter: WizardPrompter; accountId?: string; defaultAccountId: string; resolveAccount: (cfg: KlawConfig, accountId: string) => TAccount; resolveExisting: (account: TAccount, cfg: KlawConfig) => Array; resolveToken: (account: TAccount) => string | null | undefined; noteTitle: string; noteLines: string[]; message: string; placeholder: string; parseId: (value: string) => string | null; invalidWithoutTokenNote: string; resolveEntries: (params: { token: string; entries: string[]; }) => Promise; }): Promise; declare const setLegacyChannelDmPolicyWithAllowFrom: typeof setCompatChannelDmPolicyWithAllowFrom; declare const createLegacyCompatChannelDmPolicy: typeof createCompatChannelDmPolicy; //#endregion //#region src/channels/plugins/setup-wizard.d.ts type ChannelSetupWizardPlugin = ChannelSetupPlugin; declare function buildChannelSetupWizardAdapterFromSetupWizard(params: { plugin: ChannelSetupWizardPlugin; wizard: ChannelSetupWizard; }): ChannelSetupWizardAdapter; //#endregion //#region src/channels/plugins/setup-wizard-proxy.d.ts type PromptAllowFromParams = Parameters>[0]; type ResolveConfiguredParams = Parameters[0]; type ResolveAllowFromEntriesParams = Parameters["resolveEntries"]>[0]; type ResolveAllowFromEntriesResult = Awaited["resolveEntries"]>>; type ResolveGroupAllowlistParams = Parameters["resolveAllowlist"]>>[0]; declare function createDelegatedResolveConfigured(loadWizard: () => Promise): ({ cfg, accountId }: ResolveConfiguredParams) => Promise; declare function createDelegatedPrepare(loadWizard: () => Promise): (params: Parameters>[0]) => Promise; declare function createDelegatedFinalize(loadWizard: () => Promise): (params: Parameters>[0]) => Promise; type DelegatedStatusBase = Omit; declare function createDelegatedSetupWizardProxy(params: { channel: string; loadWizard: () => Promise; status: DelegatedStatusBase; credentials?: ChannelSetupWizard["credentials"]; textInputs?: ChannelSetupWizard["textInputs"]; completionNote?: ChannelSetupWizard["completionNote"]; dmPolicy?: ChannelSetupWizard["dmPolicy"]; disable?: ChannelSetupWizard["disable"]; resolveShouldPromptAccountIds?: ChannelSetupWizard["resolveShouldPromptAccountIds"]; onAccountRecorded?: ChannelSetupWizard["onAccountRecorded"]; delegatePrepare?: boolean; delegateFinalize?: boolean; }): ChannelSetupWizard; declare function createAllowlistSetupWizardProxy(params: { loadWizard: () => Promise; createBase: (handlers: { promptAllowFrom: (params: PromptAllowFromParams) => Promise; resolveAllowFromEntries: (params: ResolveAllowFromEntriesParams) => Promise; resolveGroupAllowlist: (params: ResolveGroupAllowlistParams) => Promise; }) => ChannelSetupWizard; fallbackResolvedGroupAllowlist: (entries: string[]) => TGroupResolved; }): ChannelSetupWizard; //#endregion //#region src/channels/plugins/setup-wizard-binary.d.ts type SetupTextInputParams = Parameters>[0]; declare function createDetectedBinaryStatus(params: { channelLabel: string; binaryLabel: string; configuredLabel: string; unconfiguredLabel: string; configuredHint: string; unconfiguredHint: string; configuredScore: number; unconfiguredScore: number; resolveConfigured: (params: { cfg: KlawConfig; accountId?: string; }) => boolean | Promise; resolveBinaryPath: (params: { cfg: KlawConfig; accountId?: string; }) => string; detectBinary?: (path: string) => Promise; }): ChannelSetupWizardStatus; declare function createCliPathTextInput(params: { inputKey: ChannelSetupWizardTextInput["inputKey"]; message: string; resolvePath: (params: SetupTextInputParams) => string | undefined; shouldPrompt: NonNullable; helpTitle?: string; helpLines?: string[]; }): ChannelSetupWizardTextInput; declare function createDelegatedSetupWizardStatusResolvers(loadWizard: () => Promise): Pick; declare function createDelegatedTextInputShouldPrompt(params: { loadWizard: () => Promise; inputKey: ChannelSetupWizardTextInput["inputKey"]; }): NonNullable; //#endregion export { setChannelDmPolicyWithAllowFrom as $, noteChannelLookupFailure as A, promptLegacyChannelAllowFromForAccount as B, createTopLevelChannelAllowFromSetter as C, createTopLevelChannelParsedAllowFromPrompt as D, createTopLevelChannelGroupPolicySetter as E, patchChannelConfigForAccount as F, resolveEntriesWithOptionalToken as G, promptParsedAllowFromForScopedChannel as H, patchNestedChannelConfigSection as I, resolveSetupAccountId as J, resolveGroupAllowlistWithLookupNotes as K, patchTopLevelChannelConfigSection as L, parseMentionOrPrefixedId as M, parseSetupEntriesAllowingWildcard as N, mergeAllowFromEntries as O, parseSetupEntriesWithParser as P, setAccountGroupPolicyForChannel as Q, promptAccountId as R, createStandardChannelSetupStatus as S, createTopLevelChannelDmPolicySetter as T, promptResolvedAllowFrom as U, promptParsedAllowFromForAccount as V, promptSingleChannelSecretInput as W, setAccountAllowFromForChannel as X, runSingleChannelSecretStep as Y, setAccountDmAllowFromForChannel as Z, createNestedChannelAllowFromSetter as _, createAllowlistSetupWizardProxy as a, setTopLevelChannelDmPolicyWithAllowFrom as at, createNestedChannelParsedAllowFromPrompt as b, createDelegatedResolveConfigured as c, SetupTranslator as ct, addWildcardAllowFrom as d, setLegacyChannelDmPolicyWithAllowFrom as et, buildSingleChannelSecretPromptState as f, createLegacyCompatChannelDmPolicy as g, createAllowFromSection as h, createDetectedBinaryStatus as i, setTopLevelChannelAllowFrom as it, noteChannelLookupSummary as j, normalizeAllowFromEntries as k, createDelegatedSetupWizardProxy as l, createSetupTranslator as lt, createAccountScopedGroupAccessSection as m, createDelegatedSetupWizardStatusResolvers as n, setNestedChannelDmPolicyWithAllowFrom as nt, createDelegatedFinalize as o, setTopLevelChannelGroupPolicy as ot, createAccountScopedAllowFromSection as p, resolveParsedAllowFromEntries as q, createDelegatedTextInputShouldPrompt as r, setSetupChannelEnabled as rt, createDelegatedPrepare as s, splitSetupEntries as st, createCliPathTextInput as t, setNestedChannelAllowFrom as tt, buildChannelSetupWizardAdapterFromSetupWizard as u, WizardI18nParams as ut, createNestedChannelDmPolicy as v, createTopLevelChannelDmPolicy as w, createPromptParsedAllowFromForAccount as x, createNestedChannelDmPolicySetter as y, promptLegacyChannelAllowFrom as z };