erosolar-cli 1.7.79 → 1.7.80

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 (118) hide show
  1. package/agents/erosolar-code.rules.json +0 -5
  2. package/agents/general.rules.json +0 -5
  3. package/dist/bin/erosolar.js +2 -0
  4. package/dist/bin/erosolar.js.map +1 -1
  5. package/dist/capabilities/filesystemCapability.d.ts.map +1 -1
  6. package/dist/capabilities/filesystemCapability.js +1 -2
  7. package/dist/capabilities/filesystemCapability.js.map +1 -1
  8. package/dist/contracts/agent-schemas.json +12 -20
  9. package/dist/contracts/unified-schema.json +1 -1
  10. package/dist/core/agent.d.ts +3 -38
  11. package/dist/core/agent.d.ts.map +1 -1
  12. package/dist/core/agent.js +8 -283
  13. package/dist/core/agent.js.map +1 -1
  14. package/dist/core/contextManager.js +8 -8
  15. package/dist/core/contextManager.js.map +1 -1
  16. package/dist/core/errors/apiKeyErrors.js +1 -1
  17. package/dist/core/errors/apiKeyErrors.js.map +1 -1
  18. package/dist/core/isolatedVerifier.js +22 -274
  19. package/dist/core/isolatedVerifier.js.map +1 -1
  20. package/dist/core/modelDiscovery.d.ts.map +1 -1
  21. package/dist/core/modelDiscovery.js +28 -23
  22. package/dist/core/modelDiscovery.js.map +1 -1
  23. package/dist/core/secretStore.d.ts +0 -9
  24. package/dist/core/secretStore.d.ts.map +1 -1
  25. package/dist/core/secretStore.js +2 -52
  26. package/dist/core/secretStore.js.map +1 -1
  27. package/dist/core/types.d.ts +1 -9
  28. package/dist/core/types.d.ts.map +1 -1
  29. package/dist/headless/headlessApp.d.ts.map +1 -1
  30. package/dist/headless/headlessApp.js +0 -16
  31. package/dist/headless/headlessApp.js.map +1 -1
  32. package/dist/plugins/providers/google/index.js +2 -3
  33. package/dist/plugins/providers/google/index.js.map +1 -1
  34. package/dist/providers/anthropicProvider.d.ts.map +1 -1
  35. package/dist/providers/anthropicProvider.js +19 -76
  36. package/dist/providers/anthropicProvider.js.map +1 -1
  37. package/dist/providers/googleProvider.d.ts.map +1 -1
  38. package/dist/providers/googleProvider.js +1 -23
  39. package/dist/providers/googleProvider.js.map +1 -1
  40. package/dist/providers/openaiChatCompletionsProvider.d.ts +1 -2
  41. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -1
  42. package/dist/providers/openaiChatCompletionsProvider.js +4 -121
  43. package/dist/providers/openaiChatCompletionsProvider.js.map +1 -1
  44. package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
  45. package/dist/providers/openaiResponsesProvider.js +18 -55
  46. package/dist/providers/openaiResponsesProvider.js.map +1 -1
  47. package/dist/runtime/agentController.d.ts +0 -4
  48. package/dist/runtime/agentController.d.ts.map +1 -1
  49. package/dist/runtime/agentController.js +3 -32
  50. package/dist/runtime/agentController.js.map +1 -1
  51. package/dist/security/persistence-research.d.ts +2 -0
  52. package/dist/security/persistence-research.d.ts.map +1 -1
  53. package/dist/security/persistence-research.js +2 -0
  54. package/dist/security/persistence-research.js.map +1 -1
  55. package/dist/security/security-testing-framework.d.ts +2 -0
  56. package/dist/security/security-testing-framework.d.ts.map +1 -1
  57. package/dist/security/security-testing-framework.js +2 -0
  58. package/dist/security/security-testing-framework.js.map +1 -1
  59. package/dist/shell/bracketedPasteManager.d.ts +5 -8
  60. package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
  61. package/dist/shell/bracketedPasteManager.js +43 -27
  62. package/dist/shell/bracketedPasteManager.js.map +1 -1
  63. package/dist/shell/composableMessage.d.ts +1 -1
  64. package/dist/shell/composableMessage.js +2 -2
  65. package/dist/shell/composableMessage.js.map +1 -1
  66. package/dist/shell/inputProcessor.d.ts +55 -0
  67. package/dist/shell/inputProcessor.d.ts.map +1 -0
  68. package/dist/shell/inputProcessor.js +171 -0
  69. package/dist/shell/inputProcessor.js.map +1 -0
  70. package/dist/shell/interactiveShell.d.ts +48 -7
  71. package/dist/shell/interactiveShell.d.ts.map +1 -1
  72. package/dist/shell/interactiveShell.js +340 -172
  73. package/dist/shell/interactiveShell.js.map +1 -1
  74. package/dist/shell/shellApp.d.ts.map +1 -1
  75. package/dist/shell/shellApp.js +3 -54
  76. package/dist/shell/shellApp.js.map +1 -1
  77. package/dist/shell/systemPrompt.d.ts +1 -1
  78. package/dist/shell/systemPrompt.d.ts.map +1 -1
  79. package/dist/shell/systemPrompt.js +57 -15
  80. package/dist/shell/systemPrompt.js.map +1 -1
  81. package/dist/shell/updateManager.js +2 -4
  82. package/dist/shell/updateManager.js.map +1 -1
  83. package/dist/subagents/taskRunner.js +2 -2
  84. package/dist/subagents/taskRunner.js.map +1 -1
  85. package/dist/tools/cloudTools.d.ts +2 -0
  86. package/dist/tools/cloudTools.d.ts.map +1 -1
  87. package/dist/tools/cloudTools.js +2 -0
  88. package/dist/tools/cloudTools.js.map +1 -1
  89. package/dist/tools/fileTools.d.ts.map +1 -1
  90. package/dist/tools/fileTools.js +3 -31
  91. package/dist/tools/fileTools.js.map +1 -1
  92. package/dist/ui/ShellUIAdapter.d.ts +2 -10
  93. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  94. package/dist/ui/ShellUIAdapter.js +11 -123
  95. package/dist/ui/ShellUIAdapter.js.map +1 -1
  96. package/dist/ui/keyboardShortcuts.d.ts.map +1 -1
  97. package/dist/ui/keyboardShortcuts.js +2 -12
  98. package/dist/ui/keyboardShortcuts.js.map +1 -1
  99. package/dist/ui/persistentPrompt.d.ts +0 -24
  100. package/dist/ui/persistentPrompt.d.ts.map +1 -1
  101. package/dist/ui/persistentPrompt.js +4 -86
  102. package/dist/ui/persistentPrompt.js.map +1 -1
  103. package/dist/ui/toolDisplay.d.ts.map +1 -1
  104. package/dist/ui/toolDisplay.js +0 -652
  105. package/dist/ui/toolDisplay.js.map +1 -1
  106. package/package.json +10 -10
  107. package/dist/core/cliTestHarness.d.ts +0 -200
  108. package/dist/core/cliTestHarness.d.ts.map +0 -1
  109. package/dist/core/cliTestHarness.js +0 -549
  110. package/dist/core/cliTestHarness.js.map +0 -1
  111. package/dist/core/multilinePasteHandler.d.ts +0 -35
  112. package/dist/core/multilinePasteHandler.d.ts.map +0 -1
  113. package/dist/core/multilinePasteHandler.js +0 -80
  114. package/dist/core/multilinePasteHandler.js.map +0 -1
  115. package/dist/tools/exploreTools.d.ts +0 -7
  116. package/dist/tools/exploreTools.d.ts.map +0 -1
  117. package/dist/tools/exploreTools.js +0 -344
  118. package/dist/tools/exploreTools.js.map +0 -1
@@ -445,15 +445,8 @@ export function formatToolResultSummary(input) {
445
445
  // === BASH/COMMAND EXECUTION ===
446
446
  case 'Bash':
447
447
  case 'bash':
448
- case 'execute_bash':
449
- case 'execute_bash_stream':
450
448
  case 'execute_command':
451
449
  return formatBashResult(args, output, success, durationMs);
452
- // === BACKGROUND BASH ===
453
- case 'BashOutput':
454
- return formatBashOutputResult(args, output, success);
455
- case 'KillShell':
456
- return formatKillShellResult(args, output, success);
457
450
  // === FILE READING ===
458
451
  case 'Read':
459
452
  case 'read_file':
@@ -461,16 +454,12 @@ export function formatToolResultSummary(input) {
461
454
  // === SEARCH OPERATIONS ===
462
455
  case 'Grep':
463
456
  case 'grep':
464
- case 'grep_search':
465
457
  case 'search_text':
466
- case 'search_files':
467
458
  return formatGrepResult(args, output, success);
468
459
  case 'Glob':
469
460
  case 'glob':
470
461
  case 'list_files':
471
462
  return formatGlobResult(args, output, success);
472
- case 'find_definition':
473
- return formatFindDefinitionResult(args, output, success);
474
463
  // === WEB OPERATIONS ===
475
464
  case 'WebFetch':
476
465
  case 'web_fetch':
@@ -478,8 +467,6 @@ export function formatToolResultSummary(input) {
478
467
  case 'WebSearch':
479
468
  case 'web_search':
480
469
  return formatWebSearchResult(args, output, success);
481
- case 'WebExtract':
482
- return formatWebExtractResult(args, output, success);
483
470
  // === TASK/AGENT OPERATIONS ===
484
471
  case 'Task':
485
472
  case 'task':
@@ -492,85 +479,6 @@ export function formatToolResultSummary(input) {
492
479
  case 'NotebookEdit':
493
480
  case 'notebook_edit':
494
481
  return formatNotebookResult(args, output, success);
495
- // === USER INTERACTION ===
496
- case 'AskUserQuestion':
497
- return formatAskUserResult(args, output, success);
498
- // === DEV TOOLS ===
499
- case 'run_tests':
500
- return formatTestResult(args, output, success, durationMs);
501
- case 'run_build':
502
- return formatBuildResult(args, output, success, durationMs);
503
- case 'install_dependencies':
504
- return formatInstallResult(args, output, success, durationMs);
505
- case 'check_package_info':
506
- return formatPackageInfoResult(args, output, success);
507
- // === GIT OPERATIONS ===
508
- case 'git_release':
509
- case 'git_sync':
510
- case 'git_cleanup':
511
- return formatGitResult(toolName, args, output, success);
512
- // === DOCKER ===
513
- case 'docker_build':
514
- case 'docker_compose':
515
- return formatDockerResult(toolName, args, output, success, durationMs);
516
- // === CODE ANALYSIS ===
517
- case 'analyze_code_structure':
518
- case 'find_dependencies':
519
- case 'check_code_complexity':
520
- case 'advanced_ast_analysis':
521
- case 'analyze_code_complexity':
522
- case 'suggest_refactoring':
523
- case 'generate_code_quality_report':
524
- return formatCodeAnalysisResult(toolName, args, output, success);
525
- // === TESTING TOOLS ===
526
- case 'generate_test_templates':
527
- case 'run_coverage_analysis':
528
- case 'summarize_coverage_report':
529
- case 'analyze_test_coverage':
530
- case 'generate_comprehensive_tests':
531
- return formatTestingToolResult(toolName, args, output, success);
532
- // === LINT/QUALITY ===
533
- case 'run_lint_checks':
534
- case 'inspect_code_quality':
535
- case 'list_lint_rules':
536
- return formatLintResult(toolName, args, output, success);
537
- // === CLOUD DEPLOY ===
538
- case 'cloud_status':
539
- case 'cloud_deploy':
540
- case 'cloud_init':
541
- case 'cloud_login':
542
- case 'firebase_deploy':
543
- case 'aliyun_deploy':
544
- return formatCloudResult(toolName, args, output, success);
545
- // === BROWSER AUTOMATION ===
546
- case 'browser_create_session':
547
- case 'browser_navigate':
548
- case 'browser_click':
549
- case 'browser_type':
550
- case 'browser_screenshot':
551
- case 'browser_close_session':
552
- return formatBrowserResult(toolName, args, output, success);
553
- // === EMAIL ===
554
- case 'send_email':
555
- case 'send_batch_emails':
556
- case 'verify_email_config':
557
- return formatEmailResult(toolName, args, output, success);
558
- // === SKILLS ===
559
- case 'ListSkills':
560
- case 'Skill':
561
- return formatSkillResult(toolName, args, output, success);
562
- // === PLANNING ===
563
- case 'ExitPlanMode':
564
- return formatPlanModeResult(args, output, success);
565
- // === REPO CHECKS ===
566
- case 'run_repo_checks':
567
- return formatRepoChecksResult(args, output, success);
568
- // === LEARNING ===
569
- case 'learn_codebase':
570
- case 'learn_file':
571
- case 'learn_topic':
572
- case 'learn_summary':
573
- return formatLearnResult(toolName, args, output, success);
574
482
  // === DEFAULT: Unknown tools ===
575
483
  default:
576
484
  // For unknown tools, show a generic summary if output is non-empty
@@ -777,564 +685,4 @@ function formatGenericToolResult(toolName, output, success, durationMs) {
777
685
  const lineCount = output.split('\n').length;
778
686
  return `${statusIcon} ${toolName} completed ${theme.ui.muted(`(${lineCount} lines)`)}${durationStr}`;
779
687
  }
780
- // ============================================================================
781
- // ADDITIONAL TOOL FORMATTERS
782
- // ============================================================================
783
- /**
784
- * Format BashOutput (background shell) result
785
- */
786
- function formatBashOutputResult(args, output, success) {
787
- const shellId = (args['bash_id'] || args['shell_id']) || '';
788
- const lines = [];
789
- if (!success) {
790
- return `${theme.error('✗')} Failed to get output from shell ${shellId}`;
791
- }
792
- const outputLines = output.trim().split('\n').filter(l => l);
793
- const lineCount = outputLines.length;
794
- lines.push(`${theme.success('✓')} Shell ${theme.info(shellId)} ${theme.ui.muted(`(${lineCount} lines)`)}`);
795
- // Show preview
796
- const maxPreview = 3;
797
- for (let i = 0; i < Math.min(maxPreview, outputLines.length); i++) {
798
- const line = outputLines[i] || '';
799
- const truncated = line.length > 70 ? `${line.slice(0, 67)}...` : line;
800
- lines.push(` ${theme.dim(truncated)}`);
801
- }
802
- if (lineCount > maxPreview) {
803
- lines.push(` ${theme.ui.muted(`... +${lineCount - maxPreview} more`)}`);
804
- }
805
- return lines.join('\n');
806
- }
807
- /**
808
- * Format KillShell result
809
- */
810
- function formatKillShellResult(args, _output, success) {
811
- const shellId = (args['shell_id']) || '';
812
- if (!success) {
813
- return `${theme.error('✗')} Failed to kill shell ${shellId}`;
814
- }
815
- return `${theme.success('✓')} Killed shell ${theme.info(shellId)}`;
816
- }
817
- /**
818
- * Format find_definition result
819
- */
820
- function formatFindDefinitionResult(args, output, success) {
821
- const symbol = (args['symbol'] || args['name']) || '';
822
- if (!success || !output.trim()) {
823
- return `${theme.warning('○')} Definition not found: ${symbol}`;
824
- }
825
- const locations = output.trim().split('\n').filter(l => l);
826
- return `${theme.success('✓')} Found ${theme.info(String(locations.length))} definition${locations.length === 1 ? '' : 's'} for "${symbol}"`;
827
- }
828
- /**
829
- * Format WebExtract result
830
- */
831
- function formatWebExtractResult(args, output, success) {
832
- const url = args['url'] || '';
833
- let hostname = url;
834
- try {
835
- hostname = new URL(url).hostname;
836
- }
837
- catch {
838
- // Keep original
839
- }
840
- if (!success) {
841
- return `${theme.error('✗')} Failed to extract from ${hostname}`;
842
- }
843
- const contentLength = output.length;
844
- return `${theme.success('✓')} Extracted from ${theme.info(hostname)} ${theme.ui.muted(`(${formatFileSize(contentLength)})`)}`;
845
- }
846
- /**
847
- * Format AskUserQuestion result
848
- */
849
- function formatAskUserResult(args, output, success) {
850
- const questions = args['questions'];
851
- const questionCount = questions?.length || 1;
852
- if (!success) {
853
- return `${theme.error('✗')} Failed to ask user`;
854
- }
855
- if (output.includes('answer') || output.includes('response')) {
856
- return `${theme.success('✓')} User responded`;
857
- }
858
- return `${theme.info('?')} Asked ${questionCount} question${questionCount === 1 ? '' : 's'}`;
859
- }
860
- /**
861
- * Format test run result
862
- */
863
- function formatTestResult(args, output, success, durationMs) {
864
- const testPattern = (args['pattern'] || args['filter']);
865
- const lines = [];
866
- const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
867
- // Try to extract test counts from output
868
- const passMatch = output.match(/(\d+)\s*(?:passing|passed|✓)/i);
869
- const failMatch = output.match(/(\d+)\s*(?:failing|failed|✗)/i);
870
- const skipMatch = output.match(/(\d+)\s*(?:skipped|pending)/i);
871
- const passed = passMatch ? parseInt(passMatch[1] || '0', 10) : 0;
872
- const failed = failMatch ? parseInt(failMatch[1] || '0', 10) : 0;
873
- const skipped = skipMatch ? parseInt(skipMatch[1] || '0', 10) : 0;
874
- const statusIcon = success && failed === 0 ? theme.success('✓') : theme.error('✗');
875
- let summary = `${statusIcon} Tests`;
876
- if (testPattern) {
877
- summary += ` "${testPattern}"`;
878
- }
879
- summary += durationStr;
880
- lines.push(summary);
881
- // Show counts
882
- const counts = [];
883
- if (passed > 0)
884
- counts.push(theme.success(`${passed} passed`));
885
- if (failed > 0)
886
- counts.push(theme.error(`${failed} failed`));
887
- if (skipped > 0)
888
- counts.push(theme.warning(`${skipped} skipped`));
889
- if (counts.length > 0) {
890
- lines.push(` ${counts.join(', ')}`);
891
- }
892
- // Show first error if failed
893
- if (!success && failed > 0) {
894
- const errorMatch = output.match(/(?:Error|FAIL|✗).*?:(.*?)(?:\n|$)/i);
895
- if (errorMatch && errorMatch[1]) {
896
- const errorMsg = errorMatch[1].trim().slice(0, 60);
897
- lines.push(` ${theme.error(errorMsg)}`);
898
- }
899
- }
900
- return lines.join('\n');
901
- }
902
- /**
903
- * Format build result
904
- */
905
- function formatBuildResult(args, output, success, durationMs) {
906
- const target = (args['target'] || args['script']);
907
- const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
908
- if (!success) {
909
- // Try to extract error count
910
- const errorMatches = output.match(/error/gi);
911
- const errorCount = errorMatches ? errorMatches.length : 0;
912
- if (errorCount > 0) {
913
- return `${theme.error('✗')} Build failed with ${errorCount} error${errorCount === 1 ? '' : 's'}${durationStr}`;
914
- }
915
- return `${theme.error('✗')} Build failed${durationStr}`;
916
- }
917
- const label = target ? `Build "${target}"` : 'Build';
918
- return `${theme.success('✓')} ${label} succeeded${durationStr}`;
919
- }
920
- /**
921
- * Format install dependencies result
922
- */
923
- function formatInstallResult(args, output, success, durationMs) {
924
- const packages = args['packages'];
925
- const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
926
- if (!success) {
927
- return `${theme.error('✗')} Install failed${durationStr}`;
928
- }
929
- // Try to extract package count from output
930
- const addedMatch = output.match(/added\s+(\d+)\s+packages?/i);
931
- const packageCount = addedMatch ? addedMatch[1] : null;
932
- let summary = `${theme.success('✓')} Dependencies installed`;
933
- if (packageCount) {
934
- summary += ` ${theme.ui.muted(`(${packageCount} packages)`)}`;
935
- }
936
- else if (packages) {
937
- const pkgList = Array.isArray(packages) ? packages : [packages];
938
- summary += ` ${theme.ui.muted(`(${pkgList.length} packages)`)}`;
939
- }
940
- summary += durationStr;
941
- return summary;
942
- }
943
- /**
944
- * Format package info result
945
- */
946
- function formatPackageInfoResult(args, output, success) {
947
- const packageName = (args['package'] || args['name']) || '';
948
- if (!success) {
949
- return `${theme.error('✗')} Package info failed for ${packageName}`;
950
- }
951
- // Try to extract version
952
- const versionMatch = output.match(/version[:\s]+["']?([^"'\s\n]+)/i);
953
- const version = versionMatch ? versionMatch[1] : null;
954
- if (version) {
955
- return `${theme.success('✓')} ${theme.info(packageName)}@${version}`;
956
- }
957
- return `${theme.success('✓')} Package info: ${theme.info(packageName)}`;
958
- }
959
- /**
960
- * Format git operation result
961
- */
962
- function formatGitResult(toolName, args, output, success) {
963
- const action = toolName.replace('git_', '');
964
- if (!success) {
965
- return `${theme.error('✗')} Git ${action} failed`;
966
- }
967
- switch (toolName) {
968
- case 'git_release': {
969
- const version = (args['version'] || args['tag']);
970
- if (version) {
971
- return `${theme.success('✓')} Released ${theme.info(version)}`;
972
- }
973
- return `${theme.success('✓')} Release created`;
974
- }
975
- case 'git_sync': {
976
- // Try to extract ahead/behind from output
977
- const aheadMatch = output.match(/(\d+)\s+commit.*ahead/i);
978
- const behindMatch = output.match(/(\d+)\s+commit.*behind/i);
979
- const parts = [];
980
- if (aheadMatch)
981
- parts.push(`${aheadMatch[1]} ahead`);
982
- if (behindMatch)
983
- parts.push(`${behindMatch[1]} behind`);
984
- if (parts.length > 0) {
985
- return `${theme.success('✓')} Synced ${theme.ui.muted(`(${parts.join(', ')})`)}`;
986
- }
987
- return `${theme.success('✓')} Git synced`;
988
- }
989
- case 'git_cleanup': {
990
- const branchMatch = output.match(/deleted.*?(\d+)/i);
991
- if (branchMatch) {
992
- return `${theme.success('✓')} Cleaned up ${branchMatch[1]} branches`;
993
- }
994
- return `${theme.success('✓')} Git cleanup completed`;
995
- }
996
- default:
997
- return `${theme.success('✓')} Git ${action} completed`;
998
- }
999
- }
1000
- /**
1001
- * Format docker result
1002
- */
1003
- function formatDockerResult(toolName, args, output, success, durationMs) {
1004
- const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
1005
- if (!success) {
1006
- return `${theme.error('✗')} Docker ${toolName.replace('docker_', '')} failed${durationStr}`;
1007
- }
1008
- switch (toolName) {
1009
- case 'docker_build': {
1010
- const tag = (args['tag'] || args['image']);
1011
- // Try to extract image ID from output
1012
- const imageMatch = output.match(/(?:Successfully built|sha256:)\s*([a-f0-9]{12})/i);
1013
- if (tag) {
1014
- return `${theme.success('✓')} Built image ${theme.info(tag)}${durationStr}`;
1015
- }
1016
- if (imageMatch) {
1017
- return `${theme.success('✓')} Built image ${theme.info(imageMatch[1] || '')}${durationStr}`;
1018
- }
1019
- return `${theme.success('✓')} Docker build completed${durationStr}`;
1020
- }
1021
- case 'docker_compose': {
1022
- const action = (args['action'] || args['command']) || 'up';
1023
- return `${theme.success('✓')} Docker compose ${action}${durationStr}`;
1024
- }
1025
- default:
1026
- return `${theme.success('✓')} Docker operation completed${durationStr}`;
1027
- }
1028
- }
1029
- /**
1030
- * Format code analysis result
1031
- */
1032
- function formatCodeAnalysisResult(toolName, args, output, success) {
1033
- const filePath = (args['file_path'] || args['path'] || args['file']);
1034
- const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
1035
- if (!success) {
1036
- return `${theme.error('✗')} Analysis failed${displayPath ? ` for ${displayPath}` : ''}`;
1037
- }
1038
- const toolLabels = {
1039
- 'analyze_code_structure': 'Structure analyzed',
1040
- 'find_dependencies': 'Dependencies found',
1041
- 'check_code_complexity': 'Complexity checked',
1042
- 'advanced_ast_analysis': 'AST analyzed',
1043
- 'analyze_code_complexity': 'Complexity analyzed',
1044
- 'suggest_refactoring': 'Refactoring suggestions',
1045
- 'generate_code_quality_report': 'Quality report generated',
1046
- };
1047
- const label = toolLabels[toolName] || 'Analysis completed';
1048
- // Try to extract counts from output
1049
- const issueMatch = output.match(/(\d+)\s*(?:issue|warning|suggestion)/i);
1050
- if (issueMatch) {
1051
- return `${theme.success('✓')} ${label}: ${issueMatch[1]} items${displayPath ? ` in ${displayPath}` : ''}`;
1052
- }
1053
- return `${theme.success('✓')} ${label}${displayPath ? ` for ${displayPath}` : ''}`;
1054
- }
1055
- /**
1056
- * Format testing tool result
1057
- */
1058
- function formatTestingToolResult(toolName, args, output, success) {
1059
- const filePath = (args['file_path'] || args['path']);
1060
- const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
1061
- if (!success) {
1062
- return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
1063
- }
1064
- switch (toolName) {
1065
- case 'generate_test_templates': {
1066
- const countMatch = output.match(/(\d+)\s*(?:test|template)/i);
1067
- if (countMatch) {
1068
- return `${theme.success('✓')} Generated ${countMatch[1]} test templates`;
1069
- }
1070
- return `${theme.success('✓')} Test templates generated`;
1071
- }
1072
- case 'run_coverage_analysis':
1073
- case 'summarize_coverage_report': {
1074
- const coverageMatch = output.match(/(\d+(?:\.\d+)?)\s*%/);
1075
- if (coverageMatch) {
1076
- const pct = parseFloat(coverageMatch[1] || '0');
1077
- const color = pct >= 80 ? theme.success : pct >= 60 ? theme.warning : theme.error;
1078
- return `${theme.success('✓')} Coverage: ${color(`${pct}%`)}${displayPath ? ` for ${displayPath}` : ''}`;
1079
- }
1080
- return `${theme.success('✓')} Coverage analyzed${displayPath ? ` for ${displayPath}` : ''}`;
1081
- }
1082
- case 'analyze_test_coverage': {
1083
- const coverageMatch = output.match(/(\d+(?:\.\d+)?)\s*%/);
1084
- if (coverageMatch) {
1085
- return `${theme.success('✓')} Test coverage: ${coverageMatch[1]}%`;
1086
- }
1087
- return `${theme.success('✓')} Test coverage analyzed`;
1088
- }
1089
- case 'generate_comprehensive_tests': {
1090
- return `${theme.success('✓')} Comprehensive tests generated${displayPath ? ` for ${displayPath}` : ''}`;
1091
- }
1092
- default:
1093
- return `${theme.success('✓')} Testing tool completed`;
1094
- }
1095
- }
1096
- /**
1097
- * Format lint result
1098
- */
1099
- function formatLintResult(toolName, args, output, success) {
1100
- const filePath = (args['file_path'] || args['path']);
1101
- const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
1102
- // Try to extract error/warning counts
1103
- const errorMatch = output.match(/(\d+)\s*error/i);
1104
- const warnMatch = output.match(/(\d+)\s*warning/i);
1105
- const errors = errorMatch ? parseInt(errorMatch[1] || '0', 10) : 0;
1106
- const warnings = warnMatch ? parseInt(warnMatch[1] || '0', 10) : 0;
1107
- const statusIcon = errors === 0 ? theme.success('✓') : theme.error('✗');
1108
- switch (toolName) {
1109
- case 'run_lint_checks': {
1110
- let summary = `${statusIcon} Lint`;
1111
- if (displayPath)
1112
- summary += ` ${displayPath}`;
1113
- const counts = [];
1114
- if (errors > 0)
1115
- counts.push(theme.error(`${errors} errors`));
1116
- if (warnings > 0)
1117
- counts.push(theme.warning(`${warnings} warnings`));
1118
- if (counts.length > 0) {
1119
- summary += `: ${counts.join(', ')}`;
1120
- }
1121
- else if (success) {
1122
- summary += ': clean';
1123
- }
1124
- return summary;
1125
- }
1126
- case 'inspect_code_quality': {
1127
- return `${statusIcon} Code quality inspected${displayPath ? ` for ${displayPath}` : ''}`;
1128
- }
1129
- case 'list_lint_rules': {
1130
- const ruleMatch = output.match(/(\d+)\s*rule/i);
1131
- if (ruleMatch) {
1132
- return `${theme.success('✓')} Found ${ruleMatch[1]} lint rules`;
1133
- }
1134
- return `${theme.success('✓')} Lint rules listed`;
1135
- }
1136
- default:
1137
- return `${statusIcon} Lint completed`;
1138
- }
1139
- }
1140
- /**
1141
- * Format cloud deployment result
1142
- */
1143
- function formatCloudResult(toolName, args, output, success) {
1144
- const provider = (args['provider'] || args['platform']);
1145
- if (!success) {
1146
- return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
1147
- }
1148
- switch (toolName) {
1149
- case 'cloud_status': {
1150
- return `${theme.success('✓')} Cloud status checked${provider ? ` (${provider})` : ''}`;
1151
- }
1152
- case 'cloud_deploy':
1153
- case 'firebase_deploy':
1154
- case 'aliyun_deploy': {
1155
- // Try to extract URL from output
1156
- const urlMatch = output.match(/https?:\/\/[^\s]+/);
1157
- if (urlMatch) {
1158
- return `${theme.success('✓')} Deployed to ${theme.info(urlMatch[0])}`;
1159
- }
1160
- return `${theme.success('✓')} Deployment successful${provider ? ` (${provider})` : ''}`;
1161
- }
1162
- case 'cloud_init': {
1163
- return `${theme.success('✓')} Cloud project initialized${provider ? ` (${provider})` : ''}`;
1164
- }
1165
- case 'cloud_login': {
1166
- return `${theme.success('✓')} Logged in${provider ? ` to ${provider}` : ''}`;
1167
- }
1168
- default:
1169
- return `${theme.success('✓')} Cloud operation completed`;
1170
- }
1171
- }
1172
- /**
1173
- * Format browser automation result
1174
- */
1175
- function formatBrowserResult(toolName, args, output, success) {
1176
- if (!success) {
1177
- return `${theme.error('✗')} Browser ${toolName.replace('browser_', '')} failed`;
1178
- }
1179
- switch (toolName) {
1180
- case 'browser_create_session': {
1181
- const sessionMatch = output.match(/session[:\s]+["']?([^"'\s\n]+)/i);
1182
- if (sessionMatch) {
1183
- return `${theme.success('✓')} Browser session created: ${theme.info(sessionMatch[1] || '')}`;
1184
- }
1185
- return `${theme.success('✓')} Browser session created`;
1186
- }
1187
- case 'browser_navigate': {
1188
- const url = (args['url']);
1189
- if (url) {
1190
- try {
1191
- const hostname = new URL(url).hostname;
1192
- return `${theme.success('✓')} Navigated to ${theme.info(hostname)}`;
1193
- }
1194
- catch {
1195
- return `${theme.success('✓')} Navigated to page`;
1196
- }
1197
- }
1198
- return `${theme.success('✓')} Navigated`;
1199
- }
1200
- case 'browser_click': {
1201
- const selector = (args['selector']);
1202
- return `${theme.success('✓')} Clicked ${selector ? theme.dim(selector) : 'element'}`;
1203
- }
1204
- case 'browser_type': {
1205
- const selector = (args['selector']);
1206
- return `${theme.success('✓')} Typed text ${selector ? `in ${theme.dim(selector)}` : ''}`;
1207
- }
1208
- case 'browser_screenshot': {
1209
- const path = (args['path'] || args['file_path']);
1210
- if (path) {
1211
- return `${theme.success('✓')} Screenshot saved: ${truncatePathForDisplay(path, 40)}`;
1212
- }
1213
- return `${theme.success('✓')} Screenshot captured`;
1214
- }
1215
- case 'browser_close_session': {
1216
- return `${theme.success('✓')} Browser session closed`;
1217
- }
1218
- default:
1219
- return `${theme.success('✓')} Browser action completed`;
1220
- }
1221
- }
1222
- /**
1223
- * Format email result
1224
- */
1225
- function formatEmailResult(toolName, args, _output, success) {
1226
- if (!success) {
1227
- return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
1228
- }
1229
- switch (toolName) {
1230
- case 'send_email': {
1231
- const to = (args['to']);
1232
- const recipients = Array.isArray(to) ? to.length : (to ? 1 : 0);
1233
- return `${theme.success('✓')} Email sent${recipients ? ` to ${recipients} recipient${recipients === 1 ? '' : 's'}` : ''}`;
1234
- }
1235
- case 'send_batch_emails': {
1236
- const emails = (args['emails']);
1237
- const count = emails?.length || 0;
1238
- return `${theme.success('✓')} Sent ${count} email${count === 1 ? '' : 's'}`;
1239
- }
1240
- case 'verify_email_config': {
1241
- return `${theme.success('✓')} Email config verified`;
1242
- }
1243
- default:
1244
- return `${theme.success('✓')} Email operation completed`;
1245
- }
1246
- }
1247
- /**
1248
- * Format skill result
1249
- */
1250
- function formatSkillResult(toolName, args, output, success) {
1251
- if (!success) {
1252
- return `${theme.error('✗')} Skill operation failed`;
1253
- }
1254
- switch (toolName) {
1255
- case 'ListSkills': {
1256
- const skillMatch = output.match(/(\d+)\s*skill/i);
1257
- if (skillMatch) {
1258
- return `${theme.success('✓')} Found ${skillMatch[1]} skills`;
1259
- }
1260
- return `${theme.success('✓')} Skills listed`;
1261
- }
1262
- case 'Skill': {
1263
- const skillName = (args['skill'] || args['name']);
1264
- if (skillName) {
1265
- return `${theme.success('✓')} Skill "${skillName}" executed`;
1266
- }
1267
- return `${theme.success('✓')} Skill executed`;
1268
- }
1269
- default:
1270
- return `${theme.success('✓')} Skill completed`;
1271
- }
1272
- }
1273
- /**
1274
- * Format plan mode result
1275
- */
1276
- function formatPlanModeResult(_args, _output, success) {
1277
- if (!success) {
1278
- return `${theme.error('✗')} Failed to exit plan mode`;
1279
- }
1280
- return `${theme.success('✓')} Exited plan mode`;
1281
- }
1282
- /**
1283
- * Format repo checks result
1284
- */
1285
- function formatRepoChecksResult(args, output, success) {
1286
- const checks = (args['checks']);
1287
- const checkCount = checks?.length || 0;
1288
- // Try to extract pass/fail counts
1289
- const passMatch = output.match(/(\d+)\s*pass/i);
1290
- const failMatch = output.match(/(\d+)\s*fail/i);
1291
- const passed = passMatch ? parseInt(passMatch[1] || '0', 10) : 0;
1292
- const failed = failMatch ? parseInt(failMatch[1] || '0', 10) : 0;
1293
- const statusIcon = success && failed === 0 ? theme.success('✓') : theme.error('✗');
1294
- if (passed > 0 || failed > 0) {
1295
- const counts = [];
1296
- if (passed > 0)
1297
- counts.push(theme.success(`${passed} passed`));
1298
- if (failed > 0)
1299
- counts.push(theme.error(`${failed} failed`));
1300
- return `${statusIcon} Repo checks: ${counts.join(', ')}`;
1301
- }
1302
- return `${statusIcon} Repo checks${checkCount > 0 ? ` (${checkCount} checks)` : ''} ${success ? 'passed' : 'failed'}`;
1303
- }
1304
- /**
1305
- * Format learn tool result
1306
- */
1307
- function formatLearnResult(toolName, args, output, success) {
1308
- if (!success) {
1309
- return `${theme.error('✗')} Learning failed`;
1310
- }
1311
- switch (toolName) {
1312
- case 'learn_codebase': {
1313
- const fileMatch = output.match(/(\d+)\s*file/i);
1314
- if (fileMatch) {
1315
- return `${theme.success('✓')} Learned codebase: ${fileMatch[1]} files analyzed`;
1316
- }
1317
- return `${theme.success('✓')} Codebase learned`;
1318
- }
1319
- case 'learn_file': {
1320
- const filePath = (args['file_path'] || args['path']);
1321
- if (filePath) {
1322
- return `${theme.success('✓')} Learned: ${truncatePathForDisplay(filePath, 40)}`;
1323
- }
1324
- return `${theme.success('✓')} File learned`;
1325
- }
1326
- case 'learn_topic': {
1327
- const topic = (args['topic']);
1328
- if (topic) {
1329
- return `${theme.success('✓')} Learned topic: ${topic}`;
1330
- }
1331
- return `${theme.success('✓')} Topic learned`;
1332
- }
1333
- case 'learn_summary': {
1334
- return `${theme.success('✓')} Summary generated`;
1335
- }
1336
- default:
1337
- return `${theme.success('✓')} Learning completed`;
1338
- }
1339
- }
1340
688
  //# sourceMappingURL=toolDisplay.js.map