//#region src/nextclaw-sdk/types.d.ts type LogFn = (message: string) => void; type SecretRefSource = "env" | "file" | "exec"; type DmPolicy = "open" | "pairing" | "allowlist"; type BaseProbeResult = { ok: boolean; target?: TTarget; error?: string; [key: string]: unknown; }; type ChannelMeta = { id: string; label: string; selectionLabel?: string; docsPath?: string; docsLabel?: string; blurb?: string; aliases?: string[]; order?: number; [key: string]: unknown; }; type ChannelPlugin = { id: string; meta: ChannelMeta; config?: Record; onboarding?: ChannelOnboardingAdapter; [key: string]: unknown; __resolvedAccountType__?: ResolvedAccount; }; type AnyAgentTool = { name?: string; description?: string; parameters?: Record; execute?: (toolCallId: string, params: unknown) => Promise | unknown; [key: string]: unknown; }; type ResolvedAgentRoute = { agentId?: string; sessionKey?: string; [key: string]: unknown; }; type InboundDebouncer = { run: (key: string, value: T, task: (value: T) => Promise) => void; clear: () => void; }; type PluginRuntime = { version?: string; config: { loadConfig?: () => OpenClawConfig; writeConfigFile: (next: OpenClawConfig) => Promise; }; logging: { shouldLogVerbose: () => boolean; }; media: { detectMime: (params: { buffer: Buffer; }) => Promise; loadWebMedia: (url: string, options?: Record) => Promise>; }; channel: { media: { fetchRemoteMedia: (params: { url: string; maxBytes?: number; }) => Promise>; saveMediaBuffer: (buffer: Buffer, contentType?: string, direction?: string, maxBytes?: number) => Promise<{ path: string; contentType?: string; }>; }; text: { chunkMarkdownText: (text: string, limit: number) => string[]; resolveMarkdownTableMode: (params: Record) => unknown; convertMarkdownTables: (text: string, mode?: unknown) => string; resolveTextChunkLimit: (cfg: OpenClawConfig, channel: string, accountId?: string, options?: Record) => number; resolveChunkMode: (cfg: OpenClawConfig, channel: string) => string; chunkTextWithMode: (text: string, limit: number, mode?: unknown) => string[]; hasControlCommand: (text: string, cfg: OpenClawConfig) => boolean; }; reply: { resolveEnvelopeFormatOptions: (cfg: OpenClawConfig) => Record; formatAgentEnvelope: (params: Record) => string; finalizeInboundContext: (params: Record) => Record; withReplyDispatcher: (params: Record) => Promise>; dispatchReplyFromConfig: (params: Record) => Promise>; createReplyDispatcherWithTyping: (params: Record) => { dispatcher: unknown; replyOptions: Record; markDispatchIdle: () => void; }; resolveHumanDelayConfig: (cfg: OpenClawConfig, agentId: string) => unknown; dispatchReplyWithBufferedBlockDispatcher?: (params: Record) => Promise; }; routing: { resolveAgentRoute: (params: Record) => ResolvedAgentRoute | null; }; pairing: { readAllowFromStore: (params: { channel: string; accountId?: string; }) => unknown; upsertPairingRequest: (params: Record) => Promise<{ code: string; created: boolean; }>; }; commands: { shouldComputeCommandAuthorized: (text: string) => boolean; resolveCommandAuthorizedFromAuthorizers: (params: Record) => Promise | boolean; }; debounce: { resolveInboundDebounceMs: (params: Record) => number; createInboundDebouncer: (params: Record) => InboundDebouncer; }; }; [key: string]: unknown; }; type RuntimeEnv = { log?: (message: string) => void; error?: (message: string) => void; warn?: (message: string) => void; debug?: (message: string) => void; info?: (message: string) => void; [key: string]: unknown; }; type OpenClawPluginApi = { config: ClawdbotConfig; runtime: PluginRuntime; logger: { info: LogFn; warn: LogFn; error: LogFn; debug?: LogFn; }; registerTool: (tool: AnyAgentTool | ((ctx: Record) => AnyAgentTool | AnyAgentTool[] | null | undefined), opts?: { name?: string; names?: string[]; optional?: boolean; }) => void; registerChannel: (registration: unknown) => void; [key: string]: unknown; }; type WizardSelectOption = { value: T; label: string; hint?: string; }; type WizardPrompter = { note: (message: string, title?: string) => Promise; text: (params: { message: string; placeholder?: string; initialValue?: string; validate?: (value: string) => string | undefined; }) => Promise; confirm: (params: { message: string; initialValue?: boolean; }) => Promise; select: (params: { message: string; options: WizardSelectOption[]; initialValue?: T | string; }) => Promise; }; type ChannelOnboardingDmPolicy = { label: string; channel: string; policyKey: string; allowFromKey: string; getCurrent: (cfg: ClawdbotConfig) => DmPolicy; setPolicy: (cfg: ClawdbotConfig, policy: DmPolicy) => ClawdbotConfig; promptAllowFrom: (params: { cfg: ClawdbotConfig; prompter: WizardPrompter; }) => Promise; }; type ChannelOnboardingAdapter = { channel: string; getStatus: (params: { cfg: ClawdbotConfig; }) => Promise<{ channel: string; configured: boolean; statusLines: string[]; selectionHint?: string; quickstartScore?: number; }>; configure: (params: { cfg: ClawdbotConfig; prompter: WizardPrompter; }) => Promise<{ cfg: ClawdbotConfig; accountId?: string; }>; dmPolicy?: ChannelOnboardingDmPolicy; disable?: (cfg: ClawdbotConfig) => ClawdbotConfig; }; type OpenClawConfig = { channels?: Record | undefined>; bindings?: Array<{ agentId?: string; match?: { channel?: string; peer?: { kind?: string; id?: string; }; }; }>; agents?: { list?: Array<{ id: string; workspace?: string; agentDir?: string; [key: string]: unknown; }>; [key: string]: unknown; }; broadcast?: Record; secrets?: { defaults?: { env?: string; file?: string; exec?: string; }; providers?: Record; [key: string]: unknown; }; [key: string]: unknown; }; type ClawdbotConfig = OpenClawConfig; //#endregion export { AnyAgentTool, BaseProbeResult, ChannelMeta, ChannelOnboardingAdapter, ChannelOnboardingDmPolicy, ChannelPlugin, ClawdbotConfig, DmPolicy, OpenClawConfig, OpenClawPluginApi, PluginRuntime, RuntimeEnv, WizardPrompter };