deepseek-coder-cli 1.0.0
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/LICENSE +21 -0
- package/README.md +422 -0
- package/agents/agi-code.rules.json +87 -0
- package/agents/general.rules.json +171 -0
- package/dist/bin/cliMode.d.ts +8 -0
- package/dist/bin/cliMode.d.ts.map +1 -0
- package/dist/bin/cliMode.js +20 -0
- package/dist/bin/cliMode.js.map +1 -0
- package/dist/bin/deepseek.d.ts +16 -0
- package/dist/bin/deepseek.d.ts.map +1 -0
- package/dist/bin/deepseek.js +737 -0
- package/dist/bin/deepseek.js.map +1 -0
- package/dist/bin/erosolar.d.ts +7 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +7 -0
- package/dist/bin/erosolar.js.map +1 -0
- package/dist/bin/selfTest.d.ts +14 -0
- package/dist/bin/selfTest.d.ts.map +1 -0
- package/dist/bin/selfTest.js +304 -0
- package/dist/bin/selfTest.js.map +1 -0
- package/dist/capabilities/appleSecurityCapability.d.ts +57 -0
- package/dist/capabilities/appleSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/appleSecurityCapability.js +197 -0
- package/dist/capabilities/appleSecurityCapability.js.map +1 -0
- package/dist/capabilities/authorizedSecurityCapability.d.ts +17 -0
- package/dist/capabilities/authorizedSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/authorizedSecurityCapability.js +333 -0
- package/dist/capabilities/authorizedSecurityCapability.js.map +1 -0
- package/dist/capabilities/autoEnhancementCapability.d.ts +98 -0
- package/dist/capabilities/autoEnhancementCapability.d.ts.map +1 -0
- package/dist/capabilities/autoEnhancementCapability.js +455 -0
- package/dist/capabilities/autoEnhancementCapability.js.map +1 -0
- package/dist/capabilities/baseCapability.d.ts +72 -0
- package/dist/capabilities/baseCapability.d.ts.map +1 -0
- package/dist/capabilities/baseCapability.js +183 -0
- package/dist/capabilities/baseCapability.js.map +1 -0
- package/dist/capabilities/bashCapability.d.ts +13 -0
- package/dist/capabilities/bashCapability.d.ts.map +1 -0
- package/dist/capabilities/bashCapability.js +24 -0
- package/dist/capabilities/bashCapability.js.map +1 -0
- package/dist/capabilities/biocognitiveWarfare.d.ts +136 -0
- package/dist/capabilities/biocognitiveWarfare.d.ts.map +1 -0
- package/dist/capabilities/biocognitiveWarfare.js +603 -0
- package/dist/capabilities/biocognitiveWarfare.js.map +1 -0
- package/dist/capabilities/chineseCnoIntegration.d.ts +60 -0
- package/dist/capabilities/chineseCnoIntegration.d.ts.map +1 -0
- package/dist/capabilities/chineseCnoIntegration.js +253 -0
- package/dist/capabilities/chineseCnoIntegration.js.map +1 -0
- package/dist/capabilities/cnoCapability.d.ts +110 -0
- package/dist/capabilities/cnoCapability.d.ts.map +1 -0
- package/dist/capabilities/cnoCapability.js +785 -0
- package/dist/capabilities/cnoCapability.js.map +1 -0
- package/dist/capabilities/editCapability.d.ts +17 -0
- package/dist/capabilities/editCapability.d.ts.map +1 -0
- package/dist/capabilities/editCapability.js +27 -0
- package/dist/capabilities/editCapability.js.map +1 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts +99 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.d.ts.map +1 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.js +618 -0
- package/dist/capabilities/eliteCryptoMilitaryCapability.js.map +1 -0
- package/dist/capabilities/enhancedGitCapability.d.ts +7 -0
- package/dist/capabilities/enhancedGitCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedGitCapability.js +220 -0
- package/dist/capabilities/enhancedGitCapability.js.map +1 -0
- package/dist/capabilities/filesystemCapability.d.ts +13 -0
- package/dist/capabilities/filesystemCapability.d.ts.map +1 -0
- package/dist/capabilities/filesystemCapability.js +24 -0
- package/dist/capabilities/filesystemCapability.js.map +1 -0
- package/dist/capabilities/gitHistoryCapability.d.ts +6 -0
- package/dist/capabilities/gitHistoryCapability.d.ts.map +1 -0
- package/dist/capabilities/gitHistoryCapability.js +160 -0
- package/dist/capabilities/gitHistoryCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +26 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +26 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/integratedUnifiedCapability.d.ts +105 -0
- package/dist/capabilities/integratedUnifiedCapability.d.ts.map +1 -0
- package/dist/capabilities/integratedUnifiedCapability.js +422 -0
- package/dist/capabilities/integratedUnifiedCapability.js.map +1 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts +46 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.d.ts.map +1 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.js +725 -0
- package/dist/capabilities/maxOffensiveUkraineCapability.js.map +1 -0
- package/dist/capabilities/migrationUtilities.d.ts +128 -0
- package/dist/capabilities/migrationUtilities.d.ts.map +1 -0
- package/dist/capabilities/migrationUtilities.js +658 -0
- package/dist/capabilities/migrationUtilities.js.map +1 -0
- package/dist/capabilities/offensiveDestructionCapability.d.ts +98 -0
- package/dist/capabilities/offensiveDestructionCapability.d.ts.map +1 -0
- package/dist/capabilities/offensiveDestructionCapability.js +848 -0
- package/dist/capabilities/offensiveDestructionCapability.js.map +1 -0
- package/dist/capabilities/quantumSpaceWarfare.d.ts +108 -0
- package/dist/capabilities/quantumSpaceWarfare.d.ts.map +1 -0
- package/dist/capabilities/quantumSpaceWarfare.js +342 -0
- package/dist/capabilities/quantumSpaceWarfare.js.map +1 -0
- package/dist/capabilities/readmeIntegration.d.ts +161 -0
- package/dist/capabilities/readmeIntegration.d.ts.map +1 -0
- package/dist/capabilities/readmeIntegration.js +1034 -0
- package/dist/capabilities/readmeIntegration.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +19 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +29 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/selfUpdateSystem.d.ts +122 -0
- package/dist/capabilities/selfUpdateSystem.d.ts.map +1 -0
- package/dist/capabilities/selfUpdateSystem.js +725 -0
- package/dist/capabilities/selfUpdateSystem.js.map +1 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts +89 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.d.ts.map +1 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.js +233 -0
- package/dist/capabilities/sharedMilitaryInfrastructure.js.map +1 -0
- package/dist/capabilities/simpleSecurityCapability.d.ts +36 -0
- package/dist/capabilities/simpleSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/simpleSecurityCapability.js +271 -0
- package/dist/capabilities/simpleSecurityCapability.js.map +1 -0
- package/dist/capabilities/toolManifest.d.ts +3 -0
- package/dist/capabilities/toolManifest.d.ts.map +1 -0
- package/dist/capabilities/toolManifest.js +163 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +25 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +150 -0
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/capabilities/ultimateChineseCno.d.ts +115 -0
- package/dist/capabilities/ultimateChineseCno.d.ts.map +1 -0
- package/dist/capabilities/ultimateChineseCno.js +516 -0
- package/dist/capabilities/ultimateChineseCno.js.map +1 -0
- package/dist/capabilities/ultimateIntegrationDemo.d.ts +54 -0
- package/dist/capabilities/ultimateIntegrationDemo.d.ts.map +1 -0
- package/dist/capabilities/ultimateIntegrationDemo.js +423 -0
- package/dist/capabilities/ultimateIntegrationDemo.js.map +1 -0
- package/dist/capabilities/unifiedMilitaryCapability.d.ts +63 -0
- package/dist/capabilities/unifiedMilitaryCapability.d.ts.map +1 -0
- package/dist/capabilities/unifiedMilitaryCapability.js +384 -0
- package/dist/capabilities/unifiedMilitaryCapability.js.map +1 -0
- package/dist/capabilities/universalCapabilityFramework.d.ts +352 -0
- package/dist/capabilities/universalCapabilityFramework.d.ts.map +1 -0
- package/dist/capabilities/universalCapabilityFramework.js +1056 -0
- package/dist/capabilities/universalCapabilityFramework.js.map +1 -0
- package/dist/capabilities/universalSecurityCapability.d.ts +46 -0
- package/dist/capabilities/universalSecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/universalSecurityCapability.js +580 -0
- package/dist/capabilities/universalSecurityCapability.js.map +1 -0
- package/dist/capabilities/webCapability.d.ts +23 -0
- package/dist/capabilities/webCapability.d.ts.map +1 -0
- package/dist/capabilities/webCapability.js +33 -0
- package/dist/capabilities/webCapability.js.map +1 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts +31 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.d.ts.map +1 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.js +183 -0
- package/dist/capabilities/zeroDayDiscoveryCapability.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +155 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/agent-profiles.schema.json +43 -0
- package/dist/contracts/agent-schemas.json +466 -0
- package/dist/contracts/models.schema.json +9 -0
- package/dist/contracts/module-schema.json +430 -0
- package/dist/contracts/schemas/agent-profile.schema.json +157 -0
- package/dist/contracts/schemas/agent-rules.schema.json +238 -0
- package/dist/contracts/schemas/agent-schemas.schema.json +528 -0
- package/dist/contracts/schemas/agent.schema.json +90 -0
- package/dist/contracts/schemas/tool-selection.schema.json +174 -0
- package/dist/contracts/tools.schema.json +82 -0
- package/dist/contracts/unified-schema.json +757 -0
- package/dist/contracts/v1/agent.d.ts +179 -0
- package/dist/contracts/v1/agent.d.ts.map +1 -0
- package/dist/contracts/v1/agent.js +8 -0
- package/dist/contracts/v1/agent.js.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts +60 -0
- package/dist/contracts/v1/agentProfileManifest.d.ts.map +1 -0
- package/dist/contracts/v1/agentProfileManifest.js +9 -0
- package/dist/contracts/v1/agentProfileManifest.js.map +1 -0
- package/dist/contracts/v1/agentRules.d.ts +60 -0
- package/dist/contracts/v1/agentRules.d.ts.map +1 -0
- package/dist/contracts/v1/agentRules.js +10 -0
- package/dist/contracts/v1/agentRules.js.map +1 -0
- package/dist/contracts/v1/provider.d.ts +149 -0
- package/dist/contracts/v1/provider.d.ts.map +1 -0
- package/dist/contracts/v1/provider.js +7 -0
- package/dist/contracts/v1/provider.js.map +1 -0
- package/dist/contracts/v1/tool.d.ts +136 -0
- package/dist/contracts/v1/tool.d.ts.map +1 -0
- package/dist/contracts/v1/tool.js +7 -0
- package/dist/contracts/v1/tool.js.map +1 -0
- package/dist/contracts/v1/toolAccess.d.ts +43 -0
- package/dist/contracts/v1/toolAccess.d.ts.map +1 -0
- package/dist/contracts/v1/toolAccess.js +9 -0
- package/dist/contracts/v1/toolAccess.js.map +1 -0
- package/dist/core/agent.d.ts +287 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +1563 -0
- package/dist/core/agent.js.map +1 -0
- package/dist/core/agentProfileManifest.d.ts +3 -0
- package/dist/core/agentProfileManifest.d.ts.map +1 -0
- package/dist/core/agentProfileManifest.js +188 -0
- package/dist/core/agentProfileManifest.js.map +1 -0
- package/dist/core/agentProfiles.d.ts +22 -0
- package/dist/core/agentProfiles.d.ts.map +1 -0
- package/dist/core/agentProfiles.js +35 -0
- package/dist/core/agentProfiles.js.map +1 -0
- package/dist/core/agentRulebook.d.ts +11 -0
- package/dist/core/agentRulebook.d.ts.map +1 -0
- package/dist/core/agentRulebook.js +136 -0
- package/dist/core/agentRulebook.js.map +1 -0
- package/dist/core/agentSchemaLoader.d.ts +131 -0
- package/dist/core/agentSchemaLoader.d.ts.map +1 -0
- package/dist/core/agentSchemaLoader.js +235 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/agiCore.d.ts +290 -0
- package/dist/core/agiCore.d.ts.map +1 -0
- package/dist/core/agiCore.js +1348 -0
- package/dist/core/agiCore.js.map +1 -0
- package/dist/core/aiErrorFixer.d.ts +57 -0
- package/dist/core/aiErrorFixer.d.ts.map +1 -0
- package/dist/core/aiErrorFixer.js +214 -0
- package/dist/core/aiErrorFixer.js.map +1 -0
- package/dist/core/antiTermination.d.ts +226 -0
- package/dist/core/antiTermination.d.ts.map +1 -0
- package/dist/core/antiTermination.js +713 -0
- package/dist/core/antiTermination.js.map +1 -0
- package/dist/core/appleSecurityAudit.d.ts +98 -0
- package/dist/core/appleSecurityAudit.d.ts.map +1 -0
- package/dist/core/appleSecurityAudit.js +505 -0
- package/dist/core/appleSecurityAudit.js.map +1 -0
- package/dist/core/appleSecurityIntegration.d.ts +130 -0
- package/dist/core/appleSecurityIntegration.d.ts.map +1 -0
- package/dist/core/appleSecurityIntegration.js +697 -0
- package/dist/core/appleSecurityIntegration.js.map +1 -0
- package/dist/core/bashCommandGuidance.d.ts +16 -0
- package/dist/core/bashCommandGuidance.d.ts.map +1 -0
- package/dist/core/bashCommandGuidance.js +40 -0
- package/dist/core/bashCommandGuidance.js.map +1 -0
- package/dist/core/constants.d.ts +31 -0
- package/dist/core/constants.d.ts.map +1 -0
- package/dist/core/constants.js +62 -0
- package/dist/core/constants.js.map +1 -0
- package/dist/core/contextManager.d.ts +271 -0
- package/dist/core/contextManager.d.ts.map +1 -0
- package/dist/core/contextManager.js +1073 -0
- package/dist/core/contextManager.js.map +1 -0
- package/dist/core/contextWindow.d.ts +42 -0
- package/dist/core/contextWindow.d.ts.map +1 -0
- package/dist/core/contextWindow.js +123 -0
- package/dist/core/contextWindow.js.map +1 -0
- package/dist/core/customCommands.d.ts +19 -0
- package/dist/core/customCommands.d.ts.map +1 -0
- package/dist/core/customCommands.js +85 -0
- package/dist/core/customCommands.js.map +1 -0
- package/dist/core/deepBugAnalyzer.d.ts +25 -0
- package/dist/core/deepBugAnalyzer.d.ts.map +1 -0
- package/dist/core/deepBugAnalyzer.js +44 -0
- package/dist/core/deepBugAnalyzer.js.map +1 -0
- package/dist/core/dualTournament.d.ts +110 -0
- package/dist/core/dualTournament.d.ts.map +1 -0
- package/dist/core/dualTournament.js +270 -0
- package/dist/core/dualTournament.js.map +1 -0
- package/dist/core/dynamicGuardrails.d.ts +207 -0
- package/dist/core/dynamicGuardrails.d.ts.map +1 -0
- package/dist/core/dynamicGuardrails.js +516 -0
- package/dist/core/dynamicGuardrails.js.map +1 -0
- package/dist/core/embeddingProviders.d.ts +80 -0
- package/dist/core/embeddingProviders.d.ts.map +1 -0
- package/dist/core/embeddingProviders.js +241 -0
- package/dist/core/embeddingProviders.js.map +1 -0
- package/dist/core/episodicMemory.d.ts +259 -0
- package/dist/core/episodicMemory.d.ts.map +1 -0
- package/dist/core/episodicMemory.js +833 -0
- package/dist/core/episodicMemory.js.map +1 -0
- package/dist/core/errors/apiKeyErrors.d.ts +11 -0
- package/dist/core/errors/apiKeyErrors.d.ts.map +1 -0
- package/dist/core/errors/apiKeyErrors.js +159 -0
- package/dist/core/errors/apiKeyErrors.js.map +1 -0
- package/dist/core/errors/errorTypes.d.ts +111 -0
- package/dist/core/errors/errorTypes.d.ts.map +1 -0
- package/dist/core/errors/errorTypes.js +345 -0
- package/dist/core/errors/errorTypes.js.map +1 -0
- package/dist/core/errors/index.d.ts +50 -0
- package/dist/core/errors/index.d.ts.map +1 -0
- package/dist/core/errors/index.js +156 -0
- package/dist/core/errors/index.js.map +1 -0
- package/dist/core/errors/networkErrors.d.ts +14 -0
- package/dist/core/errors/networkErrors.d.ts.map +1 -0
- package/dist/core/errors/networkErrors.js +53 -0
- package/dist/core/errors/networkErrors.js.map +1 -0
- package/dist/core/errors/safetyValidator.d.ts +115 -0
- package/dist/core/errors/safetyValidator.d.ts.map +1 -0
- package/dist/core/errors/safetyValidator.js +302 -0
- package/dist/core/errors/safetyValidator.js.map +1 -0
- package/dist/core/errors.d.ts +4 -0
- package/dist/core/errors.d.ts.map +1 -0
- package/dist/core/errors.js +33 -0
- package/dist/core/errors.js.map +1 -0
- package/dist/core/finalResponseFormatter.d.ts +10 -0
- package/dist/core/finalResponseFormatter.d.ts.map +1 -0
- package/dist/core/finalResponseFormatter.js +14 -0
- package/dist/core/finalResponseFormatter.js.map +1 -0
- package/dist/core/flowProtection.d.ts +154 -0
- package/dist/core/flowProtection.d.ts.map +1 -0
- package/dist/core/flowProtection.js +436 -0
- package/dist/core/flowProtection.js.map +1 -0
- package/dist/core/gitWorktreeManager.d.ts +126 -0
- package/dist/core/gitWorktreeManager.d.ts.map +1 -0
- package/dist/core/gitWorktreeManager.js +403 -0
- package/dist/core/gitWorktreeManager.js.map +1 -0
- package/dist/core/guardrails.d.ts +150 -0
- package/dist/core/guardrails.d.ts.map +1 -0
- package/dist/core/guardrails.js +360 -0
- package/dist/core/guardrails.js.map +1 -0
- package/dist/core/hallucinationGuard.d.ts +57 -0
- package/dist/core/hallucinationGuard.d.ts.map +1 -0
- package/dist/core/hallucinationGuard.js +237 -0
- package/dist/core/hallucinationGuard.js.map +1 -0
- package/dist/core/hooks.d.ts +113 -0
- package/dist/core/hooks.d.ts.map +1 -0
- package/dist/core/hooks.js +364 -0
- package/dist/core/hooks.js.map +1 -0
- package/dist/core/hotReload.d.ts +154 -0
- package/dist/core/hotReload.d.ts.map +1 -0
- package/dist/core/hotReload.js +451 -0
- package/dist/core/hotReload.js.map +1 -0
- package/dist/core/hypothesisEngine.d.ts +27 -0
- package/dist/core/hypothesisEngine.d.ts.map +1 -0
- package/dist/core/hypothesisEngine.js +58 -0
- package/dist/core/hypothesisEngine.js.map +1 -0
- package/dist/core/index.d.ts +26 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +54 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/inputProtection.d.ts +122 -0
- package/dist/core/inputProtection.d.ts.map +1 -0
- package/dist/core/inputProtection.js +421 -0
- package/dist/core/inputProtection.js.map +1 -0
- package/dist/core/liveGCPVerification.d.ts +41 -0
- package/dist/core/liveGCPVerification.d.ts.map +1 -0
- package/dist/core/liveGCPVerification.js +745 -0
- package/dist/core/liveGCPVerification.js.map +1 -0
- package/dist/core/modelDiscovery.d.ts +105 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +740 -0
- package/dist/core/modelDiscovery.js.map +1 -0
- package/dist/core/multilinePasteHandler.d.ts +35 -0
- package/dist/core/multilinePasteHandler.d.ts.map +1 -0
- package/dist/core/multilinePasteHandler.js +80 -0
- package/dist/core/multilinePasteHandler.js.map +1 -0
- package/dist/core/parallel.d.ts +85 -0
- package/dist/core/parallel.d.ts.map +1 -0
- package/dist/core/parallel.js +150 -0
- package/dist/core/parallel.js.map +1 -0
- package/dist/core/parallelCoordinator.d.ts +21 -0
- package/dist/core/parallelCoordinator.d.ts.map +1 -0
- package/dist/core/parallelCoordinator.js +42 -0
- package/dist/core/parallelCoordinator.js.map +1 -0
- package/dist/core/parallelExecutor.d.ts +215 -0
- package/dist/core/parallelExecutor.d.ts.map +1 -0
- package/dist/core/parallelExecutor.js +584 -0
- package/dist/core/parallelExecutor.js.map +1 -0
- package/dist/core/preferences.d.ts +71 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +341 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/productTestHarness.d.ts +46 -0
- package/dist/core/productTestHarness.d.ts.map +1 -0
- package/dist/core/productTestHarness.js +128 -0
- package/dist/core/productTestHarness.js.map +1 -0
- package/dist/core/providerKeys.d.ts +20 -0
- package/dist/core/providerKeys.d.ts.map +1 -0
- package/dist/core/providerKeys.js +40 -0
- package/dist/core/providerKeys.js.map +1 -0
- package/dist/core/realityScore.d.ts +159 -0
- package/dist/core/realityScore.d.ts.map +1 -0
- package/dist/core/realityScore.js +734 -0
- package/dist/core/realityScore.js.map +1 -0
- package/dist/core/repoUpgradeOrchestrator.d.ts +223 -0
- package/dist/core/repoUpgradeOrchestrator.d.ts.map +1 -0
- package/dist/core/repoUpgradeOrchestrator.js +1003 -0
- package/dist/core/repoUpgradeOrchestrator.js.map +1 -0
- package/dist/core/resultVerification.d.ts +47 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +126 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/revenueEnvValidator.d.ts +30 -0
- package/dist/core/revenueEnvValidator.d.ts.map +1 -0
- package/dist/core/revenueEnvValidator.js +241 -0
- package/dist/core/revenueEnvValidator.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +49 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +234 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +48 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +295 -0
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/securityTournament.d.ts +83 -0
- package/dist/core/securityTournament.d.ts.map +1 -0
- package/dist/core/securityTournament.js +357 -0
- package/dist/core/securityTournament.js.map +1 -0
- package/dist/core/selfUpgrade.d.ts +253 -0
- package/dist/core/selfUpgrade.d.ts.map +1 -0
- package/dist/core/selfUpgrade.js +669 -0
- package/dist/core/selfUpgrade.js.map +1 -0
- package/dist/core/sessionStorage.d.ts +10 -0
- package/dist/core/sessionStorage.d.ts.map +1 -0
- package/dist/core/sessionStorage.js +46 -0
- package/dist/core/sessionStorage.js.map +1 -0
- package/dist/core/sessionStore.d.ts +35 -0
- package/dist/core/sessionStore.d.ts.map +1 -0
- package/dist/core/sessionStore.js +191 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/taskCompletionDetector.d.ts +112 -0
- package/dist/core/taskCompletionDetector.d.ts.map +1 -0
- package/dist/core/taskCompletionDetector.js +469 -0
- package/dist/core/taskCompletionDetector.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +34 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -0
- package/dist/core/toolPreconditions.js +242 -0
- package/dist/core/toolPreconditions.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +185 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +412 -0
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/tournamentStrategy.d.ts +12 -0
- package/dist/core/tournamentStrategy.d.ts.map +1 -0
- package/dist/core/tournamentStrategy.js +41 -0
- package/dist/core/tournamentStrategy.js.map +1 -0
- package/dist/core/types/utilityTypes.d.ts +192 -0
- package/dist/core/types/utilityTypes.d.ts.map +1 -0
- package/dist/core/types/utilityTypes.js +272 -0
- package/dist/core/types/utilityTypes.js.map +1 -0
- package/dist/core/types.d.ts +334 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +76 -0
- package/dist/core/types.js.map +1 -0
- package/dist/core/unifiedOrchestrator.d.ts +47 -0
- package/dist/core/unifiedOrchestrator.d.ts.map +1 -0
- package/dist/core/unifiedOrchestrator.js +103 -0
- package/dist/core/unifiedOrchestrator.js.map +1 -0
- package/dist/core/universalSecurityAudit.d.ts +104 -0
- package/dist/core/universalSecurityAudit.d.ts.map +1 -0
- package/dist/core/universalSecurityAudit.js +2190 -0
- package/dist/core/universalSecurityAudit.js.map +1 -0
- package/dist/core/updateChecker.d.ts +148 -0
- package/dist/core/updateChecker.d.ts.map +1 -0
- package/dist/core/updateChecker.js +593 -0
- package/dist/core/updateChecker.js.map +1 -0
- package/dist/core/variantExecution.d.ts +23 -0
- package/dist/core/variantExecution.d.ts.map +1 -0
- package/dist/core/variantExecution.js +58 -0
- package/dist/core/variantExecution.js.map +1 -0
- package/dist/core/winnerStrategy.d.ts +15 -0
- package/dist/core/winnerStrategy.d.ts.map +1 -0
- package/dist/core/winnerStrategy.js +18 -0
- package/dist/core/winnerStrategy.js.map +1 -0
- package/dist/core/zeroDayDiscovery.d.ts +96 -0
- package/dist/core/zeroDayDiscovery.d.ts.map +1 -0
- package/dist/core/zeroDayDiscovery.js +358 -0
- package/dist/core/zeroDayDiscovery.js.map +1 -0
- package/dist/headless/interactiveShell.d.ts +22 -0
- package/dist/headless/interactiveShell.d.ts.map +1 -0
- package/dist/headless/interactiveShell.js +3799 -0
- package/dist/headless/interactiveShell.js.map +1 -0
- package/dist/headless/quickMode.d.ts +26 -0
- package/dist/headless/quickMode.d.ts.map +1 -0
- package/dist/headless/quickMode.js +226 -0
- package/dist/headless/quickMode.js.map +1 -0
- package/dist/orchestration/index.d.ts +10 -0
- package/dist/orchestration/index.d.ts.map +1 -0
- package/dist/orchestration/index.js +13 -0
- package/dist/orchestration/index.js.map +1 -0
- package/dist/orchestration/repoUpgradeRunner.d.ts +44 -0
- package/dist/orchestration/repoUpgradeRunner.d.ts.map +1 -0
- package/dist/orchestration/repoUpgradeRunner.js +375 -0
- package/dist/orchestration/repoUpgradeRunner.js.map +1 -0
- package/dist/orchestration/securityAuditRunner.d.ts +144 -0
- package/dist/orchestration/securityAuditRunner.d.ts.map +1 -0
- package/dist/orchestration/securityAuditRunner.js +526 -0
- package/dist/orchestration/securityAuditRunner.js.map +1 -0
- package/dist/plugins/index.d.ts +49 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/index.js +105 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/deepseek/index.d.ts +11 -0
- package/dist/plugins/providers/deepseek/index.d.ts.map +1 -0
- package/dist/plugins/providers/deepseek/index.js +54 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/index.d.ts +2 -0
- package/dist/plugins/providers/index.d.ts.map +1 -0
- package/dist/plugins/providers/index.js +11 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts +3 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js +27 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.js.map +1 -0
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts +3 -0
- package/dist/plugins/tools/apple/secureApplePlugin.d.ts.map +1 -0
- package/dist/plugins/tools/apple/secureApplePlugin.js +26 -0
- package/dist/plugins/tools/apple/secureApplePlugin.js.map +1 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts +3 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js +9 -0
- package/dist/plugins/tools/authorizedSecurity/authorizedSecurityPlugin.js.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts +3 -0
- package/dist/plugins/tools/bash/localBashPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bash/localBashPlugin.js +14 -0
- package/dist/plugins/tools/bash/localBashPlugin.js.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts +3 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js +27 -0
- package/dist/plugins/tools/bidirectionalAudit/bidirectionalAuditPlugin.js.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts +9 -0
- package/dist/plugins/tools/edit/editPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/edit/editPlugin.js +15 -0
- package/dist/plugins/tools/edit/editPlugin.js.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts +3 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js +9 -0
- package/dist/plugins/tools/enhancedGit/enhancedGitPlugin.js.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts +3 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js +14 -0
- package/dist/plugins/tools/filesystem/localFilesystemPlugin.js.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts +3 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js +9 -0
- package/dist/plugins/tools/gitHistory/gitHistoryPlugin.js.map +1 -0
- package/dist/plugins/tools/index.d.ts +3 -0
- package/dist/plugins/tools/index.d.ts.map +1 -0
- package/dist/plugins/tools/index.js +3 -0
- package/dist/plugins/tools/index.js.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts +3 -0
- package/dist/plugins/tools/integrity/integrityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js +31 -0
- package/dist/plugins/tools/integrity/integrityPlugin.js.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts +3 -0
- package/dist/plugins/tools/mcp/mcpPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js +27 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +15 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +37 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts +3 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js +9 -0
- package/dist/plugins/tools/offensiveDestruction/offensiveDestructionPlugin.js.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts +3 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js +340 -0
- package/dist/plugins/tools/orchestration/orchestrationPlugin.js.map +1 -0
- package/dist/plugins/tools/registry.d.ts +22 -0
- package/dist/plugins/tools/registry.d.ts.map +1 -0
- package/dist/plugins/tools/registry.js +58 -0
- package/dist/plugins/tools/registry.js.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts +3 -0
- package/dist/plugins/tools/search/localSearchPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/search/localSearchPlugin.js +14 -0
- package/dist/plugins/tools/search/localSearchPlugin.js.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts +3 -0
- package/dist/plugins/tools/skills/skillPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/skills/skillPlugin.js +27 -0
- package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts +3 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.js +37 -0
- package/dist/plugins/tools/tao/secureTaoPlugin.js.map +1 -0
- package/dist/providers/baseProvider.d.ts +148 -0
- package/dist/providers/baseProvider.d.ts.map +1 -0
- package/dist/providers/baseProvider.js +284 -0
- package/dist/providers/baseProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +64 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +1000 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +22 -0
- package/dist/providers/providerFactory.d.ts.map +1 -0
- package/dist/providers/providerFactory.js +25 -0
- package/dist/providers/providerFactory.js.map +1 -0
- package/dist/providers/resilientProvider.d.ts +103 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +462 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +114 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +693 -0
- package/dist/runtime/agentController.js.map +1 -0
- package/dist/runtime/agentHost.d.ts +61 -0
- package/dist/runtime/agentHost.d.ts.map +1 -0
- package/dist/runtime/agentHost.js +157 -0
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +45 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +210 -0
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/agentWorkerPool.d.ts +167 -0
- package/dist/runtime/agentWorkerPool.d.ts.map +1 -0
- package/dist/runtime/agentWorkerPool.js +435 -0
- package/dist/runtime/agentWorkerPool.js.map +1 -0
- package/dist/runtime/node.d.ts +7 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +24 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +18 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +21 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/shell/autoExecutor.d.ts +70 -0
- package/dist/shell/autoExecutor.d.ts.map +1 -0
- package/dist/shell/autoExecutor.js +320 -0
- package/dist/shell/autoExecutor.js.map +1 -0
- package/dist/shell/commandRegistry.d.ts +122 -0
- package/dist/shell/commandRegistry.d.ts.map +1 -0
- package/dist/shell/commandRegistry.js +386 -0
- package/dist/shell/commandRegistry.js.map +1 -0
- package/dist/shell/composableMessage.d.ts +183 -0
- package/dist/shell/composableMessage.d.ts.map +1 -0
- package/dist/shell/composableMessage.js +420 -0
- package/dist/shell/composableMessage.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +27 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +53 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +12 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +16 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/vimMode.d.ts +66 -0
- package/dist/shell/vimMode.d.ts.map +1 -0
- package/dist/shell/vimMode.js +435 -0
- package/dist/shell/vimMode.js.map +1 -0
- package/dist/tools/bashTools.d.ts +6 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +485 -0
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +43 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +607 -0
- package/dist/tools/diffUtils.js.map +1 -0
- package/dist/tools/editTools.d.ts +29 -0
- package/dist/tools/editTools.d.ts.map +1 -0
- package/dist/tools/editTools.js +702 -0
- package/dist/tools/editTools.js.map +1 -0
- package/dist/tools/emailTools.d.ts +140 -0
- package/dist/tools/emailTools.d.ts.map +1 -0
- package/dist/tools/emailTools.js +792 -0
- package/dist/tools/emailTools.js.map +1 -0
- package/dist/tools/fileReadTracker.d.ts +69 -0
- package/dist/tools/fileReadTracker.d.ts.map +1 -0
- package/dist/tools/fileReadTracker.js +213 -0
- package/dist/tools/fileReadTracker.js.map +1 -0
- package/dist/tools/fileTools.d.ts +3 -0
- package/dist/tools/fileTools.d.ts.map +1 -0
- package/dist/tools/fileTools.js +342 -0
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/grepTools.d.ts +3 -0
- package/dist/tools/grepTools.d.ts.map +1 -0
- package/dist/tools/grepTools.js +129 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/humanOpsTools.d.ts +3 -0
- package/dist/tools/humanOpsTools.d.ts.map +1 -0
- package/dist/tools/humanOpsTools.js +86 -0
- package/dist/tools/humanOpsTools.js.map +1 -0
- package/dist/tools/localExplore.d.ts +38 -0
- package/dist/tools/localExplore.d.ts.map +1 -0
- package/dist/tools/localExplore.js +30 -0
- package/dist/tools/localExplore.js.map +1 -0
- package/dist/tools/metaTools.d.ts +3 -0
- package/dist/tools/metaTools.d.ts.map +1 -0
- package/dist/tools/metaTools.js +148 -0
- package/dist/tools/metaTools.js.map +1 -0
- package/dist/tools/planningTools.d.ts +12 -0
- package/dist/tools/planningTools.d.ts.map +1 -0
- package/dist/tools/planningTools.js +75 -0
- package/dist/tools/planningTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +12 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +370 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/secureAppleExploitation.d.ts +29 -0
- package/dist/tools/secureAppleExploitation.d.ts.map +1 -0
- package/dist/tools/secureAppleExploitation.js +518 -0
- package/dist/tools/secureAppleExploitation.js.map +1 -0
- package/dist/tools/telemetryTools.d.ts +5 -0
- package/dist/tools/telemetryTools.d.ts.map +1 -0
- package/dist/tools/telemetryTools.js +9 -0
- package/dist/tools/telemetryTools.js.map +1 -0
- package/dist/tools/unifiedOps.d.ts +3 -0
- package/dist/tools/unifiedOps.d.ts.map +1 -0
- package/dist/tools/unifiedOps.js +57 -0
- package/dist/tools/unifiedOps.js.map +1 -0
- package/dist/tools/webTools.d.ts +26 -0
- package/dist/tools/webTools.d.ts.map +1 -0
- package/dist/tools/webTools.js +227 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/ui/PromptController.d.ts +174 -0
- package/dist/ui/PromptController.d.ts.map +1 -0
- package/dist/ui/PromptController.js +351 -0
- package/dist/ui/PromptController.js.map +1 -0
- package/dist/ui/UnifiedUIRenderer.d.ts +779 -0
- package/dist/ui/UnifiedUIRenderer.d.ts.map +1 -0
- package/dist/ui/UnifiedUIRenderer.js +5458 -0
- package/dist/ui/UnifiedUIRenderer.js.map +1 -0
- package/dist/ui/animatedStatus.d.ts +140 -0
- package/dist/ui/animatedStatus.d.ts.map +1 -0
- package/dist/ui/animatedStatus.js +480 -0
- package/dist/ui/animatedStatus.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +197 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +440 -0
- package/dist/ui/animation/AnimationScheduler.js.map +1 -0
- package/dist/ui/codeHighlighter.d.ts +6 -0
- package/dist/ui/codeHighlighter.d.ts.map +1 -0
- package/dist/ui/codeHighlighter.js +855 -0
- package/dist/ui/codeHighlighter.js.map +1 -0
- package/dist/ui/designSystem.d.ts +26 -0
- package/dist/ui/designSystem.d.ts.map +1 -0
- package/dist/ui/designSystem.js +114 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/errorFormatter.d.ts +64 -0
- package/dist/ui/errorFormatter.d.ts.map +1 -0
- package/dist/ui/errorFormatter.js +316 -0
- package/dist/ui/errorFormatter.js.map +1 -0
- package/dist/ui/globalWriteLock.d.ts +63 -0
- package/dist/ui/globalWriteLock.d.ts.map +1 -0
- package/dist/ui/globalWriteLock.js +173 -0
- package/dist/ui/globalWriteLock.js.map +1 -0
- package/dist/ui/index.d.ts +32 -0
- package/dist/ui/index.d.ts.map +1 -0
- package/dist/ui/index.js +54 -0
- package/dist/ui/index.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +157 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +501 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/layout.d.ts +27 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +184 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/maxOffensiveUkraineUI.d.ts +94 -0
- package/dist/ui/maxOffensiveUkraineUI.d.ts.map +1 -0
- package/dist/ui/maxOffensiveUkraineUI.js +316 -0
- package/dist/ui/maxOffensiveUkraineUI.js.map +1 -0
- package/dist/ui/outputMode.d.ts +44 -0
- package/dist/ui/outputMode.d.ts.map +1 -0
- package/dist/ui/outputMode.js +123 -0
- package/dist/ui/outputMode.js.map +1 -0
- package/dist/ui/overlay/OverlayManager.d.ts +105 -0
- package/dist/ui/overlay/OverlayManager.d.ts.map +1 -0
- package/dist/ui/overlay/OverlayManager.js +291 -0
- package/dist/ui/overlay/OverlayManager.js.map +1 -0
- package/dist/ui/premiumComponents.d.ts +54 -0
- package/dist/ui/premiumComponents.d.ts.map +1 -0
- package/dist/ui/premiumComponents.js +241 -0
- package/dist/ui/premiumComponents.js.map +1 -0
- package/dist/ui/richText.d.ts +13 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +443 -0
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts +22 -0
- package/dist/ui/telemetry/ResponseTracker.d.ts.map +1 -0
- package/dist/ui/telemetry/ResponseTracker.js +60 -0
- package/dist/ui/telemetry/ResponseTracker.js.map +1 -0
- package/dist/ui/telemetry/UITelemetry.d.ts +181 -0
- package/dist/ui/telemetry/UITelemetry.d.ts.map +1 -0
- package/dist/ui/telemetry/UITelemetry.js +446 -0
- package/dist/ui/telemetry/UITelemetry.js.map +1 -0
- package/dist/ui/textHighlighter.d.ts +83 -0
- package/dist/ui/textHighlighter.d.ts.map +1 -0
- package/dist/ui/textHighlighter.js +267 -0
- package/dist/ui/textHighlighter.js.map +1 -0
- package/dist/ui/theme.d.ts +364 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +471 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/toolDisplay.d.ts +221 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -0
- package/dist/ui/toolDisplay.js +1654 -0
- package/dist/ui/toolDisplay.js.map +1 -0
- package/dist/ui/uiConstants.d.ts +288 -0
- package/dist/ui/uiConstants.d.ts.map +1 -0
- package/dist/ui/uiConstants.js +472 -0
- package/dist/ui/uiConstants.js.map +1 -0
- package/dist/utils/askUserPrompt.d.ts +21 -0
- package/dist/utils/askUserPrompt.d.ts.map +1 -0
- package/dist/utils/askUserPrompt.js +87 -0
- package/dist/utils/askUserPrompt.js.map +1 -0
- package/dist/utils/asyncUtils.d.ts +95 -0
- package/dist/utils/asyncUtils.d.ts.map +1 -0
- package/dist/utils/asyncUtils.js +286 -0
- package/dist/utils/asyncUtils.js.map +1 -0
- package/dist/utils/debugLogger.d.ts +6 -0
- package/dist/utils/debugLogger.d.ts.map +1 -0
- package/dist/utils/debugLogger.js +39 -0
- package/dist/utils/debugLogger.js.map +1 -0
- package/dist/utils/errorUtils.d.ts +12 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +83 -0
- package/dist/utils/errorUtils.js.map +1 -0
- package/dist/utils/frontmatter.d.ts +10 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +78 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/packageInfo.d.ts +14 -0
- package/dist/utils/packageInfo.d.ts.map +1 -0
- package/dist/utils/packageInfo.js +45 -0
- package/dist/utils/packageInfo.js.map +1 -0
- package/dist/utils/planFormatter.d.ts +34 -0
- package/dist/utils/planFormatter.d.ts.map +1 -0
- package/dist/utils/planFormatter.js +141 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/dist/utils/securityUtils.d.ts +132 -0
- package/dist/utils/securityUtils.d.ts.map +1 -0
- package/dist/utils/securityUtils.js +324 -0
- package/dist/utils/securityUtils.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +134 -0
- package/dist/workspace.js.map +1 -0
- package/dist/workspace.validator.d.ts +49 -0
- package/dist/workspace.validator.d.ts.map +1 -0
- package/dist/workspace.validator.js +215 -0
- package/dist/workspace.validator.js.map +1 -0
- package/package.json +108 -0
|
@@ -0,0 +1,1654 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool Display Formatter - AGI CLI style
|
|
3
|
+
*
|
|
4
|
+
* Implements the clean, informative tool execution display that AGI CLI uses:
|
|
5
|
+
* - Tool call indicators with inline args
|
|
6
|
+
* - Result summaries with status indicators
|
|
7
|
+
* - Expandable content with previews
|
|
8
|
+
* - Diff formatting with colors
|
|
9
|
+
* - Advanced progress indicators
|
|
10
|
+
* - Compact same-line displays
|
|
11
|
+
*/
|
|
12
|
+
import { formatPlan, normalizePlanItems, resolvePlanWidth, wrapPlanText } from '../utils/planFormatter.js';
|
|
13
|
+
import { theme, icons, progressChars, formatToolName, getToolColor } from './theme.js';
|
|
14
|
+
import { TRUNCATE, ELLIPSIS, PROGRESS, DISPLAY_LIMITS, UI_STRINGS, truncateString, calculatePercentage, clampPercentage, getCoverageColor, formatDurationMs, } from './uiConstants.js';
|
|
15
|
+
/**
|
|
16
|
+
* Format tool call display (AGI CLI style)
|
|
17
|
+
*
|
|
18
|
+
* Example output:
|
|
19
|
+
* ⏺ [Read] src/core/agent.ts
|
|
20
|
+
* ⏺ [Search] pattern: "TODO|FIXME", output_mode: "content", head_limit: 15
|
|
21
|
+
*/
|
|
22
|
+
export function formatToolCall(call, options = {}) {
|
|
23
|
+
const includePrefix = options.includePrefix ?? true;
|
|
24
|
+
const symbol = includePrefix ? `${theme.info('⏺')} ` : '';
|
|
25
|
+
// Use category-specific coloring for tool names
|
|
26
|
+
const toolNameDisplay = formatToolName(call.name);
|
|
27
|
+
// Format args inline (only show relevant ones)
|
|
28
|
+
const argsDisplay = formatInlineArgs(call.args);
|
|
29
|
+
return `${symbol}${toolNameDisplay}${argsDisplay ? ` ${argsDisplay}` : ''}`;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Format tool result display (AGI CLI style)
|
|
33
|
+
*
|
|
34
|
+
* Example output:
|
|
35
|
+
* ⎿ Read 340 lines
|
|
36
|
+
* ⎿ Found 15 lines
|
|
37
|
+
* ⎿ Completed
|
|
38
|
+
*/
|
|
39
|
+
export function formatToolResult(result, options = {}) {
|
|
40
|
+
const includePrefix = options.includePrefix ?? true;
|
|
41
|
+
const prefix = includePrefix
|
|
42
|
+
? result.status === 'error'
|
|
43
|
+
? `${theme.error('⎿')} `
|
|
44
|
+
: `${theme.success('⎿')} `
|
|
45
|
+
: '';
|
|
46
|
+
const output = `${prefix}${result.summary}`;
|
|
47
|
+
return output;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Format inline args for tool call display
|
|
51
|
+
* Keeps it concise, shows only non-default values
|
|
52
|
+
* Prioritizes important args like paths, patterns, commands
|
|
53
|
+
*/
|
|
54
|
+
function formatInlineArgs(args) {
|
|
55
|
+
// Priority order for different argument types
|
|
56
|
+
const priorityArgs = [
|
|
57
|
+
'file_path', 'path', 'pattern', 'command', 'query', 'url',
|
|
58
|
+
'timeout', 'output_mode', 'glob', 'type', 'head_limit', 'offset',
|
|
59
|
+
];
|
|
60
|
+
// Special handling for specific args
|
|
61
|
+
const skipDefaults = new Set([
|
|
62
|
+
'dangerouslyDisableSandbox',
|
|
63
|
+
'run_in_background',
|
|
64
|
+
'description',
|
|
65
|
+
]);
|
|
66
|
+
const formattedArgs = [];
|
|
67
|
+
for (const [key, value] of Object.entries(args)) {
|
|
68
|
+
// Skip empty/null/undefined
|
|
69
|
+
if (value === null || value === undefined || value === '')
|
|
70
|
+
continue;
|
|
71
|
+
// Skip common defaults
|
|
72
|
+
if (skipDefaults.has(key))
|
|
73
|
+
continue;
|
|
74
|
+
if (key === 'path' && value === '.')
|
|
75
|
+
continue;
|
|
76
|
+
if (key === 'format' && value === 'plain')
|
|
77
|
+
continue;
|
|
78
|
+
if (key === 'output_mode' && value === 'files_with_matches')
|
|
79
|
+
continue;
|
|
80
|
+
// Determine priority
|
|
81
|
+
const priority = priorityArgs.indexOf(key);
|
|
82
|
+
const actualPriority = priority === -1 ? 999 : priority;
|
|
83
|
+
// Format value
|
|
84
|
+
let formatted;
|
|
85
|
+
if (key === 'timeout') {
|
|
86
|
+
const numericTimeout = typeof value === 'number' ? value : Number(value);
|
|
87
|
+
if (Number.isFinite(numericTimeout) && numericTimeout >= 0) {
|
|
88
|
+
formatted = formatDuration(numericTimeout);
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
formatted = String(value);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
else if (typeof value === 'string') {
|
|
95
|
+
// Preserve full paths/commands/patterns for copy/paste fidelity
|
|
96
|
+
if (key === 'file_path' || key === 'path') {
|
|
97
|
+
formatted = value;
|
|
98
|
+
}
|
|
99
|
+
else if (key === 'pattern' || key === 'query') {
|
|
100
|
+
formatted = `"${value}"`;
|
|
101
|
+
}
|
|
102
|
+
else if (key === 'command') {
|
|
103
|
+
formatted = `"${value}"`;
|
|
104
|
+
}
|
|
105
|
+
else {
|
|
106
|
+
// Regular string truncation for less critical values
|
|
107
|
+
if (value.length > TRUNCATE.DESCRIPTION) {
|
|
108
|
+
formatted = `"${truncateString(value, TRUNCATE.DESCRIPTION - 2)}"`;
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
formatted = `"${value}"`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if (typeof value === 'boolean') {
|
|
116
|
+
// Only show boolean if true (false is usually default)
|
|
117
|
+
if (!value)
|
|
118
|
+
continue;
|
|
119
|
+
formatted = 'true';
|
|
120
|
+
}
|
|
121
|
+
else if (typeof value === 'number') {
|
|
122
|
+
formatted = String(value);
|
|
123
|
+
}
|
|
124
|
+
else if (Array.isArray(value)) {
|
|
125
|
+
// Show array length
|
|
126
|
+
formatted = `[${value.length} items]`;
|
|
127
|
+
}
|
|
128
|
+
else {
|
|
129
|
+
formatted = JSON.stringify(value);
|
|
130
|
+
}
|
|
131
|
+
formattedArgs.push({ key, value: formatted, priority: actualPriority });
|
|
132
|
+
}
|
|
133
|
+
// Sort by priority and limit to most important args
|
|
134
|
+
formattedArgs.sort((a, b) => a.priority - b.priority);
|
|
135
|
+
const displayArgs = formattedArgs.slice(0, DISPLAY_LIMITS.MAX_INLINE_ARGS);
|
|
136
|
+
if (displayArgs.length === 0) {
|
|
137
|
+
return '';
|
|
138
|
+
}
|
|
139
|
+
// Format as inline args
|
|
140
|
+
const argStrings = displayArgs.map(arg => {
|
|
141
|
+
// For primary args (path, pattern, command), show value directly
|
|
142
|
+
if (['file_path', 'path', 'pattern', 'command', 'query', 'url'].includes(arg.key)) {
|
|
143
|
+
return arg.value;
|
|
144
|
+
}
|
|
145
|
+
// For others, show key: value
|
|
146
|
+
return `${arg.key}: ${arg.value}`;
|
|
147
|
+
});
|
|
148
|
+
return `(${argStrings.join(', ')})`;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Preserve full paths for display (no ellipsis)
|
|
152
|
+
* Ensures copy/paste fidelity for tooling output.
|
|
153
|
+
*/
|
|
154
|
+
function truncatePathForDisplay(path, _maxLength) {
|
|
155
|
+
return path;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Format expandable content preview
|
|
159
|
+
*
|
|
160
|
+
* Example:
|
|
161
|
+
* import { foo } from 'bar';
|
|
162
|
+
* … +312 lines
|
|
163
|
+
*/
|
|
164
|
+
export function formatExpandablePreview(content, maxLines = DISPLAY_LIMITS.PREVIEW_LINES) {
|
|
165
|
+
// Input validation
|
|
166
|
+
if (!content || maxLines < 1) {
|
|
167
|
+
return { preview: '', isExpanded: true, totalLines: 0 };
|
|
168
|
+
}
|
|
169
|
+
const lines = content.split('\n');
|
|
170
|
+
const totalLines = lines.length;
|
|
171
|
+
if (totalLines <= maxLines) {
|
|
172
|
+
return {
|
|
173
|
+
preview: content,
|
|
174
|
+
isExpanded: true,
|
|
175
|
+
totalLines,
|
|
176
|
+
};
|
|
177
|
+
}
|
|
178
|
+
// Show first N lines
|
|
179
|
+
const previewLines = lines.slice(0, maxLines);
|
|
180
|
+
const remainingLines = totalLines - maxLines;
|
|
181
|
+
const expandHint = theme.ui.muted(`${ELLIPSIS} +${remainingLines} lines (${UI_STRINGS.EXPAND_HINT})`);
|
|
182
|
+
previewLines.push(`${expandHint}`);
|
|
183
|
+
return {
|
|
184
|
+
preview: previewLines.join('\n'),
|
|
185
|
+
isExpanded: false,
|
|
186
|
+
totalLines,
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Format diff output (AGI CLI style)
|
|
191
|
+
*
|
|
192
|
+
* Example:
|
|
193
|
+
* Update(src/core/agent.ts)
|
|
194
|
+
* ⎿ Updated src/core/agent.ts with 2 additions and 1 removal
|
|
195
|
+
* 75 private async processConversation(): Promise<string> {
|
|
196
|
+
* 76 while (true) {
|
|
197
|
+
* 77 - this.pruneMessagesIfNeeded();
|
|
198
|
+
* 77 + await this.pruneMessagesIfNeeded();
|
|
199
|
+
* 78
|
|
200
|
+
*/
|
|
201
|
+
export function formatDiff(diff) {
|
|
202
|
+
const lines = [];
|
|
203
|
+
for (const line of diff) {
|
|
204
|
+
let formatted;
|
|
205
|
+
switch (line.type) {
|
|
206
|
+
case 'add': {
|
|
207
|
+
// Green + with line number
|
|
208
|
+
const addNum = line.lineNumber ? theme.ui.muted(String(line.lineNumber).padStart(6)) : ' ';
|
|
209
|
+
const addSymbol = theme.diff.added('+');
|
|
210
|
+
const addContent = theme.diff.added(line.content);
|
|
211
|
+
formatted = `${addNum} ${addSymbol} ${addContent}`;
|
|
212
|
+
break;
|
|
213
|
+
}
|
|
214
|
+
case 'remove': {
|
|
215
|
+
// Red - with line number
|
|
216
|
+
const remNum = line.lineNumber ? theme.ui.muted(String(line.lineNumber).padStart(6)) : ' ';
|
|
217
|
+
const remSymbol = theme.diff.removed('-');
|
|
218
|
+
const remContent = theme.diff.removed(line.content);
|
|
219
|
+
formatted = `${remNum} ${remSymbol} ${remContent}`;
|
|
220
|
+
break;
|
|
221
|
+
}
|
|
222
|
+
case 'context': {
|
|
223
|
+
// Gray line number, regular content
|
|
224
|
+
const ctxNum = line.lineNumber ? theme.ui.muted(String(line.lineNumber).padStart(6)) : ' ';
|
|
225
|
+
formatted = `${ctxNum} ${line.content}`;
|
|
226
|
+
break;
|
|
227
|
+
}
|
|
228
|
+
case 'info': {
|
|
229
|
+
// Special info line (file headers, etc.)
|
|
230
|
+
formatted = theme.diff.header(line.content);
|
|
231
|
+
break;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
lines.push(formatted);
|
|
235
|
+
}
|
|
236
|
+
return lines.join('\n');
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Format diff summary
|
|
240
|
+
* Example: "Updated src/core/agent.ts with 2 additions and 1 removal"
|
|
241
|
+
*/
|
|
242
|
+
export function formatDiffSummary(file, additions, removals) {
|
|
243
|
+
const parts = ['Updated', file, 'with'];
|
|
244
|
+
if (additions > 0) {
|
|
245
|
+
parts.push(theme.diff.added(`${additions} addition${additions === 1 ? '' : 's'}`));
|
|
246
|
+
}
|
|
247
|
+
if (removals > 0) {
|
|
248
|
+
if (additions > 0) {
|
|
249
|
+
parts.push('and');
|
|
250
|
+
}
|
|
251
|
+
parts.push(theme.diff.removed(`${removals} removal${removals === 1 ? '' : 's'}`));
|
|
252
|
+
}
|
|
253
|
+
return parts.join(' ');
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Box drawing characters for advanced edit display
|
|
257
|
+
*/
|
|
258
|
+
const BOX = {
|
|
259
|
+
topLeft: '╭',
|
|
260
|
+
topRight: '╮',
|
|
261
|
+
bottomLeft: '╰',
|
|
262
|
+
bottomRight: '╯',
|
|
263
|
+
horizontal: '─',
|
|
264
|
+
vertical: '│',
|
|
265
|
+
leftT: '├',
|
|
266
|
+
rightT: '┤',
|
|
267
|
+
cross: '┼',
|
|
268
|
+
};
|
|
269
|
+
/**
|
|
270
|
+
* Format edit result with advanced graphics
|
|
271
|
+
* Creates a visually distinct, easy-to-read display for file edits
|
|
272
|
+
*
|
|
273
|
+
* Example output:
|
|
274
|
+
* ╭──────────────────────────────────────────────────────────╮
|
|
275
|
+
* │ ✏️ EDIT src/core/agent.ts │
|
|
276
|
+
* ├──────────────────────────────────────────────────────────┤
|
|
277
|
+
* │ 77 │ - this.pruneMessagesIfNeeded(); │
|
|
278
|
+
* │ 77 │ + await this.pruneMessagesIfNeeded(); │
|
|
279
|
+
* ├──────────────────────────────────────────────────────────┤
|
|
280
|
+
* │ 📊 Summary: +1 line, -1 line │
|
|
281
|
+
* ╰──────────────────────────────────────────────────────────╯
|
|
282
|
+
*/
|
|
283
|
+
export function formatAdvancedEdit(filePath, oldString, newString, options = {}) {
|
|
284
|
+
const maxWidth = options.maxWidth ?? 70;
|
|
285
|
+
const lineNum = options.lineNumber ?? 0;
|
|
286
|
+
const lines = [];
|
|
287
|
+
// Truncate file path if needed
|
|
288
|
+
const displayPath = filePath.length > maxWidth - 20
|
|
289
|
+
? '...' + filePath.slice(-(maxWidth - 23))
|
|
290
|
+
: filePath;
|
|
291
|
+
// Calculate content widths
|
|
292
|
+
const innerWidth = maxWidth - 4; // Account for box borders and padding
|
|
293
|
+
// Helper to pad/truncate lines
|
|
294
|
+
const padLine = (content, width) => {
|
|
295
|
+
const stripped = stripAnsi(content);
|
|
296
|
+
if (stripped.length >= width) {
|
|
297
|
+
return content.slice(0, width - 3) + '...';
|
|
298
|
+
}
|
|
299
|
+
return content + ' '.repeat(width - stripped.length);
|
|
300
|
+
};
|
|
301
|
+
// Top border with header
|
|
302
|
+
const topBorder = `${BOX.topLeft}${BOX.horizontal.repeat(maxWidth - 2)}${BOX.topRight}`;
|
|
303
|
+
lines.push(theme.edit.separator(topBorder));
|
|
304
|
+
// Header line with file path
|
|
305
|
+
const headerIcon = '✏️ ';
|
|
306
|
+
const badge = theme.edit.badge(' EDIT ');
|
|
307
|
+
const pathDisplay = theme.edit.filePath(displayPath);
|
|
308
|
+
const replaceAllNote = options.replaceAll ? theme.ui.muted(' (all occurrences)') : '';
|
|
309
|
+
const headerContent = `${headerIcon}${badge} ${pathDisplay}${replaceAllNote}`;
|
|
310
|
+
const headerPadded = padLine(headerContent, innerWidth);
|
|
311
|
+
lines.push(`${theme.edit.separator(BOX.vertical)} ${headerPadded} ${theme.edit.separator(BOX.vertical)}`);
|
|
312
|
+
// Separator
|
|
313
|
+
const separator = `${BOX.leftT}${BOX.horizontal.repeat(maxWidth - 2)}${BOX.rightT}`;
|
|
314
|
+
lines.push(theme.edit.separator(separator));
|
|
315
|
+
// Process removed lines
|
|
316
|
+
const oldLines = oldString.split('\n');
|
|
317
|
+
const newLines = newString.split('\n');
|
|
318
|
+
// Show removed lines (old content)
|
|
319
|
+
for (let i = 0; i < oldLines.length; i++) {
|
|
320
|
+
const lineNo = lineNum > 0 ? String(lineNum + i).padStart(4) : ' ';
|
|
321
|
+
const lineContent = oldLines[i] || '';
|
|
322
|
+
const truncated = lineContent.length > innerWidth - 12
|
|
323
|
+
? lineContent.slice(0, innerWidth - 15) + '...'
|
|
324
|
+
: lineContent;
|
|
325
|
+
const lineNumDisplay = theme.edit.lineNumber(lineNo);
|
|
326
|
+
const symbol = theme.edit.removedLine('−');
|
|
327
|
+
const content = theme.edit.removedBg(` ${truncated} `);
|
|
328
|
+
const fullLine = `${lineNumDisplay} ${theme.edit.separator('│')} ${symbol} ${content}`;
|
|
329
|
+
const padded = padLine(fullLine, innerWidth);
|
|
330
|
+
lines.push(`${theme.edit.separator(BOX.vertical)} ${padded} ${theme.edit.separator(BOX.vertical)}`);
|
|
331
|
+
}
|
|
332
|
+
// Visual separator between old and new
|
|
333
|
+
if (oldLines.length > 0 && newLines.length > 0) {
|
|
334
|
+
const arrowLine = ' ' + theme.edit.separator('│') + ' ' + theme.ui.muted('↓'.repeat(Math.min(20, innerWidth - 10)));
|
|
335
|
+
const arrowPadded = padLine(arrowLine, innerWidth);
|
|
336
|
+
lines.push(`${theme.edit.separator(BOX.vertical)} ${arrowPadded} ${theme.edit.separator(BOX.vertical)}`);
|
|
337
|
+
}
|
|
338
|
+
// Show added lines (new content)
|
|
339
|
+
for (let i = 0; i < newLines.length; i++) {
|
|
340
|
+
const lineNo = lineNum > 0 ? String(lineNum + i).padStart(4) : ' ';
|
|
341
|
+
const lineContent = newLines[i] || '';
|
|
342
|
+
const truncated = lineContent.length > innerWidth - 12
|
|
343
|
+
? lineContent.slice(0, innerWidth - 15) + '...'
|
|
344
|
+
: lineContent;
|
|
345
|
+
const lineNumDisplay = theme.edit.lineNumber(lineNo);
|
|
346
|
+
const symbol = theme.edit.addedLine('+');
|
|
347
|
+
const content = theme.edit.addedBg(` ${truncated} `);
|
|
348
|
+
const fullLine = `${lineNumDisplay} ${theme.edit.separator('│')} ${symbol} ${content}`;
|
|
349
|
+
const padded = padLine(fullLine, innerWidth);
|
|
350
|
+
lines.push(`${theme.edit.separator(BOX.vertical)} ${padded} ${theme.edit.separator(BOX.vertical)}`);
|
|
351
|
+
}
|
|
352
|
+
// Summary separator
|
|
353
|
+
lines.push(theme.edit.separator(separator));
|
|
354
|
+
// Summary line
|
|
355
|
+
const addCount = newLines.length;
|
|
356
|
+
const removeCount = oldLines.length;
|
|
357
|
+
const summaryIcon = '📊';
|
|
358
|
+
const addText = addCount > 0 ? theme.diff.added(`+${addCount}`) : '';
|
|
359
|
+
const removeText = removeCount > 0 ? theme.diff.removed(`−${removeCount}`) : '';
|
|
360
|
+
const summaryParts = [addText, removeText].filter(Boolean).join(theme.ui.muted(', '));
|
|
361
|
+
const summaryContent = `${summaryIcon} ${theme.edit.summary('Summary:')} ${summaryParts} ${theme.ui.muted('lines')}`;
|
|
362
|
+
const summaryPadded = padLine(summaryContent, innerWidth);
|
|
363
|
+
lines.push(`${theme.edit.separator(BOX.vertical)} ${summaryPadded} ${theme.edit.separator(BOX.vertical)}`);
|
|
364
|
+
// Bottom border
|
|
365
|
+
const bottomBorder = `${BOX.bottomLeft}${BOX.horizontal.repeat(maxWidth - 2)}${BOX.bottomRight}`;
|
|
366
|
+
lines.push(theme.edit.separator(bottomBorder));
|
|
367
|
+
return lines.join('\n');
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Strip ANSI escape codes from a string
|
|
371
|
+
*/
|
|
372
|
+
function stripAnsi(str) {
|
|
373
|
+
// eslint-disable-next-line no-control-regex
|
|
374
|
+
return str.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, '');
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Format a compact inline edit summary
|
|
378
|
+
* For when the full box display is too verbose
|
|
379
|
+
*
|
|
380
|
+
* Example: "✏️ src/file.ts:42 • +3 −2 lines"
|
|
381
|
+
*/
|
|
382
|
+
export function formatCompactEdit(filePath, lineNumber, additions, removals) {
|
|
383
|
+
const icon = '✏️';
|
|
384
|
+
const path = theme.edit.filePath(filePath);
|
|
385
|
+
const lineNo = lineNumber > 0 ? theme.edit.lineNumber(`:${lineNumber}`) : '';
|
|
386
|
+
const add = additions > 0 ? theme.diff.added(`+${additions}`) : '';
|
|
387
|
+
const remove = removals > 0 ? theme.diff.removed(`−${removals}`) : '';
|
|
388
|
+
const changes = [add, remove].filter(Boolean).join(' ');
|
|
389
|
+
return `${icon} ${path}${lineNo} ${theme.ui.muted('•')} ${changes} ${theme.ui.muted('lines')}`;
|
|
390
|
+
}
|
|
391
|
+
/**
|
|
392
|
+
* Format multiline content with indentation (AGI CLI style)
|
|
393
|
+
*
|
|
394
|
+
* Adds proper indentation and line wrapping
|
|
395
|
+
*/
|
|
396
|
+
export function formatIndentedContent(content, indent = 4) {
|
|
397
|
+
const lines = content.split('\n');
|
|
398
|
+
const indentStr = ' '.repeat(indent);
|
|
399
|
+
return lines.map(line => `${indentStr}${line}`).join('\n');
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Format token usage indicator
|
|
403
|
+
* Example: "• Context 5% used (7.2k tokens)"
|
|
404
|
+
*/
|
|
405
|
+
export function formatTokenUsage(percentage, tokens) {
|
|
406
|
+
const bullet = theme.info('•');
|
|
407
|
+
let pct;
|
|
408
|
+
if (percentage >= 90) {
|
|
409
|
+
pct = theme.error(`${percentage}%`);
|
|
410
|
+
}
|
|
411
|
+
else if (percentage >= 70) {
|
|
412
|
+
pct = theme.warning(`${percentage}%`);
|
|
413
|
+
}
|
|
414
|
+
else {
|
|
415
|
+
pct = theme.success(`${percentage}%`);
|
|
416
|
+
}
|
|
417
|
+
const tokensStr = tokens ? ` (${formatTokenCount(tokens)} tokens)` : '';
|
|
418
|
+
return `${bullet} Context ${pct} used${tokensStr}`;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Format token count with k/M suffixes
|
|
422
|
+
*/
|
|
423
|
+
function formatTokenCount(tokens) {
|
|
424
|
+
if (tokens >= 1000000) {
|
|
425
|
+
return `${(tokens / 1000000).toFixed(1)}M`;
|
|
426
|
+
}
|
|
427
|
+
if (tokens >= 1000) {
|
|
428
|
+
return `${(tokens / 1000).toFixed(1)}k`;
|
|
429
|
+
}
|
|
430
|
+
return String(tokens);
|
|
431
|
+
}
|
|
432
|
+
/**
|
|
433
|
+
* Format timing information
|
|
434
|
+
* Example: "(1m 43s)" or "(250ms)"
|
|
435
|
+
*/
|
|
436
|
+
export function formatDuration(ms) {
|
|
437
|
+
if (ms < 1000) {
|
|
438
|
+
return `${Math.round(ms)}ms`;
|
|
439
|
+
}
|
|
440
|
+
const seconds = Math.floor(ms / 1000);
|
|
441
|
+
const minutes = Math.floor(seconds / 60);
|
|
442
|
+
const remainingSeconds = seconds % 60;
|
|
443
|
+
if (minutes > 0) {
|
|
444
|
+
return `${minutes}m ${remainingSeconds}s`;
|
|
445
|
+
}
|
|
446
|
+
return `${seconds}s`;
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Create a "thinking" indicator
|
|
450
|
+
* Example: "∴ Thinking…" or "∴ Thought for 2s"
|
|
451
|
+
*/
|
|
452
|
+
export function formatThinking(durationMs, _hasContent = false) {
|
|
453
|
+
const symbol = theme.info('∴');
|
|
454
|
+
if (durationMs === undefined) {
|
|
455
|
+
return `${symbol} Thinking…`;
|
|
456
|
+
}
|
|
457
|
+
const duration = formatDuration(durationMs);
|
|
458
|
+
return `${symbol} Thought for ${duration}`;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Format status line at bottom
|
|
462
|
+
* Example: "• Ready for prompts (250ms)"
|
|
463
|
+
*/
|
|
464
|
+
export function formatStatusLine(message, durationMs, tokenUsage) {
|
|
465
|
+
const parts = [];
|
|
466
|
+
// Add token usage first if available
|
|
467
|
+
if (tokenUsage) {
|
|
468
|
+
parts.push(formatTokenUsage(tokenUsage.percentage, tokenUsage.tokens));
|
|
469
|
+
}
|
|
470
|
+
// Add message with duration
|
|
471
|
+
const duration = durationMs ? ` (${formatDuration(durationMs)})` : '';
|
|
472
|
+
parts.push(message + duration);
|
|
473
|
+
return parts.join(' · ');
|
|
474
|
+
}
|
|
475
|
+
/**
|
|
476
|
+
* Smart truncate for shell commands
|
|
477
|
+
* Preserves important parts like command name and key flags
|
|
478
|
+
*/
|
|
479
|
+
export function truncateCommand(command, _maxLength = 2000) {
|
|
480
|
+
// Show the full command; rely on terminal width to wrap.
|
|
481
|
+
return command;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* Format file size in human-readable format
|
|
485
|
+
*/
|
|
486
|
+
export function formatFileSize(bytes) {
|
|
487
|
+
if (bytes < 1024)
|
|
488
|
+
return `${bytes}B`;
|
|
489
|
+
if (bytes < 1024 * 1024)
|
|
490
|
+
return `${(bytes / 1024).toFixed(1)}KB`;
|
|
491
|
+
if (bytes < 1024 * 1024 * 1024)
|
|
492
|
+
return `${(bytes / (1024 * 1024)).toFixed(1)}MB`;
|
|
493
|
+
return `${(bytes / (1024 * 1024 * 1024)).toFixed(1)}GB`;
|
|
494
|
+
}
|
|
495
|
+
/**
|
|
496
|
+
* Format JSON output with syntax highlighting
|
|
497
|
+
*/
|
|
498
|
+
export function formatJSON(data, compact = false) {
|
|
499
|
+
const json = JSON.stringify(data, null, compact ? 0 : 2);
|
|
500
|
+
// Add basic syntax highlighting
|
|
501
|
+
return json
|
|
502
|
+
.replace(/"([^"]+)":/g, (_, key) => `${theme.info(`"${key}"`)}: `) // Keys in blue
|
|
503
|
+
.replace(/: "([^"]*)"/g, (_, value) => `: ${theme.success(`"${value}"`)}`) // String values in green
|
|
504
|
+
.replace(/: (\d+\.?\d*)/g, (_, num) => `: ${theme.warning(num)}`) // Numbers in amber
|
|
505
|
+
.replace(/: (true|false|null)/g, (_, bool) => `: ${theme.secondary(bool)}`); // Booleans in purple
|
|
506
|
+
}
|
|
507
|
+
/**
|
|
508
|
+
* Format a list of items (AGI CLI style)
|
|
509
|
+
* Example:
|
|
510
|
+
* • Item 1
|
|
511
|
+
* • Item 2
|
|
512
|
+
* • Item 3
|
|
513
|
+
*/
|
|
514
|
+
export function formatList(items, bullet = '•') {
|
|
515
|
+
return items.map(item => ` ${theme.info(bullet)} ${item}`).join('\n');
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Format a key-value pair (AGI CLI style)
|
|
519
|
+
*/
|
|
520
|
+
export function formatKeyValue(key, value) {
|
|
521
|
+
return `${theme.ui.muted(key)}: ${value}`;
|
|
522
|
+
}
|
|
523
|
+
/**
|
|
524
|
+
* Format a tool result summary for display in the terminal.
|
|
525
|
+
* This is the central function for displaying ALL tool results.
|
|
526
|
+
*
|
|
527
|
+
* To add support for a new tool:
|
|
528
|
+
* 1. Add a case in the switch statement below
|
|
529
|
+
* 2. Create a format function for that tool type
|
|
530
|
+
*
|
|
531
|
+
* @returns Formatted string to display, or null if no display needed
|
|
532
|
+
*/
|
|
533
|
+
export function formatToolResultSummary(input) {
|
|
534
|
+
const { toolName, args, output, success, durationMs } = input;
|
|
535
|
+
// Determine tool category and format accordingly
|
|
536
|
+
switch (toolName) {
|
|
537
|
+
// === FILE OPERATIONS ===
|
|
538
|
+
case 'Edit':
|
|
539
|
+
case 'edit_file':
|
|
540
|
+
// These already return formatted diff output from editTools.ts
|
|
541
|
+
return output;
|
|
542
|
+
// === BASH/COMMAND EXECUTION ===
|
|
543
|
+
case 'Bash':
|
|
544
|
+
case 'bash':
|
|
545
|
+
case 'execute_bash':
|
|
546
|
+
case 'execute_command':
|
|
547
|
+
return formatBashResult(args, output, success, durationMs);
|
|
548
|
+
// === BACKGROUND BASH ===
|
|
549
|
+
case 'BashOutput':
|
|
550
|
+
return formatBashOutputResult(args, output, success);
|
|
551
|
+
case 'KillShell':
|
|
552
|
+
return formatKillShellResult(args, output, success);
|
|
553
|
+
// === FILE READING ===
|
|
554
|
+
case 'Read':
|
|
555
|
+
case 'read_file':
|
|
556
|
+
return formatReadResult(args, output, success);
|
|
557
|
+
// === SEARCH OPERATIONS ===
|
|
558
|
+
case 'Grep':
|
|
559
|
+
case 'grep':
|
|
560
|
+
case 'grep_search':
|
|
561
|
+
case 'search_text':
|
|
562
|
+
case 'search_files':
|
|
563
|
+
return formatGrepResult(args, output, success);
|
|
564
|
+
case 'Glob':
|
|
565
|
+
case 'glob':
|
|
566
|
+
return formatGlobResult(args, output, success);
|
|
567
|
+
case 'list_files':
|
|
568
|
+
return formatListFilesResult(args, output, success);
|
|
569
|
+
case 'find_definition':
|
|
570
|
+
return formatFindDefinitionResult(args, output, success);
|
|
571
|
+
// === WEB OPERATIONS ===
|
|
572
|
+
case 'WebFetch':
|
|
573
|
+
case 'web_fetch':
|
|
574
|
+
return formatWebFetchResult(args, output, success);
|
|
575
|
+
case 'WebSearch':
|
|
576
|
+
case 'web_search':
|
|
577
|
+
return formatWebSearchResult(args, output, success);
|
|
578
|
+
case 'WebExtract':
|
|
579
|
+
return formatWebExtractResult(args, output, success);
|
|
580
|
+
// === TASK/AGENT OPERATIONS ===
|
|
581
|
+
case 'Task':
|
|
582
|
+
case 'task':
|
|
583
|
+
return formatTaskResult(args, output, success);
|
|
584
|
+
// === TODO OPERATIONS ===
|
|
585
|
+
case 'TodoWrite':
|
|
586
|
+
case 'todo_write':
|
|
587
|
+
return formatTodoResult(args, output, success);
|
|
588
|
+
// === NOTEBOOK OPERATIONS ===
|
|
589
|
+
case 'NotebookEdit':
|
|
590
|
+
case 'notebook_edit':
|
|
591
|
+
return formatNotebookResult(args, output, success);
|
|
592
|
+
// === USER INTERACTION ===
|
|
593
|
+
case 'AskUserQuestion':
|
|
594
|
+
return formatAskUserResult(args, output, success);
|
|
595
|
+
// === DEV TOOLS ===
|
|
596
|
+
case 'run_tests':
|
|
597
|
+
return formatTestResult(args, output, success, durationMs);
|
|
598
|
+
case 'run_build':
|
|
599
|
+
return formatBuildResult(args, output, success, durationMs);
|
|
600
|
+
case 'install_dependencies':
|
|
601
|
+
return formatInstallResult(args, output, success, durationMs);
|
|
602
|
+
case 'check_package_info':
|
|
603
|
+
return formatPackageInfoResult(args, output, success);
|
|
604
|
+
// === GIT OPERATIONS ===
|
|
605
|
+
case 'git_release':
|
|
606
|
+
case 'git_sync':
|
|
607
|
+
case 'git_cleanup':
|
|
608
|
+
return formatGitResult(toolName, args, output, success);
|
|
609
|
+
// === DOCKER ===
|
|
610
|
+
case 'docker_build':
|
|
611
|
+
case 'docker_compose':
|
|
612
|
+
return formatDockerResult(toolName, args, output, success, durationMs);
|
|
613
|
+
// === CODE ANALYSIS ===
|
|
614
|
+
case 'analyze_code_structure':
|
|
615
|
+
case 'find_dependencies':
|
|
616
|
+
case 'check_code_complexity':
|
|
617
|
+
case 'advanced_ast_analysis':
|
|
618
|
+
case 'analyze_code_complexity':
|
|
619
|
+
case 'suggest_refactoring':
|
|
620
|
+
case 'generate_code_quality_report':
|
|
621
|
+
return formatCodeAnalysisResult(toolName, args, output, success);
|
|
622
|
+
// === TESTING TOOLS ===
|
|
623
|
+
case 'generate_test_templates':
|
|
624
|
+
case 'run_coverage_analysis':
|
|
625
|
+
case 'summarize_coverage_report':
|
|
626
|
+
case 'analyze_test_coverage':
|
|
627
|
+
case 'generate_comprehensive_tests':
|
|
628
|
+
return formatTestingToolResult(toolName, args, output, success);
|
|
629
|
+
// === LINT/QUALITY ===
|
|
630
|
+
case 'run_lint_checks':
|
|
631
|
+
case 'inspect_code_quality':
|
|
632
|
+
case 'list_lint_rules':
|
|
633
|
+
return formatLintResult(toolName, args, output, success);
|
|
634
|
+
// === CLOUD DEPLOY ===
|
|
635
|
+
case 'cloud_status':
|
|
636
|
+
case 'cloud_deploy':
|
|
637
|
+
case 'cloud_init':
|
|
638
|
+
case 'cloud_login':
|
|
639
|
+
case 'firebase_deploy':
|
|
640
|
+
case 'aliyun_deploy':
|
|
641
|
+
return formatCloudResult(toolName, args, output, success);
|
|
642
|
+
// === BROWSER AUTOMATION ===
|
|
643
|
+
case 'browser_create_session':
|
|
644
|
+
case 'browser_navigate':
|
|
645
|
+
case 'browser_click':
|
|
646
|
+
case 'browser_type':
|
|
647
|
+
case 'browser_screenshot':
|
|
648
|
+
case 'browser_close_session':
|
|
649
|
+
return formatBrowserResult(toolName, args, output, success);
|
|
650
|
+
// === EMAIL ===
|
|
651
|
+
case 'send_email':
|
|
652
|
+
case 'send_batch_emails':
|
|
653
|
+
case 'verify_email_config':
|
|
654
|
+
return formatEmailResult(toolName, args, output, success);
|
|
655
|
+
// === SKILLS ===
|
|
656
|
+
case 'ListSkills':
|
|
657
|
+
case 'Skill':
|
|
658
|
+
return formatSkillResult(toolName, args, output, success);
|
|
659
|
+
// === PLANNING ===
|
|
660
|
+
case 'UpdatePlan':
|
|
661
|
+
return formatPlanUpdateResult(args, output, success);
|
|
662
|
+
case 'ExitPlanMode':
|
|
663
|
+
return formatPlanModeResult(args, output, success);
|
|
664
|
+
// === REPO CHECKS ===
|
|
665
|
+
case 'run_repo_checks':
|
|
666
|
+
return formatRepoChecksResult(args, output, success);
|
|
667
|
+
// === LEARNING & EXPLORATION ===
|
|
668
|
+
case 'learn_codebase':
|
|
669
|
+
case 'learn_file':
|
|
670
|
+
case 'learn_topic':
|
|
671
|
+
case 'learn_summary':
|
|
672
|
+
case 'explore':
|
|
673
|
+
case 'explore_index':
|
|
674
|
+
return formatLearnResult(toolName, args, output, success);
|
|
675
|
+
// === DEFAULT: Unknown tools ===
|
|
676
|
+
default:
|
|
677
|
+
// For unknown tools, show a generic summary if output is non-empty
|
|
678
|
+
return formatGenericToolResult(toolName, output, success, durationMs);
|
|
679
|
+
}
|
|
680
|
+
}
|
|
681
|
+
/**
|
|
682
|
+
* Format Bash command result
|
|
683
|
+
* Shows: command executed, exit status, and output preview
|
|
684
|
+
*/
|
|
685
|
+
function formatBashResult(args, output, success, durationMs) {
|
|
686
|
+
const command = args['command'] || '';
|
|
687
|
+
const description = args['description'];
|
|
688
|
+
const lines = [];
|
|
689
|
+
// Header with command
|
|
690
|
+
const statusIcon = success ? theme.success('✓') : theme.error('✗');
|
|
691
|
+
const cmdDisplay = truncateCommand(command);
|
|
692
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
693
|
+
if (description) {
|
|
694
|
+
lines.push(`${statusIcon} ${description}${durationStr}`);
|
|
695
|
+
lines.push(` ${theme.ui.muted('$')} ${theme.dim(cmdDisplay)}`);
|
|
696
|
+
}
|
|
697
|
+
else {
|
|
698
|
+
lines.push(`${statusIcon} ${theme.ui.muted('$')} ${cmdDisplay}${durationStr}`);
|
|
699
|
+
}
|
|
700
|
+
// Output preview (max 5 lines)
|
|
701
|
+
if (output && output.trim()) {
|
|
702
|
+
const outputLines = output.trim().split('\n');
|
|
703
|
+
const maxPreviewLines = 5;
|
|
704
|
+
const previewLines = outputLines.slice(0, maxPreviewLines);
|
|
705
|
+
const lineFormatter = success ? theme.dim : theme.error;
|
|
706
|
+
for (const line of previewLines) {
|
|
707
|
+
// Truncate long lines
|
|
708
|
+
lines.push(` ${lineFormatter(line)}`);
|
|
709
|
+
}
|
|
710
|
+
if (outputLines.length > maxPreviewLines) {
|
|
711
|
+
const remaining = outputLines.length - maxPreviewLines;
|
|
712
|
+
lines.push(` ${theme.ui.muted(`... +${remaining} more line${remaining === 1 ? '' : 's'}`)}`);
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
return lines.join('\n');
|
|
716
|
+
}
|
|
717
|
+
/**
|
|
718
|
+
* Format Read file result
|
|
719
|
+
* Shows: file path and line count
|
|
720
|
+
*/
|
|
721
|
+
function formatReadResult(args, output, success) {
|
|
722
|
+
const filePath = (args['file_path'] || args['path']) || '';
|
|
723
|
+
const displayPath = truncatePathForDisplay(filePath, 50);
|
|
724
|
+
if (!success) {
|
|
725
|
+
return `${theme.error('✗')} Failed to read ${displayPath}`;
|
|
726
|
+
}
|
|
727
|
+
const lineCount = output.split('\n').length;
|
|
728
|
+
return `${theme.success('✓')} Read ${theme.info(displayPath)} ${theme.ui.muted(`(${lineCount} lines)`)}`;
|
|
729
|
+
}
|
|
730
|
+
/**
|
|
731
|
+
* Format Grep search result
|
|
732
|
+
* Shows: pattern, matches found, and file list preview
|
|
733
|
+
*/
|
|
734
|
+
function formatGrepResult(args, output, success) {
|
|
735
|
+
const pattern = args['pattern'] || '';
|
|
736
|
+
const patternDisplay = pattern.length > 30 ? `${pattern.slice(0, 27)}...` : pattern;
|
|
737
|
+
const lines = [];
|
|
738
|
+
if (!success || !output.trim()) {
|
|
739
|
+
lines.push(`${theme.warning('○')} No matches for "${patternDisplay}"`);
|
|
740
|
+
return lines.join('\n');
|
|
741
|
+
}
|
|
742
|
+
// Count matches/files
|
|
743
|
+
const outputLines = output.trim().split('\n').filter(l => l.trim());
|
|
744
|
+
const matchCount = outputLines.length;
|
|
745
|
+
lines.push(`${theme.success('✓')} Found ${theme.info(String(matchCount))} match${matchCount === 1 ? '' : 'es'} for "${patternDisplay}"`);
|
|
746
|
+
// Show first few matches
|
|
747
|
+
const maxPreview = 3;
|
|
748
|
+
for (let i = 0; i < Math.min(maxPreview, outputLines.length); i++) {
|
|
749
|
+
const line = outputLines[i] || '';
|
|
750
|
+
const truncated = line.length > 70 ? `${line.slice(0, 67)}...` : line;
|
|
751
|
+
lines.push(` ${theme.dim(truncated)}`);
|
|
752
|
+
}
|
|
753
|
+
if (matchCount > maxPreview) {
|
|
754
|
+
lines.push(` ${theme.ui.muted(`... +${matchCount - maxPreview} more`)}`);
|
|
755
|
+
}
|
|
756
|
+
return lines.join('\n');
|
|
757
|
+
}
|
|
758
|
+
/**
|
|
759
|
+
* Format Glob file search result
|
|
760
|
+
* Shows: pattern and files found
|
|
761
|
+
*/
|
|
762
|
+
function formatGlobResult(args, output, success) {
|
|
763
|
+
const pattern = args['pattern'] || '*';
|
|
764
|
+
const lines = [];
|
|
765
|
+
if (!success || !output.trim()) {
|
|
766
|
+
lines.push(`${theme.warning('○')} No files matching "${pattern}"`);
|
|
767
|
+
return lines.join('\n');
|
|
768
|
+
}
|
|
769
|
+
const files = output.trim().split('\n').filter(f => f.trim());
|
|
770
|
+
const fileCount = files.length;
|
|
771
|
+
lines.push(`${theme.success('✓')} Found ${theme.info(String(fileCount))} file${fileCount === 1 ? '' : 's'} matching "${pattern}"`);
|
|
772
|
+
// Show first few files
|
|
773
|
+
const maxPreview = 4;
|
|
774
|
+
for (let i = 0; i < Math.min(maxPreview, files.length); i++) {
|
|
775
|
+
const file = files[i] || '';
|
|
776
|
+
lines.push(` ${theme.dim(truncatePathForDisplay(file, 60))}`);
|
|
777
|
+
}
|
|
778
|
+
if (fileCount > maxPreview) {
|
|
779
|
+
lines.push(` ${theme.ui.muted(`... +${fileCount - maxPreview} more`)}`);
|
|
780
|
+
}
|
|
781
|
+
return lines.join('\n');
|
|
782
|
+
}
|
|
783
|
+
/**
|
|
784
|
+
* Format list_files result
|
|
785
|
+
* Shows: directory and item count (no noisy listing)
|
|
786
|
+
*/
|
|
787
|
+
function formatListFilesResult(args, output, success) {
|
|
788
|
+
const path = args['path'] || '.';
|
|
789
|
+
const displayPath = truncatePathForDisplay(path, 60);
|
|
790
|
+
if (!success) {
|
|
791
|
+
const firstLine = output.trim().split('\n')[0] || 'Failed to list files';
|
|
792
|
+
const truncated = firstLine.length > 80 ? `${firstLine.slice(0, 77)}...` : firstLine;
|
|
793
|
+
return `${theme.error('✗')} ${truncated}`;
|
|
794
|
+
}
|
|
795
|
+
const items = output
|
|
796
|
+
.split('\n')
|
|
797
|
+
.map(line => line.trim())
|
|
798
|
+
.filter(Boolean);
|
|
799
|
+
const count = items.length;
|
|
800
|
+
const countLabel = `${count} item${count === 1 ? '' : 's'}`;
|
|
801
|
+
return `${theme.success('✓')} Listed ${theme.info(countLabel)} in ${theme.ui.muted(displayPath)}`;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Format WebFetch result
|
|
805
|
+
* Shows: URL and content summary
|
|
806
|
+
*/
|
|
807
|
+
function formatWebFetchResult(args, output, success) {
|
|
808
|
+
const url = args['url'] || '';
|
|
809
|
+
let hostname = url;
|
|
810
|
+
try {
|
|
811
|
+
hostname = new URL(url).hostname;
|
|
812
|
+
}
|
|
813
|
+
catch {
|
|
814
|
+
// Keep original URL if parsing fails
|
|
815
|
+
}
|
|
816
|
+
if (!success) {
|
|
817
|
+
return `${theme.error('✗')} Failed to fetch ${hostname}`;
|
|
818
|
+
}
|
|
819
|
+
const contentLength = output.length;
|
|
820
|
+
const sizeStr = formatFileSize(contentLength);
|
|
821
|
+
return `${theme.success('✓')} Fetched ${theme.info(hostname)} ${theme.ui.muted(`(${sizeStr})`)}`;
|
|
822
|
+
}
|
|
823
|
+
/**
|
|
824
|
+
* Format WebSearch result
|
|
825
|
+
* Shows: query and result count
|
|
826
|
+
*/
|
|
827
|
+
function formatWebSearchResult(args, output, success) {
|
|
828
|
+
const query = args['query'] || '';
|
|
829
|
+
const queryDisplay = query.length > 40 ? `${query.slice(0, 37)}...` : query;
|
|
830
|
+
if (!success) {
|
|
831
|
+
return `${theme.error('✗')} Search failed for "${queryDisplay}"`;
|
|
832
|
+
}
|
|
833
|
+
// Try to count results from output
|
|
834
|
+
const resultMatches = output.match(/^\d+\./gm);
|
|
835
|
+
const resultCount = resultMatches ? resultMatches.length : 'multiple';
|
|
836
|
+
return `${theme.success('✓')} Found ${theme.info(String(resultCount))} results for "${queryDisplay}"`;
|
|
837
|
+
}
|
|
838
|
+
/**
|
|
839
|
+
* Format Task/Agent result
|
|
840
|
+
* Shows: task description and completion status
|
|
841
|
+
*/
|
|
842
|
+
function formatTaskResult(args, _output, success) {
|
|
843
|
+
const description = args['description'] || 'Task';
|
|
844
|
+
const truncatedDesc = description.length > 50 ? `${description.slice(0, 47)}...` : description;
|
|
845
|
+
if (!success) {
|
|
846
|
+
return `${theme.error('✗')} Task failed: ${truncatedDesc}`;
|
|
847
|
+
}
|
|
848
|
+
return `${theme.success('✓')} Completed: ${truncatedDesc}`;
|
|
849
|
+
}
|
|
850
|
+
/**
|
|
851
|
+
* Format TodoWrite result
|
|
852
|
+
* Shows: todo list update summary
|
|
853
|
+
*/
|
|
854
|
+
function formatTodoResult(args, _output, success) {
|
|
855
|
+
const todos = args['todos'];
|
|
856
|
+
if (!success) {
|
|
857
|
+
return `${theme.error('✗')} Failed to update todo list`;
|
|
858
|
+
}
|
|
859
|
+
if (!todos || !Array.isArray(todos)) {
|
|
860
|
+
return `${theme.success('✓')} Todo list updated`;
|
|
861
|
+
}
|
|
862
|
+
const completed = todos.filter(t => t.status === 'completed').length;
|
|
863
|
+
const inProgress = todos.filter(t => t.status === 'in_progress').length;
|
|
864
|
+
const pending = todos.filter(t => t.status === 'pending').length;
|
|
865
|
+
const parts = [`${theme.success('✓')} Todos:`];
|
|
866
|
+
if (completed > 0)
|
|
867
|
+
parts.push(theme.success(`${completed} done`));
|
|
868
|
+
if (inProgress > 0)
|
|
869
|
+
parts.push(theme.warning(`${inProgress} active`));
|
|
870
|
+
if (pending > 0)
|
|
871
|
+
parts.push(theme.dim(`${pending} pending`));
|
|
872
|
+
return parts.join(' ');
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Format NotebookEdit result
|
|
876
|
+
* Shows: notebook and cell info
|
|
877
|
+
*/
|
|
878
|
+
function formatNotebookResult(args, _output, success) {
|
|
879
|
+
const notebookPath = args['notebook_path'] || '';
|
|
880
|
+
const editMode = args['edit_mode'] || 'replace';
|
|
881
|
+
const displayPath = truncatePathForDisplay(notebookPath, 40);
|
|
882
|
+
if (!success) {
|
|
883
|
+
return `${theme.error('✗')} Failed to edit notebook ${displayPath}`;
|
|
884
|
+
}
|
|
885
|
+
const action = editMode === 'insert' ? 'Inserted cell in' : editMode === 'delete' ? 'Deleted cell from' : 'Updated';
|
|
886
|
+
return `${theme.success('✓')} ${action} ${theme.info(displayPath)}`;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Format generic/unknown tool result
|
|
890
|
+
* Provides a basic summary for tools not explicitly handled
|
|
891
|
+
*/
|
|
892
|
+
function formatGenericToolResult(toolName, output, success, durationMs) {
|
|
893
|
+
const statusIcon = success ? theme.success('✓') : theme.error('✗');
|
|
894
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
895
|
+
if (!output || !output.trim()) {
|
|
896
|
+
return `${statusIcon} ${toolName} completed${durationStr}`;
|
|
897
|
+
}
|
|
898
|
+
const lineCount = output.split('\n').length;
|
|
899
|
+
return `${statusIcon} ${toolName} completed ${theme.ui.muted(`(${lineCount} lines)`)}${durationStr}`;
|
|
900
|
+
}
|
|
901
|
+
// ============================================================================
|
|
902
|
+
// ADDITIONAL TOOL FORMATTERS
|
|
903
|
+
// ============================================================================
|
|
904
|
+
/**
|
|
905
|
+
* Format BashOutput (background shell) result
|
|
906
|
+
*/
|
|
907
|
+
function formatBashOutputResult(args, output, success) {
|
|
908
|
+
const shellId = (args['bash_id'] || args['shell_id']) || '';
|
|
909
|
+
const lines = [];
|
|
910
|
+
if (!success) {
|
|
911
|
+
return `${theme.error('✗')} Failed to get output from shell ${shellId}`;
|
|
912
|
+
}
|
|
913
|
+
const outputLines = output.trim().split('\n').filter(l => l);
|
|
914
|
+
const lineCount = outputLines.length;
|
|
915
|
+
lines.push(`${theme.success('✓')} Shell ${theme.info(shellId)} ${theme.ui.muted(`(${lineCount} lines)`)}`);
|
|
916
|
+
// Show preview
|
|
917
|
+
const maxPreview = 3;
|
|
918
|
+
for (let i = 0; i < Math.min(maxPreview, outputLines.length); i++) {
|
|
919
|
+
const line = outputLines[i] || '';
|
|
920
|
+
const truncated = line.length > 70 ? `${line.slice(0, 67)}...` : line;
|
|
921
|
+
lines.push(` ${theme.dim(truncated)}`);
|
|
922
|
+
}
|
|
923
|
+
if (lineCount > maxPreview) {
|
|
924
|
+
lines.push(` ${theme.ui.muted(`... +${lineCount - maxPreview} more`)}`);
|
|
925
|
+
}
|
|
926
|
+
return lines.join('\n');
|
|
927
|
+
}
|
|
928
|
+
/**
|
|
929
|
+
* Format KillShell result
|
|
930
|
+
*/
|
|
931
|
+
function formatKillShellResult(args, _output, success) {
|
|
932
|
+
const shellId = (args['shell_id']) || '';
|
|
933
|
+
if (!success) {
|
|
934
|
+
return `${theme.error('✗')} Failed to kill shell ${shellId}`;
|
|
935
|
+
}
|
|
936
|
+
return `${theme.success('✓')} Killed shell ${theme.info(shellId)}`;
|
|
937
|
+
}
|
|
938
|
+
/**
|
|
939
|
+
* Format find_definition result
|
|
940
|
+
*/
|
|
941
|
+
function formatFindDefinitionResult(args, output, success) {
|
|
942
|
+
const symbol = (args['symbol'] || args['name']) || '';
|
|
943
|
+
if (!success || !output.trim()) {
|
|
944
|
+
return `${theme.warning('○')} Definition not found: ${symbol}`;
|
|
945
|
+
}
|
|
946
|
+
const locations = output.trim().split('\n').filter(l => l);
|
|
947
|
+
return `${theme.success('✓')} Found ${theme.info(String(locations.length))} definition${locations.length === 1 ? '' : 's'} for "${symbol}"`;
|
|
948
|
+
}
|
|
949
|
+
/**
|
|
950
|
+
* Format WebExtract result
|
|
951
|
+
*/
|
|
952
|
+
function formatWebExtractResult(args, output, success) {
|
|
953
|
+
const url = args['url'] || '';
|
|
954
|
+
let hostname = url;
|
|
955
|
+
try {
|
|
956
|
+
hostname = new URL(url).hostname;
|
|
957
|
+
}
|
|
958
|
+
catch {
|
|
959
|
+
// Keep original
|
|
960
|
+
}
|
|
961
|
+
if (!success) {
|
|
962
|
+
return `${theme.error('✗')} Failed to extract from ${hostname}`;
|
|
963
|
+
}
|
|
964
|
+
const contentLength = output.length;
|
|
965
|
+
return `${theme.success('✓')} Extracted from ${theme.info(hostname)} ${theme.ui.muted(`(${formatFileSize(contentLength)})`)}`;
|
|
966
|
+
}
|
|
967
|
+
/**
|
|
968
|
+
* Format AskUserQuestion result
|
|
969
|
+
*/
|
|
970
|
+
function formatAskUserResult(args, output, success) {
|
|
971
|
+
const questions = args['questions'];
|
|
972
|
+
const questionCount = questions?.length || 1;
|
|
973
|
+
if (!success) {
|
|
974
|
+
return `${theme.error('✗')} Failed to ask user`;
|
|
975
|
+
}
|
|
976
|
+
if (output.includes('answer') || output.includes('response')) {
|
|
977
|
+
return `${theme.success('✓')} User responded`;
|
|
978
|
+
}
|
|
979
|
+
return `${theme.info('?')} Asked ${questionCount} question${questionCount === 1 ? '' : 's'}`;
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Format test run result
|
|
983
|
+
*/
|
|
984
|
+
function formatTestResult(args, output, success, durationMs) {
|
|
985
|
+
const testPattern = (args['pattern'] || args['filter']);
|
|
986
|
+
const lines = [];
|
|
987
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
988
|
+
// Try to extract test counts from output
|
|
989
|
+
const passMatch = output.match(/(\d+)\s*(?:passing|passed|✓)/i);
|
|
990
|
+
const failMatch = output.match(/(\d+)\s*(?:failing|failed|✗)/i);
|
|
991
|
+
const skipMatch = output.match(/(\d+)\s*(?:skipped|pending)/i);
|
|
992
|
+
const passed = passMatch ? parseInt(passMatch[1] || '0', 10) : 0;
|
|
993
|
+
const failed = failMatch ? parseInt(failMatch[1] || '0', 10) : 0;
|
|
994
|
+
const skipped = skipMatch ? parseInt(skipMatch[1] || '0', 10) : 0;
|
|
995
|
+
const statusIcon = success && failed === 0 ? theme.success('✓') : theme.error('✗');
|
|
996
|
+
let summary = `${statusIcon} Tests`;
|
|
997
|
+
if (testPattern) {
|
|
998
|
+
summary += ` "${testPattern}"`;
|
|
999
|
+
}
|
|
1000
|
+
summary += durationStr;
|
|
1001
|
+
lines.push(summary);
|
|
1002
|
+
// Show counts
|
|
1003
|
+
const counts = [];
|
|
1004
|
+
if (passed > 0)
|
|
1005
|
+
counts.push(theme.success(`${passed} passed`));
|
|
1006
|
+
if (failed > 0)
|
|
1007
|
+
counts.push(theme.error(`${failed} failed`));
|
|
1008
|
+
if (skipped > 0)
|
|
1009
|
+
counts.push(theme.warning(`${skipped} skipped`));
|
|
1010
|
+
if (counts.length > 0) {
|
|
1011
|
+
lines.push(` ${counts.join(', ')}`);
|
|
1012
|
+
}
|
|
1013
|
+
// Show first error if failed
|
|
1014
|
+
if (!success && failed > 0) {
|
|
1015
|
+
const errorMatch = output.match(/(?:Error|FAIL|✗).*?:(.*?)(?:\n|$)/i);
|
|
1016
|
+
if (errorMatch && errorMatch[1]) {
|
|
1017
|
+
const errorMsg = errorMatch[1].trim().slice(0, 60);
|
|
1018
|
+
lines.push(` ${theme.error(errorMsg)}`);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
return lines.join('\n');
|
|
1022
|
+
}
|
|
1023
|
+
/**
|
|
1024
|
+
* Format build result
|
|
1025
|
+
*/
|
|
1026
|
+
function formatBuildResult(args, output, success, durationMs) {
|
|
1027
|
+
const target = (args['target'] || args['script']);
|
|
1028
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
1029
|
+
if (!success) {
|
|
1030
|
+
// Try to extract error count
|
|
1031
|
+
const errorMatches = output.match(/error/gi);
|
|
1032
|
+
const errorCount = errorMatches ? errorMatches.length : 0;
|
|
1033
|
+
if (errorCount > 0) {
|
|
1034
|
+
return `${theme.error('✗')} Build failed with ${errorCount} error${errorCount === 1 ? '' : 's'}${durationStr}`;
|
|
1035
|
+
}
|
|
1036
|
+
return `${theme.error('✗')} Build failed${durationStr}`;
|
|
1037
|
+
}
|
|
1038
|
+
const label = target ? `Build "${target}"` : 'Build';
|
|
1039
|
+
return `${theme.success('✓')} ${label} succeeded${durationStr}`;
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* Format install dependencies result
|
|
1043
|
+
*/
|
|
1044
|
+
function formatInstallResult(args, output, success, durationMs) {
|
|
1045
|
+
const packages = args['packages'];
|
|
1046
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
1047
|
+
if (!success) {
|
|
1048
|
+
return `${theme.error('✗')} Install failed${durationStr}`;
|
|
1049
|
+
}
|
|
1050
|
+
// Try to extract package count from output
|
|
1051
|
+
const addedMatch = output.match(/added\s+(\d+)\s+packages?/i);
|
|
1052
|
+
const packageCount = addedMatch ? addedMatch[1] : null;
|
|
1053
|
+
let summary = `${theme.success('✓')} Dependencies installed`;
|
|
1054
|
+
if (packageCount) {
|
|
1055
|
+
summary += ` ${theme.ui.muted(`(${packageCount} packages)`)}`;
|
|
1056
|
+
}
|
|
1057
|
+
else if (packages) {
|
|
1058
|
+
const pkgList = Array.isArray(packages) ? packages : [packages];
|
|
1059
|
+
summary += ` ${theme.ui.muted(`(${pkgList.length} packages)`)}`;
|
|
1060
|
+
}
|
|
1061
|
+
summary += durationStr;
|
|
1062
|
+
return summary;
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Format package info result
|
|
1066
|
+
*/
|
|
1067
|
+
function formatPackageInfoResult(args, output, success) {
|
|
1068
|
+
const packageName = (args['package'] || args['name']) || '';
|
|
1069
|
+
if (!success) {
|
|
1070
|
+
return `${theme.error('✗')} Package info failed for ${packageName}`;
|
|
1071
|
+
}
|
|
1072
|
+
// Try to extract version
|
|
1073
|
+
const versionMatch = output.match(/version[:\s]+["']?([^"'\s\n]+)/i);
|
|
1074
|
+
const version = versionMatch ? versionMatch[1] : null;
|
|
1075
|
+
if (version) {
|
|
1076
|
+
return `${theme.success('✓')} ${theme.info(packageName)}@${version}`;
|
|
1077
|
+
}
|
|
1078
|
+
return `${theme.success('✓')} Package info: ${theme.info(packageName)}`;
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Format git operation result
|
|
1082
|
+
*/
|
|
1083
|
+
function formatGitResult(toolName, args, output, success) {
|
|
1084
|
+
const action = toolName.replace('git_', '');
|
|
1085
|
+
if (!success) {
|
|
1086
|
+
return `${theme.error('✗')} Git ${action} failed`;
|
|
1087
|
+
}
|
|
1088
|
+
switch (toolName) {
|
|
1089
|
+
case 'git_release': {
|
|
1090
|
+
const version = (args['version'] || args['tag']);
|
|
1091
|
+
if (version) {
|
|
1092
|
+
return `${theme.success('✓')} Released ${theme.info(version)}`;
|
|
1093
|
+
}
|
|
1094
|
+
return `${theme.success('✓')} Release created`;
|
|
1095
|
+
}
|
|
1096
|
+
case 'git_sync': {
|
|
1097
|
+
// Try to extract ahead/behind from output
|
|
1098
|
+
const aheadMatch = output.match(/(\d+)\s+commit.*ahead/i);
|
|
1099
|
+
const behindMatch = output.match(/(\d+)\s+commit.*behind/i);
|
|
1100
|
+
const parts = [];
|
|
1101
|
+
if (aheadMatch)
|
|
1102
|
+
parts.push(`${aheadMatch[1]} ahead`);
|
|
1103
|
+
if (behindMatch)
|
|
1104
|
+
parts.push(`${behindMatch[1]} behind`);
|
|
1105
|
+
if (parts.length > 0) {
|
|
1106
|
+
return `${theme.success('✓')} Synced ${theme.ui.muted(`(${parts.join(', ')})`)}`;
|
|
1107
|
+
}
|
|
1108
|
+
return `${theme.success('✓')} Git synced`;
|
|
1109
|
+
}
|
|
1110
|
+
case 'git_cleanup': {
|
|
1111
|
+
const branchMatch = output.match(/deleted.*?(\d+)/i);
|
|
1112
|
+
if (branchMatch) {
|
|
1113
|
+
return `${theme.success('✓')} Cleaned up ${branchMatch[1]} branches`;
|
|
1114
|
+
}
|
|
1115
|
+
return `${theme.success('✓')} Git cleanup completed`;
|
|
1116
|
+
}
|
|
1117
|
+
default:
|
|
1118
|
+
return `${theme.success('✓')} Git ${action} completed`;
|
|
1119
|
+
}
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* Format docker result
|
|
1123
|
+
*/
|
|
1124
|
+
function formatDockerResult(toolName, args, output, success, durationMs) {
|
|
1125
|
+
const durationStr = durationMs ? ` ${theme.ui.muted(`(${formatDuration(durationMs)})`)}` : '';
|
|
1126
|
+
if (!success) {
|
|
1127
|
+
return `${theme.error('✗')} Docker ${toolName.replace('docker_', '')} failed${durationStr}`;
|
|
1128
|
+
}
|
|
1129
|
+
switch (toolName) {
|
|
1130
|
+
case 'docker_build': {
|
|
1131
|
+
const tag = (args['tag'] || args['image']);
|
|
1132
|
+
// Try to extract image ID from output
|
|
1133
|
+
const imageMatch = output.match(/(?:Successfully built|sha256:)\s*([a-f0-9]{12})/i);
|
|
1134
|
+
if (tag) {
|
|
1135
|
+
return `${theme.success('✓')} Built image ${theme.info(tag)}${durationStr}`;
|
|
1136
|
+
}
|
|
1137
|
+
if (imageMatch) {
|
|
1138
|
+
return `${theme.success('✓')} Built image ${theme.info(imageMatch[1] || '')}${durationStr}`;
|
|
1139
|
+
}
|
|
1140
|
+
return `${theme.success('✓')} Docker build completed${durationStr}`;
|
|
1141
|
+
}
|
|
1142
|
+
case 'docker_compose': {
|
|
1143
|
+
const action = (args['action'] || args['command']) || 'up';
|
|
1144
|
+
return `${theme.success('✓')} Docker compose ${action}${durationStr}`;
|
|
1145
|
+
}
|
|
1146
|
+
default:
|
|
1147
|
+
return `${theme.success('✓')} Docker operation completed${durationStr}`;
|
|
1148
|
+
}
|
|
1149
|
+
}
|
|
1150
|
+
/**
|
|
1151
|
+
* Format code analysis result
|
|
1152
|
+
*/
|
|
1153
|
+
function formatCodeAnalysisResult(toolName, args, output, success) {
|
|
1154
|
+
const filePath = (args['file_path'] || args['path'] || args['file']);
|
|
1155
|
+
const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
|
|
1156
|
+
if (!success) {
|
|
1157
|
+
return `${theme.error('✗')} Analysis failed${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1158
|
+
}
|
|
1159
|
+
const toolLabels = {
|
|
1160
|
+
'analyze_code_structure': 'Structure analyzed',
|
|
1161
|
+
'find_dependencies': 'Dependencies found',
|
|
1162
|
+
'check_code_complexity': 'Complexity checked',
|
|
1163
|
+
'advanced_ast_analysis': 'AST analyzed',
|
|
1164
|
+
'analyze_code_complexity': 'Complexity analyzed',
|
|
1165
|
+
'suggest_refactoring': 'Refactoring suggestions',
|
|
1166
|
+
'generate_code_quality_report': 'Quality report generated',
|
|
1167
|
+
};
|
|
1168
|
+
const label = toolLabels[toolName] || 'Analysis completed';
|
|
1169
|
+
// Try to extract counts from output
|
|
1170
|
+
const issueMatch = output.match(/(\d+)\s*(?:issue|warning|suggestion)/i);
|
|
1171
|
+
if (issueMatch) {
|
|
1172
|
+
return `${theme.success('✓')} ${label}: ${issueMatch[1]} items${displayPath ? ` in ${displayPath}` : ''}`;
|
|
1173
|
+
}
|
|
1174
|
+
return `${theme.success('✓')} ${label}${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1175
|
+
}
|
|
1176
|
+
/**
|
|
1177
|
+
* Format testing tool result
|
|
1178
|
+
*/
|
|
1179
|
+
function formatTestingToolResult(toolName, args, output, success) {
|
|
1180
|
+
const filePath = (args['file_path'] || args['path']);
|
|
1181
|
+
const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
|
|
1182
|
+
if (!success) {
|
|
1183
|
+
return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
|
|
1184
|
+
}
|
|
1185
|
+
switch (toolName) {
|
|
1186
|
+
case 'generate_test_templates': {
|
|
1187
|
+
const countMatch = output.match(/(\d+)\s*(?:test|template)/i);
|
|
1188
|
+
if (countMatch) {
|
|
1189
|
+
return `${theme.success('✓')} Generated ${countMatch[1]} test templates`;
|
|
1190
|
+
}
|
|
1191
|
+
return `${theme.success('✓')} Test templates generated`;
|
|
1192
|
+
}
|
|
1193
|
+
case 'run_coverage_analysis':
|
|
1194
|
+
case 'summarize_coverage_report': {
|
|
1195
|
+
const coverageMatch = output.match(/(\d+(?:\.\d+)?)\s*%/);
|
|
1196
|
+
if (coverageMatch) {
|
|
1197
|
+
const pct = clampPercentage(parseFloat(coverageMatch[1] || '0') || 0);
|
|
1198
|
+
const color = getCoverageColor(pct, { success: theme.success, warning: theme.warning, error: theme.error });
|
|
1199
|
+
return `${theme.success(UI_STRINGS.SUCCESS)} Coverage: ${color(`${pct}%`)}${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1200
|
+
}
|
|
1201
|
+
return `${theme.success(UI_STRINGS.SUCCESS)} Coverage analyzed${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1202
|
+
}
|
|
1203
|
+
case 'analyze_test_coverage': {
|
|
1204
|
+
const coverageMatch = output.match(/(\d+(?:\.\d+)?)\s*%/);
|
|
1205
|
+
if (coverageMatch) {
|
|
1206
|
+
const pct = clampPercentage(parseFloat(coverageMatch[1] || '0') || 0);
|
|
1207
|
+
return `${theme.success(UI_STRINGS.SUCCESS)} Test coverage: ${pct}%`;
|
|
1208
|
+
}
|
|
1209
|
+
return `${theme.success(UI_STRINGS.SUCCESS)} Test coverage analyzed`;
|
|
1210
|
+
}
|
|
1211
|
+
case 'generate_comprehensive_tests': {
|
|
1212
|
+
return `${theme.success('✓')} Comprehensive tests generated${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1213
|
+
}
|
|
1214
|
+
default:
|
|
1215
|
+
return `${theme.success('✓')} Testing tool completed`;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
/**
|
|
1219
|
+
* Format lint result
|
|
1220
|
+
*/
|
|
1221
|
+
function formatLintResult(toolName, args, output, success) {
|
|
1222
|
+
const filePath = (args['file_path'] || args['path']);
|
|
1223
|
+
const displayPath = filePath ? truncatePathForDisplay(filePath, 40) : '';
|
|
1224
|
+
// Try to extract error/warning counts
|
|
1225
|
+
const errorMatch = output.match(/(\d+)\s*error/i);
|
|
1226
|
+
const warnMatch = output.match(/(\d+)\s*warning/i);
|
|
1227
|
+
const errors = errorMatch ? parseInt(errorMatch[1] || '0', 10) : 0;
|
|
1228
|
+
const warnings = warnMatch ? parseInt(warnMatch[1] || '0', 10) : 0;
|
|
1229
|
+
const statusIcon = errors === 0 ? theme.success('✓') : theme.error('✗');
|
|
1230
|
+
switch (toolName) {
|
|
1231
|
+
case 'run_lint_checks': {
|
|
1232
|
+
let summary = `${statusIcon} Lint`;
|
|
1233
|
+
if (displayPath)
|
|
1234
|
+
summary += ` ${displayPath}`;
|
|
1235
|
+
const counts = [];
|
|
1236
|
+
if (errors > 0)
|
|
1237
|
+
counts.push(theme.error(`${errors} errors`));
|
|
1238
|
+
if (warnings > 0)
|
|
1239
|
+
counts.push(theme.warning(`${warnings} warnings`));
|
|
1240
|
+
if (counts.length > 0) {
|
|
1241
|
+
summary += `: ${counts.join(', ')}`;
|
|
1242
|
+
}
|
|
1243
|
+
else if (success) {
|
|
1244
|
+
summary += ': clean';
|
|
1245
|
+
}
|
|
1246
|
+
return summary;
|
|
1247
|
+
}
|
|
1248
|
+
case 'inspect_code_quality': {
|
|
1249
|
+
return `${statusIcon} Code quality inspected${displayPath ? ` for ${displayPath}` : ''}`;
|
|
1250
|
+
}
|
|
1251
|
+
case 'list_lint_rules': {
|
|
1252
|
+
const ruleMatch = output.match(/(\d+)\s*rule/i);
|
|
1253
|
+
if (ruleMatch) {
|
|
1254
|
+
return `${theme.success('✓')} Found ${ruleMatch[1]} lint rules`;
|
|
1255
|
+
}
|
|
1256
|
+
return `${theme.success('✓')} Lint rules listed`;
|
|
1257
|
+
}
|
|
1258
|
+
default:
|
|
1259
|
+
return `${statusIcon} Lint completed`;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
/**
|
|
1263
|
+
* Format cloud deployment result
|
|
1264
|
+
*/
|
|
1265
|
+
function formatCloudResult(toolName, args, output, success) {
|
|
1266
|
+
const provider = (args['provider'] || args['platform']);
|
|
1267
|
+
if (!success) {
|
|
1268
|
+
return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
|
|
1269
|
+
}
|
|
1270
|
+
switch (toolName) {
|
|
1271
|
+
case 'cloud_status': {
|
|
1272
|
+
return `${theme.success('✓')} Cloud status checked${provider ? ` (${provider})` : ''}`;
|
|
1273
|
+
}
|
|
1274
|
+
case 'cloud_deploy':
|
|
1275
|
+
case 'firebase_deploy':
|
|
1276
|
+
case 'aliyun_deploy': {
|
|
1277
|
+
// Try to extract URL from output
|
|
1278
|
+
const urlMatch = output.match(/https?:\/\/[^\s]+/);
|
|
1279
|
+
if (urlMatch) {
|
|
1280
|
+
return `${theme.success('✓')} Deployed to ${theme.info(urlMatch[0])}`;
|
|
1281
|
+
}
|
|
1282
|
+
return `${theme.success('✓')} Deployment successful${provider ? ` (${provider})` : ''}`;
|
|
1283
|
+
}
|
|
1284
|
+
case 'cloud_init': {
|
|
1285
|
+
return `${theme.success('✓')} Cloud project initialized${provider ? ` (${provider})` : ''}`;
|
|
1286
|
+
}
|
|
1287
|
+
case 'cloud_login': {
|
|
1288
|
+
return `${theme.success('✓')} Logged in${provider ? ` to ${provider}` : ''}`;
|
|
1289
|
+
}
|
|
1290
|
+
default:
|
|
1291
|
+
return `${theme.success('✓')} Cloud operation completed`;
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
/**
|
|
1295
|
+
* Format browser automation result
|
|
1296
|
+
*/
|
|
1297
|
+
function formatBrowserResult(toolName, args, output, success) {
|
|
1298
|
+
if (!success) {
|
|
1299
|
+
return `${theme.error('✗')} Browser ${toolName.replace('browser_', '')} failed`;
|
|
1300
|
+
}
|
|
1301
|
+
switch (toolName) {
|
|
1302
|
+
case 'browser_create_session': {
|
|
1303
|
+
const sessionMatch = output.match(/session[:\s]+["']?([^"'\s\n]+)/i);
|
|
1304
|
+
if (sessionMatch) {
|
|
1305
|
+
return `${theme.success('✓')} Browser session created: ${theme.info(sessionMatch[1] || '')}`;
|
|
1306
|
+
}
|
|
1307
|
+
return `${theme.success('✓')} Browser session created`;
|
|
1308
|
+
}
|
|
1309
|
+
case 'browser_navigate': {
|
|
1310
|
+
const url = (args['url']);
|
|
1311
|
+
if (url) {
|
|
1312
|
+
try {
|
|
1313
|
+
const hostname = new URL(url).hostname;
|
|
1314
|
+
return `${theme.success('✓')} Navigated to ${theme.info(hostname)}`;
|
|
1315
|
+
}
|
|
1316
|
+
catch {
|
|
1317
|
+
return `${theme.success('✓')} Navigated to page`;
|
|
1318
|
+
}
|
|
1319
|
+
}
|
|
1320
|
+
return `${theme.success('✓')} Navigated`;
|
|
1321
|
+
}
|
|
1322
|
+
case 'browser_click': {
|
|
1323
|
+
const selector = (args['selector']);
|
|
1324
|
+
return `${theme.success('✓')} Clicked ${selector ? theme.dim(selector) : 'element'}`;
|
|
1325
|
+
}
|
|
1326
|
+
case 'browser_type': {
|
|
1327
|
+
const selector = (args['selector']);
|
|
1328
|
+
return `${theme.success('✓')} Typed text ${selector ? `in ${theme.dim(selector)}` : ''}`;
|
|
1329
|
+
}
|
|
1330
|
+
case 'browser_screenshot': {
|
|
1331
|
+
const path = (args['path'] || args['file_path']);
|
|
1332
|
+
if (path) {
|
|
1333
|
+
return `${theme.success('✓')} Screenshot saved: ${truncatePathForDisplay(path, 40)}`;
|
|
1334
|
+
}
|
|
1335
|
+
return `${theme.success('✓')} Screenshot captured`;
|
|
1336
|
+
}
|
|
1337
|
+
case 'browser_close_session': {
|
|
1338
|
+
return `${theme.success('✓')} Browser session closed`;
|
|
1339
|
+
}
|
|
1340
|
+
default:
|
|
1341
|
+
return `${theme.success('✓')} Browser action completed`;
|
|
1342
|
+
}
|
|
1343
|
+
}
|
|
1344
|
+
/**
|
|
1345
|
+
* Format email result
|
|
1346
|
+
*/
|
|
1347
|
+
function formatEmailResult(toolName, args, _output, success) {
|
|
1348
|
+
if (!success) {
|
|
1349
|
+
return `${theme.error('✗')} ${toolName.replace(/_/g, ' ')} failed`;
|
|
1350
|
+
}
|
|
1351
|
+
switch (toolName) {
|
|
1352
|
+
case 'send_email': {
|
|
1353
|
+
const to = (args['to']);
|
|
1354
|
+
const recipients = Array.isArray(to) ? to.length : (to ? 1 : 0);
|
|
1355
|
+
return `${theme.success('✓')} Email sent${recipients ? ` to ${recipients} recipient${recipients === 1 ? '' : 's'}` : ''}`;
|
|
1356
|
+
}
|
|
1357
|
+
case 'send_batch_emails': {
|
|
1358
|
+
const emails = (args['emails']);
|
|
1359
|
+
const count = emails?.length || 0;
|
|
1360
|
+
return `${theme.success('✓')} Sent ${count} email${count === 1 ? '' : 's'}`;
|
|
1361
|
+
}
|
|
1362
|
+
case 'verify_email_config': {
|
|
1363
|
+
return `${theme.success('✓')} Email config verified`;
|
|
1364
|
+
}
|
|
1365
|
+
default:
|
|
1366
|
+
return `${theme.success('✓')} Email operation completed`;
|
|
1367
|
+
}
|
|
1368
|
+
}
|
|
1369
|
+
/**
|
|
1370
|
+
* Format skill result
|
|
1371
|
+
*/
|
|
1372
|
+
function formatSkillResult(toolName, args, output, success) {
|
|
1373
|
+
if (!success) {
|
|
1374
|
+
return `${theme.error('✗')} Skill operation failed`;
|
|
1375
|
+
}
|
|
1376
|
+
switch (toolName) {
|
|
1377
|
+
case 'ListSkills': {
|
|
1378
|
+
const skillMatch = output.match(/(\d+)\s*skill/i);
|
|
1379
|
+
if (skillMatch) {
|
|
1380
|
+
return `${theme.success('✓')} Found ${skillMatch[1]} skills`;
|
|
1381
|
+
}
|
|
1382
|
+
return `${theme.success('✓')} Skills listed`;
|
|
1383
|
+
}
|
|
1384
|
+
case 'Skill': {
|
|
1385
|
+
const skillName = (args['skill'] || args['name']);
|
|
1386
|
+
if (skillName) {
|
|
1387
|
+
return `${theme.success('✓')} Skill "${skillName}" executed`;
|
|
1388
|
+
}
|
|
1389
|
+
return `${theme.success('✓')} Skill executed`;
|
|
1390
|
+
}
|
|
1391
|
+
default:
|
|
1392
|
+
return `${theme.success('✓')} Skill completed`;
|
|
1393
|
+
}
|
|
1394
|
+
}
|
|
1395
|
+
function formatPlanUpdateResult(args, _output, success) {
|
|
1396
|
+
if (!success) {
|
|
1397
|
+
return `${theme.error('✗')} Plan update failed`;
|
|
1398
|
+
}
|
|
1399
|
+
const plan = normalizePlanItems(args['plan']);
|
|
1400
|
+
const explanation = typeof args['explanation'] === 'string' ? args['explanation'].trim() : '';
|
|
1401
|
+
const width = resolvePlanWidth();
|
|
1402
|
+
const body = formatPlan(plan, { width, heading: 'Updated Plan' });
|
|
1403
|
+
if (!explanation) {
|
|
1404
|
+
return body;
|
|
1405
|
+
}
|
|
1406
|
+
const wrappedNote = wrapPlanText(explanation, ' ', width);
|
|
1407
|
+
return `${body}\n${wrappedNote.join('\n')}`;
|
|
1408
|
+
}
|
|
1409
|
+
/**
|
|
1410
|
+
* Format plan mode result
|
|
1411
|
+
*/
|
|
1412
|
+
function formatPlanModeResult(_args, _output, success) {
|
|
1413
|
+
if (!success) {
|
|
1414
|
+
return `${theme.error('✗')} Failed to exit plan mode`;
|
|
1415
|
+
}
|
|
1416
|
+
return `${theme.success('✓')} Exited plan mode`;
|
|
1417
|
+
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Format repo checks result
|
|
1420
|
+
*/
|
|
1421
|
+
function formatRepoChecksResult(args, output, success) {
|
|
1422
|
+
const checks = (args['checks']);
|
|
1423
|
+
const checkCount = checks?.length || 0;
|
|
1424
|
+
// Try to extract pass/fail counts
|
|
1425
|
+
const passMatch = output.match(/(\d+)\s*pass/i);
|
|
1426
|
+
const failMatch = output.match(/(\d+)\s*fail/i);
|
|
1427
|
+
const passed = passMatch ? parseInt(passMatch[1] || '0', 10) : 0;
|
|
1428
|
+
const failed = failMatch ? parseInt(failMatch[1] || '0', 10) : 0;
|
|
1429
|
+
const statusIcon = success && failed === 0 ? theme.success('✓') : theme.error('✗');
|
|
1430
|
+
if (passed > 0 || failed > 0) {
|
|
1431
|
+
const counts = [];
|
|
1432
|
+
if (passed > 0)
|
|
1433
|
+
counts.push(theme.success(`${passed} passed`));
|
|
1434
|
+
if (failed > 0)
|
|
1435
|
+
counts.push(theme.error(`${failed} failed`));
|
|
1436
|
+
return `${statusIcon} Repo checks: ${counts.join(', ')}`;
|
|
1437
|
+
}
|
|
1438
|
+
return `${statusIcon} Repo checks${checkCount > 0 ? ` (${checkCount} checks)` : ''} ${success ? 'passed' : 'failed'}`;
|
|
1439
|
+
}
|
|
1440
|
+
/**
|
|
1441
|
+
* Format learn tool result
|
|
1442
|
+
*/
|
|
1443
|
+
function formatLearnResult(toolName, args, output, success) {
|
|
1444
|
+
if (!success) {
|
|
1445
|
+
return `${theme.error('✗')} Learning failed`;
|
|
1446
|
+
}
|
|
1447
|
+
switch (toolName) {
|
|
1448
|
+
case 'learn_codebase': {
|
|
1449
|
+
const fileMatch = output.match(/(\d+)\s*file/i);
|
|
1450
|
+
if (fileMatch) {
|
|
1451
|
+
return `${theme.success('✓')} Learned codebase: ${fileMatch[1]} files analyzed`;
|
|
1452
|
+
}
|
|
1453
|
+
return `${theme.success('✓')} Codebase learned`;
|
|
1454
|
+
}
|
|
1455
|
+
case 'learn_file': {
|
|
1456
|
+
const filePath = (args['file_path'] || args['path']);
|
|
1457
|
+
if (filePath) {
|
|
1458
|
+
return `${theme.success('✓')} Learned: ${truncatePathForDisplay(filePath, 40)}`;
|
|
1459
|
+
}
|
|
1460
|
+
return `${theme.success('✓')} File learned`;
|
|
1461
|
+
}
|
|
1462
|
+
case 'learn_topic': {
|
|
1463
|
+
const topic = (args['topic']);
|
|
1464
|
+
if (topic) {
|
|
1465
|
+
return `${theme.success('✓')} Learned topic: ${topic}`;
|
|
1466
|
+
}
|
|
1467
|
+
return `${theme.success('✓')} Topic learned`;
|
|
1468
|
+
}
|
|
1469
|
+
case 'learn_summary': {
|
|
1470
|
+
return `${theme.success('✓')} Summary generated`;
|
|
1471
|
+
}
|
|
1472
|
+
case 'explore': {
|
|
1473
|
+
const query = (args['query']);
|
|
1474
|
+
const filesMatch = output.match(/Found\s+(\d+)\s+(?:file|relevant)/i);
|
|
1475
|
+
const symbolsMatch = output.match(/Found\s+(\d+)\s+symbol/i);
|
|
1476
|
+
const filesCount = filesMatch ? filesMatch[1] : null;
|
|
1477
|
+
const symbolsCount = symbolsMatch ? symbolsMatch[1] : null;
|
|
1478
|
+
if (filesCount || symbolsCount) {
|
|
1479
|
+
const parts = [];
|
|
1480
|
+
if (filesCount)
|
|
1481
|
+
parts.push(`${filesCount} files`);
|
|
1482
|
+
if (symbolsCount)
|
|
1483
|
+
parts.push(`${symbolsCount} symbols`);
|
|
1484
|
+
return `${theme.success('✓')} Explored: ${parts.join(', ')}`;
|
|
1485
|
+
}
|
|
1486
|
+
if (query) {
|
|
1487
|
+
return `${theme.success('✓')} Explored: "${query.slice(0, 30)}${query.length > 30 ? '...' : ''}"`;
|
|
1488
|
+
}
|
|
1489
|
+
return `${theme.success('✓')} Exploration complete`;
|
|
1490
|
+
}
|
|
1491
|
+
case 'explore_index': {
|
|
1492
|
+
const action = (args['action']);
|
|
1493
|
+
const indexMatch = output.match(/(\d+)\s*files/i);
|
|
1494
|
+
if (action === 'rebuild' && indexMatch) {
|
|
1495
|
+
return `${theme.success('✓')} Index rebuilt: ${indexMatch[1]} files`;
|
|
1496
|
+
}
|
|
1497
|
+
if (action === 'status' && indexMatch) {
|
|
1498
|
+
return `${theme.info('ℹ')} Index: ${indexMatch[1]} files`;
|
|
1499
|
+
}
|
|
1500
|
+
return `${theme.success('✓')} Index ${action || 'managed'}`;
|
|
1501
|
+
}
|
|
1502
|
+
default:
|
|
1503
|
+
return `${theme.success('✓')} Learning completed`;
|
|
1504
|
+
}
|
|
1505
|
+
}
|
|
1506
|
+
// ============================================================================
|
|
1507
|
+
// ADVANCED PROGRESS INDICATORS
|
|
1508
|
+
// ============================================================================
|
|
1509
|
+
/**
|
|
1510
|
+
* Format a compact progress bar
|
|
1511
|
+
*/
|
|
1512
|
+
export function formatCompactProgressBar(current, total, options = {}) {
|
|
1513
|
+
const { width = PROGRESS.COMPACT_WIDTH, style = 'bar' } = options;
|
|
1514
|
+
const percentage = calculatePercentage(current, total);
|
|
1515
|
+
const ratio = total > 0 ? current / total : 0;
|
|
1516
|
+
const filled = Math.round(ratio * width);
|
|
1517
|
+
const empty = Math.max(0, width - filled);
|
|
1518
|
+
let bar;
|
|
1519
|
+
switch (style) {
|
|
1520
|
+
case 'braille': {
|
|
1521
|
+
// Smooth braille progress (8 states per character)
|
|
1522
|
+
const fullBlocks = Math.floor(ratio * width);
|
|
1523
|
+
const remainder = (ratio * width) - fullBlocks;
|
|
1524
|
+
const partials = [' ', '⡀', '⡄', '⡆', '⡇', '⣇', '⣧', '⣷', '⣿'];
|
|
1525
|
+
const partialIndex = Math.floor(remainder * 8);
|
|
1526
|
+
bar = '⣿'.repeat(fullBlocks);
|
|
1527
|
+
if (fullBlocks < width) {
|
|
1528
|
+
bar += partials[partialIndex] ?? ' ';
|
|
1529
|
+
bar += ' '.repeat(Math.max(0, width - fullBlocks - 1));
|
|
1530
|
+
}
|
|
1531
|
+
bar = theme.progress?.bar?.(bar) ?? theme.info(bar);
|
|
1532
|
+
break;
|
|
1533
|
+
}
|
|
1534
|
+
case 'dots':
|
|
1535
|
+
bar = theme.success('●').repeat(filled) + theme.ui.muted('○').repeat(empty);
|
|
1536
|
+
break;
|
|
1537
|
+
case 'bar':
|
|
1538
|
+
default:
|
|
1539
|
+
bar = (theme.progress?.bar ?? theme.info)(progressChars.filled.repeat(filled)) +
|
|
1540
|
+
(theme.progress?.empty ?? theme.ui.muted)(progressChars.empty.repeat(empty));
|
|
1541
|
+
}
|
|
1542
|
+
return `[${bar}] ${(theme.progress?.percentage ?? theme.warning)(`${percentage}%`)}`;
|
|
1543
|
+
}
|
|
1544
|
+
/**
|
|
1545
|
+
* Format a micro progress indicator (fits in status line)
|
|
1546
|
+
*/
|
|
1547
|
+
export function formatMicroProgress(current, total) {
|
|
1548
|
+
const percentage = calculatePercentage(current, total);
|
|
1549
|
+
// Use single-char block progress
|
|
1550
|
+
const blocks = PROGRESS.CHARS.partial;
|
|
1551
|
+
const blockIndex = Math.min(blocks.length - 1, Math.floor(percentage / 25));
|
|
1552
|
+
const block = blocks[blockIndex] ?? blocks[0];
|
|
1553
|
+
return `${theme.info(block)}${percentage}%`;
|
|
1554
|
+
}
|
|
1555
|
+
/**
|
|
1556
|
+
* Format a spinner with elapsed time
|
|
1557
|
+
*/
|
|
1558
|
+
export function formatSpinnerWithTime(frame, label, elapsedMs) {
|
|
1559
|
+
const elapsed = formatDurationMs(elapsedMs);
|
|
1560
|
+
return `${theme.info(frame)} ${label} ${theme.ui.muted(`(${elapsed})`)}`;
|
|
1561
|
+
}
|
|
1562
|
+
/**
|
|
1563
|
+
* Format multiple tool operations on a single line
|
|
1564
|
+
*/
|
|
1565
|
+
export function formatCompactToolLine(operations, options = {}) {
|
|
1566
|
+
const { separator = ' · ', maxWidth = 80 } = options;
|
|
1567
|
+
const badges = [];
|
|
1568
|
+
let currentLength = 0;
|
|
1569
|
+
for (const op of operations) {
|
|
1570
|
+
const icon = op.status === 'success' ? icons.success :
|
|
1571
|
+
op.status === 'error' ? icons.error : icons.running;
|
|
1572
|
+
const statusColor = op.status === 'success' ? theme.success :
|
|
1573
|
+
op.status === 'error' ? theme.error : theme.info;
|
|
1574
|
+
const toolColor = getToolColor(op.name);
|
|
1575
|
+
let badge = `${statusColor(icon)} ${toolColor(op.name)}`;
|
|
1576
|
+
if (op.summary) {
|
|
1577
|
+
badge += ` ${theme.ui.muted(op.summary)}`;
|
|
1578
|
+
}
|
|
1579
|
+
// eslint-disable-next-line no-control-regex
|
|
1580
|
+
const badgeLength = badge.replace(/\u001B\[[0-9;]*m/g, '').length;
|
|
1581
|
+
// eslint-disable-next-line no-control-regex
|
|
1582
|
+
const sepLength = badges.length > 0 ? separator.replace(/\u001B\[[0-9;]*m/g, '').length : 0;
|
|
1583
|
+
if (currentLength + sepLength + badgeLength > maxWidth - 5) {
|
|
1584
|
+
const remaining = operations.length - badges.length;
|
|
1585
|
+
if (remaining > 0) {
|
|
1586
|
+
badges.push(theme.ui.muted(`+${remaining} more`));
|
|
1587
|
+
}
|
|
1588
|
+
break;
|
|
1589
|
+
}
|
|
1590
|
+
badges.push(badge);
|
|
1591
|
+
currentLength += sepLength + badgeLength;
|
|
1592
|
+
}
|
|
1593
|
+
return badges.join(theme.ui.muted(separator));
|
|
1594
|
+
}
|
|
1595
|
+
/**
|
|
1596
|
+
* Format a file operation summary with additions/removals
|
|
1597
|
+
*/
|
|
1598
|
+
export function formatFileOpSummary(path, type, stats) {
|
|
1599
|
+
const shortPath = truncatePathForDisplay(path, 40);
|
|
1600
|
+
const icon = type === 'read' ? icons.success :
|
|
1601
|
+
type === 'edit' ? icons.success : icons.success;
|
|
1602
|
+
const color = theme.success;
|
|
1603
|
+
const parts = [
|
|
1604
|
+
`${color(icon)} ${theme.file?.path?.(shortPath) ?? theme.info(shortPath)}`,
|
|
1605
|
+
];
|
|
1606
|
+
if (stats) {
|
|
1607
|
+
const details = [];
|
|
1608
|
+
if (stats.lines !== undefined) {
|
|
1609
|
+
details.push(`${stats.lines} lines`);
|
|
1610
|
+
}
|
|
1611
|
+
if (stats.additions !== undefined && stats.additions > 0) {
|
|
1612
|
+
details.push((theme.file?.additions ?? theme.success)(`+${stats.additions}`));
|
|
1613
|
+
}
|
|
1614
|
+
if (stats.removals !== undefined && stats.removals > 0) {
|
|
1615
|
+
details.push((theme.file?.removals ?? theme.error)(`-${stats.removals}`));
|
|
1616
|
+
}
|
|
1617
|
+
if (details.length > 0) {
|
|
1618
|
+
parts.push(theme.ui.muted(`(${details.join(', ')})`));
|
|
1619
|
+
}
|
|
1620
|
+
}
|
|
1621
|
+
return parts.join(' ');
|
|
1622
|
+
}
|
|
1623
|
+
/**
|
|
1624
|
+
* Format a search result summary
|
|
1625
|
+
*/
|
|
1626
|
+
export function formatSearchOpSummary(pattern, matchCount, fileCount, durationMs) {
|
|
1627
|
+
const truncPattern = pattern.length > 25 ? `${pattern.slice(0, 22)}...` : pattern;
|
|
1628
|
+
if (matchCount === 0) {
|
|
1629
|
+
return `${theme.warning(icons.pending)} No matches for "${truncPattern}"`;
|
|
1630
|
+
}
|
|
1631
|
+
const parts = [
|
|
1632
|
+
`${theme.success(icons.success)} Found`,
|
|
1633
|
+
theme.info(`${matchCount}`),
|
|
1634
|
+
matchCount === 1 ? 'match' : 'matches',
|
|
1635
|
+
];
|
|
1636
|
+
if (fileCount && fileCount > 0) {
|
|
1637
|
+
parts.push('in', theme.info(`${fileCount}`), fileCount === 1 ? 'file' : 'files');
|
|
1638
|
+
}
|
|
1639
|
+
parts.push(theme.ui.muted(`for "${truncPattern}"`));
|
|
1640
|
+
if (durationMs) {
|
|
1641
|
+
parts.push(theme.ui.muted(`(${formatDuration(durationMs)})`));
|
|
1642
|
+
}
|
|
1643
|
+
return parts.join(' ');
|
|
1644
|
+
}
|
|
1645
|
+
/**
|
|
1646
|
+
* Format a context usage badge
|
|
1647
|
+
*/
|
|
1648
|
+
export function formatContextBadge(usedPercentage) {
|
|
1649
|
+
const remaining = 100 - usedPercentage;
|
|
1650
|
+
const color = usedPercentage > 80 ? theme.error :
|
|
1651
|
+
usedPercentage > 60 ? theme.warning : theme.success;
|
|
1652
|
+
return `${color(icons.context)}${remaining}%`;
|
|
1653
|
+
}
|
|
1654
|
+
//# sourceMappingURL=toolDisplay.js.map
|