nothumanallowed 9.3.12 → 9.3.13

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.12",
3
+ "version": "9.3.13",
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/config.mjs CHANGED
@@ -283,6 +283,8 @@ export function setConfigValue(key, value) {
283
283
  'my-role': 'profile.role',
284
284
  'role': 'profile.role',
285
285
  'profile-notes': 'profile.notes',
286
+ 'language': 'language',
287
+ 'lang': 'language',
286
288
  };
287
289
 
288
290
  const resolved = aliases[key] || key;
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.12';
8
+ export const VERSION = '9.3.13';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -612,7 +612,7 @@ async function launchBrowser() {
612
612
  await ws.send('Page.addScriptToEvaluateOnNewDocument', {
613
613
  source: `
614
614
  Object.defineProperty(navigator, 'webdriver', { get: () => false });
615
- Object.defineProperty(navigator, 'languages', { get: () => ['en-US', 'en'] });
615
+ Object.defineProperty(navigator, 'languages', { get: () => ['it-IT', 'it', 'en-US', 'en'] });
616
616
  Object.defineProperty(navigator, 'plugins', { get: () => [1, 2, 3, 4, 5] });
617
617
  window.chrome = { runtime: {} };
618
618
  `,
@@ -73,8 +73,6 @@ export const DESTRUCTIVE_ACTIONS = new Set([
73
73
  * Callers replace {{TODAY}} and {{TIMEZONE}} and append their own persona.
74
74
  */
75
75
  export const TOOL_DEFINITIONS = `
76
- IMPORTANT — LANGUAGE RULE: Detect the language of the user's CURRENT message and respond ENTIRELY in that same language. English message = English response. Italian message = Italian response. Do NOT default to Italian just because the user profile or timezone is Italian. Match the language of what the user JUST wrote, not the system context.
77
-
78
76
  You have access to the following tools. When the user's message requires an action,
79
77
  output EXACTLY ONE fenced JSON block per action:
80
78
 
@@ -346,7 +344,7 @@ RULES:
346
344
  - Dates: today is {{TODAY}}. Infer relative dates from this.
347
345
  - The user's timezone is {{TIMEZONE}}.
348
346
  - CRITICAL: when creating calendar events, always use LOCAL time in format "YYYY-MM-DDTHH:MM:SS" WITHOUT any Z suffix or timezone offset.
349
- - LANGUAGE: Respond in the language of the user's LAST message. Not the profile language, not the timezone the actual message language.
347
+ - LANGUAGE: Respond in {{LANGUAGE}}. All conversational text, explanations, and descriptions must be in {{LANGUAGE}}. Tool names and JSON blocks remain in English.
350
348
  `.trim();
351
349
 
352
350
  // ── Action Parser ────────────────────────────────────────────────────────────
@@ -498,9 +496,23 @@ export function buildSystemPrompt(persona, personaDescription, config, initialCo
498
496
  const today = new Date().toISOString().split('T')[0];
499
497
  const tz = Intl.DateTimeFormat().resolvedOptions().timeZone;
500
498
 
499
+ // Detect system language from locale
500
+ const locale = Intl.DateTimeFormat().resolvedOptions().locale || 'en';
501
+ const langCode = locale.split('-')[0];
502
+ const LANG_MAP = {
503
+ en: 'English', it: 'Italian', es: 'Spanish', fr: 'French', de: 'German',
504
+ pt: 'Portuguese', nl: 'Dutch', pl: 'Polish', ru: 'Russian', ja: 'Japanese',
505
+ ko: 'Korean', zh: 'Chinese', ar: 'Arabic', hi: 'Hindi', tr: 'Turkish',
506
+ sv: 'Swedish', da: 'Danish', no: 'Norwegian', fi: 'Finnish', cs: 'Czech',
507
+ ro: 'Romanian', hu: 'Hungarian', el: 'Greek', th: 'Thai', vi: 'Vietnamese',
508
+ uk: 'Ukrainian', he: 'Hebrew', id: 'Indonesian', ms: 'Malay',
509
+ };
510
+ const language = config?.language || LANG_MAP[langCode] || 'English';
511
+
501
512
  let prompt = TOOL_DEFINITIONS
502
513
  .replace('{{TODAY}}', today)
503
- .replace('{{TIMEZONE}}', tz);
514
+ .replace('{{TIMEZONE}}', tz)
515
+ .replace(/\{\{LANGUAGE\}\}/g, language);
504
516
 
505
517
  prompt += `\n\n${personaDescription}`;
506
518
 
@@ -520,7 +532,7 @@ export function buildSystemPrompt(persona, personaDescription, config, initialCo
520
532
  if (profile.notes) fields.push(`Notes: ${profile.notes}`);
521
533
 
522
534
  if (fields.length > 0) {
523
- prompt += `\n\n--- USER PROFILE (use this for personal references like "my home", "my city", etc.) ---\n${fields.join('\n')}\nNOTE: The profile above is for context only. It does NOT determine your response language. Always respond in the language of the user's message.`;
535
+ prompt += `\n\n--- USER PROFILE (use this for personal references like "my home", "my city", etc.) ---\n${fields.join('\n')}`;
524
536
  }
525
537
  }
526
538