nothumanallowed 13.5.112 → 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 +1 -1
- package/src/commands/ui.mjs +6 -4
- package/src/constants.mjs +1 -1
- package/src/services/llm.mjs +7 -1
- package/src/services/web-ui.mjs +7 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nothumanallowed",
|
|
3
|
-
"version": "13.5.
|
|
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": {
|
package/src/commands/ui.mjs
CHANGED
|
@@ -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,
|
|
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,
|
|
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.
|
|
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
|
|
package/src/services/llm.mjs
CHANGED
|
@@ -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:
|
|
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
|
});
|
package/src/services/web-ui.mjs
CHANGED
|
@@ -4871,7 +4871,13 @@ function _doGenerateXLSX() {
|
|
|
4871
4871
|
function renderStudioResult() {
|
|
4872
4872
|
var el = document.getElementById('studioResult');
|
|
4873
4873
|
if (!el) return;
|
|
4874
|
-
if (!studioState.result) {
|
|
4874
|
+
if (!studioState.result) {
|
|
4875
|
+
el.style.display = 'none';
|
|
4876
|
+
var _xb = document.getElementById('studioInlineXlsxBtn'); if (_xb) _xb.style.display = 'none';
|
|
4877
|
+
var _cb = document.getElementById('studioInlineCsvBtn'); if (_cb) _cb.style.display = 'none';
|
|
4878
|
+
var _pb = document.getElementById('studioInlinePdfBtn'); if (_pb) _pb.style.display = 'none';
|
|
4879
|
+
return;
|
|
4880
|
+
}
|
|
4875
4881
|
el.style.display = 'block';
|
|
4876
4882
|
var hasCanvas = !!(studioState.canvas);
|
|
4877
4883
|
var body = hasCanvas
|