nothumanallowed 6.2.0 → 6.2.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": "6.2.0",
3
+ "version": "6.2.1",
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": {
@@ -354,7 +354,8 @@ html,body{height:100%;background:var(--bg);color:var(--text);font-family:var(--f
354
354
 
355
355
  const JS = `
356
356
  var API = '';
357
- var chatHistory = [];
357
+ var chatHistory = (function(){try{var s=localStorage.getItem('nha_voice_history');return s?JSON.parse(s):[];}catch(e){return [];}})();
358
+ function saveVoiceToStorage(){try{localStorage.setItem('nha_voice_history',JSON.stringify(chatHistory.slice(-20)));}catch(e){}}
358
359
  var isRecording = false;
359
360
  var recognition = null;
360
361
  var mediaRecorder = null;
@@ -523,7 +524,7 @@ function speak(text) {
523
524
  // ---- PROCESS MESSAGE ----
524
525
  function processMessage(text) {
525
526
  chatHistory.push({ role: 'user', content: text });
526
- renderMessages();
527
+ saveVoiceToStorage();renderMessages();
527
528
 
528
529
  chatHistory.push({ role: 'assistant', content: 'Thinking...' });
529
530
  renderMessages();
@@ -543,7 +544,7 @@ function processMessage(text) {
543
544
  response = 'No response from server.';
544
545
  chatHistory.push({ role: 'assistant', content: response });
545
546
  }
546
- renderMessages();
547
+ saveVoiceToStorage();renderMessages();
547
548
  setStatus('');
548
549
 
549
550
  // Speak the response
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.2.0';
8
+ export const VERSION = '6.2.1';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -180,8 +180,11 @@ input:focus,textarea:focus{border-color:var(--green3)}
180
180
  const JS = `
181
181
  var API = '';
182
182
  var currentView = 'dashboard';
183
- var chatHistory = [];
183
+ var chatHistory = (function(){try{var s=localStorage.getItem('nha_chat_history');return s?JSON.parse(s):[];}catch(e){return [];}})();
184
184
  var dash = {emails:[],events:[],tasks:[],plan:null,status:null};
185
+
186
+ function saveChatToStorage(){try{localStorage.setItem('nha_chat_history',JSON.stringify(chatHistory.slice(-40)));}catch(e){}}
187
+ function clearChatHistory(){chatHistory=[];saveChatToStorage();renderMessages();}
185
188
  var agentsList = [];
186
189
  var selectedAgent = null;
187
190
 
@@ -279,7 +282,7 @@ function renderDash(el){
279
282
  var chatReady=false;
280
283
  function renderChat(el){
281
284
  if(!chatReady||!document.getElementById('chatMessages')){
282
- el.innerHTML='<div class="chat"><div class="chat__messages" id="chatMessages"></div><div class="chat__bar"><button class="chat__mic" id="chatMic" onclick="toggleVoiceInput()" title="Voice input">&#127908;</button><textarea class="chat__input" id="chatInput" placeholder="Ask anything..." rows="1"></textarea><button class="chat__send" id="chatSend">Send</button></div></div>';
285
+ el.innerHTML='<div class="chat"><div class="chat__messages" id="chatMessages"></div><div class="chat__bar"><button class="chat__mic" id="chatMic" onclick="toggleVoiceInput()" title="Voice input">&#127908;</button><textarea class="chat__input" id="chatInput" placeholder="Ask anything..." rows="1"></textarea><button class="chat__send" id="chatSend">Send</button><button onclick="clearChatHistory()" style="background:none;color:var(--dim);font-size:10px;padding:4px 8px" title="Clear chat history">Clear</button></div></div>';
283
286
  chatReady=true;
284
287
  document.getElementById('chatSend').onclick=sendChat;
285
288
  document.getElementById('chatInput').onkeydown=function(e){if(e.key==='Enter'&&!e.shiftKey){e.preventDefault();sendChat()}};
@@ -302,14 +305,14 @@ function sendChat(){
302
305
  var inp=document.getElementById('chatInput');if(!inp)return;
303
306
  var msg=inp.value.trim();if(!msg)return;
304
307
  chatHistory.push({role:'user',content:msg});
305
- inp.value='';renderMessages();
308
+ inp.value='';saveChatToStorage();renderMessages();
306
309
  chatHistory.push({role:'assistant',content:'Thinking...'});renderMessages();
307
310
  apiPost('/api/chat',{message:msg,history:chatHistory.slice(0,-1)}).then(function(r){
308
311
  chatHistory.pop();
309
312
  if(r&&r.response){chatHistory.push({role:'assistant',content:r.response})}
310
313
  else if(r&&r.error){chatHistory.push({role:'assistant',content:'Error: '+r.error})}
311
314
  else{chatHistory.push({role:'assistant',content:'Error: no response from server'})}
312
- renderMessages();
315
+ saveChatToStorage();renderMessages();
313
316
  // Refresh data if an action was executed
314
317
  if(r&&r.actions&&r.actions.length>0){
315
318
  // Clear calendar cache so new events show up