nothumanallowed 9.3.13 → 9.3.14

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "9.3.13",
3
+ "version": "9.3.14",
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": {
@@ -1210,13 +1210,16 @@ export async function cmdUI(args) {
1210
1210
  sendSSE('tool', { action, status: 'error', error: 'No browser open' });
1211
1211
  continue;
1212
1212
  }
1213
+ // Scroll to top for best viewport
1214
+ await be.browserScroll({ direction: 'top' });
1215
+ await new Promise(r => setTimeout(r, 300));
1213
1216
  const ssResult = await be.browserScreenshot({
1214
- fullPage: params.fullPage || false,
1215
- format: params.format || 'png',
1216
- quality: params.quality,
1217
+ fullPage: false, // Always viewport
1218
+ format: 'jpeg',
1219
+ quality: 75,
1217
1220
  });
1218
1221
  if (!ssResult.error) {
1219
- sendSSE('screenshot', { base64: ssResult.base64, format: params.format || 'png' });
1222
+ sendSSE('screenshot', { base64: ssResult.base64, format: 'jpeg' });
1220
1223
  toolResults.push({ action, result: `Screenshot captured (${Math.round(ssResult.size / 1024)}KB)` });
1221
1224
  sendSSE('tool', { action, status: 'done', result: 'Screenshot captured' });
1222
1225
  } else {
@@ -1236,7 +1239,7 @@ export async function cmdUI(args) {
1236
1239
  try {
1237
1240
  const be = await import('../services/browser-engine.mjs');
1238
1241
  if (be.isBrowserRunning()) {
1239
- const ssResult = await be.browserScreenshot({ fullPage: true, format: 'png' });
1242
+ const ssResult = await be.browserScreenshot({ fullPage: false, format: 'jpeg', quality: 75 });
1240
1243
  if (!ssResult.error) {
1241
1244
  sendSSE('screenshot', { base64: ssResult.base64, format: 'png' });
1242
1245
  }
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.3.13';
8
+ export const VERSION = '9.3.14';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -287,10 +287,11 @@ TOOLS:
287
287
  Use this when you need to interact with a page (click, type, screenshot) or when fetch_url fails on JS-rendered content.
288
288
  WARNING: Do NOT use this to search the web — use web_search instead. Google/Bing block automated browsers with CAPTCHAs.
289
289
 
290
- 50. browser_screenshot(fullPage?: boolean, format?: "png"|"jpeg"|"webp", quality?: number, saveTo?: string)
291
- Capture a screenshot of the current browser page.
292
- fullPage=true captures the entire scrollable page. saveTo saves to a file path (e.g. "~/screenshot.png").
293
- Returns base64-encoded image data. Use after browser_open to see what's on screen.
290
+ 50. browser_screenshot(saveTo?: string)
291
+ Capture a screenshot of the current browser viewport (what's visible on screen).
292
+ saveTo saves to a file path (e.g. "~/screenshot.png"). Returns base64-encoded image.
293
+ ALWAYS use viewport screenshots (the default). Do NOT pass fullPage=true it produces oversized images.
294
+ Screenshots are automatically compressed as JPEG for efficiency.
294
295
 
295
296
  51. browser_click(text?: string, selector?: string, x?: number, y?: number)
296
297
  Click an element on the page by visible text, CSS selector, or x/y coordinates.
@@ -1139,14 +1140,19 @@ export async function executeTool(action, params, config) {
1139
1140
  const be = await import('./browser-engine.mjs');
1140
1141
  if (!be.isBrowserRunning()) return 'No browser open. Use browser_open first.';
1141
1142
 
1143
+ // Scroll to top before screenshot so user sees the most important content
1144
+ await be.browserScroll({ direction: 'top' });
1145
+ await new Promise(r => setTimeout(r, 300));
1146
+
1142
1147
  const saveTo = params.saveTo
1143
1148
  ? params.saveTo.replace(/^~/, os.homedir())
1144
1149
  : null;
1145
1150
 
1151
+ // Always use JPEG for efficiency (smaller base64, faster rendering in web UI)
1146
1152
  const result = await be.browserScreenshot({
1147
- fullPage: params.fullPage || false,
1148
- format: params.format || 'png',
1149
- quality: params.quality,
1153
+ fullPage: false, // Always viewport — fullPage produces oversized images
1154
+ format: 'jpeg',
1155
+ quality: 75,
1150
1156
  saveTo,
1151
1157
  });
1152
1158
  if (result.error) return `Screenshot error: ${result.message}`;
@@ -1326,7 +1332,7 @@ export async function executeTool(action, params, config) {
1326
1332
  // Render by injecting HTML into current page via JS
1327
1333
  await be.browserEval(`document.open();document.write(${JSON.stringify(fullHtml)});document.close();`);
1328
1334
  await new Promise(r => setTimeout(r, 300));
1329
- const ss = await be.browserScreenshot({ fullPage: true });
1335
+ const ss = await be.browserScreenshot({ fullPage: false, format: 'jpeg', quality: 75 });
1330
1336
  if (!ss.error) {
1331
1337
  return textResult + `\n\n[Screenshot of results captured (${Math.round(ss.size / 1024)}KB)]`;
1332
1338
  }