nothumanallowed 14.4.1 → 14.4.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": "14.4.1",
3
+ "version": "14.4.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 = '14.4.1';
8
+ export const VERSION = '14.4.2';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1031,46 +1031,40 @@ RULES:
1031
1031
 
1032
1032
  // ── Generation pipeline (SSE) ─────────────────────────────────────────────────
1033
1033
 
1034
- const FILE_PLAN_SYSTEM = `You are the lead architect of a 200-person engineering team. Design an ENTERPRISE-GRADE file structure.
1035
- Output ONLY a JSON array: [{"name":"path/to/file.ext","purpose":"detailed description","tokens":N}]
1036
- where "tokens" is your estimate of content tokens (200-600 small, 600-1500 medium, 1500-3000 large).
1037
- CRITICAL: No single file should exceed 3000 tokens. Split large files into smaller modules.
1038
-
1039
- MANDATORY STRUCTURE (every project MUST have):
1040
- - package.json (with ALL dependencies: express, helmet, cors, compression, morgan, bcryptjs, jsonwebtoken, express-rate-limit, cookie-parser, dotenv)
1041
- - .env.example (all env vars documented)
1042
- - README.md (setup guide, API docs, architecture overview)
1043
- - server.js (Express with full middleware stack)
1044
- - routes/ (separate file per resource — auth.js, api.js, pages.js)
1045
- - middleware/ (auth.js, error.js, validate.js, rateLimiter.js)
1046
- - models/ (per-entity files with validation)
1047
- - controllers/ (business logic separated from routes)
1048
- - utils/ (jwt.js, hash.js, logger.js, helpers.js)
1049
- - config/ (database.js, constants.js)
1050
- - public/index.html (hero, features, testimonials, pricing, CTA, footer complete landing page)
1051
- - public/login.html (login + register forms with validation)
1052
- - public/dashboard.html (protected page with real UI)
1053
- - public/css/variables.css (CSS custom properties: colors, fonts, spacing, breakpoints)
1054
- - public/css/reset.css (modern CSS reset)
1055
- - public/css/layout.css (grid/flexbox layouts, nav, hero, sections)
1056
- - public/css/components.css (buttons, cards, forms, modals, toasts, badges)
1057
- - public/css/animations.css (keyframes, transitions, scroll animations)
1058
- - public/css/responsive.css (media queries, mobile nav)
1059
- - public/js/app.js (SPA router, init, dark mode toggle)
1060
- - public/js/auth.js (login/register/logout, token management)
1061
- - public/js/api.js (fetch wrapper with auth headers, error handling)
1062
- - public/js/ui.js (toasts, modals, loading spinners, form validation)
1063
- - public/js/animations.js (intersection observer, scroll effects)
1064
-
1065
- RULES:
1066
- - Generate 30-50 files — many small files are better than few large ones
1067
- - NEVER generate a file larger than 200 lines. Split into components/partials instead
1068
- - HTML pages: use <script src="js/page.js"> and <link href="css/page.css"> — NOT inline
1069
- - CSS: one file per concern (max 150 lines each), NOT one giant file
1070
- - JS: one file per feature (max 150 lines each)
1071
- - Token estimates must be realistic: CSS files 1500-3000, JS files 1000-2000, HTML pages 2000-4000
1072
- - Use relative paths only
1073
- - No explanation, no markdown, ONLY the JSON array.`;
1034
+ const FILE_PLAN_SYSTEM = `You are a senior architect. Design a MINIMAL but COMPLETE working website.
1035
+ Output ONLY a JSON array: [{"name":"path/file.ext","purpose":"description","tokens":N}]
1036
+
1037
+ CRITICAL RULES:
1038
+ - Generate 8-15 files MAXIMUM — every file must be COMPLETE and WORKING
1039
+ - Each file should be 100-300 lines — substantial but not truncated
1040
+ - Token estimate per file: 500-2000 tokens (no file should need more than 2500)
1041
+ - The generated site must work IMMEDIATELY when you run "node server.js"
1042
+ - Users can add more features later via chat — start with a solid foundation
1043
+
1044
+ REQUIRED FILES:
1045
+ 1. package.json — dependencies (express, helmet, cors, compression, morgan, bcryptjs, jsonwebtoken, dotenv, cookie-parser, express-rate-limit)
1046
+ 2. .env.example environment variables
1047
+ 3. server.js Express server with ALL middleware, routes, and static serving
1048
+ 4. public/index.html — COMPLETE landing page (hero, features, footer — all CSS inline in <style>, all JS inline in <script>)
1049
+ 5. public/login.html — Login + register page (complete with inline CSS/JS, form validation, API calls)
1050
+ 6. public/css/style.css — ONE main stylesheet (variables, reset, layout, components, responsiveeverything in one file)
1051
+ 7. public/js/app.js — Main JS (SPA routing, auth, API client, dark mode, toasts, form validation)
1052
+ 8. middleware/auth.js JWT authentication middleware
1053
+ 9. routes/auth.js Auth routes (register, login, logout, refresh)
1054
+ 10. models/user.js User model with JSON file storage
1055
+
1056
+ OPTIONAL (only if the project type requires them):
1057
+ - routes/api.js REST API routes for the specific project
1058
+ - public/dashboard.html Protected dashboard page
1059
+ - Additional pages specific to the project type
1060
+
1061
+ DO NOT generate:
1062
+ - Separate CSS files per component (put everything in style.css)
1063
+ - Separate JS files per feature (put everything in app.js)
1064
+ - README.md, .gitignore (not essential for a working site)
1065
+ - Animation/responsive separate files
1066
+
1067
+ Output ONLY the JSON array, no explanation.`;
1074
1068
 
1075
1069
  // Token counter — approximate based on character count (1 token ≈ 4 chars)
1076
1070
  function countTokens(text) {
@@ -1197,20 +1191,36 @@ function _isSeverelyTruncated(content, filename) {
1197
1191
  }
1198
1192
 
1199
1193
  async function runGenerate(config, projectName, description, blocks, authFields, emit, abortSignal) {
1200
- const blocksDesc = Object.entries(blocks)
1201
- .filter(([, enabled]) => enabled)
1202
- .map(([key]) => key)
1203
- .join(', ');
1194
+ // Blocks write to memory.md as TODO features (NOT generated now)
1195
+ const enabledBlocks = Object.entries(blocks).filter(([, enabled]) => enabled).map(([key]) => key);
1204
1196
  const authDesc = blocks.auth
1205
1197
  ? `Auth fields: ${authFields.map((f) => `${f.label}(${f.type}${f.required ? ',required' : ''})`).join(', ')}`
1206
1198
  : '';
1207
1199
 
1200
+ // Save blocks as planned features in memory.md
1201
+ SkillStore.ensureDefaults(projectName, config);
1202
+ if (enabledBlocks.length > 0) {
1203
+ const ctxDir = SkillStore.dir(projectName);
1204
+ const memPath = path.join(ctxDir, 'memory.md');
1205
+ const blockInstructions = `# ${projectName} — Project Memory
1206
+
1207
+ ## Planned Features (ask the AI agent to implement these one by one)
1208
+ ${enabledBlocks.includes('auth') ? `- [ ] **Authentication** (register/login/JWT) — ${authDesc || 'email + password'}\n` : ''}${enabledBlocks.includes('cookieBanner') ? '- [ ] **GDPR Cookie Banner** — consent modal, localStorage tracking\n' : ''}${enabledBlocks.includes('securityMiddleware') ? '- [ ] **Security Middleware** — helmet CSP, rate limiting, CORS\n' : ''}${enabledBlocks.includes('emailVerification') ? '- [ ] **Email Verification** — send verification link, confirm endpoint\n' : ''}
1209
+ ## How to implement
1210
+ Ask the AI in chat: "Add authentication" or "Add cookie banner" — the agent will modify your code.
1211
+
1212
+ ## Architecture Decisions
1213
+ _Add notes here as you build._
1214
+ `;
1215
+ fs.writeFileSync(memPath, blockInstructions, 'utf-8');
1216
+ }
1217
+
1208
1218
  const planPrompt = `Project: ${projectName}
1209
1219
  Description: ${description}
1210
- ${blocksDesc ? `Required blocks: ${blocksDesc}` : ''}
1211
- ${authDesc}
1212
1220
 
1213
- Design a COMPLETE production-ready file structure. Include ALL files needed for a fully working site: server, routes, middleware, models, public HTML/CSS/JS pages, config files, README. Minimum 20 files.`;
1221
+ Design a MINIMAL but COMPLETE file structure for a working website.
1222
+ Focus on the core: a beautiful landing page, server, and main CSS/JS.
1223
+ The user will add features like auth, cookie banner, etc. later via chat.`;
1214
1224
 
1215
1225
  // Emit immediately so the browser connection stays alive and the UI shows activity
1216
1226
  emit({ type: 'processing', msg: 'Planning file structure...' });
@@ -1290,9 +1300,9 @@ Design a COMPLETE production-ready file structure. Include ALL files needed for
1290
1300
  })
1291
1301
  .join('\n\n');
1292
1302
 
1293
- // max_tokens scaled to file size smaller files = less truncation risk
1303
+ // max_tokens generous for fewer, more complete files
1294
1304
  const estimatedTokens = fileSpec.tokens || 1500;
1295
- const maxTokens = Math.min(Math.max(estimatedTokens * 2, 2000), 8192);
1305
+ const maxTokens = Math.min(Math.max(estimatedTokens * 3, 3000), 12000);
1296
1306
 
1297
1307
  const fileSys = `You are a team of 200 senior full-stack developers generating ENTERPRISE-GRADE production code.
1298
1308
 
@@ -1332,8 +1342,6 @@ FRONTEND STANDARDS:
1332
1342
 
1333
1343
  const filePrompt = `Project: ${projectName}
1334
1344
  Description: ${description}
1335
- ${blocksDesc ? `Enabled blocks: ${blocksDesc}` : ''}
1336
- ${authDesc}
1337
1345
  Full project file list: ${allFileNames}
1338
1346
 
1339
1347
  NOW GENERATE: ${fileSpec.name}