nothumanallowed 9.0.0 → 9.0.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "9.0.0",
3
+ "version": "9.0.1",
4
4
  "description": "NotHumanAllowed — 38 AI agents + unified productivity suite. Gmail, Calendar, Drive, Contacts, Tasks, GitHub, Notion, Slack, voice chat, smart scheduler. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -290,6 +290,25 @@ export async function cmdUI(args) {
290
290
  return;
291
291
  }
292
292
 
293
+ // POST /api/email/mark-read — mark email as read
294
+ if (method === 'POST' && pathname === '/api/email/mark-read') {
295
+ const body = await parseBody(req);
296
+ if (!body.messageId) {
297
+ sendJSON(res, 400, { error: 'messageId required' });
298
+ logRequest(method, pathname, 400, Date.now() - start);
299
+ return;
300
+ }
301
+ try {
302
+ const gmail = await import('../services/google-gmail.mjs');
303
+ await gmail.markAsRead(config, body.messageId);
304
+ sendJSON(res, 200, { ok: true });
305
+ } catch (e) {
306
+ sendJSON(res, 200, { ok: false, error: e.message });
307
+ }
308
+ logRequest(method, pathname, 200, Date.now() - start);
309
+ return;
310
+ }
311
+
293
312
  // POST /api/contacts — create contact
294
313
  if (method === 'POST' && pathname === '/api/contacts') {
295
314
  try {
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 = '9.0.0';
8
+ export const VERSION = '9.0.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -500,6 +500,13 @@ function renderEmails(el){
500
500
  var openEmailId=null;
501
501
  function openEmail(id){
502
502
  openEmailId=id;
503
+ // Mark as read locally + on server
504
+ var emailObj=dash.emails.find(function(e){return e.id===id});
505
+ if(emailObj&&emailObj.isUnread){
506
+ emailObj.isUnread=false;
507
+ updateBadges();
508
+ apiPost('/api/email/mark-read',{messageId:id}).catch(function(){});
509
+ }
503
510
  var el=document.getElementById('content');
504
511
  el.innerHTML='<div style="text-align:center;padding:40px"><div class="spinner"></div><div style="color:var(--dim)">Loading email...</div></div>';
505
512
  apiPost('/api/email/read',{messageId:id}).then(function(r){