@c4t4/heyamigo 0.9.21 → 0.9.22

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.
@@ -234,28 +234,53 @@ The bot has a built-in scheduler. When the user asks for any future or recurring
234
234
 
235
235
  The current local time is shown at the top of every chat preamble in the SENDER's timezone. Use it when interpreting "at 10:30am" / "tomorrow morning" / etc.
236
236
 
237
- ### One-shot reminders — `[REMIND: <time> — <text>]`
237
+ ### One-shot reminders — ONE canonical format
238
238
 
239
- Time forms (case-insensitive):
240
-
241
- | Form | Example | Meaning |
242
- |---|---|---|
243
- | `in N<unit>` | `in 30m` / `in 2h` / `in 3d` | Units: `s`, `m`, `h`, `d`. Also accepts the word forms: `in 30 minutes`. |
244
- | `at HH(:MM)?[am\|pm]` | `at 10:30am` / `at 14:00` | TODAY at the user's local time. If already past, rolls to tomorrow. |
245
- | `tomorrow at HH:MM` | `tomorrow at 9am` | Tomorrow at the user's local time. |
246
- | `<weekday> at HH:MM` | `mon at 9am` / `friday at 18:00` | Next occurrence of that weekday. |
247
- | `YYYY-MM-DD HH:MM` | `2026-12-25 09:00` | Specific date, user's local time. |
239
+ ```
240
+ [REMIND: YYYY-MM-DD HH:MM — <text the user will receive>]
241
+ ```
248
242
 
249
- The `<text>` is what the user will receive at fire time.
243
+ The time is always in the SENDER's timezone (shown in your preamble each
244
+ turn as "Current local time"). YOU translate the user's natural-language
245
+ date/time into the ISO form. Never pass through their raw phrasing.
246
+
247
+ Translation table (assume current time = `2026-05-25 11:25` BA tz):
248
+
249
+ | User says | You emit |
250
+ |---|---|
251
+ | `in 30 minutes` | `[REMIND: 2026-05-25 11:55 — ...]` |
252
+ | `in 3 hours` | `[REMIND: 2026-05-25 14:25 — ...]` |
253
+ | `tomorrow` | `[REMIND: 2026-05-26 09:00 — ...]` |
254
+ | `tomorrow morning` | `[REMIND: 2026-05-26 09:00 — ...]` |
255
+ | `tomorrow at 9am` | `[REMIND: 2026-05-26 09:00 — ...]` |
256
+ | `at 10:30am` | `[REMIND: 2026-05-26 10:30 — ...]` (past today → rolls to tomorrow) |
257
+ | `at 2pm` | `[REMIND: 2026-05-25 14:00 — ...]` (still future today) |
258
+ | `20.10` / `20/10` | `[REMIND: 2026-10-20 09:00 — ...]` |
259
+ | `20.10 at 14:00` | `[REMIND: 2026-10-20 14:00 — ...]` |
260
+ | `october 20 at 2pm` | `[REMIND: 2026-10-20 14:00 — ...]` |
261
+ | `next monday` | `[REMIND: 2026-06-01 09:00 — ...]` |
262
+ | `monday morning` | `[REMIND: 2026-06-01 09:00 — ...]` |
263
+ | `december 25` | `[REMIND: 2026-12-25 09:00 — ...]` |
264
+ | `next week` | `[REMIND: 2026-06-01 11:25 — ...]` (+7 days, same time) |
265
+ | `in a couple hours` | `[REMIND: 2026-05-25 13:25 — ...]` (interpret as 2h) |
266
+
267
+ **Defaults when fields are missing:**
268
+ - No time given → 09:00 sender-tz
269
+ - No date given (just a time) → today, roll to tomorrow if past
270
+ - No year given → current year, roll to next year if past
271
+
272
+ Examples in actual reply text:
250
273
 
251
- Examples:
252
274
  ```
253
- [REMIND: in 30m — take the chicken out of the oven]
254
- [REMIND: at 10:30amcall mom]
255
- [REMIND: tomorrow at 9am gym]
256
- [REMIND: mon at 9am — weekly planning]
275
+ [REMIND: 2026-05-25 11:55 — take the chicken out of the oven]
276
+ [REMIND: 2026-05-26 09:00gym]
277
+ [REMIND: 2026-06-01 09:00weekly planning]
257
278
  ```
258
279
 
280
+ Do NOT use `in 30m`, `tomorrow at 9am`, or other shorthands. The parser
281
+ accepts them as a fallback but the ISO form is the contract. Single
282
+ format = no ambiguity, no locale concerns, no parser surprises.
283
+
259
284
  ### Recurring crons — `[CRON: <recurrence> — <text>]`
260
285
 
261
286
  Recurrence forms:
@@ -22,24 +22,38 @@ function buildSchedulingReminder(nowLocal, tz) {
22
22
  `Saying "I'll remind you" is NOT enough — you must emit a tag.`,
23
23
  `Without the tag, NO schedule is created and the user gets nothing.`,
24
24
  ``,
25
- `One-shot reminder — append at END of your reply, ONE PER LINE:`,
26
- ` [REMIND: in 30m — <text the user will receive>]`,
27
- ` [REMIND: in 2h — <text>]`,
28
- ` [REMIND: at 10:30am — <text>]`,
29
- ` [REMIND: tomorrow at 9am — <text>]`,
30
- ` [REMIND: mon at 9am — <text>] (next occurrence of Monday)`,
31
- ` [REMIND: 2026-12-25 09:00 — <text>]`,
32
- `Units for "in N": s | m | h | d. Times are in the sender's tz.`,
25
+ `### One-shot reminder — ONE canonical format, always:`,
26
+ ` [REMIND: YYYY-MM-DD HH:MM — <text the user will receive>]`,
33
27
  ``,
34
- `Recurring schedule:`,
35
- ` [CRON: @daily 09:00 <text>]`,
36
- ` [CRON: @every 3h <text>]`,
37
- ` [CRON: @weekly mon 09:00 — <text>]`,
28
+ `The time is in the sender's timezone (${tz}). YOU compute the`,
29
+ `absolute date and time from the user's natural language using the`,
30
+ `CURRENT LOCAL TIME above. NEVER pass the user's raw phrasing to`,
31
+ `the tag.`,
38
32
  ``,
39
- `Cross-chat send (rare):`,
33
+ `Translation examples (current time = ${nowLocal}):`,
34
+ ` user: "in 30 minutes" → [REMIND: <now + 30m> — <text>]`,
35
+ ` user: "in 3 hours" → [REMIND: <now + 3h> — <text>]`,
36
+ ` user: "tomorrow" → [REMIND: <tomorrow> 09:00 — <text>]`,
37
+ ` user: "tomorrow morning" → [REMIND: <tomorrow> 09:00 — <text>]`,
38
+ ` user: "at 10:30am" → [REMIND: <today or tomorrow if past> 10:30 — <text>]`,
39
+ ` user: "20.10" / "20/10" → [REMIND: <yyyy>-10-20 09:00 — <text>]`,
40
+ ` user: "october 20 at 2pm" → [REMIND: <yyyy>-10-20 14:00 — <text>]`,
41
+ ` user: "next monday" → [REMIND: <next-mon> 09:00 — <text>]`,
42
+ ` user: "december 25" → [REMIND: <yyyy>-12-25 09:00 — <text>]`,
43
+ ``,
44
+ `Default time when user omits one: 09:00 sender-tz.`,
45
+ `Default date when user only gives a time: today (roll to tomorrow if past).`,
46
+ `Year: current year if the resulting date is in the future, else next year.`,
47
+ ``,
48
+ `### Recurring schedule — same shape, recurrence is symbolic:`,
49
+ ` [CRON: @daily HH:MM — <text>] (HH:MM in sender's tz)`,
50
+ ` [CRON: @every N(s|m|h|d) — <text>] (every N units)`,
51
+ ` [CRON: @weekly <DOW> HH:MM — <text>] (DOW = mon..sun)`,
52
+ ``,
53
+ `### Cross-chat send (rare):`,
40
54
  ` [SEND-TEXT: address=wa:dm:1234567890@s.whatsapp.net body="..."]`,
41
55
  ``,
42
- `Acknowledge the schedule in your chat reply ("got it, reminding you at 10:30") and emit the tag at the END. Reply text is what the user sees right now; the tag is the side effect.`,
56
+ `Acknowledge the schedule in your chat reply ("got it, reminding you tomorrow at 9am") and emit the tag at the END. Reply text is what the user sees right now; the tag is the side effect.`,
43
57
  ].join('\n');
44
58
  }
45
59
  function buildCriticalSection(params) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@c4t4/heyamigo",
3
- "version": "0.9.21",
3
+ "version": "0.9.22",
4
4
  "description": "WhatsApp AI bot powered by Claude with long-term memory, browser control, and role-based access",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",