nothumanallowed 9.3.17 → 9.3.19

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.17",
3
+ "version": "9.3.19",
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/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.17';
8
+ export const VERSION = '9.3.19';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1014,13 +1014,29 @@ export async function browserExtract(options = {}) {
1014
1014
  export async function browserEval(code, options = {}) {
1015
1015
  const browser = await getBrowser();
1016
1016
 
1017
- const result = await browser.ws.send('Runtime.evaluate', {
1018
- expression: code,
1017
+ // Auto-wrap object literals: {key: val} → ({key: val}) to avoid block/label ambiguity
1018
+ let expression = code.trim();
1019
+ if (expression.startsWith('{') && !expression.startsWith('{(')) {
1020
+ expression = `(${expression})`;
1021
+ }
1022
+
1023
+ let result = await browser.ws.send('Runtime.evaluate', {
1024
+ expression,
1019
1025
  returnByValue: true,
1020
1026
  awaitPromise: options.awaitPromise !== false,
1021
1027
  generatePreview: true,
1022
1028
  }, COMMAND_TIMEOUT_MS);
1023
1029
 
1030
+ // If SyntaxError, retry with IIFE wrapper
1031
+ if (result.exceptionDetails?.exception?.description?.includes('SyntaxError')) {
1032
+ result = await browser.ws.send('Runtime.evaluate', {
1033
+ expression: `(() => { return (${code.trim()}); })()`,
1034
+ returnByValue: true,
1035
+ awaitPromise: options.awaitPromise !== false,
1036
+ generatePreview: true,
1037
+ }, COMMAND_TIMEOUT_MS);
1038
+ }
1039
+
1024
1040
  if (result.exceptionDetails) {
1025
1041
  const errMsg = result.exceptionDetails.exception?.description
1026
1042
  || result.exceptionDetails.text
@@ -272,7 +272,7 @@ TOOLS:
272
272
  47. web_search(query: string, deep?: boolean, screenshot?: boolean)
273
273
  Search the web using DuckDuckGo. Returns titles, URLs, and snippets.
274
274
  Set deep=true to also fetch and extract the top 3 pages' full content (slower but more detailed).
275
- Set screenshot=true to also render the search results as a visual page and capture a screenshot (useful when the user asks to "see" results or wants a screenshot of search results).
275
+ Set screenshot=true when the user asks for a screenshot/image of the results — this renders results as a visual page and captures a screenshot. ALWAYS set screenshot=true if the user mentions "screenshot", "screen", "immagine", "foto", "mostra", or "vedi" in relation to search results.
276
276
  ALWAYS use this for ANY web search request ("search for X", "find X", "look up X", "cerca X").
277
277
  Do NOT open Google/Bing in the browser for searches — use this tool instead. It's faster and never gets blocked.
278
278