nothumanallowed 3.5.0 → 3.6.1
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/services/web-ui.mjs +134 -55
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.1",
|
|
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": {
|
package/src/services/web-ui.mjs
CHANGED
|
@@ -132,7 +132,7 @@ input:focus,textarea:focus{border-color:var(--green3)}
|
|
|
132
132
|
/* ---- MODAL ---- */
|
|
133
133
|
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.7);z-index:300;align-items:center;justify-content:center}
|
|
134
134
|
.modal-overlay--open{display:flex}
|
|
135
|
-
.modal{background:var(--bg2);border:1px solid var(--border2);border-radius:8px;width:
|
|
135
|
+
.modal{background:var(--bg2);border:1px solid var(--border2);border-radius:8px;width:92%;max-width:540px;max-height:90vh;display:flex;flex-direction:column}
|
|
136
136
|
.modal__header{display:flex;justify-content:space-between;align-items:center;padding:14px 16px;border-bottom:1px solid var(--border)}
|
|
137
137
|
.modal__header h2{font-size:16px;color:var(--green)}
|
|
138
138
|
.modal__close{background:none;color:var(--dim);font-size:24px;padding:0 4px}
|
|
@@ -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 ----
|
|
@@ -342,66 +343,140 @@ function renderEmails(el){
|
|
|
342
343
|
el.innerHTML=h;
|
|
343
344
|
}
|
|
344
345
|
|
|
345
|
-
// ---- CALENDAR ----
|
|
346
|
-
var
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
var
|
|
355
|
-
var
|
|
356
|
-
var
|
|
357
|
-
|
|
358
|
-
var
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
'<
|
|
362
|
-
'<
|
|
363
|
-
'
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
346
|
+
// ---- CALENDAR (monthly grid + day detail modal) ----
|
|
347
|
+
var calYear, calMonth;
|
|
348
|
+
var calEventsCache = {};
|
|
349
|
+
(function(){var d=new Date();calYear=d.getFullYear();calMonth=d.getMonth()})();
|
|
350
|
+
|
|
351
|
+
function calKey(y,m,d){return y+'-'+String(m+1).padStart(2,'0')+'-'+String(d).padStart(2,'0')}
|
|
352
|
+
function isToday(y,m,d){var t=new Date();return t.getFullYear()===y&&t.getMonth()===m&&t.getDate()===d}
|
|
353
|
+
|
|
354
|
+
function renderCalendar(el){
|
|
355
|
+
var firstDay=new Date(calYear,calMonth,1).getDay();
|
|
356
|
+
var daysInMonth=new Date(calYear,calMonth+1,0).getDate();
|
|
357
|
+
var monthName=new Date(calYear,calMonth,1).toLocaleDateString('en',{month:'long',year:'numeric'});
|
|
358
|
+
// Adjust so Monday=0
|
|
359
|
+
var startDay=(firstDay+6)%7;
|
|
360
|
+
|
|
361
|
+
var h='<div style="display:flex;align-items:center;gap:8px;margin-bottom:12px">'+
|
|
362
|
+
'<button class="btn btn--secondary" onclick="calPrev()">←</button>'+
|
|
363
|
+
'<div style="flex:1;text-align:center;font-size:16px;font-weight:700;color:var(--bright)">'+esc(monthName)+'</div>'+
|
|
364
|
+
'<button class="btn btn--secondary" onclick="calNext()">→</button>'+
|
|
365
|
+
'</div>';
|
|
366
|
+
|
|
367
|
+
// Day headers
|
|
368
|
+
h+='<div style="display:grid;grid-template-columns:repeat(7,1fr);gap:2px;margin-bottom:4px">';
|
|
369
|
+
['Mon','Tue','Wed','Thu','Fri','Sat','Sun'].forEach(function(d){
|
|
370
|
+
h+='<div style="text-align:center;font-size:10px;color:var(--dim);padding:4px">'+d+'</div>';
|
|
371
|
+
});
|
|
372
|
+
h+='</div>';
|
|
373
|
+
|
|
374
|
+
// Calendar grid — square cells
|
|
375
|
+
h+='<div style="display:grid;grid-template-columns:repeat(7,1fr);gap:3px">';
|
|
376
|
+
// Empty cells before first day
|
|
377
|
+
for(var i=0;i<startDay;i++){h+='<div style="aspect-ratio:1;background:var(--bg);border-radius:6px"></div>'}
|
|
378
|
+
// Day cells
|
|
379
|
+
for(var d=1;d<=daysInMonth;d++){
|
|
380
|
+
var key=calKey(calYear,calMonth,d);
|
|
381
|
+
var today=isToday(calYear,calMonth,d);
|
|
382
|
+
var evts=calEventsCache[key]||[];
|
|
383
|
+
var count=evts.length;
|
|
384
|
+
var bg=today?'var(--greendim)':'var(--bg2)';
|
|
385
|
+
var bdr=today?'var(--green3)':count>0?'var(--amber)':'var(--border)';
|
|
386
|
+
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">';
|
|
387
|
+
h+='<div style="font-size:14px;font-weight:'+(today?'800':'500')+';color:'+(today?'var(--green)':'var(--text)')+'">'+d+'</div>';
|
|
388
|
+
if(count>0){
|
|
389
|
+
h+='<div style="flex:1;display:flex;flex-direction:column;justify-content:flex-end;gap:1px;min-height:0">';
|
|
390
|
+
evts.slice(0,2).forEach(function(x){
|
|
391
|
+
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>';
|
|
392
|
+
});
|
|
393
|
+
if(count>2)h+='<div style="font-size:8px;color:var(--dim);text-align:center">+'+String(count-2)+'</div>';
|
|
394
|
+
h+='</div>';
|
|
395
|
+
}
|
|
396
|
+
h+='</div>';
|
|
367
397
|
}
|
|
398
|
+
h+='</div>';
|
|
399
|
+
|
|
400
|
+
// Loading indicator
|
|
401
|
+
h+='<div id="calLoading" style="text-align:center;padding:8px;color:var(--dim);font-size:10px">Loading events...</div>';
|
|
368
402
|
|
|
369
|
-
h
|
|
370
|
-
|
|
403
|
+
el.innerHTML=h;
|
|
404
|
+
loadMonthEvents();
|
|
405
|
+
}
|
|
371
406
|
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
407
|
+
function loadMonthEvents(){
|
|
408
|
+
var daysInMonth=new Date(calYear,calMonth+1,0).getDate();
|
|
409
|
+
var promises=[];
|
|
410
|
+
for(var d=1;d<=daysInMonth;d++){
|
|
411
|
+
var key=calKey(calYear,calMonth,d);
|
|
412
|
+
if(!calEventsCache[key]){
|
|
413
|
+
(function(k,day){
|
|
414
|
+
promises.push(apiGet('/api/calendar?date='+k).then(function(r){
|
|
415
|
+
calEventsCache[k]=(r&&r.events)||[];
|
|
416
|
+
}));
|
|
417
|
+
})(key,d);
|
|
379
418
|
}
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
419
|
+
}
|
|
420
|
+
if(promises.length===0){
|
|
421
|
+
var li=document.getElementById('calLoading');if(li)li.style.display='none';
|
|
422
|
+
return;
|
|
423
|
+
}
|
|
424
|
+
Promise.all(promises).then(function(){
|
|
425
|
+
var li=document.getElementById('calLoading');if(li)li.style.display='none';
|
|
426
|
+
// Re-render just the grid cells with events
|
|
427
|
+
renderCalendar(document.getElementById('content'));
|
|
428
|
+
});
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
function calPrev(){calMonth--;if(calMonth<0){calMonth=11;calYear--}renderCalendar(document.getElementById('content'))}
|
|
432
|
+
function calNext(){calMonth++;if(calMonth>11){calMonth=0;calYear++}renderCalendar(document.getElementById('content'))}
|
|
433
|
+
|
|
434
|
+
function openDayDetail(dateStr){
|
|
435
|
+
var evts=calEventsCache[dateStr]||[];
|
|
436
|
+
var dayLabel=new Date(dateStr+'T12:00:00').toLocaleDateString('en',{weekday:'long',month:'long',day:'numeric',year:'numeric'});
|
|
437
|
+
|
|
438
|
+
var h='<h2 style="color:var(--green);margin-bottom:4px">'+esc(dayLabel)+'</h2>';
|
|
439
|
+
h+='<div style="color:var(--dim);font-size:11px;margin-bottom:12px">'+dateStr+'</div>';
|
|
440
|
+
|
|
441
|
+
if(evts.length===0){
|
|
442
|
+
h+='<div style="color:var(--dim);padding:20px;text-align:center">No events on this day</div>';
|
|
443
|
+
} else {
|
|
444
|
+
evts.forEach(function(x){
|
|
445
|
+
var timeStr=x.isAllDay?'All day':fmtTime(x.start)+' - '+fmtTime(x.end);
|
|
446
|
+
h+='<div style="border:1px solid var(--border);border-radius:6px;padding:12px;margin-bottom:10px;background:var(--bg3)">';
|
|
447
|
+
h+='<div style="color:var(--amber);font-weight:700;font-size:13px;margin-bottom:4px">'+esc(timeStr)+'</div>';
|
|
448
|
+
h+='<div style="color:var(--bright);font-size:15px;font-weight:700;margin-bottom:6px">'+esc(x.summary)+'</div>';
|
|
449
|
+
if(x.location)h+='<div style="color:var(--cyan);font-size:12px;margin-bottom:4px">Location: '+esc(x.location)+'</div>';
|
|
450
|
+
if(x.organizer)h+='<div style="color:var(--dim);font-size:11px;margin-bottom:4px">Organizer: '+esc(x.organizer)+'</div>';
|
|
451
|
+
if(x.attendees&&x.attendees.length>0){
|
|
452
|
+
h+='<div style="color:var(--dim);font-size:11px;margin-bottom:4px">Attendees:</div>';
|
|
453
|
+
x.attendees.forEach(function(a){
|
|
454
|
+
var status=a.responseStatus==='accepted'?'var(--green)':a.responseStatus==='declined'?'var(--red)':'var(--dim)';
|
|
455
|
+
h+='<div style="font-size:11px;color:'+status+';padding-left:8px">'+esc(a.name||a.email)+' ('+esc(a.responseStatus)+')</div>';
|
|
456
|
+
});
|
|
390
457
|
}
|
|
391
|
-
if
|
|
392
|
-
|
|
393
|
-
out += '<div style="color:var(--dim);font-size:11px;margin-top:4px">👥 ' + esc(names) + '</div>';
|
|
458
|
+
if(x.description){
|
|
459
|
+
h+='<div style="border-top:1px solid var(--border);margin-top:8px;padding-top:8px;color:var(--text);font-size:12px;white-space:pre-wrap;word-wrap:break-word">'+esc(x.description)+'</div>';
|
|
394
460
|
}
|
|
395
|
-
if
|
|
396
|
-
|
|
461
|
+
if(x.hangoutLink){
|
|
462
|
+
h+='<div style="margin-top:8px"><a href="'+esc(x.hangoutLink)+'" target="_blank" style="color:var(--cyan);font-size:12px;font-weight:700">Join Video Call</a></div>';
|
|
397
463
|
}
|
|
398
|
-
if
|
|
399
|
-
|
|
464
|
+
if(x.htmlLink){
|
|
465
|
+
h+='<div style="margin-top:4px"><a href="'+esc(x.htmlLink)+'" target="_blank" style="color:var(--dim);font-size:10px">Open in Google Calendar</a></div>';
|
|
400
466
|
}
|
|
401
|
-
|
|
467
|
+
h+='</div>';
|
|
402
468
|
});
|
|
403
|
-
|
|
404
|
-
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// Use the agent modal for day detail
|
|
472
|
+
document.getElementById('modalName').textContent=dayLabel;
|
|
473
|
+
document.getElementById('modalPrompt').style.display='none';
|
|
474
|
+
document.getElementById('modalResponse').style.display='block';
|
|
475
|
+
document.getElementById('modalResponse').innerHTML=h;
|
|
476
|
+
document.getElementById('agentModal').classList.add('modal-overlay--open');
|
|
477
|
+
// Hide ask button
|
|
478
|
+
var sendBtn=document.getElementById('agentModal').querySelector('.btn--primary');
|
|
479
|
+
if(sendBtn)sendBtn.style.display='none';
|
|
405
480
|
}
|
|
406
481
|
|
|
407
482
|
// ---- AGENTS ----
|
|
@@ -418,8 +493,12 @@ function openAgent(name,display){
|
|
|
418
493
|
selectedAgent=name;
|
|
419
494
|
document.getElementById('modalName').textContent=display||name;
|
|
420
495
|
document.getElementById('modalPrompt').value='';
|
|
496
|
+
document.getElementById('modalPrompt').style.display='';
|
|
421
497
|
document.getElementById('modalResponse').style.display='none';
|
|
422
498
|
document.getElementById('modalResponse').textContent='';
|
|
499
|
+
document.getElementById('modalResponse').innerHTML='';
|
|
500
|
+
var sendBtn=document.getElementById('agentModal').querySelector('.btn--primary');
|
|
501
|
+
if(sendBtn)sendBtn.style.display='';
|
|
423
502
|
document.getElementById('agentModal').classList.add('modal-overlay--open');
|
|
424
503
|
}
|
|
425
504
|
function closeModal(){
|
|
@@ -479,7 +558,7 @@ init();
|
|
|
479
558
|
<div class="sidebar__section">
|
|
480
559
|
<div class="sidebar__label">Data</div>
|
|
481
560
|
<div class="nav-item" data-view="emails" onclick="switchView('emails')"><span class="nav-item__icon">✉</span> Emails <span class="nav-item__badge" id="emailBadge" style="display:none">0</span></div>
|
|
482
|
-
<div class="nav-item" data-view="calendar" onclick="switchView('calendar')"><span class="nav-item__icon">📅</span> Calendar</div>
|
|
561
|
+
<div class="nav-item" data-view="calendar" onclick="switchView('calendar')"><span class="nav-item__icon">📅</span> Calendar <span class="nav-item__badge" id="calBadge" style="display:none;background:var(--amber)">0</span></div>
|
|
483
562
|
</div>
|
|
484
563
|
<div class="sidebar__section">
|
|
485
564
|
<div class="sidebar__label">AI</div>
|