nothumanallowed 13.5.155 → 13.5.157

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.155",
3
+ "version": "13.5.157",
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.155';
8
+ export const VERSION = '13.5.157';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -3195,7 +3195,7 @@ function renderSettings(el) {
3195
3195
  ['model', 'Model', 'Leave empty for default'],
3196
3196
  ['thinking', 'Extended Thinking', 'on / off - Qwen3 reasoning mode (NHA Free only)'],
3197
3197
  ]) +
3198
- settingsSection('responder', 'Message Responder', 'Auto-reply to Telegram and Discord messages.', [
3198
+ settingsSection('responder', 'Telegram & Discord Bot', 'Auto-reply to Telegram and Discord messages.', [
3199
3199
  ['telegram-bot-token', 'Telegram Bot Token', 'Get from @BotFather', true],
3200
3200
  ['discord-bot-token', 'Discord Bot Token', 'From Discord Developer Portal', true],
3201
3201
  ]) +
@@ -8889,13 +8889,40 @@ async function wcGenerate() {
8889
8889
  }
8890
8890
  var content = await wcCallLLM(sysPreamble, fp.prompt + _nl2 + _nl2 + 'File to generate: ' + fp.name, signal, fp.lang, undefined, onLiveUpdate);
8891
8891
  content = wcStripFences(content);
8892
- // Post-process package.json: fix common LLM mistakes (spaces in keys/names, duplicates)
8892
+ // Post-process: fix LLM streaming artifacts (spaces inserted inside keywords/identifiers)
8893
+ if (fp.lang === 'javascript' || fp.lang === 'typescript') {
8894
+ // Fix spaces inside JS/TS keywords that LLMs sometimes split during streaming
8895
+ var jsKeywords = ['const', 'let', 'var', 'function', 'return', 'require', 'import', 'export',
8896
+ 'class', 'extends', 'async', 'await', 'throw', 'catch', 'finally', 'typeof', 'instanceof',
8897
+ 'switch', 'default', 'continue', 'debugger', 'delete', 'module', 'exports', 'process'];
8898
+ jsKeywords.forEach(function(kw) {
8899
+ // Match keyword split across 1-3 chars with a space e.g. "con st", "re quire", "ex port"
8900
+ for (var split = 1; split < kw.length - 1; split++) {
8901
+ var broken = kw.slice(0, split) + ' ' + kw.slice(split);
8902
+ // Only replace when at word boundary (start of line or after space/punctuation)
8903
+ content = content.split(broken).join(kw);
8904
+ }
8905
+ });
8906
+ // Fix spaces inside common identifiers like "error Handler", "api Routes", "sec urityMiddleware"
8907
+ // Pattern: camelCase word split by a space before an uppercase letter
8908
+ content = content.replace(new RegExp('([a-z]) ([A-Z][a-z])', 'g'), '$1$2');
8909
+ // Fix "r equire" style splits in middle of word before a space+letter
8910
+ content = content.replace(new RegExp('\\b([a-z]{1,4}) ([a-z]{2,})', 'g'), function(m, a, b) {
8911
+ var joined = a + b;
8912
+ if (jsKeywords.indexOf(joined) !== -1) return joined;
8913
+ return m; // don't join random words
8914
+ });
8915
+ // Fix backslash-n literal artifacts from LLM
8916
+ var bsn = String.fromCharCode(92) + ' n';
8917
+ content = content.split(bsn).join('');
8918
+ var bsn2 = String.fromCharCode(92) + 'n';
8919
+ content = content.split(bsn2).join('');
8920
+ }
8921
+ // Post-process package.json: fix spaces in keys/names, duplicates
8893
8922
  if (fp.name === 'package.json' && fp.lang === 'json') {
8894
8923
  try {
8895
8924
  var pkg = JSON.parse(content);
8896
- // Fix name field
8897
8925
  if (typeof pkg.name === 'string') pkg.name = pkg.name.trim().toLowerCase().replace(/\s+/g, '-');
8898
- // Fix all dependency sections: strip spaces from keys, deduplicate
8899
8926
  ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'].forEach(function(section) {
8900
8927
  if (!pkg[section] || typeof pkg[section] !== 'object') return;
8901
8928
  var clean = {};
@@ -8906,7 +8933,7 @@ async function wcGenerate() {
8906
8933
  pkg[section] = clean;
8907
8934
  });
8908
8935
  content = JSON.stringify(pkg, null, 2);
8909
- } catch(_) { /* if JSON is already broken, leave as-is for repair to handle */ }
8936
+ } catch(_) {}
8910
8937
  }
8911
8938
  return content;
8912
8939
  }