nothumanallowed 15.0.0 → 15.0.2

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": "15.0.0",
3
+ "version": "15.0.2",
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 = '15.0.0';
8
+ export const VERSION = '15.0.2';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1205,9 +1205,15 @@ function countTokens(text) {
1205
1205
  * Returns true if the file likely needs a continuation call.
1206
1206
  */
1207
1207
  function isFileTruncated(content, filename) {
1208
- if (!content || content.length < 10) return true;
1208
+ if (!content) return true;
1209
1209
  const trimmed = content.trimEnd();
1210
1210
  const ext = filename.split('.').pop()?.toLowerCase();
1211
+ // Short files: check if they're valid for their type before flagging
1212
+ if (trimmed.length < 10) {
1213
+ if (ext === 'json') { try { JSON.parse(trimmed); return false; } catch { return true; } }
1214
+ if (ext === 'css' || ext === 'js' || ext === 'mjs') return trimmed.length < 3;
1215
+ return false;
1216
+ }
1211
1217
 
1212
1218
  if (ext === 'js' || ext === 'mjs' || ext === 'ts') {
1213
1219
  const open = (trimmed.match(/\{/g) || []).length;
@@ -2568,6 +2574,7 @@ export function register(router) {
2568
2574
  try {
2569
2575
  const { projectName } = await parseBody(req);
2570
2576
  if (!projectName) return sendError(res, 400, 'projectName required');
2577
+ console.log('[scan] Starting scan for:', projectName);
2571
2578
  const dir = ProjectStore.dir(projectName);
2572
2579
  if (!fs.existsSync(dir)) return sendJSON(res, 200, { issues: [] });
2573
2580
 
@@ -2581,8 +2588,10 @@ export function register(router) {
2581
2588
 
2582
2589
  let diags = [];
2583
2590
  if (['js', 'mjs', 'jsx', 'cjs'].includes(ext)) {
2584
- const tsDiags = await lintJSWithTypeScript(dir, relPath);
2585
- diags = tsDiags || lintJS(content, relPath, projectName);
2591
+ try {
2592
+ const tsDiags = await lintJSWithTypeScript(dir, relPath);
2593
+ diags = tsDiags || lintJS(content, relPath, projectName);
2594
+ } catch { diags = lintJS(content, relPath, projectName); }
2586
2595
  } else if (ext === 'json') {
2587
2596
  try { JSON.parse(content); } catch (e) {
2588
2597
  diags.push({ from: { line: 1, col: 0 }, severity: 'error', message: e.message });
@@ -2607,7 +2616,7 @@ export function register(router) {
2607
2616
  }
2608
2617
 
2609
2618
  sendJSON(res, 200, { issues, scanned: files.length });
2610
- } catch (e) { sendError(res, 500, e.message); }
2619
+ } catch (e) { console.error('[scan] CRASH:', e); sendError(res, 500, e.message); }
2611
2620
  });
2612
2621
 
2613
2622
  // ── Syntax check ──────────────────────────────────────────────────────────