npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@agentxin-ai/plugin-wecom

v0.0.4

Published

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.

Readme

@agentxin-ai/plugin-wecom

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.

Capabilities

  • Two integration providers:
    • wecom: WeCom short-connection callback mode
    • wecom_long: WeCom long-connection websocket mode
  • Callback endpoint exposure: /api/wecom/webhook/:integrationId
  • GET URL verification for WeCom callback mode
  • POST event decryption and inbound message processing
  • Workflow trigger: WeCom Trigger
  • Agent middleware: WeComNotifyMiddleware
  • Unified chat channel: wecom

Integration Modes

Short Connection

Use provider wecom when you want WeCom to call your AgentXin API endpoint directly.

Required fields:

  • token
  • encodingAesKey

Optional fields:

  • agentxinId
  • preferLanguage
  • timeoutMs

Callback URL format:

  • https://<your-api-domain>/api/wecom/webhook/<integrationId>

Long Connection

Use provider wecom_long when you want to connect through the WeCom AI Bot websocket channel.

Required fields:

  • botId
  • secret

Optional fields:

  • wsOrigin
  • agentxinId
  • preferLanguage
  • timeoutMs

When a long-connection integration is saved, the plugin attempts to establish the websocket connection automatically.

Routing to AgentXin

You can route inbound WeCom messages in either of these ways:

  1. Set agentxinId directly on the integration.
  2. Use WeCom Trigger in a workflow to bind integrationId -> agentxinId.

The trigger-based binding is the recommended setup because it is explicit and aligns with the plugin workflow model.

Middleware Configuration

WeComNotifyMiddleware is intentionally minimal.

It only keeps one required field:

  • integrationId

The middleware is robot-only. It does not expose recipient type, recipient ID, template settings, or default timeout fields in the config UI.

For normal conversation replies, the model should output plain text directly instead of calling tools.

Available Tools

wecom_send_text_notification

Send a text reply through the active WeCom robot conversation context.

Required input:

  • content

Optional runtime context:

  • senderId
  • chatId
  • responseUrl
  • reqId
  • timeoutMs

wecom_send_rich_notification

Send a rich reply through the active WeCom robot conversation context.

Supported modes:

  • markdown
  • textcard
  • template_card

The tool can infer the mode automatically from the payload you provide.

Optional runtime context:

  • senderId
  • chatId
  • responseUrl
  • reqId
  • timeoutMs

wecom_update_message

Update a template card in the current WeCom robot conversation context.

Accepted payload aliases:

  • templateCard
  • template_card
  • card

Optional runtime context:

  • senderId
  • chatId
  • responseUrl
  • reqId
  • timeoutMs

Runtime Behavior

  • Short-connection integrations use callback context from the inbound WeCom request.
  • Long-connection integrations use websocket session context from the active AI Bot connection.
  • If no valid robot context is available, the middleware returns a context-missing error instead of falling back to application OpenAPI sending.

Local Build

cd agentxinai/integrations/wecom
node ../../node_modules/typescript/bin/tsc -p tsconfig.lib.json

Lifecycle Validation

After modifying the plugin, run the plugin lifecycle validation through plugin-dev-harness.

cd agentxinai/integrations/wecom
node ../../node_modules/typescript/bin/tsc -p tsconfig.lib.json
cd ../../..
node plugin-dev-harness/dist/index.js --workspace ./agentxinai --plugin @hxr222223323232323/plugin-wecom-xr --verbose