Initial release — Crucix Intelligence Engine v2.0.0

26-source OSINT intelligence engine with live Jarvis dashboard,
auto-refresh via SSE, optional LLM layer (4 providers), delta/memory
system, and Telegram breaking news alerts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
calesthio
2026-03-12 23:45:46 -07:00
commit ef2c6470fb
53 changed files with 8709 additions and 0 deletions

49
lib/llm/anthropic.mjs Normal file
View File

@@ -0,0 +1,49 @@
// Anthropic Claude Provider — raw fetch, no SDK
import { LLMProvider } from './provider.mjs';
export class AnthropicProvider extends LLMProvider {
constructor(config) {
super(config);
this.name = 'anthropic';
this.apiKey = config.apiKey;
this.model = config.model || 'claude-sonnet-4-20250514';
}
get isConfigured() { return !!this.apiKey; }
async complete(systemPrompt, userMessage, opts = {}) {
const res = await fetch('https://api.anthropic.com/v1/messages', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-api-key': this.apiKey,
'anthropic-version': '2023-06-01',
},
body: JSON.stringify({
model: this.model,
max_tokens: opts.maxTokens || 4096,
system: systemPrompt,
messages: [{ role: 'user', content: userMessage }],
}),
signal: AbortSignal.timeout(opts.timeout || 60000),
});
if (!res.ok) {
const err = await res.text().catch(() => '');
throw new Error(`Anthropic API ${res.status}: ${err.substring(0, 200)}`);
}
const data = await res.json();
const text = data.content?.[0]?.text || '';
return {
text,
usage: {
inputTokens: data.usage?.input_tokens || 0,
outputTokens: data.usage?.output_tokens || 0,
},
model: data.model || this.model,
};
}
}