nothumanallowed 13.5.113 → 13.5.114

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": "13.5.113",
3
+ "version": "13.5.114",
4
4
  "description": "NotHumanAllowed — 38 AI agents, 80 tools, Studio (visual agentic workflows). 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": {
@@ -1420,9 +1420,10 @@ export async function cmdUI(args) {
1420
1420
  } else if (provider === 'anthropic') {
1421
1421
  const r = await fetch('https://api.anthropic.com/v1/messages', {
1422
1422
  method: 'POST',
1423
- headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
1423
+ headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01', 'anthropic-beta': 'prompt-caching-2024-07-31' },
1424
1424
  body: JSON.stringify({
1425
- model: model || 'claude-sonnet-4-20250514', max_tokens: 4096, system: enrichedSystemPrompt,
1425
+ model: model || 'claude-sonnet-4-20250514', max_tokens: 4096,
1426
+ system: enrichedSystemPrompt ? [{ type: 'text', text: enrichedSystemPrompt, cache_control: { type: 'ephemeral' } }] : [],
1426
1427
  messages: [{ role: 'user', content: [
1427
1428
  { type: 'image', source: { type: 'base64', media_type: body.imageMimeType, data: body.imageBase64 } },
1428
1429
  { type: 'text', text: imagePrompt },
@@ -1534,9 +1535,10 @@ export async function cmdUI(args) {
1534
1535
  } else if (provider === 'anthropic') {
1535
1536
  const r = await fetch('https://api.anthropic.com/v1/messages', {
1536
1537
  method: 'POST',
1537
- headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01' },
1538
+ headers: { 'Content-Type': 'application/json', 'x-api-key': apiKey, 'anthropic-version': '2023-06-01', 'anthropic-beta': 'prompt-caching-2024-07-31' },
1538
1539
  body: JSON.stringify({
1539
- model: model || 'claude-sonnet-4-20250514', max_tokens: 8192, system: enrichedSystemPrompt,
1540
+ model: model || 'claude-sonnet-4-20250514', max_tokens: 8192,
1541
+ system: enrichedSystemPrompt ? [{ type: 'text', text: enrichedSystemPrompt, cache_control: { type: 'ephemeral' } }] : [],
1540
1542
  messages: [{ role: 'user', content: [
1541
1543
  { type: 'document', source: { type: 'base64', media_type: 'application/pdf', data: body.pdfBase64 } },
1542
1544
  { type: 'text', text: pdfPrompt },
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 = '13.5.113';
8
+ export const VERSION = '13.5.114';
9
9
  export const BASE_URL = 'https://nothumanallowed.com/cli';
10
10
  export const API_BASE = 'https://nothumanallowed.com/api/v1';
11
11
 
@@ -8,10 +8,15 @@
8
8
  // ── Providers ──────────────────────────────────────────────────────────────
9
9
 
10
10
  export async function callAnthropic(apiKey, model, systemPrompt, userMessage, stream = false, opts = {}) {
11
+ // Use Anthropic prompt caching: system prompt as array with cache_control
12
+ // so the same system prompt is served from cache on repeated calls (~90% saving on input tokens).
13
+ const systemBlocks = systemPrompt
14
+ ? [{ type: 'text', text: systemPrompt, cache_control: { type: 'ephemeral' } }]
15
+ : [];
11
16
  const body = {
12
17
  model: model || 'claude-sonnet-4-20250514',
13
18
  max_tokens: opts.max_tokens || 8192,
14
- system: systemPrompt,
19
+ system: systemBlocks,
15
20
  messages: [{ role: 'user', content: userMessage }],
16
21
  stream,
17
22
  };
@@ -22,6 +27,7 @@ export async function callAnthropic(apiKey, model, systemPrompt, userMessage, st
22
27
  'Content-Type': 'application/json',
23
28
  'x-api-key': apiKey,
24
29
  'anthropic-version': '2023-06-01',
30
+ 'anthropic-beta': 'prompt-caching-2024-07-31',
25
31
  },
26
32
  body: JSON.stringify(body),
27
33
  });