nothumanallowed 9.3.18 → 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 +1 -1
- package/src/constants.mjs +1 -1
- package/src/services/browser-engine.mjs +18 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "9.3.
|
|
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.
|
|
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
|
-
|
|
1018
|
-
|
|
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
|