import { i as OpenClawConfig } from "./types.openclaw-fYj4Ft14.js"; import { d as SecretInput } from "./types.secrets-rAcqRhcN.js"; import { _ as GroupPolicy, h as DmPolicy } from "./types.base-D238NWJT.js"; import { i as WizardPrompter } from "./prompts-DgKIGa-v.js"; import { a as ChannelSetupWizardCredentialValues, c as PromptAccountId, i as ChannelSetupWizardAllowFromEntry, n as ChannelSetupWizard, o as ChannelSetupWizardStatus, s as ChannelSetupWizardTextInput, t as ChannelSetupDmPolicy } from "./setup-wizard-types-BBRk9Kyy.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: OpenClawConfig; accountId?: string; configured: boolean; }) => string[] | Promise; }): ChannelSetupWizardStatus; declare function resolveSetupAccountId(params: { accountId?: string; defaultAccountId: string; }): string; declare function setAccountAllowFromForChannel(params: { cfg: OpenClawConfig; channel: string; accountId: string; allowFrom: string[]; }): OpenClawConfig; declare function patchTopLevelChannelConfigSection(params: { cfg: OpenClawConfig; channel: string; enabled?: boolean; clearFields?: string[]; patch: Record; }): OpenClawConfig; declare function patchNestedChannelConfigSection(params: { cfg: OpenClawConfig; channel: string; section: string; enabled?: boolean; clearFields?: string[]; patch: Record; }): OpenClawConfig; declare function setTopLevelChannelAllowFrom(params: { cfg: OpenClawConfig; channel: string; allowFrom: string[]; enabled?: boolean; }): OpenClawConfig; declare function setNestedChannelAllowFrom(params: { cfg: OpenClawConfig; channel: string; section: string; allowFrom: string[]; enabled?: boolean; }): OpenClawConfig; declare function setTopLevelChannelDmPolicyWithAllowFrom(params: { cfg: OpenClawConfig; channel: string; dmPolicy: DmPolicy; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; }): OpenClawConfig; declare function setNestedChannelDmPolicyWithAllowFrom(params: { cfg: OpenClawConfig; channel: string; section: string; dmPolicy: DmPolicy; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; enabled?: boolean; }): OpenClawConfig; declare function setTopLevelChannelGroupPolicy(params: { cfg: OpenClawConfig; channel: string; groupPolicy: GroupPolicy; enabled?: boolean; }): OpenClawConfig; declare function createTopLevelChannelDmPolicy(params: { label: string; channel: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: OpenClawConfig) => DmPolicy; promptAllowFrom?: ChannelSetupDmPolicy["promptAllowFrom"]; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; }): ChannelSetupDmPolicy; declare function createNestedChannelDmPolicy(params: { label: string; channel: string; section: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: OpenClawConfig) => DmPolicy; promptAllowFrom?: ChannelSetupDmPolicy["promptAllowFrom"]; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; enabled?: boolean; }): ChannelSetupDmPolicy; declare function createTopLevelChannelDmPolicySetter(params: { channel: string; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; }): (cfg: OpenClawConfig, dmPolicy: DmPolicy) => OpenClawConfig; declare function createNestedChannelDmPolicySetter(params: { channel: string; section: string; getAllowFrom?: (cfg: OpenClawConfig) => Array | undefined; enabled?: boolean; }): (cfg: OpenClawConfig, dmPolicy: DmPolicy) => OpenClawConfig; declare function createTopLevelChannelAllowFromSetter(params: { channel: string; enabled?: boolean; }): (cfg: OpenClawConfig, allowFrom: string[]) => OpenClawConfig; declare function createNestedChannelAllowFromSetter(params: { channel: string; section: string; enabled?: boolean; }): (cfg: OpenClawConfig, allowFrom: string[]) => OpenClawConfig; declare function createTopLevelChannelGroupPolicySetter(params: { channel: string; enabled?: boolean; }): (cfg: OpenClawConfig, groupPolicy: "open" | "allowlist" | "disabled") => OpenClawConfig; declare function setChannelDmPolicyWithAllowFrom(params: { cfg: OpenClawConfig; channel: string; dmPolicy: DmPolicy; }): OpenClawConfig; declare function setCompatChannelDmPolicyWithAllowFrom(params: { cfg: OpenClawConfig; channel: string; dmPolicy: DmPolicy; }): OpenClawConfig; declare function setAccountGroupPolicyForChannel(params: { cfg: OpenClawConfig; channel: string; accountId: string; groupPolicy: GroupPolicy; }): OpenClawConfig; declare function setAccountDmAllowFromForChannel(params: { cfg: OpenClawConfig; channel: string; accountId: string; allowFrom: string[]; }): OpenClawConfig; 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: OpenClawConfig; accountId: string; resolved: TResolved; }) => OpenClawConfig; }): NonNullable; type AccountScopedChannel = string; type CompatDmChannel = string; declare function setSetupChannelEnabled(cfg: OpenClawConfig, channel: string, enabled: boolean): OpenClawConfig; declare function patchChannelConfigForAccount(params: { cfg: OpenClawConfig; channel: AccountScopedChannel; accountId: string; patch: Record; }): OpenClawConfig; 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: OpenClawConfig; 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: OpenClawConfig) => OpenClawConfig | Promise; applySet?: (cfg: OpenClawConfig, value: SecretInput, resolvedValue: string) => OpenClawConfig | Promise; }): Promise<{ cfg: OpenClawConfig; action: SingleChannelSecretInputPromptResult["action"]; resolvedValue?: string; }>; declare function promptSingleChannelSecretInput(params: { cfg: OpenClawConfig; 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: OpenClawConfig; channel: string; accountId?: string; defaultAccountId: string; prompter: Pick; noteTitle: string; noteLines: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom: (params: { cfg: OpenClawConfig; accountId: string; }) => Array; }): Promise; declare function createTopLevelChannelParsedAllowFromPrompt(params: { channel: string; defaultAccountId: string | ((cfg: OpenClawConfig) => string); enabled?: boolean; noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom?: (cfg: OpenClawConfig) => Array; mergeEntries?: (params: { existing: Array; parsed: string[]; }) => string[]; }): NonNullable; declare function createNestedChannelParsedAllowFromPrompt(params: { channel: string; section: string; defaultAccountId: string | ((cfg: OpenClawConfig) => string); enabled?: boolean; noteTitle?: string; noteLines?: string[]; message: string; placeholder: string; parseEntries: (raw: string) => ParsedAllowFromResult; getExistingAllowFrom?: (cfg: OpenClawConfig) => 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: OpenClawConfig; 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: OpenClawConfig; channel: CompatDmChannel; prompter: WizardPrompter; accountId?: string; defaultAccountId: string; resolveAccount: (cfg: OpenClawConfig, accountId: string) => TAccount; resolveExisting: (account: TAccount, cfg: OpenClawConfig) => 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-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]; /** * Delegates setup configured-state checks to a lazily loaded wizard. */ declare function createDelegatedResolveConfigured(loadWizard: () => Promise): ({ cfg, accountId }: ResolveConfiguredParams) => Promise; /** * Delegates setup preparation to a lazily loaded wizard. */ declare function createDelegatedPrepare(loadWizard: () => Promise): (params: Parameters>[0]) => Promise; /** * Delegates setup finalization to a lazily loaded wizard. */ declare function createDelegatedFinalize(loadWizard: () => Promise): (params: Parameters>[0]) => Promise; type DelegatedStatusBase = Omit; /** * Creates a setup wizard facade with selected hooks delegated to a lazy wizard. */ 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; /** * Creates a setup wizard proxy that delegates allowlist resolution when available. */ 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]; /** * Creates setup status resolvers for channels backed by a required local binary. */ declare function createDetectedBinaryStatus(params: { channelLabel: string; binaryLabel: string; configuredLabel: string; unconfiguredLabel: string; configuredHint: string; unconfiguredHint: string; configuredScore: number; unconfiguredScore: number; resolveConfigured: (params: { cfg: OpenClawConfig; accountId?: string; }) => boolean | Promise; resolveBinaryPath: (params: { cfg: OpenClawConfig; accountId?: string; }) => string; detectBinary?: (path: string) => Promise; }): ChannelSetupWizardStatus; /** * Creates a setup text input that records or reuses a CLI path. */ declare function createCliPathTextInput(params: { inputKey: ChannelSetupWizardTextInput["inputKey"]; message: string; resolvePath: (params: SetupTextInputParams) => string | undefined; shouldPrompt: NonNullable; helpTitle?: string; helpLines?: string[]; }): ChannelSetupWizardTextInput; /** * Creates delegated status resolvers backed by a lazily loaded setup wizard. */ declare function createDelegatedSetupWizardStatusResolvers(loadWizard: () => Promise): Pick; /** * Delegates a text input's `shouldPrompt` check to a lazily loaded setup wizard. */ declare function createDelegatedTextInputShouldPrompt(params: { loadWizard: () => Promise; inputKey: ChannelSetupWizardTextInput["inputKey"]; }): NonNullable; //#endregion export { setLegacyChannelDmPolicyWithAllowFrom as $, noteChannelLookupSummary as A, promptParsedAllowFromForAccount as B, createTopLevelChannelDmPolicy as C, mergeAllowFromEntries as D, createTopLevelChannelParsedAllowFromPrompt as E, patchNestedChannelConfigSection as F, resolveGroupAllowlistWithLookupNotes as G, promptResolvedAllowFrom as H, patchTopLevelChannelConfigSection as I, runSingleChannelSecretStep as J, resolveParsedAllowFromEntries as K, promptAccountId as L, parseSetupEntriesAllowingWildcard as M, parseSetupEntriesWithParser as N, normalizeAllowFromEntries as O, patchChannelConfigForAccount as P, setChannelDmPolicyWithAllowFrom as Q, promptLegacyChannelAllowFrom as R, createTopLevelChannelAllowFromSetter as S, createTopLevelChannelGroupPolicySetter as T, promptSingleChannelSecretInput as U, promptParsedAllowFromForScopedChannel as V, resolveEntriesWithOptionalToken as W, setAccountDmAllowFromForChannel as X, setAccountAllowFromForChannel as Y, setAccountGroupPolicyForChannel as Z, createNestedChannelDmPolicy as _, createAllowlistSetupWizardProxy as a, setTopLevelChannelGroupPolicy as at, createPromptParsedAllowFromForAccount as b, createDelegatedResolveConfigured as c, createSetupTranslator as ct, buildSingleChannelSecretPromptState as d, setNestedChannelAllowFrom as et, createAccountScopedAllowFromSection as f, createNestedChannelAllowFromSetter as g, createLegacyCompatChannelDmPolicy as h, createDetectedBinaryStatus as i, setTopLevelChannelDmPolicyWithAllowFrom as it, parseMentionOrPrefixedId as j, noteChannelLookupFailure as k, createDelegatedSetupWizardProxy as l, WizardI18nParams as lt, createAllowFromSection as m, createDelegatedSetupWizardStatusResolvers as n, setSetupChannelEnabled as nt, createDelegatedFinalize as o, splitSetupEntries as ot, createAccountScopedGroupAccessSection as p, resolveSetupAccountId as q, createDelegatedTextInputShouldPrompt as r, setTopLevelChannelAllowFrom as rt, createDelegatedPrepare as s, SetupTranslator as st, createCliPathTextInput as t, setNestedChannelDmPolicyWithAllowFrom as tt, addWildcardAllowFrom as u, createNestedChannelDmPolicySetter as v, createTopLevelChannelDmPolicySetter as w, createStandardChannelSetupStatus as x, createNestedChannelParsedAllowFromPrompt as y, promptLegacyChannelAllowFromForAccount as z };