whatsapp-pi 1.0.47 → 1.0.49

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/README.md CHANGED
@@ -8,15 +8,18 @@ A WhatsApp integration extension for the **[Pi Coding Agent](https://github.com/
8
8
 
9
9
  [![GitHub](https://img.shields.io/badge/github-repo-black.svg?style=flat-square&logo=github)](https://github.com/RaphaCastelloes/whatsapp-pi)
10
10
 
11
- Pi is a powerful agentic AI coding assistant that operates in your terminal. This extension allows you to chat and pair-program with your Pi agent directly through WhatsApp, featuring message filtering, allow-listing, recents/history browsing, message detail/reply, group-only binding, and reliable message delivery.
11
+ Pi is a powerful agentic AI coding assistant that operates in your terminal. This extension lets you chat and pair-program with your Pi agent through WhatsApp, with message filtering, allowed contacts/groups, recents/history browsing, message detail/reply, group-only binding, and reliable message delivery.
12
12
 
13
13
  ## Features
14
14
 
15
15
  - **Manual WhatsApp Connection**: QR code-based authentication with session persistence
16
- - **Allow List**: Control which numbers can interact with Pi
16
+ - **Allowed Contacts**: Control which phone numbers can interact with Pi
17
17
  - Add contacts with optional names for easy identification
18
- - View ignored numbers (not in allow list) and add them when needed
19
- - Manage aliases and print allowed numbers from the menu
18
+ - View ignored numbers (not yet allowed) and add them when needed
19
+ - Manage aliases and print allowed contacts from the menu
20
+ - **Allowed Groups**: Control which WhatsApp groups can interact with Pi
21
+ - Add group JIDs with optional aliases
22
+ - Only groups in Allowed Groups are processed by the agent
20
23
  - **Recents & History**: Browse recent conversations, inspect full message history, and reply from message detail view
21
24
  - **Reliable Messaging**: Queue-based message sending with retry logic
22
25
  - **TUI Integration**: Menu-driven interface for managing connections, contacts, and recent chats
@@ -45,18 +48,25 @@ To enable PDF reading capabilities (required for the agent to process documents)
45
48
  pi install npm:whatsapp-pi
46
49
  ```
47
50
 
48
- 2. Start Pi (the extension will load automatically once installed):
51
+ 2. Start Pi:
49
52
  ```bash
50
53
  pi
51
54
  ```
52
55
 
53
- After connecting WhatsApp once from the menu and scanning the QR code, you can start Pi with auto-connect enabled:
56
+ 3. Open `/whatsapp` and choose **Connect / Reconnect WhatsApp**.
57
+ - QR appears only on first pair or after logoff.
58
+
59
+ 4. Add the chat you will use with Pi to **Allowed Contacts** or **Allowed Groups**.
60
+
61
+ 5. Send a message from that allowed chat to Pi.
62
+ - Pi replies in same thread.
63
+ - Use **Recents** only to browse history or reply manually.
64
+
65
+ After first pairing, you can start Pi with auto-connect enabled:
54
66
  ```bash
55
67
  pi --whatsapp-pi-online
56
68
  ```
57
69
 
58
- 3. Use the menu to connect WhatsApp and manage allowed/blocked numbers
59
-
60
70
  ## Development / Testing
61
71
 
62
72
  If you are developing or testing the extension locally, you can clone the repository from [GitHub](https://github.com/RaphaCastelloes/whatsapp-pi):
@@ -83,6 +93,20 @@ To test startup auto-connect locally after you have already paired WhatsApp:
83
93
  pi -e whatsapp-pi.ts --whatsapp-pi-online
84
94
  ```
85
95
 
96
+ ## How It Works
97
+
98
+ - Pi processes **incoming** messages only from allowed contacts or allowed groups.
99
+ - **Recents** is history browser, not trigger.
100
+ - **Send Message** and `send_wa_message` are outbound only.
101
+ - If you message yourself, WhatsApp may show sent/read ticks, but that does not guarantee Pi will treat it as a trigger.
102
+
103
+ ## WhatsApp Numbers and JIDs
104
+
105
+ - Contacts use phone format in UI: `+5511999999999`
106
+ - Internally, contacts map to JIDs like `5511999999999@s.whatsapp.net`
107
+ - Groups use JIDs like `120363012345@g.us`
108
+ - Recents may show normalized values from WhatsApp, so use **Print Contact** / **Print Group JID** and aliases to avoid confusion.
109
+
86
110
  ## Commands
87
111
 
88
112
  - `/whatsapp` - Open the WhatsApp management menu
@@ -92,28 +116,27 @@ pi -e whatsapp-pi.ts --whatsapp-pi-online
92
116
  - **Disconnect WhatsApp** - Stop WhatsApp connection
93
117
  - **Logoff (Delete Session)** - Remove all credentials and session data
94
118
  - **Recents** - Open recent conversations, view history, and reply
95
- - **Allowed Numbers** - Manage contacts that can interact with Pi
96
- - **Blocked Numbers** - View ignored numbers and manage them
119
+ - **Allowed Contacts** - Manage contacts that can interact with Pi
120
+ - **Allowed Groups** - Manage WhatsApp groups that can interact with Pi
121
+
122
+ ### Allowed Contacts Management
123
+ - **Add Contact** - Add a new contact to the allowed contacts list (format: +5511999999999)
124
+ - **Select a contact** - Open a submenu with **History**, **Send Message**, **Print Contact**, alias actions, **Remove Contact**, and **Back**
125
+ - **Back** - Return to main menu
97
126
 
98
- ### Allowed Numbers Management
99
- - **Add Number** - Add a new contact to the allow list (format: +5511999999999)
100
- - **Select a contact** - Open a submenu with **History**, **Send Message**, **Print Number**, alias actions, **Remove Number**, and **Back**
127
+ ### Allowed Groups Management
128
+ - **Add Group** - Add a WhatsApp group JID to the allowed groups list (format: 120363012345@g.us)
129
+ - **Select a group** - Open a submenu with **History**, **Send Message**, **Print Group JID**, alias actions, **Remove Group**, and **Back**
101
130
  - **Back** - Return to main menu
102
131
 
103
132
  ### Recents Management
104
133
  - **History** - Open full message history for that conversation
105
134
  - **Send Message** - Send a new message without Pi suffix
106
135
  - **Reply** - Open message detail, then press `R` to reply
107
- - **Allow Number** - Move a recent sender into the allow list
136
+ - **Allow Contact / Allow Group** - Move a recent sender into the appropriate allowed list
108
137
  - **Remove Alias** - Clear saved alias for that sender
109
138
  - **Back** - Return to main menu
110
139
 
111
- ### Blocked Numbers Management
112
- - **View List** - See all numbers that have been ignored (not in allow list)
113
- - **Allow** - Move a blocked number to the allowed list
114
- - **Delete** - Remove a number from the blocked list
115
- - **Back** - Return to main menu
116
-
117
140
  ## Project Structure
118
141
 
119
142
  ```
@@ -138,7 +161,7 @@ npm test
138
161
  ### Recent Feature Updates (2026-05)
139
162
 
140
163
  - **Auto-Connect Support**: Use the `--whatsapp-pi-online` flag to connect on startup when credentials already exist.
141
- - **Group-Only Mode**: Use `--whatsapp-group <jid>` to bind Pi to a single WhatsApp group.
164
+ - **Group-Only Mode**: Use `--whatsapp-group <jid>` to bind Pi to a single WhatsApp group. The group must also be present in Allowed Groups.
142
165
  - **Recents Store**: Recent conversations and message history are persisted in `~/.pi/whatsapp-pi/recents/recents.json`.
143
166
  - **Message Detail / Reply**: Open a message from history to inspect full content and reply with `R`.
144
167
  - **Media Support**: Images are forwarded for vision analysis, audio is transcribed with Whisper, and documents are saved under `./.pi-data/whatsapp/documents/`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whatsapp-pi",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "type": "module",
5
5
  "description": "WhatsApp integration extension for Pi",
6
6
  "main": "whatsapp-pi.ts",