nothumanallowed 6.1.0 → 6.1.2

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/bin/nha.mjs CHANGED
@@ -22,8 +22,8 @@ const __dirname = path.dirname(__filename);
22
22
 
23
23
  // ── Node.js version gate ────────────────────────────────────────────────────
24
24
  const major = parseInt(process.version.slice(1), 10);
25
- if (major < 22) {
26
- console.error(`\x1b[31mError: nha requires Node.js 22 or later (found ${process.version}).\x1b[0m`);
25
+ if (major < 20) {
26
+ console.error(`\x1b[31mError: nha requires Node.js 20 or later (found ${process.version}).\x1b[0m`);
27
27
  console.error('Install from https://nodejs.org');
28
28
  process.exit(1);
29
29
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "6.1.0",
3
+ "version": "6.1.2",
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": {
@@ -8,7 +8,7 @@
8
8
  "nothumanallowed": "./bin/nha.mjs"
9
9
  },
10
10
  "engines": {
11
- "node": ">=22.0.0"
11
+ "node": ">=20.0.0"
12
12
  },
13
13
  "files": [
14
14
  "bin/",
@@ -332,7 +332,7 @@ async function executeTool(action, params, config) {
332
332
  workdayEnd: params.workdayEnd || 18,
333
333
  maxSlots: 5,
334
334
  });
335
- return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting');
335
+ return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting', params.location || '');
336
336
  }
337
337
 
338
338
  case 'schedule_draft_email': {
@@ -280,7 +280,7 @@ async function executeTool(action, params, config) {
280
280
  workdayEnd: params.workdayEnd || 18,
281
281
  maxSlots: 5,
282
282
  });
283
- return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting');
283
+ return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting', params.location || '');
284
284
  }
285
285
 
286
286
  case 'schedule_draft_email': {
@@ -210,7 +210,7 @@ async function executeTool(action, params, config) {
210
210
  workdayEnd: 18,
211
211
  maxSlots: 3,
212
212
  });
213
- return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting');
213
+ return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting', params.location || '');
214
214
  }
215
215
  default:
216
216
  return `Unknown action: ${action}`;
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.1.0';
8
+ export const VERSION = '6.1.2';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -286,11 +286,11 @@ export async function findAvailableSlots(config, params) {
286
286
  const nextEvent = dayEvents.find(e => new Date(e.start).getTime() >= block.eventStart - 60000);
287
287
 
288
288
  const travelBefore = prevEvent
289
- ? estimateTravelTime(prevEvent.location, meetingLocation)
290
- : { minutes: 0, label: 'no previous event' };
289
+ ? { ...estimateTravelTime(prevEvent.location, meetingLocation), fromLocation: prevEvent.location }
290
+ : { minutes: 0, label: 'no previous event', fromLocation: '' };
291
291
  const travelAfter = nextEvent
292
- ? estimateTravelTime(meetingLocation, nextEvent.location)
293
- : { minutes: 0, label: 'no next event' };
292
+ ? { ...estimateTravelTime(meetingLocation, nextEvent.location), toLocation: nextEvent.location }
293
+ : { minutes: 0, label: 'no next event', toLocation: '' };
294
294
 
295
295
  const slotStart = new Date(cursor + travelBefore.minutes * 60000);
296
296
  const slotEnd = new Date(slotStart.getTime() + durationMs);
@@ -326,8 +326,8 @@ export async function findAvailableSlots(config, params) {
326
326
  if (gapDuration >= durationMs) {
327
327
  const lastEvent = dayEvents[dayEvents.length - 1];
328
328
  const travelBefore = lastEvent
329
- ? estimateTravelTime(lastEvent.location, meetingLocation)
330
- : { minutes: 0, label: 'no previous event' };
329
+ ? { ...estimateTravelTime(lastEvent.location, meetingLocation), fromLocation: lastEvent.location }
330
+ : { minutes: 0, label: 'no previous event', fromLocation: '' };
331
331
 
332
332
  const slotStart = new Date(cursor + travelBefore.minutes * 60000);
333
333
  const slotEnd = new Date(slotStart.getTime() + durationMs);
@@ -360,10 +360,26 @@ export async function findAvailableSlots(config, params) {
360
360
  return slots.slice(0, maxSlots);
361
361
  }
362
362
 
363
+ /**
364
+ * Generate a Google Maps directions link between two locations.
365
+ * Free — just opens the browser, no API key needed.
366
+ *
367
+ * @param {string} from — origin location/city
368
+ * @param {string} to — destination location/city
369
+ * @returns {string} Google Maps URL
370
+ */
371
+ export function getMapsLink(from, to) {
372
+ if (!from || !to) return '';
373
+ const origin = encodeURIComponent(from);
374
+ const dest = encodeURIComponent(to);
375
+ return `https://www.google.com/maps/dir/${origin}/${dest}`;
376
+ }
377
+
363
378
  /**
364
379
  * Format slots into a human-readable proposal string.
380
+ * Includes Google Maps links for travel between locations.
365
381
  */
366
- export function formatSlotProposal(slots, clientName, meetingSubject) {
382
+ export function formatSlotProposal(slots, clientName, meetingSubject, meetingLocation) {
367
383
  if (slots.length === 0) {
368
384
  return 'No available slots found in the requested date range. Try expanding the range or shortening the meeting duration.';
369
385
  }
@@ -375,9 +391,16 @@ export function formatSlotProposal(slots, clientName, meetingSubject) {
375
391
  lines.push(`${i + 1}. ${s.day} ${s.date} — ${s.startTime} to ${s.endTime}`);
376
392
  if (s.travelBefore.minutes > 0) {
377
393
  lines.push(` Travel before: ${s.travelBefore.label}`);
394
+ // Add Maps link if we have a previous location and the meeting location
395
+ if (s.travelBefore.fromLocation && meetingLocation) {
396
+ lines.push(` Route: ${getMapsLink(s.travelBefore.fromLocation, meetingLocation)}`);
397
+ }
378
398
  }
379
399
  if (s.travelAfter.minutes > 0) {
380
400
  lines.push(` Travel after: ${s.travelAfter.label}`);
401
+ if (meetingLocation && s.travelAfter.toLocation) {
402
+ lines.push(` Route: ${getMapsLink(meetingLocation, s.travelAfter.toLocation)}`);
403
+ }
381
404
  }
382
405
  }
383
406
 
@@ -442,7 +442,7 @@ export async function executeTool(action, params, config) {
442
442
  workdayEnd: params.workdayEnd || 18,
443
443
  maxSlots: 5,
444
444
  });
445
- return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting');
445
+ return formatSlotProposal(slots, params.clientName || 'the client', params.subject || 'meeting', params.location || '');
446
446
  }
447
447
 
448
448
  case 'schedule_draft_email': {