nothumanallowed 13.2.60 → 13.2.62

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": "13.2.60",
3
+ "version": "13.2.62",
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 = '13.2.60';
8
+ export const VERSION = '13.2.62';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -37,7 +37,10 @@ async function calFetch(config, urlPath, options = {}) {
37
37
  throw new Error(`Calendar API ${res.status}: ${err}`);
38
38
  }
39
39
 
40
- return res.json();
40
+ if (res.status === 204 || res.headers.get('content-length') === '0') return {};
41
+ const text = await res.text();
42
+ if (!text) return {};
43
+ try { return JSON.parse(text); } catch { return {}; }
41
44
  }
42
45
 
43
46
  /**
@@ -72,7 +75,11 @@ export async function listEvents(config, calendarId = 'primary', timeMin, timeMa
72
75
  });
73
76
 
74
77
  const data = await calFetch(config, `/calendars/${encodeURIComponent(calendarId)}/events?${params}`);
75
- const events = (data.items || []).map(parseEvent);
78
+ const events = (data.items || []).map(raw => {
79
+ const e = parseEvent(raw);
80
+ e.calendarId = calendarId; // propagate real calendarId
81
+ return e;
82
+ });
76
83
 
77
84
  // Cache events
78
85
  cacheEvents(timeMin, events);
@@ -96,6 +103,7 @@ export async function getTodayEvents(config) {
96
103
  const events = await listEvents(config, cal.id, startOfDay, endOfDay);
97
104
  for (const e of events) {
98
105
  e.calendarName = cal.summary;
106
+ e.calendarId = cal.id; // ensure real calendarId is set
99
107
  allEvents.push(e);
100
108
  }
101
109
  } catch { /* skip failed calendars */ }
@@ -113,7 +121,23 @@ export async function getEventsForDate(config, date) {
113
121
  const d = new Date(date);
114
122
  const startOfDay = new Date(d.getFullYear(), d.getMonth(), d.getDate());
115
123
  const endOfDay = new Date(startOfDay.getTime() + 86400000);
116
- return listEvents(config, 'primary', startOfDay, endOfDay);
124
+
125
+ // Load from all calendars so calendarId is always accurate
126
+ const calendars = await listCalendars(config);
127
+ const allEvents = [];
128
+ for (const cal of calendars) {
129
+ if (cal.accessRole === 'freeBusyReader') continue;
130
+ try {
131
+ const events = await listEvents(config, cal.id, startOfDay, endOfDay);
132
+ for (const e of events) {
133
+ e.calendarName = cal.summary;
134
+ e.calendarId = cal.id;
135
+ allEvents.push(e);
136
+ }
137
+ } catch { /* skip */ }
138
+ }
139
+ allEvents.sort((a, b) => new Date(a.start).getTime() - new Date(b.start).getTime());
140
+ return allEvents;
117
141
  }
118
142
 
119
143
  /**
@@ -44,7 +44,10 @@ async function graphFetch(config, urlPath, options = {}) {
44
44
  throw new Error(`Microsoft Calendar API ${res.status}: ${err}`);
45
45
  }
46
46
 
47
- return res.json();
47
+ if (res.status === 204 || res.headers.get('content-length') === '0') return {};
48
+ const text = await res.text();
49
+ if (!text) return {};
50
+ try { return JSON.parse(text); } catch { return {}; }
48
51
  }
49
52
 
50
53
  /**