nothumanallowed 13.5.38 → 13.5.40

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.38",
3
+ "version": "13.5.40",
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": {
@@ -3845,6 +3845,26 @@ ${completedHeadings ? `## SECTIONS ALREADY WRITTEN (headings only):\n${completed
3845
3845
  return;
3846
3846
  }
3847
3847
 
3848
+ // ── Studio: WebCraft — single non-streaming LLM call ────────────────
3849
+ // Used by the WebCraft tab to generate each file without SSE complexity.
3850
+ // POST /api/studio/webcraft { system, user, max_tokens } → { text }
3851
+ if (pathname === '/api/studio/webcraft' && method === 'POST') {
3852
+ const body = await parseBody(req, 131072); // 128KB max
3853
+ if (!body.system || !body.user) {
3854
+ sendJSON(res, 400, { error: 'system and user required' });
3855
+ logRequest(method, pathname, 400, Date.now() - start);
3856
+ return;
3857
+ }
3858
+ try {
3859
+ const result = await callLLM(config, body.system, body.user, { max_tokens: body.max_tokens || 4096 });
3860
+ sendJSON(res, 200, { text: result });
3861
+ } catch (e) {
3862
+ sendJSON(res, 500, { error: e.message });
3863
+ }
3864
+ logRequest(method, pathname, 200, Date.now() - start);
3865
+ return;
3866
+ }
3867
+
3848
3868
  // ── Studio: Parliament deliberation (SSE streaming) ──────────────────
3849
3869
  // Implements the Legion DeliberationEngine protocol adapted for Studio:
3850
3870
  // Round 1 outputs already exist (from normal workflow steps).
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.38';
8
+ export const VERSION = '13.5.40';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -248,7 +248,10 @@ function switchView(v) {
248
248
  if(spt)spt.textContent=t('nav_'+v)||v;
249
249
  // Toggle content--chat class for proper chat layout (no overflow, flex column)
250
250
  var ct=document.getElementById('content');
251
- if(ct){if(v==='chat'){ct.classList.add('content--chat')}else{ct.classList.remove('content--chat')}}
251
+ if(ct){
252
+ if(v==='chat'){ct.classList.add('content--chat')}else{ct.classList.remove('content--chat')}
253
+ if(v==='webcraft'){ct.classList.add('content--webcraft')}else{ct.classList.remove('content--webcraft')}
254
+ }
252
255
  closeSidebar();
253
256
  // Auto-close floating panels when leaving chat/studio
254
257
  if(v!=='chat'&&v!=='studio'){closeBrowserViewer();closeCanvas();}
@@ -3144,6 +3147,7 @@ var I18N = {
3144
3147
  wc_generate:'Generate Project', wc_generating:'Generating',
3145
3148
  wc_download:'Download Archive', wc_describe_first:'Please describe your project first.',
3146
3149
  wc_no_files:'Describe your project and click Generate',
3150
+ wc_examples_label:'Examples',
3147
3151
  },
3148
3152
  it: {
3149
3153
  chat:'Chat', studio:'Studio', settings:'Impostazioni', agents:'Agenti',
@@ -3179,6 +3183,7 @@ var I18N = {
3179
3183
  wc_generate:'Genera progetto', wc_generating:'Generazione in corso',
3180
3184
  wc_download:'Scarica archivio', wc_describe_first:'Descrivi prima il tuo progetto.',
3181
3185
  wc_no_files:'Descrivi il progetto e clicca Genera',
3186
+ wc_examples_label:'Esempi',
3182
3187
  },
3183
3188
  es: {
3184
3189
  chat:'Chat', studio:'Studio', settings:'Configuración', agents:'Agentes',
@@ -3213,6 +3218,7 @@ var I18N = {
3213
3218
  wc_generate:'Generar proyecto', wc_generating:'Generando',
3214
3219
  wc_download:'Descargar archivo', wc_describe_first:'Por favor describe tu proyecto primero.',
3215
3220
  wc_no_files:'Describe el proyecto y haz clic en Generar',
3221
+ wc_examples_label:'Ejemplos',
3216
3222
  },
3217
3223
  fr: {
3218
3224
  chat:'Chat', studio:'Studio', settings:'Paramètres', agents:'Agents',
@@ -3247,6 +3253,7 @@ var I18N = {
3247
3253
  wc_generate:'G\u00e9n\u00e9rer le projet', wc_generating:'G\u00e9n\u00e9ration en cours',
3248
3254
  wc_download:'T\u00e9l\u00e9charger archive', wc_describe_first:'Veuillez d\u00e9crire votre projet.',
3249
3255
  wc_no_files:'D\u00e9crivez le projet et cliquez sur G\u00e9n\u00e9rer',
3256
+ wc_examples_label:'Exemples',
3250
3257
  },
3251
3258
  de: {
3252
3259
  chat:'Chat', studio:'Studio', settings:'Einstellungen', agents:'Agenten',
@@ -3281,6 +3288,7 @@ var I18N = {
3281
3288
  wc_generate:'Projekt generieren', wc_generating:'Generierung',
3282
3289
  wc_download:'Archiv herunterladen', wc_describe_first:'Bitte beschreibe zuerst dein Projekt.',
3283
3290
  wc_no_files:'Beschreibe das Projekt und klicke auf Generieren',
3291
+ wc_examples_label:'Beispiele',
3284
3292
  },
3285
3293
  };
3286
3294
  // Fallback to 'en' for unmapped languages
@@ -3385,7 +3393,7 @@ var studioAbortController = null;
3385
3393
  var parlActiveAgent = null; // active agent label during parliament streaming
3386
3394
  var parlDoneAgents = {}; // set of completed agent labels during parliament
3387
3395
  var _parlPersistHtml = null; // persists parliament block HTML across tab navigations
3388
- var _PARL_STAMP = '<!--nha-parl-v13.5.38-->';
3396
+ var _PARL_STAMP = '<!--nha-parl-v13.5.39-->';
3389
3397
 
3390
3398
  function stopStudio() {
3391
3399
  if (!studioState.running) return;
@@ -6239,17 +6247,34 @@ function renderWebCraft(el) {
6239
6247
  '</div>';
6240
6248
  }).join('');
6241
6249
 
6250
+ // Example prompts — clicking fills project name + description
6251
+ var wcExamples = [
6252
+ {name:'MySaaS', desc:'SaaS landing page with hero section, pricing table (free/pro/enterprise), feature comparison grid, user registration (name, email, password), login, protected dashboard with sidebar navigation (overview, settings, billing), account settings page, and email verification flow.'},
6253
+ {name:'MyShop', desc:'E-commerce site with homepage showcasing featured products, product catalog with filters (category, price range), product detail page with image gallery, shopping cart with quantity controls, checkout form with address and payment fields, user registration and login, order history page, and admin panel for product management.'},
6254
+ {name:'MyBlog', desc:'Blog and CMS with homepage listing recent articles (title, excerpt, cover image, author, date), article detail page with markdown rendering, category and tag filtering, author profile page, admin panel for writing and publishing posts (rich text editor), user comments with moderation, and RSS feed endpoint.'},
6255
+ {name:'MyPortfolio', desc:'Professional portfolio with animated hero section (name, role, call-to-action), projects showcase grid with lightbox modal, skills section with progress bars, about page with timeline, contact form with SMTP email sending, dark/light mode toggle, and smooth scroll navigation.'},
6256
+ {name:'MyRestaurant', desc:'Restaurant website with hero with background video, menu page organized by category (starters, mains, desserts, drinks) with photos and prices, online booking form (date, time, party size, special requests) with email confirmation, about us page, gallery section, and contact page with embedded map.'},
6257
+ {name:'MyJobBoard', desc:'Job board platform with homepage listing recent job postings (title, company, location, type), job detail page, company profile pages, candidate registration and login, job application form with resume upload, employer dashboard to post and manage listings, saved jobs for candidates, and job search with filters (location, type, salary range).'}
6258
+ ];
6259
+ var wcExHtml = '<div style="margin-bottom:12px;flex-shrink:0"><div style="font-size:9px;color:var(--dim);text-transform:uppercase;letter-spacing:.8px;margin-bottom:6px">'+t('wc_examples_label')+'</div><div style="display:flex;gap:6px;flex-wrap:wrap">' +
6260
+ wcExamples.map(function(ex,i){
6261
+ return '<button onclick="wcPickExample('+i+')" style="padding:4px 10px;border-radius:14px;border:1px solid var(--border2);background:var(--bg3);color:var(--dim);font-size:11px;cursor:pointer;white-space:nowrap">'+wcEsc(ex.name)+'</button>';
6262
+ }).join('') +
6263
+ '</div></div>';
6264
+
6242
6265
  el.innerHTML =
6243
- '<div style="max-width:1100px;margin:0 auto;padding:0 8px">' +
6244
- '<div style="margin-bottom:18px">' +
6266
+ '<div style="display:flex;flex-direction:column;height:100%;min-height:0;padding:0 4px">' +
6267
+ '<div style="margin-bottom:10px;flex-shrink:0">' +
6245
6268
  '<h2 style="font-size:15px;color:var(--green);margin-bottom:4px">&#128736; '+t('wc_title')+'</h2>' +
6246
6269
  '<p style="font-size:11px;color:var(--dim);line-height:1.5">'+t('wc_subtitle')+'</p>' +
6247
6270
  '</div>' +
6248
6271
 
6249
- '<div style="display:flex;gap:16px;align-items:flex-start;flex-wrap:wrap">' +
6272
+ wcExHtml +
6273
+
6274
+ '<div style="display:flex;gap:14px;align-items:flex-start;flex:1;min-height:0">' +
6250
6275
 
6251
6276
  // LEFT: config panel
6252
- '<div style="width:300px;flex-shrink:0;display:flex;flex-direction:column;gap:12px">' +
6277
+ '<div style="width:280px;flex-shrink:0;display:flex;flex-direction:column;gap:10px;overflow-y:auto;max-height:calc(100vh - 120px)">' +
6253
6278
 
6254
6279
  // Project name + description
6255
6280
  '<div style="background:var(--bg2);border:1px solid var(--border);border-radius:10px;padding:14px">' +
@@ -6292,7 +6317,7 @@ function renderWebCraft(el) {
6292
6317
  '</div>' +
6293
6318
 
6294
6319
  // RIGHT: file viewer
6295
- '<div style="flex:1;min-width:0;background:var(--bg2);border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column;min-height:520px;overflow:hidden">' +
6320
+ '<div style="flex:1;min-width:0;background:var(--bg2);border:1px solid var(--border);border-radius:10px;display:flex;flex-direction:column;height:calc(100vh - 120px);overflow:hidden">' +
6296
6321
  fileTabsHtml +
6297
6322
  codeHtml +
6298
6323
  '</div>' +
@@ -6301,6 +6326,21 @@ function renderWebCraft(el) {
6301
6326
  '</div>';
6302
6327
  }
6303
6328
 
6329
+ function wcPickExample(i) {
6330
+ var wcExamplesData = [
6331
+ {name:'MySaaS', desc:'SaaS landing page with hero section, pricing table (free/pro/enterprise), feature comparison grid, user registration (name, email, password), login, protected dashboard with sidebar navigation (overview, settings, billing), account settings page, and email verification flow.'},
6332
+ {name:'MyShop', desc:'E-commerce site with homepage showcasing featured products, product catalog with filters (category, price range), product detail page with image gallery, shopping cart with quantity controls, checkout form with address and payment fields, user registration and login, order history page, and admin panel for product management.'},
6333
+ {name:'MyBlog', desc:'Blog and CMS with homepage listing recent articles (title, excerpt, cover image, author, date), article detail page with markdown rendering, category and tag filtering, author profile page, admin panel for writing and publishing posts (rich text editor), user comments with moderation, and RSS feed endpoint.'},
6334
+ {name:'MyPortfolio', desc:'Professional portfolio with animated hero section (name, role, call-to-action), projects showcase grid with lightbox modal, skills section with progress bars, about page with timeline, contact form with SMTP email sending, dark/light mode toggle, and smooth scroll navigation.'},
6335
+ {name:'MyRestaurant', desc:'Restaurant website with hero with background video, menu page organized by category (starters, mains, desserts, drinks) with photos and prices, online booking form (date, time, party size, special requests) with email confirmation, about us page, gallery section, and contact page with embedded map.'},
6336
+ {name:'MyJobBoard', desc:'Job board platform with homepage listing recent job postings (title, company, location, type), job detail page, company profile pages, candidate registration and login, job application form with resume upload, employer dashboard to post and manage listings, saved jobs for candidates, and job search with filters (location, type, salary range).'}
6337
+ ];
6338
+ var ex = wcExamplesData[i];
6339
+ if (!ex) return;
6340
+ wcState.projectName = ex.name;
6341
+ wcState.description = ex.desc;
6342
+ renderWebCraft(document.getElementById('content'));
6343
+ }
6304
6344
  function wcUpdateField(i, val) { wcState.authFields[i].label = val; }
6305
6345
  function wcUpdateFieldType(i, t) { wcState.authFields[i].type = t; }
6306
6346
  function wcToggleRequired(i, v) { wcState.authFields[i].required = v; }
@@ -6405,10 +6445,10 @@ async function wcGenerate() {
6405
6445
  }
6406
6446
 
6407
6447
  async function wcCallLLM(sys, user) {
6408
- var r = await fetch(API + '/studio/step', {
6448
+ var r = await fetch(API + '/studio/webcraft', {
6409
6449
  method: 'POST',
6410
6450
  headers: {'Content-Type':'application/json'},
6411
- body: JSON.stringify({system: sys, user: user, max_tokens: 4096, stream: false})
6451
+ body: JSON.stringify({system: sys, user: user, max_tokens: 4096})
6412
6452
  });
6413
6453
  if (!r.ok) throw new Error('LLM error ' + r.status);
6414
6454
  var d = await r.json();
@@ -6498,6 +6538,7 @@ input:focus,textarea:focus{border-color:var(--green3)}
6498
6538
  .nav-item__badge{background:var(--red);color:var(--bright);font-size:9px;padding:1px 5px;border-radius:8px;margin-left:auto}
6499
6539
 
6500
6540
  .content{flex:1;overflow-y:auto;padding:16px;-webkit-overflow-scrolling:touch}
6541
+ .content--webcraft{overflow:hidden;display:flex;flex-direction:column}
6501
6542
 
6502
6543
  /* Mobile burger button */
6503
6544
  #mobileBurger{display:block}