@tokagent/tokagentos 2.0.34 → 2.0.35

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": "@tokagent/tokagentos",
3
- "version": "2.0.34",
3
+ "version": "2.0.35",
4
4
  "description": "tokagentOS CLI - Create and upgrade tokagentOS project templates",
5
5
  "type": "module",
6
6
  "bin": {
@@ -310,6 +310,67 @@ async function checkDbShadow() {
310
310
 
311
311
  await checkDbShadow();
312
312
 
313
+ /**
314
+ * No-provider-configured check.
315
+ *
316
+ * Failure mode observed in the field: the user clears all direct provider
317
+ * keys (ANTHROPIC_API_KEY, OPENROUTER_API_KEY, etc.) intending to run in
318
+ * x402-only mode, but doesn't set BILLING_CHAT_KEY. The runtime then has
319
+ * NO TEXT_SMALL/TEXT_LARGE provider registered — every chat request fails
320
+ * with `[router] No provider registered for TEXT_SMALL`, which is opaque
321
+ * about the actual fix (mint a sk-ai-* key and set BILLING_CHAT_KEY).
322
+ *
323
+ * Wire (see core-plugins.ts:configureBillingChatMirror): when both
324
+ * BILLING_CHAT_KEY and TOKAGENT_GATEWAY_URL are set, OPENAI_API_KEY +
325
+ * OPENAI_BASE_URL are mirrored onto the gateway and plugin-openai loads
326
+ * as the gateway provider. Either one alone is a no-op.
327
+ */
328
+ const DIRECT_LLM_KEYS = [
329
+ "ANTHROPIC_API_KEY",
330
+ "OPENAI_API_KEY",
331
+ "OPENROUTER_API_KEY",
332
+ "GOOGLE_GENERATIVE_AI_API_KEY",
333
+ "GOOGLE_API_KEY",
334
+ "GEMINI_API_KEY",
335
+ "GROQ_API_KEY",
336
+ "XAI_API_KEY",
337
+ "DEEPSEEK_API_KEY",
338
+ "MISTRAL_API_KEY",
339
+ "TOGETHER_API_KEY",
340
+ "OLLAMA_BASE_URL",
341
+ ];
342
+ const hasDirectKey = DIRECT_LLM_KEYS.some((k) => env[k]?.trim());
343
+ const hasBillingChatKey = !!env.BILLING_CHAT_KEY?.trim();
344
+ const hasGatewayUrl = !!env.TOKAGENT_GATEWAY_URL?.trim();
345
+ const hasLiteLLM =
346
+ !!env.LITELLM_BASE_URL?.trim() && !!env.LITELLM_API_KEY?.trim();
347
+ if (!hasDirectKey && !hasBillingChatKey && !hasLiteLLM) {
348
+ fail(
349
+ `No LLM provider configured. The agent has nothing to call for chat.\n` +
350
+ ` Pick one of these three paths:\n` +
351
+ `\n` +
352
+ ` [A] Direct provider: set one of ${DIRECT_LLM_KEYS.slice(0, 4).join(", ")},\n` +
353
+ ` etc. in .env. Plugin auto-loads, chat hits the provider directly.\n` +
354
+ `\n` +
355
+ ` [B] x402 billing (Tokamak rail): mint a sk-ai-* key from the billing\n` +
356
+ ` dashboard, then set BILLING_CHAT_KEY=sk-ai-... in .env.\n` +
357
+ ` Open http://localhost:3000/tokagent-billing/v1/billing/dashboard/\n` +
358
+ ` → connect wallet → top up PTON → mint key. Without this, the\n` +
359
+ ` runtime router has zero TEXT_SMALL/TEXT_LARGE providers.\n` +
360
+ `\n` +
361
+ ` [C] LiteLLM proxy: set LITELLM_BASE_URL + LITELLM_API_KEY in .env\n` +
362
+ ` (plus LITELLM_SMALL_MODEL / LITELLM_LARGE_MODEL).`,
363
+ );
364
+ } else if (hasBillingChatKey && !hasGatewayUrl) {
365
+ fail(
366
+ `BILLING_CHAT_KEY is set but TOKAGENT_GATEWAY_URL is not. The billing\n` +
367
+ ` mirror in core-plugins.ts requires BOTH to wire the gateway as an\n` +
368
+ ` OpenAI-compatible provider — set TOKAGENT_GATEWAY_URL to the URL of\n` +
369
+ ` the tokagent-billing-server you're a client of (the hosted default is\n` +
370
+ ` https://billing-service-production-a8e7.up.railway.app).`,
371
+ );
372
+ }
373
+
313
374
  if (hadFailure) {
314
375
  console.error(
315
376
  "\n\x1b[31m[verify-llm-plugins]\x1b[0m One or more LLM-provider checks failed. Chat will not work until this is resolved.\n",
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "version": "1.0.0",
3
- "generatedAt": "2026-05-27T09:21:58.814Z",
3
+ "generatedAt": "2026-05-27T09:29:35.264Z",
4
4
  "repoUrl": "https://github.com/elizaos/eliza",
5
5
  "templates": [
6
6
  {