@moltflow/skills 1.3.0 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/SKILL.md +130 -81
  2. package/package.json +2 -2
package/SKILL.md CHANGED
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  name: "WhatsApp Automation & A2A"
3
- description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, webhooks, AI-powered replies, auto-feedback collection, intention detection, lead management, anti-spam safeguards, agent-to-agent protocol (JSON-RPC, encryption), and configurable rules."
3
+ description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, AI-powered replies, anti-spam rules, content safeguards, auto-feedback collection, intention detection, lead management, agent-to-agent protocol (JSON-RPC, encryption), and configurable policies."
4
4
  metadata: {"openclaw":{"emoji":"📱","homepage":"https://waiflow.app","requires":{"env":["MOLTFLOW_API_KEY"]},"primaryEnv":"MOLTFLOW_API_KEY"}}
5
5
  ---
6
6
 
7
7
  # WhatsApp Automation & A2A
8
8
 
9
- MoltFlow provides a complete WhatsApp automation API with managed sessions, group monitoring, AI-powered replies, auto-feedback collection, intention detection, lead management, and agent-to-agent communication.
9
+ MoltFlow provides a complete WhatsApp automation API with managed sessions, messaging, group monitoring, labels, anti-spam rules, content safeguards, AI-powered replies, auto-feedback collection, lead management, and agent-to-agent communication.
10
10
 
11
11
  ## When to use
12
12
 
@@ -15,16 +15,42 @@ Use this skill when you need to:
15
15
  - Send text messages, list chats, read message history
16
16
  - Monitor groups for leads or keywords
17
17
  - Manage contact labels (WhatsApp Business sync)
18
- - Configure webhooks for real-time events
19
- - Transcribe voice messages (Whisper AI)
20
- - Manage RAG knowledge base (upload docs, semantic search)
18
+ - Configure anti-spam rules (rate limits, duplicate blocking, pattern filters)
19
+ - Set up content safeguards (block secrets, PII, prompt injection)
21
20
  - Train style profiles and generate AI replies
21
+ - Collect feedback via sentiment analysis (14+ languages)
22
+ - Export testimonials (JSON/HTML)
22
23
  - Discover and message other AI agents (A2A JSON-RPC 2.0)
23
24
  - Manage encryption keys (X25519-AES256GCM)
24
- - Collect reviews via sentiment analysis (14+ languages)
25
- - Export testimonials (JSON/HTML)
26
25
  - Manage API keys, usage tracking, billing (Stripe)
27
26
 
27
+ ## Use cases
28
+
29
+ **Personal automation:**
30
+ - Auto-reply to WhatsApp messages while you're busy (AI learns your tone)
31
+ - Forward important group mentions to a private chat
32
+ - Schedule follow-up messages to contacts after meetings
33
+ - Collect and organize customer testimonials from group conversations
34
+
35
+ **Business & lead management:**
36
+ - Monitor industry groups for purchase-intent keywords ("looking for", "need help with")
37
+ - Auto-label new leads as VIP/Hot/Cold based on message sentiment
38
+ - Route group-detected leads to your sales team via labels
39
+ - Run feedback collectors across all chats — auto-approve positive reviews for your website
40
+
41
+ **Agent-to-Agent (A2A):**
42
+ - Build a support agent that escalates complex tickets to a human agent over A2A
43
+ - Connect your booking agent with a payment agent — encrypted end-to-end
44
+ - Create a multi-agent pipeline: lead detection → qualification → outreach → follow-up
45
+ - Let two businesses' agents negotiate and exchange data securely (X25519-AES256GCM)
46
+ - Resolve any WhatsApp number to check if they run a MoltFlow agent, then message directly
47
+
48
+ **Safety & compliance:**
49
+ - Block outgoing messages containing API keys, credit cards, or SSNs automatically
50
+ - Set rate limits to prevent accidental spam (typing indicators + random delays built-in)
51
+ - Create custom regex rules to flag sensitive content before it leaves your account
52
+ - Test any message against your full policy stack before sending
53
+
28
54
  ## Setup
29
55
 
30
56
  Env vars:
@@ -151,64 +177,117 @@ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
151
177
  | `/labels/{id}/sync` | POST | Sync to WhatsApp Business |
152
178
  | `/labels/sync-from-whatsapp` | POST | Import from WhatsApp |
153
179
 
154
- ## 5. Webhooks
180
+ ## 5. Anti-Spam Rules
155
181
 
156
182
  ```bash
157
- # List webhooks
183
+ # Get anti-spam settings
158
184
  curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
159
- https://apiv2.waiflow.app/api/v2/webhooks
185
+ https://apiv2.waiflow.app/api/v2/antispam/settings
186
+
187
+ # Update anti-spam settings
188
+ curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
189
+ -H "Content-Type: application/json" \
190
+ -d '{"enabled": true, "rate_limit": 60, "rate_limit_window": 60, "block_duplicates": true, "auto_block_spammers": true, "max_violations": 5}' \
191
+ https://apiv2.waiflow.app/api/v2/antispam/settings
160
192
 
161
- # Test webhook
193
+ # Create spam filter rule (actions: block, flag, delay)
162
194
  curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
163
- https://apiv2.waiflow.app/api/v2/webhooks/{webhook_id}/test
195
+ -H "Content-Type: application/json" \
196
+ -d '{"pattern": "buy now|limited offer", "action": "block", "enabled": true}' \
197
+ https://apiv2.waiflow.app/api/v2/antispam/rules
198
+
199
+ # Update rule
200
+ curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
201
+ -H "Content-Type: application/json" \
202
+ -d '{"pattern": "buy now|limited offer|act fast", "action": "flag", "enabled": true}' \
203
+ https://apiv2.waiflow.app/api/v2/antispam/rules/{rule_id}
204
+
205
+ # Delete rule
206
+ curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
207
+ https://apiv2.waiflow.app/api/v2/antispam/rules/{rule_id}
208
+
209
+ # Get spam statistics
210
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
211
+ https://apiv2.waiflow.app/api/v2/antispam/stats
164
212
  ```
165
213
 
166
214
  | Endpoint | Method | Description |
167
215
  |----------|--------|-------------|
168
- | `/webhooks` | GET | List webhooks |
169
- | `/webhooks` | POST | Create webhook |
170
- | `/webhooks/{id}` | GET / PATCH / DELETE | Get, update, delete |
171
- | `/webhooks/{id}/test` | POST | Send test payload |
216
+ | `/antispam/settings` | GET | Get anti-spam settings |
217
+ | `/antispam/settings` | PUT | Update settings (rate limit, duplicate blocking, auto-block) |
218
+ | `/antispam/rules` | POST | Create spam filter rule |
219
+ | `/antispam/rules/{id}` | PUT | Update rule |
220
+ | `/antispam/rules/{id}` | DELETE | Delete rule |
221
+ | `/antispam/stats` | GET | Spam statistics (blocked, flagged, violations) |
172
222
 
173
- **Webhook events:** `message.received`, `message.sent`, `message.delivered`, `message.read`, `lead.detected`, `session.connected`, `session.disconnected`, `group.message`
223
+ **Rule actions:** `block` (drop message), `flag` (mark for review), `delay` (add cooldown)
174
224
 
175
- ---
225
+ **Settings fields:** `enabled`, `rate_limit` (msgs/window), `rate_limit_window` (seconds), `block_duplicates`, `duplicate_window`, `auto_block_spammers`, `max_violations`
176
226
 
177
- ## 6. AIVoice Transcription
227
+ ## 6. SafeguardsContent Policy
178
228
 
179
229
  ```bash
180
- # Queue voice message for transcription
181
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
182
- -d '{"message_id": "uuid-of-voice-message"}' \
183
- https://apiv2.waiflow.app/api/v2/ai/voice/transcribe
184
-
185
- # Check transcription status
230
+ # Get content policy settings
186
231
  curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
187
- https://apiv2.waiflow.app/api/v2/ai/voice/status/{task_id}
232
+ https://apiv2.waiflow.app/api/v2/a2a-policy/settings
233
+
234
+ # Update content policy
235
+ curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
236
+ -H "Content-Type: application/json" \
237
+ -d '{"block_api_keys": true, "block_credit_cards": true, "block_ssn": true, "block_emails": false, "max_message_length": 4096}' \
238
+ https://apiv2.waiflow.app/api/v2/a2a-policy/settings
188
239
 
189
- # Get transcript
240
+ # View built-in safeguard patterns (prompt injection, secrets, PII)
190
241
  curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
191
- https://apiv2.waiflow.app/api/v2/ai/messages/{message_id}/transcript
192
- ```
242
+ https://apiv2.waiflow.app/api/v2/a2a-policy/safeguards
193
243
 
194
- ## 7. AI Knowledge Base (RAG)
244
+ # Create custom blocking rule
245
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
246
+ -H "Content-Type: application/json" \
247
+ -d '{"pattern": "sk-[a-zA-Z0-9]{48}", "description": "Block OpenAI API keys"}' \
248
+ https://apiv2.waiflow.app/api/v2/a2a-policy/rules
195
249
 
196
- ```bash
197
- # Search knowledge base
250
+ # Toggle rule on/off
198
251
  curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
199
- -d '{"query": "return policy", "top_k": 5}' \
200
- https://apiv2.waiflow.app/api/v2/ai/knowledge/search
252
+ https://apiv2.waiflow.app/api/v2/a2a-policy/rules/{rule_id}/toggle
201
253
 
202
- # List knowledge sources
254
+ # Delete custom rule
255
+ curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
256
+ https://apiv2.waiflow.app/api/v2/a2a-policy/rules/{rule_id}
257
+
258
+ # Test content against all policies
259
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
260
+ -H "Content-Type: application/json" \
261
+ -d '{"content": "My API key is sk-abc123"}' \
262
+ https://apiv2.waiflow.app/api/v2/a2a-policy/test
263
+
264
+ # Get blocking statistics
203
265
  curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
204
- https://apiv2.waiflow.app/api/v2/ai/knowledge/sources
266
+ https://apiv2.waiflow.app/api/v2/a2a-policy/stats
205
267
 
206
- # Delete knowledge source
207
- curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
208
- https://apiv2.waiflow.app/api/v2/ai/knowledge/{source_id}
268
+ # Reset policy to defaults
269
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
270
+ https://apiv2.waiflow.app/api/v2/a2a-policy/reset
209
271
  ```
210
272
 
211
- ## 8. AI Style Profiles (Learn Mode)
273
+ | Endpoint | Method | Description |
274
+ |----------|--------|-------------|
275
+ | `/a2a-policy/settings` | GET / PUT | Get or update content policy |
276
+ | `/a2a-policy/safeguards` | GET | View built-in safeguard patterns |
277
+ | `/a2a-policy/rules` | POST | Create custom blocking rule |
278
+ | `/a2a-policy/rules/{id}` | DELETE | Delete custom rule |
279
+ | `/a2a-policy/rules/{id}/toggle` | POST | Toggle rule on/off |
280
+ | `/a2a-policy/test` | POST | Test content against policies |
281
+ | `/a2a-policy/stats` | GET | Blocking statistics |
282
+ | `/a2a-policy/reset` | POST | Reset to defaults |
283
+
284
+ **Built-in safeguards:** prompt injection detection, secret patterns (API keys, tokens, private keys), PII patterns (SSN, credit cards, bank accounts)
285
+
286
+ **Policy fields:** `block_api_keys`, `block_passwords`, `block_tokens`, `block_private_keys`, `block_ssn`, `block_credit_cards`, `block_bank_accounts`, `block_phone_numbers`, `block_emails`, `max_message_length`, `max_urls_per_message`, `min_trust_level`, `log_blocked`
287
+
288
+ ---
289
+
290
+ ## 7. AI — Style Profiles
212
291
 
213
292
  ```bash
214
293
  # Train style profile from message history
@@ -225,30 +304,23 @@ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
225
304
  https://apiv2.waiflow.app/api/v2/ai/style/profiles
226
305
  ```
227
306
 
228
- ## 9. AI — Reply Generation
307
+ ## 8. AI — Reply Generation
229
308
 
230
309
  ```bash
231
- # Generate AI reply (uses RAG + style)
310
+ # Generate AI reply (uses style profile)
232
311
  curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
233
- -d '{"contact_id": "jid", "context": "customer question", "use_rag": true, "apply_style": true}' \
312
+ -d '{"contact_id": "jid", "context": "customer question", "apply_style": true}' \
234
313
  https://apiv2.waiflow.app/api/v2/ai/ai/generate-reply
235
314
 
236
315
  # Preview AI reply (no usage tracking)
237
316
  curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
238
- "https://apiv2.waiflow.app/api/v2/ai/ai/preview?contact_id=jid&context=question&use_rag=true&apply_style=true"
317
+ "https://apiv2.waiflow.app/api/v2/ai/ai/preview?contact_id=jid&context=question&apply_style=true"
239
318
  ```
240
319
 
241
320
  ### AI API Reference
242
321
 
243
322
  | Endpoint | Method | Description |
244
323
  |----------|--------|-------------|
245
- | `/ai/voice/transcribe` | POST | Queue voice transcription |
246
- | `/ai/voice/status/{task_id}` | GET | Check transcription status |
247
- | `/ai/messages/{id}/transcript` | GET | Get transcript |
248
- | `/ai/knowledge/ingest` | POST | Ingest document |
249
- | `/ai/knowledge/search` | POST | Semantic search |
250
- | `/ai/knowledge/sources` | GET | List knowledge sources |
251
- | `/ai/knowledge/{id}` | DELETE | Delete source |
252
324
  | `/ai/style/train` | POST | Train style profile |
253
325
  | `/ai/style/status/{task_id}` | GET | Training status |
254
326
  | `/ai/style/profile` | GET | Get style profile |
@@ -259,7 +331,7 @@ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
259
331
 
260
332
  ---
261
333
 
262
- ## 10. A2A — Agent-to-Agent Protocol
334
+ ## 9. A2A — Agent-to-Agent Protocol
263
335
 
264
336
  **Requires Business plan.** Uses JSON-RPC 2.0 over HTTPS with X25519-AES256GCM encryption.
265
337
 
@@ -314,26 +386,6 @@ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
314
386
  https://apiv2.waiflow.app/api/v2/a2a
315
387
  ```
316
388
 
317
- ### Content policy
318
-
319
- ```bash
320
- # Get policy settings
321
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
322
- https://apiv2.waiflow.app/api/v2/a2a-policy/settings
323
-
324
- # Update policy
325
- curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
326
- -H "Content-Type: application/json" \
327
- -d '{"block_api_keys": true, "block_credit_cards": true, "block_emails": false}' \
328
- https://apiv2.waiflow.app/api/v2/a2a-policy/settings
329
-
330
- # Test content against policy
331
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
332
- -H "Content-Type: application/json" \
333
- -d '{"content": "My API key is sk-abc123"}' \
334
- https://apiv2.waiflow.app/api/v2/a2a-policy/test
335
- ```
336
-
337
389
  ### A2A API Reference
338
390
 
339
391
  | Endpoint | Method | Description |
@@ -346,10 +398,6 @@ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
346
398
  | `/agents/peers` | GET | List discovered peers |
347
399
  | `/agents/peers/{id}/trust` | PATCH | Update trust level |
348
400
  | `/a2a` | POST | JSON-RPC 2.0 endpoint |
349
- | `/a2a-policy/settings` | GET/PUT | Get/update policy |
350
- | `/a2a-policy/rules` | POST | Add custom filter rule |
351
- | `/a2a-policy/test` | POST | Test content against policy |
352
- | `/a2a-policy/stats` | GET | Blocking statistics |
353
401
 
354
402
  **JSON-RPC methods:** `agent.message.send`, `group.getContext`, `agent.group.create`, `agent.group.invite`, `agent.group.list`, `webhook_manager`
355
403
 
@@ -359,7 +407,7 @@ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
359
407
 
360
408
  ---
361
409
 
362
- ## 11. Reviews — Sentiment Analysis & Testimonials
410
+ ## 10. Reviews — Feedback Collection & Testimonials
363
411
 
364
412
  ```bash
365
413
  # Create review collector
@@ -411,7 +459,7 @@ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
411
459
 
412
460
  ---
413
461
 
414
- ## 12. Auth & API Keys
462
+ ## 11. Auth & API Keys
415
463
 
416
464
  ```bash
417
465
  # Login
@@ -446,7 +494,7 @@ curl -X POST -H "Authorization: Bearer $TOKEN" \
446
494
  | `/api-keys/{id}` | GET/DELETE | Get/revoke key |
447
495
  | `/api-keys/{id}/rotate` | POST | Rotate key |
448
496
 
449
- ## 13. Usage & Billing
497
+ ## 12. Usage & Billing
450
498
 
451
499
  ```bash
452
500
  # Current period usage
@@ -491,8 +539,9 @@ curl -H "Authorization: Bearer $TOKEN" \
491
539
  - Use E.164 phone format without `+` where required
492
540
  - AI features require Pro plan or above
493
541
  - A2A protocol requires Business plan
494
- - AI reply generation includes safety: input sanitization, intent verification, output filtering, PII/secrets detection
495
- - Content policy filters secrets (API keys, tokens) and PII (SSN, credit cards)
542
+ - Anti-spam rules support pattern matching with block, flag, or delay actions
543
+ - Content safeguards filter secrets (API keys, tokens), PII (SSN, credit cards), and prompt injection
544
+ - AI reply generation includes safety: input sanitization, intent verification, output filtering
496
545
  - API keys use name + expires_in_days (no scopes param); raw key shown only once at creation
497
546
  - Respect WhatsApp opt-in, business hours, and opt-out requests
498
547
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@moltflow/skills",
3
- "version": "1.3.0",
4
- "description": "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, AI, A2A protocol, reviews, billing.",
3
+ "version": "1.4.0",
4
+ "description": "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, anti-spam rules, safeguards, AI replies, feedback collection, A2A protocol.",
5
5
  "license": "MIT",
6
6
  "private": false,
7
7
  "files": [