nothumanallowed 13.5.88 → 13.5.89
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 +1 -1
- package/src/services/web-ui.mjs +19 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.5.
|
|
3
|
+
"version": "13.5.89",
|
|
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/services/web-ui.mjs
CHANGED
|
@@ -6556,6 +6556,8 @@ var _wcSyntaxResults = []; // [{file, ok, error}]
|
|
|
6556
6556
|
var _wcSnapshots = []; // [{ts, fileCount}]
|
|
6557
6557
|
var _wcLastFilePlan = []; // saved for manual repair trigger
|
|
6558
6558
|
var _wcLastSysPreamble = '';
|
|
6559
|
+
var _wcTokIn = 0; // global token counters (accumulate across generation + repair)
|
|
6560
|
+
var _wcTokOut = 0;
|
|
6559
6561
|
// Skills state
|
|
6560
6562
|
var wcSkills = []; // [{name, content, type}] type: 'skill'|'memory'|'provider'
|
|
6561
6563
|
var wcSkillModal = null; // null | {mode:'edit'|'new', idx:number|null, name, content, type, generating}
|
|
@@ -7936,7 +7938,7 @@ async function wcGenerate() {
|
|
|
7936
7938
|
_wcLastSysPreamble = sysPreamble;
|
|
7937
7939
|
|
|
7938
7940
|
var _wcGenStartTime = Date.now();
|
|
7939
|
-
|
|
7941
|
+
_wcTokIn = 0; _wcTokOut = 0; // reset global counters for this generation run
|
|
7940
7942
|
var _wcTimerInterval = null;
|
|
7941
7943
|
|
|
7942
7944
|
function wcGenElapsed() {
|
|
@@ -8042,12 +8044,10 @@ async function wcGenerate() {
|
|
|
8042
8044
|
}
|
|
8043
8045
|
|
|
8044
8046
|
if (_wcTimerInterval) { clearInterval(_wcTimerInterval); _wcTimerInterval = null; }
|
|
8045
|
-
var _wcGenTotalTime = Math.floor((Date.now() - _wcGenStartTime) / 1000);
|
|
8046
8047
|
|
|
8047
8048
|
wcState.running = false;
|
|
8048
8049
|
_wcGenAbortCtrl = null;
|
|
8049
8050
|
_wcOverlayMinimized = false;
|
|
8050
|
-
wcState.lastGenStats = { tokIn: _wcTokIn, tokOut: _wcTokOut, seconds: _wcGenTotalTime, files: wcState.generatedFiles.length };
|
|
8051
8051
|
|
|
8052
8052
|
// Auto-save
|
|
8053
8053
|
try {
|
|
@@ -8057,10 +8057,21 @@ async function wcGenerate() {
|
|
|
8057
8057
|
});
|
|
8058
8058
|
} catch(_) {}
|
|
8059
8059
|
|
|
8060
|
+
// Post-generation syntax scan — mark truncated/broken files before repair
|
|
8061
|
+
wcState.generatedFiles.forEach(function(f) {
|
|
8062
|
+
if (f._error || f._pending || !f.content) return;
|
|
8063
|
+
var chk = wcSyntaxCheck(f.content, f.lang || '');
|
|
8064
|
+
if (!chk.ok) f._syntaxError = chk.reason;
|
|
8065
|
+
});
|
|
8066
|
+
|
|
8060
8067
|
renderWebCraft(document.getElementById('content'));
|
|
8061
8068
|
|
|
8062
8069
|
// Auto-repair: run immediately after generation completes
|
|
8063
8070
|
await wcAutoRepair(filePlan, sysPreamble);
|
|
8071
|
+
|
|
8072
|
+
// Update stats AFTER repair so token counts include repair calls
|
|
8073
|
+
wcState.lastGenStats = { tokIn: _wcTokIn, tokOut: _wcTokOut, seconds: Math.floor((Date.now() - _wcGenStartTime) / 1000), files: wcState.generatedFiles.length };
|
|
8074
|
+
renderWebCraft(document.getElementById('content'));
|
|
8064
8075
|
}
|
|
8065
8076
|
|
|
8066
8077
|
// ── Auto-repair pass — fixes _error and _syntaxError files ────────────────
|
|
@@ -8233,12 +8244,12 @@ async function wcCallLLMRaw(sys, user, signal) {
|
|
|
8233
8244
|
var d = await r.json();
|
|
8234
8245
|
// Accumulate token counts if the server returns usage data
|
|
8235
8246
|
if (d && d.usage) {
|
|
8236
|
-
|
|
8237
|
-
|
|
8247
|
+
_wcTokIn += (d.usage.prompt_tokens || d.usage.input_tokens || 0);
|
|
8248
|
+
_wcTokOut += (d.usage.completion_tokens || d.usage.output_tokens || 0);
|
|
8238
8249
|
} else if (d && d.text) {
|
|
8239
8250
|
// Estimate from char count (4 chars ≈ 1 token)
|
|
8240
|
-
|
|
8241
|
-
|
|
8251
|
+
_wcTokIn += Math.round((sys.length + user.length) / 4);
|
|
8252
|
+
_wcTokOut += Math.round((d.text || '').length / 4);
|
|
8242
8253
|
}
|
|
8243
8254
|
return (d && (d.text || d.content || d.result)) || '';
|
|
8244
8255
|
}
|
|
@@ -8407,6 +8418,7 @@ async function wcStartSandbox() {
|
|
|
8407
8418
|
wcState.sandbox = { running: true, port: null, dir: null, logs: [], error: null };
|
|
8408
8419
|
wcState.rightTab = 'preview';
|
|
8409
8420
|
wcRightTab = 'preview';
|
|
8421
|
+
_wcSkillsLoaded = false; // force skill panel reload after sandbox completes
|
|
8410
8422
|
renderWebCraft(document.getElementById('content'));
|
|
8411
8423
|
|
|
8412
8424
|
try {
|