/** * 入站消息处理 — 统一的 ctx 构建和媒体文本拼接 * * 消除 server.ts 和 relay/client.ts 中的重复实现。 */ import type { ChatRequest } from "../types.js"; /** 清理 session ID 中的特殊字符,防止 sessionKey 碰撞 */ export declare function sanitizeSession(session: string): string; /** * 将媒体附件拼成文本(与 DingTalk 一致的格式) * * 纯文本模式:不处理 base64 存储,直接以 URL/data URI 原样拼入。 * server.ts 中有额外的 base64 → mediaStore 逻辑,在调用此函数前单独处理。 */ export declare function processInboundMediaText(body: ChatRequest): string; /** * 构建 OpenClaw inbound ctx(大写字段格式) * * @param fullMessage - 已拼接媒体文本的完整消息(由调用方负责拼接) * @param body - 原始请求体(用于提取 from/chatType) * @param session - 会话 ID * @param accountId - 账号 ID */ export declare function buildInboundCtx(fullMessage: string, body: ChatRequest, session: string, accountId: string): { ModelRouting?: Record | undefined; StreamRequested?: boolean | undefined; SystemPrompt?: string | undefined; MaxContextMessages?: number | undefined; MaxTokens?: number | undefined; TopP?: number | undefined; Temperature?: number | undefined; ModelBaseUrl?: string | undefined; ModelApi?: string | undefined; Model?: string | undefined; ModelProvider?: string | undefined; TeamTaskId?: string | undefined; teamTaskId?: string | undefined; TeamRunId?: string | undefined; teamRunId?: string | undefined; Body: string; RawBody: string; CommandBody: string; BodyForAgent: string; BodyForCommands: string; From: string; To: string; SessionKey: string; sessionKey: string; AccountId: string; accountId: string; AgentId: string | undefined; agentId: string | undefined; Agent: string | undefined; MessageSid: `${string}-${string}-${string}-${string}-${string}`; ChatType: "direct" | "group"; SenderName: string; SenderId: string; CommandAuthorized: boolean; Provider: string; Surface: string; OriginatingChannel: string; OriginatingTo: string; Timestamp: number; }; //# sourceMappingURL=inbound.d.ts.map