openclaw.plugin.json 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  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. "technical": {
  143. "type": "object",
  144. "description": "Optional technical-layer config. Values here override same-name top-level fields.",
  145. "additionalProperties": true,
  146. "properties": {
  147. "apiBase": { "type": "string" },
  148. "pollIntervalMs": { "type": "integer", "minimum": 3000, "maximum": 120000 },
  149. "batchWindowMs": { "type": "integer", "minimum": 0, "maximum": 30000 },
  150. "replyCooldownSecPerWxid": { "type": "integer", "minimum": 0, "maximum": 3600 },
  151. "outboundRatePerSec": {
  152. "type": "integer",
  153. "minimum": 1,
  154. "maximum": 100,
  155. "description": "Global outbound rate limiter for all send paths."
  156. },
  157. "outboundQueueMax": {
  158. "type": "integer",
  159. "minimum": 10,
  160. "maximum": 5000,
  161. "description": "Maximum buffered outbound tasks before rejecting new ones."
  162. },
  163. "metricsLogIntervalSec": {
  164. "type": "integer",
  165. "minimum": 30,
  166. "maximum": 3600,
  167. "description": "Base interval for summary metrics logs. Recommended: 60 (debug), 120~180 (normal), 300 (stable high throughput)."
  168. },
  169. "highThroughputOutboundAttemptsPer5Min": {
  170. "type": "integer",
  171. "minimum": 50,
  172. "maximum": 50000,
  173. "description": "Auto-switch metrics summary interval to 300s when outbound attempts in 5 minutes exceed this threshold."
  174. }
  175. }
  176. },
  177. "business": {
  178. "type": "object",
  179. "description": "Optional business-layer config. Values here override same-name top-level fields.",
  180. "additionalProperties": true,
  181. "properties": {
  182. "groupEnabled": { "type": "boolean" },
  183. "groupKeywords": { "type": "array", "items": { "type": "string" } },
  184. "groupMentionTokens": { "type": "array", "items": { "type": "string" } },
  185. "groupReplyAtSender": { "type": "boolean" },
  186. "dmPolicy": { "type": "string", "enum": ["open", "allowlist", "pairing"] },
  187. "allowFrom": { "type": "array", "items": { "type": "string" } },
  188. "ignoreWxidPrefixes": { "type": "array", "items": { "type": "string" } },
  189. "ignoreWxidExact": { "type": "array", "items": { "type": "string" } },
  190. "ignoreMessageTypes": { "type": "array", "items": { "type": "string" } },
  191. "faq": { "type": "array" },
  192. "defaultTo": { "type": "string" },
  193. "selfWxid": { "type": "string" }
  194. }
  195. }
  196. }
  197. }
  198. }
  199. }
  200. }
  201. }
  202. }