export const WhatsAppConfigSchema: z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>; markdown: z.ZodOptional<z.ZodObject<{ tables: z.ZodOptional<z.ZodEnum<{ off: "off"; bullets: "bullets"; code: "code"; }>>; }, z.core.$strict>>; configWrites: z.ZodOptional<z.ZodBoolean>; sendReadReceipts: z.ZodOptional<z.ZodBoolean>; messagePrefix: z.ZodOptional<z.ZodString>; responsePrefix: z.ZodOptional<z.ZodString>; dmPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ disabled: "disabled"; pairing: "pairing"; allowlist: "allowlist"; open: "open"; }>>>; selfChatMode: z.ZodOptional<z.ZodBoolean>; allowFrom: z.ZodOptional<z.ZodArray<z.ZodString>>; defaultTo: z.ZodOptional<z.ZodString>; groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodString>>; groupPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ disabled: "disabled"; allowlist: "allowlist"; open: "open"; }>>>; historyLimit: z.ZodOptional<z.ZodNumber>; dmHistoryLimit: z.ZodOptional<z.ZodNumber>; dms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ historyLimit: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>>>; textChunkLimit: z.ZodOptional<z.ZodNumber>; chunkMode: z.ZodOptional<z.ZodEnum<{ length: "length"; newline: "newline"; }>>; blockStreaming: z.ZodOptional<z.ZodBoolean>; blockStreamingCoalesce: z.ZodOptional<z.ZodObject<{ minChars: z.ZodOptional<z.ZodNumber>; maxChars: z.ZodOptional<z.ZodNumber>; idleMs: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>; groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ requireMention: z.ZodOptional<z.ZodBoolean>; tools: z.ZodOptional<z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString>>; alsoAllow: z.ZodOptional<z.ZodArray<z.ZodString>>; deny: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strict>>; toolsBySender: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString>>; alsoAllow: z.ZodOptional<z.ZodArray<z.ZodString>>; deny: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strict>>>>; }, z.core.$strict>>>>; ackReaction: z.ZodOptional<z.ZodObject<{ emoji: z.ZodOptional<z.ZodString>; direct: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; group: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ mentions: "mentions"; never: "never"; always: "always"; }>>>; }, z.core.$strict>>; debounceMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; heartbeat: z.ZodOptional<z.ZodObject<{ showOk: z.ZodOptional<z.ZodBoolean>; showAlerts: z.ZodOptional<z.ZodBoolean>; useIndicator: z.ZodOptional<z.ZodBoolean>; }, z.core.$strict>>; healthMonitor: z.ZodOptional<z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; }, z.core.$strict>>; accounts: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ capabilities: z.ZodOptional<z.ZodArray<z.ZodString>>; markdown: z.ZodOptional<z.ZodObject<{ tables: z.ZodOptional<z.ZodEnum<{ off: "off"; bullets: "bullets"; code: "code"; }>>; }, z.core.$strict>>; configWrites: z.ZodOptional<z.ZodBoolean>; sendReadReceipts: z.ZodOptional<z.ZodBoolean>; messagePrefix: z.ZodOptional<z.ZodString>; responsePrefix: z.ZodOptional<z.ZodString>; dmPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ disabled: "disabled"; pairing: "pairing"; allowlist: "allowlist"; open: "open"; }>>>; selfChatMode: z.ZodOptional<z.ZodBoolean>; allowFrom: z.ZodOptional<z.ZodArray<z.ZodString>>; defaultTo: z.ZodOptional<z.ZodString>; groupAllowFrom: z.ZodOptional<z.ZodArray<z.ZodString>>; groupPolicy: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ disabled: "disabled"; allowlist: "allowlist"; open: "open"; }>>>; historyLimit: z.ZodOptional<z.ZodNumber>; dmHistoryLimit: z.ZodOptional<z.ZodNumber>; dms: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ historyLimit: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>>>; textChunkLimit: z.ZodOptional<z.ZodNumber>; chunkMode: z.ZodOptional<z.ZodEnum<{ length: "length"; newline: "newline"; }>>; blockStreaming: z.ZodOptional<z.ZodBoolean>; blockStreamingCoalesce: z.ZodOptional<z.ZodObject<{ minChars: z.ZodOptional<z.ZodNumber>; maxChars: z.ZodOptional<z.ZodNumber>; idleMs: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>; groups: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ requireMention: z.ZodOptional<z.ZodBoolean>; tools: z.ZodOptional<z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString>>; alsoAllow: z.ZodOptional<z.ZodArray<z.ZodString>>; deny: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strict>>; toolsBySender: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodOptional<z.ZodObject<{ allow: z.ZodOptional<z.ZodArray<z.ZodString>>; alsoAllow: z.ZodOptional<z.ZodArray<z.ZodString>>; deny: z.ZodOptional<z.ZodArray<z.ZodString>>; }, z.core.$strict>>>>; }, z.core.$strict>>>>; ackReaction: z.ZodOptional<z.ZodObject<{ emoji: z.ZodOptional<z.ZodString>; direct: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>; group: z.ZodDefault<z.ZodOptional<z.ZodEnum<{ mentions: "mentions"; never: "never"; always: "always"; }>>>; }, z.core.$strict>>; debounceMs: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; heartbeat: z.ZodOptional<z.ZodObject<{ showOk: z.ZodOptional<z.ZodBoolean>; showAlerts: z.ZodOptional<z.ZodBoolean>; useIndicator: z.ZodOptional<z.ZodBoolean>; }, z.core.$strict>>; healthMonitor: z.ZodOptional<z.ZodObject<{ enabled: z.ZodOptional<z.ZodBoolean>; }, z.core.$strict>>; name: z.ZodOptional<z.ZodString>; enabled: z.ZodOptional<z.ZodBoolean>; authDir: z.ZodOptional<z.ZodString>; mediaMaxMb: z.ZodOptional<z.ZodNumber>; }, z.core.$strict>>>>; defaultAccount: z.ZodOptional<z.ZodString>; mediaMaxMb: z.ZodDefault<z.ZodOptional<z.ZodNumber>>; actions: z.ZodOptional<z.ZodObject<{ reactions: z.ZodOptional<z.ZodBoolean>; sendMessage: z.ZodOptional<z.ZodBoolean>; polls: z.ZodOptional<z.ZodBoolean>; }, z.core.$strict>>; }, z.core.$strict>;


export type BaseProbeResult = BaseProbeResult<TError>;


export type BaseTokenResolution = BaseTokenResolution;


export type ChannelAccountSnapshot = ChannelAccountSnapshot;


export type ChannelAgentTool = ChannelAgentTool;


export type ChannelGroupContext = ChannelGroupContext;


export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;


export type ChannelMessageActionContext = ChannelMessageActionContext;


export type ChannelMessageActionDiscoveryContext = ChannelMessageActionDiscoveryContext;


export type ChannelMessageActionName = "send" | "broadcast" | "poll" | "poll-vote" | "react" | "reactions" | "read" | "edit" | "unsend" | "reply" | "sendWithEffect" | "renameGroup" | "setGroupIcon" | "addParticipant" | "removeParticipant" | "leaveGroup" | "sendAttachment" | "delete" | "pin" | "unpin" | "list-pins" | "permissions" | "thread-create" | "thread-list" | "thread-reply" | "search" | "sticker" | "sticker-search" | "member-info" | "role-info" | "emoji-list" | "emoji-upload" | "sticker-upload" | "role-add" | "role-remove" | "channel-info" | "channel-list" | "channel-create" | "channel-edit" | "channel-delete" | "channel-move" | "category-create" | "category-edit" | "category-delete" | "topic-create" | "topic-edit" | "voice-status" | "event-list" | "event-create" | "timeout" | "kick" | "ban" | "set-profile" | "set-presence" | "download-file" | "upload-file";


export type ChannelMessageToolDiscovery = ChannelMessageToolDiscovery;


export type ChannelMessageToolSchemaContribution = ChannelMessageToolSchemaContribution;


export type ChannelStatusIssue = ChannelStatusIssue;


export type ChannelThreadingContext = ChannelThreadingContext;


export type ChannelThreadingToolContext = ChannelThreadingToolContext;


export function createChannelPairingChallengeIssuer(params: { channel: ChannelId; upsertPairingRequest: (params: { id: string; meta?: PairingMeta | undefined; }) => Promise<{ code: string; created: boolean; }>; }): (challenge: Omit<...>) => Promise<...>;


export function createChannelPairingController(params: { core: PluginRuntime; channel: ChannelId; accountId: string; }): ChannelPairingController;


export function createLoggedPairingApprovalNotifier(format: string | ((params: { cfg: OpenClawConfig; id: string; accountId?: string | undefined; runtime?: RuntimeEnv | undefined; }) => string), log?: (message: string) => void): (params: { ...; }) => Promise<...>;


export function createPairingPrefixStripper(prefixRe: RegExp, map?: (entry: string) => string): (entry: string) => string;


export function createTextPairingAdapter(params: { idLabel: string; message: string; normalizeAllowEntry?: ((entry: string) => string) | undefined; notify: (params: { cfg: OpenClawConfig; id: string; accountId?: string | undefined; runtime?: RuntimeEnv | undefined; } & { ...; }) => void | Promise<...>; }): ChannelPairingAdapter;


export type ChannelPairingController = ChannelPairingController;


export function createChannelReplyPipeline(params: { cfg: OpenClawConfig; agentId: string; channel?: string | undefined; accountId?: string | undefined; typing?: CreateTypingCallbacksParams | undefined; typingCallbacks?: TypingCallbacks | undefined; }): ChannelReplyPipeline;


export type ChannelReplyPipeline = ChannelReplyPipeline;


export type CreateTypingCallbacksParams = CreateTypingCallbacksParams;


export type ReplyPrefixContext = import("src/auto-reply/reply/response-prefix-template").ResponsePrefixContext;


export type ReplyPrefixContextBundle = ReplyPrefixContextBundle;


export type ReplyPrefixOptions = ReplyPrefixOptions;


export type TypingCallbacks = TypingCallbacks;


export function createAccountStatusSink(params: { accountId: string; setStatus: (next: ChannelAccountSnapshot) => void; }): (patch: Omit<ChannelAccountSnapshot, "accountId">) => void;


export function createReplyPrefixContext(params: { cfg: OpenClawConfig; agentId: string; channel?: string | undefined; accountId?: string | undefined; }): ReplyPrefixContextBundle;


export function createReplyPrefixOptions(params: { cfg: OpenClawConfig; agentId: string; channel?: string | undefined; accountId?: string | undefined; }): ReplyPrefixOptions;


export function createTypingCallbacks(params: CreateTypingCallbacksParams): TypingCallbacks;


export function isWhatsAppGroupJid(value: string): boolean;


export function isWhatsAppUserTarget(value: string): boolean;


export function keepHttpServerTaskAlive(params: { server: CloseAwareServer; abortSignal?: AbortSignal | undefined; onAbort?: (() => void | Promise<void>) | undefined; }): Promise<void>;


export function looksLikeSignalTargetId(raw: string, normalized?: string | undefined): boolean;


export function looksLikeWhatsAppTargetId(raw: string): boolean;


export function normalizeChatType(raw?: string | undefined): ChatType | undefined;


export function normalizePollDurationHours(value: number | undefined, options: { defaultHours: number; maxHours: number; }): number;


export function normalizePollInput(input: PollInput, options?: NormalizePollOptions): NormalizedPollInput;


export function normalizeSignalMessagingTarget(raw: string): string | undefined;


export function normalizeWhatsAppAllowFromEntries(allowFrom: (string | number)[]): string[];


export function normalizeWhatsAppMessagingTarget(raw: string): string | undefined;


export function normalizeWhatsAppTarget(value: string): string | null;


export function reduceInteractiveReply<TState>(interactive: InteractiveReply | undefined, initialState: TState, reduce: (state: TState, block: InteractiveReplyBlock, index: number) => TState): TState;


export function resolvePollMaxSelections(optionCount: number, allowMultiselect: boolean | undefined): number;


export function resolveWhatsAppHeartbeatRecipients(cfg: OpenClawConfig, opts?: HeartbeatRecipientsOpts): HeartbeatRecipientsResult;


export function waitUntilAbort(signal?: AbortSignal | undefined, onAbort?: (() => void | Promise<void>) | undefined): Promise<void>;


export const CHANNEL_MESSAGE_ACTION_NAMES: readonly ["send", "broadcast", "poll", "poll-vote", "react", "reactions", "read", "edit", "unsend", "reply", "sendWithEffect", "renameGroup", "setGroupIcon", "addParticipant", "removeParticipant", "leaveGroup", "sendAttachment", "delete", "pin", "unpin", "list-pins", "permissions", "thread-create", "thread-list", "thread-reply", "search", "sticker", "sticker-search", "member-info", "role-info", "emoji-list", "emoji-upload", "sticker-upload", "role-add", "role-remove", "channel-info", "channel-list", "channel-create", "channel-edit", "channel-delete", "channel-move", "category-create", "category-edit", "category-delete", "topic-create", "topic-edit", "voice-status", "event-list", "event-create", "timeout", "kick", "ban", "set-profile", "set-presence", "set-profile", "download-file", "upload-file"];


export const CHANNEL_MESSAGE_CAPABILITIES: readonly ["interactive", "buttons", "cards", "components", "blocks"];


export type BaseProbeResult = BaseProbeResult<TError>;


export type BaseTokenResolution = BaseTokenResolution;


export type ChannelAccountSnapshot = ChannelAccountSnapshot;


export type ChannelAccountState = ChannelAccountState;


export type ChannelAgentPromptAdapter = ChannelAgentPromptAdapter;


export type ChannelAgentTool = ChannelAgentTool;


export type ChannelAgentToolFactory = ChannelAgentToolFactory;


export type ChannelAllowlistAdapter = ChannelAllowlistAdapter;


export type ChannelAuthAdapter = ChannelAuthAdapter;


export type ChannelCapabilities = ChannelCapabilities;


export type ChannelCapabilitiesDiagnostics = ChannelCapabilitiesDiagnostics;


export type ChannelCapabilitiesDisplayLine = ChannelCapabilitiesDisplayLine;


export type ChannelCapabilitiesDisplayTone = ChannelCapabilitiesDisplayTone;


export type ChannelCommandAdapter = ChannelCommandAdapter;


export type ChannelConfigAdapter = ChannelConfigAdapter<ResolvedAccount>;


export type ChannelConfiguredBindingConversationRef = ChannelConfiguredBindingConversationRef;


export type ChannelConfiguredBindingMatch = ChannelConfiguredBindingMatch;


export type ChannelConfiguredBindingProvider = ChannelConfiguredBindingProvider;


export type ChannelDirectoryAdapter = ChannelDirectoryAdapter;


export type ChannelDirectoryEntry = ChannelDirectoryEntry;


export type ChannelDirectoryEntryKind = ChannelDirectoryEntryKind;


export type ChannelElevatedAdapter = ChannelElevatedAdapter;


export type ChannelExecApprovalAdapter = ChannelExecApprovalAdapter;


export type ChannelExecApprovalForwardTarget = ChannelExecApprovalForwardTarget;


export type ChannelExecApprovalInitiatingSurfaceState = ChannelExecApprovalInitiatingSurfaceState;


export type ChannelGatewayAdapter = ChannelGatewayAdapter<ResolvedAccount>;


export type ChannelGatewayContext = ChannelGatewayContext<ResolvedAccount>;


export type ChannelGroupAdapter = ChannelGroupAdapter;


export type ChannelGroupContext = ChannelGroupContext;


export type ChannelHeartbeatAdapter = ChannelHeartbeatAdapter;


export type ChannelHeartbeatDeps = ChannelHeartbeatDeps;


export type ChannelLifecycleAdapter = ChannelLifecycleAdapter;


export type ChannelLoginWithQrStartResult = ChannelLoginWithQrStartResult;


export type ChannelLoginWithQrWaitResult = ChannelLoginWithQrWaitResult;


export type ChannelLogoutContext = ChannelLogoutContext<ResolvedAccount>;


export type ChannelLogoutResult = ChannelLogoutResult;


export type ChannelLogSink = ChannelLogSink;


export type ChannelMentionAdapter = ChannelMentionAdapter;


export type ChannelMessageActionAdapter = ChannelMessageActionAdapter;


export type ChannelMessageActionContext = ChannelMessageActionContext;


export type ChannelMessageActionDiscoveryContext = ChannelMessageActionDiscoveryContext;


export type ChannelMessageActionName = "send" | "broadcast" | "poll" | "poll-vote" | "react" | "reactions" | "read" | "edit" | "unsend" | "reply" | "sendWithEffect" | "renameGroup" | "setGroupIcon" | "addParticipant" | "removeParticipant" | "leaveGroup" | "sendAttachment" | "delete" | "pin" | "unpin" | "list-pins" | "permissions" | "thread-create" | "thread-list" | "thread-reply" | "search" | "sticker" | "sticker-search" | "member-info" | "role-info" | "emoji-list" | "emoji-upload" | "sticker-upload" | "role-add" | "role-remove" | "channel-info" | "channel-list" | "channel-create" | "channel-edit" | "channel-delete" | "channel-move" | "category-create" | "category-edit" | "category-delete" | "topic-create" | "topic-edit" | "voice-status" | "event-list" | "event-create" | "timeout" | "kick" | "ban" | "set-profile" | "set-presence" | "download-file" | "upload-file";


export type ChannelMessageCapability = "interactive" | "buttons" | "cards" | "components" | "blocks";


export type ChannelMessageToolDiscovery = ChannelMessageToolDiscovery;


export type ChannelMessageToolSchemaContribution = ChannelMessageToolSchemaContribution;


export type ChannelMessagingAdapter = ChannelMessagingAdapter;


export type ChannelOutboundAdapter = ChannelOutboundAdapter;


export type ChannelOutboundContext = ChannelOutboundContext;


export type ChannelOutboundTargetMode = ChannelOutboundTargetMode;


export type ChannelPairingAdapter = ChannelPairingAdapter;


export type ChannelPlugin = ChannelPlugin<ResolvedAccount, Probe, Audit>;


export type ChannelPollContext = ChannelPollContext;


export type ChannelPollResult = ChannelPollResult;


export type ChannelResolveKind = ChannelResolveKind;


export type ChannelResolverAdapter = ChannelResolverAdapter;


export type ChannelResolveResult = ChannelResolveResult;


export type ChannelSecurityAdapter = ChannelSecurityAdapter<ResolvedAccount>;


export type ChannelSecurityContext = ChannelSecurityContext<ResolvedAccount>;


export type ChannelSecurityDmPolicy = ChannelSecurityDmPolicy;


export type ChannelSetupAdapter = ChannelSetupAdapter;


export type ChannelSetupInput = ChannelSetupInput;


export type ChannelStatusAdapter = ChannelStatusAdapter<ResolvedAccount, Probe, Audit>;


export type ChannelStatusIssue = ChannelStatusIssue;


export type ChannelStreamingAdapter = ChannelStreamingAdapter;


export type ChannelStructuredComponents = ChannelStructuredComponents;


export type ChannelThreadingAdapter = ChannelThreadingAdapter;


export type ChannelThreadingContext = ChannelThreadingContext;


export type ChannelThreadingToolContext = ChannelThreadingToolContext;


export type ChannelToolSend = ChannelToolSend;


export type CreateTypingCallbacksParams = CreateTypingCallbacksParams;


export type NormalizedPollInput = NormalizedPollInput;


export type ReplyPrefixContextBundle = ReplyPrefixContextBundle;


export type ReplyPrefixOptions = ReplyPrefixOptions;


export type TypingCallbacks = TypingCallbacks;


export function createOptionalChannelSetupAdapter(params: OptionalChannelSetupParams): ChannelSetupAdapter;


export function createOptionalChannelSetupSurface(params: OptionalChannelSetupParams): OptionalChannelSetupSurface;


export function createOptionalChannelSetupWizard(params: OptionalChannelSetupParams): ChannelSetupWizard;


export function createTopLevelChannelDmPolicy(params: { label: string; channel: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: OpenClawConfig) => DmPolicy; promptAllowFrom?: ((params: { cfg: OpenClawConfig; prompter: WizardPrompter; accountId?: string | undefined; }) => Promise<...>) | undefined; getAllowFrom?: ((cfg: OpenClawConfig) => (string | number)[] | undefined) | undefined; }): ChannelSetupDmPolicy;


export function formatDocsLink(path: string, label?: string | undefined, opts?: { fallback?: string | undefined; force?: boolean | undefined; } | undefined): string;


export function setSetupChannelEnabled(cfg: OpenClawConfig, channel: string, enabled: boolean): OpenClawConfig;


export function splitSetupEntries(raw: string): string[];


export const DEFAULT_ACCOUNT_ID: "default";


export type ChannelSetupAdapter = ChannelSetupAdapter;


export type ChannelSetupDmPolicy = ChannelSetupDmPolicy;


export type ChannelSetupInput = ChannelSetupInput;


export type ChannelSetupWizard = ChannelSetupWizard;


export type OptionalChannelSetupSurface = OptionalChannelSetupSurface;


export function buildCommandsMessage(cfg?: OpenClawConfig | undefined, skillCommands?: SkillCommandSpec[] | undefined, options?: CommandsMessageOptions | undefined): string;


export function buildCommandsMessagePaginated(cfg?: OpenClawConfig | undefined, skillCommands?: SkillCommandSpec[] | undefined, options?: CommandsMessageOptions | undefined): CommandsMessageResult;


export function buildCommandsPaginationKeyboard(currentPage: number, totalPages: number, agentId?: string | undefined): { text: string; callback_data: string; }[][];


export function buildCommandText(commandName: string, args?: string | undefined): string;


export function buildCommandTextFromArgs(command: ChatCommandDefinition, args?: CommandArgs | undefined): string;


export function buildHelpMessage(cfg?: OpenClawConfig | undefined): string;


export function buildModelsProviderData(cfg: OpenClawConfig, agentId?: string | undefined): Promise<ModelsProviderData>;


export function createPreCryptoDirectDmAuthorizer(params: { resolveAccess: (senderId: string) => Promise<ResolvedInboundDirectDmAccess | Pick<ResolvedInboundDirectDmAccess, "access">>; issuePairingChallenge?: ((params: { ...; }) => Promise<...>) | undefined; onBlocked?: ((params: { ...; }) => void) | undefined; }): (input: { ...; }) => Promise<...>;


export function findCommandByNativeName(name: string, provider?: string | undefined): ChatCommandDefinition | undefined;


export function formatModelsAvailableHeader(params: { provider: string; total: number; cfg: OpenClawConfig; agentDir?: string | undefined; sessionEntry?: SessionEntry | undefined; }): string;


export function getCommandDetection(_cfg?: OpenClawConfig | undefined): CommandDetection;


export function hasControlCommand(text?: string | undefined, cfg?: OpenClawConfig | undefined, options?: CommandNormalizeOptions | undefined): boolean;


export function hasInlineCommandTokens(text?: string | undefined): boolean;


export function isCommandEnabled(cfg: OpenClawConfig, commandKey: string): boolean;


export function isCommandMessage(raw: string): boolean;


export function isControlCommandMessage(text?: string | undefined, cfg?: OpenClawConfig | undefined, options?: CommandNormalizeOptions | undefined): boolean;


export function isNativeCommandSurface(surface?: string | undefined): boolean;


export function listChatCommands(params?: { skillCommands?: SkillCommandSpec[] | undefined; } | undefined): ChatCommandDefinition[];


export function listChatCommandsForConfig(cfg: OpenClawConfig, params?: { skillCommands?: SkillCommandSpec[] | undefined; } | undefined): ChatCommandDefinition[];


export function listNativeCommandSpecs(params?: { skillCommands?: SkillCommandSpec[] | undefined; provider?: string | undefined; } | undefined): NativeCommandSpec[];


export function listNativeCommandSpecsForConfig(cfg: OpenClawConfig, params?: { skillCommands?: SkillCommandSpec[] | undefined; provider?: string | undefined; } | undefined): NativeCommandSpec[];


export function listReservedChatSlashCommandNames(extraNames?: string[]): Set<string>;


export function listSkillCommandsForAgents(params: { cfg: OpenClawConfig; agentIds?: string[] | undefined; }): SkillCommandSpec[];


export function listSkillCommandsForWorkspace(params: { workspaceDir: string; cfg: OpenClawConfig; skillFilter?: string[] | undefined; }): SkillCommandSpec[];


export function maybeResolveTextAlias(raw: string, cfg?: OpenClawConfig | undefined): string | null;


export function normalizeCommandBody(raw: string, options?: CommandNormalizeOptions | undefined): string;


export function parseCommandArgs(command: ChatCommandDefinition, raw?: string | undefined): CommandArgs | undefined;


export function resolveCommandArgChoices(params: { command: ChatCommandDefinition; arg: CommandArgDefinition; cfg?: OpenClawConfig | undefined; provider?: string | undefined; model?: string | undefined; }): ResolvedCommandArgChoice[];


export function resolveCommandArgMenu(params: { command: ChatCommandDefinition; args?: CommandArgs | undefined; cfg?: OpenClawConfig | undefined; }): { arg: CommandArgDefinition; choices: ResolvedCommandArgChoice[]; title?: string | undefined; } | null;


export function resolveCommandAuthorization(params: { ctx: MsgContext; cfg: OpenClawConfig; commandAuthorized: boolean; }): CommandAuthorization;


export function resolveCommandAuthorizedFromAuthorizers(params: { useAccessGroups: boolean; authorizers: CommandAuthorizer[]; modeWhenAccessGroupsOff?: CommandGatingModeWhenAccessGroupsOff | undefined; }): boolean;


export function resolveControlCommandGate(params: { useAccessGroups: boolean; authorizers: CommandAuthorizer[]; allowTextCommands: boolean; hasControlCommand: boolean; modeWhenAccessGroupsOff?: CommandGatingModeWhenAccessGroupsOff | undefined; }): { ...; };


export function resolveDirectDmAuthorizationOutcome(params: { isGroup: boolean; dmPolicy: string; senderAllowedForCommands: boolean; }): "disabled" | "unauthorized" | "allowed";


export function resolveDualTextControlCommandGate(params: { useAccessGroups: boolean; primaryConfigured: boolean; primaryAllowed: boolean; secondaryConfigured: boolean; secondaryAllowed: boolean; hasControlCommand: boolean; modeWhenAccessGroupsOff?: CommandGatingModeWhenAccessGroupsOff | undefined; }): { ...; };


export function resolveInboundDirectDmAccessWithRuntime(params: { cfg: OpenClawConfig; channel: ChannelId; accountId: string; dmPolicy?: string | null | undefined; allowFrom?: (string | number)[] | null | undefined; senderId: string; ... 4 more ...; readStoreAllowFrom?: ((provider: ChannelId, accountId: string) => Promise<...>) | undefined; }): Promise<...>;


export function resolveModelsCommandReply(params: { cfg: OpenClawConfig; commandBodyNormalized: string; surface?: string | undefined; currentModel?: string | undefined; agentId?: string | undefined; agentDir?: string | undefined; sessionEntry?: SessionEntry | undefined; }): Promise<...>;


export function resolveNativeCommandSessionTargets(params: ResolveNativeCommandSessionTargetsParams): { sessionKey: string; commandTargetSessionKey: string; };


export function resolveSenderCommandAuthorization(params: ResolveSenderCommandAuthorizationParams): Promise<{ shouldComputeAuth: boolean; effectiveAllowFrom: string[]; effectiveGroupAllowFrom: string[]; senderAllowedForCommands: boolean; commandAuthorized: boolean | undefined; }>;


export function resolveSenderCommandAuthorizationWithRuntime(params: ResolveSenderCommandAuthorizationWithRuntimeParams): Promise<{ shouldComputeAuth: boolean; effectiveAllowFrom: string[]; effectiveGroupAllowFrom: string[]; senderAllowedForCommands: boolean; commandAuthorized: boolean | undefined; }>;


export function resolveSkillCommandInvocation(params: { commandBodyNormalized: string; skillCommands: SkillCommandSpec[]; }): { command: SkillCommandSpec; args?: string | undefined; } | null;


export function resolveStoredModelOverride(params: { sessionEntry?: SessionEntry | undefined; sessionStore?: Record<string, SessionEntry> | undefined; sessionKey?: string | undefined; parentSessionKey?: string | undefined; }): StoredModelOverride | null;


export function resolveTextCommand(raw: string, cfg?: OpenClawConfig | undefined): { command: ChatCommandDefinition; args?: string | undefined; } | null;


export function serializeCommandArgs(command: ChatCommandDefinition, args?: CommandArgs | undefined): string | undefined;


export function shouldComputeCommandAuthorized(text?: string | undefined, cfg?: OpenClawConfig | undefined, options?: CommandNormalizeOptions | undefined): boolean;


export function shouldHandleTextCommands(params: ShouldHandleTextCommandsParams): boolean;


export type ChatCommandDefinition = ChatCommandDefinition;


export type CommandArgChoiceContext = CommandArgChoiceContext;


export type CommandArgDefinition = CommandArgDefinition;


export type CommandArgMenuSpec = CommandArgMenuSpec;


export type CommandArgValues = CommandArgValues;


export type CommandAuthorization = CommandAuthorization;


export type CommandAuthorizationRuntime = CommandAuthorizationRuntime;


export type CommandAuthorizer = CommandAuthorizer;


export type CommandDetection = CommandDetection;


export type CommandGatingModeWhenAccessGroupsOff = CommandGatingModeWhenAccessGroupsOff;


export type CommandNormalizeOptions = CommandNormalizeOptions;


export type CommandScope = CommandScope;


export type DirectDmCommandAuthorizationRuntime = DirectDmCommandAuthorizationRuntime;


export type ModelsProviderData = ModelsProviderData;


export type NativeCommandSpec = NativeCommandSpec;


export type ResolvedCommandArgChoice = ResolvedCommandArgChoice;


export type ResolvedInboundDirectDmAccess = ResolvedInboundDirectDmAccess;


export type ResolveNativeCommandSessionTargetsParams = ResolveNativeCommandSessionTargetsParams;


export type ResolveSenderCommandAuthorizationParams = ResolveSenderCommandAuthorizationParams;


export type ResolveSenderCommandAuthorizationWithRuntimeParams = ResolveSenderCommandAuthorizationWithRuntimeParams;


export type ShouldHandleTextCommandsParams = ShouldHandleTextCommandsParams;


export type StoredModelOverride = StoredModelOverride;


export function applyAccountNameToChannelSection(params: { cfg: OpenClawConfig; channelKey: string; accountId: string; name?: string | undefined; alwaysUseAccounts?: boolean | undefined; }): OpenClawConfig;


export function buildAgentSessionKey(params: { agentId: string; channel: string; accountId?: string | null | undefined; peer?: RoutePeer | null | undefined; dmScope?: "main" | "per-peer" | "per-channel-peer" | "per-account-channel-peer" | undefined; identityLinks?: Record<...> | undefined; }): string;


export function buildChannelConfigSchema(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>, options?: BuildChannelConfigSchemaOptions | undefined): ChannelConfigSchema;


export function buildChannelOutboundSessionRoute(params: { cfg: OpenClawConfig; agentId: string; channel: string; accountId?: string | null | undefined; peer: { kind: "direct" | "group" | "channel"; id: string; }; chatType: "direct" | "group" | "channel"; from: string; to: string; threadId?: string | ... 1 more ... | undefined; }): ChannelOutboundSessionRoute;


export function buildPluginConfigSchema(schema: ZodType<unknown, unknown, $ZodTypeInternals<unknown, unknown>>, options?: BuildPluginConfigSchemaOptions | undefined): OpenClawPluginConfigSchema;


export function channelTargetSchema(options?: { description?: string | undefined; } | undefined): TString;


export function channelTargetsSchema(options?: { description?: string | undefined; } | undefined): TArray<TString>;


export function clearAccountEntryFields<TAccountEntry extends object>(params: { accounts?: Record<string, TAccountEntry> | undefined; accountId: string; fields: string[]; isValueSet?: ((value: unknown) => boolean) | undefined; markClearedOnFieldPresence?: boolean | undefined; }): { ...; };


export function createChannelPluginBase<TResolvedAccount>(params: CreateChannelPluginBaseOptions<TResolvedAccount>): CreatedChannelPluginBase<TResolvedAccount>;


export function createChatChannelPlugin<TResolvedAccount extends { accountId?: string | null; }, Probe = unknown, Audit = unknown>(params: { base: ChatChannelPluginBase<TResolvedAccount, Probe, Audit>; security?: ChannelSecurityAdapter<TResolvedAccount> | ChatChannelSecurityOptions<...> | undefined; pairing?: ChannelPairingAdapter | ... 1 more ... | undefined; threading?: ChannelThreadingAdapter | ... 1 more ... | undefined; outbound?: ChannelOutboundAdapter | ... 1 more ... | undefined; }): ChannelPlugin<...>;


export function defineChannelPluginEntry<TPlugin>({ id, name, description, plugin, configSchema, setRuntime, registerFull, }: DefineChannelPluginEntryOptions<TPlugin>): DefinedChannelPluginEntry<TPlugin>;


export function definePluginEntry({ id, name, description, kind, configSchema, register, }: DefinePluginEntryOptions): DefinedPluginEntry;


export function defineSetupPluginEntry<TPlugin>(plugin: TPlugin): { plugin: TPlugin; };


export function delegateCompactionToRuntime(params: { sessionId: string; sessionKey?: string | undefined; sessionFile: string; tokenBudget?: number | undefined; force?: boolean | undefined; currentTokenCount?: number | undefined; compactionTarget?: "budget" | ... 1 more ... | undefined; customInstructions?: string | undefined; runtimeContext?: ContextEngineRuntimeContext | undefined; }): Promise<...>;


export function deleteAccountFromConfigSection(params: { cfg: OpenClawConfig; sectionKey: string; accountId: string; clearBaseFields?: string[] | undefined; }): OpenClawConfig;


export function emptyPluginConfigSchema(): OpenClawPluginConfigSchema;


export function enqueueKeyedTask<T>(params: { tails: Map<string, Promise<void>>; key: string; task: () => Promise<T>; hooks?: KeyedAsyncQueueHooks | undefined; }): Promise<...>;


export function formatPairingApproveHint(channelId: string): string;


export function getChatChannelMeta(id: "telegram" | "whatsapp" | "discord" | "irc" | "googlechat" | "slack" | "signal" | "imessage" | "line"): ChannelMeta;


export function isSecretRef(value: unknown): value is SecretRef;


export function loadSecretFileSync(filePath: string, label: string, options?: SecretFileReadOptions): SecretFileReadResult;


export function migrateBaseNameToDefaultAccount(params: { cfg: OpenClawConfig; channelKey: string; alwaysUseAccounts?: boolean | undefined; }): OpenClawConfig;


export function normalizeAccountId(value: string | null | undefined): string;


export function normalizeAtHashSlug(raw?: string | null | undefined): string;


export function normalizeHyphenSlug(raw?: string | null | undefined): string;


export function optionalStringEnum<T extends readonly string[]>(values: T, options?: StringEnumOptions<T>): TOptional<TUnsafe<T[number]>>;


export function parseOptionalDelimitedEntries(value?: string | undefined): string[] | undefined;


export function readSecretFileSync(filePath: string, label: string, options?: SecretFileReadOptions): string;


export function resolveGatewayBindUrl(params: { bind?: string | undefined; customBindHost?: string | undefined; scheme: "ws" | "wss"; port: number; pickTailnetHost: () => string | null; pickLanHost: () => string | null; }): GatewayBindUrlResult;


export function resolveGatewayPort(cfg?: OpenClawConfig | undefined, env?: ProcessEnv): number;


export function resolveTailnetHostWithRunner(runCommandWithTimeout?: TailscaleStatusCommandRunner | undefined): Promise<string | null>;


export function resolveThreadSessionKeys(params: { baseSessionKey: string; threadId?: string | null | undefined; parentSessionKey?: string | undefined; useSuffix?: boolean | undefined; normalizeThreadId?: ((threadId: string) => string) | undefined; }): { ...; };


export function setAccountEnabledInConfigSection(params: { cfg: OpenClawConfig; sectionKey: string; accountId: string; enabled: boolean; allowTopLevel?: boolean | undefined; }): OpenClawConfig;


export function stringEnum<T extends readonly string[]>(values: T, options?: StringEnumOptions<T>): TUnsafe<T[number]>;


export function stripChannelTargetPrefix(raw: string, ...providers: string[]): string;


export function stripTargetKindPrefix(raw: string): string;


export function tryReadSecretFileSync(filePath: string | undefined, label: string, options?: SecretFileReadOptions): string | undefined;


export const DEFAULT_ACCOUNT_ID: "default";


export const DEFAULT_SECRET_FILE_MAX_BYTES: number;


export type AnyAgentTool = AnyAgentTool;


export type ChannelConfigUiHint = ChannelConfigUiHint;


export type ChannelMessageActionContext = ChannelMessageActionContext;


export type ChannelMessagingAdapter = ChannelMessagingAdapter;


export type ChannelOutboundSessionRoute = ChannelOutboundSessionRoute;


export type ChannelOutboundSessionRouteParams = {    cfg: OpenClawConfig;    agentId: string;    accountId?: string | null;    target: string;    resolvedTarget?: {        to: string;        kind: import("src/channels/plugins/types.core").ChannelDirectoryEntryKind | "channel";        display?: string;        source: "normalized" | "directory";    };    replyToId?: string | null;    threadId?: string | number | null;};


export type ChannelPlugin = ChannelPlugin<ResolvedAccount, Probe, Audit>;


export type GatewayBindUrlResult = GatewayBindUrlResult;


export type GatewayRequestHandlerOptions = GatewayRequestHandlerOptions;


export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;


export type OpenClawConfig = OpenClawConfig;


export type OpenClawPluginApi = OpenClawPluginApi;


export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;


export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;


export type OpenClawPluginDefinition = OpenClawPluginDefinition;


export type OpenClawPluginService = OpenClawPluginService;


export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;


export type OpenClawPluginToolContext = OpenClawPluginToolContext;


export type OpenClawPluginToolFactory = OpenClawPluginToolFactory;


export type PluginCommandContext = PluginCommandContext;


export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;


export type PluginLogger = PluginLogger;


export type PluginRuntime = PluginRuntime;


export type ProviderAugmentModelCatalogContext = ProviderAugmentModelCatalogContext;


export type ProviderAuthContext = ProviderAuthContext;


export type ProviderAuthDoctorHintContext = ProviderAuthDoctorHintContext;


export type ProviderAuthMethod = ProviderAuthMethod;


export type ProviderAuthMethodNonInteractiveContext = ProviderAuthMethodNonInteractiveContext;


export type ProviderAuthResult = ProviderAuthResult;


export type ProviderBuildMissingAuthMessageContext = ProviderBuildMissingAuthMessageContext;


export type ProviderBuildUnknownModelHintContext = ProviderBuildUnknownModelHintContext;


export type ProviderBuiltInModelSuppressionContext = ProviderBuiltInModelSuppressionContext;


export type ProviderBuiltInModelSuppressionResult = ProviderBuiltInModelSuppressionResult;


export type ProviderCacheTtlEligibilityContext = ProviderCacheTtlEligibilityContext;


export type ProviderCatalogContext = ProviderCatalogContext;


export type ProviderCatalogResult = ProviderCatalogResult;


export type ProviderDefaultThinkingPolicyContext = ProviderDefaultThinkingPolicyContext;


export type ProviderDiscoveryContext = ProviderCatalogContext;


export type ProviderFetchUsageSnapshotContext = ProviderFetchUsageSnapshotContext;


export type ProviderModernModelPolicyContext = ProviderModernModelPolicyContext;


export type ProviderNormalizeResolvedModelContext = ProviderNormalizeResolvedModelContext;


export type ProviderPreparedRuntimeAuth = ProviderPreparedRuntimeAuth;


export type ProviderPrepareDynamicModelContext = ProviderResolveDynamicModelContext;


export type ProviderPrepareExtraParamsContext = ProviderPrepareExtraParamsContext;


export type ProviderPrepareRuntimeAuthContext = ProviderPrepareRuntimeAuthContext;


export type ProviderResolvedUsageAuth = ProviderResolvedUsageAuth;


export type ProviderResolveDynamicModelContext = ProviderResolveDynamicModelContext;


export type ProviderResolveUsageAuthContext = ProviderResolveUsageAuthContext;


export type ProviderRuntimeModel = ProviderRuntimeModel;


export type ProviderThinkingPolicyContext = ProviderThinkingPolicyContext;


export type ProviderUsageSnapshot = ProviderUsageSnapshot;


export type ProviderWrapStreamFnContext = ProviderWrapStreamFnContext;


export type SecretFileReadOptions = SecretFileReadOptions;


export type SecretFileReadResult = SecretFileReadResult;


export type SpeechProviderPlugin = SpeechProviderPlugin;


export type TailscaleStatusCommandResult = TailscaleStatusCommandResult;


export type TailscaleStatusCommandRunner = TailscaleStatusCommandRunner;


export type UsageProviderId = UsageProviderId;


export function definePluginEntry({ id, name, description, kind, configSchema, register, }: DefinePluginEntryOptions): DefinedPluginEntry;


export function emptyPluginConfigSchema(): OpenClawPluginConfigSchema;


export type AnyAgentTool = AnyAgentTool;


export type MediaUnderstandingProviderPlugin = MediaUnderstandingProvider;


export type OpenClawConfig = OpenClawConfig;


export type OpenClawPluginApi = OpenClawPluginApi;


export type OpenClawPluginCommandDefinition = OpenClawPluginCommandDefinition;


export type OpenClawPluginConfigSchema = OpenClawPluginConfigSchema;


export type OpenClawPluginDefinition = OpenClawPluginDefinition;


export type OpenClawPluginService = OpenClawPluginService;


export type OpenClawPluginServiceContext = OpenClawPluginServiceContext;


export type OpenClawPluginToolContext = OpenClawPluginToolContext;


export type OpenClawPluginToolFactory = OpenClawPluginToolFactory;


export type PluginCommandContext = PluginCommandContext;


export type PluginInteractiveTelegramHandlerContext = PluginInteractiveTelegramHandlerContext;


export type PluginLogger = PluginLogger;


export type ProviderAugmentModelCatalogContext = ProviderAugmentModelCatalogContext;


export type ProviderAuthContext = ProviderAuthContext;


export type ProviderAuthDoctorHintContext = ProviderAuthDoctorHintContext;


export type ProviderAuthMethod = ProviderAuthMethod;


export type ProviderAuthMethodNonInteractiveContext = ProviderAuthMethodNonInteractiveContext;


export type ProviderAuthResult = ProviderAuthResult;


export type ProviderBuildMissingAuthMessageContext = ProviderBuildMissingAuthMessageContext;


export type ProviderBuildUnknownModelHintContext = ProviderBuildUnknownModelHintContext;


export type ProviderBuiltInModelSuppressionContext = ProviderBuiltInModelSuppressionContext;


export type ProviderBuiltInModelSuppressionResult = ProviderBuiltInModelSuppressionResult;


export type ProviderCacheTtlEligibilityContext = ProviderCacheTtlEligibilityContext;


export type ProviderCatalogContext = ProviderCatalogContext;


export type ProviderCatalogResult = ProviderCatalogResult;


export type ProviderDefaultThinkingPolicyContext = ProviderDefaultThinkingPolicyContext;


export type ProviderDiscoveryContext = ProviderCatalogContext;


export type ProviderFetchUsageSnapshotContext = ProviderFetchUsageSnapshotContext;


export type ProviderModernModelPolicyContext = ProviderModernModelPolicyContext;


export type ProviderNormalizeResolvedModelContext = ProviderNormalizeResolvedModelContext;


export type ProviderPreparedRuntimeAuth = ProviderPreparedRuntimeAuth;


export type ProviderPrepareDynamicModelContext = ProviderResolveDynamicModelContext;


export type ProviderPrepareExtraParamsContext = ProviderPrepareExtraParamsContext;


export type ProviderPrepareRuntimeAuthContext = ProviderPrepareRuntimeAuthContext;


export type ProviderResolvedUsageAuth = ProviderResolvedUsageAuth;


export type ProviderResolveDynamicModelContext = ProviderResolveDynamicModelContext;


export type ProviderResolveUsageAuthContext = ProviderResolveUsageAuthContext;


export type ProviderRuntimeModel = ProviderRuntimeModel;


export type ProviderThinkingPolicyContext = ProviderThinkingPolicyContext;


export type ProviderWrapStreamFnContext = ProviderWrapStreamFnContext;


export type SpeechProviderPlugin = SpeechProviderPlugin;


export function applyAgentDefaultModelPrimary(cfg: OpenClawConfig, primary: string): OpenClawConfig;


export function applyOnboardAuthAgentModelsAndProviders(cfg: OpenClawConfig, params: { agentModels: Record<string, AgentModelEntryConfig>; providers: Record<string, ModelProviderConfig>; }): OpenClawConfig;


export function applyProviderConfigWithDefaultModel(cfg: OpenClawConfig, params: { agentModels: Record<string, AgentModelEntryConfig>; providerId: string; api: "github-copilot" | "openai-completions" | ... 5 more ... | "ollama"; baseUrl: string; defaultModel: ModelDefinitionConfig; defaultModelId?: string | undefined; }): OpenClawConfig;


export function applyProviderConfigWithDefaultModelPreset(cfg: OpenClawConfig, params: { providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | "openai-codex-responses" | "anthropic-messages" | "google-generative-ai" | "bedrock-converse-stream" | "ollama"; ... 4 more ...; primaryModelRef?: string | undefined; }): OpenClawConfig;


export function applyProviderConfigWithDefaultModels(cfg: OpenClawConfig, params: { agentModels: Record<string, AgentModelEntryConfig>; providerId: string; api: "github-copilot" | "openai-completions" | ... 5 more ... | "ollama"; baseUrl: string; defaultModels: ModelDefinitionConfig[]; defaultModelId?: string | undefined; }): OpenClawConfig;


export function applyProviderConfigWithDefaultModelsPreset(cfg: OpenClawConfig, params: { providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | "openai-codex-responses" | "anthropic-messages" | "google-generative-ai" | "bedrock-converse-stream" | "ollama"; ... 4 more ...; primaryModelRef?: string | undefined; }): OpenClawConfig;


export function applyProviderConfigWithModelCatalog(cfg: OpenClawConfig, params: { agentModels: Record<string, AgentModelEntryConfig>; providerId: string; api: "github-copilot" | "openai-completions" | ... 5 more ... | "ollama"; baseUrl: string; catalogModels: ModelDefinitionConfig[]; }): OpenClawConfig;


export function applyProviderConfigWithModelCatalogPreset(cfg: OpenClawConfig, params: { providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | "openai-codex-responses" | "anthropic-messages" | "google-generative-ai" | "bedrock-converse-stream" | "ollama"; baseUrl: string; catalogModels: ModelDefinitionConfig[]; aliases?: readonly AgentModelAliasEntry[] | undefined; primaryModelRef?: string | undefined; }): OpenClawConfig;


export function createDefaultModelPresetAppliers<TArgs extends unknown[]>(params: { resolveParams: (cfg: OpenClawConfig, ...args: TArgs) => Omit<{ providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | ... 4 more ... | "ollama"; ... 4 more ...; primaryModelRef?: string | undefined; }, "primaryModelRef"> | null | undefined; primaryModelRef: string; }): ProviderOnboardPresetAppliers<...>;


export function createDefaultModelsPresetAppliers<TArgs extends unknown[]>(params: { resolveParams: (cfg: OpenClawConfig, ...args: TArgs) => Omit<{ providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | ... 4 more ... | "ollama"; ... 4 more ...; primaryModelRef?: string | undefined; }, "primaryModelRef"> | null | undefined; primaryModelRef: string; }): ProviderOnboardPresetAppliers<...>;


export function createModelCatalogPresetAppliers<TArgs extends unknown[]>(params: { resolveParams: (cfg: OpenClawConfig, ...args: TArgs) => Omit<{ providerId: string; api: "github-copilot" | "openai-completions" | "openai-responses" | ... 4 more ... | "ollama"; baseUrl: string; catalogModels: ModelDefinitionConfig[]; aliases?: readonly AgentModelAliasEntry[] | undefined; primaryModelRef?: string | undefined; }, "primaryModelRef"> | null | undefined; primaryModelRef: string; }): ProviderOnboardPresetAppliers<...>;


export function ensureModelAllowlistEntry(params: { cfg: OpenClawConfig; modelRef: string; defaultProvider?: string | undefined; }): OpenClawConfig;


export function withAgentModelAliases(existing: Record<string, AgentModelEntryConfig> | undefined, aliases: readonly AgentModelAliasEntry[]): Record<string, AgentModelEntryConfig>;


export type AgentModelAliasEntry = AgentModelAliasEntry;


export type ModelApi = "github-copilot" | "openai-completions" | "openai-responses" | "openai-codex-responses" | "anthropic-messages" | "google-generative-ai" | "bedrock-converse-stream" | "ollama";


export type ModelDefinitionConfig = ModelDefinitionConfig;


export type ModelProviderConfig = ModelProviderConfig;


export type OpenClawConfig = OpenClawConfig;


export type ProviderOnboardPresetAppliers = ProviderOnboardPresetAppliers<TArgs>;


export function buildMediaPayload(mediaList: MediaPayloadInput[], opts?: { preserveMediaTypeCardinality?: boolean | undefined; } | undefined): MediaPayload;


export function countOutboundMedia(payload: { mediaUrls?: string[] | undefined; mediaUrl?: string | undefined; }): number;


export function createNormalizedOutboundDeliverer(handler: (payload: OutboundReplyPayload) => Promise<void>): (payload: unknown) => Promise<void>;


export function deliverFormattedTextWithAttachments(params: { payload: OutboundReplyPayload; send: (params: { text: string; replyToId?: string | undefined; }) => Promise<void>; }): Promise<boolean>;


export function deliverTextOrMediaReply(params: { payload: OutboundReplyPayload; text: string; chunkText?: ((text: string) => readonly string[]) | undefined; sendText: (text: string) => Promise<void>; sendMedia: (payload: { ...; }) => Promise<...>; onMediaError?: ((params: { ...; }) => void | Promise<...>) | undefined; }): Promise<...>;


export function formatTextWithAttachmentLinks(text: string | undefined, mediaUrls: string[]): string;


export function hasOutboundMedia(payload: { mediaUrls?: string[] | undefined; mediaUrl?: string | undefined; }): boolean;


export function hasOutboundReplyContent(payload: { text?: string | undefined; mediaUrls?: string[] | undefined; mediaUrl?: string | undefined; }, options?: { trimText?: boolean | undefined; } | undefined): boolean;


export function hasOutboundText(payload: { text?: string | undefined; }, options?: { trim?: boolean | undefined; } | undefined): boolean;


export function isNumericTargetId(raw: string): boolean;


export function normalizeOutboundReplyPayload(payload: Record<string, unknown>): OutboundReplyPayload;


export function resolveOutboundMediaUrls(payload: { mediaUrls?: string[] | undefined; mediaUrl?: string | undefined; }): string[];


export function resolvePayloadMediaUrls(payload: ReplyPayload): string[];


export function resolveSendableOutboundReplyParts(payload: { text?: string | undefined; mediaUrls?: string[] | undefined; mediaUrl?: string | undefined; }, options?: { text?: string | undefined; } | undefined): SendableOutboundReplyParts;


export function resolveTextChunksWithFallback(text: string, chunks: readonly string[]): string[];


export function sendMediaWithLeadingCaption(params: { mediaUrls: string[]; caption: string; send: (payload: { mediaUrl: string; caption?: string | undefined; }) => Promise<void>; onError?: ((params: { error: unknown; mediaUrl: string; caption?: string | undefined; index: number; isFirst: boolean; }) => void | Promise<...>) | undefined; }): Promise<...>;


export function sendPayloadMediaSequence<TResult>(params: { text: string; mediaUrls: readonly string[]; send: (input: { text: string; mediaUrl: string; index: number; isFirst: boolean; }) => Promise<TResult>; }): Promise<TResult | undefined>;


export function sendPayloadMediaSequenceAndFinalize<TMediaResult, TResult>(params: { text: string; mediaUrls: readonly string[]; send: (input: { text: string; mediaUrl: string; index: number; isFirst: boolean; }) => Promise<TMediaResult>; finalize: () => Promise<TResult>; }): Promise<...>;


export function sendPayloadMediaSequenceOrFallback<TResult>(params: { text: string; mediaUrls: readonly string[]; send: (input: { text: string; mediaUrl: string; index: number; isFirst: boolean; }) => Promise<TResult>; fallbackResult: TResult; sendNoMedia?: (() => Promise<...>) | undefined; }): Promise<...>;


export function sendPayloadWithChunkedTextAndMedia<TContext extends { payload: object; }, TResult>(params: { ctx: TContext; textChunkLimit?: number | undefined; chunker?: ((text: string, limit: number) => string[]) | null | undefined; sendText: (ctx: TContext & { ...; }) => Promise<...>; sendMedia: (ctx: TContext & { ...; }) => Promise<...>; emptyResult: TResult; }): Promise<...>;


export function sendTextMediaPayload(params: { channel: string; ctx: ChannelOutboundPayloadContext; adapter: SendPayloadAdapter; }): Promise<OutboundDeliveryResult>;


export type MediaPayload = MediaPayload;


export type MediaPayloadInput = MediaPayloadInput;


export type OutboundReplyPayload = OutboundReplyPayload;


export type SendableOutboundReplyParts = SendableOutboundReplyParts;


export function createPluginRuntimeStore<T>(errorMessage: string): { setRuntime: (next: T) => void; clearRuntime: () => void; tryGetRuntime: () => T | null; getRuntime: () => T; };


export type PluginRuntime = PluginRuntime;


export function buildOptionalSecretInputSchema(): ZodOptional<ZodUnion<readonly [ZodString, ZodDiscriminatedUnion<[ZodObject<{ source: ZodLiteral<"env">; provider: ZodString; id: ZodString; }, $strip>, ZodObject<...>, ZodObject<...>], "source">]>>;


export function buildSecretInputArraySchema(): ZodArray<ZodUnion<readonly [ZodString, ZodDiscriminatedUnion<[ZodObject<{ source: ZodLiteral<"env">; provider: ZodString; id: ZodString; }, $strip>, ZodObject<...>, ZodObject<...>], "source">]>>;


export function buildSecretInputSchema(): ZodUnion<readonly [ZodString, ZodDiscriminatedUnion<[ZodObject<{ source: ZodLiteral<"env">; provider: ZodString; id: ZodString; }, $strip>, ZodObject<...>, ZodObject<...>], "source">]>;


export function hasConfiguredSecretInput(value: unknown, defaults?: SecretDefaults | undefined): boolean;


export function normalizeResolvedSecretInputString(params: { value: unknown; refValue?: unknown; defaults?: SecretDefaults | undefined; path: string; }): string | undefined;


export function normalizeSecretInput(value: unknown): string;


export function normalizeSecretInputString(value: unknown): string | undefined;


export function createWindowsCmdShimFixture(params: { shimPath: string; scriptPath: string; shimLine: string; }): Promise<void>;


export function installCommonResolveTargetErrorCases(params: { resolveTarget: ResolveTargetFn; implicitAllowFrom: string[]; }): void;


export function removeAckReactionAfterReply(params: { removeAfterReply: boolean; ackReactionPromise: Promise<boolean> | null; ackReactionValue: string | null; remove: () => Promise<void>; onError?: ((err: unknown) => void) | undefined; }): void;


export function shouldAckReaction(params: AckReactionGateParams): boolean;


export type ChannelAccountSnapshot = ChannelAccountSnapshot;


export type ChannelGatewayContext = ChannelGatewayContext<ResolvedAccount>;


export type OpenClawConfig = OpenClawConfig;


export function applyBasicWebhookRequestGuards(params: { req: IncomingMessage; res: ServerResponse<IncomingMessage>; allowMethods?: readonly string[] | undefined; rateLimiter?: FixedWindowRateLimiter | undefined; rateLimitKey?: string | undefined; nowMs?: number | undefined; requireJsonContentType?: boolean | undefined; }): boolean;


export function beginWebhookRequestPipelineOrReject(params: { req: IncomingMessage; res: ServerResponse<IncomingMessage>; allowMethods?: readonly string[] | undefined; rateLimiter?: FixedWindowRateLimiter | undefined; ... 6 more ...; inFlightLimitMessage?: string | undefined; }): { ...; } | { ...; };


export function createBoundedCounter(options: { maxTrackedKeys: number; ttlMs?: number | undefined; pruneIntervalMs?: number | undefined; }): BoundedCounter;


export function createFixedWindowRateLimiter(options: { windowMs: number; maxRequests: number; maxTrackedKeys: number; pruneIntervalMs?: number | undefined; }): FixedWindowRateLimiter;


export function createWebhookAnomalyTracker(options?: { maxTrackedKeys?: number | undefined; ttlMs?: number | undefined; logEvery?: number | undefined; trackedStatusCodes?: readonly number[] | undefined; } | undefined): WebhookAnomalyTracker;


export function createWebhookInFlightLimiter(options?: { maxInFlightPerKey?: number | undefined; maxTrackedKeys?: number | undefined; } | undefined): WebhookInFlightLimiter;


export function isJsonContentType(value: string | string[] | undefined): boolean;


export function isRequestBodyLimitError(error: unknown, code?: RequestBodyLimitErrorCode | undefined): error is RequestBodyLimitError;


export function normalizePluginHttpPath(path?: string | null | undefined, fallback?: string | null | undefined): string | null;


export function normalizeWebhookPath(raw: string): string;


export function readJsonWebhookBodyOrReject(params: { req: IncomingMessage; res: ServerResponse<IncomingMessage>; maxBytes?: number | undefined; timeoutMs?: number | undefined; profile?: WebhookBodyReadProfile | undefined; emptyObjectOnEmpty?: boolean | undefined; invalidJsonMessage?: string | undefined; }): Promise<...>;


export function readRequestBodyWithLimit(req: IncomingMessage, options: ReadRequestBodyOptions): Promise<string>;


export function readWebhookBodyOrReject(params: { req: IncomingMessage; res: ServerResponse<IncomingMessage>; maxBytes?: number | undefined; timeoutMs?: number | undefined; profile?: WebhookBodyReadProfile | undefined; invalidBodyMessage?: string | undefined; }): Promise<...>;


export function registerPluginHttpRoute(params: { path?: string | null | undefined; fallbackPath?: string | null | undefined; handler: PluginHttpRouteHandler; auth: OpenClawPluginHttpRouteAuth; ... 6 more ...; registry?: PluginRegistry | undefined; }): () => void;


export function registerWebhookTarget<T extends { path: string; }>(targetsByPath: Map<string, T[]>, target: T, opts?: RegisterWebhookTargetOptions<T> | undefined): RegisteredWebhookTarget<T>;


export function registerWebhookTargetWithPluginRoute<T extends { path: string; }>(params: { targetsByPath: Map<string, T[]>; target: T; route: RegisterWebhookPluginRouteOptions; onLastPathTargetRemoved?: ((params: { ...; }) => void) | undefined; }): RegisteredWebhookTarget<...>;


export function requestBodyErrorToText(code: RequestBodyLimitErrorCode): string;


export function resolveRequestClientIp(req?: IncomingMessage | undefined, trustedProxies?: string[] | undefined, allowRealIpFallback?: boolean): string | undefined;


export function resolveSingleWebhookTarget<T>(targets: readonly T[], isMatch: (target: T) => boolean): WebhookTargetMatchResult<T>;


export function resolveSingleWebhookTargetAsync<T>(targets: readonly T[], isMatch: (target: T) => Promise<boolean>): Promise<WebhookTargetMatchResult<T>>;


export function resolveWebhookPath(params: { webhookPath?: string | undefined; webhookUrl?: string | undefined; defaultPath?: string | null | undefined; }): string | null;


export function resolveWebhookTargets<T>(req: IncomingMessage, targetsByPath: Map<string, T[]>): { path: string; targets: T[]; } | null;


export function resolveWebhookTargetWithAuthOrReject<T>(params: { targets: readonly T[]; res: ServerResponse<IncomingMessage>; isMatch: (target: T) => boolean | Promise<boolean>; unauthorizedStatusCode?: number | undefined; unauthorizedMessage?: string | undefined; ambiguousStatusCode?: number | undefined; ambiguousMessage?: string | undefined; }): Promise<...>;


export function resolveWebhookTargetWithAuthOrRejectSync<T>(params: { targets: readonly T[]; res: ServerResponse<IncomingMessage>; isMatch: (target: T) => boolean; unauthorizedStatusCode?: number | undefined; unauthorizedMessage?: string | undefined; ambiguousStatusCode?: number | undefined; ambiguousMessage?: string | undefined; }): T | null;


export function withResolvedWebhookRequestPipeline<T>(params: { req: IncomingMessage; res: ServerResponse<IncomingMessage>; targetsByPath: Map<string, T[]>; allowMethods?: readonly string[] | undefined; ... 8 more ...; handle: (args: { ...; }) => boolean | ... 1 more ... | Promise<...>; }): Promise<...>;


export const WEBHOOK_ANOMALY_COUNTER_DEFAULTS: Readonly<{ maxTrackedKeys: 4096; ttlMs: number; logEvery: 25; }>;


export const WEBHOOK_ANOMALY_STATUS_CODES: readonly number[];


export const WEBHOOK_BODY_READ_DEFAULTS: Readonly<{ preAuth: { maxBytes: number; timeoutMs: number; }; postAuth: { maxBytes: number; timeoutMs: number; }; }>;


export const WEBHOOK_IN_FLIGHT_DEFAULTS: Readonly<{ maxInFlightPerKey: 8; maxTrackedKeys: 4096; }>;


export const WEBHOOK_RATE_LIMIT_DEFAULTS: Readonly<{ windowMs: 60000; maxRequests: 120; maxTrackedKeys: 4096; }>;


export type BoundedCounter = BoundedCounter;


export type FixedWindowRateLimiter = FixedWindowRateLimiter;


export type RegisteredWebhookTarget = RegisteredWebhookTarget<T>;


export type RegisterWebhookPluginRouteOptions = RegisterWebhookPluginRouteOptions;


export type RegisterWebhookTargetOptions = RegisterWebhookTargetOptions<T>;


export type WebhookAnomalyTracker = WebhookAnomalyTracker;


export type WebhookBodyReadProfile = WebhookBodyReadProfile;


export type WebhookInFlightLimiter = WebhookInFlightLimiter;


export type WebhookTargetMatchResult = WebhookTargetMatchResult<T>;