nothumanallowed 9.4.6 → 9.4.8
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 +17 -4
- package/src/constants.mjs +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.8",
|
|
4
4
|
"description": "NotHumanAllowed — 38 AI agents + 58 tools + browser automation + web search. Streaming chat, headless Chrome CDP, multi-conversation, export. Gmail, Calendar, Drive, GitHub, Notion, Slack. Zero-dependency CLI.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
package/src/commands/ui.mjs
CHANGED
|
@@ -1229,8 +1229,18 @@ export async function cmdUI(args) {
|
|
|
1229
1229
|
const { textParts, actions } = parseActions(fullResponse);
|
|
1230
1230
|
const toolResults = [];
|
|
1231
1231
|
|
|
1232
|
-
// Auto-detect screenshot intent from user message
|
|
1232
|
+
// Auto-detect search + screenshot intent from user message
|
|
1233
1233
|
const wantsScreenshot = /screenshot|screen\s*shot|schermo|cattura|foto|immagine/i.test(msg);
|
|
1234
|
+
const wantsSearch = /\b(cerca|search|find|look\s*up|ricerca|cercare)\b/i.test(msg);
|
|
1235
|
+
|
|
1236
|
+
// If user asked to search but LLM didn't call web_search, force it
|
|
1237
|
+
if (wantsSearch && !actions.some(a => a.action === 'web_search')) {
|
|
1238
|
+
// Extract search query from message (remove action words)
|
|
1239
|
+
const searchQuery = msg.replace(/\b(cerca|search|find|look\s*up|ricerca|cercare|e\s+fai|and\s+take|screenshot|screen\s*shot|schermo|cattura|foto|immagine|dei|dei\s+risultati|of\s+the\s+results|risultati|results)\b/gi, '').replace(/["""]/g, '').trim();
|
|
1240
|
+
if (searchQuery.length > 2) {
|
|
1241
|
+
actions.push({ action: 'web_search', params: { query: searchQuery, screenshot: wantsScreenshot } });
|
|
1242
|
+
}
|
|
1243
|
+
}
|
|
1234
1244
|
|
|
1235
1245
|
for (const { action, params } of actions) {
|
|
1236
1246
|
// Force screenshot=true on web_search if user asked for screenshot
|
|
@@ -1299,19 +1309,22 @@ export async function cmdUI(args) {
|
|
|
1299
1309
|
if (resultStr.includes('[Screenshot of results captured')) {
|
|
1300
1310
|
try {
|
|
1301
1311
|
const fileMatch = resultStr.match(/file:(ss-\d+\.jpg)/);
|
|
1312
|
+
console.log(` [screenshot] file match: ${fileMatch?.[1] || 'NONE'}`);
|
|
1302
1313
|
if (fileMatch) {
|
|
1303
1314
|
const ssFilename = fileMatch[1];
|
|
1304
1315
|
const ssPath = path.join(NHA_DIR, 'screenshots', ssFilename);
|
|
1305
|
-
|
|
1316
|
+
const exists = fs.existsSync(ssPath);
|
|
1317
|
+
console.log(` [screenshot] path: ${ssPath}, exists: ${exists}`);
|
|
1318
|
+
if (exists) {
|
|
1306
1319
|
const ssBase64 = fs.readFileSync(ssPath).toString('base64');
|
|
1320
|
+
console.log(` [screenshot] sending SSE, base64 size: ${ssBase64.length}`);
|
|
1307
1321
|
sendSSE('screenshot', { base64: ssBase64, format: 'jpeg', filename: ssFilename });
|
|
1308
|
-
// Also send as browser_frame for the viewer
|
|
1309
1322
|
sendSSE('browser_frame', { base64: ssBase64, format: 'jpeg', url: 'Search results' });
|
|
1310
1323
|
if (!res._screenshotFiles) res._screenshotFiles = [];
|
|
1311
1324
|
res._screenshotFiles.push(ssFilename);
|
|
1312
1325
|
}
|
|
1313
1326
|
}
|
|
1314
|
-
} catch {
|
|
1327
|
+
} catch (ssErr) { console.log(` [screenshot] ERROR: ${ssErr.message}`); }
|
|
1315
1328
|
}
|
|
1316
1329
|
} catch (e) {
|
|
1317
1330
|
toolResults.push({ action, result: `Error: ${e.message}` });
|
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 = '9.4.
|
|
8
|
+
export const VERSION = '9.4.8';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|