erosolar-cli 1.7.81 → 1.7.82

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 (109) hide show
  1. package/agents/erosolar-code.rules.json +5 -0
  2. package/agents/general.rules.json +5 -0
  3. package/dist/bin/erosolar.js +0 -2
  4. package/dist/bin/erosolar.js.map +1 -1
  5. package/dist/contracts/agent-schemas.json +20 -12
  6. package/dist/contracts/unified-schema.json +1 -1
  7. package/dist/core/agent.d.ts +36 -3
  8. package/dist/core/agent.d.ts.map +1 -1
  9. package/dist/core/agent.js +223 -8
  10. package/dist/core/agent.js.map +1 -1
  11. package/dist/core/cliTestHarness.d.ts +200 -0
  12. package/dist/core/cliTestHarness.d.ts.map +1 -0
  13. package/dist/core/cliTestHarness.js +549 -0
  14. package/dist/core/cliTestHarness.js.map +1 -0
  15. package/dist/core/errors/apiKeyErrors.js +1 -1
  16. package/dist/core/errors/apiKeyErrors.js.map +1 -1
  17. package/dist/core/isolatedVerifier.js +274 -22
  18. package/dist/core/isolatedVerifier.js.map +1 -1
  19. package/dist/core/modelDiscovery.d.ts.map +1 -1
  20. package/dist/core/modelDiscovery.js +23 -28
  21. package/dist/core/modelDiscovery.js.map +1 -1
  22. package/dist/core/multilinePasteHandler.d.ts +35 -0
  23. package/dist/core/multilinePasteHandler.d.ts.map +1 -0
  24. package/dist/core/multilinePasteHandler.js +80 -0
  25. package/dist/core/multilinePasteHandler.js.map +1 -0
  26. package/dist/core/secretStore.d.ts +9 -0
  27. package/dist/core/secretStore.d.ts.map +1 -1
  28. package/dist/core/secretStore.js +52 -2
  29. package/dist/core/secretStore.js.map +1 -1
  30. package/dist/core/types.d.ts +6 -0
  31. package/dist/core/types.d.ts.map +1 -1
  32. package/dist/headless/headlessApp.d.ts.map +1 -1
  33. package/dist/headless/headlessApp.js +16 -0
  34. package/dist/headless/headlessApp.js.map +1 -1
  35. package/dist/plugins/providers/google/index.js +3 -2
  36. package/dist/plugins/providers/google/index.js.map +1 -1
  37. package/dist/providers/anthropicProvider.d.ts.map +1 -1
  38. package/dist/providers/anthropicProvider.js +27 -1
  39. package/dist/providers/anthropicProvider.js.map +1 -1
  40. package/dist/providers/googleProvider.d.ts.map +1 -1
  41. package/dist/providers/googleProvider.js +23 -1
  42. package/dist/providers/googleProvider.js.map +1 -1
  43. package/dist/providers/openaiChatCompletionsProvider.d.ts +2 -1
  44. package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -1
  45. package/dist/providers/openaiChatCompletionsProvider.js +111 -4
  46. package/dist/providers/openaiChatCompletionsProvider.js.map +1 -1
  47. package/dist/providers/openaiResponsesProvider.d.ts.map +1 -1
  48. package/dist/providers/openaiResponsesProvider.js +39 -18
  49. package/dist/providers/openaiResponsesProvider.js.map +1 -1
  50. package/dist/runtime/agentController.d.ts +4 -0
  51. package/dist/runtime/agentController.d.ts.map +1 -1
  52. package/dist/runtime/agentController.js +29 -3
  53. package/dist/runtime/agentController.js.map +1 -1
  54. package/dist/security/persistence-research.d.ts +0 -2
  55. package/dist/security/persistence-research.d.ts.map +1 -1
  56. package/dist/security/persistence-research.js +0 -2
  57. package/dist/security/persistence-research.js.map +1 -1
  58. package/dist/security/security-testing-framework.d.ts +0 -2
  59. package/dist/security/security-testing-framework.d.ts.map +1 -1
  60. package/dist/security/security-testing-framework.js +0 -2
  61. package/dist/security/security-testing-framework.js.map +1 -1
  62. package/dist/shell/bracketedPasteManager.d.ts +8 -5
  63. package/dist/shell/bracketedPasteManager.d.ts.map +1 -1
  64. package/dist/shell/bracketedPasteManager.js +27 -43
  65. package/dist/shell/bracketedPasteManager.js.map +1 -1
  66. package/dist/shell/composableMessage.d.ts +1 -1
  67. package/dist/shell/composableMessage.js +2 -2
  68. package/dist/shell/composableMessage.js.map +1 -1
  69. package/dist/shell/interactiveShell.d.ts +7 -48
  70. package/dist/shell/interactiveShell.d.ts.map +1 -1
  71. package/dist/shell/interactiveShell.js +144 -340
  72. package/dist/shell/interactiveShell.js.map +1 -1
  73. package/dist/shell/shellApp.d.ts.map +1 -1
  74. package/dist/shell/shellApp.js +54 -3
  75. package/dist/shell/shellApp.js.map +1 -1
  76. package/dist/shell/systemPrompt.d.ts +1 -1
  77. package/dist/shell/systemPrompt.d.ts.map +1 -1
  78. package/dist/shell/systemPrompt.js +10 -3
  79. package/dist/shell/systemPrompt.js.map +1 -1
  80. package/dist/shell/updateManager.js +4 -2
  81. package/dist/shell/updateManager.js.map +1 -1
  82. package/dist/subagents/taskRunner.js +2 -2
  83. package/dist/subagents/taskRunner.js.map +1 -1
  84. package/dist/tools/cloudTools.d.ts +0 -2
  85. package/dist/tools/cloudTools.d.ts.map +1 -1
  86. package/dist/tools/cloudTools.js +0 -2
  87. package/dist/tools/cloudTools.js.map +1 -1
  88. package/dist/tools/fileTools.d.ts.map +1 -1
  89. package/dist/tools/fileTools.js +31 -3
  90. package/dist/tools/fileTools.js.map +1 -1
  91. package/dist/ui/ShellUIAdapter.d.ts +10 -2
  92. package/dist/ui/ShellUIAdapter.d.ts.map +1 -1
  93. package/dist/ui/ShellUIAdapter.js +123 -11
  94. package/dist/ui/ShellUIAdapter.js.map +1 -1
  95. package/dist/ui/keyboardShortcuts.d.ts.map +1 -1
  96. package/dist/ui/keyboardShortcuts.js +12 -2
  97. package/dist/ui/keyboardShortcuts.js.map +1 -1
  98. package/dist/ui/persistentPrompt.d.ts +24 -0
  99. package/dist/ui/persistentPrompt.d.ts.map +1 -1
  100. package/dist/ui/persistentPrompt.js +86 -4
  101. package/dist/ui/persistentPrompt.js.map +1 -1
  102. package/dist/ui/toolDisplay.d.ts.map +1 -1
  103. package/dist/ui/toolDisplay.js +652 -0
  104. package/dist/ui/toolDisplay.js.map +1 -1
  105. package/package.json +3 -3
  106. package/dist/shell/inputProcessor.d.ts +0 -55
  107. package/dist/shell/inputProcessor.d.ts.map +0 -1
  108. package/dist/shell/inputProcessor.js +0 -171
  109. package/dist/shell/inputProcessor.js.map +0 -1
@@ -445,8 +445,15 @@ 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':
448
450
  case 'execute_command':
449
451
  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);
450
457
  // === FILE READING ===
451
458
  case 'Read':
452
459
  case 'read_file':
@@ -454,12 +461,16 @@ export function formatToolResultSummary(input) {
454
461
  // === SEARCH OPERATIONS ===
455
462
  case 'Grep':
456
463
  case 'grep':
464
+ case 'grep_search':
457
465
  case 'search_text':
466
+ case 'search_files':
458
467
  return formatGrepResult(args, output, success);
459
468
  case 'Glob':
460
469
  case 'glob':
461
470
  case 'list_files':
462
471
  return formatGlobResult(args, output, success);
472
+ case 'find_definition':
473
+ return formatFindDefinitionResult(args, output, success);
463
474
  // === WEB OPERATIONS ===
464
475
  case 'WebFetch':
465
476
  case 'web_fetch':
@@ -467,6 +478,8 @@ export function formatToolResultSummary(input) {
467
478
  case 'WebSearch':
468
479
  case 'web_search':
469
480
  return formatWebSearchResult(args, output, success);
481
+ case 'WebExtract':
482
+ return formatWebExtractResult(args, output, success);
470
483
  // === TASK/AGENT OPERATIONS ===
471
484
  case 'Task':
472
485
  case 'task':
@@ -479,6 +492,85 @@ export function formatToolResultSummary(input) {
479
492
  case 'NotebookEdit':
480
493
  case 'notebook_edit':
481
494
  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);
482
574
  // === DEFAULT: Unknown tools ===
483
575
  default:
484
576
  // For unknown tools, show a generic summary if output is non-empty
@@ -685,4 +777,564 @@ function formatGenericToolResult(toolName, output, success, durationMs) {
685
777
  const lineCount = output.split('\n').length;
686
778
  return `${statusIcon} ${toolName} completed ${theme.ui.muted(`(${lineCount} lines)`)}${durationStr}`;
687
779
  }
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
+ }
688
1340
  //# sourceMappingURL=toolDisplay.js.map