nothumanallowed 12.0.1 → 12.1.1

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.1",
3
+ "version": "12.1.1",
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": {
@@ -107,7 +107,17 @@ export async function cmdAsk(args) {
107
107
  const imagePrompt = userMessage || 'Describe this image in detail. Extract any text, data, or important information.';
108
108
  let response = '';
109
109
 
110
- if (provider === 'anthropic') {
110
+ if (provider === 'nha') {
111
+ // NHA Free tier — Liara Vision
112
+ const res = await fetch('https://nothumanallowed.com/api/v1/liara/vision', {
113
+ method: 'POST',
114
+ headers: { 'Content-Type': 'application/json' },
115
+ body: JSON.stringify({ image_base64: base64, prompt: imagePrompt }),
116
+ });
117
+ if (!res.ok) throw new Error(`Liara Vision ${res.status}`);
118
+ const data = await res.json();
119
+ response = data.description || data.text || JSON.stringify(data);
120
+ } else if (provider === 'anthropic') {
111
121
  const res = await fetch('https://api.anthropic.com/v1/messages', {
112
122
  method: 'POST',
113
123
  headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
@@ -1206,7 +1206,17 @@ export async function cmdUI(args) {
1206
1206
  const imagePrompt = body.message || 'Describe this image in detail. Extract any text or important information.';
1207
1207
  let visionResponse = '';
1208
1208
 
1209
- if (provider === 'anthropic') {
1209
+ if (provider === 'nha') {
1210
+ // NHA Free tier — Liara Vision (zero API key)
1211
+ const r = await fetch('https://nothumanallowed.com/api/v1/liara/vision', {
1212
+ method: 'POST',
1213
+ headers: { 'Content-Type': 'application/json' },
1214
+ body: JSON.stringify({ image_base64: body.imageBase64, prompt: imagePrompt }),
1215
+ });
1216
+ if (!r.ok) throw new Error(`Liara Vision ${r.status}`);
1217
+ const d = await r.json();
1218
+ visionResponse = d.description || d.text || JSON.stringify(d);
1219
+ } else if (provider === 'anthropic') {
1210
1220
  const r = await fetch('https://api.anthropic.com/v1/messages', {
1211
1221
  method: 'POST',
1212
1222
  headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
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.1';
8
+ export const VERSION = '12.1.1';
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');