nothumanallowed 13.5.78 → 13.5.79

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.78",
3
+ "version": "13.5.79",
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": {
@@ -7887,20 +7887,23 @@ async function wcGenerate() {
7887
7887
  '<div style="display:flex;gap:4px;margin-top:10px">'+[0,1,2,3,4].map(function(_,idx){ return '<div style="width:6px;height:6px;border-radius:50%;background:var(--green);animation:wcDot 1.1s ease-in-out infinite '+(idx*0.14)+'s"></div>'; }).join('')+'</div>';
7888
7888
  }
7889
7889
 
7890
+ // Helper: generate one file, returns {ok, content} or {ok:false, err}
7891
+ async function wcGenOneFile(fp, signal) {
7892
+ var _nl2 = String.fromCharCode(10);
7893
+ var content = await wcCallLLM(sysPreamble, fp.prompt + _nl2 + _nl2 + 'File to generate: ' + fp.name, signal);
7894
+ var _fence = String.fromCharCode(96,96,96);
7895
+ var wcLines = content.split(_nl2);
7896
+ if (wcLines.length > 0 && wcLines[0].indexOf(_fence) === 0) wcLines.shift();
7897
+ if (wcLines.length > 0 && wcLines[wcLines.length-1].trim() === _fence) wcLines.pop();
7898
+ return wcLines.join(_nl2).trim();
7899
+ }
7900
+
7890
7901
  for (var fi = 0; fi < filePlan.length; fi++) {
7891
7902
  var fp = filePlan[fi];
7892
7903
  wcUpdateGenOverlay(fi, filePlan.length, fp.name);
7893
- // Check if aborted
7894
7904
  if (_wcGenAbortCtrl && _wcGenAbortCtrl.signal.aborted) break;
7895
7905
  try {
7896
- var _nl2 = String.fromCharCode(10);
7897
- var content = await wcCallLLM(sysPreamble, fp.prompt + _nl2 + _nl2 + 'File to generate: ' + fp.name, _wcGenAbortCtrl ? _wcGenAbortCtrl.signal : null);
7898
- // Strip markdown code fences if model added them anyway
7899
- var _fence = String.fromCharCode(96,96,96);
7900
- var wcLines = content.split(_nl2);
7901
- if (wcLines.length > 0 && wcLines[0].indexOf(_fence) === 0) wcLines.shift();
7902
- if (wcLines.length > 0 && wcLines[wcLines.length-1].trim() === _fence) wcLines.pop();
7903
- content = wcLines.join(_nl2).trim();
7906
+ var content = await wcGenOneFile(fp, _wcGenAbortCtrl ? _wcGenAbortCtrl.signal : null);
7904
7907
  wcState.generatedFiles.push({ name: fp.name, content: content, lang: fp.lang });
7905
7908
  if (fi === 0) wcState.activeFile = 0;
7906
7909
  renderWebCraft(document.getElementById('content'));
@@ -7912,6 +7915,33 @@ async function wcGenerate() {
7912
7915
  }
7913
7916
  }
7914
7917
 
7918
+ // ── Retry pass: regenerate files that failed ──────────────────────────────
7919
+ var failedFiles = wcState.generatedFiles.filter(function(f){ return f._error; });
7920
+ if (failedFiles.length > 0 && !(_wcGenAbortCtrl && _wcGenAbortCtrl.signal.aborted)) {
7921
+ var retryPlan = filePlan.filter(function(fp){ return failedFiles.some(function(f){ return f.name === fp.name; }); });
7922
+ for (var ri = 0; ri < retryPlan.length; ri++) {
7923
+ var rfp = retryPlan[ri];
7924
+ wcUpdateGenOverlay(ri, retryPlan.length, 'Retry: ' + rfp.name);
7925
+ if (_wcGenAbortCtrl && _wcGenAbortCtrl.signal.aborted) break;
7926
+ // Wait 3s before retry to let Liara recover
7927
+ await new Promise(function(resolve){ setTimeout(resolve, 3000); });
7928
+ try {
7929
+ var retryContent = await wcGenOneFile(rfp, _wcGenAbortCtrl ? _wcGenAbortCtrl.signal : null);
7930
+ // Replace the error entry with the successful one
7931
+ for (var gi = 0; gi < wcState.generatedFiles.length; gi++) {
7932
+ if (wcState.generatedFiles[gi].name === rfp.name) {
7933
+ wcState.generatedFiles[gi] = { name: rfp.name, content: retryContent, lang: rfp.lang };
7934
+ break;
7935
+ }
7936
+ }
7937
+ renderWebCraft(document.getElementById('content'));
7938
+ } catch(re) {
7939
+ if (re && re.name === 'AbortError') break;
7940
+ // Keep as error — already in generatedFiles
7941
+ }
7942
+ }
7943
+ }
7944
+
7915
7945
  wcState.running = false;
7916
7946
  _wcGenAbortCtrl = null;
7917
7947
  _wcOverlayMinimized = false;