nothumanallowed 8.8.0 → 8.8.2

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": "8.8.0",
3
+ "version": "8.8.2",
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": {
@@ -831,15 +831,15 @@ export async function cmdUI(args) {
831
831
  return;
832
832
  }
833
833
  const agentFile = path.join(AGENTS_DIR, `${name}.mjs`);
834
- if (fs.existsSync(agentFile)) {
835
- sendJSON(res, 409, { error: `Agent "${name}" already exists` });
836
- logRequest(method, pathname, 409, Date.now() - start);
837
- return;
838
- }
839
834
  const content = `// NHA Custom Agent: ${name}\n// Created: ${new Date().toISOString()}\n\nexport const CARD = {\n name: '${name}',\n displayName: '${name.toUpperCase()}',\n category: 'custom',\n tagline: '${tagline.replace(/'/g, "\\'")}',\n};\n\nexport const SYSTEM_PROMPT = \`${systemPrompt.replace(/`/g, '\\`')}\`;\n`;
840
835
  if (!fs.existsSync(AGENTS_DIR)) fs.mkdirSync(AGENTS_DIR, { recursive: true });
841
836
  fs.writeFileSync(agentFile, content, 'utf-8');
842
- agentCards.push({ name, displayName: name.toUpperCase(), category: 'custom', tagline });
837
+ const existingIdx = agentCards.findIndex(a => a.name === name);
838
+ if (existingIdx >= 0) {
839
+ agentCards[existingIdx] = { name, displayName: name.toUpperCase(), category: 'custom', tagline };
840
+ } else {
841
+ agentCards.push({ name, displayName: name.toUpperCase(), category: 'custom', tagline });
842
+ }
843
843
  sendJSON(res, 201, { ok: true, agent: { name, category: 'custom', tagline } });
844
844
  logRequest(method, pathname, 201, Date.now() - start);
845
845
  return;
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 = '8.8.0';
8
+ export const VERSION = '8.8.2';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1122,7 +1122,7 @@ function showCreateAgentForm(){
1122
1122
  var sysPrompt=prompt('System prompt (agent personality & instructions):');
1123
1123
  if(!sysPrompt)return;
1124
1124
  apiPost('/api/agents',{name:name,tagline:tagline,systemPrompt:sysPrompt}).then(function(r){
1125
- if(r&&r.ok){showToast('success','Agent Created',name.toUpperCase()+' is ready to use');loadView('agents');}
1125
+ if(r&&r.ok){showToast('success','Agent Created',name.toUpperCase()+' is ready to use');loadAgents().then(function(){renderAgents(document.getElementById('content'))});}
1126
1126
  else{alert('Error: '+(r&&r.error||'Unknown'));}
1127
1127
  });
1128
1128
  }
@@ -1134,7 +1134,7 @@ function editAgent(name){
1134
1134
  var newPrompt=prompt('System prompt:',data.systemPrompt||'');
1135
1135
  if(newPrompt===null)return;
1136
1136
  fetch('/api/agents/'+name,{method:'PUT',headers:{'Content-Type':'application/json'},body:JSON.stringify({tagline:newTagline,systemPrompt:newPrompt,category:data.category||'custom'})}).then(function(r){return r.json()}).then(function(r){
1137
- if(r&&r.ok){showToast('success','Agent Updated',name.toUpperCase()+' updated');loadView('agents');}
1137
+ if(r&&r.ok){showToast('success','Agent Updated',name.toUpperCase()+' updated');loadAgents().then(function(){renderAgents(document.getElementById('content'))});}
1138
1138
  else{alert('Error: '+(r&&r.error||'Unknown'));}
1139
1139
  });
1140
1140
  });
@@ -1143,7 +1143,7 @@ function editAgent(name){
1143
1143
  function deleteAgent(name){
1144
1144
  if(!confirm('Delete agent "'+name+'"? This cannot be undone.'))return;
1145
1145
  fetch('/api/agents/'+name,{method:'DELETE'}).then(function(r){return r.json()}).then(function(r){
1146
- if(r&&r.ok){showToast('success','Agent Deleted',name+' removed');loadView('agents');}
1146
+ if(r&&r.ok){showToast('success','Agent Deleted',name+' removed');loadAgents().then(function(){renderAgents(document.getElementById('content'))});}
1147
1147
  else{alert('Error: '+(r&&r.error||'Unknown'));}
1148
1148
  });
1149
1149
  }