nothumanallowed 13.5.74 → 13.5.76

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.74",
3
+ "version": "13.5.76",
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": {
@@ -3997,12 +3997,15 @@ ${completedHeadings ? `## SECTIONS ALREADY WRITTEN (headings only):\n${completed
3997
3997
  // Default types for well-known filenames
3998
3998
  const defaultType = (n) => n === 'memory.md' ? 'memory' : n === 'liara.md' ? 'provider' : 'skill';
3999
3999
  const skills = [];
4000
- for (const fname of fs.readdirSync(skillsDir)) {
4001
- if (!fname.endsWith('.md')) continue;
4000
+ // .md first (sorted), then .log files (sorted newest-first by filename)
4001
+ const allFiles = fs.readdirSync(skillsDir);
4002
+ const mdFiles = allFiles.filter(f => f.endsWith('.md')).sort();
4003
+ const logFiles = allFiles.filter(f => f.endsWith('.log')).sort().reverse();
4004
+ for (const fname of [...mdFiles, ...logFiles]) {
4002
4005
  try {
4003
4006
  const content = fs.readFileSync(path.join(skillsDir, fname), 'utf8');
4004
4007
  const type = typeIndex[fname] || defaultType(fname);
4005
- skills.push({ name: fname, content, type });
4008
+ skills.push({ name: fname, content, type: fname.endsWith('.log') ? 'log' : type });
4006
4009
  } catch(_) {}
4007
4010
  }
4008
4011
  sendJSON(res, 200, { skills });
@@ -7872,7 +7872,9 @@ async function wcGenerate() {
7872
7872
  renderWebCraft(document.getElementById('content'));
7873
7873
  } catch(e) {
7874
7874
  if (e && e.name === 'AbortError') break;
7875
- wcState.generatedFiles.push({ name: fp.name, content: '// Error generating this file: ' + e.message, lang: fp.lang });
7875
+ wcState.generatedFiles.push({ name: fp.name, content: '// Error generating this file: ' + (e.message || 'unknown error'), lang: fp.lang });
7876
+ if (fi === 0) wcState.activeFile = 0;
7877
+ renderWebCraft(document.getElementById('content'));
7876
7878
  }
7877
7879
  }
7878
7880
 
@@ -7899,10 +7901,22 @@ async function wcCallLLM(sys, user, signal) {
7899
7901
  body: JSON.stringify({system: sys, user: user, max_tokens: 4096})
7900
7902
  };
7901
7903
  if (signal) fetchOpts.signal = signal;
7902
- var r = await fetch(API + '/api/studio/webcraft', fetchOpts);
7903
- if (!r.ok) throw new Error('LLM error ' + r.status);
7904
- var d = await r.json();
7905
- return (d && (d.text || d.content || d.result)) || '';
7904
+ // Retry up to 2 times on 5xx errors (Liara may be temporarily overloaded)
7905
+ for (var attempt = 0; attempt < 3; attempt++) {
7906
+ if (signal && signal.aborted) throw new DOMException('Aborted', 'AbortError');
7907
+ var r = await fetch(API + '/api/studio/webcraft', fetchOpts);
7908
+ if (r.ok) {
7909
+ var d = await r.json();
7910
+ return (d && (d.text || d.content || d.result)) || '';
7911
+ }
7912
+ if (r.status < 500 || attempt === 2) {
7913
+ var errBody = '';
7914
+ try { var eb = await r.json(); errBody = eb.error || ''; } catch(_) {}
7915
+ throw new Error('LLM error ' + r.status + (errBody ? ': ' + errBody : ''));
7916
+ }
7917
+ // 5xx — wait 2s then retry
7918
+ await new Promise(function(resolve) { setTimeout(resolve, 2000); });
7919
+ }
7906
7920
  }
7907
7921
 
7908
7922
  function wcSandboxPanelHtml() {
@@ -7936,7 +7950,7 @@ function wcSandboxPanelHtml() {
7936
7950
  '<div style="display:flex;gap:8px;align-items:flex-start"><span style="color:var(--green);flex-shrink:0">3.</span><span>Il server Express parte su una porta locale casuale</span></div>' +
7937
7951
  '<div style="display:flex;gap:8px;align-items:flex-start"><span style="color:var(--green);flex-shrink:0">4.</span><span>DB in-memory (no PostgreSQL richiesto) — i dati si azzerano al riavvio</span></div>' +
7938
7952
  '</div>' +
7939
- '<div style="margin-top:12px;padding:8px 10px;background:var(--amberdim);border:1px solid var(--amber3);border-radius:6px;font-size:10px;color:var(--amber)">&#9888; Solo locale — nessun dato esce dal tuo Mac</div>' +
7953
+ '<div style="margin-top:12px;padding:8px 10px;background:var(--amberdim);border:1px solid var(--amber3);border-radius:6px;font-size:10px;color:var(--amber)">&#9888; Solo locale — nessun dato esce dal tuo dispositivo</div>' +
7940
7954
  '</div>' +
7941
7955
  '</div>';
7942
7956
  }
@@ -8089,10 +8103,14 @@ async function wcStartSandbox() {
8089
8103
  wcState.sandbox.dir = evt.dir;
8090
8104
  _wcAutoFixAttempts = 0;
8091
8105
  wcStartAutoFixPoller();
8106
+ // Reload skills so newly written log file appears in the panel
8107
+ _wcSkillsLoaded = false;
8092
8108
  renderWebCraft(document.getElementById('content'));
8093
8109
  } else if (evt.type === 'error') {
8094
8110
  wcState.sandbox.running = false;
8095
8111
  wcState.sandbox.error = evt.msg;
8112
+ // Reload skills so error log appears in the panel
8113
+ _wcSkillsLoaded = false;
8096
8114
  renderWebCraft(document.getElementById('content'));
8097
8115
  // Auto-fix: try to detect MODULE_NOT_FOUND in crash message and fix it
8098
8116
  var errMsg = evt.msg || '';