nothumanallowed 16.0.46 → 16.0.47

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": "16.0.46",
3
+ "version": "16.0.47",
4
4
  "description": "Local AI assistant: 80 tools (Gmail, Calendar, Drive, GitHub, Slack, browser, code, files), 38 agents, visual workflows (Studio, AWF, WebCraft). Install with `npm i -g nothumanallowed`, run with `nha ui`. Free tier built-in (Liara), no API key required. Your data stays on your PC — OAuth tokens local, no cloud. Open-source MIT.",
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 = '16.0.46';
8
+ export const VERSION = '16.0.47';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -229,28 +229,42 @@ class SandboxManager {
229
229
  }
230
230
  } catch {}
231
231
 
232
- // Pre-flight: auto-extend CSS if coverage is below threshold.
233
- // Detects "incomplete styling" (LLM truncated CSS generation) and calls
234
- // the LLM automatically to extend the CSS file with rules for the missing
235
- // HTML selectors. NO user intervention required.
236
- // Iterates up to 2 times to handle large projects where a single extend
237
- // might not cover all selectors (e.g. 200+ missing selectors).
232
+ // Pre-flight: auto-extend CSS until 100% coverage (or LLM stops making
233
+ // progress). Target = 100%; max 5 passes as safety; early-exit if two
234
+ // consecutive passes don't reduce missing count (LLM stuck) or LLM fails.
235
+ // Goal: ZERO uncovered selectors when the LLM is capable of producing them.
238
236
  try {
239
237
  const projectName = path.basename(projectDir);
240
238
  const cfg = loadConfig();
241
- const maxPasses = 2;
239
+ const maxPasses = 5;
242
240
  let totalCovered = 0;
241
+ let prevMissing = Infinity;
242
+ let stuckPasses = 0;
243
243
  for (let pass = 1; pass <= maxPasses; pass++) {
244
- const styleResult = await _autoExtendStylesIfNeeded(projectName, cfg, emit, { minCoverage: 0.85 });
244
+ const styleResult = await _autoExtendStylesIfNeeded(projectName, cfg, emit, { minCoverage: 1.0 });
245
245
  if (!styleResult.extended) {
246
- if (styleResult.reason === 'coverage acceptable') break;
247
- // LLM failed or skipped — don't loop on a broken provider
246
+ if (styleResult.reason === 'coverage acceptable') break; // already 100%
247
+ // LLM failed or skipped — stop loop
248
248
  break;
249
249
  }
250
250
  const newlyCovered = (styleResult.missingBefore || 0) - (styleResult.missingAfter || 0);
251
251
  totalCovered += newlyCovered;
252
- emit({ type: 'status', msg: `Pass ${pass}/${maxPasses}: ${styleResult.file} extended — ${newlyCovered} new selectors covered (total ${totalCovered}).` });
253
- if ((styleResult.coverageAfter || 0) >= 0.85) break;
252
+ const missingNow = styleResult.missingAfter || 0;
253
+ emit({ type: 'status', msg: `Pass ${pass}/${maxPasses}: ${styleResult.file} extended — ${newlyCovered} new selectors covered (${missingNow} still missing, ${((styleResult.coverageAfter || 0) * 100).toFixed(0)}% coverage).` });
254
+ if (missingNow === 0) {
255
+ emit({ type: 'status', msg: `100% CSS coverage reached after ${pass} pass${pass === 1 ? '' : 'es'}. Total ${totalCovered} selectors covered.` });
256
+ break;
257
+ }
258
+ if (missingNow >= prevMissing) {
259
+ stuckPasses++;
260
+ if (stuckPasses >= 2) {
261
+ emit({ type: 'warn', msg: `LLM stopped making progress on extension (${missingNow} selectors still missing — likely pseudo-classes or JS-state classes the model can't infer). Stopping at ${((styleResult.coverageAfter || 0) * 100).toFixed(0)}%.` });
262
+ break;
263
+ }
264
+ } else {
265
+ stuckPasses = 0;
266
+ }
267
+ prevMissing = missingNow;
254
268
  }
255
269
  } catch (e) {
256
270
  emit({ type: 'warn', msg: `Auto-extend styles failed: ${(e.message || e).slice(0, 200)}` });