openclaw.plugin.json 6.4 KB

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