erosolar-cli 2.1.203 โ†’ 2.1.205

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.
Files changed (52) hide show
  1. package/dist/core/agentOrchestrator.d.ts +16 -4
  2. package/dist/core/agentOrchestrator.d.ts.map +1 -1
  3. package/dist/core/agentOrchestrator.js +181 -61
  4. package/dist/core/agentOrchestrator.js.map +1 -1
  5. package/dist/core/errors/errorTypes.d.ts +0 -6
  6. package/dist/core/errors/errorTypes.d.ts.map +1 -1
  7. package/dist/core/errors/errorTypes.js +0 -26
  8. package/dist/core/errors/errorTypes.js.map +1 -1
  9. package/dist/shell/interactiveShell.d.ts +0 -5
  10. package/dist/shell/interactiveShell.d.ts.map +1 -1
  11. package/dist/shell/interactiveShell.js +45 -205
  12. package/dist/shell/interactiveShell.js.map +1 -1
  13. package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -1
  14. package/dist/ui/UnifiedUIRenderer.js +6 -3
  15. package/dist/ui/UnifiedUIRenderer.js.map +1 -1
  16. package/package.json +1 -1
  17. package/dist/core/LazyLoader.d.ts +0 -129
  18. package/dist/core/LazyLoader.d.ts.map +0 -1
  19. package/dist/core/LazyLoader.js +0 -240
  20. package/dist/core/LazyLoader.js.map +0 -1
  21. package/dist/core/alphaZeroOrchestrator.d.ts +0 -140
  22. package/dist/core/alphaZeroOrchestrator.d.ts.map +0 -1
  23. package/dist/core/alphaZeroOrchestrator.js +0 -418
  24. package/dist/core/alphaZeroOrchestrator.js.map +0 -1
  25. package/dist/core/checkpoint.d.ts +0 -76
  26. package/dist/core/checkpoint.d.ts.map +0 -1
  27. package/dist/core/checkpoint.js +0 -278
  28. package/dist/core/checkpoint.js.map +0 -1
  29. package/dist/core/costTracker.d.ts +0 -87
  30. package/dist/core/costTracker.d.ts.map +0 -1
  31. package/dist/core/costTracker.js +0 -285
  32. package/dist/core/costTracker.js.map +0 -1
  33. package/dist/core/isolatedVerifier.d.ts +0 -40
  34. package/dist/core/isolatedVerifier.d.ts.map +0 -1
  35. package/dist/core/isolatedVerifier.js +0 -129
  36. package/dist/core/isolatedVerifier.js.map +0 -1
  37. package/dist/core/responseVerifier.d.ts +0 -98
  38. package/dist/core/responseVerifier.d.ts.map +0 -1
  39. package/dist/core/responseVerifier.js +0 -509
  40. package/dist/core/responseVerifier.js.map +0 -1
  41. package/dist/core/securityAssessment.d.ts +0 -91
  42. package/dist/core/securityAssessment.d.ts.map +0 -1
  43. package/dist/core/securityAssessment.js +0 -580
  44. package/dist/core/securityAssessment.js.map +0 -1
  45. package/dist/core/verification.d.ts +0 -137
  46. package/dist/core/verification.d.ts.map +0 -1
  47. package/dist/core/verification.js +0 -323
  48. package/dist/core/verification.js.map +0 -1
  49. package/dist/tools/softwareEngineeringTools.d.ts +0 -7
  50. package/dist/tools/softwareEngineeringTools.d.ts.map +0 -1
  51. package/dist/tools/softwareEngineeringTools.js +0 -338
  52. package/dist/tools/softwareEngineeringTools.js.map +0 -1
@@ -34,7 +34,6 @@ import { classifyTaskType } from '../core/alphaZeroEngine.js';
34
34
  import { analyzeImprovementOpportunities, runSelfImprovementCycle, getImprovementSummary, runAutonomousImprovement, requestAutoImprovementStop, getAutoImprovementState, emergencyRollback, } from '../core/selfImprovement.js';
35
35
  import { listAvailablePlugins } from '../plugins/index.js';
36
36
  import { isValidSourceRepo, getRepoName, analyzeSource, runSelfEvolution, stopEvolution, getEvolutionStatus, emergencyEvolutionRollback, learnSourcePatterns, generateFix, } from '../core/selfEvolution.js';
37
- import { analyzeTokenUsage, discoverModularTargets, getModularStatusDisplay, generateContextOptimizations, getGuidelines, deleteGuideline, getPendingActions, executeModularAction, } from '../core/alphaZeroModular.js';
38
37
  import { generateTestFlows, detectBugs, detectUIUpdates, saveTestFlows, saveBugReports, saveUIUpdates, getTestFlowStatus, } from '../core/intelligentTestFlows.js';
39
38
  import { PromptController } from '../ui/PromptController.js';
40
39
  import { enterStreamingMode, exitStreamingMode, isStreamingMode } from '../ui/globalWriteLock.js';
@@ -802,7 +801,7 @@ export class InteractiveShell {
802
801
  '/plugins',
803
802
  '/skills',
804
803
  // Self-improvement
805
- '/evolve', '/modular', '/a0',
804
+ '/evolve',
806
805
  '/learn', '/improve',
807
806
  '/test', '/tests',
808
807
  // Metrics
@@ -2542,10 +2541,6 @@ export class InteractiveShell {
2542
2541
  case '/evolve':
2543
2542
  void this.handleEvolveCommand(input);
2544
2543
  break;
2545
- case '/modular':
2546
- case '/a0':
2547
- void this.handleModularCommand(input);
2548
- break;
2549
2544
  case '/test':
2550
2545
  case '/tests':
2551
2546
  void this.handleTestCommand(input);
@@ -3788,157 +3783,9 @@ export class InteractiveShell {
3788
3783
  display.showSystemMessage(lines.join('\n'));
3789
3784
  return;
3790
3785
  }
3791
- // ========== MODULAR / TOKEN OPTIMIZATION COMMANDS ==========
3792
- if (subcommand === 'tokens') {
3793
- display.showSystemMessage(theme.gradient.primary('๐Ÿ” Analyzing Token Usage...'));
3794
- display.showSystemMessage('');
3795
- const analysis = analyzeTokenUsage(this.workingDir);
3796
- const lines = [];
3797
- lines.push(`Total Tokens: ${theme.bold(analysis.totalTokens.toLocaleString())}`);
3798
- lines.push('');
3799
- lines.push(theme.bold('By Category:'));
3800
- for (const [category, tokens] of Object.entries(analysis.byCategory)) {
3801
- const pct = ((tokens / analysis.totalTokens) * 100).toFixed(1);
3802
- const bar = 'โ–ˆ'.repeat(Math.floor(Number(pct) / 5)) + 'โ–‘'.repeat(20 - Math.floor(Number(pct) / 5));
3803
- lines.push(` ${category.padEnd(15)} ${bar} ${tokens.toLocaleString().padStart(8)} (${pct}%)`);
3804
- }
3805
- lines.push('');
3806
- lines.push(theme.bold('Optimization Opportunities:'));
3807
- for (const opp of analysis.optimizationOpportunities.slice(0, 10)) {
3808
- lines.push(` ${opp.autoFixable ? 'โœ…' : 'โš ๏ธ'} ${opp.target}`);
3809
- lines.push(` Save: ${opp.savings} tokens (${opp.savingsPercent}%)`);
3810
- lines.push(` ${theme.dim(opp.strategy)}`);
3811
- }
3812
- display.showSystemMessage(lines.join('\n'));
3813
- return;
3814
- }
3815
- if (subcommand === 'targets') {
3816
- const targets = discoverModularTargets(this.workingDir);
3817
- const lines = [];
3818
- lines.push(theme.gradient.primary('๐ŸŽฏ Modular Targets'));
3819
- lines.push('');
3820
- lines.push(`Found ${theme.bold(String(targets.length))} targets`);
3821
- lines.push('');
3822
- const byType = {};
3823
- for (const target of targets) {
3824
- if (!byType[target.type])
3825
- byType[target.type] = [];
3826
- byType[target.type].push(target);
3827
- }
3828
- for (const [type, typeTargets] of Object.entries(byType)) {
3829
- lines.push(theme.bold(`${type} (${typeTargets.length}):`));
3830
- for (const target of typeTargets.slice(0, 5)) {
3831
- const issueCount = target.issues.length;
3832
- const icon = issueCount === 0 ? 'โœ…' : issueCount < 3 ? 'โš ๏ธ' : '๐Ÿ”ด';
3833
- lines.push(` ${icon} ${target.name} (${target.tokenCount} tokens)`);
3834
- if (target.issues.length > 0) {
3835
- lines.push(` ${theme.dim(target.issues[0]?.description ?? '')}`);
3836
- }
3837
- }
3838
- if (typeTargets.length > 5) {
3839
- lines.push(` ${theme.dim(`... and ${typeTargets.length - 5} more`)}`);
3840
- }
3841
- lines.push('');
3842
- }
3843
- display.showSystemMessage(lines.join('\n'));
3844
- return;
3845
- }
3846
- if (subcommand === 'optimize') {
3847
- const optimizations = generateContextOptimizations(this.workingDir);
3848
- const lines = [];
3849
- lines.push(theme.gradient.primary('โšก Context Optimization Strategies'));
3850
- lines.push('');
3851
- const totalSavings = optimizations.reduce((sum, o) => sum + o.tokensSaved, 0);
3852
- lines.push(`Total potential savings: ${theme.success(totalSavings.toLocaleString())} tokens`);
3853
- lines.push('');
3854
- for (const opt of optimizations) {
3855
- const icon = opt.impact === 'high' ? '๐Ÿ”ด' : opt.impact === 'medium' ? '๐ŸŸก' : 'โšช';
3856
- lines.push(`${icon} ${theme.bold(opt.strategy)}`);
3857
- lines.push(` ${opt.description}`);
3858
- lines.push(` Savings: ${theme.success(opt.tokensSaved.toLocaleString())} tokens`);
3859
- lines.push(` ${theme.dim(opt.implementation)}`);
3860
- lines.push('');
3861
- }
3862
- display.showSystemMessage(lines.join('\n'));
3863
- return;
3864
- }
3865
- if (subcommand === 'guidelines') {
3866
- const action = args[1]?.toLowerCase();
3867
- if (action === 'add') {
3868
- display.showInfo('Use: /evolve guidelines add <id> <category> <rule>');
3869
- return;
3870
- }
3871
- if (action === 'delete' && args[2]) {
3872
- const result = deleteGuideline(args[2]);
3873
- if (result.success) {
3874
- display.showSuccess(`Deleted guideline: ${args[2]}`);
3875
- }
3876
- else {
3877
- display.showError(result.error ?? 'Failed to delete');
3878
- }
3879
- return;
3880
- }
3881
- const guidelines = getGuidelines();
3882
- const lines = [];
3883
- lines.push(theme.gradient.primary('๐Ÿ“‹ Active Guidelines'));
3884
- lines.push('');
3885
- for (const g of guidelines) {
3886
- const icon = g.severity === 'must' ? '๐Ÿ”ด' : g.severity === 'should' ? '๐ŸŸก' : 'โšช';
3887
- lines.push(`${icon} [${g.category}] ${theme.bold(g.id)}`);
3888
- lines.push(` ${g.rule}`);
3889
- lines.push(` ${theme.dim(g.rationale)}`);
3890
- lines.push('');
3891
- }
3892
- display.showSystemMessage(lines.join('\n'));
3893
- return;
3894
- }
3895
- if (subcommand === 'actions') {
3896
- const actions = getPendingActions();
3897
- const lines = [];
3898
- lines.push(theme.gradient.primary('๐Ÿ“ Pending Actions'));
3899
- lines.push('');
3900
- if (actions.length === 0) {
3901
- lines.push(theme.dim('No pending actions'));
3902
- }
3903
- else {
3904
- for (let i = 0; i < actions.length; i++) {
3905
- const action = actions[i];
3906
- lines.push(`${i + 1}. [${action.type}] ${action.target.name}`);
3907
- lines.push(` Impact: ${action.tokenImpact > 0 ? '+' : ''}${action.tokenImpact} tokens`);
3908
- lines.push(` ${theme.dim(action.changes.slice(0, 60))}`);
3909
- lines.push('');
3910
- }
3911
- lines.push('Run /evolve execute <number> to apply an action');
3912
- }
3913
- display.showSystemMessage(lines.join('\n'));
3914
- return;
3915
- }
3916
- if (subcommand === 'execute') {
3917
- const actionIndex = parseInt(args[1] ?? '', 10) - 1;
3918
- const result = executeModularAction(actionIndex, this.workingDir);
3919
- if (result.success) {
3920
- display.showSuccess('Action executed successfully');
3921
- }
3922
- else {
3923
- display.showError(result.error ?? 'Failed to execute');
3924
- }
3925
- return;
3926
- }
3927
- // Default: show combined status
3786
+ // Default: show status
3928
3787
  const evolveStatus = getEvolutionStatus(this.workingDir);
3929
- const modularStatus = getModularStatusDisplay(this.workingDir);
3930
3788
  display.showSystemMessage(evolveStatus);
3931
- display.showSystemMessage('');
3932
- display.showSystemMessage(modularStatus);
3933
- }
3934
- /**
3935
- * Handle /modular command - redirects to /evolve (merged functionality)
3936
- */
3937
- async handleModularCommand(input) {
3938
- // Redirect /modular to /evolve with the same arguments
3939
- const evolveInput = input.replace(/^\/(?:modular|a0)\s*/i, '/evolve ');
3940
- display.showInfo('Note: /modular is now part of /evolve. Use /evolve tokens, /evolve targets, etc.');
3941
- await this.handleEvolveCommand(evolveInput);
3942
3789
  }
3943
3790
  /**
3944
3791
  * Handle /test command for intelligent test flows
@@ -5538,14 +5385,15 @@ export class InteractiveShell {
5538
5385
  return;
5539
5386
  }
5540
5387
  const choice = Number.parseInt(trimmed, 10);
5541
- if (!Number.isFinite(choice)) {
5542
- display.showWarning('Please enter a valid number.');
5388
+ const optionCount = pending.options.length;
5389
+ if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
5390
+ display.showWarning(`Enter a number between 1 and ${optionCount}.`);
5543
5391
  this.syncRendererInput();
5544
5392
  return;
5545
5393
  }
5546
5394
  const option = pending.options[choice - 1];
5547
5395
  if (!option) {
5548
- display.showWarning('That option is not available.');
5396
+ display.showWarning(`Enter a number between 1 and ${optionCount}.`);
5549
5397
  this.syncRendererInput();
5550
5398
  return;
5551
5399
  }
@@ -5558,8 +5406,9 @@ export class InteractiveShell {
5558
5406
  return;
5559
5407
  }
5560
5408
  const trimmed = input.trim();
5409
+ const optionCount = pending.options.length;
5561
5410
  if (!trimmed) {
5562
- display.showWarning('Enter a number, type "back", or type "cancel".');
5411
+ display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
5563
5412
  this.syncRendererInput();
5564
5413
  return;
5565
5414
  }
@@ -5576,14 +5425,14 @@ export class InteractiveShell {
5576
5425
  return;
5577
5426
  }
5578
5427
  const choice = Number.parseInt(trimmed, 10);
5579
- if (!Number.isFinite(choice)) {
5580
- display.showWarning('Please enter a valid number.');
5428
+ if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
5429
+ display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
5581
5430
  this.syncRendererInput();
5582
5431
  return;
5583
5432
  }
5584
5433
  const preset = pending.options[choice - 1];
5585
5434
  if (!preset) {
5586
- display.showWarning('That option is not available.');
5435
+ display.showWarning(`Enter 1-${optionCount}, "back", or "cancel".`);
5587
5436
  this.syncRendererInput();
5588
5437
  return;
5589
5438
  }
@@ -5621,8 +5470,9 @@ export class InteractiveShell {
5621
5470
  return;
5622
5471
  }
5623
5472
  const trimmed = input.trim();
5473
+ const optionCount = pending.options.length;
5624
5474
  if (!trimmed) {
5625
- display.showWarning('Enter a number or type cancel.');
5475
+ display.showWarning(`Enter 1-${optionCount} or "cancel".`);
5626
5476
  this.syncRendererInput();
5627
5477
  return;
5628
5478
  }
@@ -5634,18 +5484,21 @@ export class InteractiveShell {
5634
5484
  return;
5635
5485
  }
5636
5486
  const choice = Number.parseInt(trimmed, 10);
5637
- if (!Number.isFinite(choice)) {
5638
- display.showWarning('Please enter a valid number.');
5487
+ if (!Number.isFinite(choice) || choice < 1 || choice > optionCount) {
5488
+ display.showWarning(`Enter 1-${optionCount} or "cancel".`);
5639
5489
  this.syncRendererInput();
5640
5490
  return;
5641
5491
  }
5642
5492
  const secret = pending.options[choice - 1];
5643
5493
  if (!secret) {
5644
- display.showWarning('That option is not available.');
5494
+ display.showWarning(`Enter 1-${optionCount} or "cancel".`);
5645
5495
  this.syncRendererInput();
5646
5496
  return;
5647
5497
  }
5648
- this.showInlinePanel([`Enter a new value for ${secret.label} or type "cancel".`]);
5498
+ this.showInlinePanel([
5499
+ `Enter new ${secret.label} or "cancel" to keep current value.`,
5500
+ theme.ui.muted('Paste your API key - input is hidden for security.'),
5501
+ ]);
5649
5502
  this.pendingInteraction = { type: 'secret-input', secret };
5650
5503
  this.terminalInput.setSecretMode(true);
5651
5504
  this.syncRendererInput();
@@ -7037,12 +6890,18 @@ Return ONLY JSON array:
7037
6890
  if (this.renderer) {
7038
6891
  this.renderer.hideCompactingStatus();
7039
6892
  }
7040
- // Show the Claude Code style separator: โ•โ• Conversation compacted ยท ctrl+o for history โ•
6893
+ // Format token savings for display
6894
+ const tokenSavingsText = bestTokenSavings >= 1000
6895
+ ? `${(bestTokenSavings / 1000).toFixed(1)}k`
6896
+ : String(bestTokenSavings);
6897
+ const percentText = Math.round(bestPercentSavings);
6898
+ // Show the Claude Code style separator with savings info
6899
+ const compactMessage = `Conversation compacted ยท freed ${tokenSavingsText} tokens (${percentText}%) ยท ctrl+o for history`;
7041
6900
  if (this.renderer) {
7042
- this.renderer.addCompactBlock('', 'Conversation compacted ยท ctrl+o for history');
6901
+ this.renderer.addCompactBlock('', compactMessage);
7043
6902
  }
7044
6903
  else {
7045
- display.showSystemMessage('โ•โ• Conversation compacted ยท ctrl+o for history โ•');
6904
+ display.showSystemMessage(`โ•โ• ${compactMessage} โ•`);
7046
6905
  }
7047
6906
  this.recordContextCompaction({
7048
6907
  timestamp: Date.now(),
@@ -7389,34 +7248,30 @@ Return ONLY JSON array:
7389
7248
  const secret = info.secret ?? null;
7390
7249
  const providerLabel = info.provider ? this.providerLabel(info.provider) : 'the selected provider';
7391
7250
  const portalLink = this.getApiKeyPortalLink(secret, info.provider);
7251
+ const isMissing = info.type === 'missing';
7392
7252
  if (!secret) {
7393
7253
  this.pendingSecretRetry = null;
7394
- const guidance = 'Run "/secrets" to configure the required API key or export it (e.g., EXPORT KEY=value) before launching the CLI.';
7395
- const baseMessage = info.type === 'missing'
7396
- ? `An API key is required before using ${providerLabel}.`
7254
+ const baseMessage = isMissing
7255
+ ? `API key required for ${providerLabel}.`
7397
7256
  : `API authentication failed for ${providerLabel}.`;
7398
- const portalHelp = portalLink ? ` Get a key: ${portalLink}` : '';
7399
- display.showWarning(`${baseMessage} ${guidance}${portalHelp}`.trim());
7400
- if (portalLink) {
7401
- display.showSystemMessage(`Purchase or generate a key to continue: ${portalLink}`);
7402
- }
7257
+ const action = portalLink
7258
+ ? `Get a key at ${portalLink} then run /secrets to set it.`
7259
+ : 'Run /secrets to configure it.';
7260
+ display.showWarning(`${baseMessage} ${action}`);
7403
7261
  return;
7404
7262
  }
7405
- const isMissing = info.type === 'missing';
7406
- if (!isMissing && info.message && info.message.trim()) {
7407
- display.showWarning(info.message.trim());
7408
- }
7409
- const prefix = isMissing
7410
- ? `${secret.label} is required before you can use ${providerLabel}.`
7411
- : `${secret.label} appears to be invalid for ${providerLabel}.`;
7412
- display.showWarning(prefix);
7413
- if (portalLink) {
7414
- display.showSystemMessage(`Acquire or top up ${secret.label}: ${portalLink}`);
7415
- }
7263
+ // Show single consolidated error message
7264
+ const action = isMissing ? 'is required' : 'appears invalid';
7265
+ const portalHelp = portalLink ? ` Get one at ${portalLink}` : '';
7266
+ display.showWarning(`${secret.label} ${action} for ${providerLabel}.${portalHelp}`);
7416
7267
  this.pendingSecretRetry = retryAction ?? null;
7417
7268
  this.pendingInteraction = { type: 'secret-input', secret };
7418
7269
  this.terminalInput.setSecretMode(true);
7419
- this.showSecretGuidance(secret, isMissing, portalLink);
7270
+ this.showInlinePanel([
7271
+ `Enter new ${secret.label} or "cancel" to abort.`,
7272
+ theme.ui.muted('Paste your API key - input is hidden for security.'),
7273
+ theme.ui.muted('I will retry your request automatically after you set it.'),
7274
+ ]);
7420
7275
  }
7421
7276
  getApiKeyPortalLink(secret, provider) {
7422
7277
  const key = secret?.id ?? provider ?? null;
@@ -7440,21 +7295,6 @@ Return ONLY JSON array:
7440
7295
  return null;
7441
7296
  }
7442
7297
  }
7443
- showSecretGuidance(secret, promptForInput, portalLink) {
7444
- const lines = [];
7445
- if (promptForInput) {
7446
- lines.push(`Enter a new value for ${secret.label} or type "cancel".`);
7447
- }
7448
- else {
7449
- lines.push(`Update the stored value for ${secret.label} or type "cancel".`);
7450
- }
7451
- if (portalLink) {
7452
- lines.push(`Get a fresh key: ${portalLink}`);
7453
- }
7454
- lines.push('Paste it here to resume and I will retry the pending action automatically.');
7455
- lines.push(`Run "/secrets" anytime to manage credentials or export ${secret.envVar}=<value> before launching the CLI.`);
7456
- display.showSystemMessage(lines.join('\n'));
7457
- }
7458
7298
  colorizeDropdownLine(text, index) {
7459
7299
  if (!DROPDOWN_COLORS.length) {
7460
7300
  return text;