nothumanallowed 13.2.46 → 13.2.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 +1 -1
- package/src/commands/ui.mjs +22 -8
- package/src/constants.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.2.
|
|
3
|
+
"version": "13.2.47",
|
|
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
|
@@ -2570,6 +2570,9 @@ export async function cmdUI(args) {
|
|
|
2570
2570
|
const extractSearchQuery = (t) => {
|
|
2571
2571
|
const m = t.match(/(?:cerca|search|find|ricerca|notizie su|news about|latest on|aggiornamenti su|ultime su|tendenz|trend)\s+(.{5,80}?)(?:\s+(?:e |and |per |for |poi |then )|[,\n]|$)/i);
|
|
2572
2572
|
if (m) return m[1].trim();
|
|
2573
|
+
// If task contains a domain/URL, use it as the search anchor
|
|
2574
|
+
const domainMatch = t.match(/(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+\.[a-z]{2,}(?:\.[a-z]{2,})?)/i);
|
|
2575
|
+
if (domainMatch) return domainMatch[0].replace(/^https?:\/\//,'');
|
|
2573
2576
|
const stripped = t.replace(/^[^:]+:\s*/,'').split(/[,\n]/)[0].slice(0,100).trim();
|
|
2574
2577
|
return stripped || t.slice(0,80).trim();
|
|
2575
2578
|
};
|
|
@@ -2709,24 +2712,35 @@ export async function cmdUI(args) {
|
|
|
2709
2712
|
} else if (agent === 'WebSearchAgent' || agent === 'ResearchAgent') {
|
|
2710
2713
|
sendToken('[Searching the web and reading pages...] ');
|
|
2711
2714
|
try {
|
|
2712
|
-
// Extract a concise search query from the step prompt
|
|
2713
|
-
// The planner should provide a short query, but if not, extract key terms
|
|
2715
|
+
// Extract a concise search query from the step prompt
|
|
2714
2716
|
let searchQuery = stepPrompt;
|
|
2715
|
-
// If the prompt is very long (> 120 chars), extract the core search terms
|
|
2716
2717
|
if (searchQuery.length > 120) {
|
|
2717
|
-
// Try to extract a meaningful short query
|
|
2718
2718
|
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);
|
|
2719
2719
|
if (keywordMatch) {
|
|
2720
2720
|
searchQuery = keywordMatch[1].trim();
|
|
2721
2721
|
} else {
|
|
2722
|
-
// Take first meaningful clause before comma/period
|
|
2723
2722
|
searchQuery = searchQuery.split(/[,\.\n]/)[0].slice(0, 100).trim();
|
|
2724
2723
|
}
|
|
2725
2724
|
}
|
|
2726
|
-
//
|
|
2725
|
+
// If step prompt / task contains a specific domain, fetch that page directly first
|
|
2726
|
+
const domainMatch = (stepPrompt + ' ' + task).match(/(?:https?:\/\/)?(?:www\.)?([a-z0-9-]+\.[a-z]{2,}(?:\/[^\s,]*)?)/i);
|
|
2727
|
+
if (domainMatch) {
|
|
2728
|
+
let targetUrl = domainMatch[0];
|
|
2729
|
+
if (!targetUrl.startsWith('http')) targetUrl = 'https://' + targetUrl;
|
|
2730
|
+
sendToken(`[Fetching ${targetUrl}...] `);
|
|
2731
|
+
try {
|
|
2732
|
+
const fetchResult = await withTimeout(executeTool('fetch_url', { url: targetUrl }, config), 20000);
|
|
2733
|
+
const fetchStr = typeof fetchResult === 'string' ? fetchResult : JSON.stringify(fetchResult);
|
|
2734
|
+
if (fetchStr && !fetchStr.startsWith('HTTP ') && !fetchStr.startsWith('Content blocked')) {
|
|
2735
|
+
toolData = `## Content from ${targetUrl}:\n${fetchStr.slice(0, 5000)}`;
|
|
2736
|
+
}
|
|
2737
|
+
} catch {}
|
|
2738
|
+
}
|
|
2739
|
+
// Deep web search for broader context
|
|
2727
2740
|
const searchResult = await withTimeout(executeTool('web_search', { query: searchQuery, deep: true }, config), 25000);
|
|
2728
|
-
|
|
2729
|
-
|
|
2741
|
+
const searchStr = typeof searchResult === 'string' ? searchResult : JSON.stringify(searchResult);
|
|
2742
|
+
toolData += (toolData ? '\n\n' : '') + `## Web search results for "${searchQuery}":\n${searchStr}`;
|
|
2743
|
+
} catch (e) { toolData = toolData || `Web search failed: ${e.message}`; }
|
|
2730
2744
|
|
|
2731
2745
|
} else if (agent === 'BrowserAgent') {
|
|
2732
2746
|
const urlMatch = stepPrompt.match(/https?:\/\/[^\s"']+/);
|
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.47';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|