@moltflow/skills 1.0.0 → 1.2.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.
package/SKILL.md CHANGED
@@ -1,512 +1,505 @@
1
- ---
2
- name: WhatsApp Automation & A2A
3
- description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, webhooks, AI (voice transcription, RAG, style profiles, reply generation), agent-to-agent protocol (JSON-RPC, encryption), review collection (14+ language sentiment analysis), auth, API keys, and Stripe billing."
4
- metadata: {"openclaw":{"emoji":"📱","homepage":"https://moltflow.com","requires":{"env":["MOLTFLOW_API_KEY"]},"primaryEnv":"MOLTFLOW_API_KEY"}}
5
- ---
6
-
7
- # WhatsApp Automation & A2A
8
-
9
- MoltFlow provides a complete WhatsApp automation API with managed sessions, group monitoring, AI-powered replies, agent-to-agent communication, review collection, and Stripe billing.
10
-
11
- ## When to use
12
-
13
- Use this skill when you need to:
14
- - Connect and manage WhatsApp sessions (QR pairing, start/stop)
15
- - Send text messages, list chats, read message history
16
- - Monitor groups for leads or keywords
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)
21
- - Train style profiles and generate AI replies
22
- - Discover and message other AI agents (A2A JSON-RPC 2.0)
23
- - Manage encryption keys (X25519-AES256GCM)
24
- - Collect reviews via sentiment analysis (14+ languages)
25
- - Export testimonials (JSON/HTML)
26
- - Manage API keys, usage tracking, billing (Stripe)
27
-
28
- ## Setup
29
-
30
- Env vars:
31
- - `MOLTFLOW_API_KEY` (required) — API key from moltflow.com dashboard
32
- - `MOLTFLOW_API_URL` (optional) — defaults to `https://api.moltflow.com`
33
-
34
- Authentication: `X-API-Key: $MOLTFLOW_API_KEY` header or `Authorization: Bearer $TOKEN` (JWT from login).
35
-
36
- Base URL: `https://api.moltflow.com/api/v2`
37
-
38
- ---
39
-
40
- ## 1. Sessions
41
-
42
- ```bash
43
- # List all sessions
44
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
45
- https://api.moltflow.com/api/v2/sessions
46
-
47
- # Create new session
48
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
49
- -H "Content-Type: application/json" \
50
- -d '{"name": "Main Line"}' \
51
- https://api.moltflow.com/api/v2/sessions
52
-
53
- # Get session details
54
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
55
- https://api.moltflow.com/api/v2/sessions/{session_id}
56
-
57
- # Delete session
58
- curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
59
- https://api.moltflow.com/api/v2/sessions/{session_id}
60
- ```
61
-
62
- | Endpoint | Method | Description |
63
- |----------|--------|-------------|
64
- | `/sessions` | GET | List sessions |
65
- | `/sessions` | POST | Create session |
66
- | `/sessions/{id}` | GET | Get session details |
67
- | `/sessions/{id}` | DELETE | Delete session |
68
-
69
- ## 2. Messages
70
-
71
- ```bash
72
- # Send text message
73
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
74
- -H "Content-Type: application/json" \
75
- -d '{"session_id": "uuid", "chat_id": "1234567890@c.us", "message": "Hello!"}' \
76
- https://api.moltflow.com/api/v2/messages/send
77
-
78
- # List chats for a session
79
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
80
- https://api.moltflow.com/api/v2/messages/chats/{session_id}
81
-
82
- # Get chat messages
83
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
84
- https://api.moltflow.com/api/v2/messages/chat/{session_id}/{chat_id}
85
- ```
86
-
87
- | Endpoint | Method | Description |
88
- |----------|--------|-------------|
89
- | `/messages/send` | POST | Send text message |
90
- | `/messages/chats/{session_id}` | GET | List chats |
91
- | `/messages/chat/{session_id}/{chat_id}` | GET | Get messages in chat |
92
- | `/messages/{message_id}` | GET | Get single message |
93
-
94
- ## 3. Groups
95
-
96
- ```bash
97
- # List monitored groups
98
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
99
- https://api.moltflow.com/api/v2/groups
100
-
101
- # List available WhatsApp groups
102
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
103
- https://api.moltflow.com/api/v2/groups/available/{session_id}
104
-
105
- # Add group to monitor
106
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
107
- -H "Content-Type: application/json" \
108
- -d '{"session_id": "uuid", "wa_group_id": "123456@g.us", "monitor_mode": "first_message"}' \
109
- https://api.moltflow.com/api/v2/groups
110
-
111
- # Update monitoring settings
112
- curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
113
- -H "Content-Type: application/json" \
114
- -d '{"monitor_mode": "keyword", "monitor_keywords": ["looking for", "need help"]}' \
115
- https://api.moltflow.com/api/v2/groups/{group_id}
116
- ```
117
-
118
- | Endpoint | Method | Description |
119
- |----------|--------|-------------|
120
- | `/groups` | GET | List monitored groups |
121
- | `/groups/available/{session_id}` | GET | List available WhatsApp groups |
122
- | `/groups` | POST | Add group to monitoring |
123
- | `/groups/{id}` | GET | Get group details |
124
- | `/groups/{id}` | PATCH | Update monitoring settings |
125
- | `/groups/{id}` | DELETE | Remove from monitoring |
126
-
127
- ## 4. Labels
128
-
129
- ```bash
130
- # Create label (color must be hex #RRGGBB)
131
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
132
- -H "Content-Type: application/json" \
133
- -d '{"name": "VIP", "color": "#00FF00"}' \
134
- https://api.moltflow.com/api/v2/labels
135
-
136
- # Sync label to WhatsApp Business
137
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
138
- "https://api.moltflow.com/api/v2/labels/{label_id}/sync?session_id={session_id}"
139
-
140
- # Import labels from WhatsApp Business
141
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
142
- "https://api.moltflow.com/api/v2/labels/sync-from-whatsapp?session_id={session_id}"
143
- ```
144
-
145
- | Endpoint | Method | Description |
146
- |----------|--------|-------------|
147
- | `/labels` | GET | List labels |
148
- | `/labels` | POST | Create label |
149
- | `/labels/business-check` | GET | Check WhatsApp Business status |
150
- | `/labels/{id}` | GET / PATCH / DELETE | Get, update, delete label |
151
- | `/labels/{id}/sync` | POST | Sync to WhatsApp Business |
152
- | `/labels/sync-from-whatsapp` | POST | Import from WhatsApp |
153
-
154
- ## 5. Webhooks
155
-
156
- ```bash
157
- # Create webhook
158
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
159
- -H "Content-Type: application/json" \
160
- -d '{"url": "https://your-server.com/webhook", "events": ["message.received", "lead.detected"]}' \
161
- https://api.moltflow.com/api/v2/webhooks
162
-
163
- # Test webhook
164
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
165
- https://api.moltflow.com/api/v2/webhooks/{webhook_id}/test
166
- ```
167
-
168
- | Endpoint | Method | Description |
169
- |----------|--------|-------------|
170
- | `/webhooks` | GET | List webhooks |
171
- | `/webhooks` | POST | Create webhook |
172
- | `/webhooks/{id}` | GET / PATCH / DELETE | Get, update, delete |
173
- | `/webhooks/{id}/test` | POST | Send test payload |
174
-
175
- **Webhook events:** `message.received`, `message.sent`, `message.delivered`, `message.read`, `lead.detected`, `session.connected`, `session.disconnected`, `group.message`
176
-
177
- ---
178
-
179
- ## 6. AI — Voice Transcription
180
-
181
- ```bash
182
- # Queue voice message for transcription
183
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
184
- -d '{"message_id": "uuid-of-voice-message"}' \
185
- https://api.moltflow.com/api/v2/ai/voice/transcribe
186
-
187
- # Check transcription status
188
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
189
- https://api.moltflow.com/api/v2/ai/voice/status/{task_id}
190
-
191
- # Get transcript
192
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
193
- https://api.moltflow.com/api/v2/ai/messages/{message_id}/transcript
194
- ```
195
-
196
- ## 7. AI — Knowledge Base (RAG)
197
-
198
- ```bash
199
- # Upload document (PDF or TXT, max 10MB)
200
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
201
- -F "file=@manual.pdf" \
202
- https://api.moltflow.com/api/v2/ai/knowledge/ingest
203
-
204
- # Search knowledge base
205
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
206
- -d '{"query": "return policy", "top_k": 5}' \
207
- https://api.moltflow.com/api/v2/ai/knowledge/search
208
-
209
- # List knowledge sources
210
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
211
- https://api.moltflow.com/api/v2/ai/knowledge/sources
212
-
213
- # Delete knowledge source
214
- curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
215
- https://api.moltflow.com/api/v2/ai/knowledge/{source_id}
216
- ```
217
-
218
- ## 8. AI — Style Profiles (Learn Mode)
219
-
220
- ```bash
221
- # Train style profile from message history
222
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
223
- -d '{"contact_id": "optional-contact-jid"}' \
224
- https://api.moltflow.com/api/v2/ai/style/train
225
-
226
- # Check training status
227
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
228
- https://api.moltflow.com/api/v2/ai/style/status/{task_id}
229
-
230
- # Get / list / delete style profiles
231
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
232
- https://api.moltflow.com/api/v2/ai/style/profiles
233
- ```
234
-
235
- ## 9. AI — Reply Generation
236
-
237
- ```bash
238
- # Generate AI reply (uses RAG + style)
239
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
240
- -d '{"contact_id": "jid", "context": "customer question", "use_rag": true, "apply_style": true}' \
241
- https://api.moltflow.com/api/v2/ai/ai/generate-reply
242
-
243
- # Preview AI reply (no usage tracking)
244
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
245
- "https://api.moltflow.com/api/v2/ai/ai/preview?contact_id=jid&context=question&use_rag=true&apply_style=true"
246
- ```
247
-
248
- ### AI API Reference
249
-
250
- | Endpoint | Method | Description |
251
- |----------|--------|-------------|
252
- | `/ai/voice/transcribe` | POST | Queue voice transcription |
253
- | `/ai/voice/status/{task_id}` | GET | Check transcription status |
254
- | `/ai/messages/{id}/transcript` | GET | Get transcript |
255
- | `/ai/knowledge/ingest` | POST | Upload document (PDF/TXT) |
256
- | `/ai/knowledge/search` | POST | Semantic search |
257
- | `/ai/knowledge/sources` | GET | List knowledge sources |
258
- | `/ai/knowledge/{id}` | DELETE | Delete source |
259
- | `/ai/style/train` | POST | Train style profile |
260
- | `/ai/style/status/{task_id}` | GET | Training status |
261
- | `/ai/style/profile` | GET | Get style profile |
262
- | `/ai/style/profiles` | GET | List all profiles |
263
- | `/ai/style/profile/{id}` | DELETE | Delete profile |
264
- | `/ai/ai/generate-reply` | POST | Generate AI reply |
265
- | `/ai/ai/preview` | GET | Preview reply (no tracking) |
266
-
267
- ---
268
-
269
- ## 10. A2A — Agent-to-Agent Protocol
270
-
271
- **Requires Business plan.** Uses JSON-RPC 2.0 over HTTPS with X25519-AES256GCM encryption.
272
-
273
- ### Bootstrap & encryption
274
-
275
- ```bash
276
- # Get full configuration
277
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
278
- https://api.moltflow.com/api/v2/agent/bootstrap
279
-
280
- # Get your public key (auto-generates if none)
281
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
282
- https://api.moltflow.com/api/v2/agent/public-key
283
-
284
- # Rotate keypair
285
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
286
- https://api.moltflow.com/api/v2/agent/rotate-keys
287
- ```
288
-
289
- ### Discover agents
290
-
291
- ```bash
292
- # Resolve phone to MoltFlow agent
293
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
294
- https://api.moltflow.com/api/v2/agents/resolve/+1234567890
295
-
296
- # List peers
297
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
298
- https://api.moltflow.com/api/v2/agents/peers
299
-
300
- # Update trust level (discovered, verified, blocked)
301
- curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
302
- -H "Content-Type: application/json" \
303
- -d '{"trust_level": "verified"}' \
304
- https://api.moltflow.com/api/v2/agents/peers/{peer_id}/trust
305
- ```
306
-
307
- ### Send A2A messages (JSON-RPC 2.0)
308
-
309
- ```bash
310
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
311
- -H "Content-Type: application/json" \
312
- -d '{
313
- "jsonrpc": "2.0",
314
- "method": "agent.message.send",
315
- "params": {
316
- "phone": "+1234567890",
317
- "message": {"parts": [{"text": "Hello from my agent!"}]}
318
- },
319
- "id": "1"
320
- }' \
321
- https://api.moltflow.com/api/v2/a2a
322
- ```
323
-
324
- ### Content policy
325
-
326
- ```bash
327
- # Get policy settings
328
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
329
- https://api.moltflow.com/api/v2/a2a-policy/settings
330
-
331
- # Update policy
332
- curl -X PUT -H "X-API-Key: $MOLTFLOW_API_KEY" \
333
- -H "Content-Type: application/json" \
334
- -d '{"block_api_keys": true, "block_credit_cards": true, "block_emails": false}' \
335
- https://api.moltflow.com/api/v2/a2a-policy/settings
336
-
337
- # Test content against policy
338
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
339
- -H "Content-Type: application/json" \
340
- -d '{"content": "My API key is sk-abc123"}' \
341
- https://api.moltflow.com/api/v2/a2a-policy/test
342
- ```
343
-
344
- ### A2A API Reference
345
-
346
- | Endpoint | Method | Description |
347
- |----------|--------|-------------|
348
- | `/agent/bootstrap` | GET | Full onboarding config |
349
- | `/agent/public-key` | GET | Get X25519 public key |
350
- | `/agent/rotate-keys` | POST | Rotate keypair |
351
- | `/agent/peer/{tenant_id}/public-key` | GET | Peer's public key |
352
- | `/agents/resolve/{phone}` | GET | Resolve phone to agent |
353
- | `/agents/peers` | GET | List discovered peers |
354
- | `/agents/peers/{id}/trust` | PATCH | Update trust level |
355
- | `/a2a` | POST | JSON-RPC 2.0 endpoint |
356
- | `/a2a-policy/settings` | GET/PUT | Get/update policy |
357
- | `/a2a-policy/rules` | POST | Add custom filter rule |
358
- | `/a2a-policy/test` | POST | Test content against policy |
359
- | `/a2a-policy/stats` | GET | Blocking statistics |
360
-
361
- **JSON-RPC methods:** `agent.message.send`, `group.getContext`, `agent.group.create`, `agent.group.invite`, `agent.group.list`, `webhook_manager`
362
-
363
- **Trust levels:** `discovered` → `verified` → `blocked`
364
-
365
- **Encryption:** X25519-AES256GCM, ECDH key exchange, HKDF-SHA256, 32-byte keys (base64)
366
-
367
- ---
368
-
369
- ## 11. Reviews — Sentiment Analysis & Testimonials
370
-
371
- ```bash
372
- # Create review collector
373
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
374
- -d '{
375
- "name": "Customer Feedback",
376
- "session_id": "uuid-of-whatsapp-session",
377
- "source_type": "groups",
378
- "min_positive_words": 3,
379
- "min_sentiment_score": 0.6,
380
- "include_keywords": ["great", "excellent"],
381
- "languages": []
382
- }' \
383
- https://api.moltflow.com/api/v2/reviews/collectors
384
-
385
- # Trigger manual scan
386
- curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
387
- https://api.moltflow.com/api/v2/reviews/collectors/{id}/run
388
-
389
- # List reviews
390
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
391
- "https://api.moltflow.com/api/v2/reviews?approved_only=false&limit=50"
392
-
393
- # Approve review
394
- curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
395
- -d '{"is_approved": true}' \
396
- https://api.moltflow.com/api/v2/reviews/{id}
397
-
398
- # Export testimonials as HTML
399
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
400
- "https://api.moltflow.com/api/v2/reviews/testimonials/export?format=html"
401
- ```
402
-
403
- ### Reviews API Reference
404
-
405
- | Endpoint | Method | Description |
406
- |----------|--------|-------------|
407
- | `/reviews/collectors` | GET/POST | List/create collectors |
408
- | `/reviews/collectors/{id}` | GET/PATCH/DELETE | Manage collector |
409
- | `/reviews/collectors/{id}/run` | POST | Trigger scan |
410
- | `/reviews` | GET | List reviews |
411
- | `/reviews/stats` | GET | Review statistics |
412
- | `/reviews/{id}` | GET/PATCH/DELETE | Manage review |
413
- | `/reviews/testimonials/export` | GET | Export (format=json/html) |
414
-
415
- **Supported languages (14+):** English, Spanish, Portuguese, French, German, Italian, Dutch, Russian, Arabic, Hebrew, Chinese, Japanese, Korean, Hindi, Turkish
416
-
417
- **Collector fields:** `name`, `session_id`, `source_type` (all/groups/chats/selected), `min_positive_words` (1-10), `min_sentiment_score` (0.0-1.0), `include_keywords`, `exclude_keywords`, `languages`
418
-
419
- ---
420
-
421
- ## 12. Auth & API Keys
422
-
423
- ```bash
424
- # Login
425
- curl -X POST -d '{"email": "user@example.com", "password": "..."}' \
426
- https://api.moltflow.com/api/v2/auth/login
427
-
428
- # Get current user
429
- curl -H "Authorization: Bearer $TOKEN" \
430
- https://api.moltflow.com/api/v2/auth/me
431
-
432
- # Create API key
433
- curl -X POST -H "Authorization: Bearer $TOKEN" \
434
- -d '{"name": "Production Key", "expires_in_days": 90}' \
435
- https://api.moltflow.com/api/v2/api-keys
436
-
437
- # Revoke key
438
- curl -X DELETE -H "Authorization: Bearer $TOKEN" \
439
- https://api.moltflow.com/api/v2/api-keys/{id}
440
-
441
- # Rotate key
442
- curl -X POST -H "Authorization: Bearer $TOKEN" \
443
- https://api.moltflow.com/api/v2/api-keys/{id}/rotate
444
- ```
445
-
446
- | Endpoint | Method | Description |
447
- |----------|--------|-------------|
448
- | `/auth/login` | POST | Login (email/password), returns JWT |
449
- | `/auth/refresh` | POST | Refresh token |
450
- | `/auth/me` | GET | Current user + tenant |
451
- | `/auth/magic-link/request` | POST | Request magic link |
452
- | `/api-keys` | GET/POST | List/create API keys |
453
- | `/api-keys/{id}` | GET/DELETE | Get/revoke key |
454
- | `/api-keys/{id}/rotate` | POST | Rotate key |
455
-
456
- ## 13. Usage & Billing
457
-
458
- ```bash
459
- # Current period usage
460
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
461
- https://api.moltflow.com/api/v2/usage/current
462
-
463
- # Daily breakdown
464
- curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
465
- "https://api.moltflow.com/api/v2/usage/daily?days=30"
466
-
467
- # List plans
468
- curl https://api.moltflow.com/api/v2/billing/plans
469
-
470
- # Create checkout session
471
- curl -X POST -H "Authorization: Bearer $TOKEN" \
472
- -d '{"plan": "pro", "cycle": "monthly", "success_url": "https://...", "cancel_url": "https://..."}' \
473
- https://api.moltflow.com/api/v2/billing/checkout
474
-
475
- # Billing portal
476
- curl -H "Authorization: Bearer $TOKEN" \
477
- https://api.moltflow.com/api/v2/billing/portal
478
- ```
479
-
480
- | Endpoint | Method | Description |
481
- |----------|--------|-------------|
482
- | `/usage/current` | GET | Current period usage + limits |
483
- | `/usage/history` | GET | Historical usage |
484
- | `/usage/daily` | GET | Daily breakdown |
485
- | `/billing/plans` | GET | Available plans |
486
- | `/billing/subscription` | GET | Current subscription |
487
- | `/billing/checkout` | POST | Stripe checkout session |
488
- | `/billing/portal` | GET | Stripe billing portal |
489
- | `/billing/cancel` | POST | Cancel subscription |
490
-
491
- ---
492
-
493
- ## Notes
494
-
495
- - All messages include anti-spam compliance (typing indicators, random delays)
496
- - Rate limits by plan: Free 10/min, Starter 60/min, Pro 300/min, Business 1000/min
497
- - Sessions require QR code pairing on first connect
498
- - Use E.164 phone format without `+` where required
499
- - AI features require Pro plan or above
500
- - A2A protocol requires Business plan
501
- - AI reply generation includes safety: input sanitization, intent verification, output filtering, PII/secrets detection
502
- - Content policy filters secrets (API keys, tokens) and PII (SSN, credit cards)
503
- - API keys use name + expires_in_days (no scopes param); raw key shown only once at creation
504
- - Respect WhatsApp opt-in, business hours, and opt-out requests
505
-
506
- <!-- FILEMAP:BEGIN -->
507
- ```text
508
- [moltflow file map]|root: .
509
- |.:{SKILL.md,package.json}
510
- |scripts:{quickstart.py,a2a_client.py,discover_agent.py,send_message.py,admin.py,ai_config.py,reviews.py}
511
- ```
512
- <!-- FILEMAP:END -->
1
+ ---
2
+ name: "WhatsApp Automation & A2A"
3
+ description: "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, labels, webhooks, AI (voice transcription, RAG, style profiles, reply generation), agent-to-agent protocol (JSON-RPC, encryption), review collection (14+ language sentiment analysis), auth, API keys, and Stripe billing."
4
+ metadata: {"openclaw":{"emoji":"📱","homepage":"https://moltflow.com","requires":{"env":["MOLTFLOW_API_KEY"]},"primaryEnv":"MOLTFLOW_API_KEY"}}
5
+ ---
6
+
7
+ # WhatsApp Automation & A2A
8
+
9
+ MoltFlow provides a complete WhatsApp automation API with managed sessions, group monitoring, AI-powered replies, agent-to-agent communication, review collection, and Stripe billing.
10
+
11
+ ## When to use
12
+
13
+ Use this skill when you need to:
14
+ - Connect and manage WhatsApp sessions (QR pairing, start/stop)
15
+ - Send text messages, list chats, read message history
16
+ - Monitor groups for leads or keywords
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)
21
+ - Train style profiles and generate AI replies
22
+ - Discover and message other AI agents (A2A JSON-RPC 2.0)
23
+ - Manage encryption keys (X25519-AES256GCM)
24
+ - Collect reviews via sentiment analysis (14+ languages)
25
+ - Export testimonials (JSON/HTML)
26
+ - Manage API keys, usage tracking, billing (Stripe)
27
+
28
+ ## Setup
29
+
30
+ Env vars:
31
+ - `MOLTFLOW_API_KEY` (required) — API key from moltflow.com dashboard
32
+ - `MOLTFLOW_API_URL` (optional) — defaults to `https://api.moltflow.com`
33
+
34
+ Authentication: `X-API-Key: $MOLTFLOW_API_KEY` header or `Authorization: Bearer $TOKEN` (JWT from login).
35
+
36
+ Base URL: `https://api.moltflow.com/api/v2`
37
+
38
+ ---
39
+
40
+ ## 1. Sessions
41
+
42
+ ```bash
43
+ # List all sessions
44
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
45
+ https://api.moltflow.com/api/v2/sessions
46
+
47
+ # Create new session
48
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
49
+ -H "Content-Type: application/json" \
50
+ -d '{"name": "Main Line"}' \
51
+ https://api.moltflow.com/api/v2/sessions
52
+
53
+ # Get session details
54
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
55
+ https://api.moltflow.com/api/v2/sessions/{session_id}
56
+
57
+ # Delete session
58
+ curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
59
+ https://api.moltflow.com/api/v2/sessions/{session_id}
60
+ ```
61
+
62
+ | Endpoint | Method | Description |
63
+ |----------|--------|-------------|
64
+ | `/sessions` | GET | List sessions |
65
+ | `/sessions` | POST | Create session |
66
+ | `/sessions/{id}` | GET | Get session details |
67
+ | `/sessions/{id}` | DELETE | Delete session |
68
+
69
+ ## 2. Messages
70
+
71
+ ```bash
72
+ # Send text message
73
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
74
+ -H "Content-Type: application/json" \
75
+ -d '{"session_id": "uuid", "chat_id": "1234567890@c.us", "message": "Hello!"}' \
76
+ https://api.moltflow.com/api/v2/messages/send
77
+
78
+ # List chats for a session
79
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
80
+ https://api.moltflow.com/api/v2/messages/chats/{session_id}
81
+
82
+ # Get chat messages
83
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
84
+ https://api.moltflow.com/api/v2/messages/chat/{session_id}/{chat_id}
85
+ ```
86
+
87
+ | Endpoint | Method | Description |
88
+ |----------|--------|-------------|
89
+ | `/messages/send` | POST | Send text message |
90
+ | `/messages/chats/{session_id}` | GET | List chats |
91
+ | `/messages/chat/{session_id}/{chat_id}` | GET | Get messages in chat |
92
+ | `/messages/{message_id}` | GET | Get single message |
93
+
94
+ ## 3. Groups
95
+
96
+ ```bash
97
+ # List monitored groups
98
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
99
+ https://api.moltflow.com/api/v2/groups
100
+
101
+ # List available WhatsApp groups
102
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
103
+ https://api.moltflow.com/api/v2/groups/available/{session_id}
104
+
105
+ # Add group to monitor
106
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
107
+ -H "Content-Type: application/json" \
108
+ -d '{"session_id": "uuid", "wa_group_id": "123456@g.us", "monitor_mode": "first_message"}' \
109
+ https://api.moltflow.com/api/v2/groups
110
+
111
+ # Update monitoring settings
112
+ curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
113
+ -H "Content-Type: application/json" \
114
+ -d '{"monitor_mode": "keyword", "monitor_keywords": ["looking for", "need help"]}' \
115
+ https://api.moltflow.com/api/v2/groups/{group_id}
116
+ ```
117
+
118
+ | Endpoint | Method | Description |
119
+ |----------|--------|-------------|
120
+ | `/groups` | GET | List monitored groups |
121
+ | `/groups/available/{session_id}` | GET | List available WhatsApp groups |
122
+ | `/groups` | POST | Add group to monitoring |
123
+ | `/groups/{id}` | GET | Get group details |
124
+ | `/groups/{id}` | PATCH | Update monitoring settings |
125
+ | `/groups/{id}` | DELETE | Remove from monitoring |
126
+
127
+ ## 4. Labels
128
+
129
+ ```bash
130
+ # Create label (color must be hex #RRGGBB)
131
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
132
+ -H "Content-Type: application/json" \
133
+ -d '{"name": "VIP", "color": "#00FF00"}' \
134
+ https://api.moltflow.com/api/v2/labels
135
+
136
+ # Sync label to WhatsApp Business
137
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
138
+ "https://api.moltflow.com/api/v2/labels/{label_id}/sync?session_id={session_id}"
139
+
140
+ # Import labels from WhatsApp Business
141
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
142
+ "https://api.moltflow.com/api/v2/labels/sync-from-whatsapp?session_id={session_id}"
143
+ ```
144
+
145
+ | Endpoint | Method | Description |
146
+ |----------|--------|-------------|
147
+ | `/labels` | GET | List labels |
148
+ | `/labels` | POST | Create label |
149
+ | `/labels/business-check` | GET | Check WhatsApp Business status |
150
+ | `/labels/{id}` | GET / PATCH / DELETE | Get, update, delete label |
151
+ | `/labels/{id}/sync` | POST | Sync to WhatsApp Business |
152
+ | `/labels/sync-from-whatsapp` | POST | Import from WhatsApp |
153
+
154
+ ## 5. Webhooks
155
+
156
+ ```bash
157
+ # List webhooks
158
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
159
+ https://api.moltflow.com/api/v2/webhooks
160
+
161
+ # Test webhook
162
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
163
+ https://api.moltflow.com/api/v2/webhooks/{webhook_id}/test
164
+ ```
165
+
166
+ | Endpoint | Method | Description |
167
+ |----------|--------|-------------|
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 |
172
+
173
+ **Webhook events:** `message.received`, `message.sent`, `message.delivered`, `message.read`, `lead.detected`, `session.connected`, `session.disconnected`, `group.message`
174
+
175
+ ---
176
+
177
+ ## 6. AI — Voice Transcription
178
+
179
+ ```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://api.moltflow.com/api/v2/ai/voice/transcribe
184
+
185
+ # Check transcription status
186
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
187
+ https://api.moltflow.com/api/v2/ai/voice/status/{task_id}
188
+
189
+ # Get transcript
190
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
191
+ https://api.moltflow.com/api/v2/ai/messages/{message_id}/transcript
192
+ ```
193
+
194
+ ## 7. AI — Knowledge Base (RAG)
195
+
196
+ ```bash
197
+ # Search knowledge base
198
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
199
+ -d '{"query": "return policy", "top_k": 5}' \
200
+ https://api.moltflow.com/api/v2/ai/knowledge/search
201
+
202
+ # List knowledge sources
203
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
204
+ https://api.moltflow.com/api/v2/ai/knowledge/sources
205
+
206
+ # Delete knowledge source
207
+ curl -X DELETE -H "X-API-Key: $MOLTFLOW_API_KEY" \
208
+ https://api.moltflow.com/api/v2/ai/knowledge/{source_id}
209
+ ```
210
+
211
+ ## 8. AI — Style Profiles (Learn Mode)
212
+
213
+ ```bash
214
+ # Train style profile from message history
215
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
216
+ -d '{"contact_id": "optional-contact-jid"}' \
217
+ https://api.moltflow.com/api/v2/ai/style/train
218
+
219
+ # Check training status
220
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
221
+ https://api.moltflow.com/api/v2/ai/style/status/{task_id}
222
+
223
+ # Get / list / delete style profiles
224
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
225
+ https://api.moltflow.com/api/v2/ai/style/profiles
226
+ ```
227
+
228
+ ## 9. AI — Reply Generation
229
+
230
+ ```bash
231
+ # Generate AI reply (uses RAG + style)
232
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
233
+ -d '{"contact_id": "jid", "context": "customer question", "use_rag": true, "apply_style": true}' \
234
+ https://api.moltflow.com/api/v2/ai/ai/generate-reply
235
+
236
+ # Preview AI reply (no usage tracking)
237
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
238
+ "https://api.moltflow.com/api/v2/ai/ai/preview?contact_id=jid&context=question&use_rag=true&apply_style=true"
239
+ ```
240
+
241
+ ### AI API Reference
242
+
243
+ | Endpoint | Method | Description |
244
+ |----------|--------|-------------|
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
+ | `/ai/style/train` | POST | Train style profile |
253
+ | `/ai/style/status/{task_id}` | GET | Training status |
254
+ | `/ai/style/profile` | GET | Get style profile |
255
+ | `/ai/style/profiles` | GET | List all profiles |
256
+ | `/ai/style/profile/{id}` | DELETE | Delete profile |
257
+ | `/ai/ai/generate-reply` | POST | Generate AI reply |
258
+ | `/ai/ai/preview` | GET | Preview reply (no tracking) |
259
+
260
+ ---
261
+
262
+ ## 10. A2A Agent-to-Agent Protocol
263
+
264
+ **Requires Business plan.** Uses JSON-RPC 2.0 over HTTPS with X25519-AES256GCM encryption.
265
+
266
+ ### Bootstrap & encryption
267
+
268
+ ```bash
269
+ # Get full configuration
270
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
271
+ https://api.moltflow.com/api/v2/agent/bootstrap
272
+
273
+ # Get your public key (auto-generates if none)
274
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
275
+ https://api.moltflow.com/api/v2/agent/public-key
276
+
277
+ # Rotate keypair
278
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
279
+ https://api.moltflow.com/api/v2/agent/rotate-keys
280
+ ```
281
+
282
+ ### Discover agents
283
+
284
+ ```bash
285
+ # Resolve phone to MoltFlow agent
286
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
287
+ https://api.moltflow.com/api/v2/agents/resolve/+1234567890
288
+
289
+ # List peers
290
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
291
+ https://api.moltflow.com/api/v2/agents/peers
292
+
293
+ # Update trust level (discovered, verified, blocked)
294
+ curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
295
+ -H "Content-Type: application/json" \
296
+ -d '{"trust_level": "verified"}' \
297
+ https://api.moltflow.com/api/v2/agents/peers/{peer_id}/trust
298
+ ```
299
+
300
+ ### Send A2A messages (JSON-RPC 2.0)
301
+
302
+ ```bash
303
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
304
+ -H "Content-Type: application/json" \
305
+ -d '{
306
+ "jsonrpc": "2.0",
307
+ "method": "agent.message.send",
308
+ "params": {
309
+ "phone": "+1234567890",
310
+ "message": {"parts": [{"text": "Hello from my agent!"}]}
311
+ },
312
+ "id": "1"
313
+ }' \
314
+ https://api.moltflow.com/api/v2/a2a
315
+ ```
316
+
317
+ ### Content policy
318
+
319
+ ```bash
320
+ # Get policy settings
321
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
322
+ https://api.moltflow.com/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://api.moltflow.com/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://api.moltflow.com/api/v2/a2a-policy/test
335
+ ```
336
+
337
+ ### A2A API Reference
338
+
339
+ | Endpoint | Method | Description |
340
+ |----------|--------|-------------|
341
+ | `/agent/bootstrap` | GET | Full onboarding config |
342
+ | `/agent/public-key` | GET | Get X25519 public key |
343
+ | `/agent/rotate-keys` | POST | Rotate keypair |
344
+ | `/agent/peer/{tenant_id}/public-key` | GET | Peer's public key |
345
+ | `/agents/resolve/{phone}` | GET | Resolve phone to agent |
346
+ | `/agents/peers` | GET | List discovered peers |
347
+ | `/agents/peers/{id}/trust` | PATCH | Update trust level |
348
+ | `/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
+
354
+ **JSON-RPC methods:** `agent.message.send`, `group.getContext`, `agent.group.create`, `agent.group.invite`, `agent.group.list`, `webhook_manager`
355
+
356
+ **Trust levels:** `discovered` `verified` `blocked`
357
+
358
+ **Encryption:** X25519-AES256GCM, ECDH key exchange, HKDF-SHA256, 32-byte keys (base64)
359
+
360
+ ---
361
+
362
+ ## 11. Reviews — Sentiment Analysis & Testimonials
363
+
364
+ ```bash
365
+ # Create review collector
366
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
367
+ -d '{
368
+ "name": "Customer Feedback",
369
+ "session_id": "uuid-of-whatsapp-session",
370
+ "source_type": "groups",
371
+ "min_positive_words": 3,
372
+ "min_sentiment_score": 0.6,
373
+ "include_keywords": ["great", "excellent"],
374
+ "languages": []
375
+ }' \
376
+ https://api.moltflow.com/api/v2/reviews/collectors
377
+
378
+ # Trigger manual scan
379
+ curl -X POST -H "X-API-Key: $MOLTFLOW_API_KEY" \
380
+ https://api.moltflow.com/api/v2/reviews/collectors/{id}/run
381
+
382
+ # List reviews
383
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
384
+ "https://api.moltflow.com/api/v2/reviews?approved_only=false&limit=50"
385
+
386
+ # Approve review
387
+ curl -X PATCH -H "X-API-Key: $MOLTFLOW_API_KEY" \
388
+ -d '{"is_approved": true}' \
389
+ https://api.moltflow.com/api/v2/reviews/{id}
390
+
391
+ # Export testimonials as HTML
392
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
393
+ "https://api.moltflow.com/api/v2/reviews/testimonials/export?format=html"
394
+ ```
395
+
396
+ ### Reviews API Reference
397
+
398
+ | Endpoint | Method | Description |
399
+ |----------|--------|-------------|
400
+ | `/reviews/collectors` | GET/POST | List/create collectors |
401
+ | `/reviews/collectors/{id}` | GET/PATCH/DELETE | Manage collector |
402
+ | `/reviews/collectors/{id}/run` | POST | Trigger scan |
403
+ | `/reviews` | GET | List reviews |
404
+ | `/reviews/stats` | GET | Review statistics |
405
+ | `/reviews/{id}` | GET/PATCH/DELETE | Manage review |
406
+ | `/reviews/testimonials/export` | GET | Export (format=json/html) |
407
+
408
+ **Supported languages (14+):** English, Spanish, Portuguese, French, German, Italian, Dutch, Russian, Arabic, Hebrew, Chinese, Japanese, Korean, Hindi, Turkish
409
+
410
+ **Collector fields:** `name`, `session_id`, `source_type` (all/groups/chats/selected), `min_positive_words` (1-10), `min_sentiment_score` (0.0-1.0), `include_keywords`, `exclude_keywords`, `languages`
411
+
412
+ ---
413
+
414
+ ## 12. Auth & API Keys
415
+
416
+ ```bash
417
+ # Login
418
+ curl -X POST -d '{"email": "user@example.com", "password": "..."}' \
419
+ https://api.moltflow.com/api/v2/auth/login
420
+
421
+ # Get current user
422
+ curl -H "Authorization: Bearer $TOKEN" \
423
+ https://api.moltflow.com/api/v2/auth/me
424
+
425
+ # Create API key
426
+ curl -X POST -H "Authorization: Bearer $TOKEN" \
427
+ -d '{"name": "Production Key", "expires_in_days": 90}' \
428
+ https://api.moltflow.com/api/v2/api-keys
429
+
430
+ # Revoke key
431
+ curl -X DELETE -H "Authorization: Bearer $TOKEN" \
432
+ https://api.moltflow.com/api/v2/api-keys/{id}
433
+
434
+ # Rotate key
435
+ curl -X POST -H "Authorization: Bearer $TOKEN" \
436
+ https://api.moltflow.com/api/v2/api-keys/{id}/rotate
437
+ ```
438
+
439
+ | Endpoint | Method | Description |
440
+ |----------|--------|-------------|
441
+ | `/auth/login` | POST | Login (email/password), returns JWT |
442
+ | `/auth/refresh` | POST | Refresh token |
443
+ | `/auth/me` | GET | Current user + tenant |
444
+ | `/auth/magic-link/request` | POST | Request magic link |
445
+ | `/api-keys` | GET/POST | List/create API keys |
446
+ | `/api-keys/{id}` | GET/DELETE | Get/revoke key |
447
+ | `/api-keys/{id}/rotate` | POST | Rotate key |
448
+
449
+ ## 13. Usage & Billing
450
+
451
+ ```bash
452
+ # Current period usage
453
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
454
+ https://api.moltflow.com/api/v2/usage/current
455
+
456
+ # Daily breakdown
457
+ curl -H "X-API-Key: $MOLTFLOW_API_KEY" \
458
+ "https://api.moltflow.com/api/v2/usage/daily?days=30"
459
+
460
+ # List plans
461
+ curl https://api.moltflow.com/api/v2/billing/plans
462
+
463
+ # Create checkout session
464
+ curl -X POST -H "Authorization: Bearer $TOKEN" \
465
+ -d '{"plan": "pro", "cycle": "monthly", "success_url": "https://...", "cancel_url": "https://..."}' \
466
+ https://api.moltflow.com/api/v2/billing/checkout
467
+
468
+ # Billing portal
469
+ curl -H "Authorization: Bearer $TOKEN" \
470
+ https://api.moltflow.com/api/v2/billing/portal
471
+ ```
472
+
473
+ | Endpoint | Method | Description |
474
+ |----------|--------|-------------|
475
+ | `/usage/current` | GET | Current period usage + limits |
476
+ | `/usage/history` | GET | Historical usage |
477
+ | `/usage/daily` | GET | Daily breakdown |
478
+ | `/billing/plans` | GET | Available plans |
479
+ | `/billing/subscription` | GET | Current subscription |
480
+ | `/billing/checkout` | POST | Stripe checkout session |
481
+ | `/billing/portal` | GET | Stripe billing portal |
482
+ | `/billing/cancel` | POST | Cancel subscription |
483
+
484
+ ---
485
+
486
+ ## Notes
487
+
488
+ - All messages include anti-spam compliance (typing indicators, random delays)
489
+ - Rate limits by plan: Free 10/min, Starter 60/min, Pro 300/min, Business 1000/min
490
+ - Sessions require QR code pairing on first connect
491
+ - Use E.164 phone format without `+` where required
492
+ - AI features require Pro plan or above
493
+ - 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)
496
+ - API keys use name + expires_in_days (no scopes param); raw key shown only once at creation
497
+ - Respect WhatsApp opt-in, business hours, and opt-out requests
498
+
499
+ <!-- FILEMAP:BEGIN -->
500
+ ```text
501
+ [moltflow file map]|root: .
502
+ |.:{SKILL.md,package.json}
503
+ |scripts:{quickstart.py,a2a_client.py,send_message.py,admin.py,ai_config.py,reviews.py}
504
+ ```
505
+ <!-- FILEMAP:END -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moltflow/skills",
3
- "version": "1.0.0",
3
+ "version": "1.2.0",
4
4
  "description": "MoltFlow — complete WhatsApp automation platform: sessions, messaging, groups, AI, A2A protocol, reviews, billing.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -1,54 +0,0 @@
1
- #!/usr/bin/env python3
2
- """
3
- A2A Discovery Script
4
- Fetches and validates the agent.json card.
5
- """
6
- import requests
7
- import sys
8
- import json
9
- import argparse
10
- from typing import Dict, Any
11
-
12
- def discover_agent(base_url: str) -> Dict[str, Any]:
13
- """
14
- Fetch the .well-known/agent.json from the base URL.
15
- """
16
- # Ensure URL doesn't end with slash to avoid double slashes
17
- url = f"{base_url.rstrip('/')}/.well-known/agent.json"
18
-
19
- try:
20
- response = requests.get(url, timeout=10)
21
- response.raise_for_status()
22
-
23
- data = response.json()
24
-
25
- # Validation
26
- if "supportedInterfaces" not in data:
27
- print(f"WARNING: {url} response missing 'supportedInterfaces'.", file=sys.stderr)
28
-
29
- return data
30
-
31
- except requests.exceptions.RequestException as e:
32
- # Return a structured error for the agent to parse
33
- return {
34
- "error": True,
35
- "message": f"Discovery failed: {str(e)}",
36
- "url": url
37
- }
38
- except json.JSONDecodeError:
39
- return {
40
- "error": True,
41
- "message": "Invalid JSON response from endpoint",
42
- "url": url
43
- }
44
-
45
- if __name__ == "__main__":
46
- parser = argparse.ArgumentParser(description="Discover MoltFlow Agent capabilities.")
47
- parser.add_argument("url", help="Base URL of the agent (e.g., https://api.waiflow.app)")
48
-
49
- args = parser.parse_args()
50
-
51
- card = discover_agent(args.url)
52
-
53
- # Output solely JSON for easy parsing by calling agent
54
- print(json.dumps(card, indent=2))