nothumanallowed 16.0.18 → 16.0.19
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/package.json +1 -1
- package/src/constants.mjs +1 -1
- package/src/services/message-responder.mjs +43 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.19",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/constants.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import { fileURLToPath } from 'url';
|
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
7
|
|
|
8
|
-
export const VERSION = '16.0.
|
|
8
|
+
export const VERSION = '16.0.19';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -2602,12 +2602,22 @@ class TelegramResponder {
|
|
|
2602
2602
|
if (extracted.date || extracted.title) {
|
|
2603
2603
|
let events = [];
|
|
2604
2604
|
try {
|
|
2605
|
+
const { listEvents } = await import('./google-calendar.mjs');
|
|
2605
2606
|
if (extracted.date) {
|
|
2606
|
-
const
|
|
2607
|
-
|
|
2607
|
+
const [yy, mm, dd] = extracted.date.split('-').map(n => parseInt(n, 10));
|
|
2608
|
+
const from = new Date(yy, mm - 1, dd);
|
|
2609
|
+
const to = new Date(from.getTime() + 86400000);
|
|
2610
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2611
|
+
events = (evs || []).map(e => ({
|
|
2612
|
+
eventId: e.id, summary: e.summary || '', time: (e.start || '').slice(11, 16),
|
|
2613
|
+
}));
|
|
2608
2614
|
} else if (extracted.title) {
|
|
2609
|
-
const
|
|
2610
|
-
|
|
2615
|
+
const from = new Date();
|
|
2616
|
+
const to = new Date(from.getTime() + 60 * 86400000);
|
|
2617
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2618
|
+
events = (evs || []).map(e => ({
|
|
2619
|
+
eventId: e.id, summary: e.summary || '', time: (e.start || '').slice(11, 16),
|
|
2620
|
+
}));
|
|
2611
2621
|
}
|
|
2612
2622
|
} catch (e) {
|
|
2613
2623
|
return { action: 'calendar_verify', success: false, message: `Errore durante la verifica: ${e.message}` };
|
|
@@ -2688,16 +2698,26 @@ class TelegramResponder {
|
|
|
2688
2698
|
if (isMove && !isDelete && !isVerify && !isCreate) {
|
|
2689
2699
|
const parsed = await this._nluExtractCalendarMove(userMessage, config);
|
|
2690
2700
|
if (parsed && (parsed.title || parsed.oldDate) && parsed.newStart) {
|
|
2691
|
-
// Find the source event
|
|
2701
|
+
// Find the source event — use listEvents directly (parser fails
|
|
2702
|
+
// because calendar_date/find don't expose eventIds in their text).
|
|
2692
2703
|
let candidates = [];
|
|
2693
2704
|
try {
|
|
2705
|
+
const { listEvents } = await import('./google-calendar.mjs');
|
|
2694
2706
|
if (parsed.oldDate) {
|
|
2695
|
-
const
|
|
2696
|
-
|
|
2707
|
+
const [yy, mm, dd] = parsed.oldDate.split('-').map(n => parseInt(n, 10));
|
|
2708
|
+
const from = new Date(yy, mm - 1, dd);
|
|
2709
|
+
const to = new Date(from.getTime() + 86400000);
|
|
2710
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2711
|
+
candidates = (evs || []).map(e => ({ eventId: e.id, summary: e.summary || '' }));
|
|
2697
2712
|
}
|
|
2698
2713
|
if (candidates.length === 0 && parsed.title) {
|
|
2699
|
-
|
|
2700
|
-
|
|
2714
|
+
// Broad search across next 60 days
|
|
2715
|
+
const from = new Date();
|
|
2716
|
+
const to = new Date(from.getTime() + 60 * 86400000);
|
|
2717
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2718
|
+
candidates = (evs || [])
|
|
2719
|
+
.filter(e => String(e.summary || '').toLowerCase().includes(parsed.title.toLowerCase()))
|
|
2720
|
+
.map(e => ({ eventId: e.id, summary: e.summary || '' }));
|
|
2701
2721
|
}
|
|
2702
2722
|
} catch (e) {
|
|
2703
2723
|
return { action: 'calendar_move', success: false, message: `Errore nella ricerca dell'evento: ${e.message}` };
|
|
@@ -2909,13 +2929,23 @@ class TelegramResponder {
|
|
|
2909
2929
|
|
|
2910
2930
|
let candidates = [];
|
|
2911
2931
|
try {
|
|
2932
|
+
const { listEvents } = await import('./google-calendar.mjs');
|
|
2912
2933
|
if (extracted.date) {
|
|
2913
|
-
const
|
|
2914
|
-
|
|
2934
|
+
const [yy, mm, dd] = extracted.date.split('-').map(n => parseInt(n, 10));
|
|
2935
|
+
const from = new Date(yy, mm - 1, dd);
|
|
2936
|
+
const to = new Date(from.getTime() + 86400000);
|
|
2937
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2938
|
+
candidates = (evs || []).map(e => ({
|
|
2939
|
+
eventId: e.id, summary: e.summary || '', time: (e.start || '').slice(11, 16),
|
|
2940
|
+
}));
|
|
2915
2941
|
}
|
|
2916
2942
|
if (candidates.length === 0 && extracted.title) {
|
|
2917
|
-
const
|
|
2918
|
-
|
|
2943
|
+
const from = new Date();
|
|
2944
|
+
const to = new Date(from.getTime() + 60 * 86400000);
|
|
2945
|
+
const evs = await listEvents(config, 'primary', from, to);
|
|
2946
|
+
candidates = (evs || [])
|
|
2947
|
+
.filter(e => String(e.summary || '').toLowerCase().includes(extracted.title.toLowerCase()))
|
|
2948
|
+
.map(e => ({ eventId: e.id, summary: e.summary || '', time: (e.start || '').slice(11, 16) }));
|
|
2919
2949
|
}
|
|
2920
2950
|
} catch (err) {
|
|
2921
2951
|
this.log(`[Telegram] direct-fresh delete lookup failed: ${err.message}`);
|