import { E as ChannelOutboundSessionRoute, L as ChannelThreadingAdapter, T as ChannelMeta, k as ChannelPollResult, w as ChannelMessagingAdapter } from "./types.core-CuC3Nb15.js"; import { i as OpenClawConfig } from "./types.openclaw-CpnoYlBx.js"; import { T as ReplyToMode } from "./types.base-CrXPFJf5.js"; import { t as ChatChannelId } from "./ids-BUiVO67E.js"; import { n as ChannelConfigSchema } from "./types.config-D1pSqbn8.js"; import { V as ChannelSecurityAdapter } from "./types.adapters-BFws9krA.js"; import { b as OutboundDeliveryResult, n as ChannelOutboundAdapter } from "./outbound.types-CfSE45o1.js"; import { t as ChannelPairingAdapter } from "./pairing.types-BXdVg_20.js"; import { t as ChannelPlugin } from "./types.plugin-oQrs9-Gb.js"; import { n as ResolvedConfiguredAcpBinding } from "./persistent-bindings.resolve-W9H5aNqm.js"; import { $n as PluginRuntime, C as OpenClawPluginApi } from "./types-BftTUA7h.js"; //#region src/shared/gateway-bind-url.d.ts type GatewayBindUrlResult = { url: string; source: "gateway.bind=custom" | "gateway.bind=tailnet" | "gateway.bind=lan"; } | { error: string; } | null; /** Resolves the externally advertised gateway URL for non-loopback bind modes. */ declare function resolveGatewayBindUrl(params: { bind?: string; customBindHost?: string; scheme: "ws" | "wss"; port: number; pickTailnetHost: () => string | null; pickLanHost: () => string | null; }): GatewayBindUrlResult; //#endregion //#region src/shared/tailscale-status.d.ts type TailscaleStatusCommandResult = { code: number | null; stdout: string; }; type TailscaleStatusCommandRunner = (argv: string[], opts: { timeoutMs: number; }) => Promise; /** Runs known Tailscale status commands and returns the first DNS name or tailnet IP found. */ declare function resolveTailnetHostWithRunner(runCommandWithTimeout?: TailscaleStatusCommandRunner): Promise; //#endregion //#region src/plugin-sdk/core.d.ts /** Ensure a configured ACP binding has live runtime state before channel delivery uses it. */ declare function ensureConfiguredAcpBindingReady(params: { cfg: OpenClawConfig; configuredBinding: ResolvedConfiguredAcpBinding | null; }): Promise<{ ok: true; } | { ok: false; error: string; }>; /** Params passed to a channel adapter when resolving outbound session routing. */ type ChannelOutboundSessionRouteParams = Parameters>[0]; /** Resolve bundled chat channel metadata while respecting the active bundled-plugin directory. */ declare function getChatChannelMeta(id: ChatChannelId): ChannelMeta; /** Remove one of the known provider prefixes from a free-form target string. */ declare function stripChannelTargetPrefix(raw: string, ...providers: string[]): string; /** Remove generic target-kind prefixes such as `user:` or `group:`. */ declare function stripTargetKindPrefix(raw: string): string; /** * Build the canonical outbound session route payload returned by channel * message adapters. */ declare function buildChannelOutboundSessionRoute(params: { cfg: OpenClawConfig; agentId: string; channel: string; accountId?: string | null; peer: { kind: "direct" | "group" | "channel"; id: string; }; chatType: "direct" | "group" | "channel"; from: string; to: string; threadId?: string | number; }): ChannelOutboundSessionRoute; /** Candidate source used when choosing a thread id for outbound session routing. */ type ThreadAwareOutboundSessionRouteThreadSource = "replyToId" | "threadId" | "currentSession"; /** Recovery context passed before reusing the current session thread id. */ type ThreadAwareOutboundSessionRouteRecoveryContext = { route: ChannelOutboundSessionRoute; currentBaseSessionKey: string; currentThreadId: string; }; /** Recover the current thread id when the current session belongs to the same base route. */ declare function recoverCurrentThreadSessionId(params: { route: ChannelOutboundSessionRoute; currentSessionKey?: string | null; canRecover?: (context: ThreadAwareOutboundSessionRouteRecoveryContext) => boolean; }): string | undefined; /** Add thread-aware session keys and route thread ids to an outbound channel route. */ declare function buildThreadAwareOutboundSessionRoute(params: { route: ChannelOutboundSessionRoute; replyToId?: string | number | null; threadId?: string | number | null; currentSessionKey?: string | null; precedence?: readonly ThreadAwareOutboundSessionRouteThreadSource[]; useSuffix?: boolean; parentSessionKey?: string; normalizeThreadId?: (threadId: string) => string; canRecoverCurrentThread?: (context: ThreadAwareOutboundSessionRouteRecoveryContext) => boolean; }): ChannelOutboundSessionRoute; /** Options for a channel plugin entry that should register a channel capability. */ type ChannelEntryConfigSchema = TPlugin extends ChannelPlugin ? NonNullable : ChannelConfigSchema; type DefineChannelPluginEntryOptions = { id: string; name: string; description: string; plugin: TPlugin; configSchema?: ChannelEntryConfigSchema | (() => ChannelEntryConfigSchema); setRuntime?: (runtime: PluginRuntime) => void; registerCliMetadata?: (api: OpenClawPluginApi) => void; registerFull?: (api: OpenClawPluginApi) => void; }; type DefinedChannelPluginEntry = { id: string; name: string; description: string; configSchema: ChannelEntryConfigSchema; register: (api: OpenClawPluginApi) => void; channelPlugin: TPlugin; setChannelRuntime?: (runtime: PluginRuntime) => void; }; type CreateChannelPluginBaseOptions = { id: ChannelPlugin["id"]; meta?: Partial["meta"]>>; setupWizard?: NonNullable["setupWizard"]>; capabilities?: ChannelPlugin["capabilities"]; commands?: ChannelPlugin["commands"]; doctor?: ChannelPlugin["doctor"]; agentPrompt?: ChannelPlugin["agentPrompt"]; streaming?: ChannelPlugin["streaming"]; reload?: ChannelPlugin["reload"]; gatewayMethods?: ChannelPlugin["gatewayMethods"]; gatewayMethodDescriptors?: ChannelPlugin["gatewayMethodDescriptors"]; configSchema?: ChannelPlugin["configSchema"]; config?: ChannelPlugin["config"]; security?: ChannelPlugin["security"]; setup: NonNullable["setup"]>; groups?: ChannelPlugin["groups"]; }; type CreatedChannelPluginBase = Pick, "id" | "meta" | "setup"> & Partial, "setupWizard" | "capabilities" | "commands" | "doctor" | "agentPrompt" | "streaming" | "reload" | "gatewayMethods" | "gatewayMethodDescriptors" | "configSchema" | "config" | "security" | "groups">>; /** * Canonical entry helper for channel plugins. * * This wraps `definePluginEntry(...)`, registers the channel capability, and * optionally exposes extra full-runtime registration such as tools or gateway * handlers that only make sense outside setup-only registration modes. */ declare function defineChannelPluginEntry({ id, name, description, plugin, configSchema, setRuntime, registerCliMetadata, registerFull }: DefineChannelPluginEntryOptions): DefinedChannelPluginEntry; /** * Minimal setup-entry helper for channels that ship a separate `setup-entry.ts`. * * The setup entry only needs to export `{ plugin }`, but using this helper * keeps the shape explicit in examples and generated typings. */ declare function defineSetupPluginEntry(plugin: TPlugin): { plugin: TPlugin; }; type ChatChannelPluginBase = Omit, "security" | "pairing" | "threading" | "outbound"> & Partial, "security" | "pairing" | "threading" | "outbound">>; type ChatChannelSecurityOptions = { dm: { channelKey: string; resolvePolicy: (account: TResolvedAccount) => string | null | undefined; resolveAllowFrom: (account: TResolvedAccount) => Array | null | undefined; resolveFallbackAccountId?: (account: TResolvedAccount) => string | null | undefined; defaultPolicy?: string; allowFromPathSuffix?: string; policyPathSuffix?: string; approveChannelId?: string; approveHint?: string; normalizeEntry?: (raw: string) => string; inheritSharedDefaultsFromDefaultAccount?: boolean; }; collectWarnings?: ChannelSecurityAdapter["collectWarnings"]; collectAuditFindings?: ChannelSecurityAdapter["collectAuditFindings"]; }; type ChatChannelPairingOptions = { text: { idLabel: string; message: string; normalizeAllowEntry?: ChannelPairingAdapter["normalizeAllowEntry"]; notify: (params: Parameters>[0] & { message: string; }) => Promise | void; }; }; type ChatChannelThreadingReplyModeOptions = { topLevelReplyToMode: string; } | { scopedAccountReplyToMode: { resolveAccount: (cfg: OpenClawConfig, accountId?: string | null) => TResolvedAccount; resolveReplyToMode: (account: TResolvedAccount, chatType?: string | null) => ReplyToMode | null | undefined; fallback?: ReplyToMode; }; } | { resolveReplyToMode: NonNullable; }; type ChatChannelThreadingOptions = ChatChannelThreadingReplyModeOptions & Omit; type ChatChannelAttachedOutboundOptions = { base: Omit; attachedResults: { channel: string; sendText?: (ctx: Parameters>[0]) => MaybePromise>; sendMedia?: (ctx: Parameters>[0]) => MaybePromise>; sendPoll?: (ctx: Parameters>[0]) => MaybePromise>; }; }; type MaybePromise = T | Promise; /** * Build a chat-style channel plugin by composing common security, pairing, * threading, and outbound adapters around a channel-specific base. */ declare function createChatChannelPlugin(params: { base: ChatChannelPluginBase; security?: ChannelSecurityAdapter | ChatChannelSecurityOptions; pairing?: ChannelPairingAdapter | ChatChannelPairingOptions; threading?: ChannelThreadingAdapter | ChatChannelThreadingOptions; outbound?: ChannelOutboundAdapter | ChatChannelAttachedOutboundOptions; }): ChannelPlugin; /** Create the shared base object for channel plugins that override only selected surfaces. */ declare function createChannelPluginBase(params: CreateChannelPluginBaseOptions): CreatedChannelPluginBase; //#endregion export { resolveTailnetHostWithRunner as _, buildThreadAwareOutboundSessionRoute as a, defineChannelPluginEntry as c, getChatChannelMeta as d, recoverCurrentThreadSessionId as f, TailscaleStatusCommandRunner as g, TailscaleStatusCommandResult as h, buildChannelOutboundSessionRoute as i, defineSetupPluginEntry as l, stripTargetKindPrefix as m, ThreadAwareOutboundSessionRouteRecoveryContext as n, createChannelPluginBase as o, stripChannelTargetPrefix as p, ThreadAwareOutboundSessionRouteThreadSource as r, createChatChannelPlugin as s, ChannelOutboundSessionRouteParams as t, ensureConfiguredAcpBindingReady as u, GatewayBindUrlResult as v, resolveGatewayBindUrl as y };