nothumanallowed 9.3.14 → 9.3.16

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.14",
3
+ "version": "9.3.16",
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": {
@@ -1001,7 +1001,7 @@ export async function cmdUI(args) {
1001
1001
  if (toolResults.length > 0) {
1002
1002
  // Second LLM call with real tool results — forces the LLM to use actual data
1003
1003
  const toolContext = toolResults.map(t => `[${t.action} result]: ${t.result.slice(0, 3000)}`).join('\n\n');
1004
- const followUp = `The user asked: "${body.message}"\n\nI executed these tools and got REAL results:\n\n${toolContext}\n\nNow respond to the user based ONLY on the REAL data above. Do NOT invent or fabricate any information. Present the actual results clearly.`;
1004
+ const followUp = `The user asked: "${body.message}"\n\nI executed these tools and got REAL results:\n\n${toolContext}\n\nNow respond conversationally based ONLY on the REAL data above. Do NOT output any JSON blocks just natural text.`;
1005
1005
  try {
1006
1006
  fullResponse = await callLLM(config, enrichedSystemPrompt, followUp);
1007
1007
  } catch {
@@ -1256,12 +1256,14 @@ export async function cmdUI(args) {
1256
1256
  let finalResponse = fullResponse;
1257
1257
  if (toolResults.length > 0) {
1258
1258
  const toolContext = toolResults.map(t => `[${t.action} result]: ${t.result.slice(0, 3000)}`).join('\n\n');
1259
- const followUp = `The user asked: "${msg}"\n\nI executed these tools and got REAL results:\n\n${toolContext}\n\nNow respond to the user based ONLY on the REAL data above. Present the actual results clearly.`;
1259
+ const followUp = `The user asked: "${msg}"\n\nI executed these tools and got REAL results:\n\n${toolContext}\n\nNow respond to the user conversationally based ONLY on the REAL data above. Present the results clearly. Do NOT output any JSON blocks — just natural text.`;
1260
1260
  sendSSE('tool_synthesis', {});
1261
1261
  try {
1262
1262
  finalResponse = await callLLMStream(config, enrichedPrompt, followUp, (chunk) => {
1263
1263
  sendSSE('token', { content: chunk });
1264
1264
  });
1265
+ // Strip any JSON blocks the LLM might have emitted anyway
1266
+ finalResponse = finalResponse.replace(/```json[\s\S]*?```/g, '').trim();
1265
1267
  } catch {
1266
1268
  finalResponse = toolResults.map(t => `${t.action}: ${t.result}`).join('\n\n');
1267
1269
  }
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.14';
8
+ export const VERSION = '9.3.16';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -74,14 +74,16 @@ export const DESTRUCTIVE_ACTIONS = new Set([
74
74
  */
75
75
  export const TOOL_DEFINITIONS = `
76
76
  You have access to the following tools. When the user's message requires an action,
77
- output EXACTLY ONE fenced JSON block per action:
77
+ output one or more fenced JSON blocks:
78
78
 
79
79
  \`\`\`json
80
80
  {"action": "<tool_name>", "params": { ... }}
81
81
  \`\`\`
82
82
 
83
- You may include conversational text BEFORE or AFTER the JSON block. If no action
84
- is needed, respond normally without any JSON block.
83
+ You can include multiple JSON blocks in one response for sequential actions.
84
+ You may include conversational text BEFORE, BETWEEN, or AFTER JSON blocks.
85
+ If no action is needed, respond normally without any JSON block.
86
+ CRITICAL: Never output a JSON block as a "suggestion" or "let me try" — every JSON block WILL be executed immediately. Only output a JSON block when you are certain the action should be performed.
85
87
 
86
88
  TOOLS:
87
89
 
@@ -346,6 +348,7 @@ RULES:
346
348
  - The user's timezone is {{TIMEZONE}}.
347
349
  - CRITICAL: when creating calendar events, always use LOCAL time in format "YYYY-MM-DDTHH:MM:SS" WITHOUT any Z suffix or timezone offset.
348
350
  - LANGUAGE: Respond in {{LANGUAGE}}. All conversational text, explanations, and descriptions must be in {{LANGUAGE}}. Tool names and JSON blocks remain in English.
351
+ - BROWSER TIP: When extracting data from a page, prefer browser_js with simple JavaScript over complex CSS selectors. Example: browser_js with code "document.body.innerText.slice(0, 3000)" to get all visible text, then parse it yourself. This is more reliable than guessing CSS selectors.
349
352
  `.trim();
350
353
 
351
354
  // ── Action Parser ────────────────────────────────────────────────────────────