openclaw
Version:
Multi-channel AI gateway with extensible messaging integrations
40 lines (39 loc) • 1.84 kB
TypeScript
import type { OpenClawConfig } from "../../../config/config.js";
import type { OutboundSendDeps } from "../../../infra/outbound/deliver.js";
import type { ChannelOutboundAdapter } from "../types.js";
type DirectSendOptions = {
cfg: OpenClawConfig;
accountId?: string | null;
replyToId?: string | null;
mediaUrl?: string;
mediaLocalRoots?: readonly string[];
maxBytes?: number;
};
type DirectSendResult = {
messageId: string;
[key: string]: unknown;
};
type DirectSendFn<TOpts extends Record<string, unknown>, TResult extends DirectSendResult> = (to: string, text: string, opts: TOpts) => Promise<TResult>;
export { resolvePayloadMediaUrls, sendPayloadMediaSequence, sendPayloadMediaSequenceAndFinalize, sendPayloadMediaSequenceOrFallback, sendTextMediaPayload, } from "openclaw/plugin-sdk/reply-payload";
export declare function resolveScopedChannelMediaMaxBytes(params: {
cfg: OpenClawConfig;
accountId?: string | null;
resolveChannelLimitMb: (params: {
cfg: OpenClawConfig;
accountId: string;
}) => number | undefined;
}): number | undefined;
export declare function createScopedChannelMediaMaxBytesResolver(channel: "imessage" | "signal"): (params: {
cfg: OpenClawConfig;
accountId?: string | null;
}) => number | undefined;
export declare function createDirectTextMediaOutbound<TOpts extends Record<string, unknown>, TResult extends DirectSendResult>(params: {
channel: "imessage" | "signal";
resolveSender: (deps: OutboundSendDeps | undefined) => DirectSendFn<TOpts, TResult>;
resolveMaxBytes: (params: {
cfg: OpenClawConfig;
accountId?: string | null;
}) => number | undefined;
buildTextOptions: (params: DirectSendOptions) => TOpts;
buildMediaOptions: (params: DirectSendOptions) => TOpts;
}): ChannelOutboundAdapter;