erosolar-cli 2.1.202 → 2.1.204
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/agents/erosolar-code.rules.json +8 -13
- package/agents/general.rules.json +20 -33
- package/dist/core/agentOrchestrator.d.ts +19 -5
- package/dist/core/agentOrchestrator.d.ts.map +1 -1
- package/dist/core/agentOrchestrator.js +221 -245
- package/dist/core/agentOrchestrator.js.map +1 -1
- package/dist/core/errors/errorTypes.d.ts +0 -6
- package/dist/core/errors/errorTypes.d.ts.map +1 -1
- package/dist/core/errors/errorTypes.js +0 -26
- package/dist/core/errors/errorTypes.js.map +1 -1
- package/dist/core/errors/safetyValidator.d.ts +1 -40
- package/dist/core/errors/safetyValidator.d.ts.map +1 -1
- package/dist/core/errors/safetyValidator.js +1 -145
- package/dist/core/errors/safetyValidator.js.map +1 -1
- package/dist/core/reliabilityPrompt.d.ts.map +1 -1
- package/dist/core/reliabilityPrompt.js +10 -11
- package/dist/core/reliabilityPrompt.js.map +1 -1
- package/dist/providers/openaiResponsesProvider.d.ts +0 -5
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
- package/dist/providers/openaiResponsesProvider.js +1 -38
- package/dist/providers/openaiResponsesProvider.js.map +1 -1
- package/dist/shell/interactiveShell.d.ts +0 -3
- package/dist/shell/interactiveShell.d.ts.map +1 -1
- package/dist/shell/interactiveShell.js +47 -73
- package/dist/shell/interactiveShell.js.map +1 -1
- package/dist/ui/PromptController.d.ts +1 -0
- package/dist/ui/PromptController.d.ts.map +1 -1
- package/dist/ui/PromptController.js +3 -0
- package/dist/ui/PromptController.js.map +1 -1
- package/dist/ui/UnifiedUIRenderer.d.ts +2 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
- package/dist/ui/UnifiedUIRenderer.js +8 -1
- package/dist/ui/UnifiedUIRenderer.js.map +1 -1
- package/package.json +1 -1
- package/dist/core/LazyLoader.d.ts +0 -129
- package/dist/core/LazyLoader.d.ts.map +0 -1
- package/dist/core/LazyLoader.js +0 -240
- package/dist/core/LazyLoader.js.map +0 -1
- package/dist/core/alphaZeroOrchestrator.d.ts +0 -140
- package/dist/core/alphaZeroOrchestrator.d.ts.map +0 -1
- package/dist/core/alphaZeroOrchestrator.js +0 -418
- package/dist/core/alphaZeroOrchestrator.js.map +0 -1
- package/dist/core/checkpoint.d.ts +0 -76
- package/dist/core/checkpoint.d.ts.map +0 -1
- package/dist/core/checkpoint.js +0 -278
- package/dist/core/checkpoint.js.map +0 -1
- package/dist/core/costTracker.d.ts +0 -87
- package/dist/core/costTracker.d.ts.map +0 -1
- package/dist/core/costTracker.js +0 -285
- package/dist/core/costTracker.js.map +0 -1
- package/dist/core/errors/errorUtils.d.ts +0 -87
- package/dist/core/errors/errorUtils.d.ts.map +0 -1
- package/dist/core/errors/errorUtils.js +0 -158
- package/dist/core/errors/errorUtils.js.map +0 -1
- package/dist/core/errors/promptBlockErrors.d.ts +0 -9
- package/dist/core/errors/promptBlockErrors.d.ts.map +0 -1
- package/dist/core/errors/promptBlockErrors.js +0 -54
- package/dist/core/errors/promptBlockErrors.js.map +0 -1
- package/dist/core/isolatedVerifier.d.ts +0 -40
- package/dist/core/isolatedVerifier.d.ts.map +0 -1
- package/dist/core/isolatedVerifier.js +0 -129
- package/dist/core/isolatedVerifier.js.map +0 -1
- package/dist/core/responseVerifier.d.ts +0 -98
- package/dist/core/responseVerifier.d.ts.map +0 -1
- package/dist/core/responseVerifier.js +0 -509
- package/dist/core/responseVerifier.js.map +0 -1
- package/dist/core/securityAssessment.d.ts +0 -91
- package/dist/core/securityAssessment.d.ts.map +0 -1
- package/dist/core/securityAssessment.js +0 -580
- package/dist/core/securityAssessment.js.map +0 -1
- package/dist/core/verification.d.ts +0 -137
- package/dist/core/verification.d.ts.map +0 -1
- package/dist/core/verification.js +0 -323
- package/dist/core/verification.js.map +0 -1
|
@@ -14,7 +14,6 @@ import { saveActiveProfilePreference, saveModelPreference, loadToolSettings, sav
|
|
|
14
14
|
import { getLearningSummary, getRecentLearning, commitLearning, exportAllLearning, getLearningDir, } from '../core/learningPersistence.js';
|
|
15
15
|
import { buildEnabledToolSet, evaluateToolPermissions, getToolToggleOptions, } from '../capabilities/toolRegistry.js';
|
|
16
16
|
import { detectApiKeyError } from '../core/errors/apiKeyErrors.js';
|
|
17
|
-
import { detectPromptBlockError, } from '../core/errors/promptBlockErrors.js';
|
|
18
17
|
import { detectNetworkError } from '../core/errors/networkErrors.js';
|
|
19
18
|
import { buildWorkspaceContext } from '../workspace.js';
|
|
20
19
|
import { buildInteractiveSystemPrompt } from './systemPrompt.js';
|
|
@@ -181,7 +180,6 @@ export class InteractiveShell {
|
|
|
181
180
|
streamingThoughtBuffer = '';
|
|
182
181
|
statusLineState = null;
|
|
183
182
|
statusMessageOverride = null;
|
|
184
|
-
lastPromptBlockNotice = null;
|
|
185
183
|
inlineCommandActive = false;
|
|
186
184
|
inlinePanelScopeActive = false;
|
|
187
185
|
promptRefreshTimer = null;
|
|
@@ -5540,14 +5538,15 @@ export class InteractiveShell {
|
|
|
5540
5538
|
return;
|
|
5541
5539
|
}
|
|
5542
5540
|
const choice = Number.parseInt(trimmed, 10);
|
|
5543
|
-
|
|
5544
|
-
|
|
5541
|
+
const optionCount = pending.options.length;
|
|
5542
|
+
if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
|
|
5543
|
+
display.showWarning(`Enter a number between 1 and ${optionCount}.`);
|
|
5545
5544
|
this.syncRendererInput();
|
|
5546
5545
|
return;
|
|
5547
5546
|
}
|
|
5548
5547
|
const option = pending.options[choice - 1];
|
|
5549
5548
|
if (!option) {
|
|
5550
|
-
display.showWarning(
|
|
5549
|
+
display.showWarning(`Enter a number between 1 and ${optionCount}.`);
|
|
5551
5550
|
this.syncRendererInput();
|
|
5552
5551
|
return;
|
|
5553
5552
|
}
|
|
@@ -5560,8 +5559,9 @@ export class InteractiveShell {
|
|
|
5560
5559
|
return;
|
|
5561
5560
|
}
|
|
5562
5561
|
const trimmed = input.trim();
|
|
5562
|
+
const optionCount = pending.options.length;
|
|
5563
5563
|
if (!trimmed) {
|
|
5564
|
-
display.showWarning(
|
|
5564
|
+
display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
|
|
5565
5565
|
this.syncRendererInput();
|
|
5566
5566
|
return;
|
|
5567
5567
|
}
|
|
@@ -5578,14 +5578,14 @@ export class InteractiveShell {
|
|
|
5578
5578
|
return;
|
|
5579
5579
|
}
|
|
5580
5580
|
const choice = Number.parseInt(trimmed, 10);
|
|
5581
|
-
if (!Number.isFinite(choice)) {
|
|
5582
|
-
display.showWarning(
|
|
5581
|
+
if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
|
|
5582
|
+
display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
|
|
5583
5583
|
this.syncRendererInput();
|
|
5584
5584
|
return;
|
|
5585
5585
|
}
|
|
5586
5586
|
const preset = pending.options[choice - 1];
|
|
5587
5587
|
if (!preset) {
|
|
5588
|
-
display.showWarning(
|
|
5588
|
+
display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
|
|
5589
5589
|
this.syncRendererInput();
|
|
5590
5590
|
return;
|
|
5591
5591
|
}
|
|
@@ -5623,8 +5623,9 @@ export class InteractiveShell {
|
|
|
5623
5623
|
return;
|
|
5624
5624
|
}
|
|
5625
5625
|
const trimmed = input.trim();
|
|
5626
|
+
const optionCount = pending.options.length;
|
|
5626
5627
|
if (!trimmed) {
|
|
5627
|
-
display.showWarning(
|
|
5628
|
+
display.showWarning(`Enter 1-${optionCount} or "cancel".`);
|
|
5628
5629
|
this.syncRendererInput();
|
|
5629
5630
|
return;
|
|
5630
5631
|
}
|
|
@@ -5636,19 +5637,23 @@ export class InteractiveShell {
|
|
|
5636
5637
|
return;
|
|
5637
5638
|
}
|
|
5638
5639
|
const choice = Number.parseInt(trimmed, 10);
|
|
5639
|
-
if (!Number.isFinite(choice)) {
|
|
5640
|
-
display.showWarning(
|
|
5640
|
+
if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
|
|
5641
|
+
display.showWarning(`Enter 1-${optionCount} or "cancel".`);
|
|
5641
5642
|
this.syncRendererInput();
|
|
5642
5643
|
return;
|
|
5643
5644
|
}
|
|
5644
5645
|
const secret = pending.options[choice - 1];
|
|
5645
5646
|
if (!secret) {
|
|
5646
|
-
display.showWarning(
|
|
5647
|
+
display.showWarning(`Enter 1-${optionCount} or "cancel".`);
|
|
5647
5648
|
this.syncRendererInput();
|
|
5648
5649
|
return;
|
|
5649
5650
|
}
|
|
5650
|
-
this.showInlinePanel([
|
|
5651
|
+
this.showInlinePanel([
|
|
5652
|
+
`Enter new ${secret.label} or "cancel" to keep current value.`,
|
|
5653
|
+
theme.ui.muted('Paste your API key - input is hidden for security.'),
|
|
5654
|
+
]);
|
|
5651
5655
|
this.pendingInteraction = { type: 'secret-input', secret };
|
|
5656
|
+
this.terminalInput.setSecretMode(true);
|
|
5652
5657
|
this.syncRendererInput();
|
|
5653
5658
|
}
|
|
5654
5659
|
async handleSecretInput(input) {
|
|
@@ -5665,6 +5670,7 @@ export class InteractiveShell {
|
|
|
5665
5670
|
if (trimmed.toLowerCase() === 'cancel') {
|
|
5666
5671
|
this.pendingInteraction = null;
|
|
5667
5672
|
this.pendingSecretRetry = null;
|
|
5673
|
+
this.terminalInput.setSecretMode(false);
|
|
5668
5674
|
display.showInfo('Secret unchanged.');
|
|
5669
5675
|
this.clearInlinePanel();
|
|
5670
5676
|
this.syncRendererInput();
|
|
@@ -5691,6 +5697,7 @@ export class InteractiveShell {
|
|
|
5691
5697
|
this.pendingInteraction = null;
|
|
5692
5698
|
this.pendingSecretRetry = null;
|
|
5693
5699
|
}
|
|
5700
|
+
this.terminalInput.setSecretMode(false);
|
|
5694
5701
|
this.clearInlinePanel();
|
|
5695
5702
|
this.syncRendererInput();
|
|
5696
5703
|
}
|
|
@@ -7036,12 +7043,18 @@ Return ONLY JSON array:
|
|
|
7036
7043
|
if (this.renderer) {
|
|
7037
7044
|
this.renderer.hideCompactingStatus();
|
|
7038
7045
|
}
|
|
7039
|
-
//
|
|
7046
|
+
// Format token savings for display
|
|
7047
|
+
const tokenSavingsText = bestTokenSavings >= 1000
|
|
7048
|
+
? `${(bestTokenSavings / 1000).toFixed(1)}k`
|
|
7049
|
+
: String(bestTokenSavings);
|
|
7050
|
+
const percentText = Math.round(bestPercentSavings);
|
|
7051
|
+
// Show the Claude Code style separator with savings info
|
|
7052
|
+
const compactMessage = `Conversation compacted · freed ${tokenSavingsText} tokens (${percentText}%) · ctrl+o for history`;
|
|
7040
7053
|
if (this.renderer) {
|
|
7041
|
-
this.renderer.addCompactBlock('',
|
|
7054
|
+
this.renderer.addCompactBlock('', compactMessage);
|
|
7042
7055
|
}
|
|
7043
7056
|
else {
|
|
7044
|
-
display.showSystemMessage(
|
|
7057
|
+
display.showSystemMessage(`══ ${compactMessage} ═`);
|
|
7045
7058
|
}
|
|
7046
7059
|
this.recordContextCompaction({
|
|
7047
7060
|
timestamp: Date.now(),
|
|
@@ -7372,11 +7385,6 @@ Return ONLY JSON array:
|
|
|
7372
7385
|
display.showError(message);
|
|
7373
7386
|
}
|
|
7374
7387
|
handleProviderError(error, retryAction) {
|
|
7375
|
-
const promptBlock = detectPromptBlockError(error);
|
|
7376
|
-
if (promptBlock) {
|
|
7377
|
-
this.handlePromptBlock(promptBlock);
|
|
7378
|
-
return true;
|
|
7379
|
-
}
|
|
7380
7388
|
const networkIssue = detectNetworkError(error);
|
|
7381
7389
|
if (networkIssue) {
|
|
7382
7390
|
this.handleNetworkIssue(networkIssue, retryAction);
|
|
@@ -7389,53 +7397,34 @@ Return ONLY JSON array:
|
|
|
7389
7397
|
this.handleApiKeyIssue(apiKeyIssue, retryAction);
|
|
7390
7398
|
return true;
|
|
7391
7399
|
}
|
|
7392
|
-
handlePromptBlock(info) {
|
|
7393
|
-
const providerLabel = info.provider ? this.providerLabel(info.provider) : 'The provider';
|
|
7394
|
-
const message = info.message?.trim() || 'Your prompt was blocked by provider safety filters.';
|
|
7395
|
-
const now = Date.now();
|
|
7396
|
-
if (this.lastPromptBlockNotice &&
|
|
7397
|
-
this.lastPromptBlockNotice.message === message &&
|
|
7398
|
-
now - this.lastPromptBlockNotice.at < 3000) {
|
|
7399
|
-
return;
|
|
7400
|
-
}
|
|
7401
|
-
this.lastPromptBlockNotice = { message, at: now };
|
|
7402
|
-
display.showWarning(`${providerLabel} blocked the prompt: ${message}`);
|
|
7403
|
-
display.showSystemMessage('Rephrase with neutral language, avoid sensitive or ambiguous instructions, and try again.');
|
|
7404
|
-
if (info.helpUrl) {
|
|
7405
|
-
display.showSystemMessage(`Provider guidance: ${info.helpUrl}`);
|
|
7406
|
-
}
|
|
7407
|
-
}
|
|
7408
7400
|
handleApiKeyIssue(info, retryAction) {
|
|
7409
7401
|
const secret = info.secret ?? null;
|
|
7410
7402
|
const providerLabel = info.provider ? this.providerLabel(info.provider) : 'the selected provider';
|
|
7411
7403
|
const portalLink = this.getApiKeyPortalLink(secret, info.provider);
|
|
7404
|
+
const isMissing = info.type === 'missing';
|
|
7412
7405
|
if (!secret) {
|
|
7413
7406
|
this.pendingSecretRetry = null;
|
|
7414
|
-
const
|
|
7415
|
-
|
|
7416
|
-
? `An API key is required before using ${providerLabel}.`
|
|
7407
|
+
const baseMessage = isMissing
|
|
7408
|
+
? `API key required for ${providerLabel}.`
|
|
7417
7409
|
: `API authentication failed for ${providerLabel}.`;
|
|
7418
|
-
const
|
|
7419
|
-
|
|
7420
|
-
|
|
7421
|
-
|
|
7422
|
-
}
|
|
7410
|
+
const action = portalLink
|
|
7411
|
+
? `Get a key at ${portalLink} then run /secrets to set it.`
|
|
7412
|
+
: 'Run /secrets to configure it.';
|
|
7413
|
+
display.showWarning(`${baseMessage} ${action}`);
|
|
7423
7414
|
return;
|
|
7424
7415
|
}
|
|
7425
|
-
|
|
7426
|
-
|
|
7427
|
-
|
|
7428
|
-
}
|
|
7429
|
-
const prefix = isMissing
|
|
7430
|
-
? `${secret.label} is required before you can use ${providerLabel}.`
|
|
7431
|
-
: `${secret.label} appears to be invalid for ${providerLabel}.`;
|
|
7432
|
-
display.showWarning(prefix);
|
|
7433
|
-
if (portalLink) {
|
|
7434
|
-
display.showSystemMessage(`Acquire or top up ${secret.label}: ${portalLink}`);
|
|
7435
|
-
}
|
|
7416
|
+
// Show single consolidated error message
|
|
7417
|
+
const action = isMissing ? 'is required' : 'appears invalid';
|
|
7418
|
+
const portalHelp = portalLink ? ` Get one at ${portalLink}` : '';
|
|
7419
|
+
display.showWarning(`${secret.label} ${action} for ${providerLabel}.${portalHelp}`);
|
|
7436
7420
|
this.pendingSecretRetry = retryAction ?? null;
|
|
7437
7421
|
this.pendingInteraction = { type: 'secret-input', secret };
|
|
7438
|
-
this.
|
|
7422
|
+
this.terminalInput.setSecretMode(true);
|
|
7423
|
+
this.showInlinePanel([
|
|
7424
|
+
`Enter new ${secret.label} or "cancel" to abort.`,
|
|
7425
|
+
theme.ui.muted('Paste your API key - input is hidden for security.'),
|
|
7426
|
+
theme.ui.muted('I will retry your request automatically after you set it.'),
|
|
7427
|
+
]);
|
|
7439
7428
|
}
|
|
7440
7429
|
getApiKeyPortalLink(secret, provider) {
|
|
7441
7430
|
const key = secret?.id ?? provider ?? null;
|
|
@@ -7459,21 +7448,6 @@ Return ONLY JSON array:
|
|
|
7459
7448
|
return null;
|
|
7460
7449
|
}
|
|
7461
7450
|
}
|
|
7462
|
-
showSecretGuidance(secret, promptForInput, portalLink) {
|
|
7463
|
-
const lines = [];
|
|
7464
|
-
if (promptForInput) {
|
|
7465
|
-
lines.push(`Enter a new value for ${secret.label} or type "cancel".`);
|
|
7466
|
-
}
|
|
7467
|
-
else {
|
|
7468
|
-
lines.push(`Update the stored value for ${secret.label} or type "cancel".`);
|
|
7469
|
-
}
|
|
7470
|
-
if (portalLink) {
|
|
7471
|
-
lines.push(`Get a fresh key: ${portalLink}`);
|
|
7472
|
-
}
|
|
7473
|
-
lines.push('Paste it here to resume and I will retry the pending action automatically.');
|
|
7474
|
-
lines.push(`Run "/secrets" anytime to manage credentials or export ${secret.envVar}=<value> before launching the CLI.`);
|
|
7475
|
-
display.showSystemMessage(lines.join('\n'));
|
|
7476
|
-
}
|
|
7477
7451
|
colorizeDropdownLine(text, index) {
|
|
7478
7452
|
if (!DROPDOWN_COLORS.length) {
|
|
7479
7453
|
return text;
|