openclaw.plugin.json 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. {
  2. "id": "wechat-agent",
  3. "channels": ["wechat-agent"],
  4. "configSchema": {
  5. "type": "object",
  6. "additionalProperties": false,
  7. "properties": {
  8. "channels": {
  9. "type": "object",
  10. "properties": {
  11. "wechat-agent": {
  12. "type": "object",
  13. "additionalProperties": true,
  14. "properties": {
  15. "enabled": {
  16. "type": "boolean",
  17. "default": true,
  18. "description": "Master switch for this channel."
  19. },
  20. "apiBase": {
  21. "type": "string",
  22. "description": "Root URL of the wechat-agent HTTP bot, e.g. http://8.138.37.248/api/wechat-agent",
  23. "examples": [
  24. "http://127.0.0.1:8138",
  25. "http://8.138.37.248/api/wechat-agent"
  26. ]
  27. },
  28. "pollIntervalMs": {
  29. "type": "integer",
  30. "minimum": 3000,
  31. "maximum": 120000,
  32. "default": 10000,
  33. "description": "How often to pull new messages (ms)."
  34. },
  35. "batchWindowMs": {
  36. "type": "integer",
  37. "minimum": 0,
  38. "maximum": 30000,
  39. "default": 3000,
  40. "description": "Wait this long after a message before dispatching to the agent, so rapid-fire messages from one sender get merged into a single agent turn. 0 = dispatch immediately."
  41. },
  42. "replyCooldownSecPerWxid": {
  43. "type": "integer",
  44. "minimum": 0,
  45. "maximum": 3600,
  46. "default": 5,
  47. "description": "Minimum seconds between two replies to the same wxid. Prevents the bot from spamming if the agent errors repeatedly."
  48. },
  49. "groupEnabled": {
  50. "type": "boolean",
  51. "default": true,
  52. "description": "Enable group-chat inbound handling. When false, all group messages are ignored."
  53. },
  54. "groupKeywords": {
  55. "type": "array",
  56. "items": { "type": "string" },
  57. "default": ["帮我", "请问"],
  58. "description": "Group messages trigger the agent when content contains any of these keywords."
  59. },
  60. "groupMentionTokens": {
  61. "type": "array",
  62. "items": { "type": "string" },
  63. "default": ["@bot", "@助手"],
  64. "description": "Additional mention-like text tokens that should trigger in groups."
  65. },
  66. "groupReplyAtSender": {
  67. "type": "boolean",
  68. "default": false,
  69. "description": "When replying in groups, @-mention the sender wxid (if backend supports ats)."
  70. },
  71. "dmPolicy": {
  72. "type": "string",
  73. "enum": ["open", "allowlist", "pairing"],
  74. "default": "open",
  75. "description": "Who can initiate DMs. 'open' = anyone, 'allowlist' = only wxids in allowFrom, 'pairing' = require pairing code."
  76. },
  77. "allowFrom": {
  78. "type": "array",
  79. "items": { "type": "string" },
  80. "default": [],
  81. "description": "Wxid whitelist (used when dmPolicy=allowlist)."
  82. },
  83. "ignoreWxidPrefixes": {
  84. "type": "array",
  85. "items": { "type": "string" },
  86. "default": ["gh_"],
  87. "description": "Skip messages from wxids starting with these prefixes (e.g. gh_ for official accounts)."
  88. },
  89. "ignoreWxidExact": {
  90. "type": "array",
  91. "items": { "type": "string" },
  92. "default": [
  93. "weixin",
  94. "fmessage",
  95. "medianote",
  96. "filehelper",
  97. "floatbottle",
  98. "qmessage",
  99. "qqmail",
  100. "tmessage",
  101. "newsapp"
  102. ],
  103. "description": "Skip messages from these exact wxids (system contacts)."
  104. },
  105. "ignoreMessageTypes": {
  106. "type": "array",
  107. "items": { "type": "string" },
  108. "default": ["system", "emoji", "voice", "image", "video", "location", "file"],
  109. "description": "Message types to skip. MVP only handles text; others are ignored until v0.2."
  110. },
  111. "faq": {
  112. "type": "array",
  113. "description": "Plugin-layer FAQ fast-path. If a message matches (any keyword in keywords is a substring of content), reply immediately without calling the agent. Saves tokens and latency for canned answers.",
  114. "default": [],
  115. "items": {
  116. "type": "object",
  117. "required": ["keywords", "reply"],
  118. "properties": {
  119. "id": { "type": "string" },
  120. "keywords": {
  121. "type": "array",
  122. "items": { "type": "string" },
  123. "minItems": 1
  124. },
  125. "reply": { "type": "string" },
  126. "stop": {
  127. "type": "boolean",
  128. "default": true,
  129. "description": "If true (default), skip the agent after matching. If false, also forward to agent."
  130. }
  131. }
  132. }
  133. },
  134. "defaultTo": {
  135. "type": "string",
  136. "description": "Default wxid to send to when agent replies without an explicit target (e.g. scheduled broadcasts)."
  137. },
  138. "selfWxid": {
  139. "type": "string",
  140. "description": "The bot's own wxid, used to filter self-sent echoes. If unset, the plugin will try to detect via checkOnline."
  141. }
  142. }
  143. }
  144. }
  145. }
  146. }
  147. }
  148. }