nothumanallowed 13.5.167 → 13.5.168

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": "13.5.167",
3
+ "version": "13.5.168",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -625,6 +625,29 @@ export async function cmdUI(args) {
625
625
  return;
626
626
  }
627
627
 
628
+ // POST /api/update-npm — install latest nothumanallowed package and restart
629
+ if (method === 'POST' && pathname === '/api/update-npm') {
630
+ sendJSON(res, 200, { ok: true, message: 'Update started' });
631
+ logRequest(method, pathname, 200, Date.now() - start);
632
+ // Stream npm install output via WebSocket, then restart
633
+ setTimeout(async () => {
634
+ const { spawn } = await import('child_process');
635
+ wsBroadcast({ type: 'npm-update', line: '⟳ Running: npm install -g nothumanallowed@latest\n' });
636
+ const child = spawn('npm', ['install', '-g', 'nothumanallowed@latest'], { stdio: ['ignore', 'pipe', 'pipe'] });
637
+ child.stdout.on('data', (d) => wsBroadcast({ type: 'npm-update', line: d.toString() }));
638
+ child.stderr.on('data', (d) => wsBroadcast({ type: 'npm-update', line: d.toString() }));
639
+ child.on('close', (code) => {
640
+ if (code === 0) {
641
+ wsBroadcast({ type: 'npm-update', line: '\n✅ Update complete! Restarting server...\n', done: true });
642
+ } else {
643
+ wsBroadcast({ type: 'npm-update', line: '\n❌ Update failed (exit code ' + code + '). Check output above.\n', error: true });
644
+ }
645
+ setTimeout(() => process.exit(0), 1500);
646
+ });
647
+ }, 100);
648
+ return;
649
+ }
650
+
628
651
  // GET /api/version/check — check npm registry for latest version
629
652
  if (method === 'GET' && pathname === '/api/version/check') {
630
653
  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 = '13.5.167';
8
+ export const VERSION = '13.5.168';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -3808,9 +3808,56 @@ function handleDaemonEvent(msg) {
3808
3808
  }
3809
3809
  }
3810
3810
  break;
3811
+
3812
+ case 'npm-update':
3813
+ var upLog = document.getElementById('npmUpdateLog');
3814
+ if (upLog) {
3815
+ upLog.textContent += msg.line || '';
3816
+ upLog.scrollTop = upLog.scrollHeight;
3817
+ }
3818
+ if (msg.done) {
3819
+ var upStatus = document.getElementById('npmUpdateStatus');
3820
+ if (upStatus) upStatus.textContent = 'Restarting server — reconnecting...';
3821
+ // Poll until server is back up, then reload
3822
+ setTimeout(function pollReconnect() {
3823
+ fetch(API + '/api/status').then(function() {
3824
+ window.location.reload();
3825
+ }).catch(function() {
3826
+ setTimeout(pollReconnect, 1500);
3827
+ });
3828
+ }, 3000);
3829
+ }
3830
+ if (msg.error) {
3831
+ var upStatus2 = document.getElementById('npmUpdateStatus');
3832
+ if (upStatus2) { upStatus2.textContent = 'Update failed. See output above.'; upStatus2.style.color = 'var(--red)'; }
3833
+ var upBtn = document.getElementById('npmUpdateCloseBtn');
3834
+ if (upBtn) upBtn.style.display = 'inline-block';
3835
+ }
3836
+ break;
3811
3837
  }
3812
3838
  }
3813
3839
 
3840
+ function npmUpdate() {
3841
+ // Show modal
3842
+ var existing = document.getElementById('npmUpdateModal');
3843
+ if (existing) existing.remove();
3844
+ var modal = document.createElement('div');
3845
+ modal.id = 'npmUpdateModal';
3846
+ modal.style.cssText = 'position:fixed;inset:0;background:rgba(0,0,0,.7);z-index:9999;display:flex;align-items:center;justify-content:center';
3847
+ modal.innerHTML =
3848
+ '<div style="background:var(--bg2);border:1px solid var(--border);border-radius:10px;padding:24px;width:540px;max-width:95vw;display:flex;flex-direction:column;gap:12px">' +
3849
+ '<div style="font-size:14px;font-weight:700;color:var(--fg)">&#8593; Updating NotHumanAllowed</div>' +
3850
+ '<div id="npmUpdateStatus" style="font-size:11px;color:var(--dim)">Installing latest version...</div>' +
3851
+ '<pre id="npmUpdateLog" style="background:var(--bg);border:1px solid var(--border);border-radius:6px;padding:12px;font-size:10px;color:var(--green);max-height:300px;overflow-y:auto;white-space:pre-wrap;word-break:break-all;margin:0"></pre>' +
3852
+ '<div style="display:flex;justify-content:flex-end">' +
3853
+ '<button id="npmUpdateCloseBtn" onclick="document.getElementById(String.fromCharCode(110,112,109,85,112,100,97,116,101,77,111,100,97,108)).remove()" style="display:none;padding:6px 16px;background:var(--bg);color:var(--dim);border:1px solid var(--border);border-radius:5px;cursor:pointer;font-size:11px">Close</button>' +
3854
+ '</div>' +
3855
+ '</div>';
3856
+ document.body.appendChild(modal);
3857
+ // Start update
3858
+ apiPost('/api/update-npm', {}).catch(function(){});
3859
+ }
3860
+
3814
3861
  // ---- VOICE INPUT (in chat view) ----
3815
3862
  var voiceRecognition = null;
3816
3863
  var voiceRecording = false;
@@ -4164,7 +4211,7 @@ function renderSidebar() {
4164
4211
  \x27<a href="https://nothumanallowed.com/docs/mobile" target="_blank" class="nav-item" style="text-decoration:none"><span class="nav-item__icon">&#128241;</span> \x27+t(\x27nav_mobile\x27)+\x27</a>\x27+
4165
4212
  \x27</div>\x27+
4166
4213
  \x27<div style="padding:12px 16px;margin-top:auto;border-top:1px solid var(--border);font-size:10px;color:var(--dim)">nothumanallowed.com<span style="margin-left:6px;opacity:.5">v${VERSION}</span>\x27+
4167
- (_updateInfo&&_updateInfo.updateAvailable?\x27<span style="margin-left:8px;background:#f59e0b;color:#000;border-radius:4px;padding:1px 6px;font-weight:700;cursor:pointer" title="Run: npm i -g nothumanallowed to update to v\x27+(_updateInfo.latest||\x27\x27)+\x27">&#8593; Update v\x27+(_updateInfo.latest||\x27\x27)+\x27</span>\x27:\x27\x27)+
4214
+ (_updateInfo&&_updateInfo.updateAvailable?\x27<span onclick="npmUpdate()" style="margin-left:8px;background:#f59e0b;color:#000;border-radius:4px;padding:1px 6px;font-weight:700;cursor:pointer" title="Click to update to v\x27+(_updateInfo.latest||\x27\x27)+\x27">&#8593; Update v\x27+(_updateInfo.latest||\x27\x27)+\x27</span>\x27:\x27\x27)+
4168
4215
  \x27</div>\x27;
4169
4216
  }
4170
4217