nothumanallowed 13.5.169 → 13.5.171

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.169",
3
+ "version": "13.5.171",
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": {
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.169';
8
+ export const VERSION = '13.5.171';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -3817,15 +3817,8 @@ function handleDaemonEvent(msg) {
3817
3817
  }
3818
3818
  if (msg.done) {
3819
3819
  var upStatus = document.getElementById('npmUpdateStatus');
3820
- if (upStatus) upStatus.textContent = 'Restarting serverreconnecting...';
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);
3820
+ if (upStatus) upStatus.textContent = 'npm install complete server restarting...';
3821
+ // Reload is handled by the independent poll in npmUpdate()
3829
3822
  }
3830
3823
  if (msg.error) {
3831
3824
  var upStatus2 = document.getElementById('npmUpdateStatus');
@@ -3838,7 +3831,6 @@ function handleDaemonEvent(msg) {
3838
3831
  }
3839
3832
 
3840
3833
  function npmUpdate() {
3841
- // Show modal
3842
3834
  var existing = document.getElementById('npmUpdateModal');
3843
3835
  if (existing) existing.remove();
3844
3836
  var modal = document.createElement('div');
@@ -3854,8 +3846,60 @@ function npmUpdate() {
3854
3846
  '</div>' +
3855
3847
  '</div>';
3856
3848
  document.body.appendChild(modal);
3857
- // Start update
3849
+
3850
+ // Start update — fire and forget (server will exit after npm install)
3858
3851
  apiPost('/api/update-npm', {}).catch(function(){});
3852
+
3853
+ // Independent reconnect poll — does NOT depend on WebSocket
3854
+ // Phase 1: wait for server to go down (up to 3 min)
3855
+ // Phase 2: wait for server to come back up, then reload
3856
+ var serverWasUp = true;
3857
+ var pollStart = Date.now();
3858
+ var MAX_WAIT = 180000; // 3 min total
3859
+ function pollDown() {
3860
+ if (Date.now() - pollStart > MAX_WAIT) {
3861
+ var st = document.getElementById('npmUpdateStatus');
3862
+ if (st) { st.textContent = 'Timeout — reload the page manually.'; st.style.color = 'var(--red)'; }
3863
+ var cb = document.getElementById('npmUpdateCloseBtn');
3864
+ if (cb) cb.style.display = 'inline-block';
3865
+ return;
3866
+ }
3867
+ fetch(window.location.origin + '/api/status', { cache: 'no-store' }).then(function() {
3868
+ setTimeout(pollDown, 1000); // still up, keep waiting
3869
+ }).catch(function() {
3870
+ // Server went down — now wait for it to come back
3871
+ var st = document.getElementById('npmUpdateStatus');
3872
+ if (st) st.textContent = 'Server restarting — reconnecting...';
3873
+ setTimeout(pollUp, 1500);
3874
+ });
3875
+ }
3876
+ function pollUp() {
3877
+ if (Date.now() - pollStart > MAX_WAIT) {
3878
+ var st = document.getElementById('npmUpdateStatus');
3879
+ if (st) { st.textContent = 'Server took too long — reload the page manually.'; st.style.color = 'var(--red)'; }
3880
+ var cb = document.getElementById('npmUpdateCloseBtn');
3881
+ if (cb) cb.style.display = 'inline-block';
3882
+ return;
3883
+ }
3884
+ fetch(window.location.origin + '/api/status', { cache: 'no-store' }).then(function() {
3885
+ // First response — wait 2s then confirm server is stable before reloading
3886
+ var st = document.getElementById('npmUpdateStatus');
3887
+ if (st) st.textContent = 'Server back — loading...';
3888
+ setTimeout(function() {
3889
+ fetch(window.location.origin + '/api/status', { cache: 'no-store' }).then(function() {
3890
+ if (st) st.textContent = 'Update complete! Reloading...';
3891
+ setTimeout(function() { window.location.reload(); }, 500);
3892
+ }).catch(function() {
3893
+ // Went back down, keep polling
3894
+ setTimeout(pollUp, 1500);
3895
+ });
3896
+ }, 2000);
3897
+ }).catch(function() {
3898
+ setTimeout(pollUp, 1500);
3899
+ });
3900
+ }
3901
+ // Start polling for server going down after a short delay
3902
+ setTimeout(pollDown, 5000);
3859
3903
  }
3860
3904
 
3861
3905
  // ---- VOICE INPUT (in chat view) ----