nothumanallowed 14.1.27 → 14.1.28
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.1.
|
|
3
|
+
"version": "14.1.28",
|
|
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.1.
|
|
8
|
+
export const VERSION = '14.1.28';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
package/src/services/llm.mjs
CHANGED
|
@@ -5,6 +5,63 @@
|
|
|
5
5
|
* Supports: Anthropic, OpenAI, Gemini, DeepSeek, Grok, Mistral, Cohere.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
// ── Qwen3 BPE artifact repair ─────────────────────────────────────────────
|
|
9
|
+
//
|
|
10
|
+
// Qwen3-32B running on vLLM produces text where Italian/English function words
|
|
11
|
+
// (articles, prepositions, conjunctions) are fused to adjacent content words
|
|
12
|
+
// due to BPE tokenizer subword merging. Examples:
|
|
13
|
+
// "lacorrelazione" → "la correlazione"
|
|
14
|
+
// "ilprezzodell'oro" → "il prezzo dell'oro"
|
|
15
|
+
// "deidati" → "dei dati"
|
|
16
|
+
// "nonesiste" → "non esiste"
|
|
17
|
+
//
|
|
18
|
+
// Strategy: insert a space before any known function word that immediately
|
|
19
|
+
// follows a lowercase letter (i.e. is fused mid-word). We run multiple
|
|
20
|
+
// passes because chains like "dellacorrelazione" need two separations.
|
|
21
|
+
// Table rows (lines starting with |) are intentionally skipped to avoid
|
|
22
|
+
// corrupting cell separators.
|
|
23
|
+
|
|
24
|
+
const IT_FUNCTION_WORDS = [
|
|
25
|
+
// Definite articles
|
|
26
|
+
'il','lo','la','i','gli','le',
|
|
27
|
+
// Indefinite articles
|
|
28
|
+
'un','uno','una',
|
|
29
|
+
// Prepositions + contractions
|
|
30
|
+
'di','del','dello','della','dei','degli','delle',
|
|
31
|
+
'a','al','allo','alla','ai','agli','alle',
|
|
32
|
+
'da','dal','dallo','dalla','dai','dagli','dalle',
|
|
33
|
+
'in','nel','nello','nella','nei','negli','nelle',
|
|
34
|
+
'su','sul','sullo','sulla','sui','sugli','sulle',
|
|
35
|
+
'con','col','per','tra','fra',
|
|
36
|
+
// Common conjunctions / adverbs that fuse
|
|
37
|
+
'che','non','ma','se','anche','come','dove','quando',
|
|
38
|
+
'perché','mentre','quindi','però','sia','né',
|
|
39
|
+
'questo','questa','questi','queste','quello','quella',
|
|
40
|
+
'e','o','è',
|
|
41
|
+
];
|
|
42
|
+
|
|
43
|
+
// Build a single regex that matches any of these words preceded by a lowercase letter
|
|
44
|
+
const BPE_SPLIT_RE = new RegExp(
|
|
45
|
+
'([a-zàèéìòù])(' + IT_FUNCTION_WORDS.map((w) => w.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')).join('|') + ')(?=[A-Za-zàèéìòù])',
|
|
46
|
+
'g',
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
function fixQwen3BPE(text) {
|
|
50
|
+
// Process line by line — skip table rows and code blocks
|
|
51
|
+
let inCode = false;
|
|
52
|
+
return text.split('\n').map((line) => {
|
|
53
|
+
if (line.trimStart().startsWith('```')) { inCode = !inCode; return line; }
|
|
54
|
+
if (inCode) return line;
|
|
55
|
+
if (line.trimStart().startsWith('|')) return line; // table row — untouched
|
|
56
|
+
// Three passes to handle chains
|
|
57
|
+
let out = line;
|
|
58
|
+
out = out.replace(BPE_SPLIT_RE, '$1 $2');
|
|
59
|
+
out = out.replace(BPE_SPLIT_RE, '$1 $2');
|
|
60
|
+
out = out.replace(BPE_SPLIT_RE, '$1 $2');
|
|
61
|
+
return out;
|
|
62
|
+
}).join('\n');
|
|
63
|
+
}
|
|
64
|
+
|
|
8
65
|
// ── Providers ──────────────────────────────────────────────────────────────
|
|
9
66
|
|
|
10
67
|
export async function callAnthropic(apiKey, model, systemPrompt, userMessage, stream = false, opts = {}) {
|
|
@@ -574,6 +631,13 @@ export async function callLLMStream(config, systemPrompt, userMessage, onToken,
|
|
|
574
631
|
let fullNhaText = nhaJson.choices?.[0]?.message?.content || '';
|
|
575
632
|
// Strip <think>...</think> blocks
|
|
576
633
|
fullNhaText = fullNhaText.replace(/<think>[\s\S]*?<\/think>/g, '').trim();
|
|
634
|
+
// Fix Qwen3 BPE tokenizer artifacts: words joined without spaces.
|
|
635
|
+
// Qwen3 streaming via vLLM occasionally produces subword tokens that arrive
|
|
636
|
+
// concatenated — e.g. "lacorrelazione" instead of "la correlazione",
|
|
637
|
+
// "ilprezzodell'oro" instead of "il prezzo dell'oro".
|
|
638
|
+
// We fix this by inserting spaces before Italian/English articles and
|
|
639
|
+
// prepositions that appear fused at word boundaries.
|
|
640
|
+
fullNhaText = fixQwen3BPE(fullNhaText);
|
|
577
641
|
if (onToken) onToken(fullNhaText);
|
|
578
642
|
return fullNhaText;
|
|
579
643
|
}
|
|
@@ -232,7 +232,7 @@ Provide specific, actionable levels. Use technical analysis (EMA, RSI, MACD, Fib
|
|
|
232
232
|
- Implementation costs: slippage, market impact, transaction costs
|
|
233
233
|
- Key risks: overfitting, regime change, crowding`,agents:[{icon:`📊`,agent:`oracle`,label:`Oracle`,status:`waiting`,output:``},{icon:`💹`,agent:`mercury`,label:`Mercury`,status:`waiting`,output:``},{icon:`📈`,agent:`edi`,label:`Edi`,status:`waiting`,output:``},{icon:`⚠️`,agent:`cassandra`,label:`Cassandra`,status:`waiting`,output:``},{icon:`🔥`,agent:`prometheus`,label:`Prometheus`,status:`waiting`,output:``}]}],Te=`trading strategy.fundamental analysis.portfolio risk.sector deep dive.crypto analysis.quant factor.macro regime.cross-asset.hedge.derivative.yield curve.market_price.market_chart.market_indicators.macro_data.crypto_data.valuation.equity.earnings.dividend.short interest.volatility.options.futures.bitcoin.ethereum`.split(`.`),Ee=[`Analyze my unread emails and create a priority action plan`,`Search the web for AI news today and summarize it in a canvas report`,`Check my calendar for this week and suggest how to optimize my schedule`,`Review my GitHub notifications and draft responses to open issues`,`Search for information about a topic, fact-check it, and write a report`],R={bg:`#0a0d14`,wall:`#0d1117`,wallStripe:`#0f1520`,baseboard:`#1e293b`,floorA:`#111827`,floorB:`#141c2b`,floorLine:`#1e293b`,ceiling:`#0b0f18`,lampBody:`#854d0e`,lampGlow:`#fef08a`,partition:`#1a2436`,partitionH:`#253347`,partitionT:`#2d4a6e`,deskTop:`#2d4263`,deskFace:`#1e3352`,deskSide:`#192b43`,deskLeg:`#0f1e30`,monBody:`#0f172a`,monFace:`#162032`,monScrIdle:`#060b12`,monScrOn:`#001208`,monScrDone:`#001a08`,monStand:`#0d1625`,keyboard:`#162032`,chairBack:`#1a3a5c`,chairSeat:`#1e4068`,chairLeg:`#0f1e30`,plant1:`#14532d`,plant2:`#166534`,pot:`#78350f`,cup:`#7c2d12`,paper:`#e2e8f0`,paperLine:`#94a3b8`,skin:[`#f5c97a`,`#fbbf24`,`#fca5a5`,`#86efac`,`#a5f3fc`,`#c4b5fd`,`#fde68a`,`#f9a8d4`],shirt:[`#1e40af`,`#065f46`,`#312e81`,`#be123c`,`#164e63`,`#7c3aed`,`#7f1d1d`,`#0e7490`],hair:[`#7c3aed`,`#92400e`,`#1e293b`,`#6b21a8`,`#78350f`,`#292524`,`#422006`,`#0c4a6e`],pants:`#1e293b`,shoes:`#0f172a`,cSkin:`#fbbf24`,cShirt:`#4f46e5`,cHair:`#111827`,cTie:`#dc2626`,cPants:`#1e293b`,cShoes:`#0f172a`,cBag:`#78350f`,green:`#22c55e`,greenDim:`#14532d`,cyan:`#67e8f9`,purple:`#a78bfa`,red:`#ef4444`,amber:`#fbbf24`,dim:`#334155`,white:`#f1f5f9`,bubbleBg:`#0f172a`,bubbleBdr:`#334155`},z=2,De=1200,Oe=140,ke=De*z,Ae=Oe*z,je=Math.round(Oe*.78),Me=130,Ne=14,Pe=je-Ne-2,Fe=8,Ie=36;function B(e,t,n,r,i=1,a=1){e.fillStyle=t,e.fillRect(n*z,r*z,i*z,a*z)}function Le(e){B(e,R.ceiling,0,0,De,7);for(let t=0;t<De;t++)B(e,t%20<10?R.wall:R.wallStripe,t,7,1,je-7);B(e,R.baseboard,0,je-3,De,3);for(let t=0;t<De;t+=14)for(let n=je;n<Oe;n+=7)B(e,(Math.floor(t/14)+Math.floor((n-je)/7))%2==0?R.floorA:R.floorB,t,n,14,7),B(e,R.floorLine,t,n,14,1),B(e,R.floorLine,t,n,1,7);for(let t=40;t<De;t+=120){B(e,R.lampBody,t,1,40,4),B(e,R.lampGlow,t+2,2,36,2);for(let n=0;n<18;n++)e.fillStyle=`rgba(254,240,138,${(.06-n*.003).toFixed(4)})`,e.fillRect((t+20-n*1.1)*z,(5+n)*z,n*2.2*z,z)}}function Re(e,t,n,r){let i=t.x,a=t.status===`running`,o=t.status===`done`,s=t.status===`error`,c=Math.abs(n-(i+Me/2))<30;a&&(e.fillStyle=`rgba(99,102,241,0.09)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z)),o&&(e.fillStyle=`rgba(34,197,94,0.05)`,e.fillRect(i*z,10*z,Me*z,(Oe-10)*z));let l=je-8;B(e,R.partition,i,8,3,l),B(e,R.partitionH,i+1,8,2,l),B(e,R.partition,i+Me,8,3,l),B(e,a?R.partitionT:o?`#1a3a2e`:s?`#3a1a1a`:R.partitionH,i,8,Me+3,4),B(e,`#0f172a`,i+5,14,16,10),B(e,`#162032`,i+6,15,14,3),a?(B(e,R.green,i+7,19,11,1),B(e,R.greenDim,i+7,21,12,1)):o?(B(e,R.green,i+7,18,12,1),B(e,R.green,i+7,20,9,1),B(e,R.green,i+7,22,11,1)):(B(e,R.dim,i+7,19,10,1),B(e,R.dim,i+7,21,7,1));let u=i+Me-14;B(e,R.pot,u+2,Pe+Ne-5,7,5),B(e,R.plant1,u,Pe+Ne-13,10,8),B(e,R.plant2,u+2,Pe+Ne-17,6,5),B(e,R.plant2,u-2,Pe+Ne-12,5,4),B(e,R.plant2,u+7,Pe+Ne-13,5,4),B(e,R.deskTop,i+4,Pe,Me-6,3),B(e,R.deskFace,i+4,Pe+3,Me-6,Ne-3),B(e,R.deskSide,i+4,Pe+Ne,Me-6,3);let d=je-Pe-Ne-3;B(e,R.deskLeg,i+8,Pe+Ne+3,4,d),B(e,R.deskLeg,i+Me-10,Pe+Ne+3,4,d);let f=i+14,p=Pe-18;if(B(e,R.monBody,f,p,22,14),B(e,R.monFace,f+1,p+1,20,12),B(e,a?R.monScrOn:o?R.monScrDone:R.monScrIdle,f+2,p+2,18,8),a)for(let t=0;t<3;t++){let n=3+Math.floor((r/90+t*5)%12);B(e,R.green,f+3,p+3+t*2,n,1),B(e,R.greenDim,f+3+n,p+3+t*2,12-n,1)}else o?(B(e,R.green,f+3,p+3,10,1),B(e,R.green,f+3,p+5,8,1),B(e,R.green,f+3,p+7,9,1),B(e,R.green,f+13,p+3,2,4)):s?(B(e,R.red,f+8,p+2,4,6),B(e,R.red,f+8,p+9,4,2)):(B(e,R.dim,f+3,p+3,12,1),B(e,R.dim,f+3,p+5,8,1),B(e,R.dim,f+3,p+7,10,1));B(e,R.monStand,f+8,p+14,4,3),B(e,R.monStand,f+5,p+17,10,1),B(e,R.keyboard,f-1,Pe+1,16,4);for(let t=0;t<5;t++)B(e,R.monFace,f+t*3,Pe+2,2,2);B(e,R.cup,i+7,Pe+2,5,5),B(e,`#92400e`,i+12,Pe+4,2,3),B(e,R.paper,i+52,Pe+2,12,7),B(e,R.paper,i+54,Pe+1,12,7),B(e,R.paperLine,i+56,Pe+3,7,1),B(e,R.paperLine,i+56,Pe+5,5,1),B(e,R.chairBack,i+Me/2-12,je-20,24,3),B(e,R.chairSeat,i+Me/2-13,je-14,26,8),B(e,R.chairLeg,i+Me/2-8,je-6,4,6),B(e,R.chairLeg,i+Me/2+5,je-6,4,6),ze(e,t,i+Me/2-8,je-Ie,a,c,r);let m=a?R.cyan:o?R.green:s?R.red:R.dim;e.font=`bold ${4*z}px monospace`,e.fillStyle=m,e.textBaseline=`alphabetic`;let h=t.label.length>14?t.label.slice(0,13)+`…`:t.label;e.fillText(h,(i+4)*z,8*z),B(e,m,i+Me-4,9,4,4),a&&Math.floor(r/250)%2==0&&B(e,R.white,i+Me-3,10,2,2)}function ze(e,t,n,r,i,a,o){let s=R.skin[t.skinIdx],c=R.shirt[t.shirtIdx],l=R.hair[t.hairIdx],u=i&&!a?Math.floor(o/700)%2:0;B(e,l,n+1,r+u,12,3),B(e,l,n,r+1+u,14,2),B(e,l,n,r+3+u,2,5),B(e,l,n+12,r+3+u,2,5),B(e,s,n+1,r+3+u,12,9);let d=l;B(e,d,n+2,r+4+u,3,1),B(e,d,n+9,r+4+u,3,1),B(e,`#e2e8f0`,n+2,r+5+u,3,3),B(e,`#e2e8f0`,n+9,r+5+u,3,3);let f=t.skinIdx%2==0?`#1d4ed8`:`#065f46`;if(B(e,f,n+3,r+6+u,2,2),B(e,f,n+10,r+6+u,2,2),B(e,`#0f172a`,n+3,r+7+u,1,1),B(e,`#0f172a`,n+10,r+7+u,1,1),B(e,`#c97a4a`,n+7,r+9+u,1,2),t.status===`done`)B(e,`#991b1b`,n+4,r+11+u,6,1),B(e,`#991b1b`,n+3,r+10+u,1,1),B(e,`#991b1b`,n+10,r+10+u,1,1);else if(t.status===`error`)B(e,`#991b1b`,n+4,r+10+u,6,1),B(e,`#991b1b`,n+3,r+11+u,1,1),B(e,`#991b1b`,n+10,r+11+u,1,1);else if(t.status===`running`){let t=Math.floor(o/250)%2;B(e,`#991b1b`,n+5,r+10+u,4,t?2:1)}else B(e,`#7f1d1d`,n+5,r+11+u,4,1);if(B(e,s,n+4,r+12,6,2),B(e,c,n+1,r+14,14,11),B(e,`#f1f5f9`,n+4,r+14,3,4),B(e,`#f1f5f9`,n+9,r+14,3,4),e.font=`${4*z}px serif`,e.textBaseline=`middle`,e.textAlign=`center`,e.fillText(t.icon,(n+8)*z,(r+19)*z),e.textAlign=`left`,i&&!a){let t=Math.floor(o/120)%2;B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+22-t,3,3),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+22-(1-t),3,3)}else if(a&&i){let t=Math.floor(o/180)%3;B(e,c,n-2,r+14,3,8),B(e,s,n-2,r+22,3,3),B(e,c,n+15,r+8+t,3,9),B(e,s,n+15,r+5+t,3,4)}else B(e,c,n-2,r+14,3,9),B(e,s,n-2,r+23,3,2),B(e,c,n+15,r+14,3,9),B(e,s,n+15,r+23,3,2);B(e,R.pants,n+2,r+25,5,7),B(e,R.pants,n+9,r+25,5,7),B(e,`#2d3f5f`,n+3,r+29,3,1),B(e,`#2d3f5f`,n+10,r+29,3,1),B(e,R.shoes,n,r+32,7,4),B(e,R.shoes,n+9,r+32,7,4),B(e,`#1e2a3a`,n+1,r+32,5,1),B(e,`#1e2a3a`,n+10,r+32,5,1),e.fillStyle=`rgba(0,0,0,0.35)`,e.beginPath(),e.ellipse((n+8)*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill()}function Be(e){e.papers.length>=6||e.papers.push({x:e.x+20+Math.random()*(Me-40),y:Pe-4,vx:(Math.random()-.5)*1.5,vy:-1.5-Math.random()*1,rot:Math.random()*360,vrot:(Math.random()-.5)*10,life:0,maxLife:70+Math.random()*40})}function Ve(e){e.papers=e.papers.filter(e=>e.life<e.maxLife);for(let t of e.papers)t.x+=t.vx,t.y+=t.vy,t.vy+=.06,t.rot+=t.vrot,t.life++}function He(e,t){for(let n of t.papers){let t=1-n.life/n.maxLife;e.save(),e.globalAlpha=t,e.translate(n.x*z,n.y*z),e.rotate(n.rot*Math.PI/180),e.fillStyle=R.paper,e.fillRect(-7*z,-5*z,14*z,10*z),e.fillStyle=R.paperLine,e.fillRect(-5*z,-2*z,8*z,z),e.fillRect(-5*z,0,6*z,z),e.restore()}e.globalAlpha=1}var Ue=`ABCDEFGHIJKLMNOPRSTUVWXYZ0123456789!?-_.:`;function We(e,t){return t<=0?e:Ue[Math.floor(Math.random()*41)]??e}function Ge(e,t,n,r,i,a=110,o=`down`){if(t.length===0)return;e.fillStyle=R.bubbleBg,e.fillRect(r*z,i*z,a*z,36*z),e.strokeStyle=R.bubbleBdr,e.lineWidth=z,e.strokeRect(r*z,i*z,a*z,36*z),e.fillStyle=R.cyan,e.fillRect(r*z,i*z,a*z,z),e.fillStyle=R.bubbleBdr,e.fillRect(r*z,(i+13+5)*z,a*z,z);for(let o=0;o<2;o++){let s=t[(Math.floor(n)+o)%t.length];if(!s)continue;let c=i+5+o*14;e.fillStyle=o%2==0?`#0f172a`:`#111827`,e.fillRect(r*z,c*z,a*z,13*z);let l=n-Math.floor(n),u=s.text.split(``);e.font=`bold ${5*z}px monospace`,e.textBaseline=`middle`;let d=Math.floor(a/7)-1;for(let t=0;t<Math.min(u.length,d);t++){let n=l>.3&&t>u.length*(1-l)?We(u[t],3):u[t];e.globalAlpha=l>0&&t>u.length*(1-l)?.5+l*.5:1,e.fillStyle=s.color,e.fillText(n,(r+4+t*7)*z,(c+6)*z)}e.globalAlpha=1}let s=r+a/2;if(e.fillStyle=R.bubbleBdr,o===`down`){let t=i+36;e.fillRect((s-2)*z,t*z,4*z,4*z),e.fillRect((s-3)*z,(t+4)*z,6*z,3*z)}else e.fillRect((s-2)*z,(i-4)*z,4*z,4*z),e.fillRect((s-3)*z,(i-7)*z,6*z,3*z)}function Ke(e,t,n,r){let i=je-Ie-8,a=n%2,o=a===0?2:0,s=a===0?0:2;e.fillStyle=`rgba(0,0,0,0.4)`,e.beginPath(),e.ellipse(t*z,(je-1)*z,9*z,2*z,0,0,Math.PI*2),e.fill(),e.save(),e.translate(t*z,0),e.scale(r?1:-1,1),B(e,R.cHair,-4,i,9,3),B(e,R.cHair,-5,i+1,11,2),B(e,R.cHair,-5,i+3,2,3),B(e,R.cHair,5,i+3,2,3),B(e,R.cSkin,-4,i+3,8,7),B(e,`#0f172a`,-2,i+5,2,2),B(e,`#0f172a`,2,i+5,2,2),B(e,`#1d4ed8`,-1,i+6,1,1),B(e,`#1d4ed8`,3,i+6,1,1),B(e,`#7f1d1d`,-2,i+9,5,1),B(e,R.cSkin,-1,i+10,3,2),B(e,R.cShirt,-5,i+12,11,9),B(e,`#3730a3`,-5,i+12,3,5),B(e,`#3730a3`,3,i+12,3,5),B(e,R.cTie,-1,i+12,3,7),B(e,`#f1f5f9`,-2,i+12,1,3),B(e,`#f1f5f9`,2,i+12,1,3),B(e,R.cShirt,-7,i+13,3,9),B(e,R.cSkin,-7,i+21,3,3),B(e,R.cShirt,5,i+13,3,9),B(e,R.cSkin,5,i+21,3,3),B(e,R.cBag,6,i+24,6,4),B(e,`#92400e`,7,i+23,4,1),B(e,R.cPants,-3,i+21+o,5,10),B(e,R.cPants,1,i+21+s,5,10),B(e,R.cShoes,-5,i+29+o,6,3),B(e,R.cShoes,-1,i+29+s,6,3),e.restore()}var qe=[[{text:`RUNNING WORKFLOW`,color:R.cyan},{text:`DISPATCHING...`,color:R.amber}],[{text:`ORCHESTRATING`,color:R.cyan},{text:`ALL SYSTEMS GO`,color:R.green}],[{text:`AGENT PIPELINE`,color:R.purple},{text:`EXECUTING...`,color:R.cyan}],[{text:`MONITORING ALL`,color:R.amber},{text:`ON SCHEDULE`,color:R.green}]];function Je(e,t){let n=e.toUpperCase().slice(0,14);return t===`running`?[{text:n,color:R.cyan},{text:`WORKING...`,color:R.green}]:t===`done`?[{text:n,color:R.green},{text:`TASK DONE`,color:R.green}]:t===`error`?[{text:n,color:R.red},{text:`ERR`,color:R.red}]:[{text:n,color:R.dim},{text:`STANDBY`,color:R.dim}]}function Ye({nodes:e,running:t}){let n=(0,_.useRef)(null),r=(0,_.useRef)(null);return(0,_.useEffect)(()=>{if(e.length===0)return;let t=Math.min(e.length,8)*(Me+Fe)-Fe,n=Math.max(6,Math.round((De-t)/2));if(!r.current)r.current={agents:e.slice(0,8).map((e,t)=>({x:n+t*(Me+Fe),icon:e.icon,label:e.label,status:e.status,skinIdx:t%R.skin.length,shirtIdx:t%R.shirt.length,hairIdx:t%R.hair.length,papers:[],bubbleLines:Je(e.label,e.status),bubbleScroll:0,bubbleTimer:0})),condX:n+Me/2,condTargetX:n+Me/2,condFacing:!0,condFrame:0,condFrameTimer:0,condIdleTimer:0,condBubble:qe[0],condBubbleScroll:0,condBubbleTimer:0,rafId:0};else{let t=r.current;for(let r=0;r<Math.min(e.length,8);r++){let i=e[r],a=t.agents[r];a?(a.status!==i.status&&(a.status=i.status,a.bubbleLines=Je(i.label,i.status),a.bubbleScroll=0),a.icon=i.icon,a.label=i.label):t.agents.push({x:n+r*(Me+Fe),icon:i.icon,label:i.label,status:i.status,skinIdx:r%R.skin.length,shirtIdx:r%R.shirt.length,hairIdx:r%R.hair.length,papers:[],bubbleLines:Je(i.label,i.status),bubbleScroll:0,bubbleTimer:0})}}},[e]),(0,_.useEffect)(()=>{let e=n.current;if(!e)return;let i=e.getContext(`2d`);if(!i||(i.imageSmoothingEnabled=!1,!r.current))return;let a=0,o=0;function s(e){let n=r.current,c=Math.min(e-a,50);a=e;let l=e,u=n.agents.find(e=>e.status===`running`);if(u)n.condTargetX=u.x+Me/2,n.condBubbleTimer+=c,n.condBubbleTimer>2e3&&(n.condBubbleTimer=0,n.condBubble=qe[Math.floor(Math.random()*qe.length)],n.condBubbleScroll=(n.condBubbleScroll+1)%4);else if(n.condIdleTimer-=c,n.condIdleTimer<=0){let e=n.agents[Math.floor(Math.random()*n.agents.length)];e&&(n.condTargetX=e.x+Me/2),n.condIdleTimer=2e3+Math.random()*3e3}let d=n.condTargetX-n.condX;if(Math.abs(d)>1&&(n.condX+=d*(t?.12:.04)*(c/16),n.condFacing=d>0,n.condFrameTimer+=c,n.condFrameTimer>100&&(n.condFrame++,n.condFrameTimer=0)),o+=c,o>200){o=0;for(let e of n.agents)e.status===`running`&&Be(e)}for(let e of n.agents)Ve(e);for(let e of n.agents)e.bubbleTimer+=c,e.bubbleTimer>1800&&(e.bubbleTimer=0,e.bubbleScroll=(e.bubbleScroll+1)%4);i.clearRect(0,0,ke,Ae),Le(i);for(let e of n.agents)Re(i,e,n.condX,l),He(i,e);Ke(i,n.condX,n.condFrame,n.condFacing);for(let e of n.agents){if(e.status===`waiting`)continue;let t=Math.min(e.label.length*6+16,90),n=Math.max(e.x+1,Math.min(e.x+(Me-t)/2,De-t-2)),r=je-Ie-36;Ge(i,e.bubbleLines,e.bubbleScroll,n,r,t,`down`)}let f=je-Ie-8-38,p=Math.max(4,Math.min(n.condX-50,De-106));Ge(i,n.condBubble,n.condBubbleScroll,p,f,100,`down`);for(let e=0;e<Ae;e+=z*3)i.fillStyle=`rgba(0,0,0,0.04)`,i.fillRect(0,e,ke,z);n.rafId=requestAnimationFrame(s)}return r.current.rafId=requestAnimationFrame(s),()=>{r.current&&cancelAnimationFrame(r.current.rafId)}},[t]),e.length===0?null:(0,k.jsx)(`div`,{style:{width:`100%`,lineHeight:0},children:(0,k.jsx)(`canvas`,{ref:n,width:ke,height:Ae,style:{width:`100%`,height:`auto`,imageRendering:`pixelated`,display:`block`,background:R.bg,boxShadow:`0 0 40px rgba(99,102,241,0.15), inset 0 0 80px rgba(0,0,0,0.4)`}})})}function Xe(e){let t=e.toLowerCase();return Te.some(e=>t.includes(e.toLowerCase()))}function Ze(e,t){let n=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),r=t.map(e=>e.output).join(`
|
|
234
234
|
|
|
235
|
-
`),i=/([+-]?\d+(?:\.\d+)?)\s*%/g,a=[],o;for(;(o=i.exec(r))!==null;){let e=parseFloat(o[1]);e>=-100&&e<=500&&a.push(e)}let s=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>{let t=
|
|
235
|
+
`),i=/([+-]?\d+(?:\.\d+)?)\s*%/g,a=[],o;for(;(o=i.exec(r))!==null;){let e=parseFloat(o[1]);e>=-100&&e<=500&&a.push(e)}let s=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>{let t=ye(e.output);return`
|
|
236
236
|
<div class="section">
|
|
237
237
|
<div class="section-head">
|
|
238
238
|
<span class="section-icon">${n(e.icon)}</span>
|
|
@@ -240,19 +240,45 @@ Provide specific, actionable levels. Use technical analysis (EMA, RSI, MACD, Fib
|
|
|
240
240
|
<span class="section-badge">${n(e.status)}</span>
|
|
241
241
|
</div>
|
|
242
242
|
<div class="section-body">${t}</div>
|
|
243
|
-
</div>`}).join(``),c=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>e.label),l=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>{let t=(e.output.match(/bullish|buy|long|upside|growth|positive|strong|breakout|momentum/gi)??[]).length,n=(e.output.match(/bearish|sell|short|downside|risk|negative|weak|breakdown|reversal/gi)??[]).length;return Math.max(0,Math.min(100,50+(t-n)*5))}),u=a.filter(e=>e!==0).slice(0,8),d=u.map((e,t)=>`Signal ${t+1}`),f=c.map((e,r)=>{let i=l[r]??50,a=i>=65?`score-bull`:i<=35?`score-bear`:`score-neutral`,o=i>=65?`fill-bull`:i<=35?`fill-bear`:`fill-neutral`,s=i>=65?`BULLISH`:i<=35?`BEARISH`:`NEUTRAL`;return`<div class="gauge-card">
|
|
243
|
+
</div>`}).join(``),c=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>e.label),l=t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>{let t=(e.output.match(/bullish|buy|long|upside|growth|positive|strong|breakout|momentum/gi)??[]).length,n=(e.output.match(/bearish|sell|short|downside|risk|negative|weak|breakdown|reversal/gi)??[]).length;return Math.max(0,Math.min(100,50+(t-n)*5))}),u=a.filter(e=>e!==0).slice(0,8),d=u.map((e,t)=>`Signal ${t+1}`),f=[],p=/\b(20\d{2})\b[^|*\n]*\|[^|*\n]*(\d[\d,. ]+)[^|*\n]*\|[^|*\n]*(\d[\d,.]+)/g,m;for(;(m=p.exec(r))!==null;){let e=parseInt(m[1],10),t=parseFloat(m[2].replace(/[,\s]/g,``)),n=parseFloat(m[3].replace(/[,\s]/g,``));if(e>=2018&&e<=2027&&t>0&&n>0){let r=t>500?t:n>500?n:void 0,i=t<200&&t>10?t:n<200&&n>10?n:void 0;(r||i)&&f.push({year:e,gold:r,oil:i,ratio:void 0})}}let h=new Map;for(let e of f)h.set(e.year,{...h.get(e.year),...e});let g=[...h.values()].sort((e,t)=>e.year-t.year),_=g.map(e=>String(e.year)),v=g.map(e=>e.gold??null),y=g.map(e=>e.oil??null),b=g.length>=2&&v.some(e=>e!==null),x=c.map((e,r)=>{let i=l[r]??50,a=i>=65?`score-bull`:i<=35?`score-bear`:`score-neutral`,o=i>=65?`fill-bull`:i<=35?`fill-bear`:`fill-neutral`,s=i>=65?`BULLISH`:i<=35?`BEARISH`:`NEUTRAL`;return`<div class="gauge-card">
|
|
244
244
|
<div class="gauge-icon">${n(t.find(t=>t.label===e)?.icon??`📊`)}</div>
|
|
245
245
|
<div class="gauge-label">${n(e)}</div>
|
|
246
246
|
<div class="gauge-score ${a}">${i}</div>
|
|
247
247
|
<div style="font-size:9px;color:var(--dim);margin-bottom:6px">${s}</div>
|
|
248
248
|
<div class="gauge-bar"><div class="gauge-fill ${o}" style="width:${i}%"></div></div>
|
|
249
|
-
</div>`}).join(``),
|
|
249
|
+
</div>`}).join(``),S=b?`<div class="chart-card chart-card-wide">
|
|
250
|
+
<div class="chart-title">Price History (extracted from analysis)</div>
|
|
251
|
+
<div class="chart-wrap"><canvas id="chartTimeSeries"></canvas></div>
|
|
252
|
+
</div>`:``,C=u.length>=3?`<div class="chart-card">
|
|
250
253
|
<div class="chart-title">Extracted % Signals</div>
|
|
251
254
|
<div class="chart-wrap"><canvas id="chartPct"></canvas></div>
|
|
252
255
|
</div>`:`<div class="chart-card">
|
|
253
256
|
<div class="chart-title">Bull vs Bear Count per Agent</div>
|
|
254
257
|
<div class="chart-wrap"><canvas id="chartBearBull"></canvas></div>
|
|
255
|
-
</div>`,
|
|
258
|
+
</div>`,w=JSON.stringify(t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>(e.output.match(/bullish|buy|long|upside|growth|breakout/gi)??[]).length)),ee=JSON.stringify(t.filter(e=>e.output&&e.output!==`(no output)`).map(e=>(e.output.match(/bearish|sell|short|downside|risk|breakdown/gi)??[]).length)),te=b?`
|
|
259
|
+
const tsCtx = document.getElementById('chartTimeSeries');
|
|
260
|
+
if (tsCtx) {
|
|
261
|
+
new C(tsCtx, {
|
|
262
|
+
type: 'line',
|
|
263
|
+
data: {
|
|
264
|
+
labels: ${JSON.stringify(_)},
|
|
265
|
+
datasets: [
|
|
266
|
+
{ label: 'Gold (USD/oz)', data: ${JSON.stringify(v)}, borderColor: '#f59e0b', backgroundColor: 'rgba(245,158,11,0.1)', tension: 0.3, pointRadius: 4, yAxisID: 'yGold', spanGaps: true },
|
|
267
|
+
{ label: 'Oil WTI (USD/bbl)', data: ${JSON.stringify(y)}, borderColor: '#00e5ff', backgroundColor: 'rgba(0,229,255,0.1)', tension: 0.3, pointRadius: 4, yAxisID: 'yOil', spanGaps: true },
|
|
268
|
+
]
|
|
269
|
+
},
|
|
270
|
+
options: {
|
|
271
|
+
responsive: true, maintainAspectRatio: false,
|
|
272
|
+
interaction: { mode: 'index', intersect: false },
|
|
273
|
+
plugins: { legend: { labels: { color: '#8b949e', font: { size: 9 } } } },
|
|
274
|
+
scales: {
|
|
275
|
+
x: { ticks: { color: '#8b949e', font: { size: 9 } }, grid: { color: '#21262d' } },
|
|
276
|
+
yGold: { type: 'linear', position: 'left', ticks: { color: '#f59e0b', font: { size: 9 }, callback: (v) => '$' + v }, grid: { color: '#21262d' } },
|
|
277
|
+
yOil: { type: 'linear', position: 'right', ticks: { color: '#00e5ff', font: { size: 9 }, callback: (v) => '$' + v }, grid: { drawOnChartArea: false } },
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
});
|
|
281
|
+
}`:``,ne=u.length>=3?`const pctCtx = document.getElementById('chartPct');
|
|
256
282
|
if (pctCtx) {
|
|
257
283
|
const pctVals = ${JSON.stringify(u)};
|
|
258
284
|
new C(pctCtx, {
|
|
@@ -276,8 +302,8 @@ if (bbCtx) {
|
|
|
276
302
|
data: {
|
|
277
303
|
labels: ${JSON.stringify(c)},
|
|
278
304
|
datasets: [
|
|
279
|
-
{ label: 'Bullish signals', data: ${
|
|
280
|
-
{ label: 'Bearish signals', data: ${
|
|
305
|
+
{ label: 'Bullish signals', data: ${w}, backgroundColor: 'rgba(0,255,65,0.7)', borderColor: '#00ff41', borderWidth: 1, borderRadius: 3 },
|
|
306
|
+
{ label: 'Bearish signals', data: ${ee}, backgroundColor: 'rgba(255,68,68,0.7)', borderColor: '#ff4444', borderWidth: 1, borderRadius: 3 },
|
|
281
307
|
]
|
|
282
308
|
},
|
|
283
309
|
options: { responsive: true, maintainAspectRatio: false,
|
|
@@ -285,7 +311,7 @@ if (bbCtx) {
|
|
|
285
311
|
scales: { x: { ticks: { color: '#8b949e', font: { size: 9 } }, grid: { color: '#21262d' } },
|
|
286
312
|
y: { ticks: { color: '#8b949e', font: { size: 9 } }, grid: { color: '#21262d' } } } }
|
|
287
313
|
});
|
|
288
|
-
}`,
|
|
314
|
+
}`,T=new Date().toLocaleString(`en-US`,{month:`short`,day:`numeric`,hour:`2-digit`,minute:`2-digit`});return`<!DOCTYPE html>
|
|
289
315
|
<html lang="en">
|
|
290
316
|
<head>
|
|
291
317
|
<meta charset="UTF-8">
|
|
@@ -314,6 +340,7 @@ if (bbCtx) {
|
|
|
314
340
|
.meta-badge{font-size:10px;color:var(--dim);background:var(--bg3);border:1px solid var(--border);padding:3px 8px;border-radius:4px}
|
|
315
341
|
.meta-badge b{color:var(--bright)}
|
|
316
342
|
.charts-row{display:grid;grid-template-columns:1fr 1fr;gap:16px;margin-bottom:20px}
|
|
343
|
+
.chart-card-wide{grid-column:1/-1}
|
|
317
344
|
.chart-card{background:var(--bg2);border:1px solid var(--border);border-radius:8px;padding:16px}
|
|
318
345
|
.chart-title{font-size:10px;text-transform:uppercase;letter-spacing:1.5px;color:var(--dim);font-weight:700;margin-bottom:12px}
|
|
319
346
|
.chart-wrap{position:relative;height:180px}
|
|
@@ -335,6 +362,21 @@ if (bbCtx) {
|
|
|
335
362
|
.section-body .sh2{font-size:12px;font-weight:700;color:var(--bright);margin:10px 0 4px;padding-left:8px;border-left:2px solid var(--green)}
|
|
336
363
|
.section-body .sh3{font-size:11px;font-weight:700;color:var(--amber);margin:8px 0 3px}
|
|
337
364
|
.section-body .sh4,.section-body .sh5{font-size:11px;color:var(--blue);margin:6px 0 2px}
|
|
365
|
+
.section-body table{width:100%;border-collapse:collapse;margin:10px 0;font-size:11px}
|
|
366
|
+
.section-body th{background:rgba(0,255,65,0.08);color:var(--bright);font-weight:700;padding:6px 10px;text-align:left;border:1px solid var(--border);text-transform:uppercase;font-size:10px;letter-spacing:0.4px}
|
|
367
|
+
.section-body td{padding:5px 10px;border:1px solid var(--border);color:var(--text)}
|
|
368
|
+
.section-body tr:nth-child(even) td{background:rgba(255,255,255,0.03)}
|
|
369
|
+
.section-body p{margin:0 0 6px}
|
|
370
|
+
.section-body ul,.section-body ol{padding-left:18px;margin:6px 0}
|
|
371
|
+
.section-body li{margin-bottom:3px}
|
|
372
|
+
.section-body h1{font-size:14px;font-weight:800;color:var(--bright);margin:12px 0 6px;padding-bottom:4px;border-bottom:1px solid var(--border)}
|
|
373
|
+
.section-body h2{font-size:12px;font-weight:700;color:var(--bright);margin:10px 0 4px;padding-left:8px;border-left:2px solid var(--green)}
|
|
374
|
+
.section-body h3{font-size:11px;font-weight:700;color:var(--amber);margin:8px 0 3px}
|
|
375
|
+
.section-body h4,.section-body h5{font-size:11px;color:var(--blue);margin:6px 0 2px}
|
|
376
|
+
.section-body code{background:rgba(255,255,255,0.05);border:1px solid var(--border);border-radius:3px;padding:1px 4px;font-family:var(--font);font-size:10px;color:var(--blue)}
|
|
377
|
+
.section-body pre{background:var(--bg3);border:1px solid var(--border);border-radius:6px;padding:10px 12px;overflow-x:auto;margin:8px 0}
|
|
378
|
+
.section-body blockquote{border-left:3px solid var(--green);padding-left:12px;color:var(--dim);margin:8px 0}
|
|
379
|
+
.section-body hr{border:none;border-top:1px solid var(--border);margin:12px 0}
|
|
338
380
|
.footer{text-align:center;padding:16px;color:var(--dim);font-size:9px;border-top:1px solid var(--border);margin-top:20px}
|
|
339
381
|
.footer span{color:var(--green)}
|
|
340
382
|
::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background:var(--bg)}::-webkit-scrollbar-thumb{background:var(--border2);border-radius:3px}
|
|
@@ -350,18 +392,19 @@ if (bbCtx) {
|
|
|
350
392
|
<div class="header-task">${n(e.slice(0,400))}${e.length>400?`…`:``}</div>
|
|
351
393
|
<div class="header-meta">
|
|
352
394
|
<div class="meta-badge"><b>${t.length}</b> Agents</div>
|
|
353
|
-
<div class="meta-badge">Generated <b>${
|
|
395
|
+
<div class="meta-badge">Generated <b>${T}</b></div>
|
|
354
396
|
<div class="meta-badge">NHA Studio <b>v13</b></div>
|
|
355
397
|
</div>
|
|
356
398
|
</div>
|
|
357
399
|
</div>
|
|
358
|
-
<div class="gauges-row">${
|
|
400
|
+
<div class="gauges-row">${x}</div>
|
|
359
401
|
${c.length>0?`<div class="charts-row">
|
|
402
|
+
${S}
|
|
360
403
|
<div class="chart-card">
|
|
361
404
|
<div class="chart-title">Agent Signal Scores</div>
|
|
362
405
|
<div class="chart-wrap"><canvas id="chartSignal"></canvas></div>
|
|
363
406
|
</div>
|
|
364
|
-
${
|
|
407
|
+
${C}
|
|
365
408
|
</div>`:``}
|
|
366
409
|
${s}
|
|
367
410
|
<div class="footer">Generated by <span>NotHumanAllowed</span> Studio • Real intelligence, real tools, free AI via Liara (Qwen3 32B)</div>
|
|
@@ -393,7 +436,8 @@ if (signalCtx) {
|
|
|
393
436
|
y: { min: 0, max: 100, ticks: { color: '#8b949e', font: { size: 9 } }, grid: { color: '#21262d' } } } }
|
|
394
437
|
});
|
|
395
438
|
}
|
|
396
|
-
${
|
|
439
|
+
${te}
|
|
440
|
+
${ne}
|
|
397
441
|
<\/script>
|
|
398
442
|
</body>
|
|
399
443
|
</html>`}function Qe(e,t){let n=e=>e.replace(/&/g,`&`).replace(/</g,`<`).replace(/>/g,`>`).replace(/"/g,`"`),r=ye,i=t.filter(e=>e.output&&e.output!==`(no output)`),a=i.map(e=>{let t=(e.output.match(/bullish|buy|positive|strong|upside|growth|ottimo|eccellente|positiv/gi)??[]).length,n=(e.output.match(/bearish|sell|negative|weak|risk|downside|problema|critico|negativ/gi)??[]).length;return Math.max(5,Math.min(95,50+(t-n)*6))}),o=Math.floor(Math.min(560,i.length*80)),s=i.length>0?Math.floor(o/i.length)-6:40,c=i.length>=2?`
|
|
@@ -406,7 +450,7 @@ ${g}
|
|
|
406
450
|
<text x="${n+s/2}" y="${a-4}" text-anchor="middle" font-size="9" font-weight="bold" fill="${o}">${e}%</text>`}).join(``)}
|
|
407
451
|
<line x1="0" y1="100" x2="${o}" y2="100" stroke="#e2e8f0" stroke-width="1"/>
|
|
408
452
|
</svg>
|
|
409
|
-
</div>`:``,l=i.map(e=>`<div class="toc-item"><span class="toc-icon">${e.icon}</span>${n(e.label)}</div>`).join(``),u=i.map(e=>`<div class="section"><div class="agent-header"><span class="icon">${e.icon}</span><div class="agent-name">${n(e.label)}</div></div><div class="section-body"
|
|
453
|
+
</div>`:``,l=i.map(e=>`<div class="toc-item"><span class="toc-icon">${e.icon}</span>${n(e.label)}</div>`).join(``),u=i.map(e=>`<div class="section"><div class="agent-header"><span class="icon">${e.icon}</span><div class="agent-name">${n(e.label)}</div></div><div class="section-body">${r(e.output)}</div></div>`).join(``);return`<!DOCTYPE html><html lang="it"><head><meta charset="UTF-8"><title>NHA Studio — ${n(e.slice(0,80))}</title>
|
|
410
454
|
<style>
|
|
411
455
|
*{box-sizing:border-box;margin:0;padding:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
|
|
412
456
|
body{font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;color:#1e293b;background:#fff;font-size:13px;line-height:1.75;padding:40px;max-width:900px;margin:0 auto}
|
package/src/ui-dist/index.html
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
|
|
9
9
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
10
10
|
<title>NHA — NotHumanAllowed</title>
|
|
11
|
-
<script type="module" crossorigin src="/assets/index-
|
|
11
|
+
<script type="module" crossorigin src="/assets/index-MuLLNT9v.js"></script>
|
|
12
12
|
<link rel="stylesheet" crossorigin href="/assets/index-BRTO-LWg.css">
|
|
13
13
|
</head>
|
|
14
14
|
<body>
|