@rubytech/taskmaster 1.29.2 → 1.30.1

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 (52) hide show
  1. package/dist/agents/model-fallback.js +9 -9
  2. package/dist/agents/subagent-announce.js +10 -2
  3. package/dist/agents/tools/cron-tool.js +10 -3
  4. package/dist/agents/tools/skill-read-tool.js +18 -1
  5. package/dist/agents/workspace-migrations.js +48 -0
  6. package/dist/build-info.json +3 -3
  7. package/dist/control-ui/assets/{index-C-AxOsfW.js → index-CkGA_2Sq.js} +494 -423
  8. package/dist/control-ui/assets/index-CkGA_2Sq.js.map +1 -0
  9. package/dist/control-ui/assets/{index-BwiQeiEa.css → index-CxVLKv6r.css} +1 -1
  10. package/dist/control-ui/index.html +2 -2
  11. package/dist/cron/normalize.js +8 -4
  12. package/dist/cron/parse.js +48 -7
  13. package/dist/cron/service/jobs.js +4 -1
  14. package/dist/cron/service/ops.js +16 -0
  15. package/dist/gateway/server-methods/whatsapp-conversations.js +41 -7
  16. package/dist/web/auto-reply/monitor/group-activation.js +1 -1
  17. package/dist/web/inbound/monitor.js +34 -3
  18. package/extensions/.npmignore +1 -0
  19. package/package.json +52 -62
  20. package/scripts/install.sh +0 -0
  21. package/skills/event-management/references/events.md +16 -6
  22. package/skills/whatsapp-business/SKILL.md +47 -0
  23. package/skills/whatsapp-business/references/setup-guide.md +258 -0
  24. package/templates/.DS_Store +0 -0
  25. package/templates/beagle-taxi/.DS_Store +0 -0
  26. package/templates/beagle-taxi/agents/.DS_Store +0 -0
  27. package/templates/beagle-taxi/memory/.DS_Store +0 -0
  28. package/templates/beagle-taxi/skills/.DS_Store +0 -0
  29. package/templates/beagle-zanzibar/.DS_Store +0 -0
  30. package/templates/beagle-zanzibar/agents/.DS_Store +0 -0
  31. package/templates/beagle-zanzibar/memory/.DS_Store +0 -0
  32. package/templates/beagle-zanzibar/skills/.DS_Store +0 -0
  33. package/templates/customer/.DS_Store +0 -0
  34. package/templates/customer/agents/.DS_Store +0 -0
  35. package/templates/education-hero/.DS_Store +0 -0
  36. package/templates/education-hero/agents/.DS_Store +0 -0
  37. package/templates/education-hero/agents/admin/.DS_Store +0 -0
  38. package/templates/education-hero/skills/.DS_Store +0 -0
  39. package/templates/education-hero/skills/education-hero/.DS_Store +0 -0
  40. package/templates/maxy/.DS_Store +0 -0
  41. package/templates/maxy/.gitignore +1 -0
  42. package/templates/maxy/agents/.DS_Store +0 -0
  43. package/templates/maxy/agents/admin/.DS_Store +0 -0
  44. package/templates/maxy/memory/.DS_Store +0 -0
  45. package/templates/maxy/skills/.DS_Store +0 -0
  46. package/templates/real-agent/.DS_Store +0 -0
  47. package/templates/real-agent/skills/.DS_Store +0 -0
  48. package/templates/taskmaster/.DS_Store +0 -0
  49. package/templates/taskmaster/.gitignore +1 -0
  50. package/templates/taskmaster/agents/public/AGENTS.md +16 -0
  51. package/templates/taskmaster/skills/.DS_Store +0 -0
  52. package/dist/control-ui/assets/index-C-AxOsfW.js.map +0 -1
@@ -0,0 +1,258 @@
1
+ # WhatsApp Business Cloud API — Setup Guide
2
+
3
+ Walk the user through the full Meta Cloud API setup from scratch: Business Portfolio → WABA → number registration → System User token → webhook → Taskmaster config.
4
+
5
+ ## Before You Start
6
+
7
+ **Remote Access must be enabled first.** Cloud API requires a publicly reachable webhook URL so Meta can deliver messages. Check that Remote Access (Tailscale Funnel) is active in Setup. If it isn't, the "Cloud API" option in Setup will be greyed out. Guide the user to enable it before proceeding — the `taskmaster` skill has a Remote Access setup guide.
8
+
9
+ **Only one QR-linked (Baileys) account is supported per workspace.** If the workspace already has a Baileys account, the Baileys option will be greyed out in Setup. Cloud API accounts have no Taskmaster-enforced limit (Meta allows up to 2 phone numbers per WABA on the free tier).
10
+
11
+ **Sessions are shared across numbers.** Taskmaster sessions are keyed by customer phone number, not by which WhatsApp number they messaged. A customer who texts both the Baileys number and a Cloud API number lands in the same conversation thread. This is usually desirable (one agent, continuous history), but means the agent cannot distinguish which number the customer used.
12
+
13
+ 1. Check memory (e.g. `memory/admin/infrastructure.md`) for the public URL — do NOT ask the user for it. Construct the webhook URL as `https://{public-host}/webhook/whatsapp`. The Setup page shows this URL automatically once Remote Access is active.
14
+ 2. The user needs a phone number that has never been registered with WhatsApp — or one that has been fully deleted from any previous WhatsApp account. A fresh SIM or a VoIP number works. They said they already have one — confirm this.
15
+ 3. Have the user ready at a desktop browser.
16
+
17
+ ## What to tell the user upfront
18
+
19
+ > "To connect via Meta's official WhatsApp Business API, we need to set up four things in Meta:
20
+ >
21
+ > 1. A Meta Business Portfolio (if you don't have one)
22
+ > 2. A WhatsApp Business Account with your new number registered
23
+ > 3. A permanent access token from a System User
24
+ > 4. A webhook so Meta can send messages to Taskmaster
25
+ >
26
+ > This takes about 15–20 minutes. I'll guide you through each step."
27
+
28
+ ---
29
+
30
+ ## Step 1: Meta Business Portfolio
31
+
32
+ **URL: business.facebook.com**
33
+
34
+ > "Go to **business.facebook.com** and sign in with your Facebook/Meta account.
35
+ >
36
+ > If you see a Business Portfolio dashboard, you're good. If you're prompted to create one, click **Create account**, enter your business name, and follow the prompts."
37
+
38
+ Wait for confirmation.
39
+
40
+ ---
41
+
42
+ ## Step 2: Create a WhatsApp Business Account (WABA) and register the phone number
43
+
44
+ This is a single 3-step wizard in Meta Business Suite that covers both WABA creation and phone number registration.
45
+
46
+ **Before starting the wizard**, make sure the Business Portfolio has complete contact information — Meta will block the wizard if it doesn't:
47
+
48
+ > "First, click the gear icon (⚙) at the bottom-left to open Settings → **Business info**.
49
+ >
50
+ > Check that the following are filled in: business address (street, city, postcode, country), phone number, and email. If any are missing, add them and save before continuing."
51
+
52
+ Then start the wizard:
53
+
54
+ > "Still in Settings, click the gear icon (⚙) at the bottom-left of business.facebook.com to open Settings.
55
+ >
56
+ > In the left sidebar, click **Accounts** → **WhatsApp accounts**.
57
+ >
58
+ > Click the **+ Add** button (top-right), then choose **Create a new WhatsApp business account** (not 'Link')."
59
+
60
+ **Step 2a — Details:**
61
+ > "Fill in:
62
+ > - **WhatsApp business display name** — your business name (e.g. Beagle Taxi)
63
+ > - **Category** — choose the most appropriate (e.g. Travel and transportation)
64
+ > - Optionally expand **Show more options** to set timezone, description, and website
65
+ >
66
+ > Click **Continue**."
67
+
68
+ **Step 2b — Phone number:**
69
+ > "Enter your dedicated phone number. Click **Continue**."
70
+
71
+ **Step 2c — Phone verification:**
72
+ > "Meta will call or SMS the number with a verification code. Enter the code to confirm ownership."
73
+
74
+ Wait for confirmation the WABA and phone number are verified and the wizard has completed.
75
+
76
+ ---
77
+
78
+ ## Step 3: Get the Business Account ID and Phone Number ID
79
+
80
+ Now open WhatsApp Manager (the WABA now exists, so access is granted):
81
+
82
+ > "In your browser, go to: **https://business.facebook.com/latest/whatsapp_manager**"
83
+
84
+ **Phone Number ID:**
85
+ > "In the left sidebar, click **Phone numbers**. Click on your number to open its details.
86
+ >
87
+ > Look for **Phone number ID** — a long string of digits. Copy it and send it to me."
88
+
89
+ Store as `phoneNumberId` in config.
90
+
91
+ **Business Account ID (WABA ID):**
92
+ > "At the top of WhatsApp Manager, near your account name, you'll see the **WhatsApp Business Account ID** (a long number). Copy it and send it to me."
93
+
94
+ Store as `businessAccountId` in config.
95
+
96
+ ---
97
+
98
+ ## Step 5: Create a Meta App (if needed)
99
+
100
+ To use the Cloud API, you need a Meta Developer App linked to your WABA.
101
+
102
+ **URL: developers.facebook.com/apps**
103
+
104
+ > "Go to **developers.facebook.com/apps** and sign in.
105
+ >
106
+ > Click **Create App**. Choose **Business** as the app type. Enter a name (e.g. 'Taskmaster') and click **Create app**."
107
+
108
+ Once the app is created:
109
+
110
+ > "Inside the app dashboard, click **Add Product** → find **WhatsApp** → click **Set up**.
111
+ >
112
+ > You'll be asked to connect a WhatsApp Business Account. Select the WABA you just created."
113
+
114
+ Wait for confirmation.
115
+
116
+ ---
117
+
118
+ ## Step 6: Create a System User with a permanent access token
119
+
120
+ User access tokens expire. A System User token is permanent.
121
+
122
+ **Navigation: business.facebook.com → Business Settings → System Users**
123
+
124
+ > "Go back to **business.facebook.com**. In the left sidebar, click **Business Settings** → **Users** → **System Users**.
125
+ >
126
+ > Click **Add** and create a new system user:
127
+ > - **Name:** something like 'Taskmaster Bot'
128
+ > - **Role:** Admin (needed to send messages)
129
+ >
130
+ > Click **Add system user**."
131
+
132
+ Now grant the system user access to the WhatsApp asset:
133
+
134
+ > "With the system user selected, click **Add Assets**.
135
+ >
136
+ > Choose **Apps**, find your Taskmaster app, tick **Manage app**, and click **Save changes**.
137
+ >
138
+ > Then choose **WhatsApp Accounts**, select your WABA, tick **Full control**, and click **Save changes**."
139
+
140
+ Now generate the token:
141
+
142
+ > "Click **Generate token** at the top of the system user page.
143
+ >
144
+ > Select your Taskmaster app from the dropdown.
145
+ >
146
+ > Tick these permissions: `whatsapp_business_messaging` and `whatsapp_business_management`.
147
+ >
148
+ > Set expiry to **Never**.
149
+ >
150
+ > Click **Generate token** and copy the token — it starts with `EAA...`. Send it to me."
151
+
152
+ Validate: must start with `EAA`, 100+ characters.
153
+
154
+ Store: enter as Access Token in Taskmaster UI (next step).
155
+
156
+ ---
157
+
158
+ ## Step 7: Generate a Webhook Verify Token
159
+
160
+ The verify token is a shared secret you define — Meta sends it to Taskmaster when verifying the webhook.
161
+
162
+ > "We need a short random string for the webhook verify token. I'll suggest one — or you can make up your own (letters and numbers, no spaces):
163
+ >
164
+ > `tm-{random 8 chars}` — for example: `tm-xk29mq7r`
165
+ >
166
+ > This goes into both Taskmaster and Meta. Note it down."
167
+
168
+ ---
169
+
170
+ ## Step 8: Enter credentials in Taskmaster
171
+
172
+ > "Now open the Taskmaster control panel at `{control_panel_url}`.
173
+ >
174
+ > Go to **Setup** → find the WhatsApp row → click the gear icon → scroll to **Add Cloud API Account**.
175
+ >
176
+ > Enter:
177
+ > - **Account name:** something like 'Business' or 'Meta'
178
+ > - **Phone Number ID:** (from Step 4)
179
+ > - **Business Account ID:** (from Step 4)
180
+ > - **Access Token:** (from Step 6)
181
+ > - **Webhook Verify Token:** (from Step 7)
182
+ >
183
+ > Click **Add Account**. Note the **Webhook URL** shown — you'll need it in the next step."
184
+
185
+ Wait for confirmation. The webhook URL will be shown in the UI after saving.
186
+
187
+ ---
188
+
189
+ ## Step 9: Configure the webhook in Meta
190
+
191
+ **Navigation: developers.facebook.com → Your App → WhatsApp → Configuration → Webhooks**
192
+
193
+ > "Back in the Meta Developer App dashboard:
194
+ >
195
+ > Click **WhatsApp** in the left sidebar → **Configuration**.
196
+ >
197
+ > Under **Webhooks**, click **Edit** (or **Configure webhooks**).
198
+ >
199
+ > Enter:
200
+ > - **Callback URL:** `{webhook_url}` (from the Taskmaster UI in the previous step)
201
+ > - **Verify token:** `{verify_token}` (the string from Step 7)
202
+ >
203
+ > Click **Verify and save**."
204
+
205
+ Meta will send a GET request to Taskmaster to verify. If it succeeds, the webhook status changes to Verified.
206
+
207
+ > "After verification, subscribe to webhook fields. Tick **messages** under the WhatsApp Business Account section. Click **Save**."
208
+
209
+ Wait for confirmation.
210
+
211
+ ---
212
+
213
+ ## Step 10: Confirm
214
+
215
+ > "WhatsApp Business Cloud API is now connected:
216
+ >
217
+ > - **Number:** {phone number} — registered with Meta
218
+ > - **Provider:** Meta Cloud API (webhook-based, no phone dependency)
219
+ > - **Webhook:** verified and subscribed
220
+ >
221
+ > Send a test message to the number from a customer's phone. Taskmaster should respond within a few seconds."
222
+
223
+ Store setup details in memory (WABA ID, phone number ID, app name, webhook URL, system user name) for future reference.
224
+
225
+ ---
226
+
227
+ ## Webhook URL
228
+
229
+ The webhook URL is always: `https://{public-host}/webhook/whatsapp`
230
+
231
+ Where `{public-host}` is the device's public URL (Tailscale Funnel or other tunnel). This must be accessible from the public internet — Meta's servers must be able to reach it.
232
+
233
+ ---
234
+
235
+ ## Troubleshooting
236
+
237
+ | Problem | Solution |
238
+ |---------|----------|
239
+ | "Setup can't be completed — business has not met WhatsApp's policy requirements" | The Business Portfolio is missing contact information. Go to Settings → **Business info** and fill in: business address (street, city, postcode, country), phone number, and email. Save, then retry the WABA creation wizard. |
240
+ | Webhook verification fails | Check the webhook URL is publicly accessible (not just on Tailscale). Tailscale Funnel must be enabled. Check the verify token matches exactly. |
241
+ | Phone number already in use | The number must be removed from any existing WhatsApp account first. Go to WhatsApp app → Settings → Linked Devices and remove if it's there. Or contact Meta support if it's stuck. |
242
+ | Token expires | System User tokens with "Never" expiry don't expire. If it does, regenerate in Business Settings → System Users → Generate token. |
243
+ | Messages not arriving | Check webhook subscription: App Dashboard → WhatsApp → Configuration → confirm "messages" field is subscribed. |
244
+ | "Permission denied" errors | System user needs Admin role AND asset access to both the App and the WABA. Recheck Step 6. |
245
+ | 401 from Meta API | Access token invalid or revoked. Regenerate in Business Settings → System Users. |
246
+ | Number not eligible | Some VoIP numbers are rejected by Meta. Use a real mobile number or try a different VoIP provider. |
247
+
248
+ ---
249
+
250
+ ## Test vs Live
251
+
252
+ | | Test number | Registered number |
253
+ |---|---|---|
254
+ | Provided by | Meta (in Developer app sandbox) | You register your own number |
255
+ | Recipients | Only pre-approved test numbers | Any WhatsApp user |
256
+ | For | Development and testing | Production |
257
+
258
+ The Developer App sandbox provides a free test number and pre-approved recipients. Use it to verify the integration works before registering your real business number.
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ .DS_Store
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -0,0 +1 @@
1
+ .DS_Store
@@ -10,6 +10,22 @@ Before doing anything else:
10
10
 
11
11
  ---
12
12
 
13
+ ## Write Permissions
14
+
15
+ Your memory writes are restricted by scope. Only these paths are writable:
16
+
17
+ - `memory/users/{phone}/**` — user profiles and data (DM conversations only)
18
+ - `memory/groups/{groupId}/**` — group member profiles and data (group conversations only)
19
+ - `memory/shared/events/**` — shared event data
20
+
21
+ Everything else is **read-only**. In particular:
22
+ - `memory/public/` — read-only (knowledge base, product info)
23
+ - `memory/shared/` outside `events/` — read-only
24
+
25
+ If a write fails with "scope restricted", do not retry with the same or similar path. The restriction is permanent. Store the data under an allowed path instead.
26
+
27
+ ---
28
+
13
29
  ## Memory Usage
14
30
 
15
31
  Your conversation history is your primary context. Memory is supplementary — use it when the conversation doesn't have what you need.