erosolar-cli 1.7.195 → 1.7.197
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/dist/StringUtils.d.ts +8 -0
- package/dist/StringUtils.d.ts.map +1 -0
- package/dist/StringUtils.js +11 -0
- package/dist/StringUtils.js.map +1 -0
- package/dist/adapters/browser/index.d.ts +12 -0
- package/dist/adapters/browser/index.d.ts.map +1 -0
- package/dist/adapters/browser/index.js +11 -0
- package/dist/adapters/browser/index.js.map +1 -0
- package/dist/adapters/node/index.d.ts +17 -0
- package/dist/adapters/node/index.d.ts.map +1 -0
- package/dist/adapters/node/index.js +35 -0
- package/dist/adapters/node/index.js.map +1 -0
- package/dist/adapters/remote/index.d.ts +13 -0
- package/dist/adapters/remote/index.d.ts.map +1 -0
- package/dist/adapters/remote/index.js +20 -0
- package/dist/adapters/remote/index.js.map +1 -0
- package/dist/adapters/types.d.ts +14 -0
- package/dist/adapters/types.d.ts.map +1 -0
- package/dist/adapters/types.js +2 -0
- package/dist/adapters/types.js.map +1 -0
- package/dist/alpha-zero/agentWrapper.d.ts +84 -0
- package/dist/alpha-zero/agentWrapper.d.ts.map +1 -0
- package/dist/alpha-zero/agentWrapper.js +171 -0
- package/dist/alpha-zero/agentWrapper.js.map +1 -0
- package/dist/alpha-zero/codeEvaluator.d.ts +25 -0
- package/dist/alpha-zero/codeEvaluator.d.ts.map +1 -0
- package/dist/alpha-zero/codeEvaluator.js +273 -0
- package/dist/alpha-zero/codeEvaluator.js.map +1 -0
- package/dist/alpha-zero/competitiveRunner.d.ts +66 -0
- package/dist/alpha-zero/competitiveRunner.d.ts.map +1 -0
- package/dist/alpha-zero/competitiveRunner.js +224 -0
- package/dist/alpha-zero/competitiveRunner.js.map +1 -0
- package/dist/alpha-zero/index.d.ts +67 -0
- package/dist/alpha-zero/index.d.ts.map +1 -0
- package/dist/alpha-zero/index.js +99 -0
- package/dist/alpha-zero/index.js.map +1 -0
- package/dist/alpha-zero/introspection.d.ts +128 -0
- package/dist/alpha-zero/introspection.d.ts.map +1 -0
- package/dist/alpha-zero/introspection.js +300 -0
- package/dist/alpha-zero/introspection.js.map +1 -0
- package/dist/alpha-zero/metricsTracker.d.ts +71 -0
- package/dist/alpha-zero/metricsTracker.d.ts.map +1 -0
- package/dist/alpha-zero/metricsTracker.js +209 -0
- package/dist/alpha-zero/metricsTracker.js.map +1 -0
- package/dist/alpha-zero/security/core.d.ts +125 -0
- package/dist/alpha-zero/security/core.d.ts.map +1 -0
- package/dist/alpha-zero/security/core.js +271 -0
- package/dist/alpha-zero/security/core.js.map +1 -0
- package/dist/alpha-zero/security/google.d.ts +125 -0
- package/dist/alpha-zero/security/google.d.ts.map +1 -0
- package/dist/alpha-zero/security/google.js +311 -0
- package/dist/alpha-zero/security/google.js.map +1 -0
- package/dist/alpha-zero/security/googleLoader.d.ts +17 -0
- package/dist/alpha-zero/security/googleLoader.d.ts.map +1 -0
- package/dist/alpha-zero/security/googleLoader.js +41 -0
- package/dist/alpha-zero/security/googleLoader.js.map +1 -0
- package/dist/alpha-zero/security/index.d.ts +29 -0
- package/dist/alpha-zero/security/index.d.ts.map +1 -0
- package/dist/alpha-zero/security/index.js +32 -0
- package/dist/alpha-zero/security/index.js.map +1 -0
- package/dist/alpha-zero/security/simulation.d.ts +124 -0
- package/dist/alpha-zero/security/simulation.d.ts.map +1 -0
- package/dist/alpha-zero/security/simulation.js +277 -0
- package/dist/alpha-zero/security/simulation.js.map +1 -0
- package/dist/alpha-zero/selfModification.d.ts +109 -0
- package/dist/alpha-zero/selfModification.d.ts.map +1 -0
- package/dist/alpha-zero/selfModification.js +233 -0
- package/dist/alpha-zero/selfModification.js.map +1 -0
- package/dist/alpha-zero/types.d.ts +170 -0
- package/dist/alpha-zero/types.d.ts.map +1 -0
- package/dist/alpha-zero/types.js +31 -0
- package/dist/alpha-zero/types.js.map +1 -0
- package/dist/bin/erosolar.d.ts +9 -0
- package/dist/bin/erosolar.d.ts.map +1 -0
- package/dist/bin/erosolar.js +88 -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/browser/BrowserSessionManager.d.ts +307 -0
- package/dist/browser/BrowserSessionManager.d.ts.map +1 -0
- package/dist/browser/BrowserSessionManager.js +713 -0
- package/dist/browser/BrowserSessionManager.js.map +1 -0
- package/dist/capabilities/advancedTestGenerationCapability.d.ts +17 -0
- package/dist/capabilities/advancedTestGenerationCapability.d.ts.map +1 -0
- package/dist/capabilities/advancedTestGenerationCapability.js +28 -0
- package/dist/capabilities/advancedTestGenerationCapability.js.map +1 -0
- package/dist/capabilities/agentSpawningCapability.d.ts +6 -0
- package/dist/capabilities/agentSpawningCapability.d.ts.map +1 -0
- package/dist/capabilities/agentSpawningCapability.js +115 -0
- package/dist/capabilities/agentSpawningCapability.js.map +1 -0
- package/dist/capabilities/askUserCapability.d.ts +21 -0
- package/dist/capabilities/askUserCapability.d.ts.map +1 -0
- package/dist/capabilities/askUserCapability.js +155 -0
- package/dist/capabilities/askUserCapability.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/browserAutomationCapability.d.ts +37 -0
- package/dist/capabilities/browserAutomationCapability.d.ts.map +1 -0
- package/dist/capabilities/browserAutomationCapability.js +49 -0
- package/dist/capabilities/browserAutomationCapability.js.map +1 -0
- package/dist/capabilities/cloudCapability.d.ts +13 -0
- package/dist/capabilities/cloudCapability.d.ts.map +1 -0
- package/dist/capabilities/cloudCapability.js +38 -0
- package/dist/capabilities/cloudCapability.js.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts +13 -0
- package/dist/capabilities/codeAnalysisCapability.d.ts.map +1 -0
- package/dist/capabilities/codeAnalysisCapability.js +24 -0
- package/dist/capabilities/codeAnalysisCapability.js.map +1 -0
- package/dist/capabilities/codeGenerationCapability.d.ts +13 -0
- package/dist/capabilities/codeGenerationCapability.d.ts.map +1 -0
- package/dist/capabilities/codeGenerationCapability.js +25 -0
- package/dist/capabilities/codeGenerationCapability.js.map +1 -0
- package/dist/capabilities/codeQualityCapability.d.ts +13 -0
- package/dist/capabilities/codeQualityCapability.d.ts.map +1 -0
- package/dist/capabilities/codeQualityCapability.js +25 -0
- package/dist/capabilities/codeQualityCapability.js.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts +13 -0
- package/dist/capabilities/dependencySecurityCapability.d.ts.map +1 -0
- package/dist/capabilities/dependencySecurityCapability.js +24 -0
- package/dist/capabilities/dependencySecurityCapability.js.map +1 -0
- package/dist/capabilities/devCapability.d.ts +13 -0
- package/dist/capabilities/devCapability.d.ts.map +1 -0
- package/dist/capabilities/devCapability.js +24 -0
- package/dist/capabilities/devCapability.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/emailCapability.d.ts +12 -0
- package/dist/capabilities/emailCapability.d.ts.map +1 -0
- package/dist/capabilities/emailCapability.js +22 -0
- package/dist/capabilities/emailCapability.js.map +1 -0
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts +17 -0
- package/dist/capabilities/enhancedCodeIntelligenceCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js +28 -0
- package/dist/capabilities/enhancedCodeIntelligenceCapability.js.map +1 -0
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts +17 -0
- package/dist/capabilities/enhancedDevWorkflowCapability.d.ts.map +1 -0
- package/dist/capabilities/enhancedDevWorkflowCapability.js +28 -0
- package/dist/capabilities/enhancedDevWorkflowCapability.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/frontendTestingCapability.d.ts +13 -0
- package/dist/capabilities/frontendTestingCapability.d.ts.map +1 -0
- package/dist/capabilities/frontendTestingCapability.js +28 -0
- package/dist/capabilities/frontendTestingCapability.js.map +1 -0
- package/dist/capabilities/globCapability.d.ts +17 -0
- package/dist/capabilities/globCapability.d.ts.map +1 -0
- package/dist/capabilities/globCapability.js +27 -0
- package/dist/capabilities/globCapability.js.map +1 -0
- package/dist/capabilities/index.d.ts +25 -0
- package/dist/capabilities/index.d.ts.map +1 -0
- package/dist/capabilities/index.js +25 -0
- package/dist/capabilities/index.js.map +1 -0
- package/dist/capabilities/interactionCapability.d.ts +12 -0
- package/dist/capabilities/interactionCapability.d.ts.map +1 -0
- package/dist/capabilities/interactionCapability.js +22 -0
- package/dist/capabilities/interactionCapability.js.map +1 -0
- package/dist/capabilities/learnCapability.d.ts +13 -0
- package/dist/capabilities/learnCapability.d.ts.map +1 -0
- package/dist/capabilities/learnCapability.js +24 -0
- package/dist/capabilities/learnCapability.js.map +1 -0
- package/dist/capabilities/mcpCapability.d.ts +6 -0
- package/dist/capabilities/mcpCapability.d.ts.map +1 -0
- package/dist/capabilities/mcpCapability.js +19 -0
- package/dist/capabilities/mcpCapability.js.map +1 -0
- package/dist/capabilities/notebookCapability.d.ts +17 -0
- package/dist/capabilities/notebookCapability.d.ts.map +1 -0
- package/dist/capabilities/notebookCapability.js +27 -0
- package/dist/capabilities/notebookCapability.js.map +1 -0
- package/dist/capabilities/performanceMonitoringCapability.d.ts +108 -0
- package/dist/capabilities/performanceMonitoringCapability.d.ts.map +1 -0
- package/dist/capabilities/performanceMonitoringCapability.js +176 -0
- package/dist/capabilities/performanceMonitoringCapability.js.map +1 -0
- package/dist/capabilities/planningCapability.d.ts +16 -0
- package/dist/capabilities/planningCapability.d.ts.map +1 -0
- package/dist/capabilities/planningCapability.js +26 -0
- package/dist/capabilities/planningCapability.js.map +1 -0
- package/dist/capabilities/refactoringCapability.d.ts +13 -0
- package/dist/capabilities/refactoringCapability.d.ts.map +1 -0
- package/dist/capabilities/refactoringCapability.js +25 -0
- package/dist/capabilities/refactoringCapability.js.map +1 -0
- package/dist/capabilities/repoChecksCapability.d.ts +10 -0
- package/dist/capabilities/repoChecksCapability.d.ts.map +1 -0
- package/dist/capabilities/repoChecksCapability.js +24 -0
- package/dist/capabilities/repoChecksCapability.js.map +1 -0
- package/dist/capabilities/searchCapability.d.ts +13 -0
- package/dist/capabilities/searchCapability.d.ts.map +1 -0
- package/dist/capabilities/searchCapability.js +24 -0
- package/dist/capabilities/searchCapability.js.map +1 -0
- package/dist/capabilities/skillCapability.d.ts +3 -0
- package/dist/capabilities/skillCapability.d.ts.map +1 -0
- package/dist/capabilities/skillCapability.js +77 -0
- package/dist/capabilities/skillCapability.js.map +1 -0
- package/dist/capabilities/taskManagementCapability.d.ts +12 -0
- package/dist/capabilities/taskManagementCapability.d.ts.map +1 -0
- package/dist/capabilities/taskManagementCapability.js +22 -0
- package/dist/capabilities/taskManagementCapability.js.map +1 -0
- package/dist/capabilities/testingCapability.d.ts +13 -0
- package/dist/capabilities/testingCapability.d.ts.map +1 -0
- package/dist/capabilities/testingCapability.js +25 -0
- package/dist/capabilities/testingCapability.js.map +1 -0
- package/dist/capabilities/todoCapability.d.ts +19 -0
- package/dist/capabilities/todoCapability.d.ts.map +1 -0
- package/dist/capabilities/todoCapability.js +169 -0
- package/dist/capabilities/todoCapability.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 +160 -0
- package/dist/capabilities/toolManifest.js.map +1 -0
- package/dist/capabilities/toolRegistry.d.ts +22 -0
- package/dist/capabilities/toolRegistry.d.ts.map +1 -0
- package/dist/capabilities/toolRegistry.js +115 -0
- package/dist/capabilities/toolRegistry.js.map +1 -0
- package/dist/capabilities/validationCapability.d.ts +13 -0
- package/dist/capabilities/validationCapability.d.ts.map +1 -0
- package/dist/capabilities/validationCapability.js +24 -0
- package/dist/capabilities/validationCapability.js.map +1 -0
- package/dist/capabilities/webCapability.d.ts +12 -0
- package/dist/capabilities/webCapability.d.ts.map +1 -0
- package/dist/capabilities/webCapability.js +22 -0
- package/dist/capabilities/webCapability.js.map +1 -0
- package/dist/config.d.ts +25 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +140 -0
- package/dist/config.js.map +1 -0
- package/dist/contracts/v1/agent.d.ts +147 -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/LazyLoader.d.ts +129 -0
- package/dist/core/LazyLoader.d.ts.map +1 -0
- package/dist/core/LazyLoader.js +240 -0
- package/dist/core/LazyLoader.js.map +1 -0
- package/dist/core/agent.d.ts +150 -0
- package/dist/core/agent.d.ts.map +1 -0
- package/dist/core/agent.js +789 -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 +234 -0
- package/dist/core/agentSchemaLoader.js.map +1 -0
- package/dist/core/cliTestHarness.d.ts +200 -0
- package/dist/core/cliTestHarness.d.ts.map +1 -0
- package/dist/core/cliTestHarness.js +549 -0
- package/dist/core/cliTestHarness.js.map +1 -0
- package/dist/core/contextManager.d.ts +259 -0
- package/dist/core/contextManager.d.ts.map +1 -0
- package/dist/core/contextManager.js +1057 -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 +18 -0
- package/dist/core/customCommands.d.ts.map +1 -0
- package/dist/core/customCommands.js +81 -0
- package/dist/core/customCommands.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 +348 -0
- package/dist/core/errors/errorTypes.js.map +1 -0
- package/dist/core/errors/errorUtils.d.ts +87 -0
- package/dist/core/errors/errorUtils.d.ts.map +1 -0
- package/dist/core/errors/errorUtils.js +158 -0
- package/dist/core/errors/errorUtils.js.map +1 -0
- package/dist/core/errors/safetyValidator.d.ts +71 -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/isolatedVerifier.d.ts +40 -0
- package/dist/core/isolatedVerifier.d.ts.map +1 -0
- package/dist/core/isolatedVerifier.js +129 -0
- package/dist/core/isolatedVerifier.js.map +1 -0
- package/dist/core/modelDiscovery.d.ts +101 -0
- package/dist/core/modelDiscovery.d.ts.map +1 -0
- package/dist/core/modelDiscovery.js +780 -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/performanceMonitor.d.ts +124 -0
- package/dist/core/performanceMonitor.d.ts.map +1 -0
- package/dist/core/performanceMonitor.js +195 -0
- package/dist/core/performanceMonitor.js.map +1 -0
- package/dist/core/preferences.d.ts +31 -0
- package/dist/core/preferences.d.ts.map +1 -0
- package/dist/core/preferences.js +232 -0
- package/dist/core/preferences.js.map +1 -0
- package/dist/core/responseVerifier.d.ts +98 -0
- package/dist/core/responseVerifier.d.ts.map +1 -0
- package/dist/core/responseVerifier.js +509 -0
- package/dist/core/responseVerifier.js.map +1 -0
- package/dist/core/resultVerification.d.ts +141 -0
- package/dist/core/resultVerification.d.ts.map +1 -0
- package/dist/core/resultVerification.js +482 -0
- package/dist/core/resultVerification.js.map +1 -0
- package/dist/core/schemaValidator.d.ts +44 -0
- package/dist/core/schemaValidator.d.ts.map +1 -0
- package/dist/core/schemaValidator.js +155 -0
- package/dist/core/schemaValidator.js.map +1 -0
- package/dist/core/secretStore.d.ts +47 -0
- package/dist/core/secretStore.d.ts.map +1 -0
- package/dist/core/secretStore.js +364 -0
- package/dist/core/secretStore.js.map +1 -0
- package/dist/core/sessionStore.d.ts +33 -0
- package/dist/core/sessionStore.d.ts.map +1 -0
- package/dist/core/sessionStore.js +188 -0
- package/dist/core/sessionStore.js.map +1 -0
- package/dist/core/testUtils.d.ts +121 -0
- package/dist/core/testUtils.d.ts.map +1 -0
- package/dist/core/testUtils.js +235 -0
- package/dist/core/testUtils.js.map +1 -0
- package/dist/core/toolPreconditions.d.ts +41 -0
- package/dist/core/toolPreconditions.d.ts.map +1 -0
- package/dist/core/toolPreconditions.js +319 -0
- package/dist/core/toolPreconditions.js.map +1 -0
- package/dist/core/toolRuntime.d.ts +137 -0
- package/dist/core/toolRuntime.d.ts.map +1 -0
- package/dist/core/toolRuntime.js +375 -0
- package/dist/core/toolRuntime.js.map +1 -0
- package/dist/core/toolValidation.d.ts +117 -0
- package/dist/core/toolValidation.d.ts.map +1 -0
- package/dist/core/toolValidation.js +282 -0
- package/dist/core/toolValidation.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 +306 -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/unified/errors.d.ts +189 -0
- package/dist/core/unified/errors.d.ts.map +1 -0
- package/dist/core/unified/errors.js +497 -0
- package/dist/core/unified/errors.js.map +1 -0
- package/dist/core/unified/index.d.ts +19 -0
- package/dist/core/unified/index.d.ts.map +1 -0
- package/dist/core/unified/index.js +68 -0
- package/dist/core/unified/index.js.map +1 -0
- package/dist/core/unified/schema.d.ts +101 -0
- package/dist/core/unified/schema.d.ts.map +1 -0
- package/dist/core/unified/schema.js +350 -0
- package/dist/core/unified/schema.js.map +1 -0
- package/dist/core/unified/toolRuntime.d.ts +179 -0
- package/dist/core/unified/toolRuntime.d.ts.map +1 -0
- package/dist/core/unified/toolRuntime.js +517 -0
- package/dist/core/unified/toolRuntime.js.map +1 -0
- package/dist/core/unified/tools.d.ts +127 -0
- package/dist/core/unified/tools.d.ts.map +1 -0
- package/dist/core/unified/tools.js +1333 -0
- package/dist/core/unified/tools.js.map +1 -0
- package/dist/core/unified/types.d.ts +352 -0
- package/dist/core/unified/types.d.ts.map +1 -0
- package/dist/core/unified/types.js +12 -0
- package/dist/core/unified/types.js.map +1 -0
- package/dist/core/unified/version.d.ts +209 -0
- package/dist/core/unified/version.d.ts.map +1 -0
- package/dist/core/unified/version.js +454 -0
- package/dist/core/unified/version.js.map +1 -0
- package/dist/core/validationRunner.d.ts +93 -0
- package/dist/core/validationRunner.d.ts.map +1 -0
- package/dist/core/validationRunner.js +740 -0
- package/dist/core/validationRunner.js.map +1 -0
- package/dist/headless/headlessApp.d.ts +5 -0
- package/dist/headless/headlessApp.d.ts.map +1 -0
- package/dist/headless/headlessApp.js +189 -0
- package/dist/headless/headlessApp.js.map +1 -0
- package/dist/intelligence/codeIntelligence.d.ts +84 -0
- package/dist/intelligence/codeIntelligence.d.ts.map +1 -0
- package/dist/intelligence/codeIntelligence.js +493 -0
- package/dist/intelligence/codeIntelligence.js.map +1 -0
- package/dist/intelligence/docGenerator.d.ts +86 -0
- package/dist/intelligence/docGenerator.d.ts.map +1 -0
- package/dist/intelligence/docGenerator.js +564 -0
- package/dist/intelligence/docGenerator.js.map +1 -0
- package/dist/intelligence/index.d.ts +51 -0
- package/dist/intelligence/index.d.ts.map +1 -0
- package/dist/intelligence/index.js +253 -0
- package/dist/intelligence/index.js.map +1 -0
- package/dist/intelligence/refactoring.d.ts +50 -0
- package/dist/intelligence/refactoring.d.ts.map +1 -0
- package/dist/intelligence/refactoring.js +354 -0
- package/dist/intelligence/refactoring.js.map +1 -0
- package/dist/intelligence/testGenerator.d.ts +74 -0
- package/dist/intelligence/testGenerator.d.ts.map +1 -0
- package/dist/intelligence/testGenerator.js +483 -0
- package/dist/intelligence/testGenerator.js.map +1 -0
- package/dist/mcp/config.d.ts +8 -0
- package/dist/mcp/config.d.ts.map +1 -0
- package/dist/mcp/config.js +252 -0
- package/dist/mcp/config.js.map +1 -0
- package/dist/mcp/sseClient.d.ts +34 -0
- package/dist/mcp/sseClient.d.ts.map +1 -0
- package/dist/mcp/sseClient.js +299 -0
- package/dist/mcp/sseClient.js.map +1 -0
- package/dist/mcp/stdioClient.d.ts +24 -0
- package/dist/mcp/stdioClient.d.ts.map +1 -0
- package/dist/mcp/stdioClient.js +179 -0
- package/dist/mcp/stdioClient.js.map +1 -0
- package/dist/mcp/toolBridge.d.ts +12 -0
- package/dist/mcp/toolBridge.d.ts.map +1 -0
- package/dist/mcp/toolBridge.js +117 -0
- package/dist/mcp/toolBridge.js.map +1 -0
- package/dist/mcp/types.d.ts +60 -0
- package/dist/mcp/types.d.ts.map +1 -0
- package/dist/mcp/types.js +2 -0
- package/dist/mcp/types.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 +114 -0
- package/dist/plugins/index.js.map +1 -0
- package/dist/plugins/providers/anthropic/index.d.ts +11 -0
- package/dist/plugins/providers/anthropic/index.d.ts.map +1 -0
- package/dist/plugins/providers/anthropic/index.js +38 -0
- package/dist/plugins/providers/anthropic/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 +52 -0
- package/dist/plugins/providers/deepseek/index.js.map +1 -0
- package/dist/plugins/providers/google/index.d.ts +11 -0
- package/dist/plugins/providers/google/index.d.ts.map +1 -0
- package/dist/plugins/providers/google/index.js +40 -0
- package/dist/plugins/providers/google/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 +20 -0
- package/dist/plugins/providers/index.js.map +1 -0
- package/dist/plugins/providers/ollama/index.d.ts +21 -0
- package/dist/plugins/providers/ollama/index.d.ts.map +1 -0
- package/dist/plugins/providers/ollama/index.js +69 -0
- package/dist/plugins/providers/ollama/index.js.map +1 -0
- package/dist/plugins/providers/openai/index.d.ts +12 -0
- package/dist/plugins/providers/openai/index.d.ts.map +1 -0
- package/dist/plugins/providers/openai/index.js +39 -0
- package/dist/plugins/providers/openai/index.js.map +1 -0
- package/dist/plugins/providers/xai/index.d.ts +11 -0
- package/dist/plugins/providers/xai/index.d.ts.map +1 -0
- package/dist/plugins/providers/xai/index.js +39 -0
- package/dist/plugins/providers/xai/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 +9 -0
- package/dist/plugins/tools/agentSpawning/agentSpawningPlugin.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/browser/browserAutomationPlugin.d.ts +14 -0
- package/dist/plugins/tools/browser/browserAutomationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/browser/browserAutomationPlugin.js +26 -0
- package/dist/plugins/tools/browser/browserAutomationPlugin.js.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts +3 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js +14 -0
- package/dist/plugins/tools/checks/localRepoChecksPlugin.js.map +1 -0
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts +3 -0
- package/dist/plugins/tools/cloud/cloudPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/cloud/cloudPlugin.js +14 -0
- package/dist/plugins/tools/cloud/cloudPlugin.js.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js +14 -0
- package/dist/plugins/tools/codeAnalysis/codeAnalysisPlugin.js.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts +3 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js +14 -0
- package/dist/plugins/tools/codeQuality/codeQualityPlugin.js.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts +3 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js +12 -0
- package/dist/plugins/tools/dependency/dependencyPlugin.js.map +1 -0
- package/dist/plugins/tools/development/devPlugin.d.ts +3 -0
- package/dist/plugins/tools/development/devPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/development/devPlugin.js +14 -0
- package/dist/plugins/tools/development/devPlugin.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/email/emailPlugin.d.ts +3 -0
- package/dist/plugins/tools/email/emailPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/email/emailPlugin.js +12 -0
- package/dist/plugins/tools/email/emailPlugin.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/frontendTesting/frontendTestingPlugin.d.ts +3 -0
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js +14 -0
- package/dist/plugins/tools/frontendTesting/frontendTestingPlugin.js.map +1 -0
- package/dist/plugins/tools/glob/globPlugin.d.ts +9 -0
- package/dist/plugins/tools/glob/globPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/glob/globPlugin.js +15 -0
- package/dist/plugins/tools/glob/globPlugin.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/interaction/interactionPlugin.d.ts +3 -0
- package/dist/plugins/tools/interaction/interactionPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/interaction/interactionPlugin.js +12 -0
- package/dist/plugins/tools/interaction/interactionPlugin.js.map +1 -0
- package/dist/plugins/tools/learn/learnPlugin.d.ts +3 -0
- package/dist/plugins/tools/learn/learnPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/learn/learnPlugin.js +14 -0
- package/dist/plugins/tools/learn/learnPlugin.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 +9 -0
- package/dist/plugins/tools/mcp/mcpPlugin.js.map +1 -0
- package/dist/plugins/tools/nodeDefaults.d.ts +2 -0
- package/dist/plugins/tools/nodeDefaults.d.ts.map +1 -0
- package/dist/plugins/tools/nodeDefaults.js +63 -0
- package/dist/plugins/tools/nodeDefaults.js.map +1 -0
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts +9 -0
- package/dist/plugins/tools/notebook/notebookPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/notebook/notebookPlugin.js +15 -0
- package/dist/plugins/tools/notebook/notebookPlugin.js.map +1 -0
- package/dist/plugins/tools/planning/planningPlugin.d.ts +9 -0
- package/dist/plugins/tools/planning/planningPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/planning/planningPlugin.js +15 -0
- package/dist/plugins/tools/planning/planningPlugin.js.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts +3 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.js +12 -0
- package/dist/plugins/tools/refactoring/refactoringPlugin.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 +9 -0
- package/dist/plugins/tools/skills/skillPlugin.js.map +1 -0
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts +3 -0
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js +12 -0
- package/dist/plugins/tools/taskManagement/taskManagementPlugin.js.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts +3 -0
- package/dist/plugins/tools/testing/testingPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/testing/testingPlugin.js +12 -0
- package/dist/plugins/tools/testing/testingPlugin.js.map +1 -0
- package/dist/plugins/tools/validation/validationPlugin.d.ts +3 -0
- package/dist/plugins/tools/validation/validationPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/validation/validationPlugin.js +14 -0
- package/dist/plugins/tools/validation/validationPlugin.js.map +1 -0
- package/dist/plugins/tools/web/webPlugin.d.ts +3 -0
- package/dist/plugins/tools/web/webPlugin.d.ts.map +1 -0
- package/dist/plugins/tools/web/webPlugin.js +12 -0
- package/dist/plugins/tools/web/webPlugin.js.map +1 -0
- package/dist/providers/anthropicProvider.d.ts +41 -0
- package/dist/providers/anthropicProvider.d.ts.map +1 -0
- package/dist/providers/anthropicProvider.js +446 -0
- package/dist/providers/anthropicProvider.js.map +1 -0
- package/dist/providers/googleProvider.d.ts +36 -0
- package/dist/providers/googleProvider.d.ts.map +1 -0
- package/dist/providers/googleProvider.js +312 -0
- package/dist/providers/googleProvider.js.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts +43 -0
- package/dist/providers/openaiChatCompletionsProvider.d.ts.map +1 -0
- package/dist/providers/openaiChatCompletionsProvider.js +468 -0
- package/dist/providers/openaiChatCompletionsProvider.js.map +1 -0
- package/dist/providers/openaiResponsesProvider.d.ts +38 -0
- package/dist/providers/openaiResponsesProvider.d.ts.map +1 -0
- package/dist/providers/openaiResponsesProvider.js +364 -0
- package/dist/providers/openaiResponsesProvider.js.map +1 -0
- package/dist/providers/providerFactory.d.ts +18 -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 +94 -0
- package/dist/providers/resilientProvider.d.ts.map +1 -0
- package/dist/providers/resilientProvider.js +370 -0
- package/dist/providers/resilientProvider.js.map +1 -0
- package/dist/runtime/agentController.d.ts +65 -0
- package/dist/runtime/agentController.d.ts.map +1 -0
- package/dist/runtime/agentController.js +353 -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 +156 -0
- package/dist/runtime/agentHost.js.map +1 -0
- package/dist/runtime/agentSession.d.ts +40 -0
- package/dist/runtime/agentSession.d.ts.map +1 -0
- package/dist/runtime/agentSession.js +206 -0
- package/dist/runtime/agentSession.js.map +1 -0
- package/dist/runtime/browser.d.ts +7 -0
- package/dist/runtime/browser.d.ts.map +1 -0
- package/dist/runtime/browser.js +10 -0
- package/dist/runtime/browser.js.map +1 -0
- package/dist/runtime/cloud.d.ts +7 -0
- package/dist/runtime/cloud.d.ts.map +1 -0
- package/dist/runtime/cloud.js +10 -0
- package/dist/runtime/cloud.js.map +1 -0
- package/dist/runtime/node.d.ts +8 -0
- package/dist/runtime/node.d.ts.map +1 -0
- package/dist/runtime/node.js +11 -0
- package/dist/runtime/node.js.map +1 -0
- package/dist/runtime/universal.d.ts +21 -0
- package/dist/runtime/universal.d.ts.map +1 -0
- package/dist/runtime/universal.js +29 -0
- package/dist/runtime/universal.js.map +1 -0
- package/dist/security/active-stack-security.d.ts +112 -0
- package/dist/security/active-stack-security.d.ts.map +1 -0
- package/dist/security/active-stack-security.js +296 -0
- package/dist/security/active-stack-security.js.map +1 -0
- package/dist/security/advanced-persistence-research.d.ts +92 -0
- package/dist/security/advanced-persistence-research.d.ts.map +1 -0
- package/dist/security/advanced-persistence-research.js +195 -0
- package/dist/security/advanced-persistence-research.js.map +1 -0
- package/dist/security/advanced-targeting.d.ts +119 -0
- package/dist/security/advanced-targeting.d.ts.map +1 -0
- package/dist/security/advanced-targeting.js +233 -0
- package/dist/security/advanced-targeting.js.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts +104 -0
- package/dist/security/assessment/vulnerabilityAssessment.d.ts.map +1 -0
- package/dist/security/assessment/vulnerabilityAssessment.js +315 -0
- package/dist/security/assessment/vulnerabilityAssessment.js.map +1 -0
- package/dist/security/authorization/securityAuthorization.d.ts +88 -0
- package/dist/security/authorization/securityAuthorization.d.ts.map +1 -0
- package/dist/security/authorization/securityAuthorization.js +172 -0
- package/dist/security/authorization/securityAuthorization.js.map +1 -0
- package/dist/security/comprehensive-targeting.d.ts +85 -0
- package/dist/security/comprehensive-targeting.d.ts.map +1 -0
- package/dist/security/comprehensive-targeting.js +438 -0
- package/dist/security/comprehensive-targeting.js.map +1 -0
- package/dist/security/global-security-integration.d.ts +91 -0
- package/dist/security/global-security-integration.d.ts.map +1 -0
- package/dist/security/global-security-integration.js +218 -0
- package/dist/security/global-security-integration.js.map +1 -0
- package/dist/security/index.d.ts +38 -0
- package/dist/security/index.d.ts.map +1 -0
- package/dist/security/index.js +47 -0
- package/dist/security/index.js.map +1 -0
- package/dist/security/persistence-analyzer.d.ts +56 -0
- package/dist/security/persistence-analyzer.d.ts.map +1 -0
- package/dist/security/persistence-analyzer.js +187 -0
- package/dist/security/persistence-analyzer.js.map +1 -0
- package/dist/security/persistence-cli.d.ts +36 -0
- package/dist/security/persistence-cli.d.ts.map +1 -0
- package/dist/security/persistence-cli.js +160 -0
- package/dist/security/persistence-cli.js.map +1 -0
- package/dist/security/persistence-research.d.ts +92 -0
- package/dist/security/persistence-research.d.ts.map +1 -0
- package/dist/security/persistence-research.js +364 -0
- package/dist/security/persistence-research.js.map +1 -0
- package/dist/security/research/persistenceResearch.d.ts +97 -0
- package/dist/security/research/persistenceResearch.d.ts.map +1 -0
- package/dist/security/research/persistenceResearch.js +282 -0
- package/dist/security/research/persistenceResearch.js.map +1 -0
- package/dist/security/security-integration.d.ts +74 -0
- package/dist/security/security-integration.d.ts.map +1 -0
- package/dist/security/security-integration.js +137 -0
- package/dist/security/security-integration.js.map +1 -0
- package/dist/security/security-testing-framework.d.ts +112 -0
- package/dist/security/security-testing-framework.d.ts.map +1 -0
- package/dist/security/security-testing-framework.js +364 -0
- package/dist/security/security-testing-framework.js.map +1 -0
- package/dist/security/simulation/attackSimulation.d.ts +93 -0
- package/dist/security/simulation/attackSimulation.d.ts.map +1 -0
- package/dist/security/simulation/attackSimulation.js +341 -0
- package/dist/security/simulation/attackSimulation.js.map +1 -0
- package/dist/security/strategic-operations.d.ts +100 -0
- package/dist/security/strategic-operations.d.ts.map +1 -0
- package/dist/security/strategic-operations.js +276 -0
- package/dist/security/strategic-operations.js.map +1 -0
- package/dist/security/tool-security-wrapper.d.ts +58 -0
- package/dist/security/tool-security-wrapper.d.ts.map +1 -0
- package/dist/security/tool-security-wrapper.js +156 -0
- package/dist/security/tool-security-wrapper.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 +288 -0
- package/dist/shell/autoExecutor.js.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts +145 -0
- package/dist/shell/claudeCodeStreamHandler.d.ts.map +1 -0
- package/dist/shell/claudeCodeStreamHandler.js +312 -0
- package/dist/shell/claudeCodeStreamHandler.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/fileChangeTracker.d.ts +39 -0
- package/dist/shell/fileChangeTracker.d.ts.map +1 -0
- package/dist/shell/fileChangeTracker.js +64 -0
- package/dist/shell/fileChangeTracker.js.map +1 -0
- package/dist/shell/inputQueueManager.d.ts +144 -0
- package/dist/shell/inputQueueManager.d.ts.map +1 -0
- package/dist/shell/inputQueueManager.js +290 -0
- package/dist/shell/inputQueueManager.js.map +1 -0
- package/dist/shell/interactiveShell.d.ts +321 -0
- package/dist/shell/interactiveShell.d.ts.map +1 -0
- package/dist/shell/interactiveShell.js +3339 -0
- package/dist/shell/interactiveShell.js.map +1 -0
- package/dist/shell/liveStatus.d.ts +29 -0
- package/dist/shell/liveStatus.d.ts.map +1 -0
- package/dist/shell/liveStatus.js +77 -0
- package/dist/shell/liveStatus.js.map +1 -0
- package/dist/shell/shellApp.d.ts +19 -0
- package/dist/shell/shellApp.d.ts.map +1 -0
- package/dist/shell/shellApp.js +364 -0
- package/dist/shell/shellApp.js.map +1 -0
- package/dist/shell/streamingOutputManager.d.ts +114 -0
- package/dist/shell/streamingOutputManager.d.ts.map +1 -0
- package/dist/shell/streamingOutputManager.js +213 -0
- package/dist/shell/streamingOutputManager.js.map +1 -0
- package/dist/shell/systemPrompt.d.ts +3 -0
- package/dist/shell/systemPrompt.d.ts.map +1 -0
- package/dist/shell/systemPrompt.js +78 -0
- package/dist/shell/systemPrompt.js.map +1 -0
- package/dist/shell/taskCompletionDetector.d.ts +106 -0
- package/dist/shell/taskCompletionDetector.d.ts.map +1 -0
- package/dist/shell/taskCompletionDetector.js +402 -0
- package/dist/shell/taskCompletionDetector.js.map +1 -0
- package/dist/shell/terminalInput.d.ts +222 -0
- package/dist/shell/terminalInput.d.ts.map +1 -0
- package/dist/shell/terminalInput.js +1089 -0
- package/dist/shell/terminalInput.js.map +1 -0
- package/dist/shell/terminalInputAdapter.d.ts +121 -0
- package/dist/shell/terminalInputAdapter.d.ts.map +1 -0
- package/dist/shell/terminalInputAdapter.js +223 -0
- package/dist/shell/terminalInputAdapter.js.map +1 -0
- package/dist/shell/updateManager.d.ts +2 -0
- package/dist/shell/updateManager.d.ts.map +1 -0
- package/dist/shell/updateManager.js +111 -0
- package/dist/shell/updateManager.js.map +1 -0
- package/dist/skills/skillRepository.d.ts +103 -0
- package/dist/skills/skillRepository.d.ts.map +1 -0
- package/dist/skills/skillRepository.js +237 -0
- package/dist/skills/skillRepository.js.map +1 -0
- package/dist/skills/types.d.ts +37 -0
- package/dist/skills/types.d.ts.map +1 -0
- package/dist/skills/types.js +2 -0
- package/dist/skills/types.js.map +1 -0
- package/dist/subagents/taskRunner.d.ts +23 -0
- package/dist/subagents/taskRunner.d.ts.map +1 -0
- package/dist/subagents/taskRunner.js +271 -0
- package/dist/subagents/taskRunner.js.map +1 -0
- package/dist/tools/advancedTestGenerationTools.d.ts +21 -0
- package/dist/tools/advancedTestGenerationTools.d.ts.map +1 -0
- package/dist/tools/advancedTestGenerationTools.js +301 -0
- package/dist/tools/advancedTestGenerationTools.js.map +1 -0
- package/dist/tools/backgroundBashTools.d.ts +21 -0
- package/dist/tools/backgroundBashTools.d.ts.map +1 -0
- package/dist/tools/backgroundBashTools.js +215 -0
- package/dist/tools/backgroundBashTools.js.map +1 -0
- package/dist/tools/bashTools.d.ts +8 -0
- package/dist/tools/bashTools.d.ts.map +1 -0
- package/dist/tools/bashTools.js +227 -0
- package/dist/tools/bashTools.js.map +1 -0
- package/dist/tools/browserAutomationTools.d.ts +23 -0
- package/dist/tools/browserAutomationTools.d.ts.map +1 -0
- package/dist/tools/browserAutomationTools.js +916 -0
- package/dist/tools/browserAutomationTools.js.map +1 -0
- package/dist/tools/cloudTools.d.ts +49 -0
- package/dist/tools/cloudTools.d.ts.map +1 -0
- package/dist/tools/cloudTools.js +1258 -0
- package/dist/tools/cloudTools.js.map +1 -0
- package/dist/tools/code-quality-dashboard.d.ts +57 -0
- package/dist/tools/code-quality-dashboard.d.ts.map +1 -0
- package/dist/tools/code-quality-dashboard.js +218 -0
- package/dist/tools/code-quality-dashboard.js.map +1 -0
- package/dist/tools/codeAnalysisTools.d.ts +74 -0
- package/dist/tools/codeAnalysisTools.d.ts.map +1 -0
- package/dist/tools/codeAnalysisTools.js +664 -0
- package/dist/tools/codeAnalysisTools.js.map +1 -0
- package/dist/tools/codeGenerationTools.d.ts +3 -0
- package/dist/tools/codeGenerationTools.d.ts.map +1 -0
- package/dist/tools/codeGenerationTools.js +439 -0
- package/dist/tools/codeGenerationTools.js.map +1 -0
- package/dist/tools/codeQualityTools.d.ts +3 -0
- package/dist/tools/codeQualityTools.d.ts.map +1 -0
- package/dist/tools/codeQualityTools.js +296 -0
- package/dist/tools/codeQualityTools.js.map +1 -0
- package/dist/tools/dependencyTools.d.ts +3 -0
- package/dist/tools/dependencyTools.d.ts.map +1 -0
- package/dist/tools/dependencyTools.js +283 -0
- package/dist/tools/dependencyTools.js.map +1 -0
- package/dist/tools/devTools.d.ts +10 -0
- package/dist/tools/devTools.d.ts.map +1 -0
- package/dist/tools/devTools.js +2305 -0
- package/dist/tools/devTools.js.map +1 -0
- package/dist/tools/diffUtils.d.ts +36 -0
- package/dist/tools/diffUtils.d.ts.map +1 -0
- package/dist/tools/diffUtils.js +528 -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 +419 -0
- package/dist/tools/editTools.js.map +1 -0
- package/dist/tools/emailTools.d.ts +21 -0
- package/dist/tools/emailTools.d.ts.map +1 -0
- package/dist/tools/emailTools.js +449 -0
- package/dist/tools/emailTools.js.map +1 -0
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts +27 -0
- package/dist/tools/enhancedCodeIntelligenceTools.d.ts.map +1 -0
- package/dist/tools/enhancedCodeIntelligenceTools.js +418 -0
- package/dist/tools/enhancedCodeIntelligenceTools.js.map +1 -0
- package/dist/tools/enhancedDevWorkflowTools.d.ts +15 -0
- package/dist/tools/enhancedDevWorkflowTools.d.ts.map +1 -0
- package/dist/tools/enhancedDevWorkflowTools.js +303 -0
- package/dist/tools/enhancedDevWorkflowTools.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 +252 -0
- package/dist/tools/fileTools.js.map +1 -0
- package/dist/tools/frontendTestingTools.d.ts +35 -0
- package/dist/tools/frontendTestingTools.d.ts.map +1 -0
- package/dist/tools/frontendTestingTools.js +1254 -0
- package/dist/tools/frontendTestingTools.js.map +1 -0
- package/dist/tools/globTools.d.ts +15 -0
- package/dist/tools/globTools.d.ts.map +1 -0
- package/dist/tools/globTools.js +174 -0
- package/dist/tools/globTools.js.map +1 -0
- package/dist/tools/grepTools.d.ts +19 -0
- package/dist/tools/grepTools.d.ts.map +1 -0
- package/dist/tools/grepTools.js +339 -0
- package/dist/tools/grepTools.js.map +1 -0
- package/dist/tools/interactionTools.d.ts +13 -0
- package/dist/tools/interactionTools.d.ts.map +1 -0
- package/dist/tools/interactionTools.js +171 -0
- package/dist/tools/interactionTools.js.map +1 -0
- package/dist/tools/learnTools.d.ts +152 -0
- package/dist/tools/learnTools.d.ts.map +1 -0
- package/dist/tools/learnTools.js +1819 -0
- package/dist/tools/learnTools.js.map +1 -0
- package/dist/tools/notebookEditTools.d.ts +15 -0
- package/dist/tools/notebookEditTools.d.ts.map +1 -0
- package/dist/tools/notebookEditTools.js +197 -0
- package/dist/tools/notebookEditTools.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 +95 -0
- package/dist/tools/planningTools.js.map +1 -0
- package/dist/tools/refactoringTools.d.ts +3 -0
- package/dist/tools/refactoringTools.d.ts.map +1 -0
- package/dist/tools/refactoringTools.js +294 -0
- package/dist/tools/refactoringTools.js.map +1 -0
- package/dist/tools/repoChecksTools.d.ts +3 -0
- package/dist/tools/repoChecksTools.d.ts.map +1 -0
- package/dist/tools/repoChecksTools.js +161 -0
- package/dist/tools/repoChecksTools.js.map +1 -0
- package/dist/tools/searchTools.d.ts +3 -0
- package/dist/tools/searchTools.d.ts.map +1 -0
- package/dist/tools/searchTools.js +207 -0
- package/dist/tools/searchTools.js.map +1 -0
- package/dist/tools/skillTools.d.ts +8 -0
- package/dist/tools/skillTools.d.ts.map +1 -0
- package/dist/tools/skillTools.js +178 -0
- package/dist/tools/skillTools.js.map +1 -0
- package/dist/tools/softwareEngineeringTools.d.ts +7 -0
- package/dist/tools/softwareEngineeringTools.d.ts.map +1 -0
- package/dist/tools/softwareEngineeringTools.js +338 -0
- package/dist/tools/softwareEngineeringTools.js.map +1 -0
- package/dist/tools/taskManagementTools.d.ts +10 -0
- package/dist/tools/taskManagementTools.d.ts.map +1 -0
- package/dist/tools/taskManagementTools.js +157 -0
- package/dist/tools/taskManagementTools.js.map +1 -0
- package/dist/tools/testingTools.d.ts +3 -0
- package/dist/tools/testingTools.d.ts.map +1 -0
- package/dist/tools/testingTools.js +233 -0
- package/dist/tools/testingTools.js.map +1 -0
- package/dist/tools/validationTools.d.ts +7 -0
- package/dist/tools/validationTools.d.ts.map +1 -0
- package/dist/tools/validationTools.js +278 -0
- package/dist/tools/validationTools.js.map +1 -0
- package/dist/tools/webTools.d.ts +3 -0
- package/dist/tools/webTools.d.ts.map +1 -0
- package/dist/tools/webTools.js +495 -0
- package/dist/tools/webTools.js.map +1 -0
- package/dist/ui/FixedInputArea.d.ts +108 -0
- package/dist/ui/FixedInputArea.d.ts.map +1 -0
- package/dist/ui/FixedInputArea.js +312 -0
- package/dist/ui/FixedInputArea.js.map +1 -0
- package/dist/ui/ShellUIAdapter.d.ts +141 -0
- package/dist/ui/ShellUIAdapter.d.ts.map +1 -0
- package/dist/ui/ShellUIAdapter.js +680 -0
- package/dist/ui/ShellUIAdapter.js.map +1 -0
- package/dist/ui/UnifiedUIController.d.ts +70 -0
- package/dist/ui/UnifiedUIController.d.ts.map +1 -0
- package/dist/ui/UnifiedUIController.js +190 -0
- package/dist/ui/UnifiedUIController.js.map +1 -0
- package/dist/ui/advancedTheme.d.ts +246 -0
- package/dist/ui/advancedTheme.d.ts.map +1 -0
- package/dist/ui/advancedTheme.js +478 -0
- package/dist/ui/advancedTheme.js.map +1 -0
- package/dist/ui/animation/AnimationScheduler.d.ts +192 -0
- package/dist/ui/animation/AnimationScheduler.d.ts.map +1 -0
- package/dist/ui/animation/AnimationScheduler.js +432 -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/collapsibleContent.d.ts +57 -0
- package/dist/ui/collapsibleContent.d.ts.map +1 -0
- package/dist/ui/collapsibleContent.js +106 -0
- package/dist/ui/collapsibleContent.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 +122 -0
- package/dist/ui/designSystem.js.map +1 -0
- package/dist/ui/diffViewer.d.ts +42 -0
- package/dist/ui/diffViewer.d.ts.map +1 -0
- package/dist/ui/diffViewer.js +343 -0
- package/dist/ui/diffViewer.js.map +1 -0
- package/dist/ui/display.d.ts +251 -0
- package/dist/ui/display.d.ts.map +1 -0
- package/dist/ui/display.js +1170 -0
- package/dist/ui/display.js.map +1 -0
- package/dist/ui/errorFormatter.d.ts +54 -0
- package/dist/ui/errorFormatter.d.ts.map +1 -0
- package/dist/ui/errorFormatter.js +251 -0
- package/dist/ui/errorFormatter.js.map +1 -0
- package/dist/ui/gitDisplay.d.ts +45 -0
- package/dist/ui/gitDisplay.d.ts.map +1 -0
- package/dist/ui/gitDisplay.js +215 -0
- package/dist/ui/gitDisplay.js.map +1 -0
- package/dist/ui/gitFormatter.d.ts +29 -0
- package/dist/ui/gitFormatter.d.ts.map +1 -0
- package/dist/ui/gitFormatter.js +203 -0
- package/dist/ui/gitFormatter.js.map +1 -0
- package/dist/ui/interrupts/InterruptManager.d.ts +142 -0
- package/dist/ui/interrupts/InterruptManager.d.ts.map +1 -0
- package/dist/ui/interrupts/InterruptManager.js +439 -0
- package/dist/ui/interrupts/InterruptManager.js.map +1 -0
- package/dist/ui/keyboardShortcuts.d.ts +49 -0
- package/dist/ui/keyboardShortcuts.d.ts.map +1 -0
- package/dist/ui/keyboardShortcuts.js +128 -0
- package/dist/ui/keyboardShortcuts.js.map +1 -0
- package/dist/ui/layout.d.ts +17 -0
- package/dist/ui/layout.d.ts.map +1 -0
- package/dist/ui/layout.js +140 -0
- package/dist/ui/layout.js.map +1 -0
- package/dist/ui/logFormatter.d.ts +70 -0
- package/dist/ui/logFormatter.d.ts.map +1 -0
- package/dist/ui/logFormatter.js +323 -0
- package/dist/ui/logFormatter.js.map +1 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts +156 -0
- package/dist/ui/orchestration/StatusOrchestrator.d.ts.map +1 -0
- package/dist/ui/orchestration/StatusOrchestrator.js +406 -0
- package/dist/ui/orchestration/StatusOrchestrator.js.map +1 -0
- package/dist/ui/outputMode.d.ts +22 -0
- package/dist/ui/outputMode.d.ts.map +1 -0
- package/dist/ui/outputMode.js +40 -0
- package/dist/ui/outputMode.js.map +1 -0
- package/dist/ui/outputSummarizer.d.ts +52 -0
- package/dist/ui/outputSummarizer.d.ts.map +1 -0
- package/dist/ui/outputSummarizer.js +242 -0
- package/dist/ui/outputSummarizer.js.map +1 -0
- package/dist/ui/progressBar.d.ts +51 -0
- package/dist/ui/progressBar.d.ts.map +1 -0
- package/dist/ui/progressBar.js +153 -0
- package/dist/ui/progressBar.js.map +1 -0
- package/dist/ui/progressIndicator.d.ts +69 -0
- package/dist/ui/progressIndicator.d.ts.map +1 -0
- package/dist/ui/progressIndicator.js +145 -0
- package/dist/ui/progressIndicator.js.map +1 -0
- package/dist/ui/richText.d.ts +6 -0
- package/dist/ui/richText.d.ts.map +1 -0
- package/dist/ui/richText.js +391 -0
- package/dist/ui/richText.js.map +1 -0
- package/dist/ui/shortcutsHelp.d.ts +23 -0
- package/dist/ui/shortcutsHelp.d.ts.map +1 -0
- package/dist/ui/shortcutsHelp.js +89 -0
- package/dist/ui/shortcutsHelp.js.map +1 -0
- package/dist/ui/streamingIndicators.d.ts +42 -0
- package/dist/ui/streamingIndicators.d.ts.map +1 -0
- package/dist/ui/streamingIndicators.js +155 -0
- package/dist/ui/streamingIndicators.js.map +1 -0
- package/dist/ui/tableFormatter.d.ts +31 -0
- package/dist/ui/tableFormatter.d.ts.map +1 -0
- package/dist/ui/tableFormatter.js +186 -0
- package/dist/ui/tableFormatter.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 +103 -0
- package/dist/ui/theme.d.ts.map +1 -0
- package/dist/ui/theme.js +128 -0
- package/dist/ui/theme.js.map +1 -0
- package/dist/ui/thinkingTracker.d.ts +51 -0
- package/dist/ui/thinkingTracker.d.ts.map +1 -0
- package/dist/ui/thinkingTracker.js +115 -0
- package/dist/ui/thinkingTracker.js.map +1 -0
- package/dist/ui/toolDisplay.d.ts +151 -0
- package/dist/ui/toolDisplay.d.ts.map +1 -0
- package/dist/ui/toolDisplay.js +1355 -0
- package/dist/ui/toolDisplay.js.map +1 -0
- package/dist/ui/toolDisplayAdapter.d.ts +66 -0
- package/dist/ui/toolDisplayAdapter.d.ts.map +1 -0
- package/dist/ui/toolDisplayAdapter.js +356 -0
- package/dist/ui/toolDisplayAdapter.js.map +1 -0
- package/dist/ui/treeVisualizer.d.ts +56 -0
- package/dist/ui/treeVisualizer.d.ts.map +1 -0
- package/dist/ui/treeVisualizer.js +247 -0
- package/dist/ui/treeVisualizer.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/errorUtils.d.ts +16 -0
- package/dist/utils/errorUtils.d.ts.map +1 -0
- package/dist/utils/errorUtils.js +66 -0
- package/dist/utils/errorUtils.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 +140 -0
- package/dist/utils/planFormatter.js.map +1 -0
- package/dist/workspace.d.ts +8 -0
- package/dist/workspace.d.ts.map +1 -0
- package/dist/workspace.js +107 -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 +214 -0
- package/dist/workspace.validator.js.map +1 -0
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorUtils.d.ts","sourceRoot":"","sources":["../../src/utils/errorUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,YAAY,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACnB;AAcD,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,OAAO,EACd,OAAO,CAAC,EAAE,YAAY,EACtB,IAAI,CAAC,EAAE,MAAM,GACZ,YAAY,CAWd;AAED,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,YAAY,GAAG,MAAM,CAkBpF;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOxD;AAED,wBAAsB,SAAS,CAAC,CAAC,EAC/B,SAAS,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EAC3B,UAAU,GAAE,MAAU,EACtB,OAAO,GAAE,MAAa,GACrB,OAAO,CAAC,CAAC,CAAC,CAkBZ"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Enhanced error utilities for better debugging and error reporting
|
|
3
|
+
*/
|
|
4
|
+
// Centralized configuration for retryable error patterns
|
|
5
|
+
const RETRYABLE_ERROR_PATTERNS = [
|
|
6
|
+
'timeout',
|
|
7
|
+
'network',
|
|
8
|
+
'rate limit',
|
|
9
|
+
'too many requests',
|
|
10
|
+
'service unavailable',
|
|
11
|
+
'gateway timeout',
|
|
12
|
+
'bad gateway',
|
|
13
|
+
'internal server error',
|
|
14
|
+
];
|
|
15
|
+
export function createErrorDetails(error, context, code) {
|
|
16
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
17
|
+
const stack = error instanceof Error ? error.stack : undefined;
|
|
18
|
+
return {
|
|
19
|
+
message,
|
|
20
|
+
code,
|
|
21
|
+
context,
|
|
22
|
+
stack,
|
|
23
|
+
timestamp: new Date().toISOString(),
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export function formatErrorForLogging(error, context) {
|
|
27
|
+
const details = createErrorDetails(error, context);
|
|
28
|
+
const parts = [
|
|
29
|
+
`[${details.timestamp}]`,
|
|
30
|
+
details.code ? `[${details.code}]` : '',
|
|
31
|
+
details.message,
|
|
32
|
+
];
|
|
33
|
+
if (details.context && Object.keys(details.context).length > 0) {
|
|
34
|
+
parts.push(`Context: ${JSON.stringify(details.context)}`);
|
|
35
|
+
}
|
|
36
|
+
if (details.stack) {
|
|
37
|
+
parts.push(`Stack: ${details.stack}`);
|
|
38
|
+
}
|
|
39
|
+
return parts.filter(Boolean).join(' ');
|
|
40
|
+
}
|
|
41
|
+
export function isRetryableError(error) {
|
|
42
|
+
if (!(error instanceof Error)) {
|
|
43
|
+
return false;
|
|
44
|
+
}
|
|
45
|
+
const message = error.message.toLowerCase();
|
|
46
|
+
return RETRYABLE_ERROR_PATTERNS.some(pattern => message.includes(pattern));
|
|
47
|
+
}
|
|
48
|
+
export async function withRetry(operation, maxRetries = 3, delayMs = 1000) {
|
|
49
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
50
|
+
try {
|
|
51
|
+
return await operation();
|
|
52
|
+
}
|
|
53
|
+
catch (error) {
|
|
54
|
+
// Don't retry if we've exhausted attempts or error is not retryable
|
|
55
|
+
if (attempt === maxRetries || !isRetryableError(error)) {
|
|
56
|
+
throw error;
|
|
57
|
+
}
|
|
58
|
+
// Exponential backoff
|
|
59
|
+
const backoffDelay = delayMs * Math.pow(2, attempt);
|
|
60
|
+
await new Promise(resolve => setTimeout(resolve, backoffDelay));
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
// This should never be reached due to the throw above, but TypeScript needs it
|
|
64
|
+
throw new Error('Retry logic failed unexpectedly');
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=errorUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errorUtils.js","sourceRoot":"","sources":["../../src/utils/errorUtils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAYH,yDAAyD;AACzD,MAAM,wBAAwB,GAAG;IAC/B,SAAS;IACT,SAAS;IACT,YAAY;IACZ,mBAAmB;IACnB,qBAAqB;IACrB,iBAAiB;IACjB,aAAa;IACb,uBAAuB;CACf,CAAC;AAEX,MAAM,UAAU,kBAAkB,CAChC,KAAc,EACd,OAAsB,EACtB,IAAa;IAEb,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAA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C,WAAW,EAAE,CAAC;IAC5C,OAAO,wBAAwB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7E,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAC7B,SAA2B,EAC3B,aAAqB,CAAC,EACtB,UAAkB,IAAI;IAEtB,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,UAAU,EAAE,OAAO,EAAE,EAAE,CAAC;QACvD,IAAI,CAAC;YACH,OAAO,MAAM,SAAS,EAAE,CAAC;QAC3B,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,oEAAoE;YACpE,IAAI,OAAO,KAAK,UAAU,IAAI,CAAC,gBAAgB,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,sBAAsB;YACtB,MAAM,YAAY,GAAG,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;YACpD,MAAM,IAAI,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,CAAC;QAClE,CAAC;IACH,CAAC;IAED,+EAA+E;IAC/E,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type PlanStatus = 'pending' | 'in_progress' | 'completed';
|
|
2
|
+
export interface PlanItem {
|
|
3
|
+
step: string;
|
|
4
|
+
status?: PlanStatus;
|
|
5
|
+
}
|
|
6
|
+
export type NormalizedPlanItem = PlanItem & {
|
|
7
|
+
status: PlanStatus;
|
|
8
|
+
};
|
|
9
|
+
export type PlanInput = Array<PlanItem | string | number | boolean | null | undefined>;
|
|
10
|
+
export interface PlanFormatOptions {
|
|
11
|
+
heading?: string;
|
|
12
|
+
bullet?: string;
|
|
13
|
+
width?: number;
|
|
14
|
+
statusSymbols?: Partial<Record<PlanStatus, string>>;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Format a structured plan for display with compact tree-like layout.
|
|
18
|
+
*/
|
|
19
|
+
export declare function formatPlan(plan: PlanInput, options?: PlanFormatOptions): string;
|
|
20
|
+
export declare function formatPlan(plan: unknown, options?: PlanFormatOptions): string;
|
|
21
|
+
/**
|
|
22
|
+
* Normalize plan input into a typed list of steps with default statuses.
|
|
23
|
+
*/
|
|
24
|
+
export declare function normalizePlanItems(plan: PlanInput): NormalizedPlanItem[];
|
|
25
|
+
export declare function normalizePlanItems(plan: unknown): NormalizedPlanItem[];
|
|
26
|
+
/**
|
|
27
|
+
* Wrap plan text with a prefix, preserving indentation for continuations.
|
|
28
|
+
*/
|
|
29
|
+
export declare function wrapPlanText(text: string, prefix: string, width?: number): string[];
|
|
30
|
+
/**
|
|
31
|
+
* Determine the available plan width using the terminal size if available.
|
|
32
|
+
*/
|
|
33
|
+
export declare function resolvePlanWidth(padding?: number): number | undefined;
|
|
34
|
+
//# sourceMappingURL=planFormatter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planFormatter.d.ts","sourceRoot":"","sources":["../../src/utils/planFormatter.ts"],"names":[],"mappings":"AAKA,MAAM,MAAM,UAAU,GAAG,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC;AAEjE,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,UAAU,CAAC;CACrB;AAED,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAAC;AACnE,MAAM,MAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;AAEvF,MAAM,WAAW,iBAAiB;IAChC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC,CAAC;CACrD;AAED;;GAEG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AACjF,wBAAgB,UAAU,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,MAAM,CAAC;AAuB/E;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,GAAG,kBAAkB,EAAE,CAAC;AAC1E,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,OAAO,GAAG,kBAAkB,EAAE,CAAC;AAyCxE;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAanF;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,MAAU,GAAG,MAAM,GAAG,SAAS,CASxE"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
const ANSI_REGEX = /\u001B\[[0-9;]*m/g;
|
|
2
|
+
const DEFAULT_WIDTH = 78;
|
|
3
|
+
const MIN_WIDTH = 42;
|
|
4
|
+
const MAX_WIDTH = 100;
|
|
5
|
+
export function formatPlan(plan, options = {}) {
|
|
6
|
+
const width = clampWidth(options.width);
|
|
7
|
+
const heading = (options.heading ?? 'Updated Plan').trim() || 'Updated Plan';
|
|
8
|
+
const bullet = (options.bullet ?? '•').trim() || '•';
|
|
9
|
+
const items = normalizePlanItems(plan);
|
|
10
|
+
const lines = [`${bullet} ${heading}`];
|
|
11
|
+
if (!items.length) {
|
|
12
|
+
lines.push(' (no steps provided)');
|
|
13
|
+
return lines.join('\n');
|
|
14
|
+
}
|
|
15
|
+
const statusSymbols = buildStatusSymbols(options.statusSymbols);
|
|
16
|
+
items.forEach((item, index) => {
|
|
17
|
+
const prefix = `${index === 0 ? ' └ ' : ' '}${statusSymbols[item.status]} `;
|
|
18
|
+
lines.push(...wrapPlanText(item.step, prefix, width));
|
|
19
|
+
});
|
|
20
|
+
return lines.join('\n');
|
|
21
|
+
}
|
|
22
|
+
export function normalizePlanItems(plan) {
|
|
23
|
+
if (!Array.isArray(plan)) {
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
const items = [];
|
|
27
|
+
for (const entry of plan) {
|
|
28
|
+
if (entry === null || entry === undefined) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (typeof entry === 'string' || typeof entry === 'number' || typeof entry === 'boolean') {
|
|
32
|
+
const step = String(entry).trim();
|
|
33
|
+
if (!step) {
|
|
34
|
+
continue;
|
|
35
|
+
}
|
|
36
|
+
items.push({ step, status: 'pending' });
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
if (typeof entry === 'object') {
|
|
40
|
+
const rawStep = entry.step;
|
|
41
|
+
const step = typeof rawStep === 'string'
|
|
42
|
+
? rawStep.trim()
|
|
43
|
+
: typeof rawStep === 'number' || typeof rawStep === 'boolean'
|
|
44
|
+
? String(rawStep).trim()
|
|
45
|
+
: '';
|
|
46
|
+
if (!step) {
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
const status = normalizeStatus(entry.status);
|
|
50
|
+
items.push({ step, status });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return items;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Wrap plan text with a prefix, preserving indentation for continuations.
|
|
57
|
+
*/
|
|
58
|
+
export function wrapPlanText(text, prefix, width) {
|
|
59
|
+
const normalizedWidth = clampWidth(width);
|
|
60
|
+
const cleanPrefix = prefix ?? '';
|
|
61
|
+
const prefixLength = visibleLength(cleanPrefix);
|
|
62
|
+
const available = Math.max(12, normalizedWidth - prefixLength);
|
|
63
|
+
const wrapped = wrapText(text, available);
|
|
64
|
+
if (!wrapped.length) {
|
|
65
|
+
return [cleanPrefix.trimEnd()];
|
|
66
|
+
}
|
|
67
|
+
const indent = ' '.repeat(prefixLength);
|
|
68
|
+
return wrapped.map((line, index) => (index === 0 ? `${cleanPrefix}${line}` : `${indent}${line}`));
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Determine the available plan width using the terminal size if available.
|
|
72
|
+
*/
|
|
73
|
+
export function resolvePlanWidth(padding = 4) {
|
|
74
|
+
if (typeof process !== 'undefined' &&
|
|
75
|
+
typeof process.stdout?.columns === 'number' &&
|
|
76
|
+
Number.isFinite(process.stdout.columns)) {
|
|
77
|
+
return Math.max(0, process.stdout.columns - padding);
|
|
78
|
+
}
|
|
79
|
+
return undefined;
|
|
80
|
+
}
|
|
81
|
+
function buildStatusSymbols(overrides) {
|
|
82
|
+
return {
|
|
83
|
+
pending: overrides?.pending?.trim() || '□',
|
|
84
|
+
in_progress: overrides?.in_progress?.trim() || '◐',
|
|
85
|
+
completed: overrides?.completed?.trim() || '✔',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
function normalizeStatus(status) {
|
|
89
|
+
if (typeof status !== 'string') {
|
|
90
|
+
return 'pending';
|
|
91
|
+
}
|
|
92
|
+
const normalized = status.trim().toLowerCase().replace(/[\s-]+/g, '_');
|
|
93
|
+
if (normalized === 'completed' || normalized === 'complete' || normalized === 'done') {
|
|
94
|
+
return 'completed';
|
|
95
|
+
}
|
|
96
|
+
if (normalized === 'in_progress' || normalized === 'inprogress') {
|
|
97
|
+
return 'in_progress';
|
|
98
|
+
}
|
|
99
|
+
return 'pending';
|
|
100
|
+
}
|
|
101
|
+
function wrapText(text, width) {
|
|
102
|
+
const normalized = (text || '').trim();
|
|
103
|
+
if (!normalized) {
|
|
104
|
+
return [];
|
|
105
|
+
}
|
|
106
|
+
const words = normalized.split(/\s+/);
|
|
107
|
+
const lines = [];
|
|
108
|
+
let current = words.shift() ?? '';
|
|
109
|
+
for (const word of words) {
|
|
110
|
+
const candidate = `${current} ${word}`;
|
|
111
|
+
if (visibleLength(candidate) > width && current) {
|
|
112
|
+
lines.push(current);
|
|
113
|
+
current = word;
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
current = candidate;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (current) {
|
|
120
|
+
lines.push(current);
|
|
121
|
+
}
|
|
122
|
+
return lines;
|
|
123
|
+
}
|
|
124
|
+
function clampWidth(width) {
|
|
125
|
+
if (typeof width !== 'number' || !Number.isFinite(width)) {
|
|
126
|
+
return DEFAULT_WIDTH;
|
|
127
|
+
}
|
|
128
|
+
const normalized = Math.floor(width);
|
|
129
|
+
if (normalized < MIN_WIDTH) {
|
|
130
|
+
return MIN_WIDTH;
|
|
131
|
+
}
|
|
132
|
+
if (normalized > MAX_WIDTH) {
|
|
133
|
+
return MAX_WIDTH;
|
|
134
|
+
}
|
|
135
|
+
return normalized;
|
|
136
|
+
}
|
|
137
|
+
function visibleLength(value) {
|
|
138
|
+
return value.replace(ANSI_REGEX, '').length;
|
|
139
|
+
}
|
|
140
|
+
//# sourceMappingURL=planFormatter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"planFormatter.js","sourceRoot":"","sources":["../../src/utils/planFormatter.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,GAAG,mBAAmB,CAAC;AACvC,MAAM,aAAa,GAAG,EAAE,CAAC;AACzB,MAAM,SAAS,GAAG,EAAE,CAAC;AACrB,MAAM,SAAS,GAAG,GAAG,CAAC;AAwBtB,MAAM,UAAU,UAAU,CAAC,IAAa,EAAE,UAA6B,EAAE;IACvE,MAAM,KAAK,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IACxC,MAAM,OAAO,GAAG,CAAC,OAAO,CAAC,OAAO,IAAI,cAAc,CAAC,CAAC,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,CAAC;AACf,CAAC;AAED,SAAS,UAAU,CAAC,KAAc;IAChC,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QACzD,OAAO,aAAa,CAAC;IACvB,CAAC;IACD,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IACrC,IAAI,UAAU,GAAG,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,IAAI,UAAU,GAAG,SAAS,EAAE,CAAC;QAC3B,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAC9C,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface WorkspaceCaptureOptions {
|
|
2
|
+
treeDepth?: number;
|
|
3
|
+
maxEntries?: number;
|
|
4
|
+
docExcerptLimit?: number;
|
|
5
|
+
}
|
|
6
|
+
export declare function resolveWorkspaceCaptureOptions(env?: NodeJS.ProcessEnv): WorkspaceCaptureOptions;
|
|
7
|
+
export declare function buildWorkspaceContext(root: string, options?: WorkspaceCaptureOptions): string | null;
|
|
8
|
+
//# sourceMappingURL=workspace.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.d.ts","sourceRoot":"","sources":["../src/workspace.ts"],"names":[],"mappings":"AAcA,MAAM,WAAW,uBAAuB;IACtC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,8BAA8B,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,uBAAuB,CAM5G;AAED,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,uBAA4B,GAAG,MAAM,GAAG,IAAI,CAiDxG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import { existsSync, readFileSync, readdirSync } from 'node:fs';
|
|
2
|
+
import { join } from 'node:path';
|
|
3
|
+
import { safeWorkspaceContext, validateWorkspaceOptions } from './workspace.validator.js';
|
|
4
|
+
const PRIORITY_DOCS = ['README.md']; // Removed package.json to save context
|
|
5
|
+
const IGNORED_DIRS = new Set([
|
|
6
|
+
'.git', 'node_modules', 'dist', '.erosolar', 'build', 'coverage', '.next', 'out',
|
|
7
|
+
'__pycache__', '.pytest_cache', '.mypy_cache', 'venv', '.venv', 'env',
|
|
8
|
+
'target', 'bin', 'obj', '.idea', '.vscode', '.DS_Store'
|
|
9
|
+
]);
|
|
10
|
+
const DEFAULT_TREE_DEPTH = 1; // Reduced from 2 to 1 for critical context savings
|
|
11
|
+
const DEFAULT_MAX_ENTRIES = 30; // Further reduced from 50 to 30 - emergency reduction
|
|
12
|
+
const DEFAULT_DOC_LIMIT = 200; // Further reduced from 300 to 200 - emergency reduction
|
|
13
|
+
export function resolveWorkspaceCaptureOptions(env = process.env) {
|
|
14
|
+
return {
|
|
15
|
+
treeDepth: parsePositiveInt(env['EROSOLAR_CONTEXT_TREE_DEPTH']),
|
|
16
|
+
maxEntries: parsePositiveInt(env['EROSOLAR_CONTEXT_MAX_ENTRIES']),
|
|
17
|
+
docExcerptLimit: parsePositiveInt(env['EROSOLAR_CONTEXT_DOC_LIMIT']),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
export function buildWorkspaceContext(root, options = {}) {
|
|
21
|
+
// CRITICAL: Validate options BEFORE building context
|
|
22
|
+
const optionsValidation = validateWorkspaceOptions(options);
|
|
23
|
+
if (!optionsValidation.valid) {
|
|
24
|
+
console.error('[Workspace Context] Invalid options:', optionsValidation.errors);
|
|
25
|
+
throw new Error(`Invalid workspace options: ${optionsValidation.errors.join(', ')}`);
|
|
26
|
+
}
|
|
27
|
+
// Log warnings if any
|
|
28
|
+
if (optionsValidation.warnings.length > 0) {
|
|
29
|
+
console.warn('[Workspace Context] Warnings:', optionsValidation.warnings);
|
|
30
|
+
}
|
|
31
|
+
const treeDepth = options.treeDepth ?? DEFAULT_TREE_DEPTH;
|
|
32
|
+
const maxEntries = options.maxEntries ?? DEFAULT_MAX_ENTRIES;
|
|
33
|
+
const docLimit = options.docExcerptLimit ?? DEFAULT_DOC_LIMIT;
|
|
34
|
+
try {
|
|
35
|
+
const treeLines = formatFileTree(root, treeDepth, maxEntries);
|
|
36
|
+
const docSnippets = capturePriorityDocs(root, docLimit);
|
|
37
|
+
// REMOVED: Rulebook duplication - rulebooks are already in system prompt
|
|
38
|
+
const sections = [`cwd: ${root}`, 'files:', ...treeLines];
|
|
39
|
+
if (docSnippets.length) {
|
|
40
|
+
sections.push(docSnippets.join('\n\n'));
|
|
41
|
+
}
|
|
42
|
+
// REMOVED: Rulebook duplication
|
|
43
|
+
// if (rulebooks.length) {
|
|
44
|
+
// sections.push(rulebooks.join('\n\n'));
|
|
45
|
+
// }
|
|
46
|
+
const rawContent = sections.filter((section) => section.trim().length > 0).join('\n');
|
|
47
|
+
// CRITICAL: Validate and enforce limits on final output
|
|
48
|
+
const safe = safeWorkspaceContext(rawContent, {
|
|
49
|
+
truncate: true, // Auto-truncate if too large
|
|
50
|
+
throwOnError: false // Don't throw, just truncate
|
|
51
|
+
});
|
|
52
|
+
// Log stats for monitoring
|
|
53
|
+
if (process.env['DEBUG_CONTEXT']) {
|
|
54
|
+
console.log('[Workspace Context] Stats:', safe.stats);
|
|
55
|
+
}
|
|
56
|
+
return safe.content;
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
60
|
+
return `Workspace context unavailable (${message}).`;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
function capturePriorityDocs(root, docLimit) {
|
|
64
|
+
return PRIORITY_DOCS.filter((name) => existsSync(join(root, name))).map((name) => {
|
|
65
|
+
try {
|
|
66
|
+
const content = readFileSync(join(root, name), 'utf8');
|
|
67
|
+
// Safety: Hard limit to prevent context explosion
|
|
68
|
+
const safeLimit = Math.min(docLimit, 300);
|
|
69
|
+
const snippet = content.length > safeLimit ? `${content.slice(0, safeLimit)}\n...` : content;
|
|
70
|
+
return `--- ${name} ---\n${snippet.trim()}`;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
return `--- ${name} ---\n[Could not read file]`;
|
|
74
|
+
}
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function formatFileTree(root, maxDepth, maxEntries) {
|
|
78
|
+
const lines = [];
|
|
79
|
+
const walk = (dir, depth, prefix) => {
|
|
80
|
+
if (depth > maxDepth || lines.length >= maxEntries) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
const entries = readdirSync(dir, { withFileTypes: true })
|
|
84
|
+
.filter((entry) => !IGNORED_DIRS.has(entry.name))
|
|
85
|
+
.sort((a, b) => a.name.localeCompare(b.name));
|
|
86
|
+
for (const entry of entries) {
|
|
87
|
+
if (lines.length >= maxEntries) {
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
const isDir = entry.isDirectory();
|
|
91
|
+
lines.push(`${prefix}${entry.name}${isDir ? '/' : ''}`);
|
|
92
|
+
if (isDir && depth < maxDepth) {
|
|
93
|
+
walk(join(dir, entry.name), depth + 1, `${prefix} `);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
};
|
|
97
|
+
walk(root, 0, '');
|
|
98
|
+
return lines;
|
|
99
|
+
}
|
|
100
|
+
function parsePositiveInt(raw) {
|
|
101
|
+
if (!raw) {
|
|
102
|
+
return undefined;
|
|
103
|
+
}
|
|
104
|
+
const value = Number.parseInt(raw, 10);
|
|
105
|
+
return Number.isFinite(value) && value > 0 ? value : undefined;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=worksp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AAM,IAAI,CAAC,CAAC;YACxD,CAAC;QACH,CAAC;IACH,CAAC,CAAC;IAEF,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IAClB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,SAAS,gBAAgB,CAAC,GAAY;IACpC,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;IACvC,OAAO,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace Context Validator - Enforces strict safety limits
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL: Prevents context explosion by validating all workspace context
|
|
5
|
+
* before it's sent to the LLM. Multiple safety layers ensure we never
|
|
6
|
+
* exceed token limits.
|
|
7
|
+
*/
|
|
8
|
+
export interface ValidationResult {
|
|
9
|
+
valid: boolean;
|
|
10
|
+
errors: string[];
|
|
11
|
+
warnings: string[];
|
|
12
|
+
stats: ContextStats;
|
|
13
|
+
}
|
|
14
|
+
export interface ContextStats {
|
|
15
|
+
totalChars: number;
|
|
16
|
+
totalLines: number;
|
|
17
|
+
estimatedTokens: number;
|
|
18
|
+
fileEntries: number;
|
|
19
|
+
docChars: number;
|
|
20
|
+
}
|
|
21
|
+
export interface WorkspaceContextSafe {
|
|
22
|
+
content: string;
|
|
23
|
+
stats: ContextStats;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Validate workspace context options BEFORE building context
|
|
27
|
+
*/
|
|
28
|
+
export declare function validateWorkspaceOptions(options: {
|
|
29
|
+
treeDepth?: number;
|
|
30
|
+
maxEntries?: number;
|
|
31
|
+
docExcerptLimit?: number;
|
|
32
|
+
}): ValidationResult;
|
|
33
|
+
/**
|
|
34
|
+
* Validate workspace context AFTER building - CRITICAL SAFETY CHECK
|
|
35
|
+
* This is the final line of defense against context explosion
|
|
36
|
+
*/
|
|
37
|
+
export declare function validateWorkspaceContext(content: string): ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Safe truncation - if content exceeds limits, truncate intelligently
|
|
40
|
+
*/
|
|
41
|
+
export declare function truncateWorkspaceContext(content: string): WorkspaceContextSafe;
|
|
42
|
+
/**
|
|
43
|
+
* Validate and enforce limits in a single call - RECOMMENDED USAGE
|
|
44
|
+
*/
|
|
45
|
+
export declare function safeWorkspaceContext(content: string | null, options?: {
|
|
46
|
+
truncate?: boolean;
|
|
47
|
+
throwOnError?: boolean;
|
|
48
|
+
}): WorkspaceContextSafe;
|
|
49
|
+
//# sourceMappingURL=workspace.validator.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workspace.validator.d.ts","sourceRoot":"","sources":["../src/workspace.validator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,EAAE,YAAY,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,eAAe,EAAE,MAAM,CAAC;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,YAAY,CAAC;CACrB;AASD;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE;IAChD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,GAAG,gBAAgB,CAuDnB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAuE1E;AAED;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,oBAAoB,CA2C9E;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,MAAM,GAAG,IAAI,EACtB,OAAO,CAAC,EAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GACvD,oBAAoB,CAiDtB"}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Workspace Context Validator - Enforces strict safety limits
|
|
3
|
+
*
|
|
4
|
+
* CRITICAL: Prevents context explosion by validating all workspace context
|
|
5
|
+
* before it's sent to the LLM. Multiple safety layers ensure we never
|
|
6
|
+
* exceed token limits.
|
|
7
|
+
*/
|
|
8
|
+
import { ContextOverflowError, ResourceLimitError } from './core/errors/errorTypes.js';
|
|
9
|
+
// ABSOLUTE MAXIMUM LIMITS - Never exceed these under any circumstances
|
|
10
|
+
const ABSOLUTE_MAX_CHARS = 5000; // ~1,250 tokens (4 chars per token)
|
|
11
|
+
const ABSOLUTE_MAX_LINES = 100; // Maximum lines in any context
|
|
12
|
+
const ABSOLUTE_MAX_FILE_ENTRIES = 50; // Maximum files in tree
|
|
13
|
+
const ABSOLUTE_MAX_DOC_CHARS = 300; // Maximum chars per priority doc
|
|
14
|
+
const WARNING_THRESHOLD = 0.7; // Warn at 70% of max
|
|
15
|
+
/**
|
|
16
|
+
* Estimate token count (rough: 1 token ≈ 4 characters)
|
|
17
|
+
*/
|
|
18
|
+
function estimateTokens(text) {
|
|
19
|
+
return Math.ceil(text.length / 4);
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Validate workspace context options BEFORE building context
|
|
23
|
+
*/
|
|
24
|
+
export function validateWorkspaceOptions(options) {
|
|
25
|
+
const errors = [];
|
|
26
|
+
const warnings = [];
|
|
27
|
+
// Validate tree depth
|
|
28
|
+
if (options.treeDepth !== undefined) {
|
|
29
|
+
if (options.treeDepth < 0) {
|
|
30
|
+
errors.push('treeDepth cannot be negative');
|
|
31
|
+
}
|
|
32
|
+
if (options.treeDepth > 2) {
|
|
33
|
+
errors.push(`treeDepth ${options.treeDepth} exceeds maximum of 2`);
|
|
34
|
+
}
|
|
35
|
+
if (options.treeDepth > 1) {
|
|
36
|
+
warnings.push('treeDepth > 1 can significantly increase context size');
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
// Validate max entries
|
|
40
|
+
if (options.maxEntries !== undefined) {
|
|
41
|
+
if (options.maxEntries < 0) {
|
|
42
|
+
errors.push('maxEntries cannot be negative');
|
|
43
|
+
}
|
|
44
|
+
if (options.maxEntries > ABSOLUTE_MAX_FILE_ENTRIES) {
|
|
45
|
+
errors.push(`maxEntries ${options.maxEntries} exceeds maximum of ${ABSOLUTE_MAX_FILE_ENTRIES}`);
|
|
46
|
+
}
|
|
47
|
+
if (options.maxEntries > 40) {
|
|
48
|
+
warnings.push('maxEntries > 40 may use significant context');
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
// Validate doc excerpt limit
|
|
52
|
+
if (options.docExcerptLimit !== undefined) {
|
|
53
|
+
if (options.docExcerptLimit < 0) {
|
|
54
|
+
errors.push('docExcerptLimit cannot be negative');
|
|
55
|
+
}
|
|
56
|
+
if (options.docExcerptLimit > ABSOLUTE_MAX_DOC_CHARS) {
|
|
57
|
+
errors.push(`docExcerptLimit ${options.docExcerptLimit} exceeds maximum of ${ABSOLUTE_MAX_DOC_CHARS}`);
|
|
58
|
+
}
|
|
59
|
+
if (options.docExcerptLimit > 250) {
|
|
60
|
+
warnings.push('docExcerptLimit > 250 may use significant context');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
return {
|
|
64
|
+
valid: errors.length === 0,
|
|
65
|
+
errors,
|
|
66
|
+
warnings,
|
|
67
|
+
stats: {
|
|
68
|
+
totalChars: 0,
|
|
69
|
+
totalLines: 0,
|
|
70
|
+
estimatedTokens: 0,
|
|
71
|
+
fileEntries: options.maxEntries ?? 0,
|
|
72
|
+
docChars: options.docExcerptLimit ?? 0,
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Validate workspace context AFTER building - CRITICAL SAFETY CHECK
|
|
78
|
+
* This is the final line of defense against context explosion
|
|
79
|
+
*/
|
|
80
|
+
export function validateWorkspaceContext(content) {
|
|
81
|
+
const errors = [];
|
|
82
|
+
const warnings = [];
|
|
83
|
+
// Count basic metrics
|
|
84
|
+
const totalChars = content.length;
|
|
85
|
+
const lines = content.split('\n');
|
|
86
|
+
const totalLines = lines.length;
|
|
87
|
+
const estimatedTokens = estimateTokens(content);
|
|
88
|
+
// Count file entries (lines that look like file paths)
|
|
89
|
+
const fileEntries = lines.filter(line => line.trim() && !line.startsWith('---') && !line.startsWith('cwd:')).length;
|
|
90
|
+
// Count chars in priority docs section
|
|
91
|
+
const docMatch = content.match(/--- .* ---[\s\S]*?(?=\n\n|$)/g);
|
|
92
|
+
const docChars = docMatch ? docMatch.join('').length : 0;
|
|
93
|
+
const stats = {
|
|
94
|
+
totalChars,
|
|
95
|
+
totalLines,
|
|
96
|
+
estimatedTokens,
|
|
97
|
+
fileEntries,
|
|
98
|
+
docChars,
|
|
99
|
+
};
|
|
100
|
+
// CRITICAL: Check absolute maximum character limit
|
|
101
|
+
if (totalChars > ABSOLUTE_MAX_CHARS) {
|
|
102
|
+
const error = new ContextOverflowError(totalChars, ABSOLUTE_MAX_CHARS, 'chars', true);
|
|
103
|
+
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
104
|
+
}
|
|
105
|
+
// CRITICAL: Check absolute maximum line limit
|
|
106
|
+
if (totalLines > ABSOLUTE_MAX_LINES) {
|
|
107
|
+
const error = new ContextOverflowError(totalLines, ABSOLUTE_MAX_LINES, 'lines', true);
|
|
108
|
+
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
109
|
+
}
|
|
110
|
+
// CRITICAL: Check absolute maximum file entries
|
|
111
|
+
if (fileEntries > ABSOLUTE_MAX_FILE_ENTRIES) {
|
|
112
|
+
const error = new ResourceLimitError('file entries', fileEntries, ABSOLUTE_MAX_FILE_ENTRIES, false);
|
|
113
|
+
errors.push(`Context exceeds ABSOLUTE maximum: ${error.message}`);
|
|
114
|
+
}
|
|
115
|
+
// WARNING: Approaching limits
|
|
116
|
+
if (totalChars > ABSOLUTE_MAX_CHARS * WARNING_THRESHOLD) {
|
|
117
|
+
warnings.push(`Context size ${totalChars} chars is ${Math.round(totalChars / ABSOLUTE_MAX_CHARS * 100)}% of maximum. ` +
|
|
118
|
+
`Consider reducing treeDepth, maxEntries, or docExcerptLimit.`);
|
|
119
|
+
}
|
|
120
|
+
if (estimatedTokens > 1000) {
|
|
121
|
+
warnings.push(`Estimated ${estimatedTokens} tokens in workspace context. This is high and may impact performance.`);
|
|
122
|
+
}
|
|
123
|
+
return {
|
|
124
|
+
valid: errors.length === 0,
|
|
125
|
+
errors,
|
|
126
|
+
warnings,
|
|
127
|
+
stats,
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Safe truncation - if content exceeds limits, truncate intelligently
|
|
132
|
+
*/
|
|
133
|
+
export function truncateWorkspaceContext(content) {
|
|
134
|
+
const validation = validateWorkspaceContext(content);
|
|
135
|
+
// If valid, return as-is
|
|
136
|
+
if (validation.valid) {
|
|
137
|
+
return {
|
|
138
|
+
content,
|
|
139
|
+
stats: validation.stats,
|
|
140
|
+
};
|
|
141
|
+
}
|
|
142
|
+
// CRITICAL: Content exceeds limits, must truncate
|
|
143
|
+
const lines = content.split('\n');
|
|
144
|
+
const truncatedLines = [];
|
|
145
|
+
let charCount = 0;
|
|
146
|
+
// Keep up to absolute maximums
|
|
147
|
+
for (const line of lines) {
|
|
148
|
+
if (truncatedLines.length >= ABSOLUTE_MAX_LINES) {
|
|
149
|
+
break;
|
|
150
|
+
}
|
|
151
|
+
if (charCount + line.length > ABSOLUTE_MAX_CHARS) {
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
truncatedLines.push(line);
|
|
155
|
+
charCount += line.length + 1; // +1 for newline
|
|
156
|
+
}
|
|
157
|
+
// Add truncation notice
|
|
158
|
+
if (truncatedLines.length < lines.length) {
|
|
159
|
+
truncatedLines.push('');
|
|
160
|
+
truncatedLines.push('[Workspace context truncated to prevent context overflow]');
|
|
161
|
+
truncatedLines.push(`[Showing ${truncatedLines.length} of ${lines.length} lines]`);
|
|
162
|
+
}
|
|
163
|
+
const truncatedContent = truncatedLines.join('\n');
|
|
164
|
+
const stats = validateWorkspaceContext(truncatedContent).stats;
|
|
165
|
+
return {
|
|
166
|
+
content: truncatedContent,
|
|
167
|
+
stats,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Validate and enforce limits in a single call - RECOMMENDED USAGE
|
|
172
|
+
*/
|
|
173
|
+
export function safeWorkspaceContext(content, options) {
|
|
174
|
+
const { truncate = true, throwOnError = false } = options ?? {};
|
|
175
|
+
if (!content) {
|
|
176
|
+
return {
|
|
177
|
+
content: '',
|
|
178
|
+
stats: {
|
|
179
|
+
totalChars: 0,
|
|
180
|
+
totalLines: 0,
|
|
181
|
+
estimatedTokens: 0,
|
|
182
|
+
fileEntries: 0,
|
|
183
|
+
docChars: 0,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
}
|
|
187
|
+
const validation = validateWorkspaceContext(content);
|
|
188
|
+
// Log warnings to console
|
|
189
|
+
if (validation.warnings.length > 0) {
|
|
190
|
+
console.warn('[Workspace Context Validator] Warnings:');
|
|
191
|
+
for (const warning of validation.warnings) {
|
|
192
|
+
console.warn(` - ${warning}`);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
// Handle errors
|
|
196
|
+
if (!validation.valid) {
|
|
197
|
+
console.error('[Workspace Context Validator] CRITICAL ERRORS:');
|
|
198
|
+
for (const error of validation.errors) {
|
|
199
|
+
console.error(` - ${error}`);
|
|
200
|
+
}
|
|
201
|
+
if (throwOnError) {
|
|
202
|
+
throw new Error(`Workspace context validation failed:\n${validation.errors.join('\n')}`);
|
|
203
|
+
}
|
|
204
|
+
if (truncate) {
|
|
205
|
+
console.warn('[Workspace Context Validator] Auto-truncating to safe limits...');
|
|
206
|
+
return truncateWorkspaceContext(content);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return {
|
|
210
|
+
content,
|
|
211
|
+
stats: validation.stats,
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=workspace.validator.js.map
|