erosolar-cli 2.1.206 → 2.1.210
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/dist/contracts/agent-profiles.schema.json +6 -6
- package/dist/contracts/agent-schemas.json +3 -3
- package/dist/contracts/unified-schema.json +2 -2
- package/dist/core/agent.d.ts +2 -0
- package/dist/core/agent.d.ts.map +1 -1
- package/dist/core/agent.js +14 -5
- package/dist/core/agent.js.map +1 -1
- package/dist/core/agentOrchestrator.d.ts.map +1 -1
- package/dist/core/agentOrchestrator.js +17 -5
- package/dist/core/agentOrchestrator.js.map +1 -1
- package/dist/core/preferences.js +1 -1
- package/dist/core/preferences.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +9 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +59 -0
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/tools/editTools.d.ts.map +1 -1
- package/dist/tools/editTools.js +63 -0
- package/dist/tools/editTools.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +6 -5
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/package.json +1 -1
|
@@ -463,9 +463,68 @@ export class InteractiveShell {
|
|
|
463
463
|
else {
|
|
464
464
|
display.stream(`\n${lines}\n`);
|
|
465
465
|
}
|
|
466
|
+
// Check if the current provider's API key is missing and show directions
|
|
467
|
+
await this.checkAndShowApiKeyWarning();
|
|
466
468
|
// Keep UI pinned; no scrollback banners
|
|
467
469
|
this.requestPromptRefresh(true);
|
|
468
470
|
}
|
|
471
|
+
/**
|
|
472
|
+
* Check if the current provider's API key is configured.
|
|
473
|
+
* If not, show a warning with directions on how to get one.
|
|
474
|
+
*/
|
|
475
|
+
async checkAndShowApiKeyWarning() {
|
|
476
|
+
const provider = this.sessionState.provider;
|
|
477
|
+
const apiKeyEnvVar = this.getApiKeyEnvVarForProvider(provider);
|
|
478
|
+
if (!apiKeyEnvVar) {
|
|
479
|
+
// Provider doesn't require an API key (e.g., Ollama)
|
|
480
|
+
return;
|
|
481
|
+
}
|
|
482
|
+
const hasKey = process.env[apiKeyEnvVar]?.trim();
|
|
483
|
+
if (hasKey) {
|
|
484
|
+
return;
|
|
485
|
+
}
|
|
486
|
+
const url = this.getApiKeyPortalLink(null, provider);
|
|
487
|
+
const providerLabel = this.providerLabel(provider);
|
|
488
|
+
const warning = [
|
|
489
|
+
'',
|
|
490
|
+
theme.warning(`⚠️ ${providerLabel} API key not configured`),
|
|
491
|
+
'',
|
|
492
|
+
` To use ${this.sessionState.model}, you need a ${providerLabel} API key.`,
|
|
493
|
+
'',
|
|
494
|
+
` 1. Get your API key at: ${theme.accent(url || 'the provider\'s website')}`,
|
|
495
|
+
` 2. Run ${theme.info('/secrets')} to configure it`,
|
|
496
|
+
` 3. Or set ${theme.bold(apiKeyEnvVar)} in your environment`,
|
|
497
|
+
'',
|
|
498
|
+
].join('\n');
|
|
499
|
+
if (this.renderer) {
|
|
500
|
+
this.renderer.addEvent('banner', warning);
|
|
501
|
+
await this.renderer.flushEvents();
|
|
502
|
+
}
|
|
503
|
+
else {
|
|
504
|
+
display.stream(warning);
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Get the environment variable name for a provider's API key.
|
|
509
|
+
*/
|
|
510
|
+
getApiKeyEnvVarForProvider(provider) {
|
|
511
|
+
switch (provider) {
|
|
512
|
+
case 'openai':
|
|
513
|
+
return 'OPENAI_API_KEY';
|
|
514
|
+
case 'anthropic':
|
|
515
|
+
return 'ANTHROPIC_API_KEY';
|
|
516
|
+
case 'deepseek':
|
|
517
|
+
return 'DEEPSEEK_API_KEY';
|
|
518
|
+
case 'xai':
|
|
519
|
+
return 'XAI_API_KEY';
|
|
520
|
+
case 'google':
|
|
521
|
+
return 'GEMINI_API_KEY';
|
|
522
|
+
case 'ollama':
|
|
523
|
+
return null; // Ollama doesn't require an API key
|
|
524
|
+
default:
|
|
525
|
+
return null;
|
|
526
|
+
}
|
|
527
|
+
}
|
|
469
528
|
describeSessionLabel() {
|
|
470
529
|
if (this.sessionRestoreConfig.mode === 'autosave')
|
|
471
530
|
return 'resume (autosave)';
|