nothumanallowed 13.2.73 → 13.2.75
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/commands/ui.mjs +25 -39
- package/src/constants.mjs +1 -1
- package/src/services/web-ui.mjs +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.75",
|
|
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/commands/ui.mjs
CHANGED
|
@@ -2944,50 +2944,36 @@ Rules:
|
|
|
2944
2944
|
} else if (agent === 'WebSearchAgent' || agent === 'ResearchAgent') {
|
|
2945
2945
|
sendToken('[Searching the web and reading pages...] ');
|
|
2946
2946
|
try {
|
|
2947
|
-
//
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
// If context contains extracted PDF data, extract the best search query from it:
|
|
2951
|
-
// product codes, model numbers, part numbers etc. are better search terms than the task text.
|
|
2947
|
+
// If there is document context from a previous step, ask the LLM to derive
|
|
2948
|
+
// the optimal search queries. This is generic and works for any document/task.
|
|
2949
|
+
let searchQueries = [stepPrompt.slice(0, 120)];
|
|
2952
2950
|
if (context && context.length > 50) {
|
|
2953
|
-
|
|
2954
|
-
const codeMatch = context.match(/\b([A-Z0-9]{2,}[-\/]?[A-Z0-9]{2,}(?:[-\/][A-Z0-9]+)*)\b/g);
|
|
2955
|
-
const productCodes = codeMatch ? [...new Set(codeMatch)].slice(0, 3) : [];
|
|
2956
|
-
// Also grab manufacturer name if present
|
|
2957
|
-
const mfrMatch = context.match(/(?:Marca|Marchio|Manufacturer|Brand|Produttore|Costruttore)[:\s]+([A-Za-z0-9 &]{2,40})/i);
|
|
2958
|
-
const mfr = mfrMatch ? mfrMatch[1].trim() : '';
|
|
2959
|
-
if (productCodes.length > 0) {
|
|
2960
|
-
searchQuery = (mfr ? mfr + ' ' : '') + productCodes.join(' ') + ' buy acquista distributore';
|
|
2961
|
-
sendToken(`[Search query from document: "${searchQuery}"] `);
|
|
2962
|
-
}
|
|
2963
|
-
}
|
|
2964
|
-
|
|
2965
|
-
if (searchQuery.length > 120 && !context) {
|
|
2966
|
-
const keywordMatch = searchQuery.match(/(?:cerca|search|find|ricerca|notizie su|news about|latest on|aggiornamenti su)\s+(.{5,80}?)(?:\s+(?:e|and|per|for|poi|then)|$)/i);
|
|
2967
|
-
if (keywordMatch) {
|
|
2968
|
-
searchQuery = keywordMatch[1].trim();
|
|
2969
|
-
} else {
|
|
2970
|
-
searchQuery = searchQuery.split(/[,\.\n]/)[0].slice(0, 100).trim();
|
|
2971
|
-
}
|
|
2972
|
-
}
|
|
2973
|
-
// If step prompt / task contains a specific domain, fetch that page directly first
|
|
2974
|
-
const domainMatch = (stepPrompt + ' ' + task).match(/(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+\.[a-z]{2,}(?:\/[^\s,]*)?)/i);
|
|
2975
|
-
if (domainMatch) {
|
|
2976
|
-
let targetUrl = domainMatch[0];
|
|
2977
|
-
if (!targetUrl.startsWith('http')) targetUrl = 'https://' + targetUrl;
|
|
2978
|
-
sendToken(`[Fetching ${targetUrl}...] `);
|
|
2951
|
+
sendToken('[Building search queries from document...] ');
|
|
2979
2952
|
try {
|
|
2980
|
-
const
|
|
2981
|
-
const
|
|
2982
|
-
|
|
2983
|
-
|
|
2953
|
+
const queryPlanSys = 'You are a search query generator. Given a document summary and a user task, output a JSON array of 1-3 concise web search queries (strings, max 80 chars each) that will find the best results. Output ONLY the JSON array, no explanation.';
|
|
2954
|
+
const queryPlanUser = `User task: "${task}"\n\nDocument content (summary):\n${context.slice(0, 3000)}\n\nGenerate search queries to fulfill the task. If the task asks for similar/alternative products, use technical specs as queries. If it asks where to buy, include vendor/distributor queries. Output: ["query1","query2",...]`;
|
|
2955
|
+
const planConfig2 = Object.assign({}, config, { thinking: 'off' });
|
|
2956
|
+
const queryRaw = await withTimeout(callLLM(planConfig2, queryPlanSys, queryPlanUser, { max_tokens: 200 }), 15000);
|
|
2957
|
+
const jsonMatch = queryRaw.match(/\[[\s\S]*?\]/);
|
|
2958
|
+
if (jsonMatch) {
|
|
2959
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
2960
|
+
if (Array.isArray(parsed) && parsed.length > 0) {
|
|
2961
|
+
searchQueries = parsed.filter(q => typeof q === 'string' && q.length > 2).slice(0, 3);
|
|
2962
|
+
}
|
|
2984
2963
|
}
|
|
2985
2964
|
} catch {}
|
|
2965
|
+
sendToken(`[Queries: ${searchQueries.map(q => '"' + q + '"').join(', ')}] `);
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
// Run all queries sequentially, accumulate results
|
|
2969
|
+
for (let qi = 0; qi < searchQueries.length; qi++) {
|
|
2970
|
+
const q = searchQueries[qi];
|
|
2971
|
+
try {
|
|
2972
|
+
const searchResult = await withTimeout(executeTool('web_search', { query: q, deep: qi === 0 }, config), 25000);
|
|
2973
|
+
const searchStr = typeof searchResult === 'string' ? searchResult : JSON.stringify(searchResult);
|
|
2974
|
+
toolData += (toolData ? '\n\n' : '') + `## Web search: "${q}":\n${searchStr}`;
|
|
2975
|
+
} catch (e) { toolData += (toolData ? '\n\n' : '') + `## Search "${q}" failed: ${e.message}`; }
|
|
2986
2976
|
}
|
|
2987
|
-
// Deep web search for broader context
|
|
2988
|
-
const searchResult = await withTimeout(executeTool('web_search', { query: searchQuery, deep: true }, config), 25000);
|
|
2989
|
-
const searchStr = typeof searchResult === 'string' ? searchResult : JSON.stringify(searchResult);
|
|
2990
|
-
toolData += (toolData ? '\n\n' : '') + `## Web search results for "${searchQuery}":\n${searchStr}`;
|
|
2991
2977
|
} catch (e) { toolData = toolData || `Web search failed: ${e.message}`; }
|
|
2992
2978
|
|
|
2993
2979
|
} else if (agent === 'BrowserAgent') {
|
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.2.
|
|
8
|
+
export const VERSION = '13.2.75';
|
|
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/web-ui.mjs
CHANGED
|
@@ -3367,7 +3367,11 @@ function renderStudioLog() {
|
|
|
3367
3367
|
el.scrollTop = el.scrollHeight;
|
|
3368
3368
|
}
|
|
3369
3369
|
|
|
3370
|
+
var _downloadPdfLast = 0;
|
|
3370
3371
|
function downloadStudioPDF() {
|
|
3372
|
+
var now = Date.now();
|
|
3373
|
+
if (now - _downloadPdfLast < 3000) return; // debounce: max 1 download every 3s
|
|
3374
|
+
_downloadPdfLast = now;
|
|
3371
3375
|
var task = studioState.task || 'NHA Studio Report';
|
|
3372
3376
|
var today = new Date().toLocaleDateString('it-IT', {day:'2-digit',month:'2-digit',year:'numeric'});
|
|
3373
3377
|
var nodes = studioState.nodes || [];
|