nothumanallowed 14.3.1 → 14.3.3

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": "14.3.1",
3
+ "version": "14.3.3",
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 = '14.3.1';
8
+ export const VERSION = '14.3.3';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1172,6 +1172,10 @@ Continue from here:`;
1172
1172
  }
1173
1173
 
1174
1174
  // ── Post-generation integrity check ──────────────────────────────────────
1175
+ if (abortSignal?.aborted) {
1176
+ emit({ type: 'done', tokIn: totalTokensIn, tokOut: totalTokensOut });
1177
+ return;
1178
+ }
1175
1179
  const brokenFiles = generatedFiles.filter((f) => {
1176
1180
  if (!f.content || f.content.length < 20) return true;
1177
1181
  if (f.name.endsWith('.html') && !f.content.includes('</html>')) return true;
@@ -1434,6 +1438,68 @@ export function register(router) {
1434
1438
  } catch (e) { sendError(res, 500, e.message); }
1435
1439
  });
1436
1440
 
1441
+ // ── Diagnostics (lint) — returns errors/warnings for a file ───────────────
1442
+ router.post('/api/studio/webcraft/lint', async (req, res) => {
1443
+ try {
1444
+ const { projectName, path: relPath } = await parseBody(req);
1445
+ if (!projectName || !relPath) return sendError(res, 400, 'projectName and path required');
1446
+ const content = ProjectStore.readFile(projectName, relPath);
1447
+ if (content === null) return sendJSON(res, 200, { diagnostics: [] });
1448
+
1449
+ const diagnostics = [];
1450
+ const ext = relPath.split('.').pop()?.toLowerCase();
1451
+
1452
+ if (ext === 'js' || ext === 'mjs' || ext === 'jsx') {
1453
+ try { new Function(content); } catch (e) {
1454
+ const match = e.message.match(/^(.*?)$/m);
1455
+ const lineMatch = e.message.match(/:(\d+):(\d+)/);
1456
+ diagnostics.push({
1457
+ from: lineMatch ? { line: parseInt(lineMatch[1]), col: parseInt(lineMatch[2]) } : { line: 1, col: 0 },
1458
+ severity: 'error',
1459
+ message: match?.[1] || e.message,
1460
+ });
1461
+ }
1462
+ }
1463
+
1464
+ if (ext === 'json') {
1465
+ try { JSON.parse(content); } catch (e) {
1466
+ const posMatch = e.message.match(/position (\d+)/);
1467
+ const pos = posMatch ? parseInt(posMatch[1]) : 0;
1468
+ const lines = content.slice(0, pos).split('\n');
1469
+ diagnostics.push({
1470
+ from: { line: lines.length, col: (lines[lines.length - 1] || '').length },
1471
+ severity: 'error',
1472
+ message: e.message,
1473
+ });
1474
+ }
1475
+ }
1476
+
1477
+ if (ext === 'css') {
1478
+ const opens = (content.match(/\{/g) || []).length;
1479
+ const closes = (content.match(/\}/g) || []).length;
1480
+ if (opens !== closes) {
1481
+ diagnostics.push({
1482
+ from: { line: content.split('\n').length, col: 0 },
1483
+ severity: 'warning',
1484
+ message: `Unbalanced braces: ${opens} open, ${closes} close`,
1485
+ });
1486
+ }
1487
+ }
1488
+
1489
+ if (ext === 'html' || ext === 'htm') {
1490
+ if (!content.includes('</html>')) {
1491
+ diagnostics.push({
1492
+ from: { line: content.split('\n').length, col: 0 },
1493
+ severity: 'warning',
1494
+ message: 'Missing </html> closing tag',
1495
+ });
1496
+ }
1497
+ }
1498
+
1499
+ sendJSON(res, 200, { diagnostics });
1500
+ } catch (e) { sendError(res, 500, e.message); }
1501
+ });
1502
+
1437
1503
  // ── File write (from IDE editor) ──────────────────────────────────────────
1438
1504
  router.post('/api/studio/webcraft/file/write', async (req, res) => {
1439
1505
  try {