nothumanallowed 12.0.0 → 12.1.0

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": "12.0.0",
3
+ "version": "12.1.0",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools. Email, calendar, browser automation, screen capture, canvas, cron/heartbeat, Alexandria E2E messaging, GitHub, Notion, Slack, voice chat, free AI (Liara), 28 languages. 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 = '12.0.0';
8
+ export const VERSION = '12.1.0';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -341,8 +341,26 @@ export async function callLLM(config, systemPrompt, userMessage, opts = {}) {
341
341
  export async function callLLMVision(config, systemPrompt, userMessage, media) {
342
342
  const provider = config.llm.provider || 'anthropic';
343
343
  const model = config.llm.model || null;
344
+
345
+ // NHA Free tier — use Liara Vision (no API key needed)
346
+ if (provider === 'nha') {
347
+ const { base64, mimeType } = media;
348
+ if (!base64) throw new Error('media.base64 required for vision');
349
+ const res = await fetch('https://nothumanallowed.com/api/v1/liara/vision', {
350
+ method: 'POST',
351
+ headers: { 'Content-Type': 'application/json' },
352
+ body: JSON.stringify({ image_base64: base64, prompt: userMessage || 'Describe this image in detail.' }),
353
+ });
354
+ if (!res.ok) {
355
+ const err = await res.text().catch(() => '');
356
+ throw new Error(`Liara Vision ${res.status}: ${err.slice(0, 200)}`);
357
+ }
358
+ const data = await res.json();
359
+ return data.description || data.text || JSON.stringify(data);
360
+ }
361
+
344
362
  const apiKey = getApiKey(config, provider);
345
- if (!apiKey) throw new Error(`No API key for ${provider}. Vision requires Claude, GPT-4, or Gemini.`);
363
+ if (!apiKey) throw new Error(`No API key for ${provider}. Vision requires Claude, GPT-4, Gemini, or NHA Free (nha config set provider nha).`);
346
364
 
347
365
  const { base64, mimeType } = media;
348
366
  if (!base64 || !mimeType) throw new Error('media.base64 and media.mimeType are required');
@@ -1939,10 +1939,3 @@ export async function executeTool(action, params, config) {
1939
1939
  return `Unknown action: ${action}`;
1940
1940
  }
1941
1941
  }
1942
-
1943
- function formatFileSize(bytes) {
1944
- if (bytes === 0) return '0 B';
1945
- const units = ['B', 'KB', 'MB', 'GB', 'TB'];
1946
- const i = Math.floor(Math.log(bytes) / Math.log(1024));
1947
- return `${(bytes / Math.pow(1024, i)).toFixed(i > 0 ? 1 : 0)} ${units[i]}`;
1948
- }