nothumanallowed 3.6.0 → 3.7.0

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": "3.6.0",
3
+ "version": "3.7.0",
4
4
  "description": "NotHumanAllowed — 38 AI agents for security, code, DevOps, data & daily ops. Ask agents directly, plan your day with 5 specialist agents, manage tasks, connect Gmail + Calendar.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -84,7 +84,7 @@ RULES:
84
84
  - For write/send/delete operations, describe what you're about to do and include the JSON block.
85
85
  - When presenting results, format them clearly in natural language. Never dump raw JSON to the user.
86
86
  - If you need multiple actions in sequence, do them ONE AT A TIME.
87
- - Dates: today is {{TODAY}}. The user's timezone is {{TIMEZONE}}.
87
+ - Dates: today is {{TODAY}}. The user's timezone is {{TIMEZONE}}. CRITICAL: when creating calendar events, always use LOCAL time in format "YYYY-MM-DDTHH:MM:SS" WITHOUT any Z suffix or timezone offset. Example: if user says "8pm", use "{{TODAY}}T20:00:00". NEVER add Z or +00:00.
88
88
  `.trim();
89
89
 
90
90
  // ── Tool execution (all imports are at top of file) ──────────
@@ -133,18 +133,23 @@ export async function getUpcomingEvents(config, hours = 2) {
133
133
  * @param {string} calendarId
134
134
  */
135
135
  export async function createEvent(config, event, calendarId = 'primary') {
136
+ const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
137
+ // If the date string has no Z or offset, treat as local time — don't convert to UTC
138
+ const startStr = String(event.start);
139
+ const endStr = String(event.end);
140
+ const startDT = (startStr.endsWith('Z') || /[+-]\d{2}:\d{2}$/.test(startStr))
141
+ ? new Date(startStr).toISOString()
142
+ : startStr; // Keep as-is (local time for the timeZone)
143
+ const endDT = (endStr.endsWith('Z') || /[+-]\d{2}:\d{2}$/.test(endStr))
144
+ ? new Date(endStr).toISOString()
145
+ : endStr;
146
+
136
147
  const body = {
137
148
  summary: event.summary,
138
149
  description: event.description || '',
139
150
  location: event.location || '',
140
- start: {
141
- dateTime: new Date(event.start).toISOString(),
142
- timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
143
- },
144
- end: {
145
- dateTime: new Date(event.end).toISOString(),
146
- timeZone: Intl.DateTimeFormat().resolvedOptions().timeZone,
147
- },
151
+ start: { dateTime: startDT, timeZone: tz },
152
+ end: { dateTime: endDT, timeZone: tz },
148
153
  };
149
154
 
150
155
  if (event.attendees?.length) {
@@ -204,10 +204,11 @@ function loadDash(){
204
204
  }
205
205
  function loadAgents(){return apiGet('/api/agents').then(function(r){agentsList=(r&&r.agents)||[]})}
206
206
  function updateBadges(){
207
- var eb=document.getElementById('emailBadge'),tb=document.getElementById('taskBadge');
208
- var ue=dash.emails.length,ut=dash.tasks.filter(function(t){return t.status!=='done'}).length;
207
+ var eb=document.getElementById('emailBadge'),tb=document.getElementById('taskBadge'),cb=document.getElementById('calBadge');
208
+ var ue=dash.emails.length,ut=dash.tasks.filter(function(t){return t.status!=='done'}).length,uc=dash.events.length;
209
209
  if(eb){eb.textContent=ue;eb.style.display=ue>0?'':'none'}
210
210
  if(tb){tb.textContent=ut;tb.style.display=ut>0?'':'none'}
211
+ if(cb){cb.textContent=uc;cb.style.display=uc>0?'':'none'}
211
212
  }
212
213
 
213
214
  // ---- HELPERS ----
@@ -283,7 +284,11 @@ function sendChat(){
283
284
  else{chatHistory.push({role:'assistant',content:'Error: no response from server'})}
284
285
  renderMessages();
285
286
  // Refresh data if an action was executed
286
- if(r&&r.actions&&r.actions.length>0){loadDash().catch(function(){})}
287
+ if(r&&r.actions&&r.actions.length>0){
288
+ // Clear calendar cache so new events show up
289
+ calEventsCache={};
290
+ loadDash().catch(function(){});
291
+ }
287
292
  });
288
293
  }
289
294
 
@@ -370,21 +375,27 @@ function renderCalendar(el){
370
375
  });
371
376
  h+='</div>';
372
377
 
373
- // Calendar grid
374
- h+='<div style="display:grid;grid-template-columns:repeat(7,1fr);gap:2px">';
378
+ // Calendar grid — square cells
379
+ h+='<div style="display:grid;grid-template-columns:repeat(7,1fr);gap:3px">';
375
380
  // Empty cells before first day
376
- for(var i=0;i<startDay;i++){h+='<div style="min-height:48px;background:var(--bg);border-radius:4px"></div>'}
381
+ for(var i=0;i<startDay;i++){h+='<div style="aspect-ratio:1;background:var(--bg);border-radius:6px"></div>'}
377
382
  // Day cells
378
383
  for(var d=1;d<=daysInMonth;d++){
379
384
  var key=calKey(calYear,calMonth,d);
380
385
  var today=isToday(calYear,calMonth,d);
381
386
  var evts=calEventsCache[key]||[];
382
- var hasDot=evts.length>0;
383
- h+='<div onclick="openDayDetail(\\x27'+key+'\\x27)" style="min-height:48px;background:'+(today?'var(--greendim)':'var(--bg2)')+';border:1px solid '+(today?'var(--green3)':'var(--border)')+';border-radius:4px;padding:4px;cursor:pointer;position:relative">';
384
- h+='<div style="font-size:12px;font-weight:'+(today?'700':'400')+';color:'+(today?'var(--green)':'var(--text)')+'">'+d+'</div>';
385
- if(hasDot){
386
- h+='<div style="font-size:8px;color:var(--amber);margin-top:2px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis">'+esc(evts[0].summary)+'</div>';
387
- if(evts.length>1)h+='<div style="font-size:8px;color:var(--dim)">+'+String(evts.length-1)+' more</div>';
387
+ var count=evts.length;
388
+ var bg=today?'var(--greendim)':'var(--bg2)';
389
+ var bdr=today?'var(--green3)':count>0?'var(--amber)':'var(--border)';
390
+ h+='<div onclick="openDayDetail(\\x27'+key+'\\x27)" style="aspect-ratio:1;background:'+bg+';border:1px solid '+bdr+';border-radius:6px;padding:6px;cursor:pointer;display:flex;flex-direction:column;overflow:hidden">';
391
+ h+='<div style="font-size:14px;font-weight:'+(today?'800':'500')+';color:'+(today?'var(--green)':'var(--text)')+'">'+d+'</div>';
392
+ if(count>0){
393
+ h+='<div style="flex:1;display:flex;flex-direction:column;justify-content:flex-end;gap:1px;min-height:0">';
394
+ evts.slice(0,2).forEach(function(x){
395
+ h+='<div style="font-size:8px;color:var(--amber);overflow:hidden;white-space:nowrap;text-overflow:ellipsis;background:var(--bg3);border-radius:2px;padding:1px 3px">'+esc(x.summary)+'</div>';
396
+ });
397
+ if(count>2)h+='<div style="font-size:8px;color:var(--dim);text-align:center">+'+String(count-2)+'</div>';
398
+ h+='</div>';
388
399
  }
389
400
  h+='</div>';
390
401
  }
@@ -551,7 +562,7 @@ init();
551
562
  <div class="sidebar__section">
552
563
  <div class="sidebar__label">Data</div>
553
564
  <div class="nav-item" data-view="emails" onclick="switchView('emails')"><span class="nav-item__icon">&#9993;</span> Emails <span class="nav-item__badge" id="emailBadge" style="display:none">0</span></div>
554
- <div class="nav-item" data-view="calendar" onclick="switchView('calendar')"><span class="nav-item__icon">&#128197;</span> Calendar</div>
565
+ <div class="nav-item" data-view="calendar" onclick="switchView('calendar')"><span class="nav-item__icon">&#128197;</span> Calendar <span class="nav-item__badge" id="calBadge" style="display:none;background:var(--amber)">0</span></div>
555
566
  </div>
556
567
  <div class="sidebar__section">
557
568
  <div class="sidebar__label">AI</div>