nothumanallowed 13.5.75 → 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.75",
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 });
@@ -7901,10 +7901,22 @@ async function wcCallLLM(sys, user, signal) {
7901
7901
  body: JSON.stringify({system: sys, user: user, max_tokens: 4096})
7902
7902
  };
7903
7903
  if (signal) fetchOpts.signal = signal;
7904
- var r = await fetch(API + '/api/studio/webcraft', fetchOpts);
7905
- if (!r.ok) throw new Error('LLM error ' + r.status);
7906
- var d = await r.json();
7907
- 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
+ }
7908
7920
  }
7909
7921
 
7910
7922
  function wcSandboxPanelHtml() {
@@ -8091,10 +8103,14 @@ async function wcStartSandbox() {
8091
8103
  wcState.sandbox.dir = evt.dir;
8092
8104
  _wcAutoFixAttempts = 0;
8093
8105
  wcStartAutoFixPoller();
8106
+ // Reload skills so newly written log file appears in the panel
8107
+ _wcSkillsLoaded = false;
8094
8108
  renderWebCraft(document.getElementById('content'));
8095
8109
  } else if (evt.type === 'error') {
8096
8110
  wcState.sandbox.running = false;
8097
8111
  wcState.sandbox.error = evt.msg;
8112
+ // Reload skills so error log appears in the panel
8113
+ _wcSkillsLoaded = false;
8098
8114
  renderWebCraft(document.getElementById('content'));
8099
8115
  // Auto-fix: try to detect MODULE_NOT_FOUND in crash message and fix it
8100
8116
  var errMsg = evt.msg || '';