Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/WecomTeam/wecom-openclaw-plugin
/ functions
Functions
367 in github.com/WecomTeam/wecom-openclaw-plugin
⨍
Functions
367
◇
Types & classes
81
↓ 1 callers
Function
getOrCreateSession
* 获取或创建指定 URL 的 MCP 会话 * * - 已确认无状态的 category:直接返回空 session,跳过握手 * - 已有可用有状态会话:直接返回缓存 * - 其他情况:执行 initialize 握手,并发请求会被合并
src/mcp/transport.ts:498
↓ 1 callers
Function
getProxyDispatcher
* **getProxyDispatcher (获取代理 Dispatcher)** * * 缓存并复用 ProxyAgent,避免重复创建连接池。
src/http.ts:13
↓ 1 callers
Function
getProxyDispatcher
* **getProxyDispatcher (获取代理 Dispatcher)** * * 缓存并复用 ProxyAgent,避免重复创建连接池。
src/webhook/http.ts:10
↓ 1 callers
Function
getRegisteredTargets
()
src/webhook/target.ts:102
↓ 1 callers
Function
getSessionChatInfo
(sessionKey: string | undefined)
src/state-manager.ts:313
↓ 1 callers
Function
getSharedState
* 获取或创建全局共享状态(进程内单例)
src/state-manager.ts:47
↓ 1 callers
Method
getSync
同步获取 chatId 对应的 reqId(仅内存)
src/reqid-store.ts:38
↓ 1 callers
Function
getTemplateCardFromCache
(accountId: string, taskId: string)
src/template-card-manager.ts:82
↓ 1 callers
Method
getUrl
* **getUrl (获取回复地址)** * * 获取指定 streamId 关联的 response_url。
src/webhook/state.ts:439
↓ 1 callers
Function
getWebhookTargetsMap
()
src/webhook/target.ts:93
↓ 1 callers
Function
guessExtensionFromContentType
从 Content-Type 反推扩展名
src/webhook/helpers.ts:543
↓ 1 callers
Function
guessUploadContentType
(filename: string)
src/agent/api-client.ts:47
↓ 1 callers
Function
handleAgentWebhook
(params: AgentWebhookParams)
src/agent/handler.ts:659
↓ 1 callers
Function
handleCall
(ctx: CallContext)
src/mcp/tool.ts:107
↓ 1 callers
Function
handleEnterChat
( target: WecomWebhookTarget, message: WebhookInboundMessage, )
src/webhook/monitor.ts:220
↓ 1 callers
Function
handleInboundMessage
( target: WecomWebhookTarget, message: WebhookInboundMessage, timestamp: string, nonce: string, prox
src/webhook/monitor.ts:60
↓ 1 callers
Function
handleList
(ctx: CallContext)
src/mcp/tool.ts:79
↓ 1 callers
Function
handleMessageCallback
* 处理消息回调 (POST)
src/agent/handler.ts:200
↓ 1 callers
Function
handleStreamRefresh
( target: WecomWebhookTarget, message: WebhookInboundMessage, )
src/webhook/monitor.ts:182
↓ 1 callers
Function
handleTemplateCardEvent
( target: WecomWebhookTarget, message: WebhookInboundMessage, timestamp: string, nonce: string, prox
src/webhook/monitor.ts:257
↓ 1 callers
Function
handleWecomAgentWebhookRequest
( req: IncomingMessage, res: ServerResponse, runtime: PluginRuntime, )
src/agent/webhook.ts:130
↓ 1 callers
Function
hasLikelyExtension
检查文件名是否有常见扩展名
src/webhook/helpers.ts:514
↓ 1 callers
Function
hasMedia
(message: WebhookInboundMessage)
src/webhook/helpers.ts:830
↓ 1 callers
Function
interceptDocAuthError
* 拦截文档授权错误 * * 检测 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 callers
Function
interceptExportResponse
* 拦截 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 callers
Function
interceptMediaResponse
* 拦截 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 callers
Function
isGenericContentType
(raw?: string | null)
src/webhook/helpers.ts:531
↓ 1 callers
Function
isGroupSenderAllowed
* 检查群组内发送者是否在允许列表中
src/group-policy.ts:86
↓ 1 callers
Function
isImageBuffer
* 检查 Buffer 是否为有效的图片格式
src/media-handler.ts:57
↓ 1 callers
Function
isSenderAllowed
(senderId: string, allowFrom: string[])
src/group-policy.ts:169
↓ 1 callers
Function
isWeComGroupAllowed
* 检查群组是否在允许列表中
src/group-policy.ts:58
↓ 1 callers
Function
isWecomSenderAllowed
(senderUserId: string, allowFrom: string[])
src/shared/command-auth.ts:16
↓ 1 callers
Function
isWecomSenderAllowed
判断发送者是否在白名单中
src/webhook/command-auth.ts:26
↓ 1 callers
Function
loadOutboundMediaFromUrl
( mediaUrl: string, options: OutboundMediaLoadOptions = {}, )
src/openclaw-compat.ts:369
↓ 1 callers
Function
loadOutboundMediaFromUrlFallback
fallback 版 loadOutboundMediaFromUrl,参考 weclaw/src/web/media.ts
src/openclaw-compat.ts:293
↓ 1 callers
Function
looksLikeTextFile
(buffer: Buffer)
src/agent/handler.ts:52
↓ 1 callers
Function
maskTemplateCardBlocks
(text: string, log?: (...args: any[]) => void)
src/template-card-parser.ts:696
↓ 1 callers
Function
mergeAbortSignal
(params: { signal?: AbortSignal; timeoutMs?: number; })
src/http.ts:21
↓ 1 callers
Function
mergeAbortSignal
(params: { signal?: AbortSignal; timeoutMs?: number; })
src/webhook/http.ts:18
↓ 1 callers
Function
mergeWeComAccountConfig
* 合并顶层配置与账号级配置(账号级覆盖顶层)。 * * 顶层字段(如 dmPolicy、allowFrom)作为所有账号的默认值, * accounts.xxx 中的字段会覆盖顶层的同名字段。 * 对于 groups 等嵌套 Record 对象,使用深层合并(账号级条目覆盖同 key,但不
src/accounts.ts:95
↓ 1 callers
Function
mimeToExtension
* MIME 类型转文件扩展名
src/media-uploader.ts:278
↓ 1 callers
Function
monitorWeComProvider
(options: WeComMonitorOptions)
src/monitor.ts:929
↓ 1 callers
Function
normalizeAgentId
(value: unknown)
src/agent/handler.ts:179
↓ 1 callers
Function
normalizeAgentIdValue
(value: unknown)
src/agent/webhook.ts:113
↓ 1 callers
Function
normalizeMime
归一化 MIME 类型
src/webhook/media.ts:84
↓ 1 callers
Function
normalizeRequestPath
* 标准化 Webhook 路径(不含 query string)
src/webhook/handler.ts:193
↓ 1 callers
Function
normalizeTemplateCardFields
* 对 LLM 生成的模板卡片 JSON 做字段类型修正,确保符合企业微信 API 的类型要求。 * * 修正范围: * - checkbox.mode: uint32(0=单选,1=多选) * - checkbox.disable: bool * - checkbox.option_li
src/template-card-parser.ts:102
↓ 1 callers
Function
normalizeUploadFilename
(filename: string)
src/agent/api-client.ts:31
↓ 1 callers
Function
normalizeWebhookPath
(raw: string)
src/agent/webhook.ts:61
↓ 1 callers
Function
parseArgs
(args: string | Record<string, unknown> | undefined)
src/mcp/tool.ts:174
↓ 1 callers
Function
parseBizData
* 从 MCP 返回结果中解析业务 JSON
src/mcp/interceptors/doc-auth-error.ts:62
↓ 1 callers
Function
parseMessageContent
(body: MessageBody)
src/message-parser.ts:222
↓ 1 callers
Function
parseQuery
解析 URL 查询参数
src/webhook/handler.ts:34
↓ 1 callers
Function
parseSseResponse
* 解析 SSE 流式响应,提取最终的 JSON-RPC result * * 按照 SSE 规范,同一事件中的多个 `data:` 行会用换行符拼接。 * 空行分隔不同事件,取最后一个完整事件的数据。
src/mcp/transport.ts:537
↓ 1 callers
Function
parseWebhookPath
(url: string)
src/webhook/target.ts:131
↓ 1 callers
Function
parseXml
(xml: string)
src/shared/xml-parser.ts:20
↓ 1 callers
Function
previewHex
(buffer: Buffer, maxBytes = 32)
src/agent/handler.ts:79
↓ 1 callers
Function
processAgentMessage
* **processAgentMessage (处理 Agent 消息)** * * 异步处理解密后的消息内容,并触发 OpenClaw Agent。 * 流程: * 1. 路由解析:根据 userid或群ID 确定 Agent 路由。 * 2. 媒体处理:如果是图片/文件等,下载资源。
src/agent/handler.ts:313
↓ 1 callers
Function
processInboundMessage
( target: WecomWebhookTarget, msg: WebhookInboundMessage, )
src/webhook/helpers.ts:274
↓ 1 callers
Function
pruneMemory
* 内存容量控制:淘汰最旧的条目。 * 利用 Map 的插入顺序 + touch(先 delete 再 set) 实现类 LRU 效果。
src/reqid-store.ts:72
↓ 1 callers
Function
pruneMessageStates
* 清理过期和超量的消息状态条目
src/state-manager.ts:128
↓ 1 callers
Function
pushFinalStreamReplyNow
* 通过 response_url 推送最终流帧(对齐 lh 版 pushFinalStreamReplyNow) * * 对齐 lh 版:从 StreamState 构建完整响应,直接 POST JSON,不加密。
src/webhook/monitor.ts:1272
↓ 1 callers
Function
readBody
* 读取 HTTP 请求 body(带大小限制保护) * * 超过 maxBytes 时会主动销毁请求并拒绝,防止大包攻击。
src/webhook/handler.ts:120
↓ 1 callers
Function
readTextBody
( req: IncomingMessage, maxBytes: number, )
src/agent/webhook.ts:88
↓ 1 callers
Function
rebuildSession
* 合并并发的 session 重建请求 * * 与 getOrCreateSession 类似,使用 inflightInitRequests 防止 * 多个并发请求同时遇到 404 时重复执行 initialize 握手。
src/mcp/transport.ts:739
↓ 1 callers
Function
registerAgentWebhookTarget
(target: AgentWebhookTarget)
src/agent/webhook.ts:40
↓ 1 callers
Function
registerTargetForPath
* 注册 Webhook Target(单条路径) * * 将 Target 加入指定路径的列表中,返回注销函数。
src/webhook/target.ts:53
↓ 1 callers
Function
registerWecomWebhookTarget
( target: WecomWebhookTarget, paths: string[], )
src/webhook/target.ts:71
↓ 1 callers
Function
rememberAgentMsgId
(msgId: string)
src/agent/handler.ts:40
↓ 1 callers
Function
resolveBeforeCall
(ctx: CallContext)
src/mcp/interceptors/index.ts:57
↓ 1 callers
Function
resolveBotIdentitySet
* 从 Target 配置中提取预期的 Bot Identity 集合 * * 用于 aibotid 校验:即使签名匹配,也要确认消息来自预期的 Bot。 * * 配置来源(对齐用户 YAML 配置): * - 单账号模式:channels.wecom.botId * - 多账号模式:c
src/webhook/handler.ts:101
↓ 1 callers
Function
resolveBotRegistrationPaths
* 解析 Bot Target 注册路径 * * 多账号场景(matrixMode)下:注册带 accountId 后缀的路径 + 兼容老路径 * 单账号场景下:只注册基础路径 * * 参考 lh 版 resolveBotRegistrationPaths
src/webhook/gateway.ts:53
↓ 1 callers
Function
resolveMcpAccountId
* 解析用于 MCP 调用的账户 ID * * 优先级: * 1. 默认账户(如果是长连接机器人) * 2. 第一个长连接机器人账户 * 3. 无可用账户时返回 null
src/mcp/transport.ts:192
↓ 1 callers
Function
resolvePages
异步解析 pages 中的 page_filepath,返回 BeforeCallOptions
src/mcp/interceptors/smartpage-create.ts:96
↓ 1 callers
Function
resolvePath
(req: IncomingMessage)
src/agent/webhook.ts:69
↓ 1 callers
Function
resolveQueryParams
* **resolveQueryParams (解析查询参数)** * * 辅助函数:从 IncomingMessage 中解析 URL 查询字符串,用于获取签名、时间戳等参数。
src/agent/handler.ts:192
↓ 1 callers
Function
resolveQueryParams
(req: IncomingMessage)
src/agent/webhook.ts:74
↓ 1 callers
Function
resolveSignatureParam
(params: URLSearchParams)
src/agent/webhook.ts:79
↓ 1 callers
Function
resolveUploads
* 执行文件校验和并行上传,返回替换后的 args
src/mcp/interceptors/smartsheet-upload.ts:331
↓ 1 callers
Function
resolveUserPath
展开 ~ 为用户主目录
src/openclaw-compat.ts:285
↓ 1 callers
Function
resolveWeComGroupConfig
* 解析企业微信群组配置
src/group-policy.ts:31
↓ 1 callers
Function
resolveWecomCommandAuthorization
(params: { core: PluginRuntime; cfg: OpenClawConfig; accountConfig: WecomCommandAuthAccountConfig; raw
src/shared/command-auth.ts:24
↓ 1 callers
Function
resolveWecomCommandAuthorization
(params: { core: PluginRuntime; cfg: OpenClawConfig; accountConfig: WeComConfig; rawBody: string; se
src/webhook/command-auth.ts:61
↓ 1 callers
Function
resolveWecomMediaMaxBytes
(config: OpenClawConfig)
src/agent/handler.ts:28
↓ 1 callers
Function
routeAndDispatchMessage
* 路由消息到核心处理流程并处理回复
src/monitor.ts:492
↓ 1 callers
Function
runAfterCall
(ctx: CallContext, result: unknown)
src/mcp/interceptors/index.ts:87
↓ 1 callers
Function
sendBizMsg
* 通过 WSClient 发送 aibot_send_biz_msg 命令 * * 按照 WwOpenWsSendAiBotBizMsgReq proto 定义构造请求体: * - chat_id: 会话标识 * - userid: 发送者 userid * - b
src/mcp/interceptors/doc-auth-error.ts:101
↓ 1 callers
Function
sendMediaBatch
* 上传并发送一批媒体文件(统一走主动发送通道) * * replyMedia(被动回复)无法覆盖 replyStream 发出的 thinking 流式消息, * 因此所有媒体统一走 aibot_send_msg 主动发送。
src/monitor.ts:371
↓ 1 callers
Function
sendTemplateCards
(params: { wsClient: WSClient; frame: WsFrame; state: MessageState; account: ResolvedWeComAccount; r
src/template-card-manager.ts:213
↓ 1 callers
Function
sendThinkingReply
* 发送"思考中"消息
src/monitor.ts:336
↓ 1 callers
Function
setMessageState
(messageId: string, state: MessageState)
src/state-manager.ts:151
↓ 1 callers
Function
setReqIdForChat
(chatId: string, reqId: string, accountId = "default")
src/state-manager.ts:213
↓ 1 callers
Function
setSessionChatInfo
(sessionKey: string, info: SessionChatInfo)
src/state-manager.ts:296
↓ 1 callers
Method
setStreamIdForMsgId
手动设置 msgid → streamId 映射
src/webhook/state.ts:112
↓ 1 callers
Function
setWeComDmPolicy
* 设置企业微信 dmPolicy
src/onboarding.ts:47
↓ 1 callers
Function
setWeComWebSocket
(accountId: string, client: WSClient)
src/state-manager.ts:82
↓ 1 callers
Function
shouldProcessAgentInboundMessage
(params: { msgType: string; fromUser: string; eventType?: string; })
src/agent/handler.ts:142
↓ 1 callers
Function
shouldProcessBotInboundMessage
* 判断入站消息是否应该被处理(对齐原版 shouldProcessBotInboundMessage) * * 仅允许"真实用户消息"进入 Bot 会话: * - 发送者缺失 → 丢弃(避免 unknown 会话串会话) * - 发送者是 sys → 丢弃(避免系统回调触发 AI 自动回复
src/webhook/handler.ts:64
↓ 1 callers
Function
shouldUseDynamicAgent
(params: { chatType: "dm" | "group"; senderId: string; config: OpenClawConfig; })
src/dynamic-agent.ts:57
↓ 1 callers
Function
sniffMimeFromBuffer
通过 buffer 魔术字节嗅探 MIME 类型(动态导入 file-type,不强依赖)
src/openclaw-compat.ts:137
← previous
next →
201–300 of 367, ranked by callers