nothumanallowed 6.8.3 → 6.8.4
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/commands/chat.mjs +16 -0
- package/src/commands/ui.mjs +18 -1
- package/src/constants.mjs +1 -1
- package/src/services/google-gmail.mjs +14 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "6.8.
|
|
3
|
+
"version": "6.8.4",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents for security, code, DevOps, data & daily ops. Per-agent memory, Telegram + Discord auto-responder, proactive intelligence daemon, voice chat, plugin system.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands/chat.mjs
CHANGED
|
@@ -142,6 +142,10 @@ TOOLS:
|
|
|
142
142
|
23. gmail_archive(messageId: string)
|
|
143
143
|
Archive a specific email (removes from inbox).
|
|
144
144
|
|
|
145
|
+
24. gmail_delete(query: string)
|
|
146
|
+
Delete an email. Query can be a messageId OR a search term like "pranzo from:me in:sent".
|
|
147
|
+
Finds the matching email and moves it to Trash. ALWAYS confirm before deleting.
|
|
148
|
+
|
|
145
149
|
24. maps_directions(from: string, to: string)
|
|
146
150
|
Generate a Google Maps directions link between two locations. Returns a clickable URL.
|
|
147
151
|
Use this when the user asks for directions, route, or "how to get to" somewhere.
|
|
@@ -474,6 +478,18 @@ async function executeTool(action, params, config) {
|
|
|
474
478
|
return `Email ${params.messageId} archived.`;
|
|
475
479
|
}
|
|
476
480
|
|
|
481
|
+
case 'gmail_delete': {
|
|
482
|
+
const gm = await import('../services/google-gmail.mjs');
|
|
483
|
+
let messageId = params.query || params.messageId;
|
|
484
|
+
if (messageId && (messageId.includes(' ') || messageId.includes(':') || messageId.length < 15)) {
|
|
485
|
+
const msgs = await gm.listMessages(config, messageId, 1);
|
|
486
|
+
if (msgs.length === 0) return `No email found matching "${messageId}".`;
|
|
487
|
+
messageId = msgs[0].id;
|
|
488
|
+
}
|
|
489
|
+
await gm.trashMessage(config, messageId);
|
|
490
|
+
return 'Email moved to Trash.';
|
|
491
|
+
}
|
|
492
|
+
|
|
477
493
|
// ── Maps Directions (free Google Maps link) ──────────────────────────
|
|
478
494
|
case 'maps_directions': {
|
|
479
495
|
const from = encodeURIComponent(params.from || '');
|
package/src/commands/ui.mjs
CHANGED
|
@@ -107,7 +107,11 @@ TOOLS:
|
|
|
107
107
|
19. gmail_archive(messageId: string)
|
|
108
108
|
Archive a specific email (removes from inbox).
|
|
109
109
|
|
|
110
|
-
20.
|
|
110
|
+
20. gmail_delete(query: string)
|
|
111
|
+
Delete an email. Query can be a messageId OR a search term like "pranzo from:me in:sent".
|
|
112
|
+
The system finds the matching email and moves it to Trash. ALWAYS confirm before deleting.
|
|
113
|
+
|
|
114
|
+
21. maps_directions(from: string, to: string)
|
|
111
115
|
Generate a Google Maps directions link between two locations.
|
|
112
116
|
|
|
113
117
|
RULES:
|
|
@@ -400,6 +404,19 @@ async function executeTool(action, params, config) {
|
|
|
400
404
|
await archiveMessage(config, params.messageId);
|
|
401
405
|
return `Email archived.`;
|
|
402
406
|
}
|
|
407
|
+
case 'gmail_delete': {
|
|
408
|
+
const gm = await import('../services/google-gmail.mjs');
|
|
409
|
+
const cfg = (await import('../config.mjs')).loadConfig();
|
|
410
|
+
let messageId = params.query || params.messageId;
|
|
411
|
+
// If it looks like a search query (has spaces or keywords), find the email first
|
|
412
|
+
if (messageId && (messageId.includes(' ') || messageId.includes(':') || messageId.length < 15)) {
|
|
413
|
+
const msgs = await gm.listMessages(cfg, messageId, 1);
|
|
414
|
+
if (msgs.length === 0) return `No email found matching "${messageId}".`;
|
|
415
|
+
messageId = msgs[0].id;
|
|
416
|
+
}
|
|
417
|
+
await gm.trashMessage(cfg, messageId);
|
|
418
|
+
return `Email moved to Trash.`;
|
|
419
|
+
}
|
|
403
420
|
case 'maps_directions': {
|
|
404
421
|
const from = encodeURIComponent(params.from || '');
|
|
405
422
|
const to = encodeURIComponent(params.to || '');
|
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 = '6.8.
|
|
8
|
+
export const VERSION = '6.8.4';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -235,6 +235,20 @@ export async function markAllAsRead(config) {
|
|
|
235
235
|
return { count: ids.length };
|
|
236
236
|
}
|
|
237
237
|
|
|
238
|
+
/**
|
|
239
|
+
* Trash a message (move to Trash — recoverable for 30 days).
|
|
240
|
+
*/
|
|
241
|
+
export async function trashMessage(config, messageId) {
|
|
242
|
+
return gmailFetch(config, `/messages/${messageId}/trash`, { method: 'POST' });
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Permanently delete a message (irreversible).
|
|
247
|
+
*/
|
|
248
|
+
export async function deleteMessage(config, messageId) {
|
|
249
|
+
return gmailFetch(config, `/messages/${messageId}`, { method: 'DELETE' });
|
|
250
|
+
}
|
|
251
|
+
|
|
238
252
|
// ── Message Parser ─────────────────────────────────────────────────────────
|
|
239
253
|
|
|
240
254
|
function parseMessage(raw) {
|