nothumanallowed 9.4.0 → 9.4.2
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 +24 -10
- package/src/constants.mjs +1 -1
- package/src/services/tool-executor.mjs +7 -1
- package/src/services/web-ui.mjs +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
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
|
@@ -253,6 +253,13 @@ export async function cmdUI(args) {
|
|
|
253
253
|
return;
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
// GET /api/health — simple health check
|
|
257
|
+
if (method === 'GET' && pathname === '/api/health') {
|
|
258
|
+
sendJSON(res, 200, { ok: true, version: VERSION });
|
|
259
|
+
logRequest(method, pathname, 200, Date.now() - start);
|
|
260
|
+
return;
|
|
261
|
+
}
|
|
262
|
+
|
|
256
263
|
// GET /api/status
|
|
257
264
|
if (method === 'GET' && pathname === '/api/status') {
|
|
258
265
|
sendJSON(res, 200, {
|
|
@@ -1219,7 +1226,15 @@ export async function cmdUI(args) {
|
|
|
1219
1226
|
const { textParts, actions } = parseActions(fullResponse);
|
|
1220
1227
|
const toolResults = [];
|
|
1221
1228
|
|
|
1229
|
+
// Auto-detect screenshot intent from user message
|
|
1230
|
+
const wantsScreenshot = /screenshot|screen\s*shot|schermo|cattura|foto|immagine/i.test(msg);
|
|
1231
|
+
|
|
1222
1232
|
for (const { action, params } of actions) {
|
|
1233
|
+
// Force screenshot=true on web_search if user asked for screenshot
|
|
1234
|
+
if (action === 'web_search' && wantsScreenshot && !params.screenshot) {
|
|
1235
|
+
params.screenshot = true;
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1223
1238
|
sendSSE('tool', { action, status: 'executing' });
|
|
1224
1239
|
try {
|
|
1225
1240
|
// For browser_screenshot in web UI: capture and send base64 image
|
|
@@ -1277,18 +1292,17 @@ export async function cmdUI(args) {
|
|
|
1277
1292
|
} catch { /* frame capture failed, non-critical */ }
|
|
1278
1293
|
}
|
|
1279
1294
|
|
|
1280
|
-
// If the tool produced a screenshot (web_search with screenshot=true), send it via SSE
|
|
1295
|
+
// If the tool produced a screenshot (web_search with screenshot=true), send it via SSE
|
|
1281
1296
|
if (resultStr.includes('[Screenshot of results captured')) {
|
|
1282
1297
|
try {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
sendSSE('screenshot', { base64: ssResult.base64, format: 'jpeg', filename: ssFilename });
|
|
1298
|
+
// Extract filename from result (tool-executor already saved it)
|
|
1299
|
+
const fileMatch = resultStr.match(/file:(ss-\d+\.jpg)/);
|
|
1300
|
+
if (fileMatch) {
|
|
1301
|
+
const ssFilename = fileMatch[1];
|
|
1302
|
+
const ssPath = path.join(NHA_DIR, 'screenshots', ssFilename);
|
|
1303
|
+
if (fs.existsSync(ssPath)) {
|
|
1304
|
+
const ssBase64 = fs.readFileSync(ssPath).toString('base64');
|
|
1305
|
+
sendSSE('screenshot', { base64: ssBase64, format: 'jpeg', filename: ssFilename });
|
|
1292
1306
|
if (!res._screenshotFiles) res._screenshotFiles = [];
|
|
1293
1307
|
res._screenshotFiles.push(ssFilename);
|
|
1294
1308
|
}
|
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.2';
|
|
9
9
|
export const BASE_URL = 'https://nothumanallowed.com/cli';
|
|
10
10
|
export const API_BASE = 'https://nothumanallowed.com/api/v1';
|
|
11
11
|
|
|
@@ -1337,7 +1337,13 @@ export async function executeTool(action, params, config) {
|
|
|
1337
1337
|
await new Promise(r => setTimeout(r, 300));
|
|
1338
1338
|
const ss = await be.browserScreenshot({ fullPage: false, format: 'jpeg', quality: 75 });
|
|
1339
1339
|
if (!ss.error) {
|
|
1340
|
-
|
|
1340
|
+
// Save to disk for persistence
|
|
1341
|
+
const ssDir = path.join(os.homedir(), '.nha', 'screenshots');
|
|
1342
|
+
const fsMod = await import('fs');
|
|
1343
|
+
fsMod.mkdirSync(ssDir, { recursive: true });
|
|
1344
|
+
const ssFilename = `ss-${Date.now()}.jpg`;
|
|
1345
|
+
fsMod.writeFileSync(path.join(ssDir, ssFilename), Buffer.from(ss.base64, 'base64'));
|
|
1346
|
+
return textResult + `\n\n[Screenshot of results captured (${Math.round(ss.size / 1024)}KB) file:${ssFilename}]`;
|
|
1341
1347
|
}
|
|
1342
1348
|
} catch { /* screenshot failed, return text only */ }
|
|
1343
1349
|
}
|
package/src/services/web-ui.mjs
CHANGED
|
@@ -101,7 +101,7 @@ input:focus,textarea:focus{border-color:var(--green3)}
|
|
|
101
101
|
.tool-indicator--web{border-color:var(--cyan);color:var(--cyan)}
|
|
102
102
|
.tool-indicator--email{border-color:var(--green3);color:var(--green)}
|
|
103
103
|
.screenshot-preview{max-width:100%;border-radius:var(--r);margin:8px 0;border:1px solid var(--border)}
|
|
104
|
-
.browser-viewer{position:fixed;
|
|
104
|
+
.browser-viewer{position:fixed;top:12px;left:12px;width:440px;background:var(--bg2);border:2px solid #9c27b0;border-radius:8px;box-shadow:0 8px 32px rgba(0,0,0,0.6);z-index:300;overflow:hidden;display:none;transition:all .3s ease}
|
|
105
105
|
.browser-viewer--open{display:block}
|
|
106
106
|
.browser-viewer__header{display:flex;align-items:center;gap:6px;padding:6px 10px;background:#1a1a2e;border-bottom:1px solid #9c27b0;font-size:10px;color:#ce93d8}
|
|
107
107
|
.browser-viewer__dot{width:6px;height:6px;border-radius:50%;background:#9c27b0;animation:bvpulse 1.5s infinite}
|
|
@@ -112,7 +112,8 @@ input:focus,textarea:focus{border-color:var(--green3)}
|
|
|
112
112
|
.browser-viewer__frame{width:100%;aspect-ratio:16/9;background:#000;display:flex;align-items:center;justify-content:center}
|
|
113
113
|
.browser-viewer__frame img{width:100%;height:100%;object-fit:contain}
|
|
114
114
|
.browser-viewer__status{padding:4px 10px;font-size:9px;color:var(--dim);border-top:1px solid var(--border)}
|
|
115
|
-
@media(max-width:600px){.browser-viewer{width:
|
|
115
|
+
@media(max-width:600px){.browser-viewer{width:calc(100vw - 24px);top:8px;left:8px}}
|
|
116
|
+
@media(min-width:901px){.browser-viewer{left:232px}}
|
|
116
117
|
.chat__bar{display:flex;gap:8px;padding:10px 0 12px 0;border-top:1px solid var(--border);flex-shrink:0}
|
|
117
118
|
.chat__input{flex:1;resize:none;min-height:40px;max-height:100px;padding:10px 14px}
|
|
118
119
|
.chat__send{background:var(--green3);color:var(--bg);padding:10px 16px;border-radius:var(--r);font-weight:700;font-size:12px}
|