MCPcopy Create free account

hub / github.com/WecomTeam/wecom-openclaw-plugin / functions

Functions367 in github.com/WecomTeam/wecom-openclaw-plugin

↓ 1 callersFunctiongetOrCreateSession
* 获取或创建指定 URL 的 MCP 会话 * * - 已确认无状态的 category:直接返回空 session,跳过握手 * - 已有可用有状态会话:直接返回缓存 * - 其他情况:执行 initialize 握手,并发请求会被合并
src/mcp/transport.ts:498
↓ 1 callersFunctiongetProxyDispatcher
* **getProxyDispatcher (获取代理 Dispatcher)** * * 缓存并复用 ProxyAgent,避免重复创建连接池。
src/http.ts:13
↓ 1 callersFunctiongetProxyDispatcher
* **getProxyDispatcher (获取代理 Dispatcher)** * * 缓存并复用 ProxyAgent,避免重复创建连接池。
src/webhook/http.ts:10
↓ 1 callersFunctiongetRegisteredTargets
()
src/webhook/target.ts:102
↓ 1 callersFunctiongetSessionChatInfo
(sessionKey: string | undefined)
src/state-manager.ts:313
↓ 1 callersFunctiongetSharedState
* 获取或创建全局共享状态(进程内单例)
src/state-manager.ts:47
↓ 1 callersMethodgetSync
同步获取 chatId 对应的 reqId(仅内存)
src/reqid-store.ts:38
↓ 1 callersFunctiongetTemplateCardFromCache
(accountId: string, taskId: string)
src/template-card-manager.ts:82
↓ 1 callersMethodgetUrl
* **getUrl (获取回复地址)** * * 获取指定 streamId 关联的 response_url。
src/webhook/state.ts:439
↓ 1 callersFunctiongetWebhookTargetsMap
()
src/webhook/target.ts:93
↓ 1 callersFunctionguessExtensionFromContentType
从 Content-Type 反推扩展名
src/webhook/helpers.ts:543
↓ 1 callersFunctionguessUploadContentType
(filename: string)
src/agent/api-client.ts:47
↓ 1 callersFunctionhandleAgentWebhook
(params: AgentWebhookParams)
src/agent/handler.ts:659
↓ 1 callersFunctionhandleCall
(ctx: CallContext)
src/mcp/tool.ts:107
↓ 1 callersFunctionhandleEnterChat
( target: WecomWebhookTarget, message: WebhookInboundMessage, )
src/webhook/monitor.ts:220
↓ 1 callersFunctionhandleInboundMessage
( target: WecomWebhookTarget, message: WebhookInboundMessage, timestamp: string, nonce: string, prox
src/webhook/monitor.ts:60
↓ 1 callersFunctionhandleList
(ctx: CallContext)
src/mcp/tool.ts:79
↓ 1 callersFunctionhandleMessageCallback
* 处理消息回调 (POST)
src/agent/handler.ts:200
↓ 1 callersFunctionhandleStreamRefresh
( target: WecomWebhookTarget, message: WebhookInboundMessage, )
src/webhook/monitor.ts:182
↓ 1 callersFunctionhandleTemplateCardEvent
( target: WecomWebhookTarget, message: WebhookInboundMessage, timestamp: string, nonce: string, prox
src/webhook/monitor.ts:257
↓ 1 callersFunctionhandleWecomAgentWebhookRequest
( req: IncomingMessage, res: ServerResponse, runtime: PluginRuntime, )
src/agent/webhook.ts:130
↓ 1 callersFunctionhasLikelyExtension
检查文件名是否有常见扩展名
src/webhook/helpers.ts:514
↓ 1 callersFunctionhasMedia
(message: WebhookInboundMessage)
src/webhook/helpers.ts:830
↓ 1 callersFunctioninterceptDocAuthError
* 拦截文档授权错误 * * 检测 errcode=851013/851014/851008 时: * 1. 通过 aibot_send_biz_msg 发送授权引导卡片(携带 chat_id、userid、chat_type) * 2. 返回简化响应,告知 LLM 授权卡片已直接发送给用户
src/mcp/interceptors/doc-auth-error.ts:180
↓ 1 callersFunctioninterceptExportResponse
* 拦截 smartpage_get_export_result 的 MCP 响应 * * 1. 从 MCP result 的 content[].text 中提取业务 JSON * 2. 检测 task_done=true 且存在 content 字段 * 3. 将 content(mar
src/mcp/interceptors/smartpage-export.ts:48
↓ 1 callersFunctioninterceptMediaResponse
* 拦截 get_msg_media 的 MCP 响应 * * 1. 从 MCP result 的 content[].text 中提取业务 JSON * 2. 提取 media_item.base64_data,解码为 Buffer * 3. 通过 openclaw SDK 的 saveM
src/mcp/interceptors/msg-media.ts:53
↓ 1 callersFunctionisGenericContentType
(raw?: string | null)
src/webhook/helpers.ts:531
↓ 1 callersFunctionisGroupSenderAllowed
* 检查群组内发送者是否在允许列表中
src/group-policy.ts:86
↓ 1 callersFunctionisImageBuffer
* 检查 Buffer 是否为有效的图片格式
src/media-handler.ts:57
↓ 1 callersFunctionisSenderAllowed
(senderId: string, allowFrom: string[])
src/group-policy.ts:169
↓ 1 callersFunctionisWeComGroupAllowed
* 检查群组是否在允许列表中
src/group-policy.ts:58
↓ 1 callersFunctionisWecomSenderAllowed
(senderUserId: string, allowFrom: string[])
src/shared/command-auth.ts:16
↓ 1 callersFunctionisWecomSenderAllowed
判断发送者是否在白名单中
src/webhook/command-auth.ts:26
↓ 1 callersFunctionloadOutboundMediaFromUrl
( mediaUrl: string, options: OutboundMediaLoadOptions = {}, )
src/openclaw-compat.ts:369
↓ 1 callersFunctionloadOutboundMediaFromUrlFallback
fallback 版 loadOutboundMediaFromUrl,参考 weclaw/src/web/media.ts
src/openclaw-compat.ts:293
↓ 1 callersFunctionlooksLikeTextFile
(buffer: Buffer)
src/agent/handler.ts:52
↓ 1 callersFunctionmaskTemplateCardBlocks
(text: string, log?: (...args: any[]) => void)
src/template-card-parser.ts:696
↓ 1 callersFunctionmergeAbortSignal
(params: { signal?: AbortSignal; timeoutMs?: number; })
src/http.ts:21
↓ 1 callersFunctionmergeAbortSignal
(params: { signal?: AbortSignal; timeoutMs?: number; })
src/webhook/http.ts:18
↓ 1 callersFunctionmergeWeComAccountConfig
* 合并顶层配置与账号级配置(账号级覆盖顶层)。 * * 顶层字段(如 dmPolicy、allowFrom)作为所有账号的默认值, * accounts.xxx 中的字段会覆盖顶层的同名字段。 * 对于 groups 等嵌套 Record 对象,使用深层合并(账号级条目覆盖同 key,但不
src/accounts.ts:95
↓ 1 callersFunctionmimeToExtension
* MIME 类型转文件扩展名
src/media-uploader.ts:278
↓ 1 callersFunctionmonitorWeComProvider
(options: WeComMonitorOptions)
src/monitor.ts:929
↓ 1 callersFunctionnormalizeAgentId
(value: unknown)
src/agent/handler.ts:179
↓ 1 callersFunctionnormalizeAgentIdValue
(value: unknown)
src/agent/webhook.ts:113
↓ 1 callersFunctionnormalizeMime
归一化 MIME 类型
src/webhook/media.ts:84
↓ 1 callersFunctionnormalizeRequestPath
* 标准化 Webhook 路径(不含 query string)
src/webhook/handler.ts:193
↓ 1 callersFunctionnormalizeTemplateCardFields
* 对 LLM 生成的模板卡片 JSON 做字段类型修正,确保符合企业微信 API 的类型要求。 * * 修正范围: * - checkbox.mode: uint32(0=单选,1=多选) * - checkbox.disable: bool * - checkbox.option_li
src/template-card-parser.ts:102
↓ 1 callersFunctionnormalizeUploadFilename
(filename: string)
src/agent/api-client.ts:31
↓ 1 callersFunctionnormalizeWebhookPath
(raw: string)
src/agent/webhook.ts:61
↓ 1 callersFunctionparseArgs
(args: string | Record<string, unknown> | undefined)
src/mcp/tool.ts:174
↓ 1 callersFunctionparseBizData
* 从 MCP 返回结果中解析业务 JSON
src/mcp/interceptors/doc-auth-error.ts:62
↓ 1 callersFunctionparseMessageContent
(body: MessageBody)
src/message-parser.ts:222
↓ 1 callersFunctionparseQuery
解析 URL 查询参数
src/webhook/handler.ts:34
↓ 1 callersFunctionparseSseResponse
* 解析 SSE 流式响应,提取最终的 JSON-RPC result * * 按照 SSE 规范,同一事件中的多个 `data:` 行会用换行符拼接。 * 空行分隔不同事件,取最后一个完整事件的数据。
src/mcp/transport.ts:537
↓ 1 callersFunctionparseWebhookPath
(url: string)
src/webhook/target.ts:131
↓ 1 callersFunctionparseXml
(xml: string)
src/shared/xml-parser.ts:20
↓ 1 callersFunctionpreviewHex
(buffer: Buffer, maxBytes = 32)
src/agent/handler.ts:79
↓ 1 callersFunctionprocessAgentMessage
* **processAgentMessage (处理 Agent 消息)** * * 异步处理解密后的消息内容,并触发 OpenClaw Agent。 * 流程: * 1. 路由解析:根据 userid或群ID 确定 Agent 路由。 * 2. 媒体处理:如果是图片/文件等,下载资源。
src/agent/handler.ts:313
↓ 1 callersFunctionprocessInboundMessage
( target: WecomWebhookTarget, msg: WebhookInboundMessage, )
src/webhook/helpers.ts:274
↓ 1 callersFunctionpruneMemory
* 内存容量控制:淘汰最旧的条目。 * 利用 Map 的插入顺序 + touch(先 delete 再 set) 实现类 LRU 效果。
src/reqid-store.ts:72
↓ 1 callersFunctionpruneMessageStates
* 清理过期和超量的消息状态条目
src/state-manager.ts:128
↓ 1 callersFunctionpushFinalStreamReplyNow
* 通过 response_url 推送最终流帧(对齐 lh 版 pushFinalStreamReplyNow) * * 对齐 lh 版:从 StreamState 构建完整响应,直接 POST JSON,不加密。
src/webhook/monitor.ts:1272
↓ 1 callersFunctionreadBody
* 读取 HTTP 请求 body(带大小限制保护) * * 超过 maxBytes 时会主动销毁请求并拒绝,防止大包攻击。
src/webhook/handler.ts:120
↓ 1 callersFunctionreadTextBody
( req: IncomingMessage, maxBytes: number, )
src/agent/webhook.ts:88
↓ 1 callersFunctionrebuildSession
* 合并并发的 session 重建请求 * * 与 getOrCreateSession 类似,使用 inflightInitRequests 防止 * 多个并发请求同时遇到 404 时重复执行 initialize 握手。
src/mcp/transport.ts:739
↓ 1 callersFunctionregisterAgentWebhookTarget
(target: AgentWebhookTarget)
src/agent/webhook.ts:40
↓ 1 callersFunctionregisterTargetForPath
* 注册 Webhook Target(单条路径) * * 将 Target 加入指定路径的列表中,返回注销函数。
src/webhook/target.ts:53
↓ 1 callersFunctionregisterWecomWebhookTarget
( target: WecomWebhookTarget, paths: string[], )
src/webhook/target.ts:71
↓ 1 callersFunctionrememberAgentMsgId
(msgId: string)
src/agent/handler.ts:40
↓ 1 callersFunctionresolveBeforeCall
(ctx: CallContext)
src/mcp/interceptors/index.ts:57
↓ 1 callersFunctionresolveBotIdentitySet
* 从 Target 配置中提取预期的 Bot Identity 集合 * * 用于 aibotid 校验:即使签名匹配,也要确认消息来自预期的 Bot。 * * 配置来源(对齐用户 YAML 配置): * - 单账号模式:channels.wecom.botId * - 多账号模式:c
src/webhook/handler.ts:101
↓ 1 callersFunctionresolveBotRegistrationPaths
* 解析 Bot Target 注册路径 * * 多账号场景(matrixMode)下:注册带 accountId 后缀的路径 + 兼容老路径 * 单账号场景下:只注册基础路径 * * 参考 lh 版 resolveBotRegistrationPaths
src/webhook/gateway.ts:53
↓ 1 callersFunctionresolveMcpAccountId
* 解析用于 MCP 调用的账户 ID * * 优先级: * 1. 默认账户(如果是长连接机器人) * 2. 第一个长连接机器人账户 * 3. 无可用账户时返回 null
src/mcp/transport.ts:192
↓ 1 callersFunctionresolvePages
异步解析 pages 中的 page_filepath,返回 BeforeCallOptions
src/mcp/interceptors/smartpage-create.ts:96
↓ 1 callersFunctionresolvePath
(req: IncomingMessage)
src/agent/webhook.ts:69
↓ 1 callersFunctionresolveQueryParams
* **resolveQueryParams (解析查询参数)** * * 辅助函数:从 IncomingMessage 中解析 URL 查询字符串,用于获取签名、时间戳等参数。
src/agent/handler.ts:192
↓ 1 callersFunctionresolveQueryParams
(req: IncomingMessage)
src/agent/webhook.ts:74
↓ 1 callersFunctionresolveSignatureParam
(params: URLSearchParams)
src/agent/webhook.ts:79
↓ 1 callersFunctionresolveUploads
* 执行文件校验和并行上传,返回替换后的 args
src/mcp/interceptors/smartsheet-upload.ts:331
↓ 1 callersFunctionresolveUserPath
展开 ~ 为用户主目录
src/openclaw-compat.ts:285
↓ 1 callersFunctionresolveWeComGroupConfig
* 解析企业微信群组配置
src/group-policy.ts:31
↓ 1 callersFunctionresolveWecomCommandAuthorization
(params: { core: PluginRuntime; cfg: OpenClawConfig; accountConfig: WecomCommandAuthAccountConfig; raw
src/shared/command-auth.ts:24
↓ 1 callersFunctionresolveWecomCommandAuthorization
(params: { core: PluginRuntime; cfg: OpenClawConfig; accountConfig: WeComConfig; rawBody: string; se
src/webhook/command-auth.ts:61
↓ 1 callersFunctionresolveWecomMediaMaxBytes
(config: OpenClawConfig)
src/agent/handler.ts:28
↓ 1 callersFunctionrouteAndDispatchMessage
* 路由消息到核心处理流程并处理回复
src/monitor.ts:492
↓ 1 callersFunctionrunAfterCall
(ctx: CallContext, result: unknown)
src/mcp/interceptors/index.ts:87
↓ 1 callersFunctionsendBizMsg
* 通过 WSClient 发送 aibot_send_biz_msg 命令 * * 按照 WwOpenWsSendAiBotBizMsgReq proto 定义构造请求体: * - chat_id: 会话标识 * - userid: 发送者 userid * - b
src/mcp/interceptors/doc-auth-error.ts:101
↓ 1 callersFunctionsendMediaBatch
* 上传并发送一批媒体文件(统一走主动发送通道) * * replyMedia(被动回复)无法覆盖 replyStream 发出的 thinking 流式消息, * 因此所有媒体统一走 aibot_send_msg 主动发送。
src/monitor.ts:371
↓ 1 callersFunctionsendTemplateCards
(params: { wsClient: WSClient; frame: WsFrame; state: MessageState; account: ResolvedWeComAccount; r
src/template-card-manager.ts:213
↓ 1 callersFunctionsendThinkingReply
* 发送"思考中"消息
src/monitor.ts:336
↓ 1 callersFunctionsetMessageState
(messageId: string, state: MessageState)
src/state-manager.ts:151
↓ 1 callersFunctionsetReqIdForChat
(chatId: string, reqId: string, accountId = "default")
src/state-manager.ts:213
↓ 1 callersFunctionsetSessionChatInfo
(sessionKey: string, info: SessionChatInfo)
src/state-manager.ts:296
↓ 1 callersMethodsetStreamIdForMsgId
手动设置 msgid → streamId 映射
src/webhook/state.ts:112
↓ 1 callersFunctionsetWeComDmPolicy
* 设置企业微信 dmPolicy
src/onboarding.ts:47
↓ 1 callersFunctionsetWeComWebSocket
(accountId: string, client: WSClient)
src/state-manager.ts:82
↓ 1 callersFunctionshouldProcessAgentInboundMessage
(params: { msgType: string; fromUser: string; eventType?: string; })
src/agent/handler.ts:142
↓ 1 callersFunctionshouldProcessBotInboundMessage
* 判断入站消息是否应该被处理(对齐原版 shouldProcessBotInboundMessage) * * 仅允许"真实用户消息"进入 Bot 会话: * - 发送者缺失 → 丢弃(避免 unknown 会话串会话) * - 发送者是 sys → 丢弃(避免系统回调触发 AI 自动回复
src/webhook/handler.ts:64
↓ 1 callersFunctionshouldUseDynamicAgent
(params: { chatType: "dm" | "group"; senderId: string; config: OpenClawConfig; })
src/dynamic-agent.ts:57
↓ 1 callersFunctionsniffMimeFromBuffer
通过 buffer 魔术字节嗅探 MIME 类型(动态导入 file-type,不强依赖)
src/openclaw-compat.ts:137
← previousnext →201–300 of 367, ranked by callers