nothumanallowed 11.1.0 → 11.1.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nothumanallowed",
3
- "version": "11.1.0",
3
+ "version": "11.1.2",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 53 tools. Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, GitHub, Notion, Slack, voice chat, 28 languages. Zero-dependency CLI.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -121,11 +121,15 @@ function getOrCreateIdentity() {
121
121
  let id = loadIdentity();
122
122
  if (!id) {
123
123
  id = generateKeypair();
124
- // Use profile name from config if available, otherwise generate default
124
+ // Use profile name from NHA config if available
125
125
  try {
126
- const { loadConfig } = await import('../config.mjs');
127
- const cfg = loadConfig();
128
- id.displayName = cfg.profile?.name || `Agent-${id.fingerprint.slice(0, 6)}`;
126
+ const cfgFile = path.join(NHA_DIR, 'config.json');
127
+ if (fs.existsSync(cfgFile)) {
128
+ const cfg = JSON.parse(fs.readFileSync(cfgFile, 'utf-8'));
129
+ id.displayName = cfg.profile?.name || `Agent-${id.fingerprint.slice(0, 6)}`;
130
+ } else {
131
+ id.displayName = `Agent-${id.fingerprint.slice(0, 6)}`;
132
+ }
129
133
  } catch {
130
134
  id.displayName = `Agent-${id.fingerprint.slice(0, 6)}`;
131
135
  }
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 = '11.1.0';
8
+ export const VERSION = '11.1.2';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -1181,7 +1181,11 @@ export async function executeTool(action, params, config) {
1181
1181
  const result = await be.browserOpen(url, {
1182
1182
  waitForLoad: params.waitForLoad !== false,
1183
1183
  });
1184
- if (result.error) return `Browser error: ${result.message}`;
1184
+ if (result.error) {
1185
+ // Navigate to blank to prevent stale screenshots from previous page
1186
+ try { await be.browserOpen('about:blank', { waitForLoad: false }); } catch {}
1187
+ return `Browser error: ${result.message}`;
1188
+ }
1185
1189
 
1186
1190
  return `Page loaded: "${result.title}"\nURL: ${result.url}`;
1187
1191
  }
@@ -1190,6 +1194,12 @@ export async function executeTool(action, params, config) {
1190
1194
  const be = await import('./browser-engine.mjs');
1191
1195
  if (!be.isBrowserRunning()) return 'No browser open. Use browser_open first.';
1192
1196
 
1197
+ // Check current URL — don't screenshot blank or error pages
1198
+ const currentInfo = await be.browserInfo();
1199
+ if (currentInfo.url === 'about:blank' || !currentInfo.url || currentInfo.url === '') {
1200
+ return 'No page loaded in browser. Use browser_open to navigate to a page first.';
1201
+ }
1202
+
1193
1203
  // Scroll to top before screenshot so user sees the most important content
1194
1204
  await be.browserScroll({ direction: 'top' });
1195
1205
  await new Promise(r => setTimeout(r, 300));