{"_id":"@agentxin-ai/plugin-wecom","name":"@agentxin-ai/plugin-wecom","dist-tags":{"latest":"0.0.4"},"versions":{"0.0.4":{"name":"@agentxin-ai/plugin-wecom","version":"0.0.4","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{"./package.json":"./package.json",".":{"@agentxin-plugins-starter/source":"./src/index.ts","types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"}},"scripts":{"prepack":"node ./scripts/copy-assets.mjs"},"dependencies":{"tslib":"^2.3.0","ws":"^8.18.0"},"devDependencies":{"@types/express":"^5.0.6","@types/passport":"^1.0.17"},"peerDependencies":{"zod":"3.25.67","@agentxin-ai/chatkit-types":"^0.0.12","@agentxin-ai/plugin-sdk":"^3.8.1","@metad/contracts":"^3.8.1","@nestjs/common":"^11.1.6","@nestjs/cache-manager":"^3.0.1","@nestjs/core":"^11.1.6","@nestjs/cqrs":"^11.0.3","@nestjs/passport":"^11.0.5","cache-manager":"^7.2.0","chalk":"4.1.2","express":"4.21.2","passport":"^0.6.0","rxjs":"^7.8.1"},"_id":"@agentxin-ai/plugin-wecom@0.0.4","description":"Generic WeCom integration plugin for AgentXin. It supports both WeCom bot callback mode and WeCom AI Bot long-connection mode, plus a robot-only notification middleware for sending replies inside an active WeCom conversation.","bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","_nodeVersion":"22.22.0","_npmVersion":"10.9.4","dist":{"integrity":"sha512-HOfi7sQkcr+FuetPL/MO6k4hBjfFuslSt8My9xK7rAmKOqxQzFG/iOett9OoX6nLE+O+OIaJR28bRCKPnMmaLw==","shasum":"832b91f192c7521d36d106b4d7a39e237535640d","tarball":"https://registry.npmjs.org/@agentxin-ai/plugin-wecom/-/plugin-wecom-0.0.4.tgz","fileCount":2,"unpackedSize":5043,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDNfWqI/E3wPpOKJTq8BNGseZu3SEZETV7LXiJG2zOQ8QIgbhZ8I9apmqr4BXIEyjIvMv1gyY0ok4F7pXUIi1WHIhQ="}]},"_npmUser":{"name":"agentxin-ai","email":"1304040880@qq.com"},"directories":{},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/plugin-wecom_0.0.4_1773917267859_0.6348916830212992"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-19T10:47:47.797Z","0.0.4":"2026-03-19T10:47:48.005Z","modified":"2026-03-19T10:47:48.173Z"},"maintainers":[{"name":"agentxin-ai","email":"1304040880@qq.com"}],"description":"Generic WeCom integration plugin for AgentXin. It supports both WeCom bot callback mode and WeCom AI Bot long-connection mode, plus a robot-only notification middleware for sending replies inside an active WeCom conversation.","homepage":"https://github.com/agentxin-ai/agentxin-plugins#readme","repository":{"type":"git","url":"git+https://github.com/agentxin-ai/agentxin-plugins.git"},"bugs":{"url":"https://github.com/agentxin-ai/agentxin-plugins/issues"},"readme":"# @agentxin-ai/plugin-wecom\n\nGeneric WeCom integration plugin for AgentXin. It supports both WeCom bot callback mode and WeCom AI Bot long-connection mode, plus a robot-only notification middleware for sending replies inside an active WeCom conversation.\n\n## Capabilities\n\n- Two integration providers:\n  - `wecom`: WeCom short-connection callback mode\n  - `wecom_long`: WeCom long-connection websocket mode\n- Callback endpoint exposure: `/api/wecom/webhook/:integrationId`\n- GET URL verification for WeCom callback mode\n- POST event decryption and inbound message processing\n- Workflow trigger: `WeCom Trigger`\n- Agent middleware: `WeComNotifyMiddleware`\n- Unified chat channel: `wecom`\n\n## Integration Modes\n\n### Short Connection\n\nUse provider `wecom` when you want WeCom to call your AgentXin API endpoint directly.\n\nRequired fields:\n\n- `token`\n- `encodingAesKey`\n\nOptional fields:\n\n- `agentxinId`\n- `preferLanguage`\n- `timeoutMs`\n\nCallback URL format:\n\n- `https://<your-api-domain>/api/wecom/webhook/<integrationId>`\n\n### Long Connection\n\nUse provider `wecom_long` when you want to connect through the WeCom AI Bot websocket channel.\n\nRequired fields:\n\n- `botId`\n- `secret`\n\nOptional fields:\n\n- `wsOrigin`\n- `agentxinId`\n- `preferLanguage`\n- `timeoutMs`\n\nWhen a long-connection integration is saved, the plugin attempts to establish the websocket connection automatically.\n\n## Routing to AgentXin\n\nYou can route inbound WeCom messages in either of these ways:\n\n1. Set `agentxinId` directly on the integration.\n2. Use `WeCom Trigger` in a workflow to bind `integrationId -> agentxinId`.\n\nThe trigger-based binding is the recommended setup because it is explicit and aligns with the plugin workflow model.\n\n## Middleware Configuration\n\n`WeComNotifyMiddleware` is intentionally minimal.\n\nIt only keeps one required field:\n\n- `integrationId`\n\nThe middleware is robot-only. It does not expose recipient type, recipient ID, template settings, or default timeout fields in the config UI.\n\nFor normal conversation replies, the model should output plain text directly instead of calling tools.\n\n## Available Tools\n\n### `wecom_send_text_notification`\n\nSend a text reply through the active WeCom robot conversation context.\n\nRequired input:\n\n- `content`\n\nOptional runtime context:\n\n- `senderId`\n- `chatId`\n- `responseUrl`\n- `reqId`\n- `timeoutMs`\n\n### `wecom_send_rich_notification`\n\nSend a rich reply through the active WeCom robot conversation context.\n\nSupported modes:\n\n- `markdown`\n- `textcard`\n- `template_card`\n\nThe tool can infer the mode automatically from the payload you provide.\n\nOptional runtime context:\n\n- `senderId`\n- `chatId`\n- `responseUrl`\n- `reqId`\n- `timeoutMs`\n\n### `wecom_update_message`\n\nUpdate a template card in the current WeCom robot conversation context.\n\nAccepted payload aliases:\n\n- `templateCard`\n- `template_card`\n- `card`\n\nOptional runtime context:\n\n- `senderId`\n- `chatId`\n- `responseUrl`\n- `reqId`\n- `timeoutMs`\n\n## Runtime Behavior\n\n- Short-connection integrations use callback context from the inbound WeCom request.\n- Long-connection integrations use websocket session context from the active AI Bot connection.\n- If no valid robot context is available, the middleware returns a context-missing error instead of falling back to application OpenAPI sending.\n\n## Local Build\n\n```bash\ncd agentxinai/integrations/wecom\nnode ../../node_modules/typescript/bin/tsc -p tsconfig.lib.json\n```\n\n## Lifecycle Validation\n\nAfter modifying the plugin, run the plugin lifecycle validation through `plugin-dev-harness`.\n\n```bash\ncd agentxinai/integrations/wecom\nnode ../../node_modules/typescript/bin/tsc -p tsconfig.lib.json\ncd ../../..\nnode plugin-dev-harness/dist/index.js --workspace ./agentxinai --plugin @hxr222223323232323/plugin-wecom-xr --verbose\n```\n","readmeFilename":"README.md","_rev":"1-fef78af97c4b5419a88c285cf48fd8e8"}