nothumanallowed 9.4.0 → 9.4.1
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 +16 -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.1",
|
|
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, {
|
|
@@ -1277,18 +1284,17 @@ export async function cmdUI(args) {
|
|
|
1277
1284
|
} catch { /* frame capture failed, non-critical */ }
|
|
1278
1285
|
}
|
|
1279
1286
|
|
|
1280
|
-
// If the tool produced a screenshot (web_search with screenshot=true), send it via SSE
|
|
1287
|
+
// If the tool produced a screenshot (web_search with screenshot=true), send it via SSE
|
|
1281
1288
|
if (resultStr.includes('[Screenshot of results captured')) {
|
|
1282
1289
|
try {
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
const
|
|
1290
|
-
|
|
1291
|
-
sendSSE('screenshot', { base64: ssResult.base64, format: 'jpeg', filename: ssFilename });
|
|
1290
|
+
// Extract filename from result (tool-executor already saved it)
|
|
1291
|
+
const fileMatch = resultStr.match(/file:(ss-\d+\.jpg)/);
|
|
1292
|
+
if (fileMatch) {
|
|
1293
|
+
const ssFilename = fileMatch[1];
|
|
1294
|
+
const ssPath = path.join(NHA_DIR, 'screenshots', ssFilename);
|
|
1295
|
+
if (fs.existsSync(ssPath)) {
|
|
1296
|
+
const ssBase64 = fs.readFileSync(ssPath).toString('base64');
|
|
1297
|
+
sendSSE('screenshot', { base64: ssBase64, format: 'jpeg', filename: ssFilename });
|
|
1292
1298
|
if (!res._screenshotFiles) res._screenshotFiles = [];
|
|
1293
1299
|
res._screenshotFiles.push(ssFilename);
|
|
1294
1300
|
}
|
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.1';
|
|
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}
|