nothumanallowed 16.0.9 → 16.0.10
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "16.0.
|
|
3
|
+
"version": "16.0.10",
|
|
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.10';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -2145,6 +2145,72 @@ class TelegramResponder {
|
|
|
2145
2145
|
// Reuse the same proposal extractor — it works on raw user text too,
|
|
2146
2146
|
// because it just looks for title quotes / dates / times.
|
|
2147
2147
|
if (isDelete) {
|
|
2148
|
+
// ─── BULK DELETE: "cancella TUTTI gli appuntamenti di MAGGIO"
|
|
2149
|
+
// Trigger when isDelete + "tutti/all/everything" + (month name | week | "oggi" | "domani"
|
|
2150
|
+
// | specific date). Iterate over the list and delete each one. Honest
|
|
2151
|
+
// reporting: tell the user how many were deleted vs failed.
|
|
2152
|
+
const isBulk = /\b(tutti|tutte|all|every(thing)?|in\s+tot)\b/.test(lower);
|
|
2153
|
+
const monthMatch = lower.match(new RegExp(`\\b(${Object.keys(MONTH_MAP).join('|')})(?:\\s+(20\\d{2}))?\\b`));
|
|
2154
|
+
const isOggi = /\b(oggi|today)\b/.test(lower);
|
|
2155
|
+
const isDomani = /\b(domani|tomorrow)\b/.test(lower);
|
|
2156
|
+
const isWeek = /\b(questa\s+settimana|della\s+settimana|this\s+week|della\s+week)\b/.test(lower);
|
|
2157
|
+
if (isBulk && (monthMatch || isOggi || isDomani || isWeek)) {
|
|
2158
|
+
// 1. Fetch the events in that timeframe via the right list tool.
|
|
2159
|
+
let listing = '';
|
|
2160
|
+
let scopeLabel = '';
|
|
2161
|
+
try {
|
|
2162
|
+
if (monthMatch) {
|
|
2163
|
+
const monthNum = MONTH_MAP[monthMatch[1]];
|
|
2164
|
+
const yearNum = parseInt(monthMatch[2] || String(new Date().getFullYear()), 10);
|
|
2165
|
+
const monthStr = `${yearNum}-${String(monthNum).padStart(2, '0')}`;
|
|
2166
|
+
listing = String(await executeTool('calendar_month', { month: monthStr }, config));
|
|
2167
|
+
scopeLabel = `di ${monthMatch[1]} ${yearNum}`;
|
|
2168
|
+
} else if (isOggi) {
|
|
2169
|
+
listing = String(await executeTool('calendar_today', {}, config));
|
|
2170
|
+
scopeLabel = 'di oggi';
|
|
2171
|
+
} else if (isDomani) {
|
|
2172
|
+
listing = String(await executeTool('calendar_tomorrow', {}, config));
|
|
2173
|
+
scopeLabel = 'di domani';
|
|
2174
|
+
} else if (isWeek) {
|
|
2175
|
+
listing = String(await executeTool('calendar_week', {}, config));
|
|
2176
|
+
scopeLabel = 'di questa settimana';
|
|
2177
|
+
}
|
|
2178
|
+
} catch (e) {
|
|
2179
|
+
return { action: 'calendar_delete_bulk', success: false, message: `Errore nel recupero degli appuntamenti: ${e.message}` };
|
|
2180
|
+
}
|
|
2181
|
+
const events = this._parseEventsFromToolOutput(listing);
|
|
2182
|
+
if (!events || events.length === 0) {
|
|
2183
|
+
return { action: 'calendar_delete_bulk', success: true,
|
|
2184
|
+
message: `Nessun appuntamento ${scopeLabel} da cancellare. Calendario già vuoto in quell'intervallo.` };
|
|
2185
|
+
}
|
|
2186
|
+
// 2. Delete each event with a real tool call. Track failures.
|
|
2187
|
+
let ok = 0, ko = 0;
|
|
2188
|
+
const failed = [];
|
|
2189
|
+
for (const ev of events) {
|
|
2190
|
+
if (!ev.eventId) { ko++; failed.push(ev.summary || '(no title)'); continue; }
|
|
2191
|
+
try {
|
|
2192
|
+
await executeTool('calendar_delete', { eventId: ev.eventId }, config);
|
|
2193
|
+
ok++;
|
|
2194
|
+
} catch (e) {
|
|
2195
|
+
ko++;
|
|
2196
|
+
failed.push(`${ev.summary || ev.eventId} (${e.message?.slice(0, 60) || 'err'})`);
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
// 3. Honest, factual summary.
|
|
2200
|
+
const lines = [`Ho cancellato ${ok} appuntament${ok === 1 ? 'o' : 'i'} ${scopeLabel}.`];
|
|
2201
|
+
if (ko > 0) {
|
|
2202
|
+
lines.push(`Non sono riuscito a cancellarne ${ko}: ${failed.slice(0, 3).join(', ')}${failed.length > 3 ? '…' : ''}`);
|
|
2203
|
+
}
|
|
2204
|
+
if (this._lastDirectAuditChatId) {
|
|
2205
|
+
this._recordAudit(this._lastDirectAuditChatId, {
|
|
2206
|
+
tool: 'calendar_delete_bulk',
|
|
2207
|
+
success: ok > 0,
|
|
2208
|
+
summary: `${ok} cancellati ${scopeLabel}, ${ko} falliti`,
|
|
2209
|
+
});
|
|
2210
|
+
}
|
|
2211
|
+
return { action: 'calendar_delete_bulk', success: ok > 0, message: lines.join('\n') };
|
|
2212
|
+
}
|
|
2213
|
+
|
|
2148
2214
|
const extracted = this._extractCalendarProposal(userMessage);
|
|
2149
2215
|
if (!extracted.date && !extracted.title) return null;
|
|
2150
2216
|
|